Webpinstant – Software Search

Posted by & filed under openSUSE, webpin.

A few years ago I wrote a tool called webpin that allowed people to search for openSUSE packages across all openSUSE repositories, both by package names and their contents. This was useful for finding where a package for a particular file was located. openSUSE had an awful lot of separate package repositories (There are now… Read more »

Test Stubbing with Builders, Real Objects, and Caches

Posted by & filed under Uncategorized.

I thought I’d start posting some of my notes on tips for testing. Starting with some tips and tricks for Mockito. Mocking/Stubbing frameworks like Mockito help to test units of code in isolation with minimal boilerplate. A couple of guidelines I like to aim to follow when writing tests are: Each test should assert/verify just… Read more »

Jammer – IRC to Yammer Bridge

Posted by & filed under Java.

Jammer is a quick 1hr project that clones IRC discussion on Yammer. Yammer is a social network for internal use by organisations. It’s a great way to broadcast information and have asynchronous discussion, and simple enough for anyone to use. Developers already have a great forum for asynchronous discussion – IRC. IRC is great for… Read more »

Typesafe Hibernate POJO Queries without code generation

Posted by & filed under Java.

Hibernate is great, but often one has to specify queries as HQL in Strings, or as criteria which allow building of invalid queries. It would be great to use the java type system to help enforce correct queries. I am aware of some tools to do this, but all the ones I have seen require… Read more »

Java Abuse: Inline instanceof

Posted by & filed under Java, Uncategorized.

One annoyance in Java is having to do instanceof checks on multiple lines. e.g. if (object instanceof Foo) { Foo foo = (Foo)object; foo.foo(); }if (object instanceof Foo) { Foo foo = (Foo)object; foo.foo(); } While this is often a sign of a design failure, there are times when instanceof checks are required often due… Read more »

Netbeans on n900

Posted by & filed under Uncategorized.

I meant to post some time ago about how great the n900 is for java development. Not only can one install OpenJDK, but Netbeans is even usable. It’s pretty easy to get running. Just install openjdk6 in the application manager. Then download and run the netbeans installer. It even runs at quite a reasonable speed… Read more »

Java Abuse: public static void main was not invented here.

Posted by & filed under Uncategorized.

Normally a command-line Java application will have an entry method that looks something like: public static void main(String… args) { /* Code that launches the application/deals with command line params here */ }public static void main(String… args) { /* Code that launches the application/deals with command line params here */ } This is far too… Read more »

openSUSE conference – Software Portal Talk

Posted by & filed under openSUSE.

Here are my notes from the software portal talk Pascal and I gave yesterday at the openSUSE conference. The slides we used are also available. What is the Software Portal? Software Portal is a free-software web-application that runs as a service on on opensuse-community.org. It provides both a web-ui and an API. It is possible… Read more »


Posted by & filed under Holiday.

I got back this week from holiday cycling and walking in Switzerland. I cycled down from Basel in the north via Bern and Interlaken to Fiescheralp. Then back via Luzern and Z├╝rich. Fiescheralp is next to the beautiful Aletsch Glacier I stayed in a chalet here for a few days with family and did some… Read more »

Java Abuse – Currency Pattern

Posted by & filed under Java.

Here’s a sillier one from last night… People often complain about not being able to return multiple values from a method in Java. I can’t see a good reason for wanting to do this, but some do. The example I was given was wanting to do: int foo, bar, baz; list(foo, bar, bar) = func(ponies);int… Read more »