May 2003
May 1, 2003
Firebird Switch Campaign
Why You Should Switch to the Mozilla Firebird by Ben Goodger is an excellent overview of Firebird’s advantages over other browsers, hosted on the Phoenix project site. I’m really looking forward to the release of 0.6 as a good, stable, easy to use browser I can recommend to non-geeky friends.
Feedster AND searching
Feedster finally supports AND as the default search operator. This is a very good thing. I’ve decided to leave this site’s search engine as using OR, mainly because I feel for a small search set (approximately a thousand entries) more search results is better than fewer search results and because relevancy algorithm used by MySQL to order the results appears to be working extremely well. For large data sets such as Feedster or Google I definitely prefer to only see results containing all of my search terms.
XUL and PHP
XUL: rendering GUIs with PHP and XUL to PHP-GTK, both on the excellent phpPatterns(). If you’re using a Gecko-based browser be sure to check out the XUL Interface to phpPatterns() proof-of-concept, which adds an XUL powered menu bar to the browser chrome at the top of the page.
iTunes Web Service?
Via Tim Bray, it turns out Apple’s new iTunes Music Store is driven under the hood by a whole load of XML documents, which are available via HTTP. Here’s hoping this leads to something similar to the Amazon Web Services API.
May 4, 2003
Defending Structural Markup
I’ve been somewhat taken by surprise by the latest round of anti-CSS rants (initiated by JWZ, followups all over the place), mainly because I’ve been using CSS for long enough now that I’d started to forget about the legions of web developers out there who haven’t yet realised what they’re missing. Instead of getting stuck in to dissecting other people’s complaints I’m just going to lay down a few of my own core beliefs.
[... 841 words]Strong Typing vs Strong Testing
In Strong Typing vs. Strong Testing, Bruce Eckel reconsiders the old idea that languages without strong typing can’t be relied on to create large programs:
[... 148 words]Achieving standards compliance and a list of DTDs
Via the WaSP blog (I wish they would ping Weblogs.com), How to achieve web standards and quality on your web site and List of valid DTDs you can use in your document, both by the W3C QA team. The former includes a great selection of questions and answers to typical reasons for not using standards (as well as some great tips on how to create standard compliant sites) while the latter finally provides all of the DTDs in one place.
May 5, 2003
Better structural markup rants
Better structural markup rants than mine: Owen Briggs’ classic Design Rant and Craig Saila’s Tables or CSS? Choosing a Layout. Incidentally, my rant has sparked some excellent feedback in the comments section.
Instant caching with PHP
I’ve been getting more database timeout errors today, probably due to increased traffic from links to recent entries. A permanent solution would be to switch to generating static HTML (this site is currently dynamically generated for every request), but I don’t have time for a full re-write at the moment. Luckily, PHP offers an extremely simple solution to dynamic caching in the form of output buffering. The front page of the site (which generates by far the most traffic) is now served from a cached copy if it has been cached within the last 5 minutes. Best of all, I didn’t have to edit any of my core application logic—I just dropped in some extra code at the top and bottom of the index.php
file. Here’s how it works:
May 6, 2003
Living on a knife edge
In The XHTML 100, Evan Goer describes an experiment in which he checked 119 site claiming to be with an XHTML doctype for full compliance with the W3C standards. His test consisted of three parts—a validation check on the front page, a check on another “inside” page, and a check to see if the correct Content-Type header (application/xhtml+xml
) was served to supporting User Agents (in his case Mozilla 1.3).
Delay to the start of my CSS tutorial series
I still plan to go ahead with a CSS tutorial series, as promised. I’m delaying the start, partly to give myself time to work out a good structure for the series, but mainly because I have a shed load of coursework due in a week today that desperately needs my full attention.
May 8, 2003
The CSS Zen Garden
This is something we’ve needed for a long time. The CSS Zen Garden demonstrates CSS as used by graphic designers, and is a truly beautiful sight to behold. It currently showcases 5 radically different designs all using exactly the same markup, and invites further contributions from other designers. Finally, a proper demonstration that standards compliant, accessible, CSS driven web sites do not have to be boring or ugly.
May 15, 2003
All Courseworked Out
I’m all courseworked out. After 4 hours sleep on Saturday night, I got up at 8am, headed in to Uni and spent the next consecutive 57 hours in the Library doing coursework (grabbing a total of about two hours sleep during that time). It was, with hindsight, a very stupid thing to do but I take heart in the fact that I was not alone: At least 20 other people from my course were there for almost the same amount of time I was (see Richard and Andy).
[... 304 words]Ninety percent of everything is crap
Via the comments on Robert C. Martin’s One per Pixel, I came across Sturgeon’s Law from the Pragmatic Programmers: Ninety percent of everything is crap
. The article has the following to say about software development:
PyMeld
PyMeld is a concrete implementation of something I’ve been thinking about for months: A template system that takes an XHTML page as a template and manipulates it based on cloning and modifying elements within the template identified using their ID attribute. It’s a very elegant solution that makes good use of Python’s object overloading support to make manipulating templates as intuitive as possible. Maybe the same thing will be possible in PHP once the new overloading functions become part of the standard package.
[... 180 words]CSS2 is five years old
No one appeared to notice, but the CSS2 Recommendation had its five year birthday on Monday the 12th of May. Maybe now people will stop writing it off as a new and unproven technology and start looking in to the benefits it can bring instead. Speaking of which, I’ve decided on the format for my CSS tutorial series and hope to kick things off with the first in the series tomorrow.
May 18, 2003
The anatomy of a stylesheet
To start my series of tutorials, I’m going to go over some of the basics of CSS. This is the boring bit: if you already know the difference between rules, properties and selectors you may want to skip this entry.
[... 1,276 words]May 19, 2003
Syntax Highlighting with Javascript
If you were curious enough to dig around the source code of yesterday’s CSS tutorial, you may have noticed a couple of classes that didn’t appear to be doing anything:
[... 264 words]New Gestures Build
There’s a new nightly build of the Mozilla mouse gestures plugin which supports Firebird 0.6 and has a preferences panel, complete with options for setting up custom gestures. I missed the customise button at first (Tools -> Options -> Extensions -> Mouse Gestures -> Settings -> Edit Mappings) but it’s very powerful, if slightly confusing. It’s nice to be able to change gestures to the right mouse button without digging in to about:config
as well.
The Selfish Class
The Selfish Class provides a set of related patterns to help design software objects that encourage reuse. They seem to make a lot of sense; I’ve only read a smal part of the paper and I’m already spotting things that are reflected in software I’ve found reusable in the past. Key example:
[... 118 words]Scripting.com, with added CSS
One of the aims of this course is to show how relatively simple CSS can be used to make dramatic improvements to existing sites. Today, I’ll show how CSS can be used to reduce the amount of code needed for a small part of the design of Scripting.com.
[... 1,178 words]May 20, 2003
Defeating IE5 CSS bugs with the help of jwz
Today’s CSS case study will be Jamie Zawinski’s LiveJournal. OK, I admit that he’s something of a tempting target after his widely publicised CSS rant last month (which was the main inspiration for this course), but there are a number of sensible reasons his site makes a good case study as well. The theme for today is “bugs in IE5 for Windows”, and jwz’s site offers two classic examples that fit this theme nicely. The first is the fact that the design is centered on the page, and the second is his choice of Verdana, a font which requires some trickery to get working well in IE5. In addition, the design of the entries seems to be a natural fit for a table based layout, so demonstrating how much simpler the code can be in CSS will hopefully turn a few heads.
[... 2,979 words]May 21, 2003
Quick tip: Styling blockquotes with CSS
Today’s tutorial is going to be short one, as I’m working on one last piece of coursework. This time I’m going to explain a clever CSS trick borrowed from Nick Boalch. Here’s a screenshot:
[... 475 words]May 23, 2003
Programming by Contract in Python
Programming by Contract seems to be a sister technique to unit testing—instead of (or as well as) writing a set of tests for a piece of code you write a set of pre- and post-conditions for the data being processed which are then checked whenever the program is run in debugging mode. Contracts for Python discusses the technique, providing a reference implementation and a PEP suggesting inclusion of support for the technique in the core language. Programming by contract was first demonstrated in the Eiffel language, and there’s a good introduction to it in Eiffel.com as well.
Even more buttons
If the 309 buttons at Steal these buttons aren’t enough for you, you can now generate your own thanks to a clever PHP script on Minimal Verbosity. Bill Zeller has made the source code available as well.
Learning Python, second edition
Mark Lutz has announced that he is working on a second edition of Learning Python. The first edition of Learning Python is probably the best learn-programming-language-X title I have ever read. It’s nice and short, but covers the whole core Python language comprehensively with excellent examples and a well targetted learning curve. I’ve lent my copy to several people, all of whom found it very helpful and one of whom went on to buy a copy themselves. I’ll probably be buying a copy of the second edition just so I can use it on my constant mission to get more people on my course to give Python a go.
CSS Tutorial: feedback so far
My CSS tutorial series has been getting some fantastic feedback, both in this blog’s comments system and elsewhere. This entry will summarise the most useful feedback, acting as a kind of errata to the previous entries. Thanks to everyone who commented, there are too many to credit individually but you can see most of the points in their original format by browsing the comments attached to each entry.
[... 661 words]May 26, 2003
Understanding the Box Model
Today’s tutorial is going to be all theory. The box model is an inevitable part of CSS, and understanding it is critical if you want to do anything remotely interesting. Like most of CSS, it’s a lot simpler than it sounds. Here it is:
[... 626 words]