Stop Iran War

I don’t know quite what to say about the ongoing belligerence on the part of the USA towards Iran. If they’re not stopped by disclosures that Dick Cheney rejected an offer Iran made four years ago that would have satisfied all their public demands, then I fear there’s not much that can be done to prevent the administration from using Iraq as a launching pad for an invasion of Iran. This story at Kos’ place didn’t help (via Ed in email) ...

February 21, 2007

OpenID for a Ruby on Rails app

The buzz about OpenID keeps building, and with the announcement that all AOL/AIM users now automatically have OpenIDs it doesn’t look set to slow down any time soon. For those who’re not familiar with the concept, OpenID is a distributed single sign-on system that lets you set up one account and then log in to any OpenID compliant site using that account. For a better introduction, check out this screencast from Simon Willison. ...

February 21, 2007

Intercepting microformats in rails input

In Input formats and content types in Rails 1.2 I mentioned a project I’ve been working on that will provide a RESTful service interface which accepts its input in a number of formats, including microformatted HTML. For certain types of data microformats provide a great way to receive input as they don’t require your clients to learn a new schema to send you data. They can take the same semantically rich HTML they’re displaying on their website and POST it to your endpoint. Or they can use a tool like Ryan King’s hcalendar creator to generate some sample input. ...

February 20, 2007

Carbon Offsetting

Having written a number of blog entries about carbon offsetting around a year ago, I’ve been watching the mounting debate over them with some interest. While I appreciate much of what George Monbiot has to say, I wasn’t impressed with his claim that carbon offsets are ’ the new indulgences.’ The emotive rhetoric masked a real issue of how we can ensure that measures to combat climate change are fair to the poor, and don’t simply let the rich buy our way out of obligations. ...

February 20, 2007

model_auto_completer

Rails’ auto_complete integration is pretty nice for building search functionality, but for entry forms it all too often falls short. Typically if I’m using an auto complete field in a form it’s because I want to link that record with an existing entry in another table, such as connecting an event with a location, or a book with a publisher, and that won’t work because the value obtained from the auto completion is the name of the linked entity, not its ID. I’ve tried various ways of managing that, either by overriding the standard methods or by adding some extra code in my model that will convert a name back into the associated model ID, but they all feel like hacks and I’d not had time to clean up the code and package anything as a plugin. ...

February 19, 2007

Leaving the cinema?

I’m beginning to wonder if I should give up on going to see movies at the multiplex. Ordinarily we can go several weeks between visits, preferring the smaller theatres in town, but with the Oscars coming up there’s been a sudden influx of larger releases we want to see. But even though a couple of the films have been very good ( Children Of Men, Pan’s Labyrinth) and several others have been worth seeing (such as last night’s choice, Babel which was intense but could have done with some significant editing), the the overall experience is far more exasperating than entrancing. ...

February 19, 2007

Extending drupal's checkout process

In yesterday’s post on creating custom product types in drupal I promised a follow up on how we were adding the license generation to our checkout. I’m not going to go through all the steps in great detail as most of what I wrote is specific to our situation, and the custom PHP module (written in C) that generates our licenses, but it took me a while to work out how to hook in, so here are a few words. ...

February 18, 2007

Edge Rails Saves You Money (and improves performance)

For anyone who serves up content that is requested repeatedly by the same user agents (be they web browsers, news readers, or any other) it can quickly get expensive (financially and in performance hits) to use up bandwidth sending the same data to the same destination over and over. HTTP provides mechanisms to deal with that, but until recently they’ve been poorly supported. Those costs are the reason that this is great news. DHH just committed a change to Edge Rails that automatically adds an ETag when sending a response and returns an HTTP 304 (Not Modified) when an agent comes back asking for the same content before it has changed. ...

February 18, 2007

Custom product types in drupal

For the Scodigo site we wanted to be able to sell licenses to use the SmartPill PHP Edition plugin. For the most part that just involves a standard ecommerce flow, and so we opted to use drupal’s suite of ecommerce modules, but we wanted to make some customizations along the way, such as being able to offer product variations (eg. different user counts for the licenses) and generating and emailing a license rather than shipping a product or delivering access to a file. To achieve that I created two custom modules: a product type called ’licensable’ and a license management module creatively titled ’licenses.' ...

February 17, 2007

Festival of Faith and Music promo spot

Another piece of our promotional strategy for this year’s Festival of Faith and Music (a strategy which has registrations four times higher than last year’s total, with six weeks still to go!) is a short animated video by Karen and Peter. We like it a lot, but I don’t think I’d posted the link here as yet. You can, of course, find it on youtube. Tags: ffm2007

February 17, 2007