Archive for April, 2008

Upgrading to WordPress 2.5.1

After weeks of putting it off, I’ve upgraded to WordPress 2.5.1. I’ve been putting off the upgrade to WP 2.5.x because my WP install was a bit old (2.1.something, I think), and because I had a nagging suspicion (but no solid recollection) that I had mucked about in the WP source to make something work (bad idea), and I was concerned the upgrade might break it. This morning I decided to bite the bullet. If I did have custom changes to the WP source that I have lost, I haven’t noticed any ill effects. Which is not to say that everything went off without a hitch. Herewith some notes, hints, and suggestions on the upgrade.

First off I wanted to be sure I had good backups, because Murphy and I go way back. I host this site on DreamHost, and used their One-Click Installer option to set up WP originally. Because of this, I was able to upgrade with the One-Click Installer, which offers automatic backup of the entire WP directory tree, including your plugins, themes, etc. The whole tree is copied to a .old directory before any changes are made. Excellent. That only left backing up the database.

WordPress uses MySql , and there are a number of ways to backup a MySql database. Because my hosting account includes shell access (all DreamHost accounts do), I just did a full dump from the command line, which is dead simple and wicked fast:

mysqldump --opt -p -uMySqlUsername -h MySqlServername MyDBName > backup.sql

Note that while many resources will tell you to include you password in the above command by replacing -p with -pMySqlSecretPassword, this is a security risk on any system with more than one user. Don’t do it. Instead, just use -p, and mysqldump will prompt you for your password. The resulting backup.sql is a sql script that you can feed directly to mysql, which will recreate your entire database, data and all. Very nice.

So, precautions properly taken, I asked the One-Click installer to upgrade me. A couple of minutes later, I got an email telling me that my upgrade was successful, and instructing me to follow a link to a special page in my site’s Admin area that would complete the upgrade by updating my database structure. Which is when things took a turn for the worse.

The update database page would not load. The admin login screen would not load. The blog would not load. Half a dimension away, Murphy giggled maniacally as he enforced his Law. Jerk.

The error message indicated that one of my plugins was attempting to redefine a function already defined in one of the core WordPress files. Oops. I’ll just skip ahead here to something I learned after some quality time on The Google: It is recommended that you disable all plugins before upgrading from a pre-2.5 install to 2.5.x. Oops. Annoyingly (but perhaps predictably), the only way to disable a plugin is via the Admin interface. You know, the one that didn’t load. Oops.

Fast-forwards 20 minutes of increasingly irritated Googling, and I had learned that there is an entry in the MySql table wp_options named active_plugins (i.e., where option_name = 'active_plugins'). If you set the option_value field of this row to an empty string, all plugins are disabled. That was enough to let me access the Update Database page, complete the upgrade, and use the Admin interface.

Of course, the blog was still broken, because my theme templates rely on certain functions exposed by various plugins. I proceeded to turn on plugins one at a time, based on the error messages I saw, until things were working. The only problem I ran into was UltimateTagWarrior, which is no longer supported, as of WordPress 2.3. Shutup, Murphy.

The solution was not difficult, although it required a little more Googling than I expected. UTW was discontinued because WP got built-in tagging support in WP 2.3 (I believe). However, anyone who used UTW had theme templates containing calls to UTW-specific functions. In addition, UTW offered a number of tag display options not offered by the core WP install. So the plugin’s author Christine introduced a new plugin, UTW Theme Compatibility Thing, which offers all of the old UTW template functions, but uses WP’s native tagging system as the data source. Once I installed and activated that, everything worked, except that I had no tags on my posts. (Note: If you used icons with your tags, as I do, be sure to check the instructions on the Compatibility Thing wab page or the readme file; there are a couple of extra steps required to make them work.)

This turned out to be an easy fix as well, after more time on The Google. WordPress already includes a tool to convert UTW tags to WP tags. From the Manage tab of the Dashboard, choose Import, and then choose Ultimate Tag Warrior. Five clicks through the wizard later, and you’re all done.

As far as I can tell, everything is working now. If you have any problems using the site, or see anything funny, please drop me an email or a comment.

So far, I really like the new WordPress, and I’m looking forward to trying out the new image uploader and the Gallery. My only complaint so far is that the page preview has been moved out of the Write Post page; you now click to pop open a preview. Do not want. I’ll give it a couple of days to grow on me, and them I’m going to start looking for a plugin to add integrated preview to the Write page.

Parallax Boe-Bot

As I kid, I was fascinated by electronics. I had one of those “150-in-1” electronics projects kits from Radio Shack, the kind with the springs that you bent to insert wires to connect the components mounted in the kit. I had a well worn copy of Forrest R. Mimms’ Getting Started in Electronics, as well as a number of his “Engineer’s Mini-Notebooks”, which were also sold at Radio Shack, alongside the overpriced component displays. I spent a good deal of my allowance (and later, paper route earnings) on blister packs of resistors, capacitors, and ICs, and soldered together many projects, with varying degrees of success.

Over the past couple of years, this interest has been renewed as I’ve been reading up on microcontrollers and hobby robotics. Bill Bumgarner’s recent posts about experimenting with AVR microcontrollers and the EMSL AtmegaXX8 Target Board have inspired me to make some time to tinker. While I have done some experimenting with AVRs using the 20.00 USD Atmel Butterfly recently, I decided to haul out the Parallax Boe-Bot I purchased a couple of years ago, and never got around to playing with.

I bought the Boe-Bot because I caught a great deal from Micro Center. Parallax sells the Boe-Bot for 159.95 USD, and you can often find them for sale for about 20 bucks less. I picked mine up for 49.00 USD, which is the Parallax list price for just the BASIC Stamp BS2 Microcontroller included with the kit. The kit also includes 2 Parallax Continuous Rotation Servos, which are actually Futaba S148 Standard Precision Servos which have already been modified for continuous rotation. Parallax sells them for 12.95 USD a piece, which is a good price on these servos, and an even better deal as they are already modified.

In spite of the good deal, I did have some reservations. As a matter of personal preference (and perhaps, programmer’s ego), I would prefer to program the microcontroller directly in C. I believe this provides the most flexibility on limited hardware, as well as the greatest opportunity for learning as I go. This is the primary reason why I avoided the open-source, AVR-based Arduino platform popularized by Make Magazine– the Arduino is programmed in a custom programming language. (Update: In the comments, David A. Mellis explains that the Arduino is programmed in C/C++, and that the Arduino language is a set of helper functions. I sense a purchase in the offing!) The BASIC Stamp 2 used in the Boe-Bot is programmed using Parallax’s custom variant of BASIC called PBASIC. While there are BASIC Stamp clones available from other manufacturers that are programmed with PBASIC variants, much of the details of programming in PBASIC is not directly translatable to the kinds of chips I am interested in, such as the AVR.

Another concern about the Stamp is licensing. While looking for information on programming the Stamp via Linux (Parallax only supplies Windows software), I found the following commentary in a reply to a question on the Ubuntu Forums about using the BStamp tools for Linux (more on this in an upcoming post.):

The package is apparently using two licenses, GNU for the volunteered portion, and PBASIC license. PBASIC Tokenizer Library software is used with hardware that is sold by Parallax. The license to redistribute any programs written is very restrictive, including requiring a driver’s license, and written agreement in the possession of Parallax, and subject to revokations including those mentioned within that package. The source for the library is not provided, and the library file is stripped. It is only useful with their hardware.

When working on personal projects, I prefer to use open source software whenever possible, to allow for the greatest flexibility should I wish to change the software or redistribute my work, but I do not object to closed-sourced software on moral grounds; open source is simply a better value for me. In the case of the BASIC Stamp, I intend to use the Boe-Bot kit as an inexpensive way to experiment with small scale robotics for my own enjoyment. At 49.95 USD, the pros outweigh the cons. If I decide to move on to custom designed projects, I will likely use an AVR or other inexpensive, more programmable microcontroller.

The Parallax line is not without its benefits as well. Parallax positions their products not only as hobbyist devices, but also as educational aides. The Boe-Bot kit includes a 340+ page spiral bound manual that explains much more than just construction (which only takes about 15 minutes). There are chapters on servo motors and how they work, robot navigation using dead reckoning, tactile navigation using physical touch sensors (implemented via metal “whiskers”, and non-tactile navigation using both visible light detection and infrared obstacle sensing. The text assumes little knowledge, and explains both the principle and implementation of these features. Most of the information learned from this course is directly applicable to other robotics projects, even if the PBASIC used to implement behaviors is not. If my son ever expresses an interest in microcontrollers or robotics, I will definitely start him with a Parallax kit.

While Parallax may exert strict control over the code to parse and compile PBASIC, they are far more open with their instructional texts. Their Stamps in Class line of kits (which includes the Boe-Bot) includes 9 distint products, which can be used in several progressions. All of the kits are built around the BASIC Stamp and the user’s choice of controller boards. Their are two controllers, the flagship Board of Education and the less expensive HomeWork Board (sold in 10 packs for schools). The starter kits- the Boe-Bot and “What is a Micrcontroller“- include a Board of Education; the other kits act as add-ons, combining a thorough text with additional parts needed to complete the projects and experiments in the books. Best of all, the books are not only available for sale separately, but they are all also available as free PDF downloads from the Parallax website. I’ve browsed several, and the quality appears as good as the Boe-Bot manual. This was a big part of my decision to grab the Boe-Bot when I saw it on sale. The book included with the industrial control kit includes a very good chapter on PID, or Proportional-Integral-Derivative control. This system is used not only in many industrial control scenarios, but also in two-wheeled self-balancing robots such as Larry Borello’s Gyrobot. (Note: After I started writing this post, I learned that the Industrial Control kit is discontinued. I do not know if it will be replaced with an updated version, but the latest manual is still available for download).

I have just begun to play around with the kit, and in truth, I am skimming some of the early material as I already have a firm grasp on the fundamentals of programming. I am also familiar with the basics of small robot design from other reading I have done. I can’t provide a full review as I have not worked my way through all of the material yet. I can say that I it is a well thought-out product and appears to provide a lot of learning opportunity for the beginning roboticist. I will post again in the near future with details on using the Boe-Bot (or other BASIC Stamp product) with Linux, and possibly on more on my experiences with the kit itself.

A Perfectly Cromulent Adjustment

I finally got tired of the narrow columns, so I spent a few minutes to embiggen the layout. Hopefully this will give me enough room for some new posts.

Last-minute Tax Advice

I just finished filing my Federal and State Income Taxes for 2007. Oh, what singular joy.

I filed much later than usual this year. Due to some one-time income, I actually owed money instead of getting a refund this year, for the first time. While paying taxes is never fun, and paying more at tax time is even worse, this year’s tax-paying event was even worse than I anticipated, thanks to Turbo Tax.

I have been using Turbo Tax since at least 1997; possibly longer, but those are the oldest returns files I have. I used the PC version until a few years ago when I decommissioned my old Windows desktop, and I have used the Mac version since. I have always had a good experience with the program, and have recommended it to friends and family.

I cannot recommend the 2007 tax year version without reservations (I used the “Deluxe” version). The entire process felt less polished than in years past. There were a number of forms that I had to hunt down in “Forms Mode” because “Interview Mode” did not ask the right questions, or ignored some possibilities. There were a number of areas where questions were asked that I did not understand; unlike in previous years, the integrated help often did not explain the question thoroughly.

Admittedly, part of the issue may be that I owed taxes this year, and in general had a few details in my return that I haven’t dealt with before. It is possible that the overall quality has not changes, only that I have not used the parts of the program which are less polished in the past due to my filing situation. For example, I had to pay Alternative Minimum Tax this year (which is a whole ‘nother rant); the help and interview questions for the AMT were by far the worst I’ve seen in Turbo Tax. Maybe they have always sucked; I’ve not seen them before. Whatever the reason, the perceived quality of the product was much lower this year than in years past.

Ah, but I promised advice. If you have not completed and filed your returns, and if you are using Turbo Tax, I strongly recommend that you use the “Print for Review” option which is offered just before you finish e-filing. Review the printed pages (and there will be many) carefully. This may seem obvious, but don’t forget this step. You may find something that you didn’t see while using the program. I certainly did… based on my unusually high (one-time!) income, Turbo Tax was going to tell the IRS that I would be making estimated 2008 tax payments of over $3000, four times this year, on top of my paycheck withholding. Fortunately, I caught this when I printed, before I filed, and found the correct section of the interview to fix it. Apparently, the interview originally asked if I wanted to make estimated payments, and when I said no, it ran its own calculations and signed me up.

CSS Naked Day

I can’t find time to write an actual post, but I can sure jump on a meme. April 9, 2008 is the third annual CSS Naked Day. From the site:

The idea behind this event is to promote Web Standards. Plain and simple. This includes proper use of (x)html, semantic markup, a good hierarchy structure, and of course, a good ‘ol play on words. It’s time to show off your .