Thursday, June 30, 2005

Work hard. Fly right.

Next on the list of people needed to started an epidemic is the Maven. I was reading about Mavens as Melanie and I were sitting at the gate waiting to fly to Newark and then on to Sweden.

Mavens are incredibly well-informed about markets and very helpful in assisting others in their purchases. I know a guy who watches automobile prices like a hawk and makes a nice profit on just buying and selling cars. He'll buy a BMW/Porsche/SAAB/whatever when he spots a good price, drive it for a few months, and then turn around and sell it for a profit.

After a few chapters we board the plane but soon the pilot says "Don't throw anything at me but we've been delayed by four hours." The flight was eventually cancelled due to inclement weather at Newark. They can't do anything about that, but the way they handled the situation was far from graceful. I'll pretend to be a maven by spreading my advice to use another airline when you fly. Fly SAS, or NWA, or any airline that uses Airbuses.

Saturday, June 25, 2005

Beach weekend

We're down in Wilmington for the weekend. Others will have better write-ups in their livejournals so I won't try to compete, but I will say that Tommy's house is very hospitable.

I began reading Malcolm Gladwell's Tipping Point on the way down. I got as far as the chapter about connectors. Connectors are people who bring other people together. In the chapter he describes an extraordinary connector who goes to great lengths to keep up with all of his acquaintances... sending out birthday cards and trying to get in touch with friends from his childhood. Reminded me of my attempt I described in my last post, but I don't really have any of the other qualitifes of a connector. For an example, Gladwell had a sort of quiz he would use to quickly identify such people. He had a list of 250 last names, randomly drawn from the Manhattan phone book. He would ask the person to go through the list and count the number of people he/she was acquainted with that had a last name in the list. If the count exceeded say 50, the person was most likely a connector. I don't think I counted more than a dozen.

My dad just emailed me an MP3 recording of a voice mail that my physician's office left me at home. Another cool feature of VOIP I guess. I logged onto their website to confirm my appointment and I find out that I can view the lab results of my blood tests. Also cool. I don't know which surprises me more: seeing these features come around or the fact that it hasn't happened earlier. With Internet reaching 75% penetration in US homes, maybe we're approaching a tipping point in the market of bringing household activities online :)

Friday, June 17, 2005

Skriv gärna namn och e-mail adress!

I just returned from a party thrown by Matt. Thanks again Matt. He thinks my blog is dorky which is hard to deny. I guess I just don't use it to speak my mind about things other than what I deal with on a daily basis. This post will be a little different, but I'm staying true to the dorkiness by blogging on a Friday night.

I met a lot of nice people, two of which I share a mutual friend with. 1) Both I and "Leeway" (I don't know how to spell is name but that's what it sounds like) know Chethan. They know each other through ultimate at Cornell. I got to know Chethan through Americana at NCSU. 2) Both I and Simon know TJ. They know each other from being students at Georgia Tech. I met TJ at IBM earlier this year. The small world phenomenon never gets old. Surprisingly, the one person at the party who expressed an interest in social networks came off as the most socially inept person there. Reminds me of Dr. Doyle speaking about Marvin Minsky and how he noticed that students would always be most interested in the aspects of AI that they didn't handle very well themselves in real life. Clumsy students who fumbled around were interested machine vision, for an example. Minsky was always worried about the students who said they were interested in general intelligence.

I'll close on another random note. Eight years ago I got confirmed through the Swedish church. It took place over 3 weeks in the summer before high school started. At the end of the three weeks, I asked people to write down their email address in my bible that I just happened to come across. If I can get just one response, that would be neat.

Tuesday, June 14, 2005

Fixing web applications

Informative read. There are at least two items mentioned that I now need to address with our web application at work. Speaking of which, before that link popped up in my RSS reader, I was trying to figure out why our web application would call the homepage twice for one page load in the browser. Turns out <link rel="home" href="..." /> was causing it. I don't know why but both Safari and Firefox were causing the associated Struts action to execute twice. Fetching the page with wget, however, resulted in the expected behavior.

Another page had a more severe problem. It would hit the homepage 8 or more times for every load. I traced down the cause of this problem to a simple JavaScript statement that preloads an image. It just hit me. The images no longer exist and so multiple 404s must've been firing (the 404 pages happen to share the homepage's Struts action). I'll leave in the strikethrough text for my co-worker(s) to laugh/scowl at.

Random note: if you google for rel link="home", the web application I'm talking about shows up as the third result. Odd.

Sunday, June 12, 2005

OJB to Hibernate 3 Migration

I've spent far too long on this already so I'll make this brief but still try to help others out who want to go through the same process.

To convert your repository_user.xml file to a hibernate mapping file, try using this stylesheet. It's not completely automatic. I still had to add inverse="true" attributes in a few places were we're using bi-directional associations (see section 2.3.6 of the Hibernate Reference Documentation).

I also needed to tweak a few proxy attributes because we're using Castor XML which turned out to make things much more difficult. Hibernate uses CGlib for what it calls proxy generation. The problem is that it changes the class signature of the original class it's proxying for. When the modified classes get sent to Castor it complains about illegal/invalid characters because the class name is now suffixed with $$EnhancerByCGLIB$$. I had to patch the Castor source with a hack. Still looking for a long term solution.

Before all that mess I spent some time trying to figure out why Hibernate wasn't reading my JNDI datasource resource. It complained about an empty driver setting and a null URL. For those issues, refer to this helpful forum thread. Not the solution I was hoping for but it works.


I'm posting the change I made to Castor in response to a comment but it's pretty embarrassing :) These lines went below line 1293 of org.exolab.castor.xml.Marshaller in version (notice the second if condition):

if (!containerField) {
//-- Make sure qName is not null
if (qName == null) {
//-- hopefully this never happens, but if it does, it means
//-- we have a bug in our naming logic
String err = "Error in deriving name for type: " +
_class.getName() + ", please report bug to: " +
throw new IllegalStateException(err);
if( qName.indexOf("$$-enhancer-by-cGLIB$$") != -1 ) {
handler.startElement(qName, atts);

Lovely solution, right? Hope it helps you, Michael.

Thursday, June 09, 2005

Greasemonkey scripts for Greasemonkey scripts

It turns out that you can in fact modify a document that contains nothing but a javascript file. So if you set the @include directive to *user.js and do something like

var href = "" + getDataUri( document.documentElement.innerHTML ); document.documentElement.appendChild( aLinkUsingThatHref )

, you'd be ready to redistribute your own scripts. It even seems to work for Platypus generated scripts, despite the fact that the URL isn't in the form scriptname.user.js.

Sunday, June 05, 2005

Grandmothers Skyping

There was a link on the Skype Journal to a post about somebody's grandmother using Skype to communicate. I have to brag a little about my own grandmother. She's been Skyping for almost a year now, and sometimes she even initiates the call! OMG.

Saturday, June 04, 2005


I read a lot of other feeds out there. I at least skim all of the entries. I'm able to because the feed reader stores state and doesn't lose it between restarts. Many posts link to either other people's blog entries or web pages in general. I click the link and a new tab opens in my browser and remains there until I read it. For whatever reason, I rarely read it directly but queue it up for later instead. This becomes problematic when the browser crashes or I'm forced to restart the browser and it's been so long since I opened up the tabs that I don't care about losing them. Except that I do. I need a system to queue up tabs like this. I need a bookmarklet that forwards the page to a service that re-publishes the page to RSS and places it in a feed that I subscribe to so that I eventually will read it. Because then I'll be sure to revisit the topic as I make my way through unread items in my reader. The reader (NetNewsWire lite) is able to display HTML so maybe I can get away with escaping the entire page's content and serving that up in RSS.

Thursday, June 02, 2005

Notebooks on night stands

My dad (XFN link!) once told me to always keep a notebook by my bed for times like these. I've tried going to bed but random thoughts are keeping me up so I'll jot them down on my notebook. My notebook just happens to connect me to the Internet.

I was experimenting with data URIs a few weeks back and learned you could create separate documents on the fly. My experiment created an inline OPML XML file based on a blogroll-like listing that you could save and import in your favorite reader. I thought it could lead to cooler things, like create a bittorrent of larger downloads where the site didn't already make them available. Tracking and seeding this file was still necessary, however, which put an end to those plans. Now that there's a trackerless version of BitTorrent, maybe this is possible?


I haven't seen this anywhere other than on the O'Reilly Radar so I'll give it some more visibility (thanks to my awesome Google PageRank): Platypus.

Creating scripts for Greasemonkey was pretty simple, but now it's ridiculous. When this gets out there's going to be an explosion in the number of scripts. I activate the extension, click around one the screen a little, and suddenly I have a customized page (within reason). In some ways, the whole web just became a portal.

Now we just need an easier/integrated way to share these scripts with the world. I wonder if you can write a greasemonkey script that modifies another greasemonkey script to insert a link. Ideally, the link would submit the title, description, and target pages of the script (pulled from the standard comments) along with the script itself to the repository of scripts.

Oh! And then... (this is like the 3rd edit of this post), we need an easier way to discover greasemonkey scripts that people have published. I need something to alert me when there's a greasemonkey script available for the current page I'm on--similar to the RSS auto-discovery feature.

And then... we'll do it all over again for Trixie.