Sunday, May 15, 2005

Newbee NetBean Module Creation

Update 7/9/2005: Here is the link to running the module stand-alone.
Update 6/17/2005: Thanks to roxie for the comments that helped clean up the broken bits.

The following came about with the help of Charlie Hunt at Sun and Geertjan Wielenga, whose blog contained a series of posts about NetBean Module making for Dummies. The problem, however, was that I was below even the dummy level. So after a series of back and forth question-and-answer emails between the three of us, I was able to come up with a process as well as a series of steps for creating the NetBeans Module and for doing something with it after building the module. What follows is a distillation of that entire process.

It should be noted that it would make life much easier if there were additional support tools inside of Netbeans to take care of a lot of this, especially the hand-jamming of files. Geertjan talks about using Maven along with another NetBeans module. At the very least I certainly wish there were a more intelligent editor for build.xml files. Eclipse has something along those lines for building plug-ins, but I can't say that the Eclipse process is any clearer or easier than Netbeans. But now that I've cracked the code so to speak, I see the lack of such a super tool as an opportunity, not a problem. And so, without further hesitation, I give you:

Building NetBeans Modules for the Complete and Utter Idiot

The primary reason for creating a NetBeans module, or nbm file, is to extend the features and capabilities of the base IDE. The nbm file allows you to do this without having to touch a line of code in the IDE platform. What follows is a documented step-by-step process for the creation of a NetBeans module. There will be a part two showing how to run the module in the stand-along NetBeans Platform.
  1. Download NetBeans 4.1 IDE.
  2. Download the NetBeans 4.1 Platform binary archive. If you want the version for Windows, select "OS Independent" in the drop-down box.
  3. Install NetBeans IDE. Extract the NetBeans Platform into a different directory from the IDE. You will create a plug-in with the NetBeans IDE and load the plug-in the NetBeans Platform. You could also load the plug-in in the NetBeans IDE. But, if you want a "true" NetBeans RCP, then you'll want to install the plug-in in the NetBean Platform. Obviously, this would be different if you would want to develop a plug-in to be with the NetBeans IDE.
  4. Start the NetBeans IDE and prepare to update the IDE from the Update Center. We need to do this to finish installation. It will prepare NetBeans IDE to fully support the rest of this how-to. Updating from the Update Center takes five steps.
    1. From the menu, select Tools | Update Center. The opening dialog allows you to select where to look for updates. The web is the default selection. Keep it, and click Next.
    2. The module needed for this how-to is "Ant Extensions for Open APIs Support." You can select others if you want, but be sure to select the Ant extensions. Press Next.
    3. The next dialog shows the progress of the download.
    4. When the download is finished you are presented with a list of all the modules you selected in Step 1. Click the checkbox under the Global column. When the Question dialog comes up asking if you want to install the modules globally, click the "Yes to All" button. Click every checkbox under the Global column. When done, click the Finish button.
    5. The IDE will install all the modules. When the modules are installed, allow the IDE to restart itself to completely finish installation. After restarting the IDE environment is now ready to continue.
  5. For this example we want to convert the Anagram Game, a sample application in the NetBean IDE, into a plug-in. Start by creating a J2SE Anagrams Game project. On the welcome page click the "Sample Project" button. Alternately, you can create a new project from the File menu: File | New Project | Samples | General | Anagram Game. When you've selected the Anagram game, click Next and Finish on the second step of the dialog.
  6. We need to modify the Anagram source file so that it can be used as a plug-in. Open the file by double-clicking the file in the File view. When it first opens you'll be in form design mode. Click the Source button and find the two methods exitMenuItemActionPerformed and exitForm (they're close together in the source body). Instead of exiting the application by calling System.exit(0) when you close it, you want to dispose of the plug-in/module when you close it. Therefore replace the code body of these two methods with the following lines of code:
  7. We've made our modifications to existing files. Now it's time to create new content. The first item to create is the Java file ShowAnagramsAction. In the Files tab, expand the src folder down to the anagrams folder, then right click on that folder and select New | File/Folder. When the dialog opens simple select Java Class under File Types, and click the Next button. In step 2 of the dialog file out the dialog as shown here and then click Finish. Creating classes on the File tab at the right level in the source tree keeps typing to a minimum. All you have to do is give it the class name.
  8. The source file is created and opened in a new editor on the right of the IDE. You'll have to add additional code as show next for it to function correctly. Added code is shown in red.
    * Created on May 12, 2005, 10:30 AM

    package com.toy.anagrams;

    import com.toy.anagrams.ui.Anagrams;

    * @author wbeebe
    public class ShowAnagramsAction extends CallableSystemAction
    public HelpCtx getHelpCtx()
    return HelpCtx.DEFAULT_HELP;

    public String getName()
    return "Anagrams";

    public void performAction()
    anagrams = new Anagrams();
    anagrams.setBounds(400, 200, 400, 220);;

    public ShowAnagramsAction()

  9. When the edits are finished the file should look like this. Note the red indicators in the left gutter of the editor. In order to remove these reference errors you need to reference the jars that hold these classes and then find and import the classes that contain these definitions. The first step is to add the jars to the project. In the Projects tab on the left, open the Libraries folder. It should be empty. Right click on the Libraries folder and select the Add Jar/Folder dialog. With the dialog you need to add three jar files (you'll need to do this three times): <NetBeansIDE-install-root>/platform5/core/openide.jar, <NetBeansIDE-install-root>/platform5/core/openide-loaders.jar, and <NetBeansIDE-install-root>/nb4.1/ant/extra/nbantext.jar. Once the jars are in the project set the focus on the editor and press the keys [Alt][Shift][F] to fix your imports, or right click in the editor and select Fix Imports from the pop-up menu. When it's finished, the correct imports will have been made like this.
  10. The next item to create is the layer file. This will add an entry to the IDE's menu so that we can execute Anagram module. In the Files tab open up the src folder down to the anagrams folder. Right click on the anagrams folder and select New | Xml Document. The dialog will open at step two. Type in 'resources/layer'. This will create both the resources directory where this file should reside as well as layer.xml. Don't add a file extension, or you'll wind up with layer.xml.xml for a file name. The final dialog asks what type of document. Select well-formed and then click Finish. When the XML editor opens up you'll have a root element to the file. Remove those and replace with the following:

    <!DOCTYPE filesystem
    PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN"
    <folder name="Menu">
    <folder name="Games">
    <file name="com.toy.anagrams.ShowAnagramsAction.instance"/>

    When finished, your file should look like this.
  11. The next item to create is the manifest file. Once again, in the File tab, at the top-level anagrams folder, right click and select New | Empty File... The dialog will appear, and you should type in in the file name. Click Finish, and then go over to the editor. Edit the file with the following:
    Manifest-Version: 1.0
    OpenIDE-Module: anagrams/1
    OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.0
    OpenIDE-Module-Layer: com/toy/anagrams/resources/layer.xml
    OpenIDE-Module-Specification-Version: 1.0

  12. At this point we need to stop and modify a properties file. In the Files tab open up anagrams/nbproject/ Add the following lines at the end of the file and save it.
  13. We've reached the point where we need to build everything. In order to do this we need to modify the build.xml file. The purpose is to add build targets and actions that will create the necessary NetBeans assets and the final module. Open up the build.xml file and add the following before the end of the closing project tag:
    <target name="create-xml-file-for-module" description="Create XML File.">
    <!-- Create directory for JAR. -->
    <mkdir dir="netbeans/${modules.dir}"/>

    <!-- Create directory for JAR's XML file. -->
    <mkdir dir="netbeans/${modulexml.dir}"/>

    <!-- Copy the JAR after building it. -->
    <copy file="${dist.jar}" todir="netbeans/${modules.dir}"/>

    <!-- Create the XML for the JAR. -->
    <taskdef name="createmodulexml"
    classpath="${javac.classpath}" />
    <createmodulexml xmldir="netbeans/${modulexml.dir}">
    <enabled dir="netbeans/${cluster.dir}">
    <include name="modules/${}.jar"/>

    <target name="create-nbm" description="Create NBM File.">
    <taskdef name="genlist" classpath="${javac.classpath}"
    <genlist outputfiledir="netbeans/${cluster.dir}"
    <fileset dir="netbeans/${cluster.dir}">
    <include name="modules/${}.jar"/>
    <include name="config/Modules/${}.xml"/>

    <taskdef name="makenbm" classpath="${javac.classpath}"
    <makenbm file="${}.nbm" needsrestart="false"

    <target name="-post-jar" depends="create-xml-file-for-module,create-nbm" />

  14. To make it easier to build our module, a new Ant target was added to the build file. When you include the Ant target "-post-jar", you don't have to run its two dependent targets manually. The NetBeans IDE defines a number of Ant targets as placeholders, which you can fill in with whatever you like. Target post-jar, for example, is automatically run after a project is built (which means that the JAR is available and the JAR is what you need when creating the NBM plug-in/module).
  15. Now you are ready to build the project. Right-click the project in the Projects window and choose Build Project. Check that the build messages are the same as here. The messages will be at the bottom of the IDE in the output section. Note that the anagram.nbm file is now in the Files section. Congratulations! You've got an nbm file!

Next: Running Our Module in the NetBeans Platform

Star Trek:Enterprise - Gone and Certainly Forgettable

I sat through the two hour finale of Star Trek:Enterprise, silently chastising myself for wasting all that time. I would have been better entertained watching paint dry. Both episodes were weak, with the second the weakest of any Star Trek episode I've ever seen. I thought it was worse than any episode of the original series, which in my not so humble opinion contain the worse Trek episodes of any Star Trek series I've ever seen and is why the original series deserved to be canceled when it was.

The first good-bye episode, "Terra Prime", shows why Peter Weller was so good as Robocop. His wooden delivery and clock-like timing were perfect for that role. Unfortunately those attributes were ill-suited for the part of isolationist leader Paxton, determined to drive all aliens off Earth. Paxton is a radical, a revolutionary, and the actor chosen for that part should have exuded fire, energy and emotionalism. Instead we got Weller. And we got a story with absolutely no surprises and completely predictable.

The second episode, "These Are The Voyages", was so lame as to be worse than the SciFi Channel's Farscape, by far the silliest science fiction series to ever hit the airwaves. We get Riker and Troi played by two folks who are definately long in the tooth and a smidge too large to fit their uniforms. The biggest strikes against the story were using the holodeck crutch to tell of the last voyage home and showing how Cmdr Tucker met his death. And right at the very end, right when it would have been interesting to hear the speach that Archer gave that was so inspiring and led to the creation of the Federation, we get Riker turning off the holodeck because Troi had had to memorize it in school and didn't want to listen to it yet again. If Roddenberry were still alive we would have had an excited Troi saying "I never tire of hearing this speach" and we would have heard that speach ourselves. But no, we get reality. She's tired of it, and it matches our own fatigue with the whole Trek universe.

What was truly sad was the very end of "These Are The Voyages". You saw all three Enterprise craft, going from the 'D' to the original series Enterprise to the NX-10. And you saw how much the series art had changed over time. You could see there was a direct lineage between the NX-10 and the Enterprise D, but the poor old original Enterprise stood out like a sore thumb.

Enterprise certainly deserved to be canceled. Based on the premise, wooden acting and recycled and/or lame story lines, it should have never left the mythical space dock. I watched Enterprise on and off until the attack by the Zindi (I don't care if the spelling is wrong, I don't care to look it up; so sue me) when they attacked Earth and torched part of future Florida. Being a Floridian I was morbidly hoping they'd hit Disney, or Universal, or maybe some super condos (yes, I live in Orlando). No, the Zindi just chewed up some mixed use real estate and bestowed Trip a massive guilt trip for not being there to protect a loved one (I don't remember who and please don't bother to tell me). After that I stopped caring and watching.

Enterprise failed because it lacked true originality and enthusiasm. The Trek universe has been sucked dry of original ideas by movies, series, books, and Paramount which seems determined to wring every last dime out of the franchise. Trek isn't just tired, it's dead, Jim. The fanatics who wear their pointed ears just so and who read their Shakespeare in the original Klingon will holler for some time, but the rest of us who listened to Shatner's SNL skit and got a life have long since moved on to better, fresher material. I for one was happy with Babylon 5, and my interest has been piqued by Joss Whedon's Serenity.

Good bye Trek. Don't come back until you've got something really interesting to tell me. 'Cause otherwise I'll just kick your limp ass right back out my door.

Sure as I know anything, I know this: I aim to misbehave.

Just Say GNo to Gnome

After having come away bloody and battered battling Fedora Core 4 test 3, I was in no humorous mood when I came across OSNew's ( story titled "The Java Vs Mono Debate Continues on Gnome". But before I tear a new one for Miguel, let me rant a bit about Gnome and Fedora Core 4.

I bloody well hate Gnome. I think what sends me ballistic is the spastic spatial default mode in nautilus. Every time I install a new version of Redhat with its default Gnomish desktop, I wind up with all the Gnome bits and the nautilus spastic default mode. And yes, I do indeed care more for KDE than for Gnome. It wasn't always that way. In the early days of the KDE vs. Gnome competition I preferred Gnome much more than KDE. It looked better, seemed to execute faster, and when Nautilus first appeared it was really nice and much superior to Konqueror. But then the bloody GNU ideologues took over, and we had one ideology war after another sapping time and energy that should have gone into Gnome and GTK.

So I stupidly downloaded the Fedora Core 4 test 3 DVD ISO, and burned a new DVD using K3b on SuSE 9.1 because Nero 6 won't burn FC DVD ISOs under Windows XP. Burns everybody else's ISOs. Go over to my FC3 system, which was tweeked and running fine and like a fool installed FC4t3 on top of a perfectly good FC3 instalation. That's when all hell broke loose. I wound up in Gnome hell all over again, and when I tried to use KDE 3.4 as my preferred desktop the KDE panel kept core dumping. Further, gimp 2.2 wouldn't start up due to an 'illegal instruction error' when it tried to run SSE instructions on my Athlon box. Other features were either tattered or just plain broke, and after two days of trying to fix stuff I finally swore off Fedora Core completely and installed SuSE 9.1 Pro on that box just like I have on all my other home systems.

I mean, how can a group of people take a perfectly good distribution like Fedora Core 3 and screw it up as badly as FC4t3 seems to be? Was it the move to gcc 4? I've managed to build gcc 4 successfully, but some of the more complex applications I've built with it do not like being mangled by gcc 4. And some of the messages on the gcc mailing list don't inspire me to move an entire distribution over to gcc 4. Either the Fedora team needs to wait for gcc 4 to settle down with several more point releases, or they need to move back to gcc 3.4.3. If they release this pile of crap anywhere near the way it is right now it will be a total frikkin' disaster.

While in such a fine state I ran across Havoc's screed at where he carried on about what folks had written concerning Mono, especially Havoc over at Redhat. What really caught my eye was this comment at the bottom of his blog:
I can only smile when I see that Havoc tells people to try Java 5 as an alternative to Mono. Specially considering that any use of Java 5 features will likely lock people into using Sun's proprietary Java.

Excuse the hell outta me Miguel, but isn't Mono built on Microsoft's C#? The features in Java 5 are features that the rest of the programming world have been asking for a long time, and they're features that match what C# version 2 delivers, such as generics and autoboxing, just to name two. So I use a version of Java that matches capabilities found in a language from Microsoft and you call what I use proprietary? Pull your head from out of your arse and look at the devil you've decided to live with. At least I've got a language from a vendor (Sun) who has a lot more F/OSS cred than Microsoft does. Talk about a pot calling a kettle black. If using Java 5 is proprietary lock-in, then I'll take that over the Microsoft cool-aid you've been drinking.

Hey Google: How About A Page Template Editor?

Finally had enough with some of the annoying nits of this blog's page template to do something about it. I had to go hunt down where the ordered list and unordered list XHTML tags were being defined in the style sheet for this particular page template and modify those styles. It's one thing to pick a graphic for the unordered bullet, it's another to pick a graphic for an ordered (enumerated) list. When I want a numbered list in my posts, I want a numbered list in my posts (see the post preceding this one for what I mean). Right now the slight tweaks have removed that graphic bullet everywhere.

I have a suggestion for Google. Take some of those card-carrying PhDs you have working on the neat stuff and have them whip up a nice template editor, or better yet, a complete template composition tool. Yes, you'd get some hideous pages. But the system is already pretty easy to correct anyway. All I have to do is reset my messes by picking another stock template and then start over. Editing the template's raw HTML is a royal pain in the ass when it's in an unadorned text box. Give us something very similar to the tool used now to compose posts. Please?

New Java In A Nutshell Book

I've now got a new roach killer sitting on my bookshelf: O'Reilly's "Java In A Netshell, 5th Edition." And if you're a Floridian, you know how important having a good roach killer is. I've had a Java Nutshell book sitting on my bookshelf since 1.1. I never had one for 1.0 because Java was small enough to understand. I could use Javadoc exclusively to find everthing I cared to know.

The latest version weighs in at 1224 pages and covers the core part of the language. Compare this with the 4th edition, which stopped at a svelt 969 pages. The new version also returns to the use of marking each package section in the book, making it a lot easier to navigate to the package (and class) you're trying to look up. The 4th edition dropped the marking and annoyed quite a few programmers, some who recommended not bothering to purchase the book just on that one flaw.

The book is organized as follows:

Part 1. Introducing Java
  1. Introduction
  2. Java Syntax from the Ground Up
  3. Object Oriented Programming in Java
  4. Java 5.0 Language Features
  5. The Java Platform
  6. Java Security
  7. Programming and Documentation Conventions
  8. Java Development Tools

Part II. API Reference
  2. java.lang and Subpackages
  3. java.math
  5. java.nio and Subpackages
  6. and Subpackages
  7. java.text
  8. java.util and Subpackages
  9. java.crypto and Subpackages
  10. and
  11. and Subpackages
  12. java.xml and Subpackages
  13. org.w3c.dom
  14. org.xml.sax and Subpackages


The biggest change is chapter 4, "Java 5.0 Language Features." That 44 page section covers generics, enumerated types, and annotations. Other features new to Java 5 such as autoboxing, the for/in loop, varible length argument lists, covariant return, and the import static directive are covered in chapter 2, "Java Syntax from the Ground Up." The reader would do well to read both chapters and to pay attention to the examples.

Compared to the forth edition, it looks like JavaBeans have been dropped from the fifth edition. The fourth edition's chapter 6 and the java.beans package documentation (chapter 9) are gone. Another package dropped in the fifth edition is org.ietf.jgss (chapter 22 in the forth edition). One additional package dropped from the fifth edition was package documentation. The author covers these changes in a paragraph in the preface, and goes on to say:
JavaBeans standards have not caught on in core Java APIs and now appear to be relevant only for Swing and related graphical APIs. As such, they are no longer relevant in this book. The package has been deprecated since Java 1.2 and I've taken this opportunity to remove it. And the org.ietf.jgss package is of interest to only a very narrow subset of readers.
Still Relevant

In spite of its heft the Java Nutshell book still remains relevant. It's a lot easier to sit back and just read the material in a book. It requires no battery power or computer to just pull down the book and look something up. And the material has been slowly corrected over time. My only complaint is that a completely searchable electronic version isn't available to sit next to my development tools while I work. But with autocomplete in Eclipse and Netbeans even that need is no longer as vital as it would be if I were, say, working in just a text editor.

My only concern is where the dropped material will wind up. Coverage of the AWT and Swing were dropped in the forth edition and wound up in its own book. The only problem with that is the Swing nutshell book appeared on bookshelves a long time after it was needed. I'm hoping that the JavaBean material will wind up in the Swing book, and that the Swing book shows up fairly quickly.

Netbeans 4.1 RC2 Impresses

I like integrated development environments (IDEs). When implemented correctly they make development very efficient, especially for the Lone Coder. I got bitten by the IDE bug with Borland's Turbo C 1.0 when it was released back in the late 80's. I drove over to a local college bookstore (UCF) and picked up my very own copy when it first came out. From that moment forward I've used IDEs on every environment and for every language (and yes, folks, emacs does qualify as an IDE).

The best IDE out on the market today is Microsoft's. While Borland might have started early and had a long distinguished run, in the end Microsoft overcame all odds. The only problem with the Microsoft IDE is the cost. Depending on what features and languages you purchase from Microsoft, getting to use its IDE can range from pricey to too-damned-expensive-for-my-budget. Oh, and the obvious limitation: it's only available for Windows.

For the most part I've stuck to emacs (and even xemacs) and dabbled with free IDEs for some years now. Those free IDEs included Sun's Netbeans, IBM's Eclipse, and Borland's JBuilder Community. Over time Sun's and IBM's IDEs have improved to the point where they now challenge every other commercial IDE at the low end, and encroach on them in the middle of the market.

A Satisfied Eclipse User

I use Eclipse for most of my work. I've used Eclipse since version 2, and Eclipse just keeps getting better. It's a fast and very powerful Java development IDE. The latest version, 3.1 M6, is still under development, but its added features over 3.0 are so compelling that I've pretty much moved to it for all my work, going back to version 3 only for those plugins that are not yet available for 3.1 (such as the Laszlo IDE).

Eclipse also works on the two operating systems I care most about, Linux and Windows. It provides equal capabilities on both operating systems, and the plugins I've accumulated over time allow me to program in C++, Python, and Ruby as well as Java. I've also installed plugins that allow me to work with Tomcat, JBoss, Hibernate, and MySQL. In short I have a very complete development environment running on top of a complete development management foundation.

But that hasn't stopped me from pulling down and trying out Netbeans.

Netbeans 4.1

I've been quite impressed with Netbeans since its 4.0 release. I still felt Eclipse was superior to 4.0 for my needs, but I did appreciate the great amount of progress and polish that went into the 4.0 release compared to the 3.6 release. It ran much faster and looked considerable better than any other release of Netbeans before 4.0.

Now I've been working with Netbeans 4.1 (RC2) and I must admit that it has pulled equal with Eclipse 3.1 (M6). And that, to me, is astounding. Sun and the Netbeans crew have been working very hard to improve Netbeans 4.1 and it shows. It also ties in with Sun's hard work to improve Java in general. I've been working with J2SE 5 since its beta, and I believe that J2SE 5 is the best release of the language to date. What the release of J2SE 5 and Netbeans 4.1 shows is that Swing can be as efficient and as good looking as Eclipse's SWT/JFace combination.

As a test of Netbeans 4.1 I have created several projects. One of them was simply to check out (via cvs) SwingX, new extensions to Swing that appear to be answers to the SWT/JFace challenge of richer, easier-to-use GUI components (see for more details). The swingx code was saved as a Netbeans project, so once it was checked out locally I was able to open it as a Netbeans project. I then went over to the Javalobby J2EE programming forum and typed in an example that used swingx (see "SwingX: Translucent Panels 101" by R. J. Lorimer). I was able to quickly and easily type in the example code, and it was every bit as fast and easy as if I had done everything in Eclipse.

What's more interesting is that out-of-the-box Netbeans can do many of the functions that I have to load external Eclipse plugins to accomplish in Eclipse. With 4.1 I was able to attach to and work with MySQL as well as Tomcat (Netbeans comes bundled with Tomcat 5.5.7). Netbeans is aimed squarely at making programmers productive developing Java applications without having to add anything else to the package. This is a different emphasis from Eclipse, which has worked on making Eclipse as extensible as possible. But somebody must have been looking at what plugins Java programmers were downloading for Eclipse, because the built-in capability with Netbeans hits all the sweet spots.

A Powerful Competitor

Granted I'll need to do some more serious testing over time before I can make a more definitive comparison, but right now at first blush I really have to hand it to Sun. It is as fast and as powerful as Eclipse on both Windows and Linux. Sun has evolved a powerful and open development tool. And it has one very compelling point in its favor that Eclipse lacks. The UI is Swing, and I know Swing a lot more than I know SWT and JFace. I have been looking to build stand-alone applications on top of the Eclipse Rich Client Platform, but I am now reconsidering that decision in light of Netbeans 4.1.

Way to go Sun!

Disaster Strikes - Google's Blogger Bites Me In The Ass

Blogger sucks. Late Saturday night I tried to create a new blog for posting Java articles, and it failed. Twice. The creation process hung twice at 10%. When I went back to my dashboard and tried to delete the bogus blogs, I wound up deleting the good working blog. The only thing that saved me was a browser window open with all my May entries. I cut and pasted the entries to Word, then recreated blogbeebe and cut and pasted them back as new/old entries.

The problem is there are few other blog hosting sites that have the same level of features as Blogger/Blogspot. And an email to support only got me an automated response. I'll stay here and I'll back up. But from this point forward I'm looking for a new home. I know what I did and I did not select the good blog for deletion. There's a flaw in the system. If I hit another disaster like this last one then I'm afraid it's another painful search for another blog home.

Does anybody have any good suggestions?

Monday, May 09, 2005

Linux - Still A Long, Long Way To Go

People tend to ask me if Linux is right for them. It's a fair question to ask given all the hype and press surrounding the operating system as well as the nearly daily articles about Window's security woes. I always have to stop and think about the person asking me that question because, even though they're very bright and quite good at what they do, they look at their computer as an appliance, a means to an end.

For the majority of the people who ask I either direct them towards a Mac with OS X or to an upgrade of Windows to XP, especially with service pack 2. In both cases this usually means a hardware upgrade, especially if they go with OS X. But in the end they really are happier with Apple or Microsoft, far more so than if I had sent them on their way with Linux.

How is it that a Linux guy wouldn't evangelize and point those folks towards Linux? Because Linux still isn't ready for the general masses. Read the following story of my very recent experiences when I had to change a video card on a Dell Precision 350 where I work, and wonder no more why I'm very careful what I recommend to folks.

I had two stock Precision 350s with ATI 7000 video cards. Both had Redhat 9 (RH9) installed on them. The video cards drove Planar CT1905S LCD monitors. One of the two systems video monitor started to show a shearing of the video image which rendered it nearly unviewable. Some simple testing narrowed the problem down to the video card on the errant system, so I asked my IT support group for a new video card. They gave me an ATI 9600XT as a replacement.

Now, if this were a Windows system I'd open up the box, swap the cards, button everything up again and power the system back up. I might want to hit the ATI website to get the latest drivers, but the fact is that Windows would have come right back up and continued on. Unfortunately you're not guaranteed this ease of use with Linux, especially with older distributions such as RH9.

I'd already checked via Google to see if there was any forum chatter out on the web with this combination of Linux and video card, and sure enough, there was. I already knew about having to download ATI's Linux driver and building it as a kernel module in order to turn on and use the video card's hardware acceleration. But before I did that I just wanted the new card to come up without any other hassles.

The X windowing system under Redhat 9 uses a configuration file located at /etc/X11/XF86Config. There is a section in that file labeled “Device”, which is shown below.

Section "Device"
Identifier "Videocard0"
Driver "radeon"
VendorName "Videocard vendor"
BoardName "ATI Radeon 7000"

The device section was changed as shown in bold red text below. The key to this change is the chip id attribute. This attribute overrides the auto detection feature of the X server. Under normal circumstances the X server will determine the video chip and load the appropriate driver. Unfortunately there is no entry in the R9 X server for the R350. But there is one for the R300, which is the ATI 9500/9700 video card. The ATI 9600XT can be treated as a 9700 (that’s the PCI ID/chip id 0x4145) and it will work, allowing the X server to come up. This one-file modification is the easiest way to bring the 9600XT up in the system.

Section "Device"
Identifier "Videocard0"
Driver "radeon"
VendorName "ATI"
BoardName "ATI Radeon 9600XT"
VideoRam 131072
ChipId 0x4145

The problem with this solution is that it does not enable hardware acceleration. The X server does enable hardware acceleration for the ATI 7000. To enable hardware acceleration for the 9600XT you need to download, build, and install a kernel module from the ATI website. What follows are the basic steps for adding hardware acceleration to a system running RH9 and using the ATI 9600XT video card.
  • Use the first step above to make sure your X desktop is operational. You want a working desktop to begin with.
  • Go to the ATI website ( and download an RPM module. For this example it was fglrx_4_3_0-8.12.10-1.i386.rpm.
  • Set user (su) to root and install the RPM: rpm -hiv --force fglrx_4_3_0-8.12.10-1.i386.rpm
  • Make sure you have the kernel sources installed. For our systems I installed the kernel sources for the initial installation kernel, then downloaded the latest kernel (2.4.30) from and build it. Our systems now run with 2.4.30, not the 2.4.20 version that comes with out-of-the-box Redhat 9.
  • Change directory to /lib/modules/fglrx/build_mod. Change the execution permissions on (chmod +x Execute and build the kernel module.
  • Move up one directory to /lib/modules/fglrx. Change the execution permission on (chmod +x Execute and install the module.
  • Run fglrxconfig. This script will help you build a new X server config called XF86config-4 under /etc/X11. When you’ve finished building this you need to log out of your account and then log back in again. The X server will re-initialize with this new configuration and the newly built ATI kernel module.
When you’re back in the system you can run two tests to see if hardware acceleration is working. They are glxinfo and fglrxinfo. glxinfo provides a large amount of information. What you’re interested in is the ‘direct rendering’ string at the top of the output. You can grep the output looking for ‘direct rendering: Yes’. If it’s ‘No’ then you’ve got a problem and you’re going to have to go digging. The other tool fglrxinfo produces a much shorter output:

display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: RADEON 9600 XT Generic
OpenGL version string: 1.3.5010 (X4.3.0-8.12.10)

Although the greatest beneficiary of this effort are applications that use OpenGL, all graphic applications will benefit from the kernel module, including the X desktop.

And that's not the end of it. I had the same problem with my home system running Fedora Core 3, an ATI 9600SE, and kernel Turns out that changes to the kernel after 2.6.11 broke some of the ATI source. I had to hunt down two patches and apply them (with patch) and then build the module before I could load it. After that hardware accelleration was working just fine.

I can do this because I know how. It doesn't bother me to live on the bleeding edge, and what happened under FC3 with the latest kernel is something I find interesting. But changing video cards under Linux in this day and time is equivalent to calling out a Florida Power bucket truck to change a light bulb in my bathroom. There are some serious architectural and proceedural flaws in the Linux system, and until those shortcomings are fixed Linux will never be suitable for anything except servers or embedded niche markets where the platform can be tightly controlled.

And I'll keep sending people to Apple and Microsoft.

Is Pamela Jones Baiting Maureen O'Gara?

In my last post on the subject I (see "Why Pamela Jones Deserves to be Outed") I hypothesized that MoG was outing PJ because of the heat MoG was getting from the Linux fanatics, egged on in part by PJ herself. A message appeared on the Yahoo SCOX board today that seems to echo that sentiment (a highly recommended message I might add).

Re: PJ on MOG
by: jwhitf
(M/Boston, MA)

05/09/05 11:30 am
Msg: 263006 of 263069

<<<Moreover, what, exactly, do you suppose MOG is up to? What's the point, if not an attempt to intimidate and silence Ms. Jones?>>>

Simple; she's venting. She's angry and casting about for a way to get back at PJ, assuming that PJ is the reason she's being so roundly criticized. Anybody who's been in enough flamewars realizes that there is a point where frustration boils over and it is extremely difficult to keep from responding irrationally. PJ's been baiting MOG for some time now -- I'm not surprised MOG lost it.

The problem, however, is that her base assumption is flawed. The cause of her problems isn't PJ -- although PJ is certainly an enthusiastic contributor. MOG's problem is that she has not only sided with SCO but has been reprinting SCO's story as if it were proven fact. Since SCO's basic theory is that the entire Linux community consists of liars and thieves, it's either disengenuous or clueless to express shock that the tone of the response should be angry.

MOG's got much bigger problems than one paralegal blogger.

Yep. Such is the day-to-day goings on at the Yahoo SCOX board. Let's see how badly we can egg somebody on, and then sit back and laugh as the target lashes out. Like I said earlier, PJ needs to be outed. More importantly, PJ needs to be brought down a peg or three. She's taken on a holier-than-thou persona that is become quite insufferable. I have, at the very least, stopped going by. If I do go by in the future it will be to deliver to her what she enjoys dishing out to others, especially to MoG.

I care deeply about Linux and want to see it grow. But I want to see it grow honestly. Actions by a number of the posters on the SCOX board as well as by PJ do nothing but taint the reputation of those of us who just want to get the job done. And you know how the Linux kernel hates things that are tainted.

Sunday, May 08, 2005

Why Pamela Jones Deserves to be Outed

There's been a firestorm of controversy raging on the Yahoo SCOX boards since Friday, May 6th. That's when Maureen O'Gara (or MoG as she's known to her fans), that hard-hitting investigative journalist, published her latest Pulitzer prize contender titled "Who Is Pamela Jones?" (see I'll leave it to the gentle reader to follow the link and read for themselves the artful, witty, and modest way Maureen followed the elusive trail of nefarious Pamela Jones, that trouble making gadfly of hard working SCOX and publisher of "super" blog Groklaw (

Sarcasm aside, there is an important reason why PJ, or Pamela Jones, should be publicly identified. PJ, through Groklaw, has made herself a high-profile celebrity through her actions on her blog. She's had tremendous help from the community in finding evidence, publishing court documents, and providing eye-witness accounts of the ongoing SCOX vs. IBM court case. The facts of the case are of tremendous value to the Linux community.

PJ, however, has done more than just report the facts of the case. She's editorialized. She's injected her opinion into the Groklaw documentation. And she's made some pointed observations about the players in this drama, one of whom is our own gentle MoG. I have no problems with PJ voicing her opinions. She has her First Amendment rights just like anyone else. The problem is that she wants to hide while she does it, and that's not right.

As long as PJ was just reporting the news an argument could be made that she should remain anonymous. But when PJ leads (at times) the pack with her commentary against very public figures such as Maureen O'Gara, Laura Didio, and Rob Enderle, then what's good for those geese is quite appropriate for that gander. No one who is for Linux and against SCOX thinks twice about publicly excoriating SCOX supporters. And it's real easy to do so because all the targets are very public people. Their pictures are on the web as well as their personal and professional information. Noticeable by her absence is PJ.

It's obvious I am no fan of MoG. I strongly disagree with what MoG publishes, but I restrict my comments and opinions to her published work. Unfortunately I'm in a minority when compared with the hard-core Linux faithful. MoG has been hounded by the Linux fanatics with Groklaw's tacit approval to the point where she wants PJ's blood. And if I were in such a situation I would want the same myself.

If PJ wants to run with the big dogs then she's going to have to do so under the same rules of engagement all the other players are forced to use; as a publicly known figure, and not some name on a blog. If she can't (or won't) play, then she needs to go back to just reporting the facts of the case and keep her opinions to herself. But considering what she's said and how long she's been saying it, it's way to late to turn back now. I hope Maureen is successfully in her pursuit of PJ, and if there's anything I can do to help, I will.