Odi's astoundingly incomplete notes
New Entries
Gentoo ACCEPT_LICENSE
Portage 2.1.7.16 is now stable. And with it comes a new feature: The ACCEPT_LICENSE variable (in
/etc/make.conf). It allows you to disable packages based on their license. You may see that emerge would now unmerge some packages (Java for example) because the default filter is not blank. To allow all licenses simply set it to ACCEPT_LICENSE="*"Add comment
Deutsches Gentoo Buch (PDF)
Soeben ist ein Buch über Gentoo frei im PDF Format erschienen.
Gunnar Wrobel
Gentoo Linux - Installation - Konfiguration - Administration
2008 Open Source Press
PDF Download
Windows annoyances: unresponsive tasks
Usually I don't blog about Windows. But since I (have to) use it at work I am exposed to its flaws. Today I am particularly annoyed by the slowness of Eclipse, which is mainly caused by a lot of disk activity (due to a large number of large projects checked out) which is utterly slow on Windows (XP). Occasionally Eclipse would become unresponsive. What happens then is:
- Eclipse widgets clutter the screen: an opened menu stays on top of all other windows.
- The task bar becomes unusable: clicking the window buttons doesn't do anything. At the same time some of them start blinking like crazy.
- Although some window is highlighted the input focus is somewhere else.
- The whole system becomes slow and sluggish.
Use a Virtual Machine running Ubuntu (or some other distro). Simple.
Uhm... maybe I should really run Windows in a VM on top of Gentoo instead :-)
Routing through a parking
Google Maps has mapped an underground parking in Zurich and includes it into their routing data. This can lead to funny routes:


Don't use gdbm
GDBM is a tiny embedded database. Convenient as an internal data store for applications. However, as you can see from this Gentoo Bug, the database format is highly dependent on the architecture and even compiler flags. So it is far from portable. You can not necessarily exchange its files between platforms or different machines of the same platform running different OS versions. It may even break like in this case during a simple upgrade, when the configure flags change.
Having such an unstable database format is inherently bad architecture. I recommend not to use this library in any application. It will cause someone a bad day.
Having such an unstable database format is inherently bad architecture. I recommend not to use this library in any application. It will cause someone a bad day.
No ext3 on Android?
It seems like the only filesystem supported on the HTC Hero's SD card is FAT. That is sad, since Linux supports no less than 40 filesystems. And the only option you have is the worst of them? Something is going terribly wrong at Google.
has it occurred to you that FAT is the only file system that works when you insert the SD card into a Mac or PC?
Gregor Rothfuss
Gregor Rothfuss
Who cares if all I want is interop with a Linux system? Besides, there are drivers for the others. Even if I take the SD card and format it with ext2, the Android would reformat it with FAT. Again, something is going terribly wrong here.
Unexpected Date.before() / .after() performance impact
The java.util.Date class has two convenience methods before() and after(). If your application is very intensive on these Date operations, be careful of a performance bottleneck here!
Each call to before/after (and even
To understand this we need to dive into the source code of Date. If you think about it, Date should be nothing more than a wrapper for a
The before/after methods are particularly bad because they will clone the
My advice is, to never use
The bug has been reported to Sun.
Each call to before/after (and even
getTime()) may have the cost of an internal object allocation. However not always. If you had called toString() on the instance before, then an object allocation will happen. Otherwise probably not.To understand this we need to dive into the source code of Date. If you think about it, Date should be nothing more than a wrapper for a
long variable holding a system timestamp. This variable is called fastTime. However the Date class has some deprecated methods that deal with a calendar date. These methods are from a time when original developers were confused about Date and Calendars, but have since been deprecated. But to support them Date still needs an internal Calendar instance of type sun.util.calendar.BaseCalendar.Date which is held in the variable cdate. Today this variable is usually null. That is as long as none of the deprecated interface has been used on the instance! Whenever it needs to convert the fastTime to a real date it will instantiate a BaseCalendar.Date in cdate. The problem is that toString() also performs a conversion to a real date. Too bad, toString() is very handy for logging. So any Date instance whose toString() method has been called once, will be slow and a memory waster. The before/after methods are particularly bad because they will clone the
cdate object on each call! The getTime() method is not as bad, but may still allocate a GregorianCalendar object.My advice is, to never use
Date.toString(), or completely work with long timestamps directly.The bug has been reported to Sun.
Layer popups vs. Window popups
It has become very popular to use JavaScript to create modal dialogs and popups "in-page". That means they are overlayed over the content of the webapp window. Before this trend, the standard way to show a popup dialog was in a new window.
Anybody who implements JavaScript popup layers PLEASE make sure not to break the usability that a normal popup window has:
Anybody who implements JavaScript popup layers PLEASE make sure not to break the usability that a normal popup window has:
- Add a close button: Something will always go wrong and your fancy layer will not close correctly. This leaves the user with a broken application. His only option is to close the browser window, or reload the page. Give back some power to the user and let hime close the popup with a simple button. Place this button in the titlebar. Careful: different platforms have varying standard where they place their close buttons. You may not be able at all to detect this standard automatically (Linux desktops are configurable and can put these buttons almost anywhere on a window decoration).
- Make it movable: Popups hide content underneath. Sometimes the user may want to read information that is hidden by the popup. A movable popup lets him move the thing out of the way if necessary.
- Implement the standard keyboard shortcuts: Some people are used to confirm popups with the Enter, Space, Esc, TAB component navigation or other keyboard shortcuts. Careful: different platforms may have different standards.
- Allow copy/paste: If the popup contains form fields, make sure that copy/paste still works -- on all browsers. Some fancy editors break it badly.
- If the window is already open, make sure to bring it to front (focus).
- Make it a "dependent" window, so that it automatically closes if the user navigates away or closes the parent window.
I hate Snap previews
You know, these litte annyoing pop-up previews, that some idiots of webmasters include in their websites. Luckily you can globally disable them, by clicking a link on the Snap website. See For the Visitors section in their FAQ.
Campaign for less configuration
I am currently cracking down on the amount of configuration of our product. Join the campaign and do the same for YOUR product:
- Define sensible default values for all parameters, thus eliminating the need to override them.
- Find configuration that is the same (nearly) everywhere and make that value the default. Then make the parameter optional.
- Identify parameters that have only one legal value. Treat like above or eliminate the parameter altogether. During a phase of backwards-compatibility warn if the parameter is set and tell the user to remove it.
- Complex object trees assembled with tools like Spring Beans can maybe hardcoded and produced by a factory, if feasible.
- If you want to go extreme, make the system smart to assume sensible default values at runtime, if they are not present in the configuration, and log the assumptions and decisions taken.
- Define required filenames or filename patterns instead of configuring them.
- Use a fixed package name, tagging interfaces or annotations and reflection to find a class dynamically at runtime instead of configuring its classname.
- Deduce class names from a context instead of mapping some property to classes in a configuration file.