Java 8 Änderungen an BigInteger: intValueExact(), longValueExact() und shortValueExact()

Die Methoden intValue(), longValue() der Klasse BigInteger (und shortValue(), was aus BigInteger aus Number erbt) liefen ein int/long/short des repräsentierten Werteobjekts, jedoch ist nicht zwingend, dass die Werte in den Datentyp int/long/short passen; falls nicht, werden sie einfach wie bei einer expliziten Typanpassung abgeschnitten. Die in Java 8 eingeführten Methoden intValueExact(), longValueExact() und shortValueExact() lösen eine ArithmeticException aus, falls der vom BigInteger repräsentierte Wert nicht ohne Verlust in den primitiven Datentyp passt.

http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/2a8072c7cf99

Google App Engine 1.5.5 freigegeben

Von http://code.google.com/p/googleappengine/wiki/SdkForJavaReleaseNotes:

  • We have increased the number of files you can upload with your application to from 3,000 to 10,000.
  • We have increased the size limit for a single file uploaded to App Engine from 10MB to 32MB.
  • We have increased the Frontend request deadline from 30 seconds to 60 seconds.
  • We have increased the online URLFetch maximum deadline from 10 seconds to 60 seconds. The default deadline remains at 10 seconds. The offline maximum deadline for URLFetch remains at 10 minutes.
  • We have increased the URLFetch Post payload from 1MB to 5MB.
  • App Engine now supports Cross Group (XG) transactions with the High Replication Datastore, which allow you to perform transactions across multiple entity groups. http://code.google.com/appengine/docs/java/datastore/transactions.html
  • We have added a graph to the admin console that displays the number of instances for which you will be billed.
  • In the XMPP API, getPresence() is deprecated in favor of using the inbound presence handlers documented inhttp://code.google.com/appengine/docs/java/xmpp/overview.html#Handling_User_Presence.
  • Fixed an issue in the Admin Console where the "Run Now" button did not work for tasks with a ‚-‚ in the name.
  • Fixed an issue to provide a better error message when a user tries to parse an HttpRequest’s input stream more than once in a request.
  • Fixed an issue to provide a better error message when using the Mail API to send email to an invalid user address.
  • Fixed an issue in the SDK where HttpServletRequest.getInputStream().read() always returned -1.http://code.google.com/p/googleappengine/issues/detail?id=5396
  • Fixed an issue where you could not schedule a cron job to run every 100 minutes.http://code.google.com/p/googleappengine/issues/detail?id=5861

Ein paar weitere Details: http://www.infoq.com/news/2011/10/Google-Cloud

PSP Emulator in Java (jpcsp)

Java ist langsam? Nee, denn sonst würde man keinen PSP Emulator in Java programmieren, sondern in C(++)! Doch das Projekt http://jpcsp.org/ (bzw. http://code.google.com/p/jpcsp/) zeigt wieder einmal, wie leistungsfähig Java (plus ein paar nativer Bibliotheken) ist. Die Emulation ist modernen Spielkonsolen ist schwer, da sie mit spezieller Hardware vollgestopft sind, auch wenn die Prozessoren nicht wie in moderne PCs in Gigahertz-Bereich laufen. Die PSP hat mit einem auf MIPS 4000 basierenden RISC-Prozessor und einen “Media-Engine”-Chip, die JPCSP ausgezeichnet emuliert, was an die 300 Speile ausführbar macht: http://www.emunewz.net/forum/forumdisplay.php?fid=65. Der Code greift für die Media-Low-Level-Operationen auf http://lwjgl.org/ zurück. Es steckt sonst noch nativer Anteil drin, etwa für Raw-Sockets (das sind Sockets mit allen TCP/IP-Informationen, also auch den Headern, nicht nur den Transportdaten selbst, http://www.savarese.org/software/rocksaw/) oder eine Bib. namens Xuggler, was ein Java-Wrapper für FFmpeg ist.

Neue JavaFX-Version (build 42), mal wieder API-Änderungen

Download unter http://javafx.com/. Änderungen betreffen wohl nahezu jedes Hauptprogramm, denn setVisible(true) wird zu show() und setVisible(false) zu hide(). Das ist natürlich super ungewöhnlich, da AWT genau den anderen Weg gegangen ist, und eben Bean-Methoden einführte. 2.: Die Builder sind in ein andere Paket gerutscht, so fällt weg: import javafx.builders.SplitPaneBuilder;
Achtung: Die Online-Doku ist im Moment noch nicht auf dem neusten Stand.

Wicket 1.5 jetzt raus

Siehe http://wicket.apache.org/2011/09/07/wicket-1.5-released.html.

Most notable changes

With this release the Wicket team has revised many of its internals. A short list:

  • HTML5 components added: EmailTextField, NumberTextField, UrlTextField and RangeTextField
  • New inter-component events (explained below)
  • Minimum required servlet API is servlet-api 2.5
  • All standard validators now extend Behavior to allow for client side validations
  • IBehavior has been removed and AbstractBehavior has been deprecated, you should now extend Behaviorinstead
  • Simplified the request cycle processing and made it more extensible
  • URL handling is now in one place
  • Wicket’s rendering code has been greatly simplified
  • Improved browser caching support
  • ClientSideImageMap replaces old ImageMap
  • Better support for running behind proxies with x-forwarded-for header
  • Request cycle listeners make it easier to integrate frameworks in your Wicket application
  • Consistent naming: methods with Javascript in the name have been renamed to use proper capitalization:JavaScript
  • Switching to HTTPS is as simple as configuring a new root mapper to make Wicket HTTPS aware and annotating a page with @RequireHttps

A longer list of changes and improvements can be found in our migration guide.

Gastbeitrag: AWT-Schwergewichte nach vorne, bitte!

Der Code hinter Container.add(Component comp) hat sich immer wieder gewandelt, und lange Zeit war es problematisch, AWT- und Swing-Komponenten zu mischen. Seit Java 7 stellt das AWT jedoch jede mögliche Kombination von beliebigen Komponenten zuverlässig dar – den zusätzlichen Rechenaufwand bekommt jeder zu spüren, der etwa versucht, eine JScrollPane mit 50.000 JLabels zu bestücken.

Weiterlesen

Tester für einfache iCalendar Klasse gesucht

Für alles rund um iCal ist http://wiki.modularity.net.au/ical4j/index.php die Standardlösung. Allerdings ist mir das zu fett und hat auch noch diverse Abhängigkeiten. Daher habe ich mir eine einfache Klasse gebaut, die iCal-Dokumente für Events erzeugt.

String s = new ICalendar()
            .start( new Date() )
            .end( new Date() )
            .summary( "Ba,st;ille\\ Day Party\näöß" )
            .toString();
System.out.print( s );

erzeugt:

BEGIN:VCALENDAR

VERSION:2.0

PRODID:-//tutego//NONSGML ICalendar//DE

BEGIN:VEVENT

DTSTART:20110904T200944

DTEND:20110904T200944

SUMMARY:Ba\,st\;ille\\ Day Party\näöß

END:VEVENT

END:VCALENDAR

Möchte das jmd. testen und mit Tipps geben?