Saw this on a mailing list :)
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
- Rich Cook
Panther Glitch
Spread the word: Panther upgrade wipes out external FireWire drives. Details on Wired News Bye-Bye Data: Glitch in Panther:
Mac users are roaring in rage because of a nasty installment glitch that erases data on external hard drives.
After upgrading to Mac OS X 10.3, better known as Panther, they are finding external FireWire drives are no longer recognized by the host machine. In many cases, all the data the drives stores are also gone.
...
Cute Logo Theory
I have noticed this for a long time now, but have dismissed it as too outlandish. After watching yesterday's Nova episode, nothing is too unfathomable now.
My observation is simply this: In the software world, things that have a cute logo, be it an operating system, an application, a programming language, or a middleware product, win.
Think Java, Linux, BSD, Apple
Coincidence? I think not!
Cool Code - Ugly Dependencies
Have you ever seen a piece of code that someone put up on a web site, like SourceForge, with an Open Source or Free Software license and you say to yourself, "This is so cool! I'll just use it." So you add a jar file to your CLASSPATH.
A few months later, you discover that everyone else also adopted the same jar file. Your J2EE server provider, your O/R mapping provider, your MVC framework provider, are all distributing incompatible versions of the jar file within their product.
And you are left with the unpleasant task of integrating all of these into a running instance of JVM. And it can't be done elegantly. You basically have to beg each and every vendor to release a version of their product that uses the same version of the jar file.
Yes, I'm talking about log4j.jar and Apache Commons jars and friends. And I have a modest proposal for a solution to the problem: Simply modify the code and make it an internal package. That way your software will have less ad doc external dependencies and less potential for conflicts.
After all, the authors of those Open Source/Free Software packages gave you the right to modify their code. Why not use it to solve an ugly problem?
J2SE 1.5, BeanShell 2.0, JMX, AOP, ...
These are all topics for presentations at the St. Louis Java Users Group.
Jeff Brown presented New Features of J2SE 1.5 last month.
Pat Niemeyer talked about his new BeanShell 2.0 this month, fifteen days ago.
Adam Quan will be presenting on JMX next month, on November 13.
Bob Lee will talk about AOP on December 11.
I learned a lot from Jeff's and Pat's presentations. Most impressive of all is BeanShell 2.0's ability to run arbitrary Java source files. The semi-automatic semicolon insertion (press Enter twice) also addressed a usability issue of 1.0 that bothered me quite a bit.
J2SE 1.5's auto-boxing and unboxing, on the other hand, is the least impressive. It won't happen for assignments. Only method parameter passing gets the auto-boxing treatment.
I'm looking forward to both Adam and Bob's talks. I missed Bob's talk when the No Fluff, Just Stuff conference was in town last May. I've heard that it's most interesting.
Things Learned Recently
It's strange how something could be right in front of our eyes and we wouldn't explore or learn it.
We've all known people who use the arrow keys to move the cursor in an editor one character at a time. Or people who use the right-arrow+backspace combination when a simple delete would suffice.
So it's no surprise that I missed a few features in tools I've been using for a long time. For example:
- In Mozilla, I can now set more than one websites as my home page. Simply open them all up in different tabs, and then click on "Use Current Group" in the Navigator Preferences dialog.
- In Windows cmd.exe, %~dp0 is the name of the current script in a batch file.
- In Emacs, you can edit any remote file reachable via ftp as if a local file. Simply visit /server:/path/file. You can even bypass the login promt by saving your username/password in ~/.netrc.
Here's a few tricks I've known for a while, but are worth mentioning because they are so neat:
- In vi, the . command repeats the last insert. This is useful when you want to do the same thing at several places. You do it in the first place, and then move to the next place and issue a . command.
- Emacs can open zip or jar files as directories. You can then open individual entries, edit them, and save. Emacs will rezip the changes right back into the zip or jar file for you.
- Try echo $PATH | tr : \\n. It will split your PATH into individual elements and display them one per line.
JBoss 3.2.2 Released
The JBoss Group announced the release of JBoss 3.2.2 today.
This is the first major release of JBoss after the departure of several JBoss developers from the project earlier this year.
Starting from this release, the default embedded web container in JBoss switched from Jetty to Tomcat. A separate JBoss+Jetty bundle is still available. This is in contrast to JBoss 3.2.1, where Jetty is the default and a separate JBoss+Tomcat bundle is available.
No new features are introduced in this release. Just a ton of bug fixes and configuration simplifications. For example, JMS configuration is much easier now.
If Your Ant Build File Works On Windows But ...
... not on Linux, check the spelling of the jar file names in the classpath for the javac task. One of them might have the case wrong.
Weblog Software Upgraded
I upgraded the weblog software this weekend to Pebble 1.4-dev. A major new feature is trackback.
An interesting twist is that Pebble 1.4-dev uses the commons-httpclient.jar from Apache Commons Project. JBoss 3.2.1 + Tomcat 4.1.24 that hosts this weblog also uses it.
Of course they use different versions of the jar. And posting a trackback to my weblog causes a NoSuchMethodException because the older version that JBoss uses lacks certain method present in the newer version.
Tweaking JBoss's class loading scheme to force the webapp to load it's own commons-httpclient.jar causes errors elsewhere. Copying the newer jar over the older jar doesn't work either.
Luckily, the latest beta version of JBoss, 3.2.2 RC4, uses the exact same version of commons-httpclient.jar as Pebble 1.4-dev. So I upgraded JBoss, and the new feature works as advertised now.
I still have problem with HTTP BASIC authentication in the embedded Tomcat. But it only affect the owner.
Sums Of Odd Integers
Here's a hint for a question I posted eight days ago:
"Can you write a function that calculates the sum of all odd integers from 1 to 2n+1?"
The answer is n2. If you don't know this, your function will be O(n) instead of O(1).
Sun, Java, Bugs, ...
It's no secret that I'm frustrated with Sun's bug reporting procedures, as previously reported fifty-five days ago and thirty-nine days ago.
Just when I thought "They can't top that", they did.
I received a note today saying "your bug has been updated, click here."
I know I'm in trouble when Sun's website prompted me to login. I have always automatically logged in before. I signed up with the JDC the first day the site went public.
Of course my username and password no longer worked. In order to serve me better, Sun has consolidated the login databases. I used to have two accounts with them, one for the JDC and one for their online store. Instead of making both of them work, they opted to make neither work. And I have to reset my password.
Resetting the password is easy enough. They just asked me my secret question, and then emailed me my new password. And I logged in with it.
There is no way I can remember this password. So the first thing I tried to do is to change my password. No such luck. There is no way I can change the password. I can only reset it.
What does this mean? It means although I can use the "remember password" feature of my browser and the "automatic login" feature of the website, the moment I go to a different computer, I have to reset my password in order to login, which, in turn, invalidates all the automatic logins on all the other computers.
Finally I reached the bug. And what do I see?
Focus regression; committing to hopper and tiger. xxxxx@xxxxx 2001-11-05 Assigning to Russia. xxxxx@xxxxx 2001-11-06 commit to hopper and tiger The problem is not reproducible with Hopper b06 and later. xxxxx@xxxxx May 28, 2002
And the status of the bug is "closed, not reproducible."
First of all, if you committed something and a bug is gone, it called "fixed!".
Secondly, the status change was dated May 28, 2002. Why does it take 494 days for Sun to send an automatic email informing me about it?
Naive Programming Harms
In a new book, Michael Kay, the author of the Saxon XSLT processor, said:
Books on relational databases don't go out of their way to tell you something that every implementer of a database system knows: The most important way of getting good performance out of the system is simply to write fast code. ... If xt processes the same stylesheet five times faster than Xalan (and it sometimes does), this isn't because it has a better optimizer; it's mainly because James Clark writes very slick code.
The opposite of slick code is naive code. And we write it everyday. And we do it in the name of object-orientation, in the name of patterns, in the name of corporate coding standards, in the name of framework, in the name of the latest buzzword, in the name of flexibility.
And we wonder why our systems are so @#$% slow.
Can you write a function that calculates the sum of all odd integers from 1 to 2n+1?