Differences in Java’s URLEncoder and JavaScript’s unescape()

January 22nd, 2010

This afternoon I ran into a problem between Java's URLEncoder and JavaScript's unescape() funtion. Ideally, I'd be able to create a URL in a Java servlet and ship it to the client and use JavaScript's unescape() function to parse the GET variables for the page. And it almost works. Almost.

The problem is the space character. The URLEncoder encodes the space into a plus sign ('+') and not the hex code (%20). The JavaScript unescape() function doesn't convert the plus sign into a space. So I have to do the following in my code:

  function parseGETVars() {
    var retval = [];
    var urlChunks = String(document.location).split('?');
    if (urlChunks[1]) {
      var pairs = urlChunks[1].split('&');
      for (var i = 0; i < pairs.length; ++i) {
        if (pairs[i]) {
          var parts = pairs[i].split('=');
          retval[parts[0]] = unescape(parts[1]).replace(/\+/,' ');
        }
      }
    }
  }

With the little change, I can use the Java URLEncoder and still get things working. Not too bad, but why on earth are these guys not doing the same conversions?

Of Vacation Policies, Sick Days, and Corporate Culture

January 22nd, 2010

cubeLifeView.gif

Lately I've been considering going back out on my own. Maybe with a few friends, but much, much smaller than what Port-to-Port became. When you have a lot of employees it changes what you're responsible for, and I want to stay doing things, as opposed to managing the business of those doing it. And the reason for this contemplation is that we have been discussing things at the Shop - things like vacation policy, sick days, and the like.

It all started when a co-worker brought up the fact that many places had no vacation policy. Actually, that's not entirely true. Their policy was that they didn't need a complex policy. Rather, they used the simple statement:

Achieving a balance between work and rest is important for everyone. Work has to get done and responsibilities covered. Good people know how to manage both.

and while this is heavily paraphrased, it's the essence of the policy that I liked.

Responsibility. Personal Responsibility, on a corporate scale.

I don't take a lot of vacation time, but I'd like not to even think about it. I work exceptionally hard and deliver results and products that are far above the norm. It's just the way it is. I'm not going to apologize for working 11 hr days, and working faster and smarter than most of the folks around me. Not all, mind you, and when I get to work with really sharp people, it's a treat. Really.

But it's the concept that I have to count these days. Moreover, when there is a "pool" of vacation and sick days, most people will look at sick days and say "I'm not that sick today to use a vacation day" - and so they bring their germs to work. Thus putting all of us with families at risk. It's the culture that there's a limited resource (days off), and the use of them needs to be personally justified.

This can get so bad that when there are "use it or loose it" days, people take off when they don't really want to because they feel they have to use this resource. Silly, yes. But very real. I've seen it happen at the Shop and I've only been here nine months.

As this email 'conversation' developed, the Netflix corporate culture docs (recently released) came up. And they are amazing. It's been talked about quite a bit, and I have to agree with all of them. What gets me most today are these:

  • Adequate performers get generous severance packages.
  • Evaluate performance based on effectiveness and results.

They go on to say that they see themselves as a Major League baseball team. Pay well, treat well, but expect stellar performance. If not, then be gracious, and show them the door. It's perfect.

Recently, I've been struggling with the very slip-shod work of people not really paying attention. It's not that they are really doing their best and just aren't capable of doing better - it's that they are being careless because they think it doesn't matter. They are wrong. It all matters.

So while I don't hold out a lot of hope that things will change at the Shop, I can hold out hope that I'll find the magic ingredients to cut out on my own, or with a few friends, and set up some place that adheres to these same guidelines. It's about the only new job I'm interested in looking at.

CoRD 0.5.2 is Out

January 22nd, 2010

CoRD.jpg

This morning I noticed that CoRD 0.5.2 was out, and with it, a hope that I may never have to have another Windows box again. This is an incredible app - works every bit as well as Windows' own Remote Desktop client for everything I need: get to a machine, run what I need, fiddle with files and settings, and get out. It's amazing.

With the update it's running in 64-bit on Snow Leopard, and several crashes have been fixed. It's also got the self-install/on-disk-location checks which have been talked about a lot in the web lately for Mac apps. I'm encouraged when I see this kind of thing picked up by really nice open source projects. Clearly, these guys are good, and that's great news.

I'll keep using this as long as it's available because I never want to have another Windows box, and there's no way business is going to give them up.

Firefox 3.6 is Out

January 22nd, 2010

Firefox3.5.jpg

This morning I noticed that the Mozilla group has finally released Firefox 3.6 - with a stunning list of changes. Among the biggies for me:

  • Protection from out-of-date plugins to keep users safer as they browse.
  • Improved JavaScript performance, overall browser responsiveness, and startup time.
  • Support for new CSS attributes such as gradients, background sizing, and pointer events.
  • Support for new DOM and HTML5 specifications including the Drag & Drop API and the File API, which allow for more interactive web pages.

but there's a lot more there for everyone.

When there's a major update to Firefox, like this, all the themes and plugins fail until the developers have a chance to update them to the new system. This morning was no exception for me. I had to mess with quite a few things in order to get Firefox working on Mac, Windows, and Linux.

Theme Problems - Whitehart 3.6.5 [XP & Linux]

I use the Whitehart theme for XP and Linux and of course it's not ready. Sadly, there's nothing I can do here as it's not in my skill-set to mess with the theme. I'll just have to live with the default theme until they get around to updating it.

XML Rendering Problems [XP & Linux]

I need to look at the XML output of several different servlets and because the servlet's content-type is text/html as opposed to application/xhtml+xml, I don't really see the XML - just some of the unbounded data in the XML. This isn't very useful. The old plug-in I used to force a content-type switch wasn't compatible with Firefox 3.6, so I tried Force Content-Type 1.2.2. What a gem!

I simply install this, activate it, and then put in the mapping for the URLs I need using JavaScript regex and BINGO! It works like a champ! I spent nearly half a day initially trying to figure out what the problem was, but this time, this guy had me up and running in less than 15 mins. That's fast.

If you need to see XML in Firefox on XP or Linux get it.

Java Plug-in [Linux]

This was a puzzler until I started googling it... the Java plug-in for Linux for Firefox 3.6 changed from the old libjavaplugin_oji.so to the new libnpjp2.so. For the JDKs distributed from Sun, this file is in the same basic directory structure, and a simple find will find it. But there's no errors in using the old one, it just doesn't load. Switch to the new one and restart Firefox, and all is well.

This little tidbit wasn't in any of the docs I read, and I wasn't the only one that thought this was an oversight. I can't imagine that after years of using the old plugin, I'd have thought to switch on my own. I'm sure glad one of the developers spoke up on this thread. Yikes!

Interesting Realization about Praise and Hostility

January 20th, 2010

I've been working pretty hard today - and for me that's saying something. There were a few things that were very near to completion, and I wanted to get them all out to the users today so I could write them off my list. I had a deployment to do, then I needed to incorporate a few more data sources to my web app, then I needed to update a few pages with additional features the users had asked for. Nothing took more than an hour or so, but there were a lot of those hour-long projects I wanted to get through.

By the time early afternoon rolled around I found that I was in a pretty crummy mood. I started to think about a conversation we had this past week about my need for appreciative feedback. She had suggested that I volunteer at the Apple Store (or get paid, either way) because the people coming in there are (usually) very appreciative of the Genius Bar's ability to fix things up.

I didn't have the heart to tell her about the bad stories I'd heard from the Genius Bar workers on the net, but that's not the point. She was saying that the work I do is nice, and it's fulfilling, but everyone wants a little positive feedback for their efforts. Otherwise, it's going to lead to burn-out.

As I was thinking of this I realized she was totally right. What's more, while I may have felt that my last job was far more hostile, it was also far more appreciative.

The harsh remarks of my last place were, at times, clearly over the top. But primarily confined to a few folks. It was certainly not universal. And when they came, it was clear they were issued by a person that was very upset about something - maybe the problem they were talking about, and maybe it was something else entirely. But in every case, I was able to clearly identify the issues involved and indicate if there was something that I could do to resolve the issue.

No question, there were folks there that could go over the top with verbal anger at times.

What I hadn't realized was that there were other folks - the majority of folks, in fact, that would go over the top with appreciation.

The majority of the support folks... the majority of the operations staff... even the majority of the traders were very appreciative of my work. True, I had been there many years and built tools that were the cornerstone of the risk analysis, but still... there were web systems I built, and legacy apps I maintained and all those people were appreciative of the efforts.

Even the loudest of the 'loud angry' folks was very appreciative at times.

Which brings me to why I feel so crummy this afternoon - there's virtually no appreciation in this position now. There's no "loud angry" people either, but if I had to accept the latter to get the former, I think I'd do it every day of the week. If I'm going to be working 11 hr days, and making a 90 min commute - each way, I'd like to know that what I do matters.

In the last four years of my old place, I almost never got yelled at. Plenty of times in the first three, but less and less as time went on. I was good at what I did, and when I said I'd get it done, it got done. No one had a reason to get angry at me. My stuff just worked. So while I was working in a hostile environment, I wasn't the target of much hostility. I was, however, the recipient of a good bit of the appreciation.

I miss that. I really do.

If I'm going to work for no appreciation, I'll still do it. I'll just pull up quite a bit short of where I've been working because there's no one giving back to me. Also, the faux appreciation of some folks doesn't count. You can tell when it's genuine, and when it's "just words".

So today has been an important realization for me. I realized that if I'm going to be leaving it on the track every day, I'm going to need to hear a genuine "good job" now and then. If I'm not going to get it, I can't really leave it all on the track -- I'll burn out. And I've been very close to burn-out the last few weeks.

So it's time to work as hard as I can - for myself. If I get more from the users, that's great, and I'll be able to give a little more, but if not -- and they are by no means required to do so, then I'll at least have enough left over for the family in the evening.

And I know they deserve it.

Apple Security Update 2010-001 on Software Updates

January 20th, 2010

This morning Apple released a new Security Update for Snow Leopard on Software Updates. It's got about a half-dozen updates to the core components: CoreAudio, CUPS, ImageIO, etc. You have to stay up to date or risk getting hit by one of the script kiddies. Sad, but true.

Coda 1.6.10 is Out

January 20th, 2010

This morning I noticed that the guys at Panic have released Coda 1.6.10 - which is great. It's still the all-in-one that I want to use for my next project on the Mac, I just haven't had time to get to it. The CSS, JavaScript and HTML along with the preview and publishing make it just what I want to use.

TextWrangler 3.1 is Out

January 20th, 2010

The guys at Bare Bones have updated their free editor TextWrangler to version 3.1. It's the little brother to BBEdit, and is a great alternative for those times you don't need everything BBEdit has, or for those that just can't see the need to pay that much for a text editor. In any case, it's nice to have as a backup.

Unison 2.0.2 is Out

January 20th, 2010

The guys at Panic have been busy... they also released Unison 2.0.2 this morning with the lovely new feature that the unread article count is now in the display. Very nice. There are still a few visual issues - most notably, the window width seems to be set up such that it can't be as narrow as I'd like and display things properly, but I can send them a note about that.

Still a terrific newsgroups client.

Finished the AJAX for the Fusion Page

January 19th, 2010

I spent the latter part of today getting all the AJAX and client (JavaScript) post-processing on the 'Fusion' page with the graph and table I started the other day. Getting the data wasn't bad, but unlike the previous table I created with the collapsing groups, these groups aren't clearly defined. In fact, the groups are contained in the table itself. This allows me to not have to worry about the group definitions, but at the same time, I needed to change everything about the old scheme because I didn't have the group definitions.

It wasn't horrible, but it took a little bit of thinking to get the summations, indentation, sorting, tagging and collapsing all working. A couple of hours of quiet work, which of course, turned out to be an entire afternoon because I don't have quiet, and making it (with my fingers in my ears) doesn't make for easy typing.

Yes... I wish I had quiet. But I don't.

In the end, I've got the code I needed, and it's off the the London users for them to kick around and send me any changes they might have.