ScribeFire Rocks

I promised I would say so, and so I am.  I might have given it away in the lead, but:

ScribeFire Rocks.

ScribeFire especially rocks now, if you are a Python blogger, because you can do this:

    def proto_init(self, string):
        """
        String received in the 'init' state.
        """
        self._currentBox = AmpBox()
        return self.proto_key(string)

I'm indenting code!  On a blogger-hosted blog!  And the code stays indented!!!

The elaborate process that I used to do that?
  1. alt-tab to emacs
  2. copy
  3. alt-tab to scribefire
  4. paste
And... I'm done!  (Well, okay, not really.  I did have to manually insert the tag to change the font face.  But still!  I didn't have to type    three million times.)

When I'm writing, I don't like to focus on markup.  I want WYSIWYG editing.  I want to drag screenshots off of my desktop and drop them into my text without worrying about how they get uploaded, and I want to see how they cause my text to re-flow.  I want bulleted lists and italics and boldface and I don't want to worry about closing tags.


ScribeFire gives me all of these things when I'm writing, with pretty much no hassle.

Thank you, ScribeFire.  Stay awesome.

Wow! Java (Swing) doesn't have to look crappy!

I have a long love-hate (well, mostly hate-hate) relationship with Java.  I used to be a Swing hacker, in my callow youth, and the whole experience left me feeling pretty bad about Java GUI programming.

Over the years, I've watched as Java has gotten better and better native look and feel on Mac and Windows, but every time I've started a Java application on Linux, it's time to party like it's 1995; the default "Metal" look is reminiscent of a souped-up Motif, and clashes terribly with my desktop.

Totally by accident, I discovered this gem on stackoverflow...

This page explains how the work with Look&Feels: http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html

You can do it commandline:

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel MyApp
... and my jaw dropped.  Really?  It's that easy?  I tried it with my favorite Java GUI application, Tiled - and here it is, not looking like crap:



As with every native look and feel, it's not quite right.  The behavior of 'tab' is off in a few places, there are tons of things that should be keyboard-focusable but aren't... but it's a huge improvement.

I still have no idea why this isn't just the default behavior on Linux — although I'm sure I have a few fun inexplicable segfaults to look forward to — but I'm certainly going to enjoy using Java applications quite a bit more now.

Programming (And Markup) Languages I've Learned In Order

Catching up with some blog backlog, I saw this post from James Tauber and it looked memeish.  I think my list is interesting:
  • HyperTalk
  • SuperTalk
  • AppleScript
  • CSH
  • Bash
  • HTML
  • POVRay
  • C++
  • Emacs Lisp
  • VRML
  • Java
  • Perl
  • Scheme
  • C
  • x86 assembler
  • Python
  • Squeak Smalltalk
  • Common Lisp
  • Ruby
  • JavaScript
  • ActionScript 3
I would consider myself proficient in the boldface languages, and use them all frequently.

Languages I intend to learn in my copious spare time:
  • C#
  • Erlang
  • Haskell

After These Messages, We'll Be Right Back

Do you have an account on Blendix?  Did you know that you can find out all kinds of interesting stuff about me on my Blendix page?  Or that, if you sign up, you can get notified on your dashboard when I do something new?

I have no problem with self-promotion, but I tend to do it indirectly, in pursuit of making some point that I hope my audience will find interesting rather than just coming out and saying it.  But this weekend I discovered that not even my own sister knew we'd launched this thing — even though I mentioned it when it launched back in January!  I guess I'm not being clear enough!

So here's clear for you.  TRY BLENDIX! :-).

We have a bunch of new development happening on Blendix now, but it's been useful for a while already.  It's useful if your friends use it, since, like other services, your friends can update their list of feeds, and you'll be notified of new things.  On Blendix, though, if your friends don't have accounts, or are lazy, and don't update their pages, you can create your own version of them with more information that is useful to you.

Now, back to our regularly scheduled programming.

exarkun for president

Jean-Paul Calderone is an amazing hacker.

So, here's the setup.  We're working on this application that runs in the Adobe AIR runtime.  We implemented the AMP protocol for client-server communication.  Superficially, it worked great; limited tests gave us good results.

Then, we started throwing some real data at it.  And it choked.  The runtime would terminate its client socket silently: it would stop delivering data to application code, send a TCP FIN to the server, and not even deliver an event indicating that the socket had gone away.  Nothing.  Nowhere to set a breakpoint, nothing to debug.

The Python implementation of this protocol worked fine; everything got delivered.  The connection was not dropped unless we told it to drop.

I spent all night poring over protocol dumps, trying to figure out what was going wrong.  There were slight differences in where in the data stream it was dying - but for some reason, always cleanly, on a message boundary.

So, I come into the office and I fire up the program and show JP.  We get a tcpdump, and he looks at the output.  He squints at it for a few minutes and says:
"Huh.  It died on message 64.  That's interesting...
Oh wait, that's hex.  What's 64 in hex?  100.
... thoughtful pause ...
Maybe the garbage collector is buggy?"
He was right.  The bug was in the garbage collector.  AIR apparently doesn't think sockets (and apparently, other stuff, like animations) are "real" things that should keep strong references to the things they are feeding events to - so, sometimes they just crap out and get garbage collected, and silently stop delivering events.