<?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:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-9876605</atom:id><lastBuildDate>Fri, 17 Feb 2012 15:58:18 +0000</lastBuildDate><category>autoconf</category><category>funny</category><category>books</category><category>spelunking</category><category>comics</category><category>latex</category><category>tmux</category><category>scifi</category><category>marriage</category><category>biking</category><category>xkcd</category><category>hiking</category><category>git</category><category>python</category><category>haskell</category><category>sun</category><category>ptimer</category><category>Mac OS X</category><category>windows</category><category>vim</category><category>solaris</category><category>c++</category><category>science</category><category>linux</category><category>tech</category><category>personal</category><category>mysql</category><category>programming</category><category>camping</category><category>music</category><category>ted</category><category>algorithm</category><category>django</category><category>blog</category><category>Mandriva</category><category>regex</category><category>automake</category><category>caving</category><category>adventure</category><category>jobs</category><category>getkey</category><category>osnews</category><category>gnome ubuntu linux</category><category>taekwondo</category><category>fun</category><category>Ubuntu</category><category>PyQt4</category><category>pomodoro</category><category>recursion</category><title>Core Dump</title><description>Segfaults in my brain.</description><link>http://amjith.blogspot.com/</link><managingEditor>noreply@blogger.com (Amjith Ramanujam)</managingEditor><generator>Blogger</generator><openSearch:totalResults>132</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/amjith" /><feedburner:info uri="blogspot/amjith" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-6870761903910191356</guid><pubDate>Fri, 10 Feb 2012 16:42:00 +0000</pubDate><atom:updated>2012-02-17T08:53:49.609-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">algorithm</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Memoization Decorator</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="posterous_autopost"&gt;
Recently I had the opportunity to give a short 10 min presentation on Memoization Decorator at our local UtahPython Users Group meeting.&lt;br /&gt;
&lt;blockquote&gt;
&lt;strong&gt;Memoization:&amp;nbsp;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Everytime a function is called, save the results in a cache (map).&lt;/li&gt;
&lt;li&gt;Next time the function is called with the exact same args, return the value from the cache instead of running the function.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
The code for memoization decorator for python is here: &lt;a href="http://wiki.python.org/moin/PythonDecoratorLibrary#Memoize"&gt;http://wiki.python.org/moin/PythonDecoratorLibrary#Memoize&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;
The typical recursive implementation of fibonacci calculation is pretty inefficient O(2^n).&amp;nbsp; &lt;br /&gt;
&lt;pre class="prettyprint"&gt;def fibonacci(num):
        print 'fibonacci(%d)'%num
        if num in (0,1):
            return num
        return fibonacci(num-1) + fibonacci(num-2)

&amp;gt;&amp;gt;&amp;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
&lt;/pre&gt;
But the memoized version makes it ridiculously efficient O(n) with very little effort.&lt;br /&gt;
&lt;pre class="prettyprint"&gt;import memoized
@memoized
def fibonacci(num):
    print 'fibonacci(%d)'%num
    if num in (0,1):
        return num
    return fibonacci(num-1) + fibonacci(num-2)
    
&amp;gt;&amp;gt;&amp;gt; math_funcs.mfibonacci(4)  # 5 function calls
    fibonacci(4)
    fibonacci(3)
    fibonacci(2)
    fibonacci(1)
    fibonacci(0)
    3
&lt;/pre&gt;
&lt;div&gt;
&lt;strong&gt;We just converted an algorithm from Exponential Complexity to Linear Complexity by simply adding the memoization decorator.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Slides&lt;/strong&gt;:&lt;br /&gt;
&lt;script src="http://speakerdeck.com/embed/4f3e77bda0d46a001f01268b.js"&gt;&lt;/script&gt;
&lt;br /&gt;
&lt;strong&gt;Presentation:&lt;/strong&gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Source:&lt;/strong&gt;&lt;br /&gt;
The rst file and tex files are available in Github.&lt;br /&gt;
&lt;a href="https://github.com/amjith/User-Group-Presentations/tree/master/memoization_decorator"&gt;https://github.com/amjith/User-Group-Presentations/tree/master/memoization_de...&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Update&lt;/u&gt;: &lt;a href="http://news.ycombinator.com/item?id=3576791"&gt;Comment by dasht&lt;/a&gt;&amp;nbsp;via HackerNews pointed out that the terminology Cache is used when you have a fixed size container, whereas the memoization decorator above does not have a restriction on the size. Hence it's technically not a cache.&lt;br /&gt;
&lt;br /&gt;
Follow the comments in HackerNews:&amp;nbsp;&lt;a href="http://news.ycombinator.com/item?id=3576620"&gt;http://news.ycombinator.com/item?id=3576620&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-6870761903910191356?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=04fo5jMhBTM:0vT55te0ZFs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/04fo5jMhBTM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/04fo5jMhBTM/memoization-decorator.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2012/02/memoization-decorator.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-2953516280970806173</guid><pubDate>Fri, 10 Feb 2012 06:09:00 +0000</pubDate><atom:updated>2012-02-10T09:48:50.288-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">django</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Productive Meter</title><description>&lt;div class='posterous_autopost'&gt;&lt;p&gt;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 &lt;a href="https://docs.djangoproject.com/en/1.3/intro/tutorial01/"&gt;docs&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;  &lt;p&gt;::Django documentation is awesome::&lt;/p&gt;  &lt;p&gt;Around this time I came across this post about &lt;a href="http://www.mattgreer.org/post/2fiveam"&gt;Waking up at 5am to code&lt;/a&gt;. 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.&amp;nbsp;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Tools:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;  &lt;li&gt;&lt;a href="https://www.djangoproject.com/"&gt;Django&lt;/a&gt;&amp;nbsp;for backend&lt;/li&gt;  &lt;li&gt;&lt;a href="http://www.sqlite.org/"&gt;Sqlite&lt;/a&gt;&lt;/li&gt;  &lt;li&gt;&lt;a href="http://haystacksearch.org/"&gt;Haystack/Solr&lt;/a&gt; - search backend for Django&lt;/li&gt;  &lt;li&gt;&lt;a href="http://fancybox.net/"&gt;FancyBox&lt;/a&gt; - jquery plugin&lt;/li&gt;  &lt;li&gt;&lt;a href="http://code.google.com/p/flot/"&gt;flot&lt;/a&gt; - jquery plotting lib&lt;/li&gt;  &lt;li&gt;&lt;a href="http://twitter.github.com/bootstrap/"&gt;Bootstrap&lt;/a&gt; - html/css&lt;/li&gt;  &lt;/ul&gt;  &lt;p&gt;A huge thanks to my irc friends and random geeks who wrote awesome blog posts and SO answers on every problem I encountered.&lt;/p&gt;  &lt;p&gt;I will be open-sourcing the app pretty soon. Stay tuned.&lt;/p&gt;  &lt;p&gt;&lt;div class='p_embed p_image_embed'&gt; &lt;a href="http://getfile8.posterous.com/getfile/files.posterous.com/temp-2012-02-09/duGEaJvxHAffFfposnvqldjhhmCEAvhDBmIvhrlsFqqGhbqJcrvfwCzbudAf/productive_meter_screenshot.png.scaled1000.png"&gt;&lt;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" /&gt;&lt;/a&gt; &lt;a href="http://getfile3.posterous.com/getfile/files.posterous.com/temp-2012-02-09/ohgFstdpHDqsdhsFfHIEGamrgAnpFGijwixccArgwerwwlrFtluAbkDIprxi/productive_meter_screenshot1.png.scaled1000.png"&gt;&lt;img alt="Productive_meter_screenshot1" height="446" src="http://getfile3.posterous.com/getfile/files.posterous.com/temp-2012-02-09/ohgFstdpHDqsdhsFfHIEGamrgAnpFGijwixccArgwerwwlrFtluAbkDIprxi/productive_meter_screenshot1.png.scaled1000.png" width="1000" /&gt;&lt;/a&gt; &lt;div class='p_see_full_gallery'&gt;&lt;a href="http://amjith.posterous.com/100506320"&gt;See the full gallery on Posterous&lt;/a&gt;&lt;/div&gt; &lt;/div&gt; &lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-2953516280970806173?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=3d5-m4H1k_Q:2gs3CUSRDaA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/3d5-m4H1k_Q" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/3d5-m4H1k_Q/productive-meter.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2012/02/productive-meter.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-7335440754230861981</guid><pubDate>Tue, 22 Nov 2011 06:47:00 +0000</pubDate><atom:updated>2011-11-21T23:47:19.231-07:00</atom:updated><title>Too Many Classes Too Little Time</title><description>&lt;div class='posterous_autopost'&gt;&lt;p&gt;I'm taking a couple of the free online classes offered by Standford. One on &lt;a href="http://ai-class.org"&gt;Artifical Intelligence&lt;/a&gt; and one on &lt;a href="http://ml-class.org"&gt;Machine Learning&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;  &lt;p&gt;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.&amp;nbsp;&lt;/p&gt;  &lt;p&gt;Stanford just announced a slew of new &lt;a href="http://www.hci-class.org/"&gt;online&lt;/a&gt; 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. :(&lt;/p&gt;  &lt;p&gt;Woe is me.&amp;nbsp;&lt;/p&gt;  &lt;p&gt;ps: If you are not taking any of these classes you are missing out big time. Please do yourself a favor and sign up.&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-7335440754230861981?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=pccDqAoLd8Y:qOYtPn4xrYU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/pccDqAoLd8Y" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/pccDqAoLd8Y/im-taking-couple-of-free-online-classes.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/11/im-taking-couple-of-free-online-classes.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-909988614520025137</guid><pubDate>Tue, 18 Oct 2011 05:01:00 +0000</pubDate><atom:updated>2011-10-17T23:09:19.822-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">recursion</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Picking 'k' items from a list of 'n' - Recursion</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="posterous_autopost"&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Background:&amp;nbsp;&lt;/strong&gt;&lt;br /&gt;
You can safely skip this section if you're not interested in the back story behind why I decided to code this up.&lt;br /&gt;
&lt;br /&gt;
I was listening to &lt;a href="http://www.khanacademy.org/"&gt;KhanAcademy&lt;/a&gt; videos on &lt;a href="http://www.khanacademy.org/#probability"&gt;probability&lt;/a&gt;. I was particularly intrigued by the combinatorics &lt;a href="http://www.khanacademy.org/video/getting-exactly-two-heads--combinatorics?playlist=Probability"&gt;video&lt;/a&gt;. The formula to calculate the number of combinations of nCr was simple, but I wanted to print all the possible combinations of nCr.&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Problem Statement:&lt;/strong&gt;&lt;br /&gt;
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').&lt;br /&gt;
&lt;br /&gt;
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 &lt;a href="http://www.jtolds.com/"&gt;jtolds&lt;/a&gt;).&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Code:&amp;nbsp;&lt;/strong&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;def combo(w, l):
    lst = []
    for i in range(len(w)):
        if l == 1:
            lst.append(w[i])
        for c in combo(w[i+1:], l-1):
            lst.append(w[i] + c)
    return lst
&lt;/pre&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Output:&lt;/strong&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;gt;&amp;gt;&amp;gt; combinations.combo('abcde',3)
    ['abc', 'abd', 'abe', 'acd', 'ace', 'ade', 'bcd', 'bce', 'bde', 'cde']
&lt;/pre&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Thoughts:&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;It helps to think about recursion with the assumption that an answer for step n-1 already exists.&lt;/li&gt;
&lt;li&gt;If you are getting partial answers check the condition surrounding the return statement.&lt;/li&gt;
&lt;li&gt;Recursion is still not clear (or easy).&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
I have confirmed that this works for bigger data sets and am quite happy with this small victory.&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-909988614520025137?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=mU0MvPilRmo:zPfAr6ri5sU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/mU0MvPilRmo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/mU0MvPilRmo/picking-items-from-list-of-recursion.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>1</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/10/picking-items-from-list-of-recursion.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-4958320516126485052</guid><pubDate>Fri, 14 Oct 2011 04:50:00 +0000</pubDate><atom:updated>2012-02-17T08:50:14.129-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Python Profiling</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="posterous_autopost"&gt;
I did a presentation at our &lt;a href="http://www.utahpython.org/"&gt;local Python User Group&lt;/a&gt; meeting tonight. It was well received, but shorter than I had expected. I should've added a lot more code examples.&lt;br /&gt;
We talked about usage of cProfile, pstats, runsnakerun and timeit.&lt;br /&gt;
Here are the slides from the presentations:&lt;br /&gt;
&lt;br /&gt;
&lt;script src="http://speakerdeck.com/embed/4f3e760bdf5d29001f011e12.js"&gt;
&lt;/script&gt;
&lt;br /&gt;
The slides were done using &lt;a href="http://en.wikipedia.org/wiki/Beamer_(LaTeX)"&gt;latex-beamer&lt;/a&gt;, but I wrote the slides in &lt;a href="http://docutils.sourceforge.net/rst.html"&gt;reStructuredText&lt;/a&gt; and used &lt;a href="http://www.agapow.net/programming/python/rst2beamer"&gt;rst2beamer&lt;/a&gt; to create slides.&lt;br /&gt;
The source code for the slides are available on my &lt;a href="http://www.blogger.com/blogger.g?blogID=9876605"&gt;github page&lt;/a&gt;.&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-4958320516126485052?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=kqAU2AYxACc:Gr8P-05krEk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/kqAU2AYxACc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/kqAU2AYxACc/python-profiling.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/10/python-profiling.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-1383062871417921914</guid><pubDate>Wed, 05 Oct 2011 05:44:00 +0000</pubDate><atom:updated>2011-10-10T13:48:34.611-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Programming - A Gateway Drug to Math</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="posterous_autopost"&gt;
&lt;div&gt;
I decided to try my hand at the Stanford's&amp;nbsp;&lt;a href="http://www.ai-class.com/"&gt;AI Class&lt;/a&gt;.&amp;nbsp;The pre-requisites mentioned Probability and Linear Algebra. So I started watching Probability videos on&amp;nbsp;&lt;a href="http://www.khanacademy.org/#probability"&gt;KhanAcademy&lt;/a&gt;.&lt;br /&gt;
Sal Khan was teaching how to find the probability of 2 heads when you toss a coin 5 times.&lt;br /&gt;
A classic nCk problem:&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;img alt="" src="http://latex.codecogs.com/gif.latex?\small%20_nC_k%20=%20\frac{n!}{k!(n-k)!}" style="margin: 10px;" 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." /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"&gt;T&lt;/span&gt;&lt;span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"&gt;he probability of getting 2 heads while tossing a coin 5 times is:&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div style="text-align: center;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: 12px;"&gt;&lt;img alt="" src="http://latex.codecogs.com/gif.latex?P(2)%20=%20\frac{{_5C_2}}{2^5}" style="margin: 10px;" 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." /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;But I wanted to find out the probability of getting at least 2 heads when I toss 5 coins.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Its really simple. All I had to do is P(2) + P(3) + P(4) + P(5).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;But then computing&lt;/span&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;&lt;img alt="" src="http://latex.codecogs.com/gif.latex?_nC_k" style="margin: 10px;" 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." /&gt;&lt;span style="font-size: small;"&gt;by hand (or a calculator) was painfully slow, let alone do it 4 times.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;So I wrote two little functions in Python that will calculate factorial (yes I reinvented the wheel) and&lt;/span&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;&lt;img alt="" src="http://latex.codecogs.com/gif.latex?_nC_k" style="margin: 10px;" 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." /&gt;&lt;span style="font-size: small;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Nothing teaches you math faster than trying to write a program to do the math for you.&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;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.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Bonus: It also teaches you corner cases like 0! = 1 and&amp;nbsp;&lt;img alt="" src="http://latex.codecogs.com/gif.latex?\small%20_5C_5%20=%201" style="margin: 10px;" 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." /&gt;&amp;nbsp;that you wouldn't think of otherwise.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-1383062871417921914?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=HFwvtZAaes4:2IH-N4Kl9qc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/HFwvtZAaes4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/HFwvtZAaes4/programming-gateway-drug-to-math_04.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>1</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/10/programming-gateway-drug-to-math_04.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-6883539583294994725</guid><pubDate>Wed, 05 Oct 2011 03:39:00 +0000</pubDate><atom:updated>2011-10-10T13:48:57.903-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c++</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Rant about C++ dependency hell</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="posterous_autopost"&gt;
When was the last time I vented about C++? The answer for that is always:&lt;br /&gt;
&lt;br /&gt;
"TOO LONG AGO".&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
The initial friction to setup a substantial project using C++ is unfucking bearable.&lt;br /&gt;
&lt;br /&gt;
When we started code revamp at work recently, I decided to be a good citizen and decided to incorporate &lt;a href="http://cpptest.sourceforge.net/"&gt;cpptest&lt;/a&gt;, a unit testing framework.&lt;br /&gt;
&lt;br /&gt;
It made me realize how unreasonably complicated Makefiles can become. After 3 hours of peeling away at the complexity I managed to add cpptest to the build dependency of the project.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Now time to write a few tests and check it out.&amp;nbsp;I'm thinking "We are almost there".&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
FALSE!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Compilation gives me a gazillion error messages that make absolutely no sense. After about 30mins of &lt;a href="http://www.stackoverflow.com/"&gt;StackOverflowing&lt;/a&gt; and Googling, I find out that string and map that I declared in the headers files need to be namespaced. 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.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Awesome my first test is compiling successfully. Time to run this baby and declare victory.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Close! But no cigar.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
The executable was unable to load the CppTest library during runtime. Argh!&lt;/div&gt;
&lt;div&gt;
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.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
It's already 6pm and I'm hungry. That'll have to wait for another day.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
TL;DR - C++ and Makefile can burn in a fire of thousand suns.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-6883539583294994725?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=wjnFFYhF13A:DPfef-HO9eU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/wjnFFYhF13A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/wjnFFYhF13A/rant-about-c-dependency-hell.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>2</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/10/rant-about-c-dependency-hell.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-5327317317636155513</guid><pubDate>Mon, 26 Sep 2011 03:02:00 +0000</pubDate><atom:updated>2011-10-10T13:44:54.227-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c++</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Rapid Prototyping in Python</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="posterous_autopost"&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
Surprisingly it took me a mere 2 hours to code up the prototype. I can't emphasize enough, how effortless it was in Python.&lt;br /&gt;
&lt;h2&gt;







What makes Python an ideal choice for prototyping:&lt;/h2&gt;
&lt;strong&gt;Dynamically typed language:&lt;/strong&gt;&lt;br /&gt;
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:&lt;br /&gt;
&lt;div class="CodeRay"&gt;
&lt;div class="code"&gt;
&lt;pre class="prettyprint"&gt;&lt;span class="kw"&gt;def&lt;/span&gt; &lt;span class="fu"&gt;max_val&lt;/span&gt;(a,b):&amp;nbsp;
&lt;span class="kw"&gt;    return&lt;/span&gt; a &lt;span class="kw"&gt;if&lt;/span&gt; a &amp;gt;b &lt;span class="kw"&gt;else&lt;/span&gt; b&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
This function can take integers, floats, strings, a combination of any of those, or lists, dictionaries, tuples, whatever.&lt;br /&gt;
A list in Python need not be homogenous. This is a perfectly good list:&lt;br /&gt;
&lt;div class="CodeRay"&gt;
&lt;div class="code"&gt;
&lt;pre class="prettyprint"&gt;[&lt;span class="i"&gt;1&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;abc&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, [&lt;span class="i"&gt;1&lt;/span&gt;,&lt;span class="i"&gt;2&lt;/span&gt;,&lt;span class="i"&gt;3&lt;/span&gt;]]
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
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++.&lt;br /&gt;
&lt;div class="CodeRay"&gt;
&lt;div class="code"&gt;
&lt;pre class="prettyprint"&gt;&lt;span class="r"&gt;class&lt;/span&gt; &lt;span class="cl"&gt;newDataType&lt;/span&gt;&amp;nbsp;
{&amp;nbsp;
&lt;span class="pt"&gt;    int&lt;/span&gt; i;&amp;nbsp;
    String str;&amp;nbsp;
    Vector vInts;&amp;nbsp;
};
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;strong&gt;Rich Set to Data-Structures:&lt;/strong&gt;&lt;br /&gt;
Built-in support for lists, dictionaries, sets, etc reduces the time involved in hunting for a library that provides you those basic data-structures.&lt;br /&gt;
&lt;strong&gt;Expressive and Succinct:&lt;/strong&gt;&lt;br /&gt;
The algorithms that operate on the data-structures are intuitive and simple to use. The final code is more readable than a pseudocode.&lt;br /&gt;
For example: Lets check if a list has an element&lt;br /&gt;
&lt;div class="CodeRay"&gt;
&lt;div class="code"&gt;
&lt;pre class="prettyprint"&gt;&amp;gt;&amp;gt;&amp;gt; lst = [&lt;span class="i"&gt;1&lt;/span&gt;,&lt;span class="i"&gt;2&lt;/span&gt;,&lt;span class="i"&gt;3&lt;/span&gt;]    &lt;span class="c"&gt;# Create a list&lt;/span&gt;&amp;nbsp;
&amp;gt;&amp;gt;&amp;gt; res = &lt;span class="i"&gt;2&lt;/span&gt; &lt;span class="kw"&gt;in&lt;/span&gt; lst   &lt;span class="c"&gt;# Check if 2 is in 'lst'&lt;/span&gt; &lt;span class="pc"&gt;True&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
If we have to do it in C++.&lt;br /&gt;
&lt;div class="CodeRay"&gt;
&lt;div class="code"&gt;
&lt;pre class="prettyprint"&gt;list lst;&amp;nbsp;
lst.push_back(&lt;span class="i"&gt;3&lt;/span&gt;);&amp;nbsp;
lst.push_back(&lt;span class="i"&gt;1&lt;/span&gt;);&amp;nbsp;
lst.push_back(&lt;span class="i"&gt;7&lt;/span&gt;);&amp;nbsp;
list::iterator result = find(lst.begin(), lst.end(), &lt;span class="i"&gt;7&lt;/span&gt;); &amp;nbsp;
&lt;span class="pt"&gt;bool&lt;/span&gt; res = (result != lst.end())
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Python Interpreter and Help System:&lt;/strong&gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;div class="CodeRay"&gt;
&lt;div class="code"&gt;
&lt;pre class="prettyprint"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;span class="pd"&gt;dir&lt;/span&gt;([])&amp;nbsp;
[&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__add__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__class__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__contains__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__delattr__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__delitem__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__delslice__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__doc__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__eq__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__format__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__ge__&lt;/span&gt;&lt;/span&gt;&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;
,  &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__getattribute__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__getitem__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__getslice__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__gt__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__hash__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__iadd__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__imul__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__init__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__iter__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__le__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;,&amp;nbsp;
&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__len__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__lt__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__mul__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__ne__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__new__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__reduce__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__reduce_ex__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__repr__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__reversed__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__rmul__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__setattr__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;,&amp;nbsp;
&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__setitem__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__setslice__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;,&amp;nbsp;&lt;span class="s"&gt;&lt;span class="k"&gt;'_&lt;/span&gt;&lt;/span&gt;&lt;span class="s"&gt;&lt;span class="k"&gt;_sizeof__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__str__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;__subclasshook__&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;append&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;extend&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;index&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;insert&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;pop&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;remove&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;,&amp;nbsp;
&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;reverse&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;sort&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;] &amp;nbsp;
&amp;gt;&amp;gt;&amp;gt; help([].sort)&amp;nbsp;
Help on built-&lt;span class="kw"&gt;in&lt;/span&gt; function sort: &amp;nbsp;
    sort(...)&amp;nbsp;
      L.sort(cmp=&lt;span class="pc"&gt;None&lt;/span&gt;, key=&lt;span class="pc"&gt;None&lt;/span&gt;, reverse=&lt;span class="pc"&gt;False&lt;/span&gt;)&amp;nbsp;
      -- stable sort *IN PLACE*; &lt;span class="pd"&gt;cmp&lt;/span&gt;(x, y) -&amp;gt; -&lt;span class="i"&gt;1&lt;/span&gt;, &lt;span class="i"&gt;0&lt;/span&gt;, &lt;span class="i"&gt;1&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;strong&gt; Advantages of prototyping instead of pseudocode: &lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The type definition of the datastructures emerge as we code. &lt;/li&gt;
&lt;li&gt;The edge cases start to emerge when you prototype. &lt;/li&gt;
&lt;li&gt;A set of required supporting routines. &lt;/li&gt;
&lt;li&gt;A better estimation of the time required to complete a task. &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-5327317317636155513?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=zwMbTgdLFiM:uMNyymAMaZ8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/zwMbTgdLFiM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/zwMbTgdLFiM/rapid-prototyping-in-python.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>1</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/09/rapid-prototyping-in-python.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-9209047651312864547</guid><pubDate>Thu, 04 Aug 2011 05:20:00 +0000</pubDate><atom:updated>2012-02-13T08:15:10.532-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">tmux</category><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Scripting Tmux Layouts</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="posterous_autopost"&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: 14px; line-height: 21px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;
&lt;a href="http://tmux.sourceforge.net/" style="color: #c55800; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;"&gt;Tmux&lt;/a&gt; is an awesome replacement for Screen. I have a couple of standard terminal layouts for programming. One of them is shown below.&lt;/div&gt;
&lt;div style="margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://vim.org/" style="color: #c55800; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;"&gt;Vim&lt;/a&gt; editor on the left.&lt;/li&gt;
&lt;li&gt;Top right pane has the &lt;a href="http://bpython-interpreter.org/" style="color: #c55800; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;"&gt;bpython&lt;/a&gt; interpreter.&lt;/li&gt;
&lt;li&gt;Bottom right pane has the bash prompt.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="p_embed p_image_embed"&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/temp-2011-08-03/ucgsvidqdagbhdmwJJsxkwBekFpBvGyBqijpupiChuavtsftveikrmbnHrEi/python_dev.png.scaled1000.png"&gt;&lt;img alt="Python_dev" height="516" src="http://posterous.com/getfile/files.posterous.com/temp-2011-08-03/ucgsvidqdagbhdmwJJsxkwBekFpBvGyBqijpupiChuavtsftveikrmbnHrEi/python_dev.png.scaled1000.png" width="1000" /&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div class="CodeRay"&gt;
I have a small tmux script in my ~/.tmux/pdev file that has the following lines &lt;/div&gt;

&lt;br /&gt;
&lt;pre class="prettyprint"&gt;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&lt;/pre&gt;

In my &lt;a href="https://github.com/amjith/_dotties/blob/master/tmux.conf"&gt;tmux.conf&lt;/a&gt; file I have bound &amp;lt;prefix&amp;gt;+P to sourcing this file. So now anytime I want to launch my python dev layout, I hit &amp;lt;prefix&amp;gt;+&amp;lt;shift&amp;gt;+p. &lt;br /&gt;

&lt;pre class="prettyprint"&gt;bind P source-file ~/.tmux/pdev&lt;/pre&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-9209047651312864547?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=T9NNyPjjoNo:xe-Hwee1Ckc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/T9NNyPjjoNo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/T9NNyPjjoNo/scripting-tmux-layouts.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>3</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/08/scripting-tmux-layouts.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-8404980168717029102</guid><pubDate>Tue, 07 Jun 2011 00:28:00 +0000</pubDate><atom:updated>2011-06-06T18:28:06.360-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">tech</category><category domain="http://www.blogger.com/atom/ns#">jobs</category><title>How to Find Local Tech Jobs</title><description>&lt;div class='posterous_autopost'&gt;&lt;p&gt;Looking for tech jobs can be daunting.&amp;nbsp;Networking is touted as the magic bullet for job seekers. But where do you start?&lt;/p&gt;  &lt;p&gt;Here are some robust ways to build your network.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Users Group:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;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 &lt;span style="color: #008000;"&gt;&lt;strong&gt;post job openings&lt;/strong&gt;&lt;/span&gt;. So sign up to the mailing list and start attending the meetups. They are full of really nice people who are willing to help.&amp;nbsp;&lt;/p&gt;  &lt;ul&gt;  &lt;li&gt;&lt;a href="http://groups.google.com/group/utahpython/"&gt;Utah Python&lt;/a&gt; - Utah Python Users Group&lt;/li&gt;  &lt;li&gt;&lt;a href="http://utruby.org/"&gt;URUG&lt;/a&gt; - Utah Ruby Users Group&lt;/li&gt;  &lt;li&gt;&lt;a href="http://www.sllug.org/"&gt;SLLUG&lt;/a&gt; - Salt Lake Linux Users Group   &lt;ul&gt;  &lt;li&gt;&lt;a href="http://www.sllug.org/cgi-bin/mailman/listinfo/sllug-jobs-announce"&gt;SLLUG-JOBS&lt;/a&gt; - Mailing list to announce job postings&lt;/li&gt;  &lt;/ul&gt;  &lt;/li&gt;  &lt;li&gt;&lt;a href="http://www.plug.org/"&gt;PLUG&lt;/a&gt;&amp;nbsp;- Provo Linux Users Group&lt;/li&gt;  &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Local Conferences:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://utos.org/"&gt;UTOSC&lt;/a&gt; - Utah Open Source Conference.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://project-day.utos.org/projects-2011/"&gt;HackUTOS&lt;/a&gt; &amp;nbsp;- Utah Open Source Project Day - Geeks, snacks and open source.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.launchup.org/"&gt;LaunchUp&lt;/a&gt; - 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.&lt;/p&gt;  &lt;p&gt;I hope this helps someone.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-8404980168717029102?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=3dt-L-ZGkiQ:gt2DuNuRfwQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/3dt-L-ZGkiQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/3dt-L-ZGkiQ/how-to-find-local-tech-jobs.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/06/how-to-find-local-tech-jobs.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-3800140188960511149</guid><pubDate>Thu, 05 May 2011 05:50:00 +0000</pubDate><atom:updated>2011-05-05T08:04:16.467-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Contributing to Open Source</title><description>&lt;div class="posterous_autopost"&gt;&lt;p&gt;Last week I successfully submitted my &lt;a href="https://bitbucket.org/bobf/bpython/changeset/bc4a8a7a0e65"&gt;first patch&lt;/a&gt; to an open source project and it was accepted. &lt;/p&gt;  &lt;p&gt;I like the &lt;a href="http://www.bpython-interpreter.org/"&gt;bpython&lt;/a&gt; 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 &lt;a href="https://twitter.com/#!/_ikanobori/status/60822979994583040"&gt;whined&lt;/a&gt; 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.&lt;/p&gt;  &lt;p&gt;After I filed the bug report, I decided to get the source code and poke around. I finally implemented a feature that will save the history after each command instead of waiting till the end of a session. &lt;/p&gt;  &lt;p&gt;The following factors were the main impetus that led me to contribute to the project. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Project Hosting: &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The project was hosted on &lt;a href="http://bitbucket.org/"&gt;bit bucket&lt;/a&gt; which is a &lt;a href="http://github.com/"&gt;Github&lt;/a&gt; equivalent for &lt;a href="http://mercurial.selenic.com/"&gt;mercurial&lt;/a&gt;. 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.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Project Size:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;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 and 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. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;IRC:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Persistence:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;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. &lt;/p&gt;  &lt;p&gt;Now I'm proud to say my name is listed in the &lt;a href="https://bitbucket.org/bobf/bpython/src/fd740b9b73ad/AUTHORS"&gt;AUTHORS&lt;/a&gt; file of bpython project.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-3800140188960511149?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=s_XJhvQJUX4:lGYBUY40jPs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/s_XJhvQJUX4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/s_XJhvQJUX4/contributing-to-open-source.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>4</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/05/contributing-to-open-source.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-2240467666826394000</guid><pubDate>Tue, 26 Apr 2011 06:38:00 +0000</pubDate><atom:updated>2011-04-26T00:38:39.240-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">tmux</category><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Synchronize Panes in Tmux</title><description>&lt;div class='posterous_autopost'&gt;&lt;p&gt;&lt;span style="font-family: arial;"&gt;&lt;span style="font-size: small;"&gt;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.&amp;nbsp;&lt;/span&gt;  &lt;p /&gt;  &lt;div style="font-size: small;"&gt;Tmux can be configured by &amp;nbsp;~/&lt;a href="https://github.com/amjith/_dotties/blob/master/.tmux.conf"&gt;.tmux.conf&lt;/a&gt; file.&lt;/div&gt;  &lt;p /&gt;  &lt;div style="font-size: small;"&gt;&lt;span style="font-size: medium;"&gt;My prefix key is Ctrl-q.&lt;/span&gt;&lt;/div&gt;  &lt;p /&gt;  &lt;div style="font-size: small;"&gt;&lt;strong&gt;Synchronizing panes:&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-size: small;"&gt;If you want to send your keystrokes to all the panes in your tmux window:&amp;nbsp;&lt;/div&gt;  &lt;p /&gt;  &lt;div style="font-size: small;"&gt;&amp;lt;prefix&amp;gt; :setw synchronize-panes&lt;/div&gt;  &lt;p /&gt;  &lt;div style="font-size: small;"&gt;In my case I do:&lt;/div&gt;  &lt;p /&gt;  &lt;div style="font-size: small;"&gt;&lt;span style="font-size: medium;"&gt;Ctrl-q:setw synchronize-panes&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-size: small;"&gt;&lt;div class='p_embed p_video_embed'&gt; &lt;a href="http://amjith.posterous.com/synchronize-panes-in-tmux"&gt;&lt;img alt="" src="http://posterous.com/getfile/video.posterous.com/temp-2011-04-25/cucuFgGczimmmxzuwAhIydAIhuBalccuqxrkzmDEwtCrrHvGphgycrEfnbDs/frame_0000.png" /&gt;&lt;/a&gt; &lt;div class='p_embed_description'&gt; &lt;strong&gt;tmux.avi&lt;/strong&gt; &lt;a href="http://amjith.posterous.com/synchronize-panes-in-tmux"&gt;Watch on Posterous&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;div style="font-size: small;"&gt;This is immensely useful if you want to execute the same set of commands on multiple servers.&lt;/div&gt;  &lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-2240467666826394000?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=IxQSAc3CQnI:7bEx_KW9eT4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/IxQSAc3CQnI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/IxQSAc3CQnI/synchronize-panes-in-tmux.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>2</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/04/synchronize-panes-in-tmux.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-6282632803023201212</guid><pubDate>Tue, 01 Mar 2011 05:49:00 +0000</pubDate><atom:updated>2011-02-28T22:49:37.017-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">gnome ubuntu linux</category><title>Why do I hate Gnome?</title><description>&lt;div class='posterous_autopost'&gt;I&amp;#39;ve been using Ubuntu Linux on my netbook for the past couple of days and I&amp;#39;m quite pleased with the whole experience, except for the initial &lt;a href="http://amjith.posterous.com/ubuntu-and-i-have-some-trust-issues-tag-ubunt" target="_blank"&gt;issues&lt;/a&gt; (I just won&amp;#39;t trust the auto-update).&lt;p /&gt;&lt;div&gt;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&amp;#39;ve always appreciated the crisp icons and the polished dialogs. I&amp;#39;ve been known to throw around the word stunning, quite generously, while describing Gnome. &lt;/div&gt; &lt;p /&gt;&lt;div&gt;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&amp;#39;t raise your window when you click on it, you just have to do the following simple steps:&lt;p /&gt; &lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Open gconf-editor&lt;/li&gt;&lt;li&gt;apps&lt;/li&gt;&lt;li&gt;metacity&lt;/li&gt;&lt;li&gt;general&lt;/li&gt;&lt;li&gt;raise on click (uncheck)&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;Quite intuitive wouldn&amp;#39;t you agree? &lt;/div&gt;&lt;p /&gt;&lt;div&gt;Oh you want to enable compositing, so your gnome-do can have some slick skins, here&amp;#39;s how you achieve that: &lt;/div&gt; &lt;p /&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Open gconf-editor&lt;/li&gt;&lt;li&gt;apps&lt;/li&gt;&lt;li&gt;metacity&lt;/li&gt;&lt;li&gt;general&lt;/li&gt;&lt;li&gt;compositing_manager (check)&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;Why? Why would you think this is more intuitive than having a simple GUI driven control center? I&amp;#39;m told this was a conscious choice by Gnome developers because giving choices tend to confuse their users.&lt;/div&gt; &lt;p /&gt;&lt;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;"&gt; If you think your users are idiots, only idiots will use it.&lt;/blockquote&gt;&lt;p /&gt;&lt;div&gt;No wonder &lt;a href="http://www.desktoplinux.com/news/NS8745257437.html"&gt;Linus was pissed&lt;/a&gt; at Gnome and started recommending KDE.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-6282632803023201212?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=8lXiT-CA06A:dM-E1an3oy8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/8lXiT-CA06A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/8lXiT-CA06A/why-do-i-hate-gnome.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>1</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/02/why-do-i-hate-gnome.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-6786577870867202493</guid><pubDate>Mon, 21 Feb 2011 07:31:00 +0000</pubDate><atom:updated>2011-02-21T00:31:03.597-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">Mandriva</category><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><title>Ubuntu and I have some trust issues</title><description>&lt;div class='posterous_autopost'&gt;&lt;p&gt;I've been exclusively using Meego on my netbook and I was moderately happy with what it provided. So I did what any self-respecting hacker would do - I tried to make it better. Well, we all know how &lt;strong&gt;that&lt;/strong&gt; usually ends. I managed to uninstall every single kernel in the system and rendered the system unbootable. Taking this as an opportunity I decided to try a grown-up OS. Enter Ubuntu into the picture.&lt;/p&gt;  &lt;p /&gt;  &lt;div&gt;I've heard nothing but great things about Ubuntu and I fuckin' hated it. Why? Because it was stealing all the limelight from the ever superior Mandriva (my favorite distro). So I got the installation process going which was smooth but surprisingly it didn't give me the option to keep my old partition, it was an all or nothing approach (grown up OS my ass). I had all my "stuff" backed up, so I decided to repartition my disk. It even detected my Broadcom wireless card and offered to install a proprietary driver for it. Wireless was working and the visual candy was stunning. I've never seen such a beautiful font set on my computer before. All the visual components looked hand crafted and the notifications were done with style. It was just a gorgeous piece of artwork. Visually stunning (if you didn't get that part already).&amp;nbsp;&lt;/div&gt;  &lt;p /&gt;  &lt;div&gt;I was quite pleased with the decision to go with Ubuntu and was having some fleeting thoughts about replacing Mandriva on my desktop. Around 15 minutes in my playful prodding and poking, I was prompted by Ubuntu to notify that Software Updates were available. After it successfully installed the updates and rebooted the computer (some Kernel updates were involved), I couldn't connect to the internet anymore. The network icon wouldn't show up on my system tray anymore. After some googling oI managed to find the "Additional Drivers" program which installed the Broadcom Drivers once again. But this time it would show me the available networks but wouldn't connect to any of them. The system update had successfully screwed over the authentication routine for connecting to WPA2 networks. I tried to plug in my network cable to the ethernet port only to find out the system hadn't recognized the existence of an ethernet port. Are you kidding me? Have you heard of a little thing called hot-plugging? I've been spoiled by Mandriva that can automatically choose between the wireless card and the network cable on the fly, depending on which was available. Now I had to muck around the network interface files to even get my ethernet card detected. How hard is it to develop a Central Control Center that can manage your hardware? After getting that to work, I tried at least 10 different methods described on various forums to get the wireless chipset to work again without any success. I gave up after 10 hours of tweaking and started trying other OSes. Here is a list:&lt;/div&gt;  &lt;div&gt;  &lt;ul&gt;  &lt;li&gt;Fedora looked nice but wouldn't connect to internet. Same problem as Ubuntu, but this time, it wouldn't offer to download proprietary drivers.&amp;nbsp;&lt;/li&gt;  &lt;li&gt;Mandriva image hangs up in the middle of booting (I'm personally&amp;nbsp;embarrassed by this). Btw, Mandriva has to be the ugliest of all the OSes. Seriously man, you gotta up the ante a little bit if you want to stay in this game.&lt;/li&gt;  &lt;li&gt;Mint OS same as Ubuntu, only it looked even more gorgeous. I might try this out in the future.&amp;nbsp;&lt;/li&gt;  &lt;/ul&gt;  &lt;/div&gt;  &lt;div&gt;I should've tried Arch Linux but I was too tired at this point. So I did what any self-respecting hacker would do..... I re-installed Ubuntu and rejected the offer to auto-update my system. Now I have wireless internet and a usable desktop that looks pretty.&lt;/div&gt;  &lt;p /&gt;  &lt;div&gt;Ubuntu had so much potential. I will always remember today as the day I almost replaced my desktop Mandriva with Ubuntu. Maybe next time.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-6786577870867202493?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=FBPFWz5B_Ro:glHw6G3hqkI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/FBPFWz5B_Ro" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/FBPFWz5B_Ro/ubuntu-and-i-have-some-trust-issues.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>5</thr:total><feedburner:origLink>http://amjith.blogspot.com/2011/02/ubuntu-and-i-have-some-trust-issues.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-6109790476551752023</guid><pubDate>Sun, 19 Dec 2010 17:17:00 +0000</pubDate><atom:updated>2010-12-19T10:17:02.964-07:00</atom:updated><title>LaTeX on Mac OS X</title><description>&lt;div class='posterous_autopost'&gt;I used LaTeX when I was in school to create reports, presentation (using &lt;a href="http://en.wikipedia.org/wiki/Beamer_(LaTeX)"&gt;beamer&lt;/a&gt;) and even sometimes class notes and assignments. Recently when I was looking for a presentation program in Linux I was crestfallen by the lack of polish in OpenOffice Impress. So I created my &lt;a href="http://amjith.posterous.com/hands-on-into-git"&gt;presentation&lt;/a&gt; for the Salt Lake Linux User Group in LaTeX and it looked professional (nothing surprising there).&lt;p /&gt;&lt;div&gt;But that was created on my tiny Netbook running Meego. I wanted to make some edits to it with my wife&amp;#39;s MacBook, so I started looking around for LaTeX on Mac. I found &lt;a href="http://www.tug.org/mactex/"&gt;MacTex&lt;/a&gt; which completely took me by surprise, because the download size of the MacTex package was 1.6GB and the installed size on the computer was well over 3GB. It took me a good one hour to download, install and configure that thing her laptop. Seeing the 1.6GB zip file getting downloaded made me realize how much work has gone into LaTeX which I&amp;#39;ve been taking for granted all these years. &lt;/div&gt; &lt;p /&gt;&lt;div&gt;I bow before thee LaTeX. &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-6109790476551752023?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=YMg5xSxdYXM:8QOxvOSpawo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/YMg5xSxdYXM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/YMg5xSxdYXM/latex-on-mac-os-x.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2010/12/latex-on-mac-os-x.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-891502708559771396</guid><pubDate>Thu, 09 Dec 2010 06:33:00 +0000</pubDate><atom:updated>2010-12-08T23:33:20.473-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">git</category><title>Hands on Intro - Git</title><description>&lt;div class='posterous_autopost'&gt;&lt;p&gt;Today I presented in the Salt Lake Linux User Group meeting. The topic was "Hands on Intro - Git". It went well and I actually enjoyed it quite a bit. I choked twice once while trying to explain how to git apply patches that you receive via email, but then recovered from it with some help from the audience. But the second time I choked while trying to explain how to pull from multiple remote repositories, I couldn't recover from that. I do that so rarely it never occurred to me. Oh well, the first time is the hardest.&lt;/p&gt;  &lt;p /&gt;  &lt;div&gt;Off to prepare for the talk tomorrow at the Utah Python Group. I'm presenting "Hands on Into - PyQt4".&amp;nbsp;&lt;/div&gt;  &lt;p /&gt;  &lt;div&gt;Here are the slides from that talk. LaTeX Source:&amp;nbsp;&lt;a href="https://github.com/amjith/git_present"&gt;https://github.com/amjith/git_present&lt;/a&gt;&amp;nbsp;&lt;/div&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;       &lt;div style='padding: 5px 5px 10px 5px; margin-top: 5px; border: 1px solid #ddd; background-color: #fff;line-height: 16px;'&gt;       &lt;div style="float: left; margin-right: 5px; overflow: visible;"&gt;&lt;a href='http://posterous.com/getfile/files.posterous.com/amjith/q1XFctzWfhYySo8Gua1Lw7ba96PGkNrEBfjkY58dSFkTqM7gcrQXN6udAASv/git_present.pdf' style='color: #bc7134;'&gt;&lt;img src='http://posterous.com/images/filetypes/pdf.png' style='border: none;'/&gt;&lt;/a&gt;&lt;/div&gt;       &lt;div style="font-size: 10px; color: #424037;line-height: 16px;"&gt;Download now or &lt;a href='http://amjith.posterous.com/hands-on-into-git' style='color: #bc7134;'&gt;preview on posterous&lt;/a&gt;&lt;/div&gt;       &lt;b&gt;&lt;a href='http://posterous.com/getfile/files.posterous.com/amjith/q1XFctzWfhYySo8Gua1Lw7ba96PGkNrEBfjkY58dSFkTqM7gcrQXN6udAASv/git_present.pdf' style='color: #bc7134;'&gt;git_present.pdf&lt;/a&gt;&lt;/b&gt; &lt;span style="font-size: 10px; color: #424037;"&gt;(135 KB)&lt;/span&gt;       &lt;br style="clear: both;"/&gt;&lt;/div&gt;      &lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-891502708559771396?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=xZE8VbySHIs:hdU_cXvvKcc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/xZE8VbySHIs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/xZE8VbySHIs/hands-on-intro-git.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2010/12/hands-on-intro-git.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-5291450965400697362</guid><pubDate>Sat, 13 Nov 2010 05:10:00 +0000</pubDate><atom:updated>2010-11-12T22:55:53.483-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">ptimer</category><title>pTimer listed in Softpedia</title><description>&lt;div class='posterous_autopost'&gt;&lt;div&gt;One of my hobby projects is now included in the &lt;a href="http://mac.softpedia.com/get/Business/pTimer.shtml"&gt;Softpedia&lt;/a&gt; Mac OS database. I don't know if that means anything but it is fun to see that 9 people have downloaded that utility so far.&amp;nbsp;&lt;/div&gt;  &lt;p /&gt;  &lt;div&gt;A while ago I wrote a little PyQt4 application called &lt;a href="http://code.google.com/p/ptimer/"&gt;pTimer&lt;/a&gt;&amp;nbsp;to try out the famous Pomodoro Technique for productivity.&amp;nbsp;&lt;/div&gt;  &lt;p /&gt;  &lt;div&gt;The &lt;a href="http://amjith.blogspot.com/2010/09/pomodoro-timer-written-in-python-and.html"&gt;original&lt;/a&gt; reason why I wrote that timer was to get myself acclimatized to Qt programming using Python. But since I liked it so much I decided to publish the code and host it on Google Code hosting.&amp;nbsp;&lt;/div&gt;  &lt;p /&gt;  &lt;div&gt;Yesterday I got an email from Softpedia about including that utility in their website. Pleasantly surprised.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-5291450965400697362?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=AqtYUcTo36w:IRxZga4QLW4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/AqtYUcTo36w" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/AqtYUcTo36w/ptimer-listed-in-softpedia.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>1</thr:total><feedburner:origLink>http://amjith.blogspot.com/2010/11/ptimer-listed-in-softpedia.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-7744882400461682528</guid><pubDate>Sat, 06 Nov 2010 00:46:00 +0000</pubDate><atom:updated>2010-11-06T14:02:52.970-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Moving MySQL databases to a new location</title><description>Default MySQL uses /var/lib/mysql folder to store the database files. If you'd like to change that default location to something else, you can modify the mysql config file called my.cnf located in /etc/my.cnf.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So edit /etc/my.cnf (you'll need root privileges). Lets say you want to change the default location to /home/mysql.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;WAS:&lt;/b&gt;&lt;/div&gt;&lt;pre class="prettyprint"&gt;[mysqld]&lt;br /&gt;user = mysql&lt;br /&gt;datadir = /var/lib/mysql&lt;br /&gt;&lt;span class="Apple-style-span"   style=" white-space: normal;  font-family:Georgia, serif;font-size:16px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;b&gt;IS:&lt;/b&gt;&lt;pre class="prettyprint"&gt;[mysqld]&lt;br /&gt;user = mysql&lt;br /&gt;datadir = /home/mysql&lt;br /&gt;&lt;/pre&gt;Create the folder /home/mysql and copy the folders that are inside /var/lib/mysql to /home/mysql.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre class="prettyprint"&gt;cp -r /var/lib/mysql /home/mysql&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The last and important step is to change the ownership of /home/mysql and its contents to the username mysql.&lt;/div&gt;&lt;pre class="prettyprint"&gt;chown -R mysql:mysql /home/mysql&lt;/pre&gt;&lt;div&gt;Now restart the mysqld service. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre class="prettyprint"&gt;service mysqld restart&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It should be ready to go and you can remove the folders from the old location /var/lib/mysql/* after you've checked to make sure everything is working properly. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-7744882400461682528?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=wScmCKY0km0:56x7V-GmaHs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/wScmCKY0km0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/wScmCKY0km0/moving-mysql-databases-to-new-location.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2010/11/moving-mysql-databases-to-new-location.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-2266570949598460206</guid><pubDate>Wed, 29 Sep 2010 03:46:00 +0000</pubDate><atom:updated>2010-09-29T19:51:09.030-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PyQt4</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">ptimer</category><title>Making Standalone Application for Mac OS X from PyQt app using py2app</title><description>&lt;div style="text-align: left;"&gt;In a previous &lt;a href="http://amjith.blogspot.com/2010/09/pomodoro-timer-written-in-python-and.html"&gt;blog post&lt;/a&gt; I talked about a software I wrote in Python called &lt;a href="http://code.google.com/p/ptimer/"&gt;ptimer&lt;/a&gt;. I decided to bundle that software into a Mac OS X application that can be used without installing any dependencies. &lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Download Link - &lt;a href="http://ptimer.googlecode.com/files/ptimer.dmg"&gt;ptimer.dmg&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;py2app is a setuptool that can convert python scripts into a standalone Mac OS X App bundle. First install py2app using easy_install. Type the following in a Terminal.&lt;/div&gt;&lt;pre class="prettyprint"&gt;$ sudo easy_install -U py2app&lt;br /&gt;&lt;/pre&gt;Next step is to create a setup.py that defines our package.&lt;/div&gt;&lt;pre class="prettyprint"&gt;from setuptools import setup&lt;br /&gt;&lt;br /&gt;APP = ['ptimer.py']&lt;br /&gt;DATA_FILES = []&lt;br /&gt;OPTIONS = {'argv_emulation': True,&lt;br /&gt; 'iconfile': 'bell.icns',&lt;br /&gt; 'includes': ['sip', 'PyQt4']}&lt;br /&gt;&lt;br /&gt;setup(&lt;br /&gt;app=APP,&lt;br /&gt;data_files=DATA_FILES,&lt;br /&gt;options={'py2app': OPTIONS},&lt;br /&gt;setup_requires=['py2app'],&lt;br /&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You'll notice that we included both sip and PyQt4 as dependencies, they will be bundled with the application. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The icon file for this application comes from 'bell.icns'. If your icon file is in the form of an image you can convert it to icns using the &lt;a href="http://www.img2icnsapp.com/"&gt;img2icns&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now let us create our app:&lt;/div&gt;&lt;pre class="prettyprint"&gt;$ python setup.py py2app&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;This will create two folders in the current directory called 'build' and 'dist'. Inside the dist folder you'll see the Mac OS X app bundle called ptimer.app. That is the app bundle for distribution.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you double click on the ptimer.app in finder, you'll get the following error message: &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_Klq-3NKFe2s/TKLEMqG1h0I/AAAAAAAABBk/89l95hhBcKQ/s1600/py2app_error.png"&gt;&lt;img src="http://4.bp.blogspot.com/_Klq-3NKFe2s/TKLEMqG1h0I/AAAAAAAABBk/89l95hhBcKQ/s400/py2app_error.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5522191814850086722" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 202px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Lets fix that error. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Using Terminal navigate inside your app bundle and open the __boot__.py file inside the dist/ptimer.app/Contents/Resources folder.&lt;/div&gt;&lt;pre class="prettyprint"&gt;$ cd dist/ptimer.app/Contents/Resources&lt;br /&gt;$ open __boot__.py&lt;br /&gt;&lt;/pre&gt;Towards the end of the file there is a function def _run(*scripts):&lt;br /&gt;Add this line after the import statement:&lt;pre class="prettyprint lang-python"&gt;    sys.path = [os.path.join(os.environ['RESOURCEPATH'], 'lib', 'python2.6', 'lib-dynload')] + sys.path&lt;br /&gt;&lt;/pre&gt;You might have to change python2.6 to the appropriate folder name inside the dist/ptimer.app/Contents/Resources/lib folder. Double-click to make sure it is working. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Not it is time to create the .dmg file which is an apple disk image that is usually used to distribute software for Mac OS X.&lt;/div&gt;&lt;pre class="prettyprint"&gt;$ hdiutil create ptimer.dmg -srcfolder dist/ptimer.app&lt;/pre&gt;&lt;div&gt;This will create the ptimer.dmg file that is ready for distribution. Release it in the wild for everyone to enjoy.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-2266570949598460206?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=d8AoAB5gpR8:gqLPp_Dbto4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/d8AoAB5gpR8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/d8AoAB5gpR8/making-standalone-application-for-mac.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_Klq-3NKFe2s/TKLEMqG1h0I/AAAAAAAABBk/89l95hhBcKQ/s72-c/py2app_error.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2010/09/making-standalone-application-for-mac.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-6485125094842474099</guid><pubDate>Mon, 27 Sep 2010 01:48:00 +0000</pubDate><atom:updated>2010-09-30T14:35:38.571-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PyQt4</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">Mac OS X</category><title>Developing PyQt4 Applications in Mac OS X</title><description>&lt;div style="text-align: left;"&gt;PyQt4 is Python binding for the Qt library. Qt is developed by Nokia and PyQt bindings are provided by Riverbank.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;PyQt4 is available only for 32-bit Intel architecture for Mac OS X. So we have to keep that in mind while we install the various dependencies for PyQt4.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The dependencies for PyQt4 are Qt4 and SIP. &lt;/div&gt;&lt;div&gt;Use the following command for configuring SIP and PyQt4 in 32-bit mode: &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch=i386&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;This link is a walk through of the installation process: &lt;a href="http://blog.oak-tree.us/index.php/2010/05/27/pyqt-snow-leopard"&gt;http://blog.oak-tree.us/index.php/2010/05/27/pyqt-snow-leopard&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Now that we have installed PyQt4 we are ready to start writing scripts in Python using PyQt4. &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Lets check if PyQt4 is working. Type the following the Python interpreter:&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;&gt;&gt;&gt; import PyQt4&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;If there are no errors, then we are good.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Since PyQt4 is installed as a 32-bit library, we have to run the Python scripts in the 32-bit mode as well.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class="prettyprint"&gt;$arch -i386 python2.6 pyqt_test.py&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;Lets try it out:&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Copy the code to a file and name it pyqt_test.py&lt;/div&gt;&lt;pre class="prettyprint lang-py"&gt;&lt;br /&gt;#!/usr/bin/env python&lt;br /&gt;&lt;br /&gt;import sys&lt;br /&gt;from PyQt4 import QtCore, QtGui&lt;br /&gt;&lt;br /&gt;class Ui_Dialog(object):&lt;br /&gt;   def setupUi(self, Dialog):&lt;br /&gt;       Dialog.setObjectName("Dialog")&lt;br /&gt;       Dialog.resize(400, 300)&lt;br /&gt;       self.pushButton = QtGui.QPushButton(Dialog)&lt;br /&gt;       self.pushButton.setGeometry(QtCore.QRect(80, 80, 271, 151))&lt;br /&gt;       self.pushButton.setObjectName("pushButton")&lt;br /&gt;       self.retranslateUi(Dialog)&lt;br /&gt;       QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL("clicked()"), Dialog.close)&lt;br /&gt;       QtCore.QMetaObject.connectSlotsByName(Dialog)&lt;br /&gt;   def retranslateUi(self, Dialog):&lt;br /&gt;       Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))&lt;br /&gt;       self.pushButton.setText(QtGui.QApplication.translate("Dialog", "Close", None, QtGui.QApplication.UnicodeUTF8))&lt;br /&gt;&lt;br /&gt;class DialogTest(QtGui.QMainWindow):&lt;br /&gt;   def __init__(self, parent=None):&lt;br /&gt;       QtGui.QWidget.__init__(self, parent)&lt;br /&gt;       self.ui =  Ui_Dialog()&lt;br /&gt;       self.ui.setupUi(self)&lt;br /&gt;&lt;br /&gt;if __name__ == "__main__":&lt;br /&gt;   app = QtGui.QApplication(sys.argv)&lt;br /&gt;   myapp = DialogTest()&lt;br /&gt;   myapp.show()&lt;br /&gt;   sys.exit(app.exec_())&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now try running the script:&lt;div&gt;&lt;pre class="prettyprint"&gt;$arch -i386 python2.6 pyqt_test.py&lt;/pre&gt;&lt;/div&gt;It should pop-up a dialog box with a big close button. Congratulations you are now ready to develop PyQt4 applications on your Mac OS X.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_Klq-3NKFe2s/TKAfiZxO1ZI/AAAAAAAABBI/_1aThOEKe8U/s1600/pythondialog.png"&gt;&lt;img src="http://2.bp.blogspot.com/_Klq-3NKFe2s/TKAfiZxO1ZI/AAAAAAAABBI/_1aThOEKe8U/s400/pythondialog.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5521447819049620882" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 322px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;If you use the following without the&lt;span class="Apple-style-span" style=" white-space: pre; font-family:monospace;"&gt; arch -i386&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" white-space: pre; font-family:monospace;"&gt;$python2.6 pyqt_test.py&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You will get the following error message:&lt;/div&gt;&lt;pre class="prettyprint"&gt;Traceback (most recent call last):&lt;br /&gt;File "pyqt_test.py", line 4, in &lt;module&gt;&lt;br /&gt;from PyQt4 import QtCore, QtGui&lt;br /&gt;ImportError: dlopen(/Library/Python/2.6/site-packages/PyQt4/QtCore.so, 2): no suitable image found. Did find:&lt;br /&gt;/Library/Python/2.6/site-packages/PyQt4/QtCore.so: mach-o, but wrong architecture&lt;br /&gt;&lt;/module&gt;&lt;/pre&gt;Happy Hacking!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-6485125094842474099?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=rucAChU3_R0:y_sDl_0UWA4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/rucAChU3_R0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/rucAChU3_R0/developing-pyqt4-applications-in-mac-os.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_Klq-3NKFe2s/TKAfiZxO1ZI/AAAAAAAABBI/_1aThOEKe8U/s72-c/pythondialog.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://amjith.blogspot.com/2010/09/developing-pyqt4-applications-in-mac-os.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-9155439615221009783</guid><pubDate>Wed, 22 Sep 2010 03:57:00 +0000</pubDate><atom:updated>2010-09-28T22:02:11.977-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">pomodoro</category><category domain="http://www.blogger.com/atom/ns#">PyQt4</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">ptimer</category><title>Pomodoro Timer written in Python and Qt4</title><description>&lt;div style="text-align: left;"&gt;I recently came across the &lt;a href="http://www.pomodorotechnique.com/index.html"&gt;Pomodoro Technique&lt;/a&gt; which is a method for improving concentration and getting things done without distractions. Since my attention span rivals the lifetime of a &lt;a href="http://en.wikipedia.org/wiki/Muon"&gt;Muon&lt;/a&gt;, I jumped on the opportunity to try it out.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Pomodoro in 5 simple steps (from the website):&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Choose a task to be accomplished&lt;/li&gt;&lt;li&gt;Set the Pomodoro to 25 minutes (the Pomodoro is a timer)&lt;/li&gt;&lt;li&gt;Work on the task until the Pomodoro rings, then put a check on your sheet of paper&lt;/li&gt;&lt;li&gt;Take a short break (5 minutes is OK)&lt;/li&gt;&lt;li&gt;Every 4 Pomodoros take a longer break&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;div&gt;Since I wasn't planning on bringing my kitchen timer to work, I started to look for a software timer that can fit my needs. &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To my surprise I couldn't find a good timer that can notify me every 25 mins, followed by 5 mins and repeat the cycle. I took it as my calling to implement the perfect Pomodoro Timer and use this opportunity to learn Python and Qt.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rest of this post is about the timer. I decided to call it '&lt;a href="http://code.google.com/p/ptimer"&gt;ptimer&lt;/a&gt;', partly because the name 'pytimer' was already taken. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Download Link: &lt;a href="http://ptimer.googlecode.com/files/ptimer-src-latest.zip"&gt;http://ptimer.googlecode.com/files/ptimer-src-latest.zip&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In order to run this timer you need to have &lt;a href="http://www.python.org/download/"&gt;python 2.6&lt;/a&gt; or above and &lt;a href="http:///www.riverbankcomputing.co.uk/software/pyqt/download"&gt;PyQt4&lt;/a&gt; installed on your system. I plan to bundle this into a single executable in the future. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;How to Use: &lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Download and unzip the &lt;a href="http://ptimer.googlecode.com/"&gt;ptimer&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Launch ptimer.py&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Windows: Double click on ptimer.py&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Linux/Mac OS X: Type './ptimer.py' from Terminal&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Set the appropriate alarm times in the settings box and press Ok.&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_Klq-3NKFe2s/TJmbys9Z1MI/AAAAAAAABAY/LSpn4y1ms-Y/s400/ptimer_settings.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5519614113683723458" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 204px; height: 167px; " /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;The ptimer will reside in the system tray.&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_Klq-3NKFe2s/TJmcNK8xitI/AAAAAAAABAg/3Dh7bV15EWs/s400/ptimer_systray.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5519614568410745554" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 168px; height: 25px; " /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;When the timer expires it will flash a small display.&lt;a href="http://4.bp.blogspot.com/_Klq-3NKFe2s/TJmdUMg83aI/AAAAAAAABBA/mll0wsxQ1-E/s1600/ptimer_timer_display.png"&gt;&lt;img src="http://4.bp.blogspot.com/_Klq-3NKFe2s/TJmdUMg83aI/AAAAAAAABBA/mll0wsxQ1-E/s400/ptimer_timer_display.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5519615788601630114" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 128px; height: 79px; " /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Left click to start the second alarm timer. &lt;/li&gt;&lt;li&gt;Repeat as necessary.&lt;/li&gt;&lt;li&gt;Right click on the timer display or the systray icon to control the behavior of the timer display.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_Klq-3NKFe2s/TJmcxR77yWI/AAAAAAAABA4/COj7mFXbEcs/s1600/ptimer_timer_context.png"&gt;&lt;img src="http://4.bp.blogspot.com/_Klq-3NKFe2s/TJmcxR77yWI/AAAAAAAABA4/COj7mFXbEcs/s400/ptimer_timer_context.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5519615188761561442" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 287px; height: 176px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I plan to go over the details of the code in some of the future posts.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Until then, enjoy the ptimer!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-9155439615221009783?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=0ZHhVPsJZxs:1ppCRYDtozE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/0ZHhVPsJZxs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/0ZHhVPsJZxs/pomodoro-timer-written-in-python-and.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_Klq-3NKFe2s/TJmbys9Z1MI/AAAAAAAABAY/LSpn4y1ms-Y/s72-c/ptimer_settings.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://amjith.blogspot.com/2010/09/pomodoro-timer-written-in-python-and.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-586927743969797890</guid><pubDate>Tue, 04 Aug 2009 15:55:00 +0000</pubDate><atom:updated>2010-09-26T23:58:38.420-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">hiking</category><category domain="http://www.blogger.com/atom/ns#">spelunking</category><category domain="http://www.blogger.com/atom/ns#">caving</category><title>Intro to Caving in Timpanogos</title><description>Caving (or Spelunking) is the sport of exploring caves. Yosh and I recently had the opportunity to go on our first spelunking adventure. It was offered at the &lt;a href="http://www.nps.gov/tica/planyourvisit/ictour.htm"&gt;Timponogos caves&lt;/a&gt; in Utah for a group of five. It wasn't quite as dangerous and difficult as it sounds, but it was definitely more than just walking inside a cave. We donned our hard-hats with head lamps before entering the dark hole in the mountain. We were accompanied by a Ranger who knew what he was doing.&lt;div&gt;&lt;br /&gt;&lt;div&gt;We had already taken the regular tour of the cave which in retrospect was dull in comparison to the spelunking experience. The path we took had a pretty low ceiling at many spots, sometimes so low we had to crawl in all fours. At one point we had to descend down the cave through a rock-climbing rope which was exciting. The cave walls were adorned with gorgeous calcite formations. At the end of our path there was a hidden lake (more like a pond really) which had a crystal clear surface. We all turned off our head lamps at this point and experienced the total darkness for about a couple of minutes. This is the kind of darkness that our eyes never get used to. No matter how long you stay in that darkness, it is impossible to detect anything. Experiencing the absence of even a single photon was quite unnerving. It was a lot of fun and definitely worth trying. We are both planning to pursue more spelunking in the future, lets see how deep it takes us. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Picture Time:&lt;/div&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://picasaweb.google.com/lh/photo/-8s2Z4YlPx6GJY4xtEi0bQ?feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_a7uv83IYef0/SoGU9_sntkI/AAAAAAAAEvQ/iK_AdI0mXho/s600/IMG_2798.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;All ready to go in&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;a href="http://picasaweb.google.com/lh/photo/hrsD8lMTCa2z4iqAo8JnUA?feat=embedwebsite"&gt;&lt;img src="http://lh6.ggpht.com/_a7uv83IYef0/SoGU9tTqm8I/AAAAAAAAEvM/YPusKokcjv8/s600/IMG_2797.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;Posing with the ranger&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;a href="http://picasaweb.google.com/lh/photo/b8gISQdKpyNmwDam5iF-Eg?feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_a7uv83IYef0/SoGU9YodkKI/AAAAAAAAEvE/GykJS_14Rys/s600/IMG_2794.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;The whole group&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-586927743969797890?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=7VoR6PV7fiE:TUh10ExgqIo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/7VoR6PV7fiE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/7VoR6PV7fiE/intro-to-caving-in-timpanogos.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_a7uv83IYef0/SoGU9_sntkI/AAAAAAAAEvQ/iK_AdI0mXho/s72-c/IMG_2798.JPG" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://amjith.blogspot.com/2009/08/intro-to-caving-in-timpanogos.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-6209936343506272080</guid><pubDate>Fri, 17 Jul 2009 14:15:00 +0000</pubDate><atom:updated>2009-07-18T00:43:37.161-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ted</category><category domain="http://www.blogger.com/atom/ns#">music</category><category domain="http://www.blogger.com/atom/ns#">science</category><title>Favorite Ted Talks - Part 2</title><description>Time to do a Part 2 on my series of Favorite Ted Talks. I've expanded my repertoire since I published &lt;a href="http://amjith.blogspot.com/2009/06/favorite-ted-talks-part-1.html"&gt;part 1&lt;/a&gt; to include talks that are not directly science related.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ted.com/index.php/talks/benjamin_zander_on_music_and_passion.html"&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;Benjamin Zander on Music and Passion:&lt;/span&gt;&lt;/a&gt;&lt;div&gt;&lt;a href="http://www.ted.com/index.php/talks/benjamin_zander_on_music_and_passion.html"&gt;&lt;/a&gt;This talk was particularly special to me, since it made me emotional when he played a Chopin piece on the piano. I am not even a piano fan (I am a proud husband of a Violinist), but that music was truly moving. The talk is definitely passionate and it packs a powerful emotional punch.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I assure you, that you'll have a greater appreciation for classical music or even a fan of classical music when you are done with it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Juicy Bits:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;(03:49)"The trouble with you is you're a two-buttock player. You should be a one-buttock player." And I moved his body like that while he was playing. And suddenly the music took off. It took flight.&lt;br /&gt;&lt;br /&gt;(10:49) I always tell my students, "If you have a deceptive cadence be sure to raise your eyebrows then everybody will know."&lt;br /&gt;&lt;br /&gt;(19:54)"I will never say anything that couldn't stand as the last thing I ever say. "&lt;/span&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;object width="446" height="326"&gt;&lt;param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;param name="bgColor" value="#ffffff"&gt; &lt;param name="flashvars" value="vu=http://video.ted.com/talks/embed/BenjaminZander_2008-embed_high.flv&amp;amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/BenjaminZander-2008.embed_thumbnail.jpg&amp;amp;vw=432&amp;amp;vh=240&amp;amp;ap=0&amp;amp;ti=286"&gt;&lt;embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgcolor="#ffffff" width="446" height="326" allowfullscreen="true" flashvars="vu=http://video.ted.com/talks/embed/BenjaminZander_2008-embed_high.flv&amp;amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/BenjaminZander-2008.embed_thumbnail.jpg&amp;amp;vw=432&amp;amp;vh=240&amp;amp;ap=0&amp;amp;ti=286"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;a href="http://www.ted.com/talks/robert_full_learning_from_the_gecko_s_tail.html"&gt;Learning from the Gecko's Tail:&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.ted.com/talks/robert_full_learning_from_the_gecko_s_tail.html"&gt;&lt;/a&gt;A very good talk about how Biology and Robotics learn from each other. This might the first step in a world full of possibilities.&lt;br /&gt;&lt;br /&gt;Wall climbing robots were made that mimicked a gecko and to the roboticists' surprise they found the robots to be unstable until they added the tails. When they fed this information back to the biologists, they conducted a series of experiments and found out how the tail helped in the gecko's climbing. There are some very interesting video clips of experiments they conducted. I love the part where they put the gecko in a wind tunnel and let it fly.&lt;br /&gt;&lt;br /&gt;Evolution is an amazing process.&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;object width="446" height="326"&gt;&lt;param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;param name="bgColor" value="#ffffff"&gt; &lt;param name="flashvars" value="vu=http://video.ted.com/talks/embed/RobertFull_2009-embed_high.flv&amp;amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/RobertFull-2009.embed_thumbnail.jpg&amp;amp;vw=432&amp;amp;vh=240&amp;amp;ap=0&amp;amp;ti=571"&gt;&lt;embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgcolor="#ffffff" width="446" height="326" allowfullscreen="true" flashvars="vu=http://video.ted.com/talks/embed/RobertFull_2009-embed_high.flv&amp;amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/RobertFull-2009.embed_thumbnail.jpg&amp;amp;vw=432&amp;amp;vh=240&amp;amp;ap=0&amp;amp;ti=571"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;a href="http://www.ted.com/talks/lang/eng/vilayanur_ramachandran_on_your_mind.html"&gt;VS Ramachandran on your mind:&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.ted.com/talks/lang/eng/vilayanur_ramachandran_on_your_mind.html"&gt;&lt;/a&gt;An amazing talk by one of the truly brilliant minds of our time. This is a talk about brain functions, neurology and other wonderful insights into some of the rare malfunctions in the brain. This is the man who cured the pain in a phantom limb with nothing more than a $10 mirror.&lt;br /&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;object width="446" height="326"&gt;&lt;param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;param name="bgColor" value="#ffffff"&gt; &lt;param name="flashvars" value="vu=http://video.ted.com/talks/embed/VilayanurRamachandran_2007-embed_high.flv&amp;amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/VilayanurRamachandran-2007.embed_thumbnail.jpg&amp;amp;vw=432&amp;amp;vh=240&amp;amp;ap=0&amp;amp;ti=184"&gt;&lt;embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgcolor="#ffffff" width="446" height="326" allowfullscreen="true" flashvars="vu=http://video.ted.com/talks/embed/VilayanurRamachandran_2007-embed_high.flv&amp;amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/VilayanurRamachandran-2007.embed_thumbnail.jpg&amp;amp;vw=432&amp;amp;vh=240&amp;amp;ap=0&amp;amp;ti=184"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;His other talk which is much longer and has a little bit of overlap with the ted talk is about the way the brain intercepts Art. This is an absolutely wonderful talk which well worth the one hour. He actually explains why Picasso's art work is beautiful.&lt;br /&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=4384015941059041392&amp;amp;hl=en&amp;amp;fs=true" style="width:400px;height:326px" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;a href="http://www.ted.com/talks/ken_robinson_says_schools_kill_creativity.html"&gt;Schools kill Creativity:&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;a href="http://www.ted.com/talks/ken_robinson_says_schools_kill_creativity.html"&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;I saved my most favorite talk to the last, because there is much to talk about and this talk.&lt;br /&gt;&lt;br /&gt;First lets begin by saying that THIS is a hilarious talk.&lt;br /&gt;Second his arguments against the current education system, strikes the bulls-eye.&lt;br /&gt;He has such valid points and he conveys them in a very engaging manner.&lt;br /&gt;&lt;br /&gt;Juicy Quotes:&lt;br /&gt;There are tons of interesting stories and quotes in this talk and I'll end up copying the transcript of his talk if I went after the juicy bits. So I'll try to reproduce only the quotes that still make sense when taken out of context.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;(3:00)"All kids have tremendous talents. And we squander them, pretty ruthlessly. My contention is that creativity now is as important in education as literacy, and we should treat it with the same status."&lt;br /&gt;&lt;br /&gt;"If you're not prepared to be wrong, you'll never come up with anything original. And by the time they get to be adults, most kids have lost that capacity. They have become frightened of being wrong."&lt;br /&gt;&lt;br /&gt;"We stigmatize mistakes. And we're now running national education systems where mistakes are the worst thing you can make. And the result is that we are educating people out of their creative capacities."&lt;/span&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;object width="334" height="326"&gt;&lt;param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;param name="bgColor" value="#ffffff"&gt; &lt;param name="flashvars" value="vu=http://video.ted.com/talks/embed/SirKenRobinson_2006-embed_high.flv&amp;amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/SirKenRobinson-2006.embed_thumbnail.jpg&amp;amp;vw=320&amp;amp;vh=240&amp;amp;ap=0&amp;amp;ti=66"&gt;&lt;embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgcolor="#ffffff" width="334" height="326" allowfullscreen="true" flashvars="vu=http://video.ted.com/talks/embed/SirKenRobinson_2006-embed_high.flv&amp;amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/SirKenRobinson-2006.embed_thumbnail.jpg&amp;amp;vw=320&amp;amp;vh=240&amp;amp;ap=0&amp;amp;ti=66"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;If you've already seen any of these videos, it never hurts to watch it again. It's absolutely worth it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Related: &lt;a href="http://amjith.blogspot.com/2009/06/favorite-ted-talks-part-1.html"&gt;Favorite Ted Talks - Part 1&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-6209936343506272080?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=9Sl14Jqe5T4:oHW6mBUwXFg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/9Sl14Jqe5T4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/9Sl14Jqe5T4/favorite-ted-talks-part-2.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>2</thr:total><feedburner:origLink>http://amjith.blogspot.com/2009/07/favorite-ted-talks-part-2.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-2541667423209075262</guid><pubDate>Tue, 07 Jul 2009 20:56:00 +0000</pubDate><atom:updated>2009-07-14T21:31:50.972-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">biking</category><category domain="http://www.blogger.com/atom/ns#">fun</category><category domain="http://www.blogger.com/atom/ns#">camping</category><title>Biking into a Lake</title><description>Biking into a lake is not quite the same as Biking around a lake or Biking near a lake, it is orders of magnitude more fun than both of them combined. If you are not familiar with the concept of Biking into a Lake, here's a quick intro:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Take your bike and point it towards the middle of the lake.&lt;/li&gt;&lt;li&gt;Start pedaling as fast as you can.&lt;/li&gt;&lt;li&gt;Go as far as possible into the lake.&lt;/li&gt;&lt;li&gt;Fall into the water (trust me this will happen)&lt;/li&gt;&lt;li&gt;Repeat.&lt;/li&gt;&lt;/ol&gt;Oh yeah, it is just as much fun as it sounds.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://picasaweb.google.com/lh/photo/-BUfCX6M6j8s6R-Ewwto-g?feat=embedwebsite"&gt;&lt;img src="http://lh5.ggpht.com/_a7uv83IYef0/SlQbX_HdsOI/AAAAAAAAEL0/8Bc_tCwFKfI/s400/IMGP0134_resize.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Unfortunately, I can't take credit for inventing this really cool way of biking. It was first proposed by &lt;a href="http://moebiusgroupe.com/qst/whoisthad.html"&gt;Thad&lt;/a&gt; and experimented by Yosh. The honor of being the first test subject goes to Blue lake in Utah located near the famous Mirror Lake.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div align="center"&gt;&lt;a href="http://picasaweb.google.com/lh/photo/NA9sDgJbmSbYA9hz59d7pA?feat=embedwebsite"&gt;&lt;img src="http://lh6.ggpht.com/_a7uv83IYef0/SlQbEriLpqI/AAAAAAAAELI/hyWpRzSxmFU/s400/IMG_4864.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We had a little bit of warm-up on the puddles on our way to the lake which was totally unintentional, since our lake biking was an improptu idea by Thad once we reached the lake.&lt;/div&gt;&lt;div&gt;&lt;div align="center"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://picasaweb.google.com/lh/photo/drwMBAgoMLtMXMHIYGAiqA?feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_a7uv83IYef0/SlQa721000I/AAAAAAAAEJ8/ZchKx5aYNtY/s400/IMG_4844.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;The lake had a very mild slope which was very helpful for this art, but it was way too muddy to keep a steady biking pace. The bike tires would sink into the mud making it impossible to restart once we got stuck (and fell into the water). Trying to pull the bike out of the mud resulted in our feet sinking deeper into the mud.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After a few iterations of lake biking, Thad and I decided to go for a swim in the lake. We both managed to go deep enough in that freezing water to reach neck level water.&lt;br /&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;a href="http://picasaweb.google.com/lh/photo/tfgfKx32wyyl7DmLSVbkSQ?feat=embedwebsite"&gt;&lt;img src="http://lh6.ggpht.com/_a7uv83IYef0/SlQa9a28osI/AAAAAAAAEKI/fjeu5tGumpQ/s400/IMG_4854.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Can you see the tiny little heads sticking out of the water. We were hoping our bodies would soon go numb. But the water just kept getting colder as we went deeper, I could almost hear my skin cells screaming "Are you f-ing kidding me?". We decided to turn back once I realized  I might panic if we kept at it. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of these days, I'm gonna man up and go all the way. &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-2541667423209075262?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=JuJiC0DuMPE:eY9GwFh4V2k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/JuJiC0DuMPE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/JuJiC0DuMPE/biking-into-lake.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_a7uv83IYef0/SlQbX_HdsOI/AAAAAAAAEL0/8Bc_tCwFKfI/s72-c/IMGP0134_resize.JPG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://amjith.blogspot.com/2009/07/biking-into-lake.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9876605.post-7071280305343699676</guid><pubDate>Mon, 29 Jun 2009 04:13:00 +0000</pubDate><atom:updated>2009-07-02T23:13:49.633-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">personal</category><category domain="http://www.blogger.com/atom/ns#">fun</category><category domain="http://www.blogger.com/atom/ns#">adventure</category><title>Partying with the Moon Rock Liberator</title><description>The other day I was reading an article online titled &lt;a href="http://gizmodo.com/5242736/how-an-intern-stole-nasas-moon-rocks"&gt;"How an Intern Stole Nasa's Moon Rocks"&lt;/a&gt;. I didn't give it much thought at the time and moved on with my life. But on the back of my mind I developed a sense of respect to the man who pulled that incredible heist. A couple of days later my wife sent me an email that knocked me off my ass. The basic gist of the email is that her TA is Thad Roberts. For those of you who didn't read the article, he is the master mind behind the moon rock heist of 2002.&lt;br /&gt;&lt;br /&gt;I could not contain the excitement once I found out that he is actually meetable (not a real word). Of course my wife managed to get me a little jealous when she wouldn't shut up about him. But I was never happier in my life with my wife's decision to take that Physics class.&lt;br /&gt;&lt;br /&gt;Yesterday was the first time I got to meet the man in flesh and bones, in a "Physics" party for the students of that class. To be honest, I was expecting a charming, charismatic, adrenaline-seeking, egocentric, alpa-male and I was right up until the adrenaline-seeking part. He was everything the article described him to be, and a bit more. What the articles missed to mention was that he is actually a really nice guy who is down-to-earth and friendly. A regular guy with a regular life. I had a great time talking to him in the party and to my surprise it was probably the first time I actually enjoyed being at a party.&lt;br /&gt;&lt;br /&gt;At the end of the party he recounted the experience of liberating the rocks. I call it liberating because he was only taking the used up rocks that were sitting in a metal safe (not even on display) that bear no scientific value anymore. The story from the horse's mouth was a little bit different from the one I read on the article. Apparently only 30% of the article is true and the journalist filled in the rest with some fluff to make it juicy. He did send me the original article that he personally approved for publication. But listening to the story from him was a lot more fun and interesting. I didn't ask him about a couple of questions about the story, but it was not the time and place, it'll have to wait. &lt;br /&gt;&lt;br /&gt;He invited us to join an adventure club that he is putting together, I can't wait :).&lt;br /&gt;&lt;br /&gt;Update: Thad has his own &lt;a href="http://moebiusgroupe.com/qst/index.html"&gt;webpage&lt;/a&gt; with links to his new book (Did I forget to mention he wrote a book on quantum space theory when he was in jail?) that is due to be released soon and a blog with some pictures.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9876605-7071280305343699676?l=amjith.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/amjith?a=jWrz-blpqXY:36wzXvSkZCs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/amjith?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/amjith/~4/jWrz-blpqXY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/amjith/~3/jWrz-blpqXY/partying-with-moon-rock-liberator.html</link><author>noreply@blogger.com (Amjith Ramanujam)</author><thr:total>1</thr:total><feedburner:origLink>http://amjith.blogspot.com/2009/06/partying-with-moon-rock-liberator.html</feedburner:origLink></item></channel></rss>

