29 July 2008

Querying/Manipulating database schema using MetaModel

Quickly scanned this libarary, MetaModel, looks like it provides a useful domain model for databases, e.g. Database, Schema, Table, Column, Index etc. Its a pain querying/manipulating this information from JDBC. It also abstract different types of database, e.g. sql, csv.

Top 10 Java Performance Troubleshooting Tools | Javalobby

28 July 2008

Del.icio.us rss feed limited at 15

I use del.icio.us for bookmarking and have a number of tags as Firefox live bookmarks. E.g:


Recently I found that each tag was only displaying the last 15 entries, it looks like del.icio.us have reduced the default size for rss feeds. To get round this just change the live bookmark url to include "?count=maxNumberOfEntries", e.g:


21 July 2008

Java wishlist - disable foreach on lists

The foreach loop will iterate a list using an iterator rather than by get(int) access. This is less efficient when called many times in tight loops. I wish I could easily detect when foreach has been used on a list.

Java wishlist - error on number overflow

I've often worried about numbers overflowing in my code, whether longs, ints or doubles. I would like to force an error to be thrown if any numbers overflow in my code. I would need to be able to set this on a class or package basis, so that I can still allow libraries that are included in my code to overflow if they wish.

Java wishlist - immutable arrays

Over the last x years I often found myself wishing for various features, thought I'd get them down in written form so I don't forget. As they come back to me I will jot them down.

An immutable array would throw an exception if anyone tried to change the reference at any one of its elements. This would allow one to return the array from a method invocation without having to defensively copy it. Of course, since Java 5, with generics, you can return typed lists that throw an error if modified.

18 July 2008

Java Native Access (JNA): Pure Java access to native libraries

jna: Java Native Access (JNA): Pure Java access to native libraries
JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code--no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation. JNA's design aims to provide native access in a natural way with a minimum of effort. No boilerplate or generated code is required. While some attention is paid to performance, correctness and ease of use take priority.

04 July 2008

FIX message dictionary

FIX Dictionary from Onix Solutions is an excellent resource that describes each message type in detail.

Motivations when writing tests

Wasn't much for me to read in My Unit Tests Are Purer Than Yours, but for an excellent quote which points out that integration tests are probably more important the unit tests:
And so, if we heed the saying "a good test is one that finds a defect", then where are we going to get the most bang for our buck? Testing very simple rules in isolation? Or testing this extremely complex interaction of rules within the framework. Obviously the latter is exponentially more likely to turn up issues and thus make for the better test!

Robust Java benchmarking

Brent Boyer has written a comprehensive set of articles on benchmarking Java code.

Robust Java benchmarking, Part 1: Issues, Understand the pitfalls of benchmarking Java code

Robust Java benchmarking, Part 2: Statistics and solutions, Introducing a ready-to-run software benchmarking framework

Understanding the closures debate