In an empty business district on the weekend I feel like a salmon swimming downstream during the spawn. Everyone rushes out of town while I rush towards the vacuum left behind. I begin to play the tape backward until the last keyframe.

Here are some pairs of places visited and books read…

Montpellier: The Master and Margarita
Petrolia: Life, a User’s Manual
Seoul: Clockers
Hiroshima: Blindness
Shikoku: Out Stealing Horses
Kyoto: Persepolis
Brighton: Darkness at Noon
London: Moby Dick

While flying to Seoul, I had a novel experience. As the plane made its way across the peninsula I dozed with eyes closed. In the uncertain belt between alertness and wandering thought there was a flash and bump. The sensation was written off as an artifact of near-sleep until the captain announced that the plane was struck by lightening.

Six weeks ago my wife gave birth to our first child: Akira. Bit by bit I’ve relived the moment by feebly expressing our joy to my friends and family. The philosopher within capitulates before questions like “what is it like to be a parent?” Perhaps the answer is something like this.

Perhaps you have heard rumors that MATLAB with its ugly syntax and license management can be replaced by some Python libraries. This all sounds very enticing, but you cannot for the life of you figure out how to install these libraries from the modest wiki documentation.

Here you will find an explanation the process of installing and testing matplotlib and scipy using Macports. The advantage of using Macports over the SVN tree or someone’s binary is that management and upgrade of these libraries is more convenient down the line.

The first step will be to install XCode and Macports following their instructions. If you have already installed Macports and Python be sure to perform a selfupdate and upgrade of the Python packages to make sure you have the latest versions. Once Macports is installed we’re ready to start building the lengthy toolchain.

The second step is to install a series of ports using Macports. I would strongly recommend using Python 2.5 as the newer interpreters do not play well with Macport’s matplotlib and scipy at the moment. So, one by one, install the following ports:

sudo port install python25
sudo port install python_select
sudo python_select python25
sudo port install py25-wxpython py25-numpy py25-matplotlib
sudo port install py25-scipy py25-ipython

Depending on how fast your mac is, this might take hours. If you encounter errors and you had previously installed some of these libraries, as a first step try to upgrade them:

sudo port selfupdate
sudo port upgrade installed

If you were foolish enough to try to test the whole system at this point, when you tried to plot nothing would show up. If you tried to force plotting using show() you’d get some cryptic errors stating:

"Your currently selected backend, 'agg' does not support show()."

To get the plotting facility operating as expected a configuration file is needed: ~/.matplotlib/matplotlibrc. Edit this text file and add the following line:

backend      : WXAgg  # Use wxpython as the plotting backend.

At this point you’re ready for a quick test. Open up ipython:

ipython2.5 -pylab

Next type in the following Python code:

import matplotlib.pyplot as plt
plt.plot([1,2,3])

If everything has proceeded as planned, what you ought to see a figure of a diagonal line.

the diagonal test plot

You may be interested in trying something more complex like this code which reproduces figure 1.2 from Bishop’s Pattern Recognition and Machine Learning:

import matplotlib
import numpy as np
import matplotlib.pylab as plt

x = np.linspace(-np.pi, np.pi, 10)
x1 = np.linspace(-np.pi, np.pi, 100)
y = np.sin(x)
y+= np.random.normal(0,0.3,size=x.shape)
y1 = np.sin(x1)
plt.plot(x, y, 'bo')
plt.plot(x1, y1, 'g')

a simularca of figure 1.2 from PRML

Update: now provides instructions for Python 2.5 after feedback from Greg.

This year, was avant-earnestness. Ardently chittering away our stories of parties, sounds, and structures long since derived. The strumming is clicked and sanded down.

Standard Issue:

(1) Lykke Li [Youth Novel]
(2) Sea From Shore [School of Language]
(3) High Places [High Places]
(4) French Kicks [Swimming]
(5) Kleerup [Klerrup]
(6) Los Campesinos! [Hold on Now, Youngster]
(7) No Kids [Come into My House]
(8) Cut Copy [In Ghost Colors]
(9) Gang Gang Dance [St. Dymphna]
(10) Crystal Castles [Crystal Castles]

Honorable Mention:

Flying Lotus [Los Angeles]
Hercules and Love Affair [Hercules and Love Affair]
Atlas Sound [Let the Blind Lead Those Who Can See But Cannot Feel]
Sebastien Tellier [Sexuality]
Why [Alopecia]

Albums that I only really started listening to this year, but came out sometime before then:

James Murphy and Pat Mahoney [Fabriclive 36]
Jens Lekman [Night Falls Over Kortedala]
Various [Nigeria 70]
Beach House [Devotion]
MGMT [Ocular Spectacular]

Here is a troglodytic programming task I have brushed passed so often that I feel there ought to be a canned script to solve it. The problem is: you have a file with text separated by arbitrary whitespace and you want to covert it to a comma separated value (CSV) file. In short you need a space to CSV converter. By way of example, suppose you have:

field1 field2    field3
field4 field5 field6

But you really need to feed R, MATLAB, or Excel:

field1,field2,field3
field4,field5,field6

You have ten seconds, tell me in which language you’d solve that. My answer is “no language” … otherwise known as a BASH script wrapper for tr:

#!/bin/sh

# Converts the text file with fields seperated by whitespace named in
# the first argument into a CSV file for output named by the second
# argument.

# First test that two arguments were passed

ARGS=2        # Number of arguments expected.
E_BADARGS=65  # Exit value if incorrect number of args passed.

test $# -ne $ARGS && \
echo "Usage: `basename $0` $ARGS argument(s)" && \
echo "Example: `basename $0` inputfile outputfile" && \
exit $E_BADARGS

# Next convert whitespace to commas for CSV

tr -s '[:blank:]' ',' < $1 > $2

Please download space-to-csv.sh, a small tool for a small problem.

One of the innumerable honors that academics bestow upon one another is the best paper prize. A particular aspect of this process I’ve always found irksome is the opacity or secrecy of the jury and award process. At typical conferences, a jury of organizers may choose to award a best paper by committee much as a group of editors might choose which article will be the front page headline.

This year I find myself in the position of organizing an academic workshop (entitled Devices that Alter Perception) which is attached with the ACM’s UbiComp 2008 conference. It occurred to me this is an opportunity to experiment with a new type of evaluation. In order to award the best paper prize (a $100 gift certificate to SparkFun Electronics) we will let the internet decide. More particularly, all of the workshop’s position papers have been uploaded to the Devices the Alter Perception (DAP) reddit for voting and commentary. Highest score == best paper.

Consider yourself welcome to comment and take part in our experiment in determining the best paper.

Edit: It was rightly pointed out that a paper receiving the most upvotes could still not be the highest scoring paper. So most upvotes == best paper has been struck in favor of highest score == best paper. Thanks redditors.

This coming September, my research group along with folks from the design interactions group at Royal College of Art will be hosting a workshop entitled Devices that Alter Perception at UbiComp. The PDF-format call for papers is now online for public consumption. As a point of novelty, I intend to upload links to the accepted submissions onto a special reddit for open commentary and voting to award a best paper prize.

Below is a quick recipe for installing and testing Player/Stage 2.0.4 on OS X 10.5 Leopard using Macports. First, if you have not already, install Macports. Once Macports is installed, from the terminal execute:

sudo port install playerstage-stage playerstage-player

At this point, I tried to launch Player/Stage, but received errors about rgb.txt:

unable to open color database /usr/X11R6/lib/X11/rgb.txt :
No such file or directory (stage.c stg_lookup_color)

To correct this problem, player/stage needs a link to the X11 color map in the place it expects:

sudo ln -s /usr/X11/share/X11/rgb.txt /usr/X11R6/lib/X11/rgb.txt

Now you are ready to launch and test player/stage:

player /opt/local/var/macports/software/playerstage-stage\
/*/opt/local/share/stage/worlds/simple.cfg

If you are sucessful, you should see the following window. You can drive player/stage using an example program in another terminal:

/opt/local/var/macports/software/playerstage-player\
/*/opt/local/share/player/examples/libplayerc++/laserobstacleavoid

After playing around a bit, I am sure you will agree that player/stage is the best thing going right now for open source robot simulation, control, and development.

My memories have an indistinctly glint. Rainwater in the gutter of narrow streets blithely lit by 明り. These project back on simulacra of San Diego’s feral humans. Thoughts drift to the space between Las Cruces and Albuqueque where you find nothing but radio waves and a town named after a quiz show. In Taketomi-jima there are walls made of coral and see-through crabs. In Firenze, standing above and below The Last Judgement you feel an ebb. In Siena you can cut Rosemary from the bush and eat effortlessly.

Fictionally during this time collected were McCabe’s The Butcher Boy, Lethem’s Fortress of Solitude, Shteyngart’s Absurdistan, Bowles’ The Sheltering Sky, McCullers’ The Heart Is a Lonely Hunter. Unfinished are Thiong’o’s The Wizard and the Crow and Pamuk’s My Name is Red.

Catsoulis’ Designing Embedded Hardware is like the modernized and miniturized version of Horowitz and Hill’s Art of Electronics. But both of those were outdated by the memristor.

Yoshiko and I have moved to Asakusa. Frosty exhales and prowling tortoiseshells were left behind for an outcropping across from a music studio. The river, 浅草寺, small shoe workshops and new-old ways of doing things here agree with what we imagine Tokyo to be.

Xmodmap for Japanese Macbook Pro Keyboards
So, you are in the unlikely position of using a Japanese model Macbook Pro with X11 and you notice that the keyboard is all wacky. It seems like they shipped the English modmap, which is pretty inconvenient since it doesn’t map the keys correctly.

Over on this blog I found a modmap which partly alleviates the problem. However, I still had some problems on my notebook, in particular the shift keys don’t work correctly. I decided this was because the file maps a few too many keys to nothing at all. To remedy this, I used sed to remove the lines ending with equal signs:

sed '/=$/d' Xmodmap.broken > .Xmodmap

The resulting .Xmodmap, placed in my home directory works well. This is on OS X Leopard, with a late 2006 model Macbook Pro.

Emacs, ¥, 円, and Backslash
Another annoyance is that Emacs (in particular Aquamacs) seems to always insert Yen symbols. The terminal is set up such that a press of the ¥ key causes a \ to be input. This is convenient in that backslash is used frequently in many Unix-style programs such as latex and bash.

After some experimenting, I found that if you add the following line to your .emacs file, the ¥ key will emit \ just like the terminal:

(global-set-key [2213] "\\\\")

This might save a lot of headaches if you enter backslash more frequently then yen. And of course the symbol most commonly used in Japan for Yen is 円.

Since the early days of reddit, users have complained about the skew of the front page. Whether it is Lolcats, Haskell, or Taser stories everyone has their hated front-page spam. The word spam here is used in the sense of overwhelming (possibly automated) submissions on a particular topic.

Recently, things have taken an interesting turn. The election race generated a flurry and finally blizzard of articles related to Ron Paul. Due to whatever reason, the reddit front page became completely overwhelmed with news articles concerning to Paul’s campaign.

At some point in the last few weeks an anonymous user became so frustrated as to compose an automated script which systematically downvotes stories found using a regular expression:

var regex = /(\W|^)(Ron|Paul)(\W|$)/i;

This was packaged as a greasemonkey script whose installers rapidly filtered all of the content relating to Ron Paul for all of reddit’s readers.

This in turn has led to cries of foul play by Ron Paul’s supporters and those who want to see reddit remain humanized. If anything it is an interesting escalation. Rouge Paul supporters in the past have been accused of gaming election polls and spamming themselves. Ironic that similar automations are being used to undo the work of Paul’s campaign.

But I think what we must now accept is that the process of dissenting, polling, and politicking has been automated. Not automated in the sense of a voting machine. Automated in the sense that political or editorial preferences have become programs; we are in the era of robots which do the dissenting for you.

Next Page »