Archive for March, 2009

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.

Coda 1.6.3 is Out

Wednesday, March 18th, 2009

Coda.jpg

This morning I noticed that Coda 1.6.3 is out and I got the update which includes a lot of bug fixes. Among the many things are a raft of changes to SVN usage and how it interacts with SSL and the uploading process. Nice to see, as I've been reading about that in the Coda mailing list for a while. There also seems to be just a bunch of little things all cleaned up. It's turning out to be a sweet little tool. I'm glad to see it.

Google Visualization API Simply Blows Me Away

Tuesday, March 17th, 2009

GoogleVisualization.jpg

I think everyone that's looked at the Google Finance page knows the really nice time-series graph that Google puts up on that page to show price history with annotations. Well, today I spent some time checking to see if it would be possible to use that in some time series viewer we're making at the Shop. Turns out, there's an entire API and widget set built around the Google Visualization API. Amazing.

The API is really pretty simple, and they give you a few reference implementations as well as the exact results you need to return for a specific query. But in essence, it's a table of data and then it's up to the widget to take that DataTable and turn it into a nice looking visualization. They even make a toolkit to bridge these to Java - which is a big plus.

The test code is simple, easy to follow, and after a couple of hours of reading, it was very clear to me that this was going to be an ideal way to partition the data-generating back-end from the front-end visualization. Oh sure, I have more reading to do, and there's plenty of coding yet to do, but my goal is to put some kind of in-memory database, backed by a SQL database, in a Tomcat instance and then put this request/response on top of that and then slap the GUI widgets in a simple web page on top of that.

Google Visualization Widget

It's clean, simple, and most of all - beautiful. Let's face it... the visualizations they have already done are nothing short of stunning.

So I'm going to be going down a road that I haven't spent a lot of time on - Javascript and Google APIs. I think it's going to be an interesting ride.

Acquisition 2.1 is Out

Monday, March 16th, 2009

Acquisition.jpg

I'm not a big peer-to-peer downloader, in fact, I think I've downloaded just two things - a couple of Eddie Izzard tracks that we owned the DVDs for, but I wanted just the soundtrack. But when I needed to get that, I got Acquisition, and it's done a fine job for the limited used I've had for it. Today, I saw that they have released v2.1, and it includes Sparkle support and a few design tweaks and connectivity improvements.

So if you need something like this, I can say it works, but can't say it's all that much better than the other things out there. I just haven't had the need to look around that much.

Somedays I’m Amazed How Hard Parenting Is

Sunday, March 15th, 2009

trophy.jpg

My kids are good kids. I mean they are all smart, healthy, clever, athletic, and at the same time they can be the biggest pain in my butt that I've ever had. It's true - no one can hurt you like those closest to you. And kids are a constant source of happiness and grief. I love them, and because I love them, they are able to frustrate me like no other human beings on earth.

Case in point: Joseph this morning. He wants to wear his (curly) hair plastered down with a (large) handful of mousse. Why? "Because it looks good." Ask anyone else and it looks like 1970's 'AfroSheen' - constantly wet and when you touch it it's actually brittle. Amazing. But try and tell him that softer and natural looks better and you are the one being unreasonable.

TheMousekeeters

Joseph, Marie and Angelina - top to bottom

So Liza tries to talk to him, and gets very frustrated in the process. He's always splitting hairs, trying to make it seem like he's the injured party. So she comes back into the bathroom to take a shower, and she's furious with him. I decide that since I'm not yet upset, my chances of staying calm for him are pretty good.

Silly Daddy!

I try to talk to him, and everything is about how his Mom is trying to "control his entire life." Yeah, like I haven't heard that before. So I point out all the freedoms he has, and he responds with "Yeah, but she's trying to control my hair, and after that, it'll be the rest of my life." Paranoid much? So I'm trying to point things out, and I don't realize that there's no talking to a 15 yr. old boy that's convinced his mother is out to control his entire life - starting with the amount of mousse he puts on his hair in the morning.

In about 8 years, I'm going to show him this post, and he's going to apologize to me and his Mother, and then in about another 20 after that, he's going to call us up and thank us for not killing him at the age of 15. For his new 15 yr old son will be saying the same things to him, and he'll be ready to drop him off at the orphanage. It's the same way for every kid. It's called maturity.

I wish he had more of it now, but that, too, is the point, now isn't it? It's my turn to call my Mom and tell her I'm glad she didn't kill me at the age of 15. Of course, this isn't the first time I've called my Mom and thanked her for letting me live... it's just the latest.

So I'm writing this down because some day I'm going to look back on this and laugh. But today is not (yet) that day.

Skitch 1.0b8 is Out!

Sunday, March 15th, 2009

Skitch.jpg

Skitch is just about one of the handiest little apps I use, and today they released a new version - 1.0b8 (v821) available via auto-updating from within Skitch. The release notes included updates for the Unibody MacBook's camera grab as well as better compatibility with Spaces. In general, there were a ton of updates to the program. Sure wish they'd have the release notes available on their web site, but I guess we can't have everything.

So get it, you won't be sorry.

Marc’s PHP 5.2.9 is Out

Saturday, March 14th, 2009

php.jpg

This morning Marc Liyanage tweeted that someone had used his build process to build PHP 5.2.9 for Leopard and posted it to Marc's web site. I downloaded and installed it and when I tried to run my old info.php I was surprised to get nothing:

  <? phpinfo() ?>

When I checked Marc's website I saw that hist test info.php was slightly different:

  <?php phpinfo() ?>

Trying that, it worked like a charm. I'm wondering if that's something in PHP 5 that I have been missing up to this point in time. I'll have to check and see what my other PHP scripts have to say about the matter.

Yup, it's the default setting on PHP - to require the 'long form' of the script start. It's configurable in the php.ini file, but that's a little dangerous as there might not be this setting in the web servers it runs on, etc. So I went through all my PHP code for the North Hollow Farm site and fixed it up.

[3/15] UPDATE: OK, so I took the time this morning to clean up the North Hollow project and then repoint the workarea to the right repository on frosty. It was a little bit of a hassle, since I hadn't touched this since I got it off my SGI box, but still, it was not horribly hard. Now I have something that works with the default PHP install and the PostgreSQL database is permissioned for the user _www as opposed to the older www. Minor change, but a pain to figure out.

Happy Pi Day!

Saturday, March 14th, 2009

pi.jpg

It passed this year with no fanfare at school, but it was Pi Day nonetheless. I still think how funny it was the first time I heard about this with Marie's math class. What a hoot.

Well... here's to Pi! (Nina would say "Pie!")

It’s Amazing What Passes for a Language – C#

Friday, March 13th, 2009

Csharp.jpg

OK, I'm old school, and as such, I'm not a big IDE user, but I recognize that they have a place in this world, and it saves a lot of people a lot of time. Just not me. Not most of the time. But when I'm coming into a new project, and it's already established in this IDE and a certain language, it's just plain silly to buck these established "standards".

But I have to say... C# is one of the oddest languages that I've ever seen. I believe it's written for people who have never seen a programming language before, and it's meant to be "easy" for them to understand what it's doing. Let's look at the setters and getters in C#, shall we?

  private string _farm;
 
  ...
 
  public string Farm {
      get {
          return _farm;
      }
      set {
          _farm = value;
      }
  }

where the first line is the definition of the instance variable, and the thing that looks like a method definition in Java or C++ or C is really a combination definition and meta-data for the getter and setter. The use of this code is simple:

  obj.Farm = "three";
 
  ...
 
  string l = obj.Farm;

Here the first call will end up calling the set 'method' in the Farm definition, and the second will call the get method. C# looks at the usage and then decides what method to call based on the naming conventions. I can see this, in theory, but it's so totally contrary to what you'd expect if you knew Java or C++.

In fact, in either of these two languages it's clear what:

  obj.cnt++;

means, but in C# is it calling the getter, doing the increment and calling the setter? It would appear it would have to. However, it's not clear from the language structure. Call me silly, but I like the language to infer as little as possible about the workings of the code for me. If I wanted that, I'd have written macros for preprocessing.

I have to use C#, so I will, but I can't imagine that I'm going to look at this anytime soon and see this as a good, descriptive, understandable, language. No time soon.

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.