<?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>Devender&#039;s Weblog</title>
	<atom:link href="http://devender.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://devender.wordpress.com</link>
	<description>How many shots ?</description>
	<lastBuildDate>Fri, 30 Dec 2011 22:46:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='devender.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Devender&#039;s Weblog</title>
		<link>http://devender.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://devender.wordpress.com/osd.xml" title="Devender&#039;s Weblog" />
	<atom:link rel='hub' href='http://devender.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Neo4j: Running Embedded Server with WebConsole</title>
		<link>http://devender.wordpress.com/2011/10/17/neo4j-running-embedded-server-with-webconsole/</link>
		<comments>http://devender.wordpress.com/2011/10/17/neo4j-running-embedded-server-with-webconsole/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 00:24:43 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[neo4j]]></category>
		<category><![CDATA[webconsole]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=605</guid>
		<description><![CDATA[Took me couple of hours to figure this out so blogging it, hopefully it helps someone else. If you are running Neo4j in embedded mode, you can still get the web console, data browser and other goodies, they do mention this in the manual but what they don&#8217;t mention is that you will need 2 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=605&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Took me couple of hours to figure this out so blogging it, hopefully it helps someone else.</p>
<p>If you are running Neo4j in embedded mode, you can still get the web console, data browser and other goodies, they do mention this in the manual but what they don&#8217;t mention is that you will need 2 extra jars to do this neo4j-server.jar and neo4j-server-static-web.jar and these are not available on neo&#8217;s repo, so you will have to clone their source from git and build it locally.</p>
<p>Add them to your pom.xml</p>
<p><pre class="brush: xml;">
&lt;dependency&gt;
  &lt;groupId&gt;org.neo4j.app&lt;/groupId&gt;
  &lt;artifactId&gt;neo4j-server&lt;/artifactId&gt;
  &lt;version&gt;1.5.M01&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
 &lt;groupId&gt;org.neo4j.app&lt;/groupId&gt;
 &lt;artifactId&gt;neo4j-server&lt;/artifactId&gt;
 &lt;version&gt;1.5.M01&lt;/version&gt;
 &lt;classifier&gt;static-web&lt;/classifier&gt;
&lt;/dependency&gt;
</pre></p>
<p>Notice the &#8220;<strong>classifier</strong>&#8221; in the above code. Below is the code for how you would start it.</p>
<p><pre class="brush: java;">
EmbeddedGraphDatabase db = new EmbeddedGraphDatabase(&lt;path&gt;);
bootstrapper = new WrappingNeoServerBootstrapper(db);
bootstrapper.start();
</pre></p>
<p>UPDATE<br />
Once you get the web console you will be able to run Cypher queries but not Gremlin, to be able to run Gremlin queries too include it into your classpath.<br />
<pre class="brush: xml;">
&lt;dependency&gt;
        &lt;groupId&gt;com.tinkerpop&lt;/groupId&gt;
	&lt;artifactId&gt;gremlin&lt;/artifactId&gt;
	&lt;version&gt;1.3&lt;/version&gt;
	&lt;type&gt;jar&lt;/type&gt;
	&lt;exclusions&gt;
		&lt;!-- Sail support not needed --&gt;
		&lt;exclusion&gt;
			&lt;groupId&gt;com.tinkerpop.blueprints&lt;/groupId&gt;
			&lt;artifactId&gt;blueprints-sail-graph&lt;/artifactId&gt;
		&lt;/exclusion&gt;
		&lt;!-- Maven support in groovy not needed --&gt;
		&lt;exclusion&gt;
			&lt;groupId&gt;org.codehaus.groovy.maven&lt;/groupId&gt;
			&lt;artifactId&gt;gmaven-plugin&lt;/artifactId&gt;
		&lt;/exclusion&gt;
		&lt;!-- &quot;readline&quot; not needed - we only expose gremlin through webadmin --&gt;
		&lt;exclusion&gt;
			&lt;groupId&gt;jline&lt;/groupId&gt;
			&lt;artifactId&gt;jline&lt;/artifactId&gt;
		&lt;/exclusion&gt;
	&lt;/exclusions&gt;
&lt;/dependency&gt;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/605/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=605&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2011/10/17/neo4j-running-embedded-server-with-webconsole/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>
	</item>
		<item>
		<title>Not impressed with Lion</title>
		<link>http://devender.wordpress.com/2011/09/01/not-impressed-with-lion/</link>
		<comments>http://devender.wordpress.com/2011/09/01/not-impressed-with-lion/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 11:41:18 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=598</guid>
		<description><![CDATA[Been using OS X Lion @ home for a couple of weeks and I am not impressed. Tiger (which I use for work) feels clean and light gets out of your way almost like a waiter that keeps your glass full without you ever noticing. Lion on the other hand feels like a needy high maintenance [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=598&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Been using OS X Lion @ home for a couple of weeks and I am not impressed. Tiger (which I use for work) feels clean and light gets out of your way almost like a waiter that keeps your glass full without you ever noticing.</p>
<p>Lion on the other hand feels like a needy high maintenance girlfriend that tries to grab your attention all the time. Really do I need my emails thrown on a pile ? Why do I need a grey background for my email to show a thread (good thing I have a 17 inch screen). And why does my calendar have to look like an old leather binder ? With a look of torn pages on top ? Why does my $2000 mac be reduced to look like this ? And the pop up dialog boxes feel like they are going to fly off the screen and hit me in the face. Feels more clunky and resource intensive. And come on why does my terminal have a busy icon on the top ? What the heck is it doing ? I am not even typing anything. By the way Apple there is something called oh I don&#8217;t know &#8216;history&#8217; in the shell that tells me what I did before I don&#8217;t need you to remember and show it to me every time I reopen a terminal.</p>
<p>You know what this reminds me off ? The transition from Win &#8217;98 to XP, oh Snap!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/598/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=598&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2011/09/01/not-impressed-with-lion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>
	</item>
		<item>
		<title>Maven Integration Tests</title>
		<link>http://devender.wordpress.com/2011/08/09/maven-integration-tests/</link>
		<comments>http://devender.wordpress.com/2011/08/09/maven-integration-tests/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 00:40:48 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=595</guid>
		<description><![CDATA[Ever forget to add @Ignore to your integration test and have the rest of the team complain or create a different project just to hold the integration tests, well no more. With the maven failsafe plugin, you no longer need to ignore your integration tests. This plugin will pick up any tests that have *IT*.java [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=595&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever forget to add @Ignore to your integration test and have the rest of the team complain or create a different project just to hold the integration tests, well no more.</p>
<p>With the maven failsafe plugin, you no longer need to ignore your integration tests. This plugin will pick up any tests that have *IT*.java in them and run it for you.</p>
<p>Continue to run you regular tests with &#8216;mvn clean install&#8217;, if you want to run your integration test run &#8216;mvn failsafe:integration-test  failsafe:verify&#8217;</p>
<p>Don&#8217;t forget to remove the @Ignore and rename your tests to *IT.java.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/595/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=595&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2011/08/09/maven-integration-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>
	</item>
		<item>
		<title>Stop Words and commonly concatenated words</title>
		<link>http://devender.wordpress.com/2011/03/16/stop-words-and-commonly-concatenated-words/</link>
		<comments>http://devender.wordpress.com/2011/03/16/stop-words-and-commonly-concatenated-words/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 18:50:14 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[classification]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[stopwords]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=584</guid>
		<description><![CDATA[Here is a list of about 800 stop words made based on 4 million documents (I started with this set). This set has helped us reduce model size and increase accuracy, please note that the same list may not be applicable in your application, please review the list before using. More interestingly here list of commonly concatenated words that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=584&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/devender/blog_resources/raw/master/stopwords.txt">Here</a> is a list of about 800 stop words made based on 4 million documents (I started with this <a href="http://www.webconfs.com/stop-words.php">set</a>). This set has helped us reduce model size and increase accuracy, please note that the same list may not be applicable in your application, please review the list before using.</p>
<p>More interestingly <a href="https://github.com/devender/blog_resources/raw/master/concatenated.txt">here</a> list of commonly concatenated words that I found and their corrections.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/584/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/584/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/584/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/584/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/584/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/584/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/584/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/584/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/584/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/584/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/584/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/584/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/584/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/584/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=584&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2011/03/16/stop-words-and-commonly-concatenated-words/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>
	</item>
		<item>
		<title>December is a great time to work</title>
		<link>http://devender.wordpress.com/2010/12/28/december-is-a-great-time-to-work/</link>
		<comments>http://devender.wordpress.com/2010/12/28/december-is-a-great-time-to-work/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 19:00:36 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=561</guid>
		<description><![CDATA[Co-workers are playing with remote-controlled helicopters, exchanging recipes for goodies, cake in the kitchen, low traffic going to work, lots of laughs in the office. How I wish it stayed liked this for the rest of the year.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=561&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Co-workers are playing with remote-controlled helicopters, exchanging recipes for goodies, cake in the kitchen, low traffic going to work, lots of laughs in the office.</p>
<p>How I wish it stayed liked this for the rest of the year.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/561/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=561&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2010/12/28/december-is-a-great-time-to-work/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>
	</item>
		<item>
		<title>Caching method calls or Memoization</title>
		<link>http://devender.wordpress.com/2010/08/05/caching-method-calls-or-memoization/</link>
		<comments>http://devender.wordpress.com/2010/08/05/caching-method-calls-or-memoization/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 17:08:07 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=555</guid>
		<description><![CDATA[Just as we use Hibernate 2nd level cache to store data, we can also save results from a method call this is a pretty old technique and in fact functional programming languages like Haskell have this feature built in and call it with a fancy name called memoization, http://en.wikipedia.org/wiki/Memoization Here is how it is done [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=555&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just as we use Hibernate 2nd level cache to store data, we can also save results from a method call this is a pretty old technique and in fact functional programming languages like Haskell have this feature built in and call it with a fancy name called memoization, <a href="http://en.wikipedia.org/wiki/Memoization">http://en.wikipedia.org/wiki/Memoization</a></p>
<p>Here is how it is done in spring <a href="http://springtips.blogspot.com/2007/06/caching-methods-result-using-spring-and_23.html">http://springtips.blogspot.com/2007/06/caching-methods-result-using-spring-and_23.html</a></p>
<p>You can read the details in the link, but on a high level when you call a method the result is stored in the cache and the next time around the result from the cache is used, as usual you can declare how long the cache should stay active and so on in a simple ehcache.xml config file.</p>
<p>There is also an open source project that now lets you just decorate methods with @ Cacheable annotation and it takes care of the rest <a href="http://code.google.com/p/ehcache-spring-annotations/wiki/UsingCacheable">http://code.google.com/p/ehcache-spring-annotations/wiki/UsingCacheable</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/555/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=555&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2010/08/05/caching-method-calls-or-memoization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>
	</item>
		<item>
		<title>Office Setup</title>
		<link>http://devender.wordpress.com/2010/07/13/office-setup/</link>
		<comments>http://devender.wordpress.com/2010/07/13/office-setup/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 18:38:19 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=551</guid>
		<description><![CDATA[oh how I wish I had this at home (hint hint)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=551&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>oh how I wish I had this at home (hint hint)<br />
<a href="http://devender.files.wordpress.com/2010/07/web.jpg"><img src="http://devender.files.wordpress.com/2010/07/web.jpg?w=300&#038;h=225" alt="" title="web" width="300" height="225" class="aligncenter size-medium wp-image-552" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/551/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=551&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2010/07/13/office-setup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>

		<media:content url="http://devender.files.wordpress.com/2010/07/web.jpg?w=300" medium="image">
			<media:title type="html">web</media:title>
		</media:content>
	</item>
		<item>
		<title># of lines of code in your project</title>
		<link>http://devender.wordpress.com/2010/07/12/of-lines-of-code-in-your-project/</link>
		<comments>http://devender.wordpress.com/2010/07/12/of-lines-of-code-in-your-project/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 19:30:27 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=540</guid>
		<description><![CDATA[As I wait for the build I wrote up this post, has absolutely no point, just an observation. At present the code base that I work with everyday has : 1030467 lines of Java 641411      lines of Xml 224530     lines of Jsp 58950       lines of plain text 102751 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=540&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As I wait for the build I wrote up this post, has absolutely no point, just an observation. At present the code base that I work with everyday has :</p>
<p>1030467    lines of Java<br />
641411      lines of Xml<br />
224530     lines of Jsp<br />
58950       lines of plain text<br />
102751     lines in property files<br />
2246         lines of groovy<br />
1353693  lines of SQL (schema files, dml, ddl&#8230;.)</p>
<p>90      Projects<br />
7186  Java files<br />
2547 SQL files</p>
<p>How many does yours ?<br />
Its easy, run this find . -name &#8216;*.java&#8217; | xargs wc -l | grep total | sed &#8216;s/total//g&#8217;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/540/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=540&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2010/07/12/of-lines-of-code-in-your-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>
	</item>
		<item>
		<title>Favorite languages, why so great? and why not so much?</title>
		<link>http://devender.wordpress.com/2010/06/17/favorite-languages-why-so-great-and-why-not-so-much/</link>
		<comments>http://devender.wordpress.com/2010/06/17/favorite-languages-why-so-great-and-why-not-so-much/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 00:50:40 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[clojure]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=523</guid>
		<description><![CDATA[About my favorite languages, I actually have 2 favorite languages Ruby: for all scripting and making quick apps. Clojure: for development. Why Ruby is great The language was designed for programmer use, you can see that from the api which is totally intuitive. Lots of libraries, my favorite is Sinatra which lets you build quick and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=523&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:verdana, sans-serif;">About my favorite languages, I actually have 2 favorite languages<br />
<strong> </strong></span></p>
<ul>
<li><span style="font-family:verdana, sans-serif;"><strong>Ruby:</strong> for all scripting and making quick apps.</span></li>
<li><span style="font-family:verdana, sans-serif;"><strong>Clojure:</strong> for development.</span></li>
</ul>
<p><span style="font-family:verdana, sans-serif;"><strong>Why Ruby is great</strong></span></p>
<ol>
<li><span style="font-family:verdana, sans-serif;">The language was designed for programmer use, you can see that from the api which is totally intuitive.</span></li>
<li><span style="font-family:verdana, sans-serif;">Lots of libraries, my favorite is <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> which lets you build quick and dirty web apps and the other is <a href="http://sequel.rubyforge.org/" target="_blank">Sequel</a>.</span></li>
<li><span style="font-family:verdana, sans-serif;">I wrote a <a href="http://devender.wordpress.com/2008/12/19/deleting-those-pesky-rfc-822-in-compatible-emails-with-ruby/" target="_blank">blog post</a> on how to delete RFC-822 in compatible emails (if you are a developer using linux and your company uses Outlook you know what I am talking about), this is a simple example of how I have used Ruby to make quick and dirty scripts.</span></li>
</ol>
<p><span style="font-family:verdana, sans-serif;">I have used Ruby numerous times to write <em>scripts to fix production data, correct files, and to generate complex reports</em>. I have used Sinatra with Google Charts to make web apps that can show load times, server status &#8230;.<br />
<strong></strong></span></p>
<p><span style="font-family:verdana, sans-serif;"><strong>Why Ruby is not so great</strong></span></p>
<ol>
<li><span style="font-family:verdana, sans-serif;">Not really meant for performance, recent years there is a push to develop a virtual machine for Ruby but it is still not anywhere close to C/Java performance.</span></li>
<li><span style="font-family:verdana, sans-serif;">Rails is a pain to deploy, <a href="http://heroku.com/" target="_blank">Heroku</a> takes away the pain but what do you do if you have to deploy internally ? I personally have 2 apps on Heroku one of which is <a href="http://first3links.com/" target="_blank">http://first3links.com/</a></span></li>
</ol>
<p><span style="font-family:verdana, sans-serif;"><strong>Why Clojure is great</strong><strong><br />
</strong>I have been on a quest to learn a functional programming language for the past 3 years, I have read the <a href="http://www.pragprog.com/titles/jaerlang/programming-erlang" target="_blank">Erlang</a> book (please see the various posts I wrote about Erlang <a href="http://devender.wordpress.com/?s=erlang" target="_blank">here</a>). Erlang is a fine language but I lost interest in it after I could not find a single good library that can connect Erlang to Oracle. The problem, there are too few 3rd party libraries. The next language I looked at was Haskell, lots of libraries and seems to be good at performance on the surface, problem I see is acceptance by business, where most of the code is in Java. Then I found Clojure and fell in love with it.</span></p>
<ol>
<li>It is just another DSL for the JVM, if you provide type hints the code generated will be the same as what Java would (can easily sneak it in).</li>
<li>Totally embraces the JVM unlike JRuby.</li>
<li>The author Rich Hickey has done a lot to reduce the pain points of lisp.</li>
<li>Finally a language that frees you mind of OOP ( Have you ever noticed how much time you spend in trying to achieve the best object model when a simple one would do ? and for what ? the customers don&#8217;t care as long as it works, the computers sure don&#8217;t care as long it is 0s and 1s)</li>
<li>Code is so concise and elegant.</li>
</ol>
<p><strong>Why Clojure is not great.</strong></p>
<ol>
<li><span style="font-family:verdana, sans-serif;">It has been called as the language with the steepest learning curve on the JVM, I tend to agree with it.</span></li>
<li><span style="font-family:verdana, sans-serif;">Unlike Scala you have no wiggle room, it is either functional code or nothing ( I like this feature actually).</span></li>
<li><span style="font-family:verdana, sans-serif;">Debugging is a major pain point. (Though there has been improvement with the latest clojure-swank).</span></li>
</ol>
<p><span style="font-family:verdana, sans-serif;">I have written many posts on Clojure on my blog you can see them <a href="http://devender.wordpress.com/?s=clojure" target="_blank">here</a>. In the most recent post I show you one can parse a one million record file in less than 15 seconds with clojure.<br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/523/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=523&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2010/06/17/favorite-languages-why-so-great-and-why-not-so-much/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>
	</item>
		<item>
		<title>Denormalizing One million records with Clojure.</title>
		<link>http://devender.wordpress.com/2010/06/16/denormalizing-one-million-records-with-clojure/</link>
		<comments>http://devender.wordpress.com/2010/06/16/denormalizing-one-million-records-with-clojure/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 23:17:04 +0000</pubDate>
		<dc:creator>devender</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[clojure]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[largedata]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[nosql]]></category>

		<guid isPermaLink="false">http://devender.wordpress.com/?p=488</guid>
		<description><![CDATA[MovieLens is a research project that provides datasets of various sizes and attributes, containing movie ratings. These datasets are free to download and use for non-commercial purposes. They have done an awesome job putting this data together and a big thanks goes to them for making it available. I wanted to exercise my Clojure skills [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=488&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.grouplens.org/node/73">MovieLens </a>is a research project that provides datasets of various sizes and attributes, containing movie ratings. These datasets are free to download and use for non-commercial purposes. They have done an awesome job putting this data together and a big thanks goes to them for making it available.</p>
<p>I wanted to exercise my Clojure skills (more like add to my tiny set of Clojure skills <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ) and it just so happens that I recently came across the MovieLens project, so how about analyzing that data using Clojure ?</p>
<p>One of the datasets they make available is the One Million Dataset, this set consists of 3 files</p>
<ol>
<li>&#8220;<em>movies.dat</em>&#8221; containing 3883 movie listings, contains title, genre&#8230;</li>
<li>&#8220;<em>users.dat</em>&#8221; containing 6040 unique users, contains age, occupation, gender &#8230;</li>
<li>&#8220;<em>ratings.dat&#8221;</em> containing 1000209 movie ratings, that references movie id and user id from the above 2 files.</li>
</ol>
<p>I could analyze this data to answer questions such as, What age group gave the most ratings ? or What was the highest rated movie for a given time period ?</p>
<p>But before I could do this I wanted to denormalize the ratings file so that it also contains the user and movie information, why ? cause I don&#8217;t want to look it up when I am analyzing the data, each record should be self contained.</p>
<p>The outline of the program is quite simple</p>
<ul>
<li>Read the users file into memory</li>
<li>Read the movies files into memory</li>
<li>For each line in the ratings
<ul>
<li>Find the corresponding movie and user</li>
<li>Print it out to a file.</li>
</ul>
</li>
</ul>
<p>Take a minute to think how would you do this in java and then look at the below code. I ran it on a Dell laptop dual 2.2Ghz laptop with 4 gig of ram and <strong>care to guess how long it takes ?</strong>? scroll down for answer.<br />
-<br />
-</p>
<p><pre class="brush: clojure;">
(ns com.dev.file-reader
 (:use [clojure.contrib.duck-streams])
 (:import [java.io BufferedReader FileReader BufferedWriter FileWriter]))

(defstruct user :id :gender :age :ccupation :zip-code)
(defstruct movie :id :title :genres)

(defn format-user [user] (str (:id user) &quot;::&quot; (:gender user) &quot;::&quot; (:age user) &quot;::&quot; (:ccupation user) &quot;::&quot; (:zip-code user)))

(defn format-movie [movie] (str (:id movie) &quot;::&quot; (:title movie) &quot;::&quot; (:genres movie)))

(defn read-user-file [fileName]
 (loop [users {} fileSeq (read-lines fileName)]
   (let [line (first fileSeq)]
     (if (nil? line)
     users
     (let [tokens (.split line &quot;::&quot;)
           id (aget tokens 0)
           user (struct user id (aget tokens 1) (aget tokens 2) (aget tokens 3) (aget tokens 4))]
        (recur (merge users {id user}) (rest fileS)))))))

(defn read-movies-file [fileName]
 (loop [movies {} fileSeq (read-lines fileName)]
   (let [line (first fileSeq)]
     (if (nil? line)
     movies
     (let [tokens (.split line &quot;::&quot;)
           id (aget tokens 0)
           movie (struct movie (Integer/parseInt (aget tokens 0)) (aget tokens 1) (aget tokens 2))]
         (recur (merge movies {id movie}) (rest fileS)))))))

(defn convert-ratings-file
 &quot;read the ratings file and denormalize it&quot;
 [moviesF usersF ratingsF outputF]
   (let [movies (read-movies-file moviesF) users (read-user-file usersF)]
     (with-open [#^BufferedReader rdr (BufferedReader. (FileReader. ratingsF) 1048576)
                 #^BufferedWriter wtr (BufferedWriter. (FileWriter. outputF) 1048576)]
       (doseq [line (line-seq rdr)]
         (let [tokens (.split line &quot;::&quot;)
               user-id (aget tokens 0)
               movie-id (aget tokens 1)
               user (get users user-id)
               movie (get movies movie-id)
               rating (aget tokens 2)
               timestamp (aget tokens 3)]
 (.write wtr (str (format-user user) &quot;::&quot; (format-movie movie) &quot;::&quot; rating &quot;::&quot; timestamp &quot;\n&quot;)))))))

(defn doIt []
 (time (convert-ratings-file
 &quot;movielens-1m/movies.dat&quot;
 &quot;movielens-1m/users.dat&quot;
 &quot;movielens-1m/ratings.dat&quot;
 &quot;movielens-1m/output.dat&quot;
 )))

</pre></p>
<p>So ready with you guess ??<br />
I ran the program 5 times and here is the output<br />
<code><br />
"Elapsed time: 12130.035819 msecs"<br />
"Elapsed time: 13113.92823 msecs"<br />
"Elapsed time: 13364.234216 msecs"<br />
"Elapsed time: 12553.478168 msecs"<br />
"Elapsed time: 14488.706176 msecs"<br />
</code></p>
<p>On average <strong>13.130076521799994 Seconds </strong>to read in 1 million records, for each record look up the movie and user and write it back to the disk.</p>
<p>Clojure puts the <strong>FUN</strong>ctional back in programming.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devender.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devender.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devender.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devender.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devender.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devender.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devender.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devender.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devender.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devender.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devender.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devender.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devender.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devender.wordpress.com/488/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devender.wordpress.com&amp;blog=609686&amp;post=488&amp;subd=devender&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devender.wordpress.com/2010/06/16/denormalizing-one-million-records-with-clojure/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd521b7911352127217de208e0a86f4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">devender</media:title>
		</media:content>
	</item>
	</channel>
</rss>
