<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dare to Dream? &#187; A strong urge to blog&#8230;</title>
	<atom:link href="http://www.makuchaku.in/blog/category/a-strong-urge-to-blog8230/feed" rel="self" type="application/rss+xml" />
	<link>http://www.makuchaku.in/blog</link>
	<description>Good judgment comes from experience; Experience comes from bad judgment.</description>
	<lastBuildDate>Sun, 02 Oct 2011 19:29:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Speeding things up with tmpfs</title>
		<link>http://www.makuchaku.in/blog/speeding-things-up-with-tmpfs</link>
		<comments>http://www.makuchaku.in/blog/speeding-things-up-with-tmpfs#comments</comments>
		<pubDate>Sun, 02 Oct 2011 19:23:09 +0000</pubDate>
		<dc:creator>Mayank Jain (makuchaku)</dc:creator>
				<category><![CDATA[A strong urge to blog...]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.makuchaku.in/blog/?p=1101</guid>
		<description><![CDATA[Since I have 6GB of RAM in my new laptop, I thought (while watching the first episode of Big Boss 5) that lets put it to some good use. Did some research &#38; found out that I can actually create a small tmpfs partition from a portion of my extra RAM and use it to [...]


No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[ 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/speeding-things-up-with-tmpfs&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span><p>Since I have 6GB of RAM in my new laptop, I thought (while watching the first episode of Big Boss 5) that lets put it to some good use.</p>
<p>Did some research &amp; found out that I can actually create a small tmpfs partition from a portion of my extra RAM and use it to super-charge my disk access.</p>
<p>What if, I could keep the most accessed parts of my hard disk on this partition &amp; somehow figure out how to persistently do this, I think I can really really speed up the disk access.</p>
<p>I did a quick test to confirm this (/run is mounted on my Ubuntu 11.10 Beta2 as tmpfs partition)</p>
<p><strong>Test &#8211; time creation of a 1GB dummy file.</strong></p>
<p>On my regular 7200 rpm disk<br />
<img class="alignnone size-full wp-image-1102" title="1GB file creation on my 7200rpm disk drive" src="http://www.makuchaku.in/blog/wp-content/uploads/2011/10/snapshot-12.png" alt="" /></p>
<p>On the /run partition (which is mounted as tmpfs)<br />
<img title="1GB file creation on tmpfs partition (/run)" src="http://www.makuchaku.in/blog/wp-content/uploads/2011/10/snapshot-13.png" alt="" /></p>
<p>This clearly shows the benefit of using tmpfs for disk access.</p>
<p>In the posts following this post, I would try to document my experiences with tmpfs.</p>
 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/speeding-things-up-with-tmpfs&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.makuchaku.in/blog/speeding-things-up-with-tmpfs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trip notes &#8211; Gangtok, Sikkim</title>
		<link>http://www.makuchaku.in/blog/trip-notes-gangtok-sikkim</link>
		<comments>http://www.makuchaku.in/blog/trip-notes-gangtok-sikkim#comments</comments>
		<pubDate>Sat, 16 Jul 2011 16:41:16 +0000</pubDate>
		<dc:creator>Mayank Jain (makuchaku)</dc:creator>
				<category><![CDATA[A strong urge to blog...]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Novice Traveller]]></category>

		<guid isPermaLink="false">http://www.makuchaku.in/blog/?p=1065</guid>
		<description><![CDATA[With this post, I am trying to start a new habit &#8211; of documenting tidbits about my trips with my wife (Kanika) to places worth remembering &#38; sharing about. I hope, with this, I will also renew the long lost will to sit and write for my dear blog Gangtok Some quick facts about our [...]


No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[ 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/trip-notes-gangtok-sikkim&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span><p>With this post, I am trying to start a new habit &#8211; of documenting tidbits about my trips with my wife (Kanika) to places worth remembering &amp; sharing about.</p>
<p>I hope, with this, I will also renew the long lost will to sit and write for my dear blog <img src='http://www.makuchaku.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2><strong>Gangtok</strong></h2>
<p>Some quick facts about our journey&#8230;</p>
<ol>
<li>Our trip was scheduled from 29th June 2011 to 3rd July 2011.</li>
<li>Flight tickets costed us about INR 13,000 (we had booked our tickets about 1 month in advance)</li>
<li>Our stay was at a local guest house in Gangtok (arranged by Kanika&#8217;s mom) &#8211; cost &#8211; INR 100 /night</li>
<li>Travel from Bagdogra airport to Gangtok (guest house drop) &#8211; INR 820 (shared cab with another couple) (Maruti Van)</li>
<li>Travel from Gangtok (Guest house pickup) to Bagdogra Airport &#8211; INR 1,500 (same Maruti van, same driver, not shared)</li>
</ol>
<div><strong>Notes about Gangtok&#8230;</strong></div>
<div>Things which you should know before planning a trip there&#8230;</div>
<div>
<ul>
<li>Rains are a complete badass in Gangtok. It used to rain for complete nights during our stay (and during the days as well). Roads leading to the hills which are not well built get dangerously muddy &amp; almost unusable.</li>
<li>Paying extra to get an experienced driver and a good (&amp; heavy) car is a decision you should always try to be in favor of.</li>
<li>Season to visit &#8211; Oct/Nov and March/April (costly) &#8211; Its the best time to visit as the badass rains have either not started yet or just stopped. Winter is either setting in or giving way to summers. If lucky, you can also get to see snowfall at this time.</li>
<li>Off season &#8211; June/July (cheaper) &#8211; Though we had no choice about our travel dates &#8211; we did enjoy the climate at this time of the year. Not to mention, visiting Gangtok during this part of the year has its own advantages <img src='http://www.makuchaku.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Travel inside Gangtok is VERY costly. The private taxi driving business is soo booming here that almost every next youngster is a private taxi driver in Gangtok. Be ready to shell out $$ if you plan to take up private cabs for your sigh seeing. What costed us just INR 820 one way (luckily we found a couple to share the cab with) &#8211; got inflated to INR 1500 just because we were the only folks travelling to the Airport that morning from our route.</li>
<li>There is NO airport in Gangtok. The only airport near Gangtok is in Bagdogra (West Bengal) &#8211; which is about 135 kilometers from Gangtok. This travel can take anywhere from 3 to 6 hours based on the condition of roads (&amp; traffic jams). Start early if your flight is in the first half of the day.</li>
<li>People of Gangtok are amazingly simple and friendly. I have not seen a city this friendly. Even Pune isn&#8217;t any close to Gangtok that way. Kudos to them <img src='http://www.makuchaku.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>When traveling first time to Gangtok, try to locate your destination hotel/lodge in reference to the MG Market. Its the heart of the city, has 3 large taxi stands built around it. Also, every driver knows this place. If at all possible, get a guest house near this market. Ours was about 10 kms further uphill and we really did witnessed some interesting times &#8211; trying to figure out how to reach our guest house.</li>
<li>If you plan to visit Nathula Pass, carry two photographs of yours. Not required, but also carry some identification papers (xerox) &#8211; as any visit to the Nathula Pass is sanctioned by the Army.</li>
</ul>
<div><strong>Places to visit </strong>(<a href="https://lh4.googleusercontent.com/-kZltcD55O6k/ThnLCRxhe3I/AAAAAAAAADU/MgIooDuw6uQ/IMG_2532.jpg" target="_blank">Map of Gangtok for reference</a>)</div>
<div>In our 3 days of stay at Gangtok, I think we saw almost all of what was there to see in this season.</div>
<div>
<ol>
<li>1st Day &#8211; We booked a cab for INR 1000 which took us to the North &amp; central tour of the city. It was a decently fulfilling day.</li>
<li>2nd Day &#8211; We opted to rest. Visited the MG Market, bought souvenirs, saw Delhi Belly at a local theater <img src='http://www.makuchaku.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  We also booked our travel to Nathula Pass (INR 600 per person, shared cab)</li>
<li>3rd Day &#8211; The journey to Nathula Pass was awesome. The valley below you looks breathtaking when you are going uphill. And at 15,000 feet, the climate is awesomely chilly. Hats off to the Army Jawans who live in such a harsh climate.</li>
</ol>
</div>
</div>
<p><strong>Gist</strong><br />
Its an amazingly breathtaking place. If you are willing to travel on long road journeys &amp; enjoy the journey more than the destination, its THE place for you.</p>
<p>I just wish, there was an airport inside Gangtok (or atleast Sikkim).</p>
<p>To end this post, I would like to show a brilliant piece of art I saw at the Handicrafts museum. I am completely in awe of the symmetry this drawing was made with. Whats even more brilliant, was the way this symmetry was achieved.</p>
<p><img src="https://lh4.googleusercontent.com/-yYiGGP1v4yI/ThnLCUjh1sI/AAAAAAAAABE/-2Z8SOyGD6M/s800/IMG_2510.jpg" alt="" width="600" height="800" /></p>
<p>Lord Gautama Buddha</p>
 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/trip-notes-gangtok-sikkim&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.makuchaku.in/blog/trip-notes-gangtok-sikkim/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Date arithmetic without having to worry about impact on dates, months or years!</title>
		<link>http://www.makuchaku.in/blog/date-arithmetic-without-having-to-worry-about-impact-on-dates-months-or-years</link>
		<comments>http://www.makuchaku.in/blog/date-arithmetic-without-having-to-worry-about-impact-on-dates-months-or-years#comments</comments>
		<pubDate>Mon, 09 May 2011 10:46:35 +0000</pubDate>
		<dc:creator>Mayank Jain (makuchaku)</dc:creator>
				<category><![CDATA[A strong urge to blog...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[My Learnings]]></category>

		<guid isPermaLink="false">http://www.makuchaku.in/blog/?p=1062</guid>
		<description><![CDATA[Last night, my wife asked a very simple question&#8230; - &#8221;In shell scripting, given a date, how can I subtract 5 hours from it?&#8221; The question was particularly interesting because the moment you think about any arithmetic on dates, you need to calculate the impact on all the other values. For example, subtracting 5 hours from [...]


No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[ 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/date-arithmetic-without-having-to-worry-about-impact-on-dates-months-or-years&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span><p>Last night, my wife asked a very simple question&#8230; - &#8221;In shell scripting, given a date, how can I subtract 5 hours from it?&#8221;</p>
<p>The question was particularly interesting because the moment you think about any arithmetic on dates, you need to calculate the impact on all the other values. For example, subtracting 5 hours from 0200 hours would shift the date by -1. Similar for months, years &#038; what not. Things get even more complicated by leap years, etc.</p>
<p>So, back to question. How do I subtract 5 hours from a given date? Usage of any other programming language is not allowed (Perl or Ruby).</p>
<p>I tried, searched internet for <a href="http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html" target="_blank">some</a> <a href="http://en.wikipedia.org/wiki/Date_(Unix)" target="_blank">references</a> &#8211; I did came across some candid solutions, but they either resorted to Perl, or were <a href="http://www.kingcomputerservices.com/unix_101/date_arithmetic_part_1.htm" target="_blank">full fledged shell scripts</a> themselves.</p>
<p>And then it hit me.</p>
<blockquote><p>If I convert the given timestamp into seconds since Epoch, subtract the number of seconds in 5 hours &amp; convert the number of seconds back to a timestamp &#8211; it&#8217;ll be a whhakeroonie!!!</p></blockquote>
<p>Hence, this&#8230;</p>
<pre>
D="20110406164224"
date -d "${D:0:8} ${D:8:2}:${D:10:2}:${D:12:2}"
==> Wed Apr  6 16:42:24 IST 2011
date -d "${D:0:8} ${D:8:2}:${D:10:2}:${D:12:2}" +"%s"
==> 1302088344
expr 1302088344 - 18000
==> 1302070344
date -d @1302070344
==> Wed Apr  6 11:42:24 IST 2011
</pre>
<p>As you can see, the result is -5 hours from the timestamp.</p>
 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/date-arithmetic-without-having-to-worry-about-impact-on-dates-months-or-years&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.makuchaku.in/blog/date-arithmetic-without-having-to-worry-about-impact-on-dates-months-or-years/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple MapReduce with Javascript</title>
		<link>http://www.makuchaku.in/blog/simple-mapreduce-with-javascript</link>
		<comments>http://www.makuchaku.in/blog/simple-mapreduce-with-javascript#comments</comments>
		<pubDate>Sun, 08 May 2011 06:40:20 +0000</pubDate>
		<dc:creator>Mayank Jain (makuchaku)</dc:creator>
				<category><![CDATA[A strong urge to blog...]]></category>
		<category><![CDATA[AdoMado]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.makuchaku.in/blog/?p=1057</guid>
		<description><![CDATA[The best way to understand MapReduce is to actually see &#38; feel it in action. Following is the simplest possible example I could cook&#8230; (Gist link) &#160; var Job = &#123; &#160; &#160; data : &#91; &#160; &#160; &#160; &#160; &#160; &#34;We are glad to see you here. This site is dedicated to&#34;, &#160; &#160; [...]


Related posts:<ol><li><a href='http://www.makuchaku.in/blog/kickass-mcv-for-your-javascript-apps' rel='bookmark' title='Kickass MCV for your Javascript Apps'>Kickass MCV for your Javascript Apps</a> <small>Very recently, I had an opportunity to work on a...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[ 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/simple-mapreduce-with-javascript&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span><p>The best way to understand MapReduce is to actually see &amp; feel it in action. Following is the simplest possible example I could cook&#8230; (<a href="https://gist.github.com/961172">Gist link</a>)</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> Job = <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; data : <span class="br0">&#91;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;We are glad to see you here. This site is dedicated to&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;poetry and to the people who make poetry possible&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;poets and their readers. FamousPoetsAndPoems.com is&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;a free poetry site. On our site you can find a large&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;collection of poems and quotes from over 631 poets&quot;</span>,</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Read and Enjoy Poetry&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;I, too, sing America&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;I am the darker brother&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;They send me to eat in the kitchen&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;When company comes&quot;</span>,</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;But I laugh&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;And eat well&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;And grow strong&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Tomorrow&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Ill be at the table&quot;</span>,</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;When company comes&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Nobodyll dare&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Say to me&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Eat in the kitchen&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Then&quot;</span>,</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Besides&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Theyll see how beautiful I am&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;And be ashamed&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;I, too, am America&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#93;</span>,</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; map : <span class="kw2">function</span><span class="br0">&#40;</span>line<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">var</span> splits = line.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&quot; &quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">var</span> temp = <span class="br0">&#91;</span><span class="br0">&#93;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span><span class="kw2">var</span> i=<span class="nu0">0</span>; i&lt;splits .<span class="me1">length</span>; i++<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; temp.<span class="me1">push</span><span class="br0">&#40;</span><span class="br0">&#123;</span>key : splits<span class="br0">&#91;</span>i<span class="br0">&#93;</span>, value : <span class="nu0">1</span><span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> temp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; <span class="br0">&#125;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; reduce : <span class="kw2">function</span><span class="br0">&#40;</span>allSteps<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">var</span> result = <span class="br0">&#123;</span><span class="br0">&#125;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span><span class="kw2">var</span> i=<span class="nu0">0</span>; i&lt;allSteps.<span class="me1">length</span>; i++<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw2">var</span> step = allSteps<span class="br0">&#91;</span>i<span class="br0">&#93;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; result<span class="br0">&#91;</span>step.<span class="me1">key</span><span class="br0">&#93;</span> = result<span class="br0">&#91;</span>step.<span class="me1">key</span><span class="br0">&#93;</span> ? <span class="br0">&#40;</span>result<span class="br0">&#91;</span>step.<span class="me1">key</span><span class="br0">&#93;</span> + <span class="nu0">1</span><span class="br0">&#41;</span> : <span class="nu0">1</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">return</span> result;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#125;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; init : <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw2">var</span> allSteps = <span class="br0">&#91;</span><span class="br0">&#93;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span><span class="kw2">var</span> i=<span class="nu0">0</span>; i&lt;Job.<span class="me1">data</span>.<span class="me1">length</span>; i++<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; allSteps = allSteps.<span class="me1">concat</span><span class="br0">&#40;</span>Job.<span class="me1">map</span><span class="br0">&#40;</span>Job.<span class="me1">data</span><span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">var</span> result = Job.<span class="me1">reduce</span><span class="br0">&#40;</span>allSteps<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span>JSON.<span class="me1">stringify</span><span class="br0">&#40;</span>result<span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span>; <span class="co1">// Job</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">Job.<span class="me1">init</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>Copy &amp; paste this code in your browser&#8217;s JS console.</p>
<p>Console output&#8230;</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span><span class="st0">&quot;631&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;We&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;are&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;glad&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;to&quot;</span>:<span class="nu0">5</span>,<span class="st0">&quot;see&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;you&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;here.&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;This&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;site&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;is&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;dedicated&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;poetry&quot;</span>:<span class="nu0">3</span>,<span class="st0">&quot;and&quot;</span>:<span class="nu0">4</span>,<span class="st0">&quot;the&quot;</span>:<span class="nu0">5</span>,<span class="st0">&quot;people&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;who&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;make&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;possible&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;poets&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;their&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;readers.&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;FamousPoetsAndPoems.com&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;a&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;free&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;site.&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;On&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;our&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;can&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;find&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;large&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;collection&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;of&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;poems&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;quotes&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;from&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;over&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Read&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Enjoy&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Poetry&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;I,&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;too,&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;sing&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;America&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;I&quot;</span>:<span class="nu0">3</span>,<span class="st0">&quot;am&quot;</span>:<span class="nu0">3</span>,<span class="st0">&quot;darker&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;brother&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;They&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;send&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;me&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;eat&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;in&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;kitchen&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;When&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;company&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;comes&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;But&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;laugh&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;And&quot;</span>:<span class="nu0">3</span>,<span class="st0">&quot;well&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;grow&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;strong&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Tomorrow&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Ill&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;be&quot;</span>:<span class="nu0">2</span>,<span class="st0">&quot;at&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;table&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Nobodyll&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;dare&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Say&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Eat&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Then&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Besides&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;Theyll&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;how&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;beautiful&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;ashamed&quot;</span>:<span class="nu0">1</span><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p></splits></pre>
 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/simple-mapreduce-with-javascript&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span>

<p>Related posts:<ol><li><a href='http://www.makuchaku.in/blog/kickass-mcv-for-your-javascript-apps' rel='bookmark' title='Kickass MCV for your Javascript Apps'>Kickass MCV for your Javascript Apps</a> <small>Very recently, I had an opportunity to work on a...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.makuchaku.in/blog/simple-mapreduce-with-javascript/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Kickass MCV for your Javascript Apps</title>
		<link>http://www.makuchaku.in/blog/kickass-mcv-for-your-javascript-apps</link>
		<comments>http://www.makuchaku.in/blog/kickass-mcv-for-your-javascript-apps#comments</comments>
		<pubDate>Fri, 08 Apr 2011 19:29:11 +0000</pubDate>
		<dc:creator>Mayank Jain (makuchaku)</dc:creator>
				<category><![CDATA[A strong urge to blog...]]></category>
		<category><![CDATA[AdoMado]]></category>
		<category><![CDATA[_sammytammy]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.makuchaku.in/blog/?p=1036</guid>
		<description><![CDATA[Very recently, I had an opportunity to work on a completely client side Javascript App &#8211; a Facebook stream reader. Since FB Graph API returns JSON, it can be directly consumed via JSONP. This app used JQuery Mobile for the UI screens (which totally rocks btw!). I wanted to keep all the logic on the [...]


No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[ 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/kickass-mcv-for-your-javascript-apps&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span><p>Very recently, I had an opportunity to work on a completely client side Javascript App &#8211; a Facebook stream reader. Since FB Graph API returns JSON, it can be directly consumed via JSONP. This app used <a href="http://jquerymobile.com/" target="_blank">JQuery Mobile</a> for the UI screens (which totally rocks btw!).</p>
<p>I wanted to keep all the logic on the client end to as much extent as possible &#8211; with just a <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> component as a cross-domain proxy for post requests.</p>
<p>To my surprise, writing &amp; consuming the Graph API via JSONP was the easiest &#8211; while managing the UI, writing the glue code between callbacks, data &amp; UI was the messiest. I spent 3 days writing this spaghetti of callbacks coupled very tightly to the DOM ids/classes. At the end of 3rd day, it became almost impossible for me to extend the logic to include more functionality.</p>
<p>The code had become ugly &#8211; and I wasn&#8217;t too happy with this.</p>
<p>I started my search for a good MCV framework with a very simple objectives</p>
<ul>
<li>Since I was already using JQuery Mobile, I did not wanted to program with another UI library</li>
<li>As lightweight as possible</li>
<li>Simpler learning curve</li>
<li>Should not get in the way of my programming style.</li>
<li>Well documented</li>
</ul>
<p>I tried the most popular MCV frameworks &#8211; <a href="http://www.sproutcore.com/" target="_blank">SproutCore</a> &amp; <a href="http://javascriptmvc.com/" target="_blank">Javascript MCV</a> &#8211; but didn&#8217;t really found them fitting my needs.</p>
<p>Then I came across &#8211; <a href="http://documentcloud.github.com/backbone/" target="_blank">Backbone.Js</a> &#8211; someone on <a href="http://stackoverflow.com/questions/386885/is-there-a-javascript-mvc-micro-framework" target="_blank">Stackoverflow</a> mentioned &#8211; &#8220;Thank god I found backbone.js&#8221;.</p>
<p>I took that review seriously &amp; spent a night reading the API documentation. Even when I slept, my mind was trying to understand how I could use backbone.js in my architecture (wink wink).</p>
<p>I woke up 7 am the next morning &amp; by 9 am, I had a very minimal architecture written.</p>
<p><script src="https://gist.github.com/910498.js"> </script></p>
<p>By the time I wrapped up office today, I had completely re-written the App into a very nice looking MCV architecture, neatly placed into model/view/collection directories. Being able to re-render a view by just changing an attribute on the model object is a state of pure bliss.</p>
<p>I highly recommend checking out Backbone.js if you are even a wee bit serious about your Javascript App. Invest some time understanding how things are done with backbone.js &#8230; &amp; I can bet that you will never want to directly tie your business logic to the DOM again!</p>
<p>Happy Hacking!</p>
 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/kickass-mcv-for-your-javascript-apps&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.makuchaku.in/blog/kickass-mcv-for-your-javascript-apps/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to commission developer machines in an agile way?</title>
		<link>http://www.makuchaku.in/blog/how-to-commission-developer-machines-in-an-agile-way</link>
		<comments>http://www.makuchaku.in/blog/how-to-commission-developer-machines-in-an-agile-way#comments</comments>
		<pubDate>Sun, 20 Mar 2011 08:35:25 +0000</pubDate>
		<dc:creator>Mayank Jain (makuchaku)</dc:creator>
				<category><![CDATA[A strong urge to blog...]]></category>
		<category><![CDATA[AdoMado]]></category>
		<category><![CDATA[My FooBar Ideas]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.makuchaku.in/blog/?p=1030</guid>
		<description><![CDATA[During the past year &#8211; working at AdoMado, I&#8217;ve seen myself &#38; our developers wasting a lot of time in maintaining their own dev machines. Package install/upgrade/dependency failures, OS upgrade failures, hard drives failures, the machine not being available physically (in case of laptops), etc &#8211; are just a few cases. Can there be a more [...]


No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[ 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/how-to-commission-developer-machines-in-an-agile-way&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span><p>During the past year &#8211; working at <a href="http://adomado.com" target="_blank">AdoMado</a>, I&#8217;ve seen myself &amp; our developers wasting a lot of time in maintaining their own dev machines. Package install/upgrade/dependency failures, OS upgrade failures, hard drives failures, the machine not being available physically (in case of laptops), etc &#8211; are just a few cases.</p>
<p>Can there be a more agile way of working for developers? Given that the technology stack an organization runs on is often well defined, this should be fairly possible.</p>
<p><img class="alignright" src="http://devstructure.com/img/logo.png" alt="" width="256" height="46" />Very recently, I came across a project from one of the Slicehost founders Matt Tanase &#8211; <a href="http://devstructure.com" target="_blank">BluePrint</a>. The project lets you create versionable configurations from an existing installs. Just setup your machine the way you want it to be, run blueprint &amp; wallah, you have a re-deployable configuration. Everything is created as a Git repository, hence any change you make to the configuration &#8211; is also versionable.</p>
<p>Next, if we can somehow automate the process of creating the machine images, we will be almost there. Luckily, there&#8217;s <a href="http://vagrantup.com/" target="_blank">Vagrant</a>. Its a tool to build &amp; distribute virtualized environments. Blueprint also supports Vagrant.</p>
<p>Add to this, a web based editor (<a href="http://ace.ajax.org/" target="_blank">Bespin or Ace</a>) &#8211; and you have a perfect recipe for dishing out pre-built images of your technology stack which are just perfect enough to be run on VirtualBox.</p>
<p>Imagine, its the first day of the developer. He can simply checkout such an image from a dashboard, run it on a VM &amp; he&#8217;s ready to rock&#8217;n roll!</p>
<p>Since all of this is automated, this process can be improved &amp; repeated as many times as one wants.</p>
<p>Sweet, aint it!</p>
<p>Ever since I started working on a Desktop as a full time machine, the only access to after-office-hours machine I have is my wife&#8217;s laptop &#8211; which being a WinBlows box, creeps me out. Such a setup, even if remotely possible &#8211; will give me the freedom I need to stretch my legs &amp; utilize my free time <img src='http://www.makuchaku.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
 
<span class = "" style = "height: 40px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.makuchaku.in/blog/how-to-commission-developer-machines-in-an-agile-way&layout=button_count&send=false&show_faces=false&width=100&action=like&colorscheme=light&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:40px"></iframe></span>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.makuchaku.in/blog/how-to-commission-developer-machines-in-an-agile-way/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

