Referencing a Bean in JasperReports

Posted on Sat 10 September 2016 in General Software Development • Tagged with Bean, jasperreports, stack overflow

Thanks to this answer on StackOverflow, I know how easy it is to reference the bean itself instead of one of its properties in a text field expression in JasperReports. The trick is to declare a field whose description is set to the keyword _THIS:

<field name="myBean" class="de …

Continue reading

Installing a Tor Relay from Source on a Raspberry Pi

Posted on Sat 03 September 2016 in Uncategorized • Tagged with git, raspberry pi, stack overflow, tor

The other day I learned on Twitter that I should update the Tor relay software on my Raspberry Pi as the Tor project had introduced a new Bridge Authority. So I lazily ran sudo apt-get update  followed by sudo apt-get upgrade only to notice that no new version of the …


Continue reading

Regex for German Zip Codes

Posted on Tue 05 July 2016 in General Software Development • Tagged with regex, zip code

I found the following regular expression (source) working fine for me:

^(?!01000|99999)(0[1-9]\\d{3}|[1-9]\\d{4})$

I tried two alternatives that did not work because they were too general:

[0-9]{5}

^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$

The first regex matches the …


Continue reading

Renewal of Let's Encrypt Certificates Using Plesk

Posted on Tue 14 June 2016 in Sysadmin • Tagged with Apache, certificate, let's encrypt, Plesk, SSL, web server

Note to self: If the Let's Encrypt extension for Plesk fails to renew a certificate (when triggered manually), disable the automatic forwarding to an SSL connection in the Apache settings. This forced secure connection seems to disturb the renewal script.

The error I got was something like this:

Let's …

Continue reading

Create Custom Application Icons for MacOS X

Posted on Sun 01 May 2016 in General Software Development • Tagged with icons, Mac

This blog post by Chris Stevens shows you how.


Continue reading

Testing Delegate Methods

Posted on Fri 15 April 2016 in General Software Development, Testing • Tagged with delegate method, J. B. Rainsberger, JUnit, unit testing

We had an interesting discussion the other day: should we write unit tests for delegate methods, that is, methods that only delegate the call to a delegate object? Here's an example of such a method:

public void do(Object o1, Object o2) {
    delegate.do(o1,o2);
}

I said I did …


Continue reading

Headless Testing with TestFX

Posted on Mon 11 April 2016 in JavaFX, Testing • Tagged with Eclipse, headless, JavaFX, Maven, Monocle, TestFX

Jérome Cambon wrote a nice introduction to TestFX and how to enable the headless mode using Monocle.

I tried to reproduce the steps he described for running my TestFX GUI tests in headless mode from Eclipse so I can keep using my mouse while they are running. The crux is …


Continue reading

A Potential Pitfall with the TextFormatter Class in JavaFX

Posted on Thu 07 April 2016 in JavaFX • Tagged with anchor, caret, cursor, eszett, Java, JavaFX, string conversion, text field, text formatter

A common use case for the TextFormatter class in JavaFX is a text field that should convert any lower-case character input into an upper-case character. This can be achieved easily by defining a filter for the text formatter as described here. A straightforward implementation could look like this:

private UnaryOperator …

Continue reading

The TextFormatter Class in JavaFX: How to Restrict User Input in a Text Field

Posted on Tue 05 April 2016 in JavaFX • Tagged with change listener, event, JavaFX, Richard Bair, text field, text formatter

There are a lot of code examples for restricting or modifying user input into a JavaFX text field. Most examples I have seen suggest adding a change listener to the text field's text property. Here's how you would allow only lower-case characters in your text field using the change listener …


Continue reading

Owncloud with Apache 2.4, PHP FPM, and Plesk

Posted on Mon 04 April 2016 in Sysadmin • Tagged with Apache, HTTP, SSL, Owncloud, PHP, Plesk

After about two weeks of fiddling around, I finally managed to get my own instance of owncloud up and running with Apache behind Plesk. Here's how I did it:

  1. Set up a sub-domain in Plesk, e.g. owcloud.mydomain.com
  2. Set up a database for owncloud using Plesk.
  3. Make sure …


Continue reading