Archive for the ‘Cube Life’ Category

Even the Pros Make Silly Mistakes

Friday, March 27th, 2009

GeneralDev.jpg

I was coding fast and furious today - trying to get the back-end persistence into a web servlet I was writing. The requests were being handled perfectly, the first-line persistence was great in an in-memory H2 database, and the back-end MS SQL Server database was the saving, I just wasn't able to load the data from the back-end store on restart. Something was causing the servlet to have problems on startup.

In order to get the last 14 days of data from the back-end, I had code that looked like this:

  // create the Calendar with today's date
  GregorianCalendar    start = new GregorianCalendar();
  // set it back two weeks for the SQL statement
  start.add(Calendar.DAY_OF_MONTH, -14);
  SimpleDateFormat  fmt = new SimpleDateFormat("yyyy-MM-dd");
  // build up the SQL
  String  sql = "select * from portfolio where acquired > '" +
                fmt.format(start) + "'";

And for about 20 mins I was wondering what on earth is wrong with the formatter that's causing the problem? I was looking at the spelling of the class... the format string... all kinds of things.

And then it hit me. Duh!

I couldn't believe that I'd spent all that time looking at the code and not realizing that I was passing in the wrong argument to the formatting. Funny thing was, it wasn't caught by the compiler. Wild.

Just goes to show that even pros make silly mistakes.

Feeling Oddly Like a Slacker

Thursday, March 26th, 2009

cubeLifeView.gif

Had a pretty nice day today... kept very busy, got a lot of things done, but at the end of the day I had a meeting with my new manager and the list of expectations for April are daunting to say the least. Not that it's all that hard - it's just all things that are somewhat out of my control and I have no idea how to do them. For instance, getting machines set up in New York and London. Now, at my old job, I knew all the ins-n-outs of doing this and could get it done with a very predictable timeline. Here? I've no idea how the process works. I know what Liza would say - give it time, it's all part of the learning process. But it doesn't keep me from feeling like a slacker.

I then started to look back at my day - a day that was filled with lots of coding on the web site I'm working on, but all of a sudden it didn't seem like I had actually done all that much. I didn't have a lot more new to show for it, but I know the infrastructure in the web app had to be built and there was a significant amount of work there.

I know it's all just self-doubt. I need to put in the time and keep focused on the day-to-day and let the months take care of themselves. There's no doubt I can get all this, but it's nonetheless a little daunting when faced with it all at once.

I just need to keep my head down and keep working.

Honesty is a Much Better Policy than Kindness

Monday, March 23rd, 2009

cubeLifeView.gif

I have been spending the last several days - let's call it a week, getting familiar with a guy's code. Now I'm not going to say it's bad, or good - it's different from what I'd have done in that it's over-designed like a Spring app might tend to be - certainly J2EE has nothing on this design pattern, but that's really not the issue. It's his code, and I was learning it in order to be able to support, maintain, and extend it. Things were going pretty well, I think, and then I started to get the inkling that this wasn't in his comfort zone.

So I asked him.

What came out and asked him about what he'd do. He's been a very nice guy, almost to a fault of not telling me what is going to take him out of his comfort zone on this project. His answer revealed what he was comfortable with - me not touching his code. Fair enough.

Hey, you have to face facts. I'm the new guy. I've been here for a grand total of two weeks and until I can produce something that's good, going on great, and it deploys around the firm, and runs like a top, there are going to be a lot of people that, rightly so, have doubts about me.

This guy is no different, and I don't blame him.

What I do wish he'd done was to be honest with me as opposed to nice. It would have saved us both a week. I can do what I need to do now by building something outside of his codebase that simply makes calls to his system and saves the results. It's not ideal, but it's possible. It's also going to be built in such a way that it can run alongside his code in a Tomcat instance so that should the time come to more closely integrate them, the first thing we can do is to put them side-by-side and then merge the codebases.

It's understandable that I'm the new guy and need to prove myself. I also appreciate this guy's kindness. I just wish he'd been a little more honest with himself, and me, and it would have saved us both a bunch of time.

Finishing Up JiGV – Java Interface to Google Visualizations

Friday, March 20th, 2009

WebDevel.jpg

Today I was able to finish up the first complete cut of my work on the Java classes for the Google Visualization API. For the last two days I've been hammering out a class structure that allows me to easily create tables of data that are then easily serialized to the Google widgets. This is a core component of the project I've been working on here since my arrival. With the incredible elegance of the Google Visualization widgets, it was a natural fit to make the data we have fit the API, and then be able to easily change the widgets on the front-end.

One of the nice things I added was a DatabaseTable that sub-classed the basic DataTable and created a constructor that takes a simple JDBC ResultSet and from that builds the DataTable for easy serialization. This will make it easy for me to make a servlet that will use the Google API to receive a GET message with a SQL statement in it, run that query, build a DatabaseTable from the results, and then serialize the data back out. Efficient and elegant. Nice.

Additionally, I wanted to complete the Google API with it's CSV and HTML output formats. These were pretty easy given that I'd already done the JSON version, but it's going to make it nice for debugging the code and checking on the data. They didn't take long, but it was worth the effort.

So it's looking like it's time to move into the Tomcat codebase. I need to put in the H2 in-memory database and then back-end it with MS SQL Server, and then put the servlets on the front end that I built this code for. Making progress. Lots and lots of progress.

Back in the Swing of Things Again

Thursday, March 19th, 2009

cubeLifeView.gif

I've been coding for a little over a day and have written a little over 3,000 lines of commented, debugged, unit-tested code. Wow! It's been a wild day. I can't remember the last time I was this productive. It feels incredibly tiring, but also exceptionally satisfying because it means that I'm starting to really produce here and in a few days I should be able to finish this all up, and start to look at using this code in the servlets to hook into the Google Visualization widgets.

Yup... it's a great feeling to be exhausted. Great.

Finally Getting to be Productive

Wednesday, March 18th, 2009

WebDevel.jpg

Today I'm finally getting to be productive on the job. I've got all the pieces worked out in my head, and on paper, and it looks like the best way to go about putting together this intraday P/L tool is to take an existing P/L service and add an H2 in-memory database with triggers to save it all to a back-end MS SQL Server for persistence, and then use the Google Visualization API to present the data fetched from the H2 database for the client.

It's got a few, solid, working components, and while they probably haven't been used in just this way in the past, there should be very little concern that they are going to work in this instance. The only trick is that there isn't a Google Visualization API Data Source in Java. They have Python, PHP, and .NET, but not Java. OK, so I need to create the DataTable and supporting API in Java for the servlets to use. Not bad.

So I fire up BBEdit, create a git repo, and create the classes I need. Since the Shop is big into unit testing, I'm trying JUnit, which isn't bad, but it's nothing you can't do in isolation, and writing good tests is still a non-trivial task, and slows down coding significantly. However, it'll let everyone feel like I'm fitting in if I do all the tests like they would - or maybe even a little better.

Finally, I need to start to use ant as that's another big thing here. I like Makefiles, but the only real difference I see in ant is the name of the file (build.xml) and the format (XML). Other than that, it's targets and actions. Can't get much simpler than that.

So thankfully, I'm productive again - with git (yeah), JUnit and ant. Not bad for a day.

Lots of Eclipse Usage at Work, Might as Well Get It

Friday, March 13th, 2009

eclipse.jpg

First week here and it's clear that there's no one universal set of development tools or techniques - C#, C++, Java, Flex, even VB... it's a lot of tools and there's very little unification of method, style, documentation, etc. It's very much what I expected - dictated by the needs of each group, but one thing is clear - if I want to be more in-line with the group, it'll mean that I need to get used to Eclipse or IntelliJ. Now, I'm not about to get IntelliJ for my Mac, but I can download Eclipse and then have a go with it.

So this morning I decided to have a run at Eclipse for my MacBook Pro. The download was beefy, but it's got all the tools I should need - even the CVS integration. I know there's a subversion plugin for Eclipse (Subclipse) but I want to chat with Troy about that before I go installing that. Maybe it's nice, maybe it's junk. Gotta get his take on it.

If that works out, then I should have Eclipse running on my Mac like I do on my machines at work. Not bad. Certainly Flex development is all done in Eclipse (the initial motivator) and a good bit of the Java work might be there as well. Don't know. But it doesn't hurt, and it's good to be as versed in the tools the other folks are using as the ones I'm used to.

UPDATE: Troy used it and thought it was fine - worked great. So I looked at the 'Download and Install' page and there it told me exactly how to point to the published install location and from there, Eclipse takes over and handles the install and update. Easy enough to do, and now I'm ready to do SVN work within Eclipse.

Pulling the Plug on Comcast, Adding Verizon Wireless

Thursday, March 12th, 2009

NetworkedWorld.jpg

The guest wireless access provided at work is nice, it's fast, but to use it I can't use Adium to get access to my instant message systems. They need to log all chat/IM on their networks - guest or no, and because of that, they aren't currently allowing IM on the 'guest' part of the network. Seems very reasonable - it's regulations, after all. So I was thinking more about the V740 EVDO card from Verizon. It's up to 1.4Mb down, and 800kb up... not fantastic speed, but it's completely wireless, and that's interesting for a lot of reasons.

If we went on a trip to Dad's house, then we'd have the internet. Not bad. If we went on vacation in the US, I'd be online. Not bad. The Metra - nice. I'd really be able to do some work just about anywhere.

But it's $60/mo, and with the new job and going from hourly to 'base + bonus' it's not something I was sure we wanted to add to the monthly load. When I asked Liza about it she said I should do it to be able to talk to Jeremy and Troy, but she was very unhappy with Comcast's Extreme 50 service. She's been saying since we upgraded that it was, in fact, slower than the older service which I think was 12MB down, 2MB up. In theory, that should be impossible. But Liza uses her box a lot and from her point of view, the extra $80/month was making things worse, not better.

pirate.jpg

So it was clear what we needed to do: Move back to the Comcast Ultra - 30MB down, 5 MB up, and save the $80 a month (they had upgraded the speeds on every price point) and then take some of that and get the Verizon service. That way, I can use the Shop's guest wireless if I need to download some massive file - like an update to Xcode, or something, but for the most part, use that and not the guest wireless and get back to Adium.

So I told Liza to do the Comcast move - as she also wanted to remove some sports package we have that we don't need, and when she tells me that it's done, I'll order the Verizon card from Amazon where it's only a penny ($0.01) with the required 2 year service contract. That's about $129 cheaper than going to the Verizon store. Why? No idea, but it is.

In the end, I'll be able to use Adium as I want without any problems, and still have the speed when I need it, and be mobile if I really want it. Not bad.

[3/14] UPDATE: I'm pretty miffed at Amazon and Verizon. Here's what happened: I ordered the V740 card from Amazon for $0.01. They said that Verizon rejected my credit application and that I needed to call Verizon and clear it up. So I did. They explained that they don't allow a second account on the same SSN as an existing account - I said that's OK, I want it on my primary account anyway. They said I'd have to have Amazon re-send it and they'd take care of it. So I called Amazon, and after four people, I got to someone that finally said I'd hear from someone in 24 hrs. What?! This is Amazon - I could have ordered a book and had it in hand in that time. What's up with that?

So I waited, and a little later today I heard from them that the reason I can't have the V740 card is because I'm not a new customer. The discounts are only for new customers. Fine. So I can't get it from Amazon. Pitty, they didn't say anything about that in the order form, but that's life. So I decided that I'd just go to the Verizon store in Bolingbrook today and get the card there.

Not so fast, me bucko! The Verizon store doesn't carry them! There's one in the case, but none to be sold. I can't believe that they can't carry at least one! But they didn't. So now I'm waiting for this Tuesday when one will arrive in the mail and I'll be able to activate it and then I'll be able to get access from work without using the guest wireless account. What an endeavor.

Day Three – My First Really Smooth Day

Wednesday, March 11th, 2009

cubeLifeView.gif

I have to say that it felt really good today to have a smooth day - no worries, no sense that I'm totally behind everything... I know it's going to take time, but it's just so unusual for me to be so new, it was a little unsettling. This team, friends, and Liza, as always, have really helped me through these tough days. Oh, I'm sure they aren't all gone, but I've been around the block a few times, and once I get my feet firmly on the new ground, I'm not worried about that.

In a few days, I'll be here a week. That's a big milestone for me. Also, it'll mean one guy is back and I need to get a good understanding of his project so we can expand/enhance it and deliver it to more desks in the firm. It'll be exciting to see all the phases of that here, and then get even more comfortable with the process.

Yes, things are getting better, and I'm very glad for that.

Second Day at the New Job – Less Flopping, More Progress

Tuesday, March 10th, 2009

cubeLifeView.gif

Well... I had a better day today. Sure, it's still Day 2, and I mean really - what can I expect from myself, here, but I'm hardest on myself and strive to make a difference even when there's no possible serious expectation of same. After all, if I had been at my old job and a new guy came in on Day 2, would I expect him to make a significant difference? Nope. I'd want him to learn how things are done - then make the significant difference.

I'm sure in a month, this will all seem like a bad dream, but I have to live it now, and it's uncomfortable, but getting better. I think it's important to show the kids that even adults are as uncomfortable starting a new job as they are going to a new school - or starting their first job. It's human nature.

But I had a few flashes of good today, and that's keeping me going. I know I can do this, it's just going to take time to get going.