<?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>Matthew Walton's Blog &#187; Programming</title>
	<atom:link href="http://alledora.co.uk/wordpress/categories/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://alledora.co.uk</link>
	<description>...in which occasional posts describe occasionally boring things</description>
	<lastBuildDate>Sun, 07 Mar 2010 19:18:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Translating Python</title>
		<link>http://alledora.co.uk/wordpress/archives/2009/12/02/398</link>
		<comments>http://alledora.co.uk/wordpress/archives/2009/12/02/398#comments</comments>
		<pubDate>Wed, 02 Dec 2009 23:08:26 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[Perl 6]]></category>

		<guid isPermaLink="false">http://alledora.co.uk/?p=398</guid>
		<description><![CDATA[@paulrpotts tweeted about a blog entry explaining why the founder of a company chose Common Lisp for a web project. There were good reasons given for not using Python, which Paul agrees with, and Paul linked to a blog entry about some of his own experience in Python. In that is a bit of Python [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/paulrpotts">@paulrpotts</a> tweeted about a blog entry explaining why the founder of a company chose Common Lisp for a web project. There were good reasons given for not using Python, which Paul agrees with, and Paul linked to a <a href="http://praisecurseandrecurse.blogspot.com/2008/02/is-python-acceptable-haskell.html">blog entry</a> about some of his own experience in Python. In that is a bit of Python code, and I started thinking what it would look like in Perl 6.</p>

<p>The code relies on an <span class="caps">XML </span>node class, which is presumably one that you can find in Python&#8217;s library. Perl 6&#8217;s library is rather sparse right now, so I&#8217;m going to partially specify a Node class which is basically the same as the bits of it used by Paul&#8217;s Python code, just with some Perl 6-ish naming conventions.</p>



<pre>class Node {
  enum NodeType &lt;TextNode&gt;;
  has $.data;
  has Node @.child-nodes;
  has NodeType $.node-type;
  method get-elements-by-tag-name(Str $name) { ... }
}</pre>



<p>This, then, is a more or less direct translation of Paul&#8217;s Python code into Perl 6. The main difference is that Perl 6 has type annotations, we don&#8217;t have to import anything to get partial function application (that&#8217;s given by .assuming) and we don&#8217;t have to do any tricks to get string reduction, because of Perl 6&#8217;s [] metaoperator.</p>



<pre>
# Given a list of nodes, return the .data member of all nodes
# which have node-type of TextNode
sub get-text-data(Node @nodelist) {
    @nodelist.grep: { .node-type ~~ Node::TextNode }.map: { .data }
}

# Given a list of nodes, extract the text data and return it as
# one long string
sub extract-text(Node @nodelist) {
    [~] get-text-data(@nodelist);
}

# Given a node tree and an element name, find the first text
# element of that name and get the text from all its child nodes
sub get-one-text-element(Node $node, Str $name) {
    my @elements = $node.get-elements-by-tag-name($name);
    @elements.elems == 1 or die;
    extract-text(@elements[0].child-nodes);
}

# Given a node tree and a list of element names, extract all the
# text from each named node and return as a hash of name =&gt; text
sub make-text-element-dict(Node $node, Str @namelist) {
    return @namelist Z @namelist.map(
      &amp;get-one-text-element.assuming(node =&gt; $node)
    );
}</pre>



<p>This could of course be shorter &#8211; most of these subs don&#8217;t need to be defined here, we could turn it into a very few lines indeed, but I&#8217;m assuming that the subs might be needed elsewhere in the form presented here.</p>

<p>A few things to point out for Perl 6 novices:</p>

<p>As in Perl 5, variables starting with @ are arrays (if you want to get precise, it means there&#8217;s something in there which does the Positional role, so you can expect to be able to use [] element accessors and suchlike).</p>

<p>The [~] construct is actually two things &#8211; first, the infix operator ~, which in Perl 6 is string concatenation, surrounded by the [] metaoperator which turns it into a list reduction. Thus the effect is to concatenate all the list elements together and return one big string.</p>

<p>Perl 6 identifiers can have hyphens in them. The parser&#8217;s smart enough to distinguish between those and use of infix -.</p>

<p>Perl 6 subroutines can have formal parameter lists. These parameters, like Perl 6 variables, can have type information explicitly declared for strict checking.</p>

<p>You can pass blocks of code to methods like .map and .grep using :{} syntax, which saves some nested brackety things.</p>

<p>You can produce a curried version of a function using its .assuming method.</p>

<p>The infix operator Z works like the zip function in Python and Haskell.</p>

<p>I haven&#8217;t checked if this would compile, but I think it&#8217;s pretty close.</p>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2009/12/02/398/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Planless testing in Perl 6</title>
		<link>http://alledora.co.uk/wordpress/archives/2009/07/23/394</link>
		<comments>http://alledora.co.uk/wordpress/archives/2009/07/23/394#comments</comments>
		<pubDate>Thu, 23 Jul 2009 11:50:36 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[Perl 6]]></category>

		<guid isPermaLink="false">http://alledora.co.uk/?p=394</guid>
		<description><![CDATA[In #perl6, our eyes were caught by a post on Matt Trout&#8217;s blog concerning the problems which arise from the traditional Perl way of test modules which require you to state at the start of your test file how many tests you&#8217;ll be running. I&#8217;m not going to repeat his arguments because they&#8217;re good ones. [...]]]></description>
			<content:encoded><![CDATA[<p>In #perl6, our eyes were caught by <a href="http://www.shadowcat.co.uk/blog/matt-s-trout/a-cunning-no_plan/">a post on Matt Trout&#8217;s blog</a> concerning the problems which arise from the traditional Perl way of test modules which require you to state at the start of your test file how many tests you&#8217;ll be running. I&#8217;m not going to repeat his arguments because they&#8217;re good ones. It didn&#8217;t take a great deal for people to agree that we should have a planless testing module for Rakudo.</p>

<p>Rakudo already ships with a fairly basic Test.pm which already had some support for planless testing, although you still had to explicitly tell it that&#8217;s what you wanted:</p>



<pre>plan *;</pre>



<p>Whereas we&#8217;d rather like it if you could just leave out the call to plan when you weren&#8217;t planning (hah!) to use a plan. We also decided to use the done_testing idea, so that you call this in planless mode after your tests are complete to mark explicitly that you&#8217;ve run as many as you wanted to.</p>

<p>I was able to put together a new version of Test.pm which contains all these enhancements for planless testing, while at the same time operating transparently in planned mode for all the test modules already out there. I for one didn&#8217;t want to go through the Perl 6 spectest suite and change all those&#8230;</p>

<p>The patch is submitted to <span class="caps">RT, </span>so hopefully it will land in Rakudo before too long (assuming nobody finds any screaming bugs in it). Then your test modules can look like this:</p>



<pre>use Test;
use MyModule;

ok(MyModule::do-something(), &quot;Doing something&quot;);

done_testing;</pre>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2009/07/23/394/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl 6 Grammars and Action Methods</title>
		<link>http://alledora.co.uk/wordpress/archives/2009/03/23/377</link>
		<comments>http://alledora.co.uk/wordpress/archives/2009/03/23/377#comments</comments>
		<pubDate>Mon, 23 Mar 2009 15:43:35 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[Perl 6]]></category>

		<guid isPermaLink="false">http://alledora.co.uk/?p=377</guid>
		<description><![CDATA[I want to share some Perl 6 grammar knowledge and a bit of my enthusiasm for what this language is going to let people do. This is based on work I&#8217;ve been doing for the Form.pm module, which will be the replacement for Perl 5&#8217;s rather clunky format function.

Imagine that Christmas has come: you&#8217;re writing [...]]]></description>
			<content:encoded><![CDATA[<p>I want to share some Perl 6 grammar knowledge and a bit of my enthusiasm for what this language is going to let people do. This is based on work I&#8217;ve been doing for the Form.pm module, which will be the replacement for Perl 5&#8217;s rather clunky format function.</p>

<p>Imagine that Christmas has come: you&#8217;re writing a programme in Perl 6 (you can actually do this today, it&#8217;s just that there are large chunks of the language which nobody has implemented yet). In your wonderful Perl 6 programme, your world domination plan includes the need to parse some text, so you reach for a grammar, the overpowered, mutant grandson of Perl 5&#8217;s regular expressions.</p>

<p>Grammars are really a special kind of class, containing a special kind of subroutine (being regexes, rules or tokens rather than subs, methods or submethods). Say your grammar looks like this:</p>



<pre>grammar Statements {
  regex TOP {
    ( &lt;statement&gt; ';' )*
    {*}
  }
  regex statement {
      'hello' &lt;ws&gt; &lt;string&gt; {*} #= hello
    | 'goodbye' &lt;ws&gt; &lt;string&gt; {*} #= goodbye
  }
  regex string {
    '&quot;' (.*?) '&quot;'
    {*}
  }
}</pre>



<p>That is, you&#8217;re going to match against zero or more statements, which are separated by semicolons and consist of either &#8216;hello&#8217; followed by some whitespace and a double-quoted string, or &#8216;goodbye&#8217; followed by some whitespace and a double-quoted string. I know the string regex is bad in that it&#8217;s awful at delimiter matching, but it&#8217;ll do for now in the interests of keeping down the complexity. Also, in real life you&#8217;d probably have rather more flexible rules for separating statements, but I&#8217;m showing off <span class="caps">AST</span>-building here, not fancy regexes.</p>

<p>So what does it all mean? The syntax isn&#8217;t too difficult to get your head around: an identifier inside angle brackets invokes another regex as a submatch. <code>|</code> delimits alternatives and <code>*</code> is the zero-or-more quantifier. <code>{*}</code> is where the clever bit comes in. When the matcher sees <code>{*}</code> in a rule, it knows that it should go and call a method with the same name as the current rule in an object which was passed to the matcher when it was invoked. These are called action methods, and offer a fantastic way to use the grammar system for building abstract syntax trees or other constructions which represent your parsed text. To make this even more useful, if the line with the <code>{*}</code> on it ends with a comment like those seen in the statement rule above, the text of the comment will be passed to the action method, so you can signal to it which alternative branch you want it to deal with.</p>

<p>Now in real life your action methods might produce one of several possible classes, maybe from a huge tree of classes which can represent your <span class="caps">AST, </span>or from a set of classes which use a common set of roles, or maybe you&#8217;re going down the route of some of the calculator examples which have been developed which do the calculations right there in the action methods, and represent nodes by their results which are just numbers. In this example, to avoid having to define a class for statements (which is really quite simple), I&#8217;m just going to produce a hash with two keys: verb and string.</p>

<p>So we write a class to hold the action methods. We can call it whatever we like, but the method names and the rule names they&#8217;re triggered by have to match.</p>



<pre>class Actions {
  method TOP($/) {
    my @statements = gather for @( $/[0] ) -&gt; $submatch {
      take $submatch&lt;statement&gt;.ast;
    }
    make @statements;
  }
  method statement($/, $key) {
    my %s;
    %s&lt;verb&gt; = $key;
    %s&lt;string&gt; = $/&lt;string&gt;;
    make %s;
  }
  method string($/) {
    make $/[0].ast;
  }
}</pre>



<p>Now we see the real magic at work. First, each action method has a parameter <code>$/</code>, which is the default name for the match object. Calling it <code>$/</code> lets you call make without any special considerations because the background match object is just there. A match object, by the way, is what a regex returns when it matches something, and it contains all the information about where and what it matched, including other match objects for subpattern matches.</p>

<p>Next, we see that the statement method has a second parameter, <code>$key</code> &#8211; this is where the comment-syntax key strings arrive. It&#8217;s entirely optional, so I only put it on the method that would actually get some use from it.</p>

<p>The make function is really key to this business &#8211; it alters the match object to provide a different result. The match object itself stays intact, but it has a slot (accessed through the .ast method) which can carry any object you like which represents the matched text. It&#8217;s called .ast because of its frequent use in building abstract syntax trees, and here it&#8217;s going to carry our hashes.</p>

<p>Let&#8217;s look at each method in turn. The action method for string is straightforward. If you look back at the regex for string, you&#8217;ll see that it has a captured subpattern between the double-quote delimiters. Subpatterns like this appear in the Match object as array elements, so you can use the array indexing operator to access them. We know here that there will only be one, and as it&#8217;s an array it&#8217;ll be in slot 0, so we can just say <code>$/[0]</code>. We call .ast on it, because the default result is a string representing what was parsed by that pattern. In this case that&#8217;s exactly what we want, so we set it to our result and we&#8217;re done.</p>

<p>Next, the statement method is a little more complicated. It creates a new hash, then sets the verb to the passed-in $key. Because string was invoked as a named subpattern, it can be found as a hash element of the match object, so we retreive <code>$/&lt;string&gt;.ast</code>, which will be the string that was produced by the string action method, and store that in the hash before using make to set it in our ast slot.</p>

<p>Finally, <code>TOP</code> has to deal with a list of subpattern captures. Because there&#8217;s a repetition quantifier on the capture, <code>$/[0]</code> will be an array. We can iterate over that with a for loop to get at the match object for each repetition, and then use the hash access to retrieve the match object for the statement subrule &#8211; which is of course the hash made by the statement action method.</p>

<p>In this case, we use <code>gather for</code> to construct the list lazily (or at least, it will be lazy once Rakudo has lazy lists). <code>gather</code> needs a loop construct, and within that construct you can call <code>take</code> as many times as you like &#8211; each time a new element will be added to the end of the list which is being constructed by the entire gather expression. Ultimately that list is assigned to <code>@statements</code>, and we make that as the final result from the match. In this case we take the ast slot from the submatch, but you may notice that there&#8217;s a backslash before its <code>$</code>. Why is this? Perl 5 programmers are probably thinking &#8216;ah, he&#8217;s taking a reference so that he can make an array of hashes&#8217;, and they&#8217;d be sort of right. Without that, the hash wants to flatten into the array, which is not what we want, so we use @\@ which in Perl 6 creates a capture (an astonishing Perl 6 construct which is used for everything from stopping things flattening into lists to passing subroutine parameters around), which in this case will just prevent the hash from flattening into the array. There may be a more elegant way to do this by ensuring that the hash isn&#8217;t taken in a context that&#8217;s going to cause flattening, but I haven&#8217;t figured that part out yet. In any case, the end result is an array of hashes, which is exactly what we want. The captures are entirely transparent to everything that tries to use it.</p>

<p>How do you run this? Very easily:</p>



<pre>my $actions = Actions.new;
my $result = Statements.parsefile('somefilename', :action($actions));
for $result.ast -&gt; $statement {
  given $statement&lt;verb&gt; {
    when 'hello' { say &quot;Hello, $statement&lt;string&gt;&quot;; }
    when 'goodbye' { say &quot;Goodbye, $statement&lt;string&gt;&quot;; }
  }
}</pre>



<p>And that, as they say, is that, except that you can do all this in <a href="http://www.rakudo.org">Rakudo Perl 6</a> today.</p>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2009/03/23/377/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML is not necessarily the answer</title>
		<link>http://alledora.co.uk/wordpress/archives/2008/07/13/361</link>
		<comments>http://alledora.co.uk/wordpress/archives/2008/07/13/361#comments</comments>
		<pubDate>Sun, 13 Jul 2008 09:45:37 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://alledora.co.uk/?p=361</guid>
		<description><![CDATA[Joe Shaw wrote about XML and Google&#8217;s Protocol Buffers, which I admit I hadn&#8217;t heard of before today, but it&#8217;s pretty irrelevant what the debate was, XML versus Protocol Buffers or XML versus Pink Fairy Protocol or whatever. The point he makes very well, and the point which is very important and, I feel, not [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joeshaw.org/2008/07/12/531">Joe Shaw wrote about <span class="caps">XML</span></a> and Google&#8217;s Protocol Buffers, which I admit I hadn&#8217;t heard of before today, but it&#8217;s pretty irrelevant what the debate was, <span class="caps">XML </span>versus Protocol Buffers or <span class="caps">XML </span>versus Pink Fairy Protocol or whatever. The point he makes very well, and the point which is very important and, I feel, not appreciated very much in the wider Internet, is that <span class="caps">XML </span>is not suitable for everything.</p>

<p>I&#8217;m not going to say much more, because I can&#8217;t make the point any better than he did, but the point is a good one. At work I designed a simple prefix-based <span class="caps">ASCII </span>protocol for two servers to use to talk to each other. Much more lightweight than <span class="caps">XML, </span>much easier to encode and decode, and you only need the first few bytes of a message to figure out if the message is incomplete or not. And you can transmit pretty much anything with it. It&#8217;s even human-readable, to a certain extent &#8211; you need the protocol spec in hand (or you have to know it) but you can figure out what a message is trying to say.</p>

<p>Estimated bandwidth saving over using <span class="caps">XML</span>? I reckon it&#8217;s about 30% lighter than a reasonable <span class="caps">XML </span>application to do the same job.</p>

<p><span class="caps">XML </span>does of course have its place, and having tools like <span class="caps">XSLT </span>and XPath available to play with structured data is great, but sometimes you don&#8217;t need it, and sometimes you just can&#8217;t take the bandwidth hit, because like it or not <span class="caps">XML </span>gets verbose very quickly.</p>

<p>This post brought to you by the thinking about work on a Sunday society.</p>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2008/07/13/361/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Three steps back&#8230;</title>
		<link>http://alledora.co.uk/wordpress/archives/2007/12/15/356</link>
		<comments>http://alledora.co.uk/wordpress/archives/2007/12/15/356#comments</comments>
		<pubDate>Sat, 15 Dec 2007 21:20:46 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[Dasher]]></category>
		<category><![CDATA[Maemo]]></category>

		<guid isPermaLink="false">http://alledora.co.uk/wordpress/archives/2007/12/15/356</guid>
		<description><![CDATA[Okay so maybe not three steps. I got Dasher linking &#8211; hurrah! It turns out there was all sorts of fudging in the configure script to get it to work on the original Maemo for the Nokia 770, which is now unnecessary on OS2008. Hurrah for SDK improvements, but boo for not spotting that earlier.

The [...]]]></description>
			<content:encoded><![CDATA[<p>Okay so maybe not three steps. I got Dasher linking &#8211; hurrah! It turns out there was all sorts of fudging in the configure script to get it to work on the original Maemo for the Nokia 770, which is now unnecessary on <span class="caps">OS2008.</span> Hurrah for <span class="caps">SDK </span>improvements, but boo for not spotting that earlier.</p>

<p>The problem now is that libglade isn&#8217;t finding half the widgets in the glade file, and returns null pointers for them instead of the widget pointers. Every single one of the ones it&#8217;s failing to find is definitely in the <span class="caps">XML, </span>and the file&#8217;s definitely in the right place. I&#8217;ve checked &#8211; lots of times.</p>

<p>This might just be what makes me start to go bald.</p>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2007/12/15/356/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Almostsuccess!</title>
		<link>http://alledora.co.uk/wordpress/archives/2007/12/13/355</link>
		<comments>http://alledora.co.uk/wordpress/archives/2007/12/13/355#comments</comments>
		<pubDate>Thu, 13 Dec 2007 08:01:09 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[Dasher]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[maemo]]></category>

		<guid isPermaLink="false">http://alledora.co.uk/wordpress/archives/2007/12/13/355</guid>
		<description><![CDATA[After literally half an hour of further effort, I managed to get Dasher to link when built against the Maemo Chinook SDK. Hurrah!

Okay so it took a manual edit to the Makefiles. I think I&#8217;m going to have to consult somebody who knows this whole autoconf/automake business a bit better to see how I can [...]]]></description>
			<content:encoded><![CDATA[<p>After literally half an hour of further effort, I managed to get Dasher to link when built against the Maemo Chinook <span class="caps">SDK.</span> Hurrah!</p>

<p>Okay so it took a manual edit to the Makefiles. I think I&#8217;m going to have to consult somebody who knows this whole autoconf/automake business a bit better to see how I can get the Glade libraries referenced properly.</p>

<p>Then I need to get it to actually start up as it currently tries to dereference a null pointer and segfaults. This is probably due to my fairly cavalier #ifdefing out to get it to compile. Now I need to go back and figure out which bits are actually needed and how to get them to work.</p>

<p>Ultimately of course the UI under Maemo is going to be a bit different, especially once I get the thing working as an input method, but for now I just want it to work at all!</p>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2007/12/13/355/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Inadequate Update</title>
		<link>http://alledora.co.uk/wordpress/archives/2005/03/16/244</link>
		<comments>http://alledora.co.uk/wordpress/archives/2005/03/16/244#comments</comments>
		<pubDate>Wed, 16 Mar 2005 08:21:09 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.alledora.co.uk/archives/2005/03/16/244</guid>
		<description><![CDATA[Just to let you know that yes, I&#8217;m still alive and doing the usual things, no nothing massively exciting has come along for me to write about, and yes I have been playing too much City of Heroes. Check out the gallery for a few screenshots from City of Heroes EU.

In other news,  I [...]]]></description>
			<content:encoded><![CDATA[<p>Just to let you know that yes, I&#8217;m still alive and doing the usual things, no nothing massively exciting has come along for me to write about, and yes I have been playing too much <a href="http://uk.cityofheroes.com">City of Heroes</a>. Check out the <a href="http://www.alledora.co.uk/gallery">gallery</a> for a few screenshots from City of Heroes <span class="caps">EU.</span></p>

<p>In other news,  I think I finally figured out how to do the positioning system for Growl. It&#8217;s not the total solution I originally intended, but it&#8217;s probably more practical to do it this way than the way I wanted to do it &#8212; which was far beyond my small mind&#8217;s ability to cope with.</p>

<p>But before I can engage on that again, time for work.</p>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2005/03/16/244/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GuidePost</title>
		<link>http://alledora.co.uk/wordpress/archives/2005/01/06/234</link>
		<comments>http://alledora.co.uk/wordpress/archives/2005/01/06/234#comments</comments>
		<pubDate>Thu, 06 Jan 2005 20:39:49 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.alledora.co.uk/archives/2005/01/06/234</guid>
		<description><![CDATA[Here&#8217;s a blast from the past. I finally dug out a GuidePost installer from years ago because I was being nagged about it, so here you are Z: GuidePost 0.6a.

For the curious, GuidePost is a simple text-based editor for GuideML, the XML application used for h2g2 articles, and other DNA-powered sites on bbc.co.uk. I wrote [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a blast from the past. I finally dug out a GuidePost installer from years ago because I was being nagged about it, so here you are Z: <a href="http://www.alledora.co.uk/guidepost-06a-setup.exe">GuidePost 0.6a</a>.</p>

<p>For the curious, GuidePost is a simple text-based editor for GuideML, the <span class="caps">XML </span>application used for <a href="http://www.bbc.co.uk/h2g2">h2g2</a> articles, and other <span class="caps">DNA</span>-powered sites on <a href="http://www.bbc.co.uk">bbc.co.uk</a>. I wrote it many years ago and haven&#8217;t touched it since, largely because it&#8217;s a Windows app and I don&#8217;t do those anymore. I do keep meaning to do a Mac version, but haven&#8217;t found the time yet.</p>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2005/01/06/234/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Onward: of coding, Yule, Christmas and hysterical laughter</title>
		<link>http://alledora.co.uk/wordpress/archives/2004/12/09/230</link>
		<comments>http://alledora.co.uk/wordpress/archives/2004/12/09/230#comments</comments>
		<pubDate>Thu, 09 Dec 2004 08:21:32 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Religion]]></category>

		<guid isPermaLink="false">http://www.alledora.co.uk/archives/2004/12/09/230</guid>
		<description><![CDATA[Firstly the hysterical laughter. I know I mentioned it last in the topic, but it&#8217;s very, very funny and deserves to go first, so first it has been put.

With that out of the way, what else was I going to write about? Ah yes. Towel proceeds. It needs a good deal more polishing, but it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Firstly the <a href="http://www.nationallampoon.com/nl/08_features/toyshopping/toys.asp">hysterical laughter</a>. I know I mentioned it last in the topic, but it&#8217;s very, very funny and deserves to go first, so first it has been put.</p>

<p>With that out of the way, what else was I going to write about? Ah yes. <a href="http://towel.sf.net">Towel</a> proceeds. It needs a good deal more polishing, but it&#8217;s gradually getting there for another release, this one with significant enhancements. The things I&#8217;m aiming for are:</p>


<ul>
<li>metadata caching in saved playlists, leading to improved load times</li>
<li>don&#8217;t have <span class="caps">GDK </span>markup errors on track titles with double quotes in</li>
<li>use <a href="http://gstreamer.freedesktop.org">GStreamer</a> 0.8 (done)</li>
<li>use GStreamer for metadata reading, instead of id3lib, libvorbis and libflac</li>
<li>metadata editing using GStreamer</li>
<li>miscellaneous UI improvements</li>
<li>anything else that seems like it&#8217;ll fit</li>
</ul>



<p>After that, the next release will likely dual-build with gtkmm 2.5, which is important because there are some handy new widgets I would find useful, lots of nice bug fixes and stock icons for play, pause etc.</p>

<p>Another project I&#8217;m starting to help with related to Towel is gstmm, the C++ bindings for GStreamer. They use the same system as <a href="http://www.gtkmm.org">gtkmm</a> does, so they should be eminently compatible with a gtkmm application such as Towel. Development has unfortunately been stalled for quite some time, so hopefully <a href="http://www.reigndropsfall.net">Bryan Forbes</a> and I will be able to get something passably wrapping GStreamer 0.8. And hopefully it won&#8217;t take us all year to do it.</p>

<p>Last night was the penultimate Tai Chi before Christmas. Not many people came so we didn&#8217;t do a new move in the longsword form, but instead spent quite a while doing Chi Kung and pushing hands. Learned some interesting things, improved my technique in one kind of movement particularly. Then we revised the longsword form as far as we have reached, which was useful to pick up on the details that tend to get lost in those first few weeks after doing a move where you&#8217;re more worried about which arm to stick out than the finer points of the move. Curiously, everyone at Tai Chi thinks the way Christmas is handled by the shops is very irritating. Where are the people that the shops are doing what they&#8217;re doing all this for?</p>

<p>Not sure what I&#8217;m doing for Yule yet this year. We shall see. The full moon group are doing a Yule ritual, so it&#8217;s likely I&#8217;ll go to that. It is highly likely to be a significant improvement on doing one solo.</p>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2004/12/09/230/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Of Towels and Novels</title>
		<link>http://alledora.co.uk/wordpress/archives/2004/11/23/226</link>
		<comments>http://alledora.co.uk/wordpress/archives/2004/11/23/226#comments</comments>
		<pubDate>Tue, 23 Nov 2004 09:12:16 +0000</pubDate>
		<dc:creator>Matt Walton</dc:creator>
				<category><![CDATA[NaNoWriMo]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.alledora.co.uk/archives/2004/11/23/226</guid>
		<description><![CDATA[NaNoWriMo continues. My novel is now flagging slightly behind the 60,000 word pace. It&#8217;s difficult to keep up the momentum once work starts to take over, and my sudden urge to restart hacking on Towel doesn&#8217;t help very much. For the uninitiated, Towel is a fairly simple audio player for GNU/Linux and FreeBSD. It started [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nanowrimo.org">NaNoWriMo</a> continues. My novel is now flagging slightly behind the 60,000 word pace. It&#8217;s difficult to keep up the momentum once work starts to take over, and my sudden urge to restart hacking on <a href="http://towel.sf.net">Towel</a> doesn&#8217;t help very much. For the uninitiated, Towel is a fairly simple audio player for <span class="caps">GNU</span>/Linux and FreeBSD. It started off as little more than a pretty <span class="caps">GTK</span>+ frontend to GStreamer, but now it&#8217;s a little more complicated than that, as the playlist system is rapidly becoming more and more complex. I think it may have reached its natural limit now, and is gradually getting filled out with missing functionality.</p>

<p>Recently I&#8217;ve been working on getting it to compile on my native 64bit Linux system, which wasn&#8217;t too hard because it was fairly intelligently coded the first time around (actually the most serious problem was with printf format strings generating warnings about variable sizes). The nastiest work was porting to GStreamer 0.8, which should have been done a long time ago but is done now and works quite nicely.</p>

<p>Currently I&#8217;m implementing properties dialogs for groups and tracks, which will help people figure out what the checkboxes in the groups and tracks views are for as they can be set from the properties dialogs as well &#8212; this is until GtkTreeView gains proper tooltip support, but I suspect that might take a while and may even be a <span class="caps">GTK</span>+ 3.0 feature. Also on the list are metadata caching, so Towel doesn&#8217;t have to probe every file in the library for its title/artist/length data every time it starts up, better handling of file read errors (there are going to be some holes exposed by the metadata caching system, as previously we relied heavily on all the files being read at startup), and general UI love for the library window.</p>

<p>Moving onward, there&#8217;ll be a release, then I&#8217;ll port to gtkmm 2.5 to take advantage of some useful new features, such as ellipsizing labels and stock icons for play, pause, stop and so forth. For now I intend to keep the project at SourceForge, but it&#8217;s going to have to move into a Subversion repository somewhere at some point; I just can&#8217;t be doing with <span class="caps">CVS </span>anymore.</p>

<p>And many thanks to Bryan Forbes, who says he&#8217;ll do some testing and offer assistance with the UI design.</p>

<p>Now I just need to get hold of Jonathan again&#8230;</p>]]></content:encoded>
			<wfw:commentRss>http://alledora.co.uk/wordpress/archives/2004/11/23/226/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
