Ubuntu 9.10: First Impressions
For all who read my last blog entry from yesterday before my web server went offline—and then back—let me just mention up front that the upgrade went as flawlessly as it can be. So, go ahead and click the upgrade button and watch your Ubuntu 9.04 system morph into a Ubuntu 9.10 system. (After backing up your vital data of course.)
For those who want to learn how my upgrade fared, read on.
Thu 29 Oct 2009 11:59:05 PM CDT
After retrieving some meta-information, the Ubuntu distribution upgrade utility—karmic—informed me that some applications are obsoleted...
Fri 30 Oct 2009 12:03:29 AM CDT
... and the number and size of the packages removed, installed and upgraded. I thought the 5 hours of download time was reasonable.
Fri 30 Oct 2009 12:13:08 AM CDT
At this time, I was thinking of clicking the download button and go to sleep. However, after the download started, it tells its going to take 17 hours.
Fri 30 Oct 2009 07:32:52 AM CDT
By Friday morning, all downloads were done, and the installation process had been started for a while. However, it was waiting for my approval of going forward with stopping some processes. I clicked the "Forward" button and got the following screen. By this time my website was down. But I had to go to work.
My blog came back up shortly after I arrived at work.
Fri 30 Oct 2009 05:43:04 PM CDT
When I got home in the afternoon, another user interaction dialog was waiting for me. After that it was time for removing obsolete packages:
Fri 30 Oct 2009 06:02:05 PM CDT
That quickly lead to the "Restart the system to complete the upgrade" dialog.
The New System
The first thing I noticed is the new theme. Title bars of windows are darker now. Firefox 3.5 is the default browser. It feels a lot faster than Firefox 3.0, which was the default for 9.04.
And obviously, this blog is running just fine after the upgrade, with Tomcat 6.0.20 and Sun Java 1.6.0_16.
Ubuntu 9.10 Is Here...
...and I'm about to click that button.
See you on the other side of the upgrade.
Day Two of Strange Loop 2009
St. Louis, MO, Oct 23—Continuing my coverage of Day One of Strange Loop 2009, here are today's happenings.
The sessions started at 8:00am. The first session I attended is Ken Sipe's The Shiny New Spring Thing. Ken has given this talk at the St. Louis JUG back in February, but I want to get the most up-to-date information. Ken's main theme is "industry forces are driving us to annotations" and emphasized that Spring 3.0 will support all industry standard annotations plus Spring specific annotations. Ken went through a laundry list of new features in Spring 3.0, including the new MVC annotations and Spring EL.
Twittable quotes: The Spring MVC guys, they apologized for their earlier MVC; The new Spring MVC is very grails-like, I can almost do it in vi without the help of an IDE; Unlike Sun, "deprecated" really means something to SpringSource—old stuff will be removed. Struts and MVC classic will be gone.
I have heard Matt Taylor's talk about JQuery on a previous occasion. So the second session I attended is Stefan Schmidt's Extreme Web productivity with Spring Roo. I know nothing about Spring Roo when I went in the room. When I got out, I'm confident that I, too, can write a Spring MVC web app in 45 minutes if I download the 4MB Spring Roo and use its command line Roo shell. Stefan emphasized two features of the Roo shell: context sensitive tab-completion, and workflow-aware hints. At least half of the time is spent in the Roo shell, and Stefan essentially tab-completed his way into a complete crud web app with the SpringSource-Green theme.
It's like Grails but generates a Java web app instead of a Groovy web app. I kind of appreciate the helpful hand that Roo offers me, because without it, it would certainly take me more than 45 minutes to figure out where the applicationcontext.xml lives, let alone creating a working application.
Behind the scenes, Spring Roo uses the JLine library to offer its intelligent tab-completion and hinting magic. The generated code includes Java code with Spring MVC and Spring Roo specific annotations, and AspectJ aspects. The Spring Roo shell continuously watch the files for modifications (which you can do, for example, in Eclipse) and regenerate the aspects accordingly.
For the third session in the morning, I went to Michael Galpin's Mobile Development 101: Developping Apps for the iPhone and the Android Platform talk. This is a high-level talk about the iPhone and the Android platforms with the exception of the small excursion into Objective-C syntax. Michael went over things like "no garbage collection", "mobile Safari leaks memory like crazy", "the App2App custom URL protocol hack", "QA provisioning", and "App Store horror stories".
Twittable quote:XML is probably the worse format you can use for anything.
For lunch we had Quizno sandwiches. I managed to make a bag of Sun Chips explode.
There are two panel discussions at lunch time: Distributed Work Environment and Programmers Turned Entrepreneurs. I went to the latter. It's an interesting discussion. Two things made an impression on me. First, about programmer's indecision on whether to start a start-up, a panel member said "Keeping your current job is a decision, a decision not to start your own business." The second is a story Matthew Porter told the audience, in which he overheard two of his employees chatting about a problem in some code. One of them said "we don't need to talk to Matt, he's the CEO and is not technical." Matt has to refrain from the urge to get into the code and walk away because coding is not his role anymore.
The first afternoon session I went to is Bob Lee's The Ghost in the Virtual Machine: A Reference to References talk. As always with Crazybob's talks, this one is too hard to summary in English prose. It's a trip to the Java language garbage collection spec and painstaking detailed analysis of some of the usage scenarios of Soft, Weak and Phantom references in Android core libraries. Details that, according to Kyle Cordes, ordinary Java programmers would gloss over and solve the memory leak problems with added RAM and a scheduled reboot.
I took notes of a couple of pieces of the code for your puzzling pleasure:
Q: Can the referenced T be garbage collected at the indicated line:
T f(WeakReference<T> ref) {
T t = ref.get();
if (t == null)
throw new NullPointerException();
// ?
return ref.get();
}
Q: Guess what the following incomplete code does:
new MapMaker() .weakKeys() .softValues() .makeComputingMap(...)
The second afternoon session I went to is Alex Buckley's Modularity in JDK 7 talk. I missed this talk at JavaOne. So here's my chance to catch up. I assume everyone who should be enthused by this topic have already heard of seen the details. One aspect of the talk is about how difficult it is to modularize the existing JDK class library (rt.jar).
One fun fact shown is the composition of rt.jar: 33.10% methods, 63.94% constant pool including 56.3% UTF8 strings.
One aspect of the JSR 294 module system is the elimination of the classpath command line parameter (The CLASSPATH is dead!) and the introduction of modulepath command line parameter.
The conference closed with the Friday keynote by Alex Payne, API lead at Twitter. Alex lead the audience into the theme of the keynote "Minimalism" through a series of paintings of artists from turn of the 20th century up to contemporary time, and introduced the notion of Minimalist arts as the reduction of arts to its rudiments.
Turning to programming, Alex poses a series of questions starting with "Where do we learn how to do what we do?" He then pointed out the often used software as physical architecture metaphor is leading up to complexity, which makes software slow, programs insecure, jobs harder, and users unhappy.
The way out, according to Alex, can be achieved through techniques such as unification, constraint, and reduction.
As an example of unification, Alex pointed out the homoiconicity (the unification of code and data) of Lisp, machine code, Lua, Factor, etc.
As an example of reduction of abstraction, Alex quoted Ken Thompson, the inventor of Unix, as saying "I think the major good idea in Unix was the clean and simple interfaces: open, close, read and write."
As examples of constraint, Alex mentioned the constraint of project scopes, hardware limitations an operational requirements. Alex emphasized the importance of a great extension architecture.
Alex then asked a series of questions: "Is it still valuable if simplicity only exists on the surface?", "Would simplicity be useful if complexity worked better?", "Is it possible to deliver minimalist software that meets all needs?"
All thought provoking questions.
The conference ended with Alex Miller's "See you in Strange Loop 2010!" and the request that attendees turn in their evaluation sheets _and the plastic badge holder_.
Yeah, it's that kind of a conference.
Seriously, most people I talked to at the conference think this is a wonderful conference and would like to come back next year.
Alex Miller did a tremendous job in organizing this conference.
Thank you, Alex!
Day One of Strange Loop 2009
St. Louis, MO, Oct 22—The Strange Loop conference is a new tech conference organized by Alex Miller. It started today at the Tivoli Theater in Delmar Loop in University City, MO. Three hundred people attended the conference.
It's a rainy day here at St. Louis, as you can see in this picture that I took in the morning. (Click on it to see the full-sized version where you can see the marquise featuring The Strange Loop starring Bob Lee and Alex Payne more clearly.)
Since the whole conference is being video taped and will be made available on DZone, I won't bore you with too much details. What follows are my impressions of the conference.
Today's program includes three tracks of one-hour talks running at 11:40am, 12:50pm, 2:10pm, and a keynote at 3:20pm. Followed by a party at Blueberry Hill that also included four fifteen-minute Strange Passion talks.
The first session I went to is Mario Aquino's Zen Mind, Worrier Spirit talk, in which Mario compared agile development process with the way the military trains, lives and operates. Mario is a fan of Zen philosophy and used several koans including the where master kept filling the tea cup for his guest, even after the cup is full. It's an entertaining talk. Since this talk involved eastern philosophies, I asked an eastern philosophical question during the Q&A: Do you think agile is a methodology the the ages? Or will it go out of style in five or ten years just like waterfall is out of style now? Mario gave a long answer that I'll have to wait till the videos come out to study further.
The second session I went to is Dean Wampler's Polyglot and Polyparadigm Programming for Better Agility talk. Dean is a very articulate speaker and presented his argument in a thoughtful and balanced fashion. He talked about several application architectural approaches, including aspects-oriented programming, functional approaches, and DSLs. The one thing that impressed me is Dean's first example architecture—that of Emacs, where "Components + Scripting = Application." The theater is full. Twittable quotes include "I can't believe Eclipse doesn't have a scripting infrastructure when it was first designed." and "I think every programmer should learn Clojure, for its principled design."
The third session I went to is Charlie Nutter's Ruby Mutants talk. The topic is not JRuby, but a couple of other languages THAT'S NOT RUBY—Duby and Surinx. Both are Ruby look-alikes, one statically-types with local type inference and the other dynamically typed. These languages are Charlie's sand boxes where languages features experiments are conducted. Duby allows Charlie to write (almost-)Ruby code that can be compiled to Java classes or Java source files. The Duby classes can then be run on the JVM without any extra Duby-specific runtime library with Java-like performance. During the demo on stage, Duby outperformed JRuby by two orders of magnitude. Twittable quotes include "The JVM is so pervasive that the chances of it not being kept up-to-date for future hardware advances is minimal.", "The JVM is the people's runtime." and "Static typing is not needed until it is really needed."
The keynote address today is given by Bob Lee on the topic of The Future of Java, in which he explained the new Java language features for Java 7 that are being worked on in Project Coin, new sorting routines, the G1 garbage collector, and JSR 330. He showed code examples of ARM blocks. He went through the his own fixing vararg error messages proposal. And he finally showed off the interface and annotations for dependency injection from the freshly approved (just last week) JSR 330. He also revealed his thoughts on the next logical step for JSR 330, standardizing the configuration scripts.
I went to the π for dinner with Denis, Nathan and other OCI people, and went back to the Duck Room at Blueberry Hill for the happy hour and Strange Passions talks. I get to meet Bob Lee in person after many years.
There were four Strange Passions talks: Kevin Archer talked about neurons and how they work. Jeff Schmitz talked about astronomy and quasars. Alex Miller talked about psychology and the famous marshmallow experiment in which cruel college professors gave four-year-olds a marshmallow and tell them that if they can refrain from eating it until they come back they can get another one. And finally Ken Sipe talked about options trading: all about deltas, thetas, vegas, and some other attributes. These are all run facts to know.
Well, that's the first day of the Strange Loop conference. A success by any measurement. Sadly, I don't think many people will blog about the conference as used to be. They tweeted the conference all day long and are probably in bed now, getting ready for tomorrows sessions which starts at 8:00am. I think it's bed time for me too.
And oh, have I mentioned that Charlie Nutter emphasized that Duby IS NOT RUBY and will not run Rails.
Wednesday Java Quiz: Think You Understand Concurrency?
There is a war of words going on about simplicity vs. complexity among the pundit circles:
- Joel Spolsky: The Duct Tape Programmer
- Robert Martin: The Duct Tape Programmer, Echoes from the Stone Age
- Tim Bray: On Duct Tape
- Peter Seibel: Unit testing in Coders at Work
- CodeToJoy: The Emperor's New Prose: Duct Tape Blogging
They argue about many things, including test-driven development, architectures, design patterns and threading:
Joel Spolsky: One principle duct tape programmers understand well is that any kind of coding technique that’s even slightly complicated is going to doom your project. Duct tape programmers tend to avoid C++, templates, multiple inheritance, multithreading, COM, CORBA, and a host of other technologies that are all totally reasonable, when you think long and hard about them, but are, honestly, just a little bit too hard for the human brain.
Robert Martin: I found myself annoyed at Joel’s notion that most programmers aren’t smart enough to use templates, design patterns, multi-threading, COM, etc. I don’t think that’s the case. I think that any programmer that’s not smart enough to use tools like that is probably not smart enough to be a programmer period.
While I had my "A-Ha, so this is how TDD works!" moment at a Robert Martin "Scoring Bowling Game" talk, I don't want to argue against Joel either.
Since I'm fixing some long standing bugs (Chris told me "It's been there for years" yesterday) in a piece of software recently, and it has a threading aspect to it, I'll just throw out snippets that I saw while walking through the code, all I ask is:
Q: What's wrong with them? (They are not complete. Use your imagination to fill in the missing parts.)
Snippet 1
public void foo() {
Object lock = task.getLock();
synchronized(lock) {
task.perform();
lock.wait();
}
}
Snippet 2
public void run() {
while (!done) {
doIt();
if (done) break;
try {
Thread.sleep(60000L);
} catch (InterruptedException e) {
}
}
}
public void stop() {
done = true;
while (thread.isAlive()) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
}
}
}
Snippet 3
public void foo() {
// code
class Bar {}
Object lock = new Bar();
synchronized(lock) {
// code
lock.wait();
}
// code
synchronized(lock) {
// code
lock.notify();
}
}