(no subject) [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Thu 2005-05-19 17:43

I left work at about 16:15 today, due to a crippling network outage which the sysadmins couldn't even provide an estimated fix time for. I decided that meant it was futile to hang about and hope it got fixed, so I came home. Hopefully it'll be sorted out by tomorrow.

(Of course I don't doubt it will actually turn out to have been sorted out five minutes after I left; that'd be just Murphy's style.)

Anyway, I put the time to good use. I came home and finished work on a ludicrously clever idea I'd had yesterday, to ensure that puzzles generated by my ‘Rectangles’ program have unique solutions. To my surprise and delight, it worked, and worked nearly first time, in spite of being a pretty outlandish blue-sky sort of idea.

(If that ‘ludicrously clever’ sounds rather self-congratulatory compared to my usual tone of ‘people might conceivably be interested in…’, then this is my diary so tough. It is pretty rare in computing – in fact, it's pretty rare at all – that I do something so impressive that it makes me want to bounce around the room shouting ‘WOOHOO’ and ‘HOW COOL IS THAT?’ and ‘DO I ****ING RULE OR WHAT?’, but this is such a thing. I am excessively pleased with myself for what I've just accomplished.)

In other news, twenty-four hours of watching my electricity meter has re-convinced me that I am right and British Gas is wrong. The reading marked ‘normal’, which I claimed was daytime and they claimed was night, moves only during the day. The reading marked ‘low’, which I claimed was night-time and they claimed was day, moves only during the night. Now all I need to do is convince them of this…

LinkReply
[identity profile] deano977.livejournal.comThu 2005-05-19 16:56
{aol}me too!{/aol}

And it was indeed all working again when I got home...
Link Reply to this
[personal profile] emperorThu 2005-05-19 17:06
Well go on then, give us the details!
Link Reply to this | Thread
[identity profile] mpinna.livejournal.comThu 2005-05-19 17:09
Aye, we can be the judges of 'ludicrously clever' :-)
Link Reply to this | Parent
[personal profile] simontThu 2005-05-19 17:19
Essentially, what I've written is a souped-up version of a Rectangles solver. It's souped up in the sense of being non-deterministic, by which I mean that it can cope with a degree of uncertainty about where exactly the number in each rectangle is placed.

To begin with, I smear each number throughout the whole of its containing rectangle. The solver deduces as much as it can under those conditions (by ruling out as many possible-rectangle-placements as possible), and then gives up. When it gives up, its next step is to narrow down the possible positions of one of the numbers in such a way as to make an additional deduction possible. Then it deduces as much as it can again, and repeats. Eventually it reaches a point where it's able to fully deduce the position of every rectangle in the grid despite some of the numbers still having uncertainty in their position. Then I can choose randomly from the possible positions for any number that's still uncertain.

The upshot of all this is that I get to do a single solving pass and place all the numbers sensibly. All the other approaches I could think of involved having to solve the grid multiple times, adjusting the number positions each time to try to get closer to uniqueness. Or, even worse, the complete bogo-sort approach of repeatedly generating an entire grid and seeing if it ended up unique (which scales extremely badly, since as far as I can tell ambiguous sections crop up at a roughly constant rate per unit of grid area, so the larger the grid the longer you'll have to keep doing this for before getting a sensible puzzle).

The solver does get hung up some of the time and have to abandon the grid and start again, but even at the largest default setting it does that under 50% of the time so it's not too bad.
Link Reply to this | Parent
[identity profile] feanelwa.livejournal.comThu 2005-05-19 17:09
You need to invite one of their little men round for tea so he can watch the meter turn round when you boil the kettle.
Link Reply to this | Thread
[identity profile] feanelwa.livejournal.comThu 2005-05-19 17:09
And yay for ludicrously clever ideas.
Link Reply to this | Parent
[identity profile] dennyd.livejournal.comThu 2005-05-19 17:14
If I should ever happen to be introducing you to someone in the future, I shall try to remember to do it as "...and this is ludicrously clever Simon". You're not allowed to blush :)

It is indeed very satisfying to code a solution that you can be that proud of. Lots and lots of 'go you'.

Good luck explaining reality to British Gas. I had fun with them when I moved out of my house in MK - they started billing the new tenant (my sister), kept billing me too, then tried to take me to court despite the fact that she'd paid all the bills.
Link Reply to this | Thread
[identity profile] womble2.livejournal.comFri 2005-05-20 23:47
I don't believe this is anything specific to BG. So far as I can tell, all billing systems are broken.
Link Reply to this | Parent
[identity profile] hsenag.livejournal.comThu 2005-05-19 17:23
It came back at 5 or so, so not just after you left.

You could always invite British Gas to take you to court. Though I guess they might cut off your supply in the meantime.
Link Reply to this | Thread
[identity profile] mwk.livejournal.comThu 2005-05-19 20:22
Just after I left then? sheesh.
Link Reply to this | Parent
[identity profile] timeplease.livejournal.comThu 2005-05-19 21:39
I was taken to court by British Gas (for a different reason - it was over access to a non-existant meter). I turned up at court and they pulled out, the cowards. I'd been looking forward to exposing their idiocy in front of the magistrates.
Link Reply to this | Parent
[identity profile] ex-lark-asc.livejournal.comFri 2005-05-20 11:13
<lennier> Woo.. hoo? </lennier> ;-)

British Gas will ahve to take your word if you send it them in writing, won't they?
Link Reply to this
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]