Posted by Simon Pither
Sun, 21 Feb 2010
In the car on the way home from a birthday party, Liz and I are trying to remember names of a few people who we all met for the first time...
I suggest one was called Paul, Liz thinks he was John, but actually John was Letty's sister's boyfriend and Paul was in fact; Paul.
Hmm, but what was Letty's sisters name?
One of her sisters was called Kitty, we can both remember that one.
"Edward, can you remember what Letty's sister is called? Not Kitty but the other one. The one who arrived late."
(A short pause for thought)
"Molly."
"Ah, yes, that was it. Thank you Edward!"
Posted by Simon Pither
Tue, 16 Feb 2010
I'm not convinced this will apply to many of the people who read this, but if you know someone in an unsigned band who fancies a chance of playing at this years FIB festival in Spain, then SupaJam's Fast Track to FIB contest has now opened it's doors.
We've only just put the contest live and the official PR launch isn't due for a little while yet, so you're now among a privileged few with early notice!
Posted by Simon Pither
Mon, 1 Feb 2010
I ended up reading the Grails code to figure this out, so I thought it might be useful to record.
One of the projects that I recently upgraded to Grails 1.2 makes use of Groovy HTTP-Builder. If you just pull in HTTP-Builder you'll quickly find that it's dependencies break your grails project. So under 1.1.1 and using maven, I had this:
<dependency>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
<version>0.5.0-RC1</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
New in Grails 1.2 is dependency management via conf/BuildConfig.groovy. There are lots and lots of examples around for how to define dependencies, but significantly less on how to exclude dependencies of those dependencies. So here's mine:
dependencies {
compile('org.codehaus.groovy.modules.http-builder:http-builder:0.5.0-RC1') {
excludes 'groovy', 'xml-apis'
}
}
The thing that caught me out was that there's no groupId specified on the excludes, only an artifactId.
Something else I noticed while reading the dependency code was that the dependency string matching is very limited. Only three parts (groupId:artifactId:version) can be matched. None of the other (ie type or classifier) maven parameters are supported.
Posted by Simon Pither
Sun, 31 Jan 2010
Just imagine that you have a list (a long list) of names in a spreadsheet (no, it's not suitable for export and processing as a CSV) that are unhelpfully in the wrong format. In my case they looked like "FredBloggs" instead of "Fred, Bloggs".
If you happen to be using a decent, open spreadsheet this is easy to fix as there's a "Regular expressions" checkbox on the Find and Replace dialog.
However if you're stuck with a proprietary spreadsheet life is a little harder. Excel has VB hiding in there somewhere though, so it had to be possible. Thankfully the Internet knows all and someone else has already written the code. Just to make sure I don't loose it, I'm going to reproduce the bit I found useful here:
Option Explicit
Function ReReplace(ReplaceIn, _
ReplaceWhat As String, ReplaceWith As String, Optional IgnoreCase As Boolean = False)
Dim RE As Object
Set RE = CreateObject("vbscript.regexp")
RE.IgnoreCase = IgnoreCase
RE.Pattern = ReplaceWhat
RE.Global = True
ReReplace = RE.Replace(ReplaceIn, ReplaceWith)
End Function
Once that had been added to my spreadsheet as a module, I could use something like this to do my conversion:
=ReReplace(A3, "^([A-Z][^A-Z]+)([A-Z])", "$1, $2")
Yes, groups and back references are all supported (as they are in the Open Office find and replace dialog)!
Having copied the new cell down a whole column I had my results. All that remained was a copy/paste of the values to overwrite the originals with the corrected formatting.
Posted by Simon Pither
Sat, 30 Jan 2010
Following the recent release of Grails 1.2.0 I've attempted to upgrade a few of the projects I work on. Some of these attempts have gone better than others.
For one of the simpler ones I only hit two problems.
Combining Acegi with Enum's defined in the same source file as domain objects no longer works. The grails bug is here and thankfully the workaround is easy - just pull all the Enum's into their own files.
Due to some of the performance improvements that Grails 1.2 makes around it's handling of GSPs and Sitemesh, the addProperty() function no longer works correctly
Unfortunately the second problem was not so easy to work around. It does however have a fix committed to the 1.2.x branch of development code. So how do you get that then? Here's what I did:
$ git clone git://github.com/grails/grails.git grails
$ cd grails
$ git checkout origin/1.2.x
You'll get some warnings about not being on a branch, but assuming you just want to build it and not modify it, you can safely ignore them.
$ ant package
You'll obviously need ant and a suitable java compiler ready to go before running this last step.
After a couple of minutes you should have a dist/grails-1.2.1.SNAPSHOT.zip file which you can unzip/install in just the same way you would a download from the grails site.
Only thing left after that is to "grails upgrade" your project again to set it to the 1.2.1.SNAPSHOT version!
Posted by Simon Pither
Wed, 6 Jan 2010
One (probably the only one I've found so far actually) of the benefits to getting up at 6am, is that when you later discover there's 5 inches of snow on the road outside and decide it's not very sensible to try driving in it, you have time to build a snowman instead...


Posted by Simon Pither
Tue, 13 Oct 2009
Having observed a sample of two(!) I have reached the conclusion that girls really can multi-task... but that's not always a good thing.
When Edward was very small he would get hiccups a lot. Sophie got them slightly less often but still enough to have noticed a repeating, and different pattern between the two of them.
When Edward got hiccups you could easily cure them by getting him to have a drink. After a few mouthfuls he would be fully focused on the milk and have forgotten all about the hiccups, which would then cease quickly.
Sophie on the other hand seems perfectly capable of drinking a bottle of milk while maintaining hiccups all the way through!
So there you have it; curing hiccups requires dedication and focus (plus a good drink), which apparently boys can do better than girls! ;-)