<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Inthehut</title>
	<atom:link href="http://inthehutt.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://inthehutt.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 13 Nov 2011 17:02:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='inthehutt.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Inthehut</title>
		<link>http://inthehutt.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://inthehutt.wordpress.com/osd.xml" title="Inthehut" />
	<atom:link rel='hub' href='http://inthehutt.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Erlang: Danger of Mixing Records and Tuples</title>
		<link>http://inthehutt.wordpress.com/2011/11/13/erlang-danger-of-mixing-records-and-tuples/</link>
		<comments>http://inthehutt.wordpress.com/2011/11/13/erlang-danger-of-mixing-records-and-tuples/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 17:02:05 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://inthehut.org/?p=105</guid>
		<description><![CDATA[I received an error from the erlang compiler: &#8220;Warning: this clause cannot match because a previous clause at line 387 always matches&#8221; and was staring at the code trying to figure out why the top clause was a &#8216;catch all&#8217;. case Result of {Version, NewId, ConnectionStates, NextProtocol} -&#62; .... #alert{} = Alert -&#62; .... so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=105&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I received an error from the erlang compiler: &#8220;Warning: this clause cannot match because a previous clause at line 387 always matches&#8221; and was staring at the code trying to figure out why the top clause was a &#8216;catch all&#8217;.</p>
<blockquote>
<pre>case Result of
    {Version, NewId, ConnectionStates, NextProtocol} -&gt;
        ....
    #alert{} = Alert -&gt;
        ....</pre>
</blockquote>
<p>so #alert has 3 fields so is always matched by the 4 field tuple. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=105&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2011/11/13/erlang-danger-of-mixing-records-and-tuples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>
	</item>
		<item>
		<title>Compiler CPS Transformations</title>
		<link>http://inthehutt.wordpress.com/2011/09/03/compiler-cps-transformations/</link>
		<comments>http://inthehutt.wordpress.com/2011/09/03/compiler-cps-transformations/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 21:24:08 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://inthehut.org/?p=98</guid>
		<description><![CDATA[It looks like people are now writing compilers to deal with node js spaghetti callback code. These are available for C#, Javascript (useable with nodejs) and Scala. C# 5.0 C# 5.0 will have await/async keywords http://msmvps.com/blogs/jon_skeet/archive/2011/05/08/eduasync-part-1-introduction.aspx you can write non-blocking http handler like: public async void get(Request request, Response response) { var json = await [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=98&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It looks like people are now writing compilers to deal with node js spaghetti callback code. These are available for C#, Javascript (useable with nodejs) and Scala.</p>
<h2>C# 5.0</h2>
<p>C# 5.0 will have await/async keywords</p>
<p>http://msmvps.com/blogs/jon_skeet/archive/2011/05/08/eduasync-part-1-introduction.aspx</p>
<p>you can write non-blocking http handler like:</p>
<pre>public async void get(Request request, Response response) {
  var json = await Redis.get(request.getParam("id"));
  await response.write(json);
}</pre>
<p>Redis#get and Reponse#write are both async methods</p>
<p>if you need to do parallel handling:</p>
<pre>public async void get(Request request, Response response) {
  var json1Task = Redis.get(request.getParam("id"));
  var json2Task = Redis.get(request.getParam("id"));

  await response.write(await json1Task + await json2Task);
}</pre>
<h2>Scala</h2>
<p>Scala has continuations using the shift/reset keywords which seems to be much harder to grock than await/async.</p>
<p>http://www.scala-lang.org/node/2096</p>
<p>However, if you wrote a proper non-blocking library you would probably never use shift/reset in client code. it would all be in the library. if you have a shift which is not nested in a reset then the method becomes CPS and if you have a method that calls a CPS method it becomes CPS as well. it spreads a bit like a virus infecting everything it touches. so it is mostly transparent.</p>
<p>you can write non-blocking http handler like:</p>
<pre>def get (request: Request, response: Response) = {
  val json = Redis.get(request.getParam("id"))
  response.write(json)
}</pre>
<p>#get, Redis#get and Reponse#write are all CPS.</p>
<p>if you need to do parallel handling then:</p>
<pre>def get (request: Request, response: Response) = {
  val json1Future = Redis.getAsync(request.getParam("id1"))
  val json2Future = Redis.getAsync(request.getParam("id2"))

  response.write(json1Future.await, json2Future.await)
}</pre>
<p>here Future#await, #get and Response#write are CPS. Redis#getAsync is a normal method that returns a Future that has a CPS await method.</p>
<p>the main difference between c# and scala is in c# the caller is able to choose whether they want to (appear to) block on an async method while in scala the callee has to expose a blocking and a non-blocking version of the method. It appears to be possible to create a function that convert a CPS blocking method to a method that returns a Future. I have some code that does it for 1/arity methods. https://gist.github.com/1191571 I suspect that there is a much simpler way of doing it but I don&#8217;t understand scala continuations enough to work it out <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Javascript</h2>
<p>For javascript there are many options</p>
<p>Streamline JS (https://github.com/Sage/streamlinejs) has been written specifically for nodejs.</p>
<p>You can write a non-blocking http handler like so:</p>
<pre>function get(request, response, _) {
  var json = Redis.get(request.getParam("id"), _);
  response.write(json, _);
}</pre>
<p>which compiles to:</p>
<pre>function get(request, response, _) {
  var json;
  var __frame = {
    name: "get",
    line: 1
  };
  return __func(_, this, arguments, get, 2, __frame, function __$get() {
    return Redis.get(request.getParam("id"), __cb(_, __frame, 1, 13, function ___(__0, __1) {
      json = __1;
      return response.write(json, __cb(_, __frame, 2, 2, _));
    }));
  });
};</pre>
<p>There is also TameJS which doesn&#8217;t have magical error handling:</p>
<p>https://github.com/maxtaco/tamejs</p>
<p>You can write a non-blocking http handler like so:<br />
<code></code></p>
<pre>function get(request, response) {
  await {Redis.get(request.getParam("id"), defer(var err, var json))};
  // error handling cut out
  await {response.write(json, defer(var err))};
  // error handling cut out
}</pre>
<p>There is also:<br />
Narrative JS (http://www.neilmix.com/narrativejs/doc/example.html)<br />
Stratify JS (http://onilabs.com/stratifiedjs)</p>
<p>and there was an attempt to get a defer keyword added to coffee script</p>
<p>https://github.com/jashkenas/coffee-script/issues/350</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=98&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2011/09/03/compiler-cps-transformations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>
	</item>
		<item>
		<title>My First Firefox Addon</title>
		<link>http://inthehutt.wordpress.com/2010/11/01/my-first-firefox-addon/</link>
		<comments>http://inthehutt.wordpress.com/2010/11/01/my-first-firefox-addon/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 10:06:22 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://inthehut.org/?p=93</guid>
		<description><![CDATA[Javascript Deminifier Sometimes I want to debug some javascript in firebug but it is minified which makes it really hard to put breakpoints in because all the code is on the same line. This plugin deminifies javascript as it is downloaded. However, it does rely on the javascript being served with the proper mime type. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=93&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="https://addons.mozilla.org/en-US/firefox/addon/247565/">Javascript Deminifier</a></p>
<p>Sometimes I want to debug some javascript in firebug but it is minified which makes it really hard to put breakpoints in because all the code is on the same line. This plugin deminifies javascript as it is downloaded. However, it does rely on the javascript being served with the proper mime type. There are some functions in firefox that let you access the pretty printed version of javascript functions and another plugin <a href="https://addons.mozilla.org/en-US/firefox/addon/10345/">javascript deobfuscator</a> uses this. But you can&#8217;t see the deobfuscated code in firebug. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=93&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2010/11/01/my-first-firefox-addon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>
	</item>
		<item>
		<title>Socialist Alliance?</title>
		<link>http://inthehutt.wordpress.com/2010/08/21/socialist-alliance/</link>
		<comments>http://inthehutt.wordpress.com/2010/08/21/socialist-alliance/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 00:24:36 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://inthehut.org/?p=90</guid>
		<description><![CDATA[Trog&#8217;s vote-a-matic recommends I vote Socialist Alliance in the Australian election. Unfortunately, for the Socialist Alliance the vote-a-matic is slightly rigged. The vote-a-matic identifies each party as either supporting, opposing or being neutral towards a statement. If your response matches the parties response and is not neutral then this counts as a tick for that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=90&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Trog&#8217;s <a href="http://trog.qgl.org/voteomatic/">vote-a-matic</a> recommends I vote Socialist Alliance in the Australian election. Unfortunately, for the Socialist Alliance the vote-a-matic is slightly rigged. The vote-a-matic identifies each party as either supporting, opposing or being neutral towards a statement. If your response matches the parties response and is not neutral then this counts as a tick for that party. The party with the most ticks is the recommended party. However, this is biased towards the Socialist Alliance and the Greens because they have the <a href="https://spreadsheets.google.com/lv?key=0AgwGFHFd0TUIdExCbkNZWllUaVRsRG9yZXVVTXhUN0E&amp;hl=en&amp;authkey=CJu2lp8P">lowest number of neutral responses</a> (19/26) compared to the highest from the Australian Sex Party (67). Oppose or Support <a href="http://misc.thefullwiki.org/Dominance_(game_theory)">weakly dominates </a>the neutral response. If you chose neutral you could always do the same or better by choosing oppose or supports. So a party that has a lot of Oppose/Support responses is most likely to come out on top.</p>
<table>
<tbody>
<tr>
<td></td>
<td>Oppose</td>
<td>Support</td>
<td>Neutral</td>
</tr>
<tr>
<td>Oppose</td>
<td>+1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Support</td>
<td>0</td>
<td>+1</td>
<td>0</td>
</tr>
<tr>
<td>Neutral</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>That row of zeroes for neutral is not where you want to be <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=90&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2010/08/21/socialist-alliance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>
	</item>
		<item>
		<title>Self Checkouts</title>
		<link>http://inthehutt.wordpress.com/2010/08/20/self-checkouts/</link>
		<comments>http://inthehutt.wordpress.com/2010/08/20/self-checkouts/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 22:50:49 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://inthehutt.wordpress.com/2010/08/20/self-checkouts/</guid>
		<description><![CDATA[Self checkouts = optimal form of retail price discrimination. Surely, you can shave 5% by being dishonest. My future prediction: stores abandon loyalty cards when they realise self checkout performs the same function. Edit: forgot to add my rant about how 90% of the time I have to pack my own bags in the uk [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=87&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Self checkouts = optimal form of retail price discrimination. Surely, you can shave 5% by being dishonest. My future prediction: stores abandon loyalty cards when they realise self checkout performs the same function.</p>
<p>Edit: forgot to add my rant about how 90% of the time I have to pack my own bags in the uk compared to never in aus. Thank god for Australian checkout chicks ^w workers.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=87&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2010/08/20/self-checkouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>
	</item>
		<item>
		<title>Ansi QrCodes in Ruby</title>
		<link>http://inthehutt.wordpress.com/2010/06/23/ansi-qrcodes-in-ruby/</link>
		<comments>http://inthehutt.wordpress.com/2010/06/23/ansi-qrcodes-in-ruby/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 14:28:36 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://inthehut.org/?p=80</guid>
		<description><![CDATA[Linux lets you change the foreground and background colors of the terminal. You can use this to create QR codes. #!/usr/bin/ruby -w require 'rubygems' require 'rqrcode' margin = 1 qr = RQRCode::QRCode.new(ARGV[0], :size =&#62; 4, :level =&#62; :h ) res = "" size = qr.modules.size + margin * 2 white = "33[5;37;47m " black = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=80&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Linux lets you change the foreground and background colors of the terminal. You can use this to create QR codes.</p>
<pre>#!/usr/bin/ruby -w
require 'rubygems'
require 'rqrcode'

margin = 1
qr = RQRCode::QRCode.new(ARGV[0], :size =&gt; 4, :level =&gt; :h )
res = ""

size = qr.modules.size + margin * 2
white = "33[5;37;47m  "
black = "33[0;34;40m  "
size.times do |x|
  size.times do |y|
    if x &lt; margin || y &lt; margin || x &gt;= size - margin || y &gt;= size - margin
      res += white
    elsif qr.is_dark(x - margin,y - margin)
      res += black
    else
      res += white
    end
  end
  res += "33[0m\n"
end
puts res

<a href="http://inthehutt.files.wordpress.com/2010/06/ansi_qrcode.png"><img class="alignnone size-full wp-image-83" title="ansi_qrcode" src="http://inthehutt.files.wordpress.com/2010/06/ansi_qrcode.png?w=450&#038;h=410" alt="" width="450" height="410" /></a>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=80&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2010/06/23/ansi-qrcodes-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>

		<media:content url="http://inthehutt.files.wordpress.com/2010/06/ansi_qrcode.png" medium="image">
			<media:title type="html">ansi_qrcode</media:title>
		</media:content>
	</item>
		<item>
		<title>Google maps rant</title>
		<link>http://inthehutt.wordpress.com/2010/06/17/google-maps-rant/</link>
		<comments>http://inthehutt.wordpress.com/2010/06/17/google-maps-rant/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 00:23:23 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://inthehutt.wordpress.com/2010/06/17/google-maps-rant/</guid>
		<description><![CDATA[I would prefer to know where I need to go rather than where I&#8217;m going<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=79&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I would prefer to know where I need to go rather than where I&#8217;m going</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=79&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2010/06/17/google-maps-rant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>
	</item>
		<item>
		<title>Life is rigged</title>
		<link>http://inthehutt.wordpress.com/2010/06/16/life-is-rigged/</link>
		<comments>http://inthehutt.wordpress.com/2010/06/16/life-is-rigged/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 23:39:56 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://inthehutt.wordpress.com/2010/06/16/life-is-rigged/</guid>
		<description><![CDATA[Why does google maps keep giving me us addresses. Eughhhhhhh!! Waterloo, uk should give me a uk address.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=78&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Why does google maps keep giving me us addresses. Eughhhhhhh!! Waterloo, uk should give me a uk address.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=78&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2010/06/16/life-is-rigged/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>
	</item>
		<item>
		<title>No Escaping Retributivist Reasoning</title>
		<link>http://inthehutt.wordpress.com/2010/06/13/no-escaping-retributivist-reasoning/</link>
		<comments>http://inthehutt.wordpress.com/2010/06/13/no-escaping-retributivist-reasoning/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 13:55:31 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://inthehut.org/?p=74</guid>
		<description><![CDATA[Quote from my new favourite law paper discussing ideas I raised in death penalty conspiracies and lotteries: But, retributivists claim, whether or not this is a good idea does not depend on the balance of costs and benefits. It is simply wrong to kill someone for double parking. A related problem is that of punishing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=74&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Quote from my new favourite law paper discussing ideas I raised in <a href="http://inthehut.org/2010/05/13/death-penalty-conspiracies-and-lotteries/">death penalty conspiracies and lotteries</a>:</p>
<blockquote><p>But, retributivists claim, whether or not this is a good idea does not depend on the balance of costs and benefits. It is simply wrong to kill someone for double parking. A related problem is that of punishing the innocent. It is possible that, under certain circumstances, falsely convicting an innocent person would have a salutary deterrent effect, enough to justify that person’s suffering, etc. Critics also note that, so far as deterrence is concerned, it is the threat of punishment that is justified and not the punishment itself. <strong>Thus, consequentialism might justify letting murderers and rapists off the hook so long as their punishment could be convincingly faked</strong>.</p>
<p>The standard consequentialist response to these charges is that such concerns have no place in the real world. They<br />
say, for example, that the idea of imposing the death penalty for parking violations to make society an overall happier place is absurd. People everywhere would live in mortal fear of bureaucratic errors, and so on. <strong>Likewise, a legal system that deliberately convicted innocent people and/or secretly refrained from punishing guilty ones would require a kind of systematic deception that would lead inevitably to corruption and that could never survive in a free society</strong>.</p></blockquote>
<p>Retributivist intituions are so strong that consequentialists have to make arguments as to why better social equilibriums are not possible. If we could have convincing fake punishment the world would be better off. However, unfortunately it is probably not possible.</p>
<p>And who would have thought Jesus or Buddah would have such a good  understanding of neurobiology and determinism:</p>
<blockquote><p>Intuitively, we want to punish those people who truly deserve it, but whenever the causes of someone’s bad behaviour are made sufficiently vivid, we no longer see that person as truly deserving of punishment. This insight is expressed by the old French proverb: ‘to know all is to forgive all’. It is also expressed in the teachings of religious figures, such as Jesus and Buddha, who preach a message of universal compassion.</p></blockquote>
<p>There is something beautiful about universal compassion and forgiveness being tied to materialistic determinism.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=74&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2010/06/13/no-escaping-retributivist-reasoning/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>
	</item>
		<item>
		<title>Lessons Learned</title>
		<link>http://inthehutt.wordpress.com/2010/05/14/lessons-learned/</link>
		<comments>http://inthehutt.wordpress.com/2010/05/14/lessons-learned/#comments</comments>
		<pubDate>Fri, 14 May 2010 00:49:40 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://inthehut.org/?p=67</guid>
		<description><![CDATA[* checking the station signs is cheap compared to getting stuck in new eltham * there is a plant similar to lantana in england and i&#8217;m now very itchy * there is a road block around new eltham staffed by around 6 females. they charge 50p for passing. 50p is a fair price for passing.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=67&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>* checking the station signs is cheap compared to getting stuck in new eltham</p>
<p>* there is a plant similar to <a href="http://en.wikipedia.org/wiki/Lantana">lantana </a> in england and i&#8217;m now very itchy</p>
<p>* there is a road block around new eltham staffed by around 6 females. they charge 50p for passing. 50p is a fair price for passing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/inthehutt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/inthehutt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/inthehutt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/inthehutt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/inthehutt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/inthehutt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/inthehutt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/inthehutt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/inthehutt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/inthehutt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/inthehutt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/inthehutt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/inthehutt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/inthehutt.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=inthehutt.wordpress.com&amp;blog=9381683&amp;post=67&amp;subd=inthehutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://inthehutt.wordpress.com/2010/05/14/lessons-learned/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d586b2a89d2bafb77504ddea33b03fb9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ben</media:title>
		</media:content>
	</item>
	</channel>
</rss>
