Visual Recursion

When I was a kid, I loved the trick of standing in front of one mirror while holding another one, and generating the seemingly infinite series of nested images of myself holding a mirror looking into a mirror at an image of myself holding a mirror…well, you get the idea. It’s a simple kind of visual recursion, to which here’s probably even a base case, assuming the Planck measurements are true. Think of it as a concrete realization of a system of continued fractions. I got to wondering, though, if with I couldn’t maybe do the same thing with a computer. It turns out you can—and here’s how I did it.

I have a copy of Parallels Desktop installed, which permits me to run Windows on my laptop. You might wonder why one might do this—in my case it’s chiefly so that I can play games. Parallels is actually quite general, so I could just as easily run Linux this way, but I have a perfectly good Linux machine in the office, so there isn’t much point in that.* It’s kind of amusing, however, to watch a virtual PC boot inside a window on a Macintosh.

Virtual BIOS

Likewise, it is not a little disconcerting to see the Windows XP startup screen on my Macintosh, although I find it a lot less troubling when it’s caged in a window like this.

Windows XP boot screen

Okay, so there’s one mirror. It didn’t have to be Windows, but I thought it would be amusing to involve another operating system. Next, the second mirror, courtesy of VNC. I already use Redstone Software’s Vine Server on our print server at home, since it lives in an inconvenient corner where it’s hard to get to the console to do system maintenance. It’s very easy to download and install, so I got it up and running on my laptop with no trouble. I didn’t even have to change the default configuration.

Vine server control window

On the Macintosh, I usually use JollysFastVNC as a client, but in this case I needed a client on the Windows side, so I instead downloaded the free version of RealVNC and installed it. Again, very simple to set up—I just had to plug in the IP address of the Macintosh to get things started:

RealVNC client window

It’s kind of amusing to consider the number of layers of network address translation going on here: The laptop receives its IP address in the private 192 subnet from the DHCP server on our router, which in turn is given a private address in the 10 subnet by our ISP. Even before we start talking virtualization, there are already at least those two layers of translation. Now, add to this the fact that the Parallels installation simulates a network interface for the hosted operating system by creating another virtual network interface within Mac OS, that in turn assigns another 10-subnet address to the virtualized XP machine. There are also at least three firewalls running here—the router has one, my laptop runs another, and the Windows XP installation is running a third. And to think, when I first read Neuromancer all those years ago, I was so skeptical of all the “medicine” they used on their computers.

So, after all that, here’s the high-tech version of visual recursion, across two operating systems running on the same hardware (follow the image link itself for a larger version).

Visual recursion, click to enlarge

I tried various methods of getting the view more centered, but this turns out to be somewhat tricky. First off, the windows you’re rearranging are all active—but some of them are controlled directly by Mac OS, while others are hosted by Parallels, and in turn are controlling the original windows via VNC. So, at certain places on the display, the cursor gets very confused, and retreats into a corner to hide. This means that in order to get what you want, you have to kind of keep the mouse out of the in-out-in sections of the screen while you’re adjusting certain layers, and that is harder than it seems. Still, I thought this made a pretty good demonstration of the principle.

I guess I should probably get back to work, now.

* One could also make the argument that we also have a perfectly good Windows machine at home, too, but it’s not very portable, so Parallels makes a good solution for the laptop.

Neverwinter Crash, A Tale of Patching the Patcher

We ran into a problem recently in which our copy of Neverwinter Nights 2 took to crashing at startup. As you can imagine, this impedes play somewhat, so I did the only thing a self-respecting Windows user can do in such a pass, which is to uninstall and then re-install the software.

The first portion of this program went smoothly enough. The InstallShield tools have gotten pretty decent about remembering where the installer put all its crap the first time, and they’re even smart enough to let you preserve your saved games. Unfortunately, the re-installation was not quite so smooth, and that’s the reason I’m writing this. At the very least, I wanted to have a record of what it took, in case I have to go through this again in the future. Also, because misery loves company.

Okay, so installing the game is not really that difficult. You fire up the setup application from the CD, and it entertains you with pretty graphics while it dumps a couple hundred megabytes onto your disk and into your Registry. Ç’est la vie, par for the course. But then you have to install patches to update the game from its original state to the (ostensibly) less-buggy current version. For older games, this step could be a real drag, as obtaining the latest patches often required sifting through seventeen layers of crappy web pages covered with enough flashing banner ads to induce seizures in people who’ve only just heard of epilepsy. Happily, Neverwinter Nights 2 has an “auto-update” feature, a tool with just enough brains to automatically download the latest patches and apply them. A great idea!

Well, in principle, anyway.

Lots of things have auto-update programs these days, and most of the time they seem to work pretty well. I use Apple’s “Software Update” all the time, and it works like a charm. But, like all software, updaters too can have bugs—and it occasionally happens that before you can update your game, the auto-updater must first update itself. If this sounds kind of like a surgeon operating on her own body, you’re not far off. Unfortunately for Yours Truly, it turns out that one of the updates to the Neverwinter Nights 2 auto-update program introduced some bugs that made some systems (including ours) unable to update the rest of the game.

I was understandably morose about this state of affairs, not least because I lost the same 84 megabyte download several times before I figured out what was going on. Also, since games provide a much-needed release from the stress of a long day of thesis-writing, there is a direct correlation between a working game and my mental stability. But it is rare for such problems to be solved by venting a killing fury upon some unsuspecting tech-support person, so I instead spent my gaming-time digging around in the NWN2 fora for a solution…a foray fororum, if you like.

To paraphrase Neal Stephenson, the problem with an Internet forum is that most of the participants turn out to be—or to be indistinguishable from—self-righteous sixteen-year-olds possessing infinite amounts of free time.* Sifting the wheat from the misspelled and ungrammatical chaff is time-consuming and unrewarding at best. But if you keep at it for an hour or two every evening, you can usually work things out, eventually. In this case, it turns out there is a downloadable patch from Atari that is supposed to fix things so that the NWN2 auto-updater will be able to update itself. So far, so good. I downloaded the patch, installed it by hand, and ran the auto-updater again. This time, it managed to update itself—but then failed to update the game, because the file I had replaced to patch the auto-updater was different.

Argh.

Well, to make a long story somewhat shorter, here’s what it took, at last, to re-install the game on our PC running Windows XP:

  1. Uninstall Neverwinter Nights 2 completely. Save your games if you wish.
  2. Reboot your computer.
  3. After rebooting, install Neverwinter Nights 2 from the original disks, but do not permit it to run its automatic update step.
  4. After quitting from the installer, install the auto-update patch. This requires replacing the file named DIALOG.TLK, but let’s take it in stages:
    1. Back up a copy of the existing DIALOG.TLK file. I just copied it to my Desktop.
    2. Install the new DIALOG.TLK file from the download.
    3. Run the NWN2 updater to get the latest auto-update patch. With DIALOG.TLK replaced, this should work.
    4. Game updates will fail; exit from the updater.
    5. Restore the original DIALOG.TLK file you backed up earlier. Replace the version you got from the auto-updater patch with the original.
  5. Now, run the NWN2 updater again, and it should be able to obtain all the latest updates.

Needless to say, I think this was an enormous waste of time, but at least it did turn out to be possible to fix the damage. So far, the original problem (whatever it was) has not recurred.

* The original quotation can be found in Cryptonomicon, pg. 302.

It’s the Law, Part 2

Another excerpt from the General Laws of Massachusetts, this time from I.14.85§11b, regulating the use of bicycles on public roadways. Here again is an area of the law of which many local drivers seem to be ignorant—though in this case, it is more to my detriment than to theirs.* As before, I have added emphasis to some of the more interesting passages:

Every person operating a bicycle upon a way, as defined in section one of chapter ninety, shall have the right to use all public ways in the commonwealth except limited access or express state highways where signs specifically prohibiting bicycles have been posted, and shall be subject to the traffic laws and regulations of the commonwealth and the special regulations contained in this section, except that: (1) the bicycle operator may keep to the right when passing a motor vehicle which is moving in the travel lane of the way, (2) the bicycle operator shall signal by either hand his intention to stop or turn, and (3) bicycles may be ridden on sidewalks outside business districts when necessary in the interest of safety, unless otherwise directed by local ordinance. A person operating a bicycle on the sidewalk shall yield the right of way to pedestrians and give an audible signal before overtaking and passing any pedestrian.

[...]

Violations of any provision of this section except violations of subclause (iii) of clause (2) shall be punished by a fine of not more than twenty dollars. The parent or guardian of any person under age eighteen shall not authorize or knowingly permit any such person to violate any of the provisions of this section. A bicycle operated by a person under the age of eighteen in violation of this section may be impounded by the police department, or in a town which has no police department, by the selectmen, for a period not to exceed fifteen days. A violation of any provision of this section by a minor under the age of eighteen shall not affect any civil right or liability nor shall such violation be considered a criminal offense.

The elided section (marked [...] above) specifies that bicyclists must ride in single file, except when passing; that carrying passengers is not permitted except in a trailer or baby-seat; that riders under 17 must wear an approved helmet; that parked bicycles may not obstruct foot or vehicle traffic; and a variety of basic safety regulations about brakes, lighting, etc. You can read the particulars if you are interested.

I brought this up because there seems to be a perception in the minds of many local drivers that bicyclists are not permitted to ride on the roadways, or that a bicyclist has fewer “rights” than an automobile driver in his use of the road. However, as we see here, that perception is quite wrong. While most bike riders are very good about leaving room for automobiles to pass, they are under no obligation to do so—and it is often safer for a bicyclist to fully occupy whichever lane she is using, especially at intersections where drivers tend to be more concerned with taking their so-called “right on red” than with such trivial considerations as safety. Since more than 42% of bicycling crashes arise from motorists turning or merging into the path of a bicyclist, misjudging an attempt to overtake a bicyclist, or failing to yield the right-of-way at an intersection, it seems clear that bicyclists should take every reasonable precaution permitted under the law, no matter how loudly the motorists honk their horns. Look at it this way: If they honk at you, at least it proves they saw you.

(Incidentally, while I enjoy having permission to turn right at a red light, provided the intersection is clear, I would happily give up that permission completely in order to eliminate its abuse—but that is a subject for another posting).

At the same time, we bicyclists also need to play by the rules. This site has some good etiquette lessons for both riders and motorists (scroll down for the latter). There are also some tips for how to pass a bicycle that are worth reading. I suspect it would probably be in the public interest to require that motorists spend a week biking on the local streets before being issued their driver’s licenses…but I’m also not holding my breath.

* Mind you, I too am also a driver. You can often identify a driver who has some experience biking, however, as they do things like look over their shoulder before opening their car door into a bike lane, check for bicyclists before making a right turn, and so forth.

Next Page »