A Poet's Progress - Rob Miles's's' Blog

About Rob

Rob on The Spoke (updated daily)

Previous

13 Jun - 19 Jun
06 Jun - 12 Jun
30 May - 05 Jun
23 May - 29 May
16 May - 22 May
09 May - 15 May
02 May - 08 May
25 Apr - 01 May
18 Apr - 24 Apr
11 Apr - 17 Apr
04 Apr - 10 Apr
28 Mar - 03 Apr
14 Mar - 20 Mar
07 Mar - 13 Mar
29 Feb - 06 Mar
22 Feb - 28 Feb
15 Feb - 21 Feb
08 Feb - 14 Feb
01 Feb - 07 Feb
25 Jan - 31 Jan
18 Jan - 24 Jan
11 Jan - 17 Jan
04 Jan - 10 Jan
28 Dec - 03 Jan
21 Dec - 27 Dec
14 Dec - 20 Dec
07 Dec - 13 Dec
30 Nov - 06 Dec
23 Nov - 29 Nov
16 Nov - 22 Nov
09 Nov - 15 Nov
02 Nov - 08 Nov
26 Oct - 01 Nov
19 Oct - 25 Oct
12 Oct - 18 Oct
05 Oct - 11 Oct
28 Sep - 04 Oct
21 Sep - 27 Sep
14 Sep - 20 Sep
07 Sep - 13 Sep
31 Aug - 06 Sep
24 Aug - 30 Aug
17 Aug - 23 Aug
03 Aug - 09 Aug
27 Jul - 02 Aug
20 Jul - 26 Jul
13 Jul - 19 Jul
06 Jul - 12 Jul
29 Jun - 05 Jul
22 Jun - 28 Jun
09 Mar - 15 Mar
02 Mar - 08 Mar
23 Feb - 01 Mar

Next

Sat, Sep 27 2003

Open Day and Flying Fun

University Open Day today. Very good turn out which is nice. And the weather was kind to us; which is even nicer. Had a good attendance at the introduction talk and the tour and quite a few people in the audience had not been to Hull before. I hope they were impressed. Everything seemed to go smoothly, although my Tablet PC (which with I am slowly moving into a love/hate relationship) went in to "jerk-o-vision" when showing the film sequence (and this is a reference to the update speed on the screen - not the fact that I am in the video).

I think it is a video driver/player issue and I hope I can sort it out before the admissions afternoons start in November. Perhaps if I start now....

Anyway, if anyone reading this actually attended; thanks for coming and maybe I'll see you again some time.

And then up to Beverly for some early evening flying with the toy plane. Found the perfect place for flying and it all went swimmingly. Had the odd crash, but nothing we couldn't fix with gaffer tape. Note for anyone getting into this business; when you buy the plane - buy a big reel of tape as well. The percentage of the plane which is tape is increasing with every flight..... Number one son is now getting the hang of the plane and we had some really nice landings. And we were also blessed with a nice sunset to fly into:

 


Fri, Sep 26 2003

Little Things that Mean Not Much

It is the little things in life that bring the greatest pleasure. I heard on the news this morning that they have just published a report on an incident where a trawler crashed into a gas collection platform in the North Sea. According to the report "..the collision occurred when the trawler changed position suddenly". Priceless.

Good news dept. Got season 2 of Babylon 5 from Amazon today. Only got a couple of episodes of season 1 left to watch, so we are talking just in time here... I used the free delivery service for the order, rather than the more expensive overnight option. I've a suspicion (but then I'm a suspicious type) that the "slow" free delivery is achieved by Amazon sitting on your order for a while before shipping it. This reminds me of the introduction of the second class, slow, post. The Post Office had to figure out how to slow mail down so that they could have a second class service...

 


Thu, Sep 25 2003

The Power of Magic

Been thinking about debugging (as one does). Debugging is what you do when the program doesn't work. Or works but does the wrong thing (nearly the same problem). The thoughts were prompted by a magic show on telly a few days ago. They showed the 50 best magic tricks (for which the number one was David Copperfield being chopped in half). Debugging a program is a bit like figuring out how a magic trick works. When I watch a magician setting up a trick I always want to jump up and go "No! That padlock is fake. There's an open link in the chain, you're hanging from a wire and that solid case you're going on about has got a trap door at the bottom. Oh, and what's that up your sleeve? And how come your assistant is twins?"

You get the picture... If everything the magician tells you is true, the trick must be impossible. This means that at some point he is telling you whoppers.

Broken programs are just the same. Something somewhere is not how it should be. Some part of the system is lying to you. This means that you debug the same way that you find out from a magician how a trick works; asking "Is the chain real?" etc etc.

Saying "It should work, I dunno why it doesn't" is tantamount to saying that you believe in magic. What you must do therefore is test all the things that you are assuming are true. "I know that this contains the customer number..." Really? How do you know? Did it start off with that number and change? Did the system that delivered the number send something else? Is the range of the numbers what you are expecting? And so on.

The worst thing that can happen is that you can end up convincing yourself that everything is OK. In that case you have what I call a "reality fault". And you start to believe in magic. At this point you have to resort to desperate measures:

  • First thing you do is walk away from the problem for a couple of hours. Often you will think of the answer; how the trick was performed. If that doesn't work, explain the trick to someone else. Two times out of ten you'll think of the answer during the explanation. One other time out of ten the someone else will tell you how the trick is done, or ask a question which changes how you view the problem: "Do you think he might have a fork lift truck in there somewhere?" or "What if the guy from the audience is in on it?".

  • Next thing you do is fiddle with the system in stupid ways. This is like asking the magician to perform the same trick, but using an elephant rather than his assistant. You might spot something this time. Send in completely invalid data. Send in lots of it. Send in lots of the same thing. This quite often gets you some behaviour which lets you track down the problem.

  • Then get the magician to do the trick in slow motion and freeze frame. Step through the code. Put in print statements. At some point you may well spot where your program does something it is not supposed to - and there you are at the solution.

  • Finally, run the trick backwards. The great advantage that a magician has is he knows how the trick will end. The audience doesn't. You can often figure out how it was done if you start from the result and try to figure out how to end up there. It is the same with debugging. Try to think how it could have ended up with that result.

  • OK. If you've done all that and it still fails you are in the one time out of a thousand where magic might actually exist. In this case you change the documentation and abracadabra! Your bug is now a feature! Failing that it is probably time to re-write the code.....

 


Wed, Sep 24 2003

Imagine that Cup

Did something that I've not done before. Got my timings fouled up and failed to attend a lecture. This would not be huge problem except for the fact that I was giving it. And I had to duck out after five minutes to talk to a lady on the radio about Microsoft chat rooms being closed down. Sorry folks.

To make matters worse I was alerted to this fact just after I had my phone ring in the coffee lounge and everyone had enjoyed a good laugh at my ring tone. Well I like it and that's that. On the subject of groovy ring tones David from Microsoft had managed to track down an absolutely amazing ring tone from an Australian cartoon series. It is basically the whole theme tune and sounds incredible. And it goes on for ever. That's the nice thing about the Microsoft Smartphone; any CD or sound sample is up for grabs...

And then it was Imagine Cup presentation time. Gavin and David had come all the way from Microsoft with goodies to distribute and stories to tell. Team Random came out of retirement to tread the boards "one last time" and do the sales pitch. The Vice Chancellor came along and made a speech at the end.

And it all went rather well. Except for my tablet PC. Lovely device, all tablety and everything. But it seems to like to try and mess up my big important presentations. This time the video player (which worked fine right up until the day itself) decided to generate lots of amusing errors and refuse to play the nice Imagine Cup Video Diary. Right in the middle of the presentation. You don't want too many moments like these in your life. Fortunately I had a spare copy that I'd transcoded just in case of a problem like that. But it was still a bit scary until I remembered that bit....

Some muttering in the forum that "free gifts" didn't mean free things for everyone who turned up. As if. But the whole thing passed off in a good natured fashion.

Had a very enjoyable lunch with the Microsoft guys and Nick from Leeds. When you get a bunch of programming guys together the conversation can get a little on the strange side. I opined that the word doppelganger sounds a bit like a German arms manufacturer:

Bond reached into his holster and pulled out his Doppelganger semi-automatic. Largo yawned. "Your gun looks just like mine...." he drawled

Sorry. But I thought it was funny.

Pays to increase your word power dept:

dopplerganger: something which looks like you and changes pitch as it goes past

 


Tue, Sep 23 2003

Basic Debate

Did something last week I'm not particularly proud of (OK, OK, I did lots of things last week I'm not proud of - this happens to be the one that I'm prepared to write about here....) In search of a cheap laugh in the first year programming lecture I cast aspersions on the Visual Basic programming language. I seem to have left the impression that I hate it. This is actually not true. When you get to my advanced years you tend to avoid wasting energy on hating things like programming languages....

The good news is that this has sparked a rather good debate on the departmental forum, with people pitching in and making points for and against the language. If you want my actual position on this one I can quote it if you like:

I've written the odd VB app in the past. It is a very nice place to work. You can make something which looks good very quickly. However, the way that you tend to construct programs (user interface first) does work against good designs. You get tempted to put the actual guts of the program into the actions behind events triggered by the buttons on the screen and this is a very bad idea since your program logic is now spread all over the place.

However, you can write well structured applications in VB in the same way that you can create badly structured ones in Java. In VB I'd advise:

Design the screens, but put nothing behind the buttons. Work out what each screen does and show it to the customer so that he/she is happy with what it is supposed to do.

Back off from the screens and decide what the data structures in your program are and what properties they have. Design the data objects and give them actions which allow them to perform the required tasks.

Create a "method" file which contains all the actions, which are implemented as sequences of method calls in the data objects.

Bind the method calls to the events produced by the buttons.

Keep a very close eye on state, and make sure that events can't occur in a sequence which will upset your program. Turn buttons on and off as required to achieve this and make appropriate use of modal dialogues.

And there you are.

If you don't like me quoting this - then I'm sorry...

 


Mon, Sep 22 2003

Teaching Frenzy

Monday would seem to be my busiest teaching day. I have a couple of hours with the .NET crew (hello folks) followed by a lecture with the first year (yo! dudes!) and then back with .NET for a lab. At the end of all that my voice is usually in need of a rest. The material seemed to go down OK though, although I'm trying to keep the jokes down a bit and concentrate on content. On the other hand, there will come a point where I tell the "orange for a head joke" - so don't give up hope just yet...

 


Sun, Sep 21 2003

Too windy to fly

Went out and bought a new wing for our little plane (along with a roll of sticky tape to mend the old one). Then we set off again to fly it. We go up to Beverly Westwood, which is a nice area of open ground. The perfect area was once again full of smug looking people flying large and expensive machines very well indeed. Actually, I'm being a bit unfair since they probably aren't smug at all - we never went close enough to find out. Instead we sought out our little corner where we broke the plane last time. Unfortunately it turned out to be just too windy to fly. Note, if there are lots of kites up in the air this indicates a reasonable breeze is blowing.... We are still learning to fly our little craft and we reasoned that discretion is the better part of valour, and so we came home with everything still intact.

Next I had another go at Midtown Madness on the XBOX. I've found quite a neat trick. On the levels where you race against opponents, pick the bus as your vehicle. Then all your opponents drive busses as well - but yours is slightly faster. You get ample warning of corners and it is dead easy to win.... And six busses all fighting through a little street in Paris is very funny to watch....

 


Posted at:Tue, Jun 15 2004 07:24:49 PM by Rob

Contact rob@robmiles.com