JPasskeep and Command-Q on Mac

I've released a new version of my long-running password keeper application: JPasskeep. This new release is now able to handle a Command-Q keystroke on the Mac, giving a user (i.e. me) an chance to save any updated entries. No more mousing around to close a window. The actual mechanism to do this was to reflectively call Apple's EAWT application classes to allow me to register the correct event listener. Hmm, run anywhere with java GUI apps....

Command-Tab and friends on Mac

Most people who work with a Mac know Command-Tab to cycle through currently running applications, but few know of Command-~ (tilde): it allows you to cycle through all the windows of the current application. No more mucking around with F10....

From Java to Groovy

Recently I’ve been playing with some old Java Swing applications and I found myself wishing that I could replace all the anonymous inner-classes with some clean Groovy closures. The job of converting a java source file to a groovy source file is pretty simple and eminently scriptable. Here’s my take on a python script to do just that: from optparse import OptionParser from subprocess import Popen, PIPE import os def rename(src, dest, use_svn): if use_svn: output = Popen(['svn', 'rename', src, dest], stdout=PIPE)....

Logging Guidelines

Logging - this is something we as developers do very badly - perhaps we need to ban the debugger. Unless you've worked in first-line support or in OPS, the only time you ever look at a log file is as a last resort. This is unfortunate, since the last resort may occur when you are trying to figure out why someone has lost money or when your company is about to be sued by a client (usually for losing their money, video, kids photo, etc)....

HTTP method primer for RESTful web services

The following is just a reminder to stop me from getting confused ;-) GET Used to fetch a resource. The server sends back a representation of the resource in the response body. Safe operation (see below). DELETE Used to delete a resource. The response from a server may contain a status message or nothing at all. It is usually nice to send back at least a 204 (No Content). Idempotent operation (see below)....

Reading code Vs searching code

Modern IDEs now allow you to search for a class or a file and go to it from the search results. On my last few projects I've seen developers using this feature almost exclusively rather than navigating their code tree. This is a very nice feature that I really enjoy using but does it have a dark side? I'm an old school hacker and I like to know how my_code is structured - its packages, dependencies, web root folders, output folders for the IDE and for automated build scripts, etc....

Concept To Cash Every Week

Turning on a sixpence - No excuses: Concept To Cash Every Week. Just saw this on InfoQ and it blew my mind. This is what I'm talking about when I mean that details matter and that there has to be a better way to deliver value to a customer. Have got to try the Pomodoro technique on my current project to see if it can improve pairing between developers (er, mostly between me and whomever is unlucky to be pairing with me)....

Using a Samsung TV as an external monitor

Here's a weird bug. I connected my macbook pro to my Samsung widescreen TV - it was detected but I had to select 59.9 as the refresh rate (rather than then autodetected 60) otherwise the TV just sat there with a message that I was using an unsupported display setting. That's fine but how to do this in clamshell mode as macs seem not to share monitor settings between dual monitor mode and clamshell mode (or for that matter a mac mini connected to the same TV)?...

Asynchronous HTML and HTTP

This post is to remind me that the next time that I am asked to consider using AJAX on a project to actually have a more careful think about the project's design and user interaction requirements. If I take the time to look at what I really need to retrieve dynamically then will AHAH do a better job more simply than AJAX & DOM manipulation? Will it make my application easier to test?...

JUnit tests and the file system

Writing unit tests for classes that operate on files has always been a little weird. Every developer & their dog has their own way of either abstracting themselves from the file system (ala Spring’s Resource types) or by creating some sort of a file system sandbox that is cleaned up at the end of the test - after all we don’t want to litter temp directories with files that will never be used again, do we?...