"Edit with Emacs" Chrome extension

Alex Bennée has written an Edit with Emacs extension for Google Chrome. It's Chrome's answer to Firefox's "It's all text" extension, which makes composing emails, blog posts, and other long-form text in a browser a lot more tolerable. (Hooray!)

Since Chrome extensions can't spawn arbitrary processes, the Edit with Emacs extension requires the cooperation of an additional edit server that can. The edit server is implemented in elisp and is bundled with the extension.

Installation instructions:

  1. Visit the extension gallery page and click "Install".
  2. In Chrome, click on the wrench menu, Extensions, "Options" under "Edit with Emacs", and follow the instructions there for setting up the edit server.
  3. After configuring the edit server, click "Test Edit Server" to make sure everything is working.
  4. Henceforth, in any new tabs you open, you'll see a little "edit" button next to any textarea elements, which you can click on to pop up a new editor frame. (You can also double-click on the textarea.)

Firefox 3.6

Mozilla released Firefox 3.6 last week. There are many noticeable improvements compared to Firefox 3.5, but two that stand out to me.

First, performance has improved quite a bit. And not just Javascript performance. Startup time is improved; the awesomebar responds instantly to keystrokes; Javascript and redraw/redisplay are faster. I no longer perceive a huge speed difference between Firefox and Google Chrome on most web apps, and the UI has become more responsive. (A few things—startup time, redraw/redisplay/scrolling, and creating/closing new windows and tabs—are still minorly annoying when I use Firefox alongside Chrome—but 3.5 and 3.6 are like night and day.)

Second, Firefox 3.6's implementation of HTML5 media, or at least audio, is superb. Having spent lots of time hacking on and listening to Zeya on Chrome, Firefox 3.5, and Firefox 3.6, the latter is the one where things most often just seem to work as spec'd. Moreover it's Firefox 3.6 (and only Firefox 3.6) that can consistently maintain the illusion that I'm using a native media player rather than a web-based one. That's colossal.

So, kudos to the Firefox developers.

PSA: the ubuntu-mozilla-daily PPA has nightly builds of Firefox 3.5, 3.6, and 3.7 packaged for all Ubuntu releases since Hardy. It's a low-hassle way to teach an old dog new tricks.

Two Python curiosities

I learn something new every day.

First, the sort of thing you could do to mess with someone when they step away from their Python interactive shell to go use the restroom:

>>> False = True
>>> False
True
>>> if False: print "Woo!"
... 
Woo!

Sure enough, True and False are just names in the builtin namespace that can be rebound. This capability seems pretty dangerous, so I'd expect to see something like it in C or in Lisp, but its presence in Python surprised me a bit.

Second, the following puzzle stumped me for a while when I first saw it. Why does the following expression evaluate as it does?

>>> "string" in [] == False
False

It's not a precedence issue, because that result is not consistent with either of the parenthesizations:

>>> ("string" in []) == False
True
>>> "string" in ([] == False)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: argument of type 'bool' is not iterable

It's actually a consequence of Python's support for chained comparison operators. That is, just as

5 < a <= 7

desugars to

5 < a and a <= 7,

the first expression above desugars to "string" in [] and [] == False, which is False.

It's good that the comparison operators (< <= > >= == != in is) work in this consistent way, but it can trip up Python novices who have not yet learned that they really have to write the more Pythonic expression "string" not in [] if they want to stay out of trouble.

Zeya 0.4

I'm pleased to announce the 0.4 release of Zeya. Zeya is a web server that lets you listen to your music collection, from anywhere, using nothing more than Firefox or Google Chrome.

Major changes since Zeya 0.3:

  • Gapless playback. This feature works with varying degrees of success on various browsers; I recommend Firefox 3.6. Firefox 3.6 > Google Chrome 4.x > Firefox 3.5.
  • "Shuffle" feature. (Thanks to Amit Saha)
  • "Repeat playlist" feature.
  • New playlist backend, which serves all the songs specified in an M3U playlist. (Amit Saha)
  • A sample Upstart script, which shows how to run Zeya at startup on Upstart-based systems, such as Ubuntu 9.10/Karmic and later. (Amit Saha)
  • Turned on traffic shaping for Google Chrome clients, so streaming doesn't hose low-bandwidth connections.
  • Other bug fixes and improvements to the listening experience.

Zeya has also now been packaged for Ubuntu! (More precisely, the Debian package has been synced to Ubuntu Lucid.) On Debian testing or unstable and Ubuntu 10.04/Lucid, install the zeya package:

# apt-get install zeya

(It may be several more days before 0.4 appears in Debian testing or Ubuntu.)

See http://web.psung.name/zeya/ for more information about Zeya, installation, getting started, reporting bugs, and development.

Charitable donations

I donated to the following charities and organizations in the past year (although I really meant to get this post out before the end of 2009):

UNICEF, to support relief operations following the earthquake in Haiti.

The Free Software Foundation, which has a simple but lofty goal: to ensure that the computers we use and carry around with us every day are actually accountable to us. Their public awareness efforts are invaluable, but if they did nothing but maintain the GNU operating system (including, ahem, Emacs), I would still be thankful beyond measure.

Wikipedia, for being one of the things that makes the web so wonderful.

Creative Commons, for showing that we can do better than "All rights reserved."

MIT Open CourseWare, for disseminating knowledge. OCW relies on donations to keep the lights on and to fund digitization of more classes.

My local branch of Feeding America (aka Second Harvest Food Bank). There is something depraved about hunger in the midst of plenty, and so close to home.

Amnesty International, that everyone may have the basic human dignities that you and I enjoy.