Archive for August, 2004

Inspiration

Tuesday, August 31st, 2004


Looks like David found me! Well, so much for keeping a low profile…




There will eventually be an image or two to go on this site, like with a theme and all (which will have to wait until I’m done whipping up a JSP 2.0 taglib for Blojsom). I was “inspired” by the name “Rage Against The Mac” when looking for RATM tracks on the iTunes music store. The font Apple uses is so big that on my PowerBook, it showed as “Rage Against The Mac…”. I though it was fitting. :-)

Getting java-readline to work on OS X

Monday, August 30th, 2004

I’ve really let someone down. This blog’s been up for all of a week, now, and someone’s already been here looking for java-readline mac os x.

And of course I didn’t have this entry written just yet…

The process isn’t really all that hard, but it is non-obvious. Someone should probably contribute this tidbit back to the source...

I found an initial set of instructions by Ian Cooke (dated September ‘02) that referenced only “OS X”. I find things to be a fair bit simpler with Panther and DarwinPorts than Ian dealt with.

For starters, you’ll need to get DarwinPorts up and running if you haven’t already done so. Once that’s done, just do a port install readline. You should know your DarwinPorts install root once you’ve installed it; in my case it’s /opt/local.

Compilation of java-readline is pretty straightforward at this point, but you do need to patch both Makefiles in the source distribution to account for the non-Linux and non-Win32 options you’ll need for the linker.

These changes apply to java-readline version 0.8.0. In the source root, edit Makefile and make the following changes:

  • Add
    JAVA_HOME = /Library/Java/Home
    below the line
    # Operating system dependent
  • Make the JAVANATINC variable read $(JAVA_HOME)/include
  • Change LD_LIBRARY_PATH to be DYLD_LIBRARY_PATH

Now, edit src/native/Makefile and change the following:

  • Add -I/opt/local/include to the end of the INCLUDES variable.
  • Change the LIBPATH variable to be -L/opt/local/lib -L/usr/lib
  • Change the CFLAGS variable to <del>fno</del>common (that should read “dash fno dash common”; stupid markdown.)
  • Change
    $(CC) -shared $(OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@
    to
    $(CC) -bundle -flat_namespace -undefined suppress $(OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@

You should now be able to run make and get libJavaReadline.so and libreadline-java.jar. You’ll need to rename libJavaReadline.so to libJavaReadline.jnilib. I put both of these in ~/Library/Java/Extensions, which makes the library available to all Java processes that are started as you. Make sure everything works by running java test.ReadlineTest from the command line.

Fun with taglibs

Saturday, August 28th, 2004

Never thought you’d see that title, did ya?

If you’re anything like me, you’ve probably wanted to have the utility of a custom tag library for use in your JSP files, but were turned off by having to learn yet another XML configuration schema (or DTD, as the case may be) to describe your tag to the container.

Well, thanks to the authors of JSR 152 taglibs now qualify as “fun” (for me, anyway).

I’ll expand more on this later, but for now, you’ll have to suffice with some links…

Unfortunate product names: EarJam

Friday, August 27th, 2004

What’s the first thing you think of when you hear “ear jam”? Brownish-yellow globs of goop on your q-tip , right?

Sounds like somebody needs to find a new ad agency…

Griffin Introduces EarJams

Under-leather garments

Wednesday, August 25th, 2004

Travis Truman has a brief review of some decent-looking underwear to wear under leathers. A long, hot day on the bike in leathers usually leaves me pretty uncomfortable as my typical loose-fitting cotton shorts and t-shirt get sweaty and sticky. I’ll have to give these a try (or at least add ‘em to my wish list...

My, how spam flies

Tuesday, August 24th, 2004

It's amazing, really. You’ve gotta love the tenacity of spammers. Too bad they can't put their powers to use for good instead of evil…


I posted a comment on Russ' site early on Saturday morning using a TMDA dated address. At 10:30 this evening, I got a spam that was sent to that exact address. The address, for sake of clarity (and now blacklisted, just so ya know) is blalor-d-1095685940.cf1feb@bravo5.org. That’s an address that lives for 30 days, after which confirmation from the sender is required before the message will be delivered. So, in roughly 80 hours, a unique address was harvested by a spambot and put to use to try to lure me into buying software for 80% off. How exciting.


We’re fast approaching the point where both email addresses and pristine Windows XP systems will be attacked in roughly the same amount of time.

Cool Tools: beanshell

Tuesday, August 24th, 2004

I’ve been a big fan of scripting languages for a long time. Back in ‘96 it was TCL, and then Python in ‘01, with judicious bits of bash thrown in when working on some antiquated AIX box without modern tools. (mumble, grumble, back when I was a boy … and we liked i!) But anyway.

I’ve always been drawn to the shortened cycle of write-run, as opposed to the write-compile-run cycle with “real” languages such as C and Java, and the even more dreaded write-compile-deploy-wait-wait-wait-run cycle encountered with J2EE applications. Yeah, sometimes you can get away with doing a hot-deploy of freshly-compiled .class files into an existing deployed application, but that still leaves the compile part.

Another thing I’ve come to appreciate with scripting languages on the Java platform is the ability to learn a new API by playing with it real-time. Once you’ve sussed out a tricky bit of shell script just by interacting with a bash shell with readline, it’s really hard to go back to doing things the old fashioned way.

Enter BeanShell. For a better part of the last year or so (since I added Java to my repertoire) I’ve been using BeanShell to do all of those things. And a few months ago when I discovered java-readline and figured out how to make it work with OS X? well, I thought I’d died and gone to heaven (in a figurative, pathetic, and geeky kind of way). Since then, I’ve broadened my horizons by coding up a servlet and a portlet that executes bsh scripts instead of having the logic hard-coded into the .class files, and also a portlet that evaluates commands submitted in a textarea as part of the current request. I’ve saved hours upon hours of development time and
write-compile-deploy-wait-wait-wait-run cycles trying to figure out how to use one of IBM’s less-documented WebSphere Portal APIs.

One of these days I’ll get around to publishing the source to those… “But what about Groovy, Jython, and all the others?” I hear you ask? Great tools, every last one of ‘em, and each with some very cool features. But right now I prefer the Java syntax. If work my way up to a complicated block of code in a BeanShell session, it’s nice to know I can cut’n’paste into my Emacs window and have working code.

Now, for that java-readline summary…

Cool Tools: henplus

Tuesday, August 24th, 2004

Well, this seems like as good of a <slashdot>first post!</slashdot> as any…

Bill Stilwell just reminded me about how cool henplus is. I discovered it a couple of months ago and almost never use the native mysql client anymore (and I never used sqlplus without a gun to my head). Getting the java-readline support built was a little tricky under OS X, but once done, it provides an absolutely brilliant environment for interacting with JDBC-connected data sources. More on java-readline later…