Programming

Peer into the future with JXTA

My November 2003 Java Matters column for Linux Magazine is now available online. It covers JXTA, a set of XML protocols for peer-to-peer network programming created as an open source project by Bill Joy and Mike Clary at Sun Microsystems. JXTA's an extremely ambitious project with a steep learning curve. A quote from the column: The formulation of networks on the fly, with or without a central server, through firewalls and with authentication and encryption, atop the Internet and other networks ... (read more)

Logging stack traces with Log4J

The Dining.Name Web application uses Log4J, Apache's logging library for Java, to log the behavior of classes that import XML data into a MySQL database. Log4J is a simple class library -- the basics take no more than a half-hour to learn, as I described in a Linux Magazine article in 2002. It supports four levels of logging and external configuration. Right now, I'm building Dining.Name at debug level and getting verbose output. When I'm confident that it works, I'll change it to fatal level ... (read more)

Regular expressions are beautifully ugly

For several years, I've been unable to find a suitable Web server log statistics program for this server, which hosts several dozen virtual domains for myself and a few friends and relatives. The commercial options such as WebTrends and Wusage cost more than I want to pay for a server-wide solution. The open-source and free-beer programs I have found are either skimpy on stats or can't handle sites that get millions of hits a year. I've decided to write my own program in Java, a project I'm ... (read more)

Creating MD5 hashed passwords in Java

I found a much-needed Java programming tip in a LiveJournal XML-RPC client programming discussion this afternoon: How to create an MD5-hashed password from a string. Radio UserLand only presents hashed passwords when publishing via XML-RPC, storing the plain text version in the object database. The following class method can be used to create a hash from a string: public static String hashPassword(String password) { String hashword = null; try { MessageDigest md5 = ... (read more)

I'm getting naked in Linux Magazine

I just finished a 3,500-word column on Naked Objects for an upcoming issue of Linux Magazine. Naked Objects, unveiled at OOPSLA in November 2002, is a groovy open source framework for developing Java software that exposes objects and their methods directly to users. Using reflection, the objects and their methods are discovered and made available in a generic user interface (screenshot). The goal is to create software that consists of "behaviorally complete" objects which genuinely embody the ... (read more)

RSS Validator advice changed

Sam Ruby has fixed the RSS Validator, which was responding to duplicate elements in a way he didn't expect. It no longer suggests an element to remove in response to invalid RSS 2.0 (and perhaps other versions). He also says this about the validator, which is an open-source project: The RSS validator has always been neutral in the RSS wars. In particular, it provides valuable feedback on the quality of RSS 1.0 feeds as well as RSS 2.0. In fact, most of the code is common between the two. If ... (read more)

Is the RSS Validator acting funky?

As a followup to yesterday's entry, a look at the source code of the RSS Validator reveals the elements it considers to be duplicates: Item elements: author and dc:creator category and dc:subject pubDate and dc:date Channel elements: copyright and dc:copyright creativeCommons:license and cc:license generator and admin:generatorAgent language and dc:language lastBuildDate and dc:termsModified managingEditor and dc:creator pubDate and dc:date webmaster and dc:publisher I haven't tested each one, ... (read more)

Who validates the validator?

The RSS Validator designed by Mark Pilgrim and Sam Ruby appears to be rejecting some valid RSS 2.0 files that make use of namespaces. As discovered by RasterWeb, when an RSS 2.0 feed contains core elements and namespace elements that serve the same purpose, such as and , the validator claims it does not validate. To fix the problem, it recommends that the core element be removed. I can't find anything in the RSS 2.0 specification that would make duplicative elements invalid or recommend that a ... (read more)

New Site Syndication Format mailing list

Announcement: The Site Syndication Format development list is a focused, short-term mailing list for the discussion of ambiguities in the RSS 2.0 specification. The goal is to develop a new specification from scratch, code-named "Site Syndication Format," that clarifies or corrects these issues -- which can then be submitted to UserLand Software, a standards body, or published as a profile describing RSS 2.0 best practices. The list's members will vote on the final disposition of the new ... (read more)

Editing OPML link directories with JOE

At first glance, the Java Outline Editor (JOE) looks like a suitable choice for editing OPML link directories and other outlines. The program supports the addition or deletion of any attributes to each outline item, enabling link directories to be created by adding type and url attributes (screenshot). It isn't as easy as using Radio, where you can hit CTRL-K or CMD-K to add a link to any title, but there may be a way to extend the functionality that I haven't found yet. Note: JOE has the same ... (read more)