<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Arnie Almighty</title>
	<atom:link href="http://arniealmighty.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://arniealmighty.wordpress.com</link>
	<description>Arnie does not play dice. He uses rand().</description>
	<lastBuildDate>Mon, 12 Oct 2009 03:47:03 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='arniealmighty.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/3f8c3dd35f885035e9739749d435f562?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Arnie Almighty</title>
		<link>http://arniealmighty.wordpress.com</link>
	</image>
			<item>
		<title>The CMI Online Judge needs you</title>
		<link>http://arniealmighty.wordpress.com/2009/10/11/the-cmi-online-judge-needs-you/</link>
		<comments>http://arniealmighty.wordpress.com/2009/10/11/the-cmi-online-judge-needs-you/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 03:45:42 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1500</guid>
		<description><![CDATA[I&#8217;m willing to pay a small amount (very miserly, but I hope there are some CMI undergrads who are in enough poverty to take me up on this offer) to get some work done on the CMI/IARCS Online Judge.

50 USD for a new professional looking CSS and layout. This is important for me, since I&#8217;m [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1500&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m willing to pay a small amount (very miserly, but I hope there are some CMI undergrads who are in enough poverty to take me up on this offer) to get some work done on the <a href='http://opc.iarcs.org.in'>CMI/IARCS Online Judge</a>.</p>
<ul>
<li>50 USD for a new professional looking CSS and layout. This is important for me, since I&#8217;m on the job hunt, and I link to opc.iarcs.org.in on my resumes, I want it to look good again. No partial credit. The layout will also have to explain considerations as to what is placed where. (For example, currently &#8220;Logout&#8221; comes on the top menu, which is completely unintuitive.) 100% XHTML Strict. Javascript/AJAX can be allowed.</li>
<li>90 USD for a specification and implementation of a tar-ball structure that almost completely defines a problem&#8217;s data. By this I mean, I should be able to create a tar-ball with all the input and output files, the problem statement, constraints etc, and just have to upload it to the judge, and the judge should be able to figure out all the parameters to the problem automatically. I have made few attempts toward this, but every time I miss something or the other, which makes it completely useless. 10 USD for a complete written specification, 60 USD for implementation via command line. 20 USD for implementing via web-uploads, with some sort of permission mechanism to allow owners to upload the problem, and edit it if required.</li>
</ul>
<p>Alright, I know I&#8217;m being cheap, but I really can&#8217;t afford to pay you a lot more. As a consolation, you could use this as &#8220;open source development&#8221; experience on your resume.</p>
<p>5$ for a name for the CMI OPC Judge. (It is referred to by several names even within the code. I am planning on putting it up on Sourceforge or something, but I don&#8217;t have a name for it.)</p>
<p>Mail me if you&#8217;re interested.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1500/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1500&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/10/11/the-cmi-online-judge-needs-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>
	</item>
		<item>
		<title>Grad Student, Season 2</title>
		<link>http://arniealmighty.wordpress.com/2009/09/16/grad-student-season-2/</link>
		<comments>http://arniealmighty.wordpress.com/2009/09/16/grad-student-season-2/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 05:34:46 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1476</guid>
		<description><![CDATA[Ah, the intoxicating smell of fear and tension: 

For a bonus amusement, I found a Masters-turned-PhD student, who used to sit in the front row and ask questions every five minutes last year, sitting at the last row with a coffee and browsing the net on his laptop. The PhD effect.
People asking you the question:

Me [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1476&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Ah, the intoxicating smell of fear and tension: </p>
<p><a href="http://www.phdcomics.com/comics/archive.php?comicid=79"><img src="http://www.phdcomics.com/comics/archive/phd092898s.gif" style="max-width:100%;"></a></p>
<p>For a bonus amusement, I found a Masters-turned-PhD student, who used to sit in the front row and ask questions every five minutes last year, sitting at the last row with a coffee and browsing the net on his laptop. The PhD effect.</p>
<p>People asking you the question:</p>
<p><a href="http://www.phdcomics.com/comics/archive.php?comicid=47"><img src="http://www.phdcomics.com/comics/archive/phd0227.gif" style="max-width:100%;"></a></p>
<p>Me being a <em>PhD-turned-Masters</em> student, answering this question becomes very tricky. I usually get it as &#8220;What-is-your-research-interest&#8221;. It&#8217;s even trickier if you are being asked that in a class filled with other people. The first time, I tried to use some fancy term (<em>&#8220;Varied&#8221;</em>) to avoid the answer; another time, I just didn&#8217;t answer it and kept the awkward pause going. Another time I had to write it down on a sheet of paper that was being passed around the class, and against my name and email address I shamelessly wrote a a long hyphen, in a column filled with fancy scientific sounding terms.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1476/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1476&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/09/16/grad-student-season-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>

		<media:content url="http://www.phdcomics.com/comics/archive/phd092898s.gif" medium="image" />

		<media:content url="http://www.phdcomics.com/comics/archive/phd0227.gif" medium="image" />
	</item>
		<item>
		<title>Inglourious Basterds</title>
		<link>http://arniealmighty.wordpress.com/2009/09/11/inglourious-basterds/</link>
		<comments>http://arniealmighty.wordpress.com/2009/09/11/inglourious-basterds/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 05:09:40 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1460</guid>
		<description><![CDATA[I usually don&#8217;t post movie reviews, but since I already made the mistake of posting about it before, I thought I should make my stance clear about Inglourious Basterds.
Absolutely sucks.
As a Tarantino fan:

Dialogs weren&#8217;t quite upto Tarantino standard.
The few decent dialogs were in subtitles. At some points, they show the camera zooming in on objects, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1460&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I usually don&#8217;t post movie reviews, but since I already made the mistake of posting about it <a href="http://arniealmighty.wordpress.com/2009/08/21/the-one-about-the-basterds/">before</a>, I thought I should make my stance clear about <a href="http://www.imdb.com/title/tt0361748/">Inglourious Basterds</a>.<span id="more-1460"></span></p>
<p><em>Absolutely sucks.</em></p>
<p>As a Tarantino fan:</p>
<ul>
<li>Dialogs weren&#8217;t quite upto Tarantino standard.</li>
<li>The few decent dialogs were in subtitles. At some points, they show the camera zooming in on objects, while a dialog is in subtitle, exactly where does the viewer look?</li>
<li>The plot was absolutely unconvincing. I kept hoping that we&#8217;re going to find an awesome Tarantino style ending (a la Four Rooms, Reservoir Dogs, Death Proof), to make up for the boring story, but that didn&#8217;t happen. Sorry for the &#8220;spoiler&#8221;.</li>
<li>Some reviews talked about good background score. There are some Tarantino style selection of music here and there, but they are pretty much there just because it&#8217;s Tarantino, and doesn&#8217;t really help the movie.</li>
<li>There wasn&#8217;t enough character development, I could hardly remember the faces of the Basterds. (plus, subtitles: I was looking at the subtitles when the introductions were done.)</li>
<li>Wtf is wrong with the title spelling. &#8220;An artistic flourish,&#8221; explains Tarantino. That would&#8217;ve been an acceptable explanation if the movie was good enough.</li>
</ul>
<p>Oh, btw, I finally did go alone. And sat in an almost empty theater. Sigh.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1460/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1460&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/09/11/inglourious-basterds/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>
	</item>
		<item>
		<title>The one about &#8220;Leadership&#8221;</title>
		<link>http://arniealmighty.wordpress.com/2009/09/10/the-one-about-leadership/</link>
		<comments>http://arniealmighty.wordpress.com/2009/09/10/the-one-about-leadership/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 01:16:20 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1445</guid>
		<description><![CDATA[I would happily give the task of &#8220;management&#8221; of any of my open source projects to anybody, and his duties would include telling me what I should be working on implementing, what bugs I should be fixing, and when I&#8217;ve been procrastinating, etc. Basically, I wouldn&#8217;t mind hiring someone to order me around.
But sometimes I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1445&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I would happily give the task of &#8220;management&#8221; of any of my open source projects to anybody, and his duties would include telling me what I should be working on implementing, what bugs I should be fixing, and when I&#8217;ve been procrastinating, etc. Basically, I wouldn&#8217;t mind hiring someone to order me around.</p>
<p>But sometimes I find friends or colleagues with no difference in seniority, telling me what to do, and when this happens, I get pissed off.</p>
<p>For instance, let&#8217;s say I&#8217;m working in a group of people. In school projects, typically what happens is that everybody is of basically the same seniority, and therefore there is no natural leader. And then as the project progresses, there&#8217;s this one guy who takes the initiative, and starts telling people what to do. </p>
<p>And I get pissed off when this happens. Note that I used the positive term &#8220;initiative&#8221;, and indeed this initiative by this person is in the best interests of the project; I wouldn&#8217;t take this initiative just because I don&#8217;t want the responsibility. Look, I would have voted for you if we had elected a leader at the beginning of the project, but I am not going to listen to your orders if I haven&#8217;t explicitly given you powers to order me. Yes, perhaps it&#8217;s my ego: if I elect you, then, in some sense, you&#8217;re working for me, and at the same time I&#8217;m working for you, and everybody is happy.</p>
<p>Sometimes, I&#8217;ve found myself indirectly giving this power to people: for instance, if there was an almost implied leader for a plan, I usually say some self-deprecating remark about how bad I&#8217;m at managing stuff, and that therefore I&#8217;m leaving everything in their hands, and that I&#8217;ll follow orders. When this happens, I would probably listen to them when they say &#8220;Sit Arnie, Sit! Good Boy!&#8221;</p>
<p>Today I&#8217;m pissed off with a particular person, who seems to be assuming some kind of leadership role, and basically giving me sweetly-worded orders. So what happens is that since they are sweetly-worded you have to keep nodding your head, &#8220;Oh okay, sure I&#8217;ll do that&#8221;, &#8220;yeah no problem&#8221;, and so on. This is not the first time this is happening with this guy, and the last time I ended up doing more work than I should have done. It&#8217;s not that I&#8217;m stupid to keep accepting, it&#8217;s just that I don&#8217;t see any way of saying No, unless I show him this blog post, and tell him that I just don&#8217;t like him taking the &#8220;leadership&#8221; initiative. </p>
<p>(Additionally, this guy talks way too much, so I agree to everything he says without argument just to make him stop talking.)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1445/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1445&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/09/10/the-one-about-leadership/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>
	</item>
		<item>
		<title>The one about If</title>
		<link>http://arniealmighty.wordpress.com/2009/08/31/the-one-about-if/</link>
		<comments>http://arniealmighty.wordpress.com/2009/08/31/the-one-about-if/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 07:33:45 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1426</guid>
		<description><![CDATA[In a recent conversation a friend, he said something which amounted to, &#8220;If A happens, then I plan to do B,&#8221; to which I informed him that A is not going to happen.
I&#8217;m sure that this person probably does not even remember this, but my reply is making me feel guilty to the point that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1426&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In a recent conversation a friend, he said something which amounted to, &#8220;If A happens, then I plan to do B,&#8221; to which I informed him that A is not going to happen.</p>
<p>I&#8217;m sure that this person probably does not even remember this, but my reply is making me feel guilty to the point that I can&#8217;t sleep. </p>
<p>There&#8217;s a reason I feel guilt. I&#8217;ve been at the receiving end of this several times over the past few months, and I&#8217;ve slowly begun noticing a pattern, and I get more and more frustrated each time it happens, because it simply destroys any logical conversation between the two people involved.</p>
<p>For those who haven&#8217;t yet understood what I&#8217;m talking about: when I tell somebody &#8220;If A, then B&#8221; (or &#8220;I&#8217;m doing B just in case A happens&#8221;), I have not implied anything about whether A is true, and have not implied anything about the probability of A being true. Simple logic.</p>
<p>Yet, when I have debates (you know, political issues, and the like) with people, the moment I mention &#8220;If A, then B&#8221;, everybody jumps on me claiming that I&#8217;m stupid to assume that A can ever be possible.</p>
<p>For the same reason, when somebody asks me what my plans for the future are, I would avoid the &#8220;If A, then B&#8221;s, and find the C that is most likely to happen (which happens to be: nobody hires me, and am jobless, as opposed to A being getting a job in Wall Street), and simply say &#8220;If C, then D&#8221;. When I do get careless, and break away from this format and say, &#8220;If A, then B&#8221;, I&#8217;m attacked as if I&#8217;m the most stupid person ever because I&#8217;m actually planning for the possibility of A happening.</p>
<p>If the discussion is of value to the attacker (Notice the <em>If</em>), and if the attacker makes me feel stupid about mentioning the As, the attacker learns less from me, and stands to loose.</p>
<p>So should I never question an If-A-then-B? It&#8217;s not all that simple.</p>
<p>What if somebody tells me: &#8220;I&#8217;m raptor-proofing my house, just in case the dinosaurs attack.&#8221; At this point, the if-clause is absolutely utterly stupid, and I&#8217;m allowed to question it. What&#8217;s the difference here? In this case, there&#8217;s a cost to taking into consideration the possibility of A. If raptor-proofing is free, I should shut up.</p>
<p>Therefore, in the interest of sane, logical conversations, I propose the following mechanism for determining whether you&#8217;re allowed to argue an If-A-then-B. Think of insurance. I had an argument once about why I prefer an expensive medical insurance, &#8220;Sure, in most cases I won&#8217;t be needing it. Heck, I&#8217;ve hardly used a few hundred dollars of it last year. But if a medical emergency does happen, and I don&#8217;t have an expensive insurance, I&#8217;d get bankrupt and my whole life would be ruined&#8221;. At this point, your only valid argument should be whether my annual premium that I pay being worth the small probability. You do not have a right to simply tell me that the probability of such an emergency is too low (worse: telling me it will never happen!), without talking about the cost involved.</p>
<p>And therefore, in the future, if I ever say &#8220;If A, then B&#8221;, and the cost involved in taking A into consideration is Zero, then heck, you have no right to argue the possibility of A. If needed, argue B given A.</p>
<p>If I say, &#8220;If A, then B&#8221;, and there&#8217;s a cost involved in taking A into consideration, then you have a right to question whether that cost is worth it. Even in this case, be mindful of the differences in valuations of cost between you and me.</p>
<p>And since, in the recent conversation with the friend that I mentioned at the beginning of this post, I claimed that A is not going to happen, in a situation where there was no cost involved in planning for A, I sincerely apologize. </p>
<p><em>(P.S. I didn&#8217;t have the right words while describing the If-A-then-B construct. Any pointers to proper linguistic terms for these if I need to discuss this again?)</em></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1426/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1426&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/08/31/the-one-about-if/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>
	</item>
		<item>
		<title>The one about the Basterds</title>
		<link>http://arniealmighty.wordpress.com/2009/08/21/the-one-about-the-basterds/</link>
		<comments>http://arniealmighty.wordpress.com/2009/08/21/the-one-about-the-basterds/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 05:45:40 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1423</guid>
		<description><![CDATA[No, I haven&#8217;t seen it, and this is not a review.
It releases today, and there&#8217;s this part of me that does not want to see it.
Over the last one year, I have seen most of the movies that I have been interested in watching, and so now when I watch something, it&#8217;s mostly out of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1423&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>No, I haven&#8217;t seen it, and this is not a review.</p>
<p>It releases today, and there&#8217;s this part of me that does not want to see it.</p>
<p>Over the last one year, I have seen most of the movies that I have been interested in watching, and so now when I watch something, it&#8217;s mostly out of boredom than actual interest.</p>
<p>A Tarantino is different.</p>
<p>I&#8217;ve been trying to figure out why I&#8217;m trying to avoid watching it. I know that this is the only movie I&#8217;ve ever really looked forward to.</p>
<p>When you buy a bottle of fine Champagne, you just don&#8217;t use it the night you buy it. You treasure it, maybe let it age, and then when the timing is right, when you&#8217;re with the right people, with the right atmosphere, and the right everything, that&#8217;s when you open it.</p>
<p>I will not drink Champagne alone.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1423/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1423/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1423/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1423/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1423/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1423/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1423/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1423/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1423/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1423/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1423&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/08/21/the-one-about-the-basterds/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>
	</item>
		<item>
		<title>The one about the Attack of the House Flies</title>
		<link>http://arniealmighty.wordpress.com/2009/08/16/the-one-about-the-attack-of-the-house-flies/</link>
		<comments>http://arniealmighty.wordpress.com/2009/08/16/the-one-about-the-attack-of-the-house-flies/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 02:57:17 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1412</guid>
		<description><![CDATA[I killed over twenty flies today. Two were &#8230; just a few minutes ago. They were humping each other, and I got them both at the peak of their ecstasy. Some were unborn, just larvae [EDIT: looking at WP images, I might be wrong about this]. I had to execute them with my own bare [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1412&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I killed over twenty flies today. Two were &#8230; just a few minutes ago. They were humping each other, and I got them both at the peak of their ecstasy. Some were unborn, just larvae [EDIT: looking at WP images, I might be wrong about this]. I had to execute them with my own bare hands, and there was something about it that I didn&#8217;t like.</p>
<p>I enjoyed it.</p>
<p>No but seriously, I suddenly, overnight, have a housefly problem at my new apartment. I mean, when you kill houseflies that are humping each other, you know you&#8217;ve got a problem. And it&#8217;s not stopping, the more I kill the more seem to appear from nowhere (my windows are netted btw, so they won&#8217;t even leave). It&#8217;s not that all 20 were present at the same time! There seems to be some nest somewhere in the apartment that&#8217;s constantly producing them. And according to wikipedia, these things lay eggs in batches of 75 to 150 that hatch within a day. Ugggh. Ewww. *shivers*. I&#8217;m screwed.</p>
<p>And I&#8217;ll not be at home tomorrow. Tomorrow they&#8217;ll have a field day humping and mating and partying on the tiny food crumbs on the kitchen. AAAAAAAAAAAHHHHHHHHHHH!!!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1412/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1412&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/08/16/the-one-about-the-attack-of-the-house-flies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>
	</item>
		<item>
		<title>Pidgin and Webkit Message Views</title>
		<link>http://arniealmighty.wordpress.com/2009/08/16/pidgin-and-webkit-message-views/</link>
		<comments>http://arniealmighty.wordpress.com/2009/08/16/pidgin-and-webkit-message-views/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 00:18:53 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[adium message views]]></category>
		<category><![CDATA[pidgin]]></category>
		<category><![CDATA[soc]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1305</guid>
		<description><![CDATA[(This is a report for Summer of Code 2009, and is intentionally very technical. Regular readers are requested to not harass me over my recent geeky posts.)
First a screenshot of a theme I liked (Ravenant), and a theme that works decently: 

(I&#8217;m not going to fool you, and I know many themes don&#8217;t work entirely [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1305&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><em>(This is a report for Summer of Code 2009, and is intentionally very technical. Regular readers are requested to not harass me over my recent geeky posts.)</em></p>
<p>First a screenshot of a theme I liked (Ravenant), and a theme that works decently: </p>
<p><a href="http://arniealmighty.wordpress.com/2009/08/16/pidgin-and-webkit-message-views/screenshot-first/" rel="attachment wp-att-1306"><img src="http://arniealmighty.files.wordpress.com/2009/08/screenshot-first.png?w=265&#038;h=300" alt="Screenshot-first" title="Screenshot-first" width="265" height="300" class="alignleft size-medium wp-image-1306" /></a></p>
<p>(I&#8217;m not going to fool you, and I know many themes don&#8217;t work entirely well. And I&#8217;ll conveniently blame that on Webkit, and I&#8217;ll bring up the rendering issues in a moment.)</p>
<h2>Repository and Directories</h2>
<p>In my <a href="http://pidgin.im/pipermail/devel/2009-July/008542.html">midterm report</a> I mentioned that I was using Git for version control. Soon after, I moved to monotone. I&#8217;ve been pushing my changes to the same Git repository for backup, but under a different branch name. So if you want to check out my code for testing, here&#8217;s what you do:</p>
<p><code><br />
   $ git clone git://github.com/tdrhq/pidgin-clone.git<br />
   $ cd pidgin-clone<br />
   $ git checkout -b webkit remotes/origin/im.pidgin.soc.2009.webkitmessageview<br />
</code></p>
<p><em>[EDIT: I changed the last checkout command to use remotes/origin/im...]</em></p>
<p>If anybody wishes to pull from my Monotone repository, we could arrange for that.</p>
<p>Since the midterm, I also added support for multiple message styles. Each of the styles go into a directory under ~/.purple/styles/. So e.g., you might have a directory called <tt>~/.purple/styles/Ravenant.AdiumStyles/Content</tt> if you have installed the Ravenant style.</p>
<p>You&#8217;ll also want to enable the Adium IMs plugin for message styles to work. (Otherwise you&#8217;ll still be using WebKit, but without themes.)</p>
<h2>What works and doesn&#8217;t work</h2>
<p>I promise I&#8217;m not going to suddenly decide to code while writing this report, so hence and therefore, even if some of the Todo&#8217;s that I mention below seem obvious to fix, I will not fix them until this report is done. :-)</p>
<p>There are very few visible changes since the midterm: You can switch between Message Styles now, and I removed support for on-the-fly changing variants. Any changes to the style or options will take effect only in new conversations.</p>
<p>Internally, I&#8217;ve changed many things since the midterm. E.g., </p>
<ul>
<li>I use signals instead of UiOps, which is more cleaner, but has its drawbacks. (The current signals that gtkconv emit don&#8217;t give the alias and timestamp for the message. Not hard to change the signal itself, but still&#8230;).</li>
<li>I&#8217;ve been more careful about waiting for the Webkit document to load completely before appending messages (otherwise the JavaScript fails silently.). </li>
<li>Since more than one Message style may be loaded at the same time I had to do some refactoring (this refactoring will also enable having different Styles for chats and IMs). </li>
<li>I currently parse the style&#8217;s <tt>Info.plist</tt> file completely according to [1], and use the DefaultFontFamily and DefaultFontSize. (Some of the other keys depend on changes in Webkit gtk; and I don&#8217;t know how to implement ImageMask.)</li>
<li>User&#8217;s selection of style options are saved on a per-style basis. (e.g., for each style I store the last variant the user used.)</li>
</ul>
<p>Among things that don&#8217;t work: most noticeable are the rendering issues. In the first screenshot, you can see that the gradient isn&#8217;t smooth. This seems to be an issue with almost all themes that seem to use translucent PNGs for drawing these gradients. (For the record, I am using WebKit trunk.) Some other themes have positioning issues, but are mostly useable.</p>
<p>Another thing I would like to do in the future is HTML-tidy each message and strip off the &lt;html&gt; and &lt;body&gt; tags. Not a show-stopper, but it&#8217;ll be easier on Style designers to have standards compliant messages.</p>
<p>Here&#8217;s a screenshot of the Adium IMs plugin options:</p>
<p><a href="http://arniealmighty.wordpress.com/2009/08/16/pidgin-and-webkit-message-views/screenshot-options/" rel="attachment wp-att-1321"><img src="http://arniealmighty.files.wordpress.com/2009/08/screenshot-options.png?w=300&#038;h=196" alt="Screenshot-options" title="Screenshot-options" width="300" height="196" class="alignleft size-medium wp-image-1321" /></a></p>
<p>I have never done Gtk layouting in the past, and I spent a lot of time just getting this little thing together, using a nasty GtkTable, and so despite how ugly it looks, I&#8217;m proud of it. (Sean gave me some better ideas as to how to do the layout, and I&#8217;ll be doing them soon. As I said, not while this report is in progress.)</p>
<p>As you can see, this does not provide the same level of customizability that the Adium&#8217;s &#8220;Messages&#8221; preference tab provides. (For those like me without access to a Mac, <a href="http://www.soft32.com/screenshot/49-0-40737.html">here&#8217;s</a> what it looks like on Adium. Screenshot from <a href="http://www.soft32.com/Download/Free/Adium_X/4-200710-3.html">here</a>.)</p>
<p>This plugin does not implement the &#8220;Status.html&#8221; and &#8220;FileTransfer.html&#8221; parts of [1]. This should be fairly easy to implement though. Also the sections on &#8220;Image Zooming&#8221;, &#8220;JavaScript enhancements&#8221;, and &#8220;Groupchat styling&#8221; are not implemented. (Groupchat works, but in a way that is not distinguished from regular IMs.) <em>[Oh crap, so many todos? I better get coding.]</em></p>
<p>This plugin, like Adium itself, does not support inline typing notifications. This needs changes into the style specification itself. It shouldn&#8217;t be too hard, we could allow the style to specify a JavaScript function &#8220;setTypingStatus&#8221;, that would be called every time the typing status changes. Not too hard, but I would definitely like an opinion from Adium devs on this one.</p>
<p>Disabling the Adium style plugin, and just using plain webkit still breaks inline typing notification. GtkIMHtml had some specific &#8220;hacks&#8221; for typing notification, which can actually be done using JavaScript with WebKit. My contention with this idea was that this adds additional complexity to GtkConv.c (which is already huge!) and this JS overlaps with the JS of implementing inline typing notifications in the Style, and if ever Pidgin chooses to use Adium styles as default, this would be wasted code.</p>
<p>I also haven&#8217;t done anything about <tt>gtkconv-&gt;entry</tt>, which refers to this widget:</p>
<p><a href="http://arniealmighty.wordpress.com/2009/08/16/pidgin-and-webkit-message-views/screenshot-entry2/" rel="attachment wp-att-1399"><img src="http://arniealmighty.files.wordpress.com/2009/08/screenshot-entry2.png?w=300&#038;h=38" alt="Screenshot-entry2" title="Screenshot-entry2" width="300" height="38" class="alignleft size-medium wp-image-1399" /></a><br />
so GtkConv still has a dependency on GtkIMHtml. </p>
<p>I haven&#8217;t worked out a solution for the Security considerations I raised in my midterm review.</p>
<h2>Code quality</h2>
<p>I&#8217;ll now give my opinion on the quality of code I&#8217;ve written. I&#8217;ve stuck to the usual Pidgin coding style. (Except, out of habit of coding in Liferea, I have used func&lt;space&gt;() at most places.)</p>
<ul>
<li>gtkwebview.{c|h} is fairly well written, being almost a very simple wrapper over WebkitWebView. (It compiles with warnings about <em>&#8220;no previous prototypes for gtk_webview_xyz&#8221;</em>, which makes absolutely no sense to me as they are declared in gtkwebview.h. I remember reading something about a GCC bug regarding this, but I&#8217;m not sure.)</li>
<li>The changes to GtkConv.c were done in one marathon session. I can&#8217;t imagine how I had the patience to do all of those, since reviewing each of those changes is painful enough. However I think I did a &#8220;decent&#8221; job here, and might have broken a few things like drag-n-drop. Also gives a few warnings about unused symbols.</li>
<li>webkit.c, and the adium styling code was initially taken from Sean&#8217;s <a href="http://www.pidgin.im/~seanegan/webkit.c">plugin</a> (which btw, does a lot of the Style parsing code already!). This code has grown and is now in two files: message-style.c and webkit.c, where message-style.c handles parsing the style data. The exact nature and intent of the PidginMessageStyle struct can be a little confusing, and I need to document it correctly. I need to separate the preferences code into a third module.</li>
<li>smileyparser.{h|c} is terribly written but does its job. It is intended as a replacement for the smiley text-replacement code which is part of GtkIMHtml, and as of right now is redundant but required for conceptual clarity.</li>
</ul>
<p>There are other less significant places cases where GtkIMHtml was replaced with WebKit. (About, User Info, Chat logs.)</p>
<p>There are a few <tt>printf</tt>&#8217;s at places, and I promise to replace them with <tt>purple_debug_info</tt>.</p>
<h2>Broken Plugins</h2>
<p>A few plugins remain broken becase they depended on gtkconv-&gt;imhtml, which no longer exists. Few of the plugins that I have removed temporarily from pidgin/plugins/Makefile.am: gestures, history, markerline, notify, timestamp, timestamp format, xmppconsole, &#8230; (I&#8217;ll get back to you on this one, I think I&#8217;ve disabled more plugins than needed.)</p>
<h2>Links, if you reached till this point</h2>
<p>[1] http://trac.adium.im/wiki/CreatingMessageStyles<br />
[2] http://pidgin.im/pipermail/devel/2009-July/008542.html</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1305/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1305&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/08/16/pidgin-and-webkit-message-views/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>

		<media:content url="http://arniealmighty.files.wordpress.com/2009/08/screenshot-first.png?w=265" medium="image">
			<media:title type="html">Screenshot-first</media:title>
		</media:content>

		<media:content url="http://arniealmighty.files.wordpress.com/2009/08/screenshot-options.png?w=300" medium="image">
			<media:title type="html">Screenshot-options</media:title>
		</media:content>

		<media:content url="http://arniealmighty.files.wordpress.com/2009/08/screenshot-entry2.png?w=300" medium="image">
			<media:title type="html">Screenshot-entry2</media:title>
		</media:content>
	</item>
		<item>
		<title>Unit Testing</title>
		<link>http://arniealmighty.wordpress.com/2009/08/15/unit-testing/</link>
		<comments>http://arniealmighty.wordpress.com/2009/08/15/unit-testing/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 04:18:34 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[event driven programming]]></category>
		<category><![CDATA[GLib]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1282</guid>
		<description><![CDATA[Hello there, tech readers. 
I have a question to ask, and I hope one of you out there can give me a good answer to it.
So I have recently been introduced to Unit Testing as a development process, as part of the Software Engineering course I just took at Penn. Now, firstly we didn&#8217;t go [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1282&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hello there, tech readers. </p>
<p>I have a question to ask, and I hope one of you out there can give me a good answer to it.</p>
<p>So I have recently been introduced to Unit Testing as a development process, as part of the Software Engineering course I just took at Penn. Now, firstly we didn&#8217;t go into very detailed technical aspects of how Unit tests are done, but I did get a chance to write tests while I wrote code, and I found it to be incredibly useful. During the course I also wrote PHPUnit tests for the <a href='http://opc.iarcs.org.in/'>CMI/IARCS online judge</a>, and, while I think PHPUnit is better than nothing, it still sucks for data-driven applications like the CMI judge.</p>
<p>Now for one thing, PHPUnit is buggy. But I think the major issue is that the entire model (which I think, is called the xUnit model) is crappy for certain types of applications, especially Web Applications.</p>
<p>I also think, that the model is pretty useless for event driven applications like most desktop applications written in C, since it&#8217;s going to be ridiculously messy to wait on events and callbacks to proceed the test. On the other hand, most Java programs would probably have a thread for doing anything that would block, and while I would&#8217;ve called that absolutely stupid until a month back, I can see why that&#8217;s so useful for writing unit tests.</p>
<p>In fact, Java makes unit tests bloody easy even without a framework. We wrote a fairly complex Java program last Spring as part of the Software Systems course, and without knowing anything about Unit testing, writing tests were obvious every time I wrote a new component: <tt>public static void main</tt>!</p>
<p>I&#8217;ve been thinking about how I would like to implement a Unit testing framework for the OPC judge, and I did come up with the following framework, and I do believe that it&#8217;s a fairly obvious way of going about it, and that one of the  <a href="http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks">hundreds of unit testing frameworks</a> should provide something like this, and that one you readers can point me to it.</p>
<p>So, first I&#8217;d like to argue that we should be able to define the state of the system well. In unit testing terminology, this might be called &#8220;fixtures&#8221;. There are two parts of the fixture, one is the static data stored by the program before it started, and then a series of actions that changed the system to its present state.</p>
<p>For example in PHP, the state would be [database] x [$_SESSION], and here the $_SESSION is usually small enough. These are the only two things that are remembered across two calls to the Apache server. (In this situation, you can imagine a second user changing the database at the same time, but for the  purpose of testing, let&#8217;s skip these situations.)</p>
<p>In event driven, single threaded programs, the state is actually very easily defined. Each time you&#8217;re in the event loop, waiting for the next event, we have a state. I wouldn&#8217;t be concerned much (with some exceptions) about intermediate states. It&#8217;s these states where the program is doing nothing that has to be tested.</p>
<p>(In multi-threaded programs, talking of state is pretty useless, so in that case, we should stick to the xUnit style of testing.)</p>
<p>Once you have the state, you can define actions. Actions may or may not change the state. Each unit test would be of the following form: set up the fixture, run a few actions to bring the system state to a state in which we want to test the system, and finally test the action we&#8217;re interested in.</p>
<p>Unfortunately, as a developer, I find myself not liking the idea of building the fixture for a particular test. It&#8217;s painful, you have to hand compute the results, errors, and any small change to the dataset changes the answers, and so on. So the first thing I want of my testing framework, is that I should be able to write tests without fully knowing how the fixture looks like. But the actions depend on the fixture itself. So e.g., I want to test that the problems/ page works on the IARCS judge.  depends on the data. I would should be able to write something like:</p>
<p><code><br />
  $problemname = get_value_for_situation ("problem-name", "Any problem name in the database, maybe one that uses images, so that we can test it");<br />
  route ("problems/$problemname");<br />
  &lt; sanity checks go here &gt;<br />
</code></p>
<p>Now this is independent of the fixture. So if a user wants to create a new test based on this for a new fixture (or for a new value of problem-name), he might do something like:</p>
<p><code><br />
 $ create-test test-problems-page.php &lt;fixturedir&gt;<br />
</code></p>
<p>and now, the testing framework asks the user to input a value for &#8220;problem-name&#8221;, and stores this answer in a testing database permanently (which should not be part of the code repository, but you could imagine a central repository, where testers can push their tests to).</p>
<p>This can go on. Answers can depend on the fixture too, for instance if in the above case an Exception is thrown while opening &#8220;problems/$problemname&#8221;, then the framework should ask the tester:</p>
<p><code><br />
An exception [ContestNotStartedException] was thrown, is this the expected behavior [y/n] ?<br />
</code></p>
<p>..and the answer goes into the database.</p>
<p>It could be more complex. The tester could write specific tests for his fixture:</p>
<p><code><br />
The test passed with no assertions failing. Do you want to test anything else [y/n]? y<br />
&gt; assert ($output-&gt;xpathQuery ("//img[@href="image1.jpg]").count != 0)<br />
</code></p>
<p>.. and this code goes into the database.</p>
<h2>Event driven C programs</h2>
<p>The second thing I want in a framework is specific to event driven programs, and very specific to the libraries/languages used. There are some unit tests that I would actually like to write for my Soc 2009 code for Pidgin.</p>
<p>A simple concept that we learnt in Software Engineering was &#8220;Design to Test,&#8221; which makes lots of sense. Therefore, I believe it makes sense for a C program to emit signals specifically to indicate that some action has completed successfully or changed the state, even if that signal is not intended to be used by other code.</p>
<p>For instance, if I had to rewrite my GoogleSource implementation in Liferea, I should be able to write unit tests that look like:</p>
<p><code><br />
 testParseSuccess (){<br />
    &lt;initialize the GoogleSource subscription&gt;<br />
    subscription_update (subscription); /* asynchronous network interactions */<br />
    g_wait_on_signal (subscription, "update-complete", &amp;xml);<br />
    &lt;validate the XML &gt;<br />
 }<br />
</code></p>
<p>[technical detail: This scheme may not be easy to implement. One way is to keep continue the event loop within the wait_on_signal function. I'm not sure about the details of this, and I might be wrong. The other is to keep this entire code in another thread, and "subscription_update" should would not be an internal API call, but a "top-level" "action".]</p>
<p>This should make it possible to write linear tests within the event driven model, while keeping the test code as an observer to the state of the system.</p>
<p>I stop here. I&#8217;m getting lazy, and I still have work to do on my Pidgin Webkit plugin, and so I&#8217;m not proof reading this. Hopefully, even though most of you didn&#8217;t reach till this paragraph, this documents some of the ideas I had for how a unit test system should behave. And even better, if you know some unit test framework that I can modify to suit my needs, do let me know.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1282/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1282&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/08/15/unit-testing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>
	</item>
		<item>
		<title>The SSH Tunnelling Cheatsheet</title>
		<link>http://arniealmighty.wordpress.com/2009/08/04/the-ssh-tunnelling-cheatsheat/</link>
		<comments>http://arniealmighty.wordpress.com/2009/08/04/the-ssh-tunnelling-cheatsheat/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 07:38:48 +0000</pubDate>
		<dc:creator>Arnie</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://arniealmighty.wordpress.com/?p=1257</guid>
		<description><![CDATA[This is going to be the Ultimate Wi-Fi Hitchhiker&#8217;s Guide to Tunnelling.
I&#8217;m going to start with the basics, and end up presenting my own scripts and my own setup to create an Ultimate, almost 100% transparent tunnelling setup, without root permissions on the gateway.
What SSH Provides
Situation 1: A &#8211;&#62; B &#8211;&#62; C
If you are A [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1257&subd=arniealmighty&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is going to be the Ultimate Wi-Fi Hitchhiker&#8217;s Guide to Tunnelling.</p>
<p>I&#8217;m going to start with the basics, and end up presenting my own scripts and my own setup to create an Ultimate, almost 100% transparent tunnelling setup, without root permissions on the gateway.</p>
<h2>What SSH Provides</h2>
<h3>Situation 1: A &#8211;&gt; B &#8211;&gt; C</h3>
<p>If you are A and you want to connect to an HTTP proxy running on C on port number 3128, but you have access only to B, and B has access to C, this is what you would do:<br />
<code>arnold@A:~$ ssh -L 8000:<em>C</em>:3128 <em>B</em> -N</code></p>
<p>(<em>B</em>/<em>C</em> are IP address or host names.) This creates a port 8000 locally which maps to port 3128 on <em>C</em>.</p>
<h3>Situation 2: C &#8212;&gt; A, but A &#8211;/&#8211;&gt; C</h3>
<p>Ok, suppose C is behind a complete firewall, and you can&#8217;t even access B, or C directly from A. But C can access A. Well, let&#8217;s assume now that you have physical access to C (or ssh access via some long tedious route), well, then connect to C and do:<br />
<code>arnold@C:~$ ssh -R 8000:<em>A</em>:3128 <em>A</em></code></p>
<p>Very useful if somebody behind a firewall wants you to help out with system administration remotely.</p>
<h3>Situation 3: You just want a &#8220;transparent&#8221; proxy, and you  already have a connection from A &#8211;&gt; C</h3>
<p>What we do here, is create a SOCKS proxy, which is a kind of super-proxy, that can proxy just about any kind of connection, as long as your client program supports SOCKS. Typically this is what you&#8217;d do:<br />
<code>arnold@A~$ ssh -D 9000 arnold@C -N</code></p>
<p>Now go to your Gnome Network Proxy setting and set your proxy to use SOCKS, with <tt>localhost:9000</tt>. You might have to manually set it for applications that don&#8217;t lookup the Gnome proxy settings. If you&#8217;ve done this right you should be able to do almost everything like chatting, browsing etc.</p>
<p><tt>ssh -D</tt> is useful, but it&#8217;s not convenient when you want a &#8220;permanent&#8221; transparent solution. For one thing many command line applications don&#8217;t support SOCKS by default. We can sort of fix this: Install <a href="http://tsocks.sourceforge.net/">tsocks</a>, edit the proxy settings in <tt>/etc/tsocks.conf</tt>, and run <tt>tsocks bash</tt>. Any command you run now will transparently use the SOCKS proxy you set up.</p>
<p>But that&#8217;s not good enough.</p>
<h3>Situation 4: A &#8211;&gt; C, and you have root access on both A and C</h3>
<p>&#8230; and you&#8217;re running Linux/BSD etc.</p>
<p><code>arnold@A~$ sudo ssh -w 0 root@C -N</code></p>
<p>This creates a &#8220;virtual&#8221; networking device (<em>tun0</em>) on both ends, and connects them, basically creating a VPN. But this step just creates the connection, it does not set up the routing. I can&#8217;t show you all the steps here, but this is basically what you do:</p>
<p><code>arnold@A~$ ifconfig tun0 10.0.0.1 pointtopoint 10.0.0.2</code><br />
<code>arnold@C~$ ifconfig tun0 10.0.0.2 pointtopoint 10.0.0.1</code></p>
<p>You should now be able to ping 10.0.0.2. Now set up iptables and NAT on C. (Sigh, I can&#8217;t explain those here, and really I don&#8217;t know much of it. But you&#8217;ll see a few examples of iptables further down.) Once this is set up, you need to set the route on A:<br />
<code><br />
arnold@A~$ sudo route del default dev eth0<br />
arnold@A~$ sudo route add  dev eth0 # you still need your SSH to run<br />
arnold@A~$ sudo route add default gw 10.0.0.2<br />
</code></p>
<p>Too messy? Of course it is. Plus, you need root access on the server. We can do better.</p>
<h2>The trick</h2>
<p>There are multiple &#8220;solutions&#8221; to the problem. The first one that came to my mind, was to create a tun0 virtual device locally, which maps each connection to a local SOCKS proxy. Fairly simple idea, turned out messy to code because I didn&#8217;t know how to easily write a userspace TCP stack that changed the raw packets from the tun device to a stream. I googled a lot but found just one program that claimed to do this, and that was written in C#, and had some GUI code in it, and I definitely didn&#8217;t feel comfortable running it. (for the record, socks-tun on Google code.)</p>
<p>So here&#8217;s what I finally did: Let&#8217;s use iptables to reroute all outgoing TCP streams to a local daemon. This daemon at this point does not know the destination of this stream, but with a little effort it can find that out by looking at <tt>/proc/net/ip_conntrack</tt>. Now it just uses tsocks to finally route this connection via SOCKS. Simple enough, the code is <a href="http://github.com/tdrhq/tunnel-scripts/">here</a> (and <tt>git clone git://github.com/tdrhq/tunnel-scripts.git</tt>), and here&#8217;s what I did:</p>
<p>Build it: <code>arnold@laptop:~/tunnel$ gcc lcat.c io_loop.c my_socket.c -g -o lcat</code>.</p>
<p>For the following example, I shall use 61.12.4.27 as an example, since it&#8217;s CMI&#8217;s IP address, although I would hope that the rest of you reaching here via Google don&#8217;t just copy and paste this.</p>
<p>Enable ip_forward: (I&#8217;m not sure if you need this step, but still&#8230;)<br />
<code>sysctl -w net.ipv4.ip_forward=1</code></p>
<p>Reroute all connections to destinations other than 61.12.4.27 to a local port:<br />
<code>sudo iptables -t nat -A OUTPUT -p tcp -d \! 61.12.4.27 -o wlan0 -j DNAT --to-destination 127.0.0.1:9000</code></p>
<p>(Change wlan0 to your interface.)</p>
<p>Now create your SSH socks proxy:<br />
<code>ssh -D 3128 61.12.4.27 -N</code></p>
<p>Now edit <tt>/etc/tsocks.conf</tt> with the proxy as <tt>localhost</tt> and port as <tt>3128</tt>. Also set the SOCKS version to 4. We&#8217;re almost done:<br />
<code><br />
arnold@laptop:~/tunnel$ sudo tsocks bash<br />
root@laptop:/home/arnold/tunnel# ./lcat -p 9000 -t<br />
</code></p>
<p>And from now on all TCP connections are 100% tunnelled.</p>
<p>Caveats: DNS lookup is not TCP based. The iptables command above routes only TCP connections. It should be possible to route UDP via SOCKS too, however I don&#8217;t have support for that in my code yet. So, right now, you better have a valid nameserver to use. Also, because of this same reason, <tt>ping</tt> won&#8217;t work, and so don&#8217;t expect to use it to test connectivity during any of the steps.</p>
<p>More notes: SSH tunnels time out if inactive.</p>
<h2>Being a responsible Tunneller</h2>
<p>As a tunneller, you don&#8217;t want to be misusing your gateway&#8217;s bandwidth. Let&#8217;s all just be resonsible tunnellers. Also, what&#8217;s your reason for tunnelling? Right now, mine is that I&#8217;m using my neighbor&#8217;s wireless, and I don&#8217;t want to get caught. (While watching videos, you don&#8217;t really need the full bandwidth, but it uses it anyway in pointless buffering.) My <tt>lcat</tt> script can be used for bandwidth throtling too. You need to run an <b>additional</b> lcat, before the ssh step. To limit the speed to 100 kbps:<br />
<code><br />
 arnold@laptop:~/tunnel$ ./lcat -p 6000 -h 61.12.4.27 -s 100<br />
 arnold@laptop:~/tunnel$ ssh -D 3128 -p 6000 arnold@localhost<br />
</code><br />
While lcat is running, you can also type in a new speed to change the speed on-the-fly.</p>
<h2>And for completeness&#8230;</h2>
<p>&#8230; let me mention <a href="http://www.agroman.net/corkscrew/">Corkscrew</a> for tunnelling an SSH session over an HTTP proxy.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arniealmighty.wordpress.com/1257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arniealmighty.wordpress.com/1257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arniealmighty.wordpress.com/1257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arniealmighty.wordpress.com/1257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arniealmighty.wordpress.com/1257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arniealmighty.wordpress.com/1257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arniealmighty.wordpress.com/1257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arniealmighty.wordpress.com/1257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arniealmighty.wordpress.com/1257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arniealmighty.wordpress.com/1257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arniealmighty.wordpress.com&blog=1119613&post=1257&subd=arniealmighty&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arniealmighty.wordpress.com/2009/08/04/the-ssh-tunnelling-cheatsheat/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Arnie</media:title>
		</media:content>
	</item>
	</channel>
</rss>