Archive for March, 2010

Just Slugging it Out

Monday, March 8th, 2010

Today has been a good day and a bad day - just depends on how you look at it. I've realized a few things today - the ideas have been crystalizing for a while, but today they can into laser focus. The Shop is consistently focused on the gimme now! answer no matter the cost of the better, long term solution. This isn't some of the time, or even most of the time. No, it's all of the time.

I'm used to a little more of a balance, and not spending all my time fighting fires. I get to do little things - but they can't take more than a day or two before they are considered "back burner" projects and I'm asked to re-focus on things that will make my manager look good to the other partners in the Shop. It's not a bad motivation, and he's not the only one doing this, so I can't really say he's the problem. No... it's the entire place that's like this.

I've just gotten tired.

I want a rest.

So I asked to start working at home.

It went over about as well as I had guessed - which is to say that it didn't go over well at all. But I didn't expect it to.

Sad.

Oh well... I've had a nice run here.

CoRD 0.5.3 is Out

Monday, March 8th, 2010

CoRD.jpg

Because I'm not a big Windows fan any longer, I really appreciate the work the CoRD Team is doing to bring a nice Remote Desktop client to Mac OS X Snow Leopard. This morning I got a tweet that CoRD 0.5.3 is out that fixes some of the cursor problems and adds a hostname feature to the connection prefs.

Sweet. The less I have to run Windows the happier I'll be.

OsiriX 3.7 is Out

Monday, March 8th, 2010

OsiriX.jpg

While I'm not sure it's necessary to keep up to date with OsiriX, it's still nice to be able to see the kids' and Liza's images from the doctor's office visits they have accumulated over the years. Sure, some will say it's a little creepy, but it's like baby pictures - sort-of. Well, today I noticed that OsiriX 3.7 was out, and decided to snap it up and upgrade what I had. Easy, quick, and really fun to look at the x-ray images over again.

MacVim Snapshot 52 is Out

Monday, March 8th, 2010

MacVim.jpg

This morning I saw a post in the MacVim groups digest saying that Snapshot 52 was released with a pretty significant list of updates and fixes. Most interesting to me is the inclusion of Core Text as the future of text rendering on the Mac. If this makes it smoother and faster, then I'm all for that.

It's still one of my favorite editors and only a slight second on my Mac to BBEdit. Great stuff.

Added an XML Output to the JiGV DataTable

Friday, March 5th, 2010

GoogleVisualization.jpg

Today I had the time and decided that it was about time for the DataTable to have a toXML() method so that if I have a servlet that's responding to something other than a JavaScript-driven web page, they can take this XML and parse it for whatever they want. Since I already had the HTML output method, this wasn't all that hard, I just needed to decide what the structure needed to be, and then replace the HTML tags with the appropriate XML tags.

Not bad at all.

OK... it's not rocket science, but it's something that needed to be done as I'm getting into a little larger audience for these servlets in the web app, and it needed the 30 mins I put into it to get the code and the unit test working.

So there.

Google Chrome 5.0.342.1 (dev) is Out

Friday, March 5th, 2010

This morning I noticed that Google had updated Chrome (dev) to 5.0.342.1, which is a welcome improvement. I've been using it as my secondary browser for several days, and I have to say that I think I'm still leaning to Firefox as a better experience. I'm not going to debate the speed of the V8 JavaScript Engine, I know it's better. But what I need in a secondary browser is something that feels right, and the fact that it's not WebKit is not bad either.

I'll keep Google Chrome around, and I'll give it a shot in a little bit, but it's just not as smooth as Firefox is for me. Nice, and close... but not a winner - yet.

WebDAV on SSL Configuration Munging

Thursday, March 4th, 2010

Today I was checking on my WebDAV/SSL access to my home server and noticed that it wasn't working. I knew I had set it up once, and I couldn't imagine what had messed it up, but then I started looking at the error and access logs, and it was clear that the WebDAV lock database was not accessible to the plugin. Rats.

As I started digging, I noticed that the DAV config file: /etc/apache2/extra/httpd-dav.conf was not the same as I had originally had - specifically, the value for DavLockDB. What was there was pointing to some default Apple location, and even that wasn't really there. So I had to go in and set:

  DavLockDB "/Library/WebServer/WebDAV/DavLock"

and then a simple:

  $ sudo apachectl graceful

and my WebDAV/SSL was once again working.

It turns out that the DAV plugin makes several files with that root name, and there's no reason it has to be there, so if there's something in that location - wipe it out and then restart Apache.

Whew! I'll have to keep a closer eye on the Apple Mac OS X updates and make sure it's not breaking the configs.

Excessive Use of Java Autoboxing Leads to Grief

Thursday, March 4th, 2010

java-logo-thumb.png

I've been hip-deep in Hemlock again this afternoon - trying to track down a NullPointerException whose reported location is giving me absolutely no help in trying to figure out the problem. I spent about an hour trying to figure out the problem until I finally stumbled on the answer and got it fixed. But the problem was an enormous pain in the rear, and related to excessive use of Java's autoboxing feature.

The problem was that the original developer of Hemlock had decided to use Double objects as instance variables as opposed to using the elemental double. This is not because he wanted to use the ability to assign null to these values - no, it's just because he was being lazy, that's the best I can figure.

If you use Double objects and then mix in arithmetic operations, you're counting on Java's autoboxing to do all the real work for you. Whereas, if you used double you might have to think about illegal values, but in this case, that wouldn't be a problem.

What I had done to the code to simplify it was to replace the use of dozens of ivars with a map. Specifically, a ConcurrentHashMap<String, Double> where I would make the setters and getters use specific keys so that the API to the class appears as if the ivars as distinct, but they're all really being looked up in the map.

This was done because the data needed to be outputted in a JSP as an XML data stream. With the Map, I was able to make a very simple loop and the dozens of getters and output statements were reduced to a few in a loop. Massive simplification that was really a long time overdue. Everything was working fine until I ran into the following code:

  Double  newValue = (obj == null ? 0.0 : obj.getMyValue());

where:

  public Double getMyValue() {
    return (_values == null ? null : _values.get("myValue"));
  }

where the _values is the ConcurrentHashMap<String, Double> that stored all the values.

Because of the nature of the ConcurrentHashMap<String, Double> neither the key nor the value could be null. Still, I was setting the value to a Double so that shouldn't be an issue. Or should it?

When I added setting a new Double(0.0) for all values in the _values Map, the error went away. What's the lesson here? I believe it's that the conditional having the 0.0 first sets the expected datatype for the second part of the conditional, and when it's null, a NullPointerException is thrown, but since it's in the return call, the exception is actually reported on the line where the method returns.

What have I learned? That with autoboxing, you have to be very, very careful about the nulls floating around your code. But more importantly, their use should really be limited because the overhead of the conversions is hidden in the code, and problems such as these don't show up as easily.

Then again, I've never had problems with these guys, but then again, I harly ever use them. I'm far more interested in the explicit conversions than implicit conversions done by the compiler or runtime.

Having a Little Extra Time is Nice

Thursday, March 4th, 2010

Today I've been finishing up on a lot of little things that I've been putting off because they just aren't that important, but today their time came. I was having a little fun making a few servlets spit out the same data as HTML, CSV, and XML. The first two were easy as I had already done that, but the XML was pretty simple too. The JSON format isn't all that different from a compressed XML format, so the same kind of data was pretty easy to reformat to XML. Nice. Now I'll be able to make that data available to other requesting clients. Nothing amazing, but it needed to be done sooner or later because I had one of those clients waiting in the wings.

I was able to spend some time monitoring my production processes and realized that one of my boxes has the memory configuration messed up. I did a little checking, and updated the start script (catalina.sh) to use the proper maximum memory setting. Tomorrow, it'll start up with the right limit. No idea who changed that, or why, but it was nice to have the time to monitor the apps and see that this was happening before it was a problem.

Plus there's the complete mental health angle... I've been running flat out for a long time, and now that I have a few things in Q/A awaiting certification, I have the time to just rest a bit. It makes a big difference on my outlook.

Not sure I'd like this every day, but it's nice to have a little breathing room now and again.

The Tech Trenches is a Complex Place to Be

Wednesday, March 3rd, 2010

cubeLifeView.gif

I'm continually amazed by my attitude towards the work I do. I really love the work I do - development, but I don't always see eye-to-eye with the people I work for, or with. This afternoon I was able to add in the parsing and storage for strike-level volatility data to be stored with every update from select sources. It's going to be a ton of data - I'm guessing about 720,000 rows/minute or roughly 432 million rows per day. Each row isn't that big - I'm guessing around 30 bytes a row, forget the indexing, etc. the data itself is over 12 GB/day. Very big.

Still, it's what they want, and they are willing to spend the money to get the database storage for it. I just hope that I can add enough RAM to my boxes so that I can hold at least two days of data. We'll see as things progress.

But it's exciting to write good code. It's frustrating to see others butcher it, and I had a little of that too, but there's nothing I can do about that. It just comes with the territory.

Still... as with kids, you have to hold onto those nice moments and make them last.