Professional PHP http://www.procata.com/blog PHP Programming, Web Development, PHP Advocacy and PHP Best Practices. Sat, 24 Nov 2007 15:16:37 +0000 http://wordpress.org/?v=2.1.2 en Sarah Snow Stever http://www.procata.com/blog/archives/2007/11/23/sarah-snow-stever/ http://www.procata.com/blog/archives/2007/11/23/sarah-snow-stever/#comments Sat, 24 Nov 2007 06:36:04 +0000 Jeff http://www.procata.com/blog/archives/2007/11/23/sarah-snow-stever/ Sarah

I am very sad. Two weeks ago, my cousin Sarah had a stroke and died. She was 35, two years younger than me.

As kids, Sarah and I, (along with her sister Rachel) would spend weeks in the summer staying at my grandparents house, playing and doing the things that ten year olds do on a farm. We sat around the campfire at family reunions. We played cards and games, talked and argued. I always looked forward to seeing all my cousins at holidays and family gatherings, but Sarah and Rachel were special then because they were closer to my age.

As adults, Sarah and I also did stuff together on occasion. We still sat around the campfire at the family reunions and visited during the holidays. But, we also went to bars and restaurants, Sarah always knew the best bars. We went to Cedar Point and shared an automobile accident. She would cut my hair and I would fix her computer. But mostly, we just talked. Sarah was just plain easy to talk to and always interesting.

In recent years Sarah moved to Atlanta to build a life for herself there. She opened a salon there and infused it with her character and personality. It was a place where she was at home and happy. I'm sure her clients felt happy and at home there as well. (A client remarks on Sarah's passing)

But, the most important thing about her move to Atlanta was meeting her husband, Kevin there. I've only met Kevin a few times, but the one thing that I know about him is that he made Sarah happy.

I haven't seen Sarah as much in the last few years. Atlanta is far from Michigan and she disliked flying. She came to fewer and fewer holiday functions. Despite her many invitations to visit Atlanta, I didn't go.

That is until September, when I went to the php|works conference in Atlanta. One of the reasons I wanted to go to the conference was to be able to see Sarah. After the conference, I stayed with her for a couple days.

Sarah showed me her Salon and I could see how much she loved it. She introduced me to the dogs that she saved. We went out to eat and visited the local Atlanta attractions. But mostly, we talked. We talked about family, dating, kids and careers. We talked about her writing, the gym she liked, the church she had joined and the things she wanted to do.

Sarah tried very hard to convince me to move to Atlanta. I think she felt that all I needed to do was to move there and I would meet the love of my life and l could live there happily to the end of my days. After all, she did.

There is so much that I still want to do with Sarah. I feel like I've always taken it for granted that that she would be around for us to "do that later." I guess not. I'll miss Sarah.

Sarah's obituary.

]]>
http://www.procata.com/blog/archives/2007/11/23/sarah-snow-stever/feed/
Benchmarking PHP’s Magic Methods http://www.procata.com/blog/archives/2007/11/04/benchmarking-phps-magic-methods/ http://www.procata.com/blog/archives/2007/11/04/benchmarking-phps-magic-methods/#comments Mon, 05 Nov 2007 00:01:02 +0000 Jeff benchmarksperformance optimizationprofiling http://www.procata.com/blog/archives/2007/11/04/benchmarking-phps-magic-methods/ Larry Garfield has an interesting set of benchmarks covering many of PHP's magic methods. His results correspond pretty well to my own benchmarks in the area. The thing to take away is that its not necessarily the overhead of the magic methods, but rather what you do inside them. Its hard to do anything useful inside a magic method, such as __get or __call that isn't 10 to 20 times slower than the "non-magic" solution.

There are probably more than a few naive programmers who would read results like this and start to avoid these constructs in their own code for performance reasons. These are the same kinds of people obsessing over a few single or double quotes, who eschew "slow" objects in favor of switch statements that are many times slower than the polymorphic method calls they are trying to avoid.

But, that's not the end of the story. Larry ran his benchmarks using 2,000,000 iterations. The N really matters here. Sure, iterators are slower than arrays, but you aren't going to be iterating over two million things. I tend to fetch my database records in lots of 25 or 50. You aren't going to be making two million invocations of __call. But how many will you make? Under what value of N does the performance of these techniques cease to matter? Is it ten, one hundred, one thousand, or ten thousand? You may be surprised at how few calls your program actually does and how little impact it has on performance.

As Wez and Travis point out in their comments, profiling is the way to find out the potential impact and to discover your true N.

Paul M. Jones has a good example of what I'm talking about. There, call_user_func_array appears to be a bottleneck, but it turns out that its the function being called, htmlspecialchars, not the calling process that consumes the balance of the time. In that case, the function was "only" called 300 times. I find that order of magnitude to be fairly typical. Something to be aware of, perhaps, but not something to obsess over.

]]>
http://www.procata.com/blog/archives/2007/11/04/benchmarking-phps-magic-methods/feed/
The Endpoints of the Scale of Stupidity on Video http://www.procata.com/blog/archives/2007/11/02/the-endpoints-of-the-scale-of-stupidity-on-video/ http://www.procata.com/blog/archives/2007/11/02/the-endpoints-of-the-scale-of-stupidity-on-video/#comments Fri, 02 Nov 2007 20:55:22 +0000 Jeff oop http://www.procata.com/blog/archives/2007/11/02/the-endpoints-of-the-scale-of-stupidity-on-video/ A quote from Cal Henderson (via simonwillison) presents a "Web Application Scale of Stupidity:"

| OGF (One Giant Function) ---- Sanity ---- OOP (Object Oriented Programming) |

The scale that Cal is talking about is actually better known as modularity:


| Few large modules ---- Sanity? ---- Many Small Modules |

If you haven't listened to Alan Kay talk about the benefits of many small modules, you should do so now. Alan Kay coined the term Object Oriented. Love OO or hate OO, if you have an opinion on it, you should know what he was thinking. Hint, it wasn't C++.

On the other end of the scale, One Giant Function is generally known as Big ball of Mud(PDF) Here is Brian Foote's presentation on the paper (read the paper first).

]]>
http://www.procata.com/blog/archives/2007/11/02/the-endpoints-of-the-scale-of-stupidity-on-video/feed/
Working with PHP 5 in Mac OS X 10.5 (Leopard) http://www.procata.com/blog/archives/2007/10/28/working-with-php-5-in-mac-os-x-105/ http://www.procata.com/blog/archives/2007/10/28/working-with-php-5-in-mac-os-x-105/#comments Mon, 29 Oct 2007 00:48:44 +0000 Jeff apachemysqlphp 5 http://www.procata.com/blog/archives/2007/10/28/working-with-php-5-in-mac-os-x-105/ PHPMac OS X is a great development platform for working with PHP. Leopard comes with Apache, PHP and many other development tools, such as subversion already installed. Leopard brings a much needed upgrade from Tiger's tired PHP 4 to a very modern version of PHP 5.2.4. This is a guide for setting up a PHP development environment under 10.5 using the version of PHP that ships with leopard.

You may prefer to use one of the 3rd party distributions of PHP, such as MAMP, XAMPP or Marc Liyanage. This is a guide to using the version of PHP that comes with 10.5.

Enable Developer Tools

These steps may not be strictly necessary for this process, but I find it useful to do them.
First, enable your root password.
You may also want to install XCode Tools from your Leopard disk (or grab the latest from Apple developer tools). The tools are required is you are going to compile any extensions for PHP.

Editing Configuration Files

We will have to edit several configuration files that exist as part of the unixy underpinnings of OS X. I'm going to recommend the free text editor, TextWrangler for this purpose. Normally, the finder hides the configuration files from view. However, in the finder, you can use the "Goto Folder..." option under the "Go" menu to view these files. This option if available via command-shift-G. Actually, this option is available in any file open dialog in OS X via command-shift-G. In addition, Text Wrangler will allow you to browse these files with its "open hidden..." option. But, the much easier option is selecting "Open file by name..." (command-D) and just typing the full path and filename. To save many of these files, you will need to enter your root password. Be Careful.

Enabling PHP

PHP is installed in Mac OS X by default, but not enabled. To enable it, we must edit the apache 2 configuration file, which is located at /etc/apache2/httpd.conf. Find the line which loads the PHP 5 module, which looks like this:

#LoadModule php5_module libexec/apache2/libphp5.so

The line is currently commented out. All we have to do is remove the comment symbol, #, so the line looks like this:

LoadModule php5_module libexec/apache2/libphp5.so

Save.

Starting Apache

Go to the sharing panel in system preferences and enable "Web Sharing." This will start the apache server.
Sharing Panel
Another way to do this is to type the following in the Terminal application:

sudo apachectl start

You will be prompted to enter your root password. After that, your apache server should now be running. If you need to restart the server from the terminal, you can type this:

sudo apachectl restart

If you find this tedious to type, there is a script that you can download to do this later in this post.

Visiting our Web Site

Now, lets check our work. In the sharing panel, you can click on the URL under "Your computer's website." Alternatively, in the web browser, go to the url http://localhost/. localhost is a special name that means "My computer." If your web server is working, you should see a page titled "Test Page for Apache Installation." If you go to http://localhost/manual/, you can read an Apache 2.2 manual, hosted from your own server. But, this don't tell you that PHP is working.
For that, we'll have to create a very simple php program. Create a new file in TextWrangler and type the following:

 
< ?php phpinfo(); ?>
 

(Don't just copy and paste this. Note that there should be no space between the < and the ?php. The WordPress software I use for this blog inserts an extra space.)
Save this using the file name info.php in the /Library/WebServer/Documents/ directory. (start from the top level directory of your hard drive, not the library directory in your home directory. Now you should be able to visit the PHP page you just created by visiting http://localhost/info.php. You should see the PHP logo and a big table of configuration information.

Showing the World

For security purposes, you should consider that anything you put in your WebServer/Documents folder will be available across the web. If you have information that you want to keep private, think twice about putting it there, unless you know how to protect it.
But, if you want people to see the pages that you are sharing, there can be a few obstacles. You can give out the URL that is listed in the sharing control panel under "Your computer's website." However, if you are behind a NAT router, such as I am, this IP address based url will only work for other computers on your network and not for the internet as a whole. You may have to configure network router or firewall in order to discover your true ip address and to route web server requests to that IP to your computer. Doing this is beyond the scope of this tutorial.
Additionally, IP address based urls don't make good urls to share. IP addresses can change. If you plan to host a permanent web site, you may want to purchase a domain name and point it to your Mac. This also, is beyond the scope of this tutorial.
Perhaps the best option is to purchase both a domain name and professional hosting. Apache based PHP Hosting is widely available and cheap. You can get support from a good host on uploading your files to the remote server. I'm going to presume that you will use one of the many excellent PHP hosting options and are only configuring PHP on your own machine for education, testing or development purposes.

Enabling a Personal Website

If you clicked on the URL under "Your Personal Website," you might have gotten a page that says forbidden. This is because in the default configuration in Leopard, unlike in Tiger, does not allow Apache to serve documents from home directories. If you want to enable this feature, you have to create a new Configuration file.
Create a new file with the following contents and save it to /etc/apache2/users/jeff.conf.

 
<directory "/Users/jeff/Sites">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</directory>
 

Replace "jeff" with your user name, which is also the name of your home directory. Exact capitalization is imporant. This tells the Apache server that it is ok to serve web content out of the ~jeff directory. You will have to restart Apache for this to take effect.
You may also have to create a Sites folder in your home directory to hold the files you want to serve. Leopard will automatically bless this folder with a special Icon.

Virtual Hosting

If you want to experiment with or work on more than one site at a time, the single directory in WebServer Documents and the Personal Websites configuration don't work well. Projects collide and files outside of your home directory can be harder to work with. The answer to this is to setup virtual hosting. Lets turn our Personal Website sharing solution into a virtual hosting solution that allows us to work with multiple websites as subdirectories of our Sites folder.
So, lets create a sample site, called mysite. We'll create a folder called "mysite" as a sub folder of our Sites folder. Capitalization is important.
Now, we are going to want to access our site with an easy to use domain name, so that our url is http://mysite/. There is an easy way to create new domain names that are only for personal use. To do this, we can add it to our /etc/hosts file. Add the following lines at the end of this file:

# My local aliases
127.0.0.1 mysite

127.0.0.1 is a special IP address designation that never changes and corresponds to localhost to mean this computer. We are telling our Mac that the name mysite is hosted on the local computer. This rule is only in effect on the same machine. If you go to a different machine, you cannot use the http://mysite/ url.
Now we need to configure apache for virtual hosting. We are going to have to edit our /etc/apache2/users/jeff.conf file. Change the contents of this file to the following:

 
<directory "/Users/jeff/Sites/*/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</directory>
 
NameVirtualHost *:80
 
<virtualhost *:80>
    DocumentRoot /Users/jeff/Sites/mysite
    ServerName mysite
</virtualhost>
 

Remember to replace "jeff" with your user name. Place your info.php test file into the mysite directory and rename it to index.php. Now, restart your apache server. When you visit http://mysite/, you should now see the familiar php logo and information page.
If you want to add another site, just add a second line in your hosts file, another subdirectory of Sites and append the following to your apache configuration file:
 
<virtualhost *:80>
    DocumentRoot /Users/jeff/Sites/myothersite
    ServerName myothersite
</virtualhost>
 

Sharing with the World, Part II

Sharing your virtual hosted sites with the world is more complicated if you don't have a domain name setup. You can, however, add your hosts files entries to other computers that you want to share with. However, you have to change the 127.0.0.1 IP address to the IP address of your computer, taking into account any NAT.
There is a special case of this. If you are using parallels, perhaps for test viewing your pages in internet explorer, you may want your virtual hosted sites to be available. The good news is that Windows also supports a hosts file. Here is how to edit your windows hosts file. The big problem is knowing what IP address to use. You can't use 127.0.0.1 on the windows side because that is the virtual windows machine, not your Mac's address. You can use the IP address shown on your network system preferences panel, 192.168.1.100 for me. But, this number is subject to change and you will have to re-edit your hosts file on the windows side.
If you are using Parellels, be sure to upgrade to the new beta version for Leopard, build 5540. Once you've done that, if you visit the network panel in system preferences and select the "Parallels Host-Guest" network, you will see the IP address that parallels assigns to your host machine. (assuming you are using Shared Networking.) You can then use this IP address in your windows hosts file. You may also be able to change "Using DHCP" to "Using DHCP with Manual address" and re-entering this number if you have a problem with the number changing. Here, my number is 10.37.129.3:

Network Preferences panel

Installing MySQL

MySQL has a binary distribution for Mac OS X. They also have reasonably good documentation on installing MySQL on Mac OS X for their distribution. Note that Leopard specific packages for MySQL have not been created yet.

Starting MySQL

So far, the MySQL preferences panel from the Tiger release is broken and does not correctly start and stop MySQL (bug report. You can do this from the terminal window with

sudo /usr/local/mysql/support-files/mysql.server start

To shutdown the server type:

sudo /usr/local/mysql/support-files/mysql.server stop

If you find this tedious to type, you can download WebDevCP, which is a small AppleScript application that I made. Launching WebDevCP launches both Apache and MySQL. Quitting the application shuts them both down. usually. Launching and quitting requires a password. No warranty on this thing. It was just something I was using personally and figured others might find useful.

Bring the mysql.sock to PHP

One problem that has come about with MySQL and Leopard is the location of the mysql.sock file. Previously, the default location for this file was in the /tmp directory. That location has now moved to the /var/mysql directory. PHP will look for it there. Unfortunately, the default location from the MySQL will still place it in the old location. We can fix this by creating a my.cnf configuration file in the /etc directory. Save a file with the following contents to /etc/my.cnf:

[client]
socket = /var/mysql/mysql.sock

[mysqld]
socket = /var/mysql/mysql.sock

In the terminal window, type the following commands to create the directory for the sock file:

sudo mkdir /var/mysql
sudo chown _mysql /var/mysql

One drawback to this is that if you have installed the MySQL GUI tools, they will look for the mysql.sock file at the old location. You can enter the new socket in the connection dialog under More Options, there is a box labeled "connect using socket." Just enter /var/mysql/mysql.sock.
Another solution is to change the php.ini file to expect the socket in a different location. I'm going with the my.cnf option because I expect the MySQL will have a Leopard version out in a few days that changes the default location.

Where is PEAR?

OS X has traditionally had problems with PEAR. Many point updates would overwrite the included version of PEAR with an older, and perhaps insecure version. Sadly, Apple has fixed this by not including PEAR at all in their OS. This is a big inconvenience for people wanting to use Apple's default version of PHP, versus a third party distribution. So, lets get PEAR installed. Type the following in the terminal window to download the PEAR installer:

curl http://pear.php.net/go-pear > go-pear.php

after that, type

sudo php -q go-pear.php

To run it. Hit enter to select the default locations. PEAR will be installed, but it won't be ready to use until we modify our php.ini file.

PHP .ini configuration

Now we need to make some changes to our php configuration file. Leopard has an empty configuration file by default, but provides a file which you can use as a template. From the terminal window, type:

sudo cp /etc/php.ini.default /etc/php.ini

Now, edit the /etc/php.ini file. Find the include_path setting:

;include_path = ".:/php/includes"

And change it to

include_path = ".:/usr/share/pear"

This enables our PEAR installation. You may also want to make some changes which will improve your ability to debug PHP. FInd the line that says

log_errors = Off

and change it to

log_errors = On

You have to then restart Apache for these PHP changes to go into effect.

Errors and Omissions

Thats all there is to using the version of PHP delivered with OS X. If you find this confusing, you are probably better off with something like XAMPP or MAMP. I'll probably end up compiling my own versions of PHP, but that is a different blog post. I've already had problems with this configuration when I tried to install XDebug via PECL. One last thing, if you run into problems, you can check the apache2 error_log file using the Console application.

For support, try the Sitepoint forums or Apple's Discussion Forums.

]]>
http://www.procata.com/blog/archives/2007/10/28/working-with-php-5-in-mac-os-x-105/feed/
Keywords and Language Simplicity http://www.procata.com/blog/archives/2007/10/11/keywords-and-language-simplicity/ http://www.procata.com/blog/archives/2007/10/11/keywords-and-language-simplicity/#comments Thu, 11 Oct 2007 18:38:26 +0000 Jeff language comparisonperlphpprogramming languageruby http://www.procata.com/blog/archives/2007/10/11/keywords-and-language-simplicity/ Well, I like programming language comparisons, so how could I resist this chart (via) promoting the simplicity of the io language by pointing out how few keywords it has. The interesting thing about this is that Java and PHP are tied on this measure of simplicity with 53 keywords. Perhaps that reflects Java's heritage as a simplification of C++ (63 keywords) and PHP's heritage as an amplification of C (37 keywords) toward a specific purpose? As usual, Perl is the poster child for language complexity. Ruby does well with 40 keywords. But, before the Ruby fans get too uppity about the simplicity of their language, they should contemplate the cat walked across the keyboard while I was holding down the shift key predefined variables that they inherited from Perl.

]]>
http://www.procata.com/blog/archives/2007/10/11/keywords-and-language-simplicity/feed/
Improved Error Messages in PHP 5 http://www.procata.com/blog/archives/2007/10/07/improved-error-messages-in-php-5/ http://www.procata.com/blog/archives/2007/10/07/improved-error-messages-in-php-5/#comments Sun, 07 Oct 2007 22:13:04 +0000 Jeff php 5 http://www.procata.com/blog/archives/2007/10/07/improved-error-messages-in-php-5/ Sometimes its the little things that make a difference. If you run the this test program in PHP 4 (tested on 4.4.7):
< ?php
function test($arg) { echo "talk like a pirate."; }
test();
?>

You get the following message:

Warning: Missing argument 1 for test() in /usr/bin/- on line 2

The error message here is reported at the position of the definition of the function, but really the error was in how the function was called. The required parameter to test was not passed. This error can be annoying, forcing you to consult a stack trace to find the actual error location. Something some beginners may not know how to do.

However, if you run the same message in PHP 5 (tested on 5.2.2):

Warning: Missing argument 1 for test(), called in /Users/jeff/- on line 3 and defined in /Users/jeff/- on line 2

Sweet improvement!

One more reason to ditch PHP 4 and go php 5.

]]>
http://www.procata.com/blog/archives/2007/10/07/improved-error-messages-in-php-5/feed/
Michigan Taxes Graphic Design Services http://www.procata.com/blog/archives/2007/10/01/michigan-taxes-graphic-design-services/ http://www.procata.com/blog/archives/2007/10/01/michigan-taxes-graphic-design-services/#comments Mon, 01 Oct 2007 21:23:57 +0000 Jeff http://www.procata.com/blog/archives/2007/10/01/michigan-taxes-graphic-design-services/ The state of Michigan, in a bid to become the most confusing state to operate a business in, has passed a sales tax on a bizarrely random selection of services. These services include such illustrious professions as astrology services, social escort services, and graphic design services.

The enumerated list of taxable services (sec 3d) [PDF] lists "Specialized design services, as described in NAICS industry group code 5414." The 5414 designation includes "planning, designing, and managing the production of visual communication in order to convey specific messages or concepts, clarify complex information, or project visual identities. These services can include the design of printed materials, packaging, advertising, signage systems, and corporate identification (logos)."

Custom programming, web design and hosting services are not taxed (they have NCAIS codes outside of the enumerated ranges). However, a service such as logo design would be taxable.

To do the right thing, as I understand it, and I am SO NOT A LAWYER...

A Michigan business offering a mix of services must collect the tax on the graphic design component of their services.

A graphic designer in Michigan must have a sales tax license and collect the tax as appropriate.

A Michigan based consumer of out of state graphic design services must report their graphic design purchases and pay the tax.

Meanwhile, Michigan has the worst unemployment rate in the nation and is the worst state for creating new businesses.

I'm glad 541511: Custom Programming Services was spared from the tax.

]]>
http://www.procata.com/blog/archives/2007/10/01/michigan-taxes-graphic-design-services/feed/
Ruby versus PHP or There and Back Again http://www.procata.com/blog/archives/2007/09/23/ruby-versus-php-or-there-and-back-again/ http://www.procata.com/blog/archives/2007/09/23/ruby-versus-php-or-there-and-back-again/#comments Sun, 23 Sep 2007 16:37:03 +0000 Jeff http://www.procata.com/blog/archives/2007/09/23/ruby-versus-php-or-there-and-back-again/ Well, I imagine that this opinion piece by Derick Silvers will cause some conversations: 7 reasons I switched back to PHP after 2 years on Rails. The gist being that a big bang rewrite of an existing code base is always a risk and that Rails is optimized more for the greenfield case. He talks about the beauty and power of coding in native SQL instead of database abstraction layers. I am sympathetic to that idea. He mentions hosting in that PHP is small and fast. To which I would add widely available and well known. He asks

IS THERE ANYTHING RAILS/RUBY CAN DO THAT PHP CAN’T DO?

And answers No with the comment

...when I took a real emotionless non-prejudiced look at it, I realized the language didn’t matter that much.

Now I disagree a bit here. It just happens that Ruby and PHP are equivalent in many of the ways that are important. See my post on comparing languages. PHP has some advantages with maturity, while ruby has some constructs, such as closures, that can do wonders in the hands of a skilled programmer. Yet, Ruby also has some disadvantages. I'd summarize that by saying it has all of the maintainability of perl with the commercial attitude of smalltalk.

One of the biggest themes of the 7 reasons piece is that he was able to bring much of what he learned from his 2 year failed rewrite in Ruby back to his PHP version. But, PHP is a different world today than it was two years ago when he made the decision to leave it for Ruby. PHP 5 is a more viable option. Additionally, the PHP community has learned from Rails. Some of the things that made the Rails framework a step ahead, for example routing and url helpers, are now widely available in the PHP world for those who want to use them.

Welcome back, we kept the light on.

]]>
http://www.procata.com/blog/archives/2007/09/23/ruby-versus-php-or-there-and-back-again/feed/
Mighty Mouse Kryptonite and Exceeding Expectations http://www.procata.com/blog/archives/2007/09/18/mighty-mouse-kryptonite-and-exceeding-expectations/ http://www.procata.com/blog/archives/2007/09/18/mighty-mouse-kryptonite-and-exceeding-expectations/#comments Tue, 18 Sep 2007 17:50:39 +0000 Jeff http://www.procata.com/blog/archives/2007/09/18/mighty-mouse-kryptonite-and-exceeding-expectations/ I'm a fan of Apple's Bluetooth mighty mouse. I cart my laptop all over and I like the ability to have a full sized mouse with a scroll wheel and right click without the hassle of cable management on some narrow coffee shop table.

Imagine my horror when just such a table caused the chain of events that killed my Mighty Mouse. Oh, it wasn't a table at my familiar neighborhood coffee shop. It was the very much narrower and much less familiar table at Taco Bell. Well, that and the tile floor in the dining area. Well, that and stiff backed mouse pad that turned out to be flexible. A narrow table, a slightly overhanging and flexible mouse-pad, and a tile floor together form Mighty Mouse kryptonite.

And yes, it is a sign of our times when Taco Bell has free WiFi.

After my mouse took the plunge off the table and hit the floor, it separated into three separate pieces where there should be only one. Perhaps, I thought, all was not lost. If only I could rejoin the pieces, I would have the power of right click once more. I needed to gather a couple of items to help me on my quest. After wandering a maze of twisty passages, otherwise known as the Wal-Mart across the street, I managed to collect an x-acto knife and super glue. My surgery was a success and the Mighty Mouse was once again functional.

Alas, the recovery was not to last. After traveling to php|works in Atlanta, I found the mighty mouse dead in my bag. The strain of travel proved too much for its little plastic innards.

As soon as I was able, I went to the Apple Store for a replacement. But, I'm a short man and the wireless mice were on the top shelf, so I was forced to seek out a store employee for assistance.

"How can I help you?" he asked.

I put the broken corpse of the Mighty Mouse on the table, "I need a replacement for this mouse."

"Oh," he replied. And then to my surprise asked, "Did you buy it with your computer?"

"Yes, I did." I told him.

"When did you buy your computer?" he wanted to know.

"January," I replied, hardly daring to believe where this conversation could lead.

"It should be covered under warranty," he informed me, "Let me check with my manager."

Sure enough, after producing the serial number for my laptop, I was sent home with a brand new Mighty Mouse and a stunned smile on my face.

Now, I'm sure that there is a specific clause in the warranty covering Taco Bell floors. And, mostly likely, if any Apple lawyers ever read this post, they won't even make it this far before writing up some kind of memo. I doubt my case was typical of company policy. The MBA-wielding consultant urging companies to "exceed expectations" is almost a cliche, but those organizations with no soul never seem to internalize the advice. I have to say that at least one heroic employee in one company in one place has exceeded my expectations and created one very grateful and impressed customer.

]]>
http://www.procata.com/blog/archives/2007/09/18/mighty-mouse-kryptonite-and-exceeding-expectations/feed/
reCAPTCHA - Combining Distributed Problem Solving with a Web Service http://www.procata.com/blog/archives/2007/05/30/recaptcha-combining-distributed-problem-solving-with-a-web-service/ http://www.procata.com/blog/archives/2007/05/30/recaptcha-combining-distributed-problem-solving-with-a-web-service/#comments Wed, 30 May 2007 13:12:39 +0000 Jeff http://www.procata.com/blog/archives/2007/05/30/recaptcha-combining-distributed-problem-solving-with-a-web-service/ I ran into an interesting project this morning called reCAPTCHA. In the spirit of distributed computing solutions, such as folding@home, it tackles a difficult problem by splitting it up and farming the pieces out. What makes this interesting is that instead of having computers solve the problem, people do.

ReCAPTCHA actually tries to solve two problems. The reCAPTCHA project pipelines the unrecognizable words from a book scanning OCR effort into a freely available web service for verifying your humanity, a CAPTCHA. Instead of each CAPTCHA puzzle being a necessary but regrettable waste of human effort, reCAPTCHA harnesses this otherwise lost resource. How brilliant is that!

The web service looks very interesting to me. I'm due to revisit a submission form soon that contains a CAPTCHA that I wrote several years ago that I know has been broken. The system contains a very extensive blacklisting system, so the weakness of the CAPTCHA has never been enough of a problem to warrant its replacement, but I'm curious to see what difference this service will make.

]]>
http://www.procata.com/blog/archives/2007/05/30/recaptcha-combining-distributed-problem-solving-with-a-web-service/feed/