Java 6 is very nice… but what’s so special about scripting support

OpenjdkLogo As any Java minded developer I also heard about the release of Java 6. While I could whine on about the fact that it is released and that it’s great, I don’t think that would add anything to the current buzz on the internet. I’d say read the release notes and your done with that. Don’t forget to click to the new features and enhancements page.

But I do want to share a little email discussion I had with a collegue. Java 6 has scripting support built in. Now scripting in a Java VM is nothing new. Then why the hell is everybody drooling over this scripting support in Java 6? The only real change is that it’s now possible to work through a standardized API. Before Java 6 it was already possible to do scripting in Java. My guess would be that most of the engines mentioned on this page could be used with earlier Java VM versions.

Oh and let me make a prediction. I am guessing that there is going to be a lot of talk about domain specific languages in Java, which will most likely be called DSL in a matter of weeks. :)

One cool thing I did find out about when plucking through the new features of Java 6: An Applet demonstrating a fully Scheme R5RS compliant Scheme implementation called SICS
Don’t know why but it made me smile. :P

Gift drawing code

In response to Martin Wolf’s blog posting about a little bit of gift drawing code I’ve hacked up a little piece of code in about 30 minutes to see if I could do better in Java 5.

There is bound to be something wrong with it. (Let’s see what we can find. :) )

package net.leenarts.sinterklaas;</code>

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class test {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {

		// Do nothing with input.

		BufferedReader sin = new BufferedReader(
				new InputStreamReader(System.in));

		List<List<String>> names = new ArrayList<List<String>>();
		Map<String, List<String>> related = new HashMap<String, List<String>>();

		System.out.println("Please enter names of people for the draw."
				+ "\nPeople"
				+ "\nentered on one line seperated by whitespace are"
				+ "\nmarked as related. Confirm entry by pressing the"
				+ "\nreturn key. Entering an empty line finishes the"
				+ "\nentry procedure.");
		for (String line = sin.readLine(); line != null && line.length() > 0; line = sin
				.readLine()) {
			// Cut input up to individuals, related to each other.
			List<String> relatives = Arrays.asList(line.split("\\s{1,}"));

			// prevent doubles
			for (String relative : relatives) {
				if (names.contains(relative)) {
					System.out.println("The name \"" + relative
							+ "\" has already been entered,"
							+ " please try again.");
					continue;
				}
			}

			// Store as relatives
			for (String relative : relatives) {
				related.put(relative, relatives);
			}

			// And store the names
			names.add(relatives);
		}

		Collections.sort(names, new Comparator<List<String>>() {
			public int compare(List<String> o1, List<String> o2) {
				if (o1.size() < o2.size()) {
					return 1;
				} else if (o1.size() > o2.size()) {
					return -1;
				}

				return 0;
			}
		});

		// Now to perform the draw
		List<String> receivers = new ArrayList<String>();
		for (List<String> nameList : names) {
			receivers.addAll(nameList);
		}
		List<String> namesList = new ArrayList<String>();
		namesList.addAll(receivers);

		Map<String, String> result = new TreeMap<String, String>();

		for (String name : namesList) {
			List<String> candidateReceivers = new ArrayList<String>(receivers);

			// People are only allowed to draw
			// someone unrelated and not themselves.
			candidateReceivers.removeAll(related.get(name));

			Collections.shuffle(candidateReceivers);

			result.put(name, candidateReceivers.get(0));
			receivers.remove(candidateReceivers.get(0));
		}

		System.out.println("Here are your results:");
		System.out.println(result);

	}

}

Performance tuning overload

Just a little update after yesterday. I must say that Kirk is performing a marvellous job. So-far we have touched on subjects like heap tuning, garbage collection tuning, profiling and architecting for performance. Loads and loads of stuff. And we’re only half way through! Fortunately the course attendees seem to be a rather bright bunch of people, so Kirk is able to work through the material at a nice tempo. I knew the Java JVM had lots of arguments, but man, in the last two days I learned about boat loads more.

Woops, Kirk is starting again. More on this later.

Performance tuning course underway

Nice, Kirk Peperdine seems like a very nice guy. Although we’re only like 4 hours underway I think this will be an interesting course. Also Kirk is doing the entire course. I had my doubts if he would.

More on the contents and my views on the course later. Right now it’s almost time for lunch. And Kirk is paging his slides quite fast.

Performance training next week

Next week I am attending a course offered by Xebia through the NL-JUG. It’s about Java Performance tuning.

They are claiming Kirk Pepperdine from Java Performance tuning will be there as well. I am curious how much face time we will actually have with Kirk. I won’t be surprised if he pops his nose through the door for a bit and is off again. But on the other hand, he could be doing the whole course just as well. But my guess is he’ll be there for the full four days. Here’s the course description.

An interesting observation I’ve done is that the Xebia course description seems to match up perfectly with this page on the Java Performance tuning site. That would seem to suggest that someone from Java Performance tuning is attending and he’s bringing along all the instruction material as well.

I guess that’s one way to offer a course. A simple matter of reselling.

One last point. The confirmation said that the attendee should bring their own laptop with Java 5.0 SDK installed and wireless network support. That includes my Apple PB too I guess.

Finally I scored some goodies at a conference…

Last Wednesday I attended the J-Fall conference by the NL-Jug. Driving home I was already thinking about doing this blog post. But as you can see, it’s two days later now. When I got home after the J-Fall I immediately took a shower en jumped into my bed. I felt exhausted. Yesterday morning I felt really sick and today it is getting a bit better. Things like dizziness, head ache, belly ache and nausea. Fortunately I am not feeling feverish. Right now I actually feel good enough to get hit by some boredom as well. But reading up a book or just stretching my brain a bit just hurts like hell and makes me feel sicker. So this blog posting won’t involve the most enlightening opinions I guess.

Anyway, about the goodies at the J-Fall. I actually scored two very nice books. There was a company standing next to Sun’s booth and they provided these little scratch cards with which you could “win” a book. I actually was lucky enough to win a book. So I immediately dragged one of the stand workers from my companies booth to have a go at it as well. He scored as well. Unfortunately for him ;) there were no books on display that he liked so he asked which book a would like and he got it for me. Also because I was a speaker at the J-Fall I was presented with a speaker present at the end of the conference. I didn’t really count in that to happen. So after attending numerous conferences I finally was able to score some real conference goodies beyond mugs, mouse pads and t-shirts.

Now I’m back to bed again. I think I over estimated how fit I was when I started writing this.

NL-Jug J-Fall 2006: Resources for my presentation

On October 11th I gave a presentation at the Dutch NL-Jug’s J-Fall conference. As this post was prepared before-hand and posted automatically during my presentation, I will put up another blog post reflecting on my performance during and reflection on the reception of my presentation.

First of, here are the book recommendations I made during the presentation:

Don't Make Me Think: A Common Sense Approach to Web Usability Designing Interfaces Pragmatic Ajax: A Web 2.0 Primer Agile Web Development with Rails: A Pragmatic Guide Core JFC Eclipse Rich Client Platform

Now concerning the presentation itself: It is in Quicktime format posted here (2.3 mb).

Enjoy!

One and a half week to go…

Dutch Java User GroupYes my fellow Dutch Java friends. I hope you all registered again for another edition of the NL-JUG’s J-Fall. Looking at the program, I must say they’re still on the right track towards becoming a must see for all Dutch Java developers.

Also, make sure to visit my presentation of you are attending. I won’t tell you any more details right now. But it will be a presentation which you will find a bit different in a good way. I have one of the last slots of the day, but that’s just another reason to attend my presentation. Because I will do my best to keep you interested and awake. It would be a shame to doze off during the last round of presentations. “Because of the free beer and all that is.” :P Also, to my colleagues not attending the J-Fall, don’t despair, on the 25th I will do the same presentation on our fortnightly ISKA gathering.

Now about my presentation… I can’t resist. Here’s a little peak-a-boo: Frontpage InfoSupport Slidedeck

Train spotting, sort of…

Logo of the NS - Dutch RailwaysPeople who have checked my project history, have probably seen that I am doing something at the Dutch railways for quite some time now. Well, tonight I will indulge myself if you will.

The project is about building an application with which the Dutch railways and any other user of the Dutch rail infrastructure should be able to plan all infrastructure, trains and personnel. Now from what I have heard, the way the Dutch railways are operated is almost unique on a global scale. Yes, you’ve read correct. Most rail infrastructure is used in a strict corridor like fashion, a train moves from A to B and B to A, all day long. But here in the Netherlands it really is a network problem. Everything, and I really mean everything crosses each-other at stations and other significant places. Now think about this for a while and let it sink in. Now I don’t know how things work in other countries, and frankly I don’t really care too much about that either. The project I’m in is trying to help planners for the Dutch situation.

Now, not only does the infrastructure need planning, the trains themselves have to be planned as well. Trains need maintenance, and at the start of the day the right equipment has to be available at the right places. Preferably with as little empty night time movements. Starting to feel a bit complex now. Well, that’s not all. Someone has to be on those trains to drive them, and let’s not forget the men and women who check your ticket. In the Netherlands a train is not allowed to depart with passengers without a conductor. Now think about this, personnel should start the day as close to “home” as possible and end up as close to home at the end of the shift as well. Oh and the machinist has to be certified for the type of train he’s running and be certified for the tracks he’s running on too.

Short version, this sh#t is complex. And the coolest part is, the entire effort is starting to feel like it’s going into it’s final stage of development. Sure there will be bugs to fix and deadlines to be met, signals are indicating that crunch time is near. I’ve been on this project for a good one and a half years now. But the effort started like a whole bunch of years ago. Last time I heard it was like 5 or 6 years ago that the first preliminary studies were conducted.

My role in this whole thing? I’m just one of the many hard working developers. My role is mainly focussed on UI and graphical display of data. Questions? Just ask, I’ll see if I can answer them.

NL-JUG J-Fall proposal has passed

Dutch Java User GroupThis year the NL-JUG’s J-Fall conference will be held on October 11th. Details are available at the NL-JUG’s website. The J-SPRING and J-FALL are the place to meet your fellow Dutch Java programmers. To me it has become a biannual gathering of past colleagues and sometimes even friends.

On a more personal note: My proposal to the NL-JUG to host a session has passed. I am thrilled about this. Especially because my proposed subject is such an interesting topic. It is not a very technical subject in itself. But I am going to talk about one of the more fundamental choices a project has to make about their product.

I am curious about the interest in my session. Since it is the in the last slot of the day and it is not about framework X or Y. But what I can promise everybody is that it will be something most of you have never seen before.

As a final note I provide you with an English translation of the proposal I sent in.

Session: Which user interface do I choose for my Java Application?
Speaker: Jeroen Leenarts, Info Support

Abstract: In this presentation you will receive an overview of the pros and cons of web and rich client technology. The differences between the various technologies will be clearly illustrated by means of practical examples. A number of technologies will be evaluated, including AJAX, Eclipse Rich Clients, Netbeans Applications, Web 1.0 (as in Web as we already know it) and Swing interfaces. A wide spectrum of technologies indeed, but they have something in common. All are very decisive about the way the resulting application will look and feel. Often one of these technologies is chosen without much thought about the suitability to the situation at hand. Don’t let your end-users down and choose a solution in the interest of your end-users. After my presentation you will be better equipped to make those decisions about which technical interaction model you want for your application.