Archive for the ‘Cube Life’ Category

Helping Out and Making Progress

Wednesday, June 17th, 2009

cubeLifeView.gif

Today has been a pretty decent day. We figured out why my NVIDIA 8400 GS video card wasn't displaying 2560x1600 with RHEL5 x86_64 - turns out the 180.51 driver was too old - when updating to the latest (185.18.14), it worked fine. Big difference to see it all and it is a great view. I can see a lot more of the code and web pages. Nice.

I also helped out a bit as a co-worker started making another page in the webapp that I started. This one was a heat map from the Google Visualizations, and it was OK, but the limitations really made it hard to display the data the way she wanted. We talked a bit, and I looked at the other visualizations and the Magic Table was really a winner. It was HTML 5-based and that's great, but also it had all she was looking for. Hopefully, it'll be easy to retrofit the Magic Table for the Heat Map.

I needed to help one of the Q/A folks get the software of mine they were testing up and going. It's been a chore as I inherited the code from another developer and the set-up of new machines is not what you'd call very deterministic. Basically, it's a "clone a VM and go" type of thing, and that leads to difficult situations when you have to re-configure it for Q/A test points.

Still, we got that going, and hopefully, we'll get through Q/A quickly and I can deploy the latest release and start on the next.

Finally, tonight is Nina's first playoff game for the 2009 softball season. The Twins go into the playoffs a 12-0 favorite - the next-best team is something like 8-4, or something like that. Still... on any given evening someone can get hot and win. Here's hoping that the Twins win this evening and move on to the next round.

Facing the Way it Is, as Opposed to How You Want it to Be

Tuesday, June 16th, 2009

cubeLifeView.gif

Today I spent a good bit of time planning out the changes I need to make in this one project I'm taking over. It's not the way I'd build it, but that's really beside the point... it is and I have to work with that. Plain and simple.

So I'm looking at why a strike for an option that should be 1.34 is really 1.34000003674 - I've run into this before in my previous job: rounding in the format change from string to float or double. It's just the way things are. So I needed to see how things were being converted and then see where I might be able to put in code to properly round to something like 1.0e-4, or something.

I found the data in the database was stored as a real, and that's not a good sign right off the bat, as I think that's going to be mapped into a Float by JDBC as opposed to the Double that might have prevented this. But the problems didn't end there. The code I found mapped the value to a String and then later, it was mapped to a Double and then used. By then, I'm not at all surprised that it had the extra digits. Too many conversions. Way too many.

But again, in order to minimize the impact to the code, it was smarter to look at where the options were being created and insert the rounding on the strike at that point. It's not what I'd have wanted to do, but again, I had something that was close to right, and so it wasn't really worth the risk of changing all the mapping and database code when the problem could be addressed very simply in the setter code of the new option:

  public synchronized void setStrike(Double value) {
    _strike = Math.rint(value * 1.0e4)/1.0e4;
  }

with this, we'll get the strike rounded to the nearest 1/100th of a cent. Easy to do, and it'll wipe out all the "problem digits" that we're seeing.

But I wasn't done yet. There was more code that needed fixing on the strikes. There was a place in the code where they were trying to create the "short-hand name" of the option and it had the following code to display the strike:

  double   decimal = strike - Math.floor(strike);
  int      strikeInt = new Double(strike).intValue();
  ...
  if (decimal > 0.)
    shortName.append(strike);
  else
    shortName.append(strikeInt);

where the goal is to render the Double 1.5 as "1.5" and the Double 95.0 as "95". Basically, if there's no fractional part, then don't show the decimal point. Seems good, but this is a horrible way to do it. A far better way would be to say:

  DecimalFormat  fmt = new DecimalFormat("0.####");
  ...
  shortName.append(fmt.format(strike));

where the formatter will properly round to four decimal places and also drop the entire decimal part if there isn't one to display.

Sure, the DecimalFormat isn't thread-safe, but I'm not expecting it to be. Make one, use it, drop it. They are meant to be very lightweight classes - which is why they aren't thread-safe. But in this case, they are perfect for the occasion.

Then I got into another problem that I needed to tackle and realized that I didn't see where the original author had made any allowances for the feature. I looked more and still found nothing. I then shot off an email as I dug even further. By the time I talked to him, I was convinced that he simply didn't have any modeling of this particular business rule in the code. It was all based on configuration files that duplicated these business relationships he didn't want to include.

I talked to him and he fessed up about not making any allowances for this because he thought it was wrong. I pointed out that all he did was to push it into static config files in the server, and he agreed.

Right or wrong, a business rule is a business rule. It's not about "correctness". It's about how the users think of things. If they choose to think of things as "colors" then model the colors - just as they think of them. Don't make the quality judgement on the way things are - just use them.

I had done this with his code - from the get-go, but he wasn't as accommodating of the users. I told him what I needed to do and why, and was very nice about the judgement, but in the end, we need to add in this concept as it's critical to being able to do several things that are globally important, even if they aren't important to him.

It's important to understand that there's a time to correct something because its wrong, and leaving it as-is is going to cause more problems in the future, and when it's time to let it flow over you and work with the imperfect system that you've been given.

Interesting Alternative to Google Visualizations

Tuesday, June 16th, 2009

GoogleVisualization.jpg

I've been using the Google Visualization AnnotatedTimeLine for quite a while. It's a pretty nice tool, and it's got the backing of Google, for all that means. Good and Bad. This morning I was pointed to the Chronoscope web site where they seem to have built something on top of the GWT that can replace the AnnotatedTimeLine pretty much completely. It even has a 'compatibility' skin where it looks like the AnnotatedTimeLine (or so the docs say).

I'm always on the lookout for something that's better, faster, and cleaner than the stuff I'm using. This certainly has a lot of things to like. Right now, my biggest concern for the AnnotatedTimeLine is the fact that it 'flashes' on all updates. It's not fast but part of that is the fact that I have to give it the entire dataset at each update. It'd be great if the dataset was able to be augmented, and in doing that, it only redrew the parts that changed.

I'm not sure that Chronoscope is the answer. It's no faster than the AnnotatedTimeLine for similar dataset sizes, but it's something to keep and eye on. Maybe it'll post some specs on speed and size and give me more reason to investigate it further.

Lots of Cleanup and Planning Today

Monday, June 15th, 2009

cubeLifeView.gif

Today has been a lot of clean-up and planning for the future today. I am at a brief pause in the development cycle, waiting for the Q/A Team to certify an application of mine so that I can then put it in production and reap the benefits of the fixes and features. While I was waiting for this, and helping them out when needed, I wanted to run through all my emails and make sure that I didn't have anything outstanding that needed to be done.

Turns out that I did - imagine that.

I needed to pull two pages into one by adding a single checkbox and a simple if-then construct to pick the right URL for the request. This would allow us to choose whether to hit the in-memory database of my app, or hit the back-end database. There are a few new webapps on the server, and this addition was really needed in order to be able to maintain the app under adverse conditions. Just makes sense to consolidate these into one.

There were a few other things I needed to do as well... nothing major, just cleaning up emails, sending out status emails, checking up on folks - organizational maintenance stuff. Got all that cleared out.

Then I spent a little bit of time planning for the next new feature for the app in Q/A. I needed to make sure I could see where to update for the new information, how to make sure it'd work regardless of the conditions. In short, it's not too hard. I'll be able to add in the data to the base elements, then the existing code will automatically aggregate across it, but the new code will be able to filter on it and come up with the exact data we need.

Pretty nice.

I did need to do a bit of explaining to the original author as he came up with a pretty decent idea that will make it easier to be sure that the old test cases and code will work with the new data. It was a little strained after I agreed with his idea and he still wanted to understand what it was that I proposed. We probably went around this a few times before he got it, and that's OK - just a little miscommunication.

In the end, it was a very productive day and lots of stuff got done. It just wasn't Wow! work, but necessary nonetheless.

Moved my Work Notes to VoodooPad

Friday, June 12th, 2009

VoodooPad4.jpg

In my previous job I had a TextEdit document that had all kinds of notes in it about the place, the applications, what to do when, how to do things, etc. It was a "How to" of all the things I had to do and needed to remember in the job. I also had a nice blog about all the things I did during the day, and the combination of these two made a really nice package to pass on to the people that remained. They didn't appreciate it, of course, but it was my choice not theirs.

This morning I was looking at the file I was creating after three months of being here, and decided that I didn't want to leave it in TextEdit as there wasn't anything special about that. No real linking, no multiple pages, etc. VoodooPad was the answer, and since I didn't have that much to move, it was pretty quick.

Even better that the formatting and styles followed the cut-n-paste, so it took me all of 5 minutes to make the index page and then make the page for the one page I had some information typed up for. Pretty simple.

Work Notes in VoodooPad

Now when I fire up VoodooPad Pro on my laptop I'll get the basic Kitchen Sink doc of mine as well as the document for work. Nice. Should make it a lot simpler. Sweet.

Classy Group: Risk Analytics Team – da’ RAT Pack

Thursday, June 11th, 2009

This is a picture of my team at the Shop - Jeff's the manager, Jean, Raj and I are the developers, and this is in the corner of the trading floor by a window overlooking Jackson street on the 8th floor of the Chicago Board of Trade.

RAT Team 2009

I have to say, after three months, it's still a great job to have and it's a real pleasure to work with a bunch of nice people.

Cutting Over from Git to Subversion

Wednesday, June 10th, 2009

gitLogo.gif

Well... today I decided it wasn't worth it to keep working in Git when it's not really supported in the Shop. The approved version control is Subversion, and that's not really horrible, but it's not as nice as Git or CVS. The requirement that you have to change directories to change to a branch is silly. I understand why they did it, but it was a bit of a cop-out. At the same time, subversion holds the 'ignore' files in metadata, they could have held the branch/tag info.

Anyway... without support I decided to move. The problem is, there are no real tools to move from Git to Subversion. What I ended up doing was to create a new project in Subversion and then import the latest copy of the files. I lost the entire history to date on the two projects. It was a little disappointing, but in the end, we have something that I can easily share with other developers.

I feel a bit sad for not being able to use Git, but in the end, the realities of the work environment dictated that it had to be done.

Leveraging the Back-End System I’ve Written

Wednesday, June 10th, 2009

WebDevel.jpg

Today a co-worker wanted to leverage the back-end Google Visualization system I have created for my web app. Given that I've got all the web services with database connections and the Google Visualization data generation, it made sense to look at the Google Visualization Gallery and see if they had something that would fit her needs. If they did, it would be relatively easy to make a page that issued an AJAX call to my server with the request for the database to be returned and placed into a simple x-y graph tool.

The first thing I needed to do was to subclass the GoogleVisualization class and create one that uses the back-end database connection as opposed to the in-memory database connection. This would allow her to execute queries against the back-end database, which was what she wanted. From there, all she had to do was to glue it together with a little HTML.

It took a while, but she's getting the hang of it.

What a Fantastic Day – Too Bad it was Doomed

Thursday, June 4th, 2009

cubeLifeView.gif

Today was one of those days you can't believe. I was coding to some wonderful music on my iPod and things were just falling into place. I'd write a method, it'd be say a dozen lines of code, and then I'd look back at it and think Wow! That's impressive. It covers all the bases, and is elegant. I did that again, and again, and again.

I had about 3 hours of this today. It was spectacular. Really. I can't remember the last day I had when I was this hot on the keyboard. It's been a while, I can tell you that.

So of course, it had to end badly. Doesn't it always?

It started when I had the basics of this F/X correction into my web app. It was absolutely wonderful. It slipped in cleanly and easily, and it worked like a charm. Sure, it had methods that needed to be database-driven as opposed to the hard-coding, but that was to save time and make sure I had it all under control.

I had a method that would give me the conversion factor for a 'from' and a 'to' currency code, for example. This needs to be driven of the database of F/X rates, but I had the basic conversions coded up as fixed numbers. The method worked, and once I got the database work in place, it would be driven off better data, but the essentials were there, and everything could be seen to be working.

This was all done about a week early, by the way.

So I mentioned to my manager that I had the rough-cut of the F/X conversions in. I tried to explain the things I had yet to do, but he was already off to the races: "Did you get this in yet? How about this? Can I see this?" Like an old boss I'd had. Excited, which is nice, but already assuming that a week early is "normal" for me.

In a very real sense, I condition people to expect greatness from me and then I'm stuck with their expectations. It's only taken three months for this manager. Yet I can't blame him. For these three months I've been working exceptionally hard to get things going, and I've got an impressive string of successes already. That I got this done in a day is not really all that surprising. But it'd be nice if he at least gave it 5 mins before asking if I'd done the next three things on my list.

Just give me a little rest.

So I ended up on a real downer when it should have been fantastic. Bummer.

Sometimes It Comes Faster than You can Field It

Wednesday, June 3rd, 2009

cubeLifeView.gif

Today was an interesting day, that's for sure. I've been trying to tie up several loose ends with this project I'm working on with another developer in the Shop, and I wanted today to be the day that we finally finished it off and sent it to QA. Seemed very reasonable when I got into work today.

My tests went perfectly, and that was about all that did. I had a 'drive by' from two developers saying that the code they'd written in the project wasn't returning the correct numbers, and the way in which I was getting it would have to change. Not horrible. In fact, reasonable, and so we spent the hour there getting that fixed up.

Then there were logging problems with the addition of the log4j jar and no configuration file. That set me back a bit as I waited for the other developer to do it. I ended up doing it to try and get this all put to bed today.

During all this, I had added new data sources to another app I'm working on and those weren't configured exactly right. The net result was that I was missing a ton of P/L in the calculations making it look like there was a huge loss. Someone was freaking out and I was in the middle of trying to check in some things for the other project while he's telling me of the problem.

"I'm on it... just give me one minute to check this in." I said.

No more than 10 sec. later he says "Could it be in the configuration?"

"Yes, I'll check it in less than a minute, I promise." as I frantically try to write the subversion check-in comment for the code sample I just finished for the project.

No more than 10 sec later he says "If this is real, they need to know about it."

"I promise, just another few seconds and I'll be on it."

Then he stands up and tries to talk to be and I look at him, put my fingers in my ears and sing "La La La La La" like the kid that doesn't want to hear what the parent has to say. Childish? Sure. But I didn't want to insult him by saying "Do you have a watch? Count off 60 sec. and be quiet!".

In less than 20 sec. I was done, another 60 sec. and I had the problem figured out, and within 5 minutes it was all solved. He then wanted to discuss why this happened, I explained that it was because the way the app was written by this other developer and the instrument lists were set by the XML config files and that's very manually intensive. He wanted to know how soon we could make it database-driven, and I said we could, but it'd drive out other things that he wanted done.

No easy choices, but the best advice is not to make decisions when you're upset about something. In this case, seeing bad P/L from a new data source. It wasn't even in production - just test. Learn that not all problems have the same impact.

Thankfully, after a few minutes of talking he calmed down and realized that the schedule we put together of work was probably the best, and we would get through this just fine. It's not perfect, but I didn't write the thing, and we're just doing the best we can to muddle through until we can give it a complete overhaul.

But I'm glad it's over.