Posts

Easily upgrade Java dependencies

Last updated

To start with a cliche: the Java ecosystem continues to develop at a high pace. Various open source frameworks releasing versions, sometimes even multiple versions at the same time. This may quickly turn into a risk But how to deal with it?

Basically, you have two options. We’ll take a typical Maven-project as an example, which uses Commons Lang 3. See the end of this post if you prefer Gradle over Maven.

Automatic upgrades

Maybe the simplest way is automatic upgrading. You can achieve this by not specifying an exact version of your dependency, but instead specify a version range. If you would normally have this snippet in your POM:

Read more... →

Combining Docker and Maven

Last updated

When you’re building Java or JVM-based software, chances are these days you’ll be deploying it inside Docker. Chances also are you’re building it with Maven. Now how do you combine the two? Of course, you could plumb together some scripts for the platform of your choice, but there’s a few disadvantages to that. First of all, it makes you platform-dependant: your build may not work - or behave differently - depending on the platform where you’re building. Secondly, it’s not very elegant, since it does not easily facilitate re-use. And in these days of microservices, we don’t want to be copying the same scripts over and over again. Thirdly, it requires the Docker binaries to be present on the system where you perform your build.

Read more... →

Timing in Protractor tests

Last updated

Ever noticed that annoying error while running your Protractor tests:

Error while waiting for Protractor to sync with the page: {}.

Especially the two brackets are annoying, because they suggest more information might be available but it is just hidden for you.

The good news is, the fix is rather easy. It turns out that Protractor expects your application to have an data-ng-app attribute on the HTML body element.

Read more... →

Mobile emulation in Google Chrome

Last updated

Building a web site or web application that should also be useable on other devices than ‘regular’ desktops or laptops? You don’t always have your mobile device at hand, or might not even own one. Yet, you want to see how your new gem looks on such devices. Worry no more!

Google Chrome to the rescue. We all know the ‘Developer Tools’, accessible using F12. If you press ESC while inside the ‘Developer Tools’, the ‘DevTools console drawer’ appears. Next to a ‘Console’ and ‘Search’ tab, it has an ‘Emulation’ tab.

Read more... →

This method is likely to yield significantly better performance

Last updated

This week, I came across an interesting difference between the Java API documentation and its current implementation. A difference? Or is it just a matter of thorough reading?

If you look at the Javadoc for Double.valueOf(), you’ll find that it is likely to outperform the use of new Double(). Sounds good! And don’t we all ove it when we get a free performance boost?

However, examining the source code to see what causes this “significantly better space and time performance”, we find….

Read more... →

Checking logfiles with logcheck

Last updated

If you own a private server, like me, you’ll probably know the feeling you need to check your logfiles every now and then. It’s not a lot of work, it’s not difficult, but it needs to be done, and it needs to be done regularly.

As for me, the solution is simple. I installed the logcheck tool. This nice little tool will send you a daily email with all logging information on your system. That sounds like an awful lot of spam on a daily basis, but thankfully that is not the case.

Read more... →

IPv6 on Raspbian

Last updated

A default Raspbian installation does not have IPv6 enabled. That’s quite a pity in 2013, where IPv4 addresses will be running out shortly.

Have no fear, it’s not too hard to enable it. Just add ipv6 to the file /etc/modules (it should be on a separate line) and reboot your Pi. If you don’t want to reboot, enable it immediately by issuing sudo insmod /lib/modules/`uname -r`/kernel/net/ipv6/ipv6.ko. Note that after a reboot, you’ll have to re-enable it again, so just change /etc/modules either way…

Read more... →