<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shriphani Palakodety &#187; Computer Science</title>
	<atom:link href="http://shriphani.com/blog/category/computer-science/feed/" rel="self" type="application/rss+xml" />
	<link>http://shriphani.com/blog</link>
	<description>In Pursuit Of Truth and Beauty</description>
	<lastBuildDate>Tue, 07 Feb 2012 10:01:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Code Pornography</title>
		<link>http://shriphani.com/blog/2012/01/29/code-pornography/</link>
		<comments>http://shriphani.com/blog/2012/01/29/code-pornography/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 09:47:25 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[circular-data-objects]]></category>
		<category><![CDATA[haskell]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=1082</guid>
		<description><![CDATA[The one-liner you see below is the Haskell erotica for the month: twoK=1:&#40;map &#40;2*&#41; twoK&#41; &#160; That line will generate an infinite list containing even numbers. I can look @ that line all day and wonder at the beauty of this language. Haskell is God&#8217;s language.]]></description>
			<content:encoded><![CDATA[<p>The one-liner you see below is the Haskell erotica for the month:</p>
<div class="dean_ch" style="white-space: nowrap;">
twoK=<span class="nu0">1</span>:<span class="br0">&#40;</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map"><span class="kw3">map</span></a> <span class="br0">&#40;</span><span class="nu0">2</span>*<span class="br0">&#41;</span> twoK<span class="br0">&#41;</span><br />
&nbsp;</div>
<p>That line will generate an infinite list containing even numbers. I can look @ that line all day and wonder at the beauty of this language. Haskell is God&#8217;s language.</p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2012/01/29/code-pornography/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Predicting Which Hiragana Character You&#8217;re Drawing</title>
		<link>http://shriphani.com/blog/2012/01/24/predicting-which-hiragana-character-youre-drawing/</link>
		<comments>http://shriphani.com/blog/2012/01/24/predicting-which-hiragana-character-youre-drawing/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 20:24:19 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[artificial intelligence]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[classifier]]></category>
		<category><![CDATA[cs]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[hiragana]]></category>
		<category><![CDATA[japanese]]></category>
		<category><![CDATA[machine learning]]></category>
		<category><![CDATA[nearest-neighbor]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=1072</guid>
		<description><![CDATA[I tried to take a shot @ the problem shown above. Turns out just high-school level math is sufficient to make a decent classifier for this. In the Japanese alphabet(s), a character is composed of strokes. These strokes have a fixed order. This restriction is pretty much all you need. I grab the stroke&#8217;s end [...]]]></description>
			<content:encoded><![CDATA[<p>I tried to take a shot @ the problem shown above. Turns out just high-school level math is sufficient to make a decent classifier for this.</p>
<p>In the Japanese alphabet(s), a character is composed of strokes. These strokes have a fixed order. This restriction is pretty much all you need. I grab the stroke&#8217;s end points and centroid and then normalize.</p>
<p>Once, a stroke is finished, a nearest-neighbor classifier runs and fetches 3 best matches. I have had very decent performance with this approach. Right now, no information about the distance between successive strokes is used. Incorporating that should improve performance by a significant amount.</p>
<p>Here&#8217;s a video of the classifier in action:</p>
<p><object width="480" height="360"><param name="movie" value="http://www.youtube.com/v/N38Ry7xvD8I?version=3&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/N38Ry7xvD8I?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="480" height="360" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The full source code (very kludgy) is <a href="https://github.com/shriphani/JPredict" target="_blank">on github</a>.</p>
<p>I have further ideas on improving the perf and training with some Kanji.</p>
<p>Enjoy :)</p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2012/01/24/predicting-which-hiragana-character-youre-drawing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Communicating Through Fingertips &#8211; Finger Gesture Recognition Using Depth Data</title>
		<link>http://shriphani.com/blog/2011/12/10/communicating-through-fingertips-finger-gesture-recognition-using-depth-data/</link>
		<comments>http://shriphani.com/blog/2011/12/10/communicating-through-fingertips-finger-gesture-recognition-using-depth-data/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 03:41:48 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Daily life]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[American Sign Language]]></category>
		<category><![CDATA[ASL]]></category>
		<category><![CDATA[depth]]></category>
		<category><![CDATA[Gestures]]></category>
		<category><![CDATA[kinect]]></category>
		<category><![CDATA[machine learning]]></category>
		<category><![CDATA[Microsoft Kinect]]></category>
		<category><![CDATA[Natural User Interfaces]]></category>
		<category><![CDATA[vision]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=1034</guid>
		<description><![CDATA[In Prof. Vishy&#8217;s ML class (cs 590 &#8211; top notch course, top notch professor), we don&#8217;t have a final and instead we are supposed to apply ML to a problem we find interesting. Microsoft gave all of us interns a Kinect this summer so I decided to put it to some use (I don&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p>In Prof. Vishy&#8217;s ML class (cs 590 &#8211; top notch course, top notch professor), we don&#8217;t have a final and instead we are supposed to apply ML to a problem we find interesting. Microsoft gave all of us interns a Kinect this summer so I decided to put it to some use (I don&#8217;t have a TV so the XBox is just collecting dust).</p>
<p>My goal was to be able to record finger gestures and then detect them when a user makes these gestures. I had 2 goals in mind &#8211; no OpenCV (i.e. I will use just depth data) and no wearing special stuff to guide anything.</p>
<p>So, let us see what I did. Basically, I used the CandescentNUI Hand Tracker to get a collection of fingertip locations and points and then applied two techniques to try and recognize the gestures we make.</p>
<p>First, I tried using the Passive-Aggressive algorithm by Crammer et. al. This algorithm uses an online-learning approach to build a hyperplane (in 3 dimensions, this is a plane, in 2 dimensions &#8211; a line etc. Basically, this is what is defined when you try to define a &#8220;surface&#8221; like structure for a space. Take 2 non-parallel vectors in 3D space and you can construct the entirety of the 2D world. The hyperplane is just that &#8211; an entire space (a subspace with 1 dim less than the one we are operating in).</p>
<p>The hyperplane is supposed to act like a brick wall (if we&#8217;re in 3D &#8211; no point visualizing a higher dimension). When we see a new data point come in, we want to inspect on which side of the wall it lies and then we can &#8220;detect&#8221; or label this point. This is the binary classifier.</p>
<p>The dataset consists of raw point coordinates in the space of the human palm seen by the kinect. Now it turns out that the online passive-aggressive algorithm fails at constructing a decent hyperplane separating 2 classes (data points for 2 different gestures).</p>
<p>&nbsp;</p>
<p>The obvious hack was to deploy a nearest neighbors classifier. The trick I used was that I ran a large cluster k-means on the data and built myself a dataset consisting entirely of cluster centers. So I was able to reduce the neighbors tenfold and still get fantastic performance. A simple technique worked fabulously in this situation and I couldn&#8217;t be more pleased.</p>
<p>Here is a video of the gesture-detector in action. The annotations should show you what to look @</p>
<p><iframe src="http://www.youtube.com/embed/DPccgJL0lpg" frameborder="0" width="560" height="315"></iframe></p>
<p>&nbsp;</p>
<p>The source is up on github. The code is very kludgy and I will fix it up after finals week. In case you&#8217;re in a hurry : <a href="http://github.com/shriphani/KinectSpell">http://github.com/shriphani/KinectSpell </a></p>
<p>Now, it is time to try and avoid failing in the finals x(.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2011/12/10/communicating-through-fingertips-finger-gesture-recognition-using-depth-data/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>When things break</title>
		<link>http://shriphani.com/blog/2011/11/01/when-things-break/</link>
		<comments>http://shriphani.com/blog/2011/11/01/when-things-break/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 02:36:02 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[Computer Science]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=997</guid>
		<description><![CDATA[Recently I had to undergo the unfortunate experience of using scipy&#8217;s optimizers in the scipy.optimize module. And I had this issue where the algorithm wouldn&#8217;t even start iterating. Essentially hitting Ctrl-C would bring up some useless info about a few dll files and &#8220;Error&#8221;. No stack track nothing. Needless to say, my assignment took 3 [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to undergo the unfortunate experience of using scipy&#8217;s optimizers in the scipy.optimize module. And I had this issue where the algorithm wouldn&#8217;t even start iterating. Essentially hitting Ctrl-C would bring up some useless info about a few dll files and &#8220;Error&#8221;. No stack track nothing. Needless to say, my assignment took 3 days to complete (time taken to pull hair out &#8211; not compute) and I put myself in a very bad situation (buggy HW) and buggy preparation for the mid-term onslaught both of which can&#8217;t be fantastic&#8230;</p>
<p>Anyway, I promised myself that coursework would be for learning and not for grades but that hasn&#8217;t worked wonders for me &#8211; maybe grad school will offer some fresh perspective on education (which I desperately need since I have been a bit demotivated by these fuck-ups that are out of my control).</p>
<p>Oh well &#8211; my GPA&#8217;s ok and 1 dip in performance will not kill it.</p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2011/11/01/when-things-break/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Problem Reductions</title>
		<link>http://shriphani.com/blog/2011/04/22/problem-reductions/</link>
		<comments>http://shriphani.com/blog/2011/04/22/problem-reductions/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 16:47:37 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Daily life]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=907</guid>
		<description><![CDATA[Prof. GNF @ Purdue provided one of the best learning opportunities I ever had in CS 381 &#8211; Algorithms. A particular section that I was particularly attracted to was problem reductions. Basically, you want to reduce 1 problem to another so you can use a previous solution to solve it. Reductions were (I am using [...]]]></description>
			<content:encoded><![CDATA[<p>Prof. GNF @ Purdue provided one of the best learning opportunities I ever had in CS 381 &#8211; Algorithms. A particular section that I was particularly attracted to was problem reductions. Basically, you want to reduce 1 problem to another so you can use a previous solution to solve it.</p>
<p>Reductions were (I am using the past tense since I haven&#8217;t picked such problems up in the recent past) central to proving NP Completeness. One of the rather interesting pitfalls undergrads @ Purdue seem to be facing is in understanding the reduction process.</p>
<p>In particular, I could boil their confusion down to something like this:</p>
<blockquote><p>I know something about problem &#8220;a&#8221; (in this case, &#8220;a&#8221; is NP-Complete). So, if I need to figure something out about the NP-Completeness of some problem &#8220;b&#8221;, I will make a sincere effort to solve it using &#8220;a&#8221;. If I solve it using &#8220;a&#8221;, &#8220;b&#8221; is NP-Complete.</p></blockquote>
<p>WRONG!  I am a math major and I see the temptation to use a known problem&#8217;s solution to make some inferences about an unknown problem but seriously that is not what you are looking for here.</p>
<p>The fail in this approach is that no one is able to grasp the correct trail of thought. This is how you think:</p>
<blockquote><p>I have some information about the perf of a, let me use that to make some inferences about b.</p></blockquote>
<p>How do you infer stuff about b using a?</p>
<p>Let us say we are faced with the following problem:</p>
<p>You are sitting in level 1 of the Lawson CS Building. Your goal is to go to the basement.<br />
Last week, you figured out:</p>
<ul>
<li>How to get to Level 2 from Level 1 (takes 2 minutes)</li>
<li>How to get from Level 1 to the basement.  (takes 4 minutes)</li>
</ul>
<p>So, here&#8217;s a diagram and a problem description:</p>
<blockquote>
<p style="text-align: left;"><a href="http://shriphani.com/blog/wp-content/uploads/2011/04/Untitled_image.png"><img class="aligncenter size-full wp-image-909" title="Lawson_shitty_plan" src="http://shriphani.com/blog/wp-content/uploads/2011/04/Untitled_image.png" alt="" width="560" height="420" /></a>To be solved: Get to basement from level 1</p>
<p>What we know: Getting to level 2 from level 1 (takes 2 minutes), Getting to basement from level 2 (takes 4 minutes)</p></blockquote>
<p>So, if you apply the ass-backwards thinking that most people seem to do, we would go from level 1 to level 2 and then go to the basement from there in a grand total of 6 minutes.</p>
<p>Ok, what then? Well, using the problem solving structure you were applying before, you ended up concluding that going from level 1 to the basement will take 6 minutes (just like how you concluded that b is now NP-Complete).</p>
<p>But that is dead wrong. From what we see, the path you choose to solving a problem tells you nothing about how easily the problem can be solved!<br />
When you chose to solve &#8220;b&#8221; using &#8220;a&#8221;, you made a (potentially stupid) choice about how to solve &#8220;b&#8221;. Possibly &#8220;b&#8221; could have a polynomial time solution and you still chose to apply a solution to it that won&#8217;t finish till your grandkids are born.</p>
<p>Here is how you approach that problem:</p>
<ul>
<li>You know something about &#8220;a&#8221;. More precisely, you know &#8220;a&#8221; is NP-Complete. You know that there is no polynomial time algorithm known for &#8220;a&#8221;.</li>
<li>You then decide, &#8220;Hey, let me see if I can solve &#8220;a&#8221; using &#8220;b&#8221;.</li>
<li>If you figure out you can solve &#8220;a&#8221; using &#8220;b&#8221;, then obviously, the theoretical lower bound you computed for &#8220;a&#8221;, holds for &#8220;b&#8221;.  You now know that &#8220;b&#8221; cannot do better than &#8220;a&#8221; (if it did, you might have proved P = NP :)).</li>
<li>Well, now we know that since &#8220;b&#8221; cannot do better than &#8220;a&#8221;, &#8220;b&#8221; is NP-Complete    (You still need to prove that &#8220;b&#8221; is in NP but I am assuming you know how to do that)</li>
</ul>
<p>That wasn&#8217;t so hard, was it?</p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2011/04/22/problem-reductions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing my incompetence</title>
		<link>http://shriphani.com/blog/2011/04/18/fixing-my-incompetence/</link>
		<comments>http://shriphani.com/blog/2011/04/18/fixing-my-incompetence/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 00:10:47 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Daily life]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=897</guid>
		<description><![CDATA[Every once in a while when I am about to take off, I promptly have my wings cut &#8211; these moments have helped shape a rather interesting college life IMO. So, this semester I happened to fall in Jeff Mark Siskind&#8217;s class EE473 where we studied classical AI (stuff that was outdated by the 80s [...]]]></description>
			<content:encoded><![CDATA[<p>Every once in a while when I am about to take off, I promptly have my wings cut &#8211; these moments have helped shape a rather interesting college life IMO. So, this semester I happened to fall in Jeff Mark Siskind&#8217;s class EE473 where we studied classical AI (stuff that was outdated by the 80s &#8211; I hope). Prof. Siskind insisted on using Scheme as the way to solve problems in his class &#8211; which was fine by me since I was rather eager to pick up functional programming and this would serve as ample motivation to do that.</p>
<p>Some salient features of Scheme code I&#8217;ve written so far (not features of scheme but shit &#8220;I&#8221; do with it):</p>
<ul>
<li>Aggressive use of map-reduce. I found this too sexy, I use it everywhere.</li>
<li>If it compiles, it is most definitely correct (at least I&#8217;ve never had runtime fuck-ups happen to me &#8211; this is pretty nice since with some thinking I could accomplish quite a lot in scheme).</li>
<li>I have very aggressively used lambdas.</li>
</ul>
<p>Keeping these new habits in mind, I sat down to tackle a p-set yesterday and finished in no time. I then was unable to comprehend the reason why I was so slow compared to the demo of his own solution (I was implementing the arc-consistency heuristic to solve n-queens). Upon investigation, I saw rubbish like this in my code:</p>
<div class="dean_ch" style="white-space: nowrap;">
<span class="br0">&#40;</span><span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw1">null?</span> foo-that-returns-array<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#40;</span>do-new-foo<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#40;</span>do-new-inv-foo<span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp;</div>
<p>Well foo-that-returns array was supposed to return a subset of values that satisfied a proposition (from an original finite domain). I totally carried over my rubbish habits from other prog languages ([] is #f and [...] is #t so I will continue to use those) rather than doing:</p>
<div class="dean_ch" style="white-space: nowrap;">
<span class="br0">&#40;</span><span class="kw1">if</span> <span class="br0">&#40;</span>some predicate-function domain<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#40;</span>do-new-foo<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#40;</span>do-new-inv-foo<span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp;</div>
<p>This looks a lot better and it was a lot faster. My reasoning for this speed improvement is that I just obtained a rather large array, checked for emptiness and then threw it away causing the scheme GC to kick in. Using <code>some</code> makes it look a lot more like a quantifier which is precisely how this procedure must be written. This summer, I really need to rock SICP and fix my shoddy half-knowledge situation with regards to functional programming. </p>
<p>Besides that, my research seemed to hit a roadblock close to the end of this semester when a sudden miracle (and a reddit-browsing approach to lit. search) led me to fix things so I can still declare victory. I will not post more about my work since I am applying the Mao approach (is it even Mao? I don&#8217;t know) &#8211; &#8220;Keep your head low and rise to the top, then the world will take notice&#8221;. I have a bad habit of gloating after I post stuff here, it is best if I only put materials here after I finish (and hopefully produce a sexy paper).</p>
<p>Anyway, more posts (better in quality than this) to follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2011/04/18/fixing-my-incompetence/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ooh Shiny !</title>
		<link>http://shriphani.com/blog/2011/04/08/ooh-shiny/</link>
		<comments>http://shriphani.com/blog/2011/04/08/ooh-shiny/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 05:41:59 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Daily life]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=881</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://shriphani.com/blog/wp-content/uploads/2011/04/snap_6.jpg"><img class="aligncenter size-full wp-image-882" title="snap_6" src="http://shriphani.com/blog/wp-content/uploads/2011/04/snap_6.jpg" alt="" width="640" height="480" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2011/04/08/ooh-shiny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fill In The Blank Coders</title>
		<link>http://shriphani.com/blog/2011/03/27/876/</link>
		<comments>http://shriphani.com/blog/2011/03/27/876/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 01:08:12 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[Computer Science]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=876</guid>
		<description><![CDATA[I had the pleasure of watching the fill-in-the-blank coders the department produces. In a relational database, we delegate I/O to the disk-manager layer, run our own page management in the buffer manager (1 layer above the disk manager) and then when we are supposed to perform operations like adding and deleting tuples, we make calls [...]]]></description>
			<content:encoded><![CDATA[<p>I had the pleasure of watching the fill-in-the-blank coders the department produces. In a relational database, we delegate I/O to the disk-manager layer, run our own page management in the buffer manager (1 layer above the disk manager) and then when we are supposed to perform operations like adding and deleting tuples, we make calls to the buffer manager and that guy takes care of I/O and other rubbish. Now, we had to start from scratch with an empty file and implement the buffer manager and the heap file (for storing tuples).</p>
<p>I finished the buffer manager and we were about to go write the heap when I decided to take a break. This super-smart dude decides to kick off. I see his code after a short while:</p>
<p>&nbsp;</p>
<p>FileWriter a = new FileWriter()&#8230;&#8230;</p>
<p>&nbsp;</p>
<p>I&#8217;m like &#8220;DUDE !   NO I/O OPERATIONS!&#8221;</p>
<p>I manage to extract a blank stare out of him.</p>
<p>I try to explain, &#8220;We do not write any I/O code. We wrote an entire buffer manager for a reason you know&#8221;.</p>
<p>He nods. I return after 10 mins, he&#8217;s typing away furiously with more FileWriter &#8230; blah blah blah.</p>
<p>I explain the concept of the DB again &#8211; &#8220;cost is measured in no. of I/O ops. The buffer manager exists to page things in and out. What the fuck are you doing !&#8221;</p>
<p>The third time he gives up. I had to finish the heap file.</p>
<p>&nbsp;</p>
<p>I just wonder what is the department doing ? How can we unleash such graduates on the world ?   I know why. We expect code to be given to us with 5 functions done so we can fill in the other 3. FILL_IN_THE_BLANK programming.</p>
<p>I want to go break something now.</p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2011/03/27/876/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A SelfControl Workaround</title>
		<link>http://shriphani.com/blog/2011/01/25/a-selfcontrol-workaround/</link>
		<comments>http://shriphani.com/blog/2011/01/25/a-selfcontrol-workaround/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 04:30:12 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=834</guid>
		<description><![CDATA[UPDATE:  I now use K9 on windows (a parental controls app that does the job for me : http://www1.k9webprotection.com/ ) (Posted since I saw some traffic to this page recently). I recently made the switch from Mac OS X to Windows (I now own a 17&#8221; XPS which is an absolute beast of a machine). I have [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:  I now use K9 on windows (a parental controls app that does the job for me : <a href="http://www1.k9webprotection.com/">http://www1.k9webprotection.com/</a> ) (Posted since I saw some traffic to this page recently).</strong></p>
<p>I recently made the switch from Mac OS X to Windows (I now own a 17&#8221; XPS which is an absolute beast of a machine). I have recently developed a major habit of wasting my time on sites like reddit, facebook (the addiction is rather huge here), gizmodo, engadget and the like. To get work done, it was imperative I used my web browser lesser than usual. Luckily, I found one of the best apps ever written to boost productivity: <a href="http://visitsteve.com/made/selfcontrol/" target="_blank">SelfControl</a> came to my rescue here. SelfControl allows you to type in a list of sites you want to block and you are all set. Essentially, the one stop solution for people with my problem.</p>
<p>I couldn&#8217;t find a free app on Windows (which sucks) so I decided to go write my own. Of course, this doesn&#8217;t even match the awesomeness that SelfControl packs in its UI (I use the command line and a text file for user input and SelfControl has absolutely the best user interface for the job) and I still don&#8217;t have persistence across reboots etc working (* yet).</p>
<p>My &#8220;app&#8221; (a small script) reads in domains from .\list.txt (you can change it in the script) and adds this one line to the System hosts file:</p>
<pre>127.0.0.1    _user_submitted_domain_</pre>
<p>and voila, site is blocked. For running the app, you need to supply no. of minutes blocked as a command line argument. So you would run:</p>
<pre>python WinSelfControl.py #number_of_minutes</pre>
<p>and it should go block it.</p>
<p>Of course, there are some quirks. For example: www.facebook.com is needed to block facebook. I initally added just facebook.com and it didn&#8217;t work (probably my misunderstanding of how hosts files work).</p>
<p>Also, this app isn&#8217;t persistent across shutdowns. If you shut-down in the middle of its execution, you will have to kick out the lines added to the hosts file yourself. So beware!</p>
<p>This was the product of a few hours and at last I can get back to productivity.</p>
<p>I have only tested this on a 64 bit Windows 7 machine. Also, this code looks like spaghetti code and it might break something. So no warranties there.<br />
Source uploaded here: <a href="http://shriphani.com/scripts/WinSelfControl.py">http://shriphani.com/scripts/WinSelfControl.py</a></p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2011/01/25/a-selfcontrol-workaround/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>More Updates to Listener</title>
		<link>http://shriphani.com/blog/2010/11/14/more-updates-to-listener/</link>
		<comments>http://shriphani.com/blog/2010/11/14/more-updates-to-listener/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 02:04:15 +0000</pubDate>
		<dc:creator>Shriphani</dc:creator>
				<category><![CDATA[DSP]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://shriphani.com/blog/?p=748</guid>
		<description><![CDATA[One of the rather irritating problems I was facing with Listener was that I had to set the intensity threshold for an alert manually (which is rather stupid). So I added a couple of lines that set the intensity threshold to what the average intensity of the surroundings currently is. So I no longer have [...]]]></description>
			<content:encoded><![CDATA[<p>One of the rather irritating problems I was facing with<a href="http://github.org/shriphani/listener" target="_blank"> Listener</a> was that I had to set the intensity threshold for an alert manually (which is rather stupid). So I added a couple of lines that set the intensity threshold to what the average intensity of the surroundings currently is. So I no longer have to calibrate my app to fire alerts at the right intensity.</p>
<p>Besides this, Microsoft interview on Tuesday, thanksgiving break and finals approaching fast etc. etc. Whatever.</p>
]]></content:encoded>
			<wfw:commentRss>http://shriphani.com/blog/2010/11/14/more-updates-to-listener/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

