<?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?</title>
	<atom:link href="http://www.makuchaku.in/blog/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>Sat, 03 Mar 2012 13:37:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Why I will buy a quad core tablet this year</title>
		<link>http://www.makuchaku.in/blog/why-i-will-buy-a-quad-core-tablet-this-year</link>
		<comments>http://www.makuchaku.in/blog/why-i-will-buy-a-quad-core-tablet-this-year#comments</comments>
		<pubDate>Sat, 03 Mar 2012 13:35:40 +0000</pubDate>
		<dc:creator>Mayank Jain (makuchaku)</dc:creator>
				<category><![CDATA[A strong urge to blog...]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[My FooBar Ideas]]></category>

		<guid isPermaLink="false">http://www.makuchaku.in/blog/?p=1110</guid>
		<description><![CDATA[About 15 months ago, after much research, I bought my Samsung Galaxy S GTi9000 &#8211; and it was one of my best buy decision so far. Back then, the GTi9000 was the pack leader in Android smartphones &#38; besides a few hiccups, my device did not fail to impress me. I need more cores per CPU [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>About 15 months ago, after <a href="http://www.makuchaku.in/blog/why-i-will-pick-samsung-galaxy-s-i9000-over-nexus-one-or-htc-desire" target="_blank">much research</a>, I bought my Samsung Galaxy S GTi9000 &#8211; and it was one of my best buy decision so far. Back then, the GTi9000 was the pack leader in Android smartphones &amp; besides a few hiccups, my device did not fail to impress me.</p>
<p><strong>I need more cores per CPU</strong></p>
<p>Using the device for everyday activities, I do feel that a single core processor is a bit lacking at times. Agreed that there weren&#8217;t enough choices at that time &#8211; but today there are. The hottest fad in mobile/tablet industry is &#8220;Quad Core&#8221; &#8211; however I consider it a real deal!</p>
<p>While performing the most simple tasks &#8211; such as browsing, watching movies/pictures, using feature rich home screen replacements, etc &#8211; you can actually feel the single core CPU becoming the bottleneck. The snappiness just isn&#8217;t there. However fast is your CPU, any CPU bound process can potentially hog a single core CPU &#8211; thereby blocking all the other processes waiting for the CPU. The more CPU hungry a process becomes, the bigger queue of pending processes it creates &#8211; eventually leading to the big bang domino effect.  This, when compared to the multi core CPU, the load is distributed across the cores &#8211; thereby letting more processes use the CPU&#8217;s simultaneously &#8211; hence more snappiness in usage. I would any day prefer Dual core 1Ghz CPU instead of a Single core 2Ghz CPU (considering everything else remains constant).</p>
<p>Speaking of multiple cores, Nvidia&#8217;s Tegra 3 architecture (ARM Cortex A9) has done an amazing job. They&#8217;ve managed to fit not just 4 cores in their Soc, but added a fifth companion core as well, totaling the count to 5 cores in the SoC. The 4 primary cores can run upto 1.5Ghz  and are transparently commissioned when demanding apps need them &#8211; while the fifth (&amp; smaller) ~500Mhz companion core keeps humming along for all the mundane tasks like screen refresh, background services, etc. The sheer ability to act like a 500Mhz device when the raw computing power isn&#8217;t needed can potentially save a ton of power. Check AnadTech for a more detailed <a href="http://www.anandtech.com/show/5072/nvidias-tegra-3-launched-architecture-revealed" target="_blank">architecture review of Tegra 3</a>.</p>
<div id="attachment_1116" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-1116 " title="Tegra3, 4+1 cores" src="http://www.makuchaku.in/blog/wp-content/uploads/2012/03/tegra3-core.gif" alt="" width="500" height="370" /><p class="wp-caption-text">Tegra3, 4+1 cores</p></div>
<p>Probably a couple of months down the line, even Samsung will come up with their <a href="http://www.unwiredview.com/2012/02/23/samsung-shows-off-quad-core-exynos-processor/" target="_blank">Exynos quad core CPU</a> (ARM Cortex A9) which promises upto 25% performance boost and about 50% battery savings as compared to the current line of Samsung CPU&#8217;s. Great times ahead!</p>
<p><strong>Why I don&#8217;t care about the ARM Cortex A15?</strong></p>
<p>A lot of folks are eagerly waiting for the ARM Cortex A15&#8242;s to start hitting the retail shelves &#8211; infact are salivating over this! These SoC&#8217;s will beat the A9&#8242;s hands down, running at just half the capacity, consuming just half the battery! And until very recently, I was also in this category.</p>
<p>However, during the past few days, I&#8217;ve been re-evaluating my thoughts. What exactly do I need an A15 CPU for?<br />
- Do I play a ton of GPU hungry games? NO<br />
- Do I want to capture videos more that 60 fps? NO<br />
- Do I need to perform video editing, image editing on my device? NO</p>
<p>The real deal here is to understand my usage pattern and what are my daily requirements. These include<br />
- Enough snappiness to support tons of widgets<br />
- Heavy internet browsing, ability to keep up with upto 10 tabs per session<br />
- Watching HD movies<br />
- Excellent multitasking<br />
- Good battery life (atleast for a day)<br />
- Basic games (sometimes GPU intensive ones)<br />
- Lot of reading from PDF&#8217;s, ebooks<br />
- Tech shelf life of atleast 2 years</p>
<p>Hence, I think, for the above mentioned requirements &#8211; either Tegra 3 or Samsung&#8217;s Exynos quad core SoC&#8217;s would be just perfect.</p>
<p>I don&#8217;t need the fastest CPU&#8230; I just need it to be fast enough for me.</p>
<p><strong>A new Phone or a new Tablet?</strong></p>
<p>I&#8217;ve been split among these options from quite some time. However, thinking on the above lines and anticipating the required expenditure &#8211; I&#8217;ve come to the following conclusion..</p>
<p>Instead of going ahead and buying a new quad core phone (which will cost me a fortune here in India) &#8211; I will keep my SGS GTi9000 (it is already running an alpha build of CM9) and will maximize its usage as a phone. Even in the quad-core era, its still a great device &#8211; with a screen which I absolutely love.</p>
<p>During the May/June interval &#8211; I will look out for a budget (~$300) quad core 7-8 inch tablet with 3G &#8211; which will serve my needs for data consumption, reading, etc.</p>
<p>I am very eagerly waiting for the ASUS to launch their 7&#8243; <a href="http://www.phonearena.com/phones/Asus-MeMO-370T_id6839" target="_blank">ASUS Memo 370T</a> with Tegra 3 (I just hope it will have an option for a 3G radio). Also, considering that with so many device launches, Samsung has nearly perfected their Android manufacturing/delivery/maintenance cycles (look at Galaxy Note, Galaxy Tab 7.7, the awesome S2)  - I am really really anticipating a good 7&#8243; to 8&#8243; quad core tablet from them. That said, I hope that since CPU, GPU, OS are no more the entry barriers to the tablet industry &#8211; more hardware manufacturers will show up in the great tablet wars of 2012.</p>
<p>The 2012 will truly be the year of Quads!</p>
<p>&nbsp;</p>
<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/why-i-will-buy-a-quad-core-tablet-this-year/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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[<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>
<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>AppDok is here!</title>
		<link>http://www.makuchaku.in/blog/appdok-is-here</link>
		<comments>http://www.makuchaku.in/blog/appdok-is-here#comments</comments>
		<pubDate>Tue, 09 Aug 2011 18:36:28 +0000</pubDate>
		<dc:creator>Mayank Jain (makuchaku)</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AdoMado]]></category>
		<category><![CDATA[AppDok]]></category>

		<guid isPermaLink="false">http://www.makuchaku.in/blog/?p=1073</guid>
		<description><![CDATA[Tomorrow is when AppDok&#8217;s might is going to be tested! Wishing good luck to the AppDok&#8216;s launch tomorrow Fingers crossed! No related posts. Related posts brought to you by Yet Another Related Posts Plugin.
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Tomorrow is when AppDok&#8217;s might is going to be tested!</p>
<p>Wishing good luck to the <a href="http://appdok.com">AppDok</a>&#8216;s launch tomorrow <img src='http://www.makuchaku.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Fingers crossed!</p>
<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/appdok-is-here/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[<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>
<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[<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>
<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; [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<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>
<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/simple-mapreduce-with-javascript/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

