Are "memristors" the future of artificial intelligence?#

Because moving charges make currents, and changing magnetic fluxes breed voltages, the new device would generate a voltage from a current rather like a resistor, but in a complex, dynamic way. In fact, Chua calculated, it would behave like a resistor that could "remember" what current had flowed through it before (see diagram). Thus the memristor was born.

Google Reader now supports Instapaper natively, and the Instapaper bookmarklet now supports Google Reader natively#

Google Reader's new "send to" feature now has built-in support for Instapaper. When the "send to" feature launched a few days ago, native Instapaper support wasn't there, but it was possible to add the service via the "create a custom link" button.

While these solutions are better than nothing (just barely), neither of them is optimal. The native solution pops up a new window, and you have to click on the "add" button to actually add the link (that said, it is nice that the window auto-closes after you hit "add"). The "custom link" solution is as annoying as it too pops up a useless window that does not auto-close.

Luckily however, the Instapaper bookmarklet has been updated to support Google Reader, and this approach works wonderfully. Indeed, it works exactly the same as it does for any other link (i.e., a status "window" displays inline with the web page as the link is being saved, and then disappears once the link has been saved successfully).

In light of the new Google Reader functionality, I now keep two Instapaper bookmarklets in my bookmarks bar: this new one to save links from within Google Reader, and my modified version to save pages that are loaded in their own tabs/windows (the modification automatically closes the tab/window when the bookmarklet is activated).

App Store Expense Monitor, a Mac-only program that tells you how much money you've spent on iPhone apps#

A couple of weeks ago I asked the following question on Twitter: "dear twitterverse, is there an easy way to determine the total amount of money you've spent on iphone apps?"

I received no responses, which I thought was quite odd, but just struck it up to there being no simple (or even difficult, but still non-manual) way to get the number I was after. I was wrong. The App Store Expense Monitor gives you the number immediately, and even lets you view a complete list of your purchased apps (including, obviously, their respective costs).

Turns out I've spent $110 on iPhone apps, which is less than I would have guessed.

Use LaunchBar to execute, in the "background," commands via a shell

August 09, 2009

Early this year I migrated from Quicksilver to LaunchBar and haven't looked back. These days I use LaunchBar for just about everything, even to a greater extent than I did with Quicksilver (and I was a Quicksilver nut). It's just great software, if a tad bit expensive (~$35). (There was nothing wrong per se with Quicksilver, but core development kind of stopped (it was open-sourced) when the software's creator headed to Google to run its Quick Search Box for Mac project, and even he was recommending that users jump ship and try LaunchBar.)

In any event, I came up with these AppleScripts in order to solve an annoying problem that presents itself at the end of the following sequence: 1) plug closed MacBook Pro into a 24" Apple LED Cinema Display and use only that monitor; 2) disconnect the display from the computer and sleep the computer; and 3) wake the computer and use only its built-in display. About 75% of the time, certain elements of the OS don't appreciate that the screen resolution has changed (i.e., that the working resolution is now much lower), and so things like Expose and Spaces — which I've mapped to corners of the screen — can't be triggered. The only solution I've found is to execute "killall Dock" from a terminal (thanks Richard), which kind of resets everything.

Instead of bringing a terminal emulator into focus and then executing the command, I thought it would be more efficient (and the sequence more easily assignable to muscle-memory) to use LaunchBar to run the command. To this end I coded up two separate AppleScripts, each of which solves the problem in a slightly different way.

The first relies on iTerm, which, for the past few years has been my Mac OS X terminal emulator of choice, and, as luck would have it, is AppleScript-able. The script assumes iTerm is running; in my case, if the computer is on, iTerm is open. (Obviously with a few simple tweaks you can have the script check to see if iTerm is open, and then either activate or launch, depending.)

The iTerm-centric script opens a new session (i.e., a new tab) within the first open terminal window (I'm assuming most people use a single window with multiple tabs) so as not to disrupt whatever you currently may be doing within iTerm, executes the shell command you gave LaunchBar, closes the session/tab and returns the window focus to whatever application you were using before you invoked LaunchBar.

To get the script working, simply paste the below code into a new file from within Script Editor, and save the file to: ~/Library/Application Support/LaunchBar/Actions/.

on handle_string(command)
    tell application "iTerm"
        tell the first terminal to launch session "Default"
        tell the last session of the first terminal to write text command
        terminate the last session of the first terminal
    end tell
    tell application "System Events"
        keystroke tab using (command down)
        keystroke tab using (command down)
        keystroke tab using (command down)
    end tell
end handle_string

You can name the script whatever you want, but keep in mind that this name will be the alias used to launch it from within LaunchBar. For example, I named my script "shell.scpt," and so to set it in motion I type (or start to type) "shell" from within LaunchBar, and then hit the space bar (so that I can enter the command) when I see that "shell" is the highlighted action.

The second AppleScript I whipped up uses Mac OS X's native terminal emulator, Terminal. It launches Terminal, routes your shell command through it, and then closes the application (thus bringing the window focus back to the app you were using previously).

on handle_string(command)
    tell application "Terminal"
        do script command
    end tell
    tell application "Terminal" to quit saving no
end handle_string

Update: Soon after posting this, Cameron Hunt wrote me to let me know that this actually can be done via LaunchBar without having to invoke a terminal emulator (see the script below, which is a slight modification of the second script above).

on handle_string(command)
    do shell script command
end handle_string

If you don't have a preference, I definitely recommend the second third of these AppleScripts because it's so much faster than the first two, despite it having to launch Terminal, and obviously would be faster still if you always kept Terminal open (and then used activate instead of launch).

I should mention that if you've a specific terminal command you want to execute (instead of the ability to run any command, as described above), I think you probably can just create a simple shell script consisting of nothing but the shebang, your interpreter of choice and the terminal command. Place the script in the same directory mentioned above and you should be good to go.

Touchable holography#

Researchers at the University of Tokyo have developed a holographic projector that displays three-dimensional virtual objects you can feel with your bare hands.

The system consists of a Holo display (developed by Provision Interactive Technologies), a pair of Wii Remotes that track the position of the user's hand in front of the screen, and an "Airborne Ultrasound Tactile Display" unit that shoots focused ultrasonic waves at the hand to create the sensation of pressure on the skin.

FPS with real guns#

This time on Waterloo Labs, we are playing Half-Life (the flash version at least), with a suppressed .22 pistol. Using accelerometers and LabVIEW, we can triangulate the position of where the bullet hits a piece of drywall and generate a mouse click at that location in the game, which has been projected onto the shooting wall, to kill the bad guys.


Khoi Vinh's thoughts on the latest NetNewsWire beta, which is supposed to sync with Google Reader#

No sooner had I launched this new version and entered my Google Reader information than NetNewsWire, in synching with my Google Reader account, began to effectively destroy the careful organization of all of my subscriptions that I've worked so hard over many months to perfect. It took only a few minutes before my entire corpus of RSS feeds was disassembled and rendered almost useless.

This is a horrible and incompetent way for software to behave, and it leaves me thinking that this version of NetNewsWire easily ranks among the most carelessly destructive I've ever encountered.

My thoughts exactly. I had a similarly terrible experience, summarized by the following tweet: "um, new greader/nnw syncing thing just lost ~150 of my feeds. i think i might be on the verge of tears. GAH!" (Not for nothing, but I eventually got most everything back to normal after exporting from Fever.)

When I first heard that NetNewsWire was going to sync with Google Reader, I was pretty ecstatic, because 1) I love Google Reader on the desktop and 2) I love NNW on the iPhone. With this news, I thought I could have the best of both worlds: GReader on the desktop, NNW on the iPhone and data synced to some cloud in between. Unfortunately though, after my train wreck of an attempt at this, it still seems a pipe dream.

All of that said, I will say that GReader on the iPhone is slowly but surely becoming less annoying, and actually is kind of a pleasant experience these days, at least via WiFi.

Toggle quickly between two Things databases#

A simple Perl script from Chris Bowns to quit Things, toggle between two Things databases and restart the app.

The underlying idea here shouldn't be limited to Things; a lot of Mac apps work off of a single database that can't be switched in-app, and this script likely can be extended easily to handle these other programs.

Also, FastScripts was built to set exactly this sort of thing in motion.