July 2009
4 posts
Moving to WordPress!
I want to have comments on my blog posts, but implementing them on Tumblr is just a pain in the butt. Apparently, Tumblr was never designed to handle this - serves me right for not thinking it through. Take a look below my posts here - you might spot a diminuitive ‘comments’ link which I have crow-barred in using Disqus, but it looks truely, truely awful.
So, you can find my future...
Developer's Nirvana
Coding is easy. You have a specific, small problem (usually a large problem broken down into small units), you have a first try. Think, write a test, test fails, write some code, fix it when it goes wrong (it almost NEVER works first time!), see the test go green. Rinse, repeat.
Software development is hard, because it requires more than code - it requires organisation, discussion, debate,...
Creately for the win!
Gliffly Creately
A while ago I touted Gliffy as a great free easy-to-use online diagramming tool perfect for those little diagrams you may need from time to time but you havn’t got access to Visio (the daddy of diagramming).
Now there is Creately (currently in beta), which after trying I can say is a lot neater, cleaner and even easier to use! It has a pretty good set of features...
SqLite in-memory testing for Fluent NHibernate
I love Fluent NHibernate, it’s so readable and clean. But I found getting it configured (using the new Fluently.Configure() method) to play nicely in integration tests against SqLite in-memory database a bit of a challenge. The problem was working out how SqLite in-memory databases behave (they are destroyed when the connection is closed), and how to export the schema into the in-memory...
June 2009
5 posts
Printing in Java
Printing is often a desirable feature for an application, but not something you want to devote a lot of time implementing. You just want to print a component. Unfortunately, the standard Java SE library from Sun only offers only very low-level access to the printing API.
This does allow flexible and powerful control, but (as I found out) it also means that carrying out simple printing tasks can...
Unit tests, mocking and DI in Java
I have recently been investigating dependency injection (DI) and unit testing using mock objects in Java. After browsing advice on Stack Overflow and trying out various frameworks, I have settled on my favourite stack:
Dependency Injection: Guice. It was either Guice or Spring, but don’t want / need all the other stuff bundled with Spring. Nice and lightweight, and simple.
Unit tests:...
Online workspaces for project management
I’m really excited about the future of software as a service, and looking forward to the big fight between Google (e.g. Google Docs) and Microsoft (e.g. Office Live) for dominance of the online software market. Project management seemed a great candidate for an online service, so I’ve signed up for an Assembla account to try the concept out. So far I love it, here are the main things I...
Optimisation benchmark results
In an earlier post I outlined some options for optimising a bottleneck in a system I am working on. Some basic benchmark results:
Original box query times:
8141 milliseconds - queried all boxes in March
8093 milliseconds - queried all boxes in February
8110 milliseconds - queried all boxes in January
8063 milliseconds - added a new box and queried all boxes in January (again)
7953...
May 2009
9 posts
'Copy Local' in Visual Studio
Trying MySql with NHibernate for the first time. On the first run, I got:
Could not create the driver from NHibernate.Driver.MySqlDataDriver
For some reason, when I referenced the MySql Connector-Net in my project, it’s ‘Copy Local’ attribute was set to false (usually false is only set on System DLLs that will definately be in the GAC). Setting it to true fixed my problem.
Gliffy for the win!
Sometimes Visio is a bit too much. Diagrams are often used to sketch things out, not get too detailed. With Visio it’s easy to get carried away adding detail which you dont need, and will probably change anyway.
Enter Gliffy - it’s free (the basic account), it’s online, and it’s decent - does all kinds of diagrams. Nice.
Database optimisation and benchmarking
A project I have been working on has a database table of boxes (1 row for each box), a table of files in each box (anything between 10 and 50 rows for each box), and a table of file sections for each file (usually 3 sections per file).
At one point in my code I get a list of all boxes added within a given date range and display it along with a file count (how many files in the box). When I...
Installing Apache 2.2, SSL and PHP5 on Windows 7
Having installed the new Windows 7 Release Candidate at home, I now need to re-install my Apache-PHP-SSL setup I sometimes use to make sure it works okay on the new OS. It seems no matter how many times I do this, it never seems to take under 2 hours - there’s always some file i haven’t copied or some setting I haven’t set in a conf file. It always seems to take ages of sifting...
Publishing an MSI using Ant in NetBeans
In times of flux for my Java desktop apps (e.g. lots of new features or bug fixes) I used to spend a lot of time manually editing configurations for my favourite installer program (Caphyon Advanced Installer) to build MSIs, doing the same things over and over, incrementing the version number. Enough. As part of my new-found customised NetBeans builds (see earlier posts) I decided to automate this...
Using Ant-Contrib with NetBeans builds
Having learned NAnt first, it was dissapointing to realise that Ant lacked certain core tasks that I have become familiar with in NAnt. Luckily a community maintains a library, Ant-Contrib, which you will probably want to use if you are working with complex builds.
The recommended way to use Ant-Contrib is to put it in the lib directory of the Ant installation. If you are using NetBeans, which...
Determining NetBeans project configuration from...
NetBeans allows you to define projects configurations (e.g. debug, release, live, dev, whatever), so you can easily switch things like your Main class and arguments and arguments to the JVM. I typically use at least a ‘Dev’, ‘Staging’ and ‘Live’ configs.
Now I am customising my NetBeans builds, I need to determine what config the project is in. There was zero...
Customising your build in NetBeans
Build scripts used to be a black-magic art to me, practised only by guru-like coders. Clicking ‘build now!’ on whatever IDE I’m working on used to be enough. Luckily I have now seen the light of Ant and its .NET cousin, Nant, and now I can’t stop tinkering! And my work flow process has much less friction than it used to.
So now I’m going to customise my NetBeans...