<?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>Heisenbug</title>
	<atom:link href="http://jenf.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jenf.wordpress.com</link>
	<description>Jenf's blog</description>
	<lastBuildDate>Mon, 23 May 2011 19:43:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jenf.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Heisenbug</title>
		<link>http://jenf.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jenf.wordpress.com/osd.xml" title="Heisenbug" />
	<atom:link rel='hub' href='http://jenf.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Hexinspector : Faster memcmp and memdiff</title>
		<link>http://jenf.wordpress.com/2011/05/23/hexinspector-faster-memcmp-and-memdiff/</link>
		<comments>http://jenf.wordpress.com/2011/05/23/hexinspector-faster-memcmp-and-memdiff/#comments</comments>
		<pubDate>Mon, 23 May 2011 19:43:19 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=326</guid>
		<description><![CDATA[When focusing on the performance of hexinspector, I realised that one of the performance bottlenecks was probably the loading single bytes individually and comparing them, instead of working a word at a time. For performance reasons the C versions of memcmp in glibc performes based on word at a time, although usually the assembly based [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=326&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When focusing on the performance of hexinspector, I realised that one of the performance bottlenecks was probably the loading single bytes individually and comparing them, instead of working a word at a time.</p>
<p>For performance reasons the C versions of memcmp in <a href="http://repo.or.cz/w/glibc.git/blob/master:/string/memcmp.c">glibc</a> performes based on word at a time, although usually the assembly based versions are used.</p>
<p>Complicating matters is the <a href="http://en.wikipedia.org/wiki/Data_structure_alignment">inability</a> of some architectures to fetch words non-aligned with the platform word size. In glibc when both pointers are not word aligned, this is overcome by aligning one of the pointers to word aligned and shifting the other pointer data (see memcmp_not_common_alignment).</p>
<p>As hexinspector is currently/unfortunatly aimed at x86 architectures which supports fetching words non-aligned, it is not a high priority of mine to implement the non-aligned version.</p>
<p>By moving from byte based to word based (see commit id <a href="https://github.com/jenf/hexinspector/commit/b0049cc3363fb8de88fd5f26debf9701633d2e87">b0049cc3363fb8de88fd5f26debf9701633d2e87</a>), the simple diff algorithm performance improved from 600mb/sec to 800mb/sec (when running on an 2 core Intel and the files are both in the cache).</p>
<p><strong>Word-based finding two bytes the same</strong></p>
<p>We realised that the while loop while the data is different could be implemented word-based instead of byte-based by using the Zero in Word technique discussed in <a href="http://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord">Bit hacks by Sean Eron Anderson</a>, which is a document well worth a read for any programmer.</p>
<p>The commit <a href="https://github.com/jenf/hexinspector/commit/bb6c8298b95bd5650794c1790fc17e4751df358d">bb6c8298b95bd5650794c1790fc17e4751df358d</a> implements this, basically as below</p>
<p><code><br />
value = (*srcword) ^ (*dstptr);<br />
if (((value - 0x01010101UL) &amp; (~value) &amp; 0x80808080UL) != 0) printf("Different");<br />
</code></p>
<p>Using this the performance of the finding two bytes the same increased on a dual core from 600mb/sec to 800mb/sec effectively the same as the compare performance.</p>
<p>One problem I noted, was that adding more CPU&#8217;s to the diff algorithm when the file was not in cache slowed it down. Question is, what&#8217;s the optimal way to access the same file using two or more cores?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=326&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2011/05/23/hexinspector-faster-memcmp-and-memdiff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>
	</item>
		<item>
		<title>Hexinspector</title>
		<link>http://jenf.wordpress.com/2011/05/18/hexinspector/</link>
		<comments>http://jenf.wordpress.com/2011/05/18/hexinspector/#comments</comments>
		<pubDate>Wed, 18 May 2011 17:31:03 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[hexinspector]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=322</guid>
		<description><![CDATA[Since I haven&#8217;t really written about hexinspector before, I thought I would. It started off as a project because I got tired of looking at binary diffs using hexdump and vimdiff. At the time people at work (EchoStar Europe) said a binary diff utility was impossible to do perfectly. While it is true that there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=322&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Since I haven&#8217;t really written about hexinspector before, I thought I would.</p>
<p>It started off as a project because I got tired of looking at binary diffs using hexdump and vimdiff. At the time people at work (EchoStar Europe) said a binary diff utility was impossible to do perfectly. While it is true that there is no accurate way of doing a binary diff 100% of the time, there are enough heuristics to make it a worthwhile tool, and hexinspector was born.</p>
<p>The &#8216;smart&#8217; mode is basically the following algorithm (which is used as default)</p>
<p>1) Go through the file until you find a difference<br />
2) When there are differences, try to slide a window of 16 bytes trying to find a match in the second file.<br />
3) When that fails, try to use the <a href="http://en.wikipedia.org/wiki/Rabin-Karp_string_search_algorithm" title="Rabin Karp algorithm">Rabin-Karp algorithm</a> (based on hashes fixed length bytes to find them)</p>
<p>Unfortunatly that algorithm isn&#8217;t perfect and isn&#8217;t that high performance, but it&#8217;s usually okay, and was for the primary dataset I was looking at at the time (mainly MPEG-2 transport streams)</p>
<p>I&#8217;m looking at improving it, both in terms of performance and accuracy.</p>
<p>As well as the &#8216;smart&#8217; mode there is the &#8216;simple&#8217; mode which doesn&#8217;t try to realign the data, and just calculates if it is equal or not.</p>
<p>For it&#8217;s warts it has become a useful tool at work, and is one of the better binary diff tools available (and probably the best one available on linux)</p>
<p>Anyway, hexinspector is available for <a href="https://github.com/jenf/hexinspector">download</a> and is licensed under the GPL.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/322/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=322&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2011/05/18/hexinspector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>
	</item>
		<item>
		<title>Restart of the blog</title>
		<link>http://jenf.wordpress.com/2011/05/18/restart-of-the-blog/</link>
		<comments>http://jenf.wordpress.com/2011/05/18/restart-of-the-blog/#comments</comments>
		<pubDate>Wed, 18 May 2011 17:15:18 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=292</guid>
		<description><![CDATA[For years this blog has effectively been dead, i&#8217;ve gone through some of the old blog posts deleting the chaff. And am intended it to be reborn as a programming blog, mainly aimed at things like performance, multicore support and things I find out.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=292&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For years this blog has effectively been dead, i&#8217;ve gone through some of the old blog posts deleting the chaff. And am intended it to be reborn as a programming blog, mainly aimed at things like performance, multicore support and things I find out.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/292/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=292&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2011/05/18/restart-of-the-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>
	</item>
		<item>
		<title>Directory of Chess Openings</title>
		<link>http://jenf.wordpress.com/2009/09/21/directory-of-chess-openings/</link>
		<comments>http://jenf.wordpress.com/2009/09/21/directory-of-chess-openings/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 19:50:57 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=213</guid>
		<description><![CDATA[I&#8217;ve been trying to learn some chess openings, couldn&#8217;t keep them in my head, so I created a mindmap of them all. I find most of the websites about openings unusable as a teaching aid, so much so I sometimes think about writing something myself.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=213&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to learn some chess openings, couldn&#8217;t keep them in my head, so I created a mindmap of them all. I find most of the websites about openings unusable as a teaching aid, so much so I sometimes think about writing something myself.</p>
<p><img class="alignnone size-medium wp-image-216" title="Chess Openings" src="http://jenf.files.wordpress.com/2009/06/chess-openings1.png?w=300&#038;h=290" alt="Chess Openings" width="300" height="290" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=213&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2009/09/21/directory-of-chess-openings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>

		<media:content url="http://jenf.files.wordpress.com/2009/06/chess-openings1.png?w=300" medium="image">
			<media:title type="html">Chess Openings</media:title>
		</media:content>
	</item>
		<item>
		<title>Moving room to room</title>
		<link>http://jenf.wordpress.com/2009/04/27/moving-room-to-room/</link>
		<comments>http://jenf.wordpress.com/2009/04/27/moving-room-to-room/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 21:38:52 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[Backpack]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=208</guid>
		<description><![CDATA[It&#8217;s taken a little while, as I&#8217;ve been distracted with other things, but backpack now has the ability to move room to room. I think it needs another refactor in it&#8217;s core as the system is becoming unwieldly. At the moment the main system is linked together with the following three classes ObjectManager : Looks after all the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=208&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s taken a little while, as I&#8217;ve been distracted with other things, but backpack now has the ability to move room to room.</p>
<p>I think it needs another refactor in it&#8217;s core as the system is becoming unwieldly. At the moment the main system is linked together with the following three classes</p>
<ul>
<li>ObjectManager : Looks after all the objects</li>
<li>World : Looks after the world view</li>
<li>DSLParser : Looks after the DSL parsing</li>
</ul>
<p>The three of these are tided together using masses of method_missing calls.</p>
<p>There&#8217;s also the problem where functions with similar names do widely differeing things</p>
<p>I&#8217;m not sure how best to rejig it. There is also the problem of inheritance in the CoreObjects, I&#8217;m not sure the best way to model it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=208&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2009/04/27/moving-room-to-room/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>
	</item>
		<item>
		<title>How the object based parser works.</title>
		<link>http://jenf.wordpress.com/2009/04/15/how-the-object-based-parser-works/</link>
		<comments>http://jenf.wordpress.com/2009/04/15/how-the-object-based-parser-works/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 22:09:43 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[Backpack]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=196</guid>
		<description><![CDATA[The object based parser is now pretty robust in terms of functionality, it needs more work in terms of error handling. The following is an example of how to declare the verb &#8216;help&#8217; and connect it to the help function in ruby, simple enough. And for strings with an object attached: It currently doesn&#8217;t support [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=196&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The object based parser is now pretty robust in terms of functionality, it needs more work in terms of error handling.<br />
The following is an example of how to declare the verb &#8216;help&#8217; and connect it to the help function in ruby, simple enough.</p>
<p><pre class="brush: ruby;">
module Backpack
  class SystemObject
    include Parser
    verb &quot;help&quot;, :help
    def help
     puts &quot;You need it&quot;
    end
  end
end
</pre></p>
<p>And for strings with an object attached:</p>
<p><pre class="brush: ruby;">
  class Item &lt; BackpackObject
    verb &quot;examine&quot;, primarynoun, :examine
    def examine
      puts self.inspect
    end

    verb &quot;put&quot;, noun, [&quot;into&quot;,&quot;in&quot;,&quot;inside&quot;,&quot;through&quot;], primarynoun,:insert
    def insert(x)
      puts &quot;insert %s&quot; % x
    end
 end
</pre></p>
<p>It currently doesn&#8217;t support multiobjects, but that&#8217;s not to difficult to add. Unfortunately it has caused a slight rethink in how exits in Backpack are handled, and is causing a slight rewrite (as well as a tidy up).</p>
<p>The system also exposed an area of ruby which I wasn&#8217;t sure of before, inheritance and metafunctionality that is created when the class is loaded, the verb function adds a class variable and this is not visible to the child, this then has to be put back together when the verb is being parsed.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=196&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2009/04/15/how-the-object-based-parser-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>
	</item>
		<item>
		<title>Breaking the Tradition of IF</title>
		<link>http://jenf.wordpress.com/2009/04/13/breaking-the-tradition-of-if/</link>
		<comments>http://jenf.wordpress.com/2009/04/13/breaking-the-tradition-of-if/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 21:56:44 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[Backpack]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=189</guid>
		<description><![CDATA[I find most IF games very infuriating, and is likely why the genre died out in the commercial world. Why spend your afternoon trying to phrase things properly when you can blow up aliens. Three Things annoy me greatly about IF. 1) What direction was I wanting to go in. Why when I want to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=189&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I find most IF games very infuriating, and is likely why the genre died out in the commercial world. Why spend your afternoon trying to phrase things properly when you can blow up aliens.</p>
<p>Three Things annoy me greatly about IF.</p>
<p>1) What direction was I wanting to go in.<br />
Why when I want to go into the Kitchen, do I have to find out what direction the kitchen is in, and then type &#8216;go east&#8217;. In the real world do you think &#8220;Hum, I want a yogurt, I&#8217;ll go to the kitchen, the kitchen is east, therefore I go east&#8221;, you think &#8220;Kitchen&#8221;</p>
<p>The only game where directions are useful seem to be the original Colossal Cave Adventure, and every game since still takes that design as a good one. I&#8217;m tempted to remove directions altogether from the standard setup of adventure backpack.</p>
<p>2) What verb was I looking for?</p>
<p>I needed a parser, so I took inspiration from Inform 6&#8242;s parser, but in my world view, I felt that the verb definitions should be done as part of the object (including inheritance).</p>
<p>Why:<br />
You could ask an object what verbs are available for it (avoiding the what verb problem)<br />
The code for declaring the verb would be in the same place as the code for handling the verb, which is much more maintainable.</p>
<p>3) Conversations in the system are very weakly done.</p>
<p>I&#8217;ve been exploring various IF games recently trying to find the style I like, all but the choosing a conversation number become very fiddly and difficult to know what you are doing. But the drawback of this (called the Lawnmower effect), is you choose responses randomly.</p>
<p>I&#8217;m tempted to take the same approach (as the default), of handling verbs where you can inquire what the person&#8217;s topics are, I know it breaks the fourth wall, but it makes it easier to work with.</p>
<p><strong>Should I be doing this at all?</strong></p>
<p>I&#8217;ve been reading the following, <a href="http://www.wolldingwacht.de/if/files/if-auth-dev-guide.html">The Interactive Fiction Authoring System Developer&#8217;s Guide 0.99</a>, and it quite correctly says that most people trying to create an IF authoring system will be wasting their time, as the current systems are quite versatile.</p>
<p>So why would I bother?</p>
<ul>
<li>It&#8217;s done in a general purpose programming language rather than a specialized one. The number of programmers out there who understand Ruby is probably 1000 times greater than the combined programmers in TADS 2 &amp; 3, Inform 6 &amp; 7. I dislike the idea of creating new languages and having to implement object models where a system is already available. Ruby already has a large amount of logistics behind it, and the mixin ability is rather cruicial.</li>
<li>Since it&#8217;s based on a real-world programming languages, new options are available. You could have a paper in the game when you read it, would fetch the Guardian&#8217;s news stories and include them into the storyline. (Difficult to program realistically, but the option is open)</li>
<li>Multiplayer IF is not well done in existing systems, and MUD systems are not really that expressive, and don&#8217;t have the advanced abilities that IF does.</li>
<li>Graphics IF creation software is ad-hoc and not easy for indie productions. (Adventure Backpack original started out as a graphical IF system, but that was to complex). I intend to extend the system to add graphics (probably AJAX &amp; SVG)</li>
<li>It gives me an excuse to program in Ruby and mess around with DSL&#8217;s.</li>
<li>I find the idea of Natural Language (Inform 7) programming abhorrent, unmaintainable and unartistic. The difficulties with programming are just as difficult with Natural Language programming as Non-Natural Language programming, but you have a new batch of guess the verb problems.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=189&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2009/04/13/breaking-the-tradition-of-if/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>
	</item>
		<item>
		<title>Continuing Adventures of Adventure Backpack</title>
		<link>http://jenf.wordpress.com/2009/04/08/continuing-adventures-of-adventure-backpack/</link>
		<comments>http://jenf.wordpress.com/2009/04/08/continuing-adventures-of-adventure-backpack/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 23:24:59 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[Backpack]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=179</guid>
		<description><![CDATA[I added the inverse path generation (which was a doddle) create a list of directions and their opposite (invert that list) and then loop over the list. I then added the existence of items, I&#8217;m played around with the syntax for creating items, I think my solution of creating the items in the rooms they are in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=179&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I added the inverse path generation (which was a doddle) create a list of directions and their opposite (invert that list) and then loop over the list.</p>
<p>I then added the existence of items, I&#8217;m played around with the syntax for creating items, I think my solution of creating the items in the rooms they are in is quite tidy and implies a lot more structure in the script file than inform does, and follows the DRY idiom (Don&#8217;t repeat yourself). The current code can be found at <a title="GitHub" href="http://github.com/jenf/adventurebackpack/tree/master">http://github.com/jenf/adventurebackpack/tree/master</a></p>
<p><pre class="brush: ruby;">
room :Forest, &quot;Deep in the forest&quot; do
 description &quot;Through the dense foliage, you glimpse a building to the west.&quot;
             &quot;A track heads to the northeast.&quot;
 exit_northeast :Clearing

 item :Bird, &quot;Baby bird&quot; do
  description &quot;Too young to fly, the nestling tweets helplessly.&quot;
  name [&quot;baby&quot;,&quot;bird&quot;,&quot;nestling&quot;]
 end
end
</pre></p>
<p> </p>
<p><pre class="brush: ruby;">
Object  forest &quot;Deep in the forest&quot;
  with  description
            &quot;Through the dense foliage, you glimpse a building to the west.
             A track heads to the northeast.&quot;,
        w_to before_cottage,
        ne_to clearing,
  has   light;

Object  bird &quot;baby bird&quot; forest
  with  description &quot;Too young to fly, the nestling tweets helplessly.&quot;,
        name 'baby' 'bird' 'nestling',
  has   ;
</pre></p>
<p>The biggest challenge to the system now has to be the natural language parsing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=179&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2009/04/08/continuing-adventures-of-adventure-backpack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>
	</item>
		<item>
		<title>Pet Project: Adventure Backpack</title>
		<link>http://jenf.wordpress.com/2009/04/08/pet-project-adventure-backpack/</link>
		<comments>http://jenf.wordpress.com/2009/04/08/pet-project-adventure-backpack/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 00:06:17 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[Backpack]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=172</guid>
		<description><![CDATA[A while ago, I tried making a Ruby based graphical adventure system. As usual I bit more than I could chew. So I&#8217;ve decided to go back and try making a text-based system first to explore things, and maybe taking the ideas into a second version of the system. (Alternatively making a system that&#8217;d fit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=172&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A while ago, I tried making a Ruby based graphical adventure system. As usual I bit more than I could chew. So I&#8217;ve decided to go back and try making a text-based system first to explore things, and maybe taking the ideas into a second version of the system. (Alternatively making a system that&#8217;d fit both text and graphical adventure games)</p>
<p>I&#8217;ve decided to make it as a DSL (Domain Specific Language), after getting my ruby programming back from the rusty part of my brain I managed to do quite a bit for 3 hours work. At the moment it allows you to move from room to room. The following is based on the Heidi example by Roger Firth and Sonja Kesserich</p>
<p><pre class="brush: ruby;">
room :BeforeForest do
 description &quot;You stand outside a cottage. The forest stretches east.&quot;
 short_description &quot;In front of a cottage&quot;
 exit_east :Forest
end

room :Forest do
 description &quot;Through the dense foliage, you glimpse a building to the west.&quot;
             &quot;A track heads to the northeast.&quot;
 short_description &quot;Deep in the forest&quot;
 exit_west :BeforeForest
 exit_north_east :Clearing
end

room :Clearing do
 short_description &quot;A forest clearing&quot;
 description &quot;A tall sycamore stands in the middle of this clearing.&quot;
             &quot;The path winds southwest through the trees.&quot;
 exit_up :TopOfTree
end

room :TopOfTree do
 short_description &quot;At the top of the tree&quot;
 description &quot;You cling precariously to the trunk&quot;
 exit_down :Clearing
end

start_room :BeforeForest
</pre></p>
<p>My next steps are</p>
<ul>
<li>Automatically generate the inverse paths</li>
<li>Add actions (like on_entry)</li>
<li>Add objects</li>
<li>Add Natural language parsing (at the moment I can only say east up down)</li>
<li>Add NPC communcation</li>
<li>I need a better name.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=172&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2009/04/08/pet-project-adventure-backpack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>
	</item>
		<item>
		<title>Crumupant</title>
		<link>http://jenf.wordpress.com/2009/01/29/crumupant/</link>
		<comments>http://jenf.wordpress.com/2009/01/29/crumupant/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 23:17:31 +0000</pubDate>
		<dc:creator>jenf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jenf.wordpress.com/?p=165</guid>
		<description><![CDATA[The realisation that the crumpets are burning. (Google doesn&#8217;t know about it)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=165&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The realisation that the crumpets are burning.</p>
<p>(Google doesn&#8217;t know about it)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jenf.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jenf.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jenf.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jenf.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jenf.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jenf.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jenf.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jenf.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jenf.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jenf.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jenf.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jenf.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jenf.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jenf.wordpress.com/165/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jenf.wordpress.com&amp;blog=941484&amp;post=165&amp;subd=jenf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jenf.wordpress.com/2009/01/29/crumupant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ef344f5effeeb077dd226b75f42e03d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jenf</media:title>
		</media:content>
	</item>
	</channel>
</rss>
