Lock Dialog Size
9
I came across this in the Java Docs, in my ever growing attempt to learn Java.
I needed to implement custom listener events.
I needed to implement custom listener events.
8
Read a eight bytes in little endian order from the given InputStream and create a long out of them.
9
A utility class that gets the MD5 hash of an input stream. Also includes a method for converting byte array to hex-formatted string.
8
Convert a password returned by JPasswordField::getPassword() into a String.
8
I needed these for a recent project, bits and bytes constants.
-3
I actually like SQL. So, things like Hibernate with it's own query language don't quite fit my style. But, I don't want to code the same catch SQLException conn.close over and over either. So, I came up with this.
The idea is you extend SQLCommand (usually anonymously) override getSql(), and call execute() to get a list of whatever objects you are selecting - all the cleanup stuff is taken care of. It also handles nullable attributes more intuitively using ResultSetWrapper and PreparedStatementWrapper so that in your overridden getRow(ResultSetWrapper rs) method, you can call getInt on a nullable column and have it return null - what a concept! Also I like java.util.Date for my dates, so the wrappers convert to/from java.sql.Timestamp.
Right now I've only bothered with some basic types - it should be pretty clear how to add more if you need em.
See what ya'll think.
Oh, it uses JDK 1.5 Generics, but stripping that away would be pretty easy if you wanted 1.2 compliance.
The idea is you extend SQLCommand (usually anonymously) override getSql(), and call execute() to get a list of whatever objects you are selecting - all the cleanup stuff is taken care of. It also handles nullable attributes more intuitively using ResultSetWrapper and PreparedStatementWrapper so that in your overridden getRow(ResultSetWrapper rs) method, you can call getInt on a nullable column and have it return null - what a concept! Also I like java.util.Date for my dates, so the wrappers convert to/from java.sql.Timestamp.
Right now I've only bothered with some basic types - it should be pretty clear how to add more if you need em.
See what ya'll think.
Oh, it uses JDK 1.5 Generics, but stripping that away would be pretty easy if you wanted 1.2 compliance.
7
Compare two dates in Java.
7
A simple implementation of a Java timer. Executes timer task every second.
6
More often than not, if your trying to work out what's going wrong with your subclass of InputStream, why the character encoding is getting lost in your database, or your file format reader is failing, you'll need to dump a byte buffer out in a useable form.
Here's two methods, one which appends to a StringBuffer, one which simply prints out to System.out
Tim.
(NB: The line: sb.append( "n" ) ; SHOULD have a leading slash ie: sb.append( "\n" ) ; but the formatter seems to remove it...
Here's two methods, one which appends to a StringBuffer, one which simply prints out to System.out
Tim.
(NB: The line: sb.append( "n" ) ; SHOULD have a leading slash ie: sb.append( "\n" ) ; but the formatter seems to remove it...
7
Change logs
-> length calculated from the array
-> charachters will not be repeated in the password
-> length calculated from the array
-> charachters will not be repeated in the password









