Welcome to the adventure

VMware windows path used for accessing host files is bolloxed

Tuesday May 30, 2006

VMware (my version is 5.5) has botched the path it uses for accessing files on the host. If your guest is Windows XP (among others), you can “share folders” from your host operating system to the guest operating system using vmtools. The shared folders are accessed under the network path:

\\.host\Shared Folders\folderName

Having the name of the computer start with a period completely messes up a lot of functionality in Windows when it’s trying to work with the shared folder. You can access \\.host from Windows Explorer, but I think that’s somehow aided by vmtools. You can’t access \\.host from the CLI, which seems to indicate that windows doesn’t handle \\.host-like paths and that vmtools has to intervene to make it work. Which makes me wonder why they made the shared folder accessible under a weird name like \\.host in the first place…

If you run a .NET application that sits in a shared folder, it’s going to get totally confused if it tries to decipher where it’s running from (e.g. by opening a file using a relative path, or calling System.Windows.Forms.Application.ExecutablePath). You’ll certainly get a System.UriFormatException, because the .NET framework can’t tell where the heck it’s running from.

You can always copy the shared folder to your desktop and access the files in there, but that grows tiresome and is usually not feasible. The most elegant solution is to use mapped network drives. Just map the weird \\.host path to something intelligble — a drive letter in Windows. You can do this from Explorer by accessing Tools -> Map Network Drive. You can make \\.host\Shared Folders show up as the drive letter Z: Then CLI commands like copy will be happy, and so will your .NET apps!

Language design - verbose-sharp

Saturday May 27, 2006

I’ve always wanted to get into a bit of programming language design. The languages I use today are too terse, too hard to understand. In my frustrations I’ve begun designing some syntax that is much more clear and useful and prevents many runtime errors.

Working with numbers directly is always dangerous, so we should work with them as strings:

Math.Divide(StringToNumber(”ten”),StringToNumber(”five”))

It goes without saying that the reverse should be impossible - 5/10 - because fractions can lose their precision in any number of ways thus causing unexpected runtime errors.

Working with numbers over 10 risk the chance of overflow; that’s why you can only represent these large numbers (>10) through safe operations, and not explicitly. So to get 80, you can’t just write StringToNumber(”eighty”). That would be madness. Instead, use multiplication:

// representation for 80:
var b = Math.Multiply(StringToNumber(”eight”),StringToNumber(”ten”))

Suppose we want to print our fancy number 80? With my language it’s trivial-

Systems.OutputSystems.ConsoleSystems.Output.WriteStream(ConvertStringToStream(b) , PositionOnScreen.CENTER)

Brilliant. I call it verbose#.

Desert Jewel

Wednesday May 24, 2006
A message from a trusted friend--
  "Your love's marriage tonight is set,
   The Sultan's firm hand will not bend;
   To her you must fly, your heart you must fetch."

My horse prepared to ride straight off,
The desert night will be my cloak.
Beds of sand I sped across,
And sprays of dust behind me broke.

The palace with long shadows endowed
Would not conceal as I crept past--
Tulwars and scimitars frayed loud!
One and then two foul foes dispatched.

I found her court, she stood within;
Veiled dark eyes regarded me warm.
  "We must away, our time grows thin--
   He will not forgive a marriage forsworn."

We clasped our hands and joined we ran;
The old escaped, our new lives began.

Mammals are the next prey for the deadly Assassin Bug!

Thursday May 18, 2006

assassin1.jpg

Assassin bugs [Wikipedia] are vicious predators that feed on Arthropods. They’re family Reduviidae and order Hemiptera. They have these raptoral legs that they snatch prey with, and a rostrum which they stab into their prey and suck their innards out. Ambush bugs are a type of Assassin bug, and they cleverly lie in wait for their prey in insidious hiding spots, to assassinate their prey when they least expect it.

One of the insects in this family has possibly the coolest name for an insect - the Corsair Assassin Bug (a species of Assassin that scuttle across the ground and run down their prey)!

Their deadly reach extends beyond mere Arthropods. They can suck the blood of rodents with immunity, and even have the audacity to hunt humans! They crawl up on a human’s face while they’re sleeping and suck the blood from our lips or eyelids! Because of this Assassin bugs are sometimes called kissing bugs. Beware, mammals… this predator may soon decide that insects aren’t enough to satiate their voracious appetite, and then you’ll be the next course!

assassin2.jpg

Here’s a sonnet celebrating Assassin Bug greatness (forgive the broken meter):

Among the trees and brush and woods I hunt,
On Arthropods I prey, and my own kind;
Seize you with my raptoral legs in front,
Suffer my sharp rostrum piercing your mind.

Egg, nymph, adult, all are fearsome stages,
Simple development ? Quite far from it;
Prey I can on insects from all ages,
And even mammal slayings I commit.

Reduviidae is our family name,
Ambush bugs share our formidable skills;
The fiercest of Hemiptera we claim,
For we perform the lion’s share of kills.

Tasty hexapods in nature beware;
Surely your innards will be my next fare!

Ye noble soldier termites!

Tuesday May 16, 2006

The soldiers develop to defend the colony against ant attack. They have enormous heads and sometimes have jaws that are so large, they can’t eat, and must be fed by workers. They defend the colony by blocking the narrow tunnels with their gigantic heads, and basically take punishment from ants trying to get down the tunnel. They bite randomly because they can’t see. Can you imagine defending the colony with your face? It gets ripped apart by ants and then another soldier termite steps into the tunnel when the one in front of it falls.

soldier termite

This is from the termite wikipedia article:

“In cases where the intrusion is coming from a breach that is larger than the soldier’s head, defense requires special formations where soldiers form a phalanx-like formation around the breach blindly biting at intruders or shooting toxic glue from the nasus. This formation involves self sacrifice because once the breach is repaired during fighting by the workers no return is provided causing the death of all the defenders.”

Kind of a noble insect… Termites have a lot of other unusual characteristics, like a highly social nature, a queen and a king (where the queen can grow up to being a few centimeters until it’s immobile) and tall colony mounds that are meters high above the ground. They’re one of the few organisms (the only?) that can digest raw cellulose (wood) from a plant, because they have microbes living in their stomach that breaks it down for them.

Exam closure

Saturday May 13, 2006

Final exams are in full swing, and I just completed by far my hardest exam - 8am on Saturday, I might add. So what do I do now? I must have closure with this class. Some people obtain it by burning their textbooks. Others punch their professors in the mouth, for retribution. One time, after a high school chemistry course, a friend and I drove away from the school at high speeds and let our notes fly out the sunroof, creating a deadly tornado of chemical balancing equations and mole calculations!

Usually I get closure by closing things. When I come home from my exam to use my computer, I have about eight virtual desktops completely full of notes, slides, pdfs and websites I was using to frantically study for the exam. Nothing gives me more joy than to close each window, one by one, slowly and purposefully.

Start synergy with GDM on Ubuntu

Monday May 8, 2006

If you have a linux Synergy client connecting to a Synergy server on another machine, you’ll want the client to start up with GDM so that you can access the mouse and keyboard to log in. Here’s how to make it happen on Ubuntu (should work on other distros):

sudo gedit /etc/gdm/Init/Default

#Synergy - place this line somewhere before the "sysmodmap=/etc/X11/Xmodmap" line
/usr/bin/synergyc serverComputerHostname

Where serverComputerHostname is the host name or IP of the Synergy server. Also edit this file:

sudo gedit /etc/gdm/PreSession/Default

#Synergy - place this line somewhere before the "XSETROOT=`gdmwhich xsetroot`" line
/usr/bin/synergyc serverComputerHostname

Logout and log back in to GDM — now you should be able to disconnect the keyboard and mouse on your client and run it strictly from the server.

Picked this up from a helpful post at the Ubuntu forums. Just reiterating, partly as a permanent note to myself.

Mission impossible 3

Friday May 5, 2006

I don’t usually blog about movies.

But this movie was oustanding. With an obnoxiously clever script, a gripping story, great acting, and “impossible missions” that are at once realistic and at the same time mind boggling, I couldn’t have envisioned MI3 being this good. Honestly, I expected another MI2.

Unequivocally the best Tom Cruise movie I’ve ever seen; the best action flick I’ve ever seen; and it has my vote for the best movie of the past 3 years. This is a refreshing return to the intelligence of the original MI, with caper and combat sequences unlike anything before it.

It’s directed by J. J. Abrams, creator and producer of Alias and Lost, arguably two of the best shows on television. What’s scary is that this is the first movie he’s directed — and he’s now my favorite director, along side Peter Jackson. I don’t think it’s possible for him to improve upon this movie, but I’m sure going to watch everything he makes to find out.

Workstation desk setup

Friday May 5, 2006

While browsing other’s workstation setups, it has become clear to me that my productivity is not all that it could be. I’ve decided that I can’t do any work unless I have an equivalent setup:

desk-setup.jpg

Found this while browsing the “Show Your LCD(s) setups!!!” thread at hardforum.com.

Out of hand. Completely.

Apple product cycle

Wednesday May 3, 2006

I hadn’t seen this before but stumbled across it peering through obscure forums for hints and speculation about the processor upgrade cycle for the MacBook Pros. It’s remarkably accurate:

http://www.misterbg.org/AppleProductCycle/

Favorite quotes:

As Macworld or the Worldwide Developer’s Conference draws near, the chatter builds to a fever pitch. Rumor sites jockey for position, posting a new unverifiable, contradictory rumor every hour or so.

Movie stars, professional athletes and rappers begin accessorizing with Apple’s new gadget. Shaquille O’Neal appears on the cover of ESPN The Magazine using one. Mac fans unconditionally forgive him for Kazaam.

Somebody starts a thread on a Mac chat board that asks whether anyone knows of a way to use the new device with some other nerd toy in a way that makes no sense whatsoever. Out of the blue, somebody writes a hack that facilitates the unholy combination and offers it as $39 shareware. Seven of the nine people who actually try to use the hack download it off of BitTorrent and use a pirate serial number. Advocates point to this as an example of how independent Mac software development is thriving.

(HA!)