November 6, 2007

ProgrammableWeb

If you like APIs and mashups, you should check out ProgrammableWeb – it’s a directory/advice/analysis site for all things API-ish.

Most recently, they’ve been working on building a subsection for government APIs, which is something that I’m very keen on. They’ve done a terrific job of organizing and structuring the information there. Outstanding work!

2008 Defense Earmarks on Google Earth

This is a lot of fun. Use the Flight Simulator inside Google Earth, and with this Earmark KML file, you can see where all the proposed 2008 spending on defense is going.

We live in an amazing world, I tell you what!

October 24, 2007

Too many ongoing threads in Gmail?

If you’re uninterested in a thread of conversation, but it just keeps coming back, try this:

Open up one of the messages in the thread, and hit ‘m’.   You’ll be transported back to the main view, and up top it will say “This conversation has been muted”

October 22, 2007

Some very good advice for programmers

Reg Braithwaite has a very strong case for being more open-minded in your programming research/learning.

Having said that, this is probably the difference between the Myers-Briggs INTP and INTJ subtypes.  INTJs (which is very common amongst programmers) are prone to judging and rejecting information that they disagree with.   INTPs less so.

Having said that, I’ve certainly made this mistake on more than one occasion (and quite possibly blogged about it as well).   But now that I’m thinking about it, I suspect I’ll make it less often.

October 15, 2007

Verizon Opt Out

It took me just 1 minute to opt all of my Verizon phones out of this data sharing service.   It’s not the most obnoxious service ever, but hey, it only took a minute!

October 14, 2007

Quantum Immortality (nee Suicide)

How Stuff Works on Quantum Suicide

Quantum Suicide is a misnomer, however, because it doesn’t have to be you who pulls the trigger, the effect is the same.  In fact, there doesn’t have to be a human pulling the trigger at all – the machine that reads the quantum spin could check it at regular or irregular intervals on its own, and fire the gun.

It also doesn’t have to be a gun – it could be electricity, poison, lasers or sonic screwdrivers (Master variant).   It could also be meteors, drowning, heart attacks, strokes, guillotine, rope or explosive.   In fact, any source of death is governed by the possibility of “it happened, or it didn’t happen”, based on the interactions of atomic and subatomic particles.

If the Many Worlds theory is correct – you are immortal.   And, in my opinion, since your memories and cognitive faculties are what makes you you – you are also (most likely) protected from dementia, brain damage, alzheimers or senility.

Something to think about on a rainy afternoon ;-)

October 4, 2007

Storm on the horizon

A fascinating article on a worm/virus/bot parasite thing called “Storm” that is apparently nigh-invulnerable and possibly unstoppable… (well, on Windows, anyways)

I thought it was a rather overwrought article at first, until I realized that it was written by Bruce Schneier.  Eeek.

My thoughts:

Worst case – the Storm takes over virtually every Windows computer on the Internet, extorts tens of billions of dollars out of Microsoft, and then wipes them all down anyways, causing a massive global catastrophe.

Best case – the Storm takes over virtually every Windows computer on the Internet, extorts a billion dollars out of Microsoft. Microsoft works feverishly to improve their security infrastructure, even at the cost of backwards compatibility. The criminals are found and Microsoft gets most of their money back and the world gets a much more secure OS.

;-)

September 26, 2007

Digg EarmarkWatch

The latest tool from the SunlightFoundation – EarmarkWatch is out, and we’d love for you to check it out, give us feedback, and if you like, help us Digg it up to the front page.

August 10, 2007

Comments are down

For some reason, the wp_comments table has disappeared. I may have lost all of my comments :(

Hopefully, I’ll be able to get new comments to start appearing, however.

*Update* – The MySQL web front-end “Repair” button worked wonders, once I figured out which database the blog was connected to.

June 5, 2007

RESTful but not HTTP-based?

Harry Pierson says:

Yet, I get the feeling that the REST community would consider a solution that uses the REST architectural style but not HTTP and/or URI as “not RESTful”.

In general, I suspect that the community might balk.   But I happen to believe that a resource-oriented communications protocol should be implementation independent.   One should be able to implement a RESTful protocol in just about any messaging system.

May 9, 2007

This just in from the Department of “Duhhhhh!”

http://www.physorg.com/news97857326.html

Research confirms theory that all modern humans descended from the same small group of people

A moment’s contemplation should reveal to everyone that humans descended from two specific ancestors – the first “human” who mated with a “nearly human” to produce “human” children.

I’m not sure why this would be a surprise to anyone :)

March 27, 2007

Unacceptable

This is the work of worthless cowards, who lack the intelligence to behave in a civilized manner, and instead, use sub-human threats of violence to get their way.

To those of you who wrote this, you may think yourself clever to control the conversation with fear.  Instead, you have blackened your core with evil acts.

Oh, and to those who suggest that she should “just grow up” is as vile as suggesting that a rape victim “deserved it because of the way she dressed.”

January 31, 2007

Flex is the new Java?

Bruce Eckel wrote an interesting article on the shortcomings in Java, and how much he likes Flex as a platform for future app development.

I think he’s exactly right – Flex apps will run in browsers on all of the major operating systems, and there’s no reason they can’t run on the desktop using a runtime of some sort.   Other than 3d games and CAD rendering there are few applications that need direct access to the video card and the CPU.

If Flex does succeed here, it will represent the triumph of JavaScript over Java, Flash over HTML and Adobe over Sun.   Microsoft may have a response with Atlas, but unless Atlas is fully cross-platform, I’m not sure it’s going to win.

January 26, 2007

I am stunned

This headline blew me away:

11 Reasons to give Microsoft Vista a chance

Think about that for a second.  When have people ever had to attempt to justify or cajole people into trying a new Microsoft OS?    And then there’s Office 07. It’s even worse – people aren’t even trying to justify why you should “give it a chance”.  As far as I can tell, Office 2007 is DOA, in terms of excitement, buzz or anything.
First – kudos to Microsoft on Windows XP and Office 2003.  Clearly, those are two very effective and well done systems if people don’t feel any need to upgrade.

Second – what does this mean?  It seems quite ominous, in relative terms.  There’s no doubt that they’ll continue to make plenty of money, but it could be that the upgrade cycle is going to slow down considerably.  We shall see.

January 16, 2007

vi syntax highlighting on MacOs

to turn on syntax highlighting in macos:

echo “syntax on” >> ~/.vimrc

Update: I changed the command – a commentor pointed out that my previous example was incorrect in most cases.

January 3, 2007

Think Differently

Laurent Bossavit talks about his experience switching to a MacBook.

I was surprised by his first issue – my MacBook Pro makes no noise at all much of the time.  I practically have to press my ear against the case to hear it.  It may be an airflow issue for him, mine has a lot of clearance.  To be sure, when it is hot, the fan is fairly loud.

I have similar issues with the keyboard, but since I typically plug a mouse and keyboard into my laptop, it hasn’t been an issue.

I do love the fact that there’s BSD Unix (the one true Unix, IMO) underneath the hood.  It made me all giddy inside to be able to open a terminal and look at the /etc files and the /var/db config, etc.

I have Parallels running for my email (Outlook).  It works quite well.  The new version of Parallels looks like it will be even better.

And as for me, change has been great.  I enjoy the challenge of learning the tricks and secrets of a new OS, and I’ve found some blogs that help with mac-specific tips and tricks – SilverMac is my favorite thus far.

And as far as reliability/stability, it’s been rock solid.   Much more so than my woeful experience with Bootcamp, Windows XP and Medieval II : Total War (which is a disaster of instability, lockups and reboots.   A pity, too, because Rome : Total War is my favorite game of all time.)

December 21, 2006

The MacBook Pro Dual Boot Experience

(Hey, that would be a great name for a band!)

So last week, I was authorized to buy a MacBook Pro and try it out to see if we should issue them to the development staff. (One of the benefits of being the chief technical guy in a small company).   Since I’m the guinea pig, I decided to try out both Boot Camp and Parallels, as well as native Mac Os as well.  Here, then, are my thoughts on each of them.
Mac OS

  • Much faster setup and boot sequence
  • I like the desktop widgets
  • The “download something that turns into a disk on the desktop that I can’t get rid of until I reboot” is annoying, but not deal-breaking
  • I use a dual monitor setup, which works perfectly, except that it is very frustrating to have to go all the way over to the left monitor to work the menu.   This is one area where Windows seems better.
  • My Firefox bookmarks, settings, etc, even the secure password thing transferred over from WinXP flawlessly. Kudos
  • It is already loaded with the latest version of Java 1.5
  • The Photobooth thing with the built-in camera provided a couple of hours of fun for the kids (and me too, I admit)
  • Eclipse runs great.  I haven’t tried the beta of flex Builder 2, but I expect it will work fine as well.

Boot Camp

  • Easy to set up.
  • Can’t get the touchpad to work properly.  Had to download a third-party app to help with that.
  • Performance is phenomenal
  • This will mostly be used for games and such, although I did go ahead and install the full MS Office suite.
  • Games look outstanding.  I’m having crashing problems with Medieval II : Total War, but I suspect it’s the game, not the hardware.

Parallels

  • Setup was easy enough.  A little trickier than Bootcamp, but not significantly so
  • I was able to mount the Bootcamp partition as a Network drive on the Parallels setup, so I can reuse my existing Office setup, and I’ll have one common place for documents across both Windows variants.  It’s not working yet, but I have hopes that it will :)

Asthetics

  • The MacBook Pro is slim, sleek and lovely.  I’ve never had a better laptop in terms of look, performance or features.
December 5, 2006

The value of a weakly typed Web Services interface

I’ve been following the discussions on InfoQ about “The Lost Art of Separating Concerns” by Matt Baker. Matt compares and contrasts the relatively architecturally clean MVC model for UI work with the programmatic web services model. For example:

GET /stockQuote?ticker=AAPL

vs.

getRealTimeStockQuote(“AAPL”)

While I generally agree with Matt, I think that he doesn’t do a good job of describing what the benefits of the more generic approach would be. So I thought I would add my two cents. Note that I’m working on a web-services project right now, and I’m in the process of defining exactly this kind of interface, so I’m putting my money where my mouth is, as it were.

First, let’s look at the basic flow of the classic MVC model:

REST1.JPG

The caller makes a request, which is first processed by a generic handler, then a custom handler (or, potentially a series of custom handlers). The handlers call the business logic which works to populate the model. Finally the model is sent to the view, which , by way of the controller, sends visually meaningful information back to the Caller.

The result – the controller accepts the request, the business logic focuses on filling out the model, and the view is responsible for presenting it in a useful way to the customer. Note that there’s very little “typing” going on here – the caller’s request is essentially a hash map with some header information, the View’s response is a long String.

How do we adapt this approach for Web Services? Web Services don’t have a View, I hear you say. Well, that’s true, unless you change the word “View” into “Response Protocol”. In that case, I hope you would agree that the Web Service certainly has a way in which it should respond to a request.

So what?

Well, if you have multiple versions of your web service, you could invoke multiple “Response Protocols” – one for each version.

But with a traditional web service approach – getRealTimeStockQuote(“AAPL”) – it would be very frustrating to handle that.

No it wouldn’t. You just change getRealTimeStockQuote and add a new parameter, the version - getRealTimeStockQuote(“AAPL”, “1.0”)

Hrrm. What if you want to create a variation that takes an array of stocks to receive quotes on?

Well, then you’d create a new method:

getRealTimeStockQuoteArray( [ “AAPL”, “GOOG”], “1.0”);

Really? Because in the Web world, you’d still be able to do that with just one Action, by adding new parameters to the request. You might have to create a new view, but you certainly wouldn’t have to create another method. You might *want* to create a new Action, but you wouldn’t have to.

And that’s just a simple example. Think about a more complex web service, one that takes, say, a more complex object. And then the object changes – you add more information to it, you change and expand its methods. And you have to maintain all of the previous versions. Think about expressing an order for an MP3 player. A web service might evolve as follows over the years:

orderMp3Player(“Brand”, “Size”)

orderMp3Player2(“Brand”, “Size”, “Color”)

orderMp3Player3(“Brand”, “Size”, “Color”, “FM?”)

orderMp3Player4(“Brand”, “Size”, “Color”, “FM?”, “Video?”)

orderMp3Player5(“Brand”, “Size”, “Color”, “FM?”, “Video?”, “Wireless?”)

And this doesn’t even cover all the variations – Form factor (nano vs. mini), the video formats it supports, the battery length. And, most importantly, what about the response? The response message to orderMp3Player() might be significantly different from orderMp3Player5(). So now you’re looking at various versions, or a common handler with multiple output formats, all hand-coded.

How would you handle that (elegantly) in a traditional web service model? I ran into that problem a while back (only with a lot more moving parts), and the only thing I could come up with was to abandon a long parameter chain, and go with an HTTP Request-style hash map for my request, and another for my response.

orderMp3Player( { Map of Features })

This approach dramatically simplified the interface, at the expense of slightly more complex marshalling and unmarshalling of request and response elements at the client. But the interface wouldn’t have to change over time, and I could simplify all of my intermediate code. I could have a generalized receiver look at the parameters, delegate the request out to the appropriate business logic, and then, based on the version the client requested, format the response according to their needs. In essence:

REST2.JPG

Look familiar?

I was very happy with this approach. The concerns with interface maintenance and dealing with customer-specific mutations went away instantly.

But, interestingly enough, I was only tapping about 10% of the power of a weakly-typed API. Because I wasn’t taking advantage of all the other capabilities of the web-based model.

  1. Filters – because the request and response are generically formatted, you can configure various filters at run-time to intercept and manipulate the request and response.
  2. Run-time Handlers – beyond just the filters, because the interface is generic, you can actually replace one version of a web service handler with another without making any code changes.

Talk about separation of concerns! Now I can delegate almost everything that isn’t core business logic out to more-or-less generic filters. And I can dynamically swap in various implementations of my service handlers, without having to build that flexibility into the code. Consider:

REST3.JPG

Now, we’ve successfully delegated out a bunch of the “non-functional” work out to these handlers for orderMp3Player(). Now, if we want to add more features/capabilities to our MP3 Player ordering system, we’re golden.

Except that our boss just told us we’re expanding. In addition to MP3 Players, we’re going to also sell Farm Animals.

Urrg. Now I have to create orderFarmAnimal(), and set up this whole system again.

Well, unless I’m smart, and I switch everything over to the even more generic order() method. I’ll define a parameter in the hashmap to define what kind of “thing” I want to order, and then I’ll do all the rest of the business-specific work in the business logic. I can even “rewire” the MP3 orders, as such:

REST4.JPG

Oh. The boss called again. Now we have to not only handle orders for MP3 players and farm animals, we also have to store videos. (This boss is clearly trend focused).

Crud. The order() method doesn’t make sense in the context of video storage. We need a storeVideo() method.

But, frankly, accepting a video file and accepting an order, while different in business focus and other ways, are both variations on “putting” something on a server, no?

Well, why not go with a generic put() method? Or, if you prefer, post() – I don’t really see the need to treat them particularly differently.

So now we can define the put() operation. We’ll know from the data whether it is an order to process or a video to store. If we need to add more services, we can effectively reuse all of our logging infrastructure, our performance metrics, our authentication, etc. Given enough time, we’ll probably end up replicating Struts or something like it.

Pros and Cons of the Weakly-Typed approach

Pro

Con

Handles change quite elegantly

It is a harder API for the user to use, because it is so generic

Cleanly separates the various layers

Will be slightly more verbose

Allows for run-time changes in flow, structure and behavior, without explicit code

Because the server-side is so easy to change, it is easier for a non-coder to use and adapt it, making it harder to ensure job security with a complex and hard-to-use API

Of these cons, the harder API is the only major concern, in most contexts.

So how do I deal with that?

At the end of the day, this weakly-typed SOA is something of a domain-specific language – the “things you can do with my company’s services” language. Here’s how I’ve dealt with it so far:

1) Create a set of libraries to support the packaging and un-packaging of domain-specific objects into hash maps. Repeat for as many different languages as you can

2) Create tutorials, examples and test suites to help teach the user which parameters should be used when

3) Work hard on the error reporting feedback back to the user. Error message support in your parameter map should be one of the first things you do.

If you do these things, you’ll be miles ahead of almost everyone else on the user-friendliness side, and your API will stand the test of time.

November 28, 2006

Old Fogeys in Training

This was a real eye-opener. A geek reviews the Wii, and finds it lacking compared to his beloved 360. His reasons?

1. It was awkward to use

It wasn’t particularly fun for me, however. It was awkward to play videogames, which hasn’t been the case for me since I got used to controllers with more than a handful of buttons.

2. It *gasp* might make game controllers in the future different

I fear, perhaps too much, that future consoles will be more like the Wii than the 360. Even though it’s a fun idea to have people boxing pixels with their real fists and swinging virtual golf clubs and the like, my bread and butter will be shooters, and I do not want to have to use anything like a Wii-mote and a nunchuk to shoot down virtual enemies.

3. He’s lazy and out of shape

I don’t want to break a sweat while playing videogames. …. While some of the cyberathletes were athletic, too, I don’t think being in good athletic shape should be a requirement for gaming.

The review is really funny if you read it with an old man’s voice – like Dana Carvey as the grumpy old man on SNL “We had to walk on jagged stumps and we liked it!”

November 10, 2006

A Squidoo Lenz

I added a Squidoo Lenz for myself.  It’s an interesting system – check it out.