Java Programming Challenge

2 min read

usWe watched the season finale of Witchblade last evening. Season 2 was pretty good overall. I think I liked the first season better though.

javaLate last nite I received this letter from Javalobby:

Dear Friends in Javalobby,

I've got a simple favor to ask you. I'd be personally grateful if you would go participate in a Java programming challenge on Wednesday night at OTN to show your support for Javalobby and your goodwill to our sponsor, Oracle, who is hosting the challenge. Oracle has treated Javalobby really well, and their sponsorship and support helps us continue to deliver Javalobby as a free resource for the whole Java developer community. I hope you'll agree that participating in their Java programming challenge is a reasonable way to acknowledge their valuable support, and you may even have fun in the process.

Visit http://www.oracle.com/go/?&Src=1075780&Act=11 for the details and to register.

You won't win any money or a new BMW or a trip to the stratosphere in a Mig- 25, but I will personally send the names of the winners to everyone in Javalobby. You'll be known by your peers in the Java community as the best of the best, and you'll be entitled to brag. I know a lot of you are seriously good Java coders, and I'd bet many of you are better at it than you think. Please take the time to go over to Oracle's OTN site and try your hand at some of their "practice arena" questions. You'll get to preview their interactive challenge environment and you'll definitely hone your skills at coding under pressure. If you enjoy yourself, then go ahead and enter the contest and do your very best to win.

The challenge begins Wednesday, August 28 at 6:30 p.m. Pacific Time. The practice arenas are open around the clock from now on. I understand you should try to show up for the challenge on Wednesday a little early so you don't miss out. If you're late, then you can't participate. Of course, the competition is totally FREE and there is no obligation to buy anything (I don't even think you CAN buy anything!)

Again, visit http://www.oracle.com/go/?&Src=1075780&Act=11 to register and try the practice arenas.

Thank you in advance for your support, and I hope this will be fun for everyone who shows up and helps make the event a success. I genuinely appreciate your help, and you can be sure that your participation will help Javalobby.

Warm regards,

Rick Ross
[email protected]

macOracle 9i for OS X. Took them long enough.

windowsExpert demonstrates yet another Microsoft hack.

macSwitch to Mac? Too funny!

javaJava Recipe of the Day: Dynamic Class Loading.

windowsMozilla 1.1 terrorized my machine.

I inadvertently hit return when asked to change the default browser. No big deal, I thought. Boy was I wrong…

It didn't take long to figure out that version 1.1, like its predecessors, does a pretty pathetic job at rendering most web pages. So I promptly un-installed it. From that point on, Internet Explorer started to refuse opening URLs. I went thru hell and back trying to re-install IE. Everything is hopefully back to normal now. Reader beware.

NcFTP, wget on OS X

1 min read
If you liked The Professional and La Femme Nikita, you'll probably want to see The Transporter. I know I will. A new preview version of my favorite java-based editor, jEdit, has been released. Version 1.4 of Jakarta Cactus, a server-side unit testing framework, has also been released. NcFTP and GNU wget are a couple terminal-based file transfer utilities I find quite indispensable under OS X. The antiquated NcFTP 2.4.3 is installed by default under 10.1.5. NcFTP 3.x, which was first introduced in 2000, sports numerous new features. Most notably bookmarks management and file name competition. To download, compile and install NcFTP 3.1.4, open a terminal window and issue the following commands:
curl ftp://ftp.ncftp.com/ncftp/ncftp-3.1.4-src.tar.bz2 -O
bunzip2 ncftp-3.1.4-src.tar.bz2
tar xvf ncftp-3.1.4-src.tar
cd ncftp-3.1.4
./configure
sudo make install
rehash
cd ..
rm -rf ncftp-3.1.4*
If bzip2 is not available on your system, look here for instructions. By default, NcFTP 3.1.4 is installed in /usr/local/bin and will not overwrite the old version located in /usr/bin. I use wget to retrieve files over HTTP or FTP. It is very similar to curl, but quite easier to use. To download, compile and install wget 1.8.1, open a terminal window and type:
curl ftp://ftp.gnu.org/pub/gnu/wget/wget-1.8.1.tar.gz -O
tar zxvf wget-1.8.1.tar.gz
cd wget-1.8.1
./configure
sudo make install
rehash
cd ..
rm -rf wget-1.8.1*
By default, wget is installed in /usr/local/bin. "Will I use iChat? Not until it is redesigned to work better for those who have large user lists and use chat as a part of their work routine. Power users need more options…" -- I completely agree with Rob. We heavily use AIM for internal communication. iChat in its current bloated implementation will simply not cut it. Lots of noise on the Java-Dev mailing list regarding the availability of Java 1.4 on OS X. Allen Denison, Apple's Java Product Manager, offers some answers. The fact still remains that it has been over a year since Sun released the first public beta version. That's what I call dropping the ball.

Jikes & OS X

<1 min read

According to reports on the Java-Dev mailing list, the Jaguar dev tools installation still comes with Jikes 1.15 and there are issues with compiling the latest version. Be sure the build Jikes 1.16 under 10.1.5 prior to the 10.2 upgrade. Here are the steps I used…

Open a terminal window, then type:

curl ftp://sources.redhat.com/pub/bzip2/v102/bzip2-1.0.2.tar.gz -O

to download bzip2 which is required to expand the Jikes archive. You could also manually download the source and use StuffIt Expander to extract it. If you do, you may skip directly to the compilation steps. Otherwise, type:

tar zxvf bzip2-1.0.2.tar.gz
cd bzip2-1.0.2
setenv CC cc
sudo make -e install
rehash
cd ..
rm -rf bzip2-1.0.2*

which will decompress, compile and install bzip2. Note that you'll be prompted for your password after the sudo command.

To download the Jikes source code, type:

curl ftp://www-126.ibm.com/pub/jikes/jikes-1.16.tar.bz2 -O

To uncompress the archive, type:

bunzip2 jikes-1.16.tar.bz2
tar xvf jikes-1.16.tar

To compile and install Jikes, type:

cd jikes-1.16
./configure
sudo make install
rehash
cd ..
rm -rf jikes-1.16*

The make command will take a while. Feel free to go grab a snack or something. :-)

By default, Jikes is installed in /usr/local/bin, but some applications may still look for the older version in /usr/bin. Renaming the old version and creating a symbolic link to the new version will circumvent the problem:

cd /usr/bin
sudo mv jikes jikes-old
sudo ln -s /usr/local/bin/jikes .

Yes, the last sudo command ends with a period. Do not forget it.

Finally, you can verify that the proper version of Jikes is active by typing:

jikes -version

Metrics...

<1 min read

Gay Spider-ManJava magazines love to duke it out. Mine's bigger than yours.

SD Times has an article on Mac OS X Server 10.2.

Apple should have dubbed Jaguar as Mac OS X.2. Mac OS X 10.2 is too redundant.

Linus on patents: "The fact is, technical people are better off not looking at patents. If you don't know what they cover and where they are, you won't be knowingly infringing on them. If somebody sues you, you change the algorithm or you just hire a hit-man to whack the stupid git."

Every so often I run JavaNCSS on the latest build of jTalk:

Nr.   Classes Functions      NCSS  Javadocs Package
  1        15       327      2330       342 com.imacination.jtalk
  2         8        97       967       108 com.imacination.jtalk.dbconnection
  3         1         2        30         3 com.imacination.jtalk.servlets
  4       122       423      3292       545 com.imacination.jtalk.taglibs
  5         1        40       270        41 com.imacination.jtalk.webservice
  6        14        58       261        72 com.imacination.jtalk.webservice.taglibs
    --------- --------- --------- ---------
          161       947      7150      1111 Total

 Packages   Classes Functions      NCSS  Javadocs | per
-------------------------------------------------------------
     6.00    161.00    947.00   7150.00   1111.00 | Project
              26.83    157.83   1191.67    185.17 | Package
                         5.88     44.41      6.90 | Class
                                   7.55      1.17 | Function

I'm a sucker for metrics. It would be nice to be able to automatically compare results between builds, maybe there's a tool out there that does just that.

Elcomsoft is not backing down. Good for them.

Buff up your Buffers...

1 min read

Happy 3rd National Slacker Day!

We installed a Netscreen 5XP yesterday. It's not fully configured yet. Allon spent a lot of time on the phone with them and is still expecting a callback on some unresolved issues.

I just noticed that StringBuffer implements indexOf() under JDK 1.4. Whenever we move our codebase to 1.4, I'll be able to get rid of my own implementation. Kewl!

While on the subject, remember that in order to reach optimal performance you should always try to avoid using:

buffer.append("test" + s + ".");

but instead:

buffer.append("test").append(s).append('.');

and don't forget it also applies for declarations, e.g.:

StringBuffer buffer = new StringBuffer(s).append("test");

I much prefer using StringBuffers over Strings, especially when holding temporary data. Reusing the same temporary object over and over allows me to keep the total number of objects to a bare minimum. I just need to make sure the object is properly reset when needed. For example:

StringBuffer tmp = new StringBuffer(0);
int i = 0;

for ( ; i < 10; i++)
{
    …
    // Reset the temporary buffer
    tmp.setLength(0);
}

// Reset the loop iterator integer
i = 0;

The same principle works extremely well with tag libraries, as most JSP containers pool individual tags. What I usually do is implement a reset function which is called when all processing is done:

public int doEndTag()
{
    …
    // Reset objects
    reset();
}


/**
 * Reset all reusable objects
 */
protected void reset()
{
    …
    // Reset the temporary buffer
    tmp.setLength(0);
}

Simple, yet efficient. KISS.

Gert Van Ham's released the first beta version of his JCE taglib which can be used to bring strong encryption to JSP applications.

Ant 1.5.1b1 is now available. I will probably install it later on today.

JIRA 1.4 beta 1 was also released today.

I like the look & feel of this blog. Good article on WiFi too.

No babies were dumped while composing this article.

Newz

<1 min read

X2

Last month, while vacationing in Hawaii, my partner proposed to his girlfriend.

Vicki made it back home safely, with one extra bag. :-P

New builds of NewzCrawler and NetNewsWire were recently released.

Sun has posted the final draft specification for J2EE 1.4. InstallAnywhere 5.0.4 is out.

To paraphrase Randy Jackson: "Kelly, Kelly, Kelly…" Hit Charade: The music industry's self-inflicted wounds.
The cassette tapes analogy is right on point.

O'Reilly: Apple should target Unix/Linux switchers. Yup.

Palm is still lying about lies. HP handled a similar problem much more gracefully.

LDAP & Tag Libraries

<1 min read
My connection is on fritz today, keeps on dropping in and out. Bummer.

'Hong Kong Phooey'  

I spent the better part of yesterday afternoon creating a new web interface for our LDAP-based address-book.

Unfortunately ldap-abook turned out to be highly inadequate. I could have stomached the convoluted code, but the lack of consistent UTF-8 support was too much to bear.

I used a combination of jTalk, and the Simya LDAP Tag Library to build a new web application. I did have to make a few modifications to the Simya library as it did not integrate well with other tag libraries.

A warning to JSP Tag Library developers:

Avoid using getParent() in sub-container tags, unless you want to prevent other tags from accessing your output data. You should use findAncestorWithClass() instead.

I don't know if Simya is still actively supporting the library, but I'll talk to them about it.

The first release candidate of JDK 1.4.1 is out.

If you're looking for a tokenzier which can be used to easily parse comma or tab delimited files, you might want to check this article out. The implementation is sound, but could use some optimization.

Vicki is coming back tonight. Yippie!

Guess what? I once again voted for Kelly. Must be love.wink