Archive for October, 2009

Art in Central London

// October 28th, 2009 // No Comments » // Photography

Last week I got to support some friends posing for the artist Richard Bagguley, dressed as a Roman soldier crucifying Jesus on Oxford St:

Richard was particularly looking for reactions from ordinary passers by, and has some genuinely interesting points to make. At the end of the video is a glimpse of André Camara, the photographer who’s story became the film City of God – who was just picked for the Brazilian 2012 paralympic rowing team, I discovered last night.

Jesus (SP Howarth) and my fellow Roman soldier (Andy) will be appearing in their play Baccus in Rehab at the end of November in Camden, which I strongly recommend – and not just because I designed the flyer and am taking the publicity shots!

One of André’s photos from the shoot was published in that weekend’s Independent on Saturday, and also appeared on the Express web site for a while but then got pulled down for mysterious reasons…

Masabists: NFC Roundup 2009

// October 25th, 2009 // Comments Off // Mobile

This post was originally featured on the Masabists blog.

After many trials, NFC has been on the cusp of launching in Europe for some time now. It is regularly brought up in conjunction with mobile ticketing, which has been one of the key use cases always quoted for the Felica NFC system available in Japan for some years now.

The potential is huge, and at Masabi we greatly look forward to the day we can start using it for transport ticketing – but where do we stand, in late October 2009?

UK Operator Support

O2 last did an NFC trial in 2008, and almost exactly a year ago they stated at a Mobile Monday NFC event that it had gone so well they were looking to run another trial at some point in the future. We haven’t had that trial yet.

A mobile phone feature requires operator subsidy to gain traction, because no manufacturer will foot the bill for the electronics on their own. Therefore, the number of NFC-enabled handsets currently available from each UK operator tells us a lot about where NFC lies along the feature adoption curve:

  • O2 – 0
  • Vodafone – 0
  • Orange – 0
  • T-Mobile – 0
  • Three – 0

Carphone Warehouse, the UK’s biggest indepedent high street retailer, also currently sell no NFC-enabled handsets.

NFC-Capable Handsets

GSM handsets with NFC launched by handset manufacturers:

NFC Predictions

Which year will NFC take off?

How big will the market be?

  • “by 2012, some 292 million handsets — just over 20 percent of the global mobile handset market — will ship with built in NFC” (ABI Research, Apr 2007)
  • Mobile phone based contactless payments will facilitate over $36 billion of worldwide consumer spending by 2011.” (Strategy Analytics, Oct 2006)

It’s easy to be cynical about 20% of handsets having NFC in 2012, as we start to roll into 2010 without any NFC handsets on sale – but once NFC handsets start shipping, how quickly could they be adopted?

Phone Feature Adoption Curve

In 2000 Sharp launched the world’s first camera phone, which was a bit of a novelty. By the end of 2003, 25-35% of handsets had some sort of camera on them. By 2007, M:Metrics stated that 75% of UK handsets and 51% of US handsets had cameras – 7 years after the first launch.

Arguably, cameras are a more obvious feature for a mobile handset than NFC.

The first handset commercially available outside Japan with integrated NFC was the Nokia 6131NFC, launched in 2007. At the end of 2009 we still have no operator subsidised NFC handsets, which suggests there is little chance of matching the camera adoption rate, with 25-35% at the end of next year.

From this quick comparison, we can assume that we are either still sitting before the start of the NFC adoption curve, or the NFC adoption curve is very much flatter than that of phone cameras – more like mobile TV, say.

Conclusion

When it comes, NFC has some great potential in niche markets like mobile ticketing. At Masabi, we’re greatly looking forward to it. But right now, as a company principally interested in mass-market technology, we’re not holding our breaths.

Please comment on the original post

Migrating Blogger to WordPress – Easy 301 Permalink Redirects

// October 25th, 2009 // 1 Comment » // Dev, Web

I’ve been moving the Masabi web site and blog onto WordPress, from a combination of static web content and a blog driven by Blogger. WordPress has a great import function to move the posts across, which does most of the initial work for you.

However, WordPress won’t by itself set up redirects for the old Blogger to new WordPress permalinks. The two platforms shrink post titles to URLs differently, so it’s not as simple as matching WordPress permalink structures to Blogger’s under the Settings.

I did see one plugin which was supposed to migrate Blogger permalinks automatically, but it didn’t work and also didn’t cover the full scope I needed – I also have legacy static html links to remap into a totally different site structure. To achieve this I turned to the excellent Redirection plugin from John Godley.

Getting Inside The Database

The plugin allows you to manually set up redirects with a very friendly interface, but there’s no fun migrating 70 blog posts by hand.  This is where SQL can come to our rescue!

VERY IMPORTANT: take a full backup of your database before you start messing around with SQL.  In theory this is a pretty low risk operation, but, you never know!

The Blogger import utility saves custom fields for every imported post; the Blogger permalink is held in the blogger_permalink field; custom fields are stored on the post_meta table with an obvious ID based backlink to the original table.  This makes one half of the mapping very easy to set up.

The other half is slightly more subtle, because WordPress permalinks are not actually stored on the wp_posts table. Every post does have a GUID, but this is based on what its permalink was when you did the import – and if you imported when you created the blog and set your WordPress permalinks later, this will not reflect the post’s current permalink URI. Ideally we’d like the 301 to point to the real end URI, so we need to get a little creative and rebuild the permalink in the way WordPress does it, from the post metadata.

My permalink structure looks like this:
YYYY/MM/DD/title/

This can be rebuilt using the following string manipulation in SQL:
CONCAT('/',YEAR(post_date),'/',LPAD(MONTH(post_date),2,'0'),'/',LPAD(DAY(post_date),2,'0'),'/',post_name,'/')

Notes on the SQL functions:

  • CONCAT just combines all of its arguments together into a single string;
  • LPAD is used to pad the left of the string with 0s, as the month and day are always 2 digits long;
  • YEAR, MONTH and DAY extract the relevant fields from the post’s creation date/time.

Given this data, we can easily create an automatic import SQL statement for moving the data across:

INSERT INTO wp_redirection_items (url,action_data,regex,group_id,status,action_type,action_code,match_type,last_access,position)
SELECT M.meta_value AS url,CONCAT('/',YEAR(P.post_date),'/',LPAD(MONTH(P.post_date),2,'0'),'/',LPAD(DAY(P.post_date),2,'0'),'/',P.post_name,'/') AS action_data,0 AS regex,1 AS group_id,'enabled' AS status,'url' AS action_type,301 AS action_code,'url' AS match_type, 0 AS last_access, 69 as position
FROM wp_postmeta M, wp_posts P
WHERE M.meta_key='blogger_permalink' AND M.post_id=P.ID AND P.post_status='publish';

Run this through PHPMyAdmin, refresh the Redirection admin page, and you should now find that all of your permalinks have been moved across. Note that we set the position field to an arbitrary constant, here 69, so we can easily delete the inserted rows if we messed up and then try again, without upsetting any other redirects already set up.

E-Mail Not Working In PHP / WordPress? It May Be CPanel MX Records…

// October 20th, 2009 // No Comments » // Web

I host a few domains through Nativespace and Host Gator (which both use the CPanel interface), and all of them have had one flaw – PHP apps like WordPress, Drupal, and also WordPress plugins like the Dagon Design Mailer Script have never been able to send email.  It’s quite hard to track down this kind of error yourself on a managed host with a web UI so in the past I’d not worried about it, but finally it came time to solve it (or rather get Ben to solve it, but I’ll write about it so others don’t have to go through the hard work)

The Problem: CPanel’s Broken MX Assumptions

Note: you can ignore this section if you don’t care why the problem occurs, and just want a fix!

It transpires that the problem occurs when the domain being hosted is registered through some other provider, which therefore runs the domain’s DNS and MX records.  MX records tell the world how your domain runs its e-mail.

Rather than do a proper MX lookup for sending e-mail, CPanel just assumes it runs the domain’s MX records and looks up in its own local configuration.  This would be fine if it did run the domain’s e-mail, but in these instances it doesn’t and therefore the e-mail ends up falling into a black hole.  Why the authors chose to do this is uncertain, but it is easy to fix.

The Fix: Redundanct Configuration

First, find the MX Entry icon in the Mail section of the CPanel front page:

CPanel's MX Entry icon

Click on it to see CPanel’s configuration for your domain.  The default looks something like this:

CPanel's default MX configuration

Many of my domains use the free Google Apps product to offer GMail accounts that work with the domain (ie. a GMail inbox tied to an @masochismtango.com address).  Here is the CPanel configuration you need if your domain does the same – if not, you’ll need to check your MX records with your domain registrar to find the right configuration to enter here.

Warning: this solution only works if you know the real MX records for the domain! If you don’t you could mess things up.  Remember it may be easier to just file a support ticket – I’m not taking responsibility if you mess this up!

First, add the correct MX configuration for the domain:

MX configuration for a domain with Google Apps GMail

For GMail, you can get away with just adding a couple of entries, at priority 1 and 5. Then, delete the old priority 0 entry which CPanel started with to leave just the real configuration:

MX configuration for a domain with Google Apps GMail

Now you’re done – hopefully your emails should instantly start working!

Flyer: Bacchus In Rehab

// October 6th, 2009 // No Comments » // Creative

Quick flyer design for my friend Andy‘s new play, Bacchus in Rehab:

It’s a shame to have to spoil the photo with so much text, but on an A5 flyer there’s not much room…

Photo is of SP and Emma, ostensibly naked in the bath, which was a highly amusing shoot to do – colour is from a green gel on a weakly bounced flash (off door to right) contrasting against candlelight.

The bits of the play I’ve heard so far are hilarious, so if you’re near Camden between 24th November and 13th December you’ve really no excuse not to go!