<?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>pedant.dk &#187; Coding</title>
	<atom:link href="http://www.pedant.dk/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pedant.dk</link>
	<description>I hack on things that lets you find stuff.</description>
	<lastBuildDate>Sun, 13 Nov 2011 11:22:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Learning some Sencha touch MVC code fu at sourcedevcon 2011</title>
		<link>http://www.pedant.dk/2011/05/08/learning-some-sencha-touch-mvc-code-fu-at-sourcedevcon-2011/</link>
		<comments>http://www.pedant.dk/2011/05/08/learning-some-sencha-touch-mvc-code-fu-at-sourcedevcon-2011/#comments</comments>
		<pubDate>Sun, 08 May 2011 15:28:48 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Sencha Touch]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=861</guid>
		<description><![CDATA[This week I had pleasure to attend sourcedevcon 2011 at the awesome resort  Le meridien Split together with  @virdun ,@jakobkruse and @stureandersen . I have been lurking for a couple of years in the ExtJS community  since attending  the extjs conference in Orlando back in 2009, keeping up to date on things at our local [...]]]></description>
			<content:encoded><![CDATA[<p>This week I had pleasure to attend <a title="sourcedevcon 2011" href="http://www.sourcedevcon.eu/">sourcedevcon 2011</a> at the awesome resort  <a title="Le meridien split" href="http://www.starwoodhotels.com/lemeridien/property/overview/index.html?propertyID=1956">Le meridien Split</a> together with  <a title="Virdun" href="http://twitter.com/#!/Virdun">@virdun </a> ,<a title="JakobKruse" href="http://twitter.com/#!/search/jakobkruse">@jakobkruse </a>and <a title="@StureAndersen" href="http://twitter.com/#!/StureAndersen">@stureandersen</a> . I have been lurking for a couple of years in the ExtJS community  since attending  the extjs conference in Orlando back in 2009, keeping up to date on things at our local <a title="Öresund ExtJS meetup" href="http://www.meetup.com/The-Oresund-ExtJS-Meetup/">Öresund ExtJS meetup</a> , so it was nice to get in touch with some of the regular faces in the ExtJS community.</p>
<h2>Near the <a title="Dicoletian's Palace" href="http://en.wikipedia.org/wiki/Diocletian%27s_Palace">Dicoletian&#8217;s Palace</a></h2>
<p><a href="http://www.pedant.dk/wp-content/uploads/2011/05/IMAG0773.jpg"><img class="aligncenter size-full wp-image-875" title="Dicoletian's palace" src="http://www.pedant.dk/wp-content/uploads/2011/05/IMAG0773.jpg" alt="" width="490" height="368" /></a></p>
<p style="text-align: center;"><em>sourcedevcon 2011 was in the lovely town of Split, near Dicoletian&#8217;s Palace.<br />
</em></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: left;">Flying into Split I had some doubts on how many ExtJS devs would take their time to fly to split, this being the first community-driven sencha conference in Europe. After arriving I quickly put all my doubts aside &#8211; since the venue and conference organization was carefully laid  out.  Split itself is a very charming city, and we had an easy time arriving (leaving was another problem though). I was impressed by the fact that 200+ attendees had chosen to show up (that figure somewhat resembles the first Orlando conference in the US).</p>
<p>At the venue , the first thing we noticed was the outstanding bar with an overview of the local marina and the ExtJS swedes <a title="FredricBerling" href="http://twitter.com/#!/FredricBerling">@FredricBerling</a> , <a title="EmilPennlov" href="http://twitter.com/#!/EmilPennlov">@EmilPenlov</a> (and @<a title="Mats Bryntse" href="http://twitter.com/#!/Bryntum">bryntum</a> when he was not to busy hanging out in some other bars).</p>
<h2>Learning some  Sencha touch MVC  Code fu.</h2>
<p>At some point Johan (@virdun)  decided that he wanted  to get a Sencha Touch application up and running  . So we kind of lost him for a moment there in the bar.  I don&#8217;t remember if it started before <a href="http://twitter.com/#!/jamespearce">@jamespearce</a> introducing sencha touch  &#8211; but Johan started hacking furiously on this app for his site <a title="Citypolarna" href="http://citypolarna.se">http://citypolarna.se </a> somewhat right about  that session.</p>
<p style="text-align: center;"><a href="http://www.pedant.dk/wp-content/uploads/2011/05/IMAG0747.jpg"><img class="aligncenter size-full wp-image-865" title="IMAG0747" src="http://www.pedant.dk/wp-content/uploads/2011/05/IMAG0747.jpg" alt="" width="442" height="334" /></a><em>Johan playing with his mobile phone </em></p>
<p>Being Johan, he just wouldn&#8217;t let go, so I had to answer a lot of questions  about how sencha touch applications worked.</p>
<p>When I discovered that Johan was not being satisfied by the answer &#8220;but hey, I haven&#8217;t coded a line of sencha touch yet&#8221; we walked through the basic shopping list example for sencha touch and Johan modified it a bit, so it could serve as as base for implementing an event viewer for citypolarna. Combining the info found on <a title="sencha" href="http://sencha.com">http://sencha.com</a> and info from the sessions by <a title="_jdg" href="http://twitter.com/#!/_jdg">@_jdg </a>and <a title="@edspencer" href="http://twitter.com/#!/edspencer">@edspencer </a>this was an easy task, so modifying the shopping list example to a working application could be done during the conference. Oh yes, it also helped that we remember  to use extraParams instead of baseParams .</p>
<p><a href="http://www.pedant.dk/wp-content/uploads/2011/05/IMAG0775.jpg"><img class="aligncenter size-full wp-image-869" title="Mobile Hacking at the pool" src="http://www.pedant.dk/wp-content/uploads/2011/05/IMAG0775.jpg" alt="" width="479" height="361" /></a></p>
<p><em>A good thing  about exploring sencha touch and mobile user interfaces is that it can be done in the bar while drinking Mojitos</em></p>
<h2>Learning to migrate to ExtJS 4</h2>
<p>Besides learning more about sencha touch I learned a lot from <a title="@bmoeskau" href="http://twitter.com/#!/bmoeskau">@bmoskeau</a>&#8216;s session on migrating from to ExtJS 4.</p>
<p>Here I especially noted that using the MVC pattern can be postponed to a last optional step and that during migration to ExtJS 4, the old &#8220;new&#8221; constructor syntax should be able to work (but that the new Ext.define and Ext.create constructs is the preferred way to go).  Brian laid out a migration strategy using the   4 R&#8217;s  &#8220;Rendering , Running, Ready, Refactor&#8221; describing the 4 stages the migration should go through.</p>
<p style="text-align: center;"><a href="http://www.pedant.dk/wp-content/uploads/2011/05/IMAG0769.jpg"><img class="aligncenter size-full wp-image-872" title="Migrating to ExtJS4" src="http://www.pedant.dk/wp-content/uploads/2011/05/IMAG0769.jpg" alt="" width="503" height="378" /></a><a title="@bmoeskau" href="http://twitter.com/#!/bmoeskau">@bmoskeau</a> talking about migration</p>
<h2>ExtJS Scheduler and Calendar</h2>
<p>The session by <a title="@bmoeskau" href="http://twitter.com/#!/bmoeskau">@bmoskeau</a> and <a title="Mats Bryntse" href="http://twitter.com/#!/Bryntum">bryntum</a> on Ext Calendar and Ext Scheduler  was supposed to be a showcase of the two products, but to me the main value of the session was seing how easy it was to integrate such complex ExtJS  components. My jaw dropped when I saw Brian demonstrate him using his component updating the data model simultaneously in ExtJS scheduler. This is a testament to two very well designed components .</p>
<h2>Wrapup</h2>
<p>All in all sourcedevcon 2011 left me with the impression of a very vibrant ExtJS community  &#8211; I also got the impression of the strong commercial focus Sencha has. Sencha presented   Sencha.IO as a product &#8211; I look forward to exploring that  more indepth in the future. I chose to focus more on learning about Sencha touch and the MVC parts of ExtJS 4 during the conference..</p>
<p>&#8220;The Irish guys&#8221; has posted some writeups of their experiences at sourcedevcon . Well worth a read:</p>
<p><a title="The lowdown of sourcedevcon" href="http://www.darraghduffy.ie/?p=294">The lowdown of sourcdevcon</a></p>
<p><a title="sourcedevcon day1" href="http://www.joelennon.ie/2011/05/05/source-dev-con-day-1/">http://www.joelennon.ie/2011/05/05/source-dev-con-day-1/</a></p>
<p><img src="file:///home/jacob/Desktop/IMAG0747.jpg" alt="" /></p>
<p><a title="@nilsdehl" href="http://twitter.com/#!/nilsdehl">@nielsdehl</a> has posted pictures from the conference at flickr here :</p>
<p><a title="sourcedevcon day1" href="http://www.flickr.com/photos/nils-dehl/sets/72157626648487744/">http://www.flickr.com/photos/nils-dehl/sets/72157626648487744/</a> (sourcedevcon day1)</p>
<p><a title="sourcedevcon day2" href="http://www.flickr.com/photos/nils-dehl/sets/72157626533490549/">http://www.flickr.com/photos/nils-dehl/sets/72157626533490549/</a> (sourcedevcon day2)</p>
<p><a title="sourcedevcon day3" href="http://www.flickr.com/photos/nils-dehl/sets/72157626544637927/">http://www.flickr.com/photos/nils-dehl/sets/72157626544637927/</a> (sourcedevcon day3)</p>
<p><a title="sourcedevcon day4" href="http://www.flickr.com/photos/nils-dehl/sets/72157626672433598/">http://www.flickr.com/photos/nils-dehl/sets/72157626672433598/</a> (sourcedevcon day4)</p>
<div id="_mcePaste" class="mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 238px; width: 1px; height: 1px;">http://www.joelennon.ie/2011/05/05/source-dev-con-day-1/</div>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2011/05/08/learning-some-sencha-touch-mvc-code-fu-at-sourcedevcon-2011/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>pdf thingy</title>
		<link>http://www.pedant.dk/2010/02/02/pdf-thingy/</link>
		<comments>http://www.pedant.dk/2010/02/02/pdf-thingy/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 20:27:48 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=784</guid>
		<description><![CDATA[Update 2010-10-16: I took pdf-thingy offline from github. Update 2010-05-08: Google has decided to discontinue Google wave, so  I  will stop updating pdf-thingy. I&#8217;ve spent a couple of hours tinkering with pdf export from wave. I put the result here : pdf-thingy@appspot.com . You can invite the bot to your wave, when you do it [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update 2010-10-16:</strong></p>
<p><strong>I took pdf-thingy offline from github.</strong></p>
<p><strong>Update 2010-05-08:</strong></p>
<p><strong>Google has decided to discontinue Google wave, so  I  will stop updating pdf-thingy.</strong></p>
<p>I&#8217;ve spent a couple of hours tinkering with pdf export from wave. I put the result here :<br />
pdf-thingy@appspot.com . You can invite the bot to your wave, when you do it will present a link to a pdf version of the root blip. No fancy colors yet <img src='http://www.pedant.dk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Somebody pointed me to <a href="http://googlewavebots.info/wiki/index.php?title=PDF_Wave_Exporter">PDF Wave Exporter</a>, but I could not find the source code for it to tinker with. (I admit that I did not look that hard).</p>
<p>I implemented pdf thingy to learn more about python,wave and google appengine.</p>
<p>I based pdf-thingy on exporty by Pamela Fox , available from <a href="http://code.google.com/p/google-wave-resources/">google code</a> .  <a href="http://konryd.blogspot.com/2008/04/outputting-pdfs-with-google-app-engine.html">This tutorial</a> helped me learn about reportlab on google app engine.</p>
<p>You can find the code here: <a href="http://github.com/jacobandresen/pdf-thingy">http://github.com/jacobandresen/pdf-thingy</a></p>
<p>There are some obvious points of improvement:<br />
- handle text overflow<br />
- supporting annotations<br />
- fancy color templating</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2010/02/02/pdf-thingy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>icanhas javascript OOP?</title>
		<link>http://www.pedant.dk/2009/12/12/icanhas-javascript-oop/</link>
		<comments>http://www.pedant.dk/2009/12/12/icanhas-javascript-oop/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 05:48:17 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=724</guid>
		<description><![CDATA[In javascript we can express objects using the prototype notation: using class mimicking from prototype-js it would be : This example should be pretty clear. But when we get into real-life application scenarios we need to interact with users and databases. Let&#8217;s say we had a panel and a button for interacting with lolcats: Note [...]]]></description>
			<content:encoded><![CDATA[<p>In javascript we can express objects using the prototype notation:</p>
<pre class="brush: jscript; title: ; notranslate">
  var Cat = function () {
     this.furry = true;
  }
 Cat.prototype.greet = function () {
   return &quot;meeow&quot;;
 }
</pre>
<p>using class mimicking from <a href="http://prototypejs.org/">prototype-js</a> it would be :</p>
<pre class="brush: jscript; title: ; notranslate">
 var Cat = new Class({
  initialize: function (){
    this.furry = true;
    },
  ask: function (item) {
   return &quot;icanhas &quot;+item+&quot; ?&quot;;
 });
</pre>
<p>This example should be pretty clear. But when we get into real-life application scenarios we need to interact with users and databases.</p>
<p>Let&#8217;s say we had a panel and a button for interacting with <a href="http://icanhascheezburger.com/2008/08/12/funny-pictures-i-fightz-dem/">lolcats</a>:</p>
<pre class="brush: jscript; title: ; notranslate">
var CatInformationPanel = Class.create({
   initialize: function (container) {
     $(container.id+'_furry').checked = true;
     $('petButton').observe('click',  this.ask.bindAsEventListener(this));
  },
  ask:  function (item) {
    $(container.id+'_text').value =&quot;icanhas &quot;+item+&quot; ?&quot;;
  }
});
</pre>
<p>Note that we need to bind &#8220;this&#8221; to the the function scope for &#8220;ask&#8221;. this is one of the intricacies of object oriented javascript. Here are <a href="http://alternateidea.com/blog/articles/2007/7/18/javascript-scope-and-binding">some badass ninja examples</a> to explain why.</p>
<p>Now, after interacting with user , you probably want to save the result to a database. let&#8217;s assume that you have a resource /lol/cat/questions you can issue a HTTP post to (you can create this using <a href="http://rubyonrails.org/">rubyonrails</a> or  something similar).</p>
<pre class="brush: jscript; title: ; notranslate">
var CatInformationPanel = Class.create({
   initialize: function (container,name) {
     this.name = name;
     $(container.id+'_furry').checked = true;
     $('petButton').observe('click',  this.ask.bindAsEventListener(this));
  },
  ask:  function (item) {
    var question = &quot;icanhas &quot;+item+&quot; ?&quot;
    $(container.id+'_text').value =question;
   var request = new Ajax.Request ({
      &quot;/lol/cat/question&quot;, {
        method:'post',
        params:{ name:name, question:question },
        onSuccess: function (json) {
           alert(&quot;saved question&quot;);
           }
     }
    });
  }
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/12/12/icanhas-javascript-oop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gemcutter: the missing manual</title>
		<link>http://www.pedant.dk/2009/10/21/gemcutter-the-missing-manual/</link>
		<comments>http://www.pedant.dk/2009/10/21/gemcutter-the-missing-manual/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 19:20:27 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=713</guid>
		<description><![CDATA[Thanks to Jakob Kruse I now know how to operate RubyGems and gemcutter on windows. Here&#8217;s what I did: 1:I downloaded the 1.8.6 ruby installer here 2: I installed gemcutter like this: this let me use gemcutter on windows using the current one-click installer]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://www.kruse-net.dk">Jakob Kruse </a> I now know how to operate RubyGems and gemcutter on windows. Here&#8217;s what I did:</p>
<p>1:I downloaded the 1.8.6 ruby installer <a href="http://www.ruby-lang.org/en/downloads/">here</a></p>
<p>2: I installed gemcutter like this:</p>
<pre class="brush: bash; title: ; notranslate">
gem update --system
gem install gemcutter
gem tumble
gem install jspec
</pre>
<p>this let me use gemcutter on windows using the current one-click installer <img src='http://www.pedant.dk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/10/21/gemcutter-the-missing-manual/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>adventures with mingw , ruby,java, rhino and jspec</title>
		<link>http://www.pedant.dk/2009/10/21/adventures-with-mingw-rubyjava-rhino-and-jspec/</link>
		<comments>http://www.pedant.dk/2009/10/21/adventures-with-mingw-rubyjava-rhino-and-jspec/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 23:09:06 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=689</guid>
		<description><![CDATA[update 2010-10-05: jspec has been deprecated in favour of jasmine update 2009-10-21: This post is a writeup of my early experiences with gemcutter and rubygems. The strange runtime error I did not understand was probably related to that I needed to update rubygems to 1.3.5. I now know how to use gemcutter from ruby1.8.6 using [...]]]></description>
			<content:encoded><![CDATA[<p><strong>update 2010-10-05: jspec has been deprecated in favour of <a title="jasmine" href="http://pivotal.github.com/jasmine/">jasmine</a></strong></p>
<p><strong>update 2009-10-21: This post is a writeup of my early experiences with gemcutter and rubygems. The strange runtime error I did not understand was probably related to that I needed to update rubygems to 1.3.5.  <a href="http://www.pedant.dk/2009/10/21/gemcutter-the-missing-manual/">I now know how to use gemcutter from ruby1.8.6 using the oneclick installer</a> .</strong></p>
<p>I have been using <a href="http://github.com/visionmedia/jspec/tree/3.x">jspec</a> on macosx for a while  and decided to give it a try on windows vista today. Installing jspec on macosx and linux can be done using the instructions <a href="http://github.com/visionmedia/jspec/blob/3.x/README.md">here</a> .</p>
<p>I want to run the automated jspec tests available via rhino at a client site. Sadly , I am forced to use windows there, so I have given some thought on how to make jspec run on windows.</p>
<p>First of all you need to install ruby.  I used the automated 1.8.6 One-Click Installer available <a href="http://www.ruby-lang.org/en/downloads/">here</a> . After installing i ran</p>
<p><code lang="bash"><br />
gem update<br />
</code></p>
<p>the instructions in the README file for jspec currently states that I should install gemcutter and install jspec via that . I was not able to do that on windows  ( my system decided to report an obscure runtime error that I did not understand). So i decided to do this instead:</p>
<p><code lang="bash"><br />
gem sources -a http://gems.github.com<br />
gem install visionmedia-jspec<br />
</code></p>
<p>I let gem install the required dependencies visionmedia-commander and visionmedia-bind. After this I had the jspec script available. Sadly this gave me version 2.7.2 (I noticed \ruby\lib\ruby\gems\1.8\gems\visionmedia-jspec-2.7.2 ) <a href="http://gemcutter.org/gems/jspec">The listing on gemcutter</a> told me that a version 2.11.10 is a avaiable , so I decided to dig deeper. Maybe I could make gemcutter work anyway?</p>
<p>After a little browsing on github.com I found the <a href="http://github.com/oneclick/rubyinstaller/">oneclick installer</a></p>
<p>I cloned this repo using git</p>
<p>using the following command:<br />
<code lang="bash"><br />
git clone git://github.com/oneclick/rubyinstaller.git<br />
</code></p>
<p>and pressed</p>
<p><code lang="bash"><br />
rake ruby19<br />
</code></p>
<p>This project creates a sandbox that compiles a working ruby environment using <a href="http://mingw.org/">mingw</a>.</p>
<p>After contemplating the insanity of what I was doing for a couple of minutes (remember : installing a working ruby on linux is a single shell command) I grabbed some coca cola and started browsing through the source code for ruby distro while the rubyinstall was compiling. I looked a bit at ruby.c and  vm_exec.c  and had grim flashbacks to my c days. Luckily the compile finished and I copied ruby19_mingw to my c:\ drive and set it up on my PATH variable. Then I could check which version I was using:</p>
<p><code lang="bash"><br />
C:\&gt;ruby -v<br />
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]<br />
</code></p>
<p>Now I was able to do:<br />
<code lang="bash"><br />
gem install gemcutter<br />
gem tumble<br />
gem install jspec<br />
</code></p>
<p>(Note that there is  information sent to the terminal during these steps)</p>
<p>Now for the interesting part(!) jspec was working , so I could do this:</p>
<p><code lang="bash"><br />
jspec init SolitaireCipher --freeze<br />
</code></p>
<p>This created a directory where I can train doing the <a href="http://www.rubyquiz.com/quiz1.html">SolitaireCipher</a> using javascript. I renamed lib/yourlib.core.js to lib/SolitaireCipher.js  and spec/spec.core.js to spec/spec.SolitaireCipher.js and spec/spec.dom.html accordingly.</p>
<p>After 20 mins of fiddling I managed to get some running tests in a browser by opening spec.dom.html. Then I decided I want to automate the tests using <a href="http://www.mozilla.org/rhino/download.html">mozilla rhino</a>. After installing rhino , I could run automated tests like this</p>
<p><code lang="bash"><br />
cd c:\projects\SolitaireCipher<br />
jspec --rhino<br />
</code></p>
<p>This opens up a proces that listens to file changes in the lib and spec folders. All very well &#8211; untill I discovered that jspec currently uses ANSI codes to render colors to the terminal screens. ANSI codes are not supported on windows vista (something with ANSI.SYS being obsoleted), so if I want the nice colors then I need an alternative terminal than my command prompt in vista.</p>
<p>I found rxvt available from <a href="http://code.google.com/p/msysgit/downloads/list">PortableGit</a> on google code. This renders the colors just nicely &#8211; but has some other drawbacks. If I just use rxvt for rendering feedback from the jspec tests, then it seems to work though.</p>
<p>One thing to note is that rhino needs the java sdk to be installed and js.jar needs to be on your CLASSPATH. when starting jspec from rxvt on the msys from PortableGit, then CLASSPATH could be set like this (assuming rhino is installed in c:\tools ):</p>
<p><code lang="bash"><br />
export CLASSPATH=/c/tools/rhino1_7R2/js.jar<br />
</code></p>
<p>I probably want to avoid using rxvt on PortableGit too much . There are some major flaws listed <a href="http://code.google.com/p/msysgit/wiki/WhyIsRxvtNotTheDefault">here</a> .</p>
<p>Maybe I should look into doing a adobe air frontend for jspec?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/10/21/adventures-with-mingw-rubyjava-rhino-and-jspec/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>unclebob does the prime factor kata</title>
		<link>http://www.pedant.dk/2009/10/11/unclebob-does-the-prime-factor-kata/</link>
		<comments>http://www.pedant.dk/2009/10/11/unclebob-does-the-prime-factor-kata/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 18:13:28 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[bdd]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=686</guid>
		<description><![CDATA[update 2009-11-12: There is an updated version here unclebob doing the prime factor kata:]]></description>
			<content:encoded><![CDATA[<p><strong>update 2009-11-12: There is an updated version <a href="http://katas.softwarecraftsmanship.org/?p=71&amp;cpage=1#comment-43">here</a></strong></p>
<p><a href="http://twitter.com/unclebobmartin">unclebob</a> doing the prime factor kata:</p>
<p><object id="viddler" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="437" height="370" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.viddler.com/player/ce8c2038/" /><param name="name" value="viddler" /><param name="allowfullscreen" value="true" /><embed id="viddler" type="application/x-shockwave-flash" width="437" height="370" src="http://www.viddler.com/player/ce8c2038/" name="viddler" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/10/11/unclebob-does-the-prime-factor-kata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paris Hilton and Behaviour Driven Development</title>
		<link>http://www.pedant.dk/2009/09/27/paris-hilton-and-behaviour-driven-development/</link>
		<comments>http://www.pedant.dk/2009/09/27/paris-hilton-and-behaviour-driven-development/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 18:36:20 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[bdd]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=644</guid>
		<description><![CDATA[Recently, I have been giving Behaviour Driven Development some thought. Let&#8217;s take a an example of how to develop and test a music video search and storage system. A traditional way of developing this would require formulating a object oriented system architecture, thinking about streaming and metadata enabled search. The system architecture could consist of [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I have been giving  <a href="http://behaviour-driven.org/Introduction">Behaviour Driven Development</a> some thought.</p>
<p>Let&#8217;s take a an example of how to develop and test a  music video search and storage  system. A traditional way of developing this would require formulating a object oriented system architecture, thinking about streaming and metadata enabled search. The system architecture could consist  of a well chosen database server, a streaming server and a metadata enabled search engine &#8211; combining these technologies with a modern UI  and encapsulating theme in carefully designed object oriented structures. During all these important choices , and all during development we would make sure to write tests before we write a single line of code.</p>
<p>All these things put together would lead to a well thought out system architecture , but all the effort put into the system architecture can be in vain &#8211; if we don&#8217;t have a solid business understanding of what a video storage system should do. What will the users expect?</p>
<p>While browsing on <a href="http://www.facebook.com">facebook</a> this other day I found the <a href="http://www.facebook.com/group.php?gid=5299495387">&#8220;The Paris Hilton &amp; Jacques Derrida Appreciation Society&#8221; </a> &#8211; this group explores the connections between the works of Paris Hilton and Jacques Derrida. When we deconstruct the &#8220;pretty blonde&#8221; facade of Paris Hilton, then you can actually find some deep insights. Take &#8220;Nothing in this world&#8221; for instance:</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/32DwYTRmmto&amp;hl=en&amp;fs=1&amp;" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/32DwYTRmmto&amp;hl=en&amp;fs=1&amp;" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
<p>Take the phrase &#8220;when you are with somebody else, that&#8217;s me in your eye&#8221;.  There is the obvious interpretation of the sentence .  But thinking about that sentence also let&#8217;s you reflect on the <em>real meaning</em> . When you look at Paris Hilton in this video, what do you see? Do you see the pretty blonde or the millionaire , hard working young girl . In this video I am seeing the image of the pretty blonde &#8211; but I am also thinking about the millions of dollars she is earning portraying herself in this way.  So in a sense &#8211; I am reading the original message out of context. I am admiring what Paris Hilton in some other way than she intended &#8211; the original meaning of the words seem to have disappeared &#8211; but my understanding of the sentence is more useful to me.  I wish I could do what Paris Hilton does &#8211; but in a way that would make sense in my world .</p>
<p>The producers of the &#8220;Nothing in this world&#8221; video are not likely to convey information about the business empire of Paris Hilton in the metadata supplied for the video. So a system formulated as a &#8220;video storage system&#8221; would not let me exploit the information I found in the facebook group.</p>
<p>BDD introduces the use of a Domain Specific language to express the users expectations in a manner more directly focused on the behavioural aspects of the system. This lifts the clouds from the system aspects and focuses on <em>intent</em>.</p>
<p>A better way to formulate my expectations for the system would be:</p>
<pre>Describe the music video storage system:
  I should be able to search for videos using metadata
  it should play videos  in my browser
  I should be able to query facebook for information about it</pre>
<p>If I had those expectations formulated to me , then I would choose to implement this system as a mashup between youtube and facebook as a facebook application. This would be a radically different system architecture than the one describe above.</p>
<p>Furthermore , by leveraging one of the <a href="http://behaviour-driven.org/Implementations">several BDD test frameworks available</a>, then the expectations could be formulated in way that can be used as tests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/09/27/paris-hilton-and-behaviour-driven-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A wave is coming</title>
		<link>http://www.pedant.dk/2009/09/13/a-wave-is-coming/</link>
		<comments>http://www.pedant.dk/2009/09/13/a-wave-is-coming/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 09:16:02 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=618</guid>
		<description><![CDATA[Last week I attended a  day of outstanding geek fun . At the Google wave hackathon I had the chance to sink my teeth into the Google wave API after seeing presentations on gwt and google wave  by Tommy Pedersen and a presentation on wave gadgets by  Joakim Recht. After a couple of hours of presentations [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I attended a  day of <a title="outstanding geek fun" href="http://www.masteringwave.com/2009/09/wave-hackathon-in-copenhagen/">outstanding geek fun</a> . At the Google wave hackathon I had the chance to sink my teeth into the Google wave API after seeing presentations on gwt and google wave  by <a href="http://twitter.com/tpedersen">Tommy Pedersen</a> and a presentation on wave gadgets by  Joakim Recht.</p>
<p>After a couple of hours of presentations and brainstorming  we started hacking.  I teamed up with <a title="skakanka" href="http://twitter.com/skakanka"> skakanka</a> to experiment with sending the contents of a wave to a Proof of concept Document storage system . But we ended up doing a simple Echo Bot (but hey! we illustrated how to extract content from a wavelet and send it somewhere).</p>
<p>I brought a mac and used the <a title="google eclipse plugin" href="http://code.google.com/eclipse/">Google eclipse plugin</a> for galileo for coding. It helped that I allready had a Google app engine account from some earlier experiments &#8211; but I spent some time learning the different key combinations on the mac &#8211; it was great fun though (and now I know how to use eclipse on  a mac!). Deploying on google app engine is as simple as pressing a button in eclipse (I also tried using som ant tasks in my earlier experiments).</p>
<p>We managed to have a google wave running sometime before lunch &#8211; so it is very easy to get a basic understanding what a wave bot is all about. (You could think of it as an <a href="https://sourceforge.net/projects/pluggableircbot/">ircbot</a> on steroids ! )</p>
<p>The overall idea of building a google wave bot is to listen to incoming events defined in the protocol. Let&#8217;s say we want to perform something when somebody enters the wave or write something &#8211; then we can define the capabilities like this:</p>
<p><code lang="xml"><br />
<?xml version="1.0"?><br />
<w:robot xmlns:w="http://wave.google.com/extensions/robots/1.0"><br />
  <w:version>0.0.4</w:version><br />
  <w:capabilities><br />
     <w:capability name="blip_submitted"></w:capability><br />
    <w:capability name="wavelet_participants_changed"/><br />
  </w:capabilities><br />
</w:robot><br />
</code></p>
<p>Then the robot should act on the defined events in a manner similar to this :</p>
<p><code lang="java"><br />
@Override<br />
public void processEvents(RobotMessageBundle robotMessageBundle) {<br />
  Wavelet wavelet = robotMessageBundle.getWavelet();<br />
  String rootText = wavelet.getRootBlip().getDocument().getText();<br />
  for ( Event e: robotMessageBundle.getEvents()){<br />
    Blip b= e.getBlip();<br />
    String text= e.getBlip().getDocument().getText();<br />
    if (e.getType().equals(EventType.BLIP_SUBMITTED)){<br />
      e.getBlip().getDocument().append( makeEcho(text));<br />
    }<br />
  }<br />
}<br />
</code></p>
<p>The Wave client api  offers something like the DOM api for the xml being sent back and forth. During the hackathon I learnt that there is no way to ask for the contents of the entire wave from a single blip &#8211; so it will require some thinking to save the entire contents of the wave &#8211; but it should be doable.</p>
<p>Sometime during the afternoon things started to slow down on the wave test server. I noticed that some of the other guys doing a multiuser  interactive drawing gadget for wave. It looked like they recorded a delta to send every time the mouse moved! This made me want to look a bit under &#8220;the hood&#8221;:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/uOFzWZrsPV0" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/uOFzWZrsPV0"></embed></object></p>
<p>Sounds like the team are handling the multiuser issues using &#8220;operational transforms&#8221; . Maybe they could somehow &#8216;batch&#8217; deltas from interactive gadgets ? I have yet to fully understand how &#8220;operational transforms&#8221; work  &#8211; but it sounds like an exciting challenge to make this work on a large scale!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/09/13/a-wave-is-coming/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>openlayers 2.8 supports WFS-T</title>
		<link>http://www.pedant.dk/2009/09/02/openlayers-2-8-supports-wfs-t/</link>
		<comments>http://www.pedant.dk/2009/09/02/openlayers-2-8-supports-wfs-t/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 19:04:11 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=590</guid>
		<description><![CDATA[if you are in a organisation where you store data with geographical information associated with it , then you have the option of sharing your data using the following standards specified by OGC: WMS (Web map service) WFS (Web feature service) One way to leverage these standards is to use the geoserver project for data [...]]]></description>
			<content:encoded><![CDATA[<p>if you are in a organisation where you store data with geographical information associated with it , then you have the option of sharing your data using the following standards specified by<a href="http://www.opengeospatial.org/"> OGC</a>:</p>
<ul>
<li><a href="http://www.opengeospatial.org/standards/wms">WMS (Web map service)</a></li>
<li><a href="http://www.opengeospatial.org/standards/wfs">WFS (Web feature service)</a></li>
</ul>
<p>One way to leverage these standards is to use the <a title="geoserver" href="http://geoserver.org">geoserver project </a>for data storage and the <a href="http://openlayers.org/">openlayers project</a> web for showing and editing maps.<strong>update 2009-09-03</strong>: When integrating with the extjs framework , then it is worth using  the <a href="http://geoext.org">geoext project</a>.</p>
<p>An example snippet from geoserver shows the use of WFS-T for inserting geometric data with associated metadata for an alley in Tasmania. I&#8217;ll just bring it here:</p>
<p><code lang="xml"></p>
<p>xmlns:wfs="http://www.opengis.net/wfs"<br />
xmlns:topp="http://www.openplans.org/topp"<br />
xmlns:gml="http://www.opengis.net/gml"<br />
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:tasmania_roads"&gt;</p>
<p>494475.71056415,5433016.8189323 494982.70115662,5435041.95096618</p>
<p>alley</p>
<p></code></p>
<p>Note that oracle has a well supported ways of extracting GML from spatial datatypes if you need to construct the wfs transactions yourself ( <a href="http://www.oracle.com/technology/sample_code/products/spatial/index.html">oracle locator</a> )</p>
<p>At the first glance wfs can seem a bit complicated. Luckily openlayers has nice wrappings for it that is easily accessed from code  as shown in one of their examples running <a href="http://openlayers.org/dev/examples/wfs-t.html">here</a> :</p>
<p><script src="https://gist.github.com/1046699.js"> </script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/09/02/openlayers-2-8-supports-wfs-t/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>closures -oh yeah?</title>
		<link>http://www.pedant.dk/2009/07/16/closures-oh-yeah/</link>
		<comments>http://www.pedant.dk/2009/07/16/closures-oh-yeah/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 09:09:42 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=514</guid>
		<description><![CDATA[Hvad mon der sker her : var a=1; function foo() { var a; function bar() { a=2; return a; } return bar; } a=3; var b=foo(); var c=b(); alert(c); alert(a);]]></description>
			<content:encoded><![CDATA[<p>Hvad mon der sker her :</p>
<p><code lang="javascript"><br />
  var a=1;<br />
  function foo() {<br />
    var a;<br />
   function bar() {<br />
     a=2;<br />
     return a;<br />
   }<br />
  return bar;<br />
  }</p>
<p>  a=3;<br />
  var b=foo();<br />
  var c=b();<br />
  alert(c);<br />
  alert(a);<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/07/16/closures-oh-yeah/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

