Archive for December, 2009

Code Snippet Editor

December 30th, 2009

I stumbled across this great Visual Studio code snippet editor and thought I should share the link.  I have already created a few snippets with it, and it my development time is benefiting from it.

The editor allows one to highlight existing code and export it into a snippet file.  This is a great launch pad for snippet development.  The editor runs in Visual Studio, and once a snippet is saved with a shortcut it is immediately available in the IDE.  The editor also allows the editing of existing snippet files.

Happy Winter Solstice!

December 21st, 2009

Today, December 21, is the shortest day of the year which is known as the Winter Solstice.  This date has had significance to humanity for thousands of years.  The earliest human civilizations were tied very closely to agriculture.  The community would grow crops all spring and summer, and harvest and prepare for the winter all fall.  The winter brought hardship, and the Winter Solstice was seen as a time of celebration.  From this day on, every day is longer and is one step closer to the plentiful days of summer.

winter solstice

Ancient peoples based a number of religions around this and other astronomical dates on the calendar.  It should not be surprising that the Romans also based their holidays on these celestial dates, including the Winter Solstice.

In 46 BC Julius Caesar introduced the Julian Calendar.  This calendar was a refinement of the previous Roman Calendar. A year later it was officially adopted by the empire.  The Julian Calendar remained in place for much of the western world until 1582, when it was replaced by the Gregorian Calendar.  The Gregorian Calendar is what we use  today.

Under the Julian Calendar, the Winter Solstice was on December 25th.  This was a major holiday in the Roman Empire, just as it had been throughout much of the world spanning back perhaps three to four thousand years before Caesar.  The Romans celebrated this holiday for centuries before the adoption of the Julian Calendar, and for centuries after.

Somewhere between 200 and 350ish AD, a newly invented religion known as Christianity also placed one of its major holidays on the Winter Solstice.  This holiday, called Christmas, did what many other, previous religions had done and took traditions from religions already in existence.  Many of the things we today associate with Christmas are from so-called Pagan festivals.  Perhaps you have heard the saying “Yule-tide greetings!”  Yule-tide was/is a Pagan holiday that also took place on the Winter Solstice.  There are a number of other Winter Solstice artifacts from other religions and celebrations.  The Christmas Tree, gift-giving, lights, and increased charity all derive from pre-Christian traditions of various cultures celebrating their Winter Solstice festivals.

When the Gregorian Calendar was adopted, Christmas stayed tied to its December 25 time-slot, and the Winter Solstice became December 21 (and sometimes December 22).  This effectively moved Christmas off of the Winter Soltice.  You can move the calendar, but the Winter Solstice is based on the length of the day and so cannot be moved.

With this knowledge of the deep history and importance of the day, I wish everyone a happy Winter Solstice!

The Utter Futility and Stupidity of Current Media Rights Management

December 20th, 2009

My wife and I are both currently reading The Girl with the Dragon Tatoo, a financial-crime mystery of sorts, on our Kindles.  The book is part 1 of a 3 part series written by the late Swedish author Stieg Larsson.  Books 1 and 2, The Girl Who Played with Fire, are available on Kindle and for purchase in bookstores in the US.  Book 3, The Girl Who Kicked the Hornet’s Nest, is not available in the US despite the fact that the series is very popular and the book was published in 2007.  In Europe the book is widely available, and is even on the UK Kindle site.  US citizens cannot buy it from the UK Kindle site.  Why is this book being held back from America in such a contrived fashion?  The publisher is trying to create demand for the book, which will be released to the US market in the spring of 2010.  There is just one problem with this plan.  Its easy to get the book.  US booksellers are importing it from Europe.  And digital versions of the book are easy to find, for free, online.  Theoretically I could have already downloaded it, without paying for it, and it could theoretically be sitting on our Kindles right now waiting to be read.

I ran into this same phenomenon tonight with a new show I wanted to view but had missed on television, White Collar.  USA and Hulu only offer the last few episodes.  I want to start from the beginning.  So this leaves me with three options.  I can start from the middle of the season (yuck).  I can decide to ignore it until it comes out on DVD and rent it through NetFlix (if I remember to do so).   The third option should be obvious: its dead simple to find this show on any of the popular torrent sights.  Its widely distributed and quickly downloadable.  If I were to theoretically download it, I would assume that it would be commercial free.  USA has just lost out on potential commercial revenue.  Just as the publisher of The Girl Who Kicked the Hornet’s Nest lost out of a sale.

Media companies, whether they are book, movie, television or music publishers, suffer a stupidity tax when they don’t make their items easily available in a digital format online.  This is (almost) 2010.  The internet as been a big thing for about 15 years now.  If a company is too stupid to realize someone can simply download their stuff if they don’t allow it on their site, then I think they incur this tax.  You can argue morality here, but from a purely-business perspective this is just a futile attempt to hold onto the pre-1994 world.

This isn’t Dr. Dre and Metallica fighting Napster, with everyone trying to figure out the realities of this new economy.  Today it shouldn’t even be an issue.  For example, right this moment Metallica’s entire catalog is available online in multiple stores.  Hell, they have a lot of free and pay concert music on their site ready to be downloaded.  They learned the lesson the entire media industry should have learned 10 years ago!

So why haven’t people learned?  I honestly think it is plain-old stupidity.  I think there are old people running companies that just simple don’t get it.  Nothing else can explain the complete lack of business sense in relation to digital media and the Internet.  But there are bright spots.  There are a number of shows with a significant portion of their catalog available, for free, on Hulu.  These companies and Hulu are making advertising money for what amounts to re-runs.

Make it easy for people to do the right thing and they will do the right thing.  If not, then most people are going to do as they please.  We aren’t talking about murder here; people are usually downloading things that are either overpriced or not available.  Digital distribution is easy; there are plenty of pioneers and a lot of great software to support it.  The trail has already been blazed, and there are working business models to be followed.  Digital distribution should be cheap.  Releasing content digitally should at very least save the cost of producing a physical product.

So, I might watch some television on my laptop tonight then settle into bed with my Kindle for some reading.

The Last Answer, by Isaac Asimov

December 20th, 2009

Murray Templeton was forty-five years old, in the prime of life, and with all parts of his body in perfect working order except for certain key portions of his coronary arteries, but that was enough.

The pain had come suddenly, had mounted to an unbearable peak, and had then ebbed steadily. He could feel his breath slowing and a kind of gathering peace washing over him.

There is no pleasure like the absence of pain – immediately after pain. Murray felt an almost giddy lightness as though he were lifting in the air and hovering.

He opened his eyes and noted with distant amusement that the others in the room were still agitated. He had been in the laboratory when the pain had struck, quite without warning, and when he had staggered, he had heard surprised outcries from the others before everything vanished into overwhelming agony.

Now, with the pain gone, the others were still hovering, still anxious, still gathered about his fallen body -

- Which, he suddenly realised, he was looking down on.

He was down there, sprawled, face contorted. He was up here, at peace and watching.

He thought: Miracle of miracles! The life-after-life nuts were right.

And although that was a humiliating way for an atheistic physicist to die, he felt only the mildest surprise, and no alteration of the peace in which he was immersed.

He thought: There should be some angel – or something – coming for me.

The Earthly scene was fading. Darkness was invading his consciousness and off in a distance, as a last glimmer of sight, there was a figure of light, vaguely human in form, and radiating warmth.

Murray thought: What a joke on me. I’m going to Heaven.

Even as he thought that, the light faded, but the warmth remained. There was no lessening of the peace even though in all the Universe only he remained – and the Voice.

The Voice said, “I have done this so often and yet I still have the capacity to be pleased at success.”

It was in Murray’s mind to say something, but he was not conscious of possessing a mouth, tongue, or vocal chords. Nevertheless, tried to make a sound. He tried, mouthlessly, to hum words or breathe them or just push them out by a contraction of – something.

And they came out. He heard his own voice, quite recognisable, and his own words, infinitely clear.

Murray said, “Is this Heaven?”

The Voice said, “This is no place as you understand place.”

Murray was embarrassed, but the next question had to be asked. “Pardon me if I sound like a jackass. Are you God?”

Without changing intonation or in any way marring the perfection of the sound, the Voice managed to sound amused. “It is strange that I am always asked that in, of course, an infinite number of ways. There is no answer I can give that you would comprehend. I am – which is all that I can say significantly and you may cover that with any word or concept you please.”

Murray said, “And what am I? A soul? Or am I only personified existence too?” He tried not to sound sarcastic, but it seemed to him that he had failed. He thought then, fleetingly, of adding a ‘Your Grace’ or ‘Holy One’ or something to counteract the sarcasm, and could not bring himself to do so even though for the first time in his existence he speculated on the possibility of being punished for his insolence – or sin? – with Hell, and what that might be like.

The Voice did not sound offended. “You are easy to explain – even to you. You may call yourself a soul if that pleases you, but what you are is a nexus of electromagnetic forces, so arranged that all the interconnections and interrelationships are exactly imitative of those of your brain in your Universe-existence – down to the smallest detail. Therefore you have your capacity for thought, your memories, your personality. It still seems to you that you are you.”

Murray found himself incredulous. “You mean the essence of my brain was permanent?”

“Not at all. There is nothing about you that is permanent except what I choose to make so. I formed the nexus. I constructed it while you had physical existence and adjusted it to the moment when the existence failed.”

The Voice seemed distinctly pleased with itself, and went on after a moment’s pause. “An intricate but entirely precise construction. I could, of course, do it for every human being on your world but I am pleased that I do not. There is pleasure in the selection.”

“You choose very few then?”

“Very few.”

“And what happens to the rest?”

“Oblivion! – Oh, of course, you imagine a Hell.”

Murray would have flushed if he had the capacity to do so. He said, “I do not. It is spoken of. Still, I would scarcely have thought I was virtuous enough to have attracted your attention as one of the Elect.”

“Virtuous? – Ah, I see what you mean. It is troublesome to have to force my thinking small enough to permeate yours. No, I have chosen you for your capacity for thought, as I choose others, in quadrillions, from all the intelligent species of the Universe.”

Murray found himself suddenly curious, the habit of a lifetime. He said, “Do you choose them all yourself or are there others like you?”

For a fleeting moment, Murray thought there was an impatient reaction to that, but when the Voice came, it was unmoved. “Whether or not there are others is irrelevant to you. This Universe is mine, and mine alone. It is my invention, my construction, intended for my purpose alone.”

“And yet with quadrillions of nexi you have formed, you spend time with me? Am I that important?”

The Voice said, “You are not important at all. I am also with others in a way which, to your perception, would seem simultaneous.”

“And yet you are one?”

Again amusement. The Voice said, “You seek to trap me into an inconsistency. If you were an amoeba who could consider individuality only in connection with single cells and if you were to ask a sperm whale, made up of thirty quadrillion cells, whether it was one or many, how could the sperm whale answer in a way that would be comprehensible to the amoeba?”

Murray said dryly, “I’ll think about it. It may become comprehensible.”

“Exactly. That is your function. You will think.”

“To what end? You already know everything, I suppose.”

The Voice said, “Even if I knew everything, I could not know that I know everything.”

Murray said, “That sounds like a bit of Eastern philosophy – something that sounds profound precisely because it has no meaning.”

The Voice said, “You have promise. You answer my paradox with a paradox – except that mine is not a paradox. Consider. I have existed eternally, but what does that mean? It means I cannot remember having come into existence. If I could, I would not have existed eternally. If I cannot remember having come into existence, then there is at least one thing – the nature of my coming into existence – that I do not know.

“Then, too, although what I know is infinite, it is also true that what there is to know is infinite, and how can I be sure that both infinities are equal? The infinity of potential knowledge may be infinitely greater than the infinity of my actual knowledge. Here is a simple example: If I knew every one of the even integers, I would know an infinite number of items, and yet I would still not know a single odd integer.”

Murray said, “But the odd integers can be derived. If you divide every even integer in the entire infinite series by two, you will get another infinite series which will contain within it the infinite series of odd integers.”

The Voice said, “You have the idea. I am pleased. It will be your task to find other such ways, far more difficult ones, from the known to the not-yet-known. You have your memories. You will remember all the data you have ever collected or learned, or that you have or will deduce from that data. If necessary, you will be allowed to learn what additional data you will consider relevant to the problems you set yourself.”

“Could you not do all that for yourself?”

The Voice said, “I can, but it is more interesting this way. I constructed the Universe in order to have more facts to deal with. I inserted the uncertainty principle, entropy, and other randomisation factors to make the whole not instantly obvious. It has worked well for it has amused me throughout its entire existence.

“I then allowed complexities that produced first life and then intelligence, and use it as a source for a research team, not because I need the aid, but because it would introduce a new random factor. I found I could not predict the next interesting piece of knowledge gained, where it would come from, by what means derived.”

Murray said, “Does that ever happen?”

“Certainly. A century doesn’t pass in which some interesting item doesn’t appear somewhere.”

“Something that you could have thought of yourself, but had not done so yet?”

“Yes.”

Murray said, “Do you actually think there’s a chance of my obliging you in this manner?”

“In the next century? Virtually none. In the long run, though, your success is certain, since you will be engaged eternally.”

Murray said, “I will be thinking through eternity? Forever?”

“Yes.”

“To what end?”

“I have told you. To find new knowledge.”

“But beyond that. For what purpose am I to find new knowledge?”

“It was what you did in your Universe-bound life. What was its purpose then?”

Murray said, “To gain new knowledge that only I could gain. To receive the praise of my fellows. To feel the satisfaction of accomplishment knowing that I had only a short time allotted me for the purpose. – Now I would gain only what you could gain yourself if you wished to take a small bit of trouble. You cannot praise me; you can only be amused. And there is no credit or satisfaction in accomplishment when I have all eternity to do it in.”

The Voice said, “And you do not find thought and discovery worthwhile in itself? You do not find it requiring no further purpose?”

“For a finite time, yes. Not for all eternity.”

“I see your point. Nevertheless, you have no choice.”

“You say I am to think. You cannot make me do so.”

The Voice said, “I do not wish to constrain you directly. I will not need to. Since you can do nothing but think, you will think. You do not know how not to think.”

“Then I will give myself a goal. I will invent a purpose.”

The Voice said tolerantly, “That you can certainly do.”

“I have already found a purpose.”

“May I know what it is?”

“You know already. I know we are not speaking in the ordinary fashion. You adjust my nexus is such a way that I believe I hear you and I believe I speak, but you transfer thoughts to me and from me directly. And when my nexus changes with my thoughts you are at once aware of them and do not need my voluntary transmission.”

The Voice said, “You are surprisingly correct. I am pleased. – But it also pleases me to have you tell me your thoughts voluntarily.”

“Then I will tell you. The purpose of my thinking will be to discover a way to disrupt this nexus of me that you have created. I do not want to think for no purpose but to amuse you. I do not want to think forever to amuse you. I do not want to exist forever to amuse you. All my thinking will be directed toward ending the nexus. That would amuse me.”

The Voice said, “I have no objection to that. Even concentrated thought on ending your own existence may, in spite of you, come up with something new and interesting. And, of course, if you succeed in this suicide attempt you will have accomplished nothing, for I would instantly reconstruct you and in such a way as to make your method of suicide impossible. And if you found another and still more subtle fashion of disrupting yourself, I would reconstruct you with that possibility eliminated, and so on. It could be an interesting game, but you will nevertheless exist eternally. It is my will.”

Murray felt a quaver but the words came out with a perfect calm. “Am I in Hell then, after all? You have implied there is none, but if this were Hell you would lie to us as part of the game of Hell.”

The Voice said, “In that case, of what use is it to assure you that you are not in Hell? Nevertheless, I assure you. There is here neither Heaven nor Hell. There is only myself.”

Murray said, “Consider, then, that my thoughts may be useless to you. If I come up with nothing useful, will it not be worth your while to – disassemble me and take no further trouble with me?”

“As a reward? You want Nirvana as the prize of failure and you intend to assure me failure? There is no bargain there. You will not fail. With all eternity before you, you cannot avoid having at least one interesting thought, however you try against it.”

“Then I will create another purpose for myself. I will not try to destroy myself. I will set as my goal the humiliation of you. I will think of something you have not only never thought of but never could think of. I will think of the last answer, beyond which there is no knowledge further.”

The Voice said, “You do not understand the nature of the infinite. There may be things I have not yet troubled to know. There cannot be anything I cannot know.”

Murray said thoughtfully, “You cannot know your beginning. You have said so. Therefore you cannot know your end. Very well, then. That will be my purpose and that will be the last answer. I will not destroy myself. I will destroy you – if you do not destroy me first.”

The Voice said, “Ah! You come to that in rather less than average time. I would have thought it would have taken you longer. There is not one of those I have with me in this existence of perfect and eternal thought that does not have the ambition of destroying me. It cannot be done.”

Murray said, “I have all eternity to think of a way of destroying you.”

The Voice said, equably, “Then try to think of it.” And it was gone.

But Murray had his purpose now and was content.

For what could any Entity, conscious of eternal existence, want – but an end?

For what else had the Voice been searching for countless billions of years? And for what other reason had intelligence been created and certain specimens salvaged and put to work, but to aid in that great search? And Murray intended that it would be he, and he alone, who would succeed.

Carefully, and with the thrill of purpose, Murray began to think.

He had plenty of time.

Book Review: The Greatest Show On Earth

December 11th, 2009

The Greatest Show On EarthI just finished reading a marvelous book titled The Greatest Show On Earth: The Evidence for Evolution by the eminent biologist Richard Dawkins.  The book is about evolution, if you couldn’t tell from the title. So this review is going to be about evolution.

If you are one of those people that disagrees with the theory of evolution via natural selection, I hope you will read this full review and I hope you will read Mr. Dawkins’s book.  Here in the United States, about 40% of the general public believe that that the theory of evolution is false.   I italicize believe, because discounting evolution must be based on belief, not on evidence.  From a scientific perspective, there isn’t a single piece of evidence, not one, that goes against this well established theory.  It is considered one of the most well-proven theories in all of science.  Mr. Dawkins argues, as others have, that such a well-proven theory should actually have a better name that “theory”.  In science the word “theory” has a very different meaning that in general usage.

Here are the two definitions of theory as provided from the Princeton Wordnet:

  1. A tentative insight into the natural world; a concept that is not yet verified but that if true would explain certain facts or phenomena.
  2. A well-substantiated explanation of some aspect of the natural world; an organized system of accepted knowledge that applies in a variety of circumstances to explain a specific set of phenomena.

Can you understand the massive difference between these two definitions?  The first one is the common, everyday, non-scientific one.  It just means a hypothesis, an idea.  The second is the actual scientific one, and it is pretty obvious that it caries with it the implication of proof.  When you read “The Theory of Gravity” or “Einstein’s General Theory of General Relativity”, and yes, “The Theory of Evolution”, the second definition of theory is the one in use.  Because of this confusion a creationist might argue against The Theory of Evolution by saying, “Its just a theory.”  But in scientific parlance, that translates to “Its just a fact.”

Evolution is a fact.  In general, non-scientific speak, that is the crux of it.  Dawkins lays out the evidence, and wow, there is evidence.  We have a rich fossil record that supports the theory of evolution, but even without a single fossil evolution would be proven.  How?  Our very DNA proves evolution.  There is also substantial supporting evidence in the embryology of any animal, including humans.  In the first weeks of gestation a human embryo is not very different from that of a fish.  And it isn’t surprising, because an ancient ancestor of our race is the fish.  Dawkins discusses many other pieces of supporting evidence that are to be found throughout the world, including cases where evolution has actually been observed first hand!

Dawkins also leaves the science of biology and discusses in depth the scientific methodology that proves evolution.  Young earth creationist will be especially horrified to learn of the variety of dating methodologies in use by modern scientists, each corroborated by at least one other.  How do we know a fossil is 10k years old or 100k years old or 1 million years old?  Dawkins discusses the various techniques used to do this dating, in detail.  He leaves no doubt.  And then he repeats this type of discussion, rolling through a number of different scientific procedures.  I really got a flavor of what biologists, geologists, anthropologists, archeologists and other scientists do when they are studying evolution.  Well, I am married to a geologist so I kinda already understood some of that stuff.

Dawkins also spends portions of each chapter debunking various creationist slanders on evolution.  I use the word slander because that is what it often amounts.  However, the creationist isn’t always willfully ignoring the facts and presenting lies.  It would appear from arguments Mr. Dawkins relates that some creationists simply don’t know any better.  Their ignorance of the rich set of data available handicaps them in any debate.  A common example is the creationist attack on the fossil record, the “missing link” argument.  The problem with this creationist argument is that there really isn’t a missing link in the fossil record.  And the fossil record doesn’t matter.  As Dawkins points out, evolution is proved in several different ways that can each stand on their own, alone.  Mr. Dawkins points out these types of logical fallacies over and over.

Dawkins authored the book to try to help fight the fight against ignorance.  Campaigns such as “Teach the Controversy” are often conducted by creationists.  Except there is not controversy.  Evolution is the accepted theory.  As I mentioned earlier, Dawkins points out again and again throughout the book, the areas of science where even one piece of evidence would cast a doubt on evolution, yet we do not find any such negative evidence.  He actually shows where one would go (intellectually) to attempt to disprove evolution.  I think this really shows the true spirit of science.  Of course its easy to do when you do you are right.

I previously reviewed another book on evolution, Why Evolution Is True by Jerry Coyne.  I found Coyne’s book to be an easier read than Dawkins’s book on the same subject.  However, I found that Dawkins covered more material and went into some depth to show how the science is actually done, not just what the science has found.

In the end, I would find it hard to believe that anyone that gave The Greatest Show On Earth an honest read would question evolution.  Not only that, but the proof against a designer fabricating the world is enormous.  This will be a dangerous book for you if you are a creationist.  It will challenge your beliefs with irrefutable evidence.  For the scientifically-minded individual, I think you will discover a number of interesting facts, and find great enjoyment in Mr. Dawkins’s careful explanations of the science around evolutions.

Book Review: On Intelligence

December 3rd, 2009

On IntelligenceI just finished a great book titled On Intelligence, written by the founder of Palm and Handspring, Jeff Hawkins.  Hawkins is a Silicon Valley genius, having invented several significant technologies.  He has also been a life-long brain and AI enthusiast.  Hawkins begins his book about human intelligence relating his experience attempting to get involved with AI and neurology.  I drew some interesting parallels between his exclusion from the MIT AI program and his great success with start-ups.  Imagine being known as the department that didn’t accept the inventor of The Palm Pilot and Graffiti into your grad program!  If he is bitter he doesn’t show it.  Instead he brings a personal enthusiasm and flavor to a very deep subject.  He dives into his impressions on how intelligence works in the human neocortex.  His description of the hierarchical structure that is used in the cortex was very enlightening.   I have found myself thinking about many of his concepts over the last few days.

How we evolved to have intelligence is a fascinating subject.  How is it we humans are able to do the things we do?  Imagine the art, the science, the great goods and the terrible evils we have done to each other.  No other species has war.  No other species has our rich language.  We have created a technological civilization with our biological brains.  Hawkins wants to use the same techniques to create artificial intelligence, and is putting his considerable money where his mouth is with his own AI start-up.

I would encourage anyone interested in this fascinating subject to pick up a copy of On Intelligence.  Its probably the best pure brain/intelligence/AI book I have read (GEB is a better book but spends much less time on AI and intelligence).

Kindle Firmware Update Report

December 2nd, 2009

I updated my Kindle 2 last night with the recently released 2.3.2 firmware update. It came with a couple of nice things. There are a couple of new screen savers. I also like the new viewing modes. One can now choose to read normal, side-way (holding left or right), or you can actually read it upside down.

Now to the bad part, which is the part I was looking forward to the most: PDF support. Kindle PDF support pre-2.3.2 firmware consisted of one emailing yourkindleaddress@free.kindle.com with a PDF, and it would email an AZW file back. The file was then placed on the Kindle. It works well, but is a little tedious. The new firmware supports native PDF rendering, which means you can place a PDF directly on the device and it will display. This is where the support ends. I placed a PDF on the device. It was unreadable. The text was tiny.

Amazon has not implemented two critical features of Adobe’s PDF reader: zoom and text flow. On the Kindle, you cannot zoom in on the PDF nor can you change the text size. Text flow is also not enabled. Pages are shown in their native size, which on the Kindle is small.

I cannot believe Amazon is calling this PDF with a straight face. Come on Amazon! I love you guys. You always treat me right. When you mess up an order you always fix it immediately. Don’t mess with me now. If you don’t have PDF support ready yet, then don’t release it. Software is hard to write and even harder when you are dealing with a device with limited processor like the Kindle. We will all understand if you need to wait.