Published June 9th, 2008
While Firebug is about as close to a perfect tool for web development as I’ve ever seen, its use as an HTTP monitor is limited — if only because its Net pane is cleared when the page refreshes. In the past I’ve used Fiddler for this job, but of course you need to remember to start it up and then configure Firefox’s proxy settings to make use of it.
I’ve recently discovered HttpFox, a Firefox extension which sits quite neatly between the two: it works better than Firebug but lacks some of the more powerful facilities of Fiddler (for example, the ability to intercept and modify requests during send/receive). However for basic HTTP monitoring tasks, it’s simple and convenient.

Category: Firefox Extensions | Tags: | 2 Comments »
Published May 22nd, 2008
A while back I wrote an article about testing HTML on multiple browsers, bemoaning the difficulty of testing on platform-specific software such as Safari and Konqueror. Of course, since then Apple has released Safari for Windows, which takes care of that problem quite neatly.
However, what of Konqueror? Putting aside the point that it’s very much a minority browser, the virtualisation options that I suggested in my previous article really are rather involved for what should be a simple ALT+Tab to browser / Refresh / Check page / ALT+Tab back to editor operation. And no virtualisation software I’ve yet tried offers any kind of acceptable performance on the frankly weedy PC I’m stuck with at work.
So I was intrigued by Ulteo, which is a form of Linux designed to run as a ‘virtual desktop’ on top of Windows. Meaning that rather than running inside a self-contained window, applications running on Ulteo appear to be native Windows apps. Each has its own Windows taskbar icon (although XP’s grouping mechanism can rather spoil the effect) and can be accessed with ALT+Tab as if it were running on Windows itself. In operation, it’s entirely seamless: Ulteo itself manifests as a self-hiding application launcher at the top of the page, giving access to a whole range of Linux apps (including Konqueror).
This screenshot shows Konqueror running alongside two instances of Firefox — Windows and Linux (click for larger version):
Speed-wise, Ulteo takes a good while (on my wheezy old desktop) to boot up, but once it’s going it’s plenty fast enough that you wouldn’t really be aware that an app is running through Ulteo rather than Windows itself. It takes up its fair share of resources, but not so much that it interrupted the normal operation of my PC.
It’s a decent compromise for a tricky situation and well worth a look if you’re interested in testing on Konqueror, or indeed just giving Linux a spin with the minimum of upheaval/effort.
Category: Web Development | Tags: | Be the First to Comment »
Published May 15th, 2008
OK so I haven’t really done much with Flash for a few years now but I’ll admit I was taken aback when I saw this morning that Adobe has released a beta of version 10. The tenth version!
Don’t worry, I’m not going to get bogged down in all the nostalgia stuff. But looking at Flash now — with streaming audio and video, built-in 3D effects, advanced text manipulation and on and on — and thinking about some of the ‘amazing’ techniques that I (and others) experimented with back in the the day, makes me feel very old.
Category: Flash, General | Tags: | 1 Comment »
Published May 15th, 2008
I’ve been running this blog-based iteration of my site for almost three years now, and recently — after numerous on-the-fly software updates — I’ve found that WordPress had become rather unstable and slow. So yesterday I decided that I’d had enough and it was time to start again with a clean slate.
The basic process was relatively painless: I created a temporary subdomain and installed a fresh copy of WordPress, then used its built-in export/import facilities to transfer all the existing articles and comments over. Then I had to install all the various plugins I’d accumulated over the years (Akismet, Bad Behavior, Code Markup, Google XML Sitemaps, OpenID Registration) and configure them appropriately. I couldn’t find an up-to-date version of the old theme I was using, so I spent a while browsing before finding this one, which I’m fairly happy with although I might tweak here and there as time goes on.
Finally I had to do some work to re-integrate the various ad spots and a few other bits and bobs (e.g. point the RSS links to FeedBurner) before the installation was complete. All in all, it was probably half a day’s work, which I think is acceptable for a complete restart.
So I hope you like the new look. If you spot any problems then please let me know via the comments form below.
Category: General | Tags: | Be the First to Comment »
Published April 24th, 2008
This is one of those silly little PHP quirks that catches me out from time to time, but apparently not often enough to avoid doing it again on occasion.
Let’s say you have a function (we’ll call it getSomeData())that returns an array, or false if there is a problem (yes you should probably be using exceptions, but let’s just say for argument’s sake that this is a third-party library over which you have no control). So you use a conditional to test whether the function had a problem or not:
// Try to get data
$data = getSomeData();
if( $data ){
//...do something
} else {
// There was a problem
error_log( "There was a problem getting data!" );
exit;
}
For the uninitiated the if() here calls the function and assigns its return value to $data. If the return value is any non-false value, the condition evaluates to true.
The quirk, if you want to call it that, is PHP’s understanding of what constitutes a ‘non-false’ value. You probably already know that null, 0 (zero) and ” (empty string) all evaluate to false. But the one that still catches me out now and then is that an empty array will evaluate to false, too. So in our above example, we’ll get an error if the getSomeData() function returns successfully, but with no data.
You could fix this with strict evaluation:
// Try to get data
$data = getSomeData()
if( $data === false ){
//...do something
} else {
// There was a problem
error_log( "There was a problem getting data!" );
exit;
}
…or alternatively (and better, in my opinion) check the return value’s type:
// Try to get data
$data = getSomeData();
if( is_array( $data ) ){
//...do something
} else {
// There was a problem
error_log( "There was a problem getting data!" );
exit;
}
If you want to know more, check out this blog post that goes into more detail — and points out a couple more unexpected ‘false’ values (the string ‘0′ and an object with no properties) that I wasn’t aware of.
Category: PHP | Tags: | 1 Comment »