Systeme D

May 25, 2009

Through the Thames by bike

I’ve wondered about setting up a crazyguyonabike journal to record our cycling trips, but since I don’t post enough here anyway…

Yesterday we put the bikes in the back of the car, drove to Lechlade, and cycled from there to Oxford. (We’re doing a Changing Places in WW on the Upper Thames and I needed to take the modern pics.) Our route, in brief, was: Lechlade->Mill Lane->old B4449 past Kelmscott->Clanfield (”mentioned in the Domesday Book” – er, like everywhere)->Bampton->Shifford Lock->Hinton Waldrist->detour to Newbridge->Appleton->Bablock Hythe (south bank)->rather muddy bridleway->Farmoor->Eynsham->via A40 to Godstow and Oxford->Royal Oak->cheeseburger.

Generally a lovely ride: pretty flat, at least until you get nearer Oxford and the valley narrows; some quiet roads; and bakingly hot. After our previous ride on proto-NCN45 via Upton-on-Severn, where we encountered a downpour of morris dancers, I was rather expecting to find the same in Bampton but sadly not.

There was one utterly wonderful highlight on such a hot day, which was this:

Duxford Ford is the one forded crossing of the River Thames (clearly not the navigation channel), on a bridleway from Chimney to Hinton Waldrist. You wouldn’t try it in the winter; the current was still pretty considerable even this weekend. But wading across, pushing the bike, it was a real delight on such a hot day.

What wasn’t so great? The traffic in some places was lousy, particularly the A415 at Newbridge, which was bad beyond belief. We witnessed two near-accidents and at least one “what the hell are these cyclists doing on my personal racetrack” wanker who was, inevitably, driving an expensive German automobile. The pubs are all Greene King. Really. At Newbridge there are two pubs, one on each side of the river: both are run by Greede Kerching. It must be the first Strongbow I’ve had in at least a year.

And: there really needs to be a bridge at Bablock Hythe. It would have made our route so much easier, safer, and more pleasant. The arguments for the bridge (the single break in the Thames Path, Oxford-Witney cycle route, etc. etc.) have been rehearsed so many zillion times before that I won’t bore you with them.

But really – it’s just like the Oxford-Cambridge railway; one of those staggeringly obvious schemes that never gets done because highway engineers are still the sort of people against whom Robert Aickman used to rage furiously in early IWA Bulletins. (”Motor Moloch”, the column was called.) At one point we passed a lonely “Oxfordshire Cycleway” sign, a disconnected remnant of a now-abandoned route, closed by Oxfordshire County Council because of rising traffic levels. Heaven forfend that they actually do something to make the roads bearable for those not in BMWs, of course.

So next time, I think we’d divert onto the back roads and head back to Charlbury via Witney, or maybe Minster Lovell, rather than hacking into Oxford. Still, a great ride.


May 20, 2009

Sending HTML e-mail with attachments in Perl

CPAN has some really good e-mail modules – including one written by the BBC. How cool is that? But the documentation isn’t entirely transparent unless you’re a MIME wizard… which I’m certainly not.

Here’s what I’ve found works to send an HTML format e-mail with attachments. (For these purposes I was never sending more than five attachments, but it’d be trivial to change.) Working out that the outer part needed to be multipart/mixed was the bit that took me the time – simply attaching files to an Email::MIME::CreateHTML message puts them as extra alternative parts in a multipart/alternative message, so a mailer might just display one of the attachments as the message body.

use Email::MIME;
use Email::MIME::CreateHTML;
use MIME::Types;
use Email::Send;
use Email::Abstract;

# -----------------------------------------------------------
# You'll need to define:
#
# $html - the HTML for the e-mail
# $plain - plain-text version
# $sender_name - name of sender
# $sender_email - address of sender
# $name - name of recipient
# $address - address of recipient
# $subject - subject line
# @body - attachments (slurped into $body[1] etc.)
# @fn - filenames for attachments

# ----- Create HTML

my $htmlmail = Email::MIME->create_html(
    header => [],
    body => $html,
    body_attributes => {
        disposition => 'inline' },
    text_body => $plain);

# ----- Create base message

my $email = Email::MIME->create(
    header => [
        From => "$sender_name <$sender_email>",
        To => "$name <$address>",
        Subject => $subject ],
    attributes => { content_type => "multipart/mixed" },
    parts => [$htmlmail]
);

# ----- Add attachments

for ($i=1; $i<=5; $i++) {
    next unless $attach[$i];
    ($mimetype,$encoding) = MIME::Types::by_suffix($fn[$i]);
    $att = Email::MIME->create(
        attributes => {
            content_type => $mimetype,
            filename => $fn[$i],
            encoding => $encoding,
            name => $fn[$i],
            disposition => "attachment" },
        header => [ 'Content-ID' => "$year$mon${mday}_${contentid}_$i" ],
        body => $body[$i]);
    $att->header_set('MIME-Version');
    $att->header_set('Date');
    $email->parts_add([$att]);
}

# ----- Send mail

$Email::Send::Sendmail::SENDMAIL = '/usr/sbin/sendmail';
my $sender=Email::Send->new({mailer => 'Sendmail'});
my $response=$sender->send($email);
return $response;


May 12, 2009

What’s worse than a spraymailing PR bunny?

Answer: a spraymailing PR bunny who knows how to use PHP.

Hello,
The following press releases were sent to you recently. We should be very grateful if you would tell us whether or not you intend to make use of them.


Not a good start.

TECHNIFOR – #1174 – 2009-03-10
XF530p: the portable deep marking solution | Capable of attaining a depth of 0.4mm, the XF530p is the world’s first portable deep marking by micro-percussion machine – which stands out for its versatility and ease of use. Whether it is used on tubes or smooth surfaces, it is simply applied to the part, with no need for other pre-tension equipment or supplementary positioning. It can mark pipelines (oil, mining, gas), lifting/hoisting equipment (pallet trucks, forklift trucks), “off the road” vehicles and even naval constructions and metallic structures.
http://ns204460.ovh.net/press/pressdoc_files/1174/CUK_TECHNIFOR-XF530P.pdf 


Ok. And that has precisely what to do with the inland waterways of Britain, pray?

But hey. We get plenty of irrelevant press releases, mostly about the America’s Cup or other saltwatery things. I can live with that. The really offensive bit is in the headers.

Subject: MEPAX Monthly Reminder
X-Mailer: Mepax/Php 


So. You add us to your initial mailing list, without permission, because you found Waterways World on Mediadisk – or some such grot – filed under “boating”… and this press release talks about “naval constructions”.

You then, astonishingly, write a nag mailer to follow up every single such misdirected release with a “monthly reminder”. And you expect us to write a personalised reply (”we should be very grateful if you would tell us”) to your automated mailer.

After recovering the power of speech, I have written a personalised reply to info@mepax.com, and it does involve the words “get” and “lost”.

(Clare’s list of Top 10 PR mistakes should be compulsory reading for bunnies everywhere.)