Old computers

The Linux boot up message of the moment:

/ has gone 49710 days without being checked, check forced.

This would place the manufacturing date of the computer in question at around 1872 or earlier; a century before the UNIX epoch (the official Dawn of Time for UNIX-based computers) and at least 86 years prior to the invention of the microchip.

Horrible Java

Apologies to non-geeks. The following Java code determines whether infinity is even or odd. It compiles, runs, finishes immediately, and outputs “false” (meaning that infinity is odd).

class Infinity \u007b static \u0062\u006f\u006f\u006c\u0065\u0061\u006e\u0020\u0065\u0076\u0065\u006e\u003b static
{
    // Configure infinite speed
    System.nanoTime(\u002f\u002a);
    boolean even = true;
    double i = 0.0;
    while(i <= infinity)
    {
        even = !even;
        i += 1.0;
    }
    System.normalTime(\u002a\u002f);
    System.out.println("Infinity is even: " + even);
    System.exit(0);\u007d
}

Yes, it's all smoke and mirrors, but I've been having fun with it.

The university of technology

All Curtin students and staff know about OASIS.

OASIS purportedly stands for “Online Access to Student Information Service” . Is that the best they could do, you ask? Evidentially, that full name is now such an embarrassment that it doesn’t seem to appear anywhere on the official OASIS website. However, I’m still not sure which is sillier – the full title, the abbreviation (a transparent backronym), or the slogan bestowed upon us when it first launched: “One site to rule them all”.

It’s bigger than Jesus!

The centrepiece of OASIS is the OCC (Official Communication Channel), through which students receive official correspondence from the University. Replacing physical mail with electronic mail is commendable, but OCC has two small drawbacks. One is that you can’t choose to receive OCC messages via email, or even to receive email notifications. You must remember to log in to OASIS. The other is best illustrated in the following pie chart, representing all the messages (now archived) I’ve received:

oasis_occ

In the past 27 months, I’ve received 21 useful messages: about 0.18 per week. I realise that at some level the University is obliged to send me the other messages as well, but that’s not the point. Logging into OASIS isn’t hard, but you quickly forget because it’s usually such a fruitless exercise. According to the official policy, one “performance indicator” for the OCC is: “The percentage of students with active OASIS accounts that access their official correspondence at least once per week.” They’re not advertising this metric, of course.

It’s not until a library book is recalled (whether you’re the original borrower or the recaller) that you appreciate the true splendour of the OCC. I simply didn’t know about mine until after fines had already started accumulating, and the person who’d recalled the book probably wasn’t too happy about it either. With email, I’d have returned the book the same day.

Not to be entirely defeated, however, I created a script on my laptop that automatically logs into OASIS for me at 11:30 am each day and forwards all new OCC messages to my email account. The Curtin bureaucracy hasn’t quite mastered that idea yet.

Bouncy bouncy

When my housemate told me of his scheme for constructing a physics simulation, I did the only decent thing I could. I stole his idea. I turned to my copy of Serway and Beichner (a ~1600 page physics book that I keep under my pillow for just such emergencies) and sat down to work out how to get 2D circles to bounce off each other in the expected manner. Not that anyone has actually seen two-dimensional circles bouncing off each other in everyday life, what with the universe being three-dimensional and everything, but somehow we still have a conception of what it would be like if it were possible.

This took a surprising amount of math (much of which was admittedly due to a series of mistakes). Collisions must preserve overall momentum and energy, and the direction of acceleration must be determined by the angle of collision. And it’s nice if you can remember the quadratic formula, and work out which of the two answers it gives you is the right one in this circumstance.

Eventually I got it working, using a combination of C++, KDevelop, CMake, SDL and OpenGL, all of which I was using for the first time in years, or in some cases ever. My housemate valiantly tried to suggest the use of autopointers, but I was all learned out at that point. So, having triumphed in two dimensions where others have merely succeeded years or decades ago in three dimensions, I now have a little black window containing 20 or so blue circles of various sizes (and virtual masses) bouncing around and hitting each other.

The algorithm assumes for the moment that a given circle can collide with at most one other circle in every discrete time unit. When multiple simultaneous collisions occur, at least two circles become entwined – partially overlapping. They constantly “collide”, in each and every time unit, each time alternating direction with respect to each other but never gaining sufficient velocity to escape. They each just vibrate back and forth. The net effect is that they become a combined object, which exhibits angular momentum. The two balls spin around each other, with the “heavier” one making less pronounced motions than the “lighter” one. And I haven’t even tried to model angular momentum yet.

The next step will be allowing for multiple collisions with the same object in the same time unit, which should theoretically stop this from happening. But I might just have to preserve the current version.

Window focusing

The user interface of OS X has many things to commend it. Its click-to-focus function is not one of them.

OS X, by design apparently, lacks a click-through capability. As far as I can tell there is no way to enable it. This generally means that when you click on a window to select it, the window itself will be blissfully unaware of the event. If you want to press a button in an unselected window, you must click once to select the window and once again to press the button.

As far as I can tell (and I could have missed something here), this is designed to prevent you activating some random hideous piece of functionality by accidentally clicking off the edge of the selected window, on the window underneath. However, while in certain somewhat undesirable states of mind, this subtle obstacle can become unimaginably irritating.

But surely Dave, can’t you just get used to double-clicking to press a button in an unselected window?

But I damn well shouldn’t have to! What if you have more than one screen (something that OS X in general handles quite smoothly)? The whole rationale falls to pieces. You have multiple screens so that you can rapidly switch your attention between multiple windows without worrying about the mechanics of the window manager. That’s not to say I haven’t tried getting used to it, but unfortunately OS X provides only a subtle visual distinction between selected and unselected windows. It’s rather counterintuitive to have to modify your actions based on the colour of the buttons in the top-left of the window.

Even if I did get used to it, I’d still be screwed because if you double-click on an unselected window, the window receives a double-click event, not a single-click, and something unwanted is bound to happen. For instance, my text editor (Smultron) lists the currently-open files down the left side of the window. If you single-click on a filename, that file will be displayed. If you double-click, the file will be displayed in a whole new window. That in itself is a perfectly reasonable and useful thing for a text editor to do, IMO, but couple it with OS X’s window management and it can become a headache.

What you actually have to do is click once to select the window, wait a prescribed amount of time, and then click again to do what you wanted to do. Gah…

Cron just keeps going and going…

What happens when you set a cron job to run every fifteen minutes, generating mail, and then leave the computer in the hands of someone who doesn’t know what a cron job is? 266MB and 54500 messages stuck in a mail directory that would never be read. Today it was turned off, and all trace of its existence (bar this post) has been wiped out. It had been running since January 10, 2006. It could have gone on much, much longer.

As a geek I set these things up as a convenience, but somehow I’ve never really trusted the technology enough to believe it would run for more than a few weeks without my intervention one way or another. I wonder how many other abandoned, forgotten cron jobs are out there, like the vestigial body parts of a species that has evolved away from them…