Wednesday, January 23, 2008

legendary

I started using Google Charts a few weeks ago, and I have to say: it's pretty stellar. You can create bar, line, or pie charts with multiple colors and data sets using a simple HTTP GET. The names of the query parameters are kind of... trite... but overall I think the API is very user-friendly. I'm a fan.

Of course, the API does have one problem: it requires me to send all of my data outside the IBM firewall. Perhaps you hadn't noticed, but the IBM Corporation employs a lot of lawyers, and said lawyers get very uncomfortable when you start talking about sharing company data with servers owned by our competitors[1]. It's unlikely that Google is employing a bunch of people to read through its server logs, find requests originating from its competitors' servers, and muse about their significance to Google's management team[2], but lawyers are paid to be paranoid, and ours are very good at their job. The net of this is that any IBM application that uses Google Charts and is not an obvious demo must be reading from a public data store.

I like to poke fun at IBM's giant legal department, but the truth is that it's not much different from that of other companies. IBM isn't the only company that will have trouble using Google Charts, so it would be nice to see some API enhancements with a nod to confidentiality. I think the easiest solution would be to split up the generation of charts and legends; the numbers that are used to create the actual bars or lines are only meaningful if they are accompanied by labels, so keeping the two things separate should satisfy the requirements of most corporate lawyers. The API should be augmented with some sample JavaScript code for generating legends that match the colors and font of a given chart; this code could be provided alongside the existing code for encoding data and invoked by programmers who are not allowed to share legend text with the outside world. This isn't as seamless as the original API, but it's better than nothing.

Assuming that Google is in no rush to appease third-party developers using a service that doesn't generate any revenue, I'll be writing my own legend generator in the near future. I'll post the code once it's complete.

[1] I guess they're a competitor. I can't think of an area where we compete with Google directly, but my inner lawyer is telling me that once a software company reaches a certain size, it automatically becomes a competitor, regardless of its current investments.

[2] The Terms of Service explicitly denies such activity.

Labels: , ,

Tuesday, January 22, 2008

beacon

Lately my blog has been devoid of the deep technical content implied by my host name; I assure you it has not been from lack of interest. In the last two months, I've published three articles on IBM's developerWorks, each exploring a different aspect of Project Zero and REST. Check it out:

  • Title: Extend Project Zero's scripting platform with Flickr APIs

    Abstract: The Flickr photo sharing service is one of today's most popular Web applications. It provides a robust hosting service with slick social networking capabilities that make uploading, organizing, and finding photos very simple. That's all very cool, but from a developer's perspective, the most interesting thing about Flickr is its public API for reading and writing photo data. You can send API requests over HTTP using any programming language you wish, and many open source projects have sprung up to encapsulate this API for various languages. In this article, you'll learn how to "Zero-ize" the Flickr API by providing a Groovy binding that is easily reusable in your Project Zero applications. When you're done, you'll be able to read and write photo data from your Groovy scripts in just a few lines of code.

    Reader's Digest Version: You want to use the Flickr API in your Java applications, but everywhere you turn there's a factory pattern or a glorified HttpURLConnection. You have started building Flickr URLs with StringBuilder, laboring under the strain of append() and hard-to-read query strings, when you receive the tragic news: you have died of dysentery. Game over.

    Fortunately, Groovy scripting lets you use all of your Java skillz while shaking off the cruft that was keeping you down. This article creates a set of Groovy scripts for invoking the Flickr API and shows how to share the scripts throughout your Zero applications; it ends by showing you how to generate one of those ubiquitous photo collages so that your site will look exactly like every other site on the Internet.


  • Title: Manage an HTTP server using RESTful interfaces and Project Zero

    Abstract: WS-* users and REST users have an ongoing debate over which technique is most appropriate for which problem sets, with WS-* users often claiming that more complex, enterprise-level problems cannot be solved RESTfully. This article puts that theory to the test by trying to create a RESTful solution for a problem area that is not often discussed by REST users: systems management. In a previous developerWorks tutorial, I showed how to create a Web services interface for managing HTTP server products; the tutorial used concepts from WSDL and the WS-* standards to define the management interface and software from Apache Muse and Apache Axis to create the management application. For this article, I use Project Zero and REST design principles to recreate the interface and function of the original application and determine if REST is a valid option for this enterprise project.

    Reader's Digest Version: Human sacrifice! Dogs and cats living together! Mass hysteria!

    It's almost unthinkable: creating a fair and level comparison of WS-* and REST based on experience working in both worlds. Well, I went ahead and thought it, and then I wrote it down so everyone could share my completely non-hysterical evaluation of REST as a foundation for remote systems management tools.


  • Title: Add Ruby templating to your Project Zero applications

    Abstract: Ruby users, take note. You can now do everything that Groovy and PHP users can do when creating Project Zero applications! In a previous article, we showed how to augment Project Zero to provide support for the Ruby scripting language. The code that we wrote enabled Ruby users to transfer their scripting skills to the Zero platform and take advantage of its unique programming model. Of course, scripting isn't the only way that Ruby is used to create applications - programmmers who use the Ruby on Rails framework also mix Ruby in HTML templates similar to JSP and PHP. These templates, called RHTML files, are very useful for creating dynamic user interfaces, and this article will show you how to extend our Ruby support to include them.

    Reader's Digest Version: Remember the first time you saw Back to the Future? As the movie ends, Marty has just discovered that his father isn't a sucker anymore, his sister is popular, his brother has a job, and something he's done has warranted his parents buying him a brand new 4x4. When Jennifer struts in a few minutes later, you undoubtedly thought, This was a killer movie. And you were right.

    But then, out of nowhere, Doc screeches into Marty's driveway in a beat-up De Lorean and tells the two teenagers that their future is in shambles and they have to go to the future to prevent a certain tragedy. No way! The movie closes with the De Lorean lifting off the ground and flying into 2015. Wow! Robert Zemeckis just turned your expectations upside-down, and now you can hardly wait for Back to the Future II. Do you remember that?

    Well, if you're like most people, you had the exact same response when you read this last abstract and realized that my Ruby on Zero article has its own Part II; you thought the first article was great, but now that you've gotten a taste, you can't imagine life without Part II and its Mr. Fusion-fueled RHTML files.


Having explored over a dozen topics related to Zero and REST, it's clear to me that one of Zero's greatest strengths is how flexible it is; in other words, Zero does not get in my way as I try to bend it to meet the needs of my project. Most of the time I don't have to do any bending at all, but sometimes I do, and rarely is something so hard that it's deemed impossible or not worth the trouble. If the Zero platform is successful, this will certainly be one of the reasons: it provides you with many tools and conventions for getting things done, but it doesn't force you into absolutes or some kind of software design religion.

Labels: , ,

Monday, January 7, 2008

irresponsible

We don't have a television in our house, but holidays and vacations always grant us the opportunity to sit in front of one for hours at a time, be it in a relative's house or a hotel room. There's a lot of bad TV out there, but most of it just fails to be interesting; once in a while, though, I find a show that crosses the line from being bad to just plain offensive. Extreme Makeover: Home Edition is such a show. After watching a couple of episodes, I spent a few days stewing in the iniquity of it all, trying to formulate a coherent rant that didn't suffer from myriad exasperated tangents. I will dispense that rant now.

When I first encountered Extreme Makeover: Home Edition (EMHE), I assumed it was just a way to pull at the heart strings of America's TV audience and get them to watch what is essentially a one-hour commercial for all of the show's sponsors. I don't fault ABC for taking the opportunity to show an hour of non-stop commercials, I just can't believe that all of the hosts are able to pull it off with a straight face.
Host #1: Sal and Julie love to grill outside during the summer, but they haven't been able to do much grilling since they ran out of charcoal last June. We could just buy them a new bag of charcoal, but I think we can do better than that.

Host #2: I talked our friends at Sears, and they said that Sears offers a great selection of propane grills and accessories, all covered by a Sears Home Warranty.

Host #1: Wow, it sounds like Sears has everything we need. Let's buy an expensive Sears brand grill that will make Sal and Julie happy for years to come.

Host #2: Good idea. Going to Sears will make this outdoor grilling area better than ever.

Host #1: Let's go to Sears!

Host #2: Sears!
This aspect of the show is just mindless and predictable, and I have no problem with that[1]. What bothers me about EMHE is the complete lack of fiscal responsibility that is demonstrated by both the producers of the show and the lucky families they have selected. I originally thought that the show would provide the families with reasonable upgrades to their existing homes using materials provided by the sponsors, making it a sappier and more commercial version of TLC's Trading Spaces; what I found was a show that glorified suburban excess while completely ignoring the plight of people who do not even have a home to renovate.

One of the first EMHE episodes I saw focused on some family in Wyoming that had bought a house that was half underground and, consequently, filled with radon gas. The whole family was sick from the radon poisoning, and they didn't have the money to build a new house or take care of the dozens of stray pets they had adopted over the years. Enter EMHE. They tore down the original house and gave this family of four a million-dollar home with seven bedrooms, a pet sanctuary, and, by my count, exactly fifty-two flat-panel TVs.

Why is this bad? Let me count the ways:

The first and most obvious thing that eats at my soul is the fact that ABC has used its immense power to extract millions of dollars in time and materials from local citizens but only managed to help one family. I don't see why a poor or middle class family that is on the down and out needs a McMansion in order to improve their lives. Every time they highlight some family member who works with disabled kids or a local charity, it strikes me that this person must have extreme cognitive dissonance upon moving into a house that is light years beyond their means.

Having grown up in a lower-middle class suburb with a single mother, I can honestly say that if anyone had offered us a brand new 3 BR/2 BA ranch like the ones all of my friends lived in, we would have been more than happy to take it. Such a house would cost between $100,000 and $200,000 depending on which area of the country it was built in; why, then, does ABC feel the need to build homes that are assessed at $500,000 to $1,000,000? I'm sure that the families are excited to live in such luxury, but if you toned down the luxury three or four notches, would they really know the difference? Would they be any less happy?

EMHE could provide these families with nice suburban homes and all of the latest gadgets for about $200,000. By restricting themselves to "nice" and "impressive" (as opposed to "grand" and "overwhelming"), the show could afford to help three or four times as many families. It would have more content to work with and there would be no effect on the amount of product placement that is currently in the show. I really don't think there would be any negative impact on revenue or ratings if the network changed the show to balance cool home improvement with the desire to help as many people as possible.

The second thing that irks me about this show is also tied to fiscal irresponsibility. It's bad enough that a giant corporation is spending excessively on something that isn't necessary (big surprise), but it's made worse by the fact that they are pushing these families into a situation that will leave them house poor. Keep in mind that these families are already "regular poor", and while house poor may seem like an upgrade, it's not exactly the stress-free life that ABC promises on the show. If a family can barely afford their current mortgage and cost of living and is not in the position to upgrade their admittedly ramshackle house, can they really afford the property taxes on a $500,000 house? Depending on what state you live in, the property taxes on such a house could easily exceed the combined mortgage payments and property taxes of a house in the low $100,000s[2].

Of course, there is a chance that the families can remain frugal in their new luxury pad and pay their property tax bill on time. Success is less likely when it comes to the utility bills. Again, we're talking about families that were already having trouble paying the bills when they lived in homes that were 1,500 square feet or less; the new homes average over 5,000 square feet, and many of them have beautiful-yet-costly structural features. The Wyoming family came home to a three-story house with a foyer wall made of glass, and when you couple that with eastern Wyoming's distinct lack of trees, I think it's safe to say that this place is going to be a greenhouse for most of the year; their only respite will come during winter, when all of their heat will rise through the foyer and escape out the giant glass wall. I would love to see the parents' reaction to that first electric bill.

The third and final thing that has me yelling at the TV is the fact that Wyoming is one of an increasingly small number of states that has not passed a law to raise its minimum wage above the federal rate of $5.85. The people of Wyoming would march on Cheyenne if anyone tried to pass a state law that raised the local minimum wage or, alternatively, increased their state sales tax in order to help more families on welfare. And yet, I saw hundreds of Wyoming residents come out to build an enormous new home for one family in need, despite the fact that said family could not repay them, did not do anything to earn the house, and did not even help build the house. This stinks of hypocrisy. The lesson here is that spending a million dollars and organizing hundreds of volunteers is no problem if the cause is heart-warming and there's a good chance you'll be on TV, but it's out of the question to do the same when the goal is to help random people whose hard-luck stories are not relayed to you in tender, five-minute TV segments.

But enough about Wyoming. That episode didn't even bother me that much, because I'm sure that if Wyoming was like the rest of America and had a some basic laws in place to protect home buyers[3], the radon thing would have been caught before the closing and the family never would have bought the house. Some of these other families are much more suspect, and their prizes much more enraging. Let's move on, this time to Kirkland, Washington.

The family in Kirkland includes a single mother who has three daughters and has renovated her inground pool for the purpose of teaching area children to swim. This small business gives her the means to pay her bills, but her house is falling apart and it would cost more to fix it than to rebuild. Unlike the Wyoming family, which lived on a couple of acres in the middle of, well, Wyoming, this family lives in a quaint suburb next to houses that are similar in size. It was during this episode that ABC discovered a new way to encourage poor financial decision making.

The Kirkland house had been in the family for generations, so the mortgage was paid off long ago; this means that the family's monthly costs were going to food, utilities, and the temporary fixes they've put in place to make their home safe. Surprisingly, my initial reaction to this situation was not to tear the house down and build a million-dollar property complete with gazebos and a professional swimming pool. Instead, I thought it would make the most sense for the mother to put the property up for sale, move into an apartment, and get a new job that provides the same income as her swimming lesson business (which can't be very large, given that her customer base is fairly small and she has to compete with non-profits such as the YMCA).

The great thing about my solution is that it's the responsible thing to do, and it doesn't require me to believe that the family's problems are equivalent to those living in public housing in downtown Seattle. I realize that this sounds harsh when compared to the ABC solution, but it is a solution, and one that the mother should have adopted a long time ago. Kirkland is a popular town, and there are plenty of potential buyers for a nice suburban plot upon which a new family could build their dream home; since she doesn't have a mortgage to pay off, she could sell the property for an extremely low price and still make a big addition to her savings account. This family doesn't need a McMansion, it needs a real estate agent and a basic investment strategy.

The last and most recent episode I caught was about some family in Vermont that had two young boys, one of whom was physically and mentally handicapped. They seemed like pretty reasonable people, and the house they ended up getting wasn't as lavish as others before it; but while I didn't have any beef with the actual family, the whole episode got me thinking about the unfairness of ABC's selection process. This family bought a "fixer upper" that had no real foundation. The house should have been condemned. They were only able to afford the house because no one else would go near it, and frankly, I don't think that such a desperate decision should give them priority over other Vermont residents who have sobbier sob stories.

There are thousands of other families across the country in equally tough situations who have not stretched themselves beyond their means and taken on mortgages for homes they can't afford. These people will never be recognized by ABC because they don't own property. They are in the same dire straits, and are arguably more responsible citizens, and yet, without a homeowner's deed, they will have no shot at the McMansion on 1.5 acres like the people from Vermont. All we have learned from this episode is that if you give in to America's big house obsession and spend yourself bankrupt while competing with the Jonses, a big team of All American volunteers will come out to save you. Reward you, even.

There are plenty of other, less grown-up reasons to hate EMHE, but I've covered the ones that everyone should agree upon. Every day I wake up and check the daily news to see if the president of ABC has managed to form a synapse between his two working neurons and pull the plug on this sham of a television show. Every day I am disappointed.

So much anger.

[1] It may be mindless, but it's not immoral.

[2] Despite the fact that the new house is a contest prize, the familes can avoid paying income tax on it thanks to a questionable tax loophole.

[3] I checked - it doesn't.

Labels: ,