Java Image Scaling Algorithm

The following article explains the different pitfalls for image scaling with java quite well. And it includes some code how to do it right.

If you use the multistep scaling flag of the provided helper method, ensure that your server has enough memory.

WebKit Browser-Engine für für Java und Qt

WebKit for SWT (ver. 0.5) is an embeddable Java™ WebKit browser component developed by Genuitec. This component can be used in the development of a wide range of Java SWT applications that require integration of rich HTML5, CSS3, JavaScript and Flash content and functionality.

Find more information at and

How to install Subversion / SVN plugin for Eclipse

To install the Subclipse plugin:

1. In Eclipse, click Help -> Software Updates -> Find and Install…

2. Choose „Search for new features to install“.

3. Click the „Add Site…“ button.

4. Enter „[WWW]“ into the URL field. Click OK.

5. Eclipse will contact the Subclipse site for available plugins. Select „Subclipse“, „Version Control with Subversion“ and click Next.

6. Accept the terms of the agreement, and click „Finish“.

7. The plugins will probably not be signed. You will get warnings. Click „Install“.

8. If prompted, click to restart the Eclipse workbench.

Feel free to visit for a more powerful SVN tool!

Java: get the time of another time zone

public Date getLocalCurrentDate() {
TimeZone timeZone = TimeZone.getTimeZone(„Greece“);
TimeZone defaultZone = TimeZone.getTimeZone(„GMT“);
Date localDate = new Date();
Date yourDate = new Date();
yourDate.setTime(localDate.getTime() + timeZone.getRawOffset() – defaultZone.getRawOffset() – defaultZone.getDSTSavings());
return yourDate;

Erzeugen eines MD5 Hash

Hier eine simple methode, um zu einem String einen passenden MD5 hash zu generieren:

* generates a md5 hash from a string
* @param input – the string the md5 has to generate from
* @return – a md5 hash as a a string
public String getMD5Hash(String input) {
StringBuffer stringBuffer = new StringBuffer(BUFFER_CAPACITY);
try {
MessageDigest md5 = MessageDigest.getInstance(„MD5“);
Formatter f = new Formatter(stringBuffer);
for (byte b : md5.digest()) {
f.format(„%02x“, b);
} catch (NoSuchAlgorithmException e) {
return stringBuffer.toString();

Java: timezone shift / Zeit in andere Zeitzone umrechnen

To calculate a time to another time zone, just

  1. get a timezone object for the new timezone
  2. register the timezone object to a formatter
  3. recalculate the time with the formatter to a string

code sample:

// formatter
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
// local date
Date now = new Date();
// instanciate timezone
TimeZone timezone = TimeZone.getTimeZone(„Japan“);
// register on formatter
// recalculate
System.out.println(„Japan time is:“+df.format(now));

Unix / Linux: was macht mein Prozess?

There are some useful tools to check the load of your box / server – even when you have just only very less permissions (ant ‚top‘ is not available):

  • ptree – all processes with pid
  • prstat – similar to top
  • kill -3 <pid> – print (java) stack strace and dump to log
  • ps -aelf – you sh’d know it. Otherwise: forget your password.