Neuer Gui-Builder GUIDE -- sehr gut
3 Kommentar(e). Veröffentlicht von Christian Ullenboom am Dienstag, September 22, 2009.Labels: Swing
Eclipse 3.6 M2
0 Kommentar(e). Veröffentlicht von Christian Ullenboom am Montag, September 21, 2009.Labels: Eclipse, Entwicklungsumgebung
Erste Sprachänderung in Java 7
0 Kommentar(e). Veröffentlicht von Christian Ullenboom am Sonntag, September 20, 2009.- http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6840638
- http://download.java.net/jdk7/changes/jdk7-b72.html
- http://download.java.net/jdk7/
Labels: Java 7
Labels: Android, Open Source
Google App Engine SDK 1.2.5
0 Kommentar(e). Veröffentlicht von Christian Ullenboom am Donnerstag, September 10, 2009.Das Update bringt interessante Neuerungen. Dazu zählen XMPP-Unterstützung. http://code.google.com/intl/de/appengine/docs/java/xmpp/:
An App Engine application can send and receive instant messages to and from any XMPP-compatible instant messaging service, such as Google Talk. An app can send and receive chat messages, send chat invites, and request status information. Incoming XMPP messages are handled by request handlers, similar to web requests.
Für Python gab es schon eine API für Aufgaben, die offline abgearbeitet werden konnten. Das gibt es es nun auch für Java, http://code.google.com/intl/de/appengine/docs/java/taskqueue/overview.html.
With the Task Queue API, applications can perform work outside of a user request but initiated by a user request. If an app needs to execute some background work, it may use the Task Queue API to organize that work into small, discrete units, called Tasks. The app then inserts these Tasks into one or more Queues. App Engine automatically detects new Tasks and executes them when system resources permit.
Labels: Open Source, Web Frameworks
Update von Findbugs auf 1.3.9
0 Kommentar(e). Veröffentlicht von Christian Ullenboom am Donnerstag, September 10, 2009.Findbugs http://findbugs.sourceforge.net/ hat die Versionsnummer erhöht und unter anderem neue Detektoren aufgenommen. Von der Webseite:
- New bug patterns; in some cases, bugs previous reported as other bug patterns are reported as instances of these new bug patterns in order to make it easier for developers to understand the bug reports
- BC_IMPOSSIBLE_DOWNCAST
- BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY
- EC_INCOMPATIBLE_ARRAY_COMPARE
- JLM_JSR166_UTILCONCURRENT_MONITORENTER
- LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE
- NP_CLOSING_NULL
- RC_REF_COMPARISON_BAD_PRACTICE
- RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN
- RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED
- SIC_THREADLOCAL_DEADLY_EMBRACE
- UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR
- VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED
- Providing a bug rank (1-20), and the ability to filter by bug rank. Eventually, it will be possible to specify your own rules for ranking bugs, but the procedure for doing so hasn't been specified yet.
- Fixed about 45 bugs filed through SourceForge
- Various reclassifications and priority tweaks
- Added more bug annotations to a variety of bug reports. This provides more context for understanding bug reports (e.g., if the value in question was is the return value of a method, the method is described as the source of the value in a bug annotation). This also provide more accurate tracking of issues across versions of the code being analyzed, but has the downside that when comparing results from FindBugs 1.3.8 and FindBugs 1.3.9 on the same version of code being analyzed, FindBugs may think that mistakenly believe that the issue reported by 1.3.8 was fixed and a new issue was introduced that was reported by FindBugs 1.3.9. While annoying, it would be unusual for more than a dozen issues per million lines of codes to be mistracked.
Labels: Open Source
Thema der Woche: Programmieren mit einem bisschen Geo
0 Kommentar(e). Veröffentlicht von Christian Ullenboom am Mittwoch, September 02, 2009.Die Klasse Locations soll beliebig viele Location-Objekte speichern können. Dazu ist eine addLocation()-Methode nötig, die einen Ort als String mit einer Location annimmt und in eine intern Datenstruktur übernimmt. addLocation() soll überladen sein, dass man einmal den Ort über ein Location-Objekt bestimmt und einmal über Longitude und Latitude. Eine toString()-Methode soll angeben, wie viele Orte enthalten sind. Eine Methode Location findLocation(String location) soll die Location für einen Ort zurückgeben. Schreibe eine Methode List
Schreibe eine Klasse LocationApplication mit einem main(). Füge einige Location-Objekte ein und teste die Bereichsabfrage.
Eine Klasse LocationRepository soll zwei statische Methoden enthalten: Locations loadLocations() und void saveLocations(Locations locations). Die Methoden sollen Locations aus einer Text-Datei lesen und schreiben können. Nutze dazu beliebige Geokoordinaten. Das Dateiformat kann frei bestimmt werden.
Passe die Methode within() an, so dass die Liste sortiert ist nach dem Abstand zum Anfrageort. Schreibe dazu einen DistanceComparator
Modelliere mit NetBeans eine grafische Oberfläche, mit zwei Reitern (JTabbedPane). In dem ersten Reiter soll man drei Textboxen haben für Ort, Longitude, Latitude und einen „Hinzufügen“ Button. Damit sollen neue Orte dem Locations hinzugefügt werden. Auf dem zweiten Reiter soll der Anwender Abfragen vornehmen können. Eine Eingabezeile für ein Ort (oder Longitude, Latitude) und Radius soll zu max. 10 Ergebnissen führen.
Zusatzaufgabe: Installiere Google Earth. Bei einer Bereichsabfrage erzeugte eine KML-Datei mit allen Ergebnissen. Diese Datei soll beim Start von Google Eath als Startparameter mitgegeben werden. Externe Programme startet man mit dem ProcessBuilder. Die Insel gibt ein Beispiel für diese Klasse.
Labels: Die wöchentliche Dosis Java
Latitude/Longitude distance in Java
3 Kommentar(e). Veröffentlicht von Christian Ullenboom am Mittwoch, September 02, 2009.public class LongLatUtils
{
/**
* Calculates the great circle distance between two points on the Earth. Uses the Haversine Formula.
*
* @param latitude1 Latitude of first location in decimal degrees.
* @param longitude1 Longitude of first location in decimal degrees.
* @param latitude2 Latitude of second location in decimal degrees.
* @param longitude2 Longitude of second location in decimal degrees.
* @return Distance in meter.
*/
public static double distance( double latitude1, double longitude1, double latitude2, double longitude2 )
{
double latitudeSin = Math.sin( Math.toRadians(latitude2 - latitude1) / 2 );
double longitudeSin = Math.sin( Math.toRadians(longitude2 - longitude1) / 2 );
double a = latitudeSin * latitudeSin
+ Math.cos( Math.toRadians(latitude1)) * Math.cos(Math.toRadians(latitude2) ) * longitudeSin * longitudeSin;
double c = 2 * Math.atan2( Math.sqrt(a), Math.sqrt(1 - a) );
return 6378137 * c;
}
/**
* Converts latitude and longitude from degrees, minutes, and seconds in decimal degrees.
*
* @param degrees
* @param minutes
* @param seconds
* @return Latitude and longitude in decimal degrees.
*/
public static double convertDegreesMinutesSecondsToDecimalDegrees( int degrees, int minutes, int seconds )
{
return degrees + minutes/60. + seconds/3600.;
}
// public static void main(String[] args)
// {
// System.out.println( convertDegreesMinutesSecondsToDecimalDegrees(38, 53, 23 ));
// System.out.println( distance(38.898556, -77.037852, 38.897147, -77.043934));
// }
}
