1. print_r debugging on steroids.

    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();
        }
    }
    
  2. So, after a long long period of pure-html, I&#8217;ve started applying some style to this blog. You may not have noticed, well, you haven&#8217;t noticed. But hey, have an image to show what it should look like when I&#8217;m done.
I hope to finish this by tonight. 

    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. 

    HD
  3. AppSumo now has a contest to win Photoshop for life. Interesting deal! http://appsumo.com/~4QVB #Design #Designer #Photoshop #Contest #freestuff

  4. 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)


  5. Crossmediaplatformpost activate! Testing #Diaspora features!

  6. Great Success!

    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!

  7. What would you do?

    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?

    Tags

  8. I have started!

    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. 

  9. I’m sorry but I don’t want to be an Emperor, that’s not my business. I don’t want to rule or conquer anyone. I should like to help everyone if possible, Jew, gentile, black man, white. We all want to help one another, human beings are like that. We want to live by each other’s happiness, not by each other’s misery. We don’t want to hate and despise one another. In this world there is room for everyone and the good earth is rich and can provide for everyone. The way of life can be free and beautiful. But we have lost the way. Greed has poisoned men’s souls, has barricaded the world with hate; has goose-stepped us into misery and bloodshed. We have developed speed but we have shut ourselves in. Machinery that gives abundance has left us in want. Our knowledge has made us cynical, our cleverness hard and unkind. We think too much and feel too little. More than machinery we need humanity. More than cleverness we need kindness and gentleness. Without these qualities, life will be violent and all will be lost. The aeroplane and the radio have brought us closer together. The very nature of these inventions cries out for the goodness in men, cries out for universal brotherhood, for the unity of us all. Even now my voice is reaching millions throughout the world, millions of despairing men, women and little children, victims of a system that makes men torture and imprison innocent people. To those who can hear me I say “Do not despair”. The misery that is now upon us is but the passing of greed, the bitterness of men who fear the way of human progress: the hate of men will pass and dictators die and the power they took from the people, will return to the people and so long as men die liberty will never perish. Soldiers: don’t give yourselves to brutes, men who despise you, enslave you, who regiment your lives, tell you what to do, what to think and what to feel, who drill you, diet you, treat you like cattle, use you as cannon fodder. Don’t give yourselves to these unnatural men, machine men, with machine minds and machine hearts. You are not machines. You are not cattle. You are men. You have the love of humanity in your hearts. You don’t hate, only the unloved hate. Only the unloved and the unnatural. Soldiers: don’t fight for slavery, fight for liberty. In the seventeenth chapter of Saint Luke it is written: “The kingdom of God is within man” Not one man, nor a group of men, but in all men; in you, you the people have the power, the power to create machines, the power to create happiness. You the people have the power to make life free and beautiful, to make this life a wonderful adventure. Then in the name of democracy let us use that power, let us all unite. Let us fight for a new world, a decent world that will give men a chance to work, that will give youth a future, and old aged security. By the promise of these things, brutes have risen to power, but they lie. They do not fulfill that promise, they never will. Dictators free themselves but they enslave the people. Now let us fight to fulfill that promise. Let us fight to free the world, to do away with national barriers, do away with greed, with hate and intolerance. Let us fight for a world of reason, a world where science and progress will lead to all men’s happiness. Soldiers! In the name of democracy, let us all unite! Charlie Chaplin in The Great Dictator.
  10. In light of the current riots all over the world, I have this to say:

    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”

  11. I promise:

    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.

  12. This.

  13. Okay, how about another update.
A new school assignment! Joy, happiness! This time we&#8217;re diving into blog/wordpress design! Currently, at the time, now, for a while, this is my idea/concept.
I&#8217;ll probably try and make it my tumblr design too. I think.

    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