All posts by rbowen

WordPress plugin

My wordpress coordinates plugin is doing mostly what I want it to now. If you put coordinates in a post that are in the correct format (xxdxx.xxx,-yydyy.yyy) it will convert them into a link to three things – a MapQuest map, and links to my CGI program for producing GPX and LOC files of the coordinates.

Example: 37d59.786,-84d32.252

Install by dropping the file into your wp-content/plugins directory and then enabling it in the “Plugins” menu.

The obvious shortcoming of this plugin is that it links to my copy of this cgi program. While I certainly don’t mind you using it, it is running on my machine at home, over my DSL line, and may be just a tiny bit slow. I will be interested, however, to see who, if anyone, starts using it.

Share and enjoy.

Coordinates -> links

Here is my first attempt at a WordPress plugin. Coordinates that appear in a particular format get converted to a link to my cgi GPX generator. This is only the first proof-of-concept version. Hopefully the links will be more useful in the near future, including a link to a map of the area. The coordinte format is: xxdxx.xxx,yydyy.yyy where that’s a literal d, and the x and y are the latitude and longitude coordinates, respectively. Coordinates may be preceeded with – to indicate S and W, respectively.

Hmm. I wonder if I got longitude and latitude confused …

(Update: ok, there was a bug, but it seems to be fixed now.)

Please note that the code is largely cargo-culted from http://scott.yang.id.au/2004/05/scripturizer-for-wordpress/ and, as such, may contain one or more things that I don’t completely understand yet. I expect the code will improve as my understanding of it improves. Patches welcome. Code released under the HJTI license.

Caching Barefoot

(With apologies to Wil …)

Last night I attended the Geocky Summer Blast at 37d58.917,-084d37.944 (On a related note, I’m working on a WordPress plugin that will automatically convert coordinates, in reasonable formats, to a series of links, to a GPX file, a LOC file, and a map of the location. Stay tuned.)

There were perhaps 25 geocachers in attendance. Good food, a great time with friends, and 5 on-site event-only geocaches which were actually pretty challenging. One of them even attacked me. I am not making this up.

A zillion thanks to “Maxine & Me” and to Debbie, of course. And to the General, too, I suppose, grudgingly. 😉

I haven’t done much geocaching in about a month, and I think that, maybe, if I get certain “must do” projects done today, I’ll go caching this afternoon. And maybe I’ll actually get out to Wilmore to do some much needed maintenance on Burning Bush, stage two of which is reported either missing or washed away or damaged in some way.

More register_globals

It appears, from IRC conversation yesterday, that there are a few other places where WordPress relies on register_globals. So I’m on a bit of a quest. And it’s a decent introduction to PHP, because the code is pretty good, but with enough room for improvement that there’s something useful that I can do.

The reason that I dislike register_globals, by the way, is twofold. One, it leads to code that is intrinsically harder to understand. Variables spring into existence with no warning, and nobody immediately knows where they came from. Second, it is potentially insecure, with malicious strangers creating variables in your namespace without your knowledge. I’m not aware of any actual exploit using this, but it just seems unpleasant.

subversion/bitkeeper comparison

I was just reading this commentary on this comparison between BitKeeper and subversion, and I must say … Wow.

For a company to distribute a free product, but refuse to let a “competitor” use that product, seems just childish and spiteful. To publish a comparison, and rig things so that the other guy can’t do the same, also seems pretty childish. And to force someone to fill out forms before they can look at your software license seems just plain odd.

Mass edit mode on WordPress

So that nobody else has to spend an hour trying to track this down, I thought I’d share the accumulated wisdom.

As discussed here, the mass delete feature on WordPress is not quite as wonderful as it first appears. Turns out, however, that if you set

register_globals = On

in php.ini, it works fine.

Fine, that is, except that register_globals is evil, and should not be turned on on any server that actually wants to be secure. Hopefully I’ll have a patch to remove this neessity in the next little bit. I’m slightly hampered by the fact that I don’t actually know PHP.

======================

Followup:

Ok, here’s the patch:

42c42,43
< if (!empty($delete_comments)) {

>
> if (!empty($_POST[‘delete_comments’])) {
45,46c46,47
< $del_comments = ”; $safe_delete_commeents = ”; $i = 0;
< foreach ($delete_comments as $comment) { // Check the permissions on each

> $i = 0;
> foreach ($_POST[‘delete_comments’] as $comment) { // Check the permissions on each

Creative Nomad

As part of my Audible.com membership, I was sent a Creative Nomad NuVo. It arrived today. The documentation is less than stellar. It took me about an hour to get it “working” in the sense of playing an MP3 file. I still don’t have it working in the sense of being able to hook it up with my Audible.com account. It seems that if I install support for the Nomad, I must uninstall support for my Palm device. And, being Windows, every time I boot up, it tries to install support for the newly detected Nomad device. This gets old real fast.

It’s very cute, I’m sure, but until it actually does something useful, it serves little purpose, except as a conversation starter.

Thumbing my nose at the content spammers

Having migrated to WordPress, I’m amused to see that the comment spammers are still trying to post comments to mt-comments.cgi in an attempt to advertise their own particular medication or pronographic web site. Even more interesting is how persistent they are about it. When I block them at the firewall, I then see not just one or two attempts, but *hundreds* of attempts to get to my website from that IP address.

Apparently the spam-fest that I had to manually delete, the morning of my migration to WordPress, was just the first in a new tactic of posting hundreds rather than just two or three comments.

I urge everyone using inferior blog software to implement measures to cut down on comment spam so that these folks will not have any more reason to continue it.

Reflections on an almost-perfect day

Today was very good. From a good breakfast (eggs, sausage, Ethiopian coffee) to a wonderful dinner (crab legs, lobster, fried shrimp, shrimp scampi) , just about everything was great.

This morning we went to the Wilmore Festival of the Fourth parade, which is always more pleasant than the Lexington parade, which we also attended. We went down to the campgrounds, where we ate too much cotton candy and snow cones, and Sarah got her hair painted red and blue.

The Lexington parade is always a showcase of nutjobs and fringe groups, from cross-dressing Harley-Davidson gangs to Gays for Jesus to John Kerry supporters.

I saw several people I knew in the parade. Tim Philpot was in the parade, as part of his re-election campaign. And Tim and Lisa and the kids were marching with the RailTrails folks (there’s photos of them in there somewhere).

Oh, and this year, I got footage of the Wilmore Precision Lawnmower Marching Brigade. (HERE and HERE) Fortunately, this year’s parade did not have the spectacular lawnmower-related injuries that accompanied last year’s parade.