<?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>DarKnightElf's Weblog</title>
	<atom:link href="http://darknightelf.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://darknightelf.wordpress.com</link>
	<description>Computers. NLP. AI. Fitness. Bodybuilding. Nutrition.</description>
	<lastBuildDate>Tue, 24 Jan 2012 01:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='darknightelf.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>DarKnightElf's Weblog</title>
		<link>http://darknightelf.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://darknightelf.wordpress.com/osd.xml" title="DarKnightElf&#039;s Weblog" />
	<atom:link rel='hub' href='http://darknightelf.wordpress.com/?pushpress=hub'/>
		<item>
		<title>New blog: Refactoring a C Program</title>
		<link>http://darknightelf.wordpress.com/2011/12/14/new-blog-refactoring-a-c-program/</link>
		<comments>http://darknightelf.wordpress.com/2011/12/14/new-blog-refactoring-a-c-program/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 18:48:09 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Bootstrap]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[google-code-prettify]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=219</guid>
		<description><![CDATA[Here is a completely new and fully working (out of what I have implemented) blog entry. I am liking this setting a lot; might eventually transform my whole blog to this new setting, built on Twitter&#8217;s Bootstrap (CSS and JS), Picons free icons, google-code-prettify and my own stuff. Currently the promised post on how to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=219&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a completely new and fully working (out of what I have implemented) blog entry. I am liking this setting a lot; might eventually transform my whole blog to this new setting, built on Twitter&#8217;s Bootstrap (CSS and JS), Picons free icons, google-code-prettify and my own stuff.</p>
<p>Currently the promised post on <a href="http://students.csci.unt.edu/~rss0089/newBlog/c_refactoring.html" title="Refactoring a C Program" target="_blank">how to refactor a C program</a> is up. Happy refactoring!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=219&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/12/14/new-blog-refactoring-a-c-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>
	</item>
		<item>
		<title>Teaser for my new blog</title>
		<link>http://darknightelf.wordpress.com/2011/12/14/teaser-for-my-new-blog/</link>
		<comments>http://darknightelf.wordpress.com/2011/12/14/teaser-for-my-new-blog/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 06:09:58 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=214</guid>
		<description><![CDATA[Teaser for my new blog Still under construction&#8230; but this is how it will look like. Taking help from Bootstrap&#8217;s CSS/JS, google-code-prettify, free icons from Picons, putting it all together in Dreamweaver and adding a blog post about some refactoring that I did for a C application. [There will be a post here about the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=214&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Teaser for my new blog <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Still under construction&#8230; but this is how it will look like. Taking help from Bootstrap&#8217;s CSS/JS, google-code-prettify, free icons from Picons, putting it all together in Dreamweaver and adding a blog post about some refactoring that I did for a C application.</p>
<p>[There will be a post here about the C refactoring]</p>
<div id="attachment_216" class="wp-caption alignnone" style="width: 310px"><a href="http://darknightelf.files.wordpress.com/2011/12/teaser.png" target="_blank"><img src="http://darknightelf.files.wordpress.com/2011/12/teaser.png?w=300&#038;h=173" alt="The masterpiece" title="teaser" width="300" height="173" class="size-medium wp-image-216" /></a><p class="wp-caption-text">Teaser for my new blog</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/214/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=214&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/12/14/teaser-for-my-new-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>

		<media:content url="http://darknightelf.files.wordpress.com/2011/12/teaser.png?w=300" medium="image">
			<media:title type="html">teaser</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Redis for fast-access to Google Web1T n-gram data</title>
		<link>http://darknightelf.wordpress.com/2011/10/08/using-redis-for-fast-access-to-google-web1t-n-gram-data/</link>
		<comments>http://darknightelf.wordpress.com/2011/10/08/using-redis-for-fast-access-to-google-web1t-n-gram-data/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 02:54:36 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Redis]]></category>
		<category><![CDATA[Web1T]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=199</guid>
		<description><![CDATA[I finally jumped on the NoSQL bandwagon and gave Redis a try. I&#8217;ve been hearing about NoSQL for quite some time as a lightweight but much faster database system (the speed and ease being the advantage over RDBMS, with the disadvantage being the lack of relations). One of the several NoSQL systems is Redis, which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=199&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I finally jumped on the NoSQL bandwagon and gave <a title="Redis" href="http://redis.io/download" target="_blank">Redis</a> a try.</p>
<p>I&#8217;ve been hearing about NoSQL for quite some time as a lightweight but much faster database system (the speed and ease being the advantage over RDBMS, with the disadvantage being the lack of relations). One of the several NoSQL systems is Redis, which I read about recently.</p>
<div>It is essentially a flat dictionary, that stores keys and values, but the values themselves can be data structures like sets, lists, dictionaries, ordered sets etc. It is an in-memory data store, and it is also persistent &#8211; meaning once you populate the dictionary and have the server running, the data is there forever. You can stop the server and restart it, and come back and the data you uploaded will still be there.</div>
<div>The main advantage is that it&#8217;s blazingly fast, and has benchmarks of 100,000 set and 80,000 get operations per second.</div>
<div>I installed Redis on my work machine, which was <a title="Install Redis" href="http://redis.io/download" target="_blank">4 lines of command line instructions</a>. I next started the Redis server. Then I installed the Python client to Redis, called <em>python-redis</em>, which is available from the Ubuntu repos. Then I wrote a script that reads through the n-grams and uploads them into the Redis data store. The script is available from <a title="Redis4NGrams" href="https://github.com/ambidextrousTx/Redis4NGrams" target="_blank">my GutHub account</a>.</div>
<div>I chose ordered sets for this &#8211; it seemed to be a good idea to have 5 dictionaries, one for 1gms, one for 2gms, etc, and have the following structure (each of them is an ordered set):</div>
<div><em>key = {1gms/ 2gms/ 3gms/ 4gms/ 5gms}</em></div>
<div><em>value = ordered set, all n-grams with the scores</em></div>
<div>It took 20 minutes to upload 13 million 1gms into the store, and now the look-up is instantaneous. And the best thing is that as long as the Redis server is running on my work machine, anybody can access the store from anywhere.</div>
<div>The steps are (from Python CLI/ REPL)</div>
<p></br><br />
<code><br />
import redis<br />
rs = redis.Redis('localhost') # or the host address<br />
rs.zcard('en:1gms') # will return the cardinality of the ordered set 'en:1gms'<br />
rs.zscore('en:1gms', 'hello') # will return the count for hello<br />
</code><br />
</br></p>
<div>Even if I stop the server now and restart it, all these counts will be there. Redis has methods for <em>sets, dictionaries, ordered sets, lists,</em> etc. All that you see above, starting with &#8216;z&#8217; are meant for ordered sets.</div>
<p>Of course it doesn&#8217;t do smoothing, but I read about Redis and I was excited to try it. I can now use Redis for anything that has large data and needs fast look-ups =D</p>
<p>Obviously NoSQL is just a flat dictionary, but I am sure Redis is using some efficient mechanism for storing the data. It is written in ANSI C, so it only makes sense. Besides, Redis comes with &#8216;batteries included&#8217; in that it has the server which, once running, can serve any client; a persistent data store, which comes back alive even if the server is stopped and restarted; the values don&#8217;t have to be strings but can be more complex data structures themselves, and finally, it has <a title="Redis clients" href="http://redis.io/clients" target="_blank">clients in a number of languages</a>.</p>
<p>Redis provides quite a few benefits over a classical RDBMS, as enumerated <a title="Why Redis?" href="http://redis.io/topics/faq" target="_blank">here</a> &#8211; for example better, more efficient data structures. However, a caveat is that once the data becomes greater than the memory and the system starts paging, the performance degrades radically. So perhaps this method is not the silver bullet for looking up all n-grams instantaneously if you don&#8217;t have enough memory. But it can still be useful (and it&#8217;s easy to use, and it comes with batteries included as mentioned earlier) for several other scenarios.</p>
<p>Go learn yourself some Redis <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=199&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/10/08/using-redis-for-fast-access-to-google-web1t-n-gram-data/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript&#8217;s Peculiarities</title>
		<link>http://darknightelf.wordpress.com/2011/09/13/javascripts-peculiarities/</link>
		<comments>http://darknightelf.wordpress.com/2011/09/13/javascripts-peculiarities/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 23:12:49 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=196</guid>
		<description><![CDATA[I recently started learning JavaScript properly [the last word being the keyword]. I found a totally awesome online book, Eloquent JavaScript, and its best feature is the presence of a console and a coding area right below the text of a chapter itself. During my reading of the first few chapters, here are some points [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=196&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently started learning JavaScript <em>properly</em> [the last word being the keyword]. I found a totally awesome online book, <a title="Eloquent JavaScript" href="http://eloquentjavascript.net/" target="_blank">Eloquent JavaScript</a>, and its best feature is the presence of a console and a coding area right below the text of a chapter itself. During my reading of the first few chapters, here are some points that stood out to me about JavaScript, which I have summarized below:<br />
- When you use == to compare entities, JavaScript tries to convert the value types. So if you do not want automatic type conversion to happen, use === or !== instead<br />
- When concatenating with a string, numbers are automatically converted to strings, e.g. &#8220;Apollo&#8221; + 5 produces &#8220;Apollo5&#8243;. &#8220;5&#8243; * 5 produces 25 on the other hand, because JavaScript tries to convert the string to a number<br />
- NaN == NaN and NaN === NaN both return false. The way to check whether a number is NaN is using the function isNaN, e.g. isNaN(NaN)<br />
- A return statement with no expression results in returning <em>undefined</em><br />
- A block of code within braces does not produce a new local scope &#8211; only functions can produce a new scope<br />
- JavaScript&#8217;s == operator is equivalent to Python&#8217;s <em>is</em> keyword<br />
- Arrays in JavaScript can be non-homogeneous, i.e. they might have values of all types mixed together<br />
- In the JavaScript <em>Date</em> class, the month numbers start from 0 and go up to 11, which is confusing because the date numbers do start from 1<br />
- JavaScript will not warn you if you try to use a variable name that has been taken before. It will silently execute if you assign something to var <em>max</em>, even though <em>Math.max</em> is a stardard that already exist<br />
- [Personal opinion] Since JavaScript is not statically typed, its advanced constructs like <em>higher order functions</em> can become really confusing when you need to determine which arguments are functions and which arguments are values/ variables</p>
<p>More to come.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=196&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/09/13/javascripts-peculiarities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>
	</item>
		<item>
		<title>The capabilities of Vim</title>
		<link>http://darknightelf.wordpress.com/2011/09/10/the-capabilities-of-vim/</link>
		<comments>http://darknightelf.wordpress.com/2011/09/10/the-capabilities-of-vim/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 21:04:37 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Practical Stuff]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=191</guid>
		<description><![CDATA[Many have heard of the good things that Vim can do. Many propose and maintain that once you take the time to actually learn Vim, it will be your last editor, ever, because you&#8217;ll never want anything else. Many claim that nothing can beat the awesome combination of simplicity and power that is Vim. This [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=191&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many have heard of the good things that Vim can do. Many propose and maintain that once you take the time to actually learn Vim, it will be your last editor, ever, because you&#8217;ll never want anything else. Many claim that nothing can beat the awesome combination of simplicity and power that is Vim.</p>
<p>This is a neutral description of some Vim stuff that I learned recently, and I&#8217;ll let the readers decide whether they conclude the same as the others above.</p>
<p>Apart from learning some built-in commands and keyboard shortcuts in Vim from the ground up, like <a title="Learn Vim progressively" href="http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/" target="_blank">here</a>, I think it is also essential to actually learn some VimScript to be able to fully leverage the power of Vim &#8211; for example <a title="Vimscript" href="http://www.ibm.com/developerworks/linux/library/l-vim-script-1/index.html?ca=dgr-jw64&amp;S_TACT=105AGY46&amp;S_CMP=grjw64" target="_blank">here</a>. Finally, after having familiarized yourself with these, the next step would be to actually start looking at some of the plugins that exist in the <a title="Vim scripts" href="http://vim.sourceforge.net/scripts/index.php" target="_blank">Vim repository</a>. Installing them is mostly easy &#8211; some of them can just be copied verbatim to your own <em>.vimrc</em> file.</p>
<p>Imagine being able to insert something at the end of every line in a block of code in a few keystrokes. Imagine being able to delete, find, replace, edit anything in a line without using the mouse, and without pressing the arrow keys at all. And it doesn&#8217;t end there.</p>
<p>Consider, for example, how helpful an automatic code/ snippet generator can be &#8211; something that enables you to, for example, press <em>for</em> followed by two tabs and automatically inserts <em>for(int i = 0; i &lt; count; i++) { // Code }</em>. Imagine that on top of that, you place the cursor on top of the <em>i</em> and type another name, and the name changes in all the three places where it appears. Cool, isn&#8217;t it? Think of the time it saves, and the errors that it precludes. And, you guessed it, a plugin like this <a title="Vim snippet generator" href="http://vim.sourceforge.net/scripts/script.php?script_id=2540" target="_blank">already exists</a>, and you can even see it in action in a <a title="Vim snippet generator video" href="http://vimeo.com/3535418" target="_blank">video</a> before you decide to install it!<br />
Happy Vimscripting!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/191/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=191&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/09/10/the-capabilities-of-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>
	</item>
		<item>
		<title>Using technology and measurement for a better [and easier] life</title>
		<link>http://darknightelf.wordpress.com/2011/09/06/using-technology-and-measurement-for-a-better-and-easier-life/</link>
		<comments>http://darknightelf.wordpress.com/2011/09/06/using-technology-and-measurement-for-a-better-and-easier-life/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 18:29:45 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Fitness/ Bodybuilding]]></category>
		<category><![CDATA[Food]]></category>
		<category><![CDATA[Practical Stuff]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=189</guid>
		<description><![CDATA[Growing up in another country, I did not even dream of how technology and measurement can actually make our lives better, healthier, and yet easier to manage in a way that I am about to talk about. Extensive and intermittent reading on the Web, and living in this country and having easy and inexpensive access to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=189&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Growing up in another country, I did not even dream of how technology and measurement can actually make our lives better, healthier, and yet easier to manage in a way that I am about to talk about. Extensive and intermittent reading on the Web, and living in this country and having easy and inexpensive access to the technology and resources, and the course of time - all these things together have collectively changed a lot in my everyday lifestyle, and I must say that the change has been for the better.</p>
<p>Consider for example nutrition. We know how our bodies need a specific amount of energy every day. If we work out or play any sports, the amount of energy required for these activities is added. If you want to be healthy, you must avoid certain foods, eat more of other foods, and exercise. The basic equation for maintaining weight plays with the balance between how much the body is burning and how much we are eating. We all know that. Yet wouldn&#8217;t it be better if we could break this down to a quantitative level of detail, so we would know exactly &#8216;how much&#8217;? If something is worth doing, it&#8217;s worth doing it well. Why do half things? Why do things based on intuition? We can do better than that. And it&#8217;s easy. How?</p>
<p>Buy a measuring cup. You know that 1 cup of brown rice gives you (give or take) 250 calories. So use 1 cup. Don&#8217;t use a handful. Don&#8217;t do it &#8216;by feeling&#8217;. Do it accurately. Do it right. The same goes for measuring spoons and weight scales. These things are inexpensive on Amazon. 6 oz of white meat is what your portion should be. And it&#8217;s easy to measure. Buy a George Foreman grill &#8211; so you can grill your chicken breasts and don&#8217;t have to use a knife/ pan/ baking pans etc etc. Get an electric rice cooker. Make life easy for yourself &#8211; we&#8217;re talking about appliances that cost less than $15 each!</p>
<p>But it doesn&#8217;t end there. Use <a title="LoseIt" href="http://loseit.com/" target="_blank">LoseIt</a> &#8211; something I came across when I read <a title="Scott Hanselman" href="http://www.hanselman.com/blog/" target="_blank">Scott Hanselman</a>&#8216;s blog entry <a title="Measurement and productivity" href="http://www.hanselman.com/blog/ProductivityAndContinuousImprovementMeasurementAndRescueTimeMakesItHappenBothPersonallyAndAtWork.aspx" target="_blank">here</a>. It&#8217;s an incredibly easy and useful application and it&#8217;s free. Tell it what your target weight is, and what your current weight is, and it will tell you how many calories you need to consume every day to reach that goal. Add every day everything you eat, and it will collectively count the calories for you. If you eat something that doesn&#8217;t exist in LoseIt&#8217;s database, you can ADD it &#8211; get the nutrient information from the Web and just create a new food item, and it&#8217;s there for you to use later! Graph your weight progress, and your eating habits. The calories you spend working out are subtracted from the overall calories for the day. Find on the Web how many calories you spend doing a sport if you don&#8217;t already see it in LoseIt&#8217;s database. See weekly reports. Measure it accurately. Don&#8217;t get me wrong &#8211; you don&#8217;t have to go to the extreme &#8211; no matter what you do it will still be slightly inaccurate &#8211; what with that odd extra tablespoon of oyster sauce you put in your chicken &#8211; but it&#8217;s still way better than not doing it at all.</p>
<p>I only wish I could have this app on my desktop. Maybe there are alternatives out there. But I like it so far, despite the fact that it&#8217;s on the Web.</p>
<p>Okay, now let&#8217;s talk about work, professional stuff, and productivity. Do you know how much of your time every day is wasted in email, surfing the Web, and contemplating stuff? Do you want to nail down the exact amount of time you are spending on a project, and see nice graphical reports? Use <a title="Toggl" href="https://www.toggl.com/" target="_blank">Toggl </a>- which I came across thanks to <a title="Vanessa Hurst" href="http://vanessahurst.com" target="_blank">Vanessa Hurst</a>&#8216;s blog entry <a title="Data driven time management" href="http://vanessahurst.com/data-driven-time-management" target="_blank">here</a>. The basic app is free, despite being on the Web (again, maybe there are desktop alternatives &#8211; and I would like to have something like that locally installed). But the interface is great and very useful. Create several projects. Start tracking time when you&#8217;re actually working on your project, and then stop tracking when you get to your email or some random activity. Start tracking again (maybe another project this time) when you get to it. See how many hours you REALLY work in a week, and not just sit in front of your computer. Eye-opening, isn&#8217;t it?</p>
<p>Technology today, is awesome. And it can make our lives better, healthier, more efficient, and easier to manage. We just need to figure out the right tools for the job, and then use them smartly.</p>
<p>Measure it &#8211; because if you don&#8217;t measure it, you know nothing about it. Leave alone being able to manage it.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=189&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/09/06/using-technology-and-measurement-for-a-better-and-easier-life/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>
	</item>
		<item>
		<title>Peculiarities of Python</title>
		<link>http://darknightelf.wordpress.com/2011/09/05/peculiarities-of-python/</link>
		<comments>http://darknightelf.wordpress.com/2011/09/05/peculiarities-of-python/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 03:26:42 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=174</guid>
		<description><![CDATA[Hi all, After a short hiatus because of my summer internship, I am back to blogging, and what better way to start again by summarizing the peculiarities of Python [for people coming from a Java/ C++ background]. So, tighten up your seatbelts, and here goes: [1] Python supports multiple inheritence [2] Python&#8217;s self is the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=174&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#ffff99;">Hi all,</span></p>
<p><span style="color:#ffff99;">After a short hiatus because of my summer internship, I am back to blogging, and what better way to start again by summarizing the peculiarities of Python [for people coming from a Java/ C++ background]. So, tighten up your seatbelts, and here goes:</span></p>
<p><span style="color:#ffff99;">[1] Python supports multiple inheritence</span></p>
<p><span style="color:#ffff99;">[2] Python&#8217;s <em>self</em> is the same thing as C++/ Java/ C# <em>this</em></span></p>
<p><span style="color:#ffff99;">[3] There is no function/ method overloading in Python</span></p>
<p><span style="color:#ffff99;">[4] All methods in Python are by default <em>virtual</em>, without the explicit use of the keyword </span></p>
<p><span style="color:#ffff99;">[5] Python has an in-built <em>copy</em> module that can copy arbitrary Python objects</span></p>
<p><span style="color:#ffff99;">[6] <em>Object identity</em> in Python is represented by the keyword <em>is</em> &#8211; unlike the <em>==</em> in Java. The == in Python always represents value equality</span></p>
<p><span style="color:#ffff99;">[7] Any class in Python can override the <em>__len__</em> method, which can dictate what the <em>len</em> function returns. If a class defines the <em>__cmp__ </em>method, its objects can be compared using ==.</span></p>
<p><span style="color:#ffff99;">[8] There are wrapper classes like <em>UserDict</em> and <em>UserString</em> that extend/ modify the functionality of base classes like <em>dict</em> and <em>string</em> &#8211; you may not directly derive from <em>dict</em> and <em>string</em></span></p>
<p><span style="color:#ffff99;">[9] Member variables are called <em>data attributes, </em>and they are defined inside the <em>__init__</em> method. Static variables are called <em>class attributes</em>, they are defined outside the <em>__init__</em> method, and do <em>not </em>have the <em>static</em> keyword</span></p>
<p><span style="color:#ffff99;">[10] There are no constants in Python</span></p>
<p><span style="color:#ffff99;">[11] Nothing is <em>protected</em> in Python</span></p>
<p><span style="color:#ffff99;">[12] Anything whose name starts with __ and does not end with it is private (function, method or attribute), and everything else is public &#8211; the keywords private and public are not used</span></p>
<p><span style="color:#ffff99;">This is just the beginning, more to come. </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/174/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=174&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/09/05/peculiarities-of-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>
	</item>
		<item>
		<title>The deque class in C++</title>
		<link>http://darknightelf.wordpress.com/2011/03/27/the-class-in-c/</link>
		<comments>http://darknightelf.wordpress.com/2011/03/27/the-class-in-c/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 19:47:49 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[deque]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=164</guid>
		<description><![CDATA[Going through some really valuable and practical C++ issues from this resource from Stanford, I came across the deque STL class in C++. Seems pretty interesting to me. Although there are performance issues to take into consideration, seeing as, unlike the vector class which ensures that all elements come from contiguous blocks of memory, the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=164&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Going through some really valuable and practical C++ issues from <a title="Stanford C++" href="http://www.keithschwarz.com/cs106l/fall2010/" target="_blank">this resource</a> from Stanford, I came across the <em>deque</em> STL class in C++. Seems pretty interesting to me. Although there are performance issues to take into consideration, seeing as, unlike the <em>vector</em> class which ensures that all elements come from contiguous blocks of memory, the <em>deque</em> implementation is a little different in that the elements might be spread out across different pages in the memory. However, it does allow for pushing and popping from both ends of the queue (hence the name <em>deque</em> &#8211; <em>d</em>ouble <em>e</em>nded <em>que</em>ue), and in certain situations when the queue is going to be small and you are frequently going to be pushing and popping at both ends, <em>deque </em>is a really invaluable resource to have in your toolkit. <a title="Vector vs Queue" href="http://www.codeproject.com/KB/stl/vector_vs_deque.aspx" target="_blank">This location</a> very nicely and thoroughly differentiates <em>deque</em>s from <em>vector</em>s. One of the exercises in the course reader was a ring buffer, which I implemented and posted <a title="Ring buffer" href="https://github.com/ambidextrousTx/dataStructures/blob/master/ringBuffer.cpp" target="_blank">here</a> &#8211; really straightforward and simple to implement.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=164&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/03/27/the-class-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>
	</item>
		<item>
		<title>Graph-plotting in Python</title>
		<link>http://darknightelf.wordpress.com/2011/03/27/graph-plotting-in-python/</link>
		<comments>http://darknightelf.wordpress.com/2011/03/27/graph-plotting-in-python/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 19:15:38 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[matplotlib]]></category>
		<category><![CDATA[pyplot]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=157</guid>
		<description><![CDATA[Having played with other options of plotting graphs, most recently I&#8217;ve settled with Python, and in particular matplotlib and pyplot. Pyplot is a part of Matplotlib, which in turn is Python&#8217;s answer to Matlab. Really neat and easy to use. I recently generated about 120 graphs using an app I wrote, which is called the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=157&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Having played with other options of plotting graphs, most recently I&#8217;ve settled with Python, and in particular <a title="Matplotlib/ pyplot" href="http://matplotlib.sourceforge.net/api/pyplot_api.html" target="_blank">matplotlib</a> and <a title="Pyplot" href="http://matplotlib.sourceforge.net/users/pyplot_tutorial.html" target="_blank">pyplot</a>. Pyplot is a part of Matplotlib, which in turn is Python&#8217;s answer to Matlab. Really neat and easy to use. I recently</p>
<div id="attachment_158" class="wp-caption alignright" style="width: 310px"><a href="http://darknightelf.files.wordpress.com/2011/03/coleur_uba-t.png"><img class="size-medium wp-image-158" title="Pyplot/ Matplotlib" src="http://darknightelf.files.wordpress.com/2011/03/coleur_uba-t.png?w=300&#038;h=225" alt="Pyplot/ Matplotlib" width="300" height="225" /></a><p class="wp-caption-text">Pyplot/ Matplotlib</p></div>
<p>generated about 120 graphs using an app I wrote, which is called the Disruptive Set Analyzer and can be downloaded <a title="Disruptive Set Analyzer" href="https://github.com/ambidextrousTx/DisruptiveSetAnalyzer" target="_blank">here</a>. The readme and the code should be self explanatory. The thresholds are determined empirically, and to summarize, this app can be used to generate plots like this for any scenario where you want to compare two systems, where each system is producing some kind of a numerical score for a bunch of same instances. The instances themselves are divided into different sets, which are also produced by the app in the form of text files. I am currently planning on making this available through the Web, where the user uploads a CSV file and a pair of systems they are interested in, along with the threshold values, and the backend generates this plot. Next, the user can hover the mouse on the individual plot points and the actual instance [it might be a string or anything] will then be revealed. This might be accompanied with a legend of sorts at the bottom of the plot. However, these are just an added layer of user interface, so it is at lower priority for me right now.</p>
<p>PS: in the code you see that I&#8217;ve identified by comments the part which makes it possible to produce graphs like this and save them in PNG format even if you only have a non-X-based shell access to the machine on which you are running the code and producing the graphs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=157&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/03/27/graph-plotting-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>

		<media:content url="http://darknightelf.files.wordpress.com/2011/03/coleur_uba-t.png?w=300" medium="image">
			<media:title type="html">Pyplot/ Matplotlib</media:title>
		</media:content>
	</item>
		<item>
		<title>Python vs C# &#8211; an incomplete comparison</title>
		<link>http://darknightelf.wordpress.com/2011/03/01/python-vs-c-an-incomplete-comparison/</link>
		<comments>http://darknightelf.wordpress.com/2011/03/01/python-vs-c-an-incomplete-comparison/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 05:03:13 +0000</pubDate>
		<dc:creator>darknightelf</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C-sharp]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://darknightelf.wordpress.com/?p=149</guid>
		<description><![CDATA[This is not going to be a complete comparison of everything that the two languages have to offer, but a beginner&#8217;s first look at how the two languages look and feel different. Expect a lot of additional posts on additional differences and similarities in the future. Apart from Python being dynamically typed, interpreted and C# [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=149&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is not going to be a complete comparison of everything that the two languages have to offer, but a beginner&#8217;s first look at how the two languages look and feel different. Expect a lot of additional posts on additional differences and similarities in the future.</p>
<p>Apart from Python being dynamically typed, interpreted and C# being statically typed, compiled, here are some subtle points of interest:</p>
<p>1. In C#, you can use <em>{0}, {1}</em> etc. as placeholders for variables in a format string, in a <em>Console.WriteLine</em>() function call, and the format string is followed by a comma separated list of the variables used. In Python (in Python 3 that is, not in Python 2), you do that by calling the method <em>format</em> of a string object, which has the <em>{0}, {1}</em>, etc. embedded, and the string is therefore followed by a dot, which is followed by the keyword <em>format</em>, parentheses (hence, a tuple) containing all the variables.</p>
<p>2. In C#, using the directive <em>using &lt;namespace name&gt;</em> is sufficient to include everything from the corresponding namespace into the current file. In Python, even after you use <em>import</em>, you need to qualify the name of the corresponding entity with the name of the namespace, e.g. <em>random.randint()</em>. If you want to avoid doing that, you may either do <em>from module import *</em>, or <em>from module import entity</em>. You may use something like <em>System.Console.WriteLine()</em> in C# without saying <em>using System</em>, but you cannot do something like that in Python.</p>
<p>3. In C# there are no performance differences whichever variant you use. I am not sure what happens under the hood in Python. I will have to get back to you on that one.</p>
<p>4. In Python, once you install a module, you can import it easily from anywhere. In C# on the other hand, some assemblies (read, <em>modules</em> for all practical purposes), are located in different directories and the compiler will need to be told explicitly about that.</p>
<p>5. Being a compiled language (with a compiled bunch of files called an <em>assembly</em>), C# (or any <em>.NET</em> language, for that matter) gives rise to things like the IL (CIL or MSIL), metadata, manifest, and by extension assembly viewers (disassemblers), decompilers, etc&#8230; we don&#8217;t have these problems in Python. Python does have <em>py2exe</em> which generates a compiled executable for the Windows platform. However, <em>py2exe</em> apparently only keeps the byte-compiled version of the code and not the raw one, so as it appears right now, it might not be that straightforward to get your raw Python source code back if you only have the compiled version. In a C# assembly, you can get back to the actual code by using decompilers, e.g. <em>Reflector</em>.</p>
<p>That&#8217;s all for now.</p>
<p>PS: WordPress, please allow using C# as a tag, don&#8217;t automatically convert C# to C++ !! For now, I am using C-sharp as the tag:-)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darknightelf.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darknightelf.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darknightelf.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darknightelf.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darknightelf.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darknightelf.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darknightelf.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darknightelf.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darknightelf.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darknightelf.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darknightelf.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darknightelf.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darknightelf.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darknightelf.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darknightelf.wordpress.com&amp;blog=4045139&amp;post=149&amp;subd=darknightelf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darknightelf.wordpress.com/2011/03/01/python-vs-c-an-incomplete-comparison/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">darknightelf</media:title>
		</media:content>
	</item>
	</channel>
</rss>
