I’ve been playing around with Zend_Form and Zend Framework 1.5 these last couple of days. Like most people I hade some trouble getting used to the decorator part of the form API. Decorators are used to style form elements for rendering in the browser, adding tags before, after and wrapping the form element itself. After much swearing I finally found this article in the Zend Developer forums that did a pretty good job explaining it.
The next problem I ran into was customizing the form error messages, not just customizing the messages but also localizing them. The framework has default error messages defined for all validators you can use with your form elements but they are kind of stiff and I doubt anyone really want’s to use them. It turns out the solution is really simple.
To attach a validator to a form element you normally write something like this:
$textField = new Zend_Form_Element_Text("myField");
$textField->addValidator(new Zend_Validate_NotEmpty());
If you want to customize the message and maybe even localize it you simply init a validator and manuelly set the message via the setMessage method, like this:
$notEmpty = new Zend_Validate_NotEmpty();
$notEmpty->setMessage("You have to enter a value");
$textField = new Zend_Form_Element_Text("myField");
$textField->addValidator($notEmpty);
If you like to localize the error message, replace the setMessage call with:
$notEmpty->setMessage($this->getView()->translate("You have to enter a value"));
It’s just that simple 
I’m working on a project right now where we make use of the Google Maps API to display various information on Google Maps. One page calls for a view of all golf courses in Sweden. To my surprice there are actually quite a few of them, closer to 500 golf courses. When you position lots and lots of markers in a small area of a map it can get quite cluttered and eventually the map starts to load painfully slow.
So with this in mind I set out to find a way to avoid this problem. I’ve seen on other sites markers that change depending on what level of zoom you’re currently in and a quick search on Google gave me the answer I was looking for. Cluster markers. Cluster markers is not a part of the Google Maps API but are supplied by third party developers. I went through a couple of different solutions but finally choose to use ClusterMarker by Martin Pearman.
ClusterMarker detects any group(s) of two or more markers whose icons visually intersect when displayed. Each group of intersecting markers is then replaced with a single cluster marker. The cluster marker, when clicked, simply centers and zooms the map in on the markers whose icons previously intersected.
The ClusterMarker API is well documented and really easy to implement and use.
Back in april I bough a MacBook to use at home and in the office. I installed Windows Vista X64 via BootCamp to use mostly at work (I do some programing in Visual Studio). I read about the many problems with drivers and was a bit anxious but to my surprise everything except the audio worked. I spent some time trying to resolve the issue, trying all kinds of different driver. Microsoft High Definition Audio (default driver choosen by Vista), Sigmatel and Realtek. None worked. I finally gave up and decided I didn’t need audio support while working in Vista.
Some time went by and I soon realized I really did need audio support. Not so much for the work I do but for listening to music while doing it. So I gave it another try and now I actually got it working. Since my last attempt it seems new versions of the Realtek drivers must have been released and it installed with any fuzz.
So now I’m writing this post so that others in the same situation might find a solution to their Vista X64 audio problems as well. The drivers that finally worked was Realtek High Definition Audio Codecs R1.94 Vista.