All of us sometimes print values to the screen, for debugging purposes. I like it neat and organised. This has been done a dozen times by now, but I might as well share my take on it. Thanks to stackoverflow for the var-name issue.
If you can improve, please do so.
[EDIT] Added a $die param. If true, function call die(); after printing, else nothing.
function showMe($die = true) {
if ($_SERVER['REMOTE_ADDR'] == 'YOUR IP GOES HERE') {
$start = microtime(true);
$arguments = func_get_args();
$debug = debug_backtrace();
// Clean up the debug.
$location = $debug[0]['file'];
$location = str_replace(DIR_FS_CATALOG, '/', $location);
$location .= ', line ' . $debug[0]['line'];
// Thanks to http://stackoverflow.com/users/6521/paul-dixon for this way of getting var names.
if (isset($debug[0]['file']))
{
$lines = file($debug[0]['file']);
$line = $lines[$debug[0]['line']-1];
$expr = $line;
$expr = preg_replace('/\s*showMe\(/i','', $expr);
$expr = preg_replace('/\);\s*/', '', $expr);
$expr = str_replace(' ', '', $expr);
$expr = explode(',', $expr);
}
echo '<pre>';
$i = 0;
echo 'Printing from ' . $location;
echo '<br />';
foreach ($arguments as $argument) {
if (is_bool($argument)) {
if ($argument) {
$argument = 'true';
} else {
$argument = 'false';
}
}
echo '<br />###> '. $expr[$i] .' <###<br />';
print_r($argument);
echo '<br />';
$i++;
}
$end = microtime(true);
$parse = $end - $start;
echo '<br/><br/>';
echo 'LISTED IN:'.$parse;
echo '</pre>';
if ($die) {
die();
}
} }
So, after a long long period of pure-html, I’ve started applying some style to this blog. You may not have noticed, well, you haven’t noticed. But hey, have an image to show what it should look like when I’m done.
I hope to finish this by tonight.
HDAppSumo now has a contest to win Photoshop for life. Interesting deal! http://appsumo.com/~4QVB #Design #Designer #Photoshop #Contest #freestuff
I wrote some #PHP. It’s really basic, checks a folder for images, and chooses a random one to display as the background. Experimenting/tinkering.
http://student.devine.be/boris.wintein/
(Can induce seizures sometimes)

Crossmediaplatformpost activate! Testing #Diaspora features!
I got blocked from Facebook, again. Does this ever end? And they are not willing to delete my information either. Oh well, I see the sun rising over the revolution, so does it really matter any longer who has some data about me? And do I really care about it? Okay, Facebook and Global Culprits, I like being an Anarchist, I like opposing authority, I like psychedelics and other mind-altering substances. You got me.
Anyway, I decided to now spill all my useless information, and diary logs onto Google+. Which is not blocking me since well, it is Google+. Their terms of use and agreement are also far more interesting than those of Facebook, and with interesting I mean respectful, and with respectful I mean fuck Facebook. Am I part of the cool guys club yet?
Now, the title isn’t referring to these two paragraphs at all. No, it’s referring to the fact that I did what my parents did, and got a job. I am now a webdesigner employed by ABO-Service, starting Wednesday at 8.30 o’ clock. I’m looking forward to it, these months of vacation have slowed me down in a way, and I’m less witty than I was in a previous life. So to speak.
Oh, and I found this pair of amazing eyes, beautiful lips, a soft voice, a glistening diamond, a darling, a real treasure, an angel, a princess. I am really happy today, and have been since friday/saturday. What a night to remember.
Oh, and I should seriously get going with this lay-out. I have a design, but I’m doubting about using it. I need something new. Sorry, this will probably take a while, but I simply don’t want anything crappy representing me. And simple html with no css whatsoever is really oldskool. So that’s definitely ok!
Ladies and Gentleman of the internet, I have a message for you!
I’m writing some PHP, for a portfolio, to refresh the skill, and just because I like the dynamic powers. I’ve written 3 different approaches to getting content, using the Smarty Template Engine, and now I’m doubting, which one would you choose and use?
The foreach uses an Array which is dynamically created reading the dir in which the pages are stored, resulting in filename+extension=>filename. I prefer this method because of the freedom it gives, I can easily just add another page in that directory, and it would be immediately be a page.
function getContent($page) {
global $smarty, $pages, $path, $default;
$content = false;
// Ye good ol’ switch-case
switch ($page) {
default:
case ‘home’:
$content = $smarty->fetch(‘pages/home.tpl’);
break;
case ‘portfolio’:
$content = $smarty->fetch(‘pages/portfolio.tpl’);
break;
case ‘contact’:
$content = $smarty->fetch(‘pages/contact.tpl’);
break;
}
// Using a foreach:
foreach ($pages as $filename=>$probPage) {
if ($page == $probPage) {
$content = $smarty->fetch($path + $filename);
}
}
// Additional default clause.
if (!$content) {
$content = $smarty->fetch($default);
}
// Using a if statement
if ($page == ‘home’ || $page == ‘portfolio’ || $page == ‘contact’) {
$content = $smarty->fetch($path + $page + ‘.tpl’);
} else {
$content = $smarty->fetch(‘pages/home.tpl’);
}
return $content;
}
So people, what would you do?
I just created the basic HTML structure of a new lay-out. Since I know understand how it all works (all the tags and so forth), I’ll develop way faster, and maybe even succeed at finishing.
I’ll try and finish this tomorrow, now it’s time for bed. It’s 5:43AM you see.
Good evening, London. Allow me first to apologize for this interruption. I do, like many of you, appreciate the comforts of every day routine- the security of the familiar, the tranquility of repetition. I enjoy them as much as any bloke. But in the spirit of commemoration, thereby those important events of the past usually associated with someone’s death or the end of some awful bloody struggle, a celebration of a nice holiday, I thought we could mark this November the 5th, a day that is sadly no longer remembered, by taking some time out of our daily lives to sit down and have a little chat. There are of course those who do not want us to speak. I suspect even now, orders are being shouted into telephones, and men with guns will soon be on their way. Why? Because while the truncheon may be used in lieu of conversation, words will always retain their power. Words offer the means to meaning, and for those who will listen, the enunciation of truth. And the truth is, there is something terribly wrong with this country, isn’t there? Cruelty and injustice, intolerance and oppression. And where once you had the freedom to object, to think and speak as you saw fit, you now have censors and systems of surveillance coercing your conformity and soliciting your submission. How did this happen? Who’s to blame? Well certainly there are those more responsible than others, and they will be held accountable, but again truth be told, if you’re looking for the guilty, you need only look into a mirror. I know why you did it. I know you were afraid. Who wouldn’t be? War, terror, disease. There were a myriad of problems which conspired to corrupt your reason and rob you of your common sense. Fear got the best of you, and in your panic you turned to the now high chancellor, Adam Sutler. He promised you order, he promised you peace, and all he demanded in return was your silent, obedient consent. Last night I sought to end that silence. Last night I destroyed the Old Bailey, to remind this country of what it has forgotten. More than four hundred years ago a great citizen wished to embed the fifth of November forever in our memory. His hope was to remind the world that fairness, justice, and freedom are more than words, they are perspectives. So if you’ve seen nothing, if the crimes of this government remain unknown to you then I would suggest you allow the fifth of November to pass unmarked. But if you see what I see, if you feel as I feel, and if you would seek as I seek, then I ask you to stand beside me one year from tonight, outside the gates of Parliament, and together we shall give them a fifth of November that shall never, ever be forgot.
- V in “V for Vendetta”
That I’ll be more active in the future. Blogging just is kinda hard, in a way. I’m just way to forgetful for these things. I have a lot to say, nobody is listening, and writing would be the perfect outlet. But still.
Writing isn’t that easy, nor remembering to write.
Maybe I should just put Tumblr as my start-page, that should fix it, or at least give me an extra push to blog more.
This.
I made a this.
http://student.devine.be/boris.wintein/2010-2011/FD/Rebus/1DEV5_WinteinBoris_FD_REBUS.swf
ITS FLASH MOTHAFOCKA
HD
Okay, how about another update.
A new school assignment! Joy, happiness! This time we’re diving into blog/wordpress design! Currently, at the time, now, for a while, this is my idea/concept.
I’ll probably try and make it my tumblr design too. I think.
HD