<?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/"
	>

<channel>
	<title>Code Vault</title>
	<atom:link href="http://codedemigod.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://codedemigod.com/blog</link>
	<description>You should be the change that you want to see in the World</description>
	<lastBuildDate>Sat, 29 May 2010 16:47:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SpringerLink pdf manipulation scripts</title>
		<link>http://codedemigod.com/blog/?p=178</link>
		<comments>http://codedemigod.com/blog/?p=178#comments</comments>
		<pubDate>Sat, 29 May 2010 16:47:44 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=178</guid>
		<description><![CDATA[The SpringerLink pdf manipulation scripts are now up on github. You can get them at http://github.com/alaasalman/pdfmaniputil. I am slowly moving most of the public projects and code over to github so that people can use it and change it more effectively.]]></description>
			<content:encoded><![CDATA[<p>The SpringerLink pdf manipulation scripts are now up on github. You can get them at <a href="http://github.com/alaasalman/pdfmaniputil">http://github.com/alaasalman/pdfmaniputil.</a></p>
<p>I am slowly moving most of the public projects and code over to github so that people can use it and change it more effectively.</p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=178</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Book Review: From Program To Product</title>
		<link>http://codedemigod.com/blog/?p=171</link>
		<comments>http://codedemigod.com/blog/?p=171#comments</comments>
		<pubDate>Sun, 26 Apr 2009 11:55:15 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[Book Review]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=171</guid>
		<description><![CDATA[Two years ago, I learned that you can be a brilliant programmer and write awesome code but if your code doesn&#8217;t help solve some problem or doesn&#8217;t ease someone&#8217;s pain, then you&#8217;re not really doing your part. This is exactly the lesson that this book tries to drive home. It goes through the different aspects [...]]]></description>
			<content:encoded><![CDATA[<p>Two years ago, I learned that you can be a brilliant programmer and write awesome code but if your code doesn&#8217;t help solve some problem or doesn&#8217;t ease someone&#8217;s pain, then you&#8217;re not really doing your part.</p>
<p>This is exactly the lesson that this book tries to drive home. It goes through the different aspects of creating a product from the programming and support to the licensing and legal side. The book also includes several interviews with people who have already done that. Personally, I found the interviews the most enjoyable part of it all. </p>
<p>The interesting part, to me, in all of this is the applications described in those interviews were really boring. As a programmer, they&#8217;re not exactly the kind of work that we love to do. I mean come on, a product to manage a stable? Tracking horses and lessons? Zzzzzz&#8230;. Not exactly the kind of work that would keep you up coding all night long. However, the applications were a success because they helped people to do their job better. They eased the pain of doing those things manually and, who knows, maybe gave someone less stress and more time to spend with their family. That is certainly what computers and programs are meant to do. To help us do what we&#8217;re supposed to do. And we&#8217;re all here to do what we&#8217;re all here to do.(The Matrix reference)</p>
<p>It took me a while to learn that lesson. I first noticed it when, as a freelancer, I had to work on a few jobs just to pay the bills. The tasks weren&#8217;t enjoyable to me as a programmer, I was just doing it for the money. And as a programmer, a lot of those tasks were very simple to do. Yet the people who I worked with were very grateful that I helped. And, as a business and a person, there&#8217;s nothing like a happy customer.</p>
<p>On the cons side of things, this wasn&#8217;t exactly a page-turner. Don&#8217;t get me wrong, the book is interesting. But recently I&#8217;ve been reading a lot of books about entrepreneurship and starting a business. And aside from the inspiration, once you&#8217;ve read one, you&#8217;ve read them all.</p>
<p>Overall, I give this book 3/5 stars. You can get the book from <a href="http://www.amazon.com/gp/product/1590599713?ie=UTF8&#038;tag=thcova-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1590599713">From Program to Product: Turning Your Code into a Saleable Product (Expert&#8217;s Voice)</a><img src="http://www.assoc-amazon.com/e/ir?t=thcova-20&#038;l=as2&#038;o=1&#038;a=1590599713" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.</p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=171</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ugly code</title>
		<link>http://codedemigod.com/blog/?p=167</link>
		<comments>http://codedemigod.com/blog/?p=167#comments</comments>
		<pubDate>Mon, 30 Mar 2009 15:21:10 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[Technical General]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=167</guid>
		<description><![CDATA[Was writing some code today and ended up with &#8220;Dictionary&#60;string, List&#60;Dictionary&#60;string, string&#62;&#62;&#62; resultDictionary&#8221; Does anyone else think that this is hideous? It&#8217;s a dictionary keyed by strings and holding lists of dictionaries keyed by strings and holding strings. And it is what you get when you have a statically typed language(C#) and no native dictionaries. [...]]]></description>
			<content:encoded><![CDATA[<p>Was writing some code today and ended up with &#8220;Dictionary&lt;string, List&lt;Dictionary&lt;string, string&gt;&gt;&gt; resultDictionary&#8221;</p>
<p>Does anyone else think that this is hideous? It&#8217;s a dictionary keyed by strings and holding lists of dictionaries keyed by strings and holding strings. And it is what you get when you have a statically typed language(C#) and no native dictionaries.</p>
<p>The code is trying to build a tree to encode as JSON to pass to javascript to represent as a tree widget&#8230;try saying that ten times.</p>
<p>I know what you&#8217;re thinking&#8230;and no, the code is no longer there, it only survived for a few mins before another iteration replaced it with something less icky..I tend to use evolutionary steps and refactor as i go.</p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=167</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joining SpringerLink pdfs</title>
		<link>http://codedemigod.com/blog/?p=163</link>
		<comments>http://codedemigod.com/blog/?p=163#comments</comments>
		<pubDate>Tue, 17 Mar 2009 17:48:05 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[Technical General]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=163</guid>
		<description><![CDATA[My workplace has a subscription to SpringerLink. So I&#8217;ve been having a blast looking at the different books over there. I found lots of books that are on my Amazon wish list and so i was like a child at a candy store. The problem is that the books are provided via separate pdf files [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://www.aub.edu.lb">workplace</a> has a subscription to <a href="http://www.springerlink.de/home/main.mpx">SpringerLink</a>. So I&#8217;ve been having a blast looking at the different books over there. I found lots of books that are on my Amazon wish list and so i was like a child at a candy store.</p>
<p>The problem is that the books are provided via separate pdf files for chapters. I am not sure why they do that, I think to make it tougher to pirate the files? Although that doesn&#8217;t really make any sense. Regardless, it is a bit annoying and I&#8217;d like to have the books as one pdf to transfer over to my trusty Sony Reader(more about it later) to read them while on the go.</p>
<p>So i hacked up a python script to rename the individual files by their chapter number making it easier to join. I then hacked up another script that reads these files and joins them in correct order into one file. Sadly, the scripts are only tested on Linux and will probably only run there. The first version used pyPDF and was probably cross-platform, but it had some problems with the pdfs so i reverted to using pdftotext that, as far as i know, only runs under a GNU Linux system.</p>
<p>This is what the code looks like for the script that does the renaming.</p>
<pre class="codequote">
<div class="highlight">
<pre><span class="c">#! /usr/bin/python</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">os.path</span>
<span class="kn">from</span> <span class="nn">subprocess</span> <span class="kn">import</span> <span class="n">Popen</span><span class="p">,</span> <span class="n">PIPE</span>
<span class="kn">import</span> <span class="nn">glob</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">re</span>
<span class="kn">import</span> <span class="nn">shutil</span>

<span class="k">def</span> <span class="nf">main</span><span class="p">(</span><span class="n">argv</span><span class="p">):</span>
    <span class="n">fullPath</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mf">1</span><span class="p">])</span>
    <span class="k">print</span> <span class="s">&quot;Looking at </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">fullPath</span>

    <span class="k">for</span> <span class="n">fileName</span> <span class="ow">in</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">fullPath</span><span class="p">,</span> <span class="s">&#39;*.pdf&#39;</span><span class="p">)):</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="n">fullFileName</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">fullPath</span><span class="p">,</span> <span class="n">fileName</span><span class="p">)</span>
            <span class="k">print</span> <span class="s">&quot;Converting </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">fullFileName</span>

            <span class="n">pOpenCls</span> <span class="o">=</span> <span class="n">Popen</span><span class="p">((</span><span class="s">&quot;/usr/bin/pdftotext&quot;</span><span class="p">,</span> <span class="n">fullFileName</span><span class="p">,</span> <span class="s">&quot;-&quot;</span><span class="p">),</span> <span class="n">stdout</span><span class="o">=</span><span class="n">PIPE</span><span class="p">)</span>
            <span class="n">convertOut</span> <span class="o">=</span> <span class="n">pOpenCls</span><span class="o">.</span><span class="n">stdout</span>

            <span class="n">titleContent</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>

            <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">xrange</span><span class="p">(</span><span class="mf">1</span><span class="p">,</span> <span class="mf">6</span><span class="p">):</span>
                <span class="n">titleContent</span> <span class="o">+=</span> <span class="n">convertOut</span><span class="o">.</span><span class="n">readline</span><span class="p">()</span>

            <span class="n">titleContent</span> <span class="o">=</span> <span class="n">titleContent</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39;</span><span class="se">\n</span><span class="s">&#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">)</span>

            <span class="n">digitSearch</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s">&#39;\d+&#39;</span><span class="p">,</span> <span class="n">titleContent</span><span class="p">)</span>

            <span class="k">if</span> <span class="n">digitSearch</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
                <span class="n">newChapterPdf</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">fullPath</span><span class="p">,</span> <span class="n">digitSearch</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">0</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;.pdf&quot;</span><span class="p">)</span>

                <span class="k">while</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">newChapterPdf</span><span class="p">):</span>
                    <span class="n">newChapterPdf</span> <span class="o">=</span> <span class="n">newChapterPdf</span> <span class="o">+</span> <span class="s">&quot;dup.pdf&quot;</span>

                <span class="n">shutil</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">fullFileName</span><span class="p">,</span> <span class="n">newChapterPdf</span><span class="p">)</span>

            <span class="k">else</span><span class="p">:</span>
                <span class="k">print</span> <span class="s">&quot;File is not a chapter, checking if front or back&quot;</span>
                <span class="k">if</span> <span class="n">fileName</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">&quot;front&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mf">1</span><span class="p">:</span>
                    <span class="n">firstPdf</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">fullPath</span><span class="p">,</span> <span class="s">&quot;0.pdf&quot;</span><span class="p">)</span>

                    <span class="k">while</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">firstPdf</span><span class="p">):</span>
                        <span class="n">firstPdf</span> <span class="o">=</span> <span class="n">firstPdf</span> <span class="o">+</span> <span class="s">&quot;0.pdf&quot;</span>

                    <span class="n">shutil</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">fullFileName</span><span class="p">,</span> <span class="n">firstPdf</span><span class="p">)</span>

                <span class="k">elif</span> <span class="n">fileName</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">&quot;back&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mf">1</span><span class="p">:</span>
                    <span class="n">lastPdf</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">fullPath</span><span class="p">,</span> <span class="s">&quot;9999.pdf&quot;</span><span class="p">)</span>

                    <span class="k">while</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">lastPdf</span><span class="p">):</span>
                        <span class="n">lastPdf</span> <span class="o">=</span> <span class="n">lastPdf</span> <span class="o">+</span> <span class="s">&quot;9.pdf&quot;</span>

                    <span class="n">shutil</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">fullFileName</span><span class="p">,</span> <span class="n">lastPdf</span><span class="p">)</span>

        <span class="k">except</span> <span class="ne">OSError</span><span class="p">,</span> <span class="n">ex</span><span class="p">:</span>
            <span class="k">print</span> <span class="n">ex</span>
            <span class="k">print</span> <span class="s">&#39;Failed&#39;</span><span class="p">,</span> <span class="n">fullFileName</span>

<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span>
    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mf">2</span><span class="p">:</span>
        <span class="k">print</span> <span class="s">&quot;Supply directory as argument&quot;</span>
        <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">()</span>
    <span class="n">main</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span>
</pre>
</div>
</pre>
<p>This is what the code looks like for the script that does the joining. pyPDF is needed for this to function.</p>
<pre class="codequote">
<div class="highlight">
<pre><span class="c">#!/usr/bin/python</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">glob</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">os.path</span>
<span class="kn">import</span> <span class="nn">pprint</span>
<span class="kn">from</span> <span class="nn">pyPdf</span> <span class="kn">import</span> <span class="n">PdfFileWriter</span><span class="p">,</span> <span class="n">PdfFileReader</span>

<span class="k">def</span> <span class="nf">compareByActualNumbers</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
    <span class="n">strippedX</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">x</span><span class="p">)[:</span><span class="o">-</span><span class="mf">4</span><span class="p">]</span>
    <span class="n">strippedY</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">y</span><span class="p">)[:</span><span class="o">-</span><span class="mf">4</span><span class="p">]</span>

    <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">strippedX</span><span class="o">.</span><span class="n">isdigit</span><span class="p">()</span> <span class="ow">and</span> <span class="n">strippedY</span><span class="o">.</span><span class="n">isdigit</span><span class="p">()):</span>
        <span class="k">return</span> <span class="mf">0</span>

    <span class="n">xInt</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">strippedX</span><span class="p">)</span>
    <span class="n">yInt</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">strippedY</span><span class="p">)</span>

    <span class="k">if</span> <span class="n">xInt</span> <span class="o">&lt;</span> <span class="n">yInt</span><span class="p">:</span>
        <span class="k">return</span> <span class="o">-</span><span class="mf">1</span>
    <span class="k">elif</span> <span class="n">xInt</span> <span class="o">==</span> <span class="n">yInt</span><span class="p">:</span>
        <span class="k">return</span> <span class="mf">0</span>
    <span class="k">elif</span> <span class="n">xInt</span> <span class="o">&gt;</span> <span class="n">yInt</span><span class="p">:</span>
        <span class="k">return</span> <span class="mf">1</span>

<span class="k">def</span> <span class="nf">main</span><span class="p">(</span><span class="n">argv</span><span class="p">):</span>
    <span class="n">fullPath</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mf">1</span><span class="p">])</span>
    <span class="n">outputFileName</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">fullPath</span><span class="p">,</span> <span class="s">&quot;fullBook.pdf&quot;</span><span class="p">)</span>
    <span class="k">print</span> <span class="s">&quot;Looking at </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">fullPath</span>

    <span class="n">outputPDF</span> <span class="o">=</span> <span class="n">PdfFileWriter</span><span class="p">()</span>

    <span class="n">pdfList</span> <span class="o">=</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">fullPath</span><span class="p">,</span> <span class="s">&#39;*.pdf&#39;</span><span class="p">))</span>
    <span class="n">sortedPdfList</span> <span class="o">=</span> <span class="n">sorted</span><span class="p">(</span><span class="n">pdfList</span><span class="p">,</span> <span class="n">compareByActualNumbers</span><span class="p">)</span>

    <span class="n">pp</span> <span class="o">=</span> <span class="n">pprint</span><span class="o">.</span><span class="n">PrettyPrinter</span><span class="p">(</span><span class="n">indent</span><span class="o">=</span><span class="mf">2</span><span class="p">)</span>
    <span class="n">pp</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="n">sortedPdfList</span><span class="p">)</span>

    <span class="k">for</span> <span class="n">chapPdf</span> <span class="ow">in</span> <span class="n">sortedPdfList</span><span class="p">:</span>
        <span class="n">pdfInput</span> <span class="o">=</span> <span class="n">PdfFileReader</span><span class="p">(</span><span class="nb">file</span><span class="p">(</span><span class="n">chapPdf</span><span class="p">,</span> <span class="s">&quot;rb&quot;</span><span class="p">))</span>
        <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">xrange</span><span class="p">(</span><span class="n">pdfInput</span><span class="o">.</span><span class="n">getNumPages</span><span class="p">()):</span>
            <span class="n">outputPDF</span><span class="o">.</span><span class="n">addPage</span><span class="p">(</span><span class="n">pdfInput</span><span class="o">.</span><span class="n">getPage</span><span class="p">(</span><span class="n">i</span><span class="p">))</span>

    <span class="c"># finally, write &quot;output&quot; to document-output.pdf</span>
    <span class="n">outputStream</span> <span class="o">=</span> <span class="nb">file</span><span class="p">(</span><span class="n">outputFileName</span><span class="p">,</span> <span class="s">&quot;wb&quot;</span><span class="p">)</span>
    <span class="n">outputPDF</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">outputStream</span><span class="p">)</span>
    <span class="n">outputStream</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>

<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span>
    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mf">2</span><span class="p">:</span>
        <span class="k">print</span> <span class="s">&quot;Supply directory as argument&quot;</span>
        <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">()</span>

    <span class="n">main</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span>
</pre>
</div>
</pre>
<p>You can download the scripts from the <a href="http://www.codedemigod.com/projects">My Projects</a> section. The code will be licensed under the GNU GPL.</p>
<p>Note to publishers, you really should step into the 21st century. Especially for the technical books, I really don&#8217;t want to pay shipping costs that are more than the price of the book, the printing costs and all the other unneeded crap&#8230;I just want the content. This is especially true for technical books that get outdated very quickly such as books about frameworks.</p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=163</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Photos from BarCamp-Lebanon</title>
		<link>http://codedemigod.com/blog/?p=160</link>
		<comments>http://codedemigod.com/blog/?p=160#comments</comments>
		<pubDate>Sun, 01 Mar 2009 19:13:01 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[barcamp-lebanon]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=160</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp1.jpg" alt="BarCamp-Lebanon" /></p>
<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp2.jpg" alt="BarCamp-Lebanon" /></p>
<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp3.jpg" alt="BarCamp-Lebanon" /></p>
<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp4.jpg" alt="BarCamp-Lebanon" /></p>
<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp5.jpg" alt="BarCamp-Lebanon" /></p>
<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp6.jpg" alt="BarCamp-Lebanon" /></p>
<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp7.jpg" alt="BarCamp-Lebanon" /></p>
<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp8.jpg" alt="BarCamp-Lebanon" /></p>
<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp9.jpg" alt="BarCamp-Lebanon" /></p>
<p><img src="http://www.codedemigod.com/staticmedia/images/barcamp10.jpg" alt="BarCamp-Lebanon" /></p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=160</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>#barcamp-lebanon Conclusion</title>
		<link>http://codedemigod.com/blog/?p=158</link>
		<comments>http://codedemigod.com/blog/?p=158#comments</comments>
		<pubDate>Sun, 01 Mar 2009 10:09:57 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[barcamp-lebanon]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=158</guid>
		<description><![CDATA[BarCamp-Lebanon was great yesterday. Met some interesting people. Attended some interesting sessions(except for the 3rd one which was a waste of my time, notice no coverage) and was surprised at the abundance of geeks and geekets attending. And speaking of things that were good, that veggie pizza was great&#8230;. We also all agreed that we [...]]]></description>
			<content:encoded><![CDATA[<p>BarCamp-Lebanon was great yesterday. Met some interesting people. Attended some interesting sessions(except for the 3rd one which was a waste of my time, notice no coverage) and was surprised at the abundance of geeks and geekets attending. And speaking of things that were good, that veggie pizza was great&#8230;.</p>
<p>We also all agreed that we need more barcamps, more meet ups and more gatherings like this. To facilitate collaboration between entrepreneurs, hackers, and geeks in general. Very exciting indeed&#8230;</p>
<p>I feel like a 90 year old today and I&#8217;m paying the price of all of yesterday&#8217;s excitement. So forgive me my uploading speed&#8230;.next up, the photos.</p>
<p>I&#8217;d like to thank the organizers of BarCamp-Lebanon, especially David and Sami. If you&#8217;d like to know more about the barcamp, you can visit the wiki page at <a href="http://www.barcamp.org/OpenSesame-BarCamp-Lebanon-notes">BarCamp-Lebanon</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=158</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Session2 at #barcamp-lebanon, organizing hacker meetup</title>
		<link>http://codedemigod.com/blog/?p=155</link>
		<comments>http://codedemigod.com/blog/?p=155#comments</comments>
		<pubDate>Sat, 28 Feb 2009 12:57:46 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[barcamp-lebanon]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=155</guid>
		<description><![CDATA[Just 4 people in attendance&#8230;oooh, not a lot of people want to meet up, what does that mean? Would like to organize hacker meet ups for coding challenges, general coding&#8230;. Gathering ideas about this issue and getting feedback. Interesting. Presenter saying, &#8220;programming sucks&#8221;&#8230;really? I don&#8217;t think so. Also talking that we should have meet ups [...]]]></description>
			<content:encoded><![CDATA[<p>Just 4 people in attendance&#8230;oooh, not a lot of people want to meet up, what does that mean?<br />
Would like to organize hacker meet ups for coding challenges, general coding&#8230;.</p>
<p>Gathering ideas about this issue and getting feedback. Interesting. Presenter saying, &#8220;programming sucks&#8221;&#8230;really? I don&#8217;t think so.</p>
<p>Also talking that we should have meet ups for sharing knowledge&#8230;completely agree. Building up tech meet ups that are fun.</p>
<p>Somebody pitching something called lebgeeks in this session to get more feedback.<br />
I am all in for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=155</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>barcamp-lebanon session about IP Law and creative commons</title>
		<link>http://codedemigod.com/blog/?p=152</link>
		<comments>http://codedemigod.com/blog/?p=152#comments</comments>
		<pubDate>Sat, 28 Feb 2009 11:05:28 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[barcamp-lebanon]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=152</guid>
		<description><![CDATA[Currently attending #barcamp-lebanon. Sitting in a session about IP law and creative commons. The main question is why don&#8217;t we promote creative commons as a way for brand recognition in this part of the world. This is specifically true for Arab media networks which are unknown in the western world. Basically, since the cost of [...]]]></description>
			<content:encoded><![CDATA[<p>Currently attending #barcamp-lebanon. Sitting in a session about IP law and creative commons. The main question is why don&#8217;t we promote creative commons as a way for brand recognition in this part of the world. This is specifically true for Arab media networks which are unknown in the western world.</p>
<p>Basically, since the cost of digital distribution is going down, we should use that to promote our brands, our knowledge and even our education.</p>
<p>Discussion moving on towards piracy and why is it widespread in this part of the world. Somebody noted that it is actually a much bigger problem in Asia and is a big problem throughout the world. General consensus is that media distribution that is in place is broken&#8230;Having a broken system promotes sharing and some people took it further towards piracy.</p>
<p>Speaker promoting using creative commons for digital content&#8230;for non-commercial use. I am not sure about that. I am not against commercial uses, just the way the content is distributed and sold.</p>
<p>Talk about collecting societies, interesting idea&#8230;never head about it before. Still not sure. What is being said doesn&#8217;t really chime with what i think. Maybe because i write software instead of producing digital media.</p>
<p>I feel like listening to a soft Richard Stallman, &#8220;sharing is good&#8221;&#8230;.   </p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=152</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quote of the week</title>
		<link>http://codedemigod.com/blog/?p=151</link>
		<comments>http://codedemigod.com/blog/?p=151#comments</comments>
		<pubDate>Fri, 13 Feb 2009 05:08:41 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=151</guid>
		<description><![CDATA[Something interesting that i heard certainly qualifies to be quote of the week. &#8220;Server administration is very easy because all the answers are found via Google or forums.&#8221; Would you say this is funny or sad?]]></description>
			<content:encoded><![CDATA[<p>Something interesting that i heard certainly qualifies to be quote of the week. &#8220;Server administration is very easy because all the answers are found via Google or forums.&#8221;</p>
<p>Would you say this is funny or sad?</p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=151</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s implement one more</title>
		<link>http://codedemigod.com/blog/?p=149</link>
		<comments>http://codedemigod.com/blog/?p=149#comments</comments>
		<pubDate>Wed, 11 Feb 2009 19:19:50 +0000</pubDate>
		<dc:creator>Alaa</dc:creator>
				<category><![CDATA[crazy work]]></category>

		<guid isPermaLink="false">http://codedemigod.com/blog/?p=149</guid>
		<description><![CDATA[We&#8217;re going to have 3(yes, 3) applications that implement the same charging feature, each with its own set of bugs. At least those are the 3 that i know about. But hey, why stop there&#8230;.let&#8217;s implement a couple more. Oh yeah, and say it with me folks. Its called Inter-process communication. For people who don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re going to have 3(yes, 3) applications that implement the same charging feature, each with its own set of bugs. At least those are the 3 that i know about. But hey, why stop there&#8230;.let&#8217;s implement a couple more.</p>
<p>Oh yeah, and say it with me folks. Its called Inter-process communication.</p>
<p>For people who don&#8217;t want to re-invent the wheel, we sure are manufacturing a lot of horse-driven carriages.</p>
]]></content:encoded>
			<wfw:commentRss>http://codedemigod.com/blog/?feed=rss2&amp;p=149</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
