Deep cop-out

I decided not to write my own deep copy yesterday and went with the serialization solution. This turned out to be the way to go. I didn't even use the optimized byte streams I mentioned and the deep copy of my object takes a very tiny fraction of a second. I'm staying with that option for now.


Faster Deep Copy Using Serialization

JavaTechniques | Faster Deep Copy of Java Objects presents a trick to make deep copy using serialization faster. The author provides FastByteArrayOutputStream and FastByteArrayInputStream which speed up the copy. However, the performance gain provided still doesn't put the technique on par with writing your own deep copy.

If you haven't guessed. I'm trying to avoid writing a deep copy method. :-)

Java Tip 76: An alternative to the deep copy technique

Java Tip 76: An alternative to the deep copy technique presents a really neat deep copy technique. Dave Miller, the author, uses serialization to deep copy an object graph. The only thing stopping me from using this technique from now on is the performance compared to cloning. However, it's a really quick and dirty way to do deep copy if you don't have to do it often or just want to prove something out.


Green Tea: Breath Be Gone

Another benefit of Green Tea is that it kills things that cause bad breath. Maybe this is the real reason my wife wanted me to start drinking it. Now my coworkers are reaping the benefit as well.

Trang, part 2

Well, I just got through checking the DTD that I built with Trang. I actually only had one thing to change so far. Trang even inferred the optional elements and the + operators for my elements. Kudos!


Trang is the gift that just keeps on giving. Ever since I started using James Clark's nXML mode for Emacs, I've also been using his Trang tool to convert DTDs to Relax NG compact schema. This allows nXML to validate your XML as you type it! It's really a great Emacs mode that also features tag completion.

However, I just discovered another great thing about Trang. I am writing an application that I need a configuration file for. I decided that I would make the configuration file XML and use Jakarta Commons Digester to read the file in and turn it into Java Beans. I mocked up my XML, and it turned out to be a little complex but workable. Since an administrator will edit the configuration file with an editor, I want the Digester to validate it using a DTD to make things more bulletproof.

SO, I was faced with creating a DTD for my XML file. Ugh. At least it's not a Schema. But, I still didn't want to do it. I remembered that Trang had different input and output options, and I wondered if it would create a DTD from my sample XML as a starting point.

Being brave and lazy, I fired up Trang against the XML and told it to spit out a DTD. VOILA! Within a second I had a working first cut at a DTD!!!

Thank you Trang, from the bottom of my lazy heart!!!


European Common Lisp Meeting Presentations, Videos, and Sounds

Edi Weitz has posted the presentations and videos of the European Common Lisp Meeting. Also , Kevin Smith pulled the sound tracks from the videos and posted them .

Courtesy of Lemonodor.

Ryan Shaw � Greasemonkey Stole Your Job (and Your Business Model)

Ryan Shaw � Greasemonkey Stole Your Job (and Your Business Model). Interesting idea: bright kids redesigning your site's UI and threatening your job as a user-interface designer. However, another perspective might be increasing the longevity of a site you no longer have time or patience to maintain.

Bottom line is that Greasemonkey is cool.


Google Desktop Search for the Enterprise

In "MSN Enterprise Search?" I speculated that Microsoft is trying a "free is better" power move on Google. I was wrong. I was misinformed - no, I was uninformed.

Today when I logged into Google, I realized MSN Enterprise Search will be a late response to a Google first strike. Enter Google Desktop Search for Enterprise. Currently, it appears to be free.

So, there you go. MS is struggling to stay in the game.


Ajax (not the foaming cleanser)

Edd Dumbill is talking about Ajax. It looks as if there is a Ajax summit going on. Also, the Ruby on Rails guys are getting all Ajax-y with it. I'm one of the many watching from the sidelines and tossing out the occaisional barb.

I'm wondering why we don't just abandon HTML. Sure, HTTP is a fine protocol for doing alot of stuff. Let's keep that. However, DHTML and things like Ajax are attempts to cling to a presentation method that we're clearly outgrowing.

Here's an idea - why don't we come up with a cross-platform, easy to program user interface language. Something that tools can sit on top of. Also, it's gotta' be something you can validate for correctness like XML. I don't want any more of that quirky parsing behavior (Do you hear me IE?).

Yeah, I've heard of XForms. But I don't think that cuts it. Clearly we need to encapsulate the event model as well as the presentation. We also want rich interactivity. Why should we limit ourselves to forms? We want canvases and crazy custom controls built for our cross-platform UI language.

You gonna' come at me with Java applets or Macromedia Flash? Please... You've seen the lack luster appeal of those technologies as well as I have.

Yes, Avalon does sound good. But, you know that's only going to be on one platform! Sure, the Mono gang may be able to port it. However, Microsoft will still be in charge of the standard.

Shouldn't we have a rich, cross-platform, distributed UI standard/language/toolkit by now? I think we could if everyone would turn away from their lock-in strategies and general silliness.

MSN Enterprise Search?

I'm not sure why this raises my eyebrows, but Mary Jo Foley is reporting that MS has an enterprise version of their desktop search product in the works. I'm guessing this will compete with the Google Search Appliance.

I wonder if this will be a way for Microsoft to undercut Google like they did with Netscape. Perhaps they will release their Enterprise Desktop Search (or whatever they'll call it) for free. Where does that leave Google? Microsoft learned the first time that "free" beats "superior technology" in the technology RoShamBo.


Spring Framework 1.2 Released!

Over the past couple of months, I've become a huge fan of the Spring Framework for Java. I've been using 1.1.5 in my current project and it's been a blast. I'm even using the Spring MVC web framework as an alternative to Struts. I'm very pleased so far.

just checked the Spring website because I've been expecting the final of 1.2 for a couple of days. Lo and behold it was released on Friday! Very nice. I know what I'm doing first thing on Monday! ;-)


Show Me The Source, Jode-y!

I've been using the Jode Eclipse Plugin probably as long as it's been out. It's one of the few Eclipse plugins I always re-install. The plugin will decompile any .class files that Eclipse comes across.

This turns out to be pretty handy. When you are debugging and you accidentally step into a 3rd party library, you can actually see the source code (but you may not get debugging information if they didn't compile it into their classes). If you are looking at 3rd party library that has no documentation and isn't OSS, you can decompile the class files to see what they're doing with what you pass in and what they should return.

Is it legal? Probably not. Will the 3rd party support you if you rely on a call that they don't publish? No way. Will you get your work done faster and feel ultra-cool? Yes... yes you will.


Problems Loading Spring Framework in WebLogic 8 with Context Listener

How's that for a specific title?

I just managed to struggle through a problem I was having with Spring MVC on WebLogic 8.1. For some reason, I couldn't reference beans from my application context in my servlet context file. Spring would tell me that it couldn't find the bean that I was referencing.

Here was my setup. I loaded the main Spring ApplicationContext with the ContextLoaderListener. Then I declare a single DispatcherServlet and name it "action". I set the "load-on-startup" value for my servlet to 1 so it gets loaded before everything else.

On Tomcat, this configuration works fine. Spring loads the main application context and then loads the servlet context. I can reference beans defined in applicationContext.xml from action-servlet.xml. No problems.

On WebLogic, I noticed that WebLogic loaded the DispatcherServlet before the ContextLoaderListener was invoked. That meant that the DispatcherServlet's action-servlet.xml was referencing beans that hadn't been instantiated yet! Argh.

I found this article in the Spring support forum. It really didn't have a direct relationship to my problem, but the problem was still the load order of the servlet context versus the application context. I noticed in a code paste that the suggestion was to load the ContextLoaderServlet before the DispatcherServlet. AHA!!! Ditch the listener and try the servlet approach to loading the application context.

SO, I removed the ContextLoaderListener config from my web.xml and used ContextLoaderServlet. I gave it a load-on-startup value of 1 and DispatcherServlet a load-on-startup value of 2. Redeploy, restart... BINGO! We have love.

del.icio.us extension

Are you using del.icio.us yet? Are you using Firefox? Good. Now, are you using the latest version of the del.icio.us extension for Firefox? If not, you should think about installing it.

The integration of the del.icio.us extension is nice. It provides a sidebar that gives you access to all your bookmarks. The sidebar allows you to select a tag and it shows you all the bookmarks that are associated with that tag. You can also select multiple tags, right click, and query the selected tags. Neato.

Perhaps the best feature is the context menu for del.icio.us. It lets you post the current page to your del.icio.us account. A separate window pops up and gives you the opportunity to enter the metadata about the tag (e.g. description, title, etc.). Of course, you also get to specify the tags that you want to associate the bookmark with. This is the good part - it tries to guess which tags might be appropriate and it shows not only your current tag set but also what other people have tagged the mark with. VERY nice.

Does this kill the folksonomy? Does this make you more sheeple like if you are using someone else's tags for your content? I don't know. Personally, I think it makes it easier to come up with new ways to tag your bookmarks. Ways that are sometimes much more intuitive than what you come up with on your own.