Skip to content

Full content feeds and Yahoo ads

I changed the Movable Type template to include full content on feeds. Sorry for the disruption (it may have made the last fifteen entries appear new).

I think sending full content in the feeds (both RSS1 and RSS2) goes nicely with the Yahoo Ads I added a few months ago. Folks who actually subscribe to what I say shouldn’t have to endure ads, while those who find the entries via a search engine can endure some advertising. (Russell Beattie had a much slicker implementation of this idea a few years ago.)

More about the ads: I think that they’re not great, but I think that’s due to my relative lack of traffic–because of the low number of pageviews, Yahoo just doesn’t (can’t) deliver ads that are very targeted. (I’ve seen a lot of ‘Find Dan Moore’). It’s also a beta service (ha, ha). Oh well–it has paid me enough to go to lunch (but I’ll have to wait because they mail a check only when you hit $100).

As long as we’re doing public service announcements, I’ve decided to turn off comments (from the initial post, rather than only on the old ones). Maybe it’s because I’m posting to thin air, or because I’m not posting on inflammatory topics, or because comment spam is so prevalent, but I’m not getting any comments anymore (I think 5 in the last 6 months). So, no more comments.

And that’s the last blog about this blog you’ll see, hopefully for another year.

New blog on information technology and public policy

Here is a new blog on information technology and public policy blog that I’ve started reading. It’s an interesting concept–each student is required to write once a week, guests are welcome to chime in (you can even follow along with the reading list, should you choose to do so), and the posts seem to be well thought out. I found the post titledFile-sharing, Market Impact and Consumer Welfare to be particularly interesting.

This is a graduate course at the Woodrow Wilson School of Public and International Affairs, graduates of which include Samual Alito, Bill Frist, Eliot Sptizer and others. So the folks writing these opinions have, at the least, an opportunity to become a mover and shaker.

Via Freedom to Tinker.

Exceptions in API design

Here’s an old but fantastic post about API (mis)design.

To handle an exception, you have four choices, one of which is:

Log it! We bought big hard disks for those servers, let’s use them! Log the exception toString() and print its stack trace, but only if you expect the exception to be thrown over 1,000,000 times each day. Alternatively, if you think that the exception would only occur rarely and that it could indicate a problem worth looking at, just print the exception class name … since stack traces just confuse people!

Hilarious. And, it looks like it’s part 4 of a 7 part series. Via Dejan Bosanac.

Wiki practices for requirements documentation

I have been heads down for the last couple of weeks helping write requirements and design documents. The team I’m on is building them using a wiki. (I discussed the wiki selection process a few weeks ago.)

I just wanted to outline a few practices (I hesitate to call them best practices) for using a wiki to document business and technical requirements.

  • Having a wiki allows anyone to edit the requirements. This doesn’t mean that everyone will or should. Documents should still have an owner.
  • Require folks to identify themselves. Require Author met our needs, as it requires an editing user enter some identifier. A history function, without tracking who made which edit, is fairly useless. Note that our solution works for a small team. A larger team may want to authenticate every user.
  • Make sure you lock down the wiki. We have ours behind the firewall, which means that we don’t have to require a user to remember yet another password, or even login at all (beyond providing some kind of identifier once, as mentioned above).
  • PDF generation allows you to generate decent looking print documents. I found PmWiki2PDF to be adequate.
  • Think carefully about document structure. We broke out the requirements into sections, and had each section on its own wiki page; more than that, we have pages for each section for each type of requirements (business, technical) or design document. These three section pages are pulled into a page for that one component, via the page include directive, which should describe everything known about a particular component. This kind of page seems useful at present, but we haven’t begun coding.
  • However, if I had to do it over again, I’d build each main document as one wiki page, and then pull the component info out of that. This allows a user to view the overall history of the document, as opposed to the above setup, where, to see what has changed in the requirements, you have to visit as many pages as there are sections. (You can also look at the RecentChanges page for a group, but that has only a page level granularity, as opposed to the line leve granularity of the page history.)
  • Choose page names carefully. While it’s easy to move content from one page to another, realize that you lose all the history when you do that. Well, actually, you might be able to move the file on the filesystem and retain the history, but for normal users, moving a pages (that is, changing a page name) causes history loss.
  • Keep requirements, whether in sections or in one document, in a different group than the design document. This allows you to lock down the requirements group, via a password while letting other documents, like design, continue to evolve.
  • Cross reference extensively. Don’t cut and paste, link or include.
  • Use pictures. The support for uploading pictures in PmWiki is alright, though the support for removing them isn’t great. Regardless, don’t shy away from diagrams and other graphics in the wiki.

I’m going to be interested to see how the process continues to evolve as we get further into development. But so far, I think that a wiki has everything you really need to generate requirements documentation for a small team of developers.

MySQL performance and doing calculations on varchar columns

MySQL, along with other features designed to make it easy to use, tries to do the right thing regarding strings. When you perform a math calculation on a column or columns that are of type varchar, MySQL automatically conversts that string to a number (empty strings are treated as zero.):

To cast a string to a numeric value in numeric context, you normally do not have to do anything other than to use the string value as though it were a number[.]

However, this translation, convenient as it may be, is not free. A client of mine had a query that was running calculations against two such columns. After indexing and trying to simplify the query, we were still seeing query execution times of 2+ seconds (all times are quoted for MySQL 4.1, on my relativly slow personal laptop).

The solution appears to be to change the type of the columns using the alter table syntax to type double. After doing so and running analyze table mytable, I was seeing query execution times of 0.2 seconds for the same query on the same box. Fantastic.

I am not sure if this result was due to not having to do several string conversions for each row returned by the query, or the fact that:

In some cases, a query can be optimized to retrieve values without consulting the data rows. If a query uses only columns from a table that are numeric and that form a leftmost prefix for some key, the selected values may be retrieved from the index tree for greater speed[.]

Regardless of the cause, if you’re doing some complicated calculations on columns, consider making them numbers.

Choosing a wiki

I am setting up a wiki at work. These are our requirements:

  • File based storage–so I don’t have to deal with installing a database on the wiki server
  • Authentication of some kind–so that we can know who made changes to what document
  • Versioning–so we can roll back changes if need be.
  • PHP based–our website already runs php and I don’t want to deal with alternate technologies if I don’t have to.
  • Handles binary uploads–in case someone had a legacy doc they wanted to share.
  • Publish to PDF–so we can use this wiki for more formal documents. We won’t publish the entire site, but being able to do this on a per document basis is required.

I see this wiki both as a repository for company muscle memory (technical decisions, R&D results) and a place for more formal documents (requirements) that might be published to PDF. Basically, I’m trying to get rid of .doc files as a technical document format. I read about this on some XP mailing lists of which I used to be a part and am interested to see how effective it might be.

I started with PHPWiki but its support for PDF was lacking. (At least, I couldn’t figure it out, even though it was documented.)

After following the wizard process at WikiMatrix (similar to CMSMatrix, which I’ve touched on before), I found PmWiki, which has support for all of our requirements. It also seems to have a nice extensible architecture.

Installation was a snap and after monkeying around with authentication and PDF installation (documented here), I’ve added the following lines to my local/config.php:

include_once('cookbook/pmwiki2pdf/pmwiki2pdf.php');
$EnablePostAuthorRequired = 1;
$EnableUpload = 1;
$UploadDir = "/path/to/wiki/uploads";
$UploadUrlFmt = "http://www.myco.com/wiki/uploads";
$UploadMaxSize = 100000000; // 100M

PR: another industry being transformed by the internet

No, this entry isn’t about blogs. If you want to hear how blogs are transforming PR, I suggest you visit Micro Persuasion.

Via Dave Taylor, I just found out about PRLeads, a service that lets you field requests for information from journalists. When you see a request about a topic on which you consider yourself an ‘expert’, you can correspond with the journalist. You provide information and context to the journalist and if things work out, you get publicity and gain authority by being quoted in a story.

I asked a friend who has worked in PR for a long time and this service is rather revolutionary. Ten years ago, the journalist would have looked to friends or in-shop files for an expert, but now they have access to everyone who knows about the service and is willing to pay the fee ($99/month–hardly backbreaking).

This is good for everyone. Journalists get access to experts who they might not find otherwise as well as the chance to write a more correct story (due to the fact that they’ll be exposed to more viewpoints). Experts get a chance to shape public opinion as well as publicity. And the public is exposed to a wider range of views than they’d otherwise see. Win-win-win.

PRLeads is a perfect example of an internet company, by the way. It has network effects–journalists will go where the most experts are, and experts will go where the most journalists are. It’s a service that just couldn’t be efficiently run without the internet. And the main commodity is information.

Update: Here’s a blog entry about results from PRLeads.com.

mod_alias vs mod_proxy for XMLHttpRequest proxying

If you’re going to use an apache proxy to fix some of the issues with XMLHttpRequest, be aware that mod_alias sends a redirect to the browser. That is, it sends one of the 3XX HTTP status codes to the XMLHttpRequest object. The XMLHttpRequest object then issues the GET itself (well, some do, check out these XMLHttpRequest tests for more). That’s fine if you’re doing a GET, but if you’re doing a POST, then some redirects will require user interaction. I found that mod_alias, which was sending a 301 (redirect permanent) just turned the POST request into a GET. (mod_alias doesn’t always come to the rescue, apparently.)

The solution? Well, since you are really proxying the XMLHttpRequest’s request, use mod_proxy.