<?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>alfa.org.uk</title>
	<atom:link href="http://www.alfa.org.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alfa.org.uk</link>
	<description>somewhere only we know</description>
	<lastBuildDate>Mon, 02 Mar 2009 12:14:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Your Nintendo Wii order with Play.com</title>
		<link>http://www.alfa.org.uk/2006/11/07/your-nintendo-wii-order-with-playcom/</link>
		<comments>http://www.alfa.org.uk/2006/11/07/your-nintendo-wii-order-with-playcom/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 11:39:13 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/11/07/your-nintendo-wii-order-with-playcom/</guid>
		<description><![CDATA[Dear Customer,
Due to a European shortage of the Nintendo Wii Consoles, we regret to inform you that Play.com will be unable to supply your pre-ordered Nintendo Wii at launch. As an Official distributor of Nintendo products we are guaranteed more stock before Christmas, but Nintendo have informed us, along with all other official Nintendo retailers, [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Dear Customer,</p>
<p>Due to a European shortage of the Nintendo Wii Consoles, we regret to inform you that Play.com will be unable to supply your pre-ordered Nintendo Wii at launch. As an Official distributor of Nintendo products we are guaranteed more stock before Christmas, but Nintendo have informed us, along with all other official Nintendo retailers, that the console will not be freely available until next year.</p>
<p>All pre-orders will be fulfilled on a first come, first served basis and we will fulfil your order as soon as we can.</p>
<p>If you no longer wish to keep your pre-order with Play.com please login to your account and remove the item from your Outstanding Orders.</p></blockquote>
<p>AAAAAAARRRRRRRRRRRGGGGGGGGGHHHHHHHHHHH!!!!!!!!!!!!                                          </p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/11/07/your-nintendo-wii-order-with-playcom/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hallowe&#8217;en</title>
		<link>http://www.alfa.org.uk/2006/10/30/halloween/</link>
		<comments>http://www.alfa.org.uk/2006/10/30/halloween/#comments</comments>
		<pubDate>Mon, 30 Oct 2006 11:09:43 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/10/30/halloween/</guid>
		<description><![CDATA[Two points.

When did Hallowe&#8217;en lose its apostrophe? It always had one when I was a kid; now it seems to be &#8220;halloween&#8221; everywhere&#8230;
When did it become such a big deal? It seems every shop is full of cheap plastic pumpkins and witches hats. I&#8217;m sure someone could write something erudite about how the secularisation of [...]]]></description>
			<content:encoded><![CDATA[<p>Two points.</p>
<ol>
<li>When did Hallowe&#8217;en lose its apostrophe? It always had one when I was a kid; now it seems to be &#8220;halloween&#8221; everywhere&#8230;</li>
<li>When did it become such a big deal? It seems every shop is full of cheap plastic pumpkins and witches hats. I&#8217;m sure someone could write something erudite about how the secularisation of Britain has combined with the shops&#8217; need to have something to fill the space between &#8220;Back To School&#8221; and &#8220;Christmas&#8221;&#8230;</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/10/30/halloween/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>T-shirt</title>
		<link>http://www.alfa.org.uk/2006/10/11/t-shirt/</link>
		<comments>http://www.alfa.org.uk/2006/10/11/t-shirt/#comments</comments>
		<pubDate>Wed, 11 Oct 2006 09:50:23 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[humour]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/10/11/t-shirt/</guid>
		<description><![CDATA[This T-shirt is so freaking cool &#8211; I love it :-)
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.threadless.com/product/623/Haikus_are_easy_but">This T-shirt</a> is so freaking cool &#8211; I love it :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/10/11/t-shirt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lego Ice Cubes</title>
		<link>http://www.alfa.org.uk/2006/10/05/lego-ice-cubes/</link>
		<comments>http://www.alfa.org.uk/2006/10/05/lego-ice-cubes/#comments</comments>
		<pubDate>Thu, 05 Oct 2006 09:38:49 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/10/05/lego-ice-cubes/</guid>
		<description><![CDATA[I found this &#8211; it lets you make ice cubes in the shape of Lego bricks! How cool!
I have ordered some :-)
]]></description>
			<content:encoded><![CDATA[<p>I found <a href="http://shop.lego.com/product.asp?p=4277645">this</a> &#8211; it lets you make ice cubes in the shape of Lego bricks! How cool!</p>
<p>I have ordered some :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/10/05/lego-ice-cubes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Piano piano piano</title>
		<link>http://www.alfa.org.uk/2006/10/02/piano-piano-piano/</link>
		<comments>http://www.alfa.org.uk/2006/10/02/piano-piano-piano/#comments</comments>
		<pubDate>Mon, 02 Oct 2006 15:57:06 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/10/02/piano-piano-piano/</guid>
		<description><![CDATA[BBC 4 has recently had a season of programmes relating to the piano. There was coverage of the Leeds International Pianoforte Competition, as well as a number of excellent documentaries, including a fascinating programme about the life and recordings of Glenn Gould. I would highly recommend watching any of them when they are repeated (as [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bbc.co.uk/bbcfour/">BBC 4</a> has recently had a season of programmes relating to the piano. There was coverage of the <a href="http://www.leedspiano.com/">Leeds International Pianoforte Competition</a>, as well as a number of excellent documentaries, including a fascinating programme about the life and recordings of Glenn Gould. I would highly recommend watching any of them when they are repeated (as they surely will be since they are on one of the BBC&#8217;s digital channels).</p>
<p>I&#8217;ve also started listening to more Keith Jarrett, and I&#8217;ve produced a basic transcription of his improvisation <em>Radiance #8</em>.</p>
<p>Watching the Gould programme made me go back and listen again to his awesome recordings of the <em>Goldberg Variations</em>. It&#8217;s such a fantastic piece &#8211; I&#8217;ve ordered the sheet music online.</p>
<p>I&#8217;m going to find out exactly what damage only playing on an electric piano has done to my technique&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/10/02/piano-piano-piano/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom foreach behaviour in Java using inner classes</title>
		<link>http://www.alfa.org.uk/2006/09/28/custom-foreach-behaviour-in-java-using-inner-classes/</link>
		<comments>http://www.alfa.org.uk/2006/09/28/custom-foreach-behaviour-in-java-using-inner-classes/#comments</comments>
		<pubDate>Thu, 28 Sep 2006 12:19:08 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[computers]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/09/28/custom-foreach-behaviour-in-java-using-inner-classes/</guid>
		<description><![CDATA[One of the most widely-anticipated and useful language updates in Java 5 was the introduction of a &#8220;foreach&#8221; construct, to reduce the amount of boilerplate code which needs to be written when a programmer wants to iterate over all the elements in a collection. Languages such as C# and PHP have had the feature for [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most widely-anticipated and useful language updates in Java 5 was the introduction of a &#8220;foreach&#8221; construct, to reduce the amount of boilerplate code which needs to be written when a programmer wants to iterate over all the elements in a collection. Languages such as C# and PHP have had the feature for a long time, and Java programmers were clamouring for it too.</p>
<p>The syntax looks like:</p>
<pre><code>for (element foo : collection) {
    ...
}
</code></pre>
<p>To allow your own classes to be iterated over with the foreach construct they must implement the new Iterable interface and thus provide an &#8220;iterator()&#8221; method to return the appropriate Iterator object.</p>
<p>However, there is a limitation in the current implementation. In some code I was writing I found I had a class which looked like:</p>
<pre><code>public class Foo {
    private List&lt;Integer&gt; intList = new ArrayList&lt;Integer&gt;();
    private List&lt;Float&gt; floatList = new ArrayList&lt;Float&gt;();
}
</code></pre>
<p>I wanted the user of Foo to be able to choose to iterate over either the intList or floatList. My first attempt was:</p>
<pre><code>public class Foo implements Iterable&lt;Integer&gt;, Iterable&lt;Float&gt; {
    private List&lt;Integer&gt; intList = new ArrayList&lt;Integer&gt;();
    private List&lt;Float&gt; floatList = new ArrayList&lt;Float&gt;();

    public Iterator&lt;Integer&gt; iterator() {
        return intList.iterator();
    }

    public Iterator&lt;Float&gt; iterator() {
        return floatList.iterator();
    }
}
</code></pre>
<p>But it won&#8217;t compile! The problem is that you are not permitted to implement the same interface more than once, even if you use a different generic type each time.</p>
<p>I&#8217;m not sure why this is, but I guess it has something to do with the requirement to support legacy code without modification. It meant that being able to write:</p>
<pre><code>Foo foo;
for (Integer i : foo) {
    ...
}
for (Float f : foo) {
    ...
}
</code></pre>
<p>was impossible.</p>
<p>I thought about this for a day or two until a solution popped into my head (after a few beers, as often happens!). It is possible if we use Java&#8217;s support for inner classes. The code isn&#8217;t quite as simple, but it&#8217;s the best we can do &#8211; and the difference to the user is so small that I think it&#8217;s a neat solution. The code follows:</p>
<pre><code>public class Foo {
    private List&lt;Integer&gt; intList = new ArrayList&lt;Integer&gt;();
    private List&lt;Float&gt; floatList = new ArrayList&lt;Float&gt;();

    public class Integers implements Iterable&lt;Integer&gt; {
        public Iterator&lt;Integer&gt; iterator() {
            return intList.iterator();
        }
    }

    public class Floats implements Iterable&lt;Float&gt; {
        public Iterator&lt;Float&gt; iterator() {
            return floatList.iterator();
        }
    }
}
</code></pre>
<p>The user code looks like:</p>
<pre><code>Foo foo;
for (Integer i : foo.new Integers()) {
    ...
}
for (Float f : foo.new Floats()) {
    ...
}
</code></pre>
<p>I&#8217;m quite pleased with this solution. I wouldn&#8217;t go as far as to call it a design pattern, but it certainly allows us to work around one of the limitations of Java generics.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/09/28/custom-foreach-behaviour-in-java-using-inner-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Da Vinci Code</title>
		<link>http://www.alfa.org.uk/2006/04/27/da-vinci-code/</link>
		<comments>http://www.alfa.org.uk/2006/04/27/da-vinci-code/#comments</comments>
		<pubDate>Thu, 27 Apr 2006 20:05:13 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/04/27/da-vinci-code/</guid>
		<description><![CDATA[Ooh, the judge on the Da Vinci code case has hidden a code in his judgement:
smithycodeJaeiextostgpsacgreamqwfkadpmqzv
I started to investigate it. It is not:

Caesar cipher (including ROT-13 ;) )
Atbash cipher
Vigenere with key of DAVINCI or SMITHYCODE

There isn&#8217;t enough ciphertext to use any of the standard attacks against Vigenere, so I just tried a few guessed keys. [...]]]></description>
			<content:encoded><![CDATA[<p>Ooh, the judge on the Da Vinci code case has hidden a code in his judgement:</p>
<p>smithycodeJaeiextostgpsacgreamqwfkadpmqzv</p>
<p>I started to investigate it. It is not:</p>
<ol>
<li>Caesar cipher (including ROT-13 ;) )</li>
<li>Atbash cipher</li>
<li>Vigenere with key of DAVINCI or SMITHYCODE</li>
</ol>
<p>There isn&#8217;t enough ciphertext to use any of the standard attacks against Vigenere, so I just tried a few guessed keys. If it is Vigenere then someone will have to get lucky.</p>
<p>A few people online have noticed that the ciphertext is the same length as &#8220;do not waste the time of the high court&#8221;&#8230;.</p>
<p><strong>UPDATE:</strong> It&#8217;s been solved! And it <em>was</em> Vigenere. The key was generated from the Fibonacci sequence (mentioned in the book apparently).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/04/27/da-vinci-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BBC Open Programme Catalogue</title>
		<link>http://www.alfa.org.uk/2006/04/26/bbc-open-programme-catalogue/</link>
		<comments>http://www.alfa.org.uk/2006/04/26/bbc-open-programme-catalogue/#comments</comments>
		<pubDate>Wed, 26 Apr 2006 16:50:39 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/04/26/bbc-open-programme-catalogue/</guid>
		<description><![CDATA[The BBC has launched an experimental interface to their programme database. It allows you to search and find programmes from throughout the BBC&#8217;s history. It&#8217;s pretty good &#8211; I was quickly able to locate the episode of Blue Peter I appeared on.  Yes, I still have my Blue Peter badge &#8211; I have not [...]]]></description>
			<content:encoded><![CDATA[<p>The BBC has launched an experimental <a href="http://open.bbc.co.uk/catalogue/infax">interface to their programme database</a>. It allows you to search and find programmes from throughout the BBC&#8217;s history. It&#8217;s pretty good &#8211; I was quickly able to locate <a href="http://open.bbc.co.uk/catalogue/infax/programme/LCKP344T">the episode of Blue Peter I appeared on</a>.  Yes, I still have my Blue Peter badge &#8211; I have not sold it on eBay.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/04/26/bbc-open-programme-catalogue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>That&#8230; Is The Sound Of Inevitability</title>
		<link>http://www.alfa.org.uk/2006/04/13/that-is-the-sound-of-inevitability/</link>
		<comments>http://www.alfa.org.uk/2006/04/13/that-is-the-sound-of-inevitability/#comments</comments>
		<pubDate>Thu, 13 Apr 2006 18:54:21 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/04/13/that-is-the-sound-of-inevitability/</guid>
		<description><![CDATA[Obviously upgrading my blogging software and using a new theme is FAR more important than actually writing anything&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Obviously upgrading my blogging software and using a new theme is FAR more important than actually writing anything&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/04/13/that-is-the-sound-of-inevitability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pakistan cartoon violence spreads</title>
		<link>http://www.alfa.org.uk/2006/02/15/pakistan-cartoon-violence-spreads/</link>
		<comments>http://www.alfa.org.uk/2006/02/15/pakistan-cartoon-violence-spreads/#comments</comments>
		<pubDate>Wed, 15 Feb 2006 13:46:30 +0000</pubDate>
		<dc:creator>alfa</dc:creator>
				<category><![CDATA[humour]]></category>
		<category><![CDATA[politics]]></category>

		<guid isPermaLink="false">http://www.alfa.org.uk/2006/02/15/pakistan-cartoon-violence-spreads/</guid>
		<description><![CDATA[Pakistan cartoon violence spreads. This headline gives me images of crowds of Pakistanis all fighting Tom&#8217;n'Jerry style &#8211; using ACME dynamite and the like :-)
]]></description>
			<content:encoded><![CDATA[<p><a href="http://news.bbc.co.uk/1/hi/world/south_asia/4715084.stm">Pakistan cartoon violence spreads</a>. This headline gives me images of crowds of Pakistanis all fighting Tom&#8217;n'Jerry style &#8211; using ACME dynamite and the like :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfa.org.uk/2006/02/15/pakistan-cartoon-violence-spreads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
