<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Peter Törnstrand</title>
	<link>http://www.tornstrand.com</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Tue, 21 Oct 2008 15:56:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>Reading a XML processing instruction with PHP</title>
		<link>http://www.tornstrand.com/2008/10/21/reading-a-xml-processing-instruction-with-php/</link>
		<comments>http://www.tornstrand.com/2008/10/21/reading-a-xml-processing-instruction-with-php/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 15:56:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[processing instruction]]></category>

		<category><![CDATA[xml]]></category>

		<category><![CDATA[xpath]]></category>

		<category><![CDATA[xsl]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/2008/10/21/reading-a-xml-processing-instruction-with-php/</guid>
		<description><![CDATA[I&#8217;m doing some XSL transformations in a project I&#8217;m involved in right now. The XML documents that are beeing transformed all include a xml-stylesheet processing instruction that I need to read in order to know what stylesheet to use for a specfic document. To my surprise, reading processing instructions from a DOMDocument in PHP was [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m doing some XSL transformations in a project I&#8217;m involved in right now. The XML documents that are beeing transformed all include a xml-stylesheet processing instruction that I need to read in order to know what stylesheet to use for a specfic document. To my surprise, reading processing instructions from a DOMDocument in PHP was not so easy as one might assume.</p>
<p> <a href="http://www.tornstrand.com/2008/10/21/reading-a-xml-processing-instruction-with-php/#more-29" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/10/21/reading-a-xml-processing-instruction-with-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Don&#8217;t miss Ubiquity</title>
		<link>http://www.tornstrand.com/2008/08/29/dont-miss-ubiquity/</link>
		<comments>http://www.tornstrand.com/2008/08/29/dont-miss-ubiquity/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 07:31:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/2008/08/29/dont-miss-ubiquity/</guid>
		<description><![CDATA[I installed the Ubiquity browser plugin yesterday and I&#8217;ve had some time to play around with it. Without a doubt Ubiquity is the most exceting thing that has happend to web browsers in years. I&#8217;m not going to rant about all the things this browser plugin can do for you, instead see for yourself at [...]]]></description>
			<content:encoded><![CDATA[<p>I installed the <a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/">Ubiquity</a> browser plugin yesterday and I&#8217;ve had some time to play around with it. Without a doubt Ubiquity is the most exceting thing that has happend to web browsers in years. I&#8217;m not going to rant about all the things this browser plugin can do for you, instead see for yourself at <a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/">Ubiquity project at Mozilla Labs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/08/29/dont-miss-ubiquity/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend_Form custom/localized error messages</title>
		<link>http://www.tornstrand.com/2008/06/27/zend_form-customlocalized-error-messages/</link>
		<comments>http://www.tornstrand.com/2008/06/27/zend_form-customlocalized-error-messages/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 19:45:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[localization]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[zend framework]]></category>

		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/2008/06/27/zend_form-customlocalized-error-messages/</guid>
		<description><![CDATA[I&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with <a href="http://framework.zend.com/manual/en/zend.form.html">Zend_Form</a> and <a href="http://framework.zend.com/">Zend Framework</a> 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 <a href="http://devzone.zend.com/article/3450-Decorators-with-Zend_Form">this article</a> in the Zend Developer forums that did a pretty good job explaining it.</p>
<p>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&#8217;s to use them. It turns out the solution is really simple.</p>
<p>To attach a validator to a form element you normally write something like this:</p>
<p><code>$textField = new Zend_Form_Element_Text("myField");<br />
$textField-&gt;addValidator(new Zend_Validate_NotEmpty());</code></p>
<p>If you want to customize the message and maybe even localize it you simply init a validator and manuelly set the message via the <em>setMessage</em> method, like this:</p>
<p><code>$notEmpty = new Zend_Validate_NotEmpty();<br />
$notEmpty-&gt;setMessage("You have to enter a value");<br />
$textField = new Zend_Form_Element_Text("myField");<br />
$textField-&gt;addValidator($notEmpty);</code></p>
<p>If you like to localize the error message, replace the setMessage call with:</p>
<p><code>$notEmpty-&gt;setMessage($this-&gt;getView()-&gt;translate("You have to enter a value"));</code></p>
<p>It&#8217;s just that simple <img src='http://www.tornstrand.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/06/27/zend_form-customlocalized-error-messages/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Maps Cluster markers</title>
		<link>http://www.tornstrand.com/2008/06/18/google-maps-cluster-markers/</link>
		<comments>http://www.tornstrand.com/2008/06/18/google-maps-cluster-markers/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 08:49:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<category><![CDATA[cluster markers]]></category>

		<category><![CDATA[google maps]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/2008/06/18/google-maps-cluster-markers/</guid>
		<description><![CDATA[I&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;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.</p>
<p>So with this in mind I set out to find a way to avoid this problem. I&#8217;ve seen on other sites markers that change depending on what level of zoom you&#8217;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 <a href="http://googlemapsapi.110mb.com/clustermarker/index.htm">ClusterMarker</a> by Martin Pearman.</p>
<blockquote><p>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 <span style="font-weight: bold">cluster marker</span>. The cluster marker, when clicked, simply centers and zooms the map in on the markers whose icons previously intersected.</p></blockquote>
<p>The <a href="http://googlemapsapi.110mb.com/clustermarker/reference.htm">ClusterMarker API is well documented</a> and really easy to implement and use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/06/18/google-maps-cluster-markers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Finally got sound in Vista X64</title>
		<link>http://www.tornstrand.com/2008/06/11/finally-got-sound-in-vista-x64/</link>
		<comments>http://www.tornstrand.com/2008/06/11/finally-got-sound-in-vista-x64/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 13:25:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/2008/06/11/finally-got-sound-in-vista-x64/</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.tornstrand.com/wp-content/uploads/2008/06/macbook-black.jpg" alt="Apple MacBook (black)" align="right" hspace="10" vspace="10" />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&#8217;t need audio support while working in Vista.</p>
<p>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.</p>
<p>So now I&#8217;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 <strong><a href="http://drivers.softpedia.com/get/SOUND-CARD/REALTEK/Realtek-High-Definition-Audio-Codecs-R194-Vista.shtml">Realtek High Definition Audio Codecs R1.94 Vista</a></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/06/11/finally-got-sound-in-vista-x64/feed/</wfw:commentRss>
		</item>
		<item>
		<title>String localization with gettext and Zend Framework</title>
		<link>http://www.tornstrand.com/2008/03/29/string-localization-with-gettext-and-zend-framework/</link>
		<comments>http://www.tornstrand.com/2008/03/29/string-localization-with-gettext-and-zend-framework/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 12:57:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[localization]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[gettext]]></category>

		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/2008/03/29/string-localization-with-gettext-and-zend-framework/</guid>
		<description><![CDATA[There&#8217;s a lot more to localizing a web site then just replacing strings with diffrent languages (for an exelent introduction read the ZF documentation on Zend_Locale). But in this post I will talk about string localization, and especially string localization using gettext and .mo-files with Zend Framework.
]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a lot more to localizing a web site then just replacing strings with diffrent languages (for an exelent introduction read the <a href="http://framework.zend.com/manual/en/zend.locale.html">ZF documentation on Zend_Locale</a>). But in this post I will talk about string localization, and especially string localization using <a href="http://www.gnu.org/software/gettext/">gettext</a> and .mo-files with <a href="http://framework.zend.com/">Zend Framework</a>. <a href="http://www.tornstrand.com/2008/03/29/string-localization-with-gettext-and-zend-framework/#more-12" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/03/29/string-localization-with-gettext-and-zend-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ASP.NET anchor link in user control</title>
		<link>http://www.tornstrand.com/2008/02/20/aspnet-anchor-link-in-user-control/</link>
		<comments>http://www.tornstrand.com/2008/02/20/aspnet-anchor-link-in-user-control/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 14:57:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[user control]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/2008/02/20/aspnet-anchor-link-in-user-control/</guid>
		<description><![CDATA[Ran into a strange bug today while trying to make an anchor link inside a user control i ASP.NET. The obvious way to do it would be to just to put the anchor ID inside the NavigateUrl attribute of the HyperLink control like NavigateUrl=&#8221;#anchor&#8221;. That however resulted in the link and anchor pointing to the [...]]]></description>
			<content:encoded><![CDATA[<p>Ran into a strange bug today while trying to make an anchor link inside a user control i ASP.NET. The obvious way to do it would be to just to put the anchor ID inside the <em>NavigateUrl </em>attribute of the <em>HyperLink</em> control like <em>NavigateUrl=&#8221;#anchor&#8221;</em>. That however resulted in the link and anchor pointing to the directory where the user control was located. <a href="http://www.tornstrand.com/2008/02/20/aspnet-anchor-link-in-user-control/#more-11" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/02/20/aspnet-anchor-link-in-user-control/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Classical ASP YouTube class</title>
		<link>http://www.tornstrand.com/2008/02/12/classical-asp-youtube-class/</link>
		<comments>http://www.tornstrand.com/2008/02/12/classical-asp-youtube-class/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 16:37:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[asp]]></category>

		<category><![CDATA[classical asp]]></category>

		<category><![CDATA[oop]]></category>

		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/2008/02/12/classical-asp-youtube-class/</guid>
		<description><![CDATA[Believe it or not but from time to time I actually get to do some programing with classical ASP, you know that stoneage technology that came before the .NET framework. Back in the days the concept of using classes was beyond me so when I got the chance the other day to do some ASP [...]]]></description>
			<content:encoded><![CDATA[<p>Believe it or not but from time to time I actually get to do some programing with classical ASP, you know that stoneage technology that came before the .NET framework. Back in the days the concept of using classes was beyond me so when I got the chance the other day to do some ASP coding I decided to do it the OOP way. <a href="http://www.tornstrand.com/2008/02/12/classical-asp-youtube-class/#more-9" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/02/12/classical-asp-youtube-class/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Links on PNG backgrounds in IE6</title>
		<link>http://www.tornstrand.com/2008/01/20/links-on-png-backgrounds-in-ie6/</link>
		<comments>http://www.tornstrand.com/2008/01/20/links-on-png-backgrounds-in-ie6/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 16:16:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[css]]></category>

		<category><![CDATA[ie6]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/2008/01/20/links-on-png-backgrounds-in-ie6/</guid>
		<description><![CDATA[Using transparent PNG background images is pretty standard these days with shadows and fading backgrounds on almost every site. PNG backgrounds even works with IE6 although it&#8217;s implementation is kind of buggy. In order to use it on IE6 you have to use the IE6 filter rule, as shown below.
]]></description>
			<content:encoded><![CDATA[<p>Using transparent PNG background images is pretty standard these days with shadows and fading backgrounds on almost every site. PNG backgrounds even works with IE6 although it&#8217;s implementation is kind of buggy. In order to use it on IE6 you have to use the IE6 filter rule, as shown below. <a href="http://www.tornstrand.com/2008/01/20/links-on-png-backgrounds-in-ie6/#more-5" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/01/20/links-on-png-backgrounds-in-ie6/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Garbeled data using PDO and MySQL</title>
		<link>http://www.tornstrand.com/2008/01/20/garbeled-data-using-pdo-and-mysql/</link>
		<comments>http://www.tornstrand.com/2008/01/20/garbeled-data-using-pdo-and-mysql/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 15:00:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[databases]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[pdo]]></category>

		<guid isPermaLink="false">http://www.tornstrand.com/index.php/2008/01/20/garbeled-data-using-pdo-and-mysql/</guid>
		<description><![CDATA[Ran into some trouble the other day while emigrating a PHP solution from our development server to the production server. The application was working fine on the development server but once moved to the production server it started to behave strangely.
]]></description>
			<content:encoded><![CDATA[<p>Ran into some trouble the other day while emigrating a PHP solution from our development server to the production server. The application was working fine on the development server but once moved to the production server it started to behave strangely. <a href="http://www.tornstrand.com/2008/01/20/garbeled-data-using-pdo-and-mysql/#more-4" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tornstrand.com/2008/01/20/garbeled-data-using-pdo-and-mysql/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
