More fun with QR Codes and the BBC logo

Add post to deliciousMarch 12th, 2008 @ 22:38 comments(10)

After what has been the most strange of days, I thought I’d write a little bit more on the QR Code work I have been doing for /programmes. This is a bit of a sneak preview, as the work will not be pushed out live for a little while as we try and fix a potential bit of memory corruption found in one of the binaries we were using.

So, I mentioned in a post not long ago that I had been working with QR Codes, and that I wanted to extend the current offering we have, which is just basically a simple implementation of a clever Japanese guys JavaScript library. I was also interested in the embedding of images in QR Codes, as displayed on the wikipedia page. This is possible due to the Reed-Solomon error correction code written into the QR Code encoder. This allows up to 30% deterioration of a QR Code possible with it still being readable.

So armed with that knowledge, and a bit of tinkering in Photoshop, we came managed to come up with a solution that was still readable by a QR Code reader and also incorporated the BBC logo in a clearly readable form. I think you’ll agree, it came out quite nice? We were quite lucky as the simple geometry of the BBC logo was ideal. QR Code (bbc.co.uk/programmes)The next thing was to coderize (patent pending) our Photoshop mock up. I had a few choices, I could use Image software to merge the logo and the QR Code, I could write the logo first and the write out the QR Code data around it (this would be the ideal solution to be honest), but I adopted for, reduce the Image to be 1:1 pixel:data ratio, adjust the logo so it fitted, then create a matrix of the logo data. This way I had a kind of BBC logo blueprint I could scale up to whatever size the QR Code image needed to rendered at. Below is the matrix based on a min image size in pixels of 39×39.

It was then just a matter of drawing this information over the top of the QR Code image information and writing out the file, which as it turns out, does not appear very CPU intensive, as it’s a simple image construct, that along with the Squid caching we have in place means the server load is minimal.

So what we’ve ended up with is below. I’m really pleased with the results and look forward to the code going live.

QR Code (bbc.co.uk/programmes)

Oh and for the benefit of people who don’t have access to one of the many free QR Code readers for mobile phones, the logo above decodes to bbc.co.uk/programmes

[Update] Just got a nice mention on the 2-d code magazine site. Also, good to see other people are liking the work.

Filed under: BBC, Experiments, qrcodes


iphone simulator seems to send the wrong user agent

Add post to deliciousMarch 7th, 2008 @ 13:40 comments(3)

The new iphone simulator (part of the iphone SDK) doesn’t seem to send the same User-Agent as a normal iphone, so any sites that use content-negotiation don’t appear on it. I would have thought it should send ‘(iPhone; U; CPU like Mac OS X; en)’ but instead it sends ‘Aspen Simulator; U; Apsen 1_2 like Mac OSX:en_us’. This seems like an oversight? What do you reckon?

iphone simulator

Filed under: Apple


rQRCode, a Ruby library for encoding QR Codes

Add post to deliciousFebruary 24th, 2008 @ 15:37 comments(6)

[Update]
I have also posted a bit more about the upcoming QR Code work for BBC /programmes.

We implemented QR Codes on /programmes (A project I’m one of the Software Engineer’s on, at the BBC) a few weeks back. They’ve been talked about since so I won’t repeat things, only to say it was a simple implementation using a JavaScript library by Kazuhiko Arase and took all of 5 minutes of my lunch hour to add. It started as an email by colleague Michael Smethhurst asking if we could/should implement them, and was also the first I had really heard of them.

Since then, I have done lots more research and think there is great mileage there for promotional material and advertising. At the moment the codes are built on the client side, but this will be moved to the server soon so we can start caching the pages, and also so we can provide the code in a more useful format (maybe images instead of the current HTML table).

So to the point of this post. During my research to understand QR Codes more and because of the lack of readable spec (Anyone know if there is one?) I decided to reverse engineer the JavaScript library into a Ruby Gem as there didn’t seem to be one out there. This helped me understand the how QR Codes are encoded, while at the same time giving something back for other people to use.

Anyway, it’s now done and there is a rQRCode Rubyforge project setup. You can also view the rRQRCode documentation (still to be improved) or just jump straight into installing the gem.

A quick simple example in the console:

Also, here is a quick example of using it in a Ruby on Rails project:

So that should get you going. I’m have some interesting features I working on adding so expect lots of updates over the next few weeks. Enjoy!

Filed under: BBC, Ruby, gems, qrcodes


Hidden session saver in Safari 3.0

Add post to deliciousOctober 31st, 2007 @ 12:49 comment(1)

Blimey, this is strange. I haven’t written anything here in a long while. I have meant to as I’ve been doing loads of fun stuff, I just don’t seemed to find time not to do the fun stuff and write about it.

This is a small tip that I find useful and others might. I had always thought that Safari never had a session saver (something I really use in a browser as I always have many tabs open waiting to be looked at). It turns out that in Safari 3.0 this is already in there just slightly hidden away. If you go to the History menu item there are 2 options [ reopen last closed window and reopen all windows from last session ]. It would be nice if you could choose to reopen when the app reopens (maybe you can, anyone know?)

Session Saver

Filed under: Browsers, Safari


BBC Radio facebook app

Add post to deliciousJune 24th, 2007 @ 13:34 comments(2)

Update It’s now running on it’s own EC2 instance using Apache and Mongrel. So far so good.

I’ve been playing with facebook recently and have built my first app. It simply lets you display your favorite BBC Radio channels in your profile with a link to play and information about who’s currently on. Go install it and let me know what you think.

BBC Radio in facebook

It’s a rails app that uses the BBC Web API (beta) to find all the schedule information. In order to push all the updated show info to facebook there is a cronjob running that in-turn runs a rake task in my rails app to look for new data. If it finds any it pushes that data to handles within my facebook app’s namespace and each users profiles fetch data from these handles.

It has been a bit of trial and error along the way due to facebooks API being very new; Their documentation being lacking and incorrect at times, and Oh, their crazy session handling. I’m sure these things will be addressed in the future. They use a push system when it comes to showing stuff in people’s profiles. So in order for me to stop making more and more requested to facebook’s server every time a new user, and networks chosen, I’m using the handler approach of sending data about each network to facebook. The users profile then just collects the network info from facebook when it needs them. This means that hopefully the app won’t die the more people use it (saying that it dies already once, but that was out of my control). It’s actually running on one mongrel instance at the moment until I sort out mongrel clusters and apache proxy forwarding. Not ideal but we’ll see what happens.

I can see why the likes of flickr and lastfm have not created crazy apps yet. In fact I don’t see how they can currently. Without posting info about every user up to facebook every few minutes their apps are gonna struggle to be useful.

Filed under: BBC, Radio, facebook


Hackday imminent

Add post to deliciousJune 14th, 2007 @ 12:44 comments(0)

This weekend is hackday in London. I’m looking forward to it as it will be my first. It’ll be nice to catch up with people I haven’t seen in a while as well as building some fun stuff. We have a whole load of extra music related feeds available on the day which are normally internal, so we’re hoping people are going to build some fun stuff with them.

Filed under: BBC, Yahoo, geek, hacking


Show Us Your Gems

Add post to deliciousFebruary 12th, 2007 @ 16:12 comments(0)

What a good idea. Here’s what I have installed currently:

$ gem list|grep '^[a-zA-Z]'
actionmailer (1.3.3, 1.3.2)
actionpack (1.13.3, 1.13.2)
actionwebservice (1.2.3, 1.2.2)
activerecord (1.15.3, 1.15.2)
activesupport (1.4.2, 1.4.1)
acts_as_versioned (0.2.3)
amazon-ec2 (0.1.0)
builder (2.0.0)
camping (1.5.180)
camping-omnibus (1.5.180)
capistrano (1.99.1, 1.4.1, 1.4.0)
cgi_multipart_eof_fix (2.1)
daemons (1.0.4)
deprec (1.3.1)
fastercsv (1.2.0)
fastthread (0.6.3)
ferret (0.11.2)
flexmock (0.6.1, 0.6.0, 0.5.0)
gem_plugin (0.2.2)
highline (1.2.7)
hoe (1.2.0)
hpricot (0.5)
map_by_method (0.6.0)
markaby (0.5)
metaid (1.0)
mocha (0.4.0)
mongrel (1.0.1)
mysql (2.7)
needle (1.3.0)
net-sftp (1.1.0)
net-ssh (1.1.1, 1.1.0, 1.0.10)
railroad (0.3.3)
rails (1.2.3, 1.2.2)
railsbench (0.9.2)
rake (0.7.2, 0.7.1)
rb-appscript (0.3.0)
RedCloth (3.0.3)
rfacebook (0.6.2)
rmagick (1.15.6, 1.15.2)
rspec (0.8.2, 0.7.5.1)
ruby-openid (1.1.4)
ruby-yadis (0.3.4)
rubyforge (0.4.1)
sources (0.0.1)
sqlite3-ruby (1.1.0.1)
stemmer (1.0.1)
termios (0.9.4)
test-spec (0.3.0)
what_methods (1.0.1)
xml-simple (1.0.10)

Filed under: Ruby


Money Shot

Add post to deliciousDecember 30th, 2006 @ 14:21 comments(0)

This made me chuckle:

Money shot

Filed under: Fun, Flickr


Amazon Christmas nightmare .. rant

Add post to deliciousDecember 12th, 2006 @ 10:59 comments(0)

UPDATE The goods arrived this morning! It still says on the Amazon site that they will not arrive in time for Christmas. Although I’m pleased the goods have come, I still think Amazon have a bit of work to do with their handling of these situations. How many people I wonder, HAVE had to go and buy replacements because they don’t know if they’re gonna get their stuff in time.

I ordered loads of my presents this year from Amazon as I normally do. I placed the order on the 3rd December, plenty of time I thought. But this time instead of all my nice things arriving, when I tracked my orders it told me that my items would not be delivered until AFTER 25th December. AAhhhhh!

Once I calmed down a bit I thought, ah-well I’ll just cancel it, and by buy them via the high street. Alas no! my order had reached the dispatch process (Amazon speak for you’re f##cked). So I thought I’d drop them an email. I got a reply from them this morning in true automated email style, basically saying you’re f##ked.

I’ve been a loyal Amazon customer since day one and to say I’m disappointed with them is a huge understatement. I have to now buy the goods again, and return the Amazon good when they arrive, which is a right royal pain in the arse.

I’m going to seriously have a think on whether I will use Amazon again after this. Does anyone else out there have a similar story? I can’t believe I’m the only one.

Filed under: amazon, rant


Whomwah RSS uses feedburner … at last

Add post to deliciousDecember 6th, 2006 @ 00:17 comments(0)

I finally got round to letting Feedburner handle the RSS feed for this site. It’s such a simple process, I had just never got round to it. If you do happen to subscribe to the feed for this site, could you please update the feed url to http://feeds.feedburner.com/whomwah.

Filed under: Feeds, feedburner, rss


Back to top of page