February 03, 2007

History is Demographics

Why is Palestine on fire while Lebanon dances in the street? Both have diverse Muslim popluations that are in direct conflict with Israeli power. Both have popular violent Shia "resistance" movements that are agitating for dominance. If anything, the violence of Hizbollah and the factional divisions in Lebanon exceed anything seen in the Palestinian territory.

But somehow, when a fuse is lit under Lebanon it remains peaceful, while Palestine blows up. Here is a simple graph that explains the physics of conflict.

Continue reading "History is Demographics"
Posted by David at 07:33 AM | Comments (9)

February 04, 2007

Superbowl Sunday

I am not a football person, so on Superbowl Sunday I feel like a Jew on Christmas. For me, this is a Sunday just like any other, but everybody around me has been clearing out their calendars. I don't even know who is playing or when the game starts....

Continue reading "Superbowl Sunday"
Posted by David at 08:43 AM | Comments (3)

February 09, 2007

Presidential Qualifications

What qualifications should we demand of the leader of the free world?

Heidi says everybody should write an autobiography before they run for president. TV news shows provoke a laugh from her each time they report "Breaking News: We learned something new about Obama today.... Did you know that he consulted his wife before he ran for the Senate?!" It seems the reporters are taking a long time to get through those lengthy books.

Continue reading "Presidential Qualifications"
Posted by David at 05:43 PM | Comments (0)

February 14, 2007

Everybody Votes

All day our Wii has been pulsing blue, so I just turned it on to see what it had to say. Looks like there is a new free channel called "Everybody Votes".

OK, so everybody in our house has voted on the four questions-of-the day. Where would you rather live, in the mountains or on the beach? In our house, survey says, if you're a grandparent, you'd rather live in the mountains. All us young'uns want to be on the beach.

Somebody at Nintendo has been thinking about what it means to be a casual gamer. Ten minutes of good weekday family fun, and now the Wii is back off.

Posted by David at 08:45 PM | Comments (4)

February 18, 2007

Python Templates

Here is a cute lightweight python templating module that supports inline python, speedy compilation, subtemplates, and subclassing, all with 70 lines of code.

(Update: before reading on, also consider this @stringfunction template approach which is faster and better and simpler.)

Basic usage looks like this:

import templet

class PoemTemplate(templet.Template):
  template = "The $creature jumped over the $thing."

print PoemTemplate(creature='cow', thing='moon')

Template strings are compiled into methods through the magic of python metaclasses, so they run fast.

The class above actually becomes a class with a method called "template" that calls "write" several times. You can think of the class as being roughly equivalent to this:

class PoemTemplate(templet.Template):
  def template(self, creature=None, thing=None):
    self.write("The ")
    self.write(creature)
    self.write(" jumped over the ")
    self.write(thing)
    self.write(".")

Templates can contain ${...} and ${{...}} blocks with python code, so you are not limited to just variable substitution: you can use arbitrary python in your template. This straightforward approach of compiling a template into python is simple, yet powerful...

Continue reading "Python Templates"
Posted by David at 05:49 PM | Comments (5)

February 25, 2007

Kidnapping Statistics

Today my dad advised me to install video cameras around our house. Over 300,000 children go missing or abducted every year in the United States, he said. And so his advice was to surveil the area to watch for any suspicious people that might be hanging about.

There are about 70 million children in the country, so his number of abductions would imply that every person has maybe a 1% chance of being snatched away before survivng to adulthood. If this was really true, it seemed to me, then the only thing police would be doing all day would be dealing with child hostages like some scene out of a summertime movie. Is kidnapping really as common as shoplifting?

Why do we fear kidnapping, terrorism, and airplane crashes? Aren't there more serious things in life to worry about? When I told my dad that his number must be wrong and that he was being nuts, he was adamant: "the number came from an expert on Oprah...."

Continue reading "Kidnapping Statistics"
Posted by David at 08:03 AM | Comments (6)

Obama's Weak Speech

Obama made a weak speech in Austin yesterday. I like Obama, and I hope that the weak speech is just a bit of campaign-trail fatigue. I hope he recognizes his mistake and turns around to elevate his tone and retake the high road as he moves on.

Because words matter.

If you educate us, draw our attention to basic truths, challenge us with views we disagree with, make us think about things that we don't think about every day, we will be inspired. If you pander to our preconceptions and tell us what we want to hear, offer clichés that we already think we know, repeat words we hear in the news every day, then we may cheer, but we won't be remember your message.

We can feel the difference. Even if we can't parse the lawyer's distinction between a sound argument and an ad hominem fallacy, we can sense the difference between profound oratory and a cheap shot....

Continue reading "Obama's Weak Speech"
Posted by David at 12:23 PM | Comments (2)

February 27, 2007

The Web's C-SPAN Killer

OpenCongress launched today. From the Congress Gossip Blog:

First, find your Congressperson and Senators here on OpenCongress, and subscribe to their RSS feeds to stay in touch with them.

Second, subscribe to the RSS feed for the most viewed bills, so you can keep on top of what's most buzzed-about on the web.

Third, browse through the Issue Areas and pick one that matters to you, then subscribe to its RSS feed so that you'll know when relevant bills are in play.

Fourth, look around in the most viewed bills or your chosen issue areas and find a bill that interests you, then write a blog post about it that includes the bill's official title (for example, "H.R.800"). A link to your blog post will likely soon appear in the blog coverage of that bill on OpenCongress.

Fifth, take that blog post and suggest it as a link to be featured on on the open-submissions Congress Gossip Blog.

Now everybody can be a wonk after reviewing the day's congressional business, scanning the profile of your favorite congressman, and reading blog entries explaining what a "cloture vote" is. It seems there is some interest - the website is under heavy load today.

Let's hope they do better than C-SPAN at making Washington relevant.

Posted by David at 07:41 PM | Comments (0)

February 28, 2007

Vitamin Religion

I grew up in a family that worshipped the cult of the Vitamin. My mom read her Vitamin Bible every Sunday and filled all of us up with megadoses of every conceivable supplement. She took the largest doses herself, in giantic units every day that my dad called "horse pills."

I am convinced that this alphabet soup of supplements was not ingested without adverse effects. "I have a twitch in my eye and sores in my lips, and my memory is fading," she would complain. Her solution to her problems? More vitamins of course, especially more of those huge orange pills of vitamin B.

In this month's JAMA, there is a nice metastudy of the effects of popular antioxidants, vitamin A, vitamin E, and beta carotine. The results? All these will shorten your life. Fortunately, vitamin C, of which I consumed vast quantities growing up, seemed to have neither a positive nor negative effect on mortality.

The abstract of the study is here. I know that this will not dissuade the antioxidant vitamin crowd. Followers are religious; there is nothing I could ever show my mom that would ever convince her to stop.

Posted by David at 10:05 AM | Comments (1)