<?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: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/" version="2.0">

<channel>
	<title>one me; one keyboard</title>
	
	<link>http://sandesh247.com/journal</link>
	<description>Have you read what I write down there ↴ ?</description>
	<lastBuildDate>Mon, 06 Sep 2010 23:24:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/OneMeOneKeyboard" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="onemeonekeyboard" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Cabbage and rice tastes great!</title>
		<link>http://sandesh247.com/journal/2010/09/cabbage-and-rice-tastes-great</link>
		<comments>http://sandesh247.com/journal/2010/09/cabbage-and-rice-tastes-great#comments</comments>
		<pubDate>Mon, 06 Sep 2010 23:24:27 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[sunysb]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=316</guid>
		<description><![CDATA[Or maybe it is the hunger speaking. I didn&#8217;t have breakfast &#8211; skipped directly to lunch. This was a day after I visited NYC. Thanks to Shrikanth, I have some photos from my university now. Have a look. NYC photographs will follow soon. © sandesh247 for one me; one keyboard, 2010. &#124; Permalink &#124; &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Or maybe it is the hunger speaking. I didn&#8217;t have breakfast &#8211; skipped directly to lunch.</p>
<p>This was a day after I visited NYC. Thanks to Shrikanth, I have some photos from my university now.</p>
<p><a href="http://picasaweb.google.com/sandesh247/ChapinToStonyBrookLirr?feat=directlink"><img class="aligncenter" title="Chapin to LIRR" src="http://lh6.ggpht.com/_sTFO93ea0eA/TIVH7UJc8DE/AAAAAAAADeg/hWWw6bsFp1I/s160-c/ChapinToStonyBrookLirr.jpg" alt="" width="160" height="160" /></a>Have a look. NYC photographs will follow soon.</p>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2010. |
<a href="http://sandesh247.com/journal/2010/09/cabbage-and-rice-tastes-great">Permalink</a> |
<a href="http://sandesh247.com/journal/2010/09/cabbage-and-rice-tastes-great#comments"></a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2010/09/cabbage-and-rice-tastes-great&title=Cabbage and rice tastes great!">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/fhN7q_ggDvk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2010/09/cabbage-and-rice-tastes-great/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The weaker sex?</title>
		<link>http://sandesh247.com/journal/2010/07/the-weaker-sex</link>
		<comments>http://sandesh247.com/journal/2010/07/the-weaker-sex#comments</comments>
		<pubDate>Fri, 16 Jul 2010 12:16:28 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=310</guid>
		<description><![CDATA[From http://esr.ibiblio.org/?p=2118: &#8230; women, in general, are not willing to eat the kind of shit that men will swallow to work in this field. Now let’s talk about death marches, mandatory uncompensated overtime, the beeper on the belt, and having no life. Men accept these conditions because they’re easily hooked into a monomaniacal, warrior-ethic way [...]]]></description>
			<content:encoded><![CDATA[<p>From <a title="Women in computing: first, get the problem right" href="http://esr.ibiblio.org/?p=2118" target="_blank">http://esr.ibiblio.org/?p=2118</a>:</p>
<blockquote><p>&#8230; women, in general, are not willing to eat the kind of shit that men will swallow to work in this field. Now let’s talk about death marches, mandatory uncompensated overtime, the beeper on the belt, and having no life. Men accept these conditions because they’re easily hooked into a monomaniacal, warrior-ethic way of thinking in which achievement of the mission is everything. Women, not so much. Much sooner than a man would, a woman will ask: &#8220;Why, exactly, am I putting up with this?&#8221;</p>
<p>&#8230; if we really want to fix the problem of too few women in computing, we need to ask some much harder questions about how the field treats everyone in it.</p></blockquote>
<p>More like the wiser one.</p>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2010. |
<a href="http://sandesh247.com/journal/2010/07/the-weaker-sex">Permalink</a> |
<a href="http://sandesh247.com/journal/2010/07/the-weaker-sex#comments"></a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2010/07/the-weaker-sex&title=The weaker sex?">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/vKqY-BPQAWE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2010/07/the-weaker-sex/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using unicode to annotate emails</title>
		<link>http://sandesh247.com/journal/2010/06/using-unicode-to-annotate-emails</link>
		<comments>http://sandesh247.com/journal/2010/06/using-unicode-to-annotate-emails#comments</comments>
		<pubDate>Thu, 10 Jun 2010 17:50:56 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[email]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=295</guid>
		<description><![CDATA[I have been using unicode characters like ★, ✘, ✔, ⚠ to annotate my gmail labels. I used it today to mark the subject of one of my mails as a high-priority mail. Wonder if it&#8217;ll work. © sandesh247 for one me; one keyboard, 2010. &#124; Permalink &#124; &#124; Add to del.icio.us Post tags:]]></description>
			<content:encoded><![CDATA[<p>I have been using unicode characters like ★, ✘, ✔, <strong>⚠</strong> to annotate my gmail labels. I used it today to mark the subject of one of my mails as a high-priority mail. Wonder if it&#8217;ll work.</p>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2010. |
<a href="http://sandesh247.com/journal/2010/06/using-unicode-to-annotate-emails">Permalink</a> |
<a href="http://sandesh247.com/journal/2010/06/using-unicode-to-annotate-emails#comments"></a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2010/06/using-unicode-to-annotate-emails&title=Using unicode to annotate emails">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/MFxkraHEcXo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2010/06/using-unicode-to-annotate-emails/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>So, I took my GRE …</title>
		<link>http://sandesh247.com/journal/2009/10/so-i-took-my-gre</link>
		<comments>http://sandesh247.com/journal/2009/10/so-i-took-my-gre#comments</comments>
		<pubDate>Tue, 13 Oct 2009 17:08:46 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[GRE]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=283</guid>
		<description><![CDATA[&#8230; and scored pretty well. 1520, to be exact. For most of the people I know, the biggest hurdle to getting a good score in the GRE was our vocabulary. Most of us have our own way of learning the various word lists available in the market. Mine involved a book, a software made in [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; and scored pretty well. 1520, to be exact.</p>
<p>For most of the people I know, the biggest hurdle to getting a good score in the GRE was our vocabulary. Most of us have our own way of learning the various word lists available in the market. Mine involved a book, a software made in Visual Basic that kept track of difficult words, and a few spreadsheets.</p>
<p>Looking back, I feel there&#8217;s one basic rule to revising -</p>
<ul>
<li>revise that which you did not know the last time you revised</li>
</ul>
<p>With this approach, each subsequent revision contains fewer words than the last one, you don&#8217;t waste time revising the <em>easy</em> words, and hopefully end up with very few <em>difficult</em> words. Of course, you need to keep doing a holistic revision every now and then, so that you don&#8217;t forget what you already knew.</p>
<p>Keeping this in mind, Pascal and I made &#8220;Shabd&#8221;<sup>1</sup>. For now, Shabd is hosted at <a href="http://wl.sandesh247.com/" target="_blank">http://wl.sandesh247.com/</a>, and the source is hosted at <a href="http://code.google.com/p/shab" target="_blank">http://code.google.com/p/shabd</a>. All contributors are welcome.</p>
<p>For now, my deployment has around 5000 words, aggregated from various word lists. You can use the software without logging in. However, the true benefits can only be had if you&#8217;re logged in &#8211; the software keeps track of all the words you know, or don&#8217;t, and can present customized word lists later on. It allows you to go through your most difficult words, or the words you didn&#8217;t know the last time you saw them (in accordance with my basic rule to revising stuff).</p>
<p>Give it a try. Your password are salted and hashed, they aren&#8217;t going anywhere. There&#8217;s no way to change them as yet, so cling on to them while we add support. Also, we need a way to have custom word lists (tags?), and host more flash cards (say, of the French language). The user interface too, leaves a lot to be desired. And then there are things that you&#8217;ll find wrong with it. Please log all such ideas and problems at <a href="http://code.google.com/p/shabd/issues/list" target="_blank">http://code.google.com/p/shabd/issues/list</a>. You&#8217;ll need a Google account for that, however. In case you don&#8217;t have one, drop in a comment here, I&#8217;ll add them to the list myself.</p>
<p>A basic guide to using the software is perhaps in order. The slider on the top jumps through the word list. Press <em>Hit</em> for words you know, this will take you to the next word. Press <em>Miss</em> for the words you don&#8217;t &#8211; this will show the meaning of the word, and bring up the <em>Next</em> button. Click on it to advance to the next word.</p>
<p>In case you are not sure if the word is what you think it is, click on the word to reveal it&#8217;s meaning, and then click on either <em>Hit </em>or <em>Miss</em> depending on whether you were right. Don&#8217;t be tempted to simply press <em>Hit</em> now. There&#8217;s no point in cheating the software &#8211; it&#8217;s not a competition, and you&#8217;ll be hurting your own revision later on.</p>
<p>Have fun!</p>
<p><small><sup>1</sup>In hindsight, this is a generic <em>flash card</em> software, which can be used to learn more than just words. You can perhaps suggest a better name for it.</small></p>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2009. |
<a href="http://sandesh247.com/journal/2009/10/so-i-took-my-gre">Permalink</a> |
<a href="http://sandesh247.com/journal/2009/10/so-i-took-my-gre#comments"></a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2009/10/so-i-took-my-gre&title=So, I took my GRE &#8230;">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/wP_b1QTGWh8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2009/10/so-i-took-my-gre/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using javascript to avoid the mouse and page scrolling</title>
		<link>http://sandesh247.com/journal/2009/06/using-javascript-to-avoid-the-mouse-and-page-scrolling</link>
		<comments>http://sandesh247.com/journal/2009/06/using-javascript-to-avoid-the-mouse-and-page-scrolling#comments</comments>
		<pubDate>Sat, 06 Jun 2009 23:59:47 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=266</guid>
		<description><![CDATA[Here&#8217;s the problem. It is not very easy to scroll a document when you&#8217;re inside an input element. Arrow keys don&#8217;t work, and Page Up/Page Down jump in big increments. What if you want to see just a few lines below the current element? Our clients hate to scroll. And they hate having to use [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the problem. It is not very easy to scroll a document when you&#8217;re inside an input element. Arrow keys don&#8217;t work, and Page Up/Page Down jump in big increments. What if you want to see just a few lines below the current element? Our clients hate to scroll. And they hate having to use the mouse. This just brings the two together.</p>
<p>FScroll is a JQuery plug-in which makes a page scroll to the currently focussed element, keeping it&#8217;s position centered with respect to the document. This helps keep a bit of &#8220;context&#8221; around the currently focussed element &#8211; since it is centered, you can see a few elements both above and below the currently focussed element.</p>
<p>Here are the <a href="http://github.com/sandesh247/projects/tree/master/js/fscroll">sources</a>. And here&#8217;s a <a href="http://sandesh247.com/projects/js/fscroll/fscroll.html">page explaining it&#8217;s usage</a> in some detail. And oh, it does <a href="http://sandesh247.com/projects/js/fscroll/nested_fscroll.html">nested centering</a> too. But it requires that the &#8216;nesting&#8217; container have a css styling of <code>position : relative</code> (in the demo page, the div enclosing the table is positioned relative). This was not strictly necessary, but it made the coding a bit easier. If you can&#8217;t live with the styling restriction, let me know. I&#8217;ll try to do what I can.</p>
<p>You may report issues <a href="http://github.com/sandesh247/projects/issues">here</a>.</p>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2009. |
<a href="http://sandesh247.com/journal/2009/06/using-javascript-to-avoid-the-mouse-and-page-scrolling">Permalink</a> |
<a href="http://sandesh247.com/journal/2009/06/using-javascript-to-avoid-the-mouse-and-page-scrolling#comments"></a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2009/06/using-javascript-to-avoid-the-mouse-and-page-scrolling&title=Using javascript to avoid the mouse and page scrolling">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/3D5iPdCDccA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2009/06/using-javascript-to-avoid-the-mouse-and-page-scrolling/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing git history into a new svn repository</title>
		<link>http://sandesh247.com/journal/2009/06/importing-git-history-into-a-new-svn-repository</link>
		<comments>http://sandesh247.com/journal/2009/06/importing-git-history-into-a-new-svn-repository#comments</comments>
		<pubDate>Mon, 01 Jun 2009 17:06:27 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=235</guid>
		<description><![CDATA[So the management has finally approved your project, and has asked you to start working on it. Heh &#8230; little do they know that you&#8217;d already been working on it, and have a nice prototype working, and it&#8217;s all saved on your local git repository. But your company is not as cool as you are [...]]]></description>
			<content:encoded><![CDATA[<p>So the management has finally approved your project, and has asked you to start working on it. Heh &#8230; little do they know that you&#8217;d already been working on it, and have a nice prototype working, and it&#8217;s all saved on your local git repository. But your company is not as cool as you are &#8211; it has it&#8217;s own svn repository, and now you have to import your code into it, history and all.</p>
<p>Here is the git tree, as you have developed it:</p>
<p><img class="aligncenter size-full wp-image-238" title="Original repostiory structure" src="http://sandesh247.com/journal/wp-content/uploads/2009/06/orig_repository.png" alt="Original repostiory structure" width="313" height="188" /></p>
<p>.. and your svn repository looks similar to this -</p>
<pre>$ svn co &lt;svn repo url&gt;
Checked out revision 0.

$ cd &lt;svnrepo&gt;

$ mkdir tags trunk branches

$ svn add *
A         branches
A         tags
A         trunk

$ svn commit -m "initial directory structure"
Adding         branches
Adding         tags
Adding         trunk

Committed revision 1.</pre>
<p>Now you <em>could</em> copy all the files from the git repository into <code>trunk</code>, and commit it. But that is really not the way it should be. For one &#8211; no one will know the reason for *<em>anything</em>* in this repository before the big bang. Also, there might have been legitimate reasons for people to branch out from some earlier state of the code, but now no one will even know.</p>
<p>Fortunately, a mail on the <a title="KernelTrap" href="http://kerneltrap.org/" target="_blank">kerneltrap</a> archives tells us how we can export a git repository, along with all it&#8217;s history, into an svn repository.</p>
<div class="section">(<small>from <a title="Re: git export to svn | KernelTrap:" href="http://kerneltrap.org/mailarchive/git/2008/10/26/3815034" target="_blank">http://kerneltrap.org/mailarchive/git/2008/10/26/3815034</a></small>)</p>
<p>From: Björn &lt;B.Steinbrink@&#8230;&gt;</p>
<p>&#8230;<br />
&#8230;</p>
<p>This should do and uses a graft to simplify the process a bit:</p>
<p>Initialize git-svn:</p>
<pre>git svn init -s --prefix=svn/ https://svn/svn/SANDBOX/warren/test2</pre>
<p>The &#8211;prefix gives you remote tracking branches like &#8220;svn/trunk&#8221; which<br />
is nice because you don&#8217;t get ambiguous names if you call your local<br />
branch just &#8220;trunk&#8221; then. And -s is a shortcut for the standard<br />
trunk/tags/branches layout.</p>
<p>Fetch the initial stuff from svn:</p>
<pre>git svn fetch</pre>
<p>Now look up the hash of your root commit (should show a single commit):</p>
<pre>git rev-list --parents master | grep '^.\{40\}$'</pre>
<p>Then get the hash of the empty trunk commit:</p>
<pre>git rev-parse svn/trunk</pre>
<p>Create the graft:</p>
<pre>echo &lt;root-commit-hash&gt; &lt;svn-trunk-commit-hash&gt;  &gt;&gt; .git/info/grafts</pre>
<p>Now, &#8220;gitk&#8221; should show svn/trunk as the first commit on which your<br />
master branch is based.</p>
<p>Make the graft permanent:</p>
<pre>git filter-branch -- ^svn/trunk --all</pre>
<p>Drop the graft:</p>
<pre>rm .git/info/grafts</pre>
<p>gitk should still show svn/trunk in the ancestry of master</p>
<p>Linearize your history on top of trunk:</p>
<pre>git svn rebase</pre>
<p>And now <code>git svn dcommit -n</code> should tell you that it is going to commit<br />
to trunk.</div>
<p>If you check your svn repository log, it will look like this.<br />
<img class="aligncenter size-full wp-image-251" title="SVN log" src="http://sandesh247.com/journal/wp-content/uploads/2009/06/svn_log.png" alt="SVN log" width="500" height="145" /></p>
<p>All the history, nice and linearised for svn.</p>
<p>Keep in mind though, that this method is lossy. All the branches have been <em>linearised</em>, and you can no longer &#8220;check them out&#8221; in the original git repository. Apart from that, things work just fine, and you can continue to commit in your local git repository, and push to svn as and when needed.</p>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2009. |
<a href="http://sandesh247.com/journal/2009/06/importing-git-history-into-a-new-svn-repository">Permalink</a> |
<a href="http://sandesh247.com/journal/2009/06/importing-git-history-into-a-new-svn-repository#comments">one comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2009/06/importing-git-history-into-a-new-svn-repository&title=Importing git history into a new svn repository">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/vitmi7Se47g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2009/06/importing-git-history-into-a-new-svn-repository/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sights and sounds, in and around Vasai</title>
		<link>http://sandesh247.com/journal/2009/05/sights-and-sounds-in-and-around-vasai</link>
		<comments>http://sandesh247.com/journal/2009/05/sights-and-sounds-in-and-around-vasai#comments</comments>
		<pubDate>Wed, 27 May 2009 19:06:39 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[funny]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[vasai]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=211</guid>
		<description><![CDATA[This is what population growth, and the resulting competition, can do. ~ English is a foreign language to most Indians, and yet it seems to be preferred for dispensing information. It&#8217;s not uncommon to see a gaffe every now and then. © sandesh247 for one me; one keyboard, 2009. &#124; Permalink &#124; &#124; Add to [...]]]></description>
			<content:encoded><![CDATA[<p>This is what population growth, and the resulting competition, can do.</p>
<p style="text-align: center;"><a href="http://sandesh247.com/journal/wp-content/uploads/2009/05/19052009321.png" target="_blank"><img class="size-medium wp-image-216 aligncenter section bghilite" title="I wonder if I am eligible ..." src="http://sandesh247.com/journal/wp-content/uploads/2009/05/19052009321-216x300.png" alt="Tough job market" width="216" height="300" /></a></p>
<p>~</p>
<p>English is a foreign language to most Indians, and yet it seems to be preferred for dispensing information. It&#8217;s not uncommon to see a gaffe every now and then.</p>
<p style="text-align: center;"><a href="http://sandesh247.com/journal/wp-content/uploads/2009/05/14012009085.jpg" target="_blank"><img class="size-medium wp-image-215 aligncenter section bghilite" title="Why would I go here, again?" src="http://sandesh247.com/journal/wp-content/uploads/2009/05/14012009085-225x300.jpg" alt="Compushop @ Vasai" width="225" height="300" /></a></p>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2009. |
<a href="http://sandesh247.com/journal/2009/05/sights-and-sounds-in-and-around-vasai">Permalink</a> |
<a href="http://sandesh247.com/journal/2009/05/sights-and-sounds-in-and-around-vasai#comments"></a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2009/05/sights-and-sounds-in-and-around-vasai&title=Sights and sounds, in and around Vasai">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/VgGwDWE-9tM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2009/05/sights-and-sounds-in-and-around-vasai/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do you see me?</title>
		<link>http://sandesh247.com/journal/2009/05/do-you-see-me</link>
		<comments>http://sandesh247.com/journal/2009/05/do-you-see-me#comments</comments>
		<pubDate>Mon, 25 May 2009 18:39:18 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[social]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=181</guid>
		<description><![CDATA[Updating my profile picture isn&#8217;t an easy task anymore. There are many sites where I own a profile, and I have to look just right on each one of them. As of now, these are the places you can see my shiny new profile picture: http://sandesh247.com http://www.google.com/profiles/sandesh247 http://www.linkedin.com/in/sandesh247 http://identi.ca/sandesh247/ http://www.facebook.com/profile.php?id=543752933 http://www.goodreads.com/sandesh247 http://www.last.fm/user/sandesh247 http://friendfeed.com/sandesh247 http://www.orkut.co.in/Main#FullProfile.aspx?uid=6964782234814101571 http://www.gravatar.com/avatar/f37a7393ce728b072aca55535f759e9f [...]]]></description>
			<content:encoded><![CDATA[<p>Updating my profile picture isn&#8217;t an easy task anymore. There are many sites where I own a profile, and I <em>have</em> to look just right on each one of them.</p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_187" class="wp-caption aligncenter" style="width: 160px;">
<dt class="wp-caption-dt"><img class="size-thumbnail wp-image-187" title="Is it me?" src="http://sandesh247.com/journal/wp-content/uploads/2009/05/silhouette_vector-150x150.png" alt="Silhouette" width="150" height="150" /></dt>
</dl>
</div>
<p>As of now, these are the places you can see my shiny new profile picture:</p>
<ul>
<li><a rel="me" href="http://sandesh247.com" target="_blank">http://sandesh247.com</a></li>
<li><a rel="me" href="http://www.google.com/profiles/sandesh247" target="_blank">http://www.google.com/profiles/sandesh247</a></li>
<li><a rel="me" href="http://www.linkedin.com/in/sandesh247" target="_blank">http://www.linkedin.com/in/sandesh247</a></li>
<li><a rel="me" href="http://identi.ca/sandesh247/" target="_blank">http://identi.ca/sandesh247/</a></li>
<li><a rel="me" href="http://www.facebook.com/profile.php?id=543752933" target="_blank">http://www.facebook.com/profile.php?id=543752933</a></li>
<li><a rel="me" href="http://www.goodreads.com/sandesh247" target="_blank">http://www.goodreads.com/sandesh247</a></li>
<li><a rel="me" href="http://www.last.fm/user/sandesh247" target="_blank">http://www.last.fm/user/sandesh247</a></li>
<li><a rel="me" href="http://friendfeed.com/sandesh247" target="_blank">http://friendfeed.com/sandesh247</a></li>
<li><a rel="me" href="http://www.orkut.co.in/Main#FullProfile.aspx?uid=6964782234814101571" target="_blank">http://www.orkut.co.in/Main#FullProfile.aspx?uid=6964782234814101571</a></li>
<li><a rel="me" href="http://www.gravatar.com/avatar/f37a7393ce728b072aca55535f759e9f" target="_blank">http://www.gravatar.com/avatar/f37a7393ce728b072aca55535f759e9f</a> <small>(all gravatar enabled websites)</small></li>
<li><a rel="me" href="http://twitter.com/sandesh247" target="_blank">http://twitter.com/sandesh247</a></li>
</ul>
<p>&nbsp;<br />
Phew. I hope that covers them all.</p>
<p><small>P.S. Last.fm and Twitter aren&#8217;t playing nice right now. I guess I have to keep trying.</small></p>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2009. |
<a href="http://sandesh247.com/journal/2009/05/do-you-see-me">Permalink</a> |
<a href="http://sandesh247.com/journal/2009/05/do-you-see-me#comments">one comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2009/05/do-you-see-me&title=Do you see me?">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/A30njts8kf0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2009/05/do-you-see-me/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tuning LINQ performance with Mr. P and Mr. S</title>
		<link>http://sandesh247.com/journal/2009/05/tuning-linq-performance-with-mr-p-and-mr-s</link>
		<comments>http://sandesh247.com/journal/2009/05/tuning-linq-performance-with-mr-p-and-mr-s#comments</comments>
		<pubDate>Sat, 16 May 2009 20:52:21 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=128</guid>
		<description><![CDATA[I thought I&#8217;d take a second look at the Mr. P and Mr. S problem, which I&#8217;d posted more than a couple of years ago. The last time I tried it, I wasn&#8217;t successful. I had a strategy to solve it, but somehow I just couldn&#8217;t translate it into code. I&#8217;ve been programming a lot [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d take a second look at the Mr. P and Mr. S problem, which I&#8217;d <a href="http://sandesh247.com/journal/2007/03/yet-another-puzzle" target="_blank">posted</a> more than a couple of years ago. The last time I tried it, I wasn&#8217;t successful. I had a strategy to solve it, but somehow I just couldn&#8217;t translate it into code.</p>
<p>I&#8217;ve been programming a lot with C# lately, and decided to use LINQ to solve the puzzle. Although not very concise, compared to the <a href="http://ipeev.blogspot.com/2007/03/solving-mrs-and-mrp-puzzle-by-john.html" target="_blank">Python</a> and <a href="http://okmij.org/ftp/Haskell/Mr-S-P.lhs" target="_blank">Haskell</a> solutions out there, it does print out the right answer. After you&#8217;ve tried to solve it yourself, you can have a look at my solution <a href="http://gist.github.com/110069" target="_blank">here</a>.</p>
<p>There&#8217;s something special about LINQ queries. All LINQ queries are deferred, which means that they aren&#8217;t executed until they are accessed. Also, they are re-executed when the execution context changes. Say we have a list of numbers, and a query on it like so :</p>
<pre>
var numbers = new List&lt;int&gt;();
var query =
  from i in numbers
  select i;
</pre>
<p>The query hasn&#8217;t been executed yet. We add a few numbers to the list, and compare the counts of the list and the query.</p>
<pre>
numbers.Add(0);
numbers.Add(1);
numbers.Add(2);

// 3 elements in list, 3 in the query
Assert.AreEqual(numbers.Count, localDeferredQuery.Count());
</pre>
<p>The test passes. LINQ queries are &#8220;live&#8221;, very much like functions. Usually, this is a good thing, as no operation is performed until it is actually needed. However, there are exceptions. For example, I used these three ranges -</p>
<pre>
public static IEnumerable<int> OddRange(int stop) // returns odd numbers upto "stop"
{
  for (int i = 1; i < stop; i+=2) yield return i;
}

public static IEnumerable<int> EvenRange(int stop) // returns even numbers upto "stop"
{
  for (int i = 2; i < stop; i+=2) yield return i;
}

public static IEnumerable<int> Range(int stop) // returns all numbers upto "stop"
{
  for (int i = 0; i < stop; ++i) yield return i;
}
</pre>
<p>To define the <code>Deferred()</code> and <code>Immediate()</code> functions below: </p>
<pre>
public void Deferred()
{
  var all = Range(limit);
  var even = from e in EvenRange(limit) where all.Contains(e) select e;
  var odd = from o in OddRange(limit) where !even.Contains(o) select o;

  var query = from q in odd select q;

  foreach(var i in query) { var j = i+1; }
}

public void Immediate()
{
  var all = Range(limit);
  var even = (from e in EvenRange(limit) where all.Contains(e) select e) <b>.ToArray()</b>;
  var odd = (from o in OddRange(limit) where !even.Contains(o) select o) <b>.ToArray()</b>;

  var query = (from q in odd select q).ToArray();

  foreach(var i in query) { var j = i+1; }
}
</pre>
<p><code>all</code>, <code>even</code> and <code>odd</code> are three sub queries, each using the previous one. The <code>Immediate()</code> function only differs from <code>Differed()</code> due it's forced execution of the subqueries with ToArray(). However, <code>Immediate()</code> performs much better than <code>Deferred()</code>. I knew LINQ operators are actually <a href="msdn.microsoft.com/en-us/library/bb394939.aspx" target="_blank">euphemism for functions</a>, and that iterator blocks are actually exploded by the compiler into <a href="http://csharpindepth.com/Articles/Chapter6/IteratorBlockImplementation.aspx" target="_blank">a lot of code</a>. But <code>Deferred()</code> was waaaayy slower than <code>Immediate()</code>, and the time taken would increase exponentially with the value of <code>limit</code>. This couldn't be just some extra code.</p>
<p>I posted a <a href="http://stackoverflow.com/questions/872697/linq-performance-deferred-v-s-immediate-execution" target="_blank">query on stackoverflow</a>, and it did not disappoint. It is quite obvious in hindsight. This statement -</p>
<pre>var odd = (from o in OddRange(limit) where !even.Contains(o) select o).ToArray();</pre>
<p>in deferred mode, turns out to be pretty expensive indeed. It contains a call to <code>even.Contains(o)</code>. While in the immediate mode this is an O(n) operation, in deferred mode, the sequence of calls looks like this -</p>
<pre>
odd --> even -+-> EvenRange()
              |
              +-> all --> Range()
</pre>
<p>A simple O(n) operation is now O(n<sup>3</sup>). We can do <a href="http://stackoverflow.com/questions/872697/linq-performance-deferred-v-s-immediate-execution/872879#872879" target="_blank">better than O(n)</a>, however, by using a Hashset.</p>
<pre>var evenSet = new HashSet(even);
var odd = from o in OddRange(limit)
          where !evenSet.Contains(o) select o; // Contains() is now O(1)
</pre>
<p>It doesn't get much better than this.</int></pre>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2009. |
<a href="http://sandesh247.com/journal/2009/05/tuning-linq-performance-with-mr-p-and-mr-s">Permalink</a> |
<a href="http://sandesh247.com/journal/2009/05/tuning-linq-performance-with-mr-p-and-mr-s#comments"></a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2009/05/tuning-linq-performance-with-mr-p-and-mr-s&title=Tuning LINQ performance with Mr. P and Mr. S">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/g8V3lTsf5Uc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2009/05/tuning-linq-performance-with-mr-p-and-mr-s/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microblogging on identi.ca</title>
		<link>http://sandesh247.com/journal/2009/05/microblogging-on-identica</link>
		<comments>http://sandesh247.com/journal/2009/05/microblogging-on-identica#comments</comments>
		<pubDate>Sun, 10 May 2009 10:58:58 +0000</pubDate>
		<dc:creator>sandesh247</dc:creator>
				<category><![CDATA[social]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[µBlog]]></category>

		<guid isPermaLink="false">http://sandesh247.com/journal/?p=89</guid>
		<description><![CDATA[If my journal template hasn&#8217;t changed since this post, you should see a µBlog roll on the sidebar. If you&#8217;ve clicked on any of the links, you&#8217;d now that those notices (or &#8216;dents&#8217;) come from identi.ca. identi.ca is a website very similar to twitter, only better. It&#8217;s built with the open source laconi.ca project, and [...]]]></description>
			<content:encoded><![CDATA[<p>If my journal template hasn&#8217;t changed since this post, you should see a <a rel="me" href="http://identi.ca/sandesh247" target="_blank">µBlog</a> roll on the sidebar. If you&#8217;ve clicked on any of the links, you&#8217;d now that those notices (or &#8216;dents&#8217;) come from <a href="http://identi.ca" target="_blank">identi.ca</a>.</p>
<p>identi.ca is a website very similar to twitter, only better. It&#8217;s built with the open source <a href="http://laconi.ca" target="_blank">laconi.ca</a> project, and has tags and groups too. The killer feature for me is IM support, along with a decent command list. All you have to do is add their bot on google talk, and you can send/receive messages in <em>real -time</em>.</p>
<p>the commands currently supported by the IM bot are:</p>
<p><code> on - turn on notifications<br />
off - turn off notifications<br />
help - show this help<br />
follow &lt;nickname&gt; - subscribe to user<br />
leave &lt;nickname&gt; - unsubscribe from user<br />
d &lt;nickname&gt; &lt;text&gt; - direct message to user<br />
get &lt;nickname&gt; - get last notice from user<br />
whois &lt;nickname&gt; - get profile info on user<br />
fav &lt;nickname&gt; - add user's last notice as a 'fave'<br />
stats - get your stats<br />
stop - same as 'off'<br />
quit - same as 'off'<br />
sub &lt;nickname&gt; - same as 'follow'<br />
unsub &lt;nickname&gt; - same as 'leave'<br />
last &lt;nickname&gt; - same as 'get' </code></p>
<p>identi.ca also supports forwarding dents to twitter, so you wont completely alienate your fans on twitter. However, identi.ca doesn&#8217;t pull tweets, so you wont see any @replies from twitter on identi.ca. At least until you can convince your friends to move from twitter.</p>
<p>identi.ca belongs to a larger ecosystem of <a href="http://openmicroblogging.org/" target="_blank">OpenMicroBlogging</a> software, which have adapted a common standard so that messages between them may be shared. If you use a software that supports OMB, you wont alienate someone just because they happen to like something different (in contrast, the twitter community <a href="http://www.inquisitr.com/10663/fail-twitter-now-not-going-to-support-openmicroblogging/" target="_blank">belongs only on twitter</a>).</p>
<p>Another popular µBlogging site is <a href="http://www.jaiku.com/" target="_blank">jaiku</a>, which will <a href="http://google-code-updates.blogspot.com/2009/01/changes-for-jaiku-and-farewell-to.html" target="_blank">support OMB, and go open source</a> soon. If identi.ca is not your cup of tea, or if you happen to like everything <a href="http://www.techcrunch.com/2007/10/09/google-buys-social-mobile-startup-jaiku/" target="_blank">Google</a>, jaiku may be for you.</p>
<hr />
<p><small>© sandesh247 for <a href="http://sandesh247.com/journal">one me; one keyboard</a>, 2009. |
<a href="http://sandesh247.com/journal/2009/05/microblogging-on-identica">Permalink</a> |
<a href="http://sandesh247.com/journal/2009/05/microblogging-on-identica#comments"></a> |
Add to
<a href="http://del.icio.us/post?url=http://sandesh247.com/journal/2009/05/microblogging-on-identica&title=Microblogging on identi.ca">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p><img src="http://feeds.feedburner.com/~r/OneMeOneKeyboard/~4/ClYIT2rkZTg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sandesh247.com/journal/2009/05/microblogging-on-identica/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
