Tuesday, July 22, 2008

Matias Tactile Pro

The Matias TactilePro page says boldy:

Built like a tank.
The Tactile Pro Keyboard is built to last, and comes with a 5 year warranty.
I'm not sure any keyboard I've ever owned has died within five years. Generally, keyboard are trouble-free, as long as you ignore all the crud that gets trapped in them, especially if you have animals that shed. If you really want to be seen as standing behind your product, you'd have to do a lot better than that to impress me.

Maven Makes Developers Feel Stupid

Although Maven has its benefits, its documentation is often spartan and scattered, and sometimes it can be quite painful to figure out how to accomplish a task, although once you've figured out how to do it, it's usually not terrifically hard to repeat it in the future.

A recent post to the Maven list just classically typifies this, for me: "How to use EAR plugin? Am I stupid?" Yes, sometimes Maven makes you feel stupid. I'm inclined to believe that's often Maven's fault, not the developer's.

Thursday, July 17, 2008

Matching JAXB Dates in Tests

If you find yourself wanting to correctly generate the date format used by JAXB, most likely in test code, you might find yourself messing with an XMLGregorianCalendar doing something like this:

        GregorianCalendar gregorian = new GregorianCalendar();
        gregorian.setTime( date );
        XMLGregorianCalendar xml = DatatypeFactory.newInstance().newXMLGregorianCalendar( gregorian );
        return xml.toXMLFormat();

If you do, you're likely to get bitten by the fact that on dates with 0 milliseconds, your method will include the milliseconds and the JAXB output will not:

expected:<2008-07-16T15:15:51[]-04:00> but was:<2008-07-16T15:15:51[.000]-04:00>

As a result, you'll want to employ code more like this:
        GregorianCalendar gregorian = new GregorianCalendar();
        gregorian.setTime( date );
        return DatatypeConverter.printDateTime( gregorian );

Et voila.

Wednesday, July 16, 2008

JBoss Effect and Hibernate Session.connection()

Sometimes it seems as if there's a JBoss effect wherein developers, once they've become a part of JBoss, become somewhat arrogant and rude in dealing with some members of their community. At first, I thought this might be the Marc Fleury effect, but he's gone, and JBoss seems to still have the same effect at times.

Case in point is the recent deprecation of Session.connection() in Hibernate and the tone of the responses here (Google cache version if Atlassian's still doing maintenance) and here.

Now, granted, the method is deprecated, and the deprecation comment implies that it will be replaced in the future with new methods. That said, the comment neither talks about the dangers of using connection() nor talks about alternative approaches that could be taken, both of which are common in deprecation Javadoc, and both of which would likely have reduced the volume of questions they were going to field.

And, frankly, if the best you can do to "help" the community is to respond with brusque, unfriendly comments about said member's ability to read and/or interpret the rather spartan documentation on this point, perhaps you should just stick to coding, instead of "helping"?

I will point out that another thread, About 3.2.4 and Deprecated function, generally stayed in the informative and polite zone, mostly due to max. Thanks, max, it's nice to see. So if you want to know why Hibernate 3.2.4 is deprecating Session.connection(), read that thread instead.