Bye bye blogspot!

After a few years using google's blogspot, I have now moved my blog to my own hosted site. Here's a new post describing what my blog set-up is. Please update your bookmarks and feeds accordingly!


Day 1156

The following story is fictional and entirely unrelated to my PhD research...

It's been 1156 days since I first arrived in the land of phud. I arrived on a ye olde and grande ship with a welcoming committee cheering my arrival. I was welcomed as an equal having just graduated with highest honours. These people in the land of phud all seemed so wise and what lay ahead was mysterious and exciting. I spent the first 300 days looking around my new home, examining the ground stones laid by many before me and finding a spot to build my own wondrous sculpture. I had written up the plans and documented thoroughly my understanding of this place and was granted permission to begin building.

First, I thought, I would build a small scale replica, in order to detect any hidden flaws in my design. This took a lot longer than I expected and another 300 days later I had finished it. It was only then that I started to build my showpiece -- my home in the land of phud.

The base and ground stones were a piece of cake, or so I thought. Cracks begun to appear early on, and much effort was put into filling them. But the fixes were quick and dirty, and sooner or later the cracks would come back and threaten the stability of the structure. Once the base was finished it was time for the main event, a wondrous tower upon which I would live. But this was a dream, and reality got in the way. The tower was built of precious stones, each more rare than the last. I ventured far and wide to find these minerals, and upon the discovery of each I was replenished with motivation to find the next. Each element of the tower required careful placement, but the cracks in the base were mischievous and repeatedly threatened the whole structure. The introduction of a new element required adjustment and realigning of base. This scenario repeated over and over (and over) again.

Looking back at my plans I see the tower was supposed to be 50m high. Looking at it now I see it is barely 10m. I've been trying to place another element for many months, but the tower is becoming increasingly unstable. I fear that I have no more strength to lift the remaining stones. When I am awake at night I see a bright light shining from out over the water. This light promises a new life. Maybe I'll pack up my family and set sail again ...


Behind the site..

Up until yesterday I was using a system called tahchee to generate my website. Tahchee is a website compiler. You give it templates and content and it generates static website pages. In my case, I had a single template that models a page with a header, navigation bar, content, footer. Each actual page on my website, e.g., http://bp.io/s/sds is generated by applying this template to a simple file that contains the content. The content was written in a wiki-style markup called kiwi, which then gets converted to HTML. An example of the syntax is:

Simplicial Developmental System

Hello, this is a description of the simplicial developmental system, blah blah.

 - Point 1
 - Point 2
 - Point 3

I said farewell to tahchee yesterday. It's a great system but it hasn't been updated in a while, and now it seems a few bugs have creeped in -- let's call it old age. Tahchee operates by gluing together some other technologies, like Cheetah templates and Kiwi markup, and adds a build system to simplify combining them all together. I decided to manufacture my own glue, and it only took a day.

First, I looked around the net at the myriad templating engines. I enumerated them all and rolled a 47 sided die. It came up with Jinja2. Jinja is a general templating engine, you can use it to generate HTML, tex, txt, css, cpp, or whatever you want that is ascii/unicode based. It is available as a python library, and its syntax is similar to cheetah and all the other engines out there. A simple html template could be:

  {{ message }}

In your python program, you then execute something like:
template.render(message = "Hello there!")

And you get:

  Hello there!

That's the gist of templating engines and Jinja. The bulk of the work I had to do was to write the build system. I designed the directory structure of the source for my site as follows, this is pretty much exactly how tahchee has it.


The makeit.py script first loads all the templates from the templates directory. It then walks through the pages/ directory looking for files that are appended with an underscore (this is my way of distinguishing between files that need to be processed with Jinja.) It then runs the files through Jinja, creating a processed file without the underscore. For example _index.html will be processed and then saved as index.html. The directory structure of pages/ is mirrored in the build directory, and any files tht don't need to be processed are copied as is. My pages/_index.html looks like the following.

{% extends 'base.html' %}
{% set title="bp.io" %}
{% block main_content_md %}

This is the project site of Ben Porter. Currently, I'm working on my PhD project: [SDS]({{ base_url }}/s/sds). Other things you'll find here are my blog, my public code repositority, and various programs and games I've written over the years.

{% endblock %} 

The content is written in Markdown, which is very similar to Kiwi. To add support for Markdown was trivial using Jinja2's support for filters. You can also see that you can mix in regular html and markdown will ignore it. I also pass all the generated html through HTLMTidy in order to fix any bad markup and to also lay the html out nicely (useful for debugging the engine.) If you view the source of my website, you can see it all nicely laid out. :) (Is someone screaming nerd right now? If so, I'm happy you've made it this far, but now is the time to rage quit!)

The layout of my site is now done using the Blueprint CSS Framework, which offers helpful grid-based layout support, some nice typography, and some cross-platform neutralisation. I will eventually incorporate some css into my site generator, in order to make it easier to maintain and change the palette and style.

The last piece of glue is the build system. I have been using scons for a little while now, including in my main project (courtesy of BV), and so it was an obvious choice. I have a simple scons script which makes sure the makeit.py template runner is executed, and then it copies over the remaining pieces, such as assets/ which stores all the static content such as the css and images. Oh, and lastly, it's all versioned using hg.

I have moved my website hosting over to a VPS (linode). This is so I can do some more complex server-side thingymajigs, which my last shared website host did not really support.


SDS-Blender delayed

Just a quick note, I've decided to delay the release of my generative organic software until later this year, probably around the end of the year. This is because of two main reasons.

Firstly, as the software depends on the latest in-development build of Blender, I want to wait until at least the scripting API of the software is frozen and stable. The Blender team is working hard on the 2.5 release, and I think at the moment they are working on the scripting API, so finger's crossed.

Secondly, my own workload has increased significantly as I'm trying to get new results, write a paper, and write my thesis. My submission date is < 6 months from now, and once I've submitted I'll have some time to adapt my software to fit Blender's latest scripting interface. Luckily, Bart, who built the interface between SDS and Blender, did so in an excellent manner and so adapting to the new API shouldn't involve much work at all.

Also, my backup hdd is now playing up ... is a PhD = the work you do between all the things that go wrong??


Sleep is death

Jason Rohrer's latest game appeared out of nowhere for me. It's a role-playing/interactive fiction tool with which two people can create a story together. The controller of the game concocts a story, makes the artwork and music, and then controls a set of scenes to make a story. The player is assigned a character and can move, speak, or apply verbs to things, like pick up, etc. The controller and player take turns, both adapting to the actions of the other, with the controller generally trying to take the story on some intelligible narrative arc, or not. Here's an example game that has been played.

I've been thinking about this type of game ever since reading a book called Diamond Age by Neil Stephenson. A game where a person, or persons, in real-time direct out the game that a player or many players are taking part in. As an alternative to creating smarter AI to direct our games we could spend time developing tools and a culture of humans directing games. In the future, could their be an equivalent of a highly paid movie director whom directs games in real-time? I can't see why not.

Anyway, back to Sleep Is Death!


The end in sight

I started my PhD research in March 2007, over 3 years ago. It's been a long, strange, and lonely journey, but it's almost done! I'm on the last stretch now, and hopefully will have submitted my thesis in 4-6 months. Here's my latest simulation and it is typical of the kind of result I have for my thesis. Not quite what I had in mind when I started, but this part of my life needs to end soon and I have to move on to the next thing. : )

A growing tentacled thing in a box. from Benjamin Porter on Vimeo.
More geometric morphogenesis.



I have moved my website to a new location: bp.io (because it's oh so cool to have really tiny urls and means that I need only remember 4 characters -- the limits of my memory.) This blog also has a new location: blog.bp.io.

The top-level (io) stands for the British Indian Ocean Territory that has a population of 4,000. They've opened up the .io top-level domain for international registrations, like the Cocos Islands (.cc) and many others have done. It's now big business for small countries with cool abbreviations to do this. And it's lucrative ... consider the €60 I just paid for one year's registration, compared to about €5 a year for a .net.au or .com, etc. Thinking relatively though, it just means that I have one less cafe latte every week -- which is a good thing.