fredag den 18. december 2009

Continious Integration

Today I have install my first system for continious integration (CI). Initially I thought that I would be using Cruise Control. Mainly because it is used on the Fortres project which I have been involved with, so I know that it works well. However I have never installed it myself, or configured it.

I downloaded Cruise Control and got it running the accompaning example within minutes. But trying to add my own java project in a mercurial project wasn't as easy as I would have liked. A colleage of mine suggested that I looked at a CI system called Hudson, and I liked what I saw. It prmissed Web interface for defining builds, easy setup, and easy integration with mercurial.

I downloaded Hudson, and within minutes I had it running my own java project from a mercurial repository. Building every 5 minutes and when changes where discovered in the repository.
It is as easy as java -jar hudson.war --httpPort=7000 to get it running on a non standard port (the default is 8080). Then go to http://localhost:7000 where you find the Hudson dashboard. From the dashboard you can easily create build jobs.

I am no expert on CI but Hudson seems like a great system and not only for Java. Also Hudson supports distributed builds.

All in all, I like what I see.

mandag den 4. maj 2009

Python setlocale on Windows XP

In a development project we had some problems with guessing the correct locale string on Windows XP, and there seems to be no copy'n'paste solution on the web, so here it is:


# Import sys packages.
import locale
import os


local = 'da_DK' # Danish locale unix: 'da_DK'
if os.name is "nt":
    local = "Danish_Denmark"
# Danish locale on Windows: "Danish_Denmark" or "Danish"




 

locale.setlocale(locale.LC_ALL, local)


See the following links for inspiration on how to guess your locale:

http://msdn.microsoft.com/en-us/library/hzz3tw78(VS.80).aspx 

http://msdn.microsoft.com/en-us/library/39cwe7zf(VS.80).aspx