husk.org. a website by Paul Mison.

2010-03-13

The View from Above | n96.org

delicious 18:08:31
Lovely.

2010-03-11

The Tube's first female driver | Going Underground's Blog

delicious 16:11:37
The story of Hannah Dadds, who became the Tube's first woman driver in the late 1970s.

2010-03-10

wrightrkuk's stuff tagged with laidupships | Flickr

delicious 09:09:59
Photos of the Maersk container ships laid up in Scotland, waiting for oil to become cheap enough to be economic again.

World’s fastest container ships mothballed | FT.com

delicious 09:08:57
Maersk has six ships in harbour in Scotland. "The fast ships, which analysts say would have cost well over $50m (€36.7m, £32.3m) each, have fallen victim to a doubling in fuel prices, slumping demand for containerised goods and changes in industry practice."

2010-03-08

Reportage - The challengers to London’s black cabs | FT.com

delicious 13:18:48
On Addison Lee, and minicabs vs taxis. Unfortunately, not enough's made of this introductory piece about GPS data: "The data track the movements of Addison Lee’s [London] cars during a three-year period [and has been used to] create a grid-like model that predicts how long a given journey should take at different times of the day." Still, interesting stuff.

Scott and Scurvy | Idle Words

delicious 09:45:33
"Somehow a highly-trained group of scientists at the start of the 20th century knew less about scurvy than the average sea captain in Napoleonic times. What happened?" A(nother) fascinating essay by Maciej Cegłowski.

2010-03-06

Legible London | Slate Magazine

delicious 22:53:31
Part of Julia Turner's series on signs and wayfinding, subtitled "Can better signs help people understand an extremely disorienting city?" The answer seems to be "yes".

The Law, Ethics and Photography | Kunst Haus Wien

delicious 22:29:34
I half-remember bookmarking this when it was on in Paris (at Musée de l’Elysée) but I didn't see it there. Now it's on in Vienna.

Shape My Language By Bruno Maag | The FontFeed

delicious 22:27:06
"Long streams of clear plastic cards hang from the ceiling, engulfing the gallery visitors in a typographic mist. Each card features one single glyph from one of thirteen different Dalton Maag typefaces, with the font name above it and the Unicode number below." Looks interesting.

2010-03-04

Roger Ebert: Farewell to my London home | The Guardian

delicious 20:49:21
Roger Ebert's eulogy for The Eyrie Mansion. "This cannot be. They're tearing down 22 Jermyn Street in London. Much of the block is going. Bates hat shop, Trumper the barber, Sergios cafe, all vanishing. Jermyn Street was my street in London. My neighbourhood."

SQLite datastore stub for the Python GAE SDK | Nick's Blog

delicious 16:36:40
"The Python SDK's datastore implementation operates by storing the entire contents of your development datastore in memory." "The new local datastore implementation fixes both these issues by rewriting the datastore stub to use SQLite as a backend." Try the beta now. (docent's memory usage when running a local copy of the full DB was... painful.)

2010-02-28

end to end build for mac os x | cairo

delicious 10:34:52
There's some stuff in here which I probably didn't need to do, but using these versions and these instructions (as far as Cairo, where I abandoned the building for multiple architectures) got me a version which had some test failures but installed and worked with pycairo and Aaron's py-modestMMarkers.

2010-02-27

Vox Importer | WordPress.com

delicious 14:36:54
I'm a month late to this, but it could be useful. I still have two years of stuff on blech.vox.com but a lot of it needs to be migrated to something I have more control of. This importer claims to do comments and can be password-protected; it might be very handy.

Crash - February 11 - April 1, 2010 | Gagosian Gallery

delicious 10:52:09
'Gagosian Gallery London will present "Crash," a major group exhibition opening on 11 February 2010, which takes its title from the famous novel by JG Ballard.'

2010-02-25

Secret papers 30-year rule reduced to 20 | BBC News

delicious 22:09:14
"The 30-year rule for publishing secret government papers is to be reduced to 20 years ... phased in over 10 years by doubling the amount of old records released each year".

2010-01-28

Introducing docent

chaff 18:20:00

Flickr and galleries

It's now a little over four months since Flickr launched their galleries feature. I liked it as soon as I saw it: it's taken a frequent request ("how can I have sets of favourites?") and delivered something that does the same job, but in a different way. I know some people quibble about some of the constraints, but I like the limited number of photos you're allowed, and generally I've enjoyed creating and browsing them.

Unfortunately, there's a problem: discovering other people's galleries. Aaron Straup Cope is good at bookmarking them on delicious, and there's an Explore page, but neither of those necessarily find things I'd like to see.

The gist of it

Just over three weeks ago, Kellan announced the first API support for galleries, and I quickly created a Python script that would go through all my contacts and fetch their galleries. It was useful, and it turned up a lot of galleries I hadn't seen, but it had two big flaws: nobody else would use it, and it wasn't pretty.

App Engines and data models

I've used App Engine in the past, but that was before the advent of their experimental Task Queue API, and I didn't use the datastore. Using Aaron's gae-flickrapp as a core, I spent about a week's worth of evenings on and off learning how to use both, ending up with the core of docent¹, a small web app.

There are only four kinds of object: dbFlickrUser, from gae-flickrapp, which handles logged in users; Contacts, which have a one-to-one relationship with dbFlickrUsers; FlickrUser, which is an object for a user docent knows about but who isn't necessarily logged in; and Gallery, which stores information about the gallery itself.

What it does

When you first log in, a task is added to a high-priority queue to fetch your contacts from Flickr. The NSIDs² from this call are stored in a single ListProperty in the Contacts object, and then a new task is added to a lower-priority queue. This goes through the IDs one by one, fetching the galleries Atom feed³ and creating the relevant objects (if necessary). This, and the various tasks to update galleries for older users, make up the bulk of the CPU load of the app, and almost all of the Datastore writes.

The big difference between traditional ORMs and the way I'm using the App Engine datastore comes into play here. In an ORM such as Django, a dbFlickrUser would have a many-to-many relationship with FlickrUsers, which would then have a one-to-many relationship with Galleries. The former would require a join table between them. The query to fetch all galleries from a single user would look something like galleries = Gallery.objects.filter(owner__contact_of__nsid=nsid)

orm.png

By contrast, in the datastore, Both FlickrUser and Gallery objects have a contact_of ListProperty. As a new user's contact list is examined, their NSID is added to the contact_of list. This is how the pages showing galleries for a contact are built: it's a simple equality test, which is translated behind the scenes to a list-membership test:

galleries = Gallery.all().filter('contact_of =', nsid).fetch(256)

gae.png It took a lot of fiddling to break out of the ORM/SQL mindset, based on joins, but I think I'm happier now I have. On the other hand, keeping the contact_of lists on all the objects in sync is something of an overhead, and the query code isn't significantly easier. There's also a rather severe limitation I only ran across later.

Onto the Flickr blog

This was all well and good as I let a few other people at the site; initially close friends, then via a couple of screenshots on Flickr, before inviting a bit more of a burst of users via Twitter. The site seemed to be scaling fine; there was a lot of CPU used fetching contacts, which eventually I managed to optimise by being more selective about updating from the gallery feeds. In fact, the FlickrUser object is currently pretty much a stub, although I'm thinking of changing that.

However, when docent made the Flickr blog, it hit a serious issue: exploding indexes. The version of the app that was live was doing this query:

galleries = Gallery.all().filter('contact_of =', nsid)
                         .order_by('-published')
                         .fetch(offset, per_page)

That extra "order_by" criteria required an additional index, and because it's combined with a ListProperty (namely contact_of), it hit the problem documented in the Queries and Indexes page:

Custom indexes that refer to multiple properties with multiple values can get very large with only a few values. To completely record such properties, the index table must include a row for every permutation of the values of every property for the index.

When I last looked, docent knew about 14,000 or so galleries. While most had small contact_of lists, some no doubt expanded to dozens of people, and so the index was too large to store. As a workaround, I eventually realised I had to abandon sorting in the query and instead use Python, at which point the app started being responsive again. Lesson learnt, the hard way.

Moving On

So, what now? The app is up, and although there are a few errors still happening, they're mainly in background tasks that can be optimised and retried without any impact on users. Personally, it's been a fairly good, if occasionally intense, introduction to App Engine's unique features.

Would I do things this way again in future? I'm not sure. Turning the relationship model on its head hasn't led to an obvious improvement over the ORM+SQL methods I'd use in, say, Django, and while the Task Queue API is very easy to use, it's hard to develop with (since it has to be fired manually locally) and there are other job queue solutions (such as Delayed Job, for Rails, as used on Heroku). On the other hand, even with the heavy load, and not the best of optimisations, docent almost stayed within the App Engine free quota CPU limits, and didn't approach any of the others.

In any case, I'm happy to have produced something so useful, and hope that anyone who tried using it yesterday only to run into errors feels willing to try again. In the meantime, I'm sure there'll be more scaling roadbumps as the site gains users and more galleries are added, but I'm looking forward to fixing them too. Please, try docent out.

(I know comments aren't enabled on this site at the moment. Feel free to add them on docent's page on Flickr's App Garden.)

¹ Why "docent"? Originlly it was the unwieldy gallery-attendant, but Chris suggested the name, based on a term more common in the US than here for the guide to a museum or gallery.
² NSIDs feel like the primary key for Flickr users: in methods like flickr.people.getInfo, it's one of the key pieces of returned information, and it can be used in feeds to fetch information as well as URLs to photos and profile pages.
³ Using feeds rather than API calls can be handy. For one thing, they don't count against your API queries-per-second count; hopefully they're cached more aggressively, both via the feedparser library and on Flickr's side so they take less resources.
⁴ One nice thing about getting more users is that the likelihood of finding a contact's galleries in the data store already goes up. When I was developing, I had to fetch everything; for the second user, there was some overlap, saving calls. As the site gets bigger, the number of fresh gallery fetches should keep fairly low.
⁵ Since I last wrote about App Engine, it's grown the ability for users to pay for resources beyond the free quota levels. I decided to do this when I hit about 55% of my CPU quota, and the app did indeed reach about 120% yesterday. I don't have a bill yet but I expect it to be under $0.50, which is fine.

2010-01-03

On New Year

notes 21:24:00

I’d forgotten - until yesterday - that the epic post on calendars and blue moons, on the Panic blog, had made me think about doing a post about the changes in New Years. So, before 2010 properly gets going (with most people going back to work tomorrow), I thought I’d try and get this out while it’s still topical.

You’d think the concept of a new year was straightforward. After all, it’s right there: the date is 1/1 (whether you’re European or American), and given we don’t use 0 for dates¹, that’s the first day of the year, right? Well, yes, it is now, for a good chunk of the world’s population. It wasn’t always.

Readers of Pepy’s Diary will know that; indeed, the entry for 1st January 1666/1667 bears two dates. Until the UK changed to the Julian calendar in 1752, the first day of the year was on the Feast of the Annunciation, Lady Day, marking the occasion of Mary’s meeting with the Angel Gabriel. Before then, dates for the first third of the year carry both the date of the Julian and Gregorian year. The British tax year still starts on this date, with (complicated) adjustments for the days lost when the calendar changed.

That’s not the only “new year”, though. Parliamentary years start with the State Opening, in November (or, occasionally) December; the Catholic and Anglican liturgical year also starts in December. Meanwhile the academic year starts after harvest in September. (Australia’s also starts in late summer.) Admittedly, none of those has as much legal force as the calendar or tax year, but still, I thought them worth mentioning.

That’s just in the UK, of course. There are two other obvious major world calendars, both lunar. The Chinese new year (also celebrated in Korea and Vietnam, but not Japan, which swapped to the Western calendar in 1873) is based on a lunar-solar calendar, so it moves around, but not much: it’s defined as the second new moon after the winter solstice, fixing it to a date between 21 January and 21 February (with thanks to this PDF, which did all the sums for me).

Meanwhile, the Hijri calendar, used by Muslims, is a pure lunar calendar, with nothing fixing it to the solar year. As a result, the Islamic new year shifts by either 11 or 12 days a year, moving through the Western calendar every 30 years or so. Even more alarmingly for those used to the rigid certainty of solar reckoning, the first day doesn’t happen until the new moon is officially sighted: this can shift the start of the year back a day, in theory at least. In 2009, the first day of Muharram, the first month, was on 18 December.

I’m not even going to try and explain the various Indian new year’s days, except to note that most of them seem to be around the northern hemisphere spring equinox.

So, happy new year, unless you’re Islamic, in which case, belated happy new year, or Asian, in which case, it’ll soon by new year, unless you’re Japanese, in which case: happy new year.

¹ There’s an exception: astronomers have a year 0, and their convention has been adopted by ISO 8601.

2009-12-20

The Visibility of Skill

notes 22:31:00

Last week, I visited Decode at the V&A, a collection of digital art, and there’s a quote from it in the Times review (as mentioned by Chris Heathcote) that I wanted to examine:

There is no denying the technological craft behind the work in Decode. However, unlike physical craft of the kind that fills the rest of the V&A, you cannot actually see the skill behind digital art. You cannot see the intricate computer codes and algorithms. … All you can judge it on is the “object” itself. And that, while undeniably pretty, is too often underwhelming.

Maybe that’s true for Tom Dyckhoff, but for me, it’s easier for me to conceive how to make something like Chris O’Shea’s Audience (part of Decode, but outside the paywall, to repurpose an internet term) than it is to understand the process behind, say, sculpture or ironwork. Obviously I’m a bit of an outlier, but I wouldn’t be surprised if, in a decade or three, the idea that “analogue” art is understandable and “digital” isn’t falls by the wayside.

Oh, and the exhibition? It’s not the best in the world but if you’re at all interested in digital art or interactivity, it’s worth the £5 to see it. You’ve got until April 2010.

2009-12-14

iPhone, video, colour profiles

notes 00:16:00

I use a lightly modified version of FlickrTouchr.py to back up my photos from Flickr, and also to push them to the iPhone (in case I get terminally bored on the Tube and fancy paging through my favourites). Unfortunately, there are two issues with it.

Firstly, until I made a patch this evening, videos were downloaded with a .jpg extension. I fixed that (note the ‘&extras=media’ argument I add to the URL when fetching photos) and then deleted the old “pictures” manually. (I suppose I could have checked for a matching ID, but… exercise for the reader, sorry.) Sadly, iTunes won’t sync videos mixed with photos: if I want them on my phone, I’d have to add them explicitly as video, and I really can’t be bothered. Still, at least they now don’t cause errors, and I can look at them on my hard drive.

Secondly, and more mysteriously, some of my favourites won’t sync. The ones I’ve checked have a ColorSync profile embedded in them, for a “LaCie 321”, which I assume is a specific (fancy) monitor. Quite why iTunes won’t just ship them over and sod the colour matching, I have no idea, but I wondered if anyone else had come across this or knew why it was enforced?

2009-11-30

King's Cross Northern Ticket Hall

notes 22:24:00

Yesterday, the new ticket hall at King’s Cross Underground station opened. The official unveiling had been on Friday, with the Mayor and Minister for London, but it was on Sunday that regular commuters got their own chance to have a look around.

So, first things first: the station works. It’s big - surprisingly big, in fact, given how much of it is in deep tunnels. It’s shiny enough (although I’m not sure how long that will last). Generally, it’s well signed. The new ticket hall is well located for St Pancras and the new high-speed domestic services due to start properly in December, and the whole thing has to pretty much double the capacity of the (incredibly busy) station.

The station is so big, in fact, that the lifts have their own map. There are nine of them (although one isn’t open yet and, alarmingly, when I popped in today one was closed), six of which belong to the extended station. Oddly, the lifts don’t go up or down automatically; once called, they wait for a button press to ascend or descend. Generally they’re well signed, but the Piccadilly’s Lift J is hidden between the platforms- I figured out where it was by descending from the interchange subway (pictured above).

Art at the Northern line concourse, King's Cross (by DeanN on Londonist)

The opposite end of the subway to the Victoria line sees the Northern line’s new concourse hosting an artwork by Knut Herik Henriksen, as discussed at Building Design, and photographed by Londonist (cheekily reused above). I suspect the art is so subtle as to go unnoticed by many, but I quite like it (although perhaps more so in photographs and diagrams than in reality). Londonist’s pictures really do a good job of capturing the way a 2009-era Tube station looks when freshly uncovered, too; the shot up at the ticket hall ceiling from the bank of four escalators down to the subway level is lovely.

Speaking of the interchange subways, they’re very, very long. The map above shows how the three deep lines (the Northern, Piccadilly and Victoria) more or less meet at a point a the bottom of the current Tube hall’s escalators. The new hall feeds down to a much longer set of passages (in peach), especially for the Victoria line (where they connect with the existing, now barely used, subway to what was once the Thameslink station, now maintained as an exit to Pentonville Road).

There’s nothing really wrong with that. What is somewhat offputting is that the signage at the new entrance to the Underground from the main-line station’s concourse is that it suggests any deep-level passenger should head via the Northern hall. This turns a one and a half minute journey into a four-minute one.

Of course, the signs are there for the confused, and there’s probably merit in sending people down the wider, shinier new corridors. If I get the choice, though, the older entrance is far more likely to be the one I use.

Still, it’s good to see a project that nearly didn’t happen take a massive step forwards.

2009-07-26

Heroku, App Engine, and AppJet

notes 11:04:00
When AppJet was still around, we had an edit button, a single page of a few dozen lines and a cross-domain AJAX API. This, surprisingly enough, was all you needed to apply some programmatic patching to a bunch of different use-cases

Jonathan Lister, from Joyent Smart Platform – a replacement for AppJet?

In it, he compares Joyent (nee Reasonably) Smart’s model, where you develop locally then deploy with git, to that of AppJet, where you edited online via a web form.

For a long time, I thought that the online-editing model was the right one, and I thought Heroku and App Engine suffered for not supporting it. However, when I was seriously working on my AppJet sites, I found that I ended up developing locally (with their .jar download), then wishing for an easier deployment method than copying and pasting between text files.

For any serious project (and most developers), I’m sure that pattern would be repeated. So why bother with the complex work required to put an editor into the browser (even if Bespin promises to be a drop-in component)? Better to concentrate on the deployment side, either building on a (D)VCS like git or using custom hooks, like GAE’s “appcfg.py update”.

He goes on to say:

I’ve said it before and I’ll say it again – I will pay for what AppJet were providing. People will pay for what AppJet were providing.

Unfortunately, this has a classic problem of having to build a market. Heroku can build on Rails programmers; GAE on Python and now Java developers. Smart has the harder job of getting people to write server-side JS, but at least there are people who think that way, and they can usually pick up git.

AppJet, on the other hand, was trying to persuade people who don’t think they can program that it’s really not that hard. This is a huge problem, and I can see why it’s far easier for their developers to sell real-time web based collaboration, since everyone knows how to write words.

I suppose this is a long winded way of saying that web-based server-side programming is still a way off.

sources

elsewhere

otherwise

flickr

Rotherhithe

Tunnel

Wapping

Tunnel

Wallpaper

Photos

Plans

Chairs

Pixels

Breakfast

ffffound

by Christoph Niemann
by Christoph Niemann
crumpled_map2.jpg
Photo: Swirled ice formation in a glacier cave