PHP 5.3.0 Released!
If you’re still stuck in the old PHP 4 days, please please please take today’s release of PHP 5.3.0 as your cue to start learning about the wonderful world of object oriented PHP 5.
5.3.0 isn’t a hugely interesting release, but getting your PHP4 code compatible with 5 will ease the process when PHP 6 comes along. PHP6 is really where it’s at:
What’s out:
No more register_globals (finally)
No more magic_quotes (you kinda liked magic quotes? Admittedly it was handy, but when you think about it, having code that may or may not be sanitised depending on a php.ini setting is Bad Idea™)
No more HTTP_GET_VARS and cousins. Just change to $_GET etc and you’re fine.
What’s in:
A bunch of minor fixes aaand:
Namespaces – so we can section off bits of code properly. Woohoo! more info here.
Short post today I know, but I’ve got some real coding to do :) If you’re not doing anything better, go download PHP and have a play with it.
Adaptive Web Sites
Posted by user24 in Adaptive Web Sites on June 14th, 2009
(this is a slightly expanded transcript of a talk I gave at Oxford in June 2009 about my work there)
Hi! I’m Howard Yeend, my supervisor is Vasile Palade, and the title of my project is:
“Implementing Adaptive Web Sites using Machine Learning and Ajax“.
But before I talk about what all those buzzwords mean, I’d like to give a little background information about why this is an important research area, and why I feel it’s the right project for me.
When I was trying to think of a project title, I had a question in mind:
How can we improve the web?
And I think that’s a hugely important question for us to ask.
Facebook Username Vanity URLs
This has been brewing for quite a few days now, but when you next log in to facebook you’ll see that it’s official: We’re going to get usernames:
Backup your files in the cloud with Dropbox
Posted by user24 in Productivity, Programs on May 29th, 2009
How does 2 gig of free online storage sound? Well you can with this really sweet application! I’ve been using it for 6 months and it’s just great to be able to “set it and forget”; once a file is in my dropbox I know I can blow up my PC and still have full backups. That’s a good feelin’ :0)
Prevent RSI with WorkRave
Posted by user24 in Productivity on May 22nd, 2009

harness the healing power of sheep with Workrave
For the last few months, I’ve been using workrave on my windows machine to remind me to take regular breaks.
I know we’ve all seen similar software floating about the net for years, and like me you probably thought “oh cool, I’ll use that some day”. Well make today that day!
Honestly, it’s just a really nifty little app. Admittedly, most of the time I just hit “skip break” instead of actually taking the 30 second micro-break it suggests, but it’s there as a reminder that I should be taking breaks.
Hacking Facebook
Posted by user24 in Other Code, hacking on May 8th, 2009
Hacking Facebook with Javascript
Because facebook relies so heavily on javascript, and because we can type javascript into the address bar, that means we can “poke” into the workings of facebook to do things that we wouldn’t normally be able to do. It’s not “hacking” exactly, but it employs the same sort of skills hackers use when looking into applications. The best part is that because it’s all using the same control codes (or “API”) that facebook uses, there’s no way for facebook to find out you’re doing it, so it’s totally safe! (I think…) Besides, we’re not going to be doing anything too dodgy, just a few little tweaks ;)
Google Images Link Improver Wordpress Plugin
Google Images Link Improver improves the way visitors find your site by redirecting hits from google images to more relevant content on your blog.
Here’s an example of how it works on an actual google images result for “earthrise”. The user clicks the following images result:
… and here’s how the clickthrough page looks:
![]() Before Plugin Installation |
![]() After Plugin Installation |
PHP ImageStringRight / Center / Italic
PHP’s built-in ImageString function is OK, but I often find it lacking some of the basic features you’d expect. So I’ve created ImageStringRight, ImageStringCenter, ImageStringItalic, and a few other goodies for writing text to images in PHP.

Image String Enhanced!
Demo and source code after the break!
Read the rest of this entry »
PHP 4/5 Image Blur
It’s not something that people require very often, but occasionally the need does arise and you have to ask: how do I blur an image in PHP? Here is some PHP ImageBlur code that works on PHP4 and 5.
What we end up with is a small fast function that can take a source image and create something like the following:
![]() No Blur |
![]() PHP5 ImageConvolution |
![]() No Blur |
![]() PHP4 myImageBlur |
In PHP 5 you can just use ImageConvolution and the code example right out of the manual:
$gaussian = array(array(1.0, 2.0, 1.0), array(2.0, 4.0, 2.0), array(1.0, 2.0, 1.0)); ImageConvolution($image, $gaussian, 16, 0);
That’s a nice Gaussian blur in PHP5 for you. But what about your nasty old PHP4 servers? I have the answer. Actually the answer is probably “use ImageMagick and a system call”, but if you want a pure PHP/GD solution, read on.
Using a crafty mix of voodoo and ImageCopyMerge, you can create a PHP 4 blur effect that is virtually identical to the PHP5 method, as you can see by comparing the results of myImageBlur with ImageConvolution above. In tests on my local server, my method takes on average 0.43 seconds to blur a 1024*768 image, while ImageConvolution takes 0.40 – so it’s basically the same, and half a second to blur a desktop sized image is pretty decent – on a live server it’ll be even faster!
There’s some more comparisons and the source code after the break:
Read the rest of this entry »
PHP Digital Camouflage
The other day I was looking at demoscene videos on youtube (do yourself a favour and watch it!) and it made me think back to my PHP image hacking days. One thing led to another and I ended up saying to my partner Linds that I’d write her a little PHP demo. 3 hours later, I had digital camo in PHP (click the images for an online demo; refresh to cycle through the different types):
![]() |
![]() |
![]() |
![]() |
The Online Demo generates larger camo patterns and has a few other camo types; refresh it to cycle through them.
Let me know if you find a use for this code :)
After the break, I go into the detail of how the code is constructed, and you get a funky debug image too!
Read the rest of this entry »









