Archive | May 29, 2006

Time that tries mens souls

Indeed, had some tyrannical god contrived to enslave our minds to time, to make it all but impossible for us to escape subjection to sodden routines and unpleasant surprises, he could hardly have done better than handing down our present system.

— Robert Grudin, Time and the Art of Living.
cited, in turn, in the GNU tar manual

Hacking WordPress with Visual FoxPro

My first attempt at importing blog postings from Radio Userland to WordPress resulted in over seventy categories. Every post with a different combination of categories like “MySQL; LAMP; Technology; Security” created a new category with that exact name, rather than a one-to-many post-to-categories representation. WordPress supports this, as does Radio. The communication breakdown occured between the two, in an export routine I used that created MT-compatible text files.

I could have kept experimenting with different imports, but I’d rather just plow ahead with what I’ve got, so I took a look at the WordPress schema and figured out what I’d need to hack. I used Visual FoxPro to read in the category table, figure out which (multiple) category posts I should have instead of the single, multi-category category, and rewrote the many-to-many file that joins the posts to the categories.

That narrowed it down to 15 categories. I added a new one, “Personal” for notes about politics and personal goings-on. I hope to squash the four, now three “My” categories, which are the old example categories left over from the original Radio install. Stay tuned!

I noted the counts of the number of posts per category was showing zero for several categories. There’s a (denormalized) category_count field in the category table. I popped open phpMyAdmin on the server to poke around and finally issued a “update wp_categories set category_count = (select count(*) from wp_post2cat where category_id = cat_ID)” to get the counts to update. Thirteen rows updated in 0.0635 sec. Darn near as fast as Rushmore.

BSA: Billions and Billions Served

Over at Ars Technica, Nate Anderson asks “Global software piracy losses: US$3- or $34-billion?” The BSA doesn’t make their case any better by making outrageous claims. Software piracy is an issue, but it is not a world-shaking crisis. 87% of the people with a pirated version of PhotoShop have no idea what to do with it. 63% of the people with an illegal copy of Adobe Acrobat would likely switch to a free product like PDFCreator if they knew of the product and had some motivation not to pirate. Use of the software by others does not correspond 1:1 to lost sales. And 73% of statistics are made up on the spot.

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.