Yesterday’s Thoughts

Hot Water/Cold Water

Steve Yegge wants to hear about my gross conceptual misunderstandings. I’ve had a couple in the hopper to blog about for a while, so I’ll take the opportunity of this new blog to mention two I’ve become clear on over the past few years. Both relate to plumbing and water temperature.

Once when I was about five, I had to go to the bathroom while my dad was in the shower. In that house on Zorn Avenue, we only had one bathroom, so I knocked on the door and asked if I could go. He said, “Yes, but don’t flush the toilet.” “Why?” I asked. “Because flushing the toilet will make the shower water hot,” he said.

To this thought went into my five year old brain in exactly those words. And stayed. Read the rest of this entry »

Moving to WordPress

What? A brand shiny new WordPress blog with exactly the same content as the old blog. Same name, same posts, same comments.

Why? The old MovableType was too much trouble to change. The templates were awkward to manage and I was tired of the busyness of the pages. Plus I wanted to be able to create multiple blogs instead of the single omnibus blog that was Yesterday’s Thoughts. Even though WordPress doesn’t support multiple blogs, it is so easy to install, that I can create a new blog in minutes, instead of the hours required for MovableType.

How? It was dead simple. Read the rest of this entry »

Bug & Patch for acts_as_ferret

I’m putting the finishing touches on Endurance Central. Basically the UI is done and all of the user functionality is complete, if not yet fully exposed. I have started to collect race data (the current data on the site is unreliable test data - I need to clear that out).

One of the last features that I added was to make it possible for users to report inaccurate data. This feature was important to the community aspect of the site and is the bridge to get users into the membership system and to take some of the responsiblity for the content off of me.

I allowed the user to report an error on any event. To do this, I subclassed by Event model into LiveEvents (those you see) and EventCorrections, and then I created an administrative interface to accept or reject corrections in the EventCorrections. With Rails and Ruby this was brilliantly easy; using single table inheritance, it took less time to do than it had taken me to think about it and almost every point worked on the first pass.

But, and you knew there was going to be a “but” didn’t you, this somehow broke by search function for the site. Read the rest of this entry »

Labels in iTerm Tabs

On the Mac, I use iTerm, an open source project, as my Terminal client. I don’t have any strong objection to Terminal, I haven’t really used it enough to tell. iTerm has tabs, I installed it the day I got my Powerbook, and customized to my needs. It has keyboard shortcuts to open terminals on each of the hosts I care about. A good useful tool.

One small annoyance is the labelling of the tabs. By default they are labelled with the name of the host they were opened to. This causes two problems, 1) I can have five tabs open to the same host, so I have to remember which is which and 2) I can connect to a connect to a second host and the tab still shows the original host.

On a whim (I had five tabs labelled “localhost”) I decided to check if there were a new version Read the rest of this entry »

Press Coverage from Iraq

This week both President Bush and Vice President Cheney have pointed fingers at the press for focusing on the bad news from Iraq. These attempts to salvage US public opinion in favor of Iraqi War and against President Bush follow on earlier effort by Secretary of Defense Donald Rumsfeld to shape media coverage to favor administration positions. The claim is that this press coverage is responsible for American’s increasing disenchantment with the ware effort. This line of argument, whatever its truth, does not work to the administration’s credit.

The dynamics of press coverage, and the ability of Saddam, Al Queda, and the insurgents to manipulate this press coverage to their advantage, was present before the war began. Any reasonable and responsible war preparations would have taken this factor into account. Complaining about the press coverage at this point of the war reminds me of elementary school tales of the British complaining about the fact that the colonists weren’t holding still so that they could shoot at them, “Bloody Colonialist will not fight like gentlemen.”

It is hard for me to fathom what the Administration was thinking. Read the rest of this entry »

Who knew there were no WMD in Iraq?

Last week Andrew Sullivan was raising the issue of ex post facto claims that the speaker/writer knew Saddam did not have WMD. Examples here,here, here, and here.

The central nugget:

I’m now overwhelmed by how many people say they now opposed the war all along because they could see that the WMD issue was invalid. It’s amazing so few made the case at the time.

Sullivan appears easily overwhelmed. Read the rest of this entry »

W Has A Nickname

Our President is famous for the nicknames he bestows on those around him. Karl Rove is “Turd Blossum”, Condi Rice is “Guru”, Vladimir Putin is “Pootie-Poot.”

I’m in favor of censuring the President for authorizing criminal acts, but even if I weren’t, I’d find these more than a little creepy. The scatalogical and homoerotic overtones of these names makes me wonder what he was really doing in Skull and Bones. Are these nicknames descended directly from the President’s favorite political philosopher? “You are Peter and upon you I will build my church and you are Ass Catcher and upon you I will take a crap.”

Anyway, turns out he has a nickname of his own.

Who bestowed this precious moniker and what is it? Read the rest of this entry »

Communication usually fails, except by accident

My rule of thumb for analyzing an argument was anticipated by Wiio1 in the late 70’s.

My argument:

The likelihood of the conclusion of an argument being true is the product of the likelihoods of each statement used in reaching that conclusion being true.

Wiio’s conclusion from an inspection of each statement takes this my argument to its logical conclusion:

Communication usually fails, except by accident

Given that there are always a large number of individual statements in any communication, each of which has some probablity of not being transmitted accurately, successful communication is very rare.

What to do? Expanding the argument makes the problem worse. There are potential misunderstanding at every step, so the probability of successful communication becomes lower and lower.

The listener needs to challenge the speaker. If the listener accepts what the speaker says, then they have misunderstood.


1The link is to a translation and commentary on Wiio’s Laws by Jukka Korpela. In spite of, or perhaps because of, everything else I say, here, Korpela’s presention of makes them very clear. (From Law 3, that implies that I am not really understanding them.)

Bug in acts_as_authenticated

I found a bug in the acts_as_authenticated plugin. The activate method in User fails to update the user record when using both activate and 2-way reversible encryption. The symptom that I was is that @user.save was false in the controller.

It fails at this line:

update_attributes(:activated_at => Time.now.utc, :activation_code => nil)

This fails because there are a series of validations on saving the model. These on save validations on password_confirmation work (assuming correct values) when the user is created and when the password is changed, but fail on other saves of the user, particularly on activation, but would also fail if acts_as_authenticated had an edit method, or a last_seen method, or any other method that changed the user without also changing the password with a confirmation.

The rails wiki has a proposed fix, which works for activate only if not also using 2-way reversible encryption. The fix causes these validations to be attempted only if password_required, which in turn tests if password.blank? is false.

Two-way reversible encryption populates the model with the value of password, so that password.blank? is always false and password_required is always true.

I resolved the problem in acts_as_authenticated by making the following changes:

validates_presence_of :password_confirmation,
                 :if => :confirmation_required? # not :password_required
validates_confirmation_of :password,
                 :if => :confirmation_required? #ditto

And then I added the following:

after_save '@confirm_password = false'

def initialize(attributes = nil)
  super
  @confirm_password = true
end

def change_password(pass, confirm = nil)
  self.password = pass
  self.password_confirmation = confirm.nil? ? pass : confirm
  @confirm_password = true
end

protected

def confirmation_required?
  @confirm_password
end

Hope that helps.

Scarborough Country

Scarborough County seems to have jumped the shark. (It was a very little shark.)
In the February 13 Newsweek, Marc Peyser writes about Stephen Coubert:

He’s the host of Comedy Central’s “The Colbert Report,” a takeoff of talk-show blowhards like Bill O’Reilly and Joe Scarborough.

Newsweek and MSNBC are owned by the same company, and if you look at link above, it actually points to the MSNBC website. When writers from your own organization start calling you a blowhard, you have a credibility problem.