Automatic file encoding detection in Java

A few months ago I worked on a process that imports Facebook Leads into a legacy system. Facebook sends its advertising data as UTF-16 encoded CSV. The tool also had to support the CSV files occasionally being ended by hand, which reverted the encoding to something a...

Postal Code Voroni Diagram

The links in this article point to a free Heroku instance, which can shut down due to inactivity. It may take a few seconds for the instance to start up. I’ve uploaded a little experiment to Heroku, showing something I toyed around with a couple years ago. Would...
Hibernate Logging Options

Hibernate Logging Options

For years I have relied on a simple property “show-sql=true” to see Hibernate’s generated SQL. This option is fairly limited: it bypasses the logging framework in the rest of my apps (SLF4J) it doesnt show parameters, just question marks it...
Making JMeter accept a HTTP 404 as success

Making JMeter accept a HTTP 404 as success

One of the projects I am currently working on involves re-writing a REST service written in ColdFusion into Java/Spring. I’m in the testing phase, and am trying to make sure the endpoints behave the same as the ColdFusion versions. One of the tests I am...

Java 8: Optional

A fellow developer today asked me a question about the Optional interface in Java 8. My team is still working on a Java 6 stack, but his team is blazing the trail to Java 8. I’ve used Optional a little bit in some side work, and I am a little more familiar with...