<?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>Blazing Bytes</title>
	<atom:link href="http://geekrelief.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://geekrelief.wordpress.com</link>
	<description>Programming and bits of code</description>
	<lastBuildDate>Fri, 26 Jun 2009 23:40:51 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='geekrelief.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/765fdcd30ea7216403d3b5fc2849963c?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Blazing Bytes</title>
		<link>http://geekrelief.wordpress.com</link>
	</image>
			<item>
		<title>StGit &#8211; Stacked Git tutorial for managing patches</title>
		<link>http://geekrelief.wordpress.com/2009/06/26/stgit-stacked-git-tutorial-for-managing-patches/</link>
		<comments>http://geekrelief.wordpress.com/2009/06/26/stgit-stacked-git-tutorial-for-managing-patches/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 23:33:02 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git patches]]></category>
		<category><![CDATA[private config files]]></category>
		<category><![CDATA[Stacked Git]]></category>
		<category><![CDATA[stg]]></category>
		<category><![CDATA[StGit]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=67</guid>
		<description><![CDATA[I&#8217;ve been using git for the past several months hacking away on a new project by myself for the most part, but a couple days ago I decided to branch to maintain a production, test, and dev version of the code base not to mention versions for different platforms.  It reminded me of how [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=67&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been using git for the past several months hacking away on a new project by myself for the most part, but a couple days ago I decided to branch to maintain a production, test, and dev version of the code base not to mention versions for different platforms.  It reminded me of how at my old job everyone had their config settings in the same file, but they were using subversion.</p>
<p>It always seemed like an error prone way to maintain everyone&#8217;s settings.  If someone inadvertently updated the file and you pulled the latest changes, you&#8217;d have to update your settings or hide them, and pulling changes was a hassle.</p>
<p>So I was thinking about how to keep configuration file changes private in different branches of my project.  Luckily Yaakov Nemoy had already written a piece on it. <a href="http://loupgaroublond.blogspot.com/2008/09/keeping-private-config-files-private-in.html">Keeping Private config files Private in Git</a></p>
<p>Awesome.  I wasn&#8217;t really familiar with git rebase, so the tutorial was a concrete example of how to use rebase compared to the man page.</p>
<p>But the after going through it, with my own project, I have to echo the sentiment in the comment by Peter Zei.  So I decided to checkout <a href="http://procode.org/stgit/">Stacked Git</a> which is pretty cool!</p>
<p>So below is a workflow on how to use Stacked Git, stg, to manage changes between your branches.  You should already be familiar with git commands before diving in since some of the stg commands have the same names but different behavior than the git commands.  </p>
<h1>Tutorial</h1>
<pre>
mkdir stg
cd stg
git init
vi README  # insert "init"
git add README
git commit -m "init"

# We've intialized the repo, now let's add our config file.
vi config # insert 'production'
git add config
git commit -m 

# Now let's branch for a development version
stg branch -c dev
# equivalent to : git checkout -b dev ; stg init
# we need to initialize every git branch for use with stg

# Let's create a new patch
stg new conf  # enter message: dev config settings
stg series # shows us our uncommitted patches
# Now modify the config file
vi config # replace production with development
stg status # shows that we modified config
stg refresh # updates our patch
stg show # shows our changes

# Now let's create a new patch, add a file to it and get it back
# into master without sending along our config changes.
stg new add_code  # message: adding some code
vi Main.as # some code
stg add Main.as # or: git add Main.as
stg refresh # this completes our patch
stg series
# this shows our two applied patches
+ conf
&gt; add_code
# Before committing we want to pop our conf patch
stg pop conf
stg commit # this turns our add_code stg patch back into a git patch and commits
stg push # pushes conf back on the stg stack

# We'll switch back to our master branch and merge the dev changes
stg branch master
git merge dev
git log -1 # shows the new patch
</pre>
<p>
And there you go.  Managing your config files is just a matter of popping and pushing a patch with Stacked Git.  If you forget to pop before committing you can run an uncommit for the patches through conf, pop conf, and commit.<br />
</p>
<pre>
stg series
# blank from previous commit
git log # shows conf changes are 3 patches away
stg uncommit -n 3
stg series
# returns
+ dev-config
+ added-x
&gt; addedY
stg pop dev-config
stg commit
stg push

# Notice that the patch names for conf was changed.  Let's rename it
stg rename dev-config conf
stg series
+ conf
</pre>
<p>Voila!</p>
<p>Here are more links to get you started.<br />
<a href="http://procode.org/stgit/doc/tutorial.html">http://procode.org/stgit/doc/tutorial.html</a><br />
<a href="http://wiki.procode.org/cgi-bin/wiki.cgi/StGIT_Tutorial">http://wiki.procode.org/cgi-bin/wiki.cgi/StGIT_Tutorial</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=67&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2009/06/26/stgit-stacked-git-tutorial-for-managing-patches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
		<item>
		<title>Wacky Pong</title>
		<link>http://geekrelief.wordpress.com/2009/01/19/wacky-haskell/</link>
		<comments>http://geekrelief.wordpress.com/2009/01/19/wacky-haskell/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 07:40:37 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=62</guid>
		<description><![CDATA[I&#8217;ve been working on a flash, real-time, multi-user system with AMQP.  The first app using the system is just pong.  Sounds easy, but I haven&#8217;t see an flash, real-time pong game on the internet yet.  Flash client side, neko for the server with RabbitMQ in the middle for messaging.  
Things have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=62&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been working on a flash, real-time, multi-user system with <a href="http://www.amqp.org">AMQP</a>.  The first app using the system is just pong.  Sounds easy, but I haven&#8217;t see an flash, real-time pong game on the internet yet.  Flash client side, neko for the server with <a href="http://www.rabbitmq.com">RabbitMQ</a> in the middle for messaging.  </p>
<p>Things have been going well so far except for the debugging process.  In general I can make do with the trace statement that <a href="http://www.haxe.com">haXe</a> affords.  It&#8217;s better than nothing, which is what Actionscript 3 would give me without components.  However, debugging the effects of latency and lag compensation has been frustrating.  Too bad I&#8217;m such a newbie with real-time, internet, game programming.  Being forced to use TCP/IP doesn&#8217;t help either. </p>
<p>I was about to give up, call it Wacky Pong, and move on to another app, but it dawned on me that I could write a network simulator to gain insight on what is going wrong with the lag compensation.  And doing so has given me insights on how to better architect the system.  </p>
<p>Another way to gain better insight is to have been debugging tools.  HaXe&#8217;s &#8216;trace&#8217; isn&#8217;t good enough considering how buggy my code is.  So I made a few updates to <a href="http://www.github.com/geekrelief/as3tohaxe/tree/master">as3tohaxe</a> and will start to convert <a href="http://www.aswing.org">AsWing</a> to haXe over the weekends.  Having a robust gui framework will be a boon to haXe, so I hope I can get some help with the conversion and testing.</p>
<p>As much fun as haXe is working on as3tohaxe in haskell is a nice change of pace.  I might get a copy of <a href="http://www.realworldhaskell.org/blog/">Real World Haskell</a> after all.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=62&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2009/01/19/wacky-haskell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
		<item>
		<title>hxamqp: AMQP with haxe!</title>
		<link>http://geekrelief.wordpress.com/2008/12/15/hxamqp-amqp-with-haxe/</link>
		<comments>http://geekrelief.wordpress.com/2008/12/15/hxamqp-amqp-with-haxe/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 20:21:43 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[amqp]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[neko]]></category>
		<category><![CDATA[rabbitmq]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=60</guid>
		<description><![CDATA[It&#8217;s been a while since my last post, but the wait has been worthwhile.  I&#8217;ve been working on converting Ben Hood&#8217;s amqp library for as3 with my converter.  It&#8217;s been an educational experience on a couple of fronts getting more familiar with the issues of conversion from as3 to haxe, AMQP/RabbitMQ, and flash [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=60&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s been a while since my last post, but the wait has been worthwhile.  I&#8217;ve been working on converting <a href="http://github.com/0x6e6562/as3-amqp/tree/master">Ben Hood&#8217;s amqp library for as3</a> with my <a href="http://www.github.com/geekrelief/as3tohaxe">converter</a>.  It&#8217;s been an educational experience on a couple of fronts getting more familiar with the issues of conversion from as3 to haxe, <a href="http://www.amqp.org">AMQP</a>/<a href="http://www.rabbitmq.com">RabbitMQ</a>, and flash vs neko io issues.</p>
<p>The resulting library, <a href="http://www.github.com/geekrelief/hxamqp">hxampq</a>, is up on github with a couple examples to experiment with.</p>
<p>While working on this I ran into issues with trying to map a flash lib to neko.  Flash only has asychronous IO, while <a href="http://www.nekovm.org">Neko</a> is synchronous IO only.  In my examples I create a thread to deal with the socket data and pass messages back and with neko&#8217;s <a href="http://www.haxe.org/api/neko/vm/thread">Thread</a> and <a href="http://www.haxe.org/api/neko/vm/deque">Deque</a> API.</p>
<p>In my tests, I ran into a latency issue with RabbitMQ.  I was trying to send an empty message from a swf, to rabbit, then read that message from a neko server, send a message back to rabbit on another q, and have the swf read it.  The resulting &#8220;roundtrip&#8221; time was measured over thousands of samples.  I was getting terrible times anywhere from 7 to 60ms.  I was running the servers on an Ubuntu VM on my local machine.  Doing a direct connection from a swf to neko and sending bytes back and forth showed times of 3ms.  It turns out that the issue is Linux TCP/IP related.  The <a href="http://en.wikipedia.org/wiki/Nagle%27s_algorithm">Nagle algorithm</a> is buffering these tiny packets.  The issue could probably be solved by sending a lot more data at once.  So after enabling <a href="http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2008-September/002016.html">TCP_NODELAY in RabbitMQ</a> (this should be the default now with 1.5.0 and on the <a href="http://hg.rabbitmq.com/rabbitmq-server/archive/tip.zip">repo</a>), I tried sending data from one swf to another swf over RabbitMQ and got 3ms!  But sending data to neko is still slow around 30+ms.  Looks like I&#8217;ll have to tinker with the neko socket code to <a href="http://articles.techrepublic.com.com/5100-10878_11-1050878.html">enable high performance tcp/ip options</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=60&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2008/12/15/hxamqp-amqp-with-haxe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
		<item>
		<title>as3tohaxe google group</title>
		<link>http://geekrelief.wordpress.com/2008/10/28/as3tohaxe-google-group/</link>
		<comments>http://geekrelief.wordpress.com/2008/10/28/as3tohaxe-google-group/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 19:26:49 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[as3tohaxe]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[haxe]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=54</guid>
		<description><![CDATA[I&#8217;ve created a google group to discuss issues, features of as3tohaxe and the general love of haXe http://groups.google.com/group/as3tohaxe 
Please feel free to join it and let the group know what you&#8217;re converting or running into any issues.  
Thanks.
-Don Q.
Update: I&#8217;ve uploaded Windows and Mac OSX binaries to the files section of the google group.
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=54&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve created a <a href="http://groups.google.com/group/as3tohaxe">google group</a> to discuss issues, features of <a href="http://www.github.com/geekrelief/as3tohaxe">as3tohaxe</a> and the general love of <a href="http://www.haxe.org">haXe</a> <a href="http://groups.google.com/group/as3tohaxe">http://groups.google.com/group/as3tohaxe </a></p>
<p>Please feel free to join it and let the group know what you&#8217;re converting or running into any issues.  </p>
<p>Thanks.<br />
-Don Q.</p>
<p>Update: I&#8217;ve uploaded Windows and Mac OSX binaries to the files section of the google group.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=54&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2008/10/28/as3tohaxe-google-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
		<item>
		<title>Scrap Your BoilerPlate and Data.Generics for the Win!</title>
		<link>http://geekrelief.wordpress.com/2008/10/23/datagenerics-for-the-win/</link>
		<comments>http://geekrelief.wordpress.com/2008/10/23/datagenerics-for-the-win/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 07:03:53 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[as3tohaxe]]></category>
		<category><![CDATA[Data.Generics]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[scrap your boilerplate]]></category>
		<category><![CDATA[SYB]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=48</guid>
		<description><![CDATA[I just updated as3tohaxe with a pretty significant change to allow transforming and querying of the AST.  I was working in the translator code to add the ability to convert variable bindings with Number types a little more intelligently.
I wanted to convert this AS3:

        public function s(s:String [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=48&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just updated <a href="http://www.github.com/geekrelief/as3tohaxe">as3tohaxe</a> with a pretty significant change to allow transforming and querying of the AST.  I was working in the translator code to add the ability to convert variable bindings with Number types a little more intelligently.</p>
<p>I wanted to convert this AS3:</p>
<pre>
        public function s(s:String = "hi", a:Number = -1.0, b:Number = 1):void{
            var c:Number = 0;
            var d:Number = 10.0;
            var o:Dynamic = {};
        }
</pre>
<p>to this <a href="http://www.haxe.org">haXe</a>:</p>
<pre>
        public function s(?s:String = "hi", ?a:Float = -1.0, ?b:Int = 1):Void{
            var c:Int = 0;
            var d:Float = 10.0;
            var o:Dynamic = {};
        }
</pre>
<p>Notice how the Number types are changed to Int or Float depending on the initializer.</p>
<p>So I was about to embark on writing a bunch of tedious, error-prone, boilerplate code to deconstruct the nested and recursive AST nodes.  The idea was to perform tests to get down to the bottom of the expression syntax tree to see if there was a float somewhere.</p>
<p>I wanted the code to look something like this pseudo <a href="http://www.haskell.org">Haskell</a>:</p>
<pre>
hasFloat e =
    case e of
        ACond a -&gt; case a of
        .... more nested cases till we get to
            TokenDouble _ -&gt; True ...
        otherwise -&gt; False
</pre>
<p>But I stopped myself after taking a minute to look at the craziness of the AST just for a simple expression for -1.  </p>
<pre>
ACond (CondE (AEUnary (UEMinus ([(TPos "" 8 63,TokenOp "-")],[]) (UEPrimary (PFFull (FPFPrimary (PELit ([(TPos "" 8 64,TokenNum (TokenDouble "1.0"))],[])) []) Nothing)))) Nothing)))
</pre>
<p>AHHH!</p>
<p>I realized and was hoping someone had dealt with this problem before and found a better way.  So I started searching and landed on JP Moresmau&#8217;s blog where he talked about issues with <a href="http://jpmoresmau.blogspot.com/2008/01/nested-records-headaches-in-haskell.html">nested records</a>.  My problem being nested/recursive constructors seemed to be on a similar boat.  After more googling I came across &#8220;<a href="http://www.cs.vu.nl/boilerplate/">Scrap Your Boilerplate</a>&#8221; which looked like a solution amongst others like polyP and <a href="http://www.cs.uu.nl/research/projects/generic-haskell/">Generic Haskell</a>.  I don&#8217;t know enough about Haskell to make an informed opinion on those, but SYB did the trick.  And after more digging I found <a href="http://jpmoresmau.blogspot.com/2008/01/scraping-my-boilerplate-generics.html">JP had posted</a> about haskell&#8217;s <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Generics.html">Data.Generics</a>.</p>
<p>Now I can write tests like:</p>
<pre>
hasFloat = everything (||) (False `mkQ` isFloat)

isFloat (TokenDouble x) = True
isFloat _ = False
</pre>
<p>which traverses the AST looking for floats.  </p>
<p>I wish this were documented in the haskell tutorials.  <a href="http://www.cs.vu.nl/boilerplate/">SYB</a> is a lifesaver!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=48&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2008/10/23/datagenerics-for-the-win/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
		<item>
		<title>hxflickr now on github</title>
		<link>http://geekrelief.wordpress.com/2008/10/21/hxflickr-now-on-github/</link>
		<comments>http://geekrelief.wordpress.com/2008/10/21/hxflickr-now-on-github/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 17:44:23 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[hxflickr]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=42</guid>
		<description><![CDATA[Previously, I attempted to convert the AsWing project with as3tohaxe and decided instead to go after a smaller code base, the as3flickrlib.  I spent the majority of the time dealing with converting the xml processing which as3tohaxe doesn&#8217;t handle (and I&#8217;m not sure ever will), but the rest of the codebase went through for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=42&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Previously, I attempted to convert the <a href="http://www.aswing.org">AsWing</a> project with <a href="http://www.github.com/geekrelief/as3tohaxe">as3tohaxe</a> and decided instead to go after a smaller code base, the <a href="http://code.google.com/p/as3flickrlib">as3flickrlib</a>.  I spent the majority of the time dealing with converting the xml processing which as3tohaxe doesn&#8217;t handle (and I&#8217;m not sure ever will), but the rest of the codebase went through for the most part without a hitch.  So my conversion efforts are now on <a href="http://www.github.com">github</a>. </p>
<p>I&#8217;ve uploaded Adobe&#8217;s as3flickrlib and an example by Shang Liang converted to <a href="http://www.haxe.org">haXe</a> as <a href="http://www.github.com/geekrelief/hxflickr">hxflickr</a>.  The library hasn&#8217;t been fully tested, but you should be able to have fun with it.  Enjoy!</p>
<p>Next project is the <a href="http://flare.prefuse.org">flare</a> vis kit!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=42&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2008/10/21/hxflickr-now-on-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
		<item>
		<title>Translating AsWing</title>
		<link>http://geekrelief.wordpress.com/2008/10/14/translating-aswing/</link>
		<comments>http://geekrelief.wordpress.com/2008/10/14/translating-aswing/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 02:10:49 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[haxe]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=34</guid>
		<description><![CDATA[Since the last blog post, as3tohaxe converter now has expression parsing, &#8220;as&#8221; converted to &#8220;cast ()&#8221; calls, and a program, as3tohaxe.hs, to run through a directory recursively and convert!   
So I gave the converter the AsWing codebase as its first big test and ran into a couple problems.  
The parser was bombing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=34&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Since the last blog post, <a href="http://www.github.com/geekrelief/as3tohaxe">as3tohaxe converter</a> now has expression parsing, &#8220;as&#8221; converted to &#8220;cast ()&#8221; calls, and a program, as3tohaxe.hs, to run through a directory recursively and convert!   </p>
<p>So I gave the converter the <a href="http://www.aswing.org">AsWing</a> codebase as its first big test and ran into a couple problems.  </p>
<p>The parser was bombing on some unidentifiable characters which turned out to be the <a href="http://en.wikipedia.org/wiki/Byte-order_mark#Representations_of_byte_order_marks_by_encoding">UTF8 header sequence</a> &#8220;\239\187\191&#8243; or EF BB BF in hex.  At first I just tried removing those characters but couldn&#8217;t with vim because the character is &#8220;zero width&#8221;.  So I used a hex editor, 0xED, and the parser ran without issue. So I&#8217;ve updated the lexer to handle the header as whitespace.  </p>
<p>The second problem I came across was one file taking a particularly long time converting.  I think it has to do with one of the statements which has a nested expression.</p>
<p><code>((((((((("GridLayout[hgap=") + hgap) + ",vgap=") + vgap) + ",rows=") + rows) + ",cols=") + cols) + "]");</code></p>
<p>I still need to verify this.</p>
<p>Update: The nested expressions were causing the slowdown.  I removed redundant work being done by the parser and got a huge speedup.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=34&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2008/10/14/translating-aswing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
		<item>
		<title>Back from FlashCamp 2008</title>
		<link>http://geekrelief.wordpress.com/2008/10/13/back-from-flashcamp-2008/</link>
		<comments>http://geekrelief.wordpress.com/2008/10/13/back-from-flashcamp-2008/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 23:13:55 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flashcamp]]></category>
		<category><![CDATA[kitchen sink]]></category>
		<category><![CDATA[yeti]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=32</guid>
		<description><![CDATA[We all had a terrific time at FlashCamp and got to see all the new features of Flash 10 and CS4 in action.  Not only that, we walked away with trial copies, and we&#8217;ll be getting licenses too!  The team I was on, &#8220;kitchen sink&#8221;, even won a prize for our efforts!  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=32&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We all had a terrific time at <a href="http://www.flashcamp.org">FlashCamp</a> and got to see all the new features of Flash 10 and CS4 in action.  Not only that, we walked away with trial copies, and we&#8217;ll be getting licenses too!  The team I was on, &#8220;kitchen sink&#8221;, even won a prize for our efforts!  </p>
<p>It was a crazy weekend from project conception to presentation, and we had a blast the whole time with our crackpot ideas.  You can tell by the look on our <a href="http://www.flickr.com/photos/dominic/2936670951/">faces</a>.  We used Flash 10&#8217;s IK for animation, dynamic sound, pixel bender shaders for tracking a light source, deco tool for snow, and along the way learned a ton and saw some really cool inspiring demos.  </p>
<p>Here&#8217;s a shout out to team &#8220;kitchen sink&#8221; MT, Dennis, Pedro, Kenny, and James, and the Adobe guys Kuy, Tony, Richard, Justin, and Dom for being so cool and making the weekend a success!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=32&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2008/10/13/back-from-flashcamp-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
		<item>
		<title>Flashcamp 2008</title>
		<link>http://geekrelief.wordpress.com/2008/10/07/flashcamp-2008/</link>
		<comments>http://geekrelief.wordpress.com/2008/10/07/flashcamp-2008/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 01:21:41 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash 10]]></category>
		<category><![CDATA[haxe]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=30</guid>
		<description><![CDATA[Woo hoo I just got confirmation from Dom Sagolla about flashcamp.  This will be my first time going, and I&#8217;m psyched!  I can&#8217;t wait to tap into Flash 10&#8217;s new features (vectors, 3D, new text layout engine).  The future of Flash and haXe looks bright.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=30&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Woo hoo I just got confirmation from Dom Sagolla about <a href="http://flashcamp.org">flashcamp</a>.  This will be my first time going, and I&#8217;m psyched!  I can&#8217;t wait to tap into Flash 10&#8217;s new features (vectors, 3D, new text layout engine).  The future of Flash and haXe looks bright.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=30&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2008/10/07/flashcamp-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
		<item>
		<title>Actionscript 3 to haXe!</title>
		<link>http://geekrelief.wordpress.com/2008/10/01/actionscript-3-to-haxe/</link>
		<comments>http://geekrelief.wordpress.com/2008/10/01/actionscript-3-to-haxe/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 04:29:30 +0000</pubDate>
		<dc:creator>geekrelief</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[as3tohaxe]]></category>
		<category><![CDATA[haxe]]></category>

		<guid isPermaLink="false">http://geekrelief.wordpress.com/?p=25</guid>
		<description><![CDATA[So after a couple of months of study, I finally put together my first Haskell project, as3tohaxe, an Actionscript 3 to haXe converter.  And now it&#8217;s up on github for everyone.  The code is a mess because I&#8217;m still green with Haskell (and haXe!).  It&#8217;s just a start, but I hope to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=25&subd=geekrelief&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So after a couple of months of study, I finally put together my first Haskell project, as3tohaxe, an Actionscript 3 to <a href="http://www.haxe.org">haXe</a> converter.  And now it&#8217;s up on <a href="http://github.com/geekrelief/as3tohaxe/tree/master">github</a> for everyone.  The code is a mess because I&#8217;m still green with Haskell (and haXe!).  It&#8217;s just a start, but I hope to continually improve the translator as I work on my haXe projects.</p>
<p>Here&#8217;s what it can do so far:</p>
<ul>
<li>converts basic types int to Int</li>
<li>cleans up the package braces</li>
<li>renames the constructor to new or main</li>
<li>converts default arguments</li>
<li>moves member variable initializers into the constructor</li>
<li>converts access control attributes (e.g. protected to public)</li>
<li><strong>and more eventually</strong></li>
</ul>
<p>Parsing expressions is on the todo list.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekrelief.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekrelief.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekrelief.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekrelief.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekrelief.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekrelief.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekrelief.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekrelief.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekrelief.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekrelief.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekrelief.wordpress.com&blog=4822973&post=25&subd=geekrelief&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekrelief.wordpress.com/2008/10/01/actionscript-3-to-haxe/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">geekrelief</media:title>
		</media:content>
	</item>
	</channel>
</rss>