<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Arjan van der Gaag’s semi-regularly updated swipe file</description><title>Arjan van der Gaag's tumblelog</title><generator>Tumblr (3.0; @avdgaag)</generator><link>http://tumble.arjanvandergaag.nl/</link><item><title>Attention Deficit Disorder by Ricardo (via gamesdaypodcast)</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_kxhy3fSAC81qzpugoo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Attention Deficit Disorder&lt;/b&gt; by Ricardo (via &lt;a href="http://gamesdaypodcast.com/post/376996846/revenge"&gt;gamesdaypodcast&lt;/a&gt;)&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/439562961</link><guid>http://tumble.arjanvandergaag.nl/post/439562961</guid><pubDate>Wed, 10 Mar 2010 21:49:54 +0100</pubDate></item><item><title>Test apache configuration syntax</title><description>&lt;p&gt;Recently my Mac OS X stock install of Apache failed to launch properly. The regular system preferences interface stopped and started Web Sharing without complaining, but I could not find &lt;code&gt;httpd&lt;/code&gt; actually running using &lt;code&gt;ps -ax | grep httpd&lt;/code&gt; in the terminal.&lt;/p&gt;

&lt;p&gt;I was at a loss to explain why, until I found this little gem that you can use to syntax-test your configuration files with: &lt;code&gt;apachectl -t&lt;/code&gt; will report on any errors in httpd.conf or any of your other included files.&lt;/p&gt;

&lt;p&gt;It appeared that some time ago when I was attempting a manual upgrade of my Subversion install to 1.6.9 some Apache modules were corrupted. As I have no use for them I disabled them.&lt;/p&gt;

&lt;p&gt;That did the trick, and now I’ve got my local development environment up and running again.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/438710736</link><guid>http://tumble.arjanvandergaag.nl/post/438710736</guid><pubDate>Wed, 10 Mar 2010 10:33:25 +0100</pubDate><category>tips</category><category>sysadmin</category></item><item><title>Javascript: typeof NodeList</title><description>&lt;p&gt;Beware of Javascript’s quirky &lt;code&gt;typeof&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;typeof document.getElementsByTagName('p')
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will return &lt;code&gt;'function'&lt;/code&gt;, which I did not expect. What &lt;em&gt;is&lt;/em&gt; returned is a &lt;code&gt;NodeList&lt;/code&gt;, which behaves like an array, identifies itself as a function, but really is neither.&lt;/p&gt;

&lt;p&gt;If you want to detect a &lt;code&gt;NodeList&lt;/code&gt; you’re better off with feature detection:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var isNodelist = (typeof myvar.length != 'undefined &amp;&amp;
  typeof myvar.item != 'undefined')
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Do note that this makes it probable you’re dealing with a &lt;code&gt;NodeList&lt;/code&gt; — but you can’t be sure.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/372162724</link><guid>http://tumble.arjanvandergaag.nl/post/372162724</guid><pubDate>Fri, 05 Feb 2010 11:50:17 +0100</pubDate><category>code</category><category>javascript</category></item><item><title>Getting Things Done with Rituals</title><description>&lt;p&gt;In order to achieve real productivity you need to get into &lt;em&gt;the zone&lt;/em&gt;. Context switches take you out of the zone and should therefore be managed carefully. &lt;strong&gt;Get rid of multitasking&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I’ve found the mental overhead of context switches can be reduced with a clear start and end for a tiny break from work. &lt;strong&gt;A ritual provides such clear boundaries&lt;/strong&gt;. I use several rituals throughout my day: reviewing my to do’s, drinking a cup of coffee while skimming through the news, getting a cup of water, and so forth. Even the daily commute between home and work helps ‘switching off’ at the end of the day.&lt;/p&gt;

&lt;p&gt;I’ve grown used to them over time. I think I now get why people are so resistant to change…&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/285901566</link><guid>http://tumble.arjanvandergaag.nl/post/285901566</guid><pubDate>Wed, 16 Dec 2009 09:44:39 +0100</pubDate><category>gtd</category></item><item><title>"In retrospect, all revolutions seem inevitable. Beforehand, all revolutions seem impossible."</title><description>“In retrospect, all revolutions seem inevitable. Beforehand, all revolutions seem impossible.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Michael McFaul&lt;/em&gt;</description><link>http://tumble.arjanvandergaag.nl/post/274430073</link><guid>http://tumble.arjanvandergaag.nl/post/274430073</guid><pubDate>Tue, 08 Dec 2009 09:19:56 +0100</pubDate></item><item><title>loveallthis:

Inspired by jeannr, I flowcharted the Beatles...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kolo40SQZq1qzy3cwo1_r1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://loveallthis.tumblr.com/post/166124704"&gt;loveallthis&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Inspired by &lt;a href="http://jeannr.tumblr.com/post/165291081/i-made-a-flow-chart-that-we-might-better"&gt;jeannr&lt;/a&gt;, I flowcharted the &lt;a href="http://en.wikipedia.org/wiki/The_Beatles"&gt;Beatles&lt;/a&gt; classic, ‘Hey Jude.’&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://tumble.arjanvandergaag.nl/post/232245954</link><guid>http://tumble.arjanvandergaag.nl/post/232245954</guid><pubDate>Tue, 03 Nov 2009 23:55:34 +0100</pubDate></item><item><title>jQuery custom selectors</title><description>&lt;p&gt;I like writing jQuery plugins, so I can separate functionality into distinct units. But &lt;em&gt;applying&lt;/em&gt; the plugin sometimes requires some logic I’d rather have in my plugin itself.&lt;/p&gt;

&lt;h2&gt;Example code&lt;/h2&gt;

&lt;p&gt;Say I want to create a plugin that creates a lightbox-style image zooming effect. I want to apply it to all links pointing at an image:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;a href="/images/photo1.jpg"&gt;&lt;img src="/images/photo1.jpg"&gt;&lt;/a&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here’s how I might call my awesome plugin in my main javascript file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$(function() {
    // One option: create complex inline selectors:
    $('a[href$="jpg"], a[href$="png"]).awesome_plugin();

    // Second option: filtering
    $('a').filter(function() {
        $(this).attr('href').match(/\.(png|gif|jpe?g)$/);
    }).awesome_plugin();
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;These both might work, but they move typical plugin logic to my javascript initializer. That’s not what I want.&lt;/p&gt;

&lt;h2&gt;Custom selector&lt;/h2&gt;

&lt;p&gt;The solution is so obvious I wonder why I did not think of it before: &lt;strong&gt;write a custom jQuery selector&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$(function() {
    $('a:to_image').awesome_plugin();
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Awesome: concise and with clear intent. Here’s one way to implement it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// Somewhere in my plugin
$.expr[':'].to_image = function(obj, index, meta, stack) {
    return $(obj).attr('href').match(/\.(png|gif|jpe?g)$/);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now all the logic is nicely tucked away in my plugin.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/212693689</link><guid>http://tumble.arjanvandergaag.nl/post/212693689</guid><pubDate>Wed, 14 Oct 2009 09:52:42 +0200</pubDate><category>javascript</category><category>jquery</category><category>code</category><category>tips</category></item><item><title>GTD with OWA</title><description>&lt;p&gt;Relying on Microsoft Outlook Web Access without Internet Explorer can be tiresome — being served a static web application that would have annoyed even in 1996 — but it is kind of relaxing too: the effort of constantly logging in and taming the horrible interface to get to your mail is a real motivator to get some actual work done.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/194017588</link><guid>http://tumble.arjanvandergaag.nl/post/194017588</guid><pubDate>Tue, 22 Sep 2009 10:31:43 +0200</pubDate><category>gtd</category><category>software</category><category>microsoft</category><category>owa</category></item><item><title>via thisishistorictimes.com</title><description>&lt;img src="http://29.media.tumblr.com/tumblr_kqabp3AI7f1qz4sn2o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;via &lt;a href="http://thisishistorictimes.com/wp-content/uploads/2009/09/editorial_20090917.jpg"&gt;thisishistorictimes.com&lt;/a&gt;&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/192748451</link><guid>http://tumble.arjanvandergaag.nl/post/192748451</guid><pubDate>Sun, 20 Sep 2009 21:34:14 +0200</pubDate><category>comic</category><category>satire</category><category>politics</category><category>usa</category></item><item><title>"Your request to not receive promotional emails about your subscription has been received and will be..."</title><description>“Your request to not receive promotional emails about your subscription has been received and will be processed within the next 10 working days.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;FT.com customer service: 10 working days to unsubscribe from your mailing list? That’s crazy fast! They must be using some kind of “computer”. Amazing…&lt;/em&gt;</description><link>http://tumble.arjanvandergaag.nl/post/189339816</link><guid>http://tumble.arjanvandergaag.nl/post/189339816</guid><pubDate>Wed, 16 Sep 2009 14:59:19 +0200</pubDate><category>spam</category><category>email</category></item><item><title>Attractive piracy</title><description>&lt;p&gt;The problem with internet piracy is obvious: downloading illegal materials is &lt;strong&gt;easier, cheaper, faster&lt;/strong&gt; and the acquired content is &lt;strong&gt;more portable&lt;/strong&gt;, than with any legal alternative. The solution would be to close the gap between the desirability of illegal versus legal content distribution &lt;em&gt;from the consumer’s perspective&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Too bad then, that the music and movie industries take the &lt;em&gt;producer&lt;/em&gt;’s perspective, trying to make  illegal downloading &lt;em&gt;less&lt;/em&gt; attractive, rather than legal downloading &lt;em&gt;more&lt;/em&gt; attractive. That is why they get so little public sympathy, I reckon.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/183520339</link><guid>http://tumble.arjanvandergaag.nl/post/183520339</guid><pubDate>Wed, 09 Sep 2009 10:09:04 +0200</pubDate><category>business</category><category>piracy</category><category>filesharing</category></item><item><title>Subversion branching</title><description>&lt;p&gt;The main reason why developers should use Git for versioning is cheap, cheap branching. But in Subversion it isn’t &lt;em&gt;so&lt;/em&gt; hard that you shouldn’t use it. Here’s a basic bugfix branch workflow. First, create your branch:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;svn copy /path/trunk\
         /path/branches/my-new-branch\
         -m "Create my new branch"
svn switch /path/branches/my-new-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Of course, &lt;code&gt;/path/&lt;/code&gt; is easy enough to find:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;svn info | grep URL
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Hack away, make some commits, and when you are ready to merge to branch back into trunk:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Note the revision that started this branch
# assume this tells you '4362'
svn log --stop-on-copy

# Get back to trunk and merge in your changes
svn switch /path/trunk
svn merge -r 4362:HEAD /path/branches/my-new-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inspect your changes, resolve conflicts and make sure everything is alright. Commit your changes…&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;svn commit -m "Merge in branch 'my new branch'"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;…and then clean up after yourself:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;svn delete /path/branches/my-new-branch\
           -m "Remove obsolete branch"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The trick is knowing where your branch started. You can note the revision number when you create the branch, or use &lt;code&gt;svn log&lt;/code&gt; to find out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beware of changes to &lt;code&gt;trunk&lt;/code&gt; before merging in your branch&lt;/strong&gt;. If &lt;code&gt;trunk&lt;/code&gt; has changed since you created your branch (and chances are it has) you should first merge those changes back into your branch, so it stays in sync.&lt;/p&gt;

&lt;p&gt;Newer versions of Subversion should make this process a little easier, but this works. Be sure to check out &lt;a href="http://svnbook.red-bean.com/en/1.5/svn.branchmerge.commonpatterns.html#svn.branchmerge.commonpatterns.feature" title="Common Branching Patterns"&gt;the Subversion manual on branching patterns&lt;/a&gt;.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/182710635</link><guid>http://tumble.arjanvandergaag.nl/post/182710635</guid><pubDate>Tue, 08 Sep 2009 11:28:40 +0200</pubDate><category>svn</category><category>subversion</category><category>scm</category><category>code</category></item><item><title>"In many ways, history should be regarded as a globalizing mass medium in the nineteenth century."</title><description>“In many ways, history should be regarded as a globalizing mass medium in the nineteenth century.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://www.amazon.co.uk/gp/product/0674013395?ie=UTF8&amp;tag=arjanvandergaag-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0674013395"&gt;P. Fritzsche, &lt;em&gt;Stranded in the Present&lt;/em&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.co.uk/e/ir?t=arjanvandergaag-21&amp;l=as2&amp;o=2&amp;a=0674013395" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;"/&gt;&lt;/em&gt;</description><link>http://tumble.arjanvandergaag.nl/post/181100296</link><guid>http://tumble.arjanvandergaag.nl/post/181100296</guid><pubDate>Sun, 06 Sep 2009 13:32:08 +0200</pubDate><category>history</category></item><item><title>Distribution of Academic Literature</title><description>&lt;p&gt;Here’s how I get my academic literature these days:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Let a teacher e-mail me a Microsoft Word file with references.&lt;/li&gt;
&lt;li&gt;Print the file&lt;/li&gt;
&lt;li&gt;Go to the library, look up the titles and wait an hour before fellow students return them.&lt;/li&gt;
&lt;li&gt;Copy the required pages on dead tree (single-sided).&lt;/li&gt;
&lt;li&gt;Go home and scan in the dead tree.&lt;/li&gt;
&lt;li&gt;Archive the digital article on my computer, ready to read from screen.&lt;/li&gt;
&lt;li&gt;Throw away the copied articles.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now, I know insisting on reading articles from screen rather than from paper is considered overly geeky, but the solutions for tagging, zooming, searching, portability and annotations make this a no-brainer for me. Regardless, it seems to me this whole process could be a lot simpler, cheaper, quicker, less frustrating and above all consume a lot less paper.&lt;/p&gt;

&lt;p&gt;Here’s what I propose:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Teacher copies links to works to a course website, rather than manually adding them to a Word file.&lt;/li&gt;
&lt;li&gt;Through the University’s volume discount program students purchase the articles in PDF for a small fee from the publisher.&lt;/li&gt;
&lt;li&gt;Those that want to read stuff from paper print it themselves, saving the rest of us a lot of time and money.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It doesn’t sound ridiculous to me.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/179497519</link><guid>http://tumble.arjanvandergaag.nl/post/179497519</guid><pubDate>Fri, 04 Sep 2009 10:42:07 +0200</pubDate><category>study</category><category>academia</category><category>university</category><category>literature</category></item><item><title>Snow Leopard Web Development Configuration</title><description>&lt;p&gt;After installing Snow Leopard on my iMac I found I had to tweak some settings before I could continue my daily web development workflow. First, you should note Snow Leopard now comes with PHP 5.3 and it will overwrite your custom Apache configuration.&lt;/p&gt;

&lt;p&gt;Here’s what I did to get up and running:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Moved &lt;code&gt;/etc/php.ini.default&lt;/code&gt; to &lt;code&gt;/etc/php.ini&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Edited &lt;code&gt;php.ini&lt;/code&gt; (using search/replace) so that &lt;code&gt;display_errors = On&lt;/code&gt; and &lt;code&gt;mysql.default_port = /tmp/mysql.sock&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;I also set a default timezone (search &lt;code&gt;php.ini&lt;/code&gt; for ‘timezone’) to suppress warnings about server timezone being unreliable.&lt;/li&gt;
&lt;li&gt;Restored my &lt;code&gt;vhosts.conf&lt;/code&gt; file from a back-up to bring back my various *.dev virtual hosts.&lt;/li&gt;
&lt;li&gt;I replaced all my PHP short tags with their longer equivalents (&lt;code&gt;&lt;?=&lt;/code&gt; to &lt;code&gt;&lt;?php echo&lt;/code&gt;) as these are deprecated in PHP 5.3.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After these rather simple steps I was back up and running, although they took a a little time and googling. Overall, I was surprised how little installing Snow Leopard messed up my system.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/174620228</link><guid>http://tumble.arjanvandergaag.nl/post/174620228</guid><pubDate>Sat, 29 Aug 2009 12:20:28 +0200</pubDate><category>snow leopard</category><category>php</category><category>apache</category><category>mac os x</category><category>osx</category></item><item><title>Internet Explorer, Javascript and base elements</title><description>&lt;p&gt;Internet Explorer treats the base element a bit diffently from other browser. I ran into the issue when trying to change the current page’s hash through javascript:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;window.location.hash = 'some_value';
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Internet explorer took the entire base URL and prepended it to the hash, resulting in an URL like &lt;code&gt;&lt;a href="http://domain.tld/http://domain.tld/#some_value"&gt;http://domain.tld/http://domain.tld/#some_value&lt;/a&gt;&lt;/code&gt;. That’s clearly not my intention.&lt;/p&gt;

&lt;p&gt;The trick lies in the &lt;code&gt;href&lt;/code&gt; attribute for links. This actually points to the faulty long url, while its actual attribute value is only the hash:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;a id="link" href="#some_value"&gt;...&lt;/a&gt;
// IE: &lt;a href="http://domain.tld/#some_value"&gt;http://domain.tld/#some_value&lt;/a&gt;
// other browser: #some_value
$('#link').attr('href'); 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The trick is to replace anything before the pound when reading the &lt;code&gt;href&lt;/code&gt; value, like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$('#link').attr('href').replace(/^.*(?=#)/, '');
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And when trying to find links pointing at &lt;code&gt;#some_value&lt;/code&gt; to not be too restrictive with your selector:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// finds 1 in other browsers, nothing in IE
$('a[href="#some_value"]')

// works like expected in all browsers; Note the *
$('a[href*="#some_value"]')
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Tricky stuff!&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/168021795</link><guid>http://tumble.arjanvandergaag.nl/post/168021795</guid><pubDate>Fri, 21 Aug 2009 10:03:08 +0200</pubDate><category>code</category><category>javascript</category><category>IE</category><category>tips</category></item><item><title>Removing deleted files from the Git index</title><description>&lt;p&gt;When working with Git it can be cumbersome to have to remove files from the index (marking them deleted rahter missing) if you did not delete them using &lt;code&gt;git-rm&lt;/code&gt;. Here’s bash one-liner for that:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git rm $(git ls-files -d)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I’ve got that aliased to &lt;code&gt;grd&lt;/code&gt; (Git Remove Deleted).&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/164832547</link><guid>http://tumble.arjanvandergaag.nl/post/164832547</guid><pubDate>Mon, 17 Aug 2009 14:03:13 +0200</pubDate><category>git</category><category>code</category><category>tip</category></item><item><title>Argument-specific memoization</title><description>&lt;p&gt;There is another way of memoizing expensive operations in JavaScript, which is also fit for argument-specific results:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;base._fooCache = {};
base.foo = function(arg) {
    if(base._fooCache[arg] === undefined) {
        base. _fooCache[arg] = ...expensive operation... 
    }
    return base. _fooCache[arg];
}; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This just keeps a local key/value cache of the result of the expensive operation for the given argument. This only works for a single argument right now, but I guess it could be extended to multiple arguments.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/161976419</link><guid>http://tumble.arjanvandergaag.nl/post/161976419</guid><pubDate>Thu, 13 Aug 2009 12:48:47 +0200</pubDate><category>code</category><category>javascript</category></item><item><title>Awesome JavaScript memoization</title><description>&lt;p&gt;Here’s an easy way to memoize expensive Javascript functions. It introduces slightly obscure code and an extra function call, but if your operation is expensive enough to memoize, it is probably worth the extra overhead:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;this.foo = function(){
    var foo = expensive_operation();
    return (this.foo = function() { return foo; })();
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What this function does is redefine itself, so on subsequent calls it only returns a static value. Neat.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/161890929</link><guid>http://tumble.arjanvandergaag.nl/post/161890929</guid><pubDate>Thu, 13 Aug 2009 09:05:00 +0200</pubDate><category>code</category><category>javascript</category></item><item><title>Science &amp; Religion</title><description>&lt;p&gt;Science and religion are not as incompatible as many seem to believe. The scientific method implies the use of logic and reason towards falsifiable theories. When you weigh pros an cons, and take into account all available evidence, there is nothing wrong with believing in a supreme being. I personally don’t believe that, bu to each his own.&lt;/p&gt;

&lt;p&gt;I do have a problem with people who reject science as if it were anti-religious. Such people choose to only hear the story they like best, not which one they think describes reality best.&lt;/p&gt;</description><link>http://tumble.arjanvandergaag.nl/post/145906539</link><guid>http://tumble.arjanvandergaag.nl/post/145906539</guid><pubDate>Tue, 21 Jul 2009 09:03:08 +0200</pubDate><category>science</category><category>religion</category><category>rant</category></item></channel></rss>
