Walmart Selling Sun Java Desktop System PCs
I followed a link in one of Tim Bray's recent blog entries. (You have to scroll all the way down to the bottom and click on a pretty stealthy link.)
And what do I see? PCs preloaded with Sun's Java Desktop System from $298.00 at Walmart. The JDS is an integrated Linux environment with GNOME, StarOffice, Mozilla, Evolution and Java 2 Standard Edition.
Gambling Problem
Jeff Brown: Casinos everywhere have signs around that say something like "Got a gambling problem? Call 1-888-BETS-OFF". I called the number and the guy at the other end of the call asked me if I had a problem. I said "yeah, I have a problem. I have a 6 and a 9. The dealer is showing a Queen. What should I do?"
Do You Know Which Jar Command You Are Using?
If you use both the Sun J2SE SDK and a full installation of GCC 3.2.x or later on the same machine, then there is a chance that when you issue the jar command from a command prompt, the wrong jar command is used.
Depending on how your PATH is setup, either the jar from GCC is always being run or the one from the JDK is always being run.
I found out that I've been using the GNU version in a Cygwin environment when I tried to do a jar -u and received an error message:
jar: `-u' mode unimplemented
The two versions are mostly compatible with the exception of the -u and the -i switches. The GNU version runs a lot faster.
NFJS
I attended the NFJS Gateway Java Software Symposium over the weekend. Jay and crew did a great job again this year.
I went to four sessions plus a panel discussion on Sunday and read the handouts for the other sessions.
Things of note:
- The Spring Framework (Bruce Tate): Inversion of control (IOC) and Dependency Injection. The Spring Framework is going to kill EJB.
- AOP: AOP is not that new and out-of-this-world any more.
- Persistence (Bruce Tate): "One word: Hibernate"
- Code Reviews (panel, Mark Volkmann): It always degenerates to a discussion of indentation and tabbing styles.
- IDEs (Paul Jensen): Last year everybody uses IDEA. This year everybody uses Eclipse.
- JGoodies Forms: I can use this in the next Swing project.
- Foxtrot: Ditto.
- Web Services (Venkat Subramaniam): "Sun's JWSDP - Oh Well". Let me skip this few slides.
- CM Tools: Dave Thomas is still teaching a CVS session. Don't know if anyone asked him about Subversion.
- Groovy (Mark Volkmann): GStrings.
- dynaop (Bob Lee): "Date is to class as trace logging is to aspect."
The buzz of the show is definitely the Spring Framework.
The Desire to Make the Light Green
I just realized something.
I have been unconsciously striving to make the light green in my development in the past two years.
I have been writing unit tests for my code, just like Eric and Brian told me to. Now that I think about it, all the good engineering reasons aside, I wrote the unit tests just so that I can run then in JUnit's GUI and see the status bar turn green.
And run them I did! Sometimes I just click on the Run button again and again.
IDEA has a "error stripe" to the right side of the editor window which contains an red/yellow/green indicator showing whether a file has errors or warnings.
On my current project, all Java files are generated from a template that contains the copyright comment, marker comments like "private fields goes here" or "constructors and getInstance for singletons goes here". The template also contains two public static final fields, one named CLASS_NAME, one named logger. If the class does not actually do any logging, IDEA flags the logger as "field never used" and gives out a yellow light.
I know I need to learn to just live with it. But I can't! Every time I see the yellow light, I think about the unused logger field, wanting to delete them. But the tree is closed.
The emotional power of the green light is greater than I thought.
Jim Waldo, OnJava.com, Secret Weapons, ...
Java.sun.com is featuring an interview with Jim Waldo about Jini in which Jim said:
A lot of customers, once they experience the power of Jini technology, are unwilling to admit to it, because they don't want their competitors to know about it.
OnJava.com is doing a user survey, asking, among other things:
What topics would you like to see receive more coverage on OnJava.com?
Guess what? What I want to see is more coverage of those technologies that get used to great success but its users are not necessarily eager to tell the world about. I want to learn about the secret weapons (that I blogged 234 days ago) that does not get their fair share of coverage in the tech media.
"Any Word, Click, Get Information!"
I don't know if you remember this, but during the Dot Com boom, there was a TV commercial showing a motivational speaker woman on stage telling the audience, "Take any word, click, get information!"
I forgot what the product or the company was. But I just found out that the latest Mozilla can do pretty much the same: If you right click on a selected word or phrase, Mozilla will show a context menu item 'Web Search for "selected word"', which will do a search for the word on the configured search engine (Google for me).
Another one of those conveniences brought to you by the Mozilla team.
Subversion: Two Weeks Later
I first took a look at Subversion 15 days ago. It's similarity to CVS made me want to dig deeper.
Here's what I found out during the past two weeks.
Building from Source
Building Subversion source from trunk on Fedora Core 1 is straight forward. I ran autogen.sh to create the ./configure script. Running ./configure revealed that I don't have the right version of apr (Apache Portable Runtime, part of Apache HTTP Server 2.0). FC1 ships 0.9.4 but 0.9.5 or 1.0 is required. Similarly for apr-util. The INSTALL file mentions that I need the WebDAV/DeltaV library neon version 0.24.4, FC1 ships with 0.24.3.
So I went to their respective web sites and grabbed the sources from CVS. Neon 0.24.4 requires autoconf 2.58, but FC1 has only 2.57. Luckily Subversion trunk will build with neon 0.24.3 and the chase stopped there.
The build itself is uneventful. First apr, then apr-util and finally svn, informing each step the location of the result of the previous steps with the --with-apr=/opt/apr and --with-apr-util=/opt/apr-util switches to ./configure. The result is here:
[root@gao svn]# pwd /opt/svn [root@gao svn]# ls bin include info lib man share [root@gao svn]# ls bin svn svnadmin svndumpfilter svnlook svnserve svnversion [root@gao svn]# ls lib libsvn_client-1.a libsvn_ra-1.a libsvn_repos-1.a libsvn_client-1.la libsvn_ra-1.la libsvn_repos-1.la libsvn_client-1.so libsvn_ra-1.so libsvn_repos-1.so libsvn_client-1.so.0 libsvn_ra-1.so.0 libsvn_repos-1.so.0 ...
The build process also created the Apache modules mod_dav_svn.so and mod_authz_svn.so and placed them in /usr/lib/httpd/modules. The httpd.conf is modified to add lines that load and configure the modules. Unfortunately this also broke Apache, making is unstartable, claiming that it cannot find certain symbol. I backed out my build and sticked with version 0.32.1 that came with FC1 for the rest of the test.
The official Fedora Core 1 build of Subversion 1.0 should arrive any day now.
The Book
The book Version Control with Subversion, by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato, a soon to be published O'Reilly book covering Subversion, is available from the same place where the CVS book is available.
This is an absolutely fantastic book to read. This is the kind of book that even though it is available for free over the Internet, you still want to buy a paper copy. Here's the Amazon.com pre-order link.
It is written in a very engaging expository style. It explains the theory behind Subversion carefully, clearly, and thoroughly. It gives examples that can actually be carried out on the computer.
Creating a Repository
Creating a Subversion repository is done using the svnadmin program.
[weiqi@gao] $ svnadmin create svnroot [weiqi@gao] $ cd svnroot [weiqi@gao] $ ls dav db format hooks locks README.txt [weiqi@gao] $ ls db changes __db.002 __db.005 nodes strings copies __db.003 DB_CONFIG representations transactions __db.001 __db.004 log.0000000001 revisions uuids
Setting Up mod_dav_svn
FC1's Apache 2.0 installation contains a /etc/httpd/conf/httpd.conf that will include any configuration file from the /etc/httpd/conf.d directory. The subversion.conf file contain everything I need to configure a Subversion repository to be accessible from the network. All I have to do is to uncomment some lines and plug in my own repository location.
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so <Location /svn> DAV svn SVNPath /var/svnroot </Location>
After restarting Apache, I can point my browser to the URL http://localhost/svn and browse the latest revision of the repository. However to perform any meaningful action, I still need my Subversion client.
Add Content To Repository
Import is simpler with Subversion, compared to CVS.
[weiqi@gao] $ svn import foo http://localhost/svn/foo
Just for fun, I imported the Linux kernel source into my Subversion repository. Here's some interesting statistics:
- Before import, the kernel source tree directory has a du -s size of 207452. After import, it's 506092.
- Before import, the empty repository has a size of 1024. After import, the size become 493472.
- The import took 22 minutes on my machine.
- Checking it out to a different location took about the same amount of time.
The reason that the directory size is doubled is because Subversion creates a .svn subdirectory in each directory of the tree, and save a pristine copy of every file in the directory there. This allows Subversion to do several things without talking to the repository. It also allows Subversion to send only diffs when committing, which is not the case for CVS.
CVS Replacement
Is Subversion a good CVS replacement? Sure. It can do everything that CVS can do and do them better. Everything you've heard about how Subversion is a better CVS is true: versioned directories, atomic commits, easier branching and tagging (they are cheap copies), file and directory metadata (properties), not breaking binary files, nicer status outputs, safer updates/merges, etc.
We should convince Dave Thomas and Andy Hunt to write a version of their Pragmatic Version Control for Subversion.
Caveats
As much as I like Subversion, there are several things that I failed to do. I can't seem to build the Java bindings of the Subversion Client API (a SWIG based JNI deal). I can't seem to get the IDEA plugin (svnup) to work. The Emacs integration provided by vc-svn.el (a VC backend written by Jim Blandy) seems to work, but is lacking in some areas (e.g., I can't rename a file using it, probably because it VC still trying to do it the CVS way). Conflict resolution still is a manual process. Mature GUI frontends for Subversion seems still some time away.
Addition
"Multiplication is just a short hand for addition. 3 x 5 is just 5 + 5 + 5, three times."
"Oh. It's just a fancy way to do addition."
"Yes. Anything that can be done with multiplication can also be done with addition. But in the long run, you are better off learning multiplication."
"But I've been doing addition for almost fifteen years. Addition feels natural to me. Multiplication feels just so weird."
"It will feel weird for about a year or two. After that, you will think multiplication is the natural way to think."
"This multiplication thing sounds like magic. I'm afraid that if I use multiplication, the person succeeding me will not understand my work. I'm sticking with addition."
A conversation overheard a few centuries ago, when Multiplication-Oriented Methodology were invented, supplanting Addition-Oriented Methodology forever.
Multiplication has its share of problems years later.
Maven Tonight
Alan Wang of Connectria will talk about Maven tonight at the St. Louis Java Users Group.
Come on down to One City Place in Creve Coure. It's free and the session starts at 6:30pm.
The PowerPoint is here.
Update: The PDF is here.
Update: After the talk, I'm still not convinced that Maven will replace Ant for anything more complicated than a 2-bean project. This might be psychological: I worked on my Ant build scripts for many hours so I have a level of familiarity with it (and also an attachment). My build does a lot of wierd things such as unzipping an EJB jar, modifying its deployment descriptors, rezipping it and then include it in the EAR, or token replacements in property files, or invoking an Expect script to deliver artifacts to various servers. I doubt Maven would allow me to do all that without custom scripts. And I'm afraid that I would have to relearn how to do all these things in Maven.
The whole POM thing also scares me a little. We are going OO where transparency is absolutely the key. How would you "web developers" think if all of a sudden you were told your HTML pages are too repetitive, and your pages are all going to inherit from other pages, and "all you have to do is to override the part that you want to customize"? It wouldn't be "web development" any more, would it?
They Are Trying To Make Us Stupid, ...
... Don't let them.
Remember, when we were young, we were full of idealism, courage, curiosity and the desire to help others and make the world a better place.
Then, we went into the system. We were told a bunch of rules. We were made to conform. Before we knew it, we lived half of our lives, and become exactly like everybody else. We call the young people naive, inexperienced, overly optimistic now.
How did they do it? Here are some of the ways:
Blame: "The username/password you entered is incorrect." "Your session expired." "The application caused a severe problem, reboot your machine."
Scare: "Are you sure you want to make the change permanent?" "You get what you pay for with Free Software." "It takes a long time to change the specification."
Brain Wash: "The correct answer is A. I told you yesterday." "The correct answer is B, not A. I never said it was A." "The correct answer is A. If you heard me say B, you are out of your mind."
Trivialize: "With our framework, all you have to do is to fill in the blank." "Just follow the standard." "Our new <buzzword> technology will do everything for you."
Lie: "Computer virus is an inevitable fact of life." "Our product outperforms the competition. Just look at these independent benchmarks." "Windows is a user friendly environment." "2 inches in 3 weeks."
It is in the interest of big vendors, big media outlets, and big employers to keep us stupid. And we are virtually alone in the fight against them. Our best weapon is a healthy dose of skepticism, pragmatism, and self-confidence.
Don't believe everything you hear. Don't take any practice as the one true way. Don't blindly buy into the big solutions. Keep on using your brains. Pay attention to grassroot movements, ones not covered by the media.
And most important of all, don't let anyone convince you that you are stupid!
Ten Years of Spam
It's hard to believe, but the original spam, (archived here) is now nearly ten years old.
I remember exactly where I was and what I was doing when that piece of news group posting came across the wire.
Desktopless In Windows
And oh, I lost my desktop on Windows 2000 a few days ago.
I booted to the Windows 2000 Pro side of my dual boot machine that I set up 44 days ago to find some old files. Then the Windows Update tray icon showed up telling me some important security fix has been downloaded. I installed them and rebooted back, just to find that MsTask can't find SHLWAPI.DLL and the Login program cannot load msgina.dll.
I copied those two files from another Windows 2000 machine just to get past the no login problem. And now explorer.exe won't start. Neither would IE. I have to resort to the task manager to start a Cygwin bash shell to get any work done.
You can all laugh at me while I delete the NTFS partition and be done with Windows! (At least on this machine.)

