Rob’s Guide to Marking

Exam Scripts
See rule 5

It was my “big” exam yesterday. Two hours of panic for the students. Four days of marking for me. So, nobody comes out of it particularly happy I suppose. For any academics out there I present Rob’s guide to marking.

  1. Don’t try and do it all at once. You will fail. Make a big hole in your schedule and set out how much you want to get done each day. Then you can point to a day in the future and say “I’ll be clear of marking then”.
  2. Make yourself a nice place to work. I used to cut up the question paper and stick it into one long strip that I could have by the answers so I didn’t have to keep flicking between question and answer as I marked. Now the students write their answers underneath each question. Easier for them, and much quicker for me to mark.
  3. Use a really nice pen. I’ve been known to spend up to twenty minutes in the Student Union shop choosing a pen with the right colour, feel and heft. Actually, this might be a displacement activity, but if the pen makes you enjoy writing the marks then at least some part of the marking process will be fun.
  4. Take regular breaks. I’ve got Professor Layton and the Curious Village fired up on the Nintendo DS. A puzzle every 12 scripts or so stops my brain from melting.
  5. On no account should you make a single pile of all the scripts that you have to mark. This is invariably depressing.

“Hello Silverlight” Book from Manning Publications

image

I’ve been lucky enough to get hold of an early copy of this book. If you are new to Silverlight and want to find out more this will tell you in a very nicely written way. It even has cartoons that are both funny and relevant – which is great. I strongly recommend it.

The book isn’t finished yet, but you can download and read the early chapters and even send comments back to the author. I’m looking forward to getting my hands on a proper printed copy when it comes out.

C# Exceptions and Finally

London Tulips

I’m writing a new version of the C# Yellow Book and I’ve been going through the chapters to make sure they still make sense. Today I’ve been playing with Exceptions. These are things that programs do when really bad things happen. When things are going badly for me in a chess game I have this annoying habit of kicking the board over and storming of to do something else. Exceptions are just like that, but for programs.

If a program finds itself in a situation where it really can’t go any further it can throw an exception and make the issue somebody else’s problem. Really bad in this case means things like “I asked for a number and you’ve given me some text” or “You asked for a file and I can’t find it”.  This means that a proper programmer will put such potentially moody code into a try – catch construction so that they can deal with any tantrums that might be thrown:

try
{
    // Potentially moody code
}
catch
{
    // Code to recover the situation
}

If anything in the block under the try throws an exception the program runs the code in the catch block to try and put things right. When I was younger and more desperate to be liked I used to make sure that code I wrote didn’t ever throw exceptions, but tried to sort things out and carry on. Ask my object to load something from a file that doesn’t exist and it would return a null reference and keep going. Sure, the program that went on to use that null reference would explode some time afterwards, but at least my method hadn’t thrown a tantrum.

Now I’m more nasty. I let my programs throw exceptions if they are asked to do stupid things. That way the fault is generated much closer to the real reason why it happened. Problem is, that sometimes I don’t want to just pass an exception on, I want to do a bit of tidying up myself before I blow away the person that calls me. I can do this by catching the exception in my method and then throwing a new one.

try
{
    // Potentially moody code
    // Code to tidy things up
}
catch
{
    // Code to tidy things up
    throw new Exception ("Bad news message to caller");
}

Of course the problem here is that I have to write the code to tidy things up in more than one place. Once if everything works, and again if the exception is thrown. Which is where finally comes in:

try
{
    // Potentially moody code
}
catch
{
    throw new Exception ("Bad news message to caller");
}
finally
{
    // Code to tidy things up
}

You don’t have to add a finally part to your try – catch construction, but if you do it is where you should put all your tidy up code. This is the code that must run whether or not the exception is thrown, and irrespective of what happens in the blocks above. I use code in the finally part to do things like close files, release objects and say bye-bye to network connections. And it works well except in one situation, which is kind of why I’m writing this blog post.

The code in my finally clause will not run if there is nothing to catch any exceptions thrown by the code in my try – catch construction. In other words, if the exception my code throws will cause the program to end for lack of an exception handler the finally clause will not run. I did some experiments to prove this, and decided it was something worth noting.

The thinking, I suppose, is that if the program is going to stop anyway, what is the point of allowing it to run any more code. Most of the time the finally clause will be releasing resources that will be freed anyway when the program is terminated. However, it is not always as simple as that. Sometimes finally code might want to say a formal goodbye to a remote host, or log some information. 

Since you can’t rely on someone to always catch exceptions that you might throw (particularly if they are stupid enough to make bad calls of your methods in the first place) I think that this means you need to be a bit careful about using finally. If this means putting tidy up code into a method and then calling it both in the try and catch parts of your program, this might be a step worth taking.

Read “Bad Science”

I was talking to some folks today and they told me they had not read “Bad Science”. They should. There are some books that everyone should read, and this is one of them. It does a great job of getting you to think properly about stuff you see in the papers, and things that advertisers tell you. It makes warning bells come on in your head when you hear things like “Studies show…” and “90% of women prefer….”.

Brilliant.

Marking Time

York Railway Museum Engine Controls 2

Been in the labs marking for the last three days. Today I did the last few presentations before I sit down and enter the whole lot into our system. Students have been making games or banking applications. I have seen some lovely stuff. It’s very hard work, I must have asked “..and what does this bit do?” loads of times. But great fun. Thanks to the first year for turning up on time and to Simon and Mike for sharing the work.

Windows 7 Upgrades for MSDN AA Students

Humber Bridge Christian Aid Walk Red Car

This is a tip for students who are lucky enough to study at places that have Microsoft Academic Alliance set up. These students have access to free copies of Windows 7 which may well be better than the ones on their machine.

If you fancy upgrading your Windows 7 machine (which may have the Home version of the software)  to the more advanced version provided by MSDN AA you don’t have to re-install your operating system. You can use the Windows Anytime Upgrade command to enter the product key for your new version and the upgrade happens for you automatically. You can find out more about this here.

Hull Digital Question Time – Free Event

image 

It is funny how the person asking the questions always gets the best chair…

Hull Digital Question Time is in a couple of weeks or so. It brings together a panel of experts and an audience to have a discussion about the internet, mobile, the future of communication and anything else you care to ask questions about. Given that one of the panel is the Vice Chancellor of the University of Hull you might also expect some discussion on the relevance of technology to the future of Higher Education. 

It is being held on the university campus at the Donald Roy Theatre in the Gulbenkian Centre. The free food and networking starts from 6:30 pm onwards on Wed. 26th May.

The event is free and open to anyone who wants to sign up here. I’ve got my ticket, and a question to ask. 

Split/Second Looks Excellent

image

I used my new, high speed, internet connection to download a demo of Split/Second today. The 815M came down the line in around 12 minutes or so, which was nice.

The game looks excellent. It is a mix of Burnout, Need for Speed and Super Mario Kart, with destructible scenery which is all set up for maximum mayhem. Accumulate power by drifting and tailgating other cars and then use this to unleash the environment on your opponents. If you thought the red shell in Mario Kart was nasty, then you haven’t seen anything yet. We are talking exploding buildings, out of control aircraft and all kinds of other bad stuff. After a few tries I realised that first place is probably not  place you want to be until the very last part of the race, what with everyone behind you lining up to blow you away.

The handling model for the car (at least on the demo) is quite forgiving, but I don’t think people will really be playing it as any kind of simulation. If you think of it as a big budget car chase action movie where you get to drive, then you are pretty much there.

Split/Second was written by Black Rock Studios, who are division of Disney Interactive and are based in Brighton in the UK. They presently employ quite a few of our graduates and our students visited them earlier in the year for a look at their HQ. The game comes out in the UK in a week or two. I shall definitely be getting a copy. 

Christian Aid Humber Bridge Cross

Humber Bridge Christian Aid Walk Bus

Today we walked across the Humber Bridge for money. The money wasn’t for us, it was for the Christian Aid appeal that has organised these sponsored crossings for several years. We’ve done the walk many times. The first time, with very young kids and a pushchair we managed to cross the bridge four times. Since then the weather has been nowhere near as good, but today it was bright and just a bit blustery so we managed to get over the bridge and back again.  Of course I took the big camera and the wide lens.

Humber Bridge Christian Aid Walk Telescope

That windmill used to be used to grind chalk.

Humber Bridge Christian Aid Walk

Obligatory tower shot.

Office 2010 Now on MSDN

image

If you are lucky enough to have an MSDN subscription you can now head over there and download Office 2010 Professional Plus. This gives you Word, PowerPoint, Excel, OneNote, Outlook, Publisher,  Access, InfoPath and a bunch of SharePoint goodies as well. There are two versions, for 32 bit and 64 bit installations.

If you want to use the 64 bit one you will have to uninstall all the previous 32 bit versions of Office 2007, including any compatibility tools and viewers, but the installer talks you through this and tells you what to do. It looks like the 64 bit version is well worth the effort, it loads in a trice and seems a bit more snappy than the 32 bit one.

Once the programs get running they look very snazzy too. Outlook found all my previous details and just works a treat. There are some nice improvements that I’m finding as I use the programs. The mini “Start” button has been replaced by a File tab on the menus (which makes sense) and the way you modify styles in Word hasn’t changed (which is just as well, as I only found out how to do that in Word 2007 last week).

For me the big news is the SharePoint integration and the group working options which look very interesting.

Iron Man 2 Movie Review

image

Went to see Iron Man 2 last week. Take one spoonful of Fantastic Four light heartedness and add two spoonfuls of Spiderman angst. Throw in a bar of soap and a bunch of high grade special effects and you are done.

The movie wasn’t bad, but it wasn’t that great either. The first one seemed to have more of a plot than this one, which had a whole saggy lump in the middle where our hero has an “end-life crisis”. I can’t fault the acting, Robert Downey JR is very watchable in the title role, but I would really have liked a little bit more than one robot fighting another robot (or bunch of robots). If you like superhero films you won’t be disappointed, but I don’t think you’ll be that overwhelmed either.

Running Windows 7 64 Bit on a Macbook Pro I didn’t know was old..

York Railway Museum Engine Controls

I’ve had so much success with 64 bit Windows 7 on my new Dell Laptop I thought I’d put it on my MacBook Pro. I got this around 2 and a half years ago and it has been quite reliable, only needing a new power supply, battery and system board so far. Thank heavens for AppleCare.

But I digress. I bought a new hard disk and got number one son to fit it. Then we installed OS X and fired up BootCamp which is the Apple program to partition the drive and put Windows on it. At the appointed time I put my Windows 7 64 bit distribution disk in the machine to begin the install. And I got a very strange error message, as if the disk was stuck at a menu I hadn’t seen before.

Turns out that the Windows 7 64 bit DVD uses a format that doesn’t work on old (i.e. made more than 18 months ago) Macs. After a bit of searching I found my way to a web site that explained how to make a new DVD that worked OK.  The command I used (with my not-working DVD in drive d:) is this one:

oscdimg.exe -n -m -bd:\boot\etfsboot.com d:\ c:\windows7x64.iso

The oscdimg program is provided by Microsoft for making disk images. Once it had finished I then had an image on drive C:  which I could burn to make a working disk. I still have it. I’m going to put it somewhere safe.

Anyhoo, that got Windows 64 bit working on my machine and then I hit a second snag. The machine is so old that Apple don’t provide a version of BootCamp for it. This means that I couldn’t do the automated install of all the Apple and other drivers to make it work properly. The good news is that I’ve got all the important bits working without it and I’m sure I can live without the light up keyboard. From a performance point of view everything is fine, and I can now use all of the 4Gbytes of memory the machine has inside.  If you have an older Mac I’d definitely recommend the move to 64 bit.