The Array Argument (aka. *)

Wednesday’s post on acts_as_locateable didn’t do much to explain what the patch to the plugin’s methods was doing to allow us to pass extra arguments to ActiveRecord#find. The secret is in the *, or array argument. A normal method will have a fixed number of arguments: def simple_method(first, second, third) puts "#{first} : #{second} : #{third}" end simple_method('one', 'two', 'three') >> one : two : three and sometimes we can develop that by allowing default values for those arguments: ...

February 9, 2007

Feed fixes

After upgrading to Wordpress 2.1, I patched the code behind this blog to support Atom 1.0, but apparently a few pieces didn’t go in the right places. So apologies to anyone who may have been waiting on updates that never came. I’ve made some changes, and hopefully normal service can now be resumed.

February 8, 2007

iConcertCal

iConcertCal is an iTunes plugin that scans your library and produces a list of upcoming concerts that you may be interested in. It attempts to detect your city from your IP address, but that can be overridden, and the calendar itself is provided as an iTunes visualiser. The iConcertCal installer has been sitting on my desktop for a few days now, awaiting a chance to be used, so it was finally time to give it a whirl. ...

February 8, 2007

Extending acts_as_locateable

There have been quite a few geographically-themed Rails plugins emerging over the past few months and I decided it was time to try out acts_as_locateable. Acts_as_locateable is based on ZipCodeSearch. It loads in a database mapping US zip codes to coordinates and then adds convenience methods to ActiveRecord objects that let you search by distance. eg. Event.find_within_radius(50, '49503') will return all events within 50 miles of me. What the standard plugin doesn’t allow is the passing in of more search parameters. So if I wanted to limit that search to future events I’d have to retrieve all the results and iterate over them. In a large system that could be very inefficient. ...

February 7, 2007

Issues of Translation

I have to confess that we were a little disappointed to hear on the radio the other night that Beijing have announced plans to crack down on poorly translated (into English) signs in the run-up to the Olympics. We were looking forward to seeing such signs when we visit this summer. Thankfully, it seems like Malaysia Airlines are extending some sympathy. I’ve been having consistent problems with 500 errors on their website, so emailed them to suggest they might like to fix it. A few seconds later, I got this delightful automatic response: ...

February 7, 2007

Guillermo Del Toro on NPR

Having very much enjoyed Pan’s Labyrinth on Sunday, I was pleased to hear the creative mind behind it, Guillermo Del Toro, interviewed by Terry Gross on Fresh Air this lunchtime. The interview’s a good one and can be heard here. Tags: pan’s layrinth, guillermo del toro, npr, fresh air, terry gross

January 24, 2007

DVD Boxsets

Writing the other day about West Wing reminded me that I’d meant to throw in a comment on the development of DVD boxsets. Having decided against getting either cable TV or an antenna, we’ve been getting all of our TV on DVD (or through certain other means) for a couple of years now, primarily from netflix or by adding to our collection. In the past few months I’ve begun to notice a new trend. ...

January 24, 2007

Oscar Season

Listening to the news this morning, with all the build up to today’s Oscar nominations, I was thinking about the blog entry I’d write to lament the fact that Ryan Gosling was cheated out of an Actor In A Leading Role nomination for his part in Half Nelson. I’m very happy to be wrong, and to see him on that list! It’s an interesting list of nominees this year. Ryan Gosling has been displaced in my ‘cheated’ list with Children Of Men, which really should be up for the sound design awards (and perhaps something higher profile). But it’s good to see Pan’s Labyrinth and The Queen taking such a high profile. I suppose it was inevitable that the Pirates Of The Caribbean franchise would get a nod to appease the big money studios but it’s gratifying to see that they’re limited to technical categories. ...

January 23, 2007

Cave Of The Yellow Dog

Following on from the acclaimed (and Oscar-nominated) The Story Of The Weeping Camel, Byambasuren Davaa’s new film The Cave Of The Yellow Dog retains the simple premise, quiet pace and flirtations with sentimentality. Following a nomad girl, Nansal, who finds a puppy hiding in the cave and petitions her parents to let her keep him, the film uses its setting to explore the challenges and decisions facing nomadic families in Mongolia as their lifestyle becomes harder to maintain, and parents have to prepare their children for a radically different future. ...

January 22, 2007

Fair Trade and Global Warming

With concerns over global warming finally having reached a critical mass in 2006, this year has seen a deluge of blog posts on the subject. A couple of interesting contributions this week have come from “Lunch Over IP”, such as this piece covering a speech on urban design by Sir Norman Foster, and a follow-up to last week’s announcements by Tescos and Marks and Spencers: the “emission labels” and other carbon footprint news. ...

January 22, 2007