Archive for the ‘Education’ Category

PHP’s flexible variable typing makes determining a value to be empty… well, see for yourself. Check out this diff for the NotEmpty validator in Zend Framework.

That can’t be right, surely! ;)

Update: the unit tests reveal the intent behind the odd-looking code change. Now the validator can optionally be very specific about what is considered empty.

Who’da thought that a single Tweet would have such impact?

During an IM chat with Daniel White he showed me his astonishing 3D Mandelbulb work. I asked if I could tweet about it and he agreed. Little did he know that this would lead to his website being Slashdotted and his work picked up by New Scientist!

Well deserved recognition for a true genius and nice guy.

Last Sunday, after getting bored implementing error handling in the Ruby version of the food journal, I decided to take a stab at the ICFP 2009 Programming Contest. Although already finished, the problem is so intense and interesting that I had to try. My solution is written in the lovely functional language Haskell.

Today, I achieved a milestone. My program can load and execute the Orbit virtual machine, run a sequence of frames and reports a score of -1.0 when the controlled satellite’s fuel is exhausted.

Browse the code on GitHub. Remember, I’m still learning, so don’t expect anything miraculous!

Continue reading ‘Controlling Satellites With Haskell’ »

I’m not by any stretch of the imagination an early adopter of technology. Nor am I (mostly) an old stick-in-the-mud who thinks that all programming should be done in COBOL. I love new technology but prefer other people to work out the bugs and niggles before I can use them reliably as tools.

So it is with some pleasure that I’ve decided to take the plunge and begin studying the Ruby programming language. Ruby has been around for 15 years now so the foundations are solid. Many rave about its simplicity, utility and natural-looking syntax.

My goal is to learn the lanugage by porting an existing application (the food journal written in PHP that I recently used to play with Zend Framework) first to the Ruby language, then to the web application framework Rails.

As usual, I embark on this project by reading a manual!

Update 12-Jul-2009: Browse the code on Github
Continue reading ‘Playing With Ruby’ »

The Zend Framework is a long-established and well-respected set of libraries for building PHP web applications. I’ve not used it before and I’ve recently become interested in learning more about it so I’ve decided to have a play. Rather than start entirely from scratch, I’m going to re-use the database schema of a famous dive-logging web application and see how much effort is involved in re-implementing the basics; logging in and displaying a page of dives.

More importantly, how much fun is it to work with?

Update 12-Jul-2009: Browse the code on Github
Continue reading ‘Playing with Zend Framework’ »

Now my Ubuntu workstation, part-way upgraded to the 7.10 “Gutsy Gibbon” release, works almost as elegantly as my Windows machines have worked forever. My network music store now auto-mounts into my home directory when I login. Finally. I’ve been beating away at this, on and off, for bloody years. I’m just not a great sysadmin, I guess!

Method follows.

Continue reading ‘libpam-mount automounts SMB shares at login, just like Windows’ »

What could I do with this?


CREATE TABLE child (
  id BIGINT NOT NULL AUTO_NUMBER PRIMARY KEY
, parent_table VARCHAR(64) NOT NULL
, parent_id BIGINT NOT NULL
, FOREIGN KEY parent_table REFERENCES INFORMATION_SCHEMA.tables(name)
, FOREIGN KEY parent_id DEREFERENCES parent_table(id)
) ENGINE=fantasy COMMENT='Don\'t run this at home, folks!';

AND
Continue reading ‘(My)SQL Infection’ »

“No love, they only blow hot air.”

Yay! Snow in Sheffield again. Piccies just as soon as my camera batteries charge. Oh dear, my camera has failed doesn’t seem to like the cold! Anyways, a couple of pics from out front and back.
Continue reading ‘Mummy, does the IPCC make it snow?’ »

The following code works on Linux (3 rows returned) but not on Windows, which returns a SQL syntax error citing LIMIT "0", "3". See PHP bug 35801 closed as “bogus” by an idiot on Christmas Day 2005 for the bogus reason:

Limit statements cannot be part of prepared statements.

Anyone care to confirm?

Continue reading ‘Christmas Bogus Bogus PHP PDO Bug’ »

This post is password protected. To view it please enter your password below: