Author Archive
Testing with Live Devices
In a lot of the projects I work on the software we write must communicate with other live devices that speak a variety of protocols and testing using mock objects will only get you so far. That is why I like to capture actual data that is coming out of these devices and include it [...]
Tivo Detection: Network Discovery
I’m sure that you know if you have a Tivo or not, but I’m providing a class based on the “Tivo Connect Automatic Machine Discovery Protocol Specification” that will listen for the Tivo UDP heartbeat and provide a notification when the heartbeat is detected. Usage: 1 2 3 4 5 6 7 TivoLocator.getInstance().addListener(new TivoLocatorListener() { [...]
Computing Levenshtein Distance in Java
The Levenshtein distance between two strings is given by the minimum number of operations needed to transform one string into the other, where an operation is an insertion, deletion, or substitution of a single character. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [...]
Setting Multicast Time To Live in Java
I know that this seems trivial, but there are a few gotchas that have burned me a few times so I thought I would post the solution here. The API will lead you to write this MulticastSocket socket = new MulticastSocket(6000); socket.setTimeToLive(16); And you’ll feel pretty good about it, but then you will deploy your [...]
Unit Testing: User Interfaces
One sticking point a lot of people seem to have is how to unit test a user interface. I’ve read many articles by TDD advocates saying that you absolutely need to have unit tests for your GUI components, and then I’ve also read articles from the RAD tool crowd who say that because of the [...]

