Skip to main content

Musings

This site is now sort of static

checkmyworking.com has always been powered by WordPress, but every now and then it’s fallen victim to annoying hacks that manage to write some spam nonsense at the top of all my PHP files. From what I can tell, WordPress and the few plugins I use are such a labyrinthine mess of code that going through and closing security vulnerabilities would be a sisyphean task.

So, I’ve taken the nuclear option – this site, as served to the wider web, is now entirely made up of static files. Hopefully, that’ll stop the hacks – there’s no PHP to abuse, leaving only any vulnerabillities in Apache or Media Temple’s account management as potential ways of getting in.

The static files are generated by Spress, which seems to be one of the least opinionated static site generators I’ve come across. It was very easy to make it produce pretty much exactly the same pages WordPress does.

I still wanted the nice editing interface WordPress provides, so I’ve made a plugin which exports posts from WordPress to the Spress source directory whenever I update them. I’ve got the WordPress installation hidden somewhere private, behind a very simple login script which stands in the way to make sure that nobody else can run WordPress code. This way, I can write posts in WordPress, and the plugin automatically rebuilds the site for me. The one compromise is that I can’t do comments any more – my current line of thought is that I’ll write a script to add comments to the WordPress database which would be simple enough to satisfy myself that it’s more secure than going through WordPress itself.

For the moment I’ve kept the layout of the site as it was, but it’s looking very old now so I’d like to redo it at some point. I don’t really post here any more, so it’s entirely possible that this’ll still be the top post in a few years’ time.

Next job is to do the same thing to The Aperiodical, which will take a lot more work!

All my new businesses!

I don’t mention it much, but I’m an entrepreneurial, go-get-’em, many-irons-in-the-fire, have-my-people-call-your-people kind of guy! Barely a day goes by when I don’t start a new business with a choice punning name and announce it on Twitter.

Twitter just switched the switch to let me download my tweets archive, so I immediately did that and grepped it for my many many new business names. Here they are:

Read more…

Some of my old BlitzMax games

When I was in school I used to spend a lot of my time making games in Blitz Basic (and later BlitzMax). Eventually, as I got older and more boring, I ran out of ideas and started doing other things. I haven’t sat down and made a satisfying game in years. I used to really enjoy it though, and I made some things that I really liked. I used to think that maybe I would be a trendy game designer one day.

I was thinking about that this morning, so I decided to go through and play a few of my old games. I feel just as much a need to show them off now as I did when I made them, so I’ve recorded a few screencasts. Camtasia broke for Unknown Reasons and it turns out Jing is sort of terrible at recording games, so they’re really jerky and the volume’s quite low, but I’m not going to not share them now I’ve made them.

Here they are:

I’m quite disappointed that a few of my favourites didn’t run. I’m sure if I recompiled them they’d work. All of my code is in a repository on github, and compiled versions of everything are on my original homepage, somethingorotherwhatever.com. Here’s a list of links to the ones that work at least a little bit:

Trenchant, Poption, Fencing, Bubble worlds, Trader, Schroedinger’s Ghost, Beards, Rowing, Surroundemup, Clockwork Shooter, Schizophrenic Pacman, Museum, Horsey (browser version), Kleinsteroids

A huggermuggering nonannouncement of an overinvolved knickknack

It’s odd, the process of waking up. Sometimes you can get out of bed and stumble around for an hour or two, maybe even get dressed and go to work, before your brain does anything to differentiate you from a patient in a highly mobile vegetative state. On other days it seems that your mental starter motor catches on the first try and before you’ve even opened your eyes all sorts of brilliantly original thoughts are competing for attention.

Today is one of those days. As I swung my big long legs out of bed the thought occurred to me that the word “cheese” has an awful lot of Es in it. (“Brilliantly original” is of course a subjective description, but this is my story so I say it qualifies). I wondered what word has the most Es in it. Now we’re beginning to move towards a decent notion.

Read more…

Fibonacci Grids

I uploaded this video to YouTube last week but I forgot to make a post here. It’s about a moderately interesting fact about fibonacci numbers that David Cushing told me at MathsJam. I generalised it a bit, so I’ve been meaning to write a post for The Aperiodical or do a snappy video or something like that for ages.

I finally decided last week to just sit down and record myself going through the proof, so here’s that video. I deliberately didn’t prepare beforehand, so it’s just under an hour long and contains a lot of thinking out loud.

Converting a stream of binary digits to a stream of base n digits

James Coglan asked on twitter:

https://twitter.com/jcoglan/status/212163174626115584

https://twitter.com/jcoglan/status/212163325579108353

So you have an infinite stream of uniform random binary digits, and want to use it to produce an infinite stream of uniform random base n digits.

The obvious really easy way to do it is to find the smallest k such that 2k>=n, and generate numbers in the range 02k1.

If the number you generate is less than n, yield it, otherwise chuck it away.

This works, but has the problem that you might go a long time before you generate a number that you don’t throw away.

So what can we do with the numbers that are thrown away?

Subtract n from them, and use them as a stream of infinite base (2kn) digits.

You can then do the same trick of generating enough of those digits until you can generate numbers greater than or equal to n. Numbers less than n are yielded; otherwise, the trick is repeated yet again!

Read more…

Problems I’m currently thinking about

I’ve been in a bit of a problem-posing mood recently. Hopefully I’ll do some problem-solving soon. Here are a few questions I’ve thought of but haven’t got solutions for. I haven’t done any literature searching, so these might have been done before.

All the problems are quite computery. Maybe I’m a computer scientist, really.

Read more…

Visualising the wrong data on the Guardian data blog

This visualisation shows for each council or unitary authority how many hours a week you’d need to work, earning minimum wage, in order to pay the median rent for a one-bed flat. The minimum wage is a national constant.

No justification is given for using the median rent. In a fair world, the median rent should be paid by someone on the median income. Assuming that people earning the minimum wage are the lowest earners ((this isn’t true: people earning cash in hand, for example, might earn less than the minimum wage but they still have an effect on house prices)) and make up X% of the population, then an upper bound for rent paid by people earning minimum wage should be the Xth percentile, if housing is provided fairly ((another large assumption.)). If you’re not paying attention to this kind of thing, you might as well just say “average” instead of “median”.

Finally, there’s this:

Note that these figures are dramatic simplifications, used for illustrative purposes only: in reality tax payments, tax credits, housing benefit, council tax, utility bills and more substantially alter these figures.

So the figures are meaningless anyway – benefits might be so generous that very little of the lowest earners’ pay goes towards housing, or taxes might be so high that people really need to work many more hours than this statistic claims in order to keep a house.

Supposing that all of these problems are sorted out and we calculate a reasonable-sounding number of hours to work to earn rent each week, what should that number be? What if house prices plummeted but food became very expensive? I can’t think what these numbers are telling us that raw rent data aren’t already.

A question has occurred to me: would I be making life worse for those worse off me by living in a flat cheaper than I should be or, on the other hand, would spending a higher than average proportion of my income on rent drive prices up, having an effect on the bottom end of the market? I suppose taking a cheaper flat reduces the prices of nicer ones. This is why I don’t like economics.

Using a zero-knowledge protocol to prove you can solve a sudoku

I’ve just uploaded to youtube a video I made with Katie Steckles to demonstrate why zero-knowledge protocols exist and how one works.

Katie is a habitual liar, so we followed the zero-knowledge protocol described in the paper, “Cryptographic and Physical Zero-Knowledge Proof Systems for Solutions of Sudoku Puzzles” which you can download from http://www.mit.edu/~rothblum/papers/sudoku.pdf

By following this protocol, Katie can prove that she isn’t lying to me about being able to solve the puzzle, without revealing anything about how she solved it.

The paper I mentioned, “How to explain zero-knowledge protocols to your children” is an excellent explanation of the ideas behind zero-knowledge proof. You can get it from http://pages.cs.wisc.edu/~mkowalcz/628.pdf

Fractal dimension in IKEA

A long time ago, I realised that IKEA’s shopfitters must be experts in fractal dimension – they manage to lay out their shop so that you have to walk past every single thing they’re selling. You can’t just nip into IKEA – you have to go through the whole hour-long “It’s A Small World” of affordably wobbly furniture even if all you want is some kitchen utensils from the bit at the end.

I’d been meaning to add something about this to the Maths in the City site but it required going in to IKEA and taking a picture of their floor plan for illustration. I just remembered this morning that I’ve already taken one of those pictures, so I spent half an hour writing up this article – Fractal Dimension in IKEA.