Author Archives: admin

SyntaxHighlighter Evolved and line-height

As you probably know, I’m using SyntaxHighlighter Evolved to post syntax-highlighted code. Some people mailed me, that in some of my posted code the underscores are not visible (although copy&paste works). Well, the culprit is the line-height attribute of the SyntaxHighlighter Evolved cascading stylesheet: Simply increasing the line-height from the default 1.1em to 1.21em in wp-content/plugins/syntaxhighlighter/syntaxhighlighter/styles/shCore.css did the trick.

log4j performance

      1 Comment on log4j performance

Log4J is the current de facto standard not only in open source development. It claims to be fast and flexible: speed first, flexibility second. But there are some pitfalls when it comes to the crunch. The costs of a log request consists of a method invocation and an integer comparison. This is typically about 1-20ns (depending on your processor) per… Read more »

sSMTP revaliases, aliases and mail.rc

      16 Comments on sSMTP revaliases, aliases and mail.rc

I already wrote about sending mails with ssmtp, a simple alternative to sendmail. But since I got a few questions (and I tend to forget myself) how to use ssmtp’s revaliases-file, here is a short reminder: /etc/revaliases, allows you to map a local user to a specific ‘From:’ address on outbound mail and to route that mail through a specific… Read more »

Making MythTV work with pulseaudio in Fedora 12

If you run mythfrontend 0.22 from RPMfusion, it will automatically try to disable pulseaudio and use the default ALSA output instead. This leads (in most cases) to no audio output at all. Changing mythtv’s audio output device in the frontend (Utilities/Setup -> Setup -> General -> Audio System -> Audio Output Device) from ‘ALSA:default’ to ‘ALSA:spdif’ worked for me, but… Read more »

Rearrange Thunderbird accounts

      No Comments on Rearrange Thunderbird accounts

Unfortunately, the Folderpane Tools-plugin I used for rearranging my accounts in Thunderbird isn’t TB3 compatible (yet?!). Although it claims to work with all Thunderbird versions starting from 1.0 it just throws out parsing errors with the current Tunderbird beta. But the plugin doesn’t do any magic tricks, of course. It simply reorders the accounts in the corresponding preferences file prefs.js…. Read more »

FileWriter, XML and UTF-8

      1 Comment on FileWriter, XML and UTF-8

Deep down in the Java-API: http://java.sun.com/javase/6/docs/api/java/io/FileWriter.html Convenience class for writing character files. The constructors of this class assume that the default character encoding and the default byte-buffer size are acceptable. To specify these values yourself, construct an OutputStreamWriter on a FileOutputStream. So, if you want to write you XML-Document to a file, for the love of god, don’t use the… Read more »

Quickly zooming a BufferedImage

      No Comments on Quickly zooming a BufferedImage

If you don’t need a scaled instance of your BufferedImage in the memory, you can use “on-the-fly scaling”. For example, this custom JComponent can be used to display a BufferedImage and zoom it with the setScaleFactor(..)-method For some benchmarking on the different RenderingHints values see Chris Campbell’s great article The Perils of Image.getScaledInstance() Resources: http://java.sun.com/docs/books/tutorial/2d/advanced/quality.html http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html