Cloud Conference for Java Developers
Posted by Sébastien Stormacq in Java on 23/06/2010
Next week, Wednesday, 30th the Luxembourg Java User group (YaJuG) will organize a conference : “The Cloud for Java Developers”.
With speakers talking about Amazon Web Service, Google App Engine and SalesForce.com platform, this conference will bring you insights the various major cloud platform types : Infrastructure, Platform or Software as a Service.
This event is sponsored by Lancelot Consulting.
Detailled agenda and registration is available on YaJuG’s web site.
Maxi80 App for iPhone – new release
Posted by Sébastien Stormacq in iPhone on 22/06/2010
We just released the updated version of Maxi80 Application for iPhone. This new version is available for iOS 4 phones only, you’ll have to update your phone software to find and install the update.
This new version brings the following new features :
Do not hesitate – Update today ! |
How to remotely capture a core dump on a Mac ?
Posted by Sébastien Stormacq in Mac OS X on 21/06/2010
Mac OS X is usually a very stable OS, over the last 10 years I can count on my fingers the rare number of cases when the system entirely crashed and required a reboot.
(I am not counting the deliberate attempts to make it crash , playing with development version of kernel modules or very very early builds of all kinds)
Since a couple of months however, I am able to crash the entire system just using iTunes.
When downloading multiple files simultaneously or when starting any type of concurrent disk access for several minutes, iTunes freezes, bringing the whole system down with him.
It looks like this is linked to my type of machine (iMac 24″) as I can not reproduce on any other three machines at home. I am not the only one experiencing this issue. Apple’s support forums host a thread here and another here with people describing exact similar symptoms (some of them with PowerMacs too)
As I am part of the Apple developer Program, I opened a bug report to request attention about this.
Surprisingly, Apple answered with 2-3 weeks asking for more details, in particular, a stack trace of the system while in frozen state.
Stackshot can be enabled as follows:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.stackshot.plist
Then, type the following chord:
Control-Option-Command-Shift-Period
a file will be written out /Library/Logs/stackshot.log and a symbolized file will be written to /Library/Logs/stackshot-syms.log
Unfortunately, this does not help in my case as the whole system was unresponsive when the crash occurs, I have no possibility to type any command while the system is frozen.
Apple then asked me to produce a core dump, using Non Maskable Interrupt trigger and a remote core dump server.
Basically, the idea is to configure the kernel to let it send a core dump to a remote server, through the network. On another machine, you’ll have to setup the core dump server, i.e. a process that will listen on the network, will accept the connection from the crashed kernel and will dump the data to a file on disk.
Once the kernel client and the core dump server configured, you need to tell the kernel to generate the data and send them to the remote server. For this top happen, you’ll need to force a panic with DTrace for example.
But in my case, the kernel is not panicking, just freezing.
I had to generate a Non Maskable Interrupt to activate the debugging process. Once properly configured as described in Apple Technical Note, this is a simple as shortly pressing the POWER button.
This method is explained with many details and options in Apple technical Note TN2118. It is surprisingly easy to setup and allows to collect valuable debugging information for developers. I am attaching a screen shot of the crashed machine while in this state.
I hope Apple will be able to provide a fix for this issue.
NetBeans 6.9 is released
Posted by Sébastien Stormacq in Java on 16/06/2010
Java Communities (and Oracle development teams) have been kept busy these days. After the release of GlassFish Open Source Edition 3.0.1 yesterday, the NetBeans team announces the availability of NetBeans 6.9.
Major new features include
- JavaFX Composer, a visual layout tool for visually building JavaFX GUI applications, similar to the Swing GUI builder for Java SE applications
- OSGI Support
- JavaFX SDK 1.3,
- PHP Zend framework,
- Ruby on Rails 3.0,
- and many Java Editor, Debugger and issue tracking enhancements.
With a download footprint of 52 Mb (28Mb for the PHP only edition), NetBeans remains the most efficient general purpose IDE.
GlassFish Open Source Edition 3.0.1 is released
Posted by Sébastien Stormacq in Java on 15/06/2010
The GlassFish community announced today the immediate availability of GlassFish Open Source Edition 3.0.1
Quoted from GlassFish web site : “GlassFish 3.0.1 is built on a modular, flexible runtime based on the OSGi standard. It enables organizations to create and deploy Web applications with the lightweight Java EE 6 Web Profile and to easily leverage the power of the full Java EE 6 platform for enterprise applications. Developers also benefit from the simplified programming model and productivity improvements offered by Java EE 6. The result is a flexible platform that can apply only what is needed to address the business problem, thereby reducing cost and complexity”
GlassFish is released under a dual CDDL and GPL v2 license.
GlassFish Open Source Edition is supported by the community (mailing lists, forum and documentation wiki). Oracle is expected to release in the next few days an equivalent commercial version, GlassFish Enterprise Server 3.0.1.
If you are curious to know were the GlassFish community is going and what is brewing for next releases, be sure to read the roadmap.
Developing Applications for Android
Posted by Sébastien Stormacq in Android on 14/06/2010
As promised, I started looking at the Android development platform and, I must say, I am quite surprised by the results.
First, Android uses the Java programming language as language of choice, combined with a Google made class library. In this respect, my learning curve was much shorter than it was with Objective-C and Cocoa. I had to install and get used to Eclipse, but I could work over that too 🙂 (although there is an Android plugin for NetBeans too)
Secondly, once we get over the basic application programming principle and life cycle, I am surprised how quickly I was able to assemble something and how few lines of code were required.
I decided to port my Maxi80 iPhone application to Android.
I was pleasantly surprised that the Android MediaPlayer class is able to read ShoutCast stream, out of the box, starting with Android 2.2. I decided to take the quick an easy way : let Android connect and decode the stream and piggy-back maxi80.com‘s web site to get the song cover and title. Unlike iPhone OS, Android let you run applications on the background, allowing you to enjoy the music while using your phone for other tasks. (I will update the iPhone application – as soon as iOS 4 will be released – to provide similar behavior for iPhone users) The result is surprisingly compact : about 200 lines of code. Half of them to manage the player and the other half for the (simple) user interface. As usual, the source code is available under a GPL v2 license at Kenai.com Should you own an Android 2.2 device, the application is available on the Android Market. |
JavaFX talk at the Transylvania JUG
Posted by Sébastien Stormacq in Java on 11/06/2010
A couple of weeks ago, I had the pleasure to be invited to deliver a talk and a lab to the Java developper community in Cluj, Romania: the Transylvania Java User Group.
I was surprised to discover a highly motivated and vibrant set of folks. Like usual, we had excellents exchanges before and after the lab Lab and presentation materials are now available (a free registration is required for the Lab material) Pictures of these two evenings will be shortly posted too. |
Nexus One
Posted by Sébastien Stormacq in Android on 11/06/2010
I just acquired a Nexus One. Although I am an happy iPhone 3G owner and user, I wanted to get a Google branded phone for two reasons :
First, now that Google announced they will stop selling it, it will probably become a collector piece. Secondly, I wanted to start exploring both Android user experience and Android as a development platform. I am not saying I am definitively switching my iPhone for the N1, I am just curious to discover the differences and understand the good and bad points of each platform. After having spent a couple of days with the Nexus One, I am pleasantly surprised both with the hardware and the software. I will write more about the software part in a separate note. |
Things I like on the hardware side :
- Replaceable battery. I never needed to replace my iPhone battery, but I like the idea the option is open.
- Replaceable memory card. The MicroSD allows to increase memory capacity if needed.
- Better camera (but I am using an “old” iPhone 3G, I never tried the 3GS or 4G yet)
- Standard USB plug for charging – alleviate the need for proprietary cables in my bag
I do intent to write a more detailled note covering software and end user experience in the coming weeks.
iPhone applications development
Posted by Sébastien Stormacq in Apple, iPhone on 10/06/2010
Since a couple of months, I am exploring the world of iPhone applications development. After spending some time to discover the development framework and tools, I am quite impressed by the productivity we can reach. Cocoa is an extremely powerful framework.
Of course, I was not starting from scratch, I already I some experience with Cocoa through Mac OS X applications development (see here and here for examples)
As of today I published two applications on the App Store.
The first one is very basic and was my learning test bed. Tip Calculator allows you to quickly add tip and split your restaurant bills. It gives you geo localized information about local tipping habits.
As I truly believe in knowledge and information sharing, the source code is available on Kenai.com You can download and install it for free from the App Store. |
The second application I developed is a web radio player. It allows to listen to Maxi80.com, an french based, eighties web radio.
Amongst other features, it allows to view the name of the current song as well as its cover. It displays the name of the current show and on-air DJ’s. It allows to send emails to the web radio stations or the DJ. Source code is also available on kenai.com. You can download and install it from the App Store. |
I do not intent to modify the Tip Calculator anymore, however a couple of points are on my todo list regarding the Maxi80 application, namely :
- Integrate the newly announced iAd service to get some revenue for the web radio
- Port the application to the Android platform, more about this later.
Hey Mark, we missed the point here !
Posted by Sébastien Stormacq in Java on 14/03/2010
I was recently watching Mark Reinhold‘s interview on Oracle Technology Network. Mark is Principal Engineer at Sun Oracle and works on OpenJDK and future Java SE releases.
The interview went over many different subjects around Java SE : projects coin (simplification), jigsaw (modularity), closures (…)
Mark was also insisting on the many –ities of the Java platform : security, availability, scalability, readability, …
One of my favorite is readability ! It is important to understand how a piece of code is expected to behave just by reading it. This helps to reduce bugs when we write code and / or to easily catch bugs when reading code written by our peers.
Java SE 5, released about 5 years ago, introduced a feature called auto boxing, allowing to mix and match Java’s primitive types (such as int, boolean, …) with their Object counterpart (such as Integer, Boolean, …)
The objective of autoboxing is to simplify code and increase readability and, as such, is a welcome addition. But the devil lies into the details.
The example of code below shows incoherent behavior introduced by auto boxing :
Integer integer1 = 127; Integer integer2 = 127; System.out.println(integer1 == integer2); //true
Integer integer3 = 128;
Integer integer4 = 128;
System.out.println(integer3 == integer4); //false
You read it right : the first equality is true, while the second is false.
I would expect either both expressions to be false (Object references never must be compared for equality, my grand mother learned me) Or both expressions to be true (should auto boxing fullfil its promises).
This weird behavior is caused by some compiler optimizations happening behind the scene. When the compiler is auto boxing values between -128 and 127, it always reuse the same Object instance. In our example, integer1 and integer2 are therefore references to the same Integer object, hence the first equality.
For values outside of this (-128, 127) range, the compiler creates different Object instances for each reference, even when the values are identical.
We all learned that we should not use object references when comparing values, but auto boxing encourages us to write such code and when doing so, we end up with incoherent behaviors such as the one described above, which can make bugs very difficult to catch.
Hey Mark, if readability is really a concern : we missed the point with auto boxing !
[UPDATE 3 May 2011]
@jplandrain on Twitter points me to the Java specs where this optimization is specified. See the last sentence of the paragraph.