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, Oct 18 2003

Canned Philosophy

So I'm in Morrisons helping with the weekly shop. I'm standing next to the tinned vegetables and it occurs to me that it is a good job that the Green Giant was jolly. If he had turned out out to be a nasty piece of work he could have caused a lot of trouble, what with being very tall and all that. And I bet the sweetcorn wouldn't have tasted as nice.

Had some stupid sports thing on the telly this evening. "..and this athlete has a heart twice the size of an average woman". Wow. I make an average woman around 5 feet six tall. That's some heart....

Not as good as my favourite though: "The new Vauxhall Vectra is now available with a choice of sixteen engines". I bet that it goes fast. But the fuel economy is probably rubbish.

 


Fri, Oct 17 2003

Getting Better All the Time

Still ill, of course. But at least most of my brain is coming back on line now. Actually wrote some nice code today. And had some meetings with project students. It is starting to dawn on them that they have a lot to do. And April 2004 is not that far away....

A loyal reader (Hi Simon) has sent me a recipe for a cold cure:

heat some grapefruit juice, lemon juice, with some honey, then mix in a shot or 2 of whiskey. Drink it all in 1 then sleep and you should feel much better by morning.

Thanks for that, I like the sound of it. It has whiskey in....

 


Thu, Oct 16 2003

Back on Form - so far..

Hah. Fifteen minutes of sorting out and everything in the program is fine again. And now I'm going to make a big backup onto a CD-ROM.....

Still got a cold though. But thanks to my superhuman strength I'm managing to keep on going almost as usual.

First year Java. Love it. Did methods today. Explained my views on defensive programming: "Always make sure that the sh*t falls on the other person's head". Explored this in terms of a method which adds an amount to the bar bill of a hotel customer when they pay for a drink:

 
boolean AddToBarBill ( int Amount ) {
	// what do you put here to make sure that nobody can 
	// corrupt your bar bill...
}

Some nice problems: Consider the fact that a member of the bar staff and a guest might decide to attack your method and try and break it. If you let your users add negative numbers this means that naughty people could make their bill smaller. In an extreme case they could end up being paid for using the bar! So, stop them from adding negative numbers.

But then you have a problem with very big positive amounts. Because of the way that values are stored in computers a number can "wrap round" a bit like a car mileometer. So by adding carefully chosen positive values a naughty person could still make their bar bill smaller.

So, what you really do is ask the customer what the price range for drinks is, and then only allow prices amounts in this range to be added:

 
boolean AddToBarBill ( int Amount )
	if ( ( Amount > MaxDrinkPrice ) || ( Amount < MinDrinkPrice) )
	{
		return false;
	}
	else {
		CustomerBill = CustomerBill + Amount;
		return true;
	}
}

This has two nice effects - it makes sure that your program always does the right thing and it makes it clear to the customer (i.e. the person who owns the hotel and is paying you to write the program) that it is their job to make sure that people in the bar enter the right prices - and that your program is doing the best it can to behave sensibly. The scary thing is that if you don't take these steps you may end up in court with your hotel customer (who has gone bankrupt) trying to take away all your money. It is interesting to see how a technical problem (stop someone from breaking my program) is really a specification problem (what do we mean by broken - and who has responsibility for breaking it).

Oh, and I know that the left hand margin has gone all funny. It is the pre-formatted text what does it and I'm working on a spiffy new host which will make everything much nicer....

 


Wed, Oct 15 2003

Don't Code with a Cold

Don't like being ill. It's just not healthy. Tried to add some stuff to the "program which cannot be named" and did OK for the first few hours. Then at 13:30 decided to make a small (hah!) change. Unfortunately my mental faculties had shut down for the day due to illness and so everything went wrong at this point and I now have a big pile of compilation errors to deal with. It will be much better when I've finished, but with hindsight I'd really rather not have started it just right now. Told number one son about this. "Never mind" he said "Just get the backup copy". I laid him out with a swift right hook followed by a left to the side of the head. I take a backup every day, but not half way through. There is probably a moral to this story, but unless it has to do with cocky kids I'd rather not hear it.

Have thought of a way to deal with organised crime though. Just take away all their diaries, personal digital assistants and filing cabinets....

 


Tue, Oct 14 2003

Help - a virus

Spent a big chunk of Sunday dealing with a computer virus (not on my machine fortunately) and now have one of my own. Only it is called a cold. Have taken to shuffling round and suffering in near silence, as men are wont to do. I'm working on just the right rendition of "Oh, I'm OK really" to elicit the appropriate level of sympathy and support from my family. Unfortunately, since I'm the last person to come down with this dratted thing, and everybody else has already suffered it, sympathy is a bit thin on the ground. Especially in the light of the kind of responses that I was producing last week: "That's OK love, you go and have a nice lie down - as soon as you've brought the coal in and made my tea..." Ho hum. Early night and Lemsip for me I think.

To make matters worse number one son has comprehensively thrashed my record on the Pinball machine and I'm not really up to beating him at the moment. Of course, when I'm fully fit (if you ever can be fully fit at my age) I'll deal with him appropriately...

 


Mon, Oct 13 2003

Up With Down With Love

And so to Monday. They are making a CD-ROM to show what life is really like at university and for some reason this involves taking videos of me giving a tutorial and lecturing. Many thanks to those who allowed themselves to be filmed as part of this. A lot of the footage was what I would call "reaction shots" of students which, considering what goes on in the lectures, could have gone either way. Thanks for looking happy folks. The cheque is in the post (and likely to stay there for some time...)

Went out and watched the film "Down With Love". Quite enjoyed it. It is a 21st century remake of one of those comedies from the sixties which used to star Doris Day and Rock Hudson. Very well done and some really funny moments.

 


Sun, Oct 12 2003

Sunday Wisdom

Things I Know: 002 of 800 If someone appears to have a really hairy, featureless, face they probably have their back to you.

 


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

Contact rob@robmiles.com