Thursday, May 19, 2011

The End of the World


So, apparently, the Bible says no man can know when the world ends. It's kinda funny, I mean, now people are saying the world can't end on Saturday at 6pm local time, because some random Joe thinks it will.

Think about that for a second. It's highly exploitable.

So here's the plan:
1) A computer assigns (future) dates and times to every person on Earth, and to new arrivals as they appear.
2) These people are told that this is the date, hour, minute, and second that the world ends and tell no one else the date they were given.
3) As people die, their dates are placed back into the computer and doled out again if they are still in the future.

There are approximately 6.77 billion people on Earth, which comes out to about 214 years during which the world cannot end without a single one person knowing the date or hour (or minute or second; the last thing we need is God slipping the end of the world in between two hours). Unfortunately, we can't go to milliseconds; that only gets us one fifth of a year.

It is absolutely critical that each person knows only the date and time they were assigned: the moment a person knows two, there is an uncertainty with his own, and the world ends.

It may be necessary for the people operating the computer to not participate in this project.

For safety, some people should be held in reserve, in case it becomes necessary to quickly have someone know when the world ends (i.e.: someone died and the world ends tomorrow). That may not be strictly necessary, since this knowledge should apply from the afterlife as well, but we should not take any chances.

Friday, April 08, 2011

Python switch statement

Having a bit of fun at 3 in the morning.

The Python version of the C-style switch statement is either a bunch of if/else's or a dictionary. Going the dictionary route can be ugly looking (not to mention confusing, pulling a value out of a mapping and calling it). This just encapsulates the whole thing and adds some support for a pseudo-default case.

The structure is a bit weird, nowhere near as nice as regular syntax, but if you absolutely have to do this, it makes it easier to read.

Wednesday, April 06, 2011

And now I can't remember what got me on this line of thought...

So here I am, hacking away in Python for oh, a few years now, and I just remembered what got me into Python in the first place.

See, I was using Python's implicit line wrapping with a tuple, and remembered back to when I read an article explaining that Python did that. Before that, all my longer lists weren't wrapped, or wrapped with '\'.

That made me recall the impetus that had me looking for such information in the first place: a Wiimote driver for Linux called CWiid.

Which, coincidently, was the first time I had seriously taken a look at Python.

I was using it to add motion control to Descent 3, which I had just purchased from GoG.com, which was... September 23rd, 2008.

I got something rudimentary going, noted that it would take a lot of hacking to make it better, and I needed to be better at the extension language it used to do it myself. So I waded into that language, which turned out to be Python.



Huh. I never did get back to motion control in Descent 3...

Wednesday, June 09, 2010

Quantum Electrodynamic Threshold

Wikipedia: Quantum Electrodynamic Threshold

Whether this is real or not is immaterial to my purposes. What I really want to know is, if one were to be fixed in place about a meter from the edge of one of these things--unaffected by the massive magnetic field--then 1) what would the region look like, and 2) what would happen to matter entering the region assuming the magnetics don't immediately pull it to the center. Also, what does it look like from the inside--looking deeper in, to the side, and out.

Tuesday, November 24, 2009

Ninja Planet

16:55:24

You're standing in the wasteland of the planet Ninja.

The desolate land that stretches out before you is scattered with knobbly trees, swaying lightly in the breeze. Twisted mountain peaks occlude the horizon, silhouetted by the setting sun behind them, and casting shadows that claw their way towards you. The whole landscape radiates a level malovence that should be impossible for mere nature.

You knew the moment you entered the atmosphere in you exploration lander than even coming near this planet was a horrible mistake, but here you are, 3 feet from the ladder back into the craft, standing, frozen in place, and attempting to plan out your escape.

The breeze picks up slightly, pushing a light cloud of dirt off the vacant landscape and into the air. Your eyes catch on the swirls in the ominously blood-red dust. Are they simple vortexes, or perhaps, something else..? A small twig or rock bounces lightly off your right thigh. You don't dare move to see which.

Timing drifts through your head. Approximately five seconds to get to the airlock, two to key it open and another to step through and hit the 30 second cycle sequence. One long minute to run through the abbreviated emergency checklist. 8 minutes to orbit.

Nine minutes and thirty eight seconds. Five hundred and seventy eight ways to die.

This is planet Ninja. In front of you? Well over a thousand ninjas... probably. You imagine them watching; Waiting for weakness. You hope it's your imagination.

16:55:25

You discover your legs won't move. One second of thought, one more way to die, though this one more unanticipated than the rest. Your hand brushes over a small pin stuck to your right thigh.

Inaction has consequences too.