Trifork Blog

Category ‘Java’

ANWB Big data Proof of Concept

February 9th, 2015 by

At the ANWB people are constantly trying to improve the services they provide. One of these services is to provide traffic information. In the Netherlands the National Data Warehouse for Traffic Information (NDW) provides an enormous database of both real-time and historic traffic data.

This data comes from many different sources and is available as open data. Wouldn’t it be great if the ANWB could use this open data to provide more accurate traffic information, either in real-time or as a prediction for a certain period? In a proof of concept we have collected and analysed the real-time traffic information to calculate the traffic intensity on the roads using elasticsearch. We also used weather information to see if the weather has influence on the need of roadside assistance.

Read the rest of this entry »

Integrating Flyway In A Spring Framework Application

December 9th, 2014 by

flyway-logo-tmThis post is about how to integrate Flyway into a Spring/JPA application for database schema migration. To skip all the preambles and get straight to the instructions, jump to Project’s Dependencies Set-up

Flyway is a database migration tool which helps do to databases, what tools like git/svn/mercurial does for source code…which is versioning. With Flyway you can easily version your database: create, migrate and ascertain its state, structure, together with its contents. It basically allows you to take control of your database, and be able to recreate it across different environment or different versions of the application it runs with, while keeping track of the chronological changes made.
Read the rest of this entry »

How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA

July 14th, 2014 by

Intellij IdeaThis post would look into how to tackle and debug issues in scenarios where they only occur in production (or other remote environment) but not in development environment. As anybody who has been in this kind of situation would acknowledge, trying to pinpoint the cause of these kind of “issues” might quickly end up being a practice at taking shots in the dark: a very time-consuming and inefficient process.

It was this kind of situation I recently found myself, where, I had to rectify certain issues that were occurring in the production environment but could not be reproduced on the development machine.

Fortunately enough, the said issues could be reproduced in the testing environments (which is as close to the production environment as possible). But having the issues reproducible in the test environment was good In that it confirms the issues needed to be fixed, but it was of little help in actually tracking the issues down, finding the cause and fixing it. Relying just on log outputs was not enough…What if I could debug the test environment from my machine?

Read the rest of this entry »

New features in Axon Framework 2.1

February 13th, 2014 by

Recently, Axon Framework 2.1 has been released. It comes packed with improvements and some exciting new features. In this post, I’ll briefly iterate of what’s new in this version.

Furthermore, we have also scheduled a few workshops and trainings.

Read the rest of this entry »

Apportable (a much better alternative to Phonegap) and AFNetworking 2.0

October 22nd, 2013 by

cocoahead_sm2On October 16th I attended CocoaHeads, an iOS developer meetup that is organized every few months by Peter Robinett of Bubble Foundry and other volunteers. Every time it’s hosted at a different location. It was previously hosted at Spil Games, Xebia and NOS. This time it was hosted at eBuddy. The formula is simple: great speakers show up and talk about interesting frameworks, hacks, tricks and so on. During the presentations, attendees can enjoy some free drinks and food.

This was the fourth time I went and it was the best edition yet! That’s why I decided to blog about it this time. I believe this was the best edition because there were talks given by two speakers from San Fransisco: Matt Thompson and Zac Bowling and they talked about some pretty interesting and even mind blowing topics.

Read the rest of this entry »

Windows Phone 8 – C# vs. Java

September 17th, 2013 by

Welcome back to another brand new Windows Phone 8 blog! After I explored the UI and checked out the IDE it is now time to take a look at the programming language: C# or “C sharp”. I want to focus purely on the language itself and compare it to the language I know best: Java. I was surprised how good C# was compared to Java. The syntax of both languages look a lot alike. I want to highlight some of the language features I discovered while writing my first app of which I thought: wow, I wish Java would have this!

Read the rest of this entry »

Hippo CMS Favorite Folders Plugin

July 17th, 2013 by

hippo_logoAfter doing a number of big projects with Hippo CMS, I came up with the idea of creating a plugin. I’m always looking for ways to optimize the user experience as I think user experience is one of the most important parts of a product. Hippo allows you to store your content in a folder structure. In my projects I’ve noticed that most users only use a few folders to work in. Sometimes this folder is located on a deeper level in the folder structure, which makes the user need to click even more before he reaches his content. My plugin allows the user to mark a folder as a favorite folder. A link will be created on the dashboard (the first screen after log-in). Using this link, the user can quickly navigate to that folder. The favorite folders will also be available in the link picker as a separate section. Continue reading to find out how it works!

Download Hippo CMS plugin

Read the rest of this entry »

Checking return values in Java

July 2nd, 2013 by

The other day I made a stupid coding error. It took me the better part of an hour to track it down. We all have those moments. Blame it on a bad night’s sleep, a brain fart, or perhaps the fact that your colleague at the next desk has been whistling that tune from Gotye’s “Somebody I used to know” (you know the one) all day, completely driving you crazy and taking your focus off your code.
Read the rest of this entry »

From the trenches: Rendering Twitter Bootstrap form inputs for Spring-MVC with FreeMarker macros

May 27th, 2013 by

This is the first entry in a new series of what we hope will become a regular appearance on our Trifork blog: “from the trenches”, with blogs that explain in a no-nonsense just-the-tech fashion how we applied certain tools, technologies, libraries and frameworks in our own projects to solve real-world challenges that we faced while building solutions for our clients. We hope that by sharing the solutions we came up with, we can provide you with some examples and ideas that you can apply to your own projects — with the confidence of knowing that these techniques have proven themselves in real production systems.

We are also open to your suggestions on what technologies you might want us to cover. So don’t be shy and just drop us a note if you have any ideas.

In this first blog I’d like to cover how we used FreeMarker to build a small library of macros that make it very easy and effort-free to work with Twitter Bootstrap-based forms in a Spring-MVC application.

TL;DR: we’ve built a set of FreeMarker form macros for Spring-MVC apps with a Twitter Bootstrap-based frontend that allow one-liners in your form templates to render full Bootstrap-based HTML structures for various input types that include internationalized labels and rendering of binding and validation errors while allowing passing in custom attributes and nested contents. It’s awesome.

Read the rest of this entry »

Introducing a Query tool as an Elasticsearch plugin (part 1)

March 12th, 2013 by


In the past few weeks I have been working with Elasticsearch. I was missing a plugin to look at the data, create queries and evaluate different facets. That was when I decided to start working on a plugin that enables you to do just this.

I have been working on AngularJS together with Twitter Bootstrap, therefore the choice as to which technology to use was not a difficult one. I also used some additional libraries, but I’ll tell you more on this later on.

Why did I put the part 1 in the title? I am going to split this information into two parts. This part deals with the setup of the plugin, the libraries I used and the functionality I implemented. Then the next part deals with providing more details about interacting with Elasticsearch; how I use the facets, create the queries, etc. I will also write down some lessons learned with respect to AngularJS in a later blog post.

Now let’s move on and have a look at the features:

Read the rest of this entry »