I’ve been cleaning up my server. Long-story-short, my hosting provider abruptly informed me a couple weeks ago that they were discontinuing support (ie. turning off) an older version of the database that is hidden quietly behind — but vitally important for the operation of — this site.
So, I’ve been cleaning up my server.
It didn’t affect this blog, but when I crawled into the digital root cellar that is my server and had a look around it became abundantly clear that a couple years worth of old projects were due to be vaporized in a little less than a month if I ignored both the warning and the mess.
So, I’ve been cleaning up my server. (Which goes a long way to explaining the thinned trickle of posts lately, by the way!)
Long Lost Treasures
Of course, like anyone who’s been living somewhere for over a decade can attest, junk piles up. And a server, it would seem, is not much different. In the past I’ve apparently spent time building little sites that have served long lost purposes, or have flopped, or for whatever reason were stuffed into dusty folders and ignored for many years.
I’ve found some odd, interesting, and occasional cool stuff, let me tell you.
One of the interesting things that caught my eye and my attention this past few days was some work I was doing on trying to mess around with approximating a true random number generator.
Randomness is fun. And hard. There are loads of pseudo-random number generators, many of them built into programming languages and used by default in silly little applications that only need to give the appearance of randomness. For example, the header images on this blog that on each reload provides you, the reader, a slightly different look and layout for your viewing pleasure, makes use of the rand() function in MySQL or the rand() function in PHP, depending, to pick something marginally random from a slightly larger data set. Say, pick 4 feature articles from 10 potential candidates. Or, pick 1 header banner from 20 possible header banners. It only needs to seem random, and true randomness is not vital to the operation.
But true randomness, when true randomness is required, is important, too. Think about games of chance or when money or something else of value is on the line. Randomness matters.
So, at some point I had built a random number generator into the template of one of my blogs.
Noise and Code
It wasn’t so much a number generator, I suppose. It was a noise gathering tool. It was an entropy observation and recording system that gathered entropy from human interaction with the blog.
It was a noise gathering tool.
See, you are a random-like factor when it comes to the computer. When you click on something, load a page, click to another page, this is a kind of quasi-entropy. Entropy comes from many sources, and I’m sure a student of entropy maths (whatever that is) would argue that there are numerous flaws in my logic, but hundreds of visitors spread across random locations and a variety of influencing factors — coupled with the only moderate popularity of this particular website — means that, say, converting a few digits of the time-of-reload time-stamp to a binary string, jumbling that together with all the other bits of entropy, and outputting it as say, a series of four-digit binary numbers, gives something like this:
1100 1111 0000 0001 1101 1001 0010 1100 1001 0011
0010 0100 0100 1101 0100 1101 0001 0000 0010 0010
1000 0000 0110 1001 1100 1001 1100 1001 1001 0010
Or maybe this:
1110 0011 0001 1010 1000 0010 0110 1110 1101 1001
1111 0010 1110 1110 0111 0100 1001 1011 1110 1011
0011 0110 1100 1001 1011 0001 1011 1100 1011 0001
It’s quasi-random, and someone with more understanding of the topic and a bit better grasp of statistical mathematics could probably poke some holes in my method.
But in the meantime, I might just dust off this long lost bit of treasure code and make something interesting out of it. If nothing else, more randomness on this blog might not be a bad thing…
If you are curious about playing around with these numbers, the ever-changing output of this entropy file is available here. I’d be interested in your analysis… so comment, write, or whatever…