Category Archives: Uncategorized

Efficiently searching the Java API

      No Comments on Efficiently searching the Java API

Since Sun’s API search is a real pain in the arse and even DocWeb doesn’t allow you to quickly search the Java API, this firefox plugin is a substantial improvement: https://addons.mozilla.org/en-US/firefox/addon/60675/ It basically redirects the search query to Google’s “I’m Feeling Lucky” feature to search Java’s API for the class information. Together with Second Search querying the Java API is… Read more »

Implementing equals() the right way

      No Comments on Implementing equals() the right way

At first sight, implementing equals() doesn’t seem fairly hard. Unfortunately, it turns out that writing a correct equality method is surprisingly difficult: http://java.sun.com/javase/6/docs/api/java/lang/Object.html The equals method implements an equivalence relation on non-null object references: It is reflexive: for any non-null reference value x, x.equals(x) should return true. It is symmetric: for any non-null reference values x and y, x.equals(y) should… Read more »

Using a HashSet in a thread-safe manner

      4 Comments on Using a HashSet in a thread-safe manner

Thread safety is a very hot topic for Java programmers right now. But I’ve seen quite a few folks using the rather complex collections from java.util.concurrent when they actually needed just a thread-safe implementation of a Set. Of course, the HashSet implementation is non-thread-safe: http://java.sun.com/javase/6/docs/api/java/util/HashSet.html Note that this implementation is not synchronized. If multiple threads access a hash set concurrently,… Read more »

PulseAudio and lirc [Update]

      No Comments on PulseAudio and lirc [Update]

Changing the system volume with a lirc enabled remote can be a pain in the arse if you don’t know what to look for. If you do, it’s quite simple: There is a package called ‘pulseaudio-module-lirc’ (PulseAudio’s Wiki for module-lirc) that contains the volume control module for the PulseAudio sound server. Install the package via yum and enable it Here… Read more »

Java plugin for Firefox 3.6

      1 Comment on Java plugin for Firefox 3.6

Since Mozilla dropped support on OJI (Open Java Virtual Machine Integration), the classic java plugin file javaplugin-oji.so doen’t work anymore for Firefox versions >3.6. Starting in Firefox 3.6, Mozilla will only support the standard NPAPI and NPRuntime interfaces. However, a ‘Next-Generation Java plugin’ (that’s what Sun calls it) is available in Java version 6 update 10 or newer and supports… Read more »

Netboot CentOS using Attansic L1 Gigabit Ethernet

To update the initrd.img to load additional drivers early in the boot process, normally you would simply run /sbin/mkinitrd and let the script do the work. But what if the initrd.img used during the installation of CentOS lacks an important driver? Maybe you want to netboot CentOS, but the initial ramdisk CentOS provides doesn’t have the right modules for you… Read more »

WordPress myStat plugin breaks rss feed

      1 Comment on WordPress myStat plugin breaks rss feed

I recently installed myStat to keep track of this blog’s rapidly increasing number of readers. Unfortunately, the plugin break the rss feed. The problem is the plugin’s myStat_footer() function, which does not check if the page is a feed before deciding to insert the myStat footer image into the page code. To fix myStat v2.6, locate line 475 in mystat.php… Read more »