The mad ramblings of a scientist
August 2019

Sunday, January 20, 2013

Cognitive bias

Often enough, individuals with strong beliefs find others who share similar beliefs to latch on to and socialize with. Such social behavior might begin as a search for comfort, because people are lazy and fearful and it takes effort to appreciate other points of view (take, for example, the popularity of political cable channels like Fox News and MSNBC). What starts as comfort can progress to reinforcement. The internet has made it easier than ever to reach out to fellow believers, accelerating this tendency in modern times.

A good example of this social phenomenon are religious cults. A more dangerous example are some political movements.

There are two recent examples that come to mind.

Nate Silver is a statistician who earned a reputation over many years for his accurate political projections, based on sound mathematics and logic. He predicted Obama's recent presidential win with almost patronizing confidence. Nate Silver's rational, objective analysis infuriated many pundits on the right. These same pundits latched instead onto predictions that were clearly biased to anyone with any statistical training whatsoever. Why did these right-wing pundits refuse to listen to the facts? I simply do not understand. It's like they live in an alternate universe were mathematics doesn't work.

My second example is the NRA's initial response to the Newtown shooting. When I read about their response, already days late (and presumably, then, fully discussed among the NRA's leadership), I was stunned how politically deaf it was. This was the golden opportunity for the NRA to become part of the solution, and they blew it. How was this possible? It's like the NRA leadership lives in an alternate universe where are all of America is still a gun-toting frontier.

Posted at: 1:33 PM
Categories: Diary

Saturday, August 25, 2012

Holy Spam, Batman!

I am not interested in promoting my web site, partly because it generates no income (no advertisements), but mostly because I am not into self promotion in general. So I was happy for these articles to sit in quiet obscurity. Even the comment forms I developed for this blog were really a programming exercise.

Of course, there is no such thing as obscurity on the web for any published site. And my site is published, given that I have a registered domain name. In fact, I noticed that several web robots (some of which were fabulously obscure) trawled my web site the very first night I put it up. So, even though my web site is basically irrelevent, it is not completely unknown!

And so the spam bots have found this blog. I suppose they did many months ago, but the code I used for the comment forms is distinctly unique (I wrote it myself, after all), and so somewhat hardened against spam robots. No hard enough, though, since it was recently broken. This morning I deleted several hundred spam messages (fortunately I know how to edit my MySQL database by hand to delete comments in mass on the command line). For old time's sake, I left the very first spam message, which you can find in a couple articles below.

Time to escalate the war! Today I install a CAPTCHA scheme!

Posted at: 8:45 AM
Categories: Diary, Projects

Sunday, September 25, 2011

What's With the MTU?

Anyone with experience engineering software or hardware understands what most of the public takes for granted: it is a tremendous effort to build complex devices that are reliable. The usual approach is to subdivide an implementation into components in order to make the task manageable. Complex components are divided into sub-components, which are then divided again if necessary, ad infinitum. Even the most complex problem, divided correctly into its trivial components, becomes manageable. Usually.

Consider, for example, the MTU, or Maximum Transmission Unit. The MTU is the largest size object that can be transmitted by a digital communication device. The MTU is an important parameter for the internet, because the internet is build upon millions of hardware devices all interconnected and all of which (in principle) have different values for the MTU. There are an entire collection of protocols designed to keep the internet up and running that deal with possible MTU disparities. Protocols that each device has to adhere too if the network is to work at all.

There are billions of internet users, but very few know about the MTU. Miraculous!

This brings me to the point of this story. It turns out that my home computer, a relatively recent Mac mini, has had some bizarre wireless ethernet problems. When I first installed this computer at home, if I left it on for more than a couple of days, the wireless would slowly start degrading. A simple ping to the wireless router would start showing dropped or badly delayed packets. The longer the computer stayed on, the more common these lost packets became. A simple reboot brought wireless performance back to normal.

I spend hours trying to figure out what was wrong, but could not find anything out of place. Another similar computer at home worked fine, so the problem wasn't directly related to the router. The problem had nothing to do with interference or the choice of wireless channel, since a bad wireless connection that persisted for hours was fixed in minutes by a reboot. Temporarily turning off encryption made no difference. I eventually decided that the problems must be some obscure hardware problem. I suppose I could have returned the computer, but it was easier just to turn it off every night and avoid the issue.

Then I installed Mac OS Lion, and suddenly reboots stopped fixing the problem. That was pretty upsetting, so I started to do more research. I finally found one change that permanently fixed wireless performance: setting the MTU of the wireless connection of the computer from "Set Automatically" to a fixed value of 1400. The computer has been on for weeks and no problems have reappeared.

So, why is my poor computer so sensitive to the MTU setting? I have no idea. Hardware problems? Maybe, I suppose. A hardware problem that some how confuses the algorithm which chooses the optimal value of MTU (for the "Set Automatically" setting)? A little more likely. But I have no proof. Nor is there much evidence that other Mac users had discovered similar problems.

An annoying mystery, but at least my computer works properly again. And I will never take a good quality wireless connection for granted again!

Posted at: 12:04 AM
Categories: Diary

Sunday, September 18, 2011


This is a friendly reminder that tomorrow is international Talk Like a Pirate Day.

Posted at: 4:55 PM
Categories: Diary
Cookies, yum!

I have been working on polishing up my new web site in my spare time this week, and I have been uncovering little details here and there that need work. One detail I bumped into was the look of my web error pages. The web server software I am using has built in error pages, of course, but they are standard, boring pages, and don't fit into my web site style at all.

Web site designers often go to some trouble to personalize their error pages with their own special look. Because error web pages don't come up very often (or at least, aren't supposed to), to put a lot of effort into them is a sign of thoroughness. And being the perfectionist that I am, I had to do the same.

I started by constructing a prototype using a CSS layout that nicely matched the style of my web site. I then just quickly composed some "suggestions" for users who might have gotten a web page url incorrectly, including a suggestion that was a joke about getting a cookie (everyone likes cookies). I was quite happy with how the web page layout turned out, especially considering how quickly it was coded. But it was entirely in text, and it seemed something was missing. Maybe a picture.

I then had the inspiration to add a picture of a cookie (to play off the cookie joke in the text). So I peeked at some pictures of cookies in the public domain. Some were okay (others weren't), but none had the right composition. So I felt at a bit of a loss. Until I had another inspiration!

She Who Must Be Obeyed is an excellent baker, and a prolific photographer. So I asked her to make some chocolate-chip cookies to my specifications: just the right size and shape. And they were perfect! (And, incidentally, really, really delicious.) I then experimented with various materials to photograph cookies on, in order to reproduce the approximate shade of the background of my web pages ('#333'). A black piece of paper worked fairly well. I found that natural lighting looked far better than flash, and then set up an impromptu studio in the bedroom (with a simple tripod made from old boxes). After some trial and error (and getting just the right bite in the right cookie), I had the perfect picture.

The image I had in my mind was a chocolate-chip cookie sitting on top of the web page. To get that image right, I had to convert the background of the picture into the html color #333. That is were GIMP comes to the rescue. GIMP is a well known open source image manipulation program with capabilities similar to Adobe Photoshop. Being an amateur user, it took a few tries to get a natural look, but I think it turned out pretty good in the end.

The moral of this story is that if you are looking for just the right look in your web page design, and can't find a good picture in the public domain, consider making one yourself. It can be a bit of fun, and educational. And in some cases, you can get added benefits like a entire batch of yummy chocolate-chip cookies.

Posted at: 2:53 PM
Categories: Diary, Projects