Recent Blog Posts
Blogs ยป Archive for April, 2006
PHP to the Rescue!
If you’re looking for a thoughtful Saturday read, you won’t go far wrong with Error codes or Exceptions? Why is Reliable Software so Hard? by Damien Katz, which is worth it just for the visual interludes.
In fact it’s less about error codes / exceptions and more about what you do when something does go wrong – how to you “bail out” of the mess you’re in?
On the PHP fanboy front, the relevant piece that needs quoting…
What we need in languages and tools is the ability to easily isolate our changes for when the s**t hits the fan, so that incomplete changes aren’t seen (all or nothing). And we cannot be in denial that the s**t can hit the fan at any time. We need to make it easy to detect when things do wrong, and make it simple to do the right thing once that happens.
Believe it or not we already have it, in rudimentary form, in PHP. Yup, good old, stupid-simple PHP. On a webserver, PHP scripts have no shared state, so each instance of a PHP script runs in its own logical memory space. The scripts maintain no persisted state, so each script start off fresh …
The Great Alexa Spike of 2006
It seems to have passed without much comment, but there seem to have been some significant changes at Alexa recently — most notably sites that appeal to a more tach-savvy audience are making huge leaps up the rankings. The phenomenon can be seen clearlyacross all major web development sites — from W3Schools.com to W3C.org to SitePoint.com — but also across a long list of sites with more general appeal to tech users, such as Flickr.com, Del.icio.us and Slashdot.org.
Meanwhile sites with no notable ‘tech-skew’ (i.e. CNN.com, EBAY.com, etc) have either held firm or been shuffled backwards by the sites bubbling up around them.
It raises some interesting questions:
- Have Alexa changed their statistical algorithms?
- Is this a temporary anomoly?
- Which sites lost out the worst?

It certainly seems that the Alexa ranking system has undergone a radical shift in it’s demographic in the past 18 months.
Alexa got their first big push in 1998 when they had their toolbar included in the Netscape 4 default install. A year later they pulled off a huge coup by getting it included in Internet Explorer 4.
At the time most users would have just assumed (as I did) that it was simply …
CSS Support in Email
Not long ago, Alex spent some time researching the CSS secrets of Lotus Notes to help get the HTML versions of our email newsletters to display properly in that client. But in the wild and wooly world of HTML email, Lotus Notes is only the worst offender on death row. There are plenty of other badly-behaved email clients out there, and most of them aren’t as considerate as Eudora (which simply doesn’t support CSS at all).
Over at the Campaign Monitor blog, David Greiner has posted a complete guide to CSS support in all the popular email clients, both desktop and web based.
This guide will save you a ton of time, even if all it does is convince you that CSS in email is a lost cause.
Consider: if you want to avoid applying style attributes to your HTML tags, you’ll have to sacrifice support for GMail entirely, and you’ll need to use both a <style> tag in the <body> to support the web email clients and a <link> tag in the <head> to support Lotus Notes.
Sound ridiculous? Tip of the iceberg, I’m afraid…
Is Your Site This Dynamic?
From the immensely entertaining The Daily WTF, a daily digest of horribly bad code spotted in the wild, comes this cautionary tale of dynamic web development gone awry.
Developer Stephan Jennewein was hired to update a web site for Firefox compatibility. What at first glance appeared to be a modest web site made up of 15-20 static pages turned out to be an intricate mixture of JavaScript and PHP code. Every one of the apparently static pages contained code resembling this:
<html>
<head>
<link href=”dynsitebase/styles.php” rel=”stylesheet” type=”text/css” />
<script src=”dynsitebase/base.php” language=”JavaScript”></script>
<script src=”dynsitebase/themes.php” language=”JavaScript”></script>
<script src=”dynsitebase/sitedata.php” language=”JavaScript”></script>
<script src=”dynsitebase/pagelayout.php” language=”JavaScript”></script>
<script language=”JavaScript”>
document.write(”<title>” + CurrentPage.Title + “</title>”);
</script>
</head>
<body>
<script language=”JavaScript”>
DataInterface.initialize();
DataInterface.bindToPage(CurrentPage);
ImageLoader.preload(CurrentPage);
LinkLoader.bindToContext(CurrentPage);
PagePrinter.printHeader(CurrentPage);
PagePrinter.printNavigation(CurrentPage);
PagePrinter.printTitle(CurrentPage);
PagePrinter.printSubTitle(CurrentPage);
PagePrinter.printMainContent(CurrentPage);
…
Google Advertises Firefox to IE Users
Most web developers agree that Firefox is a superior browser to Internet Explorer, but how do we get non-technical users to give it a try? Well… what if Google told them to?
Starting today, Internet Explorer users based in the United States who visit google.com will be greeted by the very first ad for a 3rd party product to appear on the page:

“Firefox with Google Toolbar: tabbed browsing, safer surfing” reads the ad. Granted, Google has a vested interest in promoting its toolbar, but the fact that it chose to do so with the Firefox browser (rather than continuing to push the IE version) is a huge coup.
IE7 Beta 2 Available to End Users
If last month’s “layout complete” preview release of IE7 didn’t get you working on compatibility updates to your web site(s), maybe this will: Internet Explorer 7 Beta 2 is now available to end users from the Internet Explorer web site!
Unlike the previous preview releases, Microsoft is pushing hard to get ordinary consumers to try out this new beta. Microsoft is even offering unlimited free phone support for users of the beta in North America, Germany and Japan, in the hopes that it will attract the less tech-savvy to give it a try.
As far as getting your site(s) working in IE7, the words “now or never” come to mind.
Tomcat sucks… Is Apache flawed?
High on my list of Java blogs is Hani Suleiman’s The BileBlog, in which he gives unapologetically abrasive reviews of popular Java projects and the people behind them. In the past, he has had been less than complimentary of the Apache Project’s various open source (”opensores”) Java offerings like Maven and Struts. Today, he took Tomcat to task.
Tomcat, of course, provides the reference implementations for the Servlet and JSP specifications, but by virtue of the fact that it is free, it’s also the server of choice for many small-to-medium businesses. I took a critical look at Tomcat myself awhile back, while looking for a beginner-friendly Java web application server (I’m still looking).
Suleiman’s critique of Tomcat is based, somewhat refreshingly (he often resorts to unpersuasive, if entertaining, personal attacks on the developers), on the quality of the project’s code–or rather its lack thereof. Choosing a pivotal but relatively uncomplicated class (DefaultServlet, which is responsible for serving static resources like HTML/CSS/JavaScript files and images), he points out many examples of terrible coding practice, of which these are only a sampling:
Initialization code that lazily catches Throwable
// …
Atlas disappoints in cross-browser support
(via digg) An interesting discussion has begun on Leland Scott’s blog following his testing of Microsoft’s Atlas AJAX framework in various (non-IE) browsers.
The gist of Scott’s tests is that the Atlas code doesn’t work across all browsers. Most of the UI controls get a tick in the box when tested in Firefox, but in Opera and Safari most of them either fail or don’t work as expected.
This is obviously disappointing, given the amount of hype Atlas has had, and considering there are so many other great open source toolkits out there already that work in all modern browsers. Obviously in the rush to get Atlas out, “cross-browser” was interpreted by the Atlas developers to mean “make it work in Firefox”, with the “Community Technology Preview” stamp being used as an excuse for why the rest of them fail.
Unfortunately it’s difficult to take a lot of Scott’s reportage seriously, considering the blatant anti-Microsoft bias that shows through. Still, it’s the screenshots that tell the story, and with the surge in popularity of ASP.NET and the marketing campaign behind Atlas, the toolkit is certainly going to be in wide-spread use. So unless …
PHP frontend for Xdebug profiling?
Has anyone put together a PHP front-end for viewing Xdebug 2.x’s profiling output yet?
Xdebug 1.x had this nice xdebug_dump_function_profile() function which planted a HTML table containing the profiling stats in your output – nice an easy to use, ignoring the minor issue that doing this “in band” with the code you are profiling slants the results. With Xdebug 2.x it was dropped and you now need a tool like kcachegrind or wincachegrind, an output file generated by Xdebug acting as the middle man.
The format of the profile output file is fairly straightforward (in fact the wincachegrind developer provides a nice short summary with the install README). Perhaps the trickier issue is how to deal with large files. And this could be a valid reason to use some AJAX… In fact it’s tempting to take a shot using wxpython (the book is out BTW – and it’s good) and put together a cross platform front end, but that’s another story.
Or do I need to do it myself ? ;)
Side note: the definitive Xdebug tutorial – http://derickrethans.nl/files/phparch-xdebug-qa.pdf
Try Ruby!
Keen to give this Ruby thing a go, but don’t have the time/resources/know-how to set up a test environment?
There’s a spanky little interactive Ruby tutorial you can try. All you need is your web browser and a spare 15 minutes.
A great way to get acquainted with the Ruby language and interpreter.
Sponsored Links
SitePoint Marketplace
Buy and sell Websites, templates, domain names, hosting, graphics and more.