New Release of MT4E

24. August, 2011

Note: This post is now obsolete since there is a newer release.

I just finished a new release of Maven Tools 4 Eclipse. It’s not written in Groovy and supports all the features of the old Python version plus a few new ones.

You can find instructions how to use it on the wiki page.

For now, you need to build the tool from source (which needs 1.4-SNAPSHOT from DecentXML) using Maven. I’m in discussion with the people at Eclipse to get a download link for the binary.

Update: The project page now has a download link.


KDE4: Running ssh-agent at Login

21. August, 2011

Here is the recipe if you need to run ssh-agent when you log in. First, create a start-up script $HOME/.kde4/env/start-ssh-agent.sh

#!/bin/sh
eval `/usr/bin/ssh-agent`

To make sure the agent is killed when you log out, you need a script $HOME/.kde4/shutdown/kill-ssh-agent.sh

#!/bin/sh
/usr/bin/ssh-agent -k

Tested with KDE 4.7 on openSUSE 11.4.


Suffering From Nepomuk, too?

20. August, 2011

Nepomuk is probably a suitable name for the tool suite. The name is related to the  “Pumuckl” which was a gremlin that causes all kinds of grief and havoc. I think the name is suitable since that’s what the Nepomuk framework and all related tools always did for me: Cause grief.

Either they locked up my computer, crashed my KDE session or hogged some resource (CPU, RAM, hard disk). Just now I installed this sh…software on a new laptop where it effectively prevented me to log in.

Trying to be proactive, I created a bug. Vote for it if you hate Nepomuk, too.

Rationale: We have this stuff several years to grow up. Apparently, it’s not happening.


HTML5 Boilerplate

18. August, 2011

There is a lot which you can do wrong when starting a new web site from scratch. The HTML5 Boilerplate project tries to help you there.

It contains a sane project layout, many useful JavaScript libraries, a default CSS that will make your page look the same on (almost) any device and smart CSS selectors that allow you to work around problems with browsers and devices which don’t behave well (small screen, IE6 bugs, no JavaScript enabled, you name it).


JavaScript Inheritance

17. August, 2011

Here is a comprehensive list of ways to support inheritance in JavaScript.


Useful JUnit Helper Method: ignoreUntil()

16. August, 2011

We all know the pattern: A test fails but you can’t fix it right away. What do you do? Let it stay red? @Ignore it?

All those approaches have drawbacks. Red tests make me nervous. But when I add an @Ignore, I sometimes forget to remove it in a timely fashion. Enter stage ignoreUntil():

/**
 * Ignore a test until a certain date.
 *
 * <p>This method will make the test silently fail
 * (as if it had been ignored) until a certain
 * date.
 *
 * <p>For documentation purposes, you can give a
 * message that explains why it's ignored.
 */
public static void ignoreUntil(
    String date_YYYY_MM_DD,
    String message
) {
    Date date;
    SimpleDateFormat format
        = new SimpleDateFormat( "yyyy-MM-dd" );
    try {
        date = format.parse( date_YYYY_MM_DD );
    } catch( ParseException e ) {
        throw new RuntimeException(
            "Can't parse date [" 
            + date_YYYY_MM_DD
            + "] using format "
            + format.toPattern()
        );
    }
    Assume.assumeTrue( new Date().after( date ) );
}

Usage:

@Test
public void someTest() throws Exception {
    ignoreUntil( "2011-09-15", "See issue #78" );
}

Happy testing!


Java Tools For Healthy Code

12. August, 2011

While any good developer makes sure that his code is healthy all the time *cough*, tools can be a lot of help.

Venkatt Guhesan has compiled a list of 11 tools that you should know about.


MercurialEclipse 1.8 With Mercurial 1.9 On Ubunutu

10. August, 2011

The MercurialEclipse plugin doesn’t play well with the latest 1.9 release of Mercurial.

If you’re on Ubuntu, you can replace the “mercurial” package with “mercurial-1.8” to get the old version back (see Launchpad packages). Thanks go to Max Bowsher for a quick solution:

sudo aptitude install mercurial-1.8

Saving Colors

10. August, 2011

Many people own color printers today; they are so cheap, there is little point to buy a B&W model.

But I don’t want to print with color by accident. If you’re using Linux with CUPS, here is a solution: lpoptions

“lpoptions -l | grep -i color” will tell you what the color options and possible value are. My output looks like this:

ColorModel/Farbmodus: *CMYK Gray
Colorreprod/Farbwiedergabe: *Printersettings Textgraph Textphoto Vivid Publications Lineart
MediaType/Media Type: *PrnDef Auto Plain Transparency Labels Letterhead Bond Color Preprinted Prepunched Recycled Cardstock Vellum Envelope Rough Thick CoatedPaper Highqlty User1 User2 User3 User4 User5 User6 User7 User8

To change the default, use “lpoptions -o”:

lpoptions -o ColorModel=Gray

The first command tells you the new default:

ColorModel/Farbmodus: CMYK *Gray

CUPS saves these settings in the file ~/.cups/lpoptions.

Related articles:


Martin Fowler Chimes Into Chorus Against Software Patents

9. August, 2011

In his post “Martin Fowler on Software Patents“, Martin Fowler joins the growing group of people who argue against software patents in their current form.

Related: