Topics › Python

  • strict warning: Non-static method view::load() should not be called statically in /home/peco/webapps/dp6_peter/sites/default/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /home/peco/webapps/dp6_peter/sites/default/modules/views/handlers/ on line 744.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/handlers/ on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/handlers/ on line 607.
  • strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with views_handler_filter::operator_form(&$form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/modules/node/ on line 13.
  • strict warning: Non-static method view::load() should not be called statically in /home/peco/webapps/dp6_peter/sites/default/modules/views/views.module on line 906.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /home/peco/webapps/dp6_peter/sites/default/modules/views/plugins/ on line 24.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/plugins/ on line 134.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/plugins/ on line 134.
  • strict warning: Non-static method view::load() should not be called statically in /home/peco/webapps/dp6_peter/sites/default/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /home/peco/webapps/dp6_peter/sites/default/modules/views/views.module on line 906.

Crude matrix multiplier

[Update: A slightly more sophisticated Javascript version of my program is available to use here]


I'm very excited that my paper (cowritten with Steve Kelly) on MergeAlign has finally come out in BMC Bioinformatics. We managed to time things well, so the website we've created - - is also up and fully functional.

Converting a python list to an SVG path

Here's a short snippet of Python code that was I very pleased with. It converts a list of coordinates, such as this:

[(10, 200), (12, 220), (15, 180)]

Into the d attribute of an SVG path, such as this:

"M10 200 L12 220 L15 180"



Image Processing with Pygame

Tutorial for how image processing works, using Pygame (and Numpy) as an example.

Experimenting with the Khan Academy API

In the last month or so, I've managed to more than triple the number of Earth badges I have on Khan Academy just by focussing on getting the Sub-light Speed and 299,792,458 Meters per Second badges, particularly on the simple exercises. I worked out on which exercises to focus by creating a spreadsheet of all the exercises and all the badges I had for each exercise. I filled out the spreadsheet with a combination of screen-scraping and manual data-entry.

SVG optimiser

I've started work on a program I've been meaning to make for a while: an SVG optimiser. I've often found myself spending a lot of time tidying, simplifying and compressing SVGs created by Inkscape or Illustrator. Sometimes, changes are merely aesthetic, e.g. reducing numbers from an unnecessary six decimal places to one, or removing unused attributes. These changes make it easier to read the file, and can reduce its size noticeably. Other changes are more practical, such as removing transforms which otherwise make it difficult to see where paths and shapes are actually placed.

Simulating a demand curve

Recently, I've been watching the new microeconomics lectures at Khan Academy, which got me thinking about creating an economics simulation, something I've thought about many times. Specifically, I was wondering about how to come up with a reasonable demand curve. They always seem to be drawn as a straight line but with no justification other than simplicity.

How to get black hole badges on Khan Academy

The Black Hole badges are Khan Academy are legendary and unknown, so a lot of people want to know how to get them. The code describing what they are for used to be available here, but that code is out-dated and says that the Atlas badge is for completing 150 exercises.

Pygame particle simulation in 3D

Below is a video of my first attempt to move my Pygame particle simulation into the third dimension (thus combining it with my Pygame 3D tutorial). I meant to write about it a while ago, but got distracted trying to work out how to display an image rotated in three dimension (for the walls). I still haven't worked it out.

Cell evolution game - basic interface

Today I started to make a game that I've been thinking about for a quite a while now (I mention it here). The general idea is that you play as a single-celled microbe which evolves ever more complex metabolic and regulatory systems as it moves to ever more challenging environments.