Quantcast
Channel: Scratch Where It's Itching
Browsing all 73 articles
Browse latest View live

JComboBox breaks on Exception in ActionListener

We had a bug reported to us the other day, when one combobox suddenly stopped working. You could select any item, the other components would not react to the selection. Looking through the logs, we...

View Article


The Math.Power of Bit Masks

Quite often, you would see lines like these in a program, for defining some bit masks: public static final int BIT_ZERO_MASK = 1; public static final int BIT_ONE_MASK = 2; public static final int...

View Article


For Each Remove

I found this new interesting pattern to loop over all elements of a list in our production code:    try {        for (Object element = myList.remove(0); ; element = myList.remove(0)) {            ......

View Article

SwingWorker is not a Thread

One practical class when developping Swing application is the SwingWorker. It allows you to sart a lengthy task in the background, and then applying the result to the display on the Event Thread. The...

View Article

Print All JVM Flags

I just discovered this very interesting post by Zahid Qureshi. He tells us about a JVM flag, that I never heard about before, that displays all the JVM flags, their default value, and the values that...

View Article


Am I Null?

If Shakespeare were a developer, his Hamlet class' comparison method would probably contain these lines :        if (obj == null)            return (this == null); Found in our production code. The...

View Article

The Uptime Comparator of Death

We have an application that monitors other applications, something like the Windows Task Manager. The developers in charge of this application were given the task to add an uptime column to the table....

View Article

The Calendar HOUR Trap

For the need of some algorithm, a developer wrote this small piece of code that theoretically, from a given Date, will return the same Date but with a time set to the end of the day.    public static...

View Article


Suppressed Exceptions

Thanks to Alexis Lopez and his blog, I discovered a new method that appeared in the Exception class in Java 7: getSuppressed(). According to the JavaDoc, this method was added because of the new...

View Article


Double Salto

A colleague noticed this code yesterday, which is the Java equivalent of jumping a double salto, then falling back at the same place from where you started:  private List allHosts;  public void...

View Article

DevoXX France is over

In the following days, I will try to blog about all the things I learned during these last two days. A pity I could not attend on Wednesday, I missed the part about the Lambda of Java 8.Globally, this...

View Article

DevoXX France - Heaven and Hell

On Thursday, there was a keynote titled "This could be Heaven or this could be Hell", given by Ben Evans and Martijn Verburg, the leaders of the London JUG. It comforted me in my idea that Englishmen...

View Article

Devoxx France - Bytecode Manipulation - Black Magic Democratization

This was a talk given by Julien Ponge and Frédéric Le Mouel, teachers at INSA Lyon, the engineering school that rejected my application a couple of decades ago. So they started with a bad a priori, but...

View Article


Devoxx France - Invokedynamic them all

This talk was given by Remi Forax, teacher at the University of Marnes-la-Vallée, and also part of the JSR dealing with the invokedynamic. He explained a bit about the internals of invokedynamic, and...

View Article

Devoxx France - Arduino - Getting Physical

This talk, given by David Delabassé, was a kind of a treat to me, as it was nothing close to my job, not even close to Java.Arduino is a framework around a small electronic card containing a weak...

View Article


Devoxx France - Google and Murex

These were two separate talks, but coming one after the other, it was interesting to compare how agile programing was adapted to two very different companies. It showed once more that agile can never...

View Article

Devoxx France - The Artist - Developers's portrait

This was one of the keynotes held by Patrick Chanezon from VMWare. The slides were inspired by the movie "The Artist", and told the story of a developer who stops learning new things. This is one of...

View Article


Devoxx France - Abstraction Distraction

Not just a talk but rather a performance by Neal Ford, it warned us against the levels of abstraction we are so used to add over complicated things, so that we forget what lies underneath. It reminded...

View Article

Devoxx France - Improving Resource Utilisation

This was a talk given by the London JUG leaders. They told us how the JVM is getting closer to the harware for better performance, using specialised registers for instance.In this talk, I learned that...

View Article

Devoxx France - Deadlock Victim

This was Heinz Kaboutz's talk, together with Olivier Croisier, the guy who is giving the Java Specialist course in France. They showed us how easy it was to fall in the deadlock trap. For instance,...

View Article
Browsing all 73 articles
Browse latest View live