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

<channel>
	<title>Times New Rohan &#187; FarCry</title>
	<atom:link href="http://robrohan.com/category/farcry/feed/" rel="self" type="application/rss+xml" />
	<link>http://robrohan.com</link>
	<description>技术任意</description>
	<lastBuildDate>Thu, 28 Jan 2010 13:51:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>TypeError: Unsupported format string type</title>
		<link>http://robrohan.com/2009/09/02/typeerror-unsupported-format-string-type/</link>
		<comments>http://robrohan.com/2009/09/02/typeerror-unsupported-format-string-type/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 00:47:23 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[FarCry]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=1142</guid>
		<description><![CDATA[Quick post so Google might return something helpful for others hitting this error (Since I couldn&#8217;t find a post on the matter).

I hit this error using python on Mac OS X Leopard while writing a Cocoa based application and using minidom.  I was doing a simple httplib.HTTPConnection request to a server and getting back [...]]]></description>
			<content:encoded><![CDATA[<p>Quick post so Google might return something helpful for others hitting this error (Since I couldn&#8217;t find a post on the matter).</p>

<p>I hit this error using python on Mac OS X Leopard while writing a Cocoa based application and using minidom.  I was doing a simple httplib.HTTPConnection request to a server and getting back XML in the body of the document.  I was pulling the XML out using the response.read() method.</p>

<p>The server was setting the mime type and encoding correctly, and a type() call against the result showed it as a valid python string (&lt;type &#8217;str&#8217;&gt;) and it was well formed XML. However, for some reason whenever I would feed it to minidom.parseString() Cocoa (or the PyObjC bridge or whatever) would die with the error &#8220;TypeError: Unsupported format string type&#8221;</p>

<p><span id="more-1142"></span></p>

<p>I tried making the string an NSString thinking it was some Mac OS X implementation problem (various versions of NSString.alloc().initWithString_(str_response) setting encodings, copies of objects, etc), but it always caused the same error.</p>

<p>In the end, I simply gave up on the minidom library and used ElementTree instead (from xml.etree import ElementTree).  ElementTree.fromstring(str_response) worked out of the box.</p>

<p>I hope this saves someone some time. It had me stumped for several hours since there is no other information beyond &#8220;Unsupported format string type&#8221; with the stack trace of:</p>

<pre>
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjCTools/AppHelper.py", line 235, in runEventLoop
</pre>

<p>I am still loving python though :)</p>

<p><b>Update</b></p>

<p>After working with ElementTree a bit more, I&#8217;ve discovered that the real culprit to this difficult-to-figure-out error message was likely due to the try/except statement around the method call.  For example it was doing this:</p>

<pre>
try:
    crazy.thing()
except Exception, e:
    rsp = NSRunAlertPanel(
        u"Bad Things", 
        e, 
        u"Let Me Try Again", 
        u"Quit", 
        None)
</pre>

<p>Any exception in the crazy.thing method will be masked by the &#8220;TypeError: Unsupported format string type&#8221; error when it tries to display e.  To fix it I simply casted e to a string:</p>

<pre>
try:
    crazy.thing()
except Exception, e:
    rsp = NSRunAlertPanel(
        u"Bad Things", 
        str(e), 
        u"Let Me Try Again", 
        u"Quit", 
        None)
</pre>

<p>So the real cause of my minidom problem is unknown since I&#8217;ve moved on to ElementTree.  I am a bit disappointed in the error reporting with python Cocoa, but other than a few elusive and confusing errors it is sweet, and fun development platform.</p>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/09/02/typeerror-unsupported-format-string-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Almost WebDU Time &#8211; It&#8217;s the Final Countdown</title>
		<link>http://robrohan.com/2009/05/19/almost-webdu-time-its-the-final-countdown/</link>
		<comments>http://robrohan.com/2009/05/19/almost-webdu-time-its-the-final-countdown/#comments</comments>
		<pubDate>Tue, 19 May 2009 23:08:30 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[Afae]]></category>
		<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[FarCry]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GlueyNotes]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[cfeclipse]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=1055</guid>
		<description><![CDATA[



If you are in Sydney, don&#8217;t miss Code wars tonight &#8211; which should be really fun.

I never really mentioned it either, but I&#8217;ll be talking about iPhone Web Application development, and I&#8217;ll be hanging out talking about iPhone native app development at a birds of a feather chat if you are into iPhone stuff.

I am [...]]]></description>
			<content:encoded><![CDATA[<div class="movie">
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/XAg5KjnAhuU&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/XAg5KjnAhuU&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
</div>

<p>If you are in Sydney, don&#8217;t miss <a href="http://www.webdu.com.au/session/code-wars">Code wars</a> tonight &#8211; which should be really fun.</p>

<p>I never really mentioned it either, but I&#8217;ll be talking about <a href="http://www.webdu.com.au/session/building-iphone-web-applications">iPhone Web Application development</a>, and I&#8217;ll be hanging out talking about iPhone native app development at a <a href="http://www.webdu.com.au/session/bof-mobile-mayhem">birds of a feather chat</a> if you are into iPhone stuff.</p>

<p>I am not sure if <a href="http://www.webdu.com.au/registration">WebDU</a> is sold out yet, but you might be able to score a last minute ticket&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/05/19/almost-webdu-time-its-the-final-countdown/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebDU Rock Your Inner Geek &#8211; Video 4</title>
		<link>http://robrohan.com/2009/04/13/webdu-rock-your-inner-geek-video-4/</link>
		<comments>http://robrohan.com/2009/04/13/webdu-rock-your-inner-geek-video-4/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 03:00:03 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[Afae]]></category>
		<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[FarCry]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GlueyNotes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[cfeclipse]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=1012</guid>
		<description><![CDATA[

Rock Your Inner Geek


Own it today!
]]></description>
			<content:encoded><![CDATA[<div class="movie">
<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/rx0TGvAyN1c&#038;hl=en&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/rx0TGvAyN1c&#038;hl=en&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object>
<a href="Rock Your Inner Geek ">Rock Your Inner Geek</a>
</div>

<p><a href="http://www.webdu.com.au/registration">Own it today!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/04/13/webdu-rock-your-inner-geek-video-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EC2 QandA</title>
		<link>http://robrohan.com/2009/04/03/ec2-qanda/</link>
		<comments>http://robrohan.com/2009/04/03/ec2-qanda/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 23:40:57 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[FarCry]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=994</guid>
		<description><![CDATA[Sometimes my posts are a bit wacky, and I don&#8217;t hit on things people really want to know.  I&#8217;ve come to realise I like getting email questions because it is a nice format and I know I am helping at least one person.

This set of questions came in as a result of the EC2 [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes my posts are a bit wacky, and I don&#8217;t hit on things people really want to know.  I&#8217;ve come to realise I like getting email questions because it is a nice format and I know I am helping at least one person.</p>

<p>This set of questions came in as a result of the EC2 and S3 videos I posted a while ago.</p>

<blockquote>
1. Is there a way to share a file system / volume across multiple EC2 instances?  As in, if we have 2+ App servers running, it would be ideal if they shared a volume so that if files changed, they would be changed on all servers, instantly.  If not, I suppose we could run NFS or something similar.  Ideas?
</blockquote>

<p>It would be possible to have one of your EC2 instances be a master and share the files &#8211; just as one would do in any other &#8220;normal&#8221; situation (smb, nfs, whatever).  If you&#8217;re only talking about code, you could also use something like rsync, or directly checkout from your source control to keep code in sync.</p>

<p>Another thing you can do for assets is write the data to S3 and share it via buckets.  While this approach requires quite a bit of infrastructure and error handing on your part, it also gives you unlimited data storage and an &#8220;automatic&#8221; content delivery platform.</p>

<p>The last project we did we used the S3 approach. We used message queues to inform parts of the application about changes, and also to retry on failures.  However, that project has massive data storage and delivery requirements.</p>

<blockquote>
2. Are we correct that making any configuration changes to an instance necesitates re-bundling that instance into a new AMI afterwards?  Otherwise, all changes are lost the next time it&#8217;s shut down and fired back up.
</blockquote>

<p>Yes and no. You can build a custom AMI that has everything you want on it (or buy / rent a premade one), and then save all your configurations to a mounted EBS &#8220;Elastic Block Store&#8221;.  An EBS basically equates to a hard dive you mount to the AMI.  You can use the EBS just like any hard drive attached to a &#8220;normal&#8221; computer, and it&#8217;s storage persists.</p>

<p>It&#8217;s awesome on Linux because you an just mount the EBS anywhere (like in /var/www, /opt/coldfusion, or /etc/config), but you can achieve the same effect on Windows as well.</p>

<p>In other words, you&#8217;ll always lose changes to the C:\ when you bring the system down, but not lose the D:&#44; E:\ etc.</p>

<p>(You&#8217;ll want to know how to build an AMI at some point though &#8211; system updates / upgrades and what not.)</p>

<blockquote>
3. We have some legacy windows only apps, so we are going to be running windows instances and linux instnaces, but we&#8217;re starting with the windows ones (assuming they will be more difficult)&#8230; Have you noticed any differences between the two that you want to mention?  Have you worked with the windows instances much at all?
</blockquote>

<p>The windows ones are a bit more expensive, and they seem to take a really long time to start (3-4 minutes vs. 30-45 seconds on Linux), but once they get going they seem to be just like any other box.  You can terminal service in to manage them &#8211; if you didn&#8217;t know it was an AMI you wouldn&#8217;t know it was an AMI :)</p>

<p>I&#8217;ve also never built a custom windows AMI, but I hear that it is easier (when it works).  Building a Linux AMI can be completely scripted, and I don&#8217;t think a windows one can (though, again, I&#8217;ve never built a windows one)</p>

<blockquote>
4. We are a bit concerned with the complexity of making changes to instances and needing to take them down and re-bundle them for those changes not to be lost&#8230; I suppose we could do so to copies of the AMI so that we don&#8217;t need to take down production instances, but it still seems overly cumbersome.  Do you know of a decent plan/flowchart/graph/play-by-play of how other companies/people have worked with EC2 servers as a production environment?
</blockquote>

<p>I can understand your concern, and the best remedy is to get in there and play.  You&#8217;ll find that if you configure you infrastructure correctly, use EBSs correctly, you can bring up whole new production instances in 30 seconds (or so).  Need a test deploy server?  Bling.  Done.  You can do new releases by reassigning the IP to a new running instance&#8230; Anyway, I think you might want to read up on <a href="http://www.techcrunchit.com/2008/08/21/amazon-launches-ebs-persistant-storage-for-ec2/">EBSs</a> because it sounds like will alleviate a lot of your concerns.</p>

<p>As for the plan / flowchart &#8230; that&#8217;s the kind of stuff I <a href="http://daemon.com.au">get paid for</a> :-D</p>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/04/03/ec2-qanda/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Howto Debug IE &#8211; Javascript and CSS</title>
		<link>http://robrohan.com/2009/03/28/howto-debug-ie-javascript-and-css/</link>
		<comments>http://robrohan.com/2009/03/28/howto-debug-ie-javascript-and-css/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 04:30:32 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[FarCry]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=991</guid>
		<description><![CDATA[Debugging Javascript and getting CSS to render correctly in Internet Explorer is very often a huge frustration for web developers.  I put together a few quick movies showing how to lessen the pain of dealing with IE.

The Javascript one will likely save you hours of frustration, and the CSS one is a nice tip [...]]]></description>
			<content:encoded><![CDATA[<p>Debugging Javascript and getting CSS to render correctly in Internet Explorer is very often a huge frustration for web developers.  I put together a few quick movies showing how to lessen the pain of dealing with IE.</p>

<p>The Javascript one will likely save you hours of frustration, and the CSS one is a nice tip to help debug oddities (I am not a designer so the CSS one is a bit lite, but helpful non-the-less).</p>

<p>Debugging wonderfully descriptive errors like &#8220;Object Expected&#8221; and &#8220;Object doesn&#8217;t support that property or method&#8221;:</p>

<div class="movie">
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/FoBWKHt5R4w&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/FoBWKHt5R4w&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
<a href="http://www.youtube.com/watch?v=FoBWKHt5R4w">Howto Debug Javascript in IE</a>
</div>

<p>Manipulating rendered CSS on the fly to help debug layout issues:</p>

<div class="movie">
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/3U6z-UEb2Vo&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/3U6z-UEb2Vo&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
<a href="http://www.youtube.com/watch?v=3U6z-UEb2Vo">Debug IE CSS</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/03/28/howto-debug-ie-javascript-and-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebDU &#8211; Inner Geek Rocking Video 3</title>
		<link>http://robrohan.com/2009/03/27/webdu-inner-geek-rocking-video-3/</link>
		<comments>http://robrohan.com/2009/03/27/webdu-inner-geek-rocking-video-3/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 03:53:18 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[Afae]]></category>
		<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[FarCry]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GlueyNotes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[cfeclipse]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=988</guid>
		<description><![CDATA[&#8220;The premise centers around a group of poorly-dressed white people in an artificially lit environment with no discernible rhythmic ability; which perfectly encapsulates Thursday night at webDU.&#8221;

Min&#8217;s descriptions on these videos are the bees knees.



WebDU 2009 &#8211; Rock Your Inner Geek Part 3


Register now &#8211; I highly doubt you&#8217;ll be sad you did.
]]></description>
			<content:encoded><![CDATA[<p>&#8220;The premise centers around a group of poorly-dressed white people in an artificially lit environment with no discernible rhythmic ability; which perfectly encapsulates Thursday night at webDU.&#8221;</p>

<p>Min&#8217;s descriptions on these videos are the bees knees.</p>

<div class="movie">
<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/8Ch2RWduTyY&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/8Ch2RWduTyY&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object>
<a href="http://www.youtube.com/watch?v=8Ch2RWduTyY">WebDU 2009 &#8211; Rock Your Inner Geek Part 3</a>
</div>

<p><a href="http://www.webdu.com.au/registration">Register now</a> &#8211; I highly doubt you&#8217;ll be sad you did.</p>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/03/27/webdu-inner-geek-rocking-video-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebDU &#8211; Rock Your Inner Geek (video 2)</title>
		<link>http://robrohan.com/2009/03/09/webdu-rock-your-inner-geek-video-2/</link>
		<comments>http://robrohan.com/2009/03/09/webdu-rock-your-inner-geek-video-2/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 20:24:27 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[Afae]]></category>
		<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[FarCry]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GlueyNotes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[cfeclipse]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=980</guid>
		<description><![CDATA[

Rock Your Inner Geek


WebDU Registration
twitter.com/webdu
]]></description>
			<content:encoded><![CDATA[<div class="movie">
<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/h1oROfhIzbw&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/h1oROfhIzbw&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object>
<a href="http://www.youtube.com/watch?v=h1oROfhIzbw">Rock Your Inner Geek</a>
</div>

<p><a href="http://www.webdu.com.au/registration">WebDU Registration</a>
<a href="http://twitter.com/webdu">twitter.com/webdu</a></p>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/03/09/webdu-rock-your-inner-geek-video-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebDU &#8211; Rock Your Inner Geek</title>
		<link>http://robrohan.com/2009/03/02/webdu-rock-your-inner-geek/</link>
		<comments>http://robrohan.com/2009/03/02/webdu-rock-your-inner-geek/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 03:00:52 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[Afae]]></category>
		<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[FarCry]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GlueyNotes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[cfeclipse]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=978</guid>
		<description><![CDATA[

Rock Your Inner Geek


You most likely don&#8217;t want to miss it.

WebDU Registration
twitter.com/webdu
]]></description>
			<content:encoded><![CDATA[<div class="movie">
<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/OdZszOMJRnw&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/OdZszOMJRnw&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object>
<a href="http://www.youtube.com/watch?v=OdZszOMJRnw">Rock Your Inner Geek</a>
</div>

<p>You most likely don&#8217;t want to miss it.</p>

<p><a href="http://www.webdu.com.au/registration">WebDU Registration</a>
<a href="http://twitter.com/webdu">twitter.com/webdu</a></p>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/03/02/webdu-rock-your-inner-geek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compressing A UUID</title>
		<link>http://robrohan.com/2009/02/14/compressing-a-uuid/</link>
		<comments>http://robrohan.com/2009/02/14/compressing-a-uuid/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 08:19:56 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[FarCry]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=970</guid>
		<description><![CDATA[FarCry makes heavy use of UUIDs.  I am a fan of UUIDs myself, but in some instances they are a bit long.  It seems like there should be a way to make them shorter and still have them hold their value.  I had a need for a shorter UUID and set out [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://farcrycore.org">FarCry</a> makes heavy use of UUIDs.  I am a fan of UUIDs myself, but in some instances they are a bit long.  It seems like there should be a way to make them shorter and still have them hold their value.  I had a need for a shorter UUID and set out to find a way to compress a UUID.</p>

<p>It kind of worked.  It wont work for my purposes so it was a wash for me, but it was still quite a bit of fun and I figured I might as well get a blog post out of all the work.</p>

<p>My example UUID: ED11C880-FA56-11DD-A604001EC203A3AD</p>

<p>After looking at it for a while, it dawned on me that all the characters are hex values&#8230; which means each value can only have 16 values&#8230; which means you should be able to fit it into 4 bits.  If that&#8217;s the case, then (after the 3 dashes are removed), it should be possible to reduce the UUID by 50%.</p>

<p>First I set up a simple table to look up each value.  Basically just:</p>

<div class="movie">
<img src="http://robrohan.com/wp-content/uploads/2009/02/picture-1-7.png" height="39" width="312" border="1" hspace="4" vspace="4" alt="Picture 1-7" />
</div>

<p>Then I wrote a simple loop that grabbed two chars at a time from the UUID, looked up their value in the Hex table, and then set the lower order bits to the first char, and the higher order bits to the second char.  This table is an output from the loop:</p>

<div class="movie">
<img src="http://robrohan.com/wp-content/uploads/2009/02/picture-2-3.png" height="491" width="393" border="1" hspace="4" vspace="4" alt="Picture 2-3" />
</div>

<p>As you can see the 8 bits of output (far right) is the binary representation of the integer index to 2 of the actual Hex values.</p>

<p>It does indeed work, horray :)</p>

<p>Going in reverse, looping over eight bits at a time, breaking them into 4 bits, turning them into integers and then looking up the proper Hex value works equally well (as you would expect)</p>

<div class="movie">
<img src="http://robrohan.com/wp-content/uploads/2009/02/picture-3-2.png" height="262" width="436" border="1" hspace="4" vspace="4" alt="Picture 3-2" />
</div>

<p>The reason this is a failure for me is that there doesn&#8217;t appear to be a way to pass this information in the URL.  If you were to just look at this string, it would be gobbly gook since it has high ASCII and non-printable characters. It looks like this actually:</p>

<div class="movie">
<img src="http://robrohan.com/wp-content/uploads/2009/02/picture-4.png" height="18" width="110" border="1" hspace="4" vspace="4" alt="Picture 4" />
</div>

<p>There are only 3 ways I can think of to pass data like this in the url</p>

<p>1) Hex encode &#8211; that results in the exact same string I started out with :-/</p>

<p>2) URL encoded &#8211; makes the output way longer than just the UUID by itself.</p>

<p>3) base64 &#8211; Humorously makes the string the same length as the UUID (MMOeEcKMCMKvZRHDnWpAw6EsMDrDmg==).</p>

<p>So&#8230; the whole thing was a &#8220;waste of time&#8221; (unless you have any suggestions).</p>

<p>It was fun to have my theory work out, but it was quite a let down that it&#8217;s completely useless for my needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/02/14/compressing-a-uuid/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Tweet from an Ant Build Script</title>
		<link>http://robrohan.com/2009/01/23/tweet-from-an-ant-build-script/</link>
		<comments>http://robrohan.com/2009/01/23/tweet-from-an-ant-build-script/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 10:08:52 +0000</pubDate>
		<dc:creator>小罗</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[FarCry]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://robrohan.com/?p=950</guid>
		<description><![CDATA[I think Twitter is a nice way to keep people up to date with your software projects.  It&#8217;s a nice, easy way to send out an executive summary of what is happening in real time.

Following in that vein we decided to do a tweet for each build we do for FarCry Core.  Since [...]]]></description>
			<content:encoded><![CDATA[<p>I think Twitter is a nice way to keep people up to date with your software projects.  It&#8217;s a nice, easy way to send out an executive summary of what is happening in real time.</p>

<p>Following in that vein <a href="http://www.daemon.com.au/">we</a> decided to do a tweet for each build we do for <a href="http://www.farcrycore.org/">FarCry Core</a>.  Since I am lazy, I decided to find a way to make it automated.  The solution we started using is a combination of <a href="http://curl.haxx.se/">cURL</a> and <a href="http://ant.apache.org/">Ant</a>.</p>

<p><a href="http://www.daemon.com.au/">We</a> initially tried to use the &lt;post&gt; ant task, but that turned out to be more complicated and error prone than just calling cURL via the &lt;exec&gt; task.</p>

<p>Since I develop on OS X, the first pass is Unixy and should work perfectly on Linux.  However, our build servers are currently Windows so I had to do a bit of porting to get it to work on Windows.  I&#8217;ll reiterate my usual complaint here: Windows needs a real shell cmd.exe is an abomination (powershell is from mars and unusable unless you want to only understand some random MS product) &#8211; include bash, it&#8217;s not hard.  Diatribe aside, my main point being that this process should work on Mac, Linux, and Windows.</p>

<p>For the people who don&#8217;t care how it works, but just want to use it, you can download a <a href="http://s3.amazonaws.com/software.robrohan.com/Examples/AntTwit.zip">working example here</a>.  If you know how to use Ant, it should be quite obvious how it works.</p>

<p>For those who do care about the under-workings, the main work horse for this came from a modified version of code found on <a href="http://www.linuxjournal.com/article/10222">this post on Linux Journal</a>.  The script is an abstraction layer just above <a href="http://curl.haxx.se/download/">cURL</a> which is a swiss army knife of network tinkering (leaving out <a href="http://netcat.sourceforge.net/">netcat</a> of course).</p>

<p>Curl comes pre-installed on most modern OSs, and windows users can download the exe from that above link.  The &#8220;tweet&#8221; shell script should work find on Mac OS X and Linux (you might need to chmod u+x), and the tweet.bat is the windows equivalent.</p>

<p>(Compare tweet to tweet.bat to see why cmd.exe is horrible.  Also, The windows version is limited to a tweet of 27 words.)</p>

<p>The Ant task just calls whichever tweet script you specify, and you&#8217;re off.</p>

<p>I should note the <a href="http://s3.amazonaws.com/software.robrohan.com/Examples/AntTwit.zip">example download</a> also includes the windows exe of cURL to make it easier for tinkering.  I only making it available as is with no warranty of any kind.  You might want to <a href="http://curl.haxx.se/download/">download</a> your own version, and possibly get the SSH enabled one.</p>

<p>If you are not a fan of Ant, but instead prefer make or a custom shell script, you can follow the instructions in the tweet shell script to make the script callable anywhere on the system.</p>

<p>Happy Build Tweeting.</p>
]]></content:encoded>
			<wfw:commentRss>http://robrohan.com/2009/01/23/tweet-from-an-ant-build-script/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
