<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Another Geek from Cairo</title>
	<atom:link href="http://geekfromcairo.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://geekfromcairo.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 06 Jun 2010 22:20:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='geekfromcairo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Another Geek from Cairo</title>
		<link>http://geekfromcairo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://geekfromcairo.wordpress.com/osd.xml" title="Another Geek from Cairo" />
	<atom:link rel='hub' href='http://geekfromcairo.wordpress.com/?pushpress=hub'/>
		<item>
		<title>And the game continues: Royal Tiara (Altaj Almalaki)</title>
		<link>http://geekfromcairo.wordpress.com/2010/06/06/and-the-game-continues-royal-tiara-altaj-almalaki/</link>
		<comments>http://geekfromcairo.wordpress.com/2010/06/06/and-the-game-continues-royal-tiara-altaj-almalaki/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 22:20:28 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=98</guid>
		<description><![CDATA[1. Name who asked you to play this game: Solom 2.Mention six secrets nobody can uncover about you when meeting you for the first time. 1. I get bored really easy.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=98&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>1. Name who asked you to play this game:</strong></p>
<p><a href="http://sunfall.wordpress.com/">Solom</a></p>
<p><strong>2.Mention six secrets nobody can uncover about you when meeting you for the first time.</strong></p>
<p><a href="http://torvalds-family.blogspot.com/2009/02/25-things-about-me.html">1. I get bored really easy.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=98&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2010/06/06/and-the-game-continues-royal-tiara-altaj-almalaki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
		<item>
		<title>On Human Stupidity!</title>
		<link>http://geekfromcairo.wordpress.com/2010/05/22/on-human-stupidity/</link>
		<comments>http://geekfromcairo.wordpress.com/2010/05/22/on-human-stupidity/#comments</comments>
		<pubDate>Sat, 22 May 2010 00:53:52 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Religion]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=95</guid>
		<description><![CDATA[Some miserable primate creates a facebook page with an attractive religious title. Contrary to what you&#8217;d expect, the page is actually full of age-old, oft-repeated accusations against Islam that have long been refuted. What does the page get? 30,000 Muslim fans who didn&#8217;t really bother to look up anything on the page past its title [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=95&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some miserable primate creates a facebook page with an attractive religious title. Contrary to what you&#8217;d expect, the page is actually full of age-old, oft-repeated accusations against Islam that have long been refuted.</p>
<p>What does the page get? 30,000 Muslim fans who didn&#8217;t really bother to look up anything on the page past its title :S</p>
<p><em>&#8216;Two things are infinite, The Universe and Human Stupidity, and I am not sure of the former&#8217;<br />
- Albert Einstein</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=95&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2010/05/22/on-human-stupidity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
		<item>
		<title>TEDxCairo</title>
		<link>http://geekfromcairo.wordpress.com/2010/05/05/tedxcairo/</link>
		<comments>http://geekfromcairo.wordpress.com/2010/05/05/tedxcairo/#comments</comments>
		<pubDate>Wed, 05 May 2010 10:12:30 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=93</guid>
		<description><![CDATA[After looking at the final list of sessions. All I could say is &#8220;Meh!&#8221;. So much geek-factor is obviously missing.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=93&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After looking at the <a href="http://tedxcairo.com/index-3.html">final list of sessions</a>. All I could say is &#8220;Meh!&#8221;.</p>
<p>So much geek-factor is obviously missing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=93&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2010/05/05/tedxcairo/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
		<item>
		<title>No VT for You!</title>
		<link>http://geekfromcairo.wordpress.com/2009/12/26/no-vt-for-you/</link>
		<comments>http://geekfromcairo.wordpress.com/2009/12/26/no-vt-for-you/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 13:08:23 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=84</guid>
		<description><![CDATA[So here it goes. I got a new Toshiba laptop with an Intel T6500 chip coming with it. Now naturally, all new Intel chips come with virtualization extensions enabled. So I try this: mohd@mohd-laptop:~$ sudo modprobe kvm_intel and I get this FATAL: Error inserting kvm_intel (/lib/modules/2.6.31-16-generic/kernel/arch/x86/kvm/kvm-intel.ko): Operation not supported Then I figure I haven&#8217;t enabled [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=84&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So here it goes. I got a new Toshiba laptop with an Intel T6500 chip coming with it. Now naturally, all new Intel chips come with virtualization extensions enabled. So I try this:<br />
<code>mohd@mohd-laptop:~$ sudo modprobe kvm_intel</code><br />
and I get this<br />
<code>FATAL: Error inserting kvm_intel (/lib/modules/2.6.31-16-generic/kernel/arch/x86/kvm/kvm-intel.ko): Operation not supported</code></p>
<p>Then I figure I haven&#8217;t enabled VT from the BIOS since I got the laptop, so I go into the BIOS settings, and find out that the option for enabling VT is greyed out, giving me no way in hell to enable it. I look on the internet for some solution and I find <a href="http://www.gizmola.com/blog/archives/96-Intels-T6500-No-VT-for-you!-Sony-You-got-Vaio-VT-We-turn-it-off..html">this</a>.</p>
<p>So now, the OEM vendors have the capability just to turn off VT *completely*, and not even giving you the choice to enable it, and worse yet, Intel goes out to announce the chip has no VT support after about 1 month from shipping it to customers. Seriously WTF!</p>
<p>No, I can&#8217;t hack KVM anymore. DAMN!!!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=84&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2009/12/26/no-vt-for-you/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
		<item>
		<title>Git vs. Mercurial</title>
		<link>http://geekfromcairo.wordpress.com/2009/09/20/git-vs-mercurial/</link>
		<comments>http://geekfromcairo.wordpress.com/2009/09/20/git-vs-mercurial/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 23:22:29 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=74</guid>
		<description><![CDATA[We&#8217;re moving from Subversion to Mercurial as our version control system at work, and since I was addicted to the caveats of distributed version control, I was using git-svn to maintain my working copy on top of SVN, but this is no more needed after the move. After some playing with mercurial I can only [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=74&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re moving from Subversion to Mercurial as our version control system at work, and since I was addicted to the caveats of distributed version control, I was using git-svn to maintain my working copy on top of SVN, but this is no more needed after the move. </p>
<p>After some playing with mercurial I can only say this: Mercurial maybe a more intuitive and user friendly VCS, but I really miss the fine-grained control I used to get from Git, even if that means occasionally shooting yourself in the foot at times.</p>
<p>I know, I know, you probably think I am a sick demented psycho. But I have no problem with that. </p>
<p>My $0.02. *Sigh*, </p>
<p>UPDATE:<br />
<a href="http://gitvsmercurial.com/">I agree</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=74&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2009/09/20/git-vs-mercurial/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick Shots!</title>
		<link>http://geekfromcairo.wordpress.com/2009/09/20/quick-shots/</link>
		<comments>http://geekfromcairo.wordpress.com/2009/09/20/quick-shots/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 23:19:48 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Random Thoughts]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=70</guid>
		<description><![CDATA[- First and foremost, happy eid everyone. - To whoever has been repeatedly viewing my resume for the last few days, I&#8217;d really appreciate knowing what&#8217;s so interesting to you about it? - You can obviously see the enoromous writer&#8217;s block problem I am having in the lines above. I have a lot to say, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=70&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>- First and foremost, happy eid everyone.</p>
<p>- To whoever has been repeatedly viewing my resume for the last few days, I&#8217;d really appreciate knowing what&#8217;s so interesting to you about it?</p>
<p>- You can obviously see the enoromous writer&#8217;s block problem I am having in the lines above. I have a lot to say, but obviously I am failing miserably at articulating it. If you have any suggestions about that, please comment!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=70&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2009/09/20/quick-shots/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
		<item>
		<title>My Newest Musical Obsession</title>
		<link>http://geekfromcairo.wordpress.com/2009/08/10/my-newest-musical-obsession/</link>
		<comments>http://geekfromcairo.wordpress.com/2009/08/10/my-newest-musical-obsession/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 00:56:43 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=66</guid>
		<description><![CDATA[It&#8217;s no secret to those who know me that I am an electronica junkie, especially towards IDM/Ambient/Experimental types of electronica. I&#8217;ve happened to be introduced to Rena Jones&#8216;s music through SomaFM, and man did I become obsessed! I just love how she blends classical violin with synthetic electronic sounds and glitchy beats. Here is her [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=66&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s no secret to those who know me that I am an electronica junkie, especially towards IDM/Ambient/Experimental types of electronica. I&#8217;ve happened to be introduced to <a href="http://www.renamusic.com/">Rena Jones</a>&#8216;s music through <a href="http://www.soma.fm">SomaFM</a>, and man did I become obsessed! I just love how she blends classical violin with synthetic electronic sounds and glitchy beats.<br />
Here is her newest album &#8220;Indra&#8217;s Web&#8221;:<br />
<object data="http://bandcamp.com/EmbeddedPlayer/album=3844809918/vis=abstract3d/bgcol=FFFFFF/linkcol=4285BB/size=venti/" type="text/html" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="100"><param name="movie" value="http://bandcamp.com/EmbeddedPlayer/album=3844809918/vis=abstract3d/bgcol=FFFFFF/linkcol=4285BB/size=venti/"><param name="quality" value="high" /><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="always" /><param name="wmode" value="transparent" /><object data="http://bandcamp.com/EmbeddedPlayer/album=3844809918/vis=abstract3d/bgcol=FFFFFF/linkcol=4285BB/size=venti/" type="text/html" width="400" height="100"></object></object></p>
<p>&#8220;Driftwood&#8221;<br />
<object data="http://bandcamp.com/EmbeddedPlayer/album=1134635623/vis=equaliser3d/bgcol=FFFFFF/linkcol=4285BB/size=venti/" type="text/html" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="100"><param name="movie" value="http://bandcamp.com/EmbeddedPlayer/album=1134635623/vis=equaliser3d/bgcol=FFFFFF/linkcol=4285BB/size=venti/"><param name="quality" value="high" /><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="always" /><param name="wmode" value="transparent" /><object data="http://bandcamp.com/EmbeddedPlayer/album=1134635623/vis=equaliser3d/bgcol=FFFFFF/linkcol=4285BB/size=venti/" type="text/html" width="400" height="100"></object></object></p>
<p>&#8220;Transmigration&#8221;<br />
<object data="http://bandcamp.com/EmbeddedPlayer/album=1104431471/vis=plasma/bgcol=FFFFFF/linkcol=4285BB/size=venti/" type="text/html" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="100"><param name="movie" value="http://bandcamp.com/EmbeddedPlayer/album=1104431471/vis=plasma/bgcol=FFFFFF/linkcol=4285BB/size=venti/"><param name="quality" value="high" /><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="always" /><param name="wmode" value="transparent" /><object data="http://bandcamp.com/EmbeddedPlayer/album=1104431471/vis=plasma/bgcol=FFFFFF/linkcol=4285BB/size=venti/" type="text/html" width="400" height="100"></object></object></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=66&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2009/08/10/my-newest-musical-obsession/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Chromium on Linux &#8230; First Impressions</title>
		<link>http://geekfromcairo.wordpress.com/2009/08/06/google-chromium-on-linux-first-impressions/</link>
		<comments>http://geekfromcairo.wordpress.com/2009/08/06/google-chromium-on-linux-first-impressions/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 20:29:12 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=64</guid>
		<description><![CDATA[Perhaps you&#8217;ll first say &#8216;You probably mean Chrome, don&#8217;t you?&#8217;. Well, not really. Chromium is the open source project behind Chrome (Much like OpenOffice.org to Sun StarOffice, or Fedora to RedHat Enterprise Linux). It seems good things are going to come out real soon, especially with the upcoming release of Google Chrome OS, it seems [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=64&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Perhaps you&#8217;ll first say &#8216;You probably mean Chrome, don&#8217;t you?&#8217;. Well, not really. <a href="http://code.google.com/chromium/">Chromium</a> is the open source project behind Chrome (Much like OpenOffice.org to Sun StarOffice, or Fedora to RedHat Enterprise Linux). It seems good things are going to come out real soon, especially with the upcoming release of Google Chrome OS, it seems Google is paying more attention to get Chrome finally released on Linux. Here are my first impressions:</p>
<p>1 &#8211; Running it is so smooth, not a memory hog like Firefox.<br />
2 &#8211; The V8 JavaScript engine seems to make browsing a lot faster, AJAX interfaces almost run as fast as a native desktop application<br />
3 &#8211; On the downside, it doesn&#8217;t look anywhere near as cool as Firefox, and not even as cool as it looks on Windows.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=64&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2009/08/06/google-chromium-on-linux-first-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
		<item>
		<title>To Understand Recursion&#8230;You Need To Understand Recursion (Take 2)</title>
		<link>http://geekfromcairo.wordpress.com/2009/08/04/to-understand-recursion-you-need-to-understand-recursion-take-2/</link>
		<comments>http://geekfromcairo.wordpress.com/2009/08/04/to-understand-recursion-you-need-to-understand-recursion-take-2/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 13:08:51 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=61</guid>
		<description><![CDATA[Look here first. So after some insights from Nicolas, I&#8217;ve modified my implementations to overcome some glitches. Now this C++ implementation doesn&#8217;t wrap around with large values of n. The python implementation also now overcomes the non-deterministic call order it suffered from in the past (credit to the tip goes to my colleague Abdelrahman Hussein). [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=61&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Look <a href="http://geekfromcairo.wordpress.com/2009/08/01/to-understand-recursion-you-need-to-understand-recursion/">here</a> first.</p>
<p>So after some insights from <a href="http://eikke.com">Nicolas</a>, I&#8217;ve modified my implementations to overcome some glitches. Now this C++ implementation doesn&#8217;t wrap around with large values of n. The python implementation also now overcomes the non-deterministic call order it suffered from in the past (credit to the tip goes to my colleague Abdelrahman Hussein).</p>
<p>So here is the C++ implementation:<br />
<code></p>
<pre>
#include &lt;iostream&gt;
#include &lt;ctime&gt;
#include &lt;cstdlib&gt;
#include &lt;map&gt;
using namespace std;

long double fib(unsigned int n) {
	static map&lt;unsigned int, long double&gt; memo;
	if (n &lt; memo.size()) {
		return memo[n];
	} else if (n &lt;= 1) {
		memo[0] = 1;
		memo[1] = 1;
		return memo[n];
	} else {
		long double x = fib(n-1) + fib(n-2);
		memo[n] = x;
		return x;
	}
}

int main(int argc, char **argv) {
	unsigned int n = 0;
	long double x = 0.0;
	time_t t1, t2;
	if (argc != 2) {
		cout &lt;&lt; &quot;Usage: fib &lt;n&gt;, where &lt;n&gt; is the input in f(n) = f(n-1) + f(n-2)&quot; &lt;&lt; endl;
		return 1;
	}

	n = atoi(argv[1]);

	t1 = time(NULL);
	x = fib(n);
	t2 = time(NULL);

	cout &lt;&lt; &quot;Time taken: &quot; &lt;&lt; t2 - t1 &lt;&lt; endl;
	cout &lt;&lt; &quot;fib(n) = &quot; &lt;&lt; fixed &lt;&lt; x &lt;&lt; endl;
	return 0;
}
</pre>
<p></code></p>
<p>and here is the python implementation:</p>
<p><code></p>
<pre>
def fib(n, memo=None):
	if memo == None:
		memo = dict()
	if n in memo:
		return memo[n]
	elif n == 0 or n == 1:
		memo[n] = 1
	else:
		memo[n] = fib(n-1,memo) + fib(n-2,memo)
	return memo[n]

if __name__ == "__main__":
	if len(sys.argv) != 2:
		print "Usage: fib &lt;n&gt;, where &lt;n&gt; is the input to f(n) = f(n-1) + f(n-2)"

	n = int(sys.argv[1])
	t1 = time.time()
	x = fib(n)
	t2 = time.time()

	print "Time Taken: ", t2 - t1
	print "fib(n) =",x
</pre>
<p></code></p>
<p>Running with the same scenarios, the python and the C++ implementations now probably perform as fast (although with this implementation I couldn&#8217;t get accurate numbers for the performance time of the C++ program), however I still have got some pet-peeves with Python:<br />
1- The C++ reaches the maximum size of the table when n~=23600, while python segfaults at n=8585<br />
2- I don&#8217;t like the fact that I have to explicitly set the maximum recursion depth in python, but rather it should -like Java for example- just throw an exception in the event of a stack overflow rather than at a pre-set depth.<br />
3- I also don&#8217;t like that we had to pass the map as an argument to emulate the behaviour of static variables, I don&#8217;t understand the rationale behind the absence of such construct in python. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=61&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2009/08/04/to-understand-recursion-you-need-to-understand-recursion-take-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
		<item>
		<title>To Understand Recursion You Need To Understand Recursion&#8230;</title>
		<link>http://geekfromcairo.wordpress.com/2009/08/01/to-understand-recursion-you-need-to-understand-recursion/</link>
		<comments>http://geekfromcairo.wordpress.com/2009/08/01/to-understand-recursion-you-need-to-understand-recursion/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 01:20:31 +0000</pubDate>
		<dc:creator>Mohammed Gamal</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://geekfromcairo.wordpress.com/?p=44</guid>
		<description><![CDATA[After seeing this problem, and being a developer gradually falling in love with Python (or falling in love-hate with it to be precise). It occured to me &#8220;well, why not try to see what python could do?&#8221; Of course, I didn&#8217;t want to use the straightforward recursive solution, since as my colleague, Ahmed Soliman, rightly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=44&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After seeing <a href="http://thedailywtf.com/Articles/Programming-Praxis-Josephus-Circle.aspx">this problem</a>, and being a developer gradually falling in love with <a href="http://www.python.org">Python</a> (or falling in love-hate with it to be precise). It occured to me &#8220;well, why not try to see what python could do?&#8221;</p>
<p>Of course, I didn&#8217;t want to use the straightforward recursive solution, since as my colleague, Ahmed Soliman, rightly concluded that recursion in Python <a href="http://www.ahmedsoliman.com/2009/07/15/python-recursion-performance-test">is slow</a>. (An interesting counter-argument can be found <a href="http://eikke.com/re-python-recursion-performance-test/comment-page-1">here</a> as well).</p>
<p>To cut things short, I wrote a C++ and a Python implementation of the Fibonacci algorithm with <a href="http://en.wikipedia.org/wiki/Memoization">memoization</a>, and seemingly I had some interesting observations</p>
<p>Here is the C++ implementation:<br />
<code></p>
<pre>
#include &lt;iostream&gt;
#include &lt;ctime&gt;
#include &lt;cstdlib&gt;
#include &lt;map&gt;
using namespace std;

unsigned long long fib(unsigned int n) {
	static map&lt;unsigned long long, unsigned int&gt; memo;
	if (n &lt; memo.size()) {
		return memo[n];
	} else if (n &lt;= 1) {
		memo[0] = 1;
		memo[1] = 1;
		return memo[n];
	} else {
		unsigned long long x = fib(n-1) + fib(n-2);
		memo[n] = x;
		return x;
	}
}

int main(int argc, char **argv) {
	unsigned int n = 0;
	unsigned long long x = 0;
	time_t t1, t2;
	if (argc != 2) {
		cout &lt;&lt; &quot;Usage: fib , where  is the input in f(n) = f(n-1) + f(n-2)" &lt;&lt; endl;
		return 1;
	}

	n = atoi(argv[1]);

	t1 = time(NULL);
	x = fib(n);
	t2 = time(NULL);

	cout &lt;&lt; &quot;Time taken: &quot; &lt;&lt; t2 - t1 &lt;&lt; endl;
	cout &lt;&lt; &quot;fib(n)=&quot; &lt;&lt; x &lt;&lt; endl;
	return 0;
}
</pre>
<p></code></p>
<p>Here are the inputs and outputs, note that some values might be incorrect due to overflows, but what matters here is the function call mechanism:<br />
<code></p>
<pre>
mohd@mohd-laptop:~$ ./fib_memo 40
Time taken: 0
fib(n)=165580141
mohd@mohd-laptop:~$ ./fib_memo 100
Time taken: 0
fib(n)=126979422405
mohd@mohd-laptop:~$ ./fib_memo 1000
Time taken: 0
fib(n)=2071492649197
mohd@mohd-laptop:~$ ./fib_memo 900
Time taken: 0
fib(n)=1862700660921
</pre>
<p></code></p>
<p>Now here is the python implementation:<br />
<code></p>
<pre>
memo = dict() # I don't like this, can't python just have static variables?

def fib(n):
	if memo.has_key(n):
		return memo[n]
	elif n == 0 or n == 1:
		memo[n] = 1
	else:
		memo[n] = fib(n-1) + fib(n-2)
	return memo[n]

if __name__ == "__main__":
	if len(sys.argv) != 2:
		print "Usage: fib , where  is the input to f(n) = f(n-1) + f(n-2)"

	n = int(sys.argv[1])
	t1 = time.time()
	x = fib(n)
	t2 = time.time()

	print "Time Taken: ", t2 - t1
	print "fib(n)=", x
</pre>
<p></code></p>
<p>And here are my tests:<br />
<code></p>
<pre>
mohd@mohd-laptop:~$ python fib_memo.py 40
Time Taken:  0.000197887420654
fib(n)= 165580141
mohd@mohd-laptop:~$ python fib_memo.py 100
Time Taken:  0.00048303604126
fib(n)= 573147844013817084101
mohd@mohd-laptop:~$ python fib_memo.py 900
Time Taken:  0.00656604766846
fib(n)= 88793027306605937532517516910637647045239090036365766884466525589158360259770006891772711976920559280382807770394537471560061517120086971996377683290300054868066659454250625417891167369401
mohd@mohd-laptop:~$ python fib_memo.py 1000
File "fib_memo.py", line 11, in fib
    memo[n] = fib(n-1) + fib(n-2)
  File "fib_memo.py", line 11, in fib
    memo[n] = fib(n-1) + fib(n-2)
  File "fib_memo.py", line 11, in fib
    memo[n] = fib(n-1) + fib(n-2)
  File "fib_memo.py", line 11, in fib
    memo[n] = fib(n-1) + fib(n-2)
  File "fib_memo.py", line 11, in fib
....
File "fib_memo.py", line 11, in fib
    memo[n] = fib(n-1) + fib(n-2)
  File "fib_memo.py", line 11, in fib
    memo[n] = fib(n-1) + fib(n-2)
  File "fib_memo.py", line 11, in fib
    memo[n] = fib(n-1) + fib(n-2)
  File "fib_memo.py", line 11, in fib
    memo[n] = fib(n-1) + fib(n-2)
  File "fib_memo.py", line 11, in fib
RuntimeError: maximum recursion depth exceeded
</pre>
<p></code><br />
So WTF? The recursion depth limit is somewhere near a 1000 function calls? To confirm my doubts I cracked open iPython with this scenario:<br />
<code></p>
<pre>
mohd@mohd-laptop:~$ ipython
/var/lib/python-support/python2.6/IPython/Magic.py:38: DeprecationWarning: the sets module is deprecated
  from sets import Set
Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
Type "copyright", "credits" or "license" for more information.

IPython 0.9.1 -- An enhanced Interactive Python.
?         -&gt; Introduction and overview of IPython's features.
%quickref -&gt; Quick reference.
help      -&gt; Python's own help system.
object?   -&gt; Details about 'object'. ?object also works, ?? prints more.

In [1]: from fib_memo import *

In [2]: fib(1000)

RuntimeError: maximum recursion depth exceeded

In [3]: fib(900)
Out[3]: 88793027306605937532517516910637647045239090036365766884466525589158360259770006891772711976920559280382807770394537471560061517120086971996377683290300054868066659454250625417891167369401L

In [4]: fib(1000)
Out[4]: 70330367711422815821835254877183549770181269836358732742604905087154537118196933579742249494562611733487750449241765991088186363265450223647106012053374121273867339111198139373125598767690091902245245323403501L
</pre>
<p></code></p>
<p>Now python is happy because it has to do only 100 recursive calls to get fib(1000), which clearly shows that the recursion limit is much smaller than  what&#8217;s offered by the C++ implementation, and even worse, it means that the function behaviour can change according to the order it receives arguments.</p>
<p>On the other hand, the C++ implementation suffers from the fact that lead to wrong return if they exceed the &#8220;long long&#8221; limit (how many bits is that on x86_64?), but at least the function behaviour is deterministic, and probably the only limiting factor to calling the function is when the size of the map grows too large to be held in the process&#8217;s address space hence causing a segfault.</p>
<p>Bottomline, yes, you can theoretically use recursion in Python, but neverthless you should worry A LOT about performance, and even if you find optimizations, be aware of how your functions can get called and that inputs don&#8217;t cause the function to exceed the recursion limits. In other words, just spare yourself the time and don&#8217;t use recursion in Python unless ABSOLUTELY necessary, othereise Python offers a lot of tricks to get your things done.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekfromcairo.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekfromcairo.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekfromcairo.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekfromcairo.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekfromcairo.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekfromcairo.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekfromcairo.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekfromcairo.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekfromcairo.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekfromcairo.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekfromcairo.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekfromcairo.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekfromcairo.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekfromcairo.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekfromcairo.wordpress.com&amp;blog=7356336&amp;post=44&amp;subd=geekfromcairo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekfromcairo.wordpress.com/2009/08/01/to-understand-recursion-you-need-to-understand-recursion/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/62b2eed4428b63f628ba746c1c76410b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xDEADBEEF</media:title>
		</media:content>
	</item>
	</channel>
</rss>
