The world is getting weirder

This story of a boy fascinated by rubbish trucks and wants to be a dustman when he grows up is just too weird.

Gordon, who has a growing collection of toy refuse vehicles, said the best part of the trip was “putting the bins on the back of the dustbin” and “pressing the big button”.

Though judging by the picture, he looks like he’ll settle into the job really easily:
Boy as binman

Kerala Indian restaurant, Central London

I’ve been to Kerala (Indian restaurant near Oxford Circus in Central London) again and it’s just as good as it was when I first went and wrote about it here. I just want to make sure enough people go there to keep it open (it seems busy enough) so hopefully this should appear in some search engines. The dosas are really good… in fact, I think it’s all really good if you like authentic south Indian food.

Kerala Restaurant, 15 Great Castle Street, London, W1W 8LT. Nearest tube
Oxford Circus

Review of Kerala on London-eating

Review of Kerala at
Curry House Reviews

PHP 4 foreach as references

PHP 4 doesn’t seem to create references for objects in foreach loops. e.g. the following will not change the original objects:

foreach($placeholder as $contentBlock)
{
 $contentBlock->setPosition(1);
}

The value of the position property in the original object will remain unaffected. This is quite rubbish. To get round it you need to get all the array keys and then create a separate variable to store a reference to the object you want to change:

foreach($placeholder as $key => $value)
{
 $contentBlock =& $placeholder[$key];
 $contentBlock->setPosition(1);
}

The variable $value isn’t used at all but if you’re stuck using PHP 4 then this is the best you can do. Luckily PHP 5 works much more sensibly, but we don’t always get a chance to use that so I’m stuck with this slightly messy alternative.

Foreach in the PHP docs

PHP 4 annoyances ( = rant)

After working with PHP 5 for quite some time now, I’ve had to go back to PHP 4 to develop a CMS for a client’s site where we don’t have much over the hosting environment. Going back to the old version has annoyed me quite a few times already and it’s probably made worse by the fact that I never really did much PHP 4 anyway (I’m quite new to the language, even though I have been programming in it on and off for 2 years) and lately I’ve been working in a combination of PHP 5 and C# (as well as various others) and generally being a bit more object oriented about everything.

First off there’s the whole not really object orientedness of PHP 4. PHP 5 isn’t that object oriented, but PHP 4 is miles off. Passing variables by value instead of reference unless you put stupid & symbols everywhere… whose idea was that? Also it’s obviously a bit hacked together behind the scenes, as exemplified by the fact you can’t do things like $this->getThing()->getOtherThing() without it barfing. Instead you have to put the returned value from the first thing into a variable and then call the next method… not a good sign in an interpreter.

You can just about force yourself not to access member variables of objects directly, even if you can’t set things to be protected or private, and make get() and set() methods everywhere, but sometimes it’s really useful to put things into static classes. Database routines would be really useful, for example. Instead I’ve taken to creating a great big global variable to hold an object and refer to it everywhere and use the member variables of that object to store other useful objects. At least methods can be called statically, but without static member variables they’re not as much use. (I use a similar technique when programming in Lingo to save having to reference all my globals in each script: store them as properties of another object that keeps state for the whole application.)

And very little XML support either… Even ASP could handle XML well, and even XSL, four or five years ago, and ASP as we all know is the lowest form of programming language ever invented. (Okay, there are worse languages than VBScript, but not many that site behind so many important web sites. I once worked on a half million pound project that was built in ASP… Scary!)

Rant ends

Bulwer-Lytton Fiction Contest (for the worst writing)

These awards for the worst writing of 2005 make excellent reading. Some of my favourites

Captain Burton stood at the bow of his massive sailing ship, his weathered face resembling improperly cured leather that wouldn’t even be used to make a coat or something.
Bryan Semrow, Oshkosh, WI

It was high noon in the jungles of South India when I began to recognize that if we didn’t find water for our emus soon, it wouldn’t be long before we would be traveling by foot; and with the guerilla warriors fast on our heals, I was starting to regret my decision to use poultry for transportation.

Eric Winter, Minneapolis, MN

Because of her mysterious ways I was fascinated with Dorothy and I wondered if she would ever consider having a relationship with a lion, but I have to admit that most of my attention was directed at her little dog Toto because, after all, he was a source of meat protein and I had had enough of those damn flying monkeys.
Randy Blanton, Murfreesboro, TN

A column of five hundred Roman foot soldiers – a column held together by the plaster of courage — advanced on a teeming sea of rebellious slaves — slaves who had, ironically, built most of Rome’s columns, although they actually used lime and not plaster to cement the structures, and though it is perhaps more historically precise to describe the soldiers’ column as bound by the lime of courage, that doesn’t really have the same adventurous ring to it.
Mark Hawthorne, Rohnert Park, CA

After she realized the man she had fallen in love with was her long lost twin brother and they must break up immediately, they shared one last kiss that left a bitter yet sweet taste in her mouth–kind of like throwing up after eating a junior mint.

Tami Farmer, Rome, GA

Billy Bob gushed like a broken water main about his new love: “She’s got long, beautiful, drain-clogging hair, more curves than an under-the-sink water trap, and she moves with the ease of a motorized toilet snake through a four-inch sewer line, but what she sees in me, a simple plumber, I’ll never know.”

Glenn Lawrie, Chung-buk, South Korea

Looking sideways at Thomas, Mireille slowly removed her scarf, waiting . . . hoping . . . praying that when he came close enough to smell the delectable fragrance of her long, luscious waves that he wasn’t going to start sneezing or sniffling or rubbing his eyes, because those were tell-tale signs of his allergies acting up, and if they did, he would know that she had been out rolling around in the lavender fields with Luc again.

Keriann Noble, Murray, UT

As soon as Sherriff Russell heard Bradshaw say, “This town ain’t big enough for the both of us,” he inadvertantly visualized a tiny chalk-line circle with a town sign that said ‘population 1,’ and the two of them both trying to stand inside of it rather ineffectively, leaning this way and that, trying to keep their balance without stepping outside of the line, and that was why he was smiling when Bradshaw shot him.

Keriann Noble, Murray, UT

Derwin Thoryndike vowed to place a 14-carat engagement ring on the finger of Glenda-Sue Ellington, so now all he had to do was save up enough money to buy the ring, get it inscribed, and then locate a person named Glenda-Sue Ellington and convince her to marry him.

Harvey McCluskey,
Vancouver WA

“So you see” concluded Lance “there are certain things that every woman regardless of personal situation should do at least once in their lives and I am foremost amongst these things.”

Hywel Curtis,
Abercarn, Caerphilly
Wales

Bulwer-Lytton Fiction Contest
2005 Results