Author: karlbunyan

Repeatable random numbers in JavaScript

Repeatable random numbers in JavaScript

Ever since programming BASIC on the Spectrum I’d wondered why it was possible to seed a “random” number generator. But then I found I wanted to do something that would produce repeatable results, but look like a random sequence. Strangely, although JavaScript alongs you to specify a seed for Math.random() the numbers that follow aren’t …

+ Read More

Firing JavaScript functions after a .Net AJAX request

Firing JavaScript functions after a .Net AJAX request

I wanted to have a function called after data was returned to the page from a .Net AJAX call. (The idea was to fade out when you pressed “submit” and then redraw when data came back.) It turns out there are handy handlers already there to, erm, handle this: Sys.WebForms.PageRequestManager.getInstance() .add_beginRequest(StartRequestHandler); Sys.WebForms.PageRequestManager.getInstance() .add_endRequest(EndRequestHandler); Those little …

+ Read More

Near Athens – the island of Aegina

Near Athens – the island of Aegina

Whether the island is actually spelt Aegina or not I couldn’t tell – it was spelt differently on every timetable and in every guidebook. But if fits for me. We started off at Piraeus, the port that’s virtually a suburb of Athens now, and went to “Gate 8” as directed and bought a ticket. We …

+ Read More

Athens – some modern stuff

Athens – some modern stuff

Athens has a strange history of very ancient architecture, a bit of development with the Romans, and then not much for a very long period of time. Most of the city looks very 20th century, and not particularly well done at that. However there are a few large modern buildings. Unfortunately, somehow they don’t seem …

+ Read More

Athens – various old stuff

Athens – various old stuff

Athens is full of old stuff. You can’t help seeing it everywhere, and they can’t help but finding it every time they want to build something. As a result, there are quite a few museums of old stuff, or places to wander around ruins. In fact, I’m sure you could just start building a museum …

+ Read More

Athens – about the town

Athens – about the town

I’m just back from a long week (if such a thing exists) in Athens. It’s certainly a bustling city, and one that never seems to stop completely. Cafe’s especially were populated at any hour that I was ever likely to be about and people think nothing of dropping into a restaurant at midnight. Having booked …

+ Read More

In times of recession: eat chocolate

In times of recession: eat chocolate

That’s the conclusion I draw from the news today that Thorntons has revealed annual profits have risen nearly 20% to £8.5m. Although the Thorntons PR spin is “There’s room for pleasure and a little bit of indulgence in everyone’s life”, my assessment is rather: “if you’re struggling to make ends meet, why not stuff your …

+ Read More

Summer was officially crap

Summer was officially crap

As if we didn’t already know it. “This August has been the dullest in the UK since records began – with just 105.5 hours of sunshine, against an average for the month of 165 hours.” BBC NEWS | Magazine | Call that a summer?

How to swat a fly

How to swat a fly

“The research suggests that the best way of swatting a fly is to creep up slowly and aim ahead of its location.” Well, duh. I bet those researchers spent months trying to work out how to get the last ship in Space Invaders too. Experience tells me that a good flyswat (one that doesn’t push …

+ Read More