Tuesday, April 24, 2007

Happy 25th Birthday!

As various sources have reported, yesterday was the 25th birthday of the ZX Spectrum - the launchpad of many a software developer (myself included). The speccy was my first home machine, originally in the 16k flavour before quickly getting it returned and upgraded to a whopping 48k.

In honour of this auspicious event, allow me to donate a completely useless piece of code - isn't it amazing what rubbish gets stuck in your head? I've not touched a Spectrum since, oooh, 1990 or so and I could still remember the POKE involved without having to look it up. Sad really....

10 LET A$="Happy 25th Birthday Speccy!"
20 FOR X=1 TO LEN(A$)
30 FOR Y=15 TO 0 STEP -1
40 POKE 23606, Y
50 PRINT AT 10, X; A$(X)
60 NEXT Y
70 NEXT X

Fire up a Spectrum emulator, type in the listing and see what it does! It's hardly OpenGL, but what the hell!

 Wednesday, January 03, 2007

Petition

As a long standing atheist (product of a Roman Catholic education), I have long been uneasy about the grip on education exerted by various religious groups – be they Islamic, Church of England, Roman Catholic or Pastafarian.

One of the presents I was given over the festive period was Richard Dawkins' superb "The God Delusion" (yes, I am aware of the irony) - a book which I suspect will only be preaching to the converted, because those that really need to read it will have had their minds long closed to the uncomfortable truth. This tome has convinced me that it's about time that atheists stood up to religion in areas such as education - there is no excuse in this day and age for any institution to promote one divisive creed above another, and with the rise of nut-job fundamentalists who are determined to promote rubbish such as Creationism and 'young-earth' doctrine the need to take a stand has never been greater.

Why on earth should my daughter be indoctrinated by the school she attends?

For those that feel the same way as me, I would urge you to visit this online petition and make your feelings known. It's unlikely to have an immediate effect (especially with our current Prime Minister), but over time it might serve to influence future occupants of Number 10. We can but hope.

 Friday, December 08, 2006

Testing Times Concluded

I shouldn't have got myself so wound up about the 70-536 exam I did this morning. The 'real world' questions were not nearly as bad as the Training Kit had me expecting, and there certainly weren't any howlers like the example I posted yesterday, so it came as a great relief to pass comfortably.

Mind you, it looks like I'm not the only one to have issues with the quality of the official Training Kit.

 

 Thursday, December 07, 2006

Testing Times

I'm sitting the 70-536 (Microsoft .NET Framework 2.0 – Application Development Foundation) exam tomorrow, and I sincerely hope that it's of a higher quality than the learning materials Microsoft provide for it. I've been testing myself using the official MCTS 70-536 Training Kit, and running the example tests provided.

What's disconcerting is that some of the questions are just plain wrong; here's an apposite example:

Which of the following code samples is the most efficient and compiles correctly?

  1. string s = null;
    s = "Hello";
    s += ", ";
    s += "World";
    s += "!";

  2. string s = null;
    StringBuilder sb = null;
    sb = "Hello";
    sb += ", ";
    sb += "World";
    sb += "!";
    s = sb.ToString();

  3. string s = null;
    StringBuilder sb = null;
    sb.Append("Hello");
    sb.Append(", ");
    sb.Append("World");
    sb.Append("!");
    s = sb.ToString();

  4. string s = null;
    s = "Hello";
    s += ", ";
    s += "World";
    s += "!";

So what's the correct answer? Not only do we have two identical options (1 and 4), but they also happen to be the only ones that will compile and execute. 2 is wrong because StringBuilder doesn't accept the "=" or "+=" operators, and 3 also shares the problem that the StringBuilder is never instantiated. Guess which option the test exam says is correct?

Can't say it fills me with much confidence for tomorrow...

 Thursday, November 30, 2006

Elevate Privileges Shortcut

I stumbled across a useful shortcut in Vista for elevating privileges; often you'll need to run a command prompt or another application as an administrative account (if you want to run bcdedit for example). One way is to bring up the Start menu with the Windows key, and type cmd (or the name of the application you want to start) - in a moment you'll see an icon for the command prompt. You can then right click the icon to get the "Run as administrator" option, or (and this is the useful bit!) simply press Shift-Control-Enter to execute as opposed to just Enter to execute and you'll be prompted by the ususal User Account Control dialog.

So, to recap:

  1. [Windows Key]
  2. Type name of application or executable name
  3. Shift-Control-Enter

Unfortunately this shortcut doesn't work with the Run dialog ([Windows] + R)