tips


15
Jun 08

Running out of filehandles the easy way – Java

Java has finalizer methods. These are blocks of code that run on certain times, but you usually don’t know when. When the planets are aligned you can do some finalization. You usually avoid these or should try to avoid them.

Luckily Java will sometimes use finalizers without telling. An innocent piece of code that opens a connection to an URL and checks for the last modification date (getLastModified()) will open a java.io.FileInputStream and close it only in the finalizer, i.e. exactly when the planets are aligned.

I stumbled upon this while debugging JavaRebel and trying to figure out why JBoss needed couple of thousand filehandles when no applications were deployed. A deployment scanner checking all of the files every few seconds will do the trick:)


25
May 08

Firebug 1.2 – log limit has been reached

You are doing JavaScript logging while debugging using the console.log() of Firebug. If you log more than 200 lines you get a message “Firebug’s log limit reached” and you are out of luck. Currently the option name to higher the limit is maxQueueRequests. This is not an obvious name for console logging limit. Hopefully google will index this and this post will help somebody out. I guess the reason for this kind of name is that while 1.2 is in development they just reuse limits for different stuff. I’ve added a bug report.


17
Mar 08

Exposing Darcs Repository with Python

I use Darcs distributed VCS for all the projects that I work alone on. I have ssh clients installed on all the computers I use and I have always a remote SSH server that I can use as one central server. Darcs works very well over SSH. Darcs also works well over HTTP. I don’t have always access to Apache configuration files and I do want to sometimes expose a repository or two via HTTP. Just another practical use for the Python one line webserver
[PYTHON]
python -c “from SimpleHTTPServer import test; test()”
[/PYTHON]


9
Mar 08

Wow, Commandline Tools Evolved

There is a nice piece, Sexy clones of classic Unix tools. Even if you are happy with top (display Linux tasks) just give htop a try and be amazed.


9
Mar 08

Migrating to Firefox 3

I’ve been running nightly trunks of Firefox 3 for more than a month now. The switch was not easy. The changes in the usability department seem small but some changes are 180 degrees.

While holding CTRL and wheeling the mouse the font size changes depending on the direction of the wheeling. Well, in Firefox 3 they inverted it. I’m not willing to relearn just because somebody thought the direction should be IE compliant. Change in about:config mousewheel.withcontrolkey.numlines to -1 and you have the old behaviour back.

You are reading pages with diagrams with small text? You resize the page and you cannot make anything out of the resized diagrams? Disable the image scaling, change browser.zoom.full to false.

You have old plugins that supposedly don’t work? Give them a try, install Nightly Tester Tools and tell them that they are compliant and see if they work.