<?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"
	>

<channel>
	<title>derek wilson</title>
	<atom:link href="http://www.worldolio.com/derek/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.worldolio.com/derek/wordpress</link>
	<description>What could possibly go wrong</description>
	<pubDate>Thu, 23 Feb 2012 05:48:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>I have moved blog</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=232</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=232#comments</comments>
		<pubDate>Thu, 23 Feb 2012 05:48:14 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=232</guid>
		<description><![CDATA[I have now moved this blog from http://www.worldolio.com/derek/wordpress/ to its new home in the derekwilson.net domain. This space will stay here for a little while but please update your web reference and feed reference to the new site. 
]]></description>
			<content:encoded><![CDATA[<p>I have now moved this blog from <a href="http://www.worldolio.com/derek/wordpress/">http://www.worldolio.com/derek/wordpress/</a> to its new home in the <a href="http://derekwilson.net/">derekwilson.net</a> domain. This space will stay here for a little while but please update your <a href="http://derekwilson.net/derekblog/">web reference</a> and <a href="http://derekwilson.net/derekblog/syndication.axd">feed reference</a> to the new site. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=232</wfw:commentRss>
		</item>
		<item>
		<title>Things I have learnt</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=231</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=231#comments</comments>
		<pubDate>Sat, 14 Jan 2012 06:09:00 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=231</guid>
		<description><![CDATA[I started this blog about three year ago. Its not the first blog I had had a go at like a lot of people over the last ten years I have started with all the best intentions and then it petered out. 
This blog is different – I have actually kept at it. The idea [...]]]></description>
			<content:encoded><![CDATA[<p>I started this blog about three year ago. Its not the first blog I had had a go at like a lot of people over the last ten years I have started with all the best intentions and then it petered out. </p>
<p>This blog is different – I have actually kept at it. The idea has been to set realistic goals, in this case of a post every month. I have tried to learn something new every month and document it in a comprehensive manner and I think I am quite pleased with the result and the fact that it keeps me trying to grow and develop.</p>
<p>This month I have upped sticks and moved from my home in the UK to live in New Zealand. What I have learnt this month is that if you do something like this it pretty much takes up all your time, hence this somewhat cheating entry.</p>
<p>In order that I can do next months post I have a real deadline for sorting out broadband, and a house, oh and a job – there are some details to attend to.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=231</wfw:commentRss>
		</item>
		<item>
		<title>A Festive Peer Review</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=230</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=230#comments</comments>
		<pubDate>Thu, 22 Dec 2011 20:32:00 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=230</guid>
		<description><![CDATA[Its the festive season and I bake a Christmas cake most years. I bake it in August and then let it mature until December. I was given a Christmas cook book years ago and have used the recipe out of that book ever since.
Last year I decided to seek a peer review of the cake [...]]]></description>
			<content:encoded><![CDATA[<p>Its the festive season and I bake a Christmas cake most years. I bake it in August and then let it mature until December. I was given a Christmas cook book years ago and have used the recipe out of that book ever since.</p>
<p>Last year I decided to seek a peer review of the cake and who would be better to do that than mum. She said it was very nice but I had used so much fruit that the cake tended to fall apart, now that she mentioned it all my Christmas cakes have fallen apart. She said I needed to use more flour in the mix as this would get the cake to bind.</p>
<p>And she was right, this years cake is much better.</p>
<p><a href="http://www.worldolio.com/derek/wordpress/wp-content/uploads/Peer-Review_11FF2/P1010474.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="P1010474" border="0" alt="P1010474" src="http://www.worldolio.com/derek/wordpress/wp-content/uploads/Peer-Review_11FF2/P1010474_thumb.png" width="317" height="198" /></a></p>
<p>It just goes to show that no matter how good I think I am doing having another set of eyes can make the results even better.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=230</wfw:commentRss>
		</item>
		<item>
		<title>FxCop suppression works in visual studio but not in MSBUILD</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=229</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=229#comments</comments>
		<pubDate>Tue, 29 Nov 2011 14:25:00 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=229</guid>
		<description><![CDATA[I had a very odd problem to solve recently, I needed to specify a SupressMessage attribute on some code however when I did decorate the code with SupressMessage FxCop on the build server still complained about the error. I had used FxCop locally to check the code before checking in and also used the FxCop [...]]]></description>
			<content:encoded><![CDATA[<p>I had a very odd problem to solve recently, I needed to specify a SupressMessage attribute on some code however when I did decorate the code with SupressMessage FxCop on the build server still complained about the error. I had used FxCop locally to check the code before checking in and also used the FxCop command “Copy as SuppressMessage” to make sure I didn’t type it wrong.</p>
<p> <span id="more-229"></span>
<p>Luckily this problem only seemed to afflict some projects in the solution so I could compare the projects that worked with my current project. It turned out that all the projects that worked specified CODE_ANALYSIS on the Build Tab.</p>
<p>&#160;<a href="http://www.worldolio.com/derek/wordpress/wp-content/uploads/FxCopsuppressionworksinvisualstudiobutno_C493/buildtabclip.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="buildtabclip" border="0" alt="buildtabclip" src="http://www.worldolio.com/derek/wordpress/wp-content/uploads/FxCopsuppressionworksinvisualstudiobutno_C493/buildtabclip_thumb.png" width="305" height="276" /></a> </p>
<p>The project that was causing the problem had used a check box on the Code Analysis tab labelled “Enable Code Analysis on Build (defines CODE_ANALYSIS constant)”.</p>
<p><a href="http://www.worldolio.com/derek/wordpress/wp-content/uploads/FxCopsuppressionworksinvisualstudiobutno_C493/condeanalysistabclip.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="condeanalysistabclip" border="0" alt="condeanalysistabclip" src="http://www.worldolio.com/derek/wordpress/wp-content/uploads/FxCopsuppressionworksinvisualstudiobutno_C493/condeanalysistabclip_thumb.png" width="307" height="216" /></a> </p>
<p>Now you might presume given the label that checking the box would define CODE_ANALYSIS – I know I did, however when I looked into the project XML file it turns out it did not.</p>
<p>Projects that checked the cleckbox on the Code Analysis tab looked like this</p>
<pre class="c#" name="code">&lt;PropertyGroup
 Condition=&quot; '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' &quot;&gt;
  &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
  &lt;DebugType&gt;full&lt;/DebugType&gt;
  &lt;Optimize&gt;false&lt;/Optimize&gt;
  &lt;OutputPath&gt;bin\Debug\&lt;/OutputPath&gt;
  &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt;
  &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
  &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
  &lt;RunCodeAnalysis&gt;true&lt;/RunCodeAnalysis&gt;
&lt;/PropertyGroup&gt; </pre>
<p>and projects that used the old style CODE_ANALYSIS define on the build tab looked like this.</p>
<pre class="c#" name="code">&lt;PropertyGroup
 Condition=&quot; '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' &quot;&gt;
  &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
  &lt;DebugType&gt;full&lt;/DebugType&gt;
  &lt;Optimize&gt;false&lt;/Optimize&gt;
  &lt;OutputPath&gt;bin\Debug\&lt;/OutputPath&gt;
  &lt;DefineConstants&gt;TRACE;DEBUG;CODE_ANALYSIS&lt;/DefineConstants&gt;
  &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
  &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
  &lt;RunCodeAnalysis&gt;false&lt;/RunCodeAnalysis&gt;
&lt;/PropertyGroup&gt;</pre>
<p>Notice that where we used the checkbox on the Code Analysis tab the CODE_ANALYSIS constant is not defined.</p>
<p>Sometime when I am trying to sort out bizarre little details like this I wonder if it really is a good use of my time. However later I was talking to another developer and he had run into the issue where SupressMessage was not working on the build server and his response had been to turn FxCop off for that project, when we turned FxCop back on there were hundreds of errors that now needed fixing – my conclusion was that it is worth the time to get to the bottom of this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=229</wfw:commentRss>
		</item>
		<item>
		<title>Testing jQuery behaviour using jasmine-jquery</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=227</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=227#comments</comments>
		<pubDate>Tue, 25 Oct 2011 11:28:00 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=227</guid>
		<description><![CDATA[Recently I was working on a web page and I needed to add the ability to have certain LABEL element be highlighted with an icon and to have an alternative prompt. As often happens in web development the elements to be highlighted were delivered to the page using a JavaScript array planted from the server [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on a web page and I needed to add the ability to have certain LABEL element be highlighted with an icon and to have an alternative prompt. As often happens in web development the elements to be highlighted were delivered to the page using a JavaScript array planted from the server side and although I could have changed this mechanism it would be less intrusive if I could work within the existing framework.</p>
<p>The behaviour that was required was that each LABEL to be highlighted would have the its FOR attribute value listed in a global array. Each LABEL needs to be wrapped in a SPAN with a specific CLASS (this was due to the CSS delivered by a design agency) and then the highlight prompt displayed.</p>
<p>In reality I would write the behaviour tests first however as I want to contrast different methods of testing I will list the code first.</p>
<pre class="c#" name="code">function HandleOneLabel(label,labelForId) {
  // add the tip icon with a derived ID
  // prepend to get the vertical position right in IE8
  label.prepend(&quot;&lt;span id='&quot; + this + &quot;_tip' class='tip'&gt;&lt;/span&gt;&quot;);

  // display the correct prompt
  $(&quot;.normalPrompt&quot;, label).hide();
  $(&quot;.highlightPrompt&quot;, label).show();
}

function HandleAllLabels() {
  if (typeof allLabels !== &quot;undefined&quot;) {

    jQuery.each(allLabels, function (index, value) {
      // find the label element for each label listed
      var label = $(&quot;label[for='&quot; + this + &quot;']&quot;);

      HandleOneLabel(label,this);
    });
  };
}</pre>
<p>Testing HandleOneLabel seems relatively straightforward, for this project I was using <a href="http://pivotal.github.com/jasmine/">jasmine</a> as the testing framework so I wrote a test like this.</p>
<pre class="c#" name="code">describe(&quot;HandleOneLabels&quot;, function () {

  var label;

  beforeEach(function () {
  });

  describe(&quot;When handling one label&quot;, function () {

    beforeEach(function () {
      label = jasmine.createSpyObj(&quot;label&quot;, [
        &quot;prepend&quot;
      ]);

      HandleOneLabel(label, 'TESTID');
    });

    it(&quot;should add the tip icon&quot;, function () {
      expect(label.prepend).toHaveBeenCalledWith(
          &quot;&lt;span id='TESTID_tip' class='tip'&gt;&lt;/span&gt;&quot;);
    });
  });
});</pre>
<p>This form of testing appears to work well because the HandleOneLabel can easily be called with a jasmine mock object.</p>
<p>However when I looked at the kind of testing that would be possible for HandleAllLabels then it would obviously be more tricky. In general for a lot of the pages in the site the structure of the JavaScript was to have a view with all the <a href="http://jquery.com/">jQuery</a> selectors and a controller with the logic however this code was global utility code and splitting it up into controllers and views just to make testing easier seemed wrong to me.</p>
<p>I looked around and found an interesting project called <a href="https://github.com/velesin/jasmine-jquery">jasmine-javascript</a> that provided a framework for testing jQuery and JavaScript together. </p>
<p>I was (and I guess I am still) considering the validity of this approach, after all the separation into views and controllers is a good model, however I did like the way the tests mapped very well onto the desired behaviour. The tests looked like this (the multiline string literal labelHtml is laid out over multiple lines for readability)</p>
<pre class="c#" name="code">// this is planted in the ASPX file in the real web site
var allLabels = [];

describe(&quot;HandleAllLabels&quot;, function () {

  var labelHtml = &quot;&lt;label for='TESTLABEL'&gt;
       &lt;span class='highlightPrompt'&gt;highlight prompt&lt;/span&gt;
       &lt;span class='normalPrompt'&gt;normal prompt&lt;/span&gt;
       &lt;span id='TESTSPANID'&gt;always here&lt;/span&gt;
       &lt;/label&gt;&quot;;

  beforeEach(function () {
  });

  describe(&quot;When handling all labels&quot;, function () {

    var labelAfterProcessing;

    beforeEach(function () {

      allLabels = ['TESTLABEL'];
      setFixtures(labelHtml);

      HandleAllLabels();
      labelAfterProcessing = $(&quot;label[for='TESTLABEL']&quot;);
    });

    describe(&quot;When adding the info tip&quot;, function () {

      var tipIcon;

      beforeEach(function () {
        // the tip icon should be the 1st child - for a bug in IE8
        tipIcon = labelAfterProcessing.children(&quot;:first&quot;);
      });

      it(&quot;tip icon has the correct ID&quot;, function () {
        expect(tipIcon).toHaveId(&quot;TESTLABEL_tip&quot;);
      });

      it(&quot;should have the correct class&quot;, function () {
        expect(tipIcon).toHaveClass('tip');
      });

      it(&quot;should have the correct element type&quot;, function () {
        expect(tipIcon).toBe(&quot;SPAN&quot;);
      });
    });

    describe(&quot;When setting up the prompt&quot;, function () {

      it(&quot;should hide the normal prompts&quot;, function () {
        var normalPrompts =
          labelAfterProcessing.children(&quot;.normalPrompt&quot;);

        expect(normalPrompts.length).not.toEqual(0);
        normalPrompts.each(function (index) {
          expect($(this)).toBeHidden();
        });
      });
      it(&quot;should show the highlight prompts&quot;, function () {
        var highlightPrompts =
          labelAfterProcessing.children(&quot;.highlightPrompt&quot;);

        expect(highlightPrompts.length).not.toEqual(0);
        highlightPrompts.each(function (index) {
          expect($(this)).toBeVisible();
        });
      });
      it(&quot;should leave other prompts alone&quot;, function () {
        var otherPrompt =
          labelAfterProcessing.children(&quot;#TESTSPANID&quot;);

        expect(otherPrompt.length).not.toEqual(0);
          otherPrompt.each(function (index) {
            expect($(this)).toBeVisible();
          });
        });
      });
    });
});</pre>
<p><a href="https://github.com/velesin/jasmine-jquery">jasmine-jquery</a> enables me to inject test HTML into the code under test by using setFixtures call, it also enables the tests to access the HTML after the code has been run and assign it to labelAfterProcessing as well as providing a host of convenient jQuery matches such as toBe, toHaveId, toHaveClass etc.</p>
<p>As it happens things are never as straightforward as they might be and it turns out that the match toBeHidden does not work correctly in IE8 (one of our target browsers) so I did need to rewrite one of the test like so</p>
<pre class="c#" name="code">      it(&quot;should hide the normal prompts&quot;, function () {
        var normalPrompts =
          labelAfterProcessing.children(&quot;.normalPrompt&quot;);

        expect(normalPrompts.length).not.toEqual(0);
          normalPrompts.each(function (index) {
          // bug in IE8 with the current version of jQuery
          //expect($(this)).toBeHidden();
          expect($(this).attr(&quot;style&quot;).toLowerCase())
            .toContain(&quot;display: none&quot;);
        });
      });</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=227</wfw:commentRss>
		</item>
		<item>
		<title>TiddlyWiki on small screen devices - available for download</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=226</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=226#comments</comments>
		<pubDate>Mon, 26 Sep 2011 21:16:00 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[TiddlyWiki]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=226</guid>
		<description><![CDATA[Last month I described how I got the pipe symbol to work in TiddlyWiki on my HTC Wildfire.
I got to TiddlyWiki for small screen devices by downloading AndTidWiki, this in turn was based on iTW. The thing is that its based on TiddlyWiki v2.4.1, the current version is v2.6.4 and now includes jQuery.
I took a [...]]]></description>
			<content:encoded><![CDATA[<p>Last month I described <a href="http://www.worldolio.com/derek/wordpress/?p=225">how I got the pipe symbol to work in TiddlyWiki on my HTC Wildfire</a>.</p>
<p>I got to TiddlyWiki for small screen devices by downloading <a href="http://www.appbrain.com/app/andtidwiki-beta/de.mgsimon.android.andtidwiki">AndTidWiki</a>, this in turn was based on <a href="http://itw.bidix.info/">iTW</a>. The thing is that its based on TiddlyWiki v2.4.1, the current version is v2.6.4 and now includes jQuery.</p>
<p>I took a little time and also had help from <a href="http://www.lightbulbsoftware.com/andrew/blog/">Andrew</a> and we have put together a Powershell script that will take a release copy of the TiddlyWiki from the <a href="http://www.tiddlywiki.com/archive/">published archives</a> and will add in the modifications that were made to the base TiddlyWiki by <a href="http://bidix.info/TiddlyWiki/">bidx</a> (for iTW) as well the the modification that I made to use an alternative pipe symbol on HTC android phones. The effect of this is that it is now possible to generate a TiddlyWiki for phones that is based on the latest version of TiddlyWiki. Run the scripts and then just copy the HTML file to your phone.</p>
<p>While I was doing it I also made another modification to automatically dismiss the popup div that is displayed as a successful save confirmation. The popup is all well and good but I found it annoying to have to dismiss it every time I pressed “Done”, the modification leaves the popup there for five seconds and then dismisses it.</p>
<p>We have put the all the scripts that you need to generate your own Tiddlywiki in a repository called <a href="https://bitbucket.org/derekwilson/tiddlywiki4phone/overview">TiddlyWiki4Phone</a> on bitbucket – enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=226</wfw:commentRss>
		</item>
		<item>
		<title>TiddlyWiki on android phones&#8211;using the pipe symbol</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=225</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=225#comments</comments>
		<pubDate>Wed, 24 Aug 2011 18:40:00 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[TiddlyWiki]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=225</guid>
		<description><![CDATA[Solving this problem made me laugh, and cry. It did remind me of something I heard years ago
What is the difference between hardware and software? If you play with hardware enough you will break it, if you play with software enough you might just get it to work.

I like using tiddlywiki, I’ve used it as [...]]]></description>
			<content:encoded><![CDATA[<p>Solving this problem made me laugh, and cry. It did remind me of something I heard years ago</p>
<blockquote><p>What is the difference between hardware and software? If you play with hardware enough you will break it, if you play with software enough you might just get it to work.</p>
</blockquote>
<p>I like using <a href="http://www.tiddlywiki.com/">tiddlywiki</a>, I’ve used it as a super todo.txt for a long time. I stumbled on an <a href="http://www.appbrain.com/app/andtidwiki-beta/de.mgsimon.android.andtidwiki">implementation for Android</a> which in turn was based on <a href="http://itw.bidix.info/">iTW</a> for the iPhone. The iTW tiddlywiki has been tweaked to only display one tiddler at once and the render and toolbar has been optimised for a small screen.</p>
<p>I got it and downloaded it and all was well it worked straight out of the box on my HTC Wildfire. I just wanted to put a few notes into it to get started, this worked fine and then I tried to edit a table, ahhhh problem.</p>
<p>Like a lot of Wiki markup languages <a href="http://tiddlywiki.org/bags/tiddlywiki_public/tiddlers/TiddlyWiki%20Markup.html">tables are constructed out of the pipe symbol</a> and then I found a problem – the stock HTC keyboard <a href="http://www.geekzone.co.nz/forums.asp?forumid=97&amp;topicid=70626">does not have a pipe symbol</a>, you can get alternate keyboards but these seem to involve “rooting” the device – it seemed a bit of overkill to me. If I went to the symbol page of the keyboard input and pressed the 1/2 button to go the the second page of symbols there is a ¦ symbol which is not the same as a pipe |. Annoyingly there are even blank unused keys on the second page of symbols.</p>
<p>Anyway it did give me an opportunity to have a go at starting to modify the TiddlyWiki. This is what I did, I found the section of code in the TiddlyWiki HTML file that was responsible for formatting a table, in a blank AndTidWiki file its at line 3185 but looking for “table” soon finds it – it looks like this</p>
<pre class="c#" name="code">//--
//-- Standard formatters
//--

config.formatters = [
{
 name: &quot;table&quot;,
 match: &quot;^\\|(?:[^\\n]*)\\|(?:[fhck]?)$&quot;,
 lookaheadRegExp: /^\|([^\n]*)\|([fhck]?)$/mg,
 rowTermRegExp: /(\|(?:[fhck]?)$\n?)/mg,
 cellRegExp: /(?:\|([^\n\|]*)\|)|(\|[fhck]?$\n?)/mg,
 cellTermRegExp: /((?:\x20*)\|)/mg,
 rowTypes: {&quot;c&quot;:&quot;caption&quot;, &quot;h&quot;:&quot;thead&quot;, &quot;&quot;:&quot;tbody&quot;, &quot;f&quot;:&quot;tfoot&quot;},
 handler: function(w)
 {
  var table = createTiddlyElement(w.output,&quot;table&quot;,null,&quot;twtable&quot;);</pre>
<p>And I replaced it with this, which just modifies the regular expressions to accept either a pipe or the double vertical bar</p>
<pre class="c#" name="code"> match: &quot;^[\\|¦](?:[^\\n]*)[\\|¦](?:[fhck]?)$&quot;,
 lookaheadRegExp: /^[\|¦]([^\n]*)[\|¦]([fhck]?)$/mg,
 rowTermRegExp: /([\|¦](?:[fhck]?)$\n?)/mg,
 cellRegExp: /(?:[\|¦]([^\n\|¦]*)[\|¦])|([\|¦][fhck]?$\n?)/mg,
 cellTermRegExp: /((?:\x20*)[\|¦])/mg,</pre>
<p>Basically its a very simple edit – I just made the pipe and the HTC double vertical bar work interchangeable and I could use either – pipe is easier on a PC keyboard and the ¦ the only option at the moment on the phone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=225</wfw:commentRss>
		</item>
		<item>
		<title>podcastutilities: now supports downloading and synchronising</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=223</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=223#comments</comments>
		<pubDate>Sat, 30 Jul 2011 16:53:00 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[PodcastUtilities]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=223</guid>
		<description><![CDATA[A couple of months ago I mentioned PodcastUtilities. This month we have produced a new version of PodcastUtilities that now supports downloading and synchronising podcast media files. You can download a compiled version of PodcastUtilities in a zip file from BitBucket
For the last five years I have been using Juice and it has provided sterling [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of months ago <a href="http://www.worldolio.com/derek/wordpress/?p=219">I mentioned</a> PodcastUtilities. This month we have produced a new version of PodcastUtilities that now supports downloading and synchronising podcast media files. You can download a compiled version of PodcastUtilities in a <a href="https://bitbucket.org/derekwilson/podcastutilities/downloads">zip file from BitBucket</a></p>
<p>For the last five years I have been using <a href="http://juicereceiver.sourceforge.net/">Juice</a> and it has provided sterling service as a podcast downloader, however it appears to have been dormant for the last six years since the <a href="http://www.tuaw.com/2005/11/14/apple-legal-forces-ipodder-name-change/">run in with Apple</a>. Sometimes Juice gets confused and downloads podcasts that it has already downloaded. Also, I download to a flash drive which means that I can use my main computer or my netbook to keep up to date with my podcasts, I use a <a href="http://portableapps.com/node/12082">portable version of Juice</a> from the utterly wonderful folk over at portable apps, however it does not seem to play well with Windows 7 and can sometimes get confused about where to store its downloads.</p>
<p>PodcastUtilities has now reached the stage where I can stop using Juice and move over to using my own app. If anyone else would like a downloader then <a href="https://bitbucket.org/derekwilson/podcastutilities/overview">head over to BitBucket</a> and give it a whirl.</p>
<h3>The main advantages of <span>PodcastUtilities</span></h3>
<p>· Portable    <br />Podcast Utilities is a “portable” application, in that it does not need to be installed and can be run from any drive type, local network or removable flash drive</p>
<p>· Configurable    <br />Almost any synchronisation solution can be configured, for example copy 3 of this podcast, all of these podcasts, in this order, and leave a certain amount of space on the device. The number of concurrent downloads can easily be configured.</p>
<p>· Lightweight    <br />The application does not use large amounts of memory in a system tray icon all the time its not being used, it only uses system resources when its being run.</p>
<p>· Scriptable    <br />Podcast Utilities lends itself to being run as a scheduled task or from a script. The API is “headless” and can easily be called and used from other applications</p>
<p>· Open Source    <br />The source is open and available</p>
<p>· Free    <br />There is no cost to using Podcast Utilities for any use.</p>
<p>· No need for an iTunes account    <br />Podcasts promoted on iTunes can be downloaded however there is no need to have an iTunes account.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=223</wfw:commentRss>
		</item>
		<item>
		<title>Code Review: Testing Behaviour</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=221</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=221#comments</comments>
		<pubDate>Tue, 07 Jun 2011 20:44:00 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[Code Review]]></category>

		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=221</guid>
		<description><![CDATA[During a code review of unit tests someone said something that I found very interesting. We had been looking at the structure of BDD (GivenThat and When) style tests and he said that he wanted tests to be written in such a way that if he wanted to refractor code but not change the overall [...]]]></description>
			<content:encoded><![CDATA[<p>During a code review of unit tests someone said something that I found very interesting. We had been looking at the structure of <a href="http://dannorth.net/introducing-bdd/">BDD</a> (GivenThat and When) style tests and he said that he wanted tests to be written in such a way that if he wanted to refractor code but not change the overall intent of code then the tests should not break – but of course they always did.</p>
<p>It made me think that when I have seen poor tests we end up with fragile tests that effectively just give us twice as much code to maintain. I do not think this should be used as an excuse to not write tests rather I think we should think about what we are trying to achieve.</p>
<p>Tests, especially BDD tests, should test the behaviour not the implementation. As an artificial example if we had a method that discovered if a given list of numbers contain any two numbers that are adjacent. That is when it is called with 4,7,9,6 it will return true, if called with 4,7,9 it will return false.</p>
<p>An obvious method of implementing this behaviour would be to sort the numbers and then look for adjacent numbers.</p>
<h3>Tests <span>I would expect to see</span></h3>
<p>The first two tests that string to mind, one a positive and one a negative, could be something like this.</p>
<pre class="csharp" name="code">public abstract class ItemFinderTests : WhenTestingBehaviour
{
  protected ItemFinder _selctor1;
  protected IList<int> _numbers;
  protected bool _result;

  protected override void GivenThat()
  {
    base.GivenThat();
    _selctor1 = new ItemFinder(new SystemDotNetSorter());
  }
}

public class WhenFindingAdjasentNumbers : ItemFinderTests
{
  protected override void GivenThat()
  {
    base.GivenThat();
    _numbers = new List<int>() {7,3,6};
  }

  protected override void When()
  {
    _result = _selctor1.HasAdjasentNunbers(_numbers);
  }

  [Test]
  public void ShouldFindAdjasentNumbers()
  {
    Assert.That(_result,Is.True);
  }
}

public class WhenNotFindingAdjasentNumbers : ItemFinderTests
{
  protected override void GivenThat()
  {
    base.GivenThat();
    _numbers = new List<int>() {3,6};
  }

  protected override void When()
  {
    _result = _selctor1.HasAdjasentNunbers(_numbers);
  }

  [Test]
  public void ShouldNotFindAdjasentNumbers()
  {
    Assert.That(_result, Is.False);
  }
}</pre>
<p>There are other tests that could and in fact should be written, for example testing empty lists and lists with one or two items in</p>
<h3>Tests <span>I would not expect to see</span></h3>
<p>In these tests I have mocked the object that supports ISorter, the object that is used to sort the list. In the previous tests I used a real concrete implementation. In some cases it is desirable to isolate tests from the underlying operating system or environment however in this case I’m not sure there is a great deal of benefit, in mocking the sorter, however I do not think that mocking (or not mocking) the sorter is a problem in itself.</p>
<pre class="csharp" name="code">public class ItemFinderTests2 : WhenTestingBehaviour
{
  private ItemFinder _selctor1;
  private IList<int> _numbers;
  private bool _result;
  private ISorter _sorter;
  private IList<int> _sortedNumbers;

  protected override void GivenThat()
  {
    base.GivenThat();

    _numbers = new List<int>() {7,3,6};
    _sortedNumbers = new List<int>() {3,6,7};

    _sorter = GenerateMock<isorter>();
    _sorter.Stub(s =&gt; s.Sort(_numbers)).Return(_sortedNumbers);

    _selctor1 = new ItemFinder(_sorter);
  }

  protected override void When()
  {
    _result = _selctor1.HasAdjasentNunbers(_numbers);
  }

  [Test]
  public void ShouldSortTheNumber()
  {
    _sorter.AssertWasCalled(s =&gt; s.Sort(_numbers));
  }

  [Test]
  public void ShouldFindAdjasentNumbers()
  {
    Assert.That(_result, Is.True);
  }
}</pre>
<p>When I see tests like this I think that we should not be writing tests that ensure that there are particular lines of code in the method we are testing. We do not care that the method uses the supplied sorter (or calls its sort method) only that it returns the correct result.</p>
<p>In general when we write code to satisfy BDD or TDD tests we are attempting to write the minimum amount of code that is needed to support the test and I think that we should also write the minimum amount of code in the tests that will test the behaviour we are expecting. Writing more than this gives us more code to maintain and more brittle tests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=221</wfw:commentRss>
		</item>
		<item>
		<title>PodcastUtilities</title>
		<link>http://www.worldolio.com/derek/wordpress/?p=219</link>
		<comments>http://www.worldolio.com/derek/wordpress/?p=219#comments</comments>
		<pubDate>Fri, 20 May 2011 08:00:00 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.worldolio.com/derek/wordpress/?p=219</guid>
		<description><![CDATA[I listen to lots of podcasts, both technical and for entertainment. The problem I have had for a long time is that I need software that will download episodes from a specified list of podcasts and, as I keep a large number of podcasts on my computer then synchronise a subset to a mobile device. [...]]]></description>
			<content:encoded><![CDATA[<p>I listen to lots of podcasts, both technical and for entertainment. The problem I have had for a long time is that I need software that will download episodes from a specified list of podcasts and, as I keep a large number of podcasts on my computer then synchronise a subset to a mobile device. Although there are options all seemed unsatisfactory somehow I object to running the large memory foot print of a program like iTunes when I really only need to download once a week. Also I wanted to be able to control which episodes were synchronised, 3 of this podcast, all of another, and none of the software I tried seemed to be able to support that level of configuration. </p>
<p>So the obvious solution, to me, was to write something that would do the job. It also give me an opportunity to collaborate with <a href="http://www.lightbulbsoftware.com/andrew/blog/">Andrew</a> on software which is fun, and I learn things and it gets written faster. It also gave us an opportunity to use <a href="https://bitbucket.org/">Mercurial as hosted by Bitbucket</a> while collaborating. We were both keen to explore working on a open source project.</p>
<p>Around Christmas we started working on utilities to handle synchronisation. This month we have opened to <a href="https://bitbucket.org/derekwilson/podcastutilities/wiki/Home">PodcastUtilities project</a> to everyone. PodcastUtilities are utilities that will provide portable, configurable,&#160; lightweight, scriptable utilities to download and synchronise podcasts. The initial codebase handles synchronisation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldolio.com/derek/wordpress/?feed=rss2&amp;p=219</wfw:commentRss>
		</item>
	</channel>
</rss>

