Monday, July 7, 2008

Buy your tinfoil hats here

This one is weird enough that two separate references were necessary:

Wired: The Microwave Scream Inside Your Head
ABC News: Microwave Ray Gun Controls Crowds With Noise

Go read both before continuing here.

Now, I think we can all agree that this is both bizarre and terrifying, where by "all" I need to exclude the nice folks at ABC news. For some reason Mr. Hambling includes worries that a high power version might either not be feasible or might cause neural damage, but ignores the aspect that should rightfully terrify every law abiding citizen anywhere: a low power version could beam voices/instructions/advertisements directly into our brains, potentially at a level where they could subliminally influence our behavior. Anyone who thinks that corporations and governments won't take advantage of this is probably already a test subject, or just hasn't been paying attention.

Now you'll need to excuse me for a bit as I need to go make a tinfoil hat.

Top 10 SOA Pitfalls

Top 10 SOA Pitfalls: Wrap-up
With SOA (Service Oriented Architecture) being the current IT systems acronym du jour, it's nice to see that some sane minds are mapping out the pitfalls. After all, many of these implementations stretch into the millions of dollars and deploy over several years. The last project I was part of as a government contractor was an excellent case in point. Most of these top ten pitfalls were present on the project which cost the taxpayers millions and quite frankly didn't do what the customer needed. Ironically we saw many of these pitfalls in advance and ended up having our hands tied by both our upper management and the customer's existing procedures. Maybe there needs to be a number zero, "Lack of Communication," that covers educating the stakeholders on the design and implementation model required for a successful SOA rollout. Hopefully this list can be used as a resource toward that end.

Thursday, July 3, 2008

Kevin Carmony's Blog: Michael Robertson, Where's the Cash?

Kevin Carmony's Blog: Michael Robertson, Where's the Cash?

As a San Diego resident and Linux user, Linspire has always had a fond place in my heart, if not my hard drive. Beyond that I have had cursory professional contact with both Michael Robertson and Kevin Carmony over the years, interviewing the former for a business class and having met the latter at local SDSIC (San Diego Software Industry Council) presentations. That said, you can understand why this news, and Kevin's expose of Michael's less than ethical behavior hit me like a ton of bricks. For most people this will probably be just another bit of corporate opera, and will pale in the face of the Enrons and Countrywides that have been in the news of late, but for those of us in the San Diego OSS community this debacle should, and for me does, garner a sense of personal sadness. I wish luck to the remaining shareholders and employees. Your contributions to mainstream Linux on the desktop will not be forgotten. With any luck the folks over at Cannonical can carry the torch you folks lit so many years ago.

Tuesday, June 10, 2008

Hibernating in the Spring

So I've been working on a project which uses the Spring bindings (2.0) for Hibernate (3.2) to handle persisting business objects to the database, and up until yesterday everything seemed to be working fine. Persisting and retrieving specific objects worked well and the web front end, based on Grails, had no trouble seeing and sorting the data as needed. Then yesterday I needed to do something a little different. I needed to pull all instances of a certain class from the DB and pass their IDs via JMS to an Message Driven Bean hosted on a remote JBoss server which in turn pulled the actual objects, extracted data from them and related tables, and built a warehouse using the correlated data. With all the extra pieces going in I expected something would go wrong right out of the gate as I've come to trust in Mr. Murphy's wisdom, and I wasn't disappointed. After a run completed I found I was missing about 2/3 of the expected data!

Well, I started the run again with added logging and found the following:
  1. The sending component was pulling fewer entries from the DB than there were rows.
  2. All of the pulled data was being sent.
  3. All of the sent data was ending up in the JBoss JMS queue that the MDB subscribed to.
  4. All of the data in the queue was being pulled by the MDB.
  5. About half of the data pulled didn't have a corresponding entry in the DB, and therefore didn't result in a valid warehouse entry being created.

Well, the "infection" point for the bug was clearly the client, but that didn't make any sense. The code that loaded the objects from the DB basically boiled down to:

HibernateTemplate ht = (HibernateTemplate)appContext.getBean("hibernateTemplate");
List = ht.loadAll(Foo.class);

Here ht is an instance of org.springframework.orm.hibernate3.HibernateTemplate, and loadAll(Foo.class) should have returned a list of all the instances of Foo in the DB. For some reason however it returned 2/3 as many instances as there were rows, and about half of those had IDs that didn't match the value in the DB.

Going deeper into the rathole I tried making a simple set of JDBC calls against the underlying org.springframework.jdbc.datasource.DriverManagerDataSource and got a java.sql.ResultSet back that made even less sense.

In the end I went back to basics and pulled the IDs directly out of the DB using straight JDBC, and now I have a full warehouse as the JMS and EJB3-managed entities on the server worked fine. Nonetheless, I'm incredibly confused by what happened with the Spring/Hibernate setup, and a little worried about what other issues may have gotten by the unit tests, as this only cropped up when I tried working with data sets in excess of 16,000 entries. If anyone out there has any ideas, please let me know.

Friday, May 30, 2008

Indiana Jones and the Kingdom of Jar-Jar Binks

When I heard that George Lucas was making a new Indiana Jones film after nearly twenty years I was sufficiently jaded by the wreck he made out of the original Star Wars trilogy and the crime against film that were the prequels that I couldn't help but groan. Then I saw that Spielberg was going to direct, and I thought to myself that maybe, just maybe Lucas wouldn't sour another part of my childhood. I was so very wrong. Consider this your spoiler alert for the rest of this post/rant.

"Kingdom of the Crystal Skull" follows Lucas' recent re-imaginings in its theme that good guys should be honorable at all times, dialog isn't as important as special effects and childish plot devices, and anything mystical needs to be explained with pseudo-science that both takes the grandeur out of the story and is internally inconsistent.

The movie largely consists of vehicular chase scenes and Harrison Ford and company getting in fistfights. In fact, Lucas takes great pains to avoid the problem solving and deduction of the previous films, punctuating chase scenes and fights with "story hour with Indy" moments and having most problems solved by a raving madman who mumbles. So, not a lot of points for actual plot.

On top of the cinematographic lobotomy, Indiana Jones is hardly recognizable. I'm not talking about Harrison Ford's age, though most of his lines in the film allude to it. I'm talking about his personality, or lack thereof. Classic Indy fans will be disappointed that the wry wit is gone, replaced with alternately dry dialog and outbursts of curmudgeonly wrath. It's Indy as an old man having had everything unique beaten out of him by the intervening years, and it's not interesting. Additionally, he carries the trademark 1917 revolver and bull whip, but almost never uses either. He never fires the pistol, though he draws it a number of times, and if you've seen the previews you've seen all his whip work. He is essentially a non-lethal action hero, and while I can understand Lucas making this choice deliberately as a moral statement, it is a change from Indy's existing personality that isn't really explained, and will probably revive the "Han shot first" arguments from fans. While a move to a non-lethal stance could have been an opportunity to delve into character development it was instead glossed over, leaving fans wondering what happened to the "real" Indy.

Then we have the gratuitous special effects. I'm watching an Indiana Jones film and suddenly there's an army of CGI monkeys flying to the rescue while Indy's kid plays Tarzan? And what on earth was the point of the CGI groundhog? Did an ILM intern win a bet? I'm not even going to start with the flying refrigerator scene.

Finally, the midichlorians make a comeback here in the form of a race of inter-dimensional aliens who have been on earth for 5000 years collecting random trinkets. Let's ignore for a moment the following problems with the way this was presented in the films:

1. When the skeletons are all intact the alien can form a single living body and is insanely powerful, yet in the 1500s a small group of Spaniards took one of the skulls without getting blasted into another dimension.
2. Everybody in the film seems to know everything about the aliens immediately upon exposure.
3. If they're "archaeologists" then why do they just pile up thousands of years of historical treasures in a random room, then destroy them all as they leave?
4. Where do the natives guarding the temple eat/live? Do they just hang out in those tiny alcoves all day? They're clearly mortal, as Russian bullets take them out with trivial ease.
5. Why does the temple entrance look like it's straight out of one of the recent "Prince of Persia" titles?

So, assuming for a moment any of that made sense, we still run into one of Lucas' more obnoxious recent themes. The "force" is now just a symptom of a biological infection. The mysterious lost cultures in South America worshiped aliens. If that's where it stopped I might groan and deal, but by making the alien's presence on earth explicitly older than everything else Indy has ever dealt with, one has to wonder if the broader implication is that all of the mystical artifacts we've seen to date were in fact just tech indistinguishable from magic (with apologies to the late Arthur C. Clarke).

In conclusion, George Lucas has taken yet another of his classic franchises, stripped it of all that made it unique and engaging, and left audiences with a shell of a film that cheapens the brand. And in doing so made millions more dollars to pad his fortune. Sigh.

Sunday, May 25, 2008

Feelin' Groovy

If you're a Java programmer and you don't currently count Groovy as part of your toolbox, please go here and download it. Don't worry, I'll still be here when you get back.


This little scripting language for the VM may not be revolutionary insofar as there are others in this same niche (e.g., Jython, Beanshell, JRuby, etc.), but it has one major advantage that has kept it close to my heart: the learning curve is non-existent. I'm not saying that you'll master it from the moment you start using the console or shell, but as a Java programmer you'll be productive from the first line of code. Let me give you an example. Let's say you have this existing class:



public class Foo {
 private String name;
 public void sayHello() {
  System.out.println("Hello "+name);
 }
 public void setName(String name) {
  this.name = name;
 }
}

From Java, calling this might look like:



Foo bar = new Foo();
bar.setName("John Smith");
bar.sayHello();

Now here's code that will run in Groovy



Foo bar = new Foo();
bar.setName("John Smith");
bar.sayHello();

I'll give you a second to compare the two. Now, this isn't the best way to write this code in Groovy, with this being a good alternative if you don't really care about typing "bar":



def bar = new Foo(name:"John Smith")
bar.sayHello()

...but the point is that from a productivity standpoint you can add a scripting language that's native to the JVM to your list of tools and start using it as soon as it's installed. Over time you will discover the more powerful features like closures and sensible collection initialization, but on day one you will be producing working code without the cognitive dissonance normally attendant on a new language, which is also a good argument to your boss as to why you should get to play with this shiny new toy.

First Post

So, I finally tired of being a leech on the net and decided to contribute something of my own. Only time will tell if I keep this up, or if my contribution is to the signal or the noise. The plan is to use this site to occasionally post solutions to some of the more vexing programming problems I run into during my day job, thereby hopefully keeping others from making the same mistakes I made. Also expect periodic forays into politics, religion, and any other subject that polite company in the real world avoids but that begs cathartic expression.