What's That Noise?! [Ian Kallen's Weblog]

« Previous page | Main

20040308 Monday March 08, 2004

Debugging a resume One of the problems with maintaining your resume as you would an application is that you inevitably end up introducing bugs. Having a bug in your resume is probably not a good thing.

Since the data from my resume is kept in an XML file and I've had requests to have it sent as plain text (instead of just sending the URL, which is what I'd been doing), I decided to turn it into an opportunity to mess with some XSLT. Everything was looking pretty good in my development sandbox (a Tomcat instance on my laptop and Eclipse) so I warred it up and deployed it on the production server.

The link to the plaintext version (which worked fine in my sandbox) was puking on the live server. It was generating a server 500 error, a NullPointerException in java.net.URL - oy vey! So I backed up, looked at the Parts inner class in the URL class... it wasn't readily apparent why it was NPE'ing on me - sonuvabitch!

After some slighly panicked puzzling ("I hope no prospective employer-types are clicking on that link now for the plaintext version"), it hit me: in my development sandbox, the webapp was deployed fully expanded, on the production server, it was deployed as a war file... that totally changes the way the XSLT file is accessed and turned into a stream for the Transformer class. The only reason I'd been accessing it as a URL to begin with was the Transformer's unhappiness with being given a plain-old InputStream from the ServletContext (it was throwing MalformedURLException).

The long and the short of it is: if you're accessing an XSLT stylesheet from inside a webapp, be careful how you access it and how you deploy the webapp -- having a request for your resume produce a server 500 error doesn't look so good. ( Mar 08 2004, 02:29:42 PM PST ) Permalink


20040303 Wednesday March 03, 2004

f*cked! I carpooled into the City on Monday as if it were Just Another Workday but I knew it wasn't. The company shutdown it's operations, all employees were given a short severance and timeoff and turned in our keys, company credit cards, and so forth. So that's it. That's all.

Since then, I decided to scratch an itch I've had. I've used Jakarta Struts for long time but have always found the maintenance of the deployment descriptor ("struts-config.xml") to scale poorly. Since I wanted to

  1. have a resume that expanded/collapsed the various data elements
  2. use xdoclet to generate struts-config.xml
I created an opportunity to do both, the results are here. When I get around to setting up a public source repository, I'll post the code there. If you're interested in that sort of thing, there's a "struts-resume" application on sourceforge but it seemed way too complicated for what I needed, so I didn't even bother trying it out. ( Mar 03 2004, 06:31:40 PM PST ) Permalink


20040227 Friday February 27, 2004

Compiling APM out of a linux kernel on redhat9 I rarely have to recompile linux kernels, usually stock compiles are adequate. But occasionally, badness happens.

I'd installed RH9 on a box for a specialized use (a reverse proxy server built on mod_perl 2.0). It's basic deployment requirement was simply that it'd sit in the server room on a rack (i.e. headless). Everything went fine on the system installation and the software that I setup thereafter. However, after I racked it and put a little startup script in /etc/rc.d/init.d for the mod_perl instance I'd deployed, I rebooted it in it's "production" mode i.e. without any input devices attached. Lo and behold, it hung with a message about the power management stuff, something like
apm: BIOS version 1.2 Flags 0x03 ...
[it just stops there ]
So I set out to recompile the kernel. Since I don't do these kinds of things regularly anymore, I had to poke around and read through the procedures. Just for posterity's sake, this is what I did:

I used use FreeBSD for everything I possibly could. It's been a few years since I've had to custom build kernels for BSD but I recall the process being super straight forward; the amount of dickering around with different configuration tools was nil -- just edit a kernel config file and go compile that suckah.

I miss that. Unfortunately, all of the work that I do with Java is not compatible with sticking with BSD; my work is tuxified. If fortune shines upon me, my work in the future will be on Mac OS X where: no kernel dickering should ever be needed, it's BSD and it's slick. ( Feb 27 2004, 11:29:15 AM PST ) Permalink


Dodged the rain in an Expedition Strangely, there was no line today at the pickup point

Rode in the backseat of a white late model Ford Expedition with Don Imus going on about.... nothing in particular. Driving and weather conditions were good as was my timing.

The minute I stepped into my office, umbrellas were abloom outside as the rain starting coming down. ( Feb 27 2004, 09:00:34 AM PST ) Permalink


20040226 Thursday February 26, 2004

'twas Grand Rode shotgun in a late model green Dodge Durango SUV.

After yesterday's biblically proportioned downpour, it was nice to wait for a pickup in sunny (albeit partly cloudy) weather. Yesterday, the freeway was locked up with solid accidents and general bad-weather chaos; seemed it was a definitely a BART day as the carpool line was empty. So I was attentive this morning to the radio reports for weather and traffic conditions, everything sounded good.

Waited in line about 10 minutes before for the 8 people ahead of me to get picked up, and then the Durango arrived. The same radio station I'd been listening to earlier was prattling on with the usual morning blabber.

The going was slow through the Caldicott and to the 580 split but after that it was smooth sailing. KGO was abuzz about a backup "from the tollbooth out to the Grand Avenue exit" but there was no such thing; the approach to the tollbooth was light, the non-carpoolers weren't buried too deep at the metering lights. The incline up the bridge was slow but nothing horrible; total drive time was about 30 minutes. Grand, indeed. ( Feb 26 2004, 10:15:47 AM PST ) Permalink


20040225 Wednesday February 25, 2004

Shalom Salaam At work today, I've been listening to Ziggy Marley's "Dragonfly" release.

Nice headphone groove to write code by. I really dig the fifth track, "Shalom Salaam" ...soulful, reggae and a message so pertinent to the days we live in now.

"children are children no matter color or faith"

Peace ( Feb 25 2004, 12:35:28 PM PST ) Permalink


subversion released! It's been a long time coming, but I'm very pleased to hear the announcement that subversion has gone one-dot-oh!

I've been an Apache user for a long time now and interested in WebDAV for years, so it's been with much anticipation that I've watched (from afar, anyway) the subversion project develop. While CVS will likely be in our midst for years to come, it's nice to know that a robust source control alternative (other than Perfor$e) is ready to roll.

Someday, real soon maybe, I'm going to setup a subversion repository for personal use as well as for publishing code. Putting it on my TODO list now... ( Feb 25 2004, 12:29:13 PM PST ) Permalink


Much Ado About Outsourcing Vivek Paul seems to be the annointed spokesman for India's outsourcing industry. Last week he was the lead protagonist in an eWeek piece The Offshore Proposition. In the current issue, eWeek has him again in a two page interview. The most interesting thing is an excerpt in the response to the last question ("Your advice for the 40-year-old engineer here in Silicon Valley whose job has been outsourced?"). Paul is optimistic about the prospects of US engineers who are, "...pushing the edge of innovation" but then goes on to say:

"If your job involves sitting in a cubicle and not talking to anyone else, you are at risk. Get yourself into a role that is more attached to the customers or suppliers and is on the cutting edge of innovation."
So maybe you don't think you're Milton but according to Paul's point, don't content yourself with being relegated to the basement. Recall Peter and the Bobs:
Peter: You’re gonna layoff Samir and Michael!
Bob Porter: We’re gonna bring in some entry level graduates for us to work in Singapore, that’s the usual deal.
Bob Slydell: Well, it’s standard operating procedure.
Yea, and Milton and his stapler will be outsourced. So stay close to the customers, dammit!

Milton is Nervous
Milton
( Feb 25 2004, 10:48:03 AM PST ) Permalink


20040224 Tuesday February 24, 2004

Snake Eyes Often, it's just a roll of the dice.

The line at the carpool was at least twenty five persons deep when I arrived. At that point, it becomes a dilemma: do I wait it out and ride in on the 'pool or do I just say "screw it" and jump on the train? There wasn't exactly a throng of cars chipping away at the line, it could be a long wait. When the rain started to come down and I realized that I didn't have an umbrella, I sez to meself: "screw it!"

I hustled into the station. From the platform, a clear view of the carpool pickup point is evident. Here it was, just moments later, there was no rain and the line looked to be about halved in size! Was it halved because others were following my example and bailing out on the line? A steady procession of cars were apparent as the BART sign flashed "11 minutes" for the next train. It now looked like those people who'd held fast were likely to get downtown before me and with more train fare left on their tickets.

Sometimes, the dice just come up snake eyes. ( Feb 24 2004, 09:37:44 AM PST ) Permalink


20040223 Monday February 23, 2004

It's the most wonderful time of the year Perhaps I'm a latino-phile, I dunno.

I've never been to latin america (unless Florida counts). I've never been to Mardi Gras either. But this is the time of the year when the news is filled with pictures of Carnival in Brazil and other great places. And I think it's awesome.

Public displays of non-inhibition are not always pretty but the pictures of the various Carnival celebrations are truly splendiferous. Just a nice reminder that the accepted American narrative of normal and appropriate behavior is clearly deficient. ( Feb 23 2004, 12:03:00 PM PST ) Permalink


Constants Abuse Hard-coding string and numeric values into application logic is often problem-plagued. I tcan lead to duplication, which leads to maintenance nightmares, which can lead to increased substance abuse, drinking, crack cocain... it's a treacherous road. Don't go there.

It's a pretty common (and usually, good) practice amongst java programmers to organize all of the little magic values that application logic depends on into a class that defines public constants. However, this can lead to another problem: constants bloat. Cases where the developer needs to define a constant that is only accessed by one component (let's just call a single class and its instances "one component" for the time being) but stores it in a shared centralized constants class is another form of substance abuse. It's constants abuse.

I would really prefer to see constants with a limited scope of applicability confined to that scope. For instance, if it's only used by one class -- define it in that class, not the shared centralized beast. If it's only used by a cluster of classes that work on a particular area, perhaps there's already a bean that they all know about; the constant may be better suited for that bean than a class shared system-wide.

Confine the scope of your constants definitions to where they are useful and save yourself and your colleagues maintenance headaches down the road. ( Feb 23 2004, 10:55:14 AM PST ) Permalink
Comments [1]

20040221 Saturday February 21, 2004

Black Sun to open for Yngwie Malmsteen Long time Bay Area axe-slinger Thaen Rasmussen's current band, Black Sun is set to open for Yngwie Malmsteen. Those of us who frequented the metal scene way back when may recall Thaen's legacy effort, Anvil Chorus, and their opening gig with Yngwie. Yep, I believe that show at Wolfgang's in San Francisco was over twenty years ago, 11/19/1983! ( Feb 21 2004, 12:09:30 PM PST ) Permalink


Tiles Definition Files: anti-pattern? Struts tiles definition files allow the developer to refer to components to include symbolically. Besides the struts-config.xml, this is an additional configuration point. Ostensibly, the extra layer of indirection eases maintenance and re-use. However, I've found it to be flawed:
It increases the maintenance burden by requiring mappings in two different xml files and these mappings are easily abused
For instance, suppose updating the UI logic on the SomerSault widget is required. The developer may have to traverse two different mapping types (struts class mapping and tiles component mapping)
  1. look in struts-config.xml for the class mapped to /SomerSault.do
  2. the <Action /> stanza forwards to something called somerSault.layout
  3. ok, next, look in tiles-defs.xml and one might find that somerSault.layout maps to /SomerSaultContainer.do
  4. alright, go back to the struts-config.xml to find /SomerSaultContainer.do and see that it maps to the type com.example.SomerSaultContainer
That's too many steps
There's no compile-time validation
The developer might make all of these changes and be please that everything compiles, including the JSP components (using the jasperC ant task). However, at runtime if the names don't match up, it's difficult to debug where the problem is.
It would be preferable to define any symbolic names for components as constants in a compiled class (say TileDefinitionConstants), this would make the names uniformly available to the Action classes and JSPs. Exposing the symbols to the JSPs would require writing a little tag library but that's a trivial feat. ( Feb 21 2004, 10:22:50 AM PST ) Permalink