February 21st, 2005

diesel, learning, evil, sweeti

Local install tool

Apparently I'm the author or co-author of several of the most dependency heavy modules on CPAN. And you know what? I'm fine with that. Some people moan about tests failing but I say that's a good thing - I want to see that the tests fail at install time than just assume they work and then not be able to work out why the app isn't working after I've installed bu unzipping it in a directory.

Either way - sometimes I write stuff that hasn't been released on CPAN yet but has a butt load of dependencies. And this is a pain in the neck because even if I do a make dist then neither cpan or cpanp can do

    install file://My-New-Module-0.1.tar.gz

and automatically follow all the dependencies.

So, I'm pondering using Module::Depends, Module::CoreList, Archive::Extract and CPANPLUS together to just having something that will do

    % cpan-local My-New-Module-0.1.tar.gz

and it will Just Work.

Or, on second thoughts, I could just PAR everything up to satisfy the people in the first paragraph.

diesel, learning, evil, sweeti

HTML and scrolling frames

As part of something at work that has previously required doing horrific hacks to present IR Receivers as keyboards and arsing around writing kernel drivers to get VIA Unichrome CLE266 chips to do hardware MPEG decoding (I'm so 733t) and now I'm ... fixing HTML and PHP. sigh. And now I've hit a problem - when someone hits the down button on a long list of item it shoudl smoothly scroll but, despite having a


and various other supplementary and increasingly desperate hacks. I know lots of peiople think that HTML is some fantastic tool for doing interfaces to applications but god it's horrible. It's a fricking markup language. Bugger off and use SVG or something equally vile. I suppsoe that's what Avalon is for.

diesel, learning, evil, sweeti

svn commit hooks and tabs

I use nano which, without unsupported patches, can't auto convert tabs to spaces. Which sucks. So Mr Clamp has a an svn-commit hook that matches incoming diffs against


and rejects the commit if it gets a hit. Which is lovely but when you commit 20 or so files it's a pain no knowing which one failed. Which means using one of the diff modules on CPAN I suppose.

diesel, learning, evil, sweeti


For ages I've wanted a plugin for Siesta that, given the public keys of subscribers and a public-key/private-key pair for a list will reject any non-signed, non-encrypted mail posted and then sign and encrypt each mail sent out to list members.

I even sat down and tried to do it a couple of times.

Then Simon Cozen's mentioned that it'd be really useful for missionaries and so the might Mr Clamp gave it a go

And then he gave up because as the comment says

    # XXX ALL GPG/Mail modules SUCK!

The biggest problem being that they have no way of you saying

    my $object     = GPG::Object->new($mail->body);
    my $plain_text = $object->decrypt($private_key);
    my $is_signed  = $object->is_signed($someones_public_key);
    my $other      = GPG::Object->new($plain_text);
    my $encrypted  = $other->encrypt($someones_public_key);

and instead rely on getting a key out of a store via a key-id which, I suppose, is a throw back to the fact that they're most wrappers round gpg.

I sense Yak Shaving in the future.

diesel, learning, evil, sweeti


Which sort of leads me onto the next thing. Ages ago Paul Mison and Leon Brocard hacked together Scribot.com which did weird things with SOAP (I think Leon was going through a web services phase then) and some sort of hybride dynamic and updated-via-cron-job website.

It's awful, which is weird because they're both good programmers but damn this is ugly, brittle, hacky code. So I thought about redoing it rather than trying to fix whatever odd interaction was going on with SQLite (before I figured it out whilst writing the note above).

diesel, learning, evil, sweeti


SQLite version <=0.31 is libsqlite v2 as is SQLite2 but SQLite > 0.31 is libsqlite v3.

Still with me?

Me neither.

Actually I get it and I even sort of get the reasons for doing it but it still makes me feel icky. The bad thing is that whilst SQLite2 is supposed to be fully backwards I was getting errors about "can't find object method" and ...

Oh, blinding flash of insight.

... The problem ended up being in Class::DBI::BaseDSN which does a check for dbi:([^:]+): and then uses $1 to initialise the Class::DBI driver. Except there was no Class::DBI::SQLite2.

The solution I used was to copy Class::DBI::SQLite over as Class/DBI/SQlite2.pm and insert 2s judiciously. This may not be the best way although the other quick solution was to do

    $driver = 'SQLite' if $driver eq 'SQLite2'; 

or the moral equivalent which just seems hacky.

diesel, learning, evil, sweeti

More work on Buscador

Since the last update Buscador has had its utf-8 From: names fixed, gained the ability to undesrtand month names and short years, added Mail::Thread::Arc style threads, begun to grok html mails and attachments better, become much more XHTML compliant (thanks to Brain 'LTJake' Cassidy), will now give a list of all entities on the system and generally become a bit more (in)sane due to exposure to The Real World.

diesel, learning, evil, sweeti

Postgres and Email::Store

Apparently Email::Store doesn't work under Postgres - there are various issues, some trivial some serious. The most pressing, I think, is that Postgres doesn't cope with the CREATE TABLE UNLESS EXIST syntax which, I suppose isn't the most difficult thing to catch in the world - either check in advance or catch the exception. Possibly even have a force flag that does a DROP first.