Category Archives: Computers

OpenID Servers: Allow Redundant Means of Access

That’s the lesson I take from Kyle Neath’s critique of OpenID (HT: Ma.tt), from his first point, the one that I think has the most traction. OpenID servers should allow users to associate their account with several OpenID providers, if they want, and/or an email address.

sed and Multi-Line Search and Replace

I’ve been experimenting with getting regular expression patterns to match over multiple lines using sed. For example, one might want to change
<p>previous text</p>
<h2>
<a href="http://some-link.com">A title here</a>
</h2>
<p>following text</p>
to
<p>previous text</p>
No title here
<p>following text</p>
sed cycles through each line of input one line at a time, so the most obvious way to match a pattern that extends [...]

A Good Enough addEvent

Several years ago, PPK of Quirksmode sponsored a contest to come up with a new version of the trusty JavaScript addEvent function. The original addEvent was created by Scott Andrew LePera in 2001 as a way to merge Internet Explorer’s attachEvent with the W3C’s addEventListener. Both addEventListener and attachEvent allow you to attach [...]

Restoring Your WordPress 2.5 Password in the Database

WordPress 2.5 introduced a much more thorough password-hashing algorithm with PHPass. That is great for security, but I was afraid that it would make restoring your WordPress password in the database almost impossible. You see, prior to 2.5, if you needed to reset your password, you could just hash it using md5 and [...]

The Right Way to Use JavaScript in Your WordPress Plugin

Ozh explains how to properly use JavaScript in your WordPress plugins. There are two key parts:

Use wp_enqueue_script() to load external libraries and standalone scripts, instead of generating your own script header tags.
On admin pages, use the admin_print_scripts-[mypage] action hook to register the code on only your plugin’s page, not every admin page.

Both of those [...]

WordPress Database Errors and the Post Hoc Fallacy

Glenn Reynolds at Instapundit mentioned WordPress today in not-so-flattering terms (emphasis added):
LIEBERMAN CAMPAIGN CRASHED OWN WEBSITE: “The server that hosted the joe2006.com Web site failed because it was overutilized and misconfigured.” That’s like when people send me a link to their underpowered WordPress blog, then it produces a “Database Error” message when too many people [...]