How to Shoot Yourself in the Foot

Kids, don't program tired. And don't try to fix things when you are tired. Otherwise you'll do stuff like what I just did. I've been trying to get a Wiki to work on my office PC. FlexiWiki, the wiki I'm using (by the way - wikis are great) is run by a bunch of Active Server pages. So I copy all the files onto the web root on my office PC and try to fire them up. I get a page not available error in the browser.

Ho hum. All of my asp pages are broke. So I Google the item in the event log and sure enough, a security patch has changed the protection such that you have to give the ASPNET account more access when it runs. OK. I'm equal to that, but setting file and directory protection is something I use the cacls program for. It is a command line program and very dangerous in the wrong hands - i.e. mine.

I have to give the ASPNET account permissions in a variety of directories, including System32. OK, so I work out the commands that I need and I type them in for each directory. And then my cacls program stops working. Along with lots of other commands. This is bad. Very bad. My machine is becomming a paperweight before my eyes. And then I remember. If you don't use a special option to cacls (the /E option) it doesn't add the new settings to the directory, it replaces them. So, the only person who can now look in the System32 directory is ASPNET. And he is not logged in at the moment. And the cacls program lives in, wait for it, System32!

So, I can't run the only program that I can use to fix the problem that I have made for myself. I think I said a dirty word at this point. The only ray of light is that I'm doing this from home, using Remote Desktop. I therefore have on my home PC a proper copy of cacls which I promptly email myself at my office. Once I have the program somewhere I can run it, things can be got back to normal and all my commands brought back from the grave.

And now I'm going to bed......

Nobody knows the answer

OK, since nobody knows how to solve this one I'll post the answer tomorrow. If you want a clue; it has to do with construction.....

Oh, and in case you are wondering where I've been, I've spent a very happy time at an MVP (Most Valued Professional) day in Reading. Many thanks to Lorna and the team for making us so welcome and the time so interesting.

I reckon that in every age the people around must have reckoned theirs is the most interesting time to be alive:

"This new fire stuff really looks like a neat idea...."

"These steam engines are ushering in a new age..."

"Now that we've got electricity things are really cooking...."

However, I reckon now is most definitely the most interesting time to be around. From the chats that I've had with Microsoft people and others over the last day the changes that we have seen (which are amazing) are pretty darned small fry compared with what is coming over the horizon. It seems that everything is going to be connected, intelligent and useful. I'm not saying that I've seen the future and it works. But I've had a little glimpse of where we are going and it sure looks like fun!

Exam Question 2

Well done folks. Yes, the breaks were missing, which is an interesting foible of C, C++ and Java. I'd used this in a good way:
case 'a':
case 'A':

This makes sure that the code will work for upper case and lower case command letters. However, it also means that the program continues when you don't want it to:

case 'A':
case 'd':
case 'D':

Once the program has performed the AddEntry it carries on and does the delete, which is not what you want. You have to explicitly end the case clause:

case 'A':
case 'd':
case 'D':

C# will not let you do this, which is nice. In C# you have to explicitly chain the cases together. Of courese, I'd probably convert the command to upper case before the switch if I was really writing this code. It makes the code smaller, faster and clearer.
The missing break is one of the most common typo based programming errors. Two others that I've seen are:
for ( count = 0 ; count < limit ; count++ ) ;
// something in here which happens when you dont expect it

if ( x = 5 ) {
// at least Java won't let you do this one

Beginning programmers think that their work is done when the program compiles. Ha! If you like a good read and want to know about this kind of thing you should read Code Complete. In fact, if you haven't read this book I don't think you are a programmer at all!
And so to question 2. A couple of classes which won't compile. They are in the right source files, so what is going on here?

public class Person {
String name ;
public Person ( String inName ) {
name = inName ;
public class SecurityGuard extends Person{
int securityLevel;
public SecurityGuard ( int inSecurityLevel) {
securityLevel = inSecurityLevel ;

I've just discovered that Steve McConnell is writing another editiion of Code Complete. Wahay! Incidently, he has also written some of the best books ever on project management. Take a look at Rapid Development if you want to find out how to really do it!

Ninja Gaiden

Got another XBOX game. The man in the shop said it was a bit tough. "The first boss is the worst" he said. "Just remember to keep moving and blocking". Wow. Was he ever right. Number one son has been grappling with it and still not got past this bloke and his nun-chutcas (or however they are spelt).

An interesting approach to game design; put something in there which makes the game virtually unplayable around 1 hour in.  The good news is that the graphics and atmosphere mean that we are going to work at this until we beat the guy. And once we have got some experience we're going to set out on XBOX Live and see how we do. Me, I still prefer Steel Batallion. I'm not really very good at it, but the fun of pressing all those buttons is tremendous.

There is no such thing as slightly garlic

The package looked innocent enough. Slightly Garlic Sausage. "Oh well, makes a change from Smoked Ham" I thought, and slung it in the basket. I made my sandwich with it this morning and took it to work. My office began to smell of garlic. Strongly of garlic. I've eaten the sandwich now and I probably smell of the stuff as well (although I can't smell it in the office any more - funny that). We are having a project viva in here in half an hour. I hope Ope likes garlic, although she is too polite to mention the pong even if she doesn't.

I should have remembered that there is no such thing as slightly garlic. It is indeed funny stuff. Apparently it is one of those rare chemicals which you can absorb through your skin. Put on a pair of garlic socks and, shortly afterwards your breath would smell of garlic. Ugh. I've just thought - garlic socks, now there's an idea worth running away from...

The Love of Randomness

The new firmware in my Jukebox has a wonderful feature. Todally random play. It just picks up a track from anywhere on the disk and plays it. Followed by another and another and another. It is like having my own personal radio station. I'm even going to put a whole load of the best radio adds (including the Budweiser "Real American Heroes") on there as well to make things even more authentic. I've already got "On The Hour" for the news. Not heard of "On the Hour"? Excellent spoof radio news show from the BBC. Spawned The Day Today, an even better TV news spoof show which also launched Alan Partridge. I've just bought the DVD of that. Cures you of ever taking TV news seriously. Should be required viewing for all.

Anyhoo, I think the IPOD has had random play since it was first sold, but for us who have been using disk based MP3 Players for longer than that, it is a new feature to us. It has made me realise just how much good stuff that there is on that there disk. I've now reached the point where I'm thinking about keeping this particular machine because it's taste is so good......

Morality Test

So I go down to the coffee machine (not to get coffee - I'm not that stupid..). And I notice that there is already 10 pence paid into it. This causes a huge crisis. Do I:
  1. Pay less for my drink and consider myself 10 pence up on the day (a major win on my part)?
  2. Pay less for my drink and donate the 10 pence to a good cause?
  3. Leave the machine with 10p in so that is causes the same conscience crisis for the next user of the machine?

In the end I opted for option 3. I kind of felt that my integrity was under threat. Options 1 and 2 would have me leaving with the extra money (and they wouldn't necessarily know it was going to a good cause). And it might be that somebody had just popped off to get extra change to finish paying.


And they say that us programmers obsess over small things....

I got a new MP3 Player

I got a new MP3 player today. It has a snazzy icon driven display, shows a neat clock when it plays music and it cost me nothing. Great stuff. All I had to do was upgrade the firmware in my exisitng Creative Nomad Jukebox 3. Silly me, the upgrade has been around since the end of last year, but it took me until now to notice it.

I really like this idea of getting new, better, products for free. I've done it a couple of times with my Smartphone too. I guess in the future this will happen all by itself (anybody thinking "Windows Update" yet?)

By the way, you can get this device (which cost me oodles around two years ago) for around 140 quid from ebuyer in the UK. You even get the tuner/mic/remote control thrown in. If that isn't a bargain, I don't know what is. And the product itself is superb. And mine is now nearly full.

Which means that what I really, really, really want next is one of these.

Exam Tips

I've got this new device for measuring time. It is called a pen. I can get around a third of the way through a new red ball point pen in a day at the moment. I can just about tell what time it is by the amount of ink left.

In case you haven't guessed, I'm marking at the moment. Around 100 second/third year papers and then I get to mark the 150 or so first year ones. Wonderful. But you do get some quite good exam tips which are worth passing on (sorry if these are a bit UK University-centric, but that is where I work) :


  • answer your questions in order. If you can't do one part, leave a blank page and go back to it. Nothing annoys a marker more than having to flip through an answer book looking for bits of questions. And you really don't want to annoy the marker (although of course it makes no difference to your mark). and start each answer on a new page, after all, you aren't paying for the answer books...
  • don't make things up. People answer fiction in the faint hope that the marker might go for it. Never worked when I tried it as a student, and doesn't work when I'm marking either.
  • don't answer a different question. Showing off the bit you happened to revise (but didn't come up on the paper) is not going to impress anyone, least of all the person marking.
  • work through the last three previous papers answering all of the questions and get them marked by someone. If you do this it is almost impossible to fail.
  • rough your answer out first. Make some notes in pencil, or marked "rough" before you write out the proper answer. This helps you structure things.
  • don't write in dirty great blocks of text. This makes it very hard to mark. If you split things up it looks a lot nicer. Don't be afraid to use bullet points or tables if these get the answer accross. And never underestimate the value of a good diagram.
  • don't leave early. At Hull students can leave after the first 30 minutes of a 3 hour exam if they want to. But think how stupid you'd feel if you thought of something after you have left the room.....
  • If there is something affecting your performance, make sure that your tutor knows about it. Anything which stops you giving 100% is something you should make people aware of.
  • Oh, and being lucky helps as well!

Time Management

Been using my wonderful marking program today. Together with the snipping tool for the Tablet PC it makes quite a formidable device for grabbing bits of program displays and listings, annotating them and then dropping them into a customised web page for each student. I've had to put an embargo on "bright new ideas" (although I do write them down) because if I implemented them I'd never get any of the proper work done.

But when I use my programs I always find problems "round the edges". Sometimes the student files aren't quite right, or their programs get stuck, and then my program misbehaves and I've had to sort it out. I reckon that a programmer should spend around 20% of time solving the problem and then around 80% of the time handing all the ways that their solution could fail. Add on around 50% for testing and 20% for writing documentation and you get an understanding of why programmers are so busy. Or why some programs don't work as they should....


Many years ago I bought a book. This was not an isolated event, in fact I have bought many books since. And I've even read some. This book (purchased in 1975) is a wonderful read. I ran across it on my bookshelf today. 

I was therefore very pleased to find that you can still buy it. Systemantics is about systems. How they take over and get a life of their own. If you are in business you should read this book. If you want to be in business you should read this book. If you like a good laugh you should read this book. My favourite quotes (from many) :

People In Systems Do Not Do What The System Says They Are Doing

Things Are What They Are Reported To Be

Cupboard Love

Apparently cupboards should have backs. They are not supposed to act like those things that magician's assistants get into and subsequently disappear from. The cupboard in our kitchen is slowly changing back into sawdust, and as a kind of weigh point on this progress the back fell off, which resulted in tins of tuna (dolphin safe) amongst other things vanishing into it, never to be seen again.

Well, today I did something about it. Using my electric screwdriver, bradawl and of course my trusty hammer, I contrived to refit the shelves, brace them with some plastic bracing thingies and firmly fix the back in place. In the proces I found some quite, shall we say, elderly food. All nicely packed and sealed. We had three categories; not past sell by date, past sell by date and sell by date worn off.

Whatever did we do before sell by dates? Perhaps they are a great marketing scam to make people buy new products for no good reason. However, I've always had a sneaking respect for them. For many years (and even today in some plants) the sell by date on bottles of Budweiser was produced by software written by my own fair hand. Not that we ever had any in our house long enough to ever need to worry about that of course....

Lookout for Outlook

If you use Outlook for your email and contacts (and who doesn't) then I can heartily reccommend Lookout. It builds an index of your inboxes and contacts and then performs fast (and I mean *really* fast) searches of them. It uses similar search expressions as Google, so that you can esaily narrow your searches down and it seems to work like a dream. At the moment it is free, but when the time comes I'll be putting my 30 dollars into the pot....

No Two Ways

I've been marking student projects for a while now and it never ceases to amaze me how, given the same problem, lots of people can come up with different answers. Some are much worse than the one I thought of, others are better. I love this (except for the ones which are way better than my design of course..)

Some of the students want to know what the "right" answer is. But of course there is no right answer. Some are faster, some are smaller, some are easier to use and some are easier to maintain. When you get good at this game you start to recognise the tradeoffs and can even code to make things big and fast (i.e. look up table) or small and slow (i.e. work it out each time). Me, I always write code for maximum clarity these days. The processors can stand a little inefficiency and I rate my time above any computers.

Shiny Class Server

Anyone who knows me knows that I am a sucker for bright, new, shiny objects. Today Rob and Claire from Microsoft came over to Hull and showed us Microsoft Class Server. It is very bright, and very shiny. OK, so it is is technically not an object, although I suppose that object oriented design technology was used in the creation of the system which means that .......

But I digress. If, for example, you were a lecturer at one of the premier universities in the UK, giving the grateful students the benefit of your wisdom and knowledge. Say you want to make your life easier in terms of deploying courseware, managing assessments and providing feedback to students. Then you are going to find Class Server very shiny indeed, because that is just what it does.

Basically, I want in. I'm so impressed that I'm going to test fly it on the shiny new, joke packed, C# module which I will be giving to those lucky enough to be selected for the first year of our course this year. What's more, I'm going to have a crack at extending it and adding some kind of Wiki-ness, which should also be fun and enhance the learning experience. I'll let you know what colour smoke I get...

Another Day, Another Hull Winner

It seems that all Hull students do is win competitions. Hot on the heels of the news that two Hull students were in the top teams in the Imagine Cup UK heats this year (kudus to Mat Steeples for being in the winning team) it seems that another Matt, Matt Jones, has won a BCS essay competition. It must be all in the name!

Anyhoo, Matt now gets to spend a few days hob-nobbing with the great and the good in IT on a cruise ship. He's promised to blog about the event, I'll post a link when I get one from him.

It must be something about Hull that drives students to enter competitions and win them. I put it down to the quality of the lecturing staff...

Virus Thoughts Two

Imagine you run a delivery company. Imagine that the manufacturer of the little vans that you use sends you a message saying that they've found a fault with the tyres and if it rains your little vans might go off the roads and crash. The van maker offers you a free fix to make them safe. Imagine you ignore that message.

Of course the next time it rains heavily some of your little vans do crash and cause damage and upset.

So, who is at fault here? I think it is fair to say that your delivery company is more than a bit to blame. Of course it would have caused you difficulty and upset to fix your vans. And you can argue that there should never have been a fault with the vans in the first place. But I think in this situation any company would have made darned sure that the problem did not arise.

The Sasser virus upset is exactly the same situation. Except that companies who rely on computer support do not take their computers as seriously as their little vans. Viruses are just like the weather. Now and again you get a hurricane. Now and again some buffoon thinks it "might be neat" to send something out on the internet and see what happens.

If I lose a seat on a plane because of the Sasser virus, I'm not going to be chasing an 18 year old German idiot, I'm going to be banging the desk at the checkout shouting about the duty of care owed me by the airline to make sure that their systems don't fail in this way (and hoping that their maintenance policy for their airplanes is somewhat more rigorous...)

So, no trombone then

I've talked to a few people about trombones and they tell me that they are much harder to play than the piano (which I seem to have given up) and the guitar (which I seem to have given up). Basically you have to blow a raspberry down a pipe and then adjust the length to get the right note. The raspberry bit sounds fun I suppose, but not for several hours at a time. Hmmm. I think I might put this aspect of my musical ambitions on hold for a moment.. And remember, there is always the banjo.

Oh, and I put "trombone playing dog" into Google and wasn't rewarded with any hits which were particularly useful. And Ebay were no help either.