coding

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 [...]

Unit Testing: A Short Primer

I realize that I am not the first to write about unit testing, but there seems to to be an absence of examples dealing with only simple unit testing.  Most all documents deal with unit testing as part of an overall strategy like XP or agile, I don’t really care when you do it as [...]