Mitch Hurwitz – How to get a show cancelled

Some excellent advice from the creator of Arrested Development, including:

Add a sprinkle of incest

They'll never admit it, but viewers love sex. In fact, they love any sort of titillation, with the exception of incest. So focus on that.

Massive Lego marble run

Fabrice Bellard – JavaScript emulation of a PC running Linux

Fabrice Bellard is famous within the Computer Science world for various impressive contributions, including the Tiny C Compiler (tcc), founding the FFmpeg project, and calculating Pi to 2.7 trillion places on a single desktop PC.

Now he has created a PC emulator written in JavaScript that runs in the browser.

Rome – an interactive music video in WebGL

Various screenshots from Rome

Some clever use of 2D videos and realtime 3D graphics.

Needs a WebGL enabled browser like Chrome or FF4 or Webkit Nightly.

Robin Houston on mazes

A selection of 3x3 weave mazes

Following on from Jamis Buck's posts on mazes, Robin Houston has started writing on the subject:

I started to think about mazes after reading Jamis Buck’s excellent series of posts, and found that mazes lead quite directly to some interesting mathematics and some remarkable algorithms. So I’d like to share some of that here.

Definitely worth a look.

Also see his post "The worst algorithm in the world?"

Leaving the Forestry Commission

Silvan House, The Forestry Commission Headquarters

Tomorrow I will have been working at the Forestry Commission for four years, and two weeks today is my last day.

I'm really excited to be moving on to something new, but it's going to be so strange, and quite sad, not seeing those people every day. And it's the people that have kept me there this long. Easily some of the nicest, friendliest people I could have hoped to meet, they've made the last four years a lot of fun. Thank you.

Introspection at the Scottish Ruby Conference, 2011

I woke up on Sunday morning, the morning after the Scottish Ruby Conference's after-party, and Lindsey asked me how the conference went. I found it hard to provide an answer that really described how I felt.

Scottish Ruby Conference T-Shirt photo by urgetopunt

It's been almost a week now and I've had some time to reflect on it.

The tutorial day on Thursday was great, and right at my level. Everything that Chad and Keavy talked about was either new or contained enough information that I learned a little bit more about something that I already knew (if I'm honest it was mainly the former!). The information was so well presented that I feel like I've retained a lot of it despite it being pretty complicated in places.

Dave Hoover's opening keynote on Friday focussed on self-improvement and set the tone for the rest of the conference. I hadn't been sure which talks I would attend, but after the keynote I made an effort to focus on self-improvement-related talks.

All of the talks I went to see were great, but a few in particular seemed very well suited to me, including Alan Gardner's talk on test-driving our personal development, Joe O'Brien's talk on being an accidental business owner, Gustin Prudner's talk "Ruby makes you happy" and Keavy's talk about giving your career a health-check.

I could go into more detail about each of them, and others, but I won't just now!

After last year's conference I regretted that I hadn't talked to as many people as I could have. Even though I can seem outgoing at times I find it difficult to approach people, but I made a concerted effort to strike up conversations with people and I think it went well. I met a lot of great people at code(food,bar) (thanks Sam) and at the after-party I had some really great conversations with Joe, Chad and a few others.

Chad delivered a great closing keynote, and one thing that he said that really opened my eyes was that, after he had gone to a conference and met some extraordinary people, he had realised that the only way that he could be around those people all the time was to become one of those people.

This point, along with everything else, has really made me think about what I'm doing, why I'm doing it and where I'm going. I'm going to have to take some time to figure it out. I've started reading The Passionate Programmer based on several recommendations so I hope that helps.

All in all, I'm still finding it difficult to succinctly express how much I enjoyed the conference. It was fantastic and I met so many wonderful people.

So, thanks very much Paul, Alan and Graeme for organising it, it was great and I can't wait for the next one!

Terrain generation source code

After my previous post on terrain generation I got a few requests for the source code, so I've made it available on GitHub.

I'm still learning CoffeeScript, as well as terrain generation, so if you have any advice on how to make my code any cleaner or more idiomatic then I'd love to hear from you. Either at paul [at] or @baxt3r.

Terrain generation with the diamond square algorithm

Lately I've been playing with the diamond square algorithm, a fractal algorithm that's pretty good at generating realistic looking terrain.

I started in Ruby initially but, inspired by Jamis Buck's excellent maze algorithm visualisations, I decided to rewrite my work in CoffeeScript. It's still a work in progress but I figured I'd show what I had so far.

The diamond square algorithm works on a 2D array that's 2n+1 square, and needs the four corner points of the array to have a value set before it starts. All the other points in the grid have no value, but in the visualisation below I've displayed the points as though they were set to zero.

I've also drawn polygons between the points to make the visualisation look a bit clearer.


The first thing that the algorithm does is set the centre point by averaging the four corner values and adding or subtracting a random amount of noise. This is the 'diamond' step.

The next thing that the algorithm does is set the four mid points between the corners, i.e. North, South, East and West, by averaging the two values on either side of the point in question and adding or subtracting a slightly smaller random amount of noise. This is the 'square' step.

Clicking 'step' above will go through one diamond and one square step.

After these two steps are complete there will be nine points with values set; the four corner points, the centre point, and the four midpoints between each corner point. This means that we can split the starting array into four smaller arrays and call the algorithm again four times, this time reducing the magnitude of the noise applied.

The process continues on until there are no empty points left in the grid.

The whole process runs extremely quickly, even in the browser, so I've added a delay between each step when the 'run' link is clicked.

As I said before, it's a work in progress, so if you encounter any bugs or think I should try something different then send me an email at paul [at] or send a tweet to @baxt3r.

Update: See my next post for links to the source code.

Fez gameplay from PAX East

Fez is a 2.5D platformer by Polytron where you rotate the gameworld by 90° at a time. It looks and sounds great. I plan on buying this when it comes out for Xbox Live Arcade.