Archive for the 'programming' Category

Using Java’s HttpClient to send a PUT

After a lot of searching the net, I wrote this method a few weeks back to write a string (or file) to a web server using Java’s HttpClient. It seemed ridiculous that I couldn’t find an example to cut and paste. So here it is for the next person.
Cheers.

public boolean [...]

UTF Character encoding in MySQL

I’ve had on going issues with mySQL not defaulting to UTF8 and instead using Latin1 constantly. After searching around a bit on the mySQL forums, I seem to have found a series of settings that put a halt to the problem once and for all. Just add these settings to your my.cnf file:

[mysqld]
default-character-set=utf8
default-collation=utf8_bin
collation_server=utf8_bin
[mysql]
default-character-set=utf8

Cheers

Teamcity status macro for Trac

I had a need to print the build status of our teamcity server in trac. After researching various solutions, I figured a trac macro would best fit. It was a surprisingly simple solution so I figured I would share it here.
I created a file called “TeamCityStatus.py” and placed it into my trac/plugins folder.
from [...]

XSL for Line breaking long words

I spent a few hours searching for, but had no luck in finding this. So I’m posting what I wrote!
This XSL will put a zero length space character into any word longer then 20 characters in any text node of the current XML document.
There is of course always better ways to do things, but [...]

Technology Makes the instrument

The reactable, is a multi-user electronic music instrument with a tabletop tangible user interface. Several simultaneous performers share complete control over the instrument by moving physical objects on a luminous table surface.

.NET Domain Object validation through delegation

Over the years I’ve seen a dozen different ways to validate domain objects in any MVC framework. Everyone has got their own favorite method. I’ve recently been presented with the same problem again and recalled a particularly elegant solution I implemented once in C# that I figured I would share.
The delegate accepts a [...]