So, I’ve not been well lately. And because a few days lying on my back with insufficient mental stimulation is a quick route to insanity for me, I’ve been trying to spend my
most-conscious moment doing things that keep my brain ticking over. And that’s how I ended up calculating pi.
When I say I’ve been unwell, that might be an understatement. But we’ll get to that another time.
Pi (or π) is, of course, the ratio of the circumference of a circle to its diameter, for every circle. You’ll probably have learned it in school as 3.14, 3.142, or 3.14159, unless you
were one of those creepy kids who tried to memorise a lot more digits. Over the years, we’ve been able to calculate it to increasing precision, and although there’s no practical or theoretical reason that we need to know it beyond the 32 digits worked out by
Ludolph van Ceulen in the 16th Century, it’s still a fascinating topic that attracts research and debate.
Our calculation of pi has rocketed since the development of the digital computer.
Most of the computer-based systems we use today are hard to explain, but there’s a really fun computer-based
experimental method that can be used to estimate the value of pi that I’m going to share with you. As I’ve been stuck in bed (and often asleep) for the last few days, I’ve not
been able to do much productive work, but I have found myself able to implement an example of how to calculate pi. Recovery like a nerd, am I right?
Pi goes on forever. Pie, sadly, comes to an end.
Remember in school, when you’ll have learned that the formula to describe a circle (of radius 1) on a cartesian coordinate system is x2 + y2 = 1? Well you can work
this backwards, too: if you have a point on a grid, (x,y), then you can tell whether it’s inside or outside that circle. If x2 + y2 < 1, it’s inside, and if
x2 + y2 > 1, it’s outside. Meanwhile, the difference between the area of a circle and the area of a square that exactly contains it is π/4.
Think back to your school days. Ever draw a circle like this? Do the words “Cartesian coordinates” ring any bells?
Take those two facts together and you can develop an experimental way to determine pi, called a Monte Carlo
method. Take a circle of radius 1 inside a square that exactly contains it. Then randomly choose points within the square. Statistically speaking, these random points have a
π/4 chance of occurring within the circle (rather than outside it). So if we take the number of points that lie within the circle, divide that by the total number of
points, and then multiply by 4, we should get something that approaches the value of pi. You could even do it by hand!
I wrote some software to do exactly that. Here’s what it looks like – the red points are inside the circle, and the black points are outside.
The software illustration I’ve written is raw JavaScript, HTML, and SVG, and should work in any modern web browser (though it can get a little slow once it’s drawn a few thousand
points!). Give it a go, here! When you go to that page, your browser will start drawing dots at random points, colouring them red if
the sum of the squares of their coordinates is less than 1, which is the radius of the circle (and the width of the square that encompasses it). As it goes along, it uses the formula I
described above to approximate the value of pi. You’ll probably get as far as 3.14 before you get bored, but there’s no reason that this method couldn’t be used to go as far as
you like: it’s not the best tool for the job, but it’s super-easy to understand and explain.
Oh, and it’s all completely open-source, so you’re welcome to take it and do with it what you wish. Turn off the graphical output
to make it run faster, and see if you can get an accurate approximation to 5 digits of pi! Or slow it down so you can see how the appearance of each and every point affects the
calculation. Or adapt it into a teaching tool and show your maths students one way that pi can be derived experimentally. It’s all yours: have fun.
And I’ll update you on my health at some other point.
So yeah: that’s not entirely pleasant. A couple of days ago I was diagnosed with what was supposed to be a minor bladder infection and given antibiotics. Then yesterday I became
feverish and collapsed. And now I’m in hospital.
But on the upside, they’ve spent all night pumping me full of some kind of intravaenous antibiotic that must be made from like unicorn spunk and leprechaun tears or something
because it’s frankly magical: feeling so much better today than yesterday.
I’m pretty sure that an outside observer, given the advance knowledge of this blog post, could easily tell when I’m in the process of getting over an illness just by the food I eat. I’m
pretty sure that I have a particular ‘tell’ in the foods I look for when I’m on the cusp of recovering from a cold, like now: or, I suppose, on those rare occasions that I’ll have drunk
enough to be suffering from a hangover.
Take this lunchtime, for example. I’ve been off work for the last couple of days, laid low by what seems to be the very same cold that I was sure I’d dodged when everybody else got it,
last month (I blame Annabel, the contagious little beast, who’s particularly keen on shoving her hands into people’s mouths). Today I’m back on my feet, but working from home: I skipped
breakfast, but by lunchtime I felt able to face some food, and quickly determined what it was that I really wanted:
An egg and cheese wafflestack. If you think it looks calorie-laden and disgusting, then you’re right: but you wouldn’t be saying that if you were recovering from an illness!
Egg & Cheese Wafflestack
Serves: 1 unwell-but-recovering person
Preparation: 15 minutes
Difficulty: if you can’t make this, get the hell out of the kitchen
Ingredients
4 × frozen potato waffles. I’m using Birds Eye ones, but honestly, who can tell the difference?
~ 30g mature cheddar cheese, grated or thinly sliced, brought to room temperature so it melts quickly
2 × eggs
A little vegetable oil
Tomato ketchup (alternatively, brown sauce works well)
Method
Grill the waffles in accordance with the instructions. Meanwhile, fry the two eggs (“sunny side up”: keep the yolk fluid). Assemble in stacks, with each stack consisting of cheese
sandwiched between two waffles, topped with an egg and the ketchup. Serve immediately. Eat as quickly as you dare.
So now I’m sitting here eating the taste of delicious recovery, generating 4096-bit strong probable prime numbers (like you do), and reading the feedback on a browser plugin I released
recently. And every part of that is a huge improvement upon lying ill in bed.
This is the first in a series of four blog posts which ought to have been published during January 2013,
but ran late because I didn’t want to publish any of them before the first one.
2012 was one of the hardest years of my life.
My retweet of JTA’s sentiments, shortly after midnight on New Year’s Eve, pretty much covers my feeling of the year, too.
It was a year of unceasing disasters and difficulties: every time some tragedy had befallen me, my friends, or family, some additional calamity was lined-up to follow in its wake. In an
environment like this, even the not-quite-so-sad things – like the death of Puddles, our family dog, in May – were magnified, and the ongoing challenges of the year – like the
neverending difficulties with my dad’s estate – became overwhelming.
My sister Becky with Puddles, both younger and more-foolish than they eventually became. I don’t know why Puddles is wearing a t-shirt.
The sudden and unexpected death of my dad while training for his Arctic trek, was clearly the event which had the
most-significant impact on me. I’ve written about the experience at length, both here on my blog and elsewhere (for example, I made a self-post to Reddit on the day after the accident, urging readers to “call somebody
you love today”).
My dad, climbing Aladdin’s Mirror in the Cairngorms.
In the week of his death, my sister Becky was suffering from an awful toothache which was stopping her from eating,
sleeping, or generally functioning at all (I tried to help her out by offering some oil of cloves (which functions as a dental contact anesthetic), but she must have misunderstood my instruction about applying it to the
tooth without swallowing it, because she spent most of that evening throwing up (seriously: don’t ever swallow clove oil).
My dad’s clothes for his funeral. My sisters and I decided that he ought to be dressed as he would be for a one of his summer hikes, right down to the combination of sandals and socks
(the funeral director needed reassurance that yes, he really did routinely wear both at the same time).
Little did she know, worse was yet to come: when she finally went to the dentist, he botched her operation, leaving her
with a jaw infection. The infection spread, causing septicæmia of her face and neck and requiring that she was hospitalised. On the day of our dad’s funeral, she needed to insist that the “stop gap” surgery that she was given was done under local, rather
than general, anasthetic, so that she could make it – albeit in a wheelchair and unable to talk – to the funeral.
Five weeks later, my dad finally reached the North Pole,
his ashes carried by another member of his team. At about the same time, Ruth‘s grandmother passed away, swamping the
already-emotional Earthlings with yet another sad period. That same month,
my friend S****** suffered a serious injury, a traumatic and distressing experience in the middle of a long and difficult period of her life, and an event which caused significant
ripples in the lives of her circle of friends.
The notice of Ruth’s grandmother’s death, as it appeared in the online version of her local newspaper.
Shortly afterwards, Paul moved out from Earth, in a situation that was anticipated (we’d said when we first moved in
together that it would be only for a couple of years, while we all found our feet in Oxford and decided on what we’d be doing next, as far as our living situations were concerned), but
still felt occasionally hostile: when Paul left town six months later, his last blog post stated that Oxford could “get lost”, and that he’d “hated hated 90% of the time” he’d lived here. Despite
reassurances to the contrary, it was sometimes hard – especially in such a difficult year – to think that this message wasn’t directed at Oxford so much as at his friends there.
As the summer came to an end, my workload on my various courses increased dramatically, stretching into my so-called “free time”: this, coupled with delays resulting from all of the
illness, injury, and death that had happened already, threw back the release date of Milestone: Jethrik, the latest update to Three Rings. Coupled with the stress of the 10th Birthday Party Conference – which thankfully JTA handled most of – even the rare periods during which nobody was ill or dying were filled with sleepless nights and anxiety. And of
course as soon as all of the preparation was out of the way and
the conference was done, there were still plenty of long days ahead, catching up on everything that had been temporarily put on the back burner.
My sister Sarah and I at the christening of a bus named after my dad. Click the picture for the full story.
When I was first appointed executor of my dad’s estate, I said to
myself that I could have the whole thing wrapped-up and resolved within six months… eight on the outside. But as things dragged on – it took almost six months until the investigation
was finished and the coroner’s report filed, so we could get a death
certificate, for example – they just got more and more bogged-down. Problems with my dad’s will made it harder than expected to get started (for example, I’m the executor and a beneficiary of the will, yet nowhere on it am
I directly mentioned by name, address, or relationship… which means that I’ve had to prove that I am the person mentioned in the will every single time I present it, and that’s
not always easy!), and further administrative hiccups
have slowed down the process every step of the way.
On the first anniversary of my dad’s death, I cycled up a hill to watch the sunset with a bottle of Guinness and a Mars bar. And sent this Tweet.
You know what would have made the whole thing easier? A bacon sandwich. And black
pudding for breakfast. And a nice big bit of freshly-battered cod. And some roast chicken. I found that 2012 was a harder year than 2011 in which to be a vegetarian. I guess that a nice steak would have
taken the edge off: a little bit of a luxury, and some escapism. Instead, I probably drank a lot more than I ought to have. Perhaps we should encourage recovering alcoholic, when things
are tough, to hit the sausage instead of the bottle.
It’s been a while, old friend. A while since I used this delicious-looking photograph in my blog, I mean! This is the sixth time… can you find them all?
Becky’s health problems weren’t done for the year, after she started getting incredibly intense and painful headaches. At first, I was worried that she was lined-up for a similar diagnosis to mine, of the other year (luckily, I’ve been symptom-free for a year
and a quarter now, although medical science is at a loss to explain why), but as I heard more about her symptoms, I became convinced that this wasn’t the case. In any case, she found
herself back in the operating room, for the second serious bit of surgery of the year (the operation was a success, thankfully).
The “F” is for “Fuck me you’re going to put a scalpel WHERE?”
I had my own surgery, of course, when I had a vasectomy; something I’d been
planning for some time. That actually went quite well, at least as far as can be
ascertained at this point (part three of that series of posts will be coming soon), but it allows me to segue into the topic of reproduction…
Because while I’d been waiting to get snipped, Ruth and JTA had managed to conceive. We found this out right as we were running around sorting out the Three Rings Conference, and Ruth
took to calling the fœtus “Jethrik”, after the Three Rings milestone. I was even more delighted still when I heard that the expected birth date would be 24th July: Samaritans‘ Annual Awareness Day (“24/7”).
One of the many pregnancy tests Ruth took, “just to be sure” (in case the last few were false positives). Photo from Ruth’s blog.
As potential prospective parents, they did everything right. Ruth stuck strictly to a perfectly balanced diet for her stage of pregnancy; they told only a minimum of people, because –
as everybody knows – the first trimester’s the riskiest period. I remember when Ruth told her grandfather (who had become very unwell towards the end of 2012 and died early this year:
another sad family tragedy) about the pregnancy, that it was only after careful consideration – balancing how nice it would be for him to know that the next generation of his
family was on the way before his death – that she went ahead and did so. And as the end of the first trimester, and the end of the year, approached, I genuinely believed that the string
of bad luck that had been 2012 was over.
In Ruth’s blog post, she’s used kittens to make a sad story a little softer, and so I have too.
But it wasn’t to be. Just as soon as we were looking forward to New Year, and planning to not so much “see in 2013” as to “kick out 2012”, Ruth had a little bleeding. Swiftly followed
by abdominal cramps. She spent most of New Year’s Eve at the hospital, where they’d determined that she’d suffered a miscarriage, probably a few weeks earlier.
Ruth’s written about it. JTA’s written about it, too. And I’d recommend they read their account rather than mine: they’ve
both written more, and better, about the subject than I could. But I shan’t pretend that it wasn’t hard: in truth, it was heartbreaking. At the times that I could persuade myself that
my grief was “acceptable” (and that I shouldn’t be, say, looking after Ruth), I cried a lot. For me, “Jethrik” represented a happy ending to a miserable year: some good news at last for
the people I was closest to. Perhaps, then, I attached too much importance to it, but it seemed inconceivable to me – no pun intended – that for all of the effort they’d put in, that
things wouldn’t just go perfectly. For me, it was all connected: Ruth wasn’t pregnant by me, but I still found myself wishing that my dad could have lived to have seen it, and when the
pregnancy went wrong, it made me realise how much I’d been pinning on it.
I don’t have a positive pick-me-up line to put here. But it feels like I should.
A few days before the miscarriage became apparent, Ruth and her dad survey the back garden of the house he’s rebuilding.
And so there we were, at the tail of 2012: the year that began awfully, ended awfully, and was pretty awful in the middle. I can’t say there weren’t good bits, but they were somewhat
drowned out by all of the shit that happened. Fuck off, 2012.
Here’s to 2013.
Edit, 16th March 2013: By Becky’s request, removed an unflattering photo of her and some of the ickier details of her health problems this year.
Edit, 11th July 2016: At her request, my friend S******’s personal details have been obfuscated in this post so that they are no longer readily available to
search engines.
Edit, 26th September 2016: At her request, my friend S******’s photo was removed from this post, too.
This weekend was the worst net weekend of cinemagoing experiences that I’ve ever had. I went to the cinema twice, and both times I left dissatisfied. An earlier blog post
talked about the second of the two trips: this is about the first.
You know what – 2012 has been a pretty shit year, so far. We’ve had death (my father’s), more death
(my partner’s grandmother’s), illness (my sister’s horrific face infection), and injury (a friend of mine lost her leg to a train, a few
weeks ago, under very tragic circumstances). We’ve had breakups (a wonderful couple I know suddenly separated) and busy-ness (a cavalcade of day-job work, Three Rings work, course work, and endless
bureaucracy as executor of my dad’s will).
But it gets worse:
Of all the things that have gone horribly, tragically wrong so far this year… going to the cinema to watch this film was the worst.
On Friday night, I went out with my family to watch Piranha 3DD.
This is one of those bad films that falls into the gap of mediocrity between films that are bad but watchable and films that are so bad that they wrap right around to
being enjoyable again (you know, the “so bad they’re good” kind of movies). To summarise:
[one_half]
The Good
Lots of nudity, all presented in 3D. If there’ll ever be anything that convinces me that 3D films are a good idea, porn will probably be it. Boobs boobs boobs.
3D films remain a pointless gimmick, still spending most of their time playing up the fact that they’re 3D (lots of long objects, like broom handles, pointing towards the camera,
etc.), and still kinda blurry and headache-inducing. Plus: beams of light (e.g. from a torch) in 3D space don’t look like that. The compositor should be fired.
The cameos mostly serve to show off exactly how unpolished the acting is of the less well-known actors.
Plenty of less-enjoyable pop culture references: if you’re not going to do the “false leg is actually a gun” thing even remotely as well at Planet Terror, don’t even try – it’s like trying to show a good movie in the middle of your crappy movie, but not even managing to do
that.
Unlikeable, unmemorable characters who spend most of their time engaging in unremarkable teen drama bullshit. Same old sex joke repeated as many times as they think they can get
away with. And then a couple of times more.
Lackluster special effects: mangled bodies that don’t look much like bodies, vicious fish don’t look remotely like fish (and, for some reason, growl at people), and
CGI that would look dated on a straight-to-video release.
The worst part of being so horribly ill is the moment when you’re dashing to the toilet before you pebbledash the floor with your arse… and at that moment you realise that your stomach
is about to eject it’s contents, too. What a paradox.
In any case – it’s not all bad news: the Ship & Castle has been re-opened. It’s now run by
Ian Blair, the man behind The Mill. They’re still doing real ales (albeit a very slightly reduced
selection), and the redecoration of the place has given it a lighter, more ‘open’ feel. Sadly, the jukebox has been changed, and several of the better rock ballads CDs have been
replaced with “Now XX”.
[this post has been partially damaged during a server failure on Sunday 11th July 2004, and it has been possible to recover only a part of it]
[more of this post was recovered on Friday 24 November 2017]
Here’s some stuff I found interesting this weekend:
Swedish health workers, in an effort to stem the growing cases of chlamydia among young people, have launched a ‘condom ambulance [BBC News]. If you find yourself ‘caught short’ in Sweden,
just give them a bell and they’ll rush around to your house with a pack-of-three, for the equivelent cost of about £4.
Chinese researchers have used a carbon nanotube [Wikipedia] as a filament in a new, experimental light bulb [The Register]. This bulb emits more light and works at
a lower threshold than tungsten at the same voltage, and was still functioning fine after being switched on and off 5000 times. The future of lighting?
And finally, researchers from Hebrew University in Israel may have found a solution to the problems associated with passwords. As it stands, ‘secure’ passwords are hard to remember, and
often find themselves written down, whereas insecure ones can be cracker. Plus, for real security, passwords should be …
[this post has been partially damaged during a server failure on Sunday 11th July 2004, and it has been possible to recover only a part of it]
Feel rotten. And I’m supposed to be back at work, today. Called in sick, especially apologetically.
Had another lariam-induced mood swing yesterday, and became especially grotty to people, so went and excluded myself from them for awhile. I’ve made an appointment to see the doctor
next Monday, pre-emptively: if these side-effects don’t get any better by then (I’ll be taking more of the drug today) I’ll ask about switching to one of the alternative meds. After
all, as margi said, if I’m becoming intolerable in quiet company with friends, what am I likely to be like under the African sun with strangers.
And if today’s pill brings everything into line, I can cancel my appointment. Winner.
In other news, as promised, below is a picture of my beard in it’s new “Ming The Merciless” (Flash Gordon, for those of you with no film culture) configuration. And yes, I mean the 1936
one:
[picture removed]
It’s really quite scary to look at the original Flash Gordon and realise that…
After my stressy-rant the other day, Claire, Kit and Paul started tidying up Claire and my flat. My suspicions – that they were doing this to try to make my life a little less stressful –
were confirmed by Claire one evening.
They mean well, but I can’t help but feel that instead of having lots of things to do and little motivation, I now have somewhat fewer things to do and little motivation. I’m not sure
whether that’s an improvement or not. I guess it is. More prominently, for awhile I felt guilty: like by my blog entry I’d, like, emotionally blackmailed them into doing it. I mean:
tidying my flat? I don’t know.
Claire’s not feeling well and has taken an early night, but I can’t sleep again.
I do feel a lot better though. I guess my friends’ efforts really have helped. It makes me happy to have friends who care. It makes the corners of my eyes twitch and my stomach try to
swallow my heart, all by themselves. I guess this is what friends are for.
I’m going to check if Claire’s asleep and take her some more painkillers if she’s not. Then I think I’ll take a walk, then try to get some sleep.