27 September 2006

Robot or Not Robot?

Just throwing my 2 cents out here yet again. I expect there are a lot of different opinions in this area. This one just happens to be mine.

A robot mainly is a physical thing, though there is some room to call certain kinds of software 'robot' as well.

A robot isn't a robot unless it has some degree of autonomy. If you drive it around with a remote control, it isn't a robot; it's a remotely controlled car. It doesn't matter if it looks humanoid and walks around on two legs. Sure, balancing and arm waving and so forth is cool, and maybe it needs loads of processor power to do it, but balancing on two legs doesn't really amount to more than a fancy suspension/propulsion system. If it just goes where you tell it to with a remote, it's not materially different from an r/c car.

A robot isn't a robot unless it has some degree of state, which I think really amounts to the same thing as memory. For example, I have a kit that rolls forward until it senses an obstacle, at which point it backs to the left for a moment and then proceeds. Very simple behaviour and it's fun to watch, but it has only two states: (A) going forward, and (B) backing to the left. The transitions between these states are trivial. I think this category of device can be interesting, but it isn't really aware of anything. I guess I'm trying to say that a robot must have a sufficient number of states to represent an at least rudimentary awareness of its surroundings.

A robot shouldn't be expected to do it if you can't do it: Imagine you are sitting in an empty room. On the wall there are three lights, which are either ON or OFF. You also have two levers in front of you, which you can independently push forward or pull back. After some time playing with the levers, you might notice that you can predict when the lights will go on or off. Well, this pretty much describes the world of possible awareness that a typical plastic-brick-system robot has; the lights you see are the switch inputs, and the levers you control happen to connect to motors you know nothing about. If someone told you that the left lever moved a motor on the left side of an imaginary car, and the right one, a right side motor, and that the lights represented reflection off a paper map, you might be able to execute the classic line follower behaviour. BUT, and this is important - even if you were left with no explanation of what the levers connected to or what the lights meant, if someone gave you a list of Things To Do, with items like "when the left light goes ON, push the left stick forward and pull the right stick back; when no lights are on, push both sticks forward; etc.", you could execute the line-following algorithm just as well - and this is exactly the situation the little RCX finds itself in.


(It wouldn't be too hard to set up simulations like this, so that an un-informed human could be given such controls as a windows application, and these could connect to a simulated world that could be seen in a window on another computer, and all kinds of what-if scenarios could be played out.. )


A robot doesn't have to do everything, or even one thing as well as you might think. For example, suppose the neighbor's hypothetical cat keeps doing its, err, thing in my tomato patch. I could buy one of those motion-sensitive thingies that connect to a garden hose and blindly spray an area to keep such pests out. Well, this would probably suffice on my neighbor's cat, but suppose the cat were a little more cunning (and determined, one supposes), and could figure out where the sprayer thingy isn't getting things wet. Now the blind/dumb sprayer is ineffective. But what if it could aim? How would it aim? Do I need a full-blown computer vision system that recognizes the particular cat and whether it has burrs stuck on it today? No! It doesn't even need to recognize 'cats', or even 'animals', or know much of anything about the world, visually. It would suffice for it to be able to pick out the black-ish blob that moves in the image, and aim the hose accordingly. Now the cat wouldn't get away unsoaked, and the robot would be effective at its job, and would be minimally aware of its environment, insofar as knowing hey, there it is, there! no, there! or hmm, nothing to soak, stop the water

22 September 2006

Stupid Windows Tricks

It seems like a couple of different fairly common file types have turned out to be ZIP files in disguise lately. For example, java .JAR files and firefox .XPI files are both really just zip files underneath. As such, it's sometimes (frequently!) useful to peek inside them using a zip utility such as my current favorite, WinZip.

There are several ways to get a non-ZIP file into an zip util, but I've found they don't always work on all machines. Has to do with the file associations, and how the particular zip util feels about openning things, etc. So here are the ways I know of:

0. DON'T associate the non-zip to your zip util! You want the basic 'open' behaviour to continue to open the right app when you double-click the things!

1. If you're lucky, your zip util may already have generously added an offer to open anything and everything with a right click. WinZip, for example, offers "Extract .." for some things, but sadly, not for most things. If you don't see it, read on ..

2. right-click and choose "open with". First time you try this, you may have to "choose program" to clue Windows in that sometimes you like to open, say, JAR files with WinZip. Be Careful! See that box labelled "Always use the selected program to open this kind of file." ? Make sure it is NOT checked. (see method '0', above). Hereafter, your chosen zip util should appear on the short list of "open with" options. However, on some machines, I've seen this technique flip out the zip util and make it think it needs to install components, etc. If that happens, there's always Option 3.

3. "Send To" - you can add things (like zip utils) to the right-click/Send To menu like so: go get a folder open on your "documents and settings\%username%\SendTo" directory. Now find the .EXE for your zip util, right click & hold it, drag to the SendTo folder just opened, and choose "create shortcut" on the menu that appears when you let go of the right button. After this, you should have that app on your Send To menu.

4. Add your own context menu option! This turns out to be easier than you might think. Open a folder, any folder. Choose "Tools/Folder Options", go to the "File Types" tab, and wait for the flashlight to go away. Let's say you want to open XPI files with WinZip. Find XPI in the list of types. What?! Not there? Click "New", put "XPI" in the "File Extension" box and hit OK. Now you have XPI in the list, just have to find it. Get it selected then hit the "Advanced" button. There's an un-labeled text input box at the top. If you just created the type, this will be blank. For XPI, I put "Firefox Extension" in the box. (This helps later on when you get properties on an XPI, etc). Now, see that big input area labeled "Actions"? Here's how you make a right-click menu option called "Feed It to WinZip" - click the "New" button to get the "New Action" dialog. In the top box, put the string you want to see on your menu, in this case, "Feed It to WinZip". In the lower box, "Application used..", you need the path to the EXE. Type it if you know it, or use the "Browse" button to find it. Before you hit "OK", add the string "%1" (quotes and all) at the end of the application string. OK, now you can "OK" your way back to normality. Right click your XPI or JAR or whatever, choose the "Feed It to WinZip" (or whatever you put) and you should be in business!

5. I won't even say 'registry'. NO. Don't go in there. If you don't know how to get in there, I am not going to tell you! You don't want to go in there. Seriously, you will mess your machine up, so don't do it. Unless you know what you're doing. But there, I've told you, so don't do it!

Recovering from SiteAdvisor v23

I used to like SiteAdvisor, adding the extension to every instance of FireFox that I use. I liked it right up to the point where they introduced the Proxy Bug. Version 21 worked fine; but 23 causes FF to hang, window-less, on any FF that has its connection settings set to use a proxy server. Apparently McAfee knows about this problem, but doesn't consider those of us stuck with firewalls and proxy servers as worthy of the attention necessary to fix the problem.

So the solution I found is to revert back to version 21. Sounds simple, but in practice, it wasn't, which is why you might be interested to know how I did it.

Finding the old version:
This may not be easy. McAfee apparently doesn't want anyone getting their hands on previous versions, which, considering the mess they've made with the v23, is kind of obnoxious, but what can you expect? I don't dare to post it myself, but the file you are looking for is called 'safe.xpi' - version 21 is 48,997 bytes, version 20 is 41,518 bytes, and version (blecch!) v23 is 82,765 bytes. If you had installed previous versions, try digging through your hard drive, particularly "documents and settings\%username%\Local Settings\Temp" and look for any .xpi file of that size.

Fun with XPI files -
FF doesn't make it obvious how it handles extensions, but basically it works like this: if you click a link (in FF) that leads to an XPI file, FF downloads it to a temporary place and processes it. How? Turns out an XPI file is really just a ZIP file. Try opening the XPI with WinZip or WinRAR, etc. If the zip util complains about the filetype, make a copy of the XPI and change the extension to ZIP and see what happens. Anyway, once inside, you can recognize a SA extension by the "zigbert" files inside it.

If you want to grab an extension w/o having FF automatically trying to assimilate it, you can try the old right-click/save-as thing, but that doesn't always work. Another way is to drive your way to the link for the extension using FF, then open IE, copy the url over to IE, and just click the "install extension" link the regular way. IE will find the XPI file, but won't know what to do with it. That's when you tell it "save-as" and presto! You have the XPI file. You can install the extension into FF later (or on other machines) by just going to FF's File/Open-File option and navigating it to the XPI. When FF tries to open the XPI you automatically get the install behavior.

As I said, some sites try to make it difficult (cough!mcafee!ahem..) to get the actual file, by making the "install extension" link/button/etc go to some script that in turn goes and gets the file. So, if you want to nab v23 of safe.xpi, whatever you do, don't go to McAfee's site, and don't use the aforementioned IE trick because they don't want you to do that!

Out with the New ..
First, start FF in 'safe mode'. Chances are that on your start menu, under 'programs' and then 'mozilla firefox' you will find the shortcut to 'safe mode'. Start FF in safe mode, go to Tools, Extensions, right click the offending SA and choose 'uninstall'. If it throws a new browser window at you, you can ignore (close) it. Quit FF and restart it to make sure the uninstall script goes through all the way. Quit FF a 2nd time for good measure.

In with the Old -
Start FF. Go to File, choose Open File, and use the open file dialog to find the XPI file. Open it. You will have to quit FF and restart, as is usual installing FF extensions, but that should do it.

19 September 2006

Avast!

Arrrhh!! Do ye not know what day this be? 'Tis International Talk Like a Pirate Day, sure as I'm not actually a pirate, aarrrhh!!

Place Memory and Icons

As human beings we have this great facility for remembering where things are in space. If I ask you to remember a list of ten random words, you might not do so well, but if you were asked to name the towns around where you live, you'd probably list more than 10 without trouble. Further, you'd probably even be fairly good at remembering which ones are next to which other ones. Granted, maybe you've had more time to study that data than the hypothetical list of random words, but the point here is that the overall inter-relation of Things In Space makes it easier to recall the information in question. It gives all the pieces a context in which you have some means of addressing the thing you're looking for in relation to the things you're immediately aware of. This is the heart of the trick of remembering your computer passwords not by remembering the exact sequence of characters, but by remembering the shape they make on the keyboard when you type them. As people, we're good at getting around in the world, and this is mainly due to the fact that most parts of the world stay put most of the time.

Now, what's up with my ICONS? As our hard drives get larger and we all accumulate more and more stuff, we're all faced with the growing problem of finding 'that document I was working on last tuesday', or the 'list of things people are getting for christmas', etc. You probably don't have too much trouble with finding the things that you are working on in the immediate time frame, but if you're like me, if you haven't touched the file in a week, the Big Search begins. This is enough of a problem that there are even things like Google Desktop to help you search out stuff on your own machine. I want to argue that a good deal of this confusion could be eliminated if icons would just stay where you put them.

If the Macintosh got anything right, it's that when you arrange icons in a folder, they stay that way. (Or at least, last time I used a Mac, they did.) Maybe you put all the lists off to the left, and some notes-to-self in the upper right, and some relevant urls in the lower middle, or some such. If you didn't come back to that folder for Months, it didn't matter, when you came back, there that arrangement would be, just like you left it. When was the last time you visited your home town? It probably didn't change too much, and to the extent that it's the same, you would be able to find places in it you hadn't even thought of for years. Our brains retain information spatially like that, are excellent at that.

If your OS would just manage to preserve the spatial relationships of icons, you could use all those zillions of neurons that are adapted for just that purpose to good effect. As it is, if things in the Real World worked like your folders and icons, every time you went back to your home town, everything would be in a different place.

Another metaphor: let's say you want some popcorn. How do you find the popcorn in your kitchen? Do you find that unseen little gremlins re-arrange everything every time you close the cupboard doors, so that you have to engage in a random search to find the one specific item? No! You use this great place-memory; the popcorn is next to the oatmeal is next to the pasta; hey! there's the pasta! Look next to it, and again, bang-o, you have the popcorn and you didn't have to look at every last thing in the cupboard - because the relations of what's next to what are preserved over time.

In short: if OS vendors (coughMICROsoftahem!) would just find a way to stop messing the icons about, we could all be more productive.