-
Leveraging Lucene
Imagine a catalog of a few hundred thousand items. These items have been labeled into a few hundred categories. Each item can be linked to up to three categories. New categories need to be added in order to make things easier to find. However, categories without content are useless. So some content needs to be…
-
Spring Boot, MongoDB and raw JSON
Sometimes you want to store and retrieve raw JSON in MongoDB. With Spring Boot storing the JSON isn’t very hard, but retrieving can be a bit more challenging. Setting up To start using MongoDB from Spring Boot, you add the dependency to spring-boot-starter-data-mongodb And then you inject MongoTemplate into your class Inserting into MongoDB Inserting…
-
Lessons learned
Pressure makes diamonds, as the saying goes. I worked on a high-pressure project for a couple of weeks (as in, it needed to be done before we even started), and these are some of the lessons we learned as a team. The lessons are mostly tips and tricks, as we learned a lot on the…
-
Class size
Imagine that you need to maintain two applications. Both are about 20.000 lines of code. Now imagine that one has about 10 classes, and the other has 200 classes. Which one would you rather work with? I’ve had discussions about whether you should favor many classes over fewer. When you only take into account the…
-
Javadoc
In our current project there is a guideline that all of the public API must have Javadoc. I disagree with this guideline. Our project does not have a public API, since we’re the only team that works on this project and no other team is allowed to use the codebase. Public classes and methods are…
-
Pomodoro 0.2 released
It has been a while since the first version of this pomodoro tracker has been released. Development has continued, and there have been a few changes: Backported to Java 1.7. Added popup dialog when Pomodori are done, to ask whether to register it as a complete one: Added popup dialog when breaks are done, to…
-
Java 8
On 18 march 2014, Oracle launched Java 8. I’ve had a little time to play with it. Here are my first experiences. Eclipse Eclipse 4.4 (Luna) will get support for Java 8. However, Eclipse 4.3.2 (Kepler) can support Java 8 by installing a feature patch. This page shows how to install the patch. Once installed,…
-
Using JNA to get the active program on Windows
This question on StackOverflow explains how to get the currently active program on Windows. This means, the program that is in the foreground, and receiving user input. However, there’s a lot going on there that isn’t explained. And the code could use a bit of cleaning up. The example uses JNA , or Java Native…