SVG in Confluence

October 5, 2014

We wanted to host an SVG document with clickable links in a Confluence site.

SVG Images

First, we followed the instructions at https://bobswift.atlassian.net/wiki/display/info/How+to+display+SVG+attachments+in+Confluence

  • Go to your Confluence server and find the directory where Confluence was installed.
  • Edit ...

Mercurial Hooks Not Working

September 30, 2014

I had trouble with a Mercurial hook (the integration with bugzilla) that wasn't firing. It was configured as per the instructions in the hgrc file. We couldn't find any sensible reason why it wasn't working, but it just wasn't being called. This respository was running behind ...

Sorting Lists in Java with Comparators

August 31, 2014

I always forget how to write a comparator in Java, so here's an explanation for me to refer to.

You can sort a collection in Java using Collections.sort(), passing in the collection and a Comparator:

List<Person> lPeopleList = new ArrayList<Person>();
lPeopleList.add(new Person("Stephen", 20)); 
lPeopleList ...

Showing .java files in the Browser

July 29, 2014

I have a webserver that serves generated source code - some Java, some Python and some ActionScript. There are also XML schema. This is being served via nginx and each file is downloaded when clicked on.

I wanted to change this so that the file was shown in the browser by ...

Listing Classes in a Java Package

July 18, 2014

I needed to list the Classes that existed in a Java Package. It isn't possible to do this with the default JVM, but there is a third party library called Reflections that can do the job.

Once the library and its dependencies are on the classpath, the following code ...