<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dcterms="http://purl.org/rss/1.0/modules/dcterms/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <generator>Plagger/0.7.17</generator>
    <dc:creator>nobody@example.com</dc:creator>
    <webMaster>nobody@example.com</webMaster>
    <description/>
    <title>Jess Robinson</title>
    <pubDate>Mon, 01 Aug 2011 04:05:08 +0100</pubDate>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public laptop asus travel hotels</category>
      <link>http://desert-island.me.uk/~castaway/blog/ramblings-july-4-2011.html</link>
      <description>Ramblings, July 4th 2011
========================

In which I ramble about recent events, being too lazy to compose separate
updates for each..


Asus Transformer
----------------

Since my review of my long-time pal, the Asus 701 netbook, the poor thing
has lost the use of all the USB ports down its left^Wright side. More
recently, somehow the battery loses contact often enough to be quite
annoying (aka the thing just turns off, no warning, if I reseat the
battery it happily works again, for a while..) I spent a while watching
the AlwaysInnovating site/forums to see if the TouchBookII would ever
actually appear, but they still seem to be failing to produce one soo.. I
bought an Asus Transformer complete with dock (keyboard).

So far, its been pretty good. The battery life is fantastic (charge full
at home, spend a day and a bit travelling from Europe to the US, and its
still working), the Android Honeycomb OS generally Just Works (tm). I've
found useful apps for my general use-case - an ssh client, ConnectBot, a
browser, Opera Mobile (recently updated to actually support Flash,
hooray!), an editor, and some games.

Only one major annoyance so far, the power/charge cable is quite short
(about 40cm or so), compared to the 701 cable which is 3m long. This
means if I plug it in under my desk at home or next to the bed, it barely
reaches my actual lap.. We tried extending with a USB A-A cable, but that
fails to produce a charging light on the dock.


Travelling
----------

This is mostly a reminder to myself: No matter how much you plan and
organise (and I left several bits a bit late, this recent trip), some
things will just always go wrong. After comparing prices of National
Express and long-stay (a week) near Heathrow, it seemed that long-stay
parking was now cheaper (50 versus 70 GBP), so I booked parking at NCP
flightpath.

The flight being at 8am, we also decided to drive down the night before,
and overnight at a nearby hotel, Hostelbookers found me the Heathrow
Lodge Hotel.. Which was fine but for some errors on their website (and
the hostelbookers site), see where it says "free parking"? That's
rubbish, they charged us a fiver, and signs threatened to clamp/tow any
unknown vehicles.

As we arrived there, paying for extra breakfast was suggested by the
clerk, which could be delivered at any hour, he insisted.. So we said
"yes, 5:30am please" (having planned to leave at 6).. Come 5:45am the
next morning, no breakfast arrived, on enquiry, of the exact same guy at
the front desk, he asked "when did you want it?" .. Sigh.. He did however
manage to get us a packed version in the next 5mins, which was a fairly
good breakfast.

We drove as planned (more or less) to the NCP flightpath parking place..
which, by the way, its useless to navigate via postcode to, satnavs get
it all wrong.. Luckily they know this, and also post their lat/long
coordinates on their website .. If only we'd thought to do that the first
attempt to find it, instead of after the satnav failed.. On arriving, the
auto-number-plate recognition system failed to find us, it turned out
(much later) that this is because you have ±6 hours of your actual
booking time to be recognised, and we'd booked for the previous morning
just in case we wanted to park there all day.

Eventually the attendant just suggested we take a ticket and sort it out
on the way back.


Services
--------

Which brings me to service.. Several times on this holiday I've noticed
how some companys, presumably mostly the ones with a fair amount of
competition, have improved their service to the point of being genuinely
nice and useful.

Notable was the parking attendant whom we saw when picking up the car on
the way back. I'd managed to actually lose the ticket we'd taken (along
with my notepad, sniff), but he found our actual pre-paid booking on the
system anyway, explained the whole ±6 hours rule thing, and gave us a
ticket to exit the carpark with. This was even replaced with another one
that worked, as we'd taken more than 15mins to pack the car and decide
where we were off to next (London Hackspace!). He said "I hope you'll use
us again", I think I may well.

Hmm, ran out of steam at this point, posting anyway.. more ramblings to
come!

@public,laptop,asus,travel,hotels</description>
      <dc:date>2011-07-05T20:12:18+01:00</dc:date>
      <dc:subject>public laptop asus travel hotels</dc:subject>
      <title>Under the palm tree (ramblings-july-4-2011.html)</title>
      <pubDate>Tue, 05 Jul 2011 20:12:18 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Ramblings, July 4th 2011&lt;/h1&gt;

&lt;p&gt;In which I ramble about recent events, being too lazy to compose separate updates for each..&lt;/p&gt;

&lt;h2&gt;Asus Transformer&lt;/h2&gt;

&lt;p&gt;Since my review of my long-time pal, the &lt;a href="/~castaway/blog/review-asus-701.html"&gt;Asus 701 netbook&lt;/a&gt;, the poor thing has lost the use of all the USB ports down its left^Wright side. More recently, somehow the battery loses contact often enough to be quite annoying (aka the thing just turns off, no warning, if I reseat the battery it happily works again, for a while..) I spent a while watching the &lt;a href="http://alwaysinnovating.com"&gt;AlwaysInnovating&lt;/a&gt; site/forums to see if the TouchBookII would ever actually appear, but they still seem to be failing to produce one soo.. I bought an &lt;a href="http://uk.asus.com/Eee/Eee_Pad/Eee_Pad_Transformer_TF101/"&gt;Asus Transformer&lt;/a&gt; complete with dock (keyboard).&lt;/p&gt;

&lt;p&gt;So far, its been pretty good. The battery life is fantastic (charge full at home, spend a day and a bit travelling from Europe to the US, and its &lt;em&gt;still&lt;/em&gt; working), the Android Honeycomb OS generally Just Works (tm). I've found useful apps for my general use-case - &lt;a href="http://market.android.com/details?id=org.connectbot"&gt;an ssh client, ConnectBot&lt;/a&gt;, &lt;a href="https://market.android.com/details?id=com.opera.browser"&gt;a browser, Opera Mobile&lt;/a&gt; (recently updated to actually support Flash, hooray!), &lt;a href="https://market.android.com/details?id=jp.sblo.pandora.jota"&gt;an editor&lt;/a&gt;, &lt;a href="https://market.android.com/details?id=com.nvidia.tegrazone"&gt;and some games&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Only one major annoyance so far, the power/charge cable is quite short (about 40cm or so), compared to the 701 cable which is 3m long. This means if I plug it in under my desk at home or next to the bed, it barely reaches my actual lap.. We tried extending with a USB A-A cable, but that fails to produce a charging light on the dock.&lt;/p&gt;

&lt;h2&gt;Travelling&lt;/h2&gt;

&lt;p&gt;This is mostly a reminder to myself: No matter how much you plan and organise (and I left several bits a bit late, this recent trip), some things will just always go wrong. After comparing prices of National Express and long-stay (a week) near Heathrow, it seemed that long-stay parking was now cheaper (50 versus 70 GBP), so I booked parking at NCP flightpath. &lt;/p&gt;

&lt;p&gt;The flight being at 8am, we also decided to drive down the night before, and overnight at a nearby hotel, &lt;a href="http://www.hostelbookers.com"&gt;Hostelbookers&lt;/a&gt; found me the &lt;a href="http://heathrowlodge.com"&gt;Heathrow Lodge Hotel&lt;/a&gt;.. Which was fine but for some errors on their website (and the hostelbookers site), see where it says "free parking"? That's rubbish, they charged us a fiver, and signs threatened to clamp/tow any unknown vehicles.&lt;/p&gt;

&lt;p&gt;As we arrived there, paying for extra breakfast was suggested by the clerk, which could be delivered at any hour, he insisted.. So we said "yes, 5:30am please" (having planned to leave at 6).. Come 5:45am the next morning, no breakfast arrived, on enquiry, of the exact same guy at the front desk, he asked "when did you want it?" .. Sigh.. He did however manage to get us a packed version in the next 5mins, which was a fairly good breakfast. &lt;/p&gt;

&lt;p&gt;We drove as planned (more or less) to the NCP flightpath parking place.. which, by the way, its useless to navigate via postcode to, satnavs get it all wrong.. Luckily they know this, and also post their lat/long coordinates on their website .. If only we'd thought to do that the first attempt to find it, instead of after the satnav failed.. On arriving, the auto-number-plate recognition system failed to find us, it turned out (much later) that this is because you have &amp;#177;6 hours of your actual booking time to be recognised, and we'd booked for the previous morning just in case we wanted to park there all day.&lt;/p&gt;

&lt;p&gt;Eventually the attendant just suggested we take a ticket and sort it out on the way back.&lt;/p&gt;

&lt;h2&gt;Services&lt;/h2&gt;

&lt;p&gt;Which brings me to service.. Several times on this holiday I've noticed how some companys, presumably mostly the ones with a fair amount of competition, have improved their service to the point of being genuinely nice and useful.&lt;/p&gt;

&lt;p&gt;Notable was the parking attendant whom we saw when picking up the car on the way back. I'd managed to actually lose the ticket we'd taken (along with my notepad, sniff), but he found our actual pre-paid booking on the system anyway, explained the whole &amp;#177;6 hours rule thing, and gave us a ticket to exit the carpark with. This was even replaced with another one that worked, as we'd taken more than 15mins to pack the car and decide where we were off to next (London Hackspace!). He said "I hope you'll use us again", I think I may well.&lt;/p&gt;

&lt;p&gt;Hmm, ran out of steam at this point, posting anyway.. more ramblings to come!&lt;/p&gt;

&lt;p&gt;@public,laptop,asus,travel,hotels&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2011-07-05T20:12:18+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/ramblings-july-4-2011.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public perl forms</category>
      <link>http://desert-island.me.uk/~castaway/blog/looking-at-forms-Spark-Form.html</link>
      <description>Looking at forms (5- Spark::Form)
=================================

What this is about


Spark::Form
-----------

I know who wrote this one.. They also asked me to contribute to the docs,
which I should. I suspect there's a much improved version in the git
repository, howver as its not on CPAN, it doesn't exist for my purposes.

Now I'm wondering if cpanm can/does/should install from a git URL.

Anyway, Spark::Form consists of a set of basic Roles for defining,
printing (HTML, XHTML) and validating forms, or mostly the fields that
forms consist of. As you can tell from my example, I can't actually tell
from 30/40mins doc poking, how to make the validation work at all.


Pros

  * Modular, you can design subsets of field types or use someone elses.

  * Supports subforms, you can merge in fields from existing form
    objects.


Cons

  * Docs and SYNOPSIS are confusing

  * Not obvious how to output HTML at all, given a form object.

  * Links to docs that don't exist at all (Spark::Form::Manual).


Sample code (by me)
-------------------

#!/usr/bin/env perl

use strict;
use warnings;

use Spark::Form;

my $form = Spark::Form-&gt;new( plugin_ns =&gt; 'SparkX::Form');

$form-&gt;add('text', 'username', label =&gt; 'username', regex =&gt; qr/^.{2,}/);
$form-&gt;add('password', 'password', label =&gt; 'pasword', regex =&gt; qr/^.{2,}/);
$form-&gt;add('submit', 'submit');

foreach my $field ($form-&gt;fields) {
    print $field-&gt;to_html;
}

$form-&gt;data( {username =&gt; '', password =&gt; '' });
if($form-&gt;validate) {
    print "Valid!\n";
} else {
    print "Not valid\n"
}


Sample code output
------------------

&lt;input name="username" type="text"&gt;&lt;input name="password" type="password"&gt;&lt;input name="submit" type="submit"&gt;Valid!

@public,perl,forms</description>
      <dc:date>2011-06-08T22:03:30+01:00</dc:date>
      <dc:subject>public perl forms</dc:subject>
      <title>Under the palm tree (looking-at-forms-Spark-Form.html)</title>
      <pubDate>Wed, 08 Jun 2011 22:03:30 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Looking at forms (5- Spark::Form)&lt;/h1&gt;

&lt;p&gt;&lt;a href="/~castaway/blog/looking-at-forms.html"&gt;What this is about&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Spark::Form&lt;/h2&gt;

&lt;p&gt;I know who wrote this one.. They also asked me to contribute to the
docs, which I should. I suspect there's a much improved version in the
git repository, howver as its not on CPAN, it doesn't exist for my
purposes.&lt;/p&gt;

&lt;p&gt;Now I'm wondering if &lt;a href="http://xrl.us/cpanm"&gt;cpanm&lt;/a&gt; can/does/should install from a git URL.&lt;/p&gt;

&lt;p&gt;Anyway, Spark::Form consists of a set of basic Roles for defining,
printing (HTML, XHTML) and validating forms, or mostly the fields that
forms consist of. As you can tell from my example, I can't actually
tell from 30/40mins doc poking, how to make the validation work at
all.&lt;/p&gt;

&lt;h3&gt;Pros&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Modular, you can design subsets of field types or use someone elses.&lt;/li&gt;
&lt;li&gt;Supports subforms, you can merge in fields from existing form objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Cons&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Docs and SYNOPSIS are confusing&lt;/li&gt;
&lt;li&gt;Not obvious how to output HTML at all, given a form object.&lt;/li&gt;
&lt;li&gt;Links to docs that don't exist at all (Spark::Form::Manual).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Sample code (by me)&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/env perl

use strict;
use warnings;

use Spark::Form;

my $form = Spark::Form-&amp;gt;new( plugin_ns =&amp;gt; 'SparkX::Form');

$form-&amp;gt;add('text', 'username', label =&amp;gt; 'username', regex =&amp;gt; qr/^.{2,}/);
$form-&amp;gt;add('password', 'password', label =&amp;gt; 'pasword', regex =&amp;gt; qr/^.{2,}/);
$form-&amp;gt;add('submit', 'submit');

foreach my $field ($form-&amp;gt;fields) {
    print $field-&amp;gt;to_html;
}

$form-&amp;gt;data( {username =&amp;gt; '', password =&amp;gt; '' });
if($form-&amp;gt;validate) {
    print "Valid!\n";
} else {
    print "Not valid\n"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Sample code output&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;input name="username" type="text"&amp;gt;&amp;lt;input name="password" type="password"&amp;gt;&amp;lt;input name="submit" type="submit"&amp;gt;Valid!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;@public,perl,forms&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2011-06-08T22:03:30+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/looking-at-forms-Spark-Form.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public ruby 7langs7weeks</category>
      <link>http://desert-island.me.uk/~castaway/blog/first-ruby-code.html</link>
      <description>I wrote my first Ruby code this morning...
==========================================

A few weeks back I bought a copy of Seven languages, in seven weeks by
Bruce Tate (as an ebook, from pragprog.com). You can read what it's about
behind the link, a short summary is that it covers Ruby, Clojure,
Haskell, Prolog, Scala and Io, in a meaningful fashion.

I can't verify that yet, since I've just read Day One of Ruby, and so far
managed to produce this:

(using irb)

num = rand();
guess = -1
while guess.to_i != num.to_i
  puts "Guess:"
  guess = gets
  if guess.to_i &gt; num.to_i
    puts "too high"
  elsif guess.to_i &lt; num.to_i
    puts "too low"
  end
end

That was the biggest "Day One" exercise, another that I attempted
consisted of "find out how to get the index of a string inside another
string in Ruby" .. I attempted 'string'.methods for this, but no "index".
I then googled and found "ruby-doc.org", which found "index" when I
looked under the "String" type..

I also assumed I'd have local docs, and skimmed "man ruby", which wasn't
too helpful, then tried a "man -l ruby", which also didn't show up a lot.
Is this normal, or just Ubuntu not installing docs by default again?

So far, so good.

@public,ruby,7langs7weeks</description>
      <dc:date>2011-06-06T15:21:43+01:00</dc:date>
      <dc:subject>public ruby 7langs7weeks</dc:subject>
      <title>Under the palm tree (first-ruby-code.html)</title>
      <pubDate>Mon, 06 Jun 2011 15:21:43 +0100</pubDate>
      <content:encoded>&lt;h1&gt;I wrote my first Ruby code this morning...&lt;/h1&gt;

&lt;p&gt;A few weeks back I bought a copy of &lt;a href="http://xrl.us/7langs7weeks"&gt;Seven languages, in seven
weeks&lt;/a&gt; by Bruce Tate (as an ebook, from
pragprog.com). You can read what it's about behind the link, a short
summary is that it covers Ruby, Clojure, Haskell, Prolog, Scala and
Io, in a meaningful fashion.&lt;/p&gt;

&lt;p&gt;I can't verify that yet, since I've just read Day One of Ruby, and so far managed to produce this:&lt;/p&gt;

&lt;p&gt;(using irb) &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;num = rand();
guess = -1
while guess.to_i != num.to_i
  puts "Guess:"
  guess = gets
  if guess.to_i &amp;gt; num.to_i
    puts "too high"
  elsif guess.to_i &amp;lt; num.to_i
    puts "too low"
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That was the biggest "Day One" exercise, another that I attempted consisted of "find out how to get the index of a string inside another string in Ruby" .. I attempted 'string'.methods for this, but no "index". I then googled and found "ruby-doc.org", which found "index" when I looked under the "String" type..&lt;/p&gt;

&lt;p&gt;I also assumed I'd have local docs, and skimmed "man ruby", which wasn't too helpful, then tried a "man -l ruby", which also didn't show up a lot. Is this normal, or just Ubuntu not installing docs by default again?&lt;/p&gt;

&lt;p&gt;So far, so good.&lt;/p&gt;

&lt;p&gt;@public,ruby,7langs7weeks&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2011-06-06T15:21:43+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/first-ruby-code.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public perl forms</category>
      <link>http://desert-island.me.uk/~castaway/blog/looking-at-forms-Form-Processor.html</link>
      <description>Looking at forms (4- Form::Processor)
=====================================

What this is about


Form::Processor
---------------

Next on my list is Form::Processor, after reading its docs closely
however, it does not seem to meet my requirements of drawing forms in
HTML at all. This is a tool for processing and validating the data
gathered from forms, or anywhere else really. Useful if you prefer to
handcraft your HTML? The form object can be passed to the template and
queried for the needed fields, so it doesn't make you define your fields
in two places. (Or so I gather)

It was originally released in June 2007, and the most recent release was
July 2008.

I've attempted to make something work, but it appears without crafting an
appropriate Form::Processor::Model subclass I may not be able to at all.


Pros

  * Seems to support many field types


Cons

  * No HTML rendering at all.

  * Examples are a bit confusing if you're not using it to write to a
    Class::DBI -based database model.

  * Unresolved bugs.


(Attempt at) Sample code

#!/usr/bin/env perl

use strict;
use warnings;

use Data::Dumper;

my $form = MyApp::Form::Login-&gt;new();
print Dumper($form-&gt;fif);

$form-&gt;validate({ username =&gt; 'fred',
                  password =&gt; 'harry',
                });

print "Is valid? ", $form-&gt;validate();

package MyApp::Form::Login;

use strict;
use warnings;

use base 'Form::Processor';

sub profile {
    return {
    required =&gt; {
        username =&gt; 'Text',
        password =&gt; 'Password',
    },
    };
}


Sample output

$VAR1 = {};
Is valid? 0

Yes, I could do with some help on this one, it's failing to be usable in
30-45mins, which is my arbitrary target for getting up to speed with
these.

@public,perl,forms</description>
      <dc:date>2011-05-25T16:12:01+01:00</dc:date>
      <dc:subject>public perl forms</dc:subject>
      <title>Under the palm tree (looking-at-forms-Form-Processor.html)</title>
      <pubDate>Wed, 25 May 2011 16:12:01 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Looking at forms (4- Form::Processor)&lt;/h1&gt;

&lt;p&gt;&lt;a href="/~castaway/blog/looking-at-forms.html"&gt;What this is about&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Form::Processor&lt;/h2&gt;

&lt;p&gt;Next on my list is Form::Processor, after reading its docs closely
however, it does not seem to meet my requirements of drawing forms in
HTML at all. This is a tool for processing and validating the data
gathered from forms, or anywhere else really. Useful if you prefer to
handcraft your HTML? The form object can be passed to the template and
queried for the needed fields, so it doesn't make you define your
fields in two places. (Or so I gather)&lt;/p&gt;

&lt;p&gt;It was originally released in June 2007, and the most recent release
was July 2008.&lt;/p&gt;

&lt;p&gt;I've attempted to make something work, but it appears without crafting
an appropriate Form::Processor::Model subclass I may not be able to at
all.&lt;/p&gt;

&lt;h3&gt;Pros&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Seems to support many field types &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Cons&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No HTML rendering at all.&lt;/li&gt;
&lt;li&gt;Examples are a bit confusing if you're not using it to write to a Class::DBI -based database model.&lt;/li&gt;
&lt;li&gt;Unresolved bugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;(Attempt at) Sample code&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/env perl

use strict;
use warnings;

use Data::Dumper;

my $form = MyApp::Form::Login-&amp;gt;new();
print Dumper($form-&amp;gt;fif);

$form-&amp;gt;validate({ username =&amp;gt; 'fred',
                  password =&amp;gt; 'harry',
                });

print "Is valid? ", $form-&amp;gt;validate();

package MyApp::Form::Login;

use strict;
use warnings;

use base 'Form::Processor';

sub profile {
    return {
    required =&amp;gt; {
        username =&amp;gt; 'Text',
        password =&amp;gt; 'Password',
    },
    };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Sample output&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;$VAR1 = {};
Is valid? 0
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Yes, I could do with some help on this one, it's failing to be usable
in 30-45mins, which is my arbitrary target for getting up to speed
with these.&lt;/p&gt;

&lt;p&gt;@public,perl,forms&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2011-05-25T16:12:01+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/looking-at-forms-Form-Processor.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public forms perl</category>
      <link>http://desert-island.me.uk/~castaway/blog/looking-at-forms-3.html</link>
      <description>Looking at forms (3 - Form::Sensible)
=====================================

As previously mentioned...


Form::Sensible
--------------

Started in Jan 2010, and last updated this year (Jan 2011), this one
looks slightly more alive than the previous candidates. Jumping straight
to the Overview, it's worth reading through the rather long philosophy
explanation to see whats going on here.

The aim of this module seems to be to define a set of fields based on
what data you want to ultimately obtain, and leave the rendering end to
figure out how to present that to the user. The advantage being that your
data gathering end doesn't care if your frontend presents "pick one of
these" as a drop-down, or a set of checkboxes, or something even
stranger.


Pros

  * Nice separation of concerns

  * Built-in HTML rendering outputs labels, ids and classes and is valid.

  * Decent looking starter documentation.

  * Content validation can be done via regex, coderef or plain
    "required".

  * Error messages can be changed.


Cons

  * Doesn't seem to be a way to permanently define a form using a class.
    The simple data structure could be stored as XML, YAML or some other
    config type though.

  * Docs link to a non-existent wiki page.

  * Open and unsolved bugs.

  * Form structure hashref not validated (I typed "rehex" instead of
    "regex" and there was no error or warning).


Sample code (mostly from Overview doc)

#!/usr/bin/env perl

use strict;
use warnings;

use Form::Sensible;

my $form = Form::Sensible-&gt;create_form( 
    {
        name =&gt; 'login_form',
        fields =&gt; [
            { 
                field_class =&gt; 'Text',
                name =&gt; 'username',
                validation =&gt; { 
                    regex =&gt; '{2,}',
                    required =&gt; 1,
                }
            },
            {
                field_class =&gt; 'Text',
                name =&gt; 'password',
                validation =&gt; { 
                    required =&gt; 1,
                    regex =&gt; '{2,}',
                },
                render_hints =&gt; { 
                    'HTML' =&gt; {
                        render_as =&gt; 'password' 
                    }
                },
            },
            {
                field_class =&gt; 'Trigger',
                name =&gt; 'submit'
            }
            ],
    } );

my $renderer = Form::Sensible-&gt;get_renderer('HTML');
my $renderedform = $renderer-&gt;render($form);

print $renderedform-&gt;complete('', 'post'); 


Sample output

&lt;div id="fs_login_form_form_div" class="fs_form_container fs_login_form_form_container"&gt;
    &lt;form action="" method="post" id="fs_login_form_form" class="fs_form fs_login_form_form" accept-charset="utf-8" &gt;
&lt;div id="fs_username_div" class="fs_formfieldline fs_text fs_username  "&gt;
    &lt;label class="fs_label fs_text_label " for="fs_login_form_username_input"&gt;Username&lt;/label&gt;
    &lt;input type="text" id="fs_login_form_username_input" class="fs_input fs_text_input fs_username_input " name="username" value="" /&gt;
&lt;/div&gt;

&lt;div id="fs_password_div" class="fs_formfieldline fs_text fs_password  "&gt;
    &lt;label class="fs_label fs_text_label " for="fs_login_form_password_input"&gt;Password&lt;/label&gt;
    &lt;input type="password" id="fs_login_form_password_input" class="fs_input fs_text_input fs_password_input " name="password"/&gt;
&lt;/div&gt;

&lt;div id="fs_submit_div" class="fs_formfieldline fs_trigger fs_submit  "&gt;


    &lt;input type="submit" id="fs_login_form_submit_input" class="fs_input fs_trigger_input fs_submit_input  " name="submit" value="Submit" /&gt;

&lt;/div&gt;

&lt;/form&gt;
&lt;/div&gt;


Input validation

To validate the input values against the rules given earlier:

$form-&gt;set_values({ username =&gt; '1',
                    password =&gt; '',
                  });
my $result = $form-&gt;validate();
if(!$result-&gt;is_valid) {
    $renderedform = $renderer-&gt;render($form);
    $renderedform-&gt;add_errors_from_validator_result($result);
    print "Form with errors\n";
    print $renderedform-&gt;complete('','post');
}

and you get:

&lt;div id="fs_login_form_form_div" class="fs_form_container fs_login_form_form_container"&gt;
    &lt;form action="" method="post" id="fs_login_form_form" class="fs_form fs_login_form_form" accept-charset="utf-8" &gt;
&lt;div class="fs_errorblock fs_login_form_errorblock"&gt;    &lt;span class="fs_error fs_login_form_error"&gt;Username is invalid.&lt;/span&gt;&lt;br/&gt;    &lt;span class="fs_error fs_login_form_error"&gt;Password is a required field but was not provided.&lt;/span&gt;&lt;br/&gt;&lt;/div&gt;&lt;div id="fs_username_div" class="fs_formfieldline fs_text fs_username fs_has_errors "&gt;
    &lt;label class="fs_label fs_text_label " for="fs_login_form_username_input"&gt;Username&lt;/label&gt;
    &lt;input type="text" id="fs_login_form_username_input" class="fs_input fs_text_input fs_username_input " name="username" value="1" /&gt;
&lt;/div&gt;

&lt;div id="fs_password_div" class="fs_formfieldline fs_text fs_password fs_has_errors "&gt;
    &lt;label class="fs_label fs_text_label " for="fs_login_form_password_input"&gt;Password&lt;/label&gt;
    &lt;input type="password" id="fs_login_form_password_input" class="fs_input fs_text_input fs_password_input " name="password"/&gt;
&lt;/div&gt;

&lt;div id="fs_submit_div" class="fs_formfieldline fs_trigger fs_submit  "&gt;


    &lt;input type="submit" id="fs_login_form_submit_input" class="fs_input fs_trigger_input fs_submit_input  " name="submit" value="Submit" /&gt;    

&lt;/div&gt;

&lt;/form&gt;
&lt;/div&gt;

[% INCLUDE 'forms-list.txt' %]

@public,forms,perl</description>
      <dc:date>2011-05-19T23:46:16+01:00</dc:date>
      <dc:subject>public forms perl</dc:subject>
      <title>Under the palm tree (looking-at-forms-3.html)</title>
      <pubDate>Thu, 19 May 2011 23:46:16 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Looking at forms (3 - Form::Sensible)&lt;/h1&gt;

&lt;p&gt;&lt;a href="/~castaway/blog/looking-at-forms.html"&gt;As previously mentioned...&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Form::Sensible&lt;/h2&gt;

&lt;p&gt;Started in Jan 2010, and last updated this year (Jan 2011), this one
looks slightly more alive than the previous candidates. Jumping
straight to the
&lt;a href="http://search.cpan.org/perldoc?Form::Sensible::Overview"&gt;Overview&lt;/a&gt;,
it's worth reading through the rather long philosophy explanation to
see whats going on here.&lt;/p&gt;

&lt;p&gt;The aim of this module seems to be to define a set of fields based on
what data you want to ultimately obtain, and leave the rendering end
to figure out how to present that to the user. The advantage being
that your data gathering end doesn't care if your frontend presents
"pick one of these" as a drop-down, or a set of checkboxes, or
something even stranger.&lt;/p&gt;

&lt;h3&gt;Pros&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Nice separation of concerns&lt;/li&gt;
&lt;li&gt;Built-in HTML rendering outputs labels, ids and classes and is valid.&lt;/li&gt;
&lt;li&gt;Decent looking starter documentation.&lt;/li&gt;
&lt;li&gt;Content validation can be done via regex, coderef or plain "required".&lt;/li&gt;
&lt;li&gt;Error messages can be changed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Cons&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Doesn't seem to be a way to permanently define a form using a class. The simple data structure could be stored as XML, YAML or some other config type though.&lt;/li&gt;
&lt;li&gt;Docs link to a non-existent wiki page.&lt;/li&gt;
&lt;li&gt;Open and unsolved bugs.&lt;/li&gt;
&lt;li&gt;Form structure hashref not validated (I typed "rehex" instead of "regex" and there was no error or warning).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Sample code (mostly from Overview doc)&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/env perl

use strict;
use warnings;

use Form::Sensible;

my $form = Form::Sensible-&amp;gt;create_form( 
    {
        name =&amp;gt; 'login_form',
        fields =&amp;gt; [
            { 
                field_class =&amp;gt; 'Text',
                name =&amp;gt; 'username',
                validation =&amp;gt; { 
                    regex =&amp;gt; '{2,}',
                    required =&amp;gt; 1,
                }
            },
            {
                field_class =&amp;gt; 'Text',
                name =&amp;gt; 'password',
                validation =&amp;gt; { 
                    required =&amp;gt; 1,
                    regex =&amp;gt; '{2,}',
                },
                render_hints =&amp;gt; { 
                    'HTML' =&amp;gt; {
                        render_as =&amp;gt; 'password' 
                    }
                },
            },
            {
                field_class =&amp;gt; 'Trigger',
                name =&amp;gt; 'submit'
            }
            ],
    } );

my $renderer = Form::Sensible-&amp;gt;get_renderer('HTML');
my $renderedform = $renderer-&amp;gt;render($form);

print $renderedform-&amp;gt;complete('', 'post'); 
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Sample output&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;div id="fs_login_form_form_div" class="fs_form_container fs_login_form_form_container"&amp;gt;
    &amp;lt;form action="" method="post" id="fs_login_form_form" class="fs_form fs_login_form_form" accept-charset="utf-8" &amp;gt;
&amp;lt;div id="fs_username_div" class="fs_formfieldline fs_text fs_username  "&amp;gt;
    &amp;lt;label class="fs_label fs_text_label " for="fs_login_form_username_input"&amp;gt;Username&amp;lt;/label&amp;gt;
    &amp;lt;input type="text" id="fs_login_form_username_input" class="fs_input fs_text_input fs_username_input " name="username" value="" /&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;div id="fs_password_div" class="fs_formfieldline fs_text fs_password  "&amp;gt;
    &amp;lt;label class="fs_label fs_text_label " for="fs_login_form_password_input"&amp;gt;Password&amp;lt;/label&amp;gt;
    &amp;lt;input type="password" id="fs_login_form_password_input" class="fs_input fs_text_input fs_password_input " name="password"/&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;div id="fs_submit_div" class="fs_formfieldline fs_trigger fs_submit  "&amp;gt;


    &amp;lt;input type="submit" id="fs_login_form_submit_input" class="fs_input fs_trigger_input fs_submit_input  " name="submit" value="Submit" /&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Input validation&lt;/h3&gt;

&lt;p&gt;To validate the input values against the rules given earlier:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$form-&amp;gt;set_values({ username =&amp;gt; '1',
                    password =&amp;gt; '',
                  });
my $result = $form-&amp;gt;validate();
if(!$result-&amp;gt;is_valid) {
    $renderedform = $renderer-&amp;gt;render($form);
    $renderedform-&amp;gt;add_errors_from_validator_result($result);
    print "Form with errors\n";
    print $renderedform-&amp;gt;complete('','post');
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and you get:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;div id="fs_login_form_form_div" class="fs_form_container fs_login_form_form_container"&amp;gt;
    &amp;lt;form action="" method="post" id="fs_login_form_form" class="fs_form fs_login_form_form" accept-charset="utf-8" &amp;gt;
&amp;lt;div class="fs_errorblock fs_login_form_errorblock"&amp;gt;    &amp;lt;span class="fs_error fs_login_form_error"&amp;gt;Username is invalid.&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;    &amp;lt;span class="fs_error fs_login_form_error"&amp;gt;Password is a required field but was not provided.&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div id="fs_username_div" class="fs_formfieldline fs_text fs_username fs_has_errors "&amp;gt;
    &amp;lt;label class="fs_label fs_text_label " for="fs_login_form_username_input"&amp;gt;Username&amp;lt;/label&amp;gt;
    &amp;lt;input type="text" id="fs_login_form_username_input" class="fs_input fs_text_input fs_username_input " name="username" value="1" /&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;div id="fs_password_div" class="fs_formfieldline fs_text fs_password fs_has_errors "&amp;gt;
    &amp;lt;label class="fs_label fs_text_label " for="fs_login_form_password_input"&amp;gt;Password&amp;lt;/label&amp;gt;
    &amp;lt;input type="password" id="fs_login_form_password_input" class="fs_input fs_text_input fs_password_input " name="password"/&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;div id="fs_submit_div" class="fs_formfieldline fs_trigger fs_submit  "&amp;gt;


    &amp;lt;input type="submit" id="fs_login_form_submit_input" class="fs_input fs_trigger_input fs_submit_input  " name="submit" value="Submit" /&amp;gt;    

&amp;lt;/div&amp;gt;

&amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;[% INCLUDE 'forms-list.txt' %]&lt;/p&gt;

&lt;p&gt;@public,forms,perl&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2011-05-19T23:46:16+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/looking-at-forms-3.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public perl html forms</category>
      <link>http://desert-island.me.uk/~castaway/blog/looking-at-forms-2.html</link>
      <description>Looking at forms (2 - Form::Factory)
====================================

Let's see how long I can keep this up.

Reminder of the plan + criteria


Form::Factory
-------------

Somewhat convoluted looking module, started in November 2009, last
updated September 2010. It's Moose based, and made of many small modules
for defining Controls, Features and bits of Interface. The main way to
use it appears to be to define your own Action class, adding named
controls as needed for the form.

I figured out how to make a simple form by reading Form::Factory,
Form::Factory::Action then Form::Factory::Processor. No idea why this
last one, but it has an Action example in it.


Pros

  * Can easily define collections of fields (Actions).

  * Creates compact HTML which seems to contain enough structure to be
    styled usefully.

  * Outputs labels for each control as requested.

  * Outputs elements for storing error messages.


Cons

  * Quite confusing documentation, which doesn't contain a full example
    in the synopsis

  * Docs are from the point of view of someone in the know (stashed?
    what?)

  * Error message elements are empty UL tags, this fails validation.

  * Relies on deprecated Moose API (Moose::Util::MetaRole API).

  * Rendered controls seem to appear in a random order when the entire
    form is rendered (I got Password, Username, Submit).


Sample code (created by me)

#!/usr/bin/perl

package MyApp::Action::Login;
use Form::Factory::Processor;

has_control username =&gt; {
    control =&gt; 'text',
    options =&gt; {
        label =&gt; 'Username',
    },
    features =&gt; {
        required =&gt; 1,
        length =&gt; {
            minimum =&gt; 2,
        },
    },
};

has_control password =&gt; {
    control =&gt; 'password',
    options =&gt; {
        label =&gt; 'Password',
    },
    features =&gt; {
        required =&gt; 1,
        length =&gt; {
            minimum =&gt; 2,
        },
    },
};

has_control submit =&gt; {
    control =&gt; 'button',
    options =&gt; {
        label =&gt; 'Submit',
    },
};


1;

package main;

use strict;
use warnings;

use Form::Factory;

my $interface = Form::Factory-&gt;new_interface('HTML');
my $action  = $interface-&gt;new_action('MyApp::Action::Login');

$action-&gt;render;


Sample output (newlines added by me)
------------------------------------

&lt;div id="password-wrapper" class="form widget wrapper password"&gt;&lt;/div&gt;
&lt;label id="password-label" class="form widget label password"for="password"&gt;Password&lt;span class="form required"&gt;*&lt;/span&gt;&lt;/label&gt;
&lt;input id="password" class="form widget field password"value="" name="password" type="password"/&gt;
&lt;ul id="password-alerts" class="form widget alerts password"&gt;&lt;/ul&gt;
&lt;div id="username-wrapper" class="form widget wrapper text"&gt;&lt;/div&gt;
&lt;label id="username-label" class="form widget label text"for="username"&gt;Username&lt;span class="form required"&gt;*&lt;/span&gt;&lt;/label&gt;
&lt;input id="username" class="form widget field text"value="" name="username" type="text"/&gt;
&lt;ul id="username-alerts" class="form widget alerts text"&gt;&lt;/ul&gt;
&lt;input id="submit" class="form widget field button"value="Submit" name="submit" type="submit"/&gt;


Update (input validation)
-------------------------

Looks like I forgot to attempt input validation with this one, which
claims to support it. My excuse is that my 30min test time was up.

According to the SYNOPSIS, one does something like this:

## data validation test (empty form):
$action-&gt;consume_and_clean_and_check_and_process( request =&gt; {} );
if(!$action-&gt;is_valid) {

    print "\n Errors :\n", $action-&gt;error_messages, "\n";
    print "\n Rendered: \n", $action-&gt;render, "\n";
}

## data validation test (all values):
$action-&gt;consume_and_clean_and_check_and_process( request =&gt; { 
    username =&gt; 'Fred',
    password =&gt; 'Bloggs',
                                                  } );
if($action-&gt;is_valid) {
    print "It worked!\n";
}

However this is what comes out:

 Errors :
 Form::Factory::Message=HASH(0x89c95f8)Form::Factory::Message=HASH(0x894db60)
 &lt;div id="password-wrapper" class="form widget wrapper password"&gt;&lt;/div&gt;&lt;label id="password-label" class="form widget label password"for="password"&gt;Password
 &lt;span class="form required"&gt;*&lt;/span&gt;&lt;/label&gt;&lt;input id="password" class="form widget field password"value="" name="password" type="password"/&gt;
 &lt;ul id="password-alerts" class="form widget alerts password"&gt;&lt;li id="password-message-1" class="form widget message password error"&gt;The Password is required.&lt;/li&gt;&lt;/ul&gt;
 &lt;div id="username-wrapper" class="form widget wrapper text"&gt;&lt;/div&gt;&lt;
 label id="username-label" class="form widget label text"for="username"&gt;Username
 &lt;span class="form required"&gt;*&lt;/span&gt;&lt;/label&gt;&lt;input id="username" class="form widget field text"value="" name="username" type="text"/&gt;
 &lt;ul id="username-alerts" class="form widget alerts text"&gt;&lt;li id="username-message-1" class="form widget message text error"&gt;The Username is required.&lt;/li&gt;&lt;/ul&gt;
 &lt;input id="submit" class="form widget field button"value="Submit" name="submit" type="submit"/&gt;
  Rendered:

  Can't locate object method "run" via package "MyApp::Action::Login" at /usr/src/perl/forms/perl5/lib/perl5/Form/Factory/Action.pm line 605.

So not quite sure what the error_messages method is about, but at least
result is "invalid", and the re-rendered HTML contains error messages.

[% INCLUDE 'forms-list.txt' %]

@public,perl,html,forms</description>
      <dc:date>2011-05-19T23:29:42+01:00</dc:date>
      <dc:subject>public perl html forms</dc:subject>
      <title>Under the palm tree (looking-at-forms-2.html)</title>
      <pubDate>Thu, 19 May 2011 23:29:42 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Looking at forms (2 - Form::Factory)&lt;/h1&gt;

&lt;p&gt;Let's see how long I can keep this up.&lt;/p&gt;

&lt;p&gt;&lt;a href="/~castaway/blog/looking-at-forms.html"&gt;Reminder of the plan + criteria&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Form::Factory&lt;/h2&gt;

&lt;p&gt;Somewhat convoluted looking module, started in November 2009, last
updated September 2010. It's Moose based, and made of many small
modules for defining Controls, Features and bits of Interface. The
main way to use it appears to be to define your own &lt;code&gt;Action&lt;/code&gt; class,
adding named controls as needed for the form. &lt;/p&gt;

&lt;p&gt;I figured out how to make a simple form by reading
&lt;a href="http://search.cpan.org/perldoc?Form::Factory"&gt;Form::Factory&lt;/a&gt;,
&lt;a href="http://search.cpan.org/perldoc?Form::Factory::Action"&gt;Form::Factory::Action&lt;/a&gt;
then
&lt;a href="http://search.cpan.org/perldoc?Form::Factory::Processor"&gt;Form::Factory::Processor&lt;/a&gt;. No
idea why this last one, but it has an Action example in it.&lt;/p&gt;

&lt;h3&gt;Pros&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Can easily define collections of fields (Actions).&lt;/li&gt;
&lt;li&gt;Creates compact HTML which seems to contain enough structure to be styled usefully.&lt;/li&gt;
&lt;li&gt;Outputs labels for each control as requested.&lt;/li&gt;
&lt;li&gt;Outputs elements for storing error messages.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Cons&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Quite confusing documentation, which doesn't contain a full example in the synopsis&lt;/li&gt;
&lt;li&gt;Docs are from the point of view of someone in the know (stashed? what?)&lt;/li&gt;
&lt;li&gt;Error message elements are empty UL tags, this fails validation.&lt;/li&gt;
&lt;li&gt;Relies on deprecated Moose API (Moose::Util::MetaRole API).&lt;/li&gt;
&lt;li&gt;Rendered controls seem to appear in a random order when the entire form is rendered (I got Password, Username, Submit).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Sample code (created by me)&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/perl

package MyApp::Action::Login;
use Form::Factory::Processor;

has_control username =&amp;gt; {
    control =&amp;gt; 'text',
    options =&amp;gt; {
        label =&amp;gt; 'Username',
    },
    features =&amp;gt; {
        required =&amp;gt; 1,
        length =&amp;gt; {
            minimum =&amp;gt; 2,
        },
    },
};

has_control password =&amp;gt; {
    control =&amp;gt; 'password',
    options =&amp;gt; {
        label =&amp;gt; 'Password',
    },
    features =&amp;gt; {
        required =&amp;gt; 1,
        length =&amp;gt; {
            minimum =&amp;gt; 2,
        },
    },
};

has_control submit =&amp;gt; {
    control =&amp;gt; 'button',
    options =&amp;gt; {
        label =&amp;gt; 'Submit',
    },
};


1;

package main;

use strict;
use warnings;

use Form::Factory;

my $interface = Form::Factory-&amp;gt;new_interface('HTML');
my $action  = $interface-&amp;gt;new_action('MyApp::Action::Login');

$action-&amp;gt;render;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Sample output (newlines added by me)&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;div id="password-wrapper" class="form widget wrapper password"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;label id="password-label" class="form widget label password"for="password"&amp;gt;Password&amp;lt;span class="form required"&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;
&amp;lt;input id="password" class="form widget field password"value="" name="password" type="password"/&amp;gt;
&amp;lt;ul id="password-alerts" class="form widget alerts password"&amp;gt;&amp;lt;/ul&amp;gt;
&amp;lt;div id="username-wrapper" class="form widget wrapper text"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;label id="username-label" class="form widget label text"for="username"&amp;gt;Username&amp;lt;span class="form required"&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;
&amp;lt;input id="username" class="form widget field text"value="" name="username" type="text"/&amp;gt;
&amp;lt;ul id="username-alerts" class="form widget alerts text"&amp;gt;&amp;lt;/ul&amp;gt;
&amp;lt;input id="submit" class="form widget field button"value="Submit" name="submit" type="submit"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Update (input validation)&lt;/h2&gt;

&lt;p&gt;Looks like I forgot to attempt input validation with this one, which
claims to support it. My excuse is that my 30min test time was up.&lt;/p&gt;

&lt;p&gt;According to the SYNOPSIS, one does something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;## data validation test (empty form):
$action-&amp;gt;consume_and_clean_and_check_and_process( request =&amp;gt; {} );
if(!$action-&amp;gt;is_valid) {

    print "\n Errors :\n", $action-&amp;gt;error_messages, "\n";
    print "\n Rendered: \n", $action-&amp;gt;render, "\n";
}

## data validation test (all values):
$action-&amp;gt;consume_and_clean_and_check_and_process( request =&amp;gt; { 
    username =&amp;gt; 'Fred',
    password =&amp;gt; 'Bloggs',
                                                  } );
if($action-&amp;gt;is_valid) {
    print "It worked!\n";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;However this is what comes out:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; Errors :
 Form::Factory::Message=HASH(0x89c95f8)Form::Factory::Message=HASH(0x894db60)
 &amp;lt;div id="password-wrapper" class="form widget wrapper password"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;label id="password-label" class="form widget label password"for="password"&amp;gt;Password
 &amp;lt;span class="form required"&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&amp;lt;input id="password" class="form widget field password"value="" name="password" type="password"/&amp;gt;
 &amp;lt;ul id="password-alerts" class="form widget alerts password"&amp;gt;&amp;lt;li id="password-message-1" class="form widget message password error"&amp;gt;The Password is required.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;
 &amp;lt;div id="username-wrapper" class="form widget wrapper text"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;
 label id="username-label" class="form widget label text"for="username"&amp;gt;Username
 &amp;lt;span class="form required"&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&amp;lt;input id="username" class="form widget field text"value="" name="username" type="text"/&amp;gt;
 &amp;lt;ul id="username-alerts" class="form widget alerts text"&amp;gt;&amp;lt;li id="username-message-1" class="form widget message text error"&amp;gt;The Username is required.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;
 &amp;lt;input id="submit" class="form widget field button"value="Submit" name="submit" type="submit"/&amp;gt;
  Rendered:

  Can't locate object method "run" via package "MyApp::Action::Login" at /usr/src/perl/forms/perl5/lib/perl5/Form/Factory/Action.pm line 605.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So not quite sure what the error_messages method is about, but at
least result is "invalid", and the re-rendered HTML contains error
messages.&lt;/p&gt;

&lt;p&gt;[% INCLUDE 'forms-list.txt' %]&lt;/p&gt;

&lt;p&gt;@public,perl,html,forms&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2011-05-19T23:29:42+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/looking-at-forms-2.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public perl html forms</category>
      <link>http://desert-island.me.uk/~castaway/blog/looking-at-forms.html</link>
      <description>Looking at forms (1 - Form::Maker)
==================================

There seem to be many, many, modules on CPAN which deal with the business
of UI (usually HTML) forms in one way or another. I've often wondered why
there are so many, and why it is that the earlier ones are either not
found, or not used, by those who made the later ones.

I think I'll take a look at some, and see what they do. First up is
Form::Maker, from Simon Cozens (and Kasei), just because it appears near
the top of my search, and seems relatively simple.

For now I'm going to look into how to create a simple Login form with
each module, and list what seem to be the pros and cons. This will be
after 30mins (ish) of attempting to get a login form working, and reading
the available documentation, so it may miss a lot (but so will users
looking for tools!).


Form requirements
-----------------


Controls

  * username - text input

  * password - password input

  * login button - submit button


Submission validation

Each input field should contain a value longer than two characters.


HTML validation

The HTML created should be valid, for instance it should not have
repeating ID attributes.


Accessibility

It should be possible to output a label for each input field, using the
for attribute and the input fields id.


Form::Maker
-----------

Builds on existing HTML::Element objects (which already have as_HTML
methods) using a simple framework of Fields, Buttons, Renderers and
Validators. See Form::Maker::Introduction for an overview of how to use
it. The documentation is somewhat sparse otherwise.


Pros

  * Has a way to specify / predefine collections of fields as a named
    form

  * Contains a predefined Login form with username, password, submit and
    reset.

  * Is easily extensible, and behaviour is easily overridden.

  * Re-uses HTML::Element nicely, no need to provide its own rendering.


Cons

  * HTML output using the HTML renderer (default) may change with
    HTML::Element updates.

  * No actual validation or parsing of submitted data possible, just
    provides a way to store validation info per field.

  * Only pure form controls are created, no UI elements such as labels or
    layout.

  * No element IDs or classes are added to the output.

  * Outstanding bugs.


Sample code (created by me)

#!/usr/bin/env perl
## A Login form using Form::Maker (0.03)

use strict;
use warnings;

use Form::Maker;

print "Using built-in login form outline: \n";
my $login_form = Form::Maker-&gt;make('Form::Outline::Login');
print $login_form, "\n";

print "Using manual form creation: \n";
my $login_manual = Form::Maker-&gt;make();
$login_manual-&gt;add_fields(
    Form::Field::Text-&gt;new({ name =&gt; 'username' }),
    Form::Field::Password-&gt;new({ name =&gt; 'password' })
);
print $login_manual, "\n";

print "Adding validation to built-in form: \n";
$login_form-&gt;add_validation(username =&gt; 'Form::Validator::Email');
print $login_form, "\n";

print "Rendering form parts: \n";
print "Start:\n";
print $login_form-&gt;start;
print "Fieldset:\n";
print $login_form-&gt;fieldset;
print "Buttons:\n";
print $login_form-&gt;buttons;
print "End: \n";
print $login_form-&gt;end;


Sample code output (added)

Using built-in login form outline: 
&lt;form&gt;
&lt;!-- begin fields --&gt;
&lt;input name="username" type="text" /&gt;&lt;input name="password" type="password" /&gt;
&lt;!-- end fields --&gt;
&lt;input name="submit" type="submit" /&gt;&lt;input name="reset" type="reset" /&gt;&lt;/form&gt;
Using manual form creation: 
&lt;form&gt;
&lt;!-- begin fields --&gt;
&lt;input name="username" type="text" /&gt;&lt;input name="password" type="password" /&gt;
&lt;!-- end fields --&gt;
&lt;input name="submit" type="submit" /&gt;&lt;input name="reset" type="reset" /&gt;&lt;/form&gt;
Adding validation to built-in form: 
&lt;form&gt;
&lt;!-- begin fields --&gt;
&lt;input id="field1" name="username" onblur="validate(&amp;#39;field1&amp;#39;, &amp;#39;username&amp;#39;, /^[\w\-\+\._]+\@[a-zA-Z0-9][-a-zA-Z0-9\.]*\.[a-zA-Z]+$/)" type="text" /&gt;&lt;input name="password" type="password" /&gt;
&lt;!-- end fields --&gt;
&lt;input name="submit" type="submit" /&gt;&lt;input name="reset" type="reset" /&gt;&lt;/form&gt;
Rendering form parts: 
Start:
&lt;form&gt;Fieldset:

&lt;!-- begin fields --&gt;
&lt;input id="field2" name="username" onblur="validate(&amp;#39;field2&amp;#39;, &amp;#39;username&amp;#39;, /^[\w\-\+\._]+\@[a-zA-Z0-9][-a-zA-Z0-9\.]*\.[a-zA-Z]+$/)" type="text" /&gt;&lt;input name="password" type="password" /&gt;
&lt;!-- end fields --&gt;
Buttons:
&lt;input name="submit" type="submit" /&gt;&lt;input name="reset" type="reset" /&gt;End: 
&lt;/form&gt;

Update: Added suggested criteria about labels and ids from David

[% INCLUDE 'forms-list.txt' %]

@public,perl,html,forms</description>
      <dc:date>2011-05-19T23:29:27+01:00</dc:date>
      <dc:subject>public perl html forms</dc:subject>
      <title>Under the palm tree (looking-at-forms.html)</title>
      <pubDate>Thu, 19 May 2011 23:29:27 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Looking at forms (1 - Form::Maker)&lt;/h1&gt;

&lt;p&gt;There seem to be many, many, modules on
&lt;a href="http://search.cpan.org/search?query=form&amp;amp;mode=dist"&gt;CPAN&lt;/a&gt; which deal
with the business of UI (usually HTML) forms in one way or
another. I've often wondered why there are so many, and why it is that
the earlier ones are either not found, or not used, by those who made
the later ones.&lt;/p&gt;

&lt;p&gt;I think I'll take a look at some, and see what they do. First up is
&lt;a href="http://search.cpan.org/dist/Form-Maker"&gt;Form::Maker&lt;/a&gt;, from Simon
Cozens (and Kasei), just because it appears near the top of my search,
and seems relatively simple.&lt;/p&gt;

&lt;p&gt;For now I'm going to look into how to create a simple Login form with
each module, and list what seem to be the pros and cons. This will be
after 30mins (ish) of attempting to get a login form working, and
reading the available documentation, so it may miss a lot (but so will
users looking for tools!).&lt;/p&gt;

&lt;h2&gt;Form requirements&lt;/h2&gt;

&lt;h3&gt;Controls&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;username - text input&lt;/li&gt;
&lt;li&gt;password - password input&lt;/li&gt;
&lt;li&gt;login button - submit button&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Submission validation&lt;/h3&gt;

&lt;p&gt;Each input field should contain a value longer than two characters.&lt;/p&gt;

&lt;h3&gt;HTML validation&lt;/h3&gt;

&lt;p&gt;The HTML created should be valid, for instance it should not have repeating ID attributes.&lt;/p&gt;

&lt;h3&gt;Accessibility&lt;/h3&gt;

&lt;p&gt;It should be possible to output a label for each input field, using the &lt;code&gt;for&lt;/code&gt; attribute and the input fields &lt;code&gt;id&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Form::Maker&lt;/h2&gt;

&lt;p&gt;Builds on existing HTML::Element objects (which already have as_HTML
methods) using a simple framework of Fields, Buttons, Renderers and
Validators. See
&lt;a href="http://search.cpan.org/~simon/Form-Maker-0.03/lib/Form/Maker/Introduction.pm"&gt;Form::Maker::Introduction&lt;/a&gt;
for an overview of how to use it. The documentation is somewhat
sparse otherwise.&lt;/p&gt;

&lt;h3&gt;Pros&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Has a way to specify / predefine collections of fields as a named form&lt;/li&gt;
&lt;li&gt;Contains a predefined Login form with username, password, submit and reset.&lt;/li&gt;
&lt;li&gt;Is easily extensible, and behaviour is easily overridden.&lt;/li&gt;
&lt;li&gt;Re-uses HTML::Element nicely, no need to provide its own rendering.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Cons&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;HTML output using the HTML renderer (default) may change with HTML::Element updates.&lt;/li&gt;
&lt;li&gt;No actual validation or parsing of submitted data possible, just provides a way to store validation info per field.&lt;/li&gt;
&lt;li&gt;Only pure form controls are created, no UI elements such as labels or layout.&lt;/li&gt;
&lt;li&gt;No element IDs or classes are added to the output.&lt;/li&gt;
&lt;li&gt;Outstanding bugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Sample code (created by me)&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/env perl
## A Login form using Form::Maker (0.03)

use strict;
use warnings;

use Form::Maker;

print "Using built-in login form outline: \n";
my $login_form = Form::Maker-&amp;gt;make('Form::Outline::Login');
print $login_form, "\n";

print "Using manual form creation: \n";
my $login_manual = Form::Maker-&amp;gt;make();
$login_manual-&amp;gt;add_fields(
    Form::Field::Text-&amp;gt;new({ name =&amp;gt; 'username' }),
    Form::Field::Password-&amp;gt;new({ name =&amp;gt; 'password' })
);
print $login_manual, "\n";

print "Adding validation to built-in form: \n";
$login_form-&amp;gt;add_validation(username =&amp;gt; 'Form::Validator::Email');
print $login_form, "\n";

print "Rendering form parts: \n";
print "Start:\n";
print $login_form-&amp;gt;start;
print "Fieldset:\n";
print $login_form-&amp;gt;fieldset;
print "Buttons:\n";
print $login_form-&amp;gt;buttons;
print "End: \n";
print $login_form-&amp;gt;end;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Sample code output (added)&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;Using built-in login form outline: 
&amp;lt;form&amp;gt;
&amp;lt;!-- begin fields --&amp;gt;
&amp;lt;input name="username" type="text" /&amp;gt;&amp;lt;input name="password" type="password" /&amp;gt;
&amp;lt;!-- end fields --&amp;gt;
&amp;lt;input name="submit" type="submit" /&amp;gt;&amp;lt;input name="reset" type="reset" /&amp;gt;&amp;lt;/form&amp;gt;
Using manual form creation: 
&amp;lt;form&amp;gt;
&amp;lt;!-- begin fields --&amp;gt;
&amp;lt;input name="username" type="text" /&amp;gt;&amp;lt;input name="password" type="password" /&amp;gt;
&amp;lt;!-- end fields --&amp;gt;
&amp;lt;input name="submit" type="submit" /&amp;gt;&amp;lt;input name="reset" type="reset" /&amp;gt;&amp;lt;/form&amp;gt;
Adding validation to built-in form: 
&amp;lt;form&amp;gt;
&amp;lt;!-- begin fields --&amp;gt;
&amp;lt;input id="field1" name="username" onblur="validate(&amp;amp;#39;field1&amp;amp;#39;, &amp;amp;#39;username&amp;amp;#39;, /^[\w\-\+\._]+\@[a-zA-Z0-9][-a-zA-Z0-9\.]*\.[a-zA-Z]+$/)" type="text" /&amp;gt;&amp;lt;input name="password" type="password" /&amp;gt;
&amp;lt;!-- end fields --&amp;gt;
&amp;lt;input name="submit" type="submit" /&amp;gt;&amp;lt;input name="reset" type="reset" /&amp;gt;&amp;lt;/form&amp;gt;
Rendering form parts: 
Start:
&amp;lt;form&amp;gt;Fieldset:

&amp;lt;!-- begin fields --&amp;gt;
&amp;lt;input id="field2" name="username" onblur="validate(&amp;amp;#39;field2&amp;amp;#39;, &amp;amp;#39;username&amp;amp;#39;, /^[\w\-\+\._]+\@[a-zA-Z0-9][-a-zA-Z0-9\.]*\.[a-zA-Z]+$/)" type="text" /&amp;gt;&amp;lt;input name="password" type="password" /&amp;gt;
&amp;lt;!-- end fields --&amp;gt;
Buttons:
&amp;lt;input name="submit" type="submit" /&amp;gt;&amp;lt;input name="reset" type="reset" /&amp;gt;End: 
&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;small&gt;Update: Added suggested criteria about labels and ids from David&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;[% INCLUDE 'forms-list.txt' %]&lt;/p&gt;

&lt;p&gt;@public,perl,html,forms&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2011-05-19T23:29:27+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/looking-at-forms.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>diary walking public</category>
      <link>http://desert-island.me.uk/~castaway/blog/walking_the_thames_path_4.html</link>
      <description>Walking the Thames Path, Part 4
===============================

Our Serial/USB adaptor is refusing to work, so no route of the walk yet.
I shouldn't let that stop me from writing it up at all though.

There being lots of lovely long weekends lately, and one of them being
mine to plan, I decided to walk another chunk of the Thames Path.
Previously, I'd been from Cricklade to Ashton Keynes, Ashton Keynes to
Somerford Keynes and Somerford Keynes to the Source. Having run out of
Path towards the source, it was time to walk some of the rest of it.

James volunteered to join me for this one, and suggested we walk the Path
one direction, Castle Eaton to Cricklade, then he hang about in Cricklade
and wait for me, while I went back and got the car.

We drove to Castle Eaton on the lovely sunny Friday morning, while
certain royals were busy getting married, and no doubt many other people
were partying in the streets (not that we saw any of them). Packing this
time consisted of lunch for two, choc snacks, drinks, my laptop (the
packable EEPC, though still not super light!) including it's broadband
dongle, umbrellas (hey, they said it would rain!), and I forget what
else.. Ah, my eReader, weighing not much at all.

Following the satnav, and then my map, we parked on Long Row, which is
actually part of the Thames Path, as it travels through Castle Eaton. We
followed the Thames Path, with its distinctive wooden acorn signs (who
maintains all those!?) quite easily to Cricklade, past enormous fields of
yellow oilseed rape (James: Ick, organised farming), and little off-cut
areas of land which seem to be just wild (James: Yay!).. There are
pictures, somewhere.

Reaching Cricklade, we crossed under the A419 (hooray! I'd expected we
were going to have to cross over it), and into the edge of Cricklade,
which is a lovely large leisure+sports field. Shortly after that we
reached North Wall, which was where I started my original
Cricklade-to-the-Source walk, several years earlier (yes, it's going to
take me a while at this speed!). Here we stopped for lunch, in a little
corner with benches, in commemoration of a milkman, who died on his
rounds.

30 minutes later I was ready to set off on the way back, James had
pondered the 2.5hours waiting for me to fetch the car and changed his
mind, so we set off again together.

Not liking to retrace my exact steps, I'd decided previously that it
looked possible (from the OS map, #169), that one could follow the
disused canal on part of the way back.. Let me say now, this is a bad
idea. There is indeed a nice walk from the Thames Path just east of the
A419, up towards and along what is presumably the old canal.. However it
does not meet up with the Thames Path again, at all. You end up in a
field on the wrong side of it, and unless you can long jump or pole
vault, no way to get across. After getting annoyed with ourselves a fair
bit, tramping through brambles on the wrong side of the Thames, and James
sinking his shoe up to the ankle in mud.. We retraced our steps back
through the field, to the canal (which at that end actually contains
water, and was in the process of having a lock repaired), and walked back
to Castle Eaton (mostly) along the road.

All in all, we did 23,000 steps, according to my pedometer, around 15.1km
or 9.4 miles.

I may post pictures later..

@diary,walking,public</description>
      <dc:date>2011-05-11T07:57:42+01:00</dc:date>
      <dc:subject>diary walking public</dc:subject>
      <title>Under the palm tree (walking_the_thames_path_4.html)</title>
      <pubDate>Wed, 11 May 2011 07:57:42 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Walking the Thames Path, Part 4&lt;/h1&gt;

&lt;p&gt;Our Serial/USB adaptor is refusing to work, so no route of the walk yet. I shouldn't let that stop me from writing it up at all though.&lt;/p&gt;

&lt;p&gt;There being lots of lovely long weekends lately, and one of them being mine to plan, I decided to walk another chunk of the Thames Path. Previously, I'd been from &lt;a href="http://desert-island.me.uk/~castaway/blog/739966.html"&gt;Cricklade to Ashton Keynes&lt;/a&gt;, &lt;a href="http://desert-island.me.uk/~castaway/blog/walking_the_thames_path_2.html"&gt;Ashton Keynes to Somerford Keynes&lt;/a&gt; and &lt;a href="http://desert-island.me.uk/~castaway/blog/2010-09-walking_the_thames_path_3.html"&gt;Somerford Keynes to the Source&lt;/a&gt;. Having run out of Path towards the source, it was time to walk some of the rest of it.&lt;/p&gt;

&lt;p&gt;James volunteered to join me for this one, and suggested we walk the Path one direction, Castle Eaton to Cricklade, then he hang about in Cricklade and wait for me, while I went back and got the car.&lt;/p&gt;

&lt;p&gt;We drove to Castle Eaton on the lovely sunny Friday morning, while certain royals were busy getting married, and no doubt many other people were partying in the streets (not that we saw any of them). Packing this time consisted of lunch for two, choc snacks, drinks, my laptop (the packable EEPC, though still not super light!) including it's broadband dongle, umbrellas (hey, they said it would rain!), and I forget what else.. Ah, my eReader, weighing not much at all.&lt;/p&gt;

&lt;p&gt;Following the satnav, and then my map, we parked on Long Row, which is actually part of the Thames Path, as it travels through Castle Eaton. We followed the Thames Path, with its distinctive wooden acorn signs (who maintains all those!?) quite easily to Cricklade, past enormous fields of yellow oilseed rape (James: Ick, organised farming), and little off-cut areas of land which seem to be just wild (James: Yay!).. There are pictures, somewhere.&lt;/p&gt;

&lt;p&gt;Reaching Cricklade, we crossed under the A419 (hooray! I'd expected we were going to have to cross over it), and into the edge of Cricklade, which is a lovely large leisure+sports field. Shortly after that we reached North Wall, which was where I started my original Cricklade-to-the-Source walk, several years earlier (yes, it's going to take me a while at this speed!). Here we stopped for lunch, in a little corner with benches, in commemoration of a milkman, who died on his rounds.&lt;/p&gt;

&lt;p&gt;30 minutes later I was ready to set off on the way back, James had pondered the 2.5hours waiting for me to fetch the car and changed his mind, so we set off again together. &lt;/p&gt;

&lt;p&gt;Not liking to retrace my exact steps, I'd decided previously that it looked possible (from the OS map, #169), that one could follow the disused canal on part of the way back.. Let me say now, this is a bad idea. There is indeed a nice walk from the Thames Path just east of the A419, up towards and along what is presumably the old canal.. However it does not meet up with the Thames Path again, at all. You end up in a field on the wrong side of it, and unless you can long jump or pole vault, no way to get across. After getting annoyed with ourselves a fair bit, tramping through brambles on the wrong side of the Thames, and James sinking his shoe up to the ankle in mud.. We retraced our steps back through the field, to the canal (which at that end actually contains water, and was in the process of having a lock repaired), and walked back to Castle Eaton (mostly) along the road.&lt;/p&gt;

&lt;p&gt;All in all, we did 23,000 steps, according to my pedometer, around 15.1km or 9.4 miles.&lt;/p&gt;

&lt;p&gt;I may post pictures later.. &lt;/p&gt;

&lt;p&gt;@diary,walking,public&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2011-05-11T07:57:42+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/walking_the_thames_path_4.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public ude uwn window-managers</category>
      <link>http://desert-island.me.uk/~castaway/blog/window-managers-and-desktop-environments.html</link>
      <description>Window managers and desktop environments
========================================

Currently using: UDE / UWM


Likes

  * 

    No panels, menu bars, icons etc cluttering up the screen

  * 

    Simple mouse based handling of windows, menus, and actions; using a
    UI that only appears when needed.

  * 

    Colours easily configurable

  * 

    Window edge "snap-to" support (easy to align windows)


Dislikes

  * 

    Little keyboard support (ALT+TAB etc would be handy)

  * 

    Some software needs an icon tray.

What Window Manager / [Desktop
environment]http://en.wikipedia.org/wiki/Desktop_environment)( do you
use, and why? (If you don't know, "the default one with will also do as
an answer)

@public,ude,uwn,window-managers</description>
      <dc:date>0</dc:date>
      <dc:subject>public ude uwn window-managers</dc:subject>
      <title>Under the palm tree (window-managers-and-desktop-environments.html)</title>
      <pubDate>Sat, 20 Nov 2010 15:36:59 -0000</pubDate>
      <content:encoded>&lt;h1&gt;Window managers and desktop environments&lt;/h1&gt;

&lt;p&gt;Currently using: &lt;a href="http://udeproject.sourceforge.net/"&gt;UDE / UWM&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Likes&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;No panels, menu bars, icons etc cluttering up the screen&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simple mouse based handling of windows, menus, and actions; using a UI that only appears when needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Colours easily configurable&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Window edge "snap-to" support (easy to align windows)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Dislikes&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Little keyboard support (ALT+TAB etc would be handy)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some software &lt;em&gt;needs&lt;/em&gt; an icon tray.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What &lt;a href="http://en.wikipedia.org/wiki/Window_manager"&gt;Window Manager&lt;/a&gt; / [Desktop environment]http://en.wikipedia.org/wiki/Desktop_environment)( do you use, and why? (If you don't know, "the default one with &lt;some version of some operating system&gt; will also do as an answer)&lt;/p&gt;

&lt;p&gt;@public,ude,uwn,window-managers&lt;/p&gt;
</content:encoded>
      <dcterms:modified>0</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/window-managers-and-desktop-environments.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public review laptop asus 701</category>
      <link>http://desert-island.me.uk/~castaway/blog/review-asus-701.html</link>
      <description>Durability review - Asus 701 "netbook" laptop
=============================================

  * Gadget

      * Asus 701 laptop (4G)

  * Owned

      * 3 years

  * Modified (from new)

      * 16 Gb SDHC card

      * Extended battery

      * Mobile broadband dongle

      * Replaced OS

  * Usage

      * Daily - Terminal (SSH) and browser. Occasional video watching.

  * 

    Verdict

      * 4.5/5

  * 

    Review

    This laptop has occasionally frustrated and confused (what hardware
    doesn't?), but on the whole generally worked. I had originally set up
    a replacement fund over two years, but since it doesn't need
    replacing yet, spent some of that on a new gadget instead!

    I quite liked the Asus-ified Linux OS it arrived with, however the
    version of unionfs used was buggy. The bug manifests itself by
    applications inexplicably reporting disc full, when there is plenty
    of space left. What actually happens it that the system runs out of
    inodes, as deleted files leave ghost copies on the hidden partition.
    In addition upgrades to software would install in the user partition,
    not the hidden system partition, and generally get in the way.

    In spite of these errors, Asus managed to pack a lot of software into
    the 4Gb of space, a feat I've failed to replicate using "netbuntu"
    (now "netbook edition" of ubuntu itself). The addition of an extra
    SDHC card permanently mounted to /usr has solved this issue.

    The extended battery means I can leave it on/suspended all day and
    still be able to use it on the way home or in the evening.


Summary
-------

I'd buy one of these again, maybe to replace this one if/when it dies.
The Asus tablets are looking interesting though..

@public,review,laptop,asus,701</description>
      <dc:date>2010-10-03T16:06:10+01:00</dc:date>
      <dc:subject>public review laptop asus 701</dc:subject>
      <title>Under the palm tree (review-asus-701.html)</title>
      <pubDate>Sun, 03 Oct 2010 16:06:10 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Durability review - Asus 701 "netbook" laptop&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Gadget
&lt;ul&gt;
&lt;li&gt;Asus 701 laptop (4G)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Owned
&lt;ul&gt;
&lt;li&gt;3 years &lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Modified (from new)
&lt;ul&gt;
&lt;li&gt;16 Gb SDHC card &lt;/li&gt;
&lt;li&gt;Extended battery&lt;/li&gt;
&lt;li&gt;Mobile broadband dongle&lt;/li&gt;
&lt;li&gt;Replaced OS&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Usage
&lt;ul&gt;
&lt;li&gt;Daily - Terminal (SSH) and browser. Occasional video watching.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verdict&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;4.5/5&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Review&lt;/p&gt;

&lt;p&gt;This laptop has occasionally frustrated and confused (what hardware doesn't?), but on the whole generally worked. I had originally set up a replacement fund over two years, but since it doesn't need replacing yet, spent some of that on a new gadget instead!&lt;/p&gt;

&lt;p&gt;I quite liked the Asus-ified Linux OS it arrived with, however the version of unionfs used was buggy. The bug manifests itself by applications inexplicably reporting disc full, when there is plenty of space left. What actually happens it that the system runs out of inodes, as deleted files leave ghost copies on the hidden partition. In addition upgrades to software would install in the user partition, not the hidden system partition, and generally get in the way.&lt;/p&gt;

&lt;p&gt;In spite of these errors, Asus managed to pack a lot of software into the 4Gb of space, a feat I've failed to replicate using "netbuntu" (now "netbook edition" of ubuntu itself). The addition of an extra SDHC card permanently mounted to /usr has solved this issue.&lt;/p&gt;

&lt;p&gt;The extended battery means I can leave it on/suspended all day and still be able to use it on the way home or in the evening.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;I'd buy one of these again, maybe to replace this one if/when it dies. The Asus tablets are looking interesting though..&lt;/p&gt;

&lt;p&gt;@public,review,laptop,asus,701&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2010-10-03T16:06:10+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/review-asus-701.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public comments disqus</category>
      <link>http://desert-island.me.uk/~castaway/blog/blog-with-comments.html</link>
      <description>Blog with comments
==================

Well that was too easy. Why write my own commenting system when Disqus
just appears to work?

@public,comments,disqus</description>
      <dc:date>2010-10-02T23:56:37+01:00</dc:date>
      <dc:subject>public comments disqus</dc:subject>
      <title>Under the palm tree (blog-with-comments.html)</title>
      <pubDate>Sat, 02 Oct 2010 23:56:37 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Blog with comments&lt;/h1&gt;

&lt;p&gt;Well that was too easy. Why write my own commenting system when
&lt;a href="http://www.disqus.com"&gt;Disqus&lt;/a&gt; just appears to work?&lt;/p&gt;

&lt;p&gt;@public,comments,disqus&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2010-10-02T23:56:37+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/blog-with-comments.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>diary walking public thames</category>
      <link>http://desert-island.me.uk/~castaway/blog/2010-09-walking_the_thames_path_3.html</link>
      <description>on August 23rd, 2010



Walking the Thames Path, part 3
===============================

Time to write some shorter blog posts, rather than none at all.

Previously, on walking the Thames Path, I walked from Waterhays to
Somerford Keynes. This time, I walked from Somerford Keynes to the
Source.

Here's the route

And some pictures, via Flickr

@diary,walking,public,thames</description>
      <dc:date>2010-09-13T16:44:32+01:00</dc:date>
      <dc:subject>diary walking public thames</dc:subject>
      <title>Under the palm tree (2010-09-walking_the_thames_path_3.html)</title>
      <pubDate>Mon, 13 Sep 2010 16:44:32 +0100</pubDate>
      <content:encoded>&lt;p&gt;on August 23rd, 2010&lt;/p&gt;

&lt;h1&gt;Walking the Thames Path, part 3&lt;/h1&gt;

&lt;p&gt;Time to write some shorter blog posts, rather than none at all.&lt;/p&gt;

&lt;p&gt;Previously, on &lt;em&gt;walking the Thames Path&lt;/em&gt;, I walked from
&lt;a href="/~castaway/blog/walking_the_thames_path_2.html"&gt;Waterhays to Somerford Keynes&lt;/a&gt;. This time, I walked from Somerford Keynes to the Source.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://maps.google.co.uk/?q=http://desert-island.me.uk/kml/20100823t-2-52.kml"&gt;Here's the route&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jessrobinson/sets/72157624816918273/with/4983453337/"&gt;And some pictures, via Flickr&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;@diary,walking,public,thames&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2010-09-13T16:44:32+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/2010-09-walking_the_thames_path_3.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public perl ironman</category>
      <link>http://desert-island.me.uk/~castaway/blog/dbic-sql-hackers-cont.html</link>
      <description>DBIx::Class for SQL hackers
===========================

Work in progress:

Introduction

Database structure (DDL)

INSERTing data

SELECTing data

@public,perl,ironman</description>
      <dc:date>2010-05-04T21:27:40+01:00</dc:date>
      <dc:subject>public perl ironman</dc:subject>
      <title>Under the palm tree (dbic-sql-hackers-cont.html)</title>
      <pubDate>Tue, 04 May 2010 21:27:40 +0100</pubDate>
      <content:encoded>&lt;h1&gt;DBIx::Class for SQL hackers&lt;/h1&gt;

&lt;p&gt;Work in progress:&lt;/p&gt;

&lt;p&gt;&lt;a href="/~castaway/docs/dbic-sql-hackers-introduction.html"&gt;Introduction&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/~castaway/docs/dbic-sql-hackers-db-structure.html"&gt;Database structure (DDL)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/~castaway/docs/dbic-sql-hackers-inserting-data.html"&gt;INSERTing data&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/~castaway/docs/dbic-sql-hackers-selecting-data.html"&gt;SELECTing data&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;@public,perl,ironman&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2010-05-04T21:27:40+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/dbic-sql-hackers-cont.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public perl dbix-class</category>
      <link>http://desert-island.me.uk/~castaway/blog/dbix-class-for-sql-hackers-1.html</link>
      <description>DBIx::Class for SQL Hackers (1)
===============================


History
-------

I volunteered (or was nudged) to apply to get the Enlightened Perl
Organisation's grant to document/write-up some material on using
DBIx::Class for SQL Hackers. The idea is to show folks that traditionally
use plain DBI in their Perl code, how to do the same queries and much
more, using DBIx::Class.


Plan
----

  * Grant proposal doc - DONE

Still waiting for Matt to look at this, or say something about it. Will
assume for now that its all fine.. ;)

  * User participation - TODO

I hope to post links to editable content via the EPO Wiki, helpfully both
my blog/doc format and that of the Wiki are Markdown, so I can shunt
things around easily.

  * Tutorial update/conversion - TODO

The DBIC Tutorial is a long-time work-in-progress which I really need to
get into a state/place where others can use and contribute to it. Is it a
good idea to convert to markdown and then add sections on "from SQL" to
complete the grant?


Introduction (Why ORMs and DBIx::Class)
---------------------------------------

Almost every sizable Perl application these days needs a method of long
term data storage. When the data needs to be easily retrieved as well as
stored, we often use a database. Most databases can be comfortably
accessed using SQL. Using the DBI module, and a DBD for the particular
database, we can write SQL in our Perl code, and retrieve the results as
arrays or hashes.

## Example
my $dbh = DBI-&gt;connect("dbi:SQLite:mydb.db");
my $sth = $dbh-&gt;select("SELECT artist.id, artist.name FROM artists");
$sth-&gt;execute;
my $results = $sth-&gt;fetchrow_arrayref({});

foreach my $row (@$results) {
  print $row-&gt;{name};
}

There are several things we can do to make this code more usable, for
example store the database connect string (DSN) in a configuration file
so that users of the code can use different databases without editing the
code. We can also write a separate method or module for creating and
returning the $dbh, so that we don't create a lot of db connections
unnecessarily.

The part we can't do much about is the SQL in the code. We can move it
around, put it in libraries, but it's still there, somewhere.

Why would you not want SQL in your Perl code? For a start, it's just a
string to pass to the database interpreter, there is no syntax checking
at the Perl compilation level. Thus it fails late, not early. Your editor
will also not syntax check what it just sees as strings of text.

Modern Perl should also leverage OO where it can. DBI is a low level
library that gets things right, but returns plain hashes and arrays, not
objects.

Perl ORMs still use DBI underneath, extending it to catch coding errors
early (names of columns, SQL clauses), and to return the results as
objects containing the database values, which work just like any other
Perl object.

Comments

@public,perl,dbix-class</description>
      <dc:date>0</dc:date>
      <dc:subject>public perl dbix-class</dc:subject>
      <title>Under the palm tree (dbix-class-for-sql-hackers-1.html)</title>
      <pubDate>Tue, 05 Jan 2010 21:34:24 -0000</pubDate>
      <content:encoded>&lt;h1&gt;DBIx::Class for SQL Hackers (1)&lt;/h1&gt;

&lt;h2&gt;History&lt;/h2&gt;

&lt;p&gt;I volunteered (or was nudged) to apply to get the &lt;a href="http://enlightenedperl.org"&gt;Enlightened Perl Organisation&lt;/a&gt;'s &lt;a href="http://www.enlightenedperl.org/grants/grants001.html"&gt;grant&lt;/a&gt; to document/write-up some material on using DBIx::Class for SQL Hackers. The idea is to show folks that traditionally use plain &lt;a href="http://search.cpan.org/dist/DBI"&gt;DBI&lt;/a&gt; in their Perl code, how to do the same queries and much more, using &lt;a href="http://search.cpan.org/dist/DBIx-Class"&gt;DBIx::Class&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Plan&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="/~castaway/docs/epo-grants.html"&gt;Grant proposal doc&lt;/a&gt; - DONE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still waiting for Matt to look at this, or say something about it. Will assume for now that its all fine.. ;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User participation - TODO&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope to post links to editable content via the &lt;a href="http://epo.means.no"&gt;EPO Wiki&lt;/a&gt;, helpfully both my blog/doc format and that of the Wiki are Markdown, so I can shunt things around easily.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tutorial update/conversion - TODO&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="/perldoc/dbic-tutorial/lib/DBIx/Class/Tutorial/Intro.pod"&gt;DBIC Tutorial&lt;/a&gt; is
a long-time work-in-progress which I really need to get into a state/place where others can use and contribute to it. Is it a good idea to &lt;a href="http://search.cpan.org/dist/Pod-Markdown/"&gt;convert to
markdown&lt;/a&gt; and then add sections on "from SQL" to complete the grant?&lt;/p&gt;

&lt;h2&gt;Introduction (Why ORMs and DBIx::Class)&lt;/h2&gt;

&lt;p&gt;Almost every sizable Perl application these days needs a method of long term data storage. When the data needs to be easily retrieved as well as stored, we often use a database. Most databases can be comfortably accessed using SQL. Using the DBI module, and a DBD for the particular database, we can write SQL in our Perl code, and retrieve the results as arrays or hashes.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;## Example
my $dbh = DBI-&amp;gt;connect("dbi:SQLite:mydb.db");
my $sth = $dbh-&amp;gt;select("SELECT artist.id, artist.name FROM artists");
$sth-&amp;gt;execute;
my $results = $sth-&amp;gt;fetchrow_arrayref({});

foreach my $row (@$results) {
  print $row-&amp;gt;{name};
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;There are several things we can do to make this code more usable, for example store the database connect string (DSN) in a configuration file so that users of the code can use different databases without editing the code. We can also write a separate method or module for creating and returning the $dbh, so that we don't create a lot of db connections unnecessarily.&lt;/p&gt;

&lt;p&gt;The part we can't do much about is the SQL in the code. We can move it around, put it in libraries, but it's still there, somewhere. &lt;/p&gt;

&lt;p&gt;Why would you not want SQL in your Perl code? For a start, it's just a string to pass to the database interpreter, there is no syntax checking at the Perl compilation level. Thus it fails late, not early. Your editor will also not syntax check what it just sees as strings of text.&lt;/p&gt;

&lt;p&gt;Modern Perl should also leverage OO where it can. DBI is a low level library that gets things right, but returns plain hashes and arrays, not objects.&lt;/p&gt;

&lt;p&gt;Perl ORMs still use DBI underneath, extending it to catch coding errors early (names of columns, SQL clauses), and to return the results as objects containing the database values, which work just like any other Perl object.&lt;/p&gt;

&lt;p&gt;&lt;a href="mailto:castaway@desert-island.me.uk"&gt;Comments&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;@public,perl,dbix-class&lt;/p&gt;
</content:encoded>
      <dcterms:modified>0</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/dbix-class-for-sql-hackers-1.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>diary  public  perl  lpw2009</category>
      <link>http://desert-island.me.uk/~castaway/blog/london_perl_workshop_2009.html</link>
      <description>London Perl Workshop 2009
=========================

Several days later, what do I remember from LPW 2009?

Piers' talk on New beginnings. Interestingly, it's mostly the structure
of the talk that I remember, not the content. Only a few days before,
Simon Cozens had pointed out a post of Yuval's, and specifically praised
it as a post with good structure: Show where there is a problem, solve
that problem with a particular coding technique (or technology), dont
waffle too much. Simon was so impressed he posted a meta-post on the
subject.

Pier's talk was about why he left Perl for Ruby, and why he came back
again. Perl has some "boilerplate" code that one typically needs when
writing all methods. Instead of declaring the methods incoming arguments,
one has to explicitly pull them off of the argument array, @_. Piers
returned because the Perl community has been solving this and similar
annoyances. In this case with Devel::Declare. And it's not even a "source
filter"!

Problem; Solution; Done.

Another talk I still remember is Andy Wardley's on Template Toolkit 3.
It's been many years in the making, much like Perl 6^WRakudo. It's
looking pretty good however, and much evolved. I made myself some TODO
notes as he was talking. Andy's talk style was the opposite of Piers', so
I will have to ask him later; What problems does TT3 solve (better, more
elegantly) that TT2 doesn't? Why would I use it over TT2? He also zhas
some ambitious ideas to add a C library so that it can be used from other
programming languages. This is another good way to spread good things
that come from Perl.

That's it, most of the rest is a blur. Hallway chats, hot drinks, food,
books. O'Reilly were there with a table as usual, with 35% off usual
prices, so I bought "Beautiful Teams" to add to my collection of projecty
books.

It was good to see friends again, to actually talk to people outside the
confines of IRC. I came away somewhat more motivated to join in non-work
projects than of late.

So much so that I've picked up on the EPO grants again. Having been voted
on, decided, had money assigned and then listed.. They've been sitting
there idle, waiting for someone to speak up and offer to complete them.
Maybe its a lesson in time management, these things don't run themselves,
mebbe volunteers need to be able to dedicate X amount of hours per
day/week to help. Oops, minor side-rant, I'll go and write that proposal
now, and assign myself time to work on it!

@diary, public, perl, lpw2009</description>
      <dc:date>0</dc:date>
      <dc:subject>diary  public  perl  lpw2009</dc:subject>
      <title>Under the palm tree (london_perl_workshop_2009.html)</title>
      <pubDate>Fri, 11 Dec 2009 09:17:04 -0000</pubDate>
      <content:encoded>&lt;h1&gt;London Perl Workshop 2009&lt;/h1&gt;

&lt;p&gt;Several days later, what do I remember from LPW 2009? &lt;/p&gt;

&lt;p&gt;Piers' talk on New beginnings. Interestingly, it's mostly the
structure of the talk that I remember, not the content. Only a few
days before, Simon Cozens had pointed out a &lt;a href="http://blog.woobling.org/2009/12/simplifying-begin-with-moose-roles.html"&gt;post of Yuval's&lt;/a&gt;, and
specifically praised it as a post with good structure: Show where
there is a problem, solve that problem with a particular coding
technique (or technology), dont waffle too much. Simon was so
impressed he posted a &lt;a href="http://www.simon-cozens.org/content/advocacy-and-evangelism"&gt;meta-post on the subject&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Pier's talk was about why he left Perl for Ruby, and why he came back
again. Perl has some "boilerplate" code that one typically needs when
writing all methods. Instead of declaring the methods incoming
arguments, one has to explicitly pull them off of the argument array,
@_. Piers returned because the Perl community has been solving this
and similar annoyances. In this case with &lt;a href="http://seach.cpan.org/dist/Devel-Declare"&gt;Devel::Declare&lt;/a&gt;. And it's not
even a "source filter"!&lt;/p&gt;

&lt;p&gt;Problem; Solution; Done.&lt;/p&gt;

&lt;p&gt;Another talk I still remember is Andy Wardley's on &lt;a href="http://tt3.template-toolkit.org"&gt;Template Toolkit
3&lt;/a&gt;. It's been many years in the
making, much like Perl 6^WRakudo. It's looking pretty good however,
and much evolved. I made myself some TODO notes as he was
talking. Andy's talk style was the opposite of Piers', so I will have
to ask him later; What problems does TT3 solve (better, more
elegantly) that TT2 doesn't? Why would I use it over TT2? He also zhas
some ambitious ideas to add a C library so that it can be used from
other programming languages. This is another good way to spread good
things that come from Perl.&lt;/p&gt;

&lt;p&gt;That's it, most of the rest is a blur. Hallway chats, hot drinks,
food, books. O'Reilly were there with a table as usual, with 35% off
usual prices, so I bought "Beautiful Teams" to add to my collection of
projecty books.&lt;/p&gt;

&lt;p&gt;It was good to see friends again, to actually talk to people outside
the confines of IRC. I came away somewhat more motivated to join in
non-work projects than of late.&lt;/p&gt;

&lt;p&gt;So much so that I've picked up on the &lt;a href="http://enlightenedperl.org/grants/grants001.html"&gt;EPO grants&lt;/a&gt; again. Having been
voted on, decided, had money assigned and then listed.. They've been
sitting there idle, waiting for someone to speak up and offer to
complete them. Maybe its a lesson in time management, these things
don't run themselves, mebbe volunteers need to be able to dedicate X
amount of hours per day/week to help. Oops, minor side-rant, I'll go
and write that proposal now, and assign myself time to work on it!&lt;/p&gt;

&lt;p&gt;@diary, public, perl, lpw2009&lt;/p&gt;
</content:encoded>
      <dcterms:modified>0</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/london_perl_workshop_2009.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public perl ironman</category>
      <link>http://desert-island.me.uk/~castaway/blog/ironman-update.html</link>
      <description>IronMan Update
==============

No really, not just because I've not posted anything in.. a while. I got
bored reading mst's mbox of ironman stuff, converting blog urls into
atom/rss feeds, and typing the results into Plaggers yaml configuration
file.

So I replaced all those manual entries with:

- module: Subscription::DBI
  config:
    schema_class: 'IronMan::Schema'
    connect_info: ['dbi:SQLite:/home/castaway/plagger/subscriptions.db']

And wrote one of these to convert the existing junk:

 #!/usr/bin/perl

 use strict;
 use warnings;
 use YAML 'LoadFile';
 use Data::Dumper;
 use Data::UUID;
 use IronMan::Schema;

 my $yamlfile = shift;
 my $dsn = shift;
 my $yaml_dump = LoadFile($yamlfile);

 my $schema = IronMan::Schema-&gt;connect($dsn);

 my ($sub_conf) = grep { $_-&gt;{module} eq 'Subscription::Config' } 
  @{ $yaml_dump-&gt;{plugins} };
 print Dumper($sub_conf);
 my $feeds = $sub_conf-&gt;{config}{feed};

 my $uuid = Data::UUID-&gt;new();
 foreach my $feed (@$feeds) {
     print "Feed: $feed-&gt;{url}\n";
     my $fdb = $schema-&gt;resultset('Feed')-&gt;find_or_new({ id =&gt; $uuid-&gt;create_str, %$feed}, { key =&gt; 'url' });
     if($fdb-&gt;in_storage) { 
         print "... already exists\n";
         next;
     }
     $fdb-&gt;insert;
 }

The twiddly part was setting up an app (form) for people to sign up,
which now exists in the ironman repo, and runs on my local box, at the
moment.

Thoughts of things to add:

  * Make the config for the app and the one for plagger use the same info
    for the database dsn?

  * Confirm signup by sending an email including a link back to the app
    using the guid of the signup.

  * Allow users to edit/remove their feeds using the guid/email key.

  * ??

  * Profit

Someone also needs to make the thing prettier!

Btw to install, symlink the css and image dirs from
"plagger/assets/plugins/Publish-PagedPlanet/default/static" to the
catalyst "root" dir.

@public,perl,ironman</description>
      <dc:date>2009-07-30T23:32:11+01:00</dc:date>
      <dc:subject>public perl ironman</dc:subject>
      <title>Under the palm tree (ironman-update.html)</title>
      <pubDate>Thu, 30 Jul 2009 23:32:11 +0100</pubDate>
      <content:encoded>&lt;h1&gt;IronMan Update&lt;/h1&gt;

&lt;p&gt;No really, not just because I've not posted anything in.. a while. I
got bored reading mst's mbox of ironman stuff, converting blog urls
into atom/rss feeds, and typing the results into Plaggers yaml
configuration file.&lt;/p&gt;

&lt;p&gt;So I replaced all those manual entries with:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;- module: Subscription::DBI
  config:
    schema_class: 'IronMan::Schema'
    connect_info: ['dbi:SQLite:/home/castaway/plagger/subscriptions.db']
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And wrote one of these to convert the existing junk:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; #!/usr/bin/perl

 use strict;
 use warnings;
 use YAML 'LoadFile';
 use Data::Dumper;
 use Data::UUID;
 use IronMan::Schema;

 my $yamlfile = shift;
 my $dsn = shift;
 my $yaml_dump = LoadFile($yamlfile);

 my $schema = IronMan::Schema-&amp;gt;connect($dsn);

 my ($sub_conf) = grep { $_-&amp;gt;{module} eq 'Subscription::Config' } 
  @{ $yaml_dump-&amp;gt;{plugins} };
 print Dumper($sub_conf);
 my $feeds = $sub_conf-&amp;gt;{config}{feed};

 my $uuid = Data::UUID-&amp;gt;new();
 foreach my $feed (@$feeds) {
     print "Feed: $feed-&amp;gt;{url}\n";
     my $fdb = $schema-&amp;gt;resultset('Feed')-&amp;gt;find_or_new({ id =&amp;gt; $uuid-&amp;gt;create_str, %$feed}, { key =&amp;gt; 'url' });
     if($fdb-&amp;gt;in_storage) { 
         print "... already exists\n";
         next;
     }
     $fdb-&amp;gt;insert;
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The twiddly part was setting up an app (form) for people to sign up,
which now exists in the &lt;a href="http://dev.catalyst.perl.org/repos/bast/ironman/IronMan-Web"&gt;ironman repo&lt;/a&gt;, and runs on my local box, at the moment.&lt;/p&gt;

&lt;p&gt;Thoughts of things to add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make the config for the app and the one for plagger use the same info for the database dsn?&lt;/li&gt;
&lt;li&gt;Confirm signup by sending an email including a link back to the app using the guid of the signup.&lt;/li&gt;
&lt;li&gt;Allow users to edit/remove their feeds using the guid/email key.&lt;/li&gt;
&lt;li&gt;??&lt;/li&gt;
&lt;li&gt;Profit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Someone also needs to make the thing prettier!&lt;/p&gt;

&lt;p&gt;Btw to install, symlink the css and image dirs from
"plagger/assets/plugins/Publish-PagedPlanet/default/static" to the
catalyst "root" dir.&lt;/p&gt;

&lt;p&gt;@public,perl,ironman&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2009-07-30T23:32:11+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/ironman-update.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public perl crypt-rsa xml-atom-simplefeed</category>
      <link>http://desert-island.me.uk/~castaway/blog/making-a-difference.html</link>
      <description>Making a difference
===================

I failed in the end, to Reproduce my URI problem, but that hasn't
deterred me from helping to improve random parts of CPAN in general.

Recently I've been struggling with Crypt::RSA. It's API is not all that
complicated, however a small typo caused me quite a bit of grief. A typo
in my own code, misspelling one of the argument names for the verify
function.

I had this:

$rsa-&gt;verify(
  Messsage =&gt; $mess,
  Key =&gt; $key,
  Signature =&gt; $signature
);

Spot the problem? It took me ages, and some perl -d debugging, to
realiase that Crypt::RSA happily attempts to verify an empty (undef)
message. It didn't use warnings, or check it's arguments, so my extra "s"
in message wasn't noticed.

I reported the problem to the author, using CPAN's RT installation, which
is available to all modules, as Bug #46577.

The author responded rapidly, understood my problem, improved his code,
and uploaded a new release to CPAN. You can see the fixes using the CPAN
diff tool: Diff from Crypt-RSA-1.98 to Crypt-RSA-1.99. Yay!

The second (actually chronologically first) fix was related to my mumble
about XML::Atom::SimpleFeed, on a previous blog entry. Aristotle got in
touch with me to say "That shouldn't happen, is all sane" .. But
eventually James proved him wrong with a patch including a test case, and
a new release of that appeared too.

@public,perl,crypt-rsa,xml-atom-simplefeed</description>
      <dc:date>2009-06-10T06:56:33+01:00</dc:date>
      <dc:subject>public perl crypt-rsa xml-atom-simplefeed</dc:subject>
      <title>Under the palm tree (making-a-difference.html)</title>
      <pubDate>Wed, 10 Jun 2009 06:56:33 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Making a difference&lt;/h1&gt;

&lt;p&gt;I failed in the end, to &lt;a href="/~castaway/blog/reproducing-the-bug.html"&gt;Reproduce my URI
problem&lt;/a&gt;, but that hasn't
deterred me from helping to improve random parts of
&lt;a href="http://search.cpan.org"&gt;CPAN&lt;/a&gt; in general.&lt;/p&gt;

&lt;p&gt;Recently I've been struggling with
&lt;a href="http://search.cpan.org/dist/Crypt-RSA"&gt;Crypt::RSA&lt;/a&gt;. It's API is not
all that complicated, however a small typo caused me quite a bit of
grief. A typo in my own code, misspelling one of the argument names
for the &lt;em&gt;verify&lt;/em&gt; function.&lt;/p&gt;

&lt;p&gt;I had this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$rsa-&amp;gt;verify(
  Messsage =&amp;gt; $mess,
  Key =&amp;gt; $key,
  Signature =&amp;gt; $signature
);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Spot the problem? It took me ages, and some perl -d debugging, to
realiase that Crypt::RSA happily attempts to verify an empty (undef)
message. It didn't use warnings, or check it's arguments, so my extra
"s" in message wasn't noticed.&lt;/p&gt;

&lt;p&gt;I reported the problem to the author, using CPAN's
&lt;a href="http://bestpractical.com"&gt;RT&lt;/a&gt; installation, which is available to all
modules, as &lt;a href="http://rt.cpan.org/Public/Bug/Display.html?id=46577"&gt;Bug #46577&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The author responded rapidly, understood my problem, improved his
code, and uploaded a new release to CPAN. You can see the fixes using
the CPAN diff tool: &lt;a href="http://search.cpan.org/diff?from=Crypt-RSA-1.98&amp;amp;to=Crypt-RSA-1.99"&gt;Diff from Crypt-RSA-1.98 to
Crypt-RSA-1.99&lt;/a&gt;. Yay!&lt;/p&gt;

&lt;p&gt;The second (actually chronologically first) fix was related to my
mumble about XML::Atom::SimpleFeed, on a previous &lt;a href="/~castaway/blog/blog_update.html"&gt;blog
entry&lt;/a&gt;. Aristotle got in touch with
me to say "That shouldn't happen, is all sane" .. But eventually James
proved him wrong with a &lt;a href="http://search.cpan.org/diff?from=XML-Atom-SimpleFeed-0.82&amp;amp;to=XML-Atom-SimpleFeed-0.83"&gt;patch including a test case&lt;/a&gt;, and a new release of that appeared too.&lt;/p&gt;

&lt;p&gt;@public,perl,crypt-rsa,xml-atom-simplefeed&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2009-06-10T06:56:33+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/making-a-difference.html</guid>
    </item>
    <item>
      <author>nobody@example.com (Jess Robinson)</author>
      <dc:creator>nobody@example.com (Jess Robinson)</dc:creator>
      <category>public programming perl thinking</category>
      <link>http://desert-island.me.uk/~castaway/blog/are-we-going-to-need-it.html</link>
      <description>Are we going to need it?
========================

Odd flash of inspiration while washing up (yay for mindless activity) and
also listening to a TED talk.

I often grumble at Moose. Though not actually at Moose itself, just at
seemingly everyone and everything jumping on the bandwagon. I also want
to use Reaction, cos Matt wrote/writes it, and from the outside it feels
like a great idea.

But part of me doesn't think so. I think I know why now. Maybe I've been
reading too many articles on Agile and so on. Specifically the principles
of DoTheSimplestThingThatCouldPossiblyWork, and YouAintGonnaNeedIt.

Reaction is a complex piece of software, built on top of two other pieces
of complex software, Catalyst, and Moose. That's a whole stack of code.
As people jokingly say "It installs half of CPAN". Don't get me wrong,
software re-use is good and if I actually needed a piece of software that
does all the many things that these three do, I'd use them.

But I don't. Applications (and websites) don't often start complex, they
gather complexity over time.

For one or two web pages, maybe even ten, I can write them by hand. Ok so
I probably copy the header and footer after a few. When I come to write
the eleventh one, this becomes tedious. So instead I could use something
like Template Toolkit's ttree, to produce a bunch of pages out of some
templates. At some point I find myself needing something dynamic, or the
concept of users, then I may go fetch Catalyst.

And that's as far as I've got. Which step makes me need Reaction? The one
where 90% of my website is interactive? I've not written too many of
those, but the few I have, Catalyst has sufficed.

You're probably thinking now, that I just don't write the same kind of
applications/websites as others do. Thats possibly true.

But again, Agile ways of doing things suggest we write the minimal amount
of code we can get away with, to imlement the currently required
features. That we don't plan ahead and add more code for potential
features later, they will be re-thought anyway. That we release early,
and often, and gather feedback for improvement, and then add new
features.

Not forgetting to refactor. To upgrade, to replace the entire framework
if needed.


To be practical
---------------

I think, what I'm looking for is, a guide for newcomers to explain and
help ths progression. How to upgrade your site or code, from a few pages,
to some dynamic bits, to a full blown interactive site. Or even not, not
every site wants or needs to go that far. Not all code needs to be able
to use email.

There seem to exist many articles on how to write this complex code, but
not enough that explain how to come to the conclusion that you need it.

Maybe this is also why there are still many many more people writing
about how to do CGI scripts in Perl, than how to use Moose. The
transition is missing.

(With thanks to Elizabeth Gilbert on nurturing creativity)

Right, now I'm off to move the fledgling DBIx::Class website from some
hand written pages to ttree.

@public,programming,perl,thinking</description>
      <dc:date>2009-05-25T01:22:35+01:00</dc:date>
      <dc:subject>public programming perl thinking</dc:subject>
      <title>Under the palm tree (are-we-going-to-need-it.html)</title>
      <pubDate>Mon, 25 May 2009 01:22:35 +0100</pubDate>
      <content:encoded>&lt;h1&gt;Are we going to need it?&lt;/h1&gt;

&lt;p&gt;Odd flash of inspiration while washing up (yay for mindless activity)
and also listening to a TED talk.&lt;/p&gt;

&lt;p&gt;I often grumble at Moose. Though not actually at Moose itself, just at
seemingly everyone and everything jumping on the bandwagon. I also
want to use Reaction, cos Matt wrote/writes it, and from the outside
it feels like a great idea.&lt;/p&gt;

&lt;p&gt;But part of me doesn't think so. I think I know why now. Maybe I've
been reading too many articles on Agile and so on. Specifically the
principles of DoTheSimplestThingThatCouldPossiblyWork, and
YouAintGonnaNeedIt.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://code2.0beta.co.uk/reaction/svn"&gt;Reaction&lt;/a&gt; is a complex piece
of software, built on top of two other pieces of complex software,
&lt;a href="http://search.cpan.org/dist/Catayst-Runtime"&gt;Catalyst&lt;/a&gt;, and
&lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt;. That's a whole stack of
code. As people jokingly say "It installs half of CPAN". Don't get me
wrong, software re-use is good and if I actually needed a piece of
software that does all the many things that these three do, I'd use
them.&lt;/p&gt;

&lt;p&gt;But I don't. Applications (and websites) don't often start complex,
they gather complexity over time.&lt;/p&gt;

&lt;p&gt;For one or two web pages, maybe even ten, I can write them by hand. Ok
so I probably copy the header and footer after a few. When I come to
write the eleventh one, this becomes tedious. So instead I could use
something like Template Toolkit's ttree, to produce a bunch of pages
out of some templates. At some point I find myself needing something
dynamic, or the concept of users, then I may go fetch Catalyst.&lt;/p&gt;

&lt;p&gt;And that's as far as I've got. Which step makes me need Reaction? The
one where 90% of my website is interactive? I've not written too many
of those, but the few I have, Catalyst has sufficed.&lt;/p&gt;

&lt;p&gt;You're probably thinking now, that I just don't write the same kind of
applications/websites as others do. Thats possibly true.&lt;/p&gt;

&lt;p&gt;But again, Agile ways of doing things suggest we write the minimal
amount of code we can get away with, to imlement the currently
required features. That we don't plan ahead and add more code for
potential features later, they will be re-thought anyway. That we
release early, and often, and gather feedback for improvement, and
then add new features.&lt;/p&gt;

&lt;p&gt;Not forgetting to refactor. To upgrade, to replace the entire
framework if needed.&lt;/p&gt;

&lt;h2&gt;To be practical&lt;/h2&gt;

&lt;p&gt;I think, what I'm looking for is, a guide for newcomers to explain and
help ths progression. How to upgrade your site or code, from a few
pages, to some dynamic bits, to a full blown interactive site. Or even
not, not every site wants or needs to go that far. Not all code needs
to be able to use email.&lt;/p&gt;

&lt;p&gt;There seem to exist many articles on how to write this complex code,
but not enough that explain how to come to the conclusion that you
need it.&lt;/p&gt;

&lt;p&gt;Maybe this is also why there are still many many more people writing
about how to do CGI scripts in Perl, than how to use Moose. The
transition is missing.&lt;/p&gt;

&lt;p&gt;(With thanks to &lt;a href="http://www.ted.com/index.php/talks/elizabeth_gilbert_on_genius.html"&gt;Elizabeth Gilbert on nurturing creativity&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Right, now I'm off to move the fledgling DBIx::Class website from some
hand written pages to ttree.&lt;/p&gt;

&lt;p&gt;@public,programming,perl,thinking&lt;/p&gt;
</content:encoded>
      <dcterms:modified>2009-05-25T01:22:35+01:00</dcterms:modified>
      <guid isPermaLink="false">tag:insel,2006:http://desert-island.me.uk:8888/~castaway/blog/are-we-going-to-need-it.html</guid>
    </item>
  </channel>
</rss>

