Site Redesign

I’ve just updated the design of this blog, re-enabled comments and added a contact tab. I’ve installed a strong anti-spam comment filter, but you should now be able to comment on entries. I’ve also changed the layout of things slightly, and made it easier to read.

January 14, 2010 · 1 min · David Craddock

PHP Sample - HTML Page Fetcher and Parser

Back in 2008, I wrote a PHP class that fetched an arbitary URL, parsed it, and coverted it into an PHP object with different attributes for the different elements of the page. I recently updated it and sent it along to a company that wanted a programming example to show I could code in PHP. I thought someone may well find a use for it - I’ve used the class in several different web scraping applications, and I found it handy. From the readme: ...

January 14, 2010 · 3 min · David Craddock

Passed the W3Schools PHP Certification

As a break from my contract work, I took the W3Schools PHP Certification. I didn’t do any revision, which probably wasn’t wise. It was a bit more difficult than I thought, but I passed still.

January 14, 2010 · 1 min · David Craddock

Config files for the Windows version of VIM

Today I encountered problems configuring the windows version of the popular text editor VIM , so I thought I’d write up a quick post talk about configuration files under the Windows version, if anyone becomes stuck like I did. I use Linux, OSX and Windows on a day-to-day basis, and VIM as a text editor for a lot of quick edits on all three platforms. Here’s a quick comparison: Linux Linux is easy because that’s what most people who use VIM run, and so it is very well tested. ...

January 10, 2010 · 5 min · David Craddock

Speed Climbing

I’m going to take a break from the purely technical posts to get more people to see this video. Here the late Dan Osman speed-climbs a cliff without any safety equipment. http://www.youtube-nocookie.com/v/Fpm0m6bVfrM&hl=en&fs=1&rel=0 Risky? Just a bit. A few years later he lost his life during a similar attempt. But no-one can doubt the guts required, and the level of skill he achieved, in this type of climbing.

October 17, 2009 · 1 min · David Craddock

Regex in VIM.. simple

There are more than a gazillion ways to use regexs. I am sure they are each very useful for their own subset of problems. The sheer variety can be highly confusing and scary for a lot of people though, and you only need to use a few approaches to accomplish most text-editing tasks. Here is a simple method for using regex in the powerful text editor VIM that will work well for common use. ...

October 7, 2009 · 5 min · David Craddock

Heart rate monitor now available for the XO Laptop

Volunteers on the OLPC project have developed a low-cost heart rate monitor that can be plugged into the XO laptop , making steps towards an affordable monitoring system for hospitals in developing countries. For more information on the development, see the: OLPC Goldenstate project. People in the US can currently buy the sensor here ; unfortunately there is no international shipping yet in place.

April 7, 2009 · 1 min · David Craddock

VirutalHosts on CentOS

A common task when setting up an Apache webserver under Linux, is writing a httpd.conf file. The httpd.conf file is the main configuration file for Apache. One of the main reasons to edit the httpd.conf file is to setup virtual hosts In Apache. A Virtual host configuration allows several different domains to be run off a single instance of Apache, on a single IP. Each host is a ‘Virtual host’, and typically has a different web root, log file, and any number of subdomains aliased to it. The virtualhosts are configured in parts of the httpd.conf file that look like this: ...

March 30, 2009 · 3 min · David Craddock

MicroKORG + Python = MIDI fun!

So, about a month ago I got a second-hand microKORG from Ebay. Fiddling around with the preset patches, and creating new patches is great fun, even though I only know a few chords. Recently I plugged it in to my PC via my M-Audio Uno USB->MIDI interface , and soon was using Ableton Live to program drums in time with the microKORG’s arp. I thought I’d experiment the music libraries available in python, and see if I could send notes to the synth via MIDI. Turns out that the M-Audio Uno is supported under Ubuntu, all you have to do is install the midisport-firmware package. With the help of pyrtmidi , a set of python wrappers around the C++ audio library rtmidi I was able to recieve MIDI signals in realtime from the microKORG, and send them in realtime also. With the help of this old midi file reader/writer library that I found posted to a python mailing list, I’ve made some progress in writing a simple MIDI file player that sends notes to the ‘KORG.

March 30, 2009 · 1 min · David Craddock

Eclipse 3.4.2 + Pydev + Eclim = win

So, after saying all that stuff about how vimplugin and EasyEclipse was great, I actually started to use the setup heavily, and it started to annoy me. For one, EE is not a recent build of eclipse, nor does it come with a full set of recent plugins. This makes it annoyingly difficult to use when you want to use more than the set of plugins it packages for you. As far as vimplugin goes, it does not provide the vim integration I thought it might from embedded vim. Not really even close. ...

March 27, 2009 · 1 min · David Craddock