Archive for March, 2009

Holy Smoke! Building Web Sites is Fun Again!

Tuesday, March 31st, 2009

WebDevel.jpg

I've been fine-tuning my webapp this morning, and I have to say that it's a ton more fun to use servlets on the back-end and HTML and Javascript on the front, typical AJAX, than the other schemes I've used. Probably the second best is the Tapestry framework, and there's no reason you can't use AJAX on Tapestry, but the HTML in Tapestry is still going to have to be generated by the server, so it's not as lightweight as the system I'm using, but it's still not bad.

No, I have to say that this is a wonderful little way to put pages together. Certainly, a lot of the credit goes to Google's Visualization API. Without the widgets and the data standard, it would have been possible, but not nearly as powerful and therefore - fun.

Yeah, I think I'm going to have to do a lot more of this and see where it goes. Fun.

Interesting Gotchas with Google Visualization AnnotatedTimeLine

Tuesday, March 31st, 2009

GoogleVisualization.jpg

I have been messing with the Google Visualization's AnnotatedTimeLine widget on my webapp, and while it's wonderful in so many ways, there are a few 'gotchas' that I've run into - and I'm not alone on one of these.

Specifying Column Index in Hiding/Showing Columns

The AnnotatedTimeLine has some really nice methods that allow you to show/hide the lines on the graph (columns in the DataTable):

    chart.hideDataColumns(2);
    chart.showDataColumns(2);

the problem is that the columnIndex that you'd think you needed to pass in would probably be wrong. They are looking for the dataset index and for that, you have to remember that the date data in column 0 of the table is really not considered in this calculation.

So, if you have the name of the column and want to make it disappear, you need to have a function like:

    function toggleView(name, state) {
      var i;
      var colCnt = graphData.getNumberOfColumns();
      for (i = 1; i < colCnt; i++) {
        if (graphData.getColumnLabel(i) == name) {
          // the dataset number is one less than the column number
          if (state) {
            chart.showDataColumns(i-1);
          } else {
            chart.hideDataColumns(i-1);
          }
        }
      }
    }

If you remember to have the right offset, it all works fine.

Showing a Hidden Line Bug

I found a reference to this on the Google Visualization mailing list. It turns out that if you try to show a hidden line, it doesn't work. But if you cycle it twice then it works. Meaning this doesn't work:

    // hide the line on the graph
    chart.hideDataColumns(2);
    // show the line we just hid
    chart.showDataColumns(2);

but this does:

    // hide the line on the graph
    chart.hideDataColumns(2);
    // show the line we just hid
    chart.showDataColumns(2);
    chart.hideDataColumns(2);
    chart.showDataColumns(2);

It's the "second cycle" on the 'show' side of things that makes the difference. This is an acknowledged bug by Google, and the good news is that as soon as they fix it, we're going to get the fix. Nice.

UPDATE: With the 3/30/2009 Release Candidate from Google, this is fixed! Yup, just use the version "1.1" in the google.load() javascript call and you'll set it. It's set to go to production on 4/6, and at that point, version "1" will again get it. Excellent update!

So... just keep these in mind if you're using this widget.

NeoOffice 3.0 is Out

Tuesday, March 31st, 2009

NeoOffice.jpg

I don't use it often, but when I need it, NeoOffice is a really handy app to have. Specifically, it seems that some Microsoft Office formats (Word, Excel) don't import nicely into Pages or Numbers, and even Bean can't read them properly. In those cases, I've had great luck using NeoOffice to read and work on the files.

It's like the last chance for a Microsoft Office document. Well worth the download - if you need it, it's a lifesaver.

Awesome Day – Loads Accomplished

Monday, March 30th, 2009

cubeLifeView.gif

Today I leave feeling like I've really gotten the webapp into a good place. It's not all done, that's for sure, and I want to fix a lot of things, but it's working. It's got all the features it was supposed to have in it's first cut, and it's ready to show to the users.

It's nice to have a really great day. Get a lot done. Feel like you're a contributing part of the team. It's nice. While today isn't the first time this has happened, it's always nice to have it happen as often as possible.

The app is really close. I can see how it'll finally look.

An Interesting Alternative to AppleScript – JSTalk

Monday, March 30th, 2009

JSTalk.jpg

I've a big fan of Gus M's work at Flying Meat, and this morning I was reading about his alternative to AppleScript - JSTalk. The idea is simple - when creating a Mac app, adding AppleScript support is something most users expect from a high-quality app. But from what I've heard, and Gus seconds this, doing so is not easy which is why not all things you can do in an app can be done within AppleScript. In many cases, it's a limited subset.

So Gus made JSTalk - built on JSCocoa and WebKit's JavaScriptCore, that allows you to write JavaScript and interact with an application on that level as opposed to using AppleScript. He's got a command-line tool, an editor, and a framework for people to put into their apps to allow it to be 'automated' from JSTalk. The examples are compelling. The ideas are pretty sound.

What remains to be seen is how many will adopt it. It's all open source on the MIT license on GitHub, so it's there for the looking, fixing, using. If I had an app, I'd look at using this because there are a lot more people that know JavaScript than know AppleScript. It's just a language that not a lot of folks spend the time to learn.

So I'm going to keep an eye on this... if I make an app, I'll use it. It looks very nice, and all the hard work is done. Glad to see an alternative to AppleScript.

MacVim Snapshot 44 is Out

Monday, March 30th, 2009

MacVim.jpg

There were a few bugs in Snapshot 43, so the MacVim team worked on them and today I got an email notice that Snapshot 44 is out. This fixes various issues with the display as well as the python syntax highlighter.

Glad to hear about it. Got it right away.

Firefox 3.0.8 is Out

Monday, March 30th, 2009

Firefox.jpg

Once again, there's a raft of security fixes necessitating a new release of Firefox. Seems reasonable, but it's amazing the number of security fixes that there are these days. Maybe it's the increased attention each platform is getting, but I have to wonder if it's not, at least in part, due to sloppy coding. Sure, it's a complex bit of software, but still...

Oh well... it's easy enough to update, and so I do - for all the obvious reasons.

MarsEdit 2.3.1 is Out

Monday, March 30th, 2009

MarsEditIcon128.jpg

Daniel tweeted that he found a much faster way of browsing the flickr picture stream for the media manager, and so this morning I saw that MarsEdit 2.3.1 is out with this enhancement. Nice to see.

I'm not that big of a flickr fan, but I can understand that there are tons of folks that are, and for them, this is a real boon. Good enough.

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.

Skitch Updated to Beta 8.1 (v924)

Friday, March 27th, 2009

Skitch.jpg

This morning there was another update to Skitch - this time to Beta 8.1. The release notes say that it's related to PPC issues on 10.4 and the ability to snap X11 windows and the DVD Player application. Good enough for me. Gotta update Skitch - it's one of my favorite apps.