<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:posterous="http://posterous.com/help/rss/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
  <channel>
    <title>Brain Spill</title>
    <link>http://amjith.posterous.com</link>
    <description>A dumping ground for my incomplete and incoherent thoughts</description>
    <generator>posterous.com</generator>
    <link xmlns="http://www.w3.org/2005/Atom" href="http://posterous.com/api/sup_update#9e1c5c6e8" type="application/json" rel="http://api.friendfeed.com/2008/03#sup" />
    
    
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BrainSpit" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="brainspit" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://posterous.superfeedr.com/" /><item>
      <pubDate>Fri, 10 Feb 2012 08:03:00 -0800</pubDate>
      <title>Memoization Decorator</title>
      <link>http://amjith.posterous.com/memoization-decorator</link>
      <guid>http://amjith.posterous.com/memoization-decorator</guid>
      <description>
        <![CDATA[<p>
	<p>Recently I had the opportunity to give a short 10 min presentation on Memoization Decorator at our local UtahPython Users Group meeting.&nbsp;</p>
<blockquote>
<p><strong>Memoization:&nbsp;</strong></p>
<ul>
<li>Everytime a function is called, save the results in a cache (map).</li>
<li>Next time the function is called with the exact same args, return the value from the cache instead of running the function.</li>
</ul>
</blockquote>
<p>The code for memoization decorator for python is here: <a href="http://wiki.python.org/moin/PythonDecoratorLibrary#Memoize">http://wiki.python.org/moin/PythonDecoratorLibrary#Memoize</a></p>
<p><strong>Example:</strong></p>
<p>The typical recursive implementation of fibonacci calculation is pretty inefficient O(2^n).&nbsp;<span style=""> &nbsp;</span></p>
<div class="CodeRay">
  <div class="code"><pre>def fibonacci(num):
        print 'fibonacci(%d)'%num
        if num in (0,1):
            return num
        return fibonacci(num-1) + fibonacci(num-2)

&gt;&gt;&gt; math_funcs.fibonacci(4)   # 9 function calls
    fibonacci(4)
    fibonacci(3)
    fibonacci(2)
    fibonacci(1)
    fibonacci(0)
    fibonacci(1)
    fibonacci(2)
    fibonacci(1)
    fibonacci(0)
    3</pre></div>
</div>

<p><span style="">But the memoized version makes it ridiculously efficient O(n) with very little effort.</span></p>
<div class="CodeRay">
  <div class="code"><pre><span class="keyword">import</span> <span class="include">memoized</span>
<span class="decorator">@memoized</span>
<span class="keyword">def</span> <span class="function">fibonacci</span>(num):
    <span class="keyword">print</span> <span class="string"><span class="delimiter">'</span><span class="content">fibonacci(%d)</span><span class="delimiter">'</span></span>%num
    <span class="keyword">if</span> num <span class="keyword">in</span> (<span class="integer">0</span>,<span class="integer">1</span>):
        <span class="keyword">return</span> num
    <span class="keyword">return</span> fibonacci(num-<span class="integer">1</span>) + fibonacci(num-<span class="integer">2</span>)
    
&gt;&gt;&gt; math_funcs.mfibonacci(<span class="integer">4</span>)  <span class="comment"># 5 function calls</span>
    fibonacci(<span class="integer">4</span>)
    fibonacci(<span class="integer">3</span>)
    fibonacci(<span class="integer">2</span>)
    fibonacci(<span class="integer">1</span>)
    fibonacci(<span class="integer">0</span>)
    <span class="integer">3</span></pre></div>
</div>

<div>
<p><strong>We just converted an algorithm from Exponential Complexity to Linear Complexity by simply adding the memoization decorator.</strong></p>
<p><strong>Slides</strong>:</p>
<p><div class='p_embed p_file_embed'>
<a href="http://amjith.posterous.com/memoization-decorator"><img alt="" src="http://posterous.com/images/filetypes/pdf.png" /></a>
<div class='p_embed_description'>
<strong>memoization_decorator.pdf</strong>
<a href="http://getfile2.posterous.com/getfile/files.posterous.com/temp-2012-02-09/ABJIsraBFJgdphmHutxtpBhxuGxjvHkhngggjwzGbwBBnbnDIrrfdapunjzr/memoization_decorator.pdf">Download this file</a>
</div>
</div>
</p>
<p><strong>Presentation:</strong></p>
<p>I generated the slides using LaTeX Beamer. But instead of writing raw LaTeX code I used reStructured Text (rst) and used rst2beamer script to generate the .tex file.&nbsp;</p>
<p><strong>Source:</strong></p>
<p>The rst file and tex files are available in Github.</p>
<p><a href="https://github.com/amjith/User-Group-Presentations/tree/master/memoization_decorator">https://github.com/amjith/User-Group-Presentations/tree/master/memoization_de...</a></p>
<p>&nbsp;</p>
</div>
	
</p>

<p><a href="http://amjith.posterous.com/memoization-decorator">Permalink</a> 

	| <a href="http://amjith.posterous.com/memoization-decorator#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Thu, 09 Feb 2012 22:09:09 -0800</pubDate>
      <title>Productive Meter </title>
      <link>http://amjith.posterous.com/100506320</link>
      <guid>http://amjith.posterous.com/100506320</guid>
      <description>
        <![CDATA[<p>
	<p>A few weeks ago I decided that I should suck it up and start learning how to develop for the web. After asking around, my faithful community brethren, I decided to learn Django from its <a href="https://docs.djangoproject.com/en/1.3/intro/tutorial01/">docs</a>.&nbsp;</p>
<p>::Django documentation is awesome::</p>
<p>Around this time I came across this post about <a href="http://www.mattgreer.org/post/2fiveam">Waking up at 5am to code</a>. I tried it a few times and it worked wonders. I've been working on a small project that can keep track of my productivity on the computer. The concept is really simple, just log the window that is on top and find a way to display that data in a meaningful way.&nbsp;</p>
<p>Today's 5am session got me to a milestone on my project. I am finally able to visaulize the time I spend using a decent looking graph. Which is a huge milestone for someone who learned how to display html tables 3 weeks ago.</p>
<p><strong>Tools:</strong></p>
<ul>
<li><a href="https://www.djangoproject.com/">Django</a>&nbsp;for backend</li>
<li><a href="http://www.sqlite.org/">Sqlite</a></li>
<li><a href="http://haystacksearch.org/">Haystack/Solr</a> - search backend for Django</li>
<li><a href="http://fancybox.net/">FancyBox</a> - jquery plugin</li>
<li><a href="http://code.google.com/p/flot/">flot</a> - jquery plotting lib</li>
<li><a href="http://twitter.github.com/bootstrap/">Bootstrap</a> - html/css</li>
</ul>
<p>A huge thanks to my irc friends and random geeks who wrote awesome blog posts and SO answers on every problem I encountered.</p>
<p>I will be open-sourcing the app pretty soon. Stay tuned.</p>
<p><div class='p_embed p_image_embed'>
<a href="http://getfile8.posterous.com/getfile/files.posterous.com/temp-2012-02-09/duGEaJvxHAffFfposnvqldjhhmCEAvhDBmIvhrlsFqqGhbqJcrvfwCzbudAf/productive_meter_screenshot.png.scaled1000.png"><img alt="Productive_meter_screenshot" height="313" src="http://getfile6.posterous.com/getfile/files.posterous.com/temp-2012-02-09/duGEaJvxHAffFfposnvqldjhhmCEAvhDBmIvhrlsFqqGhbqJcrvfwCzbudAf/productive_meter_screenshot.png.scaled600.png" width="600" /></a>
<a href="http://getfile3.posterous.com/getfile/files.posterous.com/temp-2012-02-09/ohgFstdpHDqsdhsFfHIEGamrgAnpFGijwixccArgwerwwlrFtluAbkDIprxi/productive_meter_screenshot1.png.scaled1000.png"><img alt="Productive_meter_screenshot1" height="268" src="http://getfile4.posterous.com/getfile/files.posterous.com/temp-2012-02-09/ohgFstdpHDqsdhsFfHIEGamrgAnpFGijwixccArgwerwwlrFtluAbkDIprxi/productive_meter_screenshot1.png.scaled600.png" width="600" /></a>
<div class='p_see_full_gallery'><a href="http://amjith.posterous.com/100506320">See the full gallery on Posterous</a></div>
</div>
</p>
	
</p>

<p><a href="http://amjith.posterous.com/100506320">Permalink</a> 

	| <a href="http://amjith.posterous.com/100506320#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
      <media:content type="image/png" height="730" width="1398" url="http://getfile3.posterous.com/getfile/files.posterous.com/temp-2012-02-09/duGEaJvxHAffFfposnvqldjhhmCEAvhDBmIvhrlsFqqGhbqJcrvfwCzbudAf/productive_meter_screenshot.png">
        <media:thumbnail height="261" width="500" url="http://getfile9.posterous.com/getfile/files.posterous.com/temp-2012-02-09/duGEaJvxHAffFfposnvqldjhhmCEAvhDBmIvhrlsFqqGhbqJcrvfwCzbudAf/productive_meter_screenshot.png.scaled500.png" />
      </media:content>
      <media:content type="image/png" height="711" width="1594" url="http://getfile8.posterous.com/getfile/files.posterous.com/temp-2012-02-09/ohgFstdpHDqsdhsFfHIEGamrgAnpFGijwixccArgwerwwlrFtluAbkDIprxi/productive_meter_screenshot1.png">
        <media:thumbnail height="223" width="500" url="http://getfile4.posterous.com/getfile/files.posterous.com/temp-2012-02-09/ohgFstdpHDqsdhsFfHIEGamrgAnpFGijwixccArgwerwwlrFtluAbkDIprxi/productive_meter_screenshot1.png.scaled500.png" />
      </media:content>
    </item>
    <item>
      <pubDate>Mon, 21 Nov 2011 22:29:00 -0800</pubDate>
      <title>Too Many Classes Too Little Time</title>
      <link>http://amjith.posterous.com/too-many-classes-too-little-time</link>
      <guid>http://amjith.posterous.com/too-many-classes-too-little-time</guid>
      <description>
        <![CDATA[<p>
	<p>I'm taking a couple of the free online classes offered by Standford. One on <a href="http://ai-class.org">Artifical Intelligence</a> and one on <a href="http://ml-class.org">Machine Learning</a>.&nbsp;</p>
<p>I haven't had so much fun since kindergarten. Actually that's not fair, I didn't enjoy kindergarten this much. I'm listening to the classes during my lunch, after work, during weekends. I'm working on my assignment with so much enthusiasm, I dread the day when this class ends.&nbsp;</p>
<p>Stanford just announced a slew of new <a href="http://www.hci-class.org/">online</a> classes offered starting in Jan 2012. I was way too excited when I first read the description on them. Now I'm a little sad, becasue I want to take 8 out of the 11 courses that are being offered and I don't have enough time. :(</p>
<p>Woe is me.&nbsp;</p>
<p>ps: If you are not taking any of these classes you are missing out big time. Please do yourself a favor and sign up.&nbsp;</p>
	
</p>

<p><a href="http://amjith.posterous.com/too-many-classes-too-little-time">Permalink</a> 

	| <a href="http://amjith.posterous.com/too-many-classes-too-little-time#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Mon, 17 Oct 2011 21:52:00 -0700</pubDate>
      <title>Picking 'k' items from a list of 'n' - Recursion</title>
      <link>http://amjith.posterous.com/picking-k-items-from-a-list-of-n-recursion</link>
      <guid>http://amjith.posterous.com/picking-k-items-from-a-list-of-n-recursion</guid>
      <description>
        <![CDATA[<p>
	<p>Let me preface this post by saying I suck at recursion. But it never stopped me from trying to master it. Here is my latest (successful) attempt at an algorithm that required recursion.&nbsp;</p>
<p><strong>Background:&nbsp;</strong></p>
<p>You can safely skip this section if you're not interested in the back story behind why I decided to code this up.&nbsp;</p>
<p>I was listening to <a href="http://www.khanacademy.org/">KhanAcademy</a> videos on <a href="http://www.khanacademy.org/#probability">probability</a>. I was particularly intrigued by the combinatorics <a href="http://www.khanacademy.org/video/getting-exactly-two-heads--combinatorics?playlist=Probability">video</a>. The formula to calculate the number of combinations of nCr was simple, but I wanted to print all the possible combinations of nCr.&nbsp;</p>
<p><strong>Problem Statement:</strong></p>
<p>Given 'ABCD' what are the possible outcomes if you pick 3 letters from it to form a combination without repetition (i.e. 'ABC' is the same as 'BAC').&nbsp;</p>
<p>At first I tried to solve this using an iterative method and gave up pretty quickly. It was clearly designed to be a recursive problem. After 4 hours of breaking my head I finally got a working algorithm using recursion. I was pretty adamant about not looking it up online but I seeked some help from IRC (Thanks <a href="http://www.jtolds.com/">jtolds</a>).&nbsp;</p>
<p><strong>Code:&nbsp;</strong></p>
<div class="CodeRay">
  <div class="code"><pre><span class="kw">def</span> <span class="fu">combo</span>(w, l):
        lst = []
        <span class="kw">if</span> l &lt; <span class="i">1</span>:
            <span class="kw">return</span> lst
        <span class="kw">for</span> i <span class="kw">in</span> <span class="pd">range</span>(<span class="pd">len</span>(w)):
            <span class="kw">if</span> l == <span class="i">1</span>:
                lst.append(w[i])
            <span class="kw">for</span> c <span class="kw">in</span> combo(w[i+<span class="i">1</span>:], l-<span class="i">1</span>):
                lst.append(w[i] + c)
        <span class="kw">return</span> lst</pre></div>
</div>

<p><strong>Output:</strong></p>
<div class="CodeRay">
  <div class="code"><pre>&gt;&gt;&gt; combinations.combo(<span class="s"><span class="dl">'</span><span class="k">abcde</span><span class="dl">'</span></span>,<span class="i">3</span>)
    [<span class="s"><span class="dl">'</span><span class="k">abc</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">abd</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">abe</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">acd</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">ace</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">ade</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">bcd</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">bce</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">bde</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">cde</span><span class="dl">'</span></span>]</pre></div>
</div>

<p><strong>Thoughts:</strong></p>
<ul>
<li>It helps to think about recursion with the assumption that an answer for step n-1 already exists.</li>
<li>If you are getting partial answers check the condition surrounding the return statement.</li>
<li>Recursion is still not clear (or easy).&nbsp;</li>
</ul>
<p>I have confirmed that this works for bigger data sets and am quite happy with this small victory.</p>
	
</p>

<p><a href="http://amjith.posterous.com/picking-k-items-from-a-list-of-n-recursion">Permalink</a> 

	| <a href="http://amjith.posterous.com/picking-k-items-from-a-list-of-n-recursion#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Thu, 13 Oct 2011 21:40:00 -0700</pubDate>
      <title>Python Profiling</title>
      <link>http://amjith.posterous.com/python-profiling</link>
      <guid>http://amjith.posterous.com/python-profiling</guid>
      <description>
        <![CDATA[<p>
	<p>I did a presentation at our <a href="http://www.utahpython.org">local Python User Group</a> meeting tonight. It was well received, but shorter than I had expected. I should've added a lot more code examples.&nbsp;</p>
<p>We talked about usage of cProfile, pstats, runsnakerun and timeit.&nbsp;</p>
<p>Here are the slides from the presentations:&nbsp;<div class='p_embed p_file_embed'>
<a href="http://amjith.posterous.com/python-profiling"><img alt="" src="http://posterous.com/images/filetypes/pdf.png" /></a>
<div class='p_embed_description'>
<strong>profiling.pdf</strong>
<a href="http://posterous.com/getfile/files.posterous.com/temp-2011-10-13/pCsdDJzrunbCFrsGCpsFhtlGfDezIvCguaukziGikyquDoEiIIqAesuIiJwi/profiling.pdf">Download this file</a>
</div>
</div>
</p>
<p>The slides were done using <a href="http://en.wikipedia.org/wiki/Beamer_(LaTeX)">latex-beamer</a>, but I wrote the slides in <a href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> and used <a href="http://www.agapow.net/programming/python/rst2beamer">rst2beamer</a> to create the tex file which was then converted to pdf using pdflatex.&nbsp;</p>
<p>The source code for the slides are available on&nbsp;<a>github</a>.</p>
	
</p>

<p><a href="http://amjith.posterous.com/python-profiling">Permalink</a> 

	| <a href="http://amjith.posterous.com/python-profiling#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 04 Oct 2011 22:31:00 -0700</pubDate>
      <title>Programming - A Gateway Drug to Math</title>
      <link>http://amjith.posterous.com/programming-a-gateway-drug-to-math</link>
      <guid>http://amjith.posterous.com/programming-a-gateway-drug-to-math</guid>
      <description>
        <![CDATA[<p>
	
<div>
<p>I decided to try my hand at the Stanford's&nbsp;<a href="http://www.ai-class.com/">AI Class</a>.&nbsp;The pre-requisites mentioned Probability and Linear Algebra. So I started watching Probability videos on&nbsp;<a href="http://www.khanacademy.org/#probability">KhanAcademy</a>.&nbsp;</p>
<p>Sal Khan was teaching how to find the probability of 2 heads when you toss a coin 5 times.</p>
<p>A classic nCk problem:&nbsp;</p>
<p style="text-align: center;"><img title="This is the rendered form of the equation. You can not edit this directly. Right click will give you the option to save the image, and in most browsers you can drag the image onto your desktop or another program." src="http://latex.codecogs.com/gif.latex?\small%20_nC_k%20=%20\frac{n!}{k!(n-k)!}" alt="" style="margin: 10px;" /></p>
</div>
<p>The probability of getting 2 heads while tossing a coin 5 times is:</p>
<div>
<div style="text-align: center;"><img title="This is the rendered form of the equation. You can not edit this directly. Right click will give you the option to save the image, and in most browsers you can drag the image onto your desktop or another program." src="http://latex.codecogs.com/gif.latex?P(2)%20=%20\frac{{_5C_2}}{2^5}" alt="" style="margin: 10px;" /></div>
</div>
<div>But I wanted to find out the probability of getting at least 2 heads when I toss 5 coins.</div>
<div>Its really simple. All I had to do is P(2) + P(3) + P(4) + P(5).&nbsp;</div>
<div>But then computing<img src="http://latex.codecogs.com/gif.latex?_nC_k" alt="" style="margin: 10px;" />by hand (or a calculator) was painfully slow, let alone do it 4 times.</div>
<div>So I wrote two little functions in Python that will calculate factorial (yes I reinvented the wheel) and<img src="http://latex.codecogs.com/gif.latex?_nC_k" alt="" style="margin: 10px;" /></div>
<div><strong>Nothing teaches you math faster than trying to write a program to do the math for you.&nbsp;</strong></div>
<div>Writing a program is the same as teaching the computer how to do a certain task. The only way you can teach someone to do a task is to become a master at doing that task yourself.</div>
<div><br />Bonus: It also teaches you corner cases like 0! = 1 and&nbsp;<img src="http://latex.codecogs.com/gif.latex?\small%20_5C_5%20=%201" alt="" style="margin: 10px;" />&nbsp;that you wouldn't think of otherwise.</div>
	
</p>

<p><a href="http://amjith.posterous.com/programming-a-gateway-drug-to-math">Permalink</a> 

	| <a href="http://amjith.posterous.com/programming-a-gateway-drug-to-math#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 04 Oct 2011 20:38:00 -0700</pubDate>
      <title>Rant about C++ dependency hell</title>
      <link>http://amjith.posterous.com/rant-about-c-dependency-hell</link>
      <guid>http://amjith.posterous.com/rant-about-c-dependency-hell</guid>
      <description>
        <![CDATA[<p>
	<p>When was the last time I vented about C++? The answer for that is always:</p>
<p>"TOO LONG AGO".&nbsp;</p>
<div>The initial friction to setup a substantial project using C++ is unfucking bearable.</div>
<p />
<div>When we started code revamp at work recently, I decided to be a good citizen and decided to incorporate <a href="http://cpptest.sourceforge.net/">cpptest</a>, a unit testing framework in our project.</div>
<p />
<div>It made me realize how unreasonably complicated Makefiles can be. After 3 hours of peeling away at the complexity I managed to add cpptest to the build dependency of the project.&nbsp;</div>
<p />
<div>Now time to write a few tests and check it out.&nbsp;I'm thinking "We are almost there".&nbsp;</div>
<p />
<div>FALSE!</div>
<p />
<div>Compilation gives me a gazillion error messages that make absolutely no sense. After about 30mins of <a href="http://stackoverflow.com/">StackOverflowing</a> and Googling, I find out that its not enough to include string.h and map.h in my &nbsp;header files, but I also need to namespace it. Of course there is no indication (not even a hint) of that in the error messages. So I add 'using namespace std' and get past it.</div>
<p />
<div>Awesome my first test is compiling successfully. Time to run this baby and declare victory.&nbsp;</div>
<p />
<div>Close! But no cigar.</div>
<p />
<div>The executable was unable to load the CppTest library during runtime. Argh!</div>
<p />
<div>I set my LD_LIBRARY_PATH env variable and now it's running. But I can't ask everyone in my team to do that, so I have to figure out how to statically link that library.&nbsp;</div>
<p />
<div>It's already 6pm and I'm hungry. That'll have to wait for another day.&nbsp;</div>
<p />
<div>TL;DR - C++ and Makefile can burn in a fire of thousand suns.</div>
	
</p>

<p><a href="http://amjith.posterous.com/rant-about-c-dependency-hell">Permalink</a> 

	| <a href="http://amjith.posterous.com/rant-about-c-dependency-hell#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Sun, 25 Sep 2011 19:45:55 -0700</pubDate>
      <title>Rapid Prototyping in Python</title>
      <link>http://amjith.posterous.com/rapid-prototyping-in-python</link>
      <guid>http://amjith.posterous.com/rapid-prototyping-in-python</guid>
      <description>
        <![CDATA[<p>
	<p>I was recently assigned to a new project at work. Like any good software engineer I started writing the pseudocode for the modules. We use C++ at work to write our programs.</p>
<p>I quickly realized it's not easy to translate programming ideas to English statements without a syntactic structure. When I was whining about it to Vijay, he told me to try prototyping it in Python instead of writing pseudocode. Intrigued by this, I decided to write a prototype in Python to test how various modules will come together.</p>
<p>Surprisingly it took me a mere 2 hours to code up the prototype. I can't emphasize enough, how effortless it was in Python.</p>
<h2>What makes Python an ideal choice for prototyping:</h2>
<p><strong>Dynamically typed language:</strong></p>
<p>Python doesn't require you to declare the datatype of a variable. This lets you write a function that is generic enough to handle any kind of data. For eg:</p>
<div class="CodeRay">
  <div class="code"><pre><span class="kw">def</span> <span class="fu">max_val</span>(a,b):
    <span class="kw">return</span> a <span class="kw">if</span> a &gt;b <span class="kw">else</span> b</pre></div>
</div>

<p>This function can take integers, floats, strings, a combination of any of those, or lists, dictionaries, tuples, whatever.</p>
<p>A list in Python need not be homogenous. This is a perfectly good list:</p>
<div class="CodeRay">
  <div class="code"><pre>[<span class="i">1</span>, <span class="s"><span class="dl">'</span><span class="k">abc</span><span class="dl">'</span></span>, [<span class="i">1</span>,<span class="i">2</span>,<span class="i">3</span>]]</pre></div>
</div>

<p>This lets you pack data in unique ways on the fly which can later be translated to a class or a struct in a statically typed language like C++.</p>
<div class="CodeRay">
  <div class="code"><pre><span class="r">class</span> <span class="cl">newDataType</span>
{
    <span class="pt">int</span> i;
    String str;
    Vector vInts;
};</pre></div>
</div>

<p><strong>Rich Set to Data-Structures:</strong></p>
<p>Built-in support for lists, dictionaries, sets, etc reduces the time involved in hunting for a library that provides you those basic data-structures.</p>
<p><strong>Expressive and Succinct:</strong></p>
<p>The algorithms that operate on the data-structures are intuitive and simple to use. The final code is more readable than a pseudocode.</p>
<p>For example: Lets check if a list has an element</p>
<div class="CodeRay">
  <div class="code"><pre>&gt;&gt;&gt; lst = [<span class="i">1</span>,<span class="i">2</span>,<span class="i">3</span>]    <span class="c"># Create a list</span>
&gt;&gt;&gt; res = <span class="i">2</span> <span class="kw">in</span> lst   <span class="c"># Check if 2 is in 'lst'</span>
<span class="pc">True</span></pre></div>
</div>

<p>If we have to do it in C++.</p>
<div class="CodeRay">
  <div class="code"><pre>list lst;
lst.push_back(<span class="i">3</span>);
lst.push_back(<span class="i">1</span>);
lst.push_back(<span class="i">7</span>);
list::iterator result = find(lst.begin(), lst.end(), <span class="i">7</span>); 
<span class="pt">bool</span> res = (result != lst.end())</pre></div>
</div>

<p><strong>Python Interpreter and Help System:</strong></p>
<p>This is a huge plus. The presence of interpreter not only aids you in testing snippets of code, but it acts as an help system. Lets say we want to look up the functions that operate on a List.</p>
<div class="CodeRay">
  <div class="code"><pre>&gt;&gt;&gt; <span class="pd">dir</span>([])
[<span class="s"><span class="dl">'</span><span class="k">__add__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__class__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__contains__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__delattr__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__delitem__</span><span class="dl">'</span></span>,
<span class="s"><span class="dl">'</span><span class="k">__delslice__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__doc__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__eq__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__format__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__ge__</span><span class="dl">'</span></span>, 
<span class="s"><span class="dl">'</span><span class="k">__getattribute__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__getitem__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__getslice__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__gt__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__hash__</span><span class="dl">'</span></span>,
<span class="s"><span class="dl">'</span><span class="k">__iadd__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__imul__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__init__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__iter__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__le__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__len__</span><span class="dl">'</span></span>,
<span class="s"><span class="dl">'</span><span class="k">__lt__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__mul__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__ne__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__new__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__reduce__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__reduce_ex__</span><span class="dl">'</span></span>,
<span class="s"><span class="dl">'</span><span class="k">__repr__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__reversed__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__rmul__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__setattr__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__setitem__</span><span class="dl">'</span></span>,
<span class="s"><span class="dl">'</span><span class="k">__setslice__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__sizeof__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__str__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">__subclasshook__</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">append</span><span class="dl">'</span></span>,
<span class="s"><span class="dl">'</span><span class="k">count</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">extend</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">index</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">insert</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">pop</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">remove</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">reverse</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="k">sort</span><span class="dl">'</span></span>]

&gt;&gt;&gt; help([].sort)
Help on built-<span class="kw">in</span> function sort:
     
sort(...)
    L.sort(cmp=<span class="pc">None</span>, key=<span class="pc">None</span>, reverse=<span class="pc">False</span>) -- stable sort *IN PLACE*;
    <span class="pd">cmp</span>(x, y) -&gt; -<span class="i">1</span>, <span class="i">0</span>, <span class="i">1</span></pre></div>
</div>

<p><strong> Advantages of prototyping instead of pseudocode: </strong></p>
<ul>
<li>The type definition of the datastructures emerge as we code. </li>
<li>The edge cases start to emerge when you prototype. </li>
<li>A set of required supporting routines. </li>
<li>A better estimation of the time required to complete a task. </li>
</ul>
	
</p>

<p><a href="http://amjith.posterous.com/rapid-prototyping-in-python">Permalink</a> 

	| <a href="http://amjith.posterous.com/rapid-prototyping-in-python#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Sat, 27 Aug 2011 18:39:00 -0700</pubDate>
      <title>New Laptop</title>
      <link>http://amjith.posterous.com/new-laptop</link>
      <guid>http://amjith.posterous.com/new-laptop</guid>
      <description>
        <![CDATA[<p>
	
<div>
<p>I finally ordered a new Macbook air for myself. One of my friends remarked at the fact that this is the first brand new laptop that I've ordered for myself. Since I'm a bit of a Linux fanatic, I tend to restore old computers and install a linux distro and make them useable. So I always get old laptops for cheap for myself. But this time I decided it's time to checkout Mac OS X. So I'll be replacing my Netboook (yep!) with the Macbook air. Anyone need a Lenovo S10 netbook :). I will even do a clean-install of Ubuntu or your choice of Linux distro.&nbsp;</p>
<p>This new Macbook air will be my primary development machine. Let's hope it can take the abuse.</p>
</div>
<p>&nbsp;</p>
	
</p>

<p><a href="http://amjith.posterous.com/new-laptop">Permalink</a> 

	| <a href="http://amjith.posterous.com/new-laptop#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Sun, 07 Aug 2011 09:05:00 -0700</pubDate>
      <title>Falsetto dude and the Fat man</title>
      <link>http://amjith.posterous.com/falsetto-dude-and-the-fat-man</link>
      <guid>http://amjith.posterous.com/falsetto-dude-and-the-fat-man</guid>
      <description>
        <![CDATA[<p>
	<p>A typical conversation between my wife and I:&nbsp;</p>
<p />
<div>Playing Ne Me Quitte Pas by Nina Simone</div>
<p />
<div>
<object height="40" width="250">
<param name="movie" value="http://grooveshark.com/songWidget.swf" />
<param name="wmode" value="window" />
<param name="allowScriptAccess" value="always" />
<param name="flashvars" value="hostname=cowbell.grooveshark.com&amp;songIDs=19332692&amp;style=metal&amp;p=0" /><embed src="http://grooveshark.com/songWidget.swf" type="application/x-shockwave-flash" wmode="window" height="40" flashvars="hostname=cowbell.grooveshark.com&amp;songIDs=19332692&amp;style=metal&amp;p=0" width="250"></embed>
</object>
</div>
<p />
<div><strong>Yoshi</strong> : Ow! What is that abomination?&nbsp;</div>
<div><strong>Amjith</strong>: It's a french song sung by the great Nina Simone.</div>
<div><strong>Yoshi</strong> : It's a woman? Sounded like a dude singing in falsetto.</div>
<div><strong>Yoshi&nbsp;</strong>: I'm leaving the room if you don't change the song.</div>
<div><strong>Amjith</strong>: FINE. You play something then.</div>
<p />
<div>Yoshi puts on Ave Maria by Pavarotti.&nbsp;</div>
<div><span style="font-family: arial, sans-serif; font-size: 13px; background-color: #ffffff;"> 
<object height="40" width="250">
<param name="movie" value="http://grooveshark.com/songWidget.swf" />
<param name="wmode" value="window" />
<param name="allowScriptAccess" value="always" />
<param name="flashvars" value="hostname=cowbell.grooveshark.com&amp;songIDs=29024538&amp;style=metal&amp;p=0" /><embed src="http://grooveshark.com/songWidget.swf" type="application/x-shockwave-flash" wmode="window" height="40" flashvars="hostname=cowbell.grooveshark.com&amp;songIDs=29024538&amp;style=metal&amp;p=0" width="250"></embed>
</object>
</span></div>
<p />
<div><span style="font-family: arial, sans-serif; font-size: 13px; background-color: #ffffff;"><span style="font-family: arial; font-size: small;">I wait for 2 mins.</span></span></div>
<p />
<div><strong>Amjith</strong>: Hey! Your fat man seems to be yelling at Maria.&nbsp;</div>
<p />
<div>Yosh leaves the room and I sleep on the couch.</div>
<p />
<p />
<div>The End</div>
	
</p>

<p><a href="http://amjith.posterous.com/falsetto-dude-and-the-fat-man">Permalink</a> 

	| <a href="http://amjith.posterous.com/falsetto-dude-and-the-fat-man#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 03 Aug 2011 22:19:00 -0700</pubDate>
      <title>Scripting Tmux Layouts</title>
      <link>http://amjith.posterous.com/scripting-tmux-layouts</link>
      <guid>http://amjith.posterous.com/scripting-tmux-layouts</guid>
      <description>
        <![CDATA[<p>
	<p><a href="http://tmux.sourceforge.net/">Tmux</a> is an awesome replacement for Screen. I have a couple of standard terminal layouts for programming. One of them is show below.</p>
<ul>
<li><a href="http://vim.org">Vim</a> editor on the left.</li>
<li>Top right pane has the <a href="http://bpython-interpreter.org/">bpython</a> interpreter.&nbsp;</li>
<li>Bottom right pane has the bash prompt.&nbsp;</li>
</ul>
<p><div class='p_embed p_image_embed'>
<a href="http://posterous.com/getfile/files.posterous.com/temp-2011-08-03/ucgsvidqdagbhdmwJJsxkwBekFpBvGyBqijpupiChuavtsftveikrmbnHrEi/python_dev.png.scaled1000.png"><img alt="Python_dev" height="309" src="http://posterous.com/getfile/files.posterous.com/temp-2011-08-03/ucgsvidqdagbhdmwJJsxkwBekFpBvGyBqijpupiChuavtsftveikrmbnHrEi/python_dev.png.scaled600.png" width="600" /></a>
</div>
</p>
<p>I have a small tmux script in my ~/.tmux/pdev file that has the following lines</p>
<div class="CodeRay">
  <div class="code"><pre>selectp -t 0              # Select pane 0
splitw -h -p 50 'bpython' # Split pane 0 vertically by 50%
selectp -t 1              # Select pane 1
splitw -v -p 25           # Split pane 1 horizontally by 25%
selectp -t 0              # Select pane 0</pre></div>
</div>

<p>In my <a href="https://github.com/amjith/_dotties/blob/master/tmux.conf">tmux.conf</a> file I have bound &lt;prefix&gt;+P to sourcing this file. So now anytime I want to launch my python dev layout, I hit &lt;prefix&gt;+&lt;shift&gt;+p.&nbsp;</p>
<div class="CodeRay">
  <div class="code"><pre>bind P source-file ~/.tmux/pdev</pre></div>
</div>
	
</p>

<p><a href="http://amjith.posterous.com/scripting-tmux-layouts">Permalink</a> 

	| <a href="http://amjith.posterous.com/scripting-tmux-layouts#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
      <media:content type="image/png" height="825" width="1600" url="http://getfile1.posterous.com/getfile/files.posterous.com/temp-2011-08-03/ucgsvidqdagbhdmwJJsxkwBekFpBvGyBqijpupiChuavtsftveikrmbnHrEi/python_dev.png">
        <media:thumbnail height="258" width="500" url="http://getfile0.posterous.com/getfile/files.posterous.com/temp-2011-08-03/ucgsvidqdagbhdmwJJsxkwBekFpBvGyBqijpupiChuavtsftveikrmbnHrEi/python_dev.png.scaled500.png" />
      </media:content>
    </item>
    <item>
      <pubDate>Mon, 01 Aug 2011 22:38:12 -0700</pubDate>
      <title>Downloading Specific Filetypes using 'wget'</title>
      <link>http://amjith.posterous.com/downloading-specific-filetypes-using-wget</link>
      <guid>http://amjith.posterous.com/downloading-specific-filetypes-using-wget</guid>
      <description>
        <![CDATA[<p>
	<p>I decided to prepare myself for the <a href="http://www.ai-class.com/">Intro to AI</a>, a free online course offered by Stanford. I found the course website:&nbsp;<a href="http://www.stanford.edu/class/cs221/schedule.html">http://www.stanford.edu/class/cs221/schedule.html</a>&nbsp;and wanted to download all the slides.&nbsp;</p>
<p>It's time to pull all the ppt files from that page.</p>
<div class="CodeRay">
  <div class="code"><pre>wget -r -A.ppt http://www.stanford.edu/class/cs221/notes/ </pre></div>
</div>

<p>This created a tree of empty directories with one of them that had all the ppt files. Time to clean up the empty folders:</p>
<div class="CodeRay">
  <div class="code"><pre>find -depth -type d -empty -exec rmdir {} \;</pre></div>
</div>

<p>Ta-da! Empty folders are gone.&nbsp;</p>
<p>Remember if you are typing a command more than once in succession there is a way to automate it.&nbsp;</p>
<p>&nbsp;</p>
	
</p>

<p><a href="http://amjith.posterous.com/downloading-specific-filetypes-using-wget">Permalink</a> 

	| <a href="http://amjith.posterous.com/downloading-specific-filetypes-using-wget#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Mon, 06 Jun 2011 17:28:04 -0700</pubDate>
      <title>How to Find Local Tech Jobs</title>
      <link>http://amjith.posterous.com/how-to-find-local-tech-jobs</link>
      <guid>http://amjith.posterous.com/how-to-find-local-tech-jobs</guid>
      <description>
        <![CDATA[<p>
	<p>Looking for tech jobs can be daunting.&nbsp;Networking is touted as the magic bullet for job seekers. But where do you start?</p>
<p>Here are some robust ways to build your network.</p>
<p><strong>Users Group:</strong></p>
<p>User groups are typically monthly meetings for geeks who get together to talk about their favorite programming language or operating system. Usually they are accompanied with a mailing list which is used to announce the meetings, ask questions and <span style="color: #008000;"><strong>post job openings</strong></span>. So sign up to the mailing list and start attending the meetups. They are full of really nice people who are willing to help.&nbsp;</p>
<ul>
<li><a href="http://groups.google.com/group/utahpython/">Utah Python</a> - Utah Python Users Group</li>
<li><a href="http://utruby.org/">URUG</a> - Utah Ruby Users Group</li>
<li><a href="http://www.sllug.org/">SLLUG</a> - Salt Lake Linux Users Group 
<ul>
<li><a href="http://www.sllug.org/cgi-bin/mailman/listinfo/sllug-jobs-announce">SLLUG-JOBS</a> - Mailing list to announce job postings</li>
</ul>
</li>
<li><a href="http://www.plug.org/">PLUG</a>&nbsp;- Provo Linux Users Group</li>
</ul>
<p><strong>Local Conferences:</strong></p>
<p>Most cities have some tech conferences that are a great source for networking. I found out about a lot of the user group by going to one of the following conference.</p>
<p><a href="http://utos.org/">UTOSC</a> - Utah Open Source Conference.</p>
<p><a href="http://project-day.utos.org/projects-2011/">HackUTOS</a> &nbsp;- Utah Open Source Project Day - Geeks, snacks and open source.</p>
<p><a href="http://www.launchup.org/">LaunchUp</a> - A local entreneurship clinic. A great way to learn about the local start-up scene. You can meet new CEOs and fresh companies looking to hire tech talent. A must for job-seekers.</p>
<p>I hope this helps someone.</p>
	
</p>

<p><a href="http://amjith.posterous.com/how-to-find-local-tech-jobs">Permalink</a> 

	| <a href="http://amjith.posterous.com/how-to-find-local-tech-jobs#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 04 May 2011 22:49:00 -0700</pubDate>
      <title>Contributing to Open Source</title>
      <link>http://amjith.posterous.com/contributing-to-open-source</link>
      <guid>http://amjith.posterous.com/contributing-to-open-source</guid>
      <description>
        <![CDATA[<p>
	<p>Last week I successfully submitted my <a href="https://bitbucket.org/bobf/bpython/changeset/bc4a8a7a0e65">first patch</a> to an open source project and it was accepted.&nbsp;</p>
<p>I like the <a href="http://www.bpython-interpreter.org/">bpython</a> interpreter for all my python needs. It is quite handy for a python newbie like me. A few weeks ago I was in the middle of building an elaborate datastructure to learn list comprehension in python, when bpython crashed and took all the history with it. I <a href="https://twitter.com/#!/_ikanobori/status/60822979994583040">whined</a> about it on twitter and one of the developers of the project prompted me to submit a bug report. I was quite impressed by the fact that a core developer of bpython replied to my bitching on twitter.</p>
<p>After I filed the bug report, I decided to get the source code and poke around. I finally implemented a feature that saved the history after each command instead of waiting till the end of a session.&nbsp;</p>
<p>The following factors were the main impetus that led me to contribute to the project.&nbsp;</p>
<p><strong>Project Hosting:&nbsp;</strong></p>
<p>The project was hosted on <a href="http://bitbucket.org">bit bucket</a> which is a <a href="http://github.com">Github</a> equivalent for <a href="http://mercurial.selenic.com/">mercurial</a>. This makes it so easy to fork a project and issue pull requests, compared to the traditional source forge model of submitting patches in a mailing list. The social coding sites like Github and BitBucket have reduced much of the initial friction in starting an open source project.</p>
<p><strong>Project Size:</strong></p>
<p>This one has a huge impact when I decide to dive into the code. Traditional C projects tend to have a ton of files that are too big which is daunting for a beginner. The bpython project was written in python and had a total of 13 .py files. This makes it dead simple to make a quick change and run the project without compiling it. Again the choice of language has a lot to do with this.&nbsp;</p>
<p><strong>IRC:</strong></p>
<p>The welcoming nature of the community around a project does a lot to encourage a new comer. The IRC channels are a great way to interact with the developers compared to a passive form of communication such as emails. I jumped on #bpython irc channel and started asking questions when I ran into an issue with bpython source code. People on that channel are really helpful and prompt in answering questions.</p>
<p><strong>Persistence:</strong></p>
<p>My first pull request was scrutinized by the core developers and some suggestions for improvements were given. During that process I learned a lot about code review and how to check for corner cases. Finally after I made all those improvements the pull request was accepted and merged with the main repo. So having a beginners mind (no ego) is an absolute must when getting started on any project. Don't be discouraged if your first attempt is unsuccessful.&nbsp;</p>
<p>Now I'm proud to say my name is listed in the&nbsp;<a href="https://bitbucket.org/bobf/bpython/src/fd740b9b73ad/AUTHORS">AUTHORS</a> file of bpython project.</p>
	
</p>

<p><a href="http://amjith.posterous.com/contributing-to-open-source">Permalink</a> 

	| <a href="http://amjith.posterous.com/contributing-to-open-source#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Mon, 25 Apr 2011 23:24:00 -0700</pubDate>
      <title>Synchronize Panes in Tmux</title>
      <link>http://amjith.posterous.com/synchronize-panes-in-tmux</link>
      <guid>http://amjith.posterous.com/synchronize-panes-in-tmux</guid>
      <description>
        <![CDATA[<p>
	<p><span style="font-family: arial;"><span style="font-size: small;">Tmux is an alternative for screen. For anyone who doesn't know screen, it is a terminal multiplexer which means, it allow multiple windows in terminal. It can split your window into multiple panes (vertical/horizontal), detach a session which can be attached at a later time. Detach/Attach is very useful for running a job in a remote server without having to keep the ssh open the whole time.&nbsp;</span> </span></p>
<div style="font-size: small;">Tmux can be configured by &nbsp;~/<a href="https://github.com/amjith/_dotties/blob/master/tmux.conf">.tmux.conf</a> file.</div>
<div style="font-size: small;"><span style="font-size: medium;">My prefix key is Ctrl-q.</span></div>
<div style="font-size: small;"><strong>Synchronizing panes:</strong></div>
<div style="font-size: small;">If you want to send your keystrokes to all the panes in your tmux window:&nbsp;</div>
<div style="font-size: small;">&lt;prefix&gt; :setw synchronize-panes</div>
<div style="font-size: small;">In my case I do:</div>
<div style="font-size: small;"><span style="font-size: medium;">Ctrl-q:setw synchronize-panes</span></div>
<div style="font-size: small; text-align: center;"><div class='p_embed p_video_embed'>
<a href="http://amjith.posterous.com/synchronize-panes-in-tmux"><img alt="" src="http://posterous.com/getfile/video.posterous.com/temp-2011-04-25/cucuFgGczimmmxzuwAhIydAIhuBalccuqxrkzmDEwtCrrHvGphgycrEfnbDs/frame_0000.png" /></a>
<div class='p_embed_description'>
<strong>tmux.avi</strong>
<a href="http://amjith.posterous.com/synchronize-panes-in-tmux">Watch on Posterous</a>
</div>
</div>
</div>
<div style="font-size: small;">This is immensely useful if you want to execute the same set of commands on multiple servers.</div>
<p>&nbsp;</p>
	
</p>

<p><a href="http://amjith.posterous.com/synchronize-panes-in-tmux">Permalink</a> 

	| <a href="http://amjith.posterous.com/synchronize-panes-in-tmux#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
      <media:content type="video/x-msvideo" fileSize="1670" url="http://getfile7.posterous.com/getfile/files.posterous.com/temp-2011-04-25/cucuFgGczimmmxzuwAhIydAIhuBalccuqxrkzmDEwtCrrHvGphgycrEfnbDs/tmux.avi" />
    </item>
    <item>
      <pubDate>Tue, 08 Mar 2011 23:22:00 -0800</pubDate>
      <title>Coffescript - A Better Way to JS</title>
      <link>http://amjith.posterous.com/coffescript-a-better-way-to-js-tag-javascript</link>
      <guid>http://amjith.posterous.com/coffescript-a-better-way-to-js-tag-javascript</guid>
      <description>
        <![CDATA[<p>
	<p>I went to attend the <a href="http://utruby.org/">URUG</a> (Utah Ruby Users Group) meeting today because a little <a href="http://twitter.com/#!/dbrady">birdy</a>&nbsp;said there will be some Javascript related presentations.&nbsp;</p>
<p />
<div>I got to see an awesome presentation by <a href="http://tadthorley.com">Tad Thorley</a>&nbsp;on <a href="http://jashkenas.github.com/coffee-script/">Coffeescript</a>. It's a minimalistic language that compiles to Javascript. Take a Javascript program and start removing unwanted literals from the syntax until you can't remove anymore, that's how a Coffeescript program looks like.&nbsp;</div>
<p />
<div>Its the kind of minimalism that makes you appreciate the beauty of code. It combines the good parts of Python and Ruby syntax. There are some side-by-side <a href="http://jashkenas.github.com/coffee-script/#literals">comparisons</a> of Coffeescript and Javascript code on the Coffeescript website.</div>
<p />
<div>Tad might post his slides (which are just short snippets of code) on github and I'll try to link it here.</div>
<p />
<div>Update: Coffee Script Presentation -&nbsp;<a href="https://github.com/phaedryx/coffeescript-presentation">https://github.com/phaedryx/coffeescript-presentation</a></div>
	
</p>

<p><a href="http://amjith.posterous.com/coffescript-a-better-way-to-js-tag-javascript">Permalink</a> 

	| <a href="http://amjith.posterous.com/coffescript-a-better-way-to-js-tag-javascript#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 02 Mar 2011 22:20:00 -0800</pubDate>
      <title>Snowboarding @ Sundance</title>
      <link>http://amjith.posterous.com/snowboarding-sundance</link>
      <guid>http://amjith.posterous.com/snowboarding-sundance</guid>
      <description>
        <![CDATA[<p>
	<p>Just got back from Snowboarding at Sundance Ski resort. I fell down a lot less than I did during my previous times. I'm also doing a lot more toe turns which has always been an issue. I decided to try the blue slopes today which was good and bad. I got over my fear of going down the steep sections, but I also got too tired to enjoy the green sections of the run. I can tell that I'm getting a lot faster these days because the runs seem shorted (or quicker). One more season and I'll be a pro :).&nbsp;</p>
<p />
<div>After our snowboarding session, I had a near melt down. I couldn't find my car keys in any of my jacket pockets and I don't have a spare key for that car anywhere. I checked with the lost and found with no success and I requested the security to jack the car door for me. Right when they asked me to sign some release forms and were about to insert the lever into my car window, Yoshi comes out of no where (she decided to retire after a few runs) and declares that she has the keys. It was a photo-finish ending for a great day.&nbsp;</div>
<p />
<div>I just love the fact that my wife can save the day no matter how much I manage to screw up.</div>
	
</p>

<p><a href="http://amjith.posterous.com/snowboarding-sundance">Permalink</a> 

	| <a href="http://amjith.posterous.com/snowboarding-sundance#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 02 Mar 2011 09:31:00 -0800</pubDate>
      <title>Have a Schedule</title>
      <link>http://amjith.posterous.com/have-a-schedule</link>
      <guid>http://amjith.posterous.com/have-a-schedule</guid>
      <description>
        <![CDATA[<p>
	<p>After wasting about 3 hours watching old episodes of The Office, I had a sinking feeling last night that I'm not working towards any of my life goals.&nbsp;</p>
<div>
<ul>
<li>Learn JS</li>
<li>Release mobile apps</li>
<li>Get better at Python</li>
<li>Do a startup or at least join one</li>
</ul>
<div>But thanks to my thoughtful wife, I didn't freak out about it. She gave me some tangible ideas to remedy the situation&nbsp;(not one of those "You'll be fine").&nbsp;</div>
</div>
<p />
<div>So new plan:</div>
<div>
<ul>
<li>Set short-term goals.&nbsp;</li>
<li>Work on my stuff and report the progress every week to my buddy <a href="http://vijayd.posterous.com/">Vijay</a>.&nbsp;</li>
</ul>
</div>
<div>This should keep me accountable and on track. To actually show some progress, I'm going to fix my schedule and follow <a href="http://lifehacker.com/#!281626/jerry-seinfelds-productivity-secret">Seinfield's Productivity Technique</a>.</div>
<div>
<ul>
<li>Tue (6-9)</li>
<li><span style="color: #ffcc99;">Wed (6-9) - bonus day</span></li>
<li>Thu (6-9)</li>
<li>Sat (5-9)</li>
<li>Sun (1-5)</li>
</ul>
<div>Phew! crisis averted. Now back to work.</div>
</div>
	
</p>

<p><a href="http://amjith.posterous.com/have-a-schedule">Permalink</a> 

	| <a href="http://amjith.posterous.com/have-a-schedule#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 01 Mar 2011 21:37:00 -0800</pubDate>
      <title>Leaders are genuine</title>
      <link>http://amjith.posterous.com/leaders-inspire</link>
      <guid>http://amjith.posterous.com/leaders-inspire</guid>
      <description>
        <![CDATA[<p>
	<p>I had a chance to watch one of my role models in action today. He is one of the young, intelligent managers who rose to the top of the ladder pretty quickly. He managed to do that without creating enemies along the way which is pretty hard to do in big corporations. Everyone who has worked with him will attest to the fact that he deserves to be in the top and has nothing bad to say about him.&nbsp;</p>
<p />
<div>Unfortunately I never got a chance to work directly with him, but watching him today made me realize why he is different from the other managers. It all came down to being truthful. Just being genuine to your fellow workers can mean a world of difference. When he tries to inspire someone, he is not the one to throw around some business lingo. He doesn't just say "We really appreciate all the work you are doing" or "Keep up the good work". That is just a terrible compliment. When he praises you for something, you know he really appreciates your work.</div>
<p />
<div>One lesson I learned from him today is "Be Genuine", and I shall try.</div>
	
</p>

<p><a href="http://amjith.posterous.com/leaders-inspire">Permalink</a> 

	| <a href="http://amjith.posterous.com/leaders-inspire#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Mon, 28 Feb 2011 21:49:27 -0800</pubDate>
      <title>Why do I hate Gnome?</title>
      <link>http://amjith.posterous.com/why-do-i-hate-gnome</link>
      <guid>http://amjith.posterous.com/why-do-i-hate-gnome</guid>
      <description>
        <![CDATA[<p>
	I&#39;ve been using Ubuntu Linux on my netbook for the past couple of days and I&#39;m quite pleased with the whole experience, except for the initial <a href="http://amjith.posterous.com/ubuntu-and-i-have-some-trust-issues-tag-ubunt" target="_blank">issues</a> (I just won&#39;t trust the auto-update).<p /><div>Ubuntu uses the Gnome desktop environment by default with a little bit of tweaking. Gnome UI designers have a sense of aesthetic cognizance to their designs. I&#39;ve always appreciated the crisp icons and the polished dialogs. I&#39;ve been known to throw around the word stunning, quite generously, while describing Gnome. </div> <p /><div>All these initial infatuations almost made me forget the reasons why I abandoned Gnome a few years ago. I  hate the absence of a central control center to tweak the default behavior of Gnome. There is however a severely handicapped version called gconf-editor which is like a terrible cousin of Windows Registry. So now if you want sloppy focus on gnome that doesn&#39;t raise your window when you click on it, you just have to do the following simple steps:<p /> </div><div><ol><li>Open gconf-editor</li><li>apps</li><li>metacity</li><li>general</li><li>raise on click (uncheck)</li></ol></div><div>Quite intuitive wouldn&#39;t you agree? </div><p /><div>Oh you want to enable compositing, so your gnome-do can have some slick skins, here&#39;s how you achieve that: </div> <p /><div><ol><li>Open gconf-editor</li><li>apps</li><li>metacity</li><li>general</li><li>compositing_manager (check)</li></ol></div><div>Why? Why would you think this is more intuitive than having a simple GUI driven control center? I&#39;m told this was a conscious choice by Gnome developers because giving choices tend to confuse their users.</div> <p /><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"> If you think your users are idiots, only idiots will use it.</blockquote><p /><div>No wonder <a href="http://www.desktoplinux.com/news/NS8745257437.html">Linus was pissed</a> at Gnome and started recommending KDE.</div>
	
</p>

<p><a href="http://amjith.posterous.com/why-do-i-hate-gnome">Permalink</a> 

	| <a href="http://amjith.posterous.com/why-do-i-hate-gnome#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/839837/self.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/YXyCkcOIgYp</posterous:profileUrl>
        <posterous:firstName>Amjidanutpan</posterous:firstName>
        <posterous:lastName>Ramanujam</posterous:lastName>
        <posterous:nickName>amjith</posterous:nickName>
        <posterous:displayName>Amjidanutpan Ramanujam</posterous:displayName>
      </posterous:author>
    </item>
  </channel>
</rss>

