Bad Code Offsets
Wednesday, November 18th, 2009In a development of world-shaking importance, Alex Papadimoulis announces a new technique that can totally eliminate the problem of bad code.
In a development of world-shaking importance, Alex Papadimoulis announces a new technique that can totally eliminate the problem of bad code.
I got a request for Sean Hickey’s original aLinks code.
Here it is
…but be warned that it has some serious bugs. However it includes features that are not in my fixed version.
Go here for my fixed version, which omits some broken features that I never got around to fixing (because I don’t use them.)
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
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(); } }
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.
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.
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.
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.
Just add the following to the web.config file for the application:
<system.net>
<defaultProxy>
<proxy proxyaddress="http://127.0.0.1:8888" />
</defaultProxy>
</system.net>
Thanks to Rick Strahl.
Get Fiddler here.
I converted an old console app from .NET Framework 1.1 to 2.0 using Visual Studio 2008. When I ran it I got the following helpful error message
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
Looking in the Security Event Log I found the following messages:
Generate Activation Context failed for C:\ParsII\bin\server\CCSWinService2.exe. Reference error message: The operation completed successfully.
Syntax error in manifest or policy file “C:\ParsII\bin\server\CCSWinService2.exe.Config” on line 1.
The last one was the key. In the app config file the first line was
<?xml version="1.0" encoding="Windows-1252"?>
That should be perfectly legal for an XML file, but deleting it caused everything to work perfectly.
Raymond Chen explains in detail how to be a jerk.
After testing the site with Safari for the first time I ended up making some massive, long-overdue changes to the stylesheet, which hopefully will allow things to display better in more browsers and screen resolutions.
In particular I eliminated the use of pixel metrics, replacing it with logical sizes (inches and points.) I also reduced the dependence on bitmap images for formatting and fixed some malformed relative URLs, which Firefox and IE handled correctly but Safari didn’t like.
If the site now looks WORSE in your browser, let me know what your configuration is and I’ll see what I can do.
“Robert X. Cringely” (Mark Stephens) repeats and debunks the story the Admiral Grace Hopper invented the term “bug” (refering to computer problems.)
Actually I’m pretty sure that she never intended to claim that she invented the term. That is a misunderstanding imposed by others. She just said that she found “the first genuine computer bug,” meaning the first bug that was actually an insect.