flex on Mac OS X

September 30, 2009 on 10:28 am | In Miscellaneous | No Comments

I just discovered a horrible bug in the default version of flex (2.5.33) on Mac OS X 10.5.8. It strips out [[ and ]] from literal strings inside %{...}%! First, I tried building flex 2.5.35 from source. This doesn’t mess up the strings, but it blows up inside yy_get_next_buffer(). Then I tried building flex 2.5.4 from source, but it does very strange stuff, too. I finally gave up and split the double square brackets up by using string concatenation: "...[""[:digit:]""]...". It’s ugly, but it works!

Erlang Message Passing — Part 2

September 21, 2009 on 10:22 am | In Miscellaneous | No Comments

I just finished a major overhaul of my Erlang Actor in Java library. Not only does it now provide three different threading strategies (persistent thread, transient thread, thread pool), but these strategies are pluggable. Implementations derive from Actor and implement act(), and the threading strategy is provided when the Actor is instantiated, by passing in a concrete implementation of Agent. I also added in the concept of a MessageSpy, for logging and monitoring. Any number of MessageSpies can be installed, and each one gets to look at every message that is sent.

Re-enabling Eee PC External Monitor

September 21, 2009 on 8:46 am | In Miscellaneous | No Comments

I use my Eee PC as my dev box at home, so of course I have my Sony monitor plugged in. The wonderful feature of Metacity on Eeebuntu is that it automatically adjusts to the size and resolution of my monitor. There is a minor bug, however: the size of the root window is reported to be the size of the notebook screen, not the size of my monitor. In an attempt to fix this, I made the mistake of using the Video Displays menu in the Eee PC Tray. This disabled the external monitor, no matter which option I selected! After tracing through shell scripts, I discovered that /var/eeepc/vga_saved needs to contain 1. This re-enabled the external monitor.

Update (9/30/2009): The latest system update has fixed this. The Video Displays menu works. After the update, the external monitor went back to low resolution, but as soon as I selected External Display Only, it worked perfectly.

The Unknown OS

September 13, 2009 on 7:45 pm | In Programming | No Comments

Before the internet, everybody always worried about getting their desktop applications to run on multiple operating systems. If it ran natively on Linux, Mac, and Windows, it was a marvel. Nowadays, everybody worries about getting their web applications to run on multiple browsers. If it runs equally well in Firefox, IE, Opera, Safari across Linux, Mac, Windows, it’s a marvel.

But there is another, virtually unknown OS, exclusive to Unix: the window manager.

Getting a Unix desktop application to work correctly across the myriad of window managers (AfterStep, blackbox, Enlightenment, fvwm, icewm, Metacity, OpenStep, Sawfish, WindowMaker, XQuartz, etc, etc, etc.) is almost impossible since each seems to have its own unique ideas about how to position decorated windows. There are thankfully some standards, but not all window managers support these. Some do their own thing, while others support older standards. Metacity on Eeebuntu doesn’t make the window a child of the frame. Sawfish on my version of Eeebuntu locks up when it receives a _NET_WM_DESKTOP client message!

In addition, getting a Unix application to interoperate with all the various desktop environments (CDE, Gnome, KDE, XFCE, etc.) is also pretty much hopeless. When I tested an edge case in the reference implementation of XDND against Konqueror in Eeebuntu, it was almost impossible to get the reference implementation to accept the drop from Konqueror. When I tested the default file manager in Eeebuntu, it accepted files dropped via XDND, but it did not use XDND when dragging files!

No wonder so many people stick to Windows…

Update: Further testing reveals that Konqueror only seems to send a single message to the target window instead of a continuous stream as the mouse moves!

Negotiations

September 10, 2009 on 6:43 pm | In Miscellaneous | No Comments

I just finished another story. This one is set in the Star Trek universe, because I dreamt it that way :)

The Joy of Hacking

September 3, 2009 on 8:16 pm | In Programming | No Comments

I’ve spent quite a bit of time over the past couple of years writing layout managers in JavaScript. If you happen to have access to Yahoo! APT, then every time you resize your browser window and everything expands or shrinks to fit the available space — that’s mah baby. I sometimes joke that the layout manager is going to put my daughter through college, because it’s on version 3 already and my next project is version 3a. But I digress…

All sizes in version 3 are percentages. This keeps the math and the configuration simple. (Version 2 let you use any unit, %/em/px, and it was a bear.) Recently, somebody asked if it would be possible to mix in fixed size elements. After thinking about it, I realized that I could treat fixed size elements the same way that I already handle collapsed elements, since collapsed elements are a (small) fixed size. A long day and a few judiciously placed statements later, and it works!

And the really cool part is that instead of making a complete mess of the configuration by introducing units, I simply added a keep your grubby paws off this element flag. The element’s size can then be set via CSS, the good old-fashioned way :)

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^