July 2004

I'm back.

I received snail-mail from Michael Wilcox. That was fun. His hand-writing isn't particularly good, but neither is mine. :-)

Here's a pretty cool thing about PHP; you can limit a variable's length in double quoted strings with curly braces. I've often wondered how it can know how many characters after the dollar sign is part of the variable. Now I know; it greedily takes as many characters as it can to form a valid variable name. And a variable name, as any label in PHP, is expressed with the regex [a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*. The reason something like this...

<?php
$foo = "15";

echo "Today I ran $foo meters!";
?>

...works is because the parser sees the dollar sign, then greedily consumes characters until it comes to an illegal character. Space is an illegal character in any label, so this works. If you go like this...

<?php
$foo = "15";

echo "Today I ran $foom!";
?>

..., however, you run into trouble. It sees the dollar sign, chews characters, then chokes on the exclamation mark, and finds $foom, which is a value-less variable. As said, you can limit the variable's length by enclosing it in curly braces (including the dollar sign inside the braces is optional):

<?php
$foo = "15";
$bar = "20";

echo "Today I ran ${foo}m!";

echo "But Jacob ran {$bar}m...";
?>

This works as expected.

Why do Jackie Chan's newer movies suck so much? I mean, why does Tuxedo suck so much? What happened to Legend of Drunken Boxing or Gorgeous? The Rush Hour series is mediocre. I was actually pleasantly surprised by Shanghai Knights. You know what they ought to do? Put Jackie Chan and Jet Li in a warehouse fillled with interesting toys, and throw fifty goons in there with them. Let Jackie play with them for a while, and then send them to Jet, who offs them. That'd be fun to watch.

Allow me to reiterate: You really should be getting Far Cry. As I'm progressing through the game, it gets better and better.

Oh, and one last thing: My HTML tutorial is coming along very nicely.

So, I'm back from my three weeks' vacation to England. Oh right, I didn't mention that. Ooops. I didn't think anyone would miss me, but I was wrong. Sorry lads, won't happen again.

Most of the time on the trip was spent driving around England (we drove about 250 (metric) miles, in fact), so I decided to read through the PHP 4 Bible by Tom Converse and Joyce Park, sans part II, which deals with databases and such. (Which I don't need. Yet.) So, there I was, in the car, reading about a web scripting language. With no computer to try out all the cool stuff I read about on.

I visited Alton Towers again, this time with my sister. Great fun, besides the queue times.

Also, I visited Alex again, which was fun. We went rock climbing, walking in the forest, going to the pub and looking at a castle ruin which ties up to the battle of Hastings in 1066 in some way I can't quite remember. But most importantly, Alex had a spare computer I could use! I eventually managed to write a semi-useful PHP script on it, which I'll soon release.

The 30 hours' boat trip home was hellish. My head is still woozy. Never again...

In other, perhaps outdated, news: Far Cry is one of the best FPSs I've seen in a long time. You owe it to yourself to play it.

There are 4 posts for July 2004.