<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>My Tech Log</title>
	<atom:link href="http://shreenitech.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shreenitech.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 29 Sep 2009 10:13:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='shreenitech.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>My Tech Log</title>
		<link>http://shreenitech.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://shreenitech.wordpress.com/osd.xml" title="My Tech Log" />
	<atom:link rel='hub' href='http://shreenitech.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Next JUG SIngapore meeting and introducing a new hack</title>
		<link>http://shreenitech.wordpress.com/2009/09/20/next-jug-singapore-meeting-and-introducing-a-new-hack/</link>
		<comments>http://shreenitech.wordpress.com/2009/09/20/next-jug-singapore-meeting-and-introducing-a-new-hack/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 11:36:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[announce]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/09/20/next-jug-singapore-meeting-and-introducing-a-new-hack</guid>
		<description><![CDATA[Well, this blog is way overdue but life has been a little busy in the last few days and hence I have been lagging behind a lot of things including blogging. My sincere apologies for the same. Now, coming to the point. Last Monday (14th September) was JUG Singapore&#8217;s September meetup. The attendance was much [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=184&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well, this blog is way overdue but life has been a little busy in the last few days and hence I have been lagging behind a lot of things including blogging. My sincere apologies for the same. Now, coming to the point.</p>
<div>Last Monday (14th September) was <a href="http://www.meetup.com/JUG-Singapore/">JUG Singapore&#8217;s</a> September meetup. The attendance was much better than <a href="http://blog.shreeni.info/2009/08/jug-singapore.html">previous one</a> and pretty much everybody from the last one ended up here too. The attendees was a good mix of hackers, managers, managers-of-hackers and so on.</div>
<div>We actually had Sun Microsystem&#8217;s office and hence we could do a couple of presentations and discuss in peace. The first presentation was by David, who spoke about a Java VXML based voice browser he developed back in 2001. He explained the purpose, architecture, gotchas and ran us through the essential libraries required for something like this.</div>
<div>I spoke about <a href="http://marvin.shreeni.info">Marvin</a>, a new hack I have been working on. Its essentially a twitter trend analyzing engine, finding out trends which people are positively or negatively describing or they are being neutral. Once the trends are found, I just link them to the news and photos of that trend. These are being brought in through YQL. The whole system is built on Java and hosted on Google App Engine. There are a few interesting challenges I tackled, which I shall blog later. If you are impatient, you can grab the <a href="http://docs.google.com/present/edit?id=0AVqCGKuFSHTiZGMyazYzYzhfMjBjOTg0M3RndA&amp;hl=en">presentation deck</a> or email me or comment here. The hack is open as an alpha and feedback is most welcome.</div>
<div>The discussions were very interactive with lots of questions and loads of feedback. I hope we can keep the momentum going on this group. You can try to attend the next meetup on October 26th.</div>
<div class="blogger-post-footer"></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=184&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/09/20/next-jug-singapore-meeting-and-introducing-a-new-hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
		<item>
		<title>[Hack]: Chess runner</title>
		<link>http://shreenitech.wordpress.com/2009/09/02/hack-chess-runner/</link>
		<comments>http://shreenitech.wordpress.com/2009/09/02/hack-chess-runner/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 07:58:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/09/02/hack-chess-runner</guid>
		<description><![CDATA[As I wrote a while back, I spend quite some time playing chess on the iPhone using Glaurung app. The interesting feature is that it sends out email of your game describing the game in the Algebraic Notation. I mentioned at the end of the blog that I wanted to have a simulator/runner, that basically [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=181&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As I wrote a while back, I spend quite some time playing <a href="http://blog.shreeni.info/2009/08/iphone-free-chess-roundup-gluarung-is.html">chess on the iPhone using Glaurung app</a>. The interesting feature is that it sends out email of your game describing the game in the <a href="http://en.wikipedia.org/wiki/Algebraic_chess_notation">Algebraic Notation</a>. I mentioned at the end of the blog that I wanted to have a simulator/runner, that basically runs the entire game when this email is fed to it. I couldn&#8217;t find one online &#8211; so I built one.</p>
<p>The easy part is to take the data, store it, parse it and the simple UI I built for making the moves work. What is infinitely more complex is to understand the moves in the algebraic notation and changing the status of the board. The problem is that the notation only tells you where something is to end up at, not where it originates from &#8211; and that has to be computed by you based on your previous board state and a complex set of rules.</p>
<p>The one that I built looks ugly in code presently (and hence not sharing right away), but it works, including moves like castles and en passants. The UI itself is just two pages &#8211; one to feed your game and another to run it. If you want to embed the &#8220;run&#8221; page, you can do that too by adding &#8220;&amp;nfh=1&#8243; to the end of the page URL.</p>
<p>So check it out at <a href="http://www.shreeni.info/chess/index.jsp">http://www.shreeni.info/chess/index.jsp</a> or check out <a href="http://www.shreeni.info/chess/simulate.jsp?gameid=G9a2dc5ddf3f083faad8e6592d8ccafa0">one of my wins</a>.
<div class="blogger-post-footer">
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/181/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=181&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/09/02/hack-chess-runner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Inaugural Geekcamp Singapore</title>
		<link>http://shreenitech.wordpress.com/2009/08/23/inaugural-geekcamp-singapore/</link>
		<comments>http://shreenitech.wordpress.com/2009/08/23/inaugural-geekcamp-singapore/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 12:50:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[events]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/08/23/inaugural-geekcamp-singapore</guid>
		<description><![CDATA[Close on the heels of JUG Singapore, I attended the Geekcamp Singapore on Saturday. Since I work for Yahoo and our company was hosting the event, I was also a volunteer. The geekcamp was quite a success. I did attend the talks till about 2.30 PM after which a sleep-deprivation-induced headache prevented me from continuing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=180&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Close on the heels of <a href="http://blog.shreeni.info/2009/08/jug-singapore.html">JUG Singapore</a>, I attended the Geekcamp Singapore on Saturday. Since I work for Yahoo and our company was hosting the event, I was also a volunteer. The geekcamp was quite a success. I did attend the talks till about 2.30 PM after which a sleep-deprivation-induced headache prevented me from continuing any further. The most interesting thing I learnt was that actual event here was better than the event in KL, which was the inspiration for Jason Ong and others to start off conceiving the event.</p>
<div>The talks on CouchDB by Arun Thampi and the talk on Design in programming by Justin Lee were my favorites. Having heard good things about Patrick from his colleague Trent Payne at the JUG meetup, I rather felt sorry for having missed his talk. But I am sure there will be a next time.</p>
<div>The details of the event can be found at the <a href="http://geekcamp.pbworks.com/">Geekcamp page</a>. If you did not attend this one, try stopping by for the next one.</div>
</div>
<div class="blogger-post-footer"></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=180&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/08/23/inaugural-geekcamp-singapore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
		<item>
		<title>JUG Singapore</title>
		<link>http://shreenitech.wordpress.com/2009/08/22/jug-singapore/</link>
		<comments>http://shreenitech.wordpress.com/2009/08/22/jug-singapore/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 03:28:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[events]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/08/22/jug-singapore</guid>
		<description><![CDATA[Two days back, I spent my evening with the Java Users Group (JUG) Singapore. It is apparently yet another effort towards building a vibrant Java community in Singapore. Sven, the organizer has been in Singapore for 8 years and has seen the history of the Java guys coming together and breaking apart more than once. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=179&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Two days back, I spent my evening with the Java Users Group (JUG) Singapore. It is apparently yet another effort towards building a vibrant Java community in Singapore. Sven, the organizer has been in Singapore for 8 years and has seen the history of the Java guys coming together and breaking apart more than once. This attempt, we are hoping, will be longer lasting. We were 6 people discussing quite a bit, and not just Java. I am going to list down some of the discussion threads (and omitting details/conclusions. If you are interested, come to the next meetup <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ):</p>
<div>
<ul>
<li>Tech Culture in Singapore</li>
<li>Tech best practices (Test Driven Development, Continuous Integration)</li>
<li>Entrepreneurial Opportunities in Singapore</li>
<li>Startup ecosystem in Singapore</li>
<li>Cloud Computing growth, both Singapore specific and otherwise</li>
<li>And some personal anecdotes</li>
</ul>
<div>We are currently hosted on <a href="http://www.meetup.com/JUG-Singapore/">meetup&#8217;s JUG page</a>. The next meetup is on September 7. Care to join?</div>
<div>ps: Even if you don&#8217;t write code in Java, you can join in to discuss good ideas.</div>
</div>
<div class="blogger-post-footer"></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=179&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/08/22/jug-singapore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
		<item>
		<title>iPhone Free Chess Roundup: Glaurung is my pick</title>
		<link>http://shreenitech.wordpress.com/2009/08/11/iphone-free-chess-roundup-glaurung-is-my-pick/</link>
		<comments>http://shreenitech.wordpress.com/2009/08/11/iphone-free-chess-roundup-glaurung-is-my-pick/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 05:41:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/08/11/iphone-free-chess-roundup-glaurung-is-my-pick</guid>
		<description><![CDATA[I am a chess enthusiast, not the expert kind, but the amateur kind. I would like to spend a few minutes playing a neat player, but not one who is too strong who would keep beating me. It would be cool to be able to increase the level of the game and also awesome if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=174&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am a chess enthusiast, not the expert kind, but the amateur kind. I would like to spend a few minutes playing a neat player, but not one who is too strong who would keep beating me. It would be cool to be able to increase the level of the game and also awesome if the opponent would occasionally allow me to take back the move (yeah, that&#8217;s a little too much to ask, I know <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ) And since I have an iPhone, what better device to use for playing chess?</p>
<p>So, I basically did a round up of all the free chess apps I could find on the AppStore and this article does a summary-review of all of them.</p>
<p><a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=317226770&amp;mt=8">a1 chess Free</a>: Too bad that it has only two levels (and I am guessing the paid versions might have more &#8211; but I only tried free ones). The level 2 (highest) plays too naively and you can pretty much defeat it every time with either white or black. You will pretty soon get bored of this app.<br />
Rating: * (1/5)</p>
<p><a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=311395856&amp;mt=8">Chess Free</a>: Neat interface and good level of chess, but has a hard limitation of the games being 10-min a player only. What if I don&#8217;t want that restriction? Time limit chess is only one of the forms of chess and not one that I fancy. It would have been nicer to have at least have the option of changing the time limit.<br />
Rating: ** (2/5)</p>
<p><a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=294829633&amp;mt=8">Chess O</a>: I could never properly test this &#8211; because into a minute of using this, it starts complaining of the iPhone running on low memory, while everything else seems to be working fine. God knows how to make this work.<br />
Rating: (0/5)</p>
<p><a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=299471089">Deep Green Chess Lite</a>: Very glib interface and good level of chess game, but no adjustments on the game possible. If that were possible, then this would be quite a good app to use.<br />
Rating: ** (2/5)</p>
<p><a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=305558605&amp;mt=8">Glaurung Chess</a>: This is by far the best free chess app I have seen. It has loads of cool features. It has a timer &#8211; but it doesn&#8217;t not stop the game after the time has lapsed but just indicates it in red on the top. If you want to make the time limit strict, you can finish the game then. It has easy ways to control the level &#8211; it has levels between 1-199 which means you can set it at multiple levels as you increase. It has the option of taking a move very easily &#8211; just swipe right to left at the moves section (and left to right to see what happened from a point in the past). Ability to look at your moves is a great way to learn. Finally, what makes it quite awesome is the ability to send emails to yourself when the game finishes. I have recorded a bunch of the games that I thought were interesting. If I find a simulator to run through the moves as a video, then that would make this feature the rock star feature. [<strong>Update</strong>: I built the <a href="http://blog.shreeni.info/2009/09/hack-chess-runner.html">Chess Runner</a>]<br />
Rating: ***** (5/5)</p>
<p><a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=317989890&amp;mt=8">Free Chess</a>: Has levels (discrete numbering 6), the interface is snazzy and you can save and retrieve games (within the iPhone), and hence is probably the best competitor to Glaurung. If only it had more levels control and emailing feature, I would have rated it a full 5.<br />
Rating: **** (4/5)</p>
<div class="blogger-post-footer"></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/174/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=174&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/08/11/iphone-free-chess-roundup-glaurung-is-my-pick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Moving away from www</title>
		<link>http://shreenitech.wordpress.com/2009/07/27/moving-away-from-www/</link>
		<comments>http://shreenitech.wordpress.com/2009/07/27/moving-away-from-www/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 09:43:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[announce]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/07/27/moving-away-from-www</guid>
		<description><![CDATA[Since I have been spending some time recently on hacking, I wanted to start using custom domains and also start using www.shreeni.info for other things and not just this blog. Hence I am moving away this blog from www.shreeni.info to blog.shreeni.info. Not that it makes much of a difference if you are using the feedburner [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=172&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Since I have been spending some time recently on hacking, I wanted to start using custom domains and also start using www.shreeni.info for other things and not just this blog. Hence I am moving away this blog from www.shreeni.info to blog.shreeni.info. Not that it makes much of a difference if you are using the <a href="http://feeds.feedburner.com/TidbitsHereAndThere">feedburner link</a> to subscribe to the blog or if you are coming to the blog from other places. That said, if you do come to the site directly or use a bookmark, make sure you update those.</p>
<p><span style="font-weight:bold;">Update</span>: All blogs posts from 2003-2011 will continue to work with the previous page urls too (although it will redirect to blog.shreeni.info) &#8211; thanks to a quick and dirty hack &#8211; I will blog about it later.</p>
<div class="blogger-post-footer"></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=172&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/07/27/moving-away-from-www/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Tracking me on Twitter</title>
		<link>http://shreenitech.wordpress.com/2009/07/26/tracking-me-on-twitter/</link>
		<comments>http://shreenitech.wordpress.com/2009/07/26/tracking-me-on-twitter/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 12:33:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/07/26/tracking-me-on-twitter</guid>
		<description><![CDATA[For a while, I have been thinking of hacking up a system which would track up all the tweets that talk of me &#8211; just for the fun of it. So, I started using the Twitter API and built up an hack to scan through the public timeline and store those tweets and to publish [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=171&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For a while, I have been thinking of hacking up a system which would track up all the tweets that talk of me &#8211; just for the fun of it. So, I started using the <a href="http://apiwiki.twitter.com/">Twitter API</a> and built up an hack to scan through the <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-public_timeline">public timeline</a> and store those tweets and to publish it later in whatever way deemed fit. Turns out, <a href="http://stackoverflow.com/questions/902878/how-often-to-run-the-cron-to-mine-twitter-public-timeline">that&#8217;s not so easy</a> &#8211; since this public timeline only lists 20 recent tweets every minute (off the thousands or hundreds of thousands that might be generated.)</p>
<p>The right way to do this would have been to use the <a href="http://apiwiki.twitter.com/Streaming-API-Documentation#firehose">twitter firehouse,</a> which of course is not openly available to everybody, or to use the search interface. As I was planning to shift the code to use that, I hit upon this <a href="http://twitter.com/goodies/widget_search">neat little widget from Twitter</a>, which allows me to create a widget to track all the tweets containing my name and allows me to publish this wherever. I am putting this up on this blog. I have taken out the widget showing my tweets to the new widget titled &#8220;Chatter about me on twitverse&#8221; and its a dynamically updating widget. At this moment, I am enjoying the look of the new widget on my blog.</p>
<p><span style="font-weight:bold;">Update</span>: I have removed the widget from this blog since I have made my twitter stream private. You can still get the widget from the link.
<div class="blogger-post-footer">
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/171/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=171&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/07/26/tracking-me-on-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
		<item>
		<title>[Hack]: Rahu Kalam Calculator</title>
		<link>http://shreenitech.wordpress.com/2009/07/05/hack-rahu-kalam-calculator/</link>
		<comments>http://shreenitech.wordpress.com/2009/07/05/hack-rahu-kalam-calculator/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 03:52:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/07/05/hack-rahu-kalam-calculator</guid>
		<description><![CDATA[Rahu Kalam, in Indian Astrology, is considered that part of the day which is inauspicious for starting new activities or performing good deeds. More on how to calculate Rahu Kalam at Wikipiedia. Essentially, Rahu Kalam is supposed to be calculated on the basis on the sunrise and sunset times, which in turns depends on where [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=166&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Rahu Kalam, in Indian Astrology, is considered that part of the day which is inauspicious for starting new activities or performing good deeds. More on how to calculate <a href="http://en.wikipedia.org/wiki/Rahukaalam">Rahu Kalam at Wikipiedia</a>. Essentially, Rahu Kalam is supposed to be calculated on the basis on the sunrise and sunset times, which in turns depends on where you live. Calculating this is quite tedious.</p>
<p>In India, since it is mostly South Indians who believe in Rahu Kalam, they tend to assume that sunrise and sunset is 0600 and 1800 Hrs respectively. This leads to fixed times of the Rahu Kalam on each day of the week. This, however, could be wrong depending on the seasons. Even more importantly, this would be quite wrong in others parts of the world. In Singapore, sunrise is rarely before 7.00 AM and in Scandinavian counties, sunrise and sunset hugely varies depending on the season. So, I decided to write a hack to automate all this.</p>
<p>So the site is at:<br /><a href="http://rahukalamcalculator.appspot.com/">http://rahukalamcalculator.appspot.com/</a></p>
<p>Essentially, you need to tell where you are from (Bangalore, Hyderabad, New York etc) and based on the lat-long on that location, it will calculate the Sunrise Sunset times and tell you the Rahu Kalam for the next 3 days. You are of course free to choose a specific date and find the Rahu Kalam for that date. The system will remember your location choice and not ask you next time. (You can choose to clear it, of course)</p>
<p>The hack itself involves using a bunch of webservices &#8211; the <a href="http://developer.yahoo.com/maps/rest/V1/geocode.html">Yahoo Maps Webservice</a> for geocoding a location and getting its latitude and longitude. Second, I used the <a href="http://www.earthtools.org/webservices.htm#sun">Earthtools API</a> to get the sunrise and the sunset of a given location. Everything else is calculated internally. I have  hosted it on <a href="http://code.google.com/appengine/">Google App Engine</a>.</p>
<p>Please test the tool and give me your much-sought-after feedback/suggestions etc. You may also tell me what you want to see there.</p>
<p>I will clean up the code in a while and post it in public.
<div class="blogger-post-footer">
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/166/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=166&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/07/05/hack-rahu-kalam-calculator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Tinyurl Clone in Java in 40 lines</title>
		<link>http://shreenitech.wordpress.com/2009/06/25/tinyurl-clone-in-java-in-40-lines/</link>
		<comments>http://shreenitech.wordpress.com/2009/06/25/tinyurl-clone-in-java-in-40-lines/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 00:11:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/06/25/tinyurl-clone-in-java-in-40-lines</guid>
		<description><![CDATA[My colleague (in fact my Boss&#8217; Boss) Sau Sheong wrote a hack: Build a tinyurl.com clone in just 40 lines of code. He used Ruby and I was left wondering if Java could be used to do something similar. I tried it last week and have a working code in 40 lines of Java code. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=165&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My colleague (in fact my Boss&#8217; Boss) Sau Sheong wrote a hack: Build a <a href="http://blog.saush.com/2009/04/clone-tinyurl-in-40-lines-of-ruby-code/">tinyurl.com clone in just 40 lines of code</a>. He used Ruby and I was left wondering if Java could be used to do something similar. I tried it last week and have a working code in 40 lines of Java code. This post is to show the code and how I did it:<br />First, persistence is a breeze in Googe AppEngine and hence I used their JDO approach to store it. The class (with the annotation) is as follows:</p>
<p><span style="font-family:courier new;font-size:78%;"><br />package info.shreeni.snip4java;import javax.jdo.annotations.*;<br />@PersistenceCapable(identityType = IdentityType.DATASTORE)<br />public class Mapping {<br />  @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)<br />  public Long id;<br />  @Persistent<br />  public String url;<br />}<br /></span></p>
<p>As you can see, since the idea was to be as terse as possible, all imports were lumped into the same line and no JavaDocs. Also, I completely did away with getter and setter since that would have consumed more lines of code. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Then comes the MappingManager, the piece that performs the I/O with the Datastore:<br /><span style="font-family:courier new;font-size:78%;"><br />package info.shreeni.snip4java;import java.util.*;import javax.jdo.JDOHelper;import javax.jdo.PersistenceManager;<br />public class MappingManager {<br />private static PersistenceManager pm = JDOHelper.getPersistenceManagerFactory(&#8220;transactions-optional&#8221;).getPersistenceManager();<br />public static Long storeMapping(Mapping mapping) {<br />long existingMapping = getMappingByUrl(mapping.url);<br />return (existingMapping == -1)?pm.makePersistent(mapping).id:existingMapping;<br />}<br />public static Long getMappingByUrl(String url) {<br />Iterator i = ((List)(pm.newQuery(&#8220;select from &#8221; + Mapping.class.getName() + &#8221; where url == &#8216;&#8221; + url + &#8220;&#8216;&#8221;).execute())).iterator();<br />return (i == null || !i.hasNext())?-1:i.next().id;<br />}<br />public static String getLink(String urlId) {<br />Iterator i = ((List)(pm.newQuery(&#8220;select from &#8221; + Mapping.class.getName() + &#8221; where id == &#8221; + Long.valueOf(urlId, 36)).execute())).iterator();<br />return (i == null || !i.hasNext())?null:i.next().url;<br />}<br />}<br /></span></p>
<p>The first method stores the mapping, the second gets a url id based on the url (so that we don&#8217;t keep bloating our DB with repeated URLs) and the third gets a URL based on the Id. The expression &#8220;<span style="font-family:courier new;font-size:78%;">Long.valueOf(urlId, 36)</span>&#8221; converts the url id from Base 36 String to a long. Its the same approach as used by Sau Sheong&#8217;s Snip. All exceptions and error handling is conveniently ignored so that it would end in a HTTP 500 at the end, which I think is a reasonable approach considering the limited amount of code we can write in 40 lines.</p>
<p>Then comes the servlet code which converts a URL into a short URL and print it to the user:<br /><span style="font-family:courier new;font-size:78%;"><br />package info.shreeni.snip4java;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.*;<br />public class Snip extends HttpServlet {<br />protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {<br />Mapping mapping = new Mapping();<br />mapping.url = req.getPathInfo().substring(1);<br />resp.getWriter().print(req.getRequestURL().toString().replaceAll(req.getPathInfo(), &#8220;/&#8221;).replace(&#8220;/s/&#8221;, &#8220;/r/&#8221;) + Long.toString(MappingManager.storeMapping(mapping), 36));<br />}<br />}<br /></span></p>
<p>Quite fascinatingly, the first two lines in the doGet method serve very little, but the third pretty much does all the business logic, or storing the url to db, getting the id, converting to Base 36, constructing the URL and printing it.</p>
<p>Now, the last class which does the real work or taking a short URL and redirecting it to the correct URL stored in the DB:<br /><span style="font-family:courier new;font-size:78%;"><br />package info.shreeni.snip4java;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.*;<br />public class Redirect extends HttpServlet {<br />protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {<br />resp.sendRedirect(MappingManager.getLink(req.getPathInfo().substring(1)));<br />}<br />}<br /></span></p>
<p>Right then, we are done. Thats exactly 40 lines of Java Code. The only thing left is the Web.xml and the appengine-web.xml which are XML required for running all this Java code (first required by any Servlet container and the second required by Google AppEngine.) Being XML, each of those can be compressed into 1 line each, but I am not going to bother presenting them here since they are both too trivial. I put in a index.html just for those users who may not know how to use it (again, this can be packaged into one line). Even if we were to include these three, it would come to only 43 lines.</p>
<p>Thats it, go ahead and try <a href="http://sniponjava.appspot.com/">SnipOnJava</a>. Examples: <a href="http://sniponjava.appspot.com/s/http://www.yahoo.com">Yahoo.com</a>, <a href="http://sniponjava.appspot.com/s/http://blog.saush.com/2009/04/clone-tinyurl-in-40-lines-of-ruby-code/">Sau Sheong&#8217;s Snip blog entry</a>.
<div class="blogger-post-footer">
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/165/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=165&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/06/25/tinyurl-clone-in-java-in-40-lines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Moving Eastward</title>
		<link>http://shreenitech.wordpress.com/2009/03/30/moving-eastward/</link>
		<comments>http://shreenitech.wordpress.com/2009/03/30/moving-eastward/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 03:48:00 +0000</pubDate>
		<dc:creator>shreeniwasiyer</dc:creator>
				<category><![CDATA[announce]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://shreenitech.wordpress.com/2009/03/30/moving-eastward</guid>
		<description><![CDATA[Its time for a new chapter to begin in my life. I am relocating to Yahoo&#8217;s office in Singapore. Today is my last day in Bangalore. That&#8217;s the easy part to say. Now to the tough part. What prompted this? My recent travels to a few countries opened me to the significant cultural differences that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=148&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Its time for a new chapter to begin in my life. I am relocating to Yahoo&#8217;s office in Singapore. Today is my last day in Bangalore. That&#8217;s the easy part to say. Now to the tough part.</p>
<p>What prompted this? My recent travels to a few countries opened me to the significant cultural differences that I thought would be great to learn, absorb &amp; appreciate. Also, the travel bug had bitten both me and my wife and we thought this would be a great time to spend some time traveling, especially before other responsibilities catch up with us. So, time was ripe for me to move on. At the same time, Yahoo provided me with an opportunity to continue my engagement with them out of Singapore and it was a win-win arrangement.</p>
<p>Why Singapore? After my visit there last year, I was most impressed with the city. It has fantastic public transportation, has built a great nation in spite of not having much natural resources, has propagated communal harmony in spite of being a pot boiler of multiple religions and cultures. Its also a place that&#8217;s very inviting with great immigration laws and comfortable life for expats.  Its also a great hub to commute around most of south east Asia. And finally, Yahoo has a office with some significant engineering work being done out of there and they offered me an option to work out that location.</p>
<p>While pointing out the good things, there are of course significant shortcomings also &#8211; a horrible weather, a very big carbon footprint due to importing everything they require, a insecure system which relies of fickle expats (22% of population) for their economy to grow and a system thats often criticized for being only a pseudo democracy with significant media restrictions. These things bother me, but just enough for me to decide against going there. Probably living there would give me a different perspective on these.</p>
<p>What about Bangalore? Well, I can&#8217;t say the same great things about Bangalore &#8211; but it has been a good home for me and my family over the past 4 years. I have also been a good resident, paying all taxes, investing locally (and hence contributing to the local economy) and celebrating the same festivals that Kannadigas celebrate. Though I have been a vocal critic of some of the issues plaguing the city, I see a lot of hope in where this city can go with action groups and active communities contributing to make this a better place. With the intellectual capital brewing in the city, I also think, it might be the epicentre of creating the change agents that the country requires to move to the next level of development.</p>
<p>I will miss a few things from my life in Bangalore:</p>
<ul>
<li>Friends &#8211; I have been blessed with acquiantances of some great people during my stay here and instead of taking names &#8211; I would just say each one of them has contributed to enriching my life here.</li>
<li>My ex-colleagues across all my three employers &#8211; Trilogy, Ugenie and Yahoo have made me a better person, a better professional and it has been a good learning experience. I hope I have contributed to their causes as well.</li>
<li>The weather &#8211; when you are heading to Singapore with a horrible hot weather through the year, there are probably 360 days you are going to long to come back to the brilliant weather back in Bangalore.</li>
<li>My favorite eating/drinking joints &#8211; ranging from the upscale Ebony to the down-to-earth darshinis and the always good Stones and the creamy-ice-creamy Corner House &#8211; have been great memories and I hope they stay with me forever. Kesari Bath, Rava Masala Dosa and Hot Chocolate Fudge will rate the highest here.</li>
<li>My own home at Mahaveer Nest, Devara Chikana Halli and the locality, that has grown on me with acquiantances with all the shopkeepers and the presence of the serene Aiyyappa Temple being a tempering influence on me, will not be there anymore for me to return to everyday in the evening.</li>
</ul>
<p>These are some of my thoughts before I head out there. I will keep you all posted after reaching there on some of my experiences.</p>
<div class="blogger-post-footer"></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shreenitech.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shreenitech.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shreenitech.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shreenitech.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shreenitech.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shreenitech.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shreenitech.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shreenitech.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shreenitech.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shreenitech.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shreenitech.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shreenitech.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shreenitech.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shreenitech.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shreenitech.wordpress.com&amp;blog=9697947&amp;post=148&amp;subd=shreenitech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shreenitech.wordpress.com/2009/03/30/moving-eastward/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd776fe12dee57c4d76c00b9c40f3287?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shreeniwasiyer</media:title>
		</media:content>
	</item>
	</channel>
</rss>
