WebGL Shader Toy

Animated fractal graphics using WebGL

This was fun until it crashed my nightly WebKit build.

Japan quake map

The most terrifying Google map I have ever seen.

Planetarium by Firefox Labs

The solar system

Another great demo from Mozilla.

The Plumen lightbulb wins Design of the Year 2011

The Plumen lightbulb

Letter Heads by Firefox Labs

Letters arranged so that their shadows look like a head

A really cute demo by Simurai of what's possible with CSS3 and web fonts.

Upgrading to 1.9.2 – Invalid byte sequence in US-ASCII

The site was down for about a short while today while I migrated to the Bamboo stack on Heroku which runs Ruby 1.9.2.

Testing locally using rvm showed that a few changes would be necessary to my code in order to get it to work.

The biggest problem that I ran into was that the default method of opening files in Ruby is now US-ASCII, meaning any multibyte UTF characters in a file will cause ruby to throw errors by default.

Initially I figured that doing a find and replace on certain commonly used non-ASCII characters would be enough. For example, I tend to liberally use em dashes (—) so I replaced all instances of em dashes in my markdown files with the HTML escaped version.

While this was enough to satisfy ruby on my local machine, trying it on Heroku caused ArgumentError - invalid byte sequence in US-ASCII in the part of my model that loads and parses files.

I tried to track down which characters were causing this error and found

  • — (—)
  • ’ (’)
  • ® (®)
  • £ (£)

Upon reaching the pound sign I decided that a far more sensible approach would be to instruct ruby to always load files in UTF-8 format, so I changed this line:

f = File.open(matches.first)

to this

f = File.open(matches.first, "r:UTF-8")

which solved the problem.

Katamari any webpage

A Katamari all up in my blogs

Axel Leone, David Nufer, and David Truong have created an awesome bookmarklet to add a Katamari to any webpage.

It works best in Chrome or Safari.

Try it out on this page or go to his website to get the bookmarklet.

"Written for people to read"

In the Preface to the First Edition of the Structure and Interpretation of Computer Programs Abelson, Sussman, and Sussman say:

Our design of this introductory computer-science subject reflects two major concerns. First, we want to establish the idea that a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute.

Whenever I program I try to keep the above quote in mind.

Lego Carcassonne

A Carcassonne board made out of lego

Cal Henderson designed this clever Carcassonne board out of Lego pieces.

Sadly it hasn't been built in real life, this is just a 3D render.

Vintage Future – a tumblr of retro visions of the future

Some sort of subterranean moon dwelling

Image © Avi Abrams

As a child I spent hours designing space stations and moon bases, imagining what it would be like to try and build a colony on another world. I'd use old Usborne books, with exactly these kinds of pictures inside as references.

What's surprising is not that predictions of the future made 50 years ago turned out to be wrong, but how much actually has been achieved in such a short time.

We might not all be living on the moon but the present is still a pretty amazing future.