Archive for the ‘development tools’ Category

Find Bugs—Eclipse Plugin

Friday, November 21st, 2008

A few ago I decided to try out FindBugs, a plugin for Eclipse JDT. Here is its description on Eclipse Plugin Central:

[FindBugs] looks for instances of ‘bug patterns’—code instances that are likely to be errors.

I have seen enough of these tools to have downloaded it with skeptical expectations: code pattern analyzers are typically ridden with absurd anti‐pattern heuristics, nonsensical descriptions, bugs, and useless heavy‐weight features. I had it since my most recent plugin‐downloading spree but first tried it yesterday. I was impressed: it is possibly the best Eclipse plugin I have used. Note that FindBugs is both a standalone distribution and a plugin for Eclipse; I review both here:

  • Its anti‐patterns really are anti‐patterns. Most of its detections were actual design flaws or questionable practices. So far its heuristics have incorrectly identified very little.
  • It is highly configurable. It allows you to select anti‐patterns to check, filter files, choose ant‐patterns to show, and control re‐checking on rebuild.
  • It is fast. Speed is atypical for code pattern analyzers. Because FindBugs also shows the analysis speed for each anti‐pattern, you can fine‐tune its speed.
  • I have not encountered a bug yet. This may change, but it seems pretty solid. Note that I discount false positives (incorrect pattern matches) as bugs—that will always happen.
  • Its anti‐patterns have descriptions. No—I am not joking. Each of its anti‐patterns has a description that is in valid English (!), explains the issue, and suggests solutions. I find that extremely useful in sorting issues from non‐issues and false positives.

The first time I ran FindBugs, I looked through the list and examined each code fragment. I had previously noticed some of the practice flaws it identified, but some were useful. But more than that: it actually identified three bugs, which I will signal in an SVN commit diff somewhere. The bottom line is that FindBugs actually finds bugs.

Remote Storage on Gmail with gmailfs

Friday, September 26th, 2008

People who have bought computers from the Dell website have likely noticed the “online backup” service. As far as I have seen, it is a waste of money. Besides the recent obvious inexpense of external hard drives, superior, cost-effective options are abundant. I have an external hard drive for backup that I use regularly but, after hearing some enticing success stories, have gained recent interest in storing files on Gmail. I tried out Richard Jones‘s gmailfs (for Linux) and managed to connect after fixing some simple issues from Fedora‘s packaging.

Update: it is not worth using, and the Gmail team sometimes disables accounts bypass their interface for backup

Repository Mirroring with svnsync

Monday, January 21st, 2008

I recently created a new Subversion repository on my domain here. I wanted to migrate from my Google Code repository in order to support a better HTTP interface via ViewVC. After its setup, I realized that I did not know how to transfer the old revision history from Google Code. After searching for a Google Code tech support contact (which I deemed did not exist), I discovered the frighteningly simple answer: svnsync. svnsync is a tool distributed with Subversion to create read‐only syncs from one repository to another.

First, open a shell on the machine containing your destination repository. Configure your pre-revprop-change hook to permit any change from a user sharing the username with a valid privileged user on your source repository. (If you do not have a pre-revprop-change hook, make one by removing the filename extension of the sample file your_repository/hooks/pre-revprop-change.tmpl.) Unless you have a better way (I am certain there are many.), insert the line
if [ "$USER" = "dmyersturnbull" ]; then exit 0; fi
after the initial variable declarations and before the exit 1. The hook’s header comments may help, but particularly remember that a nonzero return indicates an error.
With your pre-revprop-change hook configured, run
svnsync init --username your-username destination-repos source-repos
Then run (maybe with a cron job)
svnsync sync destination-repos source-repos
For every commit to your source. Tigris recommends not changing the destination repository directly.

Launch4J: Jar Wrapper

Tuesday, November 13th, 2007

The Java forums provided by Sun at http://forums.java.sun.com have become an unfortunate degradation into experts responding to certain users who post redundant questions. One of the more commonly asked questions can be found in a format like “give me executable maker,” which has been answered before, is often incomprehensible, and is rude. But this particular redundant question led me to discover Launch4J, a simple utility to build Windows‐proprietary executables designed solely to wrap Jars or directly launch them directly. Distributing a package containing only the executable defeats Java’s entire cross‐platform approach, but adding an executable does have advantages, such as embedded comments and icons and the ability to target the less computer‐literate. Because the application or console program is launched directly and the JRE is launched through it, it will be grouped as a separate process in the Windows task manager.

yEd: Flowchart Editor

Sunday, November 4th, 2007

Good code designs are the key to a clean, efficient, and successful code. I use lists, pseudocode, and layouts on a regular basis, but my favourite design medium remains the flowchart. While stepping back and looking through the notebook I was once so content with, I was recently shocked at how confusing it was. It was neat and well‐organized, but there was a significant lack of content in places where I had to use a separate piece of paper. And all those papers were missing. Then I found yEd, the best free programmer’s flowchart editor I could imagine available. Written purely in Java, yEd is incredibly fast to use with simple drag‐and‐drop, an outline view, and zooming functionality. It allows different label colours, shapes, and sizes, and supports custom images. Users can insert descriptions and URLs into individual nodes. yEd includes automated organizers, powerful printing options, and a fully featured help menu. And it is somehow under 7 megabytes.