autoload conflicts

Our publishing system has a fairly large PHP object model, with tons of corresponding library files. Early in the development of the library, we saw huge value in PHP 5’s autoloader. But when we integrated a 3rd party library into our application, we quickly found a limitation when our __autoload() function conflicted with the other library’s __autoload() function.

Continue reading “autoload conflicts”

Fuzzy matching city names

Recently, my team was tasked with building a system that would allow users to look up weather forecasts for arbitrary cities in the United States. The system had to allow for misspellings to give the user a forgiving but predictable interface. If the misspelling clearly matched a single city, it would use that city; otherwise it would present the user a list of options. This article describes the techniques used to perform this task.

Continue reading “Fuzzy matching city names”

Building a custom CentOS 5 kickstart disc, part 1

Note: this series of articles applies to CentOS 5; for CentOS 6, see this series.

CentOS (and of course, it’s upstream distro, Red Hat Enterprise Linux) has an extremely powerful, but somewhat poorly documented, tool for rapidly deploying machines and managing their configuration: kickstart. Kickstart lets you build a custom installation that can run hands-free. So not only is the installation quick and easy for you, you can be confident that your machines are configured exactly the way you want them to be.

Continue reading “Building a custom CentOS 5 kickstart disc, part 1”

The Outsider’s Guide to Joomla 1.5, Part 3

Once I had figured out the basic organization of menus and articles in Joomla, I had one more obstacle to overcome. I was looking at the sample site that was bundled with my installation, and I wanted to know how to control the various elements on my pages other than the articles. For example, the sample site has a poll, a “newsflash” block, a user login form, and other various elements on the pages. I wanted to know what those were and how to control them in the Joomla administration interface.

Continue reading “The Outsider’s Guide to Joomla 1.5, Part 3”

Intelligent Abbreviation of Text (pretty_substr)

Recently, we found that we needed to limit the length of “headline” text on one of our sites for display purposes. The text in question was the title text for classified ads. Our classifieds system was simply truncating the title text at an admin-configured number of characters. This helps us preserve our design, but it leads to awkward truncations where words are cut in half. Not the optimal way to do this.

Continue reading “Intelligent Abbreviation of Text (pretty_substr)”