Monthly Archives: January 2011

Spring-Dao 2.x problems

What the heck is this? Your library has this class and the method does exist and even takes a String. What makes it even weirder is that your tests run in your editor, but do not run from the Maven … Continue reading

Posted in Java, JUnit, Maven, Spring | 3 Comments

jsoup: Java HTML Parser

I haven’t had to do this in a while, but some co-workers were talking about two problems and they had HTML parsing in common. Dave Petersheim had already introduced jsoup into our project for just that purpose. jsoup: Java HTML … Continue reading

Posted in Java | 2 Comments

IntelliJ maintenance registry

Do you ever wish you can go in and change the number of days of local history to keep? Well, you are in luck. CTRL+ ALT + SHIFT + / The maintenance panel is displayed. Pick “registry”. Scroll down to … Continue reading

Posted in IntelliJ | Leave a comment

Creating toString, hash and equals methods the easy way

Creating a toString method used to be tedious and would lead to new properties being left out. Jakarta Commons solved that problem for us: They also provide a HashCodeBuilder class to make creating a hash code easy Append as many … Continue reading

Posted in Java | 3 Comments

Sorting objects of different types using Java Collections

Sorting with Java Collections is easy. Collections.sort() does all of the work if you have defined a way to compare the objects. That works great … when they are of the same type. What happens if the objects are of … Continue reading

Posted in Java | Leave a comment

SSH and env

Your environment (env) isn’t the same environment you get when you ssh into a machine. It isn’t even the same environment you get when you rlogin into the same machine. Consider [sourcdcode language=”bash”]ssh host env[/sourcecode]. The list is much shorter. … Continue reading

Posted in Bash, SSH | Leave a comment

IE’s problem with overflow is fixed with style=”overflow:hidden;”

Here is what I started with, a hidden div containing data: The data turned out to be too large for the amount of room that I was given to display in. Here is a good write-up, but his plugin did … Continue reading

Posted in HTML, IE | Leave a comment

Parsing Strings to/from Joda-Time

To parse a string into a DateTime object: To output the formatted value of a DateTime object as a String:

Posted in Collections, Java, Joda-Time | Leave a comment