September 26th, 2007
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.
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.
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.
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:
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).
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.
Filed by Michael at 14:41 under Amusement, Technology
No Comments

2 Comments