Log in

No account? Create an account

t3knomanser's Fustian Deposits

How Random?

How Random Babbling Becomes Corporate Policy

run the fuck away

Mad science gone horribly, horribly wrong(or right).

How Random?

Previous Entry Share Next Entry
So, I found a website that offers you truly Random Numbers as generated by a quantum detector doohickey. Very cool but just getting numbers on a website doesn't do me any good at all. So much work to try and integrate them into a program. So I encapsulated that work in some java code- there are three classes- qrandom.Random which actually gets the page, scrapes it, and returns the results. There's a really nasty hack in there, because I was too lazy to tweak the regex properly. The second class is an XML-RPC server for qrandom.Random and the third is a client to connect to the XML-RPC server.

The end result? If someone really wanted to, they could host a Random Number server over XML-RPC using the quantum generated numbers. This is really handy for encryption purposes, and all sorts of math and research.

For the geeky of you, there's a .jar containing the class files and source and JavaDoc. If you poke in the source you'll see my really ugly hack because I was feeling like a regex retard (namely, I actually have the remote site generate twice as many numbers as you request and only return half of those). ::shrug:: I do think they'll be fairly upset if anyone ends up running my server and fielding lots of hits. Though, they say that in a few months they'll have their own server running, though I don't know what protocol it runs. I do hope it's XML-RPC, because XML-RPC is sexay.

All in all, the QRandom thing took about an hour of actual work, most of which was spent learning how java.util.regex works.
Powered by LiveJournal.com