March 24th, 2009 by Jonathan Tappan
How do you create a IDictionary that does case-insensitive key matches. There are a number of solutions posted on the web, but none of them seem quite correct. The following should work.
IDictionary map = new Dictionary(new StringCompInsensitive());
where
public class StringCompInsensitive : IEqualityComparer
{
public bool Equals(string x, string y)
{
return String.Compare(x, y, true) == 0;
}
public int GetHashCode(string obj)
{
return ((string)obj).ToLower().GetHashCode();
}
}
Posted in Dot-Net | Comments Off
March 19th, 2009 by Jonathan Tappan
I can’t give proper credit to the author of this piece. He may be an expert on computer security, but he doesn’t seem to know much about how to set up a web site (there’s no link back to the home page.)
Nevertheless, The Six Dumbest Ideas in Computer Security is well worth reading if you have any interest in how to secure a computer or a network.
Posted in Security | Comments Off
February 25th, 2009 by Jonathan Tappan
Microsoft has finally addressed the problem I described here and and released an official update to let you really disable AutoRun. (via The Register.)
Posted in Security | Comments Off
February 25th, 2009 by Jonathan Tappan
Wired tracks down the actual mathematical formula used by the investment bankers and credit rating agencies to wreck the economy.
Maybe it’s unfair to blame David X. Li, who did warn that his formula was being used inappropriately. (On the other hand, he did say it was “better than nothing”, which seems not to have been the case.) Probably if the Gaussian copula function did not exist, the whiz kids would have found something else.
Tags: Gaussian Copula
Posted in Economics | Comments Off
February 25th, 2009 by Jonathan Tappan
Greg Newton dug up a series of photos that seems to do a nice job of explaining the system.
Posted in Economics | Comments Off
January 22nd, 2009 by Jonathan Tappan
Back in the early 1990s, when Microsoft was raring to conquer the world, and still thought that security was something that could be dealt with as an afterthought, they added two features to Windows that have caused endless grief: ActiveX controls and AutoRun. Both were intended to make things more convenient for developers. (ActiveX was also a blatent attempt to hijack the Internet by encouraging web developers to build sites that could only be accessed using Windows and Internet Explorer.)
ActiveX controls used to cause all sorts of security problems, but this issue has gradually faded away as web developers came to realize that they should never, ever use them, and end users learned to always click “No” on requests to install them (or better yet, just use FireFox or some other browser that doesn’t support them.)
AutoRun, which automatically runs a program whenever a removable disk is inserted in the drive, has persisted because it’s just so convenient for developers to be able to say “Just put the CD in the drive and follow the instructions on the screen.” Recently however a new wave of viruses spread though devices like USB keys and electronic picture frames has convinced many users that this feature is much too dangerous to allow on their machines.
However when they try to disable AutoRun they find that Microsoft has made it ridiculously difficult. There are various menu options to turn it off, but they don’t really work.
As a public service, here’s a link to Scott Dunn’s article that gives relatively simple instructions for really disabling AutoRun. (After doing this, when you want to install software from a CD-ROM you will need to open the disc in Explorer and run the setup program manually.)
Woody Leonhard’s description of the “Conficker” worm makes it clear why it is so dangerous to leave AutoRun even partially enabled.
Posted in Security | Comments Off
November 20th, 2008 by Jonathan Tappan
Typealyzer asks you the enter the URL of a blog, and attempts to determine the personality of the author according to the Myers-Briggs Type Indicator. (via Megan McArdle.)
Naturally I immediately put in the URL of this blog and was told I am an “INTJ”, which it describes as a nerdy scientist type. Then I put in the URL of my other blog, where I write about “fun” stuff. This time it said I was an “ESTP”, which it describes as “active and playful.”
Of course these blogs have very different tones. Nevertheless the term “personality” as used by psychologists (including Meyers and Briggs) is something that applies to people, not blogs, and it is not supposed to change depending on what you are writing about. If Typealyzer gives different results for two blogs written by the same person, then it is not a reliable measurement technique.
Typealyzer also displays a chart purporting to show which areas of the brain were used in writing the blog. I’m not an expert in this field but I suspect this is pure hokum.
Tags: Typealyzer
Posted in Web Development | Comments Off
November 14th, 2008 by Jonathan Tappan
I had been happily using the “aLinks” WordPress plugin by Sean Hickey for quite a while. The plugin automatically generates links for keywords that you specify. Version 1 did everything that I wanted, but it broke when I upgraded to WordPress 2.6. I found that Sean had written a completely new aLinks 2.0, so I installed it and found that it mostly worked, though with some minor problems.
Then Sean seemed to vanish from the face of the Internet. His web server went off line, making it impossible to even send him an email, and has been that way for several months.
So I had no choice but to go into the source code and fix the bugs that were bothering me. Since the code is released under the GNU General Public License (GPL) I am making the revised plugin available to anyone who is interested.
New WordPress 3.x compatible version.
Old WordPress 2.x compatible version.
Bugs Fixed
- aLinks failed to respect word boundaries when identifying keyphrases, causing links to be inserted in the middle of words.
- aLinks was ignoring the “classes” setting which allows you to assign one or more CSS classes to the links.
Warning
If you are upgrading from aLinks 1.x you must first export your keyphrases to a file, then import them back in after you have installed version 2.0. Otherwise you will lose your keyphrases.
Other Notes
To install, unzip and copy the entire alinks directory to your wp-content/plugins directory.
The documentation is included as a PDF file in the alinks/includes directory.
Tags: aLinks
Posted in Web Development, WordPress | 20 Comments »
November 12th, 2008 by Jonathan Tappan
Michael Lewis, the author of Liar’s Poker, delivers a blow by blow account of the final days of the subprime bubble, from the viewpoint of some people who not only predicted the collapse but managed to profit from it by shorting subprime derivatives. (via Tim Bray.)
Some of Lewis’s observations:
- He mentions the central role played by the bond rating agencies, who screwed up in a big way. Amoung other things Standard & Poors apparently relied on a computer model that did not take into account the possibilty that home prices might fall. Most of the institutional safeguards intended to keep something like this from happening relied on these agencies to give reliable ratings. Some sort of reform is probably needed to address the conflicts of interest that they face.
- He thinks the problem really started when investment banks first switched from partnerships to public corporations. A partner is personally liable for the firm’s debts and thus has strong incentives to make sure that it doesn’t take on insane levels of risk. A corporate executive knows that it’s the stockholders who bear the risk, and thus will be tempted to take big risks in order to earn big bonuses.
Tags: Michael Lewis
Posted in Economics | Comments Off
October 28th, 2008 by Jonathan Tappan
Mark’s latest list of software he considers essential for a Linux desktop.
Posted in Uncategorized | Comments Off