Just a few notes…

Had a nice vacation the last three weeks. I’m in the process of picking up the pieces when I dropped everything three weeks ago. It basicly comes down to the familiar pile of e-mail.

I have done some software related updates to my blog. To my knowledge everything should be in working order again. If you do happen to run into a problem with my site, please let me know. I’ve checked that the contact form functionality is in working order. I also made sure to double check my rss feed is working properly for obvious reasons. The rest of the site should be ok, since I did a quick click around.

Next week I will start at a new project with a large Dutch bank. Something involving Maven 2 scripting as a build manager. I’ll be working with a lot of people including a few integrators. So I am hoping I’ll actually get to implement a new Maven 2 build infrastructure and manage the process of introducing my results instead of constantly caressing a build to completion. It’s going to be a big challenge to bring my assigned task to completion. The technical aspects should all work after a couple of problems and hick-ups. But besides the technical aspects I am expecting to do a lot of convincing, talking and reporting to get everybody on the same page concerning the new build mechanisms. Because I was told that I am going to be involved with a pilot scenario. Not to mention the number of people, departments, projects and external suppliers involved. Anyway, exciting stuff.

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);

	}

}

Java SDK open-source: a blessing or a dreadfull mistake…

OpenjdkLogoWow, it finally happened. Java is now officially open-source. First of all, I think it’s great to be able to take a peek under the hood of Java.

Now there is a catch though. I’m not entirely sure, but it seems that it is JDK version 8 (!!) which is available under an open-source license. The sources and binaries of JDK 6 and JDK 7 can be downloaded, but they are licensed under the JRL (Java Research License), which has some restrictions.

To check it out, take a look overhere. Note the usage of username “guest”. Personally I have checked out using the command:
svn checkout https://openjdk.dev.java.net/svn/openjdk openjdk --username guest
Yes, that’s without the trunk part. I will perform a chechout of the entire repository, including all branches and tags of the main project, hotspot project and the compiler project. That’s like, everything. After the checkout the source code tree is about 220 MBs in size. That’s a lot of code.

Also note the usage of the GPL with the OpenSDK. Corporations need not worry though, The GPL license has an addendum called the classpath exception, a GNU endorsed mechanism to allow linking of proprietary code to API code.

Anyway: Is open-source java a good thing or a bad thing. There are a number of opinions:

Pro: Open Source Java …

  • … will speed up development and feature maturity.
  • … will provide developers with the possibility to review the JVM/Compiler code and truly understand it’s workings.
  • … will allow the Sun Java release to be integrated with true open-source Linux distributions.

Con: Open Source Java …

  • … will become a hindrance because of wild growth of JVM branches.
  • … is not needed, we’ve got the JRL license, so we can already review the code.
  • …, why join those overzealous fanatics, open-source is a pest that should be exterminated with all available measures. (Erh, right…)

Of-course there are more arguments to be made in favor and against open-source Java. Personally I think it’s great. Fiddling with the code is not something for everybody. I took a stroll through the code the other night and yes it is intimidating, believe me. But because it is such an essential component to any Java runtime and development environment, I do think it is best when you have the source-code available. Also I don’t think there will be any wild fire like scenario with heaps of different Java SDKs available will happen any time soon. I do think certain people and organisations might provide their own extensions, much like J2EE server implementations do. But gross incompatibility, I don’t expect that. See, Sun is still the driving force behind the Java Community Process which defines the standards that a Java implementation has to comply to. So as long as there remains a single entity that defines the shape of Java today and in the future, we will all be all-right.

Java Action Week and some other things

The week after the performance tuning course has been a busy one. My employer planned a thing called a Java Action Week. A Java Action Week involves pulling back a number of people from our customers to create a focus group to achieve a number of goals in the short time-span of only a week. Last week my name was up, and while it was a busy week, it also was a very refreshing break from the normal course of business. I can’t really go into the details of things, company policy has to be followed on this one. Yeah it did involve something with Java programming.. ;) All in all it was a very productive week.

Besides the regular 40 hour week my M.sc program is taking it’s toll as well. Because I was going to work by car instead of by train the last week I lost about 5 hours of work because of steering a car. But still I had to stay up to speed with the courses I am following. Next to that a friend of mine had a nice surprise in store for me as well. Although my time was very short these last two weeks, her surprise put a smile on my face. Something I really needed because I was starting to feel swamped by all the stuff I still have to do.

I’ve also noted an item in my agenda to compile some nice posts to put up here. But I’m just not getting around to it. So please hang on, there will be some good stuff here in the future.

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.