Displaying articles in the web development category

Virgin racing F1 Site Launched

This week Poke launched virginracing.com, which is a beginning of the online experience for the new Virgin formula 1 team.

Richard Branson Viginracing

Timo Glock

Virgin Partner

Make your own tracks with The Sound of Orange Rockcorps

During the past couple of months I've been working on this Poke project for Orange. It's an amazing feat of web technology where you can record your own sounds and have them mashed up with your friends into songs.

We built this project using a Django backend, Sox, lame, ffmpeg and aubio for audio processing, amqp-js for realtime communication between flash and the server, red5 and an IVR system for note recording and lots of glue in the form of RabbitMQ.

For the song playback we use Standingwave, an open source AS3 library for sequencing and synthesising sounds.

Be sure to check out the auto tuner and phone recording, it's special. =)

Here's my incredibly silly attempt on Ting tings - That's not my name:

This is the original

I dare you to go make a better one! The Sound of Orange Rockcorps

Girl, most associated with Trouble

Brushing up on natural language processing (NLTK) and saw this amusing example from the Brown Corpus.

Seems like Trouble is for a Girl what Butter is for Bread.

girl trouble

Amazon recommends switching from EC2 to Google App engine

Having used the Amazon web services hosting stack for a while, this email felt quite ambiguous.

Amazon email 1

Balloonacy videos and Webby awards

I just found some fun little videos I made about a year ago when we did the Balloonacy game.

Timelaps video

Made from screenshots of my blog over a few hours time

40,000 balloons in 22 seconds

The second one is a speed run through the map and most of the balloons on it. It looks a bit mental in the middle.

(Thanks Gav for wicked AF skills)

Map + Balloon data visualisation

This is more geeky and it's showing the basic data structure we used for the race map and some rainbow portals and balloons. It was rendered using Ubigraph.

I have no idea why it got such bad framerate when transcoded by Vimeo.

Vote for us in People's Voice!

Balloonacy is nominated in three categories in the Webby Awards. I'm super thrilled about this and I'd love it you helped us win! Sign in at the People's Voice and in the Website section, balloonacy can be found under Services > Telecommunications. In the Interactive Advertising section balloonacy is under Game or Application and Online Guerilla & Innovation.

Fresh tweets straight out of the oven

Yesterday we installed Bakertweet at Albion right across the road from work.

It's a little Twitter box hanging off the wall telling followers when fresh bread is coming out of the oven!

bakertweet demo

@aszolty did a great job with the arduino that talks to our bakertweet website, that in turn syncs the freshly baked croissants to twitter.

bakertweet

If you like your buns hot, and are stationed around Shoreditch, go to Twitter and follow @albionsoven.

It's time for a good old book burning ceremony

We're having a clear out of some old programming book at work. A part of me feels a little weird about throwing away books, it's sort of something you just keep, forever. But don't worry, we're getting some brand shiny new web3.0 books to fill the holes in the bookshelf. ;)

Here's an excerpt from Spainhour & Quercia's Webmaster in a Nutshell (First Edition 1996):

This is a book that needs no introduction. By this time, if you don't know what the World Wide Web is, then you probably haven't heard of Rollerblades, VCRs, or Boris Yeltsin either.

programming books

Character encoding hell: Converting MySQL latin1 to utf8 for use in Django

This is one of those problems that developers like to pretend doesn't exist. Until we actually have to deal with it of coarse. What I'm talking about is Character encoding hell. Lots of programmers (me included) have many times spent endless hours trying to figure out the mysteries of garbled text. So the reason I'm writing this blog post is to maybe help one or two people out there that are trying to do the same thing as I did today. Converting a MySQL database full of Swedish text (latin1) to a more manageable utf8 format.

We basically have different character encodings* because we have lots of different spoken and written languages in the world, and it was hard for the brilliant computer scientists back in the day to get it all right the first time.

*Note: Please read A tutorial on character code issues for a fuller explanation on character encodings.

The problem

I've got a MySQL database dump containing some 5000 products with descriptions all written in Swedish. As you might know Swedish contains characters like å, ä and ö. The database was also using latin1 as it's character set. So when firing it up in the Django admin I got something looking like this:

Mysql latin1

I spent about 5 hours trying to get this to display correctly. Django rightfully uses utf8 throughout, so converting my database to utf8 should take care of the problem?

alter database DATABASE_NAME charset=utf8;

No, it's not as easy as that, because when we convert the database to utf8, the data within stays the same. So what if we convert the table and the field?

alter table TABLE_NAME charset utf8;
alter table TABLE_NAME modify FIELD_NAME varchar(255) character set utf8;

No no, nothing changes, it's all the same garbled mess. So how can we get MySQL to actually convert the content?

The solution

Convert the field to BLOB. That's right, the first thing we need to do is converting the field type to a binary type. Then we change the character set of the database to utf8, and lastly we convert our field back to text or varchar.

alter table TABLE_NAME modify FIELD_NAME blob;
alter database DATABASE_NAME charset=utf8;
alter table TABLE_NAME modify FIELD_NAME varchar(255) character set utf8;

This forces MySQL to convert the binary format into varchar using character set utf8.

Mysql utf8

This trick should work regardless if you're using Django or not, that's just what I happened to be developing in. And telling Django to use a different character encoding is, from what I've heard, a nightmare.