Jon Webb's Blog

Friday, December 10, 2010

Harry Potter and Transport

Has anyone noticed how very many ways there are of getting from one place to another in the "Harry Potter" series? J. K. Rowling was obsessed with transport. Here is a partial list:

  1. Broomsticks.
  2. Hagrid's motorcycle.
  3. Flue powder.
  4. Apparition.
  5. Portkey.
  6. Knight bus.
  7. Thestral.
  8. Griffin.
  9. The death eaters travel through the air leaving smoke behind them.
  10. The Weasley's flying car.
  11. The toilets used to enter the Ministry of Magic.
  12. Sideways-moving elevator in the Ministry of Magic.
One or two ways of magic travel would have been enough. What is the reason for so many?

Monday, December 06, 2010

Tax cuts & Obama

I am as loyal a supporter of Barack Obama that you will find and I have been terribly disappointed by his decision to negotiate with the Republicans on extending the Bush tax cuts. For me, this was the issue the 2008 elections were about, just as the 1998 election was won by George W. Bush on the basis of his "no new taxes" pledge.

Two things have made this situation more interesting, though. One is the article by Ezra Klein in the Washington Post (http://voices.washingtonpost.com/ezra-klein/2010/12/can_the_white_house_win_in_201.html) arguing that by giving in on the tax cuts, Obama is getting more stimulus in the economy that he could have hoped to -- not just the tax cuts, but other benefits he will get in the negotiation, such as extended unemployment benefits, other tax cuts directed at the middle class, and so on. This is probably White House spin selling the idea to the left, but it does have a certain appeal.
But the thing that is truly fascinating about this moment is how fluid it is at this moment (6 December 2010). There are several different groups, any of which could derail the whole thing, but each of which has good reasons not to do so:
  1. Left-wing Democrats, who would like to see the tax cuts renewed only for people making less than $250K/year, and use the money from the newly increased taxes on people making more than that to extend unemployment benefits, and provide some stimulus in other ways.
  2. Right-wing Republicans, who are unalterably opposed to increasing debt (except when it involves a tax cut), who would like to renew all the tax cuts and do nothing else.
  3. President Obama, whose major promise from the 2008 election was not to renew the tax cuts for people making more than $250k/year, and who is smart enough politically to realize that this is a defining issue for his base.
  4. Republican leaders negotiating with Obama, who would like to roll this President on another issue, but who must also be aware that they can very easily end up looking like the President rolled them.
It is actually impossible to predict what is going to happen, on this major issue, which affects all of us.

Sunday, December 05, 2010

Wikileaks and the "poisoned channel"

There is a technique in counter-intelligence called the "poisoned channel." It works like this. Your enemy has a communications channel -- they communicate with the public, or another party. You can counter this in various ways. One is to set up your own channel, pretending to be your enemy. People have no way to tell if your channel or that of your enemy is real. You can interfere with their messages, cause them to lose credibility, and so on. Another way is to take control or partial control of your enemy's channel. You can inject messages into it. Your messages can serve your own purposes, and your enemy and others will believe them.
In the case of Wikileaks, Pfc. Manning, when he downloaded hundreds of thousands of documents from the intelligence web site, may well have been detected. When an intelligence service detects and intrusion like this, they may well decide to hang back and find out what's going on. He then sent the information to Wikileaks, which is apparently a loose coalition of people around the world, which gathered, edited, and posted his stolen information.
There are multiple ways that this information could have been posioned. Pfc. Manning may have been compromised. His transport of information to Wikileaks could have been interfered with. Wikileaks itself may include U.S. intelligence operatives. The Wikileaks servers may have been hacked and information inserted.
Note that the result of the Wikileaks affair has not been entirely to the discredit of the United States. First of all, there appears to be unanimity of Iran's neighbors that Iran is a threat and many of them think we should invade. This serves the purposes of U.S. foreign policy. Iran apparently believes it is thought of as a thread (they recently issued a statement assuring their neighbors that they are not) and this may affect their behavior. Even if one of the nations implicated as speaking against Iran know they were misquoted, they do themselves no good denying it -- and they believe the others think Iran should be invaded. It is a strangely fortunate outcome, don't you think?
A poisoned channel requires smart people, and one thing the Obama administration is is smart. Hillary Clinton is a smart woman. The State Department and U.S. intelligence services employ many smart people, who are normally quite good at keeping secrets. The "poisoned channel" is a well enough known technique that even I know about it.
Think about it.

Friday, August 31, 2007

Zombie Physiology

An interesting question regarding zombie physiology is: how do zombies move? They do not breathe (or at least their lungs do not supply oxygen to their muscles, since they have no circulatory system). While they consume flesh, they do not digest. Where does their energy come from?
Putting aside for the purposes of this article the fact that zombies do not actually exist, we can find the source of zombie energy in the basic chemical reaction that powers the muscles of the living, which is the Krebs citric acid cycle, and its alternate which takes place when insufficient oxygen is present, glycolysis. Zombies must be using glycolysis to power their muscles.
Glycolysis is an inefficient mechanism for transforming glucose into energy. It is, in fact about 14 times less efficient than the Krebs cycle used in cellular respiration (in other words, a 6-carbon glucose molecule is oxydised to produce 2 molecules of ATP. The Krebs cycle produces about 28 molecules of ATP per oxydised glucose molecule). And it produces as a by product lactic acid. What effects does this have on zombies?
First, the loss of energy due to depending purely on glycolysis is dramatic. Given that zombies do not consume, or at least do not digest, food, they must depend purely on stored body reserves of fat for the duration of their existence. A rough estimate of the reserves is given by the "rule of three": a person can survive 3 minutes without air, 3 days without water, 3 weeks without food. By this rule, zombies should "survive" only a day and a half since they burn up their reserves 14 times less efficiently? How, then, do they "survive" for years?
The answer lies in the fact that zombies are not warm-blooded and do not have to expend energy maintaining most organs. All they have to do is control their muscles and move. The other organs in their body are useless. So a day and a half supply of energy goes much further. In fact, the organs they are not using can be broken down and used to supply their muscles with energy as well.
It should also be pointed out that the anaerobic (and acidic, because of the lactic acid) environment inside a zombie's environment partly explains why zombies do not suffer decay due to the action of bacteria, for example those found in the gut. The inside of a zombie's body would likely be sterile following zombification.
It should also be noted that the production of acid by the zombie's muscles must eventually lead to decay of body parts and may account in part for the traditional horrifying appearance of zombies (aside from the fact that they exist only to eat the flesh of the living, of course).
A zombie that is not moving need consume very little energy, only that needed to keep itself aware of the environment. In such a situation a zombie could last for years, using only its initial store of body fat, especially if it started out obese.
The information this article is based on comes from the useful Zombie Survival Guide by Max Brooks.

Friday, February 02, 2007

Microsoft, Google, and Control of Intellectual Property

I've noticed that I now go through this sequence when I'm trying to figure out the cause of an error reported in the EventViewer:

  1. Click on the hyperlink to the event.asp page on the Microsoft web site. This takes me to a page which says:
    We're sorry
    There is no additional information about this issue in the Error and Event Log Messages or Knowledge Base databases at this time. You can use the links in the Support area to determine whether any additional information might be available elsewhere.
  2. Go to msdn.microsoft.com and search on the event id and message content. This is tricky. Sometimes I get no results at all (too many search terms, especially when I include the complete message text). Other times I get taken to a page which doesn't tell me anything informative -- it will usually be something like a guide to the setup of whatever product I'm having the problem with, with no detail whatsoever about the particular problem I'm encountering.
  3. Type the exact content (enclosed in quotes) and the event id into the Google search bar. Click search. This always takes me to a page that tells me something useful about the error. Always! What's even more amazing is that many of these pages are on the Microsoft web site. Sometimes I can solve the problem by reading these pages and sometimes not -- but at least I start getting someplace.
The bottom line is, it appears that Google has better access to Microsoft's intellectual property, as reflected in its documentation, than Microsoft itself does. This is a truly incredible fact. And it does not bode well for Microsoft. This is a more fundamental problem, I think, than, say, IBM's giving Microsoft control of the operating system on its personal computer product. It says something is wrong about Microsoft's corporate culture: they've lost control of their intellectual property.

Labels: , ,

Customize Class Item in Visual Studio 2005

I wanted to customize the Visual Basic Class template in Visual Studio 2005 so it automatically added headers etc. I ran into problems, but eventually found a way around them, and haven't found any other answers on the web.
The first thing I tried was to create a new item template following the instructions in the Visual Studio template help at http://msdn2.microsoft.com/en-us/library/ms247069(VS.80).aspx.
I created a file called Class.vb, with these contents:

' $safeitemname$
'
' Written by Jon A. Webb 2007
' Copyright (c) 2007 by Jon A. Webb
' All right reserved.
'
' $History: $
'
'
Public $safeitemname$ $safeitemname$
#Region "$safeitemname$ variables"
#End Region
#Region "$safeitemname$ lifecycle"
#End Region
#Region "$safeitemname$ operations"
#End Region
#Region "$safeitemname$ properties"
#End Region
End $safeitemname$
Then I selected File->Export template and followed the instructions there to add the template, naming it 'Class'.
This worked, in part. When I added a class called 'Class1' to the project I got this:
' Class18
'
' Written by Jon A. Webb 2007
' Copyright (c) 2007 by Jon A. Webb
' All right reserved.
'
' $History: $
'
'
Public Class18 Class18
#Region "Class18 variables"
#End Region
#Region "Class18 lifecycle"
#End Region
#Region "Class18 operations"
#End Region
#Region "Class18 properties"
#End Region
End Class18
Oops -- at one point, doing a global search and replace, I'd changed 'class' everywhere to '$safeitemname'. That resulted in the class keyword getting replaced. What I'd actually meant to use as the template was
' $safeitemname$
'
' Written by Jon A. Webb 2007
' Copyright (c) 2007 by Jon A. Webb
' All right reserved.
'
' $History: $
'
'
Public Class $safeitemname$
#Region "$safeitemname$ variables"
#End Region
#Region "$safeitemname$ lifecycle"
#End Region
#Region "$safeitemname$ operations"
#End Region
#Region "$safeitemname$ properties"
#End Region
End Class
OK, now, how do I fix this? I tried re-exporting the template but nothing changed. Add new class still used the old template. Then I tried following the instructions at http://geekswithblogs.net/ehammersley/archive/2005/11/08/59451.aspx. I ended up doing
devenv /installvstemplates
Still nothing -- the old template was still there. I poked around and found the cache Visual Studio was using for the template at C:\Documents and Settings\webb\Application Data\Microsoft\VisualStudio\8.0\ItemTemplatesCache. Clearing the directory and rerunning the devenv command above had no effect. There must be a second level cache somewhere.
OK, so, poking around, I found another cache at C:\Documents and Settings\webb\My Documents\Visual Studio 2005\Templates\ItemTemplates with another copy of the old Class.zip there. Deleting it, too, gave the original behavior when I added a class -- an empty class without my customizations. But then re-exporting the template gave me back the template with "Class" globally substituted by $safeitemname$. Very weird. Where was the template coming from? Nowhere -- I searched the disk. Then I realized what was going on... Visual Studio 2005 was itself substituting Class with $safeitemname$. In other words, if I submitted this as a template:
' Class
'
' Written by Jon A. Webb 2007
' Copyright (c) 2007 by Jon A. Webb
' All right reserved.
'
' $History: $
'
'
Public Class Class
#Region "Class variables"
#End Region
#Region "Class lifecycle"
#End Region
#Region "Class operations"
#End Region
#Region "Class properties"
#End Region
End Class
I'd end up with the template above with $safeitemname$ everywhere. I tried this, and it happened. But that leads to a solution -- use capitalization to get around this. So the final template was
' Class
'
' Written by Jon A. Webb 2007
' Copyright (c) 2007 by Jon A. Webb
' All right reserved.
'
' $History: $
'
'
Public class Class
#Region "Class variables"
#End Region
#Region "Class lifecycle"
#End Region
#Region "Class operations"
#End Region
#Region "Class properties"
#End Region
End class
(Note: I had to edit and save this file with a text editor, not Visual Studio, to keep the final 'class' from getting automatically capitalized.) Exporting this as a template worked!

Labels: , ,

Friday, January 05, 2007

Whitney Houston and the Axis of Evil


Has anyone else noticed the strange association between Whitney Houston and the Axis of Evil? Consider:

  • As Harper's recorded, Saddam Hussein's campaign song, during his last presidential campaign, where he won 100% of the vote: "I Will Always Love You."
  • As reported in The Daily Mail, Kola Boof, in her book "Diary of a Lost Girl", claimed that Osama bin Laden was obsessed with Whitney Houston and wanted to kill Bobby Brown.
  • Fox News reported that when the Bush Administration banned the sales of Segways and iPods to North Korea one of Kim Jong Il's favorite movies was "The Bodyguard."
Coincidence? Something more? Perhaps, now that Whitney has finally gotten rid of Bobby Brown, she might be available as a sort of super-ambassador to the Axis of Evil. Could this be the reason for the long delay in Bush's new Iraq strategy?
Just asking.

Labels: ,

Sunday, March 27, 2005

Plants and Sight

All seeing things on the planet -- everything from mosquitoes to people (with the remarkable exception of some dragonfish) -- sense light by virtue of closely-related chemicals called rhodopsins. Three slightly different versions of rhodopsin give us the ability to perceive light as red, blue, and green components.
Rhodopsin originated in a bacterium. Salt-loving escendants of the bacterium still exist in the Red Sea. The bacterium's version of rhodopsin preferentially absorbed green light, like our eyes. That is why color digital cameras use the following mask to break light down into its red, green, and blue components:

R-G-R-G-R-G...
G-B-G-B-G-B...
R-G-R-G-R-G...
G-B-G-B-G-B...
That is, every other pixel is masked by a filter that lets through green light, and red and blue components are each half as frequent as green. The higher spatial sensitivity to green makes the color image appear to have higher resolution than it would if red, green, and blue were equally frequent, since our eyes have more retinal cells sensitive to green light than red or blue.
The bacteria's preference for green light and our eyes greater sensitivity to it have the same origin. The rhodopsin in bacteria was more efficient if it captured green light because that was what was left over in the pools of water it was swimming about it. At that time, the competitor for that light was algae floating on the surface of the pond. The chlorophyll in algae leave behind the green light -- hence their color. The bacteria therefore absorb green light, and look red as a result.
Our eyes, too, had to deal with green light in the forest environment that we evolved in. The forests and grasslands where we hunted gave good protection to our prey--but by having eyes that had high spatial sensitivity in this region of the spectrum, we could improve our chances of survival. So chlorophyll once again guided our evolution.
Algae evolved beyond the form of chlorophyll that absorbs just green light. More adept forms of algae absorb a wide spectrum of light, so that algae now comes in all colors. But the descendants of algae, which are the multicellular plants, were stuck with the early form of chlorophyll. So they are still green, and we, the descendants of the bacteria, see them with green-sensitive eyes.