Tom McQueeney's posts
Comments on my blog posts are welcome. Just email me at my first name @ my last name .com and I will add your comment, as appropriate.
Click on a post's headline to read the full entry.
If you are a good Java programmer but want to become a great Java programmer, here are 22 tips to help you write better, clearer, more-maintainable Java code.
When most folks were out enjoying the fine weekend weather last Saturday morning in Arlington, the County Board met and approved letting government developers publish software as open source. Whether software the county shares with the open source community proves to be useful to other developers is a secondary issue. The exciting news here is that the county board’s unanimous vote is a good idea both for the open source community and the Arlington County government itself.
Here are some of the photos I captured today of Space Shuttle Discovery flying over D.C. today on board its Boeing 747 carrier. The shuttle circled around D.C. a few times before heading for its final resting place at the National Air and Space Museum Steven F. Udvar-Hazy Center next to Dulles International Airport.
Moonrise on Feb. 28, 2010
I have had continuing problems with ddclient being able to connect to the network and make an http call to check my current IP address. If you use ddclient and also see this problem, this workaround might work for you, too.
Rich Hickey, inventor of the Clojure language, and Stuart Halloway, author of “Programming Clojure,” presented introductory and advanced concepts of the young JVM language at Wednesday’s Northern Virginia Java Users Group. These are some of my notes from the meeting. The session served to whet interest in learning Clojure, thus these notes do not include a lot of code or explain Clojure’s unusual syntax. There are many other sources for that.
Let me start this review of Dan Brown’s latest novel by saying I read Angels & Demons and The Da Vinci Code and thoroughly enjoyed the stories and the storytelling. Second, although The Lost Symbol was at times painful to read, I do not join other critics who point out the preachy, moralistic ending. Sometimes we need a reminder to return to the basics of our morality. Finally, I plan to reveal minor details of the book here but I won’t disclose any plot twists or surprises.
For the past few months, tech publisher Manning Publications has impressed me with its marketing push by offering quick-strike discounts on print and ebooks. Until Manning’s recent marketing and discounts, I was buying a Manning book maybe once a year, and I almost never bought it directly from the publisher. Instead, I’d usually check sites like BestBookBuys to find who had the title I was looking for at the best price. But with its steep short-term discount offers, and my newfound fondness for ebooks, I have purchased Manning books in recent months on Groovy, Grails, Spring and Ext JS, almost always buying the ebook version for $10 to $15 — a great price for a tech book.
Technical pride prompted me to write my first Griffon application Tuesday. Griffon is a Groovy-based framework to write Java desktop applications. Groovy takes some of the sting out of writing Java Swing applications and Griffon relieves more of the burden. My pride came into the picture when Manning Publications released its daily Pop Quiz yesterday asking what technique one would use to process the shutdown of a Griffon application running on OS X. Manning posts a new question each day of September, and as of today, I’m running a perfect score. I couldn’t let a little question about Griffon stop me. However, since Griffon is so new (its stable release is 0.1.2) and developers are only now starting to play with it, googling around for a simple answer didn’t turn up much.
Jefferson Memorial at dawn this morning during the
D.C. Cherry Blossom Festival
Alfresco Software said Tuesday it will not release certain new enterprise features of the Alfresco content management products, such as high-availability clustering, as open source as a way to persuade freeloading companies to pay up. John Newton, CTO and co-founder of Alfresco Software Inc., posted notice of this new business strategy in a blog entry that effectively says Fortune 50 users of the free version of Alfresco are cheapskates. He reassures everyone in his blog that core components of Alfresco will remain open source and free. Alfresco thus joins other commercial open source projects, such as MySQL, in bifurcating their source code into a core version licensed as open source, and a version with features important to large businesses (the ones with money) available for a fee.
I installed Groovy 1.6 on Fedora from an RPM as offered on the Groovy download page and immediately got an exception stack trace when running groovysh or groovyConsole. I installed the groovy-1.6.0-2.noarch.rpm file, kindly packaged by Federico Pedemonte, then tried to run groovyConsole:
Share is Alfresco Software’s open source collaboration server. It’s a Java web application that stands as a free competitor to Microsoft SharePoint. Since I wrote earlier this month about how to modify the default footer text in the Alfresco content management server’s web client, I thought I’d follow up with even simpler instructions on how to modify the global footer in Alfresco Share. You don’t even need to stop and restart the web application server for this modification.
I created a Google Alerts to be sent daily to my Google mail account. I received daily emails for a week, then one day it stopped. Turns out Gmail filtered the Google alert to the Spam folder.
The web client for the open source Alfresco enterprise content management server ships with a footer that is added to every webpage via a JSP tag. The footer blends marketing and usage tracking with a copyright statement. It can be annoying to see on every page, especially if you are using the web client internally. The web client footer looks like this (from a clipped screen capture):
I was cleaning out a desk drawer last weekend and found a few old 3 1/2 inch floppy disks. The discovery made me realize that in order to read the data off those disks, I would have to pull the floppy drive from an old computer and install it in a functioning computer — and hope the new computer had the appropriate data connector, or that I could find an adapter.
After installing Fedora 10 last month, I finally got the Tomboy note-taking application working. I began using Tomboy in Fedora 8, and have several notes stored in Tomboy notebooks. When Tomboy broke in Fedora 10, I put it on my to-do list to figure out how to get it working. I figured the fix would be as easy as re-installing Tomboy. It wasn’t.
When I set out to install Sun’s latest Java development kit on my newly upgraded Fedora 10 development box, I discovered the previous instructions I had used on Fedora 8 from the Fedora FAQ no longer cover installing the Sun JDK. The instructions now refer only to OpenJDK using the java-1.6.0-openjdk package. After a short search, I found a newer installation technique, but unfortunately had to tweak it because it didn’t work with JDK 6u12.
For developers new to Java, here’s a tip that could make you look more like a ninja coder than colleagues who have been writing Java for years: learn how
super()works within constructors.
Even though Koen Aers from JBoss had to be up early Thursday to give a jBPM presentation at EclipseWorld 2007, he kindly stopped by our Northern Virginia Java Users Group (NovaJUG) meeting Wednesday night to talk about business process management in general and JBoss’s jBPM platform specifically.
Grails committer Jason Rudolph showed off the power of Grails at last night’s Northern Virginia Java Users Group (NovaJUG) using a technique guaranteed to impress. He started with a JDK, a Grails installation, and an empty directory. In a few minutes, he had a skeletal Java web application created and functioning in a web browser, ready for enhancement. Audience members literally oohed and aahed.
evalthem from Java without having to call a specific function or method by name.
Pop quiz: Hashtable is to HashMap as StringBuffer is to …
Yesterday saw another great celebration on the National Mall in Washington of our nation’s declared independence. Two hundred thirty-one years ago, the Continental Congress adopted Thomas Jefferson’s draft of the Declaration of Independence.
I opened an Eclipse project today, ran a unit test, and got a socket exception I’d never seen before. The project was one I had set aside a few weeks ago after playing with the NetBeans 6 preview release.
I left the real world yesterday to “attend” a technical briefing in Second Life, hosted by IBM, on what Web 2.0 means for business. I want to congratulate IBM for experimenting with virtual worlds. But in this case, the pretend physical nature of the online briefing detracted from the message and added nothing discernable. I spent more time fighting the Second Life client application than I did listening to the IBM presenters.
I spent last Thursday at the International Trade Center in Washington attending Sun Tech Days 2007, the last stop in a 15-city world technology tour showcasing what’s new in Java and Solaris. Here are some highlights of the day, and notes from the keynote address by Sun Microsystems CEO Jonathan Schwartz. Overall, the day was like a mini JavaOne: exposure to new technologies without actually teaching you how to use them. With most technical sessions lasting just 50 minutes, exposure is about all one can expect.
I just heard that Joshua Bloch from Google will be in downtown D.C. tonight presenting “Java Puzzlers’ Greatest Hits.” If you haven’t seen his presentation at a conference or JUG meeting, I highly recommend attending. Bloch throws Java code snippets or questions related to Java up on the wall, and audience members puzzle-out the answers. I learned things about Java that surprised me when I first heard his talk in 2004. The simple snippets of Java code in his questions often don’t do precisely what you’d think — because they won’t compile, because of primitive integer overflow, because the code stumbles into a collections corner case, or other Java language subtlety.
I’m working on a project for a client to integrate an existing web-based mortgage application to work with a large mortgage-loan consolidator. The existing application has a large code base originally targeted for Java 1.3. We needed to create an integration API and wanted to take advantage of some of the concurrency classes introduced in Java 1.5. The client gave approval to use 1.5 for the new code.
Last week, NASA and the United States celebrated 45 years of Americans in orbit. On Feb. 20, 1962, an Atlas missile launched astronaut John H. Glenn Jr. into a cloudless sky on a trajectory that allowed his tiny Friendship 7 spacecraft to orbit the earth three times. The successful mission let the U.S. hold its head a little higher after the Soviets beat the United States into space yet again (i.e. Sputnik) when it launched Yuri Gagarin into orbit aboard Vostok 1 on April 12 the previous year. The flight also helped the world believe the United States might actually achieve what President Kennedy had proposed less than a year earlier: to land a man on the moon and return him safely to earth.
When should you use Ajax? Whenever you want to create a rich client application with the universal reach of the Internet. Stuart Halloway, speaking Friday afternoon at this fall’s Northern Virginia Software Symposium, predicts Ajax will be part of nearly all web applications within the next year. Stuart’s first session of the day focused on the architectural issues involving Ajax, from technical features to selling Ajax to management. In 90 minutes he discussed:
Today begins the fall session of the Northern Virginia Software Symposium put on by No Fluff Just Stuff (Jay Zimmerman and crew). That means I have to decide which one of the six concurrent sessions to attend in each time slot. That means I have to decide which of five sessions to miss during each time period.
When I blogged in September about using the Java threading classes introduced in Java 1.5, I didn’t know a similar library was available in Java 1.4. It is, courtesy of the backport-util-concurrent package maintained by Dawid Kurzyniec at Emory University.
Like most tech geeks, I own multiple domain names and dozens of email addresses. I have configured many of my email servers with “catch-all” or wild-card forwards that allow mail sent to any address at a particular domain to be delivered to a particular inbox. One of my uses for this setup is to allow me to use unique email addresses when I give out my email address to online businesses. Doing so allows me to filter incoming email, immediately gauge the priority of email, and track if my email addresses leak beyond the online company with which I originally shared it.
The United States Air Force finally has a memorial in the nation’s capital. The memorial was dedicated Saturday in a ceremony attended by President Bush and other dignitaries. The memorial honors those who have served and those serving in the Air Force. Its triple stainless steel spires soar to varying heights up to 270 feet in a “bomb burst” flaring-out pattern.
If you have sat through the many sales pitches from companies selling SOA products, which you learn is defined as whatever their products used to be but now with a new, improved web services interface and UDDI registry, you’ll probably enjoy reading Grady Booch’s blog entry on Thursday.
On Wednesday, I ragged on Google for four of its good-to-terrible services that all could be better. Today I want to play fair and congratulate Google on one service that is so handy and useful, it has saved me time nearly every day: Google Browser Sync.
After using Google search for many years and being impressed with its lightening speed, using Google Maps and being impressed with its spiffy Ajax features, and using Google Earth and being amazed at how easy it was to zoom around neighborhoods and find features like subway stations, I find myself more and more disappointed by Google’s more recent services. Is googleplacency setting in at the Googleplex?
Here’s something you don’t see everyday: A black cloud of smoke wafting toward the U.S. Capitol.
Apache Tomcat comes with a simple ROOT webapp that is nothing more than a precompiled index JSP page. The text of this JSP page warns users not to bother trying to edit this index.jsp page in the
$CATALINA_HOME/webapps/ROOTdirectory. If you try, then reload the http://localhost:8080/ page, your changes won’t be reflected because the index page was precompiled into a JAR file.
After I installed the Confluence wiki, I discovered I need to do at least one thing to maintain it. By default, Confluence makes a backup of the site every morning at 2 a.m. The files will keep building up unless you do something about it. On a small Confluence site like mine, it would take a couple of years to fill the disk. But in case your site is large and you haven’t already put something in place to prune the older backup files, here’s a simple Unix shell script you can add to your Cron configuration.
I attended a talk tonight on Java concurrency presented by Stuart Halloway at the Northern Virginia JUG that provided a refresher on the java.util.concurrent package. Stuart is one of the founders of Relevance, author of Component Development for the Java Platform, a frequent speaker at technical symposiums, co-author of Rails for Java Developers, and a great technical speaker.
Of the many wonderful features I enjoy in the Mozilla Firefox browser, the feature to automatically perform a Google “I’m feeling lucky” search whenever I accidentally type a bad URL or keyword into the address bar isn’t one of them.
While planning my upgrade from Roller 2.1 to 2.3, I ran into an unexpected snag in Tomcat 5.5 running on Fedora Core 5. After I installed Roller 2.3 on my Fedora server and upgraded my database, Tomcat couldn’t seem to create the
<Resource>for the JDBC datasource. My catalina.log file had this unrevealing (to me) error:
Last night, I attended what was billed as the first-ever Atlassian user-group meeting. Scott Farquhar, one of the founders of Atlassian Software Systems in Australia, was here in northern Virginia for the event.
When I was looking for a Java wiki application to install on my personal Tomcat server, I saw that Atlassian offers a free “personal” version of its Confluence wiki server. Confluence is a super-wiki application that uses a database backend. Instructions are provided to setup Confluence with various open-source and commercial databases. It talked to my PostgreSQL server with no problem.
I recently upgrade my old RedHat 9 server to Fedora Core 5 and unexpectedly had to explore some of the intricacies of Security Enhanced Linux. The need to upgrade my home server came after I wanted to expose some public services, like a web server, to remote users. I was leery of opening ports on a server I hadn’t upgraded for more than two years. Upgrades to RedHat 9 were easy when I first installed it. The O/S came with the RedHat Network, a service that allowed me to upgrade packages with the click of a button. But then RedHat dropped the free RHN service, and I left my packages to languish in old, and probably insecure, states.
I got an obscure error message and stack trace from Sun’s Java Web Service Developer Pack 1.6‘s
wscompiletool. I tried to generate the server-side artifacts for a JSE web service using the following
I spent about a frustrating half-hour solving this one. Tomcat 5 has such a nice Windows installer, and good integration with Windows services, so I hate to rag on it. But for such a common situation, it seems this is a vast oversight in the Windows Tomcat installation program.
I think it’s fair to say that Maven has yet to catch fire among Java developers. Maven is complicated to learn and its documentation is lacking. Most Java developers who are using Ant probably have heard of Maven and its promise of easier automated builds. In fact, a fair number of Ant users probably have it on their To Do List to check out Maven to see whether it will save them time.
When I was a high school senior, my English teacher assigned (my translation at the time: forced) me to read Henderson the Rain King by Saul Bellow.
I checked to see what the next talk was going to be at my local Java Users Group (the Denver JUG) and saw that Eitan Suez was going to be presenting on The State Machine Compiler. My first reaction was, “What the heck is that?”
Are the scripting languages threatening Java?
I recently had to write a quick standalone Java application to manipulate data so it could be imported to Excel. I wanted to ensure only full records would be output even if the user hit Control-C during processing.
I momentarily got the Firefox upgrade blues when I upgraded my Pre 1 browser to the 1.0 release. As has happened nearly every time I’ve upgraded Firefox, my installed extensions break.
Despite Chris and his Powerbook coming to my rescue when my company-owned Wintel laptop couldn’t connect to a VGA overhead projector at last Wednesday’s Denver JUG meeting, I’m still concerned the Mac won’t work for me. I wouldn’t be able to run JDK 5.0 for some time, and that generally seems to be true for a lot of software: It comes out on the Mac much later or not at all.
I’m in the market for a new laptop. Many developers I know and respect own an Apple Powerbook. They say the usability is much better than Windows XP. Friends also recommend the Powerbook. One of them, Chris Huston, said there is no contest between the Powerbook/OS X and a Windows XP laptop. He said it won’t be one big Powerbook feature that will blow me away. It will be 1,000 little features that will continue to impress me every day.
In trying to build Apache Geronimo from the subversion trunk tonight, I noticed that eight JAR files are missing from the remote repository Maven uses to download the files.
Sun Microsystems said today it will pay Eastman Kodak $92 million to settle a Java patent-infringement lawsuit.
The Rochester Democrat and Chronicle reports today that Eastman Kodak reached an out-of-court settlement with Sun Microsystems regarding damages over patent infringement. Financial terms of the agreement have not been disclosed. This announcement comes two days after speculation that the Sun-Kodak case could prove pivotal for the tech industry yet have minimal impact on Sun Microsystems, with their $7 billion in cash and other assets.
In Eastman Kodak’s lawsuit against Sun Microsystems, Kodak alleged that Java RMI activation, Java IDL, and Enterprise JavaBeans technologies violate three patents owned by Kodak. But you wouldn’t know this from reading the technology press.
A federal jury today is trying to decide whether Java contains features that violate Eastman Kodak Co. patents.
With Java 1.5 released today, it got me wondering how many weeks it will take until I’m comfortable reading the new language syntax. Tiger’s changes are the first major syntax changes to the language in seven years, when features like anonymous inner classes were introduced in JDK 1.1.
I finally found an RSS reader that fits my application lifestyle. I’ve tried a few stand-alone RSS readers in the past, including one that runs under .NET, but none worked well for me.
It’s been more than a year since Sun Microsystems introduced its Fast Web Services technology at JavaOne 2003. I’ve been following the status of binary Fast Web Services because of my interest in increasing the speed of SOAP messaging in my projects, and discovered the U.S. military shares my interest.
Today I tried to install some new browser extensions into the latest Firefox 0.9.3 browser and couldn’t figure out why nothing was happening. I first tried opening the XPI file directly from the Mozilla Update extensions page. I clicked on one of the extensions I wanted (Adblock, highly recommended), and clicked the “Install Now” link. Nothing happened, like it wasn’t recognizing my click.
After thinking I couldn’t see using the new varargs feature in JDK 5 every day, I thought of a potential use that could cut down on repetitive code: initializing a bean or value object.
Here is a summary of the new language features coming this fall in JDK 5, taken mostly from a talk given Wednesday by Joshua Bloch and Neal Gafter at the Denver Java Users Group.
Whether you call it JDK 1.5 or 5.0, I had the pleasure this week of hearing a fantastic summary of the changes coming this fall to the core Java language. Even better, I got to hear it from two of the guys responsible for the changes, Joshua Bloch and Neal Gafter. They spoke earlier this week at the Denver Java Users Group. Their presentation slides are available on our web site.
Features and usability of free, UML modeling tools in Java was a recent discussion topic on the Denver Java User Group‘s email list. I thought I’d share the recommendations, and provide links with more information.
One of my all-time Microsoft Word annoyances is Word’s assumption that when you paste text into your document, the text should carry with it all the formatting from where you copied it. The problem shows up most frequently when I copy text from a web page or from an email message that isn’t written in plain text. This annoyance makes writing technical documents with Word much more annoying.
The large parent company of the consulting company I work for sent out a mass email Monday informing its tens of thousands of employees about its new spam filtering policies. The email mentioned that new email server filters soon to be in place will remove email messages, and I quote:
Today, I enabled Eclipse to warn me when my code accesses a “non-accessible member of an enclosing type” and learned something in the process.
I’m trying to figure out what to call the new version of Java when it comes out this fall. Will Java 5 catch on, or will everyone except Sun and maybe book publishers call it Java 1.5?
During a JavaOne session today, Linda DeMichiel, Sun’s EJB specification lead, said the EJB 3.0 experts group wants to make writing EJBs easier so that even “corporate developers” could write EJBs.
Can you run multiple Java applications in one virtual machine to boost speed and reduce memory requirements? Apparently, engineers at Sun are trying to find a way to do this. And from this first JavaOne session I attended this morning, it sounds like this could happen in the next year or so.
Scott McNealy, during his JaveOne keynote today, made sure everyone knew Sun Microsystems and Microsoft are partners moving forward. With a $2.4 billion check, MS and Sun will be working together for the next 10 years, getting the Liberty Alliance and Passport systems working together, getting LDAP and MS Directory Server to work together for an enterprise single-signon solution, integrating .NET and Java, and other joint ventures.
My favorite technical session of the day was the new concurrency utility package scheduled for release this fall in J2SE 5. (the newly rebranded J2SE 1.5.) If you’re writing multi-threading applications today and you’re not using Doug Lea‘s package, get it. The new java.util.concurrent package is based on it.
I just arrived at JavaOne on a sunny Sunday afternoon. I got side-tracked on my way over to the Moscone by the Gay Pride parade rolling down Market Street. At first, my goal was to cross Market to wend my way over to the conference center, but then the parade was fun to watch for a while.
I upgraded to Mozilla Thunderbird 0.7 today. Since I used the Windows installer for version 0.6, the uninstall was easy by using the Windows Control Panel.
Today I began refactoring some Hibernate data objects in order to use XDoclet to generate the mapping files. When creating the Ant taskdef:
First, some history on why I think the Java community missed a step in developing a standard way to use object-relational mapping tools for our data.
The client I’m working for wants to set up Cruise Control or another tool to assist with the continuous integration of their project code.
Not surprisingly, my first post to this blog is on the issues I encountered installing and getting the Roller webapp working with Tomcat and MySQL. I want to track these issues for my next installation.
subscribe via RSS