Blue screen of death

Oliver Brown
— This upcoming video may not be available to view yet.

My computer is now essentially dead. Luckily I have internet access at work and an hour lunch break :D

It’s been getting increasingly unstable for the past month or so giving me random blue screens of death. Sometimes I get a driver reference that caused the problem (and they are different drivers each time) and sometimes I don’t. Yesterday it managed to crash while trying to display the Windows log-in screen and I was left with just a cursor on black screen.

Since I now have money and it’s old anyway (Athlon 1.2GHz - back when AMD named their processor after their real speed), I’m not so bothered.

JavaScript debugging with Internet Explorer

Oliver Brown
— This upcoming video may not be available to view yet.

Ever had a problem with JavaScript? If you don’t realise that’s a rhetorical question then go away now…

I had a simple script that worked fine in Firefox and Opera but not in IE. I got the amazingly useful message “Object expected” at line 0, character 0. So after looking around for a bit I found the Microsoft Script Debugger. And it’s actually quite good. Not as convenient as Firefox (since most of my problems are syntax errors) but it solved my problem. And in a way, I can blame Firefox and Opera for the problem. Maybe.

“class” is a reserved word in JScript (IE’s JavaScript engine) but it isn’t in Firefox and Opera. Perhaps it should be. Then perhaps not since contrary to popular belief, JavaScript (or technically ECMAScript) is not an object orientated language (at least not in the traditional sense), it’s a prototype language.

The main difference is a prototype language does not have classes (which is why “class” is not a reserved word in Firefox or IE), objects are given functionality on a per instance basis.

All this is rather academic though. If you need to debug JavaScript in IE for whatever reason, get the debugger. And ignore the link that says there is a newer version available - it’s pointing to Visual Studio .NET 2003.

Star Trek XI announced

Oliver Brown
— This upcoming video may not be available to view yet.

Ironically I found this out while reading an article on a wrestling site.

Apparently the new movie will be directed and produced by J.J. Abrams, a guy famous for Lost, Alias and Mission Impossible: III and is scheduled for a 2008 release. In a risky move the story will apparently focus on Kirk and Spock’s first meeting at the academy during the early days of the Federation. How they do that with William Shatner and Leonard Nimoy as old as they are is a beyond me, unless they use new actors which is an immensely bad idea.

Oh and they’re apparently not involving Rick Berman in the project at all…

Info on StarTrek.com.

Star Trek, William Shatner, Leonard Nimoy, science fiction, sci-fi, TV

t.A.T.u - How Soon is Now - Stepmania Simfile

Oliver Brown
— This upcoming video may not be available to view yet.
t.A.T.u - How Soon is Now

t.A.T.u - How Soon is Now

One of the reasons for my sudden mention of Stepmania will now be revealed: I’ve created some Stepmania step charts for “How Soon is Now” from the album “200 km/h in the Wrong Lane” by t.A.T.u..

The download is available as an smzip file so it should be a matter of downloaded it and running. It contains the steps as both .sm and .dwi files as well as a background image and banner image. It does not include the music file. Although I realise that technically the images are just as subject to copyright as the music I’m more confident about my host not being bothered.

The step files were synced to the music ripped off the album “200 km/h in the Wrong Lane " which is how I suggest you get the file but I’m sure you can work how to get it some other way if you want it. It has all the difficulties except basic although the challenge difficulty may not be possible (I just used the difficult one and applied modifiers) but it’s all fun anyway.

And I know neither of the images are really anything to do with the song :P How Soon is Now - Download (219kB)

Switching to a Mac is getting easier

Oliver Brown
— This upcoming video may not be available to view yet.

Unless you’ve been living under a rock for the past couple of weeks (possible admittedly - you could have been on holiday) you’ve probably heard that you can now run Windows XP on an Intel Mac using Boot Camp. This could be a great step forward for Apple with regards to capturing Windows users.

Firstly I don’t think Apple will capture the casual market, at least not in the near future. However much certain Mac enthusiasts may claim Macs are easier to use, a Windows machine does everything the casual user wants it to do (and because of the market share of Microsoft it does it the way the expect it to. Not only that but some of the details about installing Windows on a Mac are too much for the casual user (look for the confused look when you explain to them that if they use an NTFS partition to put Windows on the Mac won’t be able to write it. Then see how they laugh when you mention FAT32 as an alternative). The slightly more technical fraction of the market is much more obtainable.

Those with enough confidence with computers to manage the transition may now be willing to make the change. Before, buying a Mac was a big step. Unless you wanted to have two computers it meant giving up a lot. Now you can have the best of both worlds with just one computer. For developers this could be great. With the increasing success of Mono as a cross platform development environment, have a single computer to test everything on (whether it’s been done or not I’m sure it’s technically feasible to run Linux on an Intel Mac). This will ultimate increase the number of developers able to work with Macs and the whole things spirals outwards.

Perhaps.

Free advertising

Oliver Brown
— This upcoming video may not be available to view yet.

TextLinkAds are offering $100 of free text link ads. The catch? You have to buy $125 of advertising. The catch isn’t as big as you’d think. I assumed it meant you spend $125 and get another $100 free, but it doesn’t. You order $125 worth of advertising and only pay for $25. You still need to be careful though. You’re actually ordering a subscription and if you don’t cancel within a month you will be charged again.

TextLinkAds sell hard coded text links (oddly enough) on publishers websites. Hard coded means detectable by search engines. And you can get them at one fifth the “normal” price. To qualify just enter “New client” as the coupon code.

Going more mobile

Oliver Brown
— This upcoming video may not be available to view yet.

I announced limited support for mobile devices viewing the blog recently. That support basically only covered phones with Opera Mini.

Well now I have a WML theme installed so you should be able to view the site with any WAP device.

You can force WML output with any browser though (although most browsers do not understand WML).

Detecting Mobile Phones

You’re first instinct is probably to check the user agent. Although it’s true there are fairly consistent ways to detect a phone from the user-agent there is a better way.

One of the many under-utilised headers that browsers always send (well 99.99% of browsers you encounter will) is called Accept. This is just a list of MIME types that the browser can handle. Since all mobile phones (as well as PDAs can display WML pages, we’ll use this as the basis to detect mobile devices. The MIME type for WML pages always seemed rather odd to me: text/vnd.wap.wml.

if (strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false) $mobile = true;

Now we need to find out if the phone can accept XHTML Basic (or XHTML Mobile Profile or whatever) in pretty much the same way:

if (strpos($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') !== false) $xhtml = true;

Many “real” browsers are inconsistent with regards to the MIME type for XHTML. As far as I know since mobile phones do not have any sort of backwards compatibility issues they all use the proper application/xhtml+xml.

XHTML Compliant - Thrice!

Oliver Brown
— This upcoming video may not be available to view yet.

I tried validating the markup and my site and found a few errors (nobr tag not allowed, span tag not allowed inside a ul and few others) so I fixed them and I’m XHTML 1.1 compliant once again. That is the home page and a few random pages I tried are compliant. There are probably some posts with random stuff that isn’t…

The main reason I did it was for the sake of any mobile browsers that might complain really loudly about bad markup. So I started reading about XHTML Basic what exactly was and wasn’t allowed. Well I couldn’t find anything useful so I just tried validating as XHTML Basic 1.0. I had to remove script tags, style attributes, replace i with em and again, a few other minor things. The end result is that an XHTML Basic version of the site is available to mobile browsers. Since I don’t have a mobile browser to test it on I can’t guarantee I’m detecting them properly yet. If you want to see what it looks like though, just go to Oliver Brown - Basic.

Then I discovered that it’s mainly PDAs that use XHTML Basic and that mobile phones tend to want XHTML Mobile Profile (XHTML MP also called WAP 2.0). Just changing the doctype was enough to get XHTML Basic to validate as XHTML MP. You can check it out at Oliver Brown - Mobile (it looks the same as Basic).

Just to let you know, when browsing the other versions manually all the links bring you back to the normal site - you actually need a browser detected as being a mobile phone for it to work properly.

AJAX problems in IE

Oliver Brown
— This upcoming video may not be available to view yet.

One of the things I’m working on right now (at work interestingly enough) uses a fairly simple JavaScript function that takes a url and an element id and replaces the content of that element with whatever the url returns.

This worked well until I started getting an odd error from IE - Unknown runtime error. Firefox and Opera both handled this fine. After some fiddling I discovered the problem was the type of element I was replacing into - Internet Explorer doesn’t like you replacing the innerHTML of certain elements.

So far I’ve found TR and TBODY don’t work (and I’d guess THEAD and TFOOT too).