Saturday, February 25, 2006

Review: Blink by Malcolm Gladwell


My wife and I finished Blink: The Power of Thinking Without Thinking by Malcolm Caldwell a couple nights ago. It was really a
fascinating book. The psychology experiments the author mentioned were amazingly clever. I
was particularly intrigued by the studies of the facial muscles and
cataloging all the possible expressions and their meanings. It was humorous to imagine university professors staring at each other and making faces. Nevertheless, the dedication of spending 7 years of one's life studying a single topic in such depth is admirable.




My wife and I disagreed with a couple conclusions the author made in the
book. The most egregious one was in the last chapter. He was talking
about blind auditions for symphonies and orchestras and saying that
the blind auditions had made classical music better. The disagreement
we had with is that he seems to have
forgotten his chapter on Pepsi vs Coke sip tests. In that chapter, he discusses the fact that Pepsi consistently performs better than Coke in blind sip tests. That success rate was what motivated Coca Cola's failure with New Coke in the 1980s. The point of the chapter was to say that nobody drinks soda at home in the form of a sip
test. Therefore, it doesn't really matter which cola performs better in that test. When people drink cola, they are aware of the packaging and all the associations they have with the brand. That awareness affects their experience of the beverage.




We saw that as exactly the problem with the blind auditions:
people don't listen to an orchestra or a symphony behind a blind. They
observe them in the concert hall. A conductor is perfectly
justified in choosing a musician based upon her appearance or the
expectations of his audience. If the audience is going to be distracted
from the music because a female is playing the french horn, that
detracts from the musical experience. Of course, when seleting members of an orchestra for recording purposes, blind auditions are rational.




Overall, the book was fascinating and makes for some good, light reading. I recommend it.

Tuesday, February 21, 2006

Tooltips with Javascript or CSS


For the Wyoming Liberty Index, I created a quick webpage using Catalyst and Perl to help rate the bills of the 2006 legislative session. On one page, I wanted to display the ratings of the bills with comments appearing as tooltips for the ratings. My first attempt was to use the title attribute on the abbr tag, but browsers only display a short summary of the title attribute as a tooltip. I wanted to display the entire comment.



CSS




My first solution was to use pure CSS tooltips. I had to make two changes to get it working in Internet Explorer. First, IE doesn't support the :hover pseudo-class on tags other than a, so I had to change the outermost tag on my tooltips to be a instead of span. Secondly, by hacking on Eric Meyer's pure CSS popups code, I determined that unless you have the following CSS somewhere, Internet Explorer won't display the tooltips.




a:hover {
background : white; /* a color other than default */
}


Javascript




After I got the CSS hacked into shape and working acceptably, I discovered Alessandro Fulciniti's simple Javascript tooltip library. I had investigated a bunch of Javascript tooltip libraries and they were all too complex. Fulciniti's approach is simple and clean. It keeps Javascript, XHTML and CSS separated, the way it should be. With a few minutes hacking, I had it doing exactly what I wanted.




Thank you Alessandro.