Archive for January, 2010

Unit Testing and Code Change

January 29th, 2010

This morning I made a small but important change to a chunk of code that our entire Silverlight application uses.  This code, lets call it the Manager, facilitates every work flow through the application.  The code change to the Manager amounts to deleting some unused code, changing some types, and some small tweaks to how new screens are called.  On the surface the actual lines of code changed appeared to be very simple, but I was nervous I would break something since this is a fundamental piece of code.  Everything uses the Manager.

Code can have subtle and dangerous dependencies.  Even when one is the author (as I am in this case), one cannot be completely sure of the consequences of a code change in a sufficiently complex system.  This is where unit tests come to the rescue.

I was able to execute my suite of unit tests, and after a successful report I ran through a few regressions with live data.  Everything works.  And I commited the code to our repository with a high level of confidence.

If something had broken I would have fixed it, and then written a unit test to check for the condition in the future.

Unit tests are a pain to write, but they sure do have a big payoff.

Thought on iPad

January 28th, 2010

The much anticipated Apple iPad (or Mac’s iPad as it is being called int teh interwebs) debuted yesterday.  And it was a flop.  Apple could have built a great e-reader.  They could have built an incredible tablet.  Instead, they just released a really big iPhone and patted themselves on their collective backs.  Here are a few things that the iPad is sorely lacking if you want to use it for reading:

  1. No electronic ink.  Until you have spent some time with e-ink, you will never understand how much nicer it is than an LCD screen.  Here is a quick example.  Read a page of text off your computer monitor.  Then read a page of text out of a big, hardcover book.  How much nicer is reading that text out of the book?  There isn’t the eye strain associated with a computer monitor, the letters are crisp and clear, and you can see the book in sunlight.  This is the difference now between the iPad and the Kindle.  I doubt we will see many iPads on the beach.
  2. No known ability to load books from outside the iTunes store.  Will this allow you to download free books from Google?  Or can you load books from USB?  I have plenty of books I have obtained outside the Kindle store sitting on my Kindle.  There is no hint that this will be available on the iPad, or if it is if it will be anything close to easy.

Now, if they decided instead to make a great tablet PC, here are a few things they are missing:

  1. No web cam.  Seriously, you built an ultra-portable and don’t think people are going to use the webcam on it?
  2. No Flash or Silverlight support in the web browser or elsewhere.  This has the same crippled browsing as the iPhone.
  3. Not a “real” OS.  OK, I realize this is a stripped-down version of OS X.  But I cannot load my own programs or other programs from the internet on this.  It cannot MULTITASK.  This computer is severely limited compared to my cheap-as-dirt Asus Netbook.  Which has all those things I just mentioned, and does them pretty well.

This picture pretty much sums it up for me:

Firefox 3.6 Released

January 21st, 2010

I just installed Firefox 3.6., which was released today.  There are some new features which include:

  • Personas – A new type of theming,
  • Stability improvements,
  • Performance improvements,
  • Open video and audio based on HTML 5.

I can only comment on two of these.  I could not get any selected persona to work.  I believe my current theme is conflicting with this new feature.  I don’t really care as this isn’t something that really improves the Firefox experience, IMO.  However, I have seen a significant memory gain.  Before I upgraded I had three tabs open, running at 277 MB.  After reinstall with the same three tabs I had 77 MB, which shot up to and stayed at around 150 MB after some page changes, etc.  I would say that that is a significant improvement.  Better memory usage by Firefox means my whole system runs faster because I have more RAM free.  I almost always have Firefox open since my primary job responsibility is developing applications that run in a web browser (Silverlight, ASP.Net).  At home Firefox is my browser of choice.  It is more features and has a bigger plugin ecosystem than Chrome, and is much more secure and must faster than IE.

I recommend downloading Firefox 3.6 today.

Belief

January 20th, 2010

One of the most significant things that make humans human is the ability to hold beliefs.  A lot of thinkers including Decartes, Dennet, Sagan, and others have proselytized that ideas should hold no sacredness.  I think this is probably the core of true thinking.  Why should any notion or concept be give special protection against scrutiny?  It seems that such a concept would promote the abandonment of reason and the promotion of dogma.

So here enters religion.  Any follower of any religion about which I know must confess, if they are honest, that they base their beliefs on faith.  I use the most derogatory definition of faith here.  Faith equals belief without proof in this definition. In the real world faith accounts for nothing.  The earth is not heated by the sun through faith.  Photons and other energetic particles leave our star and heat our world.  Faith does not power the very core of our existence.  There are rational, reasoned arguments to be made for of the natural processes on Earth.  And for those left unexplained, a “god of the gaps” is a poor excuse of the simple statement “we don’t know yet”.  The scientific method, it seems, really does work.

Science had proven to be an amazingly useful tool to further our understanding of the natural world.  Religion has not.  At all.  Let me be clear.  Religion, and in particular the Christian religion with which I am familiar, has done a horrible job explaining our universe.  So I find it disgusting and perverse when people of religion attempt to subvert reality in favor of their fantasies (religion), and on top of that perversion, declare their perverse beliefs sacred!

On top of these points, Christianity and other religions have done  a horrible job providing a moral framework for humans.  As it turns out, humans don’t really derive morality from religion anyway.  Study after study have shown that the true moral lessons are derived outside of religion.  However, this should not be construed that Christians are bad people; just that it does not take faith to make a good person.

An idea is an idea is an idea.  Every idea is available to the scrutiny of reasoning and intellect.  Whether the idea be string theory or the god hypothesis, the idea should be easily propped up or torn down based based on the the evidence available and sound reasoning.

Is this too much to ask?

Book Reviews: The Millennium Trilogy

January 9th, 2010

Swedish journalist Stieg Larrson wrote novels, for fun, in his spare time.  Larrson died in November of 2004, leaving three unpublished books.   These were the only novels known to have been written by the man, and they have received many awards and accolades in Europe after their posthumous publishing.  Since their translation to English they have enjoyed great success in the English speaking world as well.  Only the first two books have been released in The United States, though it is not very difficult to obtain a copy of the third online.

The Millennium Trilogy follows the exploits of twenty-something, anti-social hacker Lisbeth Salander and middle-aged, controversial reporter Mikael Blomkvist.  The duo find themselves united in the first book to solve a 30 year old murder mystery, but the plot thickens from there.   The second and third books each tell a story of their own while also telling an overarching story, and bring to conclusion a lot of themes and unresolved issues from the first book.

The Girl with the Dragon Tattoo is the first in the trilogy.  I found this book to be the best of the bunch, which shouldn’t take anything away from the other books.  Dragon introduces us to a rich set of characters and to locations that are unfamiliar.  The settings in the book are almost exclusively in Sweden, and Larrson goes into some detail about the cities, towns, transportation, restaurants, and general ambiance there.  The characters are well developed and interesting.  The two lead characters both have similar attitudes, and express these attitudes in very different ways.  All of this is stacked on top of a rather interesting murder mystery.

The Girl Who Played with Fire continues on with the characters about a year after the end of Dragon.  Fire continues with many of the themes established in the first book, and jumps into some of the more interesting teasers left hanging.  We soon find the roles our lead characters took in the first book reversed.  This book quickly turns into another murder mystery, but that is not what is really going on.  Blomkvist and Salander separately race to solve related portions of the same mystery, although this time it isn’t so much a mystery for Salander, but history.  The book has a couple of interesting plot twists at the end, and while it resolves the central mystery of the book it does leave at least one character in serious jeopardy.

The Girl Who Kicked the Hornets’ Nest concludes the trilogy, and finishes the overarching story started in Fire.  Again Blomkvist and Salander are fighting against unknown adversaries, this time with a more united front.  At the end of the book Larrson leaves the characters ready for more battles together, and one can only imagine what would have come from his mind had he lived.  However, this trilogy does tell a complete overall story and closes all the loose threads.  In the final analysis its a story about friendship and loyalty between many different characters, but mostly between Salander and Blomkvist.

I recommend the trilogy to anyone that enjoys good fiction.  As an avid science and science fiction reader, I am not entirely sure what lured me into reading these books.  But I found them all very good reads.

The Hawk: Andre Dawson

January 6th, 2010

In 1987 Andre Dawson was trying to find a new home after several years playing for the Expos.  He was focused squarely on the Chicago Cubs.  The Cubs, however, thought they had an outfielder and did not care to sign Dawson.  Dawson gave them a blank contract.  The general manager of the Cubs gave him a $500k contract (which was actually pretty good money in those days).  He also wrote a bonus stipulation into the contract.  Dawson would earn another $250k if he made the All-Star Team, Started for the All-Star Team, and if he got the MVP.  He did all three.

Think of the players today that could do that for a bonus today.   There aren’t many, and they are all headed for the Hall of Fame, as is Andre Dawson.

The Hawk was a true 5-tool player.  Just look at the numbers he put up:

Average: .279
Hits: 2774
Home Runs: 438
RBIs: 1591
Stolen Bases: 314
Gold Gloves: 8
All-Star Games: 8
Rookie of the Year (1997), Most Valuable Player (1987)

Just in case you were wondering, that is what Hall of Fame stats look like.

And Now I Present Trains Plowing Snow!

January 3rd, 2010

The Atheist Apocalypse!

January 2nd, 2010

I found this awesome comic today about The Atheist Apocalypse.  Its quite funny, and features the Four Horsemen: the eminent biologist Richard Dawkins, philosopher Daniel Dennett, science writer Sam Harris, and journalist Christopher Hitchens.