Friday, May 29, 2009

Excellent article describing how to work with CouchDB and jQuery in Firebug

A really nice step-by-step outline by Ben Atkin of how to use the Firebug interpreter to interactively work with CouchDB using jQuery's ajax() method.

Thanks to @nitin for this link, and thanks to Ben for taking the time to write it up! These simple tip blogs are one of the most valuable aspects of the social web for me.

Thursday, May 28, 2009

Twitter for communication in a disaster

I just sent this letter to the City of Berkeley disaster preparedness team.  You might want to consider doing the same with your local municipality...


Hello.  I am a homeowner here in Berkeley, and have been using Twitter for the past month or so, and I was impressed at how easily it is for me to stay up-to-date with things happening real-time.  For example, there is a conference going on in SFO, and I just subscribe to the search term for that conference and I see real-time updates from everyone who is at the conference and using that code.

Another example of course is that during the Mumbai terrorist attacks, everyone used the term "#mumbai" in their messages, and anyone subscribing to that term could see upates in real time.

One of the worst problems in a disaster is lack of information and nobody knowing what's going on or what they should be doing.  If a disaster occurs in Berkeley, it would be very nice to get real-time updates through Twitter.

In particular, I can see an "official" channel coming from your office and the City of Berkeley in general, with important information that you want to disseminate.

I can also see an "unofficial" channel where citizens can post messages, things like "fire on 4th and Hearst" or "looting going on near downtown BART, stay away" or "if anyone needs extra firewood I have some".

When I say a channel what I really mean is that when you post a message you use a certain tag like "#berk" or "#coberk" or something like that.   Then those of us trying to keep in touch can subscribe to this term and get real-time updates, and post our own updates as well.

If you set this up, and then let people know ahead of time to make use of these channels, I think this could be a very good thing.

You might want to also set up an agreement with local cellular providers that in the case of emergency everybody should have access to their data services even if they're not paying subscribers, so they can engage in communication through the Internet using their cell phones.

Thank you,

David

Wednesday, May 27, 2009

Google needs HTML5 and JavaScript

I've been following the Twitter stream for Google I/O, it's been fun to watch (cool that everyone got a phone).

But why are they giving developers phones? Well, being at Sun, I know the strategy: you capture developers, and many good things flow from this.

The other effort to capture developers is all the stuff around HTML5 and making JavaScript faster and better. Take a look at Tim O'Reilly's great post that summarizes the many cool HTML5 features that are already available in most browsers, things like a native JavaScript canvas and easy embedding of videos.

Why is all of this so important to Google? Because if JavaScript and HTML doesn't get much better quickly, then developers will move to the RIA model (ala Flex or Silverlight or Java) to get the beauty and dynamics they need for web-based applications.

And this would be a Big Problem for Google, it seems to me. Why? Because you can't crawl RIAs. You can't add AdSense RIAs. And ads are the cash cow for Google.

It looks like they're doing a great job though - the developers at the Google IO conference are very exicited. My suspicion: the web browser is going to win over RIAs like Flex and Silverlight, because it (a) developers are already used to JavaScript and the browser and (b) it works today on mobile web platforms like the Android and the iPhone and Palm's WebOS.

And by the way, if you're building a rich UI in JavaScript (or in any rich internet app environment), then the role of the server becomes very different - it stops being responsible for handling UI events and generating UI, and instead becomes a simple provider of web services. Just like the good ol' days. I think there are a lot of interesting consequences from that architectural change...

Wednesday, May 20, 2009

SchemaBank - web-based visual data modeling and change management

Well, this looks pretty darn interesting. I don't have a lot of time to play with this, but SchemaBank, if it delivers on its promise, looks like a very useful ERD tool at a pretty reasonable price point.

You can export a SQL dump from MySQL or PostgreSQL, import this into SchemaBank, and start going. Or you can start with a fresh schema. You can do visual data modeling, versioning, branching, diffing - in other words, both modeling and change control for your schema.

The UI looks sweet, although I'd be curious how it handles super-large schemas, always the bane of ER tools. It does have "Bird's View" which is a good sign they're thinking in the large.

Using CouchDB map/reduce to generate a bloom filter

This is very interesting. Devlin Daley is in the last phases of building a bloom filter for CouchDB. Taking advantage of various reusable components available out there in the Vast Internet, he uses map to set up a bloom filter for a given element of a given document, and the reduce to combine all of these into a single bloom filter. Et voila!

Once this is done, definitely something to keep in the toolbox. Thanks, Devlin!

Thursday, May 14, 2009

Gone over to the Twitter side

Remember when I gave up on Twitter? Ah well, I found a tool that actually works for me, TweetDeck, and now I'm actually finding a way for it to work. I particularly like that I can send and view Facebook status updates from the same tool, that really helps keep things together.

The problem is now when I have little comments to make or links to post, I post them on Twitter instead of here. I wish I had an easy way to post the same link to my blog, but I haven't figure that out yet.

I've added the "Follow me on Twitter" button to my blog page, or you can just go here and click on the "Follow" button.

If you're not on Twitter and are wondering what all the fuss is about, the best thing to do is to try it, it's very hard to grok otherwise. And I really do recommend TweetDeck, it helps makes it more manageable and easy to use, and thus you use it more and stay engaged.

I'm sure there are other apps that are similarly good, but without one of these the whole thing just doesn't work.

David

Java is like classical, Javascript is like jazz

I've been looking at Javascript in more detail as part of a side project I'm working on.  I've been reading Javascript code and feeling my head hurt, and it took a while for me to figure out what was causing the dissonance.

I've been a Java programmer for years.  I have always enjoyed its clarity and structure.  The static typing lets you say what you mean and mean what you say. 

Reading Javascript code isn't like that.  Nobody tells you what somethings going to be used for, and it can change over time.  Objects can be of any type and can have any number of elements.  Functions are created and destroyed like wafts of smoke.

I finally realized the Javascript is like impressionistic and avant-garde art, like jazz.  It flows, it molds, it changes, like a dream.  Java is like renaissance art, like classical music.  Its beauty is in its form and structure, but it constrains your ability to express and invent - you have to follow the forms given to you.

Of course this isn't a perfect match, but it helped me remove my Classical hat and put on my Jazz hat when dealing with Javascript.  And it also helped me understand why Java is so popular in the enterprise, while Javascript (and other dynamic languages) are so popular for the creative types building consumer-facing applications.

Sometimes a little metaphor like that can go a long way.  Now all I need to do is start wearing black and pierce my lip...

Thursday, May 07, 2009

Larry Ellison wants to keep hardware, SPARC, and storage

From @timbray, a very enlightening interview with Larry Ellison about Sun's hardware business.  Sez he wants to keep SPARC, storage, and the hardware business in general.  I wish him luck - Sun sure wasn't getting anywhere with the "integrated systems" pitch.

Tuesday, May 05, 2009

Very nice code review tool

I just wanted to quickly mention Review Board - a free code review tool that we're using here at Symantec. It is very easy to create a review based on a diff, pick reviewers, publish it, and manage comments - you can add comments to a specific line and have per-comment discussions.

All review comments are published via email so it can be tied into an open source community where all discussions/reviews are supposed to happen over the email list.

So much better than email reviews, where you have to somehow manage all the comments in a single email, which can be quite daunting.

Saturday, May 02, 2009

Inhumane pig conditions are incubator for swine flu

I think each of us knows when something is "not right", which I guess is what you might call "immoral" but that seems so judgemental. But regardless, what I've seen is that often our intuition is telling us something that our rational mind can, well, rationalize.

What I've noticed is that often, when we instinctively know something is not right, often we find out it's true when the unforeseen consequences arise. The latest example of this theme comes from an excellent article in Wired magazine (thanks @larrybrilliant), where they describe in detail how the swine flu now spreading through the world had its origins in insanely packed pig farms:

At an environmental level, the conditions which shaped H3N2 and H1N2 evolution, and increased the variants’ chances of taking a human-contagious form, are well understood. High-density animal production facilities came to dominate the U.S. pork industry during the late 20th century, and have been adopted around the world. Inside them, pigs are packed so tightly that they cannot turn, and literally stand in their own waste.

Diseases travel rapidly through such immunologically stressed populations, and travel with the animals as they are shuttled throughout the United States between birth and slaughter. That provides ample opportunity for strains to mingle and recombine. An ever-escalating array of industry-developed vaccines confer short-term protection, but at the expense of provoking flu to evolve in unpredictable ways.

The horrible packing of pigs for slaughter, standing in their own excrement, combined with an "ever-escalating array of ... vaccines." Sounds horrible, it seems wrong, and as we see, there are consequences.

The world lives in such a beautiful balance, each thing complementing the other in this intricate array of interdependencies. Then we take our logical, rational mind and deconstruct some piece of it and think we can get away with changing it for some increase in efficiency or productivity, without any "unforeseen" consequences.

I really am not interested in placing judgmental or moral overtones on this. This is not about God punishing sinners or some such rot. To me it's more about God's beautiful intricate creation, and how the depth and richness and complexity of it can never be fathomed by the human mind, and if anything I find myself shaking my head at our hubris in thinking we can push things to their limits like this and not expect consequences.

This is why whenever I hear some industry talking head saying how something is "perfectly safe" and "all studies have shown there are no harmful side effects" for some strange mutilation of the natural order (such as fake sugar and fake fat, or massive vaccinations of children, or the heavy use of pesticides and chemical fertilizers) I just go "yeah, right, uh-huh" and wait for the next shoe to drop, which it invariably does ten, twenty, or fifty years later.

Friday, May 01, 2009

Ruminations on what at Sun will stay and what will go

This week I ran into an old friend from Sun who now works at Oracle. I saw him in the lobby of the office building where I work at in San Francisco -- it turns out he's in the same office building! BEA had offices there, and now they're part of Oracle.

We went across the street to Peet's and remembered the good ol' days, and then started talking about the software products we thought were dead meat.

This is all conjecture and hearsay, and I recognize that every project killed means people unemployed, which is no fun as I can personally attest. But that said, one does wonder what's going to get the axe. Here are some possibilities

Glassfish
This is a hard one to swallow, but Oracle already has an app server (Weblogic). So there's a distinct possibility that Glassfish will have to go. Of course it's open source so it could still survive, but I can imagine Oracle pulling the app server folks off of Glassfish and onto Weblogic.

NetBeans
I love NetBeans. I had fun working on it. But let's get real. Oracle is already an Eclipse shop, as well as having their own IDE (JDeveloper). I just can't see why they'd want to keep NetBeans around

JavaFX
It's my opinion that Oracle has no need for this, and will be happy to pull resources off of it and back onto standard Java. However, mobile is taking off, and Java has a place there, so who knows. I am on the fence on this one.

JavaDB
I could see how Oracle would see this as quite valuable and how it could fill a good niche. But they could just as easily take the Most Excellent Java DB engineering team and redeploy them elsewhere, and leave Apache Derby to IBM.

MySQL
Well, everyone's conjecturing about this one. The nice thing for Oracle is now they have the future of MySQL in their hands and can direct it in a way that makes sense for their business. The only wild card I see is the forks that are out there, but I must admit I don't fully understand all the business and political aspects of this to know how viable these forks are if MySQL "proper" is put into mothballs.

There are lots of other ones to talk about - SPARC, cloud computing, and lots of little projects you probably haven't even heard of. But I don't have enough visibility into these to know what the right choice is or could be. So it would really be sticking a finger into the wind.

However, I know we'll be finding out soon enough. I don't envy those folks who get the ax because of the reorganizations Oracle will be doing. May each and every one of you who "get the package" quickly and easefully move on to your new phase in life, whether it's another job or time off or starting your own company. Good luck and God bless!