heise.de/developer hat derzeit einen interessanten und umfassenden Artikel zum Thema Single Sign On (SSO) mittels OpenID im Web-Angebot!
Kategorie: Java
Oracle kauft Sun
Sun ist endlich unter der haube. nachdem der deal mit Big Blue IBM geplatzt war, hat nun Oracle zugeschlagen. Siehe prnewswire.com
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.
http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html
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 www.genuitec.com/about/labs.html and www.golem.de/0903/65697.html.
How to install Maven2
There is a great article called „Maven in 5 minutes“: maven.apache.org/guides/getting-started/maven-in-five-minutes
For more information refer to maven.apache.org
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] http://subclipse.tigris.org/update“ 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 eclipse.org/subversive 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;
}
Java: timezone shift / Zeit in andere Zeitzone umrechnen
To calculate a time to another time zone, just
- get a timezone object for the new timezone
- register the timezone object to a formatter
- 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
df.setTimeZone(timezone);
// 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.