james mckay dot net

because there are few things that are less logical than business logic
05
Jun

Keyboard switching in IE8 is insane

Earlier this week I took delivery of a new laptop at work. Because I use Colemak with my Microsoft Natural 4000 keyboard and qwerty when the ergonomic option is not available (unfortunately I find flat keyboards and Colemak just don’t mix, though the Colemak/ergo combination is light years ahead in terms of comfort) this means I am likely to be switching to and fro between the two layouts a lot more on the same machine.

Unfortunately, the Windows keyboard switcher is completely insane in this respect. It’s maddening that it sets your keyboard layout separately for each individual window rather than letting you set it across the board for all the windows that you have open, and even more so that it doesn’t give you an option to change this behaviour.

But it gets worse. In IE8 you can set the keyboard layout individually for each tab. This meant that at one point this morning I had Colemak in Twitter and qwerty in the browser’s address bar.

Yes, I know there’s the whole thing about each tab being in a separate process, but Google Chrome has a similar architecture and gets this right. Microsoft: this is a bug, not a feature. Please fix it.

05
Dec

Do antivirus scans really need to brick your computer?

Pretty much every antivirus software package that I have ever used has a really annoying flaw. Whenever it launches into a full system scan, it slows your computer down so much that it hardly even responds to your keyboard and mouse. Given that a typical PC has up to half a million files knocking around on the hard disk, such a scan takes a good couple of hours at least.

It seems that when they perform a scan, they process the files back to back, which results in a lot of churning of your hard disk as the heads continually seek all over the place to find the next one. The fact that they’re both processor intensive (with fairly complex heuristics and pattern matching algorithms) and hard disk intensive means that during this time, they effectively brick your PC for a good two hours or so.

I’d have thought it would be fairly easy for them to fix this, by introducing a pause between each file (or each chunk of a file, for larger files) to give your computer a chance to respond to user input in a timely fashion. They could go in to a fast mode if you were running a screensaver, but while you’re actually trying to get some work done, you really want them to ease off the gas.

Unfortunately, I’ve not yet come across any antivirus programs that do this. Why not?

12
Apr

Trying out speech recognition in Windows Vista

Over the past few months I’ve been rather intrigued by some of the reports that I’ve read about Windows Vista speech recognition.  For example, Scott Hanselman claims an increase in speed from approximately 72 words per minute when typing to about 125 words per minute with voice recognition—an improvement of approximately 75%.

Now Hanselman works for Microsoft, so it is only natural that he would give something to do with Windows Vista a glowing report, and let’s face it, a typing test is actually a very artificial way of trying out this kind of thing—you’re not chopping and changing all the time but reading verbatim off the screen.  Other people are less complimentary.  Microsoft’s ill fated demonstration of Vista’s speech recognition went down in history, with the immortal phrase “Dear aunt, let’s set so double the killer delete select all” appearing on the evening news and geek T-shirts.

I haven’t actually used Windows Vista that much until recently.  My old laptop only had Windows XP on it, and I use Windows Server 2003 at work.  However, a couple of weeks ago I got a new laptop, complete with Windows Vista, so I thought I might as well put it through its paces, and so today, I’ve been trying it out.  I’ve set myself the goal of writing a complete blog entry without using the keyboard or the mouse: opening Windows Live Writer, navigating Firefox and Google Reader, finding other pages that I want to reference, and inserting hyperlinks, using speech alone.

My experience so far has been more along the lines of the ill fated demonstration than Hanselman’s glowing report, but to be fair, it’s still early days.  Initially it was painfully awkward, and after a few hours it’s still pretty clunky, but it does seem to be learning from its mistakes and it does get it right about 80% of the time.  The problem is that the 20 per cent of the time when it doesn’t get it right, or when you want to chop and change things, it is very slow and fiddly.  Some things don’t even work: “show numbers” doesn’t show numbers correctly for hyperlinks on Ajax enabled sites in Firefox, and your blog’s category names don’t appear in the “categories” drop down list in Windows Live Writer.

Yes, it’s more comfortable than using the keyboard, but it does take a lot longer, and thoughts only trickle from your brain into your document rather than flowing.  It is also pretty frustrating if you keep chopping and changing things, as I do when I’m writing. Perhaps if I persevere at it I might find it improves, but I don’t think we’re going to be dispensing with our keyboards anytime soon. 

10
Apr

Windows upgrades break Media Player 6.4

One of the systems that we have developed serves up WMA files dynamically and plays them in an embedded Windows Media Player. Because this system has been around for a few years now, it still uses the old classID for Windows Media Player 6.4 rather than the newer one for versions 7-11. That was all very well: this works fine with the later versions, it doesn’t have to do anything particularly fancy, and besides, it did the job admirably well.

Until Microsoft rolled out their latest set of Windows updates this week, that is. All of a sudden, users were reporting that Internet Explorer was crashing all over the place. However, if they rolled back to IE6, everything worked fine.

It turned out that we were serving up some of our sound files with a content type of “application/octet-stream” rather than with the expected “audio/x-ms-wma”. This was fair enough: Postel’s Law says that you should be liberal in what you accept, but conservative in what you do. So even if we weren’t getting it quite right, Windows Media Player was forgiving us.

Unfortunately, on Patch Tuesday, Postel’s Law went out the window at Microsoft’s end as well as ours. And rather rudely, to boot. No “invalid content type” messages or anything: Internet Explorer would just freeze.

To fix the problem, you need to do one of the following (preferably all three, despite the fact that there may be certain logistical issues with the third):

  1. Make sure you are serving up the correct MIME type with your media files. For WMA audio files it should be “audio/x-ms-wma”. For other media types see here.
  2. Change your web pages to use the newer class ID for Windows Media Player. It should be 6BF52A52-394A-11D3-B153-00C04F79FAA6 rather than 22D6F312-B0F6-11D0-94AB-0080C74C7E95. Note that some properties change names between versions: in particular, you use “url” rather than “src” in the later version.
  3. Tell your users to jettison Internet Explorer altogether and switch to Firefox or Safari.

Talking of point 3: can someone please explain why the Windows Media Player Firefox Plugin doesn’t install on Windows Server 2003? Windows Server 2003 is just supposed to be Windows XP on steroids with a bunch of configuration tweaks and extra bells and whistles and an inflated price tag, surely? Or is there some genuine good technical reason for this seemingly inexplicable design decision?

17
Dec

Making the "zoom" slider on the Microsoft Natural 4000 keyboard do something useful

Unapologetic mindless link propagation time — this is just way too useful to let it slip: Olivier Dagenais on a hack to make the "zoom" slider on the Microsoft Natural 4000 keyboard function as a "scroll" slider. (Hat tip: Ayende).