Blogs

A rigorous friction model for human-computer symbiosis

This is a response to Ari’s awesome post on human-computer symbiosis. Ari and I were chatting about the equation he developed and I was wondering if there were some further refinements that are possible… let’s take a look: We are attempting to understand the total analytic capability for a given task a of a human-computer [...]

Continue reading »

Fun with jMock

Here at Palantir, a lot of our automatic tests are full-chain tests. A backend server is fired up, client code runs against it, and everything runs much like a production environment. This makes intuitive sense because it’s a faithful approximation of how the system will run in the field. However, there are some disadvantages to [...]

Continue reading »

Model-View-Adapter

I used to think I understood MVC. In undergraduate CS programs, MVC is taught as an off-the-shelf pattern, explained once and then ready for use in the real world. Wikipedia also makes it seem pretty simple: Model–View–Controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from [...]

Continue reading »

Printing to Plotters in Java

Carl juggles with his creation One of the things our customers love to do is print our beautiful object graphs and tape them to the wall for discussion. What they hate to do is print 30 pages, line them up, and tape them to a poster one at a time. So we bought a plotter, [...]

Continue reading »

James Gosling comes to visit

Following the discovery that our offices were the birthplace of Java (or least the place where it had its childhood), I invited James Gosling to come visit. For those that don’t know who James Gosling is, he’s more-or-less the father of Java. Java started as a project of James Gosling’s in 1991; today, 17 years [...]

Continue reading »

Best Practices: compareTo consistent with equals

What is wrong with this class and why? I’ll tell you beforehand there are two things I am looking for and they are both in the compareTo function. Yes, this came from the Palantir code base and caused me some issues. It has been modified slightly for illustrative purposes.

Continue reading »

SimpleDateFormat is not thread-safe

It seems like a relatively common mistake is to assume that the java.text.SimpleDateFormat class is thread-safe (at least for methods such as format(), which you might not expect to mutate state!). This is not true; SimpleDateFormat is not thread-safe, and format() does mutate state. From the javadoc: Date formats are not synchronized. It is recommended [...]

Continue reading »

XML Pull Parsing and Enums: like chocolate and peanut butter

. There comes a time in every developer’s life when they need to write code that processes some XML. Lately, we’ve seen the proliferation of APIs that make XML processing easier, like JAXB (Java API for XML Binding). However, when speed and scale are required, chances are you’re going to need to roll your own [...]

Continue reading »

Custom Alpha Compositing

Every so often (can’t be more than once every two or three days), Swing doesn’t quite do what we need, and we end up writing customized code. In this case, all the available AlphaComposite instances provided with Java were variations on the theme of combining the colors and alpha channel of both source images into [...]

Continue reading »

Unicode and happy user experiences

Everyone agrees that it’s crucial to do validation on user input so that, among other things, your application never tries to write a value that’s too long into a database field with a specific limit. Users of your application shouldn’t, however, be left guessing whether the megabyte they pasted (and you know they will) into [...]

Continue reading »

Showing 1-10 of 12