<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-16217904-1");
pageTracker._trackPageview();
} catch(err) {}
Leon Weidauer, Zend Certified Engineer

Visit techpriester.net for more …</description><title>Techpriester::blog()</title><generator>Tumblr (3.0; @techpriester)</generator><link>http://techpriester.tumblr.com/</link><item><title>Name that code - Online programming quiz</title><description>&lt;p&gt;&lt;a href="http://www.oneplusyou.com/q/v/code" target="_blank"&gt;&lt;img alt="Name" src="http://www.oneplusyou.com/q/img/badges/code_100.jpg" border="0"/&gt;&lt;/a&gt;&lt;br/&gt;Created by OnePlusYou - &lt;a href="http://www.oneplusyou.com" target="_blank"&gt;Free Dating Sites&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It’s a bit too easy, but fun anyway …&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/963108448</link><guid>http://techpriester.tumblr.com/post/963108448</guid><pubDate>Mon, 16 Aug 2010 17:47:00 +0200</pubDate><category>quiz</category><category>game</category></item><item><title>Thingler</title><description>&lt;a href="http://thingler.com/"&gt;Thingler&lt;/a&gt;: &lt;p&gt;A really simplified collaborative todo list written entirely in JavaScript using node.js and CouchDB.&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/912844330</link><guid>http://techpriester.tumblr.com/post/912844330</guid><pubDate>Fri, 06 Aug 2010 16:26:33 +0200</pubDate><category>node.js</category><category>couchdb</category><category>todo</category><category>tool</category></item><item><title>9 Notes for Developers</title><description>&lt;p&gt;&lt;a href="http://fuckyeahcomputerscience.tumblr.com/post/893050526/9-notes-for-developers" target="_blank"&gt;fuckyeahcomputerscience&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://wedothin.gs/post/885831429/9-notes-for-developers" target="_blank"&gt;wedothingsinc&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In any creative discipline, it’s good to have pointers that can keep you on the straight and narrow. Developing is one of these disciplines. From my experiences, I’ve put together 9 quick notes which can improve the way you code, and the way you see developing. It’s a valuable read, especially for anyone starting out or for programmers looking to refine their skills.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://wedothin.gs/post/885831429/9-notes-for-developers" target="_blank"&gt;Read More&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(submitted by &lt;a href="http://floop.me/" target="_blank"&gt;floop&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://techpriester.tumblr.com/post/893768841</link><guid>http://techpriester.tumblr.com/post/893768841</guid><pubDate>Mon, 02 Aug 2010 18:50:39 +0200</pubDate><category>advice</category><category>philosophy</category><category>attitude</category></item><item><title>How to choose your first programming language</title><description>&lt;p&gt;Everyone has to start somewhere and of course that applies to programming, too. But getting started in programming puts you in front of one important question right at the start: What language should I start with?&lt;/p&gt;
&lt;p&gt;There&amp;#8217;s a gazillion of languages that are fitted for beginners. Some of them may prove to be your tools of choice even when you&amp;#8217;ve gathered some experience. Others, well, won&amp;#8217;t.&lt;/p&gt;
&lt;p&gt;So how do most people choose their first language? Simple, they don&amp;#8217;t. They let someone else tell them what to use. That could be their computer sience professor (which may be good or bad), their boss (probably bad) or &amp;#8220;that friend who really knows computer stuff&amp;#8221; (wich is almost guaranteed to be bad).&lt;/p&gt;
&lt;p&gt;If your choice of a language is only based on one persons views, it&amp;#8217;s not unlikely that this person will have a very subjective opinion about the &amp;#8220;best language&amp;#8221; for you. So I think the first thing to do is to ask more people. In times of the web, this should not be a problem. Just go to any website where programmers hang around (like &lt;a title="Stackoverflow.com" href="http://stackoverflow.com" target="_blank"&gt;stackoverflow.com&lt;/a&gt;) and start asking. They won&amp;#8217;t eat you for breakfast. Most of them actually like to answer these kind of questions because it gives them the opportunity to promote their favorite tools.&lt;/p&gt;
&lt;p&gt;Which leads you to the next problem: How can you tell wether the guy who just told you to learn &amp;#8220;LanguageX&amp;#8221; because it&amp;#8217;s &amp;#8220;the bestest of them all&amp;#8221; is not just a fanboy of &amp;#8220;LanguageX&amp;#8221;? You can try the following steps, all with one single person:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Ask, why you should use LanguageX. You&amp;#8217;ll probably get more than enough answers.&lt;/li&gt;
&lt;li&gt;Ask, what the drawbacks of LanguageX are.&lt;/li&gt;
&lt;li&gt;Ask, what language does the things mentioned in step 2 better.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;If the guy is unable or not willing to provide satisfying answers to questions 2 and 3, he&amp;#8217;s probably just a fanboy and you shouldn&amp;#8217;t pay much attention to him.&lt;/p&gt;
&lt;p&gt;Repeat this with some more people. You&amp;#8217;ll notice that you will get very different answers from different people but that&amp;#8217;s OK. The whole point of this is to learn what the highlights and pitfalls of all these languages are. Any modern programming language probably &amp;#8220;works&amp;#8221; for anything you may want to do as a beginner but it can be very disappointing to discover major drawbacks later on after you&amp;#8217;ve become used to it.&lt;/p&gt;
&lt;p&gt;Of course this is not guaranteed to result in THE PERFECT CHOICE™ but it may help you get started with a lot less pain and a lot more fun because it&amp;#8217;s just awesome to discover later on that the tool, that you started out with can still do the job for you.&lt;/p&gt;
&lt;p&gt;After having said that, I suggest, you learn &lt;a title="Piet - Wikipedia (EN)" href="http://en.wikipedia.org/wiki/Piet_(programming_language)" target="_blank"&gt;Piet&lt;/a&gt; because it&amp;#8217;s just super incredibly cool and perfect in every aspect with no drawbacks at all. Period. Just look at &lt;a title="Piet Program Gallery" href="http://www.dangermouse.net/esoteric/piet/samples.html" target="_blank"&gt;what you can do with it&lt;/a&gt; &amp;#8230;&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/871620242</link><guid>http://techpriester.tumblr.com/post/871620242</guid><pubDate>Wed, 28 Jul 2010 20:24:00 +0200</pubDate><category>languages</category><category>getting started</category><category>learning</category></item><item><title>Adding .indexOf() to arrays in Internet Explorer</title><description>&lt;p&gt;Most of you will already know this but hey, it doesn&amp;#8217;t hurt to tell the tale again.&lt;/p&gt;
&lt;p&gt;Looking up an array elements value by key is trivial:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;var bar = someArray['foo'];
&lt;/pre&gt;
&lt;p&gt;In &lt;em&gt;actually working&lt;/em&gt; javascript implementations the reverse is simple, too:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;'foo' == someArray.indexOf(bar); //will be true after the above code snippet
&lt;/pre&gt;
&lt;p&gt;The actual API docs can be found &lt;a title="indexOf - Mozilla API Docs" href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/indexOf" target="_blank"&gt;over at Mozilla.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However, there is still this one JavaScript engine that is not only broken beyond repair but also lacks important features in the first place. I&amp;#8217;m talling, of course, about our beloved Interbet Explorer.&lt;/p&gt;
&lt;p&gt;Trying to use &lt;em&gt;someArray.indexOf()&lt;/em&gt; in up to IE8 will result in an error message telling you that the object does not support this method.&lt;/p&gt;
&lt;p&gt;So, let&amp;#8217;s fix this!&lt;/p&gt;
&lt;pre class="prettyprint"&gt;if (typeof Array.prototype.indexOf !== 'function') {
    Array.prototype.indexOf = function(value) {
        for (var idx in this) {
            if (this.hasOwnProperty(idx)) {
                if (this[idx] == value) {
                    return idx;
                }
            }
        }
        return -1;
    }
}
&lt;/pre&gt;
&lt;p&gt;This will check, if the engine that your script is running on already has the &lt;em&gt;indexOf()&lt;/em&gt; method, and if not, it will simply add it to the Array prototype and by that to all present and future arrays.&lt;/p&gt;
&lt;p&gt;Not exactly a game changer, but useful.&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/871417161</link><guid>http://techpriester.tumblr.com/post/871417161</guid><pubDate>Wed, 28 Jul 2010 19:22:34 +0200</pubDate><category>javascript</category><category>internet explorer</category><category>fixes</category></item><item><title>The Time Zone Converter</title><description>&lt;a href="http://www.thetimezoneconverter.com/"&gt;The Time Zone Converter&lt;/a&gt;: &lt;p&gt;&lt;a href="http://onethingwell.org/post/871165802/the-time-zone-converter" target="_blank"&gt;onethingwell&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Does what it says on the tin.&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://techpriester.tumblr.com/post/871392349</link><guid>http://techpriester.tumblr.com/post/871392349</guid><pubDate>Wed, 28 Jul 2010 19:15:05 +0200</pubDate><category>tool</category></item><item><title>We really should remind us of this more often...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_l5oe3infUa1qav3jwo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;We really should remind us of this more often … &lt;/p&gt;
&lt;p&gt;&lt;a href="http://fuckyeahcomputerscience.tumblr.com/post/823635479/2-things-every-programmer-needs-to-know" target="_blank"&gt;fuckyeahcomputerscience&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;2 things every programmer needs to know&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://techpriester.tumblr.com/post/825494354</link><guid>http://techpriester.tumblr.com/post/825494354</guid><pubDate>Sun, 18 Jul 2010 02:11:31 +0200</pubDate></item><item><title>(via fuckyeahcomputerscience)</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_l5pe359YNC1qav3jwo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;(via &lt;a href="http://fuckyeahcomputerscience.tumblr.com/" target="_blank"&gt;fuckyeahcomputerscience&lt;/a&gt;)&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/825489469</link><guid>http://techpriester.tumblr.com/post/825489469</guid><pubDate>Sun, 18 Jul 2010 02:09:47 +0200</pubDate></item><item><title>rxq:

Se nada der certo, viro analista de mídias sociais.
[via...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_l4w9t6pXMX1qzrd78o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://blog.rodrigo.eti.br/post/758681439" target="_blank"&gt;rxq&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Se nada der certo, viro analista de mídias sociais.&lt;/p&gt;
&lt;p&gt;[via &lt;a href="http://www.oesquema.com.br/urbe" target="_blank"&gt;&lt;a href="http://www.oesquema.com.br/urbe" target="_blank"&gt;http://www.oesquema.com.br/urbe&lt;/a&gt;&lt;/a&gt; ]&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://techpriester.tumblr.com/post/758813947</link><guid>http://techpriester.tumblr.com/post/758813947</guid><pubDate>Thu, 01 Jul 2010 22:35:58 +0200</pubDate></item><item><title>Harry Potter on the UNIX Shell</title><description>&lt;a href="http://fuckyeahcomputerscience.tumblr.com/post/714301692/yer-a-programmer-donnie-knuth"&gt;Harry Potter on the UNIX Shell&lt;/a&gt;: &lt;blockquote&gt;
&lt;p&gt;Spells from Harry Potter and their corresponding Bash commands:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Accio: wget (Pulls an object to the caster.)&lt;/li&gt;
&lt;li&gt;Alohomora: chmod +rw (Unlock a door.)&lt;/li&gt;
&lt;li&gt;Avada Kedavra: rm -rf / (The killing curse.)&lt;/li&gt;
&lt;li&gt;Colloportus: chmod uo-rw (Prevents a muggle from openin a door.)&lt;/li&gt;
&lt;li&gt;Deletrius: history -c (Deletrius clears a wand’s spell history.)/li&gt; &lt;/li&gt;
&lt;li&gt;Episkey, Reparo: fsck (Heal minor injuries./Fixes objects.)&lt;/li&gt;
&lt;li&gt;Gemino: cp (Makes a copy of an object.)&lt;/li&gt;
&lt;li&gt;Homenum Revelio: who (Reveals humans near caster.)&lt;/li&gt;
&lt;li&gt;Pack: tar (Packs up objects into a container.)&lt;/li&gt;
&lt;li&gt;Portus: ln -s (Creates portkey.)&lt;/li&gt;
&lt;li&gt;Prior Incantato: Ctrl+P, history 1 (Shows a ghost of the last spell casted.)&lt;/li&gt;
&lt;li&gt;Rictusempra: touch (Causes the sensation of beeing tickled.)&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;</description><link>http://techpriester.tumblr.com/post/714335247</link><guid>http://techpriester.tumblr.com/post/714335247</guid><pubDate>Sat, 19 Jun 2010 10:19:00 +0200</pubDate><category>fun</category><category>humor</category><category>unix</category><category>shell</category><category>script</category><category>fantasy</category></item><item><title>PHP style date formatting in JavaScript</title><description>&lt;p&gt;A lot of people probably already know PHPs date formatting system and are quite familiar with it. Using formatting strings like &amp;#8220;Y-m-d H:i:s&amp;#8221; makes it really easy to produce nicely formatted date strings in a way that is relatively easy to remember since you probably use the same few formatting strings all the time. In combination with the much improved DateTime class in PHP 5.3 this gives you all the tools you need to work with dates and timestamps.&lt;/p&gt;
&lt;p&gt;JavaScript has a very powerful and comfortable Date object, too. The only thing that&amp;#8217;s missing is an output formatting method that doesn&amp;#8217;t involve concatenating the strings from the single outputs of the Date object together manually.&lt;/p&gt;
&lt;p&gt;So here it is: An extension of the Date object that replicates the functionality of PHPs formatting system:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;/*
 * The following call returns a closure which has some helper functions and objects in it's scope.
 * The closure is then added to the Date prototype and will be available in all Date objects as the "format" method.
 */
Date.prototype.format = (function () {
    /*
     * Helper function for padding numbers with zeros on the left side
     * @private
     * @param {Number} number The input number that is to be padded
     * @param {Number} digits The number of digits of the resulting number
     * @return {String}
     */
    var pad = function(number, digits) {
        var padding = '';
        while ((number + padding).length &amp;lt; digits) {
            padding += '0';
        }
        return padding + number;
    };
    var weekDaysShort = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
    var weekDaysLong  = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
    var monthsShort   = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

    /*
     * Helper method to determine if an hour in 24h format is AM or PM
     * @param {Number} h The hour in 24h Format
     * @return {String}
     * @private
     */
    var amPm = function(h) {
        if (h&amp;lt;=12) {
            return 'am';
        } else {
            return 'pm';
        }
    };

    /*
     * Constructor for the replacer object that provides methods for the format placeholders
     * @param {Date} The Date object that serves a s adata source for the string replacements
     * @constructor
     */
    var Replacer = function(d) {
        this.dO = d; //makes the passed Date object available to the Replacers prototype
    };
    Replacer.prototype = {
        d: function () {return pad(this.dO.getDate(), 2);},
        D: function () {return weekDaysShort[this.dO.getDay()];},
        j: function () {return this.dO.getDate();},
        l: function () {return weekDaysLong[this.dO.getDay()];},
        N: function () {return this.dO.getDay()+1;},
        S: function () {
            var n = this.dO.getDate();
            if (n == 11 || n==12 || n==13) {
                return 'st';
            }
            n = n % 10;
            switch (n) {
                case 1: return 'st';
                        break;
                case 2: return 'nd';
                        break;
                case 3: return 'rd';
                        break;
                default: return 'th';
            }
        },
        w: function () {return this.dO.getDay();},
        m: function () {return pad(this.dO.getMonth(),2);},
        M: function () {return monthsShort[this.dO.getMonth()];},
        n: function () {return this.dO.getMonth()+1;},
        Y: function () {return this.dO.getFullYear();},
        y: function () {return this.dO.getFullYear().toString().substr(2);},
        a: function () {return amPm(this.dO.getHours());},
        A: function () {return amPm(this.dO.getHours()).toUpperCase();},
        g: function () {return this.dO.getHours() % 12;},
        G: function () {return this.dO.getHours();},
        h: function () {return pad(this.dO.getHours() % 12, 2);},
        H: function () {return pad(this.dO.getHours(),2);},
        i: function () {return pad(this.dO.getMinutes(),2);},
        s: function () {return pad(this.dO.getSeconds(),2);},
        U: function () {return this.dO.getTime();}
    };

    /*
     * Returns a closure that has all the needed private helpers in it's scope.
     */
    return function (format) {
        var returnString = '';
        var replacer = new Replacer(this);
        for (var i = 0; i &amp;lt; format.length; i = i + 1) {
            if (typeof replacer[format[i]] !== 'undefined') {
                returnString += replacer[format[i]]();
            } else {
                returnString += format[i];
            }
        }
        return returnString;
    };
}());
&lt;/pre&gt;
&lt;p&gt;After executing this piece of code, all your Date objects will have a &lt;em&gt;format()&lt;/em&gt; method. Even the ones that have been created earlier due to JavaScripts prototypal inheritance system.&lt;/p&gt;
&lt;p&gt;You can call the &lt;em&gt;format()&lt;/em&gt; method with a formatting string just like in PHP. It uses the same tokens to represent the individual fields. For a detailed explanation  what every token does, please consult the PHP manual page for &lt;em&gt;&lt;a title="PHP Manual: date()" href="http://www.php.net/manual/en/function.date.php" target="_blank"&gt;date()&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This version here does not support all the formatting options that are available in PHP but the common ones are in there.&lt;/p&gt;
&lt;p&gt;If you need additional formatting options, you can easily extend the formatter by adding new methods to &lt;em&gt;Replacer.prototype&lt;/em&gt; where all the tokens for the format string are defined as functions.&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/690450389</link><guid>http://techpriester.tumblr.com/post/690450389</guid><pubDate>Sat, 12 Jun 2010 15:43:00 +0200</pubDate><category>php</category><category>javascript</category><category>date</category><category>time</category><category>formatting</category><category>string</category><category>extension</category><category>utility</category></item><item><title>"Saying “I know &lt;programmingLanguageX /&gt;.” is like saying “I can drive a..."</title><description>“&lt;p&gt;Saying “I know &lt;programmingLanguageX /&gt;.” is like saying “I can drive a car”.&lt;/p&gt;

&lt;p&gt;It says nothing about wether you’re a professional race driver or if you crash at least once a year.&lt;/p&gt;”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;This especially applies to languages that are easy to get into.&lt;/em&gt;</description><link>http://techpriester.tumblr.com/post/653892012</link><guid>http://techpriester.tumblr.com/post/653892012</guid><pubDate>Tue, 01 Jun 2010 20:05:00 +0200</pubDate><category>languages</category><category>skills</category><category>people</category></item><item><title>(via fuckyeahcomputerscience)</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_l2z5v5eo9v1qav3jwo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;(via &lt;a href="http://fuckyeahcomputerscience.tumblr.com/" target="_blank"&gt;fuckyeahcomputerscience&lt;/a&gt;)&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/635241322</link><guid>http://techpriester.tumblr.com/post/635241322</guid><pubDate>Wed, 26 May 2010 21:57:41 +0200</pubDate></item><item><title>How asynchronicity gets you a nice girl</title><description>&lt;p&gt;I just made myself some pasta. Ok, nothing spectacular so far, just pasta with plain tomato sauce. But while doing so, I thought about the way I was acting and recognized the similarity between my pasta cooking and &amp;#8230;&lt;/p&gt;
&lt;p&gt;&amp;#8230; JavaScript. Yes, JavaScript.&lt;/p&gt;
&lt;p&gt;Let me explain. What&amp;#8217;s the &amp;#8220;algorithm&amp;#8221; for making pasta with tomato sauce? It&amp;#8217;s something like this (may vary depending on your favored pasta style):&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Put salt water on the stove.&lt;/li&gt;
&lt;li&gt;While the water heats, put some oil into a frying pan.&lt;/li&gt;
&lt;li&gt;While the oil heats, cut an onion. The water is still heating.&lt;/li&gt;
&lt;li&gt;Fry the onion while you cut some tomatoes.&lt;/li&gt;
&lt;li&gt;Add tomatoes to the onions.&lt;/li&gt;
&lt;li&gt;Your water could be boiling by now, so add pasta to the water.&lt;/li&gt;
&lt;li&gt;Let the sauce loose some water by boiling it for a while.&lt;/li&gt;
&lt;li&gt;Then add some spices.&lt;/li&gt;
&lt;li&gt;Take the pasta pout of the water, when it&amp;#8217;s finished (This will probably take the most time).&lt;/li&gt;
&lt;li&gt;Add sauce.&lt;/li&gt;
&lt;li&gt;Eat it and Be happy.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;You see, there&amp;#8217;s a lot of stuff happening concurrently although you are doing it alone - &amp;#8220;single threaded&amp;#8221;, so to speak. This is very much like the asynchronous calls that are common in JavaScript and some other languages. The whole process just takes as long as its longest part, which is probably boiling the pasta.&lt;/p&gt;
&lt;p&gt;Now image making pasta synchronously, like you would program in the more traditional way:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Put water on the stove.&lt;/li&gt;
&lt;li&gt;Wait until it boils&lt;/li&gt;
&lt;li&gt;Put the pasta in the water&lt;/li&gt;
&lt;li&gt;Wait until its ready.&lt;/li&gt;
&lt;li&gt;Cut the onion&lt;/li&gt;
&lt;li&gt;Put oil into the pan.&lt;/li&gt;
&lt;li&gt;Wait &amp;#8230;&lt;/li&gt;
&lt;li&gt;Put the onion into the hot oil.&lt;/li&gt;
&lt;li&gt;Wait &amp;#8230;&lt;/li&gt;
&lt;li&gt;&amp;#8230;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;You see where this is going. There&amp;#8217;s a lot of waiting involved. That&amp;#8217;s time in which you could have done something useful. Like inviting a nice girl over to share the pasta with. But sadly, because you chose synchronous cooking, you&amp;#8217;ll eat not only much later but also alone. And your pasta will most likely have gotten cold while you were so busy with idling.&lt;/p&gt;
&lt;p&gt;Now think again about how &amp;#8220;complicated&amp;#8221; and &amp;#8220;hard to grasp&amp;#8221; asynchronous programming really is.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;PS: I didn&amp;#8217;t invite anyone over for pasta because I used the free time that I had because of asynchronous cooking to write this post ;)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Maybe I should set some different priorities &amp;#8230;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;PPS: And don&amp;#8217;t get me started on multithreaded cooking. My kitchen is barely big enough for one person. Just like your computers RAM is just not big enough to be wasted on threads.&lt;/em&gt;&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/635224685</link><guid>http://techpriester.tumblr.com/post/635224685</guid><pubDate>Wed, 26 May 2010 21:50:15 +0200</pubDate><category>javascript</category><category>pasta</category><category>girls</category><category>asynchronicity</category><category>nonblocking</category><category>concurrency</category><category>threads</category><category>mutlithreading</category><category>cooking</category></item><item><title>"Software development over the past decade was pretty much ruled by Java.

I have this strange..."</title><description>“&lt;p&gt;Software development over the past decade was pretty much ruled by Java.&lt;/p&gt;

&lt;p&gt;I have this strange feeling that the next one will belong to JavaScript.&lt;/p&gt;”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;My cerebellum just said that …&lt;/em&gt;</description><link>http://techpriester.tumblr.com/post/616905025</link><guid>http://techpriester.tumblr.com/post/616905025</guid><pubDate>Thu, 20 May 2010 21:30:54 +0200</pubDate><category>javascript</category><category>java</category><category>future</category><category>history</category><category>speculation</category></item><item><title>Precise finance in JavaScript</title><description>&lt;p&gt;JavaScript knows only one number type: signed 64Bit floating point.&lt;/p&gt;
&lt;p&gt;That is pretty cool most of the time because you can&amp;#8217;t run into strange type conversion issues when every number is already of the exakt same type.&lt;/p&gt;
&lt;p&gt;However, as soon as you do financial mathematics in JS, you&amp;#8217;ll run into pretty bad mojo. Money does not have more than two decimal fractional digits and it&amp;#8217;s always rounded before any calculation is made. So if you throw around money values in JavaScript, it will behave incorrect in terms of currency although the math is perfectly fine.&lt;/p&gt;
&lt;p&gt;To mitigate the dangers of this problem, you can introduce a new type of number: The Money object! &lt;strong&gt;It&amp;#8217;s an object made of cash, yeah!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Ok, here&amp;#8217;s the code:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;var Money = function(amount) {
        if ('number' !== typeof amount) {
            amount = 0;
        }
        this.amount = amount;
    }
Money.prototype.valueOf = function() {
    return Math.round(this.amount * 100) / 100;
}
&lt;/pre&gt;
&lt;p&gt;The &lt;em&gt;valueOf()&lt;/em&gt; method is called every time you try to use an object like a primitive type like &lt;em&gt;Number&lt;/em&gt;, &lt;em&gt;String&lt;/em&gt; or &lt;em&gt;Boolean&lt;/em&gt;. By default it returns the string &amp;#8220;[object Object]&amp;#8221; if you try to do that, which is not very useful. But as you see you can override this behavior by defining a new method of the same name on the constructors &lt;em&gt;prototype&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Now this happens:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;var m = new Money(50.42355446);
var n = new Money(30.342141);

sys.puts(m.amount + n.amount); //80.76569546
sys.puts(m+n);                 //80.76
&lt;/pre&gt;
&lt;p&gt;You can implement a more sophisticated (and maybe less customer friendly) rounding algorithm, if you like. I&amp;#8217;m not an accountant but I&amp;#8217;m sure there are rules how money has to be rounded in different situations.&lt;/p&gt;
&lt;p&gt;And hey, having a constructor for Money sounds pretty awesome, right?&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/616850427</link><guid>http://techpriester.tumblr.com/post/616850427</guid><pubDate>Thu, 20 May 2010 21:03:36 +0200</pubDate><category>javascript</category><category>finance</category><category>math</category><category>calculation</category><category>money</category><category>cash</category><category>howto</category><category>tutorial</category></item><item><title>onethingwell:


ImageOptim optimizes images — so they take up...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_l2ibqzxszN1qbsh2yo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://onethingwell.org/post/612915901/imageoptim-optimizes-images-so-they-take-up-less" target="_blank"&gt;onethingwell&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://imageoptim.pornel.net/" target="_blank"&gt;ImageOptim&lt;/a&gt; optimizes images — so they take up less disk space and load faster — by finding best compression parameters and by removing unnecessary comments and color profiles. It handles PNG, JPEG and GIF animations.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;Just tried it on several hundred photos that I carry around on my phone. It does a nice and fast job.&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/613860472</link><guid>http://techpriester.tumblr.com/post/613860472</guid><pubDate>Wed, 19 May 2010 21:31:08 +0200</pubDate></item><item><title>onethingwell:


Loremify is a one-click tool to copy Lorem...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_l1lb3aGWWc1qbsh2yo1_400.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://onethingwell.org/post/555935051/loremify-is-a-one-click-tool-to-copy-lorem-ipsum" target="_blank"&gt;onethingwell&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://tobiasahlin.com/blog/introducing-loremify/" target="_blank"&gt;Loremify&lt;/a&gt; is a one-click tool to copy Lorem Ipsum. It lets you wrap in html, specify the amount of text, and copy it to your clipboard—all in one click. It runs as a Dashboard Widget in Mac OS X, and is a mere 400kb download.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;small&gt;&lt;a href="http://notes.gilest.org/post/551972221/loremify-a-one-click-tool-to-copy-lorem-ipsum" target="_blank"&gt;Via Giles&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Works like a charm. Awesome UI idea to use the mouse position over the buttons as a measure for the wanted amount of Lorem Ipsum.&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/602061429</link><guid>http://techpriester.tumblr.com/post/602061429</guid><pubDate>Sun, 16 May 2010 01:30:29 +0200</pubDate><category>lorem ipsum</category><category>tool</category><category>mac</category><category>html</category><category>text</category></item><item><title>
We all use random number generators all the time in our...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_l2gr641YKc1qa5flso1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;span&gt;
&lt;p&gt;We all use random number generators all the time in our software. Mostly these generators only produce pseudo random numbers. They calculate their numbers from thing like the computers internal clock so it’s actually not random. For truly unpredictable numbers, you need a physical source of entropy.&lt;/p&gt;
&lt;p&gt;I just wanted to illustrate the difference between synthetic random numbers and real ones. The pictures show software generated noise how it can be made with most image editing programs and a difference blending of two high ISO exposures from a digital camera which produces real physical entropy.&lt;/p&gt;
&lt;p&gt;I think, the difference is quite obvious just by looking at them. Just keep that in mind, when you expect something to be “random” next time.&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/600833896</link><guid>http://techpriester.tumblr.com/post/600833896</guid><pubDate>Sat, 15 May 2010 15:37:16 +0200</pubDate><category>random</category><category>entropy</category><category>software</category><category>physics</category></item><item><title>Protect your late statics!</title><description>&lt;p&gt;In PHP 5.3 we got a great feature called &amp;#8220;late static binding&amp;#8221;. If you don&amp;#8217;t know it yet, read about it &lt;a title="Late Static Bindings - php.net" href="http://php.net/manual/en/language.oop5.late-static-bindings.php" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However, there&amp;#8217;s a little problem that may confuse some people and that may also lead to quite unexpected behaviour, if you don&amp;#8217;t pay attention to it. Let me demonstrate:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;?php
class Foo
{
    static public $foo = 23;
}

class Bar extends Foo
{
    public function __construct()
    {
        static::$foo = 42;
    }
}

echo 'Foo: '.Foo::$foo.PHP_EOL; // 23
echo 'Bar: '.Bar::$foo.PHP_EOL; // 23
$o1 = new Bar();
echo 'Bar: '.Bar::$foo.PHP_EOL; // 42
Bar::$foo = 5;
echo 'Foo: '.Foo::$foo.PHP_EOL; // 5 ... ouch!
&lt;/pre&gt;
&lt;p&gt;As expected, The call to &lt;em&gt;Bar::__construct()&lt;/em&gt; accesses the static member &lt;em&gt;$foo&lt;/em&gt;  in the context of &lt;em&gt;Bar&lt;/em&gt; and not &lt;em&gt;Foo&lt;/em&gt;. If I had used &amp;#8220;&lt;em&gt;self::&lt;/em&gt;&amp;#8221; instead  of &amp;#8220;&lt;em&gt;static::&lt;/em&gt;&amp;#8221;, it&amp;#8217;d have changed the value of &lt;em&gt;Foo::$foo&lt;/em&gt;. So that&amp;#8217;s all working fine.&lt;/p&gt;
&lt;p&gt;The problem occurs when I change the value of &lt;em&gt;Bar::$foo&lt;/em&gt; from the outside, which is allowed because I declared it as public. Now, since there is no late static binding for the &lt;a title="Paamayim Nekudotayim - Wikipedia" href="http://en.wikipedia.org/wiki/Paamayim_Nekudotayim#PHP" target="_blank"&gt;Paamayim Nekudotayim&lt;/a&gt; (Yes, that&amp;#8217;s the correct name for &amp;#8220;::&amp;#8221;) outside of the class it is operating on, I actually changed &lt;em&gt;Foo::$foo&lt;/em&gt; intead of &lt;em&gt;Bar::$foo&lt;/em&gt;. This may be bad.&lt;/p&gt;
&lt;p&gt;To avoid this issue, just declare our static members private and unless you want this to happen, access them via public getter/setter methods that can make use of the late static binding.&lt;/p&gt;</description><link>http://techpriester.tumblr.com/post/592991199</link><guid>http://techpriester.tumblr.com/post/592991199</guid><pubDate>Wed, 12 May 2010 20:29:59 +0200</pubDate><category>php</category><category>problem</category><category>caution</category><category>late static binding</category><category>inheritance</category><category>scope</category><category>warning</category></item></channel></rss>
