Archive for February, 2011

Windows Backup did not complete successfully

This took me ages to discover (and hat-tip to Sarah Bourne for the answer) so I’m posting it as it might help someone else.

If you suddenly start getting this error when doing backups on Windows 7, run a full security scan and kill any quarantined viruse. (I use the free-to-download Microsoft Security Essentials.)

Why the error message is so stupidly unhelpful, and why Windows back-up doesn’t simply carry on in the legitimate assumption that you’d rather not backup quarantined viruses, are just two of the many mysteries of the universe.

Reading List 2

Stuff that people who aren’t following my tweet stream may have missed.

(Last Updated on 21 December 2011)

Polluter pays: building it right

I was having a conversation with someone who was developing a site and who had it looking good in some browsers and not others. She had markup like this:


<div id="before-nav"></div>
<nav>…</nav>
<div id="before-footer"></div>
<footer>…</footer>

with the empty <div>s being used to hold the top half of an image of some rounded corners. The page’s document landmarks needed rounded corners, and my friend was using images rather than CSS3 border-radius so it would work in IE<9.

Her problem was lining up the top half of the background effect with the bottom half, as they’re behind two separate elements and browsers have inconsistent browser stylesheets. So to get it to line up she was going to reset loads of elements and potentially resort to CSS hacks.

The trouble with this is that you’re then building hacks on top of hacks. Using completely empty <div>s for presentational purposes is already hacky, and it means that Opera, Firefox, Safari, Chrome and IE9 get markup and images they don’t need, as they could just use border-radius.

It might seem obvious, and the “build for good browsers, then hack for bad browsers” methodology has been around for a while, but let me gently remind you: don’t penalise the good guys. In Web design, unlike the real world, the polluter pays.

So, my friend should have designed her site with no extra unsemantic thingummies, and used border-radius to achieve her design effect. (If she were using more experimental CSS3 properties, she’d neeed a cross-browser future-proof vendor-prefix stack.)

Once this is tested and lovely in Opera, Firefox, Safari, Chrome and IE9, she can add one line into her CSS, courtesy of CSS3Pie, and her CSS rounded corners will work everywhere, but only the naughty browsers download the extra stuff.

This works nicely for CSS. For HTML5 APIs, there are all the HTML5 Polyfills. Sure, there are edge-cases and undetectables, but as a general methodology, the polluter-pays approach will speed up your development and leave you with clearner, less-hacky and therefore more maintainable code.

Snakeoil, local government, accessibility and HTML5

As we’ve seen from the £585 icon fiasco, in which Reading Room charged the Information Commissioner’s Office a large sum for a 32-by-32 pixel favicon, the public sector is a credulous and top-heavy environment in which to develop websites. (Disclosure: I once had to maintain some code by that agency.)

In the public sector, many websites sit in parts of the organisation that are managed by people who don’t really understand the Web. They may be Marcomms folks, used to traditional media, or IT Directors who are comfortable with Service Level Agreements, purchasing Enterprise-level software. But both breeds of manager are fair game to be frightened witless by the requirements to have accessible web sites.

There is a website monitoring and compliance tool that’s very popular with local government and public sector managers, as it does a battery of automated tests, marks websites as passing or failing. (See Gez Lemon’s old-but-gold Testing Invalid Content with Accessibility Validators to see why this might be more of a box-ticking exercise than a useful approach.)

The monitoring tool is less popular with the web people who actually do the work as the compliance reports and league tables that the vendor produces often require coding for the tool rather than for accessibility or best practices.

A correspondent writes that the tool didn’t properly score her HTML5 pages and had the following email exchange with the tool vendor.

Nice lady:

The issue seems to be because we are using the HTML5 doctype on our site. All of the checks being performed seem to be trying to validate us as HTML4 which is wrong.

Snakeoil salesman:

HTML 5, as a ratified standard, does not yet exist so there is only the initial draft proposal to work to, so as yet we have not started work on testing HTML 5. (See answer below about timings on using HTML 5.)

Nice lady:

The HTML5 syntax is much more relaxed and allows for a combination of HTML4 and XHTML standards. So errors being produced for things such as wrongly using self-closing tags are false.

Snakeoil salesman:

We do not believe this to be correct, even for HTML 5.

Nice lady:

HTML5 is new but the doctype is fully supported and recognised by all browsers.

Snakeoil salesman:

This is incorrect. HTML 5 does not yet have a “doctype” (as a method of signifying the document type). No browsers at all implement the HTML 5 document parsing method as far as we are aware.

Nice lady:

Developers are being encouraged to use HTML5 as the best way to ensure your pages will last a long, long time’.

Snakeoil salesman:

We are not aware of anyone that is encouraging people to use it, but if it is true that someone is then they are misguided and mistaken.

Here are advisories from the head of the W3C team working the HTML 5 spec from early October 2010.
W3C: Hold off on deploying HTML5 in websites &helip;

And in terms of ensuring pages last a long time HTML 5 parsers are backwards compatible with HTML 4 in any event, so documents written today in HTML 4 will last at least as long as HTML 5 documents, with the added advantage that they are actually supported by existing browsers.

For these reasons we do not currently support HTML 5 and have no plans to do so in the immediate future.

So if you would like to use any of the new HTML5 elements, canvas or multimedia or ARIA to aid accessibility, just make sure that your boss doesn’t pay money for Snakeoil Monthly report.

Reading List

Like everyone else, I post links to interesting stuff on Twitter. Some friends tell me that they miss those links because either they don’t follow me as I tweet lots of non-webdev stuff, or Twitter is blocked at their workplace.

So I plan to post those links to my blog. As with my tweets, I don’t necessarily endorse or agree with the links.

Listing useful links on blogs, eh? What an innovative idea.

Introducing HTML5 translations

A chum pointed me to Изучаем HTML5: our publishers tell us that translations are in progress into Simplified Chinese, Traditional Chinese, French, German, Italian, Korean, Polish, Portuguese as well as Russian.

Speaking Staffordshire University, Wed 16 Feb

I’m speaking with Remy Sharp and two other super-special guests (they haven’t announced yet) at Staffordshire University, Beaconside Campus. I’ll be talking about open Web standards. Remy will be talking about HTML5 APIs. Festivities begin around 1.30.

There are limited free places open to the public. Contact Fiona Knight (@fiona_knight) for details.

(Last Updated on 21 December 2011)

Old programmer war story

I had to smile to see some young whippersnapper ask “What are the Windows A: and B: drives used for?“, and thought back to when I started using computers that were even pre-floppy drive (you saved and loaded from a cassette tape and sat listening to the high-pitched noise as it loaded for 10 minutes with fingers crossed in case of data error), and decided to write down my favourite computer war story of prehistoric times.

Between 1988 and 1993 I worked for a very large computer services company, writing VAX/VMS Fortran and Cobol programs that drove an “online” Viewdata service that allowed the dealer network of a British car company to record sales and arrange finance. No program module could be more than 8K, I recall – so fripperies like comments, meaningful variable names or 4 digit year numbers were luxuries we couldn’t afford.

At night, the service was suspended while batch jobs ran to produce great big magnetic taps of data that were taken by motorcycle courier from the West Midlands to London in time for the BACS run at 7 am, when the banks did all their transactions. If you missed the BACs run, the previous day’s sales were not debited form the customers’ accounts and therefore not credited to the car dealer. Because of this, members of the team took it turns to carry a pager so that we could be contacted if there was a problem outside office hours (no mobile phones then!).

In the early hours of the morning of 2nd of August 1991, my girlfriend and I were disturbed in flagrante delicto after a boozy night at the pub by my work pager chirruping. I phoned the operator at our computer data centre to be told that one of the batch jobs had failed with an inscrutable error message. Of course, these days I’d open my laptop and search the Web, but way back then I had no option to get a taxi into the data centre and go to the big cupboard full of the big orange ring binders that contained the manuals.

The error message told me that a data type had overflowed. A further 30 minutes led me to conclude that the running total of sales value was being stored in an INTEGER*4 variable. Because it was an integer, it was being tallied in pence rather than pounds – and at55m (or 5.5 billion pence) the number was too big to store in 4 bytes. The previous day’s trading, 1st of August, was the first day of the new car registration year, so everyone had rushed to be the first on their street/in their office to have the newest registration plate.

Another half hour with cigarettes, vending machine coffee while looking at the manuals suggested that I could substitute a REAL*4 variable and tally in pounds with two significant decimal places for the pennies. With no time for fripperies like testing my theory, I recompiled and relinked all the programs and ran the batch job again as dawn was breaking.

The leathered-up motorcycle guy was in Reception by this point. “It’s going to start getting busy on the M25” he warned as we mounted the tapes to write to.

It was with a queasy feeling that I checked the logs before writing the tape to make sure that the grand total was55million. If I’d got it wrong, I would rather not send a tape to the bank at all than send a tape that erroneously debited5million or550million. I was also painfully aware that I had no authority to take such a decision—and a day’s interest on that kind of money was not trivial. But by the time I had found the number of someone with such authority, phoned him, awoken him, explained the position to he could take the decision, it would be too late.

Success – the total was correct! While the courier grumbled that he was going to perhaps exceed the 70mph speed limit on British motorways, the tape was written, boxed up and put in the cycle paniers. As the courier roared off, I wearily got into a taxi back to my sleeping lady-friend, to shave and shower to start work at 8.30 again.

You young ‘uns with your APIs and debugging consoles. You don’t know you’re born.

(Last Updated on 9 September 2020)