jerakeen.org

by Tom Insam

notes☴

code☷

links☲

photos☵

The Small Stuff

created 11 June 2009 in talks tagged hate, javascript, perl, programming, python and ruby and is geotagged

A talk I gave at the BCS Evening of Dynamic Languages event, on some of the small, trivial, and therefore really annoying differences between the four programming languages I spend the most time using.

Upcoming

I will be attending London Perl Mongers Social Meeting on Thursday November 06

created 18 October 2008 in stream tagged london and perl and is geotagged

I will be attending London Perl Mongers Social Meeting on Thursday November 06

http://upcoming.yahoo.com/event/1182401/

I will be attending London Perl Mongers Social Meeting on Thursday October 02

I will be attending London Perl Mongers Social Meeting on Thursday October 02

created 02 October 2008 in stream tagged london and perl and is geotagged

I will be attending London Perl Mongers Social Meeting on Thursday October 02

http://upcoming.yahoo.com/event/1139807/

decrypt-emp.pl

decrypt-emp.pl

created 30 April 2008 in links tagged emp, emusic and perl.

Perl parser for the eMusic .emp file format, which I had hoped that they didn’t use any more. Alas, this turns out not to be the case.

http://wannabehacker.com/src/decrypt-emp.pl

The Corrosion of Aaron Stone » Blog Archive » Perl in Apache with mod_perlite

The Corrosion of Aaron Stone  » Blog Archive   » Perl in Apache with mod_perlite

created 07 November 2007 in links tagged apache, mod_perl and perl.

Another attempt at replacing mod_perl

http://hydricacid.com/general/perl-in-apache-with-mod_per...

Piers Harding / DJabberd-Delivery-OfflineStorage-0.02 - search.cpan.org

Piers Harding / DJabberd-Delivery-OfflineStorage-0.02 - search.cpan.org

created 08 October 2007 in links tagged cpan, djabberd, jabber and perl.

DJabberD offline message storage.

http://search.cpan.org/~piers/DJabberd-Delivery-OfflineSt...

Meteor

Meteor

created 21 June 2007 in links tagged http, perl, server and streaming.

shiny shiny perl web server for long-running data connections. I vaguely remember something at hack day using this. Real-time wireless stats, I think.

http://meteorserver.org/

Examples at Clicker

Examples at Clicker

created 23 October 2006 in links tagged chart and perl.

oooh, a pretty perl charting library

http://www.onemogin.com/clicker/examples

Perl for windows ce / pocketpc

Perl for windows ce / pocketpc

created 10 October 2006 in links tagged perl and pocketpc.

bwhaahaha. ahhahahah. haaha. ah.

http://perlce.sourceforge.net/

CamelBones, an Objective-C/Perl bridge for Mac OS X & GNUStep - Release Notes - 1.0.0

CamelBones, an Objective-C/Perl bridge for Mac OS X & GNUStep - Release Notes - 1.0.0

created 11 July 2006 in links tagged cocoa, mac, perl and programming.

Camelbones 1.0. Congratulations to Sherm

http://camelbones.sourceforge.net/documentation/history/d...

Bot::BasicBot 0.7

created 11 June 2006 in blog tagged irc, perl and release.

  • Updates for new PoDo::IRC
  • No longer do 2 server connects on startup
  • the connect test doesn’t break itself by faking a connection first

Use lighttpd instead of mogstored

Use lighttpd instead of mogstored

created 05 June 2006 in links tagged perl and webdav.

How to use lighttpd as a mogstored instead of perlbal. Cunning

http://lists.danga.com/pipermail/mogilefs/2006-June/00032...

The CPAN Search Site - search.cpan.org

The CPAN Search Site - search.cpan.org

created 18 May 2006 in links tagged json, perl and rpc.

The perl implementation of JSON-RPC. Ships with JSON.pm, which is nice.

http://search.cpan.org/~makamaka/JSON-1.05/lib/JSONRPC.pm

Writing IRC bots with Bot::BasicBot

Writing IRC bots with Bot::BasicBot

created 14 May 2006 in talks tagged irc and perl.

A talk

encoding::warnings - Warn on implicit encoding conversions - search.cpan.org

encoding::warnings - Warn on implicit encoding conversions - search.cpan.org

created 22 April 2006 in links tagged perl and unicode.

Looks like it solves my favourite all-time problem in perl - no clear distinction between characters and byte sequences. Horay.

http://search.cpan.org/dist/encoding-warnings/lib/encodin...

Perl DateTime objects, time zones, and ISO8601

created 13 April 2006 in blog tagged date, perl and time.

Here’s what I want to do. DateTime objects conveniently stringify to their ISO8601 date representation. But last week the clocks changed, and all my code broke, because this representation doesn’t include the time zone. I want a DateTime object that will stringify to an ISO8601 date including a timezone. Shouldn’t be too hard.

Combust -

Combust -

created 28 February 2006 in links tagged cms, combust and perl.

http://combust.develooper.com/

Template::TAL

created 03 November 2005 in blog tagged perl and template.

Yay, I’ve released Yet Another Templating Language. This one is a perl implementation of TAL, which is a nice XML-based templating language I’ve been playing with recently. There are other (sort of) implementations, but I consider Template::TAL (a) closer to the spec, and (b) more abstracted - I can load templates from anywhere, not just disk. It’s weaker in other respects, of course, but that’s life..

The London Perl Workshop 2005

The London Perl Workshop 2005

created 28 October 2005 in links tagged conference, london, lwp, perl, programming and workshop.

Yay. I liked last year’s

http://london.pm.org/pipermail/london.pm/Week-of-Mon-2005...

debian.pkgs.cpan.org — debified CPAN packages

debian.pkgs.cpan.org -- debified CPAN packages

created 23 October 2005 in links tagged debian, packages and perl.

debian repository of CPAN modules. Very, very cool

http://debian.pkgs.cpan.org/

PerlWarRules - PerlWar - Trac

PerlWarRules - PerlWar - Trac

created 18 October 2005 in links tagged corewar, game and perl.

looks.. so.. fun..

http://babyl.dyndns.org/perlwar/wiki/PerlWarRules

Perl Loves UTF-8

created 16 October 2005 in talks tagged perl and unicode.

Given for the first time at the london.pm tech-meet at the Fotango offices on 2005/02/24, this was a 5-minute rant about perl, character sets, and why noone can ever get them right. The slides were written in OmniGraffle for some bizarre reason, but I think it worked quite well, and may use the technique again some time.

Open bugs in JavaScript

Open bugs in JavaScript

created 09 October 2005 in links tagged javascript and perl.

http://rt.cpan.org/NoAuth/Bugs.html?Dist=JavaScript

AnnoCPAN - Petal

AnnoCPAN - Petal

created 05 October 2005 in links tagged perl, petal, template and xml.

http://annocpan.org/~BPOSTLE/Petal-2.16/lib/Petal.pm

search.cpan.org: Fotango Ltd / Froody-42

search.cpan.org: Fotango Ltd / Froody-42

created 04 October 2005 in links tagged fotango, perl and xmlrpc.

http://search.cpan.org/~fotango/Froody-42/

RDFDB

RDFDB

created 04 October 2005 in links tagged database, perl and rdf.

http://www.guha.com/rdfdb/

Text::Textile

created 23 September 2005 in blog tagged perl and text.

Props to Brad Choate, who has released Text::Textile 2.03, freeing me from the burden of maintaining it myself. Yay.

search.cpan.org: Perl::Review - Engine to critique Perl souce code

search.cpan.org: Perl::Review - Engine to critique Perl souce code

created 22 September 2005 in links tagged perl, pierre, programming and review.

http://search.cpan.org/~thaljef/Perl-Review-0.04/lib/Perl...

search.cpan.org: Locale::Maketext::TPJ13 — article about software localization

search.cpan.org: Locale::Maketext::TPJ13 -- article about software localization

created 06 September 2005 in links tagged locale, localization, perl, strings and translation.

http://search.cpan.org/~sburke/Locale-Maketext-1.09/lib/L...

AnnoCPAN - DBD::Multiplex

AnnoCPAN - DBD::Multiplex

created 31 August 2005 in links tagged dbi and perl.

http://annocpan.org/~TKISHEL/DBD-Multiplex-1.97/Multiplex.pm

AnnoCPAN - MIME::Types

AnnoCPAN - MIME::Types

created 31 August 2005 in links tagged mime and perl.

http://annocpan.org/~MARKOV/MIME-Types-1.15/lib/MIME/Type...

MogileFS

MogileFS

created 25 July 2005 in links tagged filesystem and perl.

http://www.danga.com/mogilefs/

YAPC::NA 2005

We arrive My first toronto skyline Welcome YAPC::NA The Loose Møøse the CN Tower scary arty things the gang, hundreds of meters above the ground Toronto from the CN tower It's a long way down.. Solar Power at the CN Tower shadow of the CN tower people down there are small View down from the SkyPod A very small train station The Glass Floor an emergency exit trams are random Ade and Stig, tourists Canadian buildings! the YAPC welcome dinner exciting discussion at dinner the welcome restaurant watch for elderly pedestrians - 5 points! keep left the brewery off we go a flock of segways stig, on a segway mark, speeding brewery sign brewery art continental breakfast continental coffee airport express looking for the boat still looking for the boat has anyone seen the boat? the boat arrives positively no passengers relaxing on the boat Toronto from the sea Canada Malting A good sunset Still a good sunset Toronto at night The auction PoundPerl group photo Yahoo! talk panorama Panorama from the SkyPod vertical to horizon from skypod

created 11 July 2005 in sets tagged auction, dorknation, perl, toronto and yapc.

YAPC::NA 2005 was held in Toronto. And I went. And took photos.

Photos from this flickr set.

Bot::BasicBot::Pluggable 0.50

created 19 March 2005 in blog tagged irc and perl.

finally, I have a Bot::BasicBot::Pluggable release out. muttley’s been bugging me for weeks, and the last release was in June 2003, which is ridiculous. When you just use things straight from the svn repository, you forget how long it is since you’ve done a release.

There’s a Bot::BasicBot 0.60 release to go along with it, with better character set support, no massive improvements, though. I should push that guy to 1.0 soon…

photo gallery

created 06 January 2005 in blog tagged perl, photos and php.

All I want, and I don’t feel that this is a lot, is to be able to put photos on my web page from iPhoto. Because writing iPhoto plugins is a pain, this requires me to use either Flickr, which I don’t want to (because I’d like to control my own photos, please, and not pay money for it), or php gallery, which has it’s own issues for me, mostly that it’s written in php.

As a perl (most of the time) programmer, I resent the fact that my web page is increasingly powered by php, but alas that’s where all these little toys come from nowadays. I’ve dabbled in php myself a little now, and it seems like a bearable language, although not one I’d actually want to write serious code in. Of course, with my colo going through.. pain recently, it’s tempting to restrict myself to a very simple subset of things, specifically, a subset of the stuff that the main box admin uses, because I know that it works and I don’t have to think about it. No more compiling weird perl/C modules on solaris as root with bizarre things tacked onto the end of my library path for me. The other colo has debian on it, which I like, but only 64 megs of memory, which I don’t. Hardware (even virtual hardware) sucks.

Of course, having got a gallery, I want to do things like have ‘5 most recent’ pictures on the front page of the site, and this is where things fall down a little. Noone else seems to want to do this stuff - I may end up subscribing to my own RSS feed, syndicating from one bit of my site to another, which seems disgustingly wasteful.

unit tests

created 04 January 2005 in blog tagged perl and tests.

Tests are a blessing and a curse. They are the developer’s friend - I can barely write code nowadays without a test suite. How else will I know when I’ve broken something? I’m very lazy - I can’t be bothered to manually run through every feature, or even to start up the web server (or whatever) in most cases. Edit, save, run tests, edit again, is my preferred cycle, and for this, the tests must be as comprehensive as possible - not only testing the features, but testing the things that shouldn’t work, and testing every nasty, hard-to-track-down bug you’ve ever found - there’s nothing worse than spending hours tracking down the same bug that you fixed last month.

But for deployment, tests are just annoying. Take CPAN modules, for instance. Most of the time, yay, tests pass, install the module. But as with all things, all the interesting things happen when things break, and the tests don’t pass. In my experience, if there are any failures at all, either all the tests fail, because there’s a dependancy that failed to build and you can’t even ‘use’ the module, or one or two out of 45,000 tests failed, because there’s a tiiiny little broken case on whatever bizarre architecture I’m using this week, and I’m just going to force install it anyway. This would seem to be served better by a much simpler ‘does the thing superficially work?’ test suite used for deployment, separate from the development test suite.

Writing recursive closures

created 15 December 2004 in blog tagged perl.

I discovered the other day that you can do quite horrifying things with perl. A closure in perl is a nice concept - it’s a block that can reference things in the scope that it’s declared in, but that can be passed around and used in quite different scopes. For instance, suppose I wanted a function that, say, converted a string to utf8 bytes (yes, I’m obsessed with utf8). I can do this like this:

my $closure;
$closure = sub {
  my $val = shift;
  return Encode::encode("utf8", $val);
};

And call it later as:

print $closure->("héllo");

This is dead nifty. But because a closure can reference things in it’s scope, and $closure is in it’s scope, it can call itself, or at least, it can call the function pointed at by $closure. So we can make this function recursive:

$closure = sub {
  my $val = shift;
  if (ref $val eq "ARRAY") {
    return [ map { $closure->($_) } @$val ];
  } elsif (ref $val eq "HASH") {
    return { map { $_ => $closure->($_) } keys(%$val) };
  } else {
    return Encode::encode("utf8", $val);
  }
};

Until the assignment is complete, the inside of the closure won’t work, because $closure is undefined. But by the time we call it later..

return $closure->( [ "héllo", { foo =>"bår" } ] );

..everything works.

Crazy, I tell you.

UTF8 Openguides

created 13 December 2004 in blog tagged perl, unicode, utf8 and wiki.

I foolishly offered to make OpenGuides UTF-8 safe. Because I don’t do that enough at work, or something. Anyway, it’s going quite well - because I did all the grunt work in CGI::Wiki a while ago, it’s just a matter of finding all the inputs and outputs and making sure they’re encoded properly. So far, the page contents and names are utf-8 safe, along with the cookie preferences, so your username is good. The search stuff looks scary, and there are various broken plugins, etc, etc, so there’s still stuff to do. I should also do the hooks properly - CGI::Wiki should offer nice functions for this stuff.

Anyway, there’s a demo site here in case you feel like trying to break it. The patch against OG is here, out of my svn repository, of course.

London Perl Workshop talk

created 11 December 2004 in blog tagged cocoa and perl.

I gave a talk today at the London Perl Workshop, brilliantly organised by a shadowy cabal of mysterious figures. Every talk I saw was great, to the point that the inevitable clashes with other talks that I wanted to see were really annoying, but fortunately everything was filmed, so presumably there’ll be video of the talks I missed available at some point. Likewise, all the slides will be around at some point, but until then, my slides are here. Powerpoint, I’m afraid, it’s what the work laptop has, and 1.5 megs, because it’s full of pictures…

Class::Persist 0.30

created 10 December 2004 in blog tagged perl and release.

I’ve done something I’ve wanted to do for ages - get another release of Class::Persist out. This one I consider massively improved over the last one - it’s dropped some of the nastier dependancies, doesn’t require it’s own magic database tables to be created, can properly put objects into more than one database, and, my personal favourite new feature, all objects are maintained properly as ‘singletons’ - you can only have one copy of any given object around at any one time.

The release should be here: Class::Persist 0.30.

Bot::BasicBot 0.5

created 01 December 2004 in blog tagged irc, perl and release.

Bot::BasicBot 0.50 is released. The big thing in this one is nick tracking - the bot will keep track of what nicks are in a given channel, and if they’re opped or not - this is mostly so I can re-write slavorg on top of Bot::BasicBot, and bin slavorg2…

toybox

created 16 August 2004 in blog tagged cocoa, macos, perl and release.

Look, ma, a web browser.

Honestly, I don’t know why I bother blogging. All I say is ‘look, I wrote this shiny toy’. Bah.

Release Frenzy!

created 16 August 2004 in blog tagged irc, perl, release and wiki.

Had a bit of a release thing over the weekend, new versions of Bot::BasicBot, URI::Title, AudioFile::Identify::MusicBrainz were released, and I’ve also given the world URI::Find::Simple. Now I need a release of Bot::BasicBot::Pluggable to sync it up with Bot::BasicBot, and I have some german translations to integrate into CGI::Wiki::Kwiki. Insane, I tell you.

AudioFile::Identify::MusicBrainz

created 13 August 2004 in blog tagged mp3, perl and release.

After much muttering back and forth between blech and I, I have written and released AudioFile::Identify::MusicBrainz. The old MusicBrainz client relied on the C library they distribute, which was silly for something that sent and recieved pure RDF, so a pure-perl implementation was just begging to be written.

So, upsides, it works, there’s exactly one sort of query you can send it, but that’s fine, it’s the important one - you can say ‘I know this about a track, tell me more’. The next step is to give the user a nice choice, and then let them write the updated information back into the ID3 tag.

Downsides, I’m not using ‘real’ RDF parsers, I’m using XML::DOM. This worries me, frankly, I’d much rather do the right thing, but I get a headache trying to make the perl RDF stuff work. There’s an RDF::Simple out there now, though, so maybe I’ll try that…

I’m going to get a reputation here for stupidly long module names, you know.

broken tick

created 13 August 2004 in blog tagged irc and perl.

I’m releasing another Bot::BasicBot at the moment, to change the semantics of the tick() method. Instead of getting called every 5 seconds, you now need to return a value from the tick() method, and you will be called again in that many seconds. this is waaay more useful than before, but of course it’ll break anything that uses it. Oops. But 0.2 has only been out a short time, so I should get away with it.

More of a problem is what to do with Bot::BasicBot::Pluggable, because I now can’t just pass the tick method straight through. I have a new version in CVS that I’m very happy with, needs more tests, though, but the feature still stopping release is per-module tick events. I want every module to be able to have independant tick events, instead of sharing one global tick, but haven’t come up with an elegant way of doing it yet..

CGI::Wiki::Kwiki

created 13 August 2004 in blog tagged perl, release and wiki.

Well, in the end, rather than fold my code into CGI::Wiki and its example scripts, Kake has persuaded me to release the thing as an actual module. So, the world now has CGI::Wiki::Formatter::Kwiki and CGI::Wiki::Kwiki. I’m not sure about the name of the latter, but given that is was mostly written as a Kwiki importer and front end, it made the most sense. I hope that people also realise that it doesn’t have to have anything to do with Kwikis at all, and can be used as a stand-alone wiki front end..

They still have very small version numbers, the formatter needs code, tables and comments, and the Wiki front-end needs tests (bad me), but as far as I can tell, for the most part they both work. The code is much cleaned up from the “last release”:/blog/programming/CGI-Wiki, all modular and everything, I’m much happier with it now.

You can get them both from CPAN.

Bot-BasicBot-Pluggable 0.04 released

created 13 August 2004 in blog tagged irc and perl.

Hah, finally I bullied simon into releasing Bot::BasicBot 0.04, allowing me to release a version of Bot::BasicBot::Pluggable that actually installs and builds and works. Thanks, Simon. I’ve bumped the version number to keep in sync with BasicBot, not totally sure why, as I suspect I’ll rapidly overtake it, but I’d like to get >10E-1 at some point…

Anyway, read the docs, or download the code, send me feedback.

blogroll

created 13 August 2004 in blog tagged perl, template and xml.

Ah ha! I have a blogroll. Ph33r me.

In other news, Template::Plugin::XML::Simple is really nifty.

<p class="code">
[% USE blogroll = XML.Simple('/export/home/tomi/web/jerakeen.org/blogroll.opml') %] 
&lt;p class=header&gt;blogroll&lt;/p&gt;
&lt;p&gt;
[% FOREACH section = blogroll.body.outline %]
  &lt;a href="[% section.htmlUrl %]"&gt;[% section.text %]&lt;/a&gt;
  [% UNLESS loop.last %]&lt;br /&gt;[% END %]
[% END %]
&lt;/p&gt;

build_m3u

created 13 August 2004 in blog tagged mp3 and perl.

I was reading this article on m3u files and decided to scratch one of my long-term itches, building a decent windows playlist on the file server. It’s a.. large collection, so I don’t want to build things on the client end, you see, it takes bloody ages.

Up till now, I’ve just created a list of paths, and used that as the playlist. This had 3 disadvantages:

  • it’s very hard to have it sorted by anything useful, using the filename is hopeless as there are several different naming conventions involved. blech’s fault.
  • I’d quite like to have the track lengths already by the tracks when winamp starts, as opposed to have it add them whenever you see them.
  • for some reason, winamp starts much faster when there are EXTINF tags in the playlist file. Don’t know why. Don’t care.

So now I search the server for files, read the id3 tags, sort by artist/album/tracknum/title and print out, along with the track length and name in an EXTINF tag. The whole process takes almost exactly 2 mins, but it’s not very memory-efficient. For various complicated reasons the server has almost a gig of memory in it (ok, they’re not complicated reasons - we just don’t own any other boxes that can use the stuff) so I don’t care about this.

code is here, if you care. It’s hard-coded for my server, but the only thing you’d really need to change is at the beginning, where $root and $remote are defined - $root needs to be where the music lives on the server, $remote is where it lives on the network. For my server, I samba share /music on the server cowboy as cowboymusic. Also, $playlist should be where you want the playlist to go.

Template::ModTT

created 01 January 2000 in code tagged perl and template.

mod_tt is an apache handler that processes Template Toolkit templates natively in the apache server without the configuration overhead of a full mod_perl and Apache::Template install. Template::ModTT (this module) is the perl interface to the mod_tt hander available to you when running under mod_tt.