Denizens

When Mood Music
2012-04-11 21:49:00 blank Square Boxes – Roy Harper

I’ve got my demo Row program adding adding an Ogre at a random position and a random choice of (donkey, parrot or snake) at square (0,0).

I need to learn Swing to replace the poxy default Java icon with something nicer.

I want to tweak the code that lists the denizens of each grid-square so that trailing commas are eliminated but that can wait.

summary

When Mood Music
2012-04-11 18:40:00 content Space Shanty – Leftfield

I now have code for a grid-square class. Grid-square objects

  • know where they are
  • how many ogres, donkeys, parrots and snakes they contain (initially zero of each)
  • can increment and decrement the numbers of these creatures (and will sing out if the numbers ever become negative or if there is more than 1 ogre)
  • can report these numbers
  • can decide whether the ogre overwhelms the other creatures or vice versa (and will sing out if I try to have a battle involving zero ogres)

Now I have to construct a row as a collection of grid-squares and create methods to

  • add an ogre to a random square
  • add donkeys, parrots and snakes at random to the first square in the grid
  • move the denizens about at random
  • provoke fights between the ogre and the others in whatever grid-square he’s in.

Then I have to construct a swamp as a collection of rows and develop 2-D versions of the random-movement methods.

Poor ogre – no matter what, eventually he’s going to be brayed, squawked or venomed (or combinations thereof) out of existence.

Much farting about later

 

When Mood Music
2012-04-11 17:30:00 annoyed The Sound of the Drums – Angélique Kidjo

Bollocks – I can’t work out how to pass the co-ordinates of the afflicted grid-square to the appropriate exception. So instead, the afflicted grid-square calls the exception, which then creates a message such as ‘there are too many ogres in a grid square’. Control then goes back to the code for the grid-square, which augments the message with ‘The afflicted grid-square has co-ordinates (x, y).’ and then displays the complete message.

It works but it’s not satisfactory to me.

Ogre overflow

 

When Mood Music
2012-04-11 16:44:00 amused Sophisticated Beggar – Roy Harper

I’ve just written a Java exception to notify if there are too many ogres in a grid-square. (‘Too many’ means ‘more than one’.)

Now I need to write methods for decrementing numbers of donkeys, parrots and snakes, along with exceptions to notify if the program attempts to have negative numbers of these creatures.

Short-changed

When Mood Music
2012-04-10 20:52:00 awake Short and Sweet – David Gilmour

Last Friday I bought a new pair of cycle-shorts. I tried to wear them the first time this morning but I discovered that, despite having tried on the shorts in the shop, I’d come home with a child-size pair that wouldn’t go even halfway up my legs. Fortunately, I’d not taken the labels off and so was able to swap them for a pair that would fit my flabby anatomy.

I also checked on the date for Lev Davidovitch’s brake-swap – it’s due on the 28th. Dad had warned me Lev would need new disks, as well as new brake-callipers: apparently it’s impossible to properly flatten a disk once it’s been bent out of shape. (He used to make brake disks for Ford and Austin Rover so has more knowledge of this area than I do about anything!) So I spent a while drawing reasons why friction would imply a distorted or damaged disk.

Fortunately, I didn’t need to argue my case – they new brakes will come with new disks anyway, so it’s all good apart from the wait and cycling to Napier not being as easy as it could be.

Despite the friction, I’m still very pleased I chose disk-brakes. I appreciated their inclement-weather-unimpaired stopping capacity when a car-moron jumped some traffic lights lights on Lothian Road today. Even in good conditions, disk-brakes are better stoppers than rim-brakes, and won’t wear the rims away.

Also, cycling Lev for just a couple of weeks on Edinburgh’s rubbish road surfaces has already affected his wheels so much that if Lev had rim-brakes, they’d be rubbing without any chance of getting them fixed for free.

Friction – turning into ire

When Mood Music
2012-04-05 14:26:00

With apologies to Morcheeba

I had planned to meet my mentor this morning at Napier, then spend the rest of the day in the library, looking for references to back up what I’m saying in my web-enabled business coursework. Meeting my mentor went well – thanks Natalie!

However, I’d also been somewhat irked by Lev Davidovitch’s brakes still rubbing badly. On the way back from spinning last night, I had to drop a couple of gears to compensate. Since I’d just spend an hour deliberately riding against friction and was still working off cramp in my right leg, I wanted a smooth ride home! I also needed a replacement helmet cover (the original had blown off and away on Tuesday morning) and another pair of shorts (2 pairs isn’t enough considering I’m spinning twice a week and cycling distances at weekends) while my hostess’ new leggings were supposed to have arrived at the co-op this morning.

So I took LD and his bulging panniers back to the bike co-op to ask what was causing the friction. (I tend to start by assuming that I’m the cause of my problems – in this case I feared that Randolph Crescent’s cobbles might have jolted or buckled the wheels enough to cause the brake rotors to move agaisnt the pads.) However, I was pleased to learn that I wasn’t the cause after all.

It turns out that LD and his siblings were built with road-bike brake-callipers, i.e. with a fairly narrow gap to contain brake pads and disks. (By contrast, mountain bike callipers have large gaps to allow for the inevitable bashings and distortions they’ll suffer, so friction is far less likely and more tolerated.) The problem was that the manufacturers of LD’s brakes had worked to poor tolerances and I’d had the bad luck to get a duff set. The co-op has offered to replace the relevant parts with new ones, of a different brand which is manufactured to better tolerances (and better all round) – and to say sorry with a voucher.

However, the new parts would take a while to arrive – so Gordon the mechanic was tasked with trying to make LD’s brakes work tolerably until then. I was asked to leave LD with them for 20 minutes so went to a nearby coffee shop to drink tea. However, when I returned, all the world and his boyfriend had been bothering the mechanics so LD still wasn’t ready. Also, the front calliper had bent the disk so Gordon was trying to bring it back into shape. After around another half-while I’d pondered – and rejected – buying an under-saddle or in-frame bag for the tools I like to carry, Gordon brought LD out of the workshop. Both brakes are much better – there’s still some friction once per rotation of the front wheel. However, until the new callipers arrive, I’m told I can bring LD in again for running repairs. The co-op will supply and fit the new callipers free of charge – and have reiterated their promise of recompense for selling a bike with duff bits. Thanks to Chris (who seems to work mostly in bike sales) for advising me what the problem is, making sure it will be fixed and recompensed and to Gordon the mechanic for doing running repairs in the meantime.

So after getting this off my head and into the blog (and eating spud, salad and beans – which might amuse Fiona), it’s time to crack on with Uni work.

Bah!

When Mood Music
2012-04-03 11:46:00 fuming FriComedy: News Quiz 2010_06_11 – BBC Radio 4

Screaming at this. Quite apart from the hypocrisy of denouncing this when in opposition but then going for it when in power, what will this do to internet use, personal freedom, trust in governments….

Speaking purely personally, this pushes me into voting for independence despite my aversion to borders in general, Alex Salmond and Fiona Hyslop in particular and my family being the other side of this border-to-be.

Diabetes Diary

When Mood Music
2012-04-02 15:10:00

Morning – very tired, arm feeling like Arnie’s in the steel foundry when the T-1000 is about to put a rod through him.

Tired enough not to resist doing arm exercises, taking pills, doing blood test.

By lunchtime, back to prevarication!