Most recent posts...

Quick links to the most recent posts:

The popularity of “could care less” cannot be underestimated

Personally speaking, I find the usage of “I could care less” instead of “I couldn’t care less” to be a little annoying. I’d even go further: to my ear it sounds illogical: “hey, if you could care less then you must care a bit!” Much merriment and good-natured joshing ensue, ho, ho, ho. But, to be honest, life’s too short to start a grammar war over it.

Cats In MirrorI’ve even encountered the theory (I believe it was Steven Pinker who first proposed it) that the speaker of “I could care less” is being sarcastic: “hey, I could care a bit, but, like, it’s so not worth the effort”. But then again, “I couldn’t care less” is also being sarcastic by using emphasis: whatever happened to the simple “I don’t care”? Besides which, it’s used so often in an automatic unthinking manner that it’s a little presumptuous to imagine that every usage is sarcasm (ditto the “negated” version, I suppose).

They are both idioms. They don’t have to really make sense literally: you are conveying the thought through the cliché. People don’t really hear the words, they hear the shape of the saying and get the meaning from that. You cannot fail to miss with colloquial phrases. Everyone knows them. Here’s one: “I’m head over heels in love with you”. You all know this one, it means “I’m bowled over by you”, and maybe you’ve even had it said to you. And yet you’ve never really read it. Look, when I’m standing upright, my head is over my heels. So, I’m in love with everyone I meet as I walk around the mall? Duh. (Brewer’s Dictionary of Phrase and Fable states that the saying used to be “heels over head” which makes a lot more sense. But the idiom changed over the years.)

In essence, it’s part of a problem with how our poor monkey brains deal with negation (or even over-negation) in sentences, especially in conversation. Sometimes it seems there’s just not enough time for the brain to process the complicated grammar, craft a sentence, and get the mouth to say it; or even the other way around: to hear and parse what someone else is saying to you. No one is too intelligent to avoid misinterpreting over-negated sentences. We just cancel out some of the (explicit/implicit) negation and somehow hear what the other was trying to say, even if the sentence literally meant the opposite. Heck, I know de Morgan’s Laws and yet I still have problems writing complex conditional expressions with not operators. I have to stop and really think about what I’m trying to say.

So, before you all jump over me for condoning “could care less”, maybe you should reread what I wrote.

Album cover for The Best of Strange CargosNow playing:
Orbit, William - Fire and Mercy
(from The Best of Strange Cargos)


Art at Chatsworth, September 2011

For our wedding anniversary this year we went to the Peak District and stayed at a hotel in Baslow, just north of Chatsworth Park. Of course, since we were so close, we had to go visit the House and grounds.

Bizarrely, despite the fact my family used to live near Matlock when I was a late teen, I’d never visited either. I’d driven though the Park at the time in my parents’ borrowed Capri, but never stopped. Maybe at 18 I was too cool for art.

With our visit, we were fortunate in some ways, but most unfortunate in a couple of others. The South Front, the part of the house that looks down that impossibly beautiful lake with its Emperor Fountain, was being renovated and was covered with scaffolding and white tarps. Also, due to a drier spring than is usual in Derbyshire, the water level of the lake that feeds both the Cascade and the Emperor Fountain was too low, so both attractions were only being turned on to a strict schedule. The fortunate part: Sotheby’s had an exhibition of monumental sculpture in the park, with some quite wonderful pieces.

First, though, the house. The Dukes of Devonshire, over the centuries, had amassed quite an impressive art collection; with some striking modern art collected by the current Duke.

The first piece that really grabbed me was this Damien Hirst sculpture of St Bartholomew in the Chapel (the full title is Saint Bartholomew, Exquisite Pain). The light was atrocious and I didn’t want to use flash, so it’s taken at ISO 1600 with as steady a hand as I could manage.

St Bartholomew

(I’d click through to see the full sized image.) It depicts a man with scalpel in one hand, outstretched, and a pair of wicked scissors in the other. Over his right arm there’s something draped, a coat? Then you see that it’s his skin and you see his muscles and tendons, and realize that he’s meant to have flayed himself. (St Bartholomew was one of the twelve apostles and was supposed to have been skinned alive in Armenia.) A disturbing image, especially in a chapel, but strikingly executed.

For the next one, I didn’t make any notes about its provenance but it’s a fun modern metal sculpture of a man in a hat:

Man with hat sculpture

As I mentioned before, the light inside was bad and I didn’t want to use flash. Here’s a great picture of one of the ceilings along the tour:

Ceiling painting

Another just about acceptable photo (1/2 second exposure, wide open, at ISO 1600 – I must have been leaning on something) of the famous violin on the door: it’s a trompe l’oeil painting, not a real violin:

Violin trompe l'oeil

A little easier to take was this portrait of Georgiana, Duchess of Devonshire, as Cynthia from Spenser's Faerie Queene. (If you saw The Duchess with Kiera Knightley, the film was about this rather flamboyant 18th century socialite.) Unfortunately although the light was better, taking the photo full on would have resulted in too much glare. I tell you, it just wasn’t my day for indoor photos.

Lady Georgiana

The sculpture gallery was magnificent. The story here is that prior to filming Price and Prejudice at Chatsworth, the sculpture gallery had tapestries and wall-hangings adorning the walls, and had chairs and couches dotted around. They were removed temporarily for the scene where Elizabeth Bennet changes her mind about Mr Darcy, and the resulting light in the space was so spectacular that after filming the tapestries were not replaced and the gallery was again filled with the neo-classical sculptures that it used to contain. The effect now is breathtaking: the light from the domed skylights illuminating the gritstone walls whose soft color reflects the light evenly over the white marble sculptures. Here’s a couple of pictures of the lions at the far end:

Left lion

Right lion

And this is Ganymede:

Ganymede

See what I mean about the light? After all my difficulties trying to (unobtrusively) take good photos elsewhere on the tour, suddenly it was easy.

Outside, it was trying to rain (and succeeded, off and on). As I mentioned above, there was a display of modern sculpture in the park, so we dodged the raindrops and took some photos. Of particular interest were Legend and Myth by Damien Hirst (again) at the end of the lake. Here’s Myth, the unicorn:

Myth, the unicorn

(You can see the Emperor Fountain running at half-height in the middle distance, and the tarp-covered South Front at the end.)

And here’s Legend, the winged horse:

Legend, the winged horse

I suppose Hirst is exploring here the differences between legend and reality by showing these mythical creatures as having ordinary muscle, sinews, and bone. Or maybe he’s wacky. The sculptures are weirdly beautiful, if austere and a bit cold.

The final piece I’d like to show you is really quite extraordinary. A sculpture of a roaring lion made from steel and used tyres by Ji Yong-Ho. It’s just called Lion:

Lion, made with tyres

It’s raw and menacing with a wonderful sense of frozen movement, and incredibly beautifully done:

Lion, made with tyres

All in all, I think we spent all day there: we arrived before the grounds and house opened, and we left when they were shutting. Quite a wonderful day.

Album cover for The Raw & the RemixNow playing:
Fine Young Cannibals - Tired of Getting Pushed Around [The Mayhem Rhythm Remix]
(from The Raw & the Remix)


Kindle Fire

On the day that Apple announces that they’ve sold a gazillion iPads in the last quarter (and that they can clearly see the near future when more iPads are sold than Windows PCs), I’m going to tell you about my Kindle Fire. Bucking the trend, moi? Wading upstream? Yep, that’s me.

Kindle FireThere are a couple of reasons why I decided to pre-order a Fire when Amazon announced them last September. The first is obvious: I already had and was using a Kindle (a second-generation, international 3G version) and was very enthusiastic about it. I’ve now read ebooks from Amazon on it, as well as technical books from Pragmatic Bookshelf and O’Reilly. I’ve read PDFs that I’ve downloaded to it. The format is great, the device light, and the ability to sync (WhisperSync as Amazon calls it) across all Kindle devices and apps is awesome. Just before Christmas we found ourselves in some fabric store – stupidly, we’d chosen the “up to 50% off” sale day to go – and I read a third of a book on my iPhone Kindle app while waiting for a fabric cutter. Brilliant.

The other great thing about the older Kindle? Annotations and highlights. For novels, meh (although it amazes me that other people have highlighted a Lee Child thriller – “Detection and response. Stage one, stage two. First you spot the threat, and then you react.” – a little creepy, no?), but for technical books it’s a dream. And the text is searchable, to boot. A technical book on an e-reader is the best thing out.

And the other reason for ordering the Fire was the ability to do other things with it. Web, video, games, etc. And in color too!

So, on November 16, UPS delivered my Kindle Fire. My opinion? Almost ideal. It’s perhaps a little too heavy for me, although the size is perfect. I much prefer a seven-inch tablet to the iPad’s ten. Like the e-ink Kindle, it’s about the size of a paperback book. Reading e-books on it is great, apart from the slight heaviness. The web browser works just fine for the sites I visit: I can catch up with emails and the feeds I follow in Google Reader just before going to sleep. The speed of its processor is fine for what I use it for; and I’ve never had any touch issues apart from a tendency for the swipe-to-unlock screen to be a bit hesitant. But, then again, sometimes my iPhone does that too.

I was already a member of Amazon Prime, so I’ve watched hours of free streaming video from Amazon on it. In fact, way more than from Netflix (we’re subscribers to that too) even though there’s a special Netflix app for the Fire. I’ve also used it to replace my iPod Touch as the device I use on flights to watch my DVDs I’ve ripped. (The iPhone/iPad settings in Handbrake work just fine for the Fire.) The only issue with that aspect is that selecting the video file to watch is remarkably hard (the Fire just displays a captured screenshot of the video – no file name – and, if you’re selecting one from several episodes of a TV series, that can be somewhat awkward).

Games? Nope, sorry. Haven’t bought/downloaded/played any at all. Not even Angry Birds. To be honest, that’s not what I bought it for. For me, the Fire is a consumer entertainment device where “entertainment” means videos and books. It’s not for work, although reading tech books is just fine. Mind you, since I wrote about the Fire’s web experience for PC Plus, I can even claim for it on my taxes. Score!

I’ve now updated the OS three times on it (the first was when I initially turned it on: there was an immediate update) and had no problem at all. In fact, I didn’t wait for the “over-the-air” update to happen the other two times: I downloaded the update files directly from Amazon with my PC and just connected the Fire via a USB cable to perform the update. The Fire comes with just a power brick so you have to have a mini-USB cable handy to do this, but since my previous Kindle had one of those, I was golden. (I’ve since bought spares, and my youngest kitten has already chewed through the cable on the power brick so that’s been disposed of. The power brick that is, not the kitten.)

So, all in all, an excellent device. Well worth the $199 for the Fire itself, and the $25 for the cover. If I were to compare it to the iPad, the only thing I would say is that you can buy five Fires for the cost of two of the cheapest iPads. No contest.

Benefits for me:

  • Size is ideal.
  • The whole online Amazon experience. WhisperSync, Amazon Prime, ordering content online, the works. Amazon so have this aspect down pat.
  • Great e-book reader, either with .MOBI files procured from Amazon or sideloaded through USB
  • Great video player, either streamed via Amazon or sideloaded as .M4V files.

Minor downsides, in my opinion:

  • Could be a little lighter.
  • Speed of the web browser – aka Amazon Silk – with “Accelerate page loading” enabled  is still slower than when it’s disabled. WTF?
  • RAM is too small. It should be 16GB at least (or there should be a version with 16GB or more).
  • Uploading with USB is pretty slow.
  • When recharging, the little green power light comes on at 90% full and not 100%. I now ignore it.
  • The keyboard sounds are WAY TOO LOUD. Now permanently turned off.

All in all, recommended.

Now playing:
Bachman-Turner Overdrive - Takin' Care of Business
(from A Knight's Tale)


JavaScript for C# developers: coercion

In C#, we have implicit and explicit conversions. In both cases the idea is that we, the readers of the code, are not surprised by any conversions that happen. That’s why we can freely intermix ints with floats in a floating point calculation and everything turns out just fine. The ints are implicitly converted to floats (there’s no data loss) and the calculation comes out right. However, when there’s a possibility of some kind of data loss (say, converting a ulong to a long variable) you have to explicitly state the conversion in order to say “yep, I know what I’m doing; move along, nothing to see here.” Of course, the explicit conversion does come with an implied contract – that you have, you know, actually determined that the possible loss of data is benign – but otherwise just have at it.

Old pepper millIn JavaScript type conversions are known as coercions. Variables will be coerced automatically into values of another type to make the statement or expression work. Unlike C#’s implicit conversions where there’s no data loss, JavaScript’s coercions can really wreak havoc if you are not paying attention.

One great example I’ve already talked about is the use of the double-equals (equality) comparison operator. If the two sides are evaluated to be of different types, JavaScript will coerce one or both sides to make sense of the comparison. So we get things like this:

var b;
b = 0 == "0"; // true, the "0" is coerced to 0
b = 0 == ""; // true, the "" is coerced to 0
b = "0" == ""; // false, duh, both sides are the same type

var o = {
  toString: function () {
    return "42";
  }
};
b = o == "42"; // true, the object is coerced to a string using toString()

As you can see, the first three assignments show that ‘==’ is not even transitive, going against everything you’ve ever learned; which, if nothing else, should keep you up at night. That’s why the recommendation is to always use triple-equals (identity) as a comparison operator since it does not do any coercions at all. As a handy hint, if you really, really want to use “==”, then you can force the coercion you want rather than the one you get:

var b;
b = "" + x == "" + y; // String comparison
b = +x == +y;         // Number comparison
b = !x == !y;         // Boolean comparison

But really, forget I told you this and just use “===”. Really – you can just thank me later.

At CodeMash 2012, Gary Bernhardt did an awesomely funny presentation called Wat. Watch it, and then come back here. I’ll wait.

The JavaScript parts of Gary’s talk are all to do with coercions. The first one was “what’s [] + []?”, or, in other words, what’s an empty array plus an empty array? The answer is the empty string, and the reason is not that difficult when you think in terms of coercion. The binary “+” operator in JavaScript, like C#, has two meanings: add a number to a number, and concatenate a string to a string. In C#, that’s all there is to it: you’ve got to make sure the types match and you’re done. However, in JavaScript, if the left-hand side and the right-hand side don’t make sense when used with “+”, they get coerced, usually to strings. Since [].toString() is the empty string (toString() on an array will list the contents of the array as strings separated by commas), you get the result Gary showed.

The second example, [] + {}, should now be obvious. Again, values are getting coerced to strings using the toString() method. (The answer is the string “[object Object]”, the default result of calling Object.prototype.toString().)

The third example, {} + [], caught me out at first. To my mind, it should be the same as the second example. This is where it gets seriously wacky. This code:

var result = {} + [];
console.log(result); // "[object Object]
console.log(typeof result); // "string"

produces the results shown in the comments; exactly the same as before. Yet, typing {} + [] in the Console in Firebug produces Gary’s answer of 0. What’s going on?

The answer is that the first {} in the statement is not evaluated as an object, but as a block. It’s an empty block (open brace, no code, close brace) and does nothing. So we’re left with +[]. The unary plus is numeric only, and so the empty array gets coerced to a number, in fact to 0. (In essence, it’s coerced to an empty string, and coercing an empty string to a number produces 0.)

The fourth example ({} + {}) is (a) an empty block as before, and (b) an object coerced to a Number (OK, it coerces to “[object Object]” as a string,  and that string, when coerced to a number, produces NaN).

Mind you, if you ever rely on any of this stuff, please let me know so that I don’t work on the same code as you. Thanks!

Album cover for Classic SongsNow playing:
Taylor, James - Handy Man
(from Classic Songs)


Agile New Year resolutions

I was having a chat with a friend recently about the blog post I published on January 1, the traditional day for writing down on a napkin your resolutions for the coming year. He was saying that it didn’t sound like a bunch of resolutions of the form “I will do this new thing” or “I will change this existing behavior”. It read as more wishy-washy than that.

ResolutionsIt reminded me of something Donna has been saying since the New Year. For the past 6 months or more, she’s been in training to improve her marathon times. To aid in this, she has a personal trainer at the local megaplex gym and goes there twice a week for some kind of torturous exercise. She mentioned that around the New Year the parking lot at the gym was overflowing at the times she went, compared with before Christmas. She had to park further away from the main entrance. However, this week the parking situation has ameliorated and has regained its previous occupancy level. In other words, all those “I gotta get more exercise and lose weight NOW” resolutions have already fallen by the wayside.

Why should this be? If I put my Project Manager hat on, I think it’s because too many New Year resolutions are of the Waterfall type. They’re big. It’s all or nothing. This major change has to happen, and once that’s done I’ll embark on this other major change. Just like in software development, it’s all very well making the big plans down to the last detail (“do this, do that, then do the other”) but they tend to fail more often that you’d like. There has to be more feedback in the loop. Goals have to be more bite-sized, not gulp-sized. Resiliency is the name of the game: unforeseen situations come up that have to be accommodated, be absorbed into the plan. The timetables for goals have to be measured in days, not months, to force them to be automatically smaller and more achievable.

Resolutions have to be Agile, in other words.

And that’s the point of my post and what my friend was remarking on: I am going to make gradual changes to help me reach my far future goals. I am being Agile. For example, with regard to this blog, my ultimate goal is to train myself to write better, to write quicker, to acquire a better facility with the language. Talk about a Waterfall process. Bloody impossible to achieve, that’s what it is. So, I’ve broken it down, made it more Agile. I have a mini-goal of one post a day. Say an hour’s work; 500 words. I have a list of topics on a pad to my left – if you’re a developer, you’d call them stories and probably write them down on post-its and put them on a whiteboard. Some of these stories are small, some wacky, some easy, some hard, some will require research and will take longer. I don’t care. Just so long as I can respond rapidly to what fate tosses in my path day by day.

But, if something transpires (or conspires!) such that I don’t write a blog post one day, it’s fine. It could be that I write two the next (but still dole them out at the rate of one per day) – this has happened tonight and several times over the past month. So long as I do at least 5 per week, I feel that I’m doing well and am on track for my major goal.

Ditto for the rest of my goals for the year. They’re all in train, one small step at a time. Agile resolutions, each resolutely agile.

Now playing:
Abbott, Gregory - Shake You Down
(from Nite Flite)


Tintin: the British cars in The Black Island

I am slowly making my way through the Tintin comic books in the original French, just so I can keep my hand in. I’ve now got to number 7, L’île Noire, or as they say in English, The Black Island.

Les aventures de Tintin, L'île noireLike all of the early books, this was originally drawn by Hergé in black and white. It wasn’t until L’étoile mystérieuse (number 10) that he started publishing them in color, at which point, since they were proving so popular, he went back and redrew and colored the previous 8 (Tintin au pays des Soviets was never drawn in color, probably because it was essentially crude anti-Communist propaganda rather than a cohesive adventure per se) over the next few years. L’île Noire was first redrawn and colored in 1943, but when the British publisher Methuen was ready to print a translation in English in the mid-sixties, they decided that it desperately needed updating. The main reason why was the adventure was set in England and Scotland, and Methuen thought that it didn’t properly depict modern Great Britain at all.

Hergé sent one of his illustrators to England to take some photographs and gather information about places, planes, trains, and automobiles, and on his return they redrew L’île Noire completely and reset the plot to 1966. As a kid, when I first read it, L’île Noire therefore really resonated. We’d just moved to Le Havre (which is why I was reading it in French in the first place) and the look of the whole book was quintessentially English to me. Especially the cars that Hergé and his studio drew. Imagine you are 7 or 8 again: you like cars, you can spot them and name them, you pay attention to such things. So I thought it would be fun to identify here all the British cars that appear in L’île Noire.

The adventure starts off in Belgium, but pretty soon the plot moves to Sussex. The first car we see is the blue taxi that Tintin takes from the station to Eastdown, where a suspicious plane had crashed:

Tintin-Ford Zephyr

It’s a blue Ford Zephyr (to be precise, a Ford Zephyr 6 Mark III, characterized by the split grille at the front and the rear lights sloping outwards at the top).

Unfortunately Tintin is being pursued and is captured by the baddies in a red Jaguar Mark X:

Tintin-Jaguar Mark X

This one is not I fear one of Jaguar’s prettiest cars, with its forward sloping front grille.

Some adventures later, the baddies escape in the Jag, and Tintin has to flag down a couple in their car – it’s pulling a caravan:

Tintin-Triumph Herald

It’s a Triumph Herald. A convertible to boot. It’s hard to tell from the drawing, but if it is an original one then it only has a 948cc engine. No wonder it was having problems pulling the caravan. In fact the caravan, in which Tintin was travelling, broke loose and crashed. Tintin was forced to flag down another car  to continue his pursuit:

Tintin-MG 1100

This one is perhaps a little harder to identify, since the basic shape was used by British Leyland throughout their marques (Morris, Austin, Riley, Vanden Plas, MG, Wolseley), but it’s an MG 1100. Not my favorite cars from the 60s at all, with Hydrolastic suspension copied from the Citroën 2CV, and built at Cowley when the unions were at the height of their power (so the quality was pretty crap).

But what’s this? The baddies have crashed into a tree and escaped on foot to the nearest station! And so we get a glimpse of our last car (the other half of the book just involves trains, planes, and boats):

Tintin-Rover P6

Although we only see the rear third of that blue car, it’s obvious what it is: a Rover 2000TC (aka the Rover P6), the preferred police car in the late 60s, early 70s. It was also the car that Princess Grace of Monaco was driving when she crashed and died from her injuries in 1982.

And there we have it, a nice little quintet of mid-60s British cars from the only Tintin book set in Great Britain.

Now playing:
Les Jumeaux - Miracle Road
(from Café del Mar, Vol. 4)


PCPlus 303: How it works: high definition video

The suggestion came from the top: “how about an article on HD video, HD TVs and all that?” When you get those kinds of suggestions, you don’t raise trivial issues like the fact you don’t even have a TV, let alone an HD TV. You File New in Word and get to work.

PC Plus logoYep, it’s true. We don’t have a telly. It goes back to the days when I first came to live in the States in 1993. I thought I’d only be here a couple of years. I was still paying the mortgage on my flat in London, so I wanted to save up and not blow it on an electronic behemoth that I couldn’t ship back (it wouldn’t have worked – different voltage) nor on the cable subscription to feed it. So, no TV in the Bucknall bachelor pad. Then when I started going out with Donna and it was obvious I was going to stay in the US, she was studying law for a JD and definitely didn’t want a TV. That absence has not made the heart grow fonder: nowadays it’s much easier to watch TV drama via Netflix or Amazon.

Nevertheless, writing about high definition video was quite fun in the end. I actually learned a lot about the whole television process, especially as it’s so different between the UK and the US. There were topics like interlacing, telecine, blur, bilinear interpolation, upscaling, and so on, to research and write up. And I’ll admit it feels good that I can now spot the comb effect from progressive scan on older shows converted to DVD and furthermore explain why it happens. Geek.

All in all, a great little article, even if I say so myself. I think the man on high was pleased with it too.

This article first appeared in issue 303, January 2011.

You can read the PDF here.

(I write a monthly column for PCPlus, a computer news-views-n-reviews magazine in the UK (actually there are thirteen issues a year — there's an Xmas issue as well — so it's a bit more than monthly). The column is called Theory Workshop and appears in the Make It section of the magazine. When I signed up, my editor and the magazine were gracious enough to allow me to reprint the articles here after say a year or so.)

Now playing:
Visage - Visage
(from Fade to Grey: The Singles Collection)


HTML5 and validation issues with this blog

OK, I was nuts. If it ain’t broke, don’t fix it, right? But what the heck, it’s part of the technology stack I’m supposed to know and use and promote, and furthermore I have a text editor and know how to use it.

HTML5 logoThe issue is I’ve switched this blog to HTML5 markup rather than XHTML, which is what it was before. No sweat, you snort, the doctype is way simpler:

<!DOCTYPE html>

and you can get rid of that other XML namespace gubbins on the <html> tag:

<html lang="en">

Nice and easy. Morceau de gâteau. Yeah, that’s what I thought. Except when I then ran the W3 validator on it I got a rather bizarre error on the <html> tag: “application/xhtml+xml is not an appropriate Content-Type for a document whose root element is not in a namespace”. Whuuuuut?

Some searching later (and boy, was I getting ratty about it), I managed to piece together what was happening. So in the interests of getting this out there in some searchable fashion, here goes.

When you visit a website in a browser, you send along a request to the site and part of that request is the Accept header. Here’s what Firefox sends for the Accept header for the main page for my blog, as an example:

text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

What this says (roughly) is that Firefox will accept an HTML document, an XHTML document, or a plain XML document. All of the other browsers send something similar. IIS7 (the web server my hosting service uses) notes this and replies with a response that has the following Content-Type header:

text/html; charset=utf-8

Magic. “Hey, Firefox, got your request, and here’s an HTML document for you.” That’s supposed to be what happens. All is good.

Unfortunately for me, the W3 validator was sending a similar Accept header as part of the request, but IIS7 was deciding – all on its lonesome – that it was going to send back this Content-Type header instead:

application/xhtml+xml; charset=utf-8

At which point, the W3 validator was going to start complaining that the document it got wasn’t valid XHTML, and in particular there was no XML namespace declared in the <html> tag. Without that, it gave up trying to decipher the document (that is, the web page) because the markup failed the first validation question of all.

So why was IIS7 deciding that it should declare the document as containing XHTML or XML? Who knows. There’s an interesting blog post from some chap at Opera that seems to suggest that, absent any other clues, IIS7 does some user agent sniffing and makes some kind of decision based on that. Maybe it was doing the same with the W3 validator. That left me with a problem though. How could I fix this, given that my access to IIS7 on my hosting company is pretty thin?

Luckily, I use GraffitiCMS to serve this blog. GraffitiCMS is open source, so I can change it if needed, which is what I did. I opened up TemplatedThemePage.cs (all public-facing pages are of this type), and added this line of code in the OnLoad method in order to force the response’s Content-Type to HTML:

protected override void OnLoad(EventArgs e)
{
  base.OnLoad(e);

  Response.ContentType = "text/html"; // force HTML type

  Initialize();

  //...

No more was I going to allow IIS7 to decide for me. A quick recompile, and then I uploaded the DLLs to my site, and the W3 validator was satisfied that the content was HTML.

And then proceeded to detail a bazillion errors.

There are two big ones that I want to talk about right now. The first one is the Grooveshark widgets I’ve been using recently. In essence, they’re copy-and-paste object elements from Grooveshark, and they break W3’s HTML5 validation big time. I really can’t be bothered to work out the changes I would need to make every time I use them, so as soon as I have time to update each post, they’re gone.

The second one is a small bug in Windows Live Writer (and I’ve just reported it). For images, WLW adds a border attribute to the img element – specifically border="0" – and HTML5 has deprecated that particular value for that particular attribute, suggesting that you use CSS instead. Hence every image on my web pages produces a warning. The problem is there’s no way to alter the default HTML markup that WLW produces for an image, and so I will have to go in to the Source View to edit the markup for every blog post to remove the warnings. Oh joy. Looking forward to that when I have time, although it can be done with a simple search/replace.

There are some other small bugs (can’t have the clear attribute on a <br /> tag, etc), but they’re pretty easy to fix (an easy search/replace again).

After that I can start experimenting with the site’s templates to use header and footer elements, and so on; the whole panoply of HTML5. Stay tuned for more news on that.

Album cover for The Original SoundtrackNow playing:
10cc - Une Nuit a Paris: One Night in Paris, Pt. 1/The Same Night in Paris, Pt. 2
(from The Original Soundtrack)


Protesting SOPA/PIPA

Just some warning that tomorrow, Wednesday 18 January from 8am to 8pm EST, this blog will be going on strike to protest SOPA/PIPA. The protest encompasses sites such as Wikipedia, BoingBoing, and even Google will have some kind of protest statement on their home page.

Should you wish to join this protest with your blog, you can get the JavaScript code here.

A Richmond walk

Last September, we stayed in Richmond, North Yorkshire, for a few days in order to go visit the graves of my parents – it had been the first opportunity for us to see the gravestones and to pay our respects. As is normal the day we arrive in England, Donna was really tired (it’s an effect of the travel medication she takes), and so I left her napping and went on a little walk around Richmond, a town that, although I knew superficially around the market place and the Castle, was not one I’d explored in any great depth.

We were staying at the Frenchgate Restaurant & Hotel which is, appropriately enough, on Frenchgate, a cobbled cul-de-sac that was once an important thoroughfare, but which was now sidetracked by the main road through Richmond. I can well recommend this hotel-restaurant, we enjoyed every moment and every meal we were there. The room we had was great (I love heated floors in bathrooms) and very cosy and quiet. The staff were extremely welcoming. Quite a find, and we will certainly be staying there this September again. Anyway…

Down Frenchgate

This is the view down Frenchgate (behind me is the stairs up to the A6108, aka Pottergate). The sign you can see on the right is the hotel and, of course, in the middle distance is Richmond Castle.

Lombard's Wynd

Right at the top is a side path going down the hill, known as Lombard’s Wynd (pronounced wind as in a winding path, not wind as in a breeze). It broadens out in a little while to a narrow street.

National School

An old schoolhouse on Lombard’s Wynd. It’s now a private house but as far as I can gather it was an old primary school. Not sure when it was closed down.

Richmond Castle

After crossing the old Railway bridge (as in, the bridge that led to Richmond Railway Station – now no longer a station), I dropped down to the River Swale and took this picture of the Castle…

Richmond Lower School

…and this picture of Richmond Lower School through the arches of the bridge.

Street sign

I then crossed back over the bridge, and walked through the park along the river bank. This was on the side of a house at the end of Park Wynd – I just love the typography.

Millgate

Then it was time to walk up Millgate towards the Castle.

Number 1

Unfortunately Castle Wynd was blocked by construction (a house was being renovated), but I snapped number 1. I can’t remember exactly, but I think number 2 was up those stone stairs to the side.

King's Head

After that I walked into the Market Place, past Mum & Dad’s solicitors at the end of Millgate, and up past the King’s Head, which, I must admit, had a remarkable show of flowers.

St Mary's Church

It was getting a bit late at that point, the sun was going down, so I walked down Ryders Wynd to Frenchgate and took this picture of St Mary’s Parish Church in the evening light before returning to the hotel.

Album cover for RiptideNow playing:
Palmer, Robert - Riptide
(from Riptide)


Search

About Me

I'm Julian M Bucknall, the M because it's my middle initial and because I and the other Julian Bucknall (the movie guy) would like to differentiate ourselves.

I'm a programmer by trade, an actor by ambition, and an algorithms guy by osmosis. I write articles for PCPlus in my spare time, not that there's much of that.

Julian M Bucknall Apart from that, an ex-pat Brit, atheist, microbrew enthusiast, Pet Shop Boys fanboy, slide rule and HP calculator collector, amateur photographer, Altoids muncher.

DevExpress

I'm Chief Technology Officer at Developer Express, a software company that writes some great controls and tools for .NET and Delphi. I'm responsible for the technology oversight and vision of the company.

Validation

Validate markup as HTML5 (beta)     Validate CSS

Bottom swirl

Archives

January 2012 (22)
SMTWTFS
« Dec  
1234567
891011121314
15161718192021
22232425262728
293031

Like this Archive Calendar widget? Download it here.

Social networking

Google ads

The OUT Campaign

The OUT Campaign

My Tweets

  • I know Google is a big faceless organization, but they think my age is 35-44. #corporationsarepeople #googleissexy30yearoldwoman
  • Blog post: The popularity of “could care less” cannot be underestimated http://t.co/xCT4646p
  • @ardalis Funny that: I've been seeing the "bring GraffitiCMS to its knees every now and then" problem recently too. Reading your post...
Bottom swirl