May
30
2008
Let’s start with an analogy. I’ve got the manuscript for my bestseller here and I want you to proofread it for me. My options are to email it to you or put it online somewhere for you to download. Email is an effective way of pushing it to you but it might be too large a file to attach. Alternatively I could send you a link which you can use to download from somewhere else. The advantage of this method is that it scales really well — if I want 50 friends to read my new book it’s just as quick to email them all with a link.
There is one disadvantage — if the file isn’t there then the would-be proofreader sees Error 404: File Not Found. And they give up.
Using this analogy we can look at the problem of programs moving data about in memory. There are two ways to do — copy all the data from one place to another, or just copy the location where the data is stored. This is the same idea as emailing the whole document or just emailing the link.
The disadvantages of copying all the data around should be easy to see — it’s terribly slow. All of these delays cost a lot of time because memory access is so much slower than the processor. The alternative, passing references round instead of all the data, is much faster. The only data copied is a tiny little link showing the location of the needed data.
But — and this is really important — if the link points to the wrong data then the consequences can be catastrophic. If the in-memory link (which is called a “pointer”) doesn’t point anywhere then the application (or even the whole computer) can crash. Why such a big reaction to what is essentially a 404 error?
The details to this are quite interesting. Inside your computer there is an intricate hierarchy of privileges — this prevents programs from doing things they’re not allowed to do, like reading protected files without permission. One of the ways in which these privileges work is that each program is assigned an area of memory to use. It can’t just access any old location in memory. If a program tries to access memory outside its own assigned segment it will often be killed by the operating system. (If it is not killed then the program could do something dangerous like interfering with another program or with the operating system itself.) The operating system may state that the program was killed because of a segmentation fault or similar stern warning.
One common fault in programs is trying to follow pointers that don’t point anywhere. These are often called null pointers, since they actually point to address zero in memory, which doesn’t contain anything. This memory location is specifically not owned by anyone, so there should never be any need to look there. Any program which does look there is assumed to be in error and killed by the OS.
You know how common 404 errors are when browsing the web. Null pointers are just as common in programming. They are used all the time and can be quite powerful in many situations. But they are also very dangerous and many modern programming languages do their best to provide the advantages of pointers without the dangers. Sometimes the result is like a safety razor, with most of the function and fewer dangers — and sometimes the result is just the same dangerous tool with a warning sticker.
May
29
2008
We spent last weekend painting the front room in our new flat. It’s the first time I’ve painted a room and it shows. Well, it’s not that bad but it could be more evenly coloured.
It was easy to get all the painting done last weekend because we don’t have any furniture yet. This could become quite awkward as we’ll be moving in this weekend. We have no dining table or chairs (though there is a window seat…) and no sofa either.
We haven’t really made any firm decisions about dining tables. I don’t really like formal or “modern” tables — I want something that has character and feels friendly. A farmhouse feel to it, rather than a silver-service restaurant aesthetic. What can I say about my romantic notions that is not apparent? ;-)
I’m looking forward to the new flat with an almost silly amount of excitement. Despite not even having any furniture to eat at, I’m excited about baking. I bought the book Lawrence recommended a few months ago1 — Dough: Simple Contemporary Bread by Richard Bertinet. I just watched the included DVD and now have to resist the urge to just not bother going to work and baking bread all day instead. The Amazon reader reviews for the book are similarly effusive/evangelical/ominous: buy this book and you will become dangerously addicted to bread-making.
The other cooking we’re doing, the Nigella Express Challenge, is a bit neglected at the moment. We are the furthest behind schedule we have been since we started. By my reckoning that’s about 13 recipes behind schedule, assuming a regular timetable. Moving house will may impact us in either way:
- An excuse to eat a lot of easy food or takeaway pizza. Having La Favorita across the road is a dangerous temptation.
- Lots of food-laden gatherings. Dozens of flat-warming parties!
The more enthusiasm we get for option two the more likely it will happen that way!
But back to the move: we haven’t done any packing either. Our brave friends have volunteered to bring cars on Saturday and haul our various bits and bobs from one end of town to the other, through massive roadworks and diversions. If there are any lone bodies out there who are willing to lend a hand on Saturday or Sunday then get in touch. Getting all this stuff up to the third floor might be more trouble than we’ve anticipated.
May
27
2008
Saw Indiana Jones and the Kingdom of the Crystal Skulls on Saturday. Spoilers if you follow the link…
Continue Reading »
May
24
2008
I’m standing (yes, standing) in the new flat at the moment. We have no furniture (hence the standing) and no internet (hence the leaching off anonymous wifi connections). I also get a better signal with the Eee on the mantle piece so that’s why I’m not sitting on the floor.
Today we intend to paint the front room. We have paint — Ruby Fountain 2 — and we have brushes and enthusiasm. And primer and polyfilla and rollers and dust sheets and so on. But now that we also have internet things have ground to a halt. I’m blogging, not scrubbing. Oh well.
May
22
2008
I mentioned that Helen bought REM’s new album Accelerate last week. It’s been a while since I’ve said this but I’m really enjoying their new stuff. For a start — and this has proved to be a good sign in the past — Michael Stipe is angry. His lyrics have bite and his singing does too.
Peter Buck and Mike Mills have given up farting around with their E-bows and keyboards and started making some loud noises with their instruments again. There’s real distortion on some of these songs! Angry chords! I’d say their current style is an amalgam of Monster, Automatic for the People and Up in all the good ways: political, loud, tuneful, energetic and alive.
It’s so good to hear them back on form again. We’ll just politely pretend that this is their first release since Up and all will be well.
May
22
2008
Let this be a salutary lesson on the dangers of impulse buying. If you don’t spend a few minutes reading reviews on Amazon you might accidentally buy Amir Aczel’s The Artist and the Mathematician, the “story of Nicolas Bourbaki, the genius mathematician who never existed”. And that would be a mistake.
Nicolas Bourbaki was the pseudonym of a group of French mathematicians who attempted to formalise mathematical thinking in the early to mid-twentieth century. In the author’s opinion Bourbaki’s publications had important influences on the structuralist movement that would spread from linguistics and anthropology to many disparate areas of science.
Well, I wouldn’t know about that; and I still feel like I don’t know about it. The book is filled with tedious and trivial details where it should provide only impressions — and sketchy and vague where it should be exact and clear. In fact it exemplifies everything the Bourbaki group were pushing against. Aczel takes whole chapters to explain the minute detail surrounding the early life of one mathematician (including the life of his parents when they were young…) though this has no real relevance to the work he did. In fact, now I think on it I can’t even remember which mathematician gets all the boring backstory.
Whatever: the point is that the writer doesn’t bother telling you why any of this matters. He name-drops mathematical ideas without context or explanation. They have no more relevance to the reader than the endless litanies of people and parents’ occupations and meetings and so on. Amir Aczel insists that Bourbaki was incredibly influential in whatever it was they did, without bothering to reveal whatever it was they did. And that many other fields borrowed these ideas to do whatever it was that they did, again without explanation or detail. And then eventually we find that Bourbaki became less relevant — though again, without explanation.
It’s quite satisfying to say that an author who talks about abstract algebras and category theory is “over-generalising”. If only the book were as satisfying. Instead, I can heartily recommend Mario Livio’s The Equation That Couldn’t Be Solved — a proper tribute to genius mathematics.
May
21
2008
Today’s crazy thought was inspired by Scott Aaronson’s lecture notes/discussion on The Emperor’s New Mind. He notes that, for human thought to be computable then it must be equivalent to a Turing machine. So, the author of The Emperor’s New Mind, Roger Penrose, must be equivalent to a particular machine M.
Does M output the following sentence?
“Roger Penrose will never output this sentence.”
Well, we don’t know what that means — for a person to “output a sentence”. For a classically defined Turing machine we know what it means, but not for humans. I’m sure Roger Penrose could say the above sentence but that’s not what the statement means. I certainly don’t know, though I can talk nonsense as much as anyone.
It did bring to mind a discussion with Nick in a previous comment thread, about believing one’s own opinions. From the accusation that “you always believe your own opinions are right” it seems reasonable there must be people who believe their own opinions are wrong. Why would one hold opinions that you acknowledge to be wrong? Is it even possible?
I suggest that one of the limitations of the Turing machine M, which we call Roger Penrose, is that it cannot believe things it doesn’t believe. Obviously! The fact that I thought it worth writing a blog post about is probably what makes this crazy.
May
19
2008
Whenever I get the chance to read a newspaper I end up really angry. The Observer on 18 May had several columns about abortion and very few of them were sensible. There were contradictions, unverified claims and outrageous lies throughout the whole thing.
I really wished that the reporters would make some attempt to verify the statements made by the interviewees. Do good journalists verify the statements they print? For instance, this opinion of Sister Andrea Fraile in Glasgow is just worthless scaremongering:
‘[Abortion] can be very detrimental to their mental state. Physically it
could mean that in future if she wants to have a baby she will have
difficulty conceiving. And she may have difficulty sustaining relationships
and may turn to drink or drug abuse to help her cope.’
There is no good link between past abortion and future ability to have a baby. Neither will getting an abortion mean you can’t sustain relationships or become a junkie. It’s just all complete nonsense. In place of calling these people out for their repeated nonsense, I would like to suggest a new form of punctuation which I will call “the slap”. It looks like ❢ (that’s HTML entity ❢ or heavy exclamation mark ornament if you want to use it) and should be used like a more flexible version of Wikipedia’s [citation needed].
‘[Abortion] can be very detrimental to their mental state. ❢
Physically it could mean that in future if she wants to have a baby she will
have difficulty conceiving. ❢ And she may have difficulty sustaining
relationships ❢ and may turn to drink or drug abuse to help her
cope. ❢’
It means something like:
- No,just stop it
- You made that up didn’t you?
- This is fraudulent nonsense
- You’ve been rebuked for telling this lie before
…and so on. It’s not a very subtle tool but it’s immensely satisfying. I’m beginning to feel that such people deserve only ridicule.
May
18
2008
I’ve had a great weekend and done lots of exciting things with interesting people, old and new. I should probably mention some of it here. But instead I think I’ll just close the lid on the laptop and relax for five minutes. I feel a bit burned out, more than anything. (This could be an effect of spending an afternoon in the sun.)
I look forward to having some time in our new flat. This Friday! We still don’t know what the hell’s happening, but that’s cool, right?
May
15
2008
Is there a meaningful difference between
- someone who won’t vaccinate their child because it will give them autism
- someone who won’t vaccinate their child because it promotes promiscuous sex
And having asked that, what do you think about compulsory vaccination? I haven’t thought about it yet and I’m ready for bed. Comments please!