<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dotvoid.com - PHP and more</title>
	<atom:link href="http://www.dotvoid.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotvoid.com</link>
	<description>Experiments and thoughts in PHP and javascript</description>
	<lastBuildDate>Tue, 24 Apr 2012 13:17:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting to grips with an existing XML structure</title>
		<link>http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/</link>
		<comments>http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 13:17:32 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=495</guid>
		<description><![CDATA[Very often I find myself writing input filters for large XML files using PHP. Common enough task; and PHP offer a great variety of tools to do this effectively depending on the situation. Unfortunately, almost as common is the lack of documentation for the aforementioned XML files.
Manually trying to document the XML structure is not [...]]]></description>
			<content:encoded><![CDATA[<p>Very often I find myself writing input filters for large XML files using PHP. Common enough task; and PHP offer a great variety of tools to do this effectively depending on the situation. Unfortunately, almost as common is the lack of documentation for the aforementioned XML files.</p>
<p>Manually trying to document the XML structure is not a fun job. And I have looked around for a simple tool but I didn&#8217;t really find a  tool that gave me the quick and dirty overview I wanted. A year or so ago I finally wrote a small PHP class to analyze large XML files.</p>
<p>It is simple, but quickly creates a good overview of the XML structure as well as the kind of data and attributes of the elements in the XML file. Even for a very large XML file it does a good job of showing just the relevant structure of the XML.</p>
<p>It is best described using an example.</p>
<p><strong>Example XML</strong></p>
<pre>
<div id="_mcePaste">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
 &lt;company xmlns:dvoidcomp="http://dotvoid.se/schema/company" name="MegaCorp" employeeOfTheMonth="E0003"&gt;</div>
<div id="_mcePaste">  &lt;department name="Advanced Technologies" location="NY" number="123"&gt;</div>
<div id="_mcePaste">    &lt;employee name="Al Smith" SN="E0004" manager="true"&gt;</div>
<div id="_mcePaste">      &lt;title&gt;Tech manager&lt;/title&gt;</div>
<div id="_mcePaste">    &lt;/employee&gt;</div>
<div id="_mcePaste">    &lt;employee name="John Jones" SN="E0001"&gt;</div>
<div id="_mcePaste">      &lt;title&gt;Worker&lt;/title&gt;</div>
<div id="_mcePaste">    &lt;/employee&gt;</div>
<div id="_mcePaste">    &lt;employee name="Jane Doe" SN="E0003"&gt;</div>
<div id="_mcePaste">      &lt;title&gt;Worker&lt;/title&gt;</div>
<div id="_mcePaste">    &lt;/employee&gt;</div>
<div id="_mcePaste">  &lt;/department&gt;</div>
<div id="_mcePaste">  &lt;department name="Resarch &amp;amp; Development" location="JS" number="789"&gt;</div>
<div id="_mcePaste">    &lt;employee name="Anders Andersson" SN="E0005"&gt;</div>
<div id="_mcePaste">      &lt;title&gt;Lead technologist&lt;/title&gt;</div>
<div id="_mcePaste">    &lt;/employee&gt;</div>
<div id="_mcePaste">    &lt;employee name="Joe Schmoe" SN="E0008" manager="true"/&gt;</div>
<div id="_mcePaste">    &lt;employee name="Sven Svensson" SN="E0006"&gt;</div>
<div id="_mcePaste">      &lt;title&gt;Worker&lt;/title&gt;</div>
<div id="_mcePaste">    &lt;/employee&gt;</div>
<div id="_mcePaste">  &lt;/department&gt;</div>
<div id="_mcePaste">&lt;/company&gt;</div>
</pre>
<p><strong>Example output in HTML</strong></p>
<p>The output shows the overall structure of all possible elements and all possible attributes of the different elements. All attributes have example values so that you can see what kind of data you can expect. In this example I have also asked for all possible values of the title element to be included. This is good if you know there are XML elements with a limited set of values.</p>
<p><a href="http://www.dotvoid.com/wp-content/uploads/2012/04/xmlstruct.png"><img class="aligncenter size-full wp-image-497" title="XML Structure" src="http://www.dotvoid.com/wp-content/uploads/2012/04/xmlstruct.png" alt="XML Structure" width="368" height="348" /></a></p>
<p><strong>Usage of the PHP class</strong></p>
<p>The class is simple to use. And really the only thing you can do is give the path to an XML file and call parse() with an optional array of XML element names that you want all values for in the HTML output.</p>
<pre>s&lt;?php
	use Void\File\XmlStructure;
	require __DIR__ . '/XmlStructure.php';

	$xmlStruct = new XmlStructure();
	$xmlStruct-&gt;parse(
		__DIR__ . '/XmlStructure.xml',
		array('title')
	);

?&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;style type="text/css"&gt;
		 &lt;?php echo $xmlStruct-&gt;css();?&gt;
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;?echo $xmlStruct-&gt;html();?&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong>Download: <a href="http://www.dotvoid.com/wp-content/uploads/2012/04/xmlgrips.tar.gz">xmlgrips.tar.gz</a></strong></p>
<p>Eventually I might, and might not, put it on Bitbucket or Github. The PHP class is not well documented, but small enough. Bare in mind I wrote it quickly and I only use it as a simple means of boiling down a large XML file to the bare essentials. Hopefully you will find it useful or maybe give you ideas on how to improve it.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/&amp;title=Getting+to+grips+with+an+existing+XML+structure" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/&amp;t=Getting+to+grips+with+an+existing+XML+structure" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/&amp;title=Getting+to+grips+with+an+existing+XML+structure&amp;summary=Very%20often%20I%20find%20myself%20writing%20input%20filters%20for%20large%20XML%20files%20using%20PHP.%20Common%20enough%20task%3B%20and%20PHP%20offer%20a%20great%20variety%20of%20tools%20to%20do%20this%20effectively%20depending%20on%20the%20situation.%20Unfortunately%2C%20almost%20as%20common%20is%20the%20lack%20of%20documentation%20for%20the%20aforementioned%20XML%20files.%0D%0A%0D%0AManually%20tryin&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/&amp;title=Getting+to+grips+with+an+existing+XML+structure" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Getting+to+grips+with+an+existing+XML+structure+-+http://bit.ly/JD0qEe&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Background color for inline text</title>
		<link>http://www.dotvoid.com/2011/10/background-color-for-inline-text/</link>
		<comments>http://www.dotvoid.com/2011/10/background-color-for-inline-text/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 12:47:35 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=477</guid>
		<description><![CDATA[In searching for a solution to a CSS problem I had I stumbled over another interesting problem, similar to mine. Most people seemed to agree that it
was impossible to do in pure CSS. The effect those people were after is commonly used in magazines where text with a background color is put over an image. A simple effect [...]]]></description>
			<content:encoded><![CDATA[<p>In searching for a solution to a CSS problem I had I stumbled over another interesting problem, similar to mine. Most people seemed to agree that it<br />
was impossible to do in pure CSS. The effect those people were after is commonly used in magazines where text with a background color is put over an image. A simple effect hard to achieve.</p>
<p>One solution was to surround each line of text using styled span elements. Another solution used &#8221;<a href="http://samcroft.co.uk/2011/jquery-plugin-for-inline-text-backgrounds/">a teeny weeny jquery&#8221;</a> to solve the problem. I&#8217;m sure it&#8217;s a solid solution but using jquery and javascript to be able to style text is, well, wrong. Forcing editors to add invisible span elements in text is also not a good idea. But - the effect can actually be achieved using css only and still keep the html simple and semantically correct.</p>
<p>If you use a block element, like &lt;p&gt;, and set the background color, it will be  a filled square behind the text. By setting the css display property to inline you get  close to the effect wanted.</p>
<p><img class="alignnone size-full wp-image-482" title="block-1" src="http://www.dotvoid.com/wp-content/uploads/2011/10/block-1.png" alt="" width="327" height="81" /></p>
<p>So far it is simple. The problem then is that using padding on inline text will only affect the horisontal padding (text indentation) on the first and last line of text. You get the following effect.</p>
<p><img class="alignnone size-full wp-image-483" title="block-2" src="http://www.dotvoid.com/wp-content/uploads/2011/10/block-2.png" alt="" width="339" height="82" /></p>
<p>In order to get the effect we want we need to add two elements. A surrounding block element (div) surrounding the paragraph and an inline element (span) surrounding the text inside the paragraph. Both of which is semantically without meaning.</p>
<p>First we add a left border on the surrouding block element. Then we move the text in the span element slightly to the left. The background color is set on the paragraph and does not move. Using this neat little trick we simulate text padding or indentation on each line of text.</p>
<p><img class="alignnone size-full wp-image-484" title="block-3" src="http://www.dotvoid.com/wp-content/uploads/2011/10/block-3.png" alt="" width="335" height="83" /></p>
<p>Finally we need to fix the vertical padding and line height to get rid of the spacing between the text lines. The end result is not perfect. There are still problems when the user resize text and you need to be careful with the spacing in Internet Explorer. But it&#8217;s a good start.</p>
<p><a href="http://www.dotvoid.com/wp-content/uploads/2011/10/block-4.png"><img class="alignnone size-full wp-image-485" title="block-4" src="http://www.dotvoid.com/wp-content/uploads/2011/10/block-4.png" alt="" width="336" height="86" /></a></p>
<p>Chrome sometimes change line height seemingly in a random fashion when inserting html &lt;br&gt;. Setting white-space to pre-line fix this behaviour. If not for Internet Explorer it could be simplifed further. Internet Explorer does not seem to support white-space: pre-line. So Internet Explorer still needs manually added html breaks.</p>
<p>The full source</p>
<pre>&lt;pre&gt;
&lt;html&gt;
  &lt;head&gt;
  &lt;style type="text/css"&gt;
  div#column {
    border-left: 6px solid #000;
  }

<code>  p.subs {
    display: inline;
    font: bold 14px/18px arial;
    color: #fff;
    background: #000;
    padding: 1px 0 1px 0;
    white-space: pre-line; /* Not understood by IE, use manual br for IE */
  }</code>

<code>  p.subs span {
    position: relative;
    left: -3px;
  }

  p.subs br {
    display: none;
  }
  &lt;/style&gt;
</code>

<code>  &lt;!--[if IE ]&gt;
    &lt;style type="text/css"&gt;
      p.subs br {
      display: inline;
    }
    &lt;/style&gt;
  &lt;![endif]--&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="column"&gt;
      &lt;p class="subs"&gt;&lt;span&gt;Ground round &lt;br /&gt;
salami pig, meatball short loin frankfurter &lt;br /&gt;
short ribs pork hamburger rump &lt;br /&gt;
strip steak beef ribs T-bone salami ham hock.&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2011/10/background-color-for-inline-text/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2011/10/background-color-for-inline-text/&amp;title=Background+color+for+inline+text" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2011/10/background-color-for-inline-text/&amp;t=Background+color+for+inline+text" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2011/10/background-color-for-inline-text/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2011/10/background-color-for-inline-text/&amp;title=Background+color+for+inline+text&amp;summary=In%20searching%20for%20a%20solution%20to%20a%20CSS%20problem%20I%20had%20I%20stumbled%20over%20another%C2%A0interesting%20problem%2C%20similar%20to%20mine.%20Most%20people%20seemed%20to%20agree%20that%20it%0D%0Awas%20impossible%20to%20do%20in%20pure%20CSS.%20The%20effect%20those%20people%20were%20after%C2%A0is%20commonly%20used%20in%20magazines%20where%20text%20with%20a%20background%20color%20is%20put%C2%A0over%20a&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2011/10/background-color-for-inline-text/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2011/10/background-color-for-inline-text/&amp;title=Background+color+for+inline+text" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Background+color+for+inline+text+-+http://bit.ly/nJD9I7&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2011/10/background-color-for-inline-text/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PHP development on Mac &#8211; my experience</title>
		<link>http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/</link>
		<comments>http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 12:13:34 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[inkscape]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[omnigraffle]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=466</guid>
		<description><![CDATA[A while ago I saw a lot of people writing about their PHP development environment and tools. I didn&#8217;t get around to it at the time but yesterday I found me some time to write down my experiences of moving from Linux to MacOS X as primary OS for PHP  and web development
Me and my [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I saw a lot of people writing about their PHP development environment and tools. I didn&#8217;t get around to it at the time but yesterday I found me some time to write down my experiences of moving from Linux to MacOS X as primary OS for PHP  and web development</p>
<p>Me and my partner in <a href="http://www.dotvoid.se/index.en.html">Dotvoid, a small web development and integration company,</a> have used linux as a client OS for more than a decade. All the tools I needed for developing are there already; emacs, apache, php, MySQL, xdebug, other scripting languages, various compilers, OpenOffice and so much more. For my partner, <a href="http://www.gimp.org/">Gimp</a> and <a href="http://inkscape.org/">Inkscape</a> have provided all the functionality for producing both designs and graphics. And all for free. Fantastic. Even so, a few months ago I suddenly decided it was time to abandon our ugly plastic laptops from Dell and Sony. I ordered two Macbook Pro. I haven&#8217;t used or even touched a Macintosh since 1995. But hey, they look good.</p>
<p>We soon discovered that some things aren&#8217;t as user friendly as we exptected. The multitouch trackpad with it&#8217;s gestures is wonderful. My partner still use Inkscape and <a href="http://www.gimp.org/macintosh/">Gimp under MacOS</a>. Still excellent tools. But she needs more precision and bought the Magic mouse which she&#8217;s not very satisfied with. You can change the acceleration but not the speed. Annoying. OpenOffice also works like a charm on MacOS.</p>
<p>As for me I really &#8211; really &#8211; miss a decent keyboard with keys as delete, home, end, page up and page down. I didn&#8217;t expect them to be missing from the Macbook keyboard. In time I guess I&#8217;ll get use to the weird key combinations that is needed to replace them. I might even get used to the weird combinations needed to write backspace, brackets and curly braces. But the keyboard is not really designed for programmers. On the other hand the multitouch trackpad is great. Virtual desktops in MacOS is also a bit limited but it&#8217;s not a big issue. All in all I&#8217;m slowly getting used to the hardware and the way things work under MacOS.</p>
<p>However, MacOS is not enough. There are PHP distributions for Mac. But as I use Ubuntu in production I use Virtualbox to run a 32-bit Ubuntu in a virtual machine. After disabling the Intel VT-x CPU optimization the 32-bit Ubuntu runs as smooth as ever. For some reason Virtualbox refuse to disable VT-x for Ubuntu 64-bit which is the reason I have to use 32-bit. With the VT-x (optimization) enabled the virtual machine with Ubuntu freeze for a couple of seconds every five seconds or so. I work in many different places, in different wireless networks and often using 3G. To make it work in any network I&#8217;m connected to I needed to setup two network adapters for the guest OS. One network adapter to allow the guest OS reach the outside world and another for communication between the host OS and the guest. I also have Virtualbox running a windows installation to allow me easy testing in a windows environment without hassle.</p>
<p>When buying Macbooks I also decided to buy Zend Studio for MacOS. I haven&#8217;t looked back once to either PDT or emacs. It is a great feeling being able to use subversion, debug, refactor, run tests and much more in the same editor without setting things up and tweaking PDT. It just works. I&#8217;m happy with it. Let&#8217;s me focus on development. And it is not as slow as for example SpringSource Tool Suite for java development. The workspace with the projects I work on I have in a shared directory accessible to both MacOS and the Ubuntu virtual machine.</p>
<p>In addition I use <a href="http://wb.mysql.com/">MySQL Workbench</a> a lot. It is also available for MacOS. It is a great tool for designing and working with MySQL databases. I still use the command line a lot as I&#8217;ve done since 1997 when I first started working with MySQL. But with just a few clicks the Workbench let me see changes between a database and the schema, export all the changes to a database in development, staging and finally production. (I always use an ssh tunnel to push schema changes to staging and production databases as I never allow ftp or anything else.) I still run the MySQL development databases on the virtual machine though.</p>
<p><a href="http://www.omnigroup.com/products/omnigraffle/">OmniGraffle</a> is another application I decided to buy. I use it to create diagrams and flowcharts but also to build graphical user interfaces. Especially when designing iPhone apps. Great tool and well worth the money. You can find stencils for most purposes at <a href="http://graffletopia.com/">Graffletopia</a>.</p>
<p>Even though we still use mostly open source software, compared to a linux environment, the move to Macbook cost a lot. Especially for a small company as ours. But after a few months I still think it&#8217;s worth the money. The actual hardware is great. Looks good. Silent although it does get a bit too hot underneath. The high resolution anti-glare screen is fantastic. I can even work in direct sunlight outdoors. I never want to see another crappy Sony Vaio. If only my Macbook could stop crashing every now and then I&#8217;d be really satisfied.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/&amp;title=PHP+development+on+Mac+-+my+experience" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/&amp;t=PHP+development+on+Mac+-+my+experience" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/&amp;title=PHP+development+on+Mac+-+my+experience&amp;summary=A%20while%20ago%20I%20saw%20a%20lot%20of%20people%20writing%20about%20their%20PHP%20development%20environment%20and%20tools.%20I%20didn%27t%20get%20around%20to%20it%20at%20the%20time%20but%20yesterday%20I%20found%20me%20some%20time%20to%20write%20down%20my%20experiences%20of%20moving%20from%20Linux%20to%20MacOS%20X%20as%20primary%20OS%20for%20PHP%20%C2%A0and%20web%20development%0D%0A%0D%0AMe%20and%20my%20partner%20in%20Dotvo&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/&amp;title=PHP+development+on+Mac+-+my+experience" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=PHP+development+on+Mac+-+my+experience+-+http://bit.ly/j4A2iK&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2011/07/php-development-on-mac-my-experience/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Setting up a new company</title>
		<link>http://www.dotvoid.com/2010/10/setting-up-a-new-company/</link>
		<comments>http://www.dotvoid.com/2010/10/setting-up-a-new-company/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 08:37:50 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[spain]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=461</guid>
		<description><![CDATA[In July, after another few months in Spain as a PHP consultant for a European debt collection company, I have been trudging along with my family in Kalmar. I am still doing consultancy work as a PHP developer and mostly for the very same company. It&#8217;s a great opportunity to work with PHP in a [...]]]></description>
			<content:encoded><![CDATA[<p>In July, after another few months in Spain as a PHP consultant for a European debt collection company, I have been trudging along with my family in Kalmar. I am still doing consultancy work as a PHP developer and mostly for the very same company. It&#8217;s a great opportunity to work with PHP in a financial context where accuracy and quality is important. But the last couple of months I have also been busy setting up a new company as <a href="http://www.artamus.se">Artamus AB</a> is investing in my <a href="http://www.evenemang.se">Swedish event guide  Evenemang.se</a>. This means more time to spend on coding PHP and less time needed to spend on marketing and SEO.</p>
<p>I really look forward to the coming year with excitement.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2010/10/setting-up-a-new-company/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2010/10/setting-up-a-new-company/&amp;title=Setting+up+a+new+company" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2010/10/setting-up-a-new-company/&amp;t=Setting+up+a+new+company" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2010/10/setting-up-a-new-company/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2010/10/setting-up-a-new-company/&amp;title=Setting+up+a+new+company&amp;summary=In%20July%2C%20after%20another%20few%20months%20in%20Spain%20as%20a%20PHP%20consultant%20for%20a%20European%20debt%20collection%20company%2C%20I%20have%20been%20trudging%20along%20with%20my%20family%20in%20Kalmar.%20I%20am%20still%20doing%20consultancy%20work%20as%20a%20PHP%20developer%20and%20mostly%20for%20the%20very%20same%20company.%20It%27s%20a%20great%20opportunity%20to%20work%20with%20PHP%20in%20a%20financ&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2010/10/setting-up-a-new-company/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2010/10/setting-up-a-new-company/&amp;title=Setting+up+a+new+company" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Setting+up+a+new+company+-+http://b2l.me/azfybp&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2010/10/setting-up-a-new-company/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The MongoDB vs MySQL debate&#8230;</title>
		<link>http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/</link>
		<comments>http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 06:36:10 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nosql]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=456</guid>
		<description><![CDATA[
Same stupid debate as so often before. Just the topics are different from time to time. Found via the Swedish Utvbloggen, RWW, highscalability och myNoSQL.




		
			Subscribe to the comments for this post?
		
		
			Share this on del.icio.us
		
		
			Share this on Facebook
		
		
			Post on Google Buzz
		
		
			Share this on LinkedIn
		
		
			Share this on Plaxo
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Tweet This!
		




]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="390" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="height=390&amp;width=480&amp;file=http://newvideos.xtranormal.com/web_final_lo/574b3910-afc9-11df-914b-003048d69c21_27_web_final_lo_web_finallo-flv.flv&amp;image=http://newvideos.xtranormal.com/web_final_lo/574b3910-afc9-11df-914b-003048d69c21_27_web_final_lo_poster.jpg&amp;link=http://www.xtranormal.com/watch/6995033&amp;searchbar=false&amp;autostart=false" /><param name="src" value="http://www.xtranormal.com/site_media/players/jwplayer.swf" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="390" src="http://www.xtranormal.com/site_media/players/jwplayer.swf" flashvars="height=390&amp;width=480&amp;file=http://newvideos.xtranormal.com/web_final_lo/574b3910-afc9-11df-914b-003048d69c21_27_web_final_lo_web_finallo-flv.flv&amp;image=http://newvideos.xtranormal.com/web_final_lo/574b3910-afc9-11df-914b-003048d69c21_27_web_final_lo_poster.jpg&amp;link=http://www.xtranormal.com/watch/6995033&amp;searchbar=false&amp;autostart=false" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Same stupid debate as so often before. Just the topics are different from time to time. <em>Found via the Swedish <a href="http://utvbloggen.se/nosql-humor-med-mongodb-vs-mysql/">Utvbloggen</a>, <a href="http://www.readwriteweb.com/cloud/2010/09/an-amusing-take-mysql-diehard.php">RWW</a>, <a href="http://highscalability.com/blog/2010/9/5/hilarious-video-relational-database-vs-nosql-fanbois.html">highscalability </a>och <a href="http://nosql.mypopescu.com/post/1016320617/mongodb-is-web-scale">myNoSQL</a></em>.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/&amp;title=The+MongoDB+vs+MySQL+debate..." rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/&amp;t=The+MongoDB+vs+MySQL+debate..." rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/&amp;title=The+MongoDB+vs+MySQL+debate...&amp;summary=%0D%0A%0D%0ASame%20stupid%20debate%20as%20so%20often%20before.%20Just%20the%20topics%20are%20different%20from%20time%20to%20time.%20Found%20via%20the%20Swedish%20Utvbloggen%2C%20RWW%2C%C2%A0highscalability%20och%C2%A0myNoSQL.&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/&amp;title=The+MongoDB+vs+MySQL+debate..." rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=The+MongoDB+vs+MySQL+debate...+-+http://b2l.me/ap74me&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2010/09/the-mongodb-vs-mysql-debate/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Recent activity&#8230;</title>
		<link>http://www.dotvoid.com/2010/05/recent-activity/</link>
		<comments>http://www.dotvoid.com/2010/05/recent-activity/#comments</comments>
		<pubDate>Tue, 25 May 2010 21:53:20 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[contract]]></category>
		<category><![CDATA[spain]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=452</guid>
		<description><![CDATA[Busy is good &#8211; but not being too busy. Recently I feel like I having been a bit too busy. A long time now me and my partner have been working on a new Swedish event guide. Completely written in Zend Framework, using MySQL as database and Sphinx as full text search engine. These tools [...]]]></description>
			<content:encoded><![CDATA[<p>Busy is good &#8211; but not being too busy. Recently I feel like I having been a bit too busy. A long time now me and my partner have been working on a new <a href="http://www.evenemang.se">Swedish event guide</a>. Completely written in Zend Framework, using MySQL as database and Sphinx as full text search engine. These tools are what I use normally nowadays while working on our own projects. The site has recently been launched as a beta in the spirit of release early/release often policy I have. The site is not near finished but releasing this early have already changed a few of our initial assumptions. So releasing early is good even though it sometimes can be hard to change the structure of a public website without getting in to trouble somehow.</p>
<p>Currently I&#8217;m also on a three month contract ending June 30th where I work three days a week with a <a href="http://www.iqsis.com/">European debt collection</a> system in Fuengirola, Spain. I have been involved in the project every now and then for the past two years now. Fun and very interesting &#8211; but also challenging &#8211; as we&#8217;re a small team creating a complex system integrating many very different external systems (ranging from newly designed SOAP services to old COBOL systems to Windows bookkeeping applications. All in PHP of course. Beginning of July I&#8217;ll have some vacation and then we&#8217;ll just have too see what comes up.</p>
<p>So I thought I&#8217;d throw in an update of Wordpress and a new theme here on my blog as well&#8230; about time.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2010/05/recent-activity/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2010/05/recent-activity/&amp;title=Recent+activity..." rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2010/05/recent-activity/&amp;t=Recent+activity..." rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2010/05/recent-activity/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2010/05/recent-activity/&amp;title=Recent+activity...&amp;summary=Busy%20is%20good%20-%20but%20not%20being%20too%20busy.%20Recently%20I%20feel%20like%20I%20having%20been%20a%20bit%20too%20busy.%20A%20long%20time%20now%20me%20and%20my%20partner%20have%20been%20working%20on%20a%20new%20Swedish%20event%20guide.%20Completely%20written%20in%20Zend%20Framework%2C%20using%20MySQL%20as%20database%20and%20Sphinx%20as%20full%20text%20search%20engine.%20These%20tools%20are%20what%20I%20use%20&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2010/05/recent-activity/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2010/05/recent-activity/&amp;title=Recent+activity..." rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Recent+activity...+-+http://b2l.me/wws24&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2010/05/recent-activity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting UTF BOM &#8211; byte order mark</title>
		<link>http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/</link>
		<comments>http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 08:43:20 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=447</guid>
		<description><![CDATA[When integrating systems with many different data sources and systems across Europe you are bound to eventually run in to issues with UTF-8 and national character sets as for example the Swedish ISO-8859-1. Even when parsing simple UTF-8 files with comma separated values things might things might popup to bite you.
One such thing is the [...]]]></description>
			<content:encoded><![CDATA[<p>When integrating systems with many different data sources and systems across Europe you are bound to eventually run in to issues with UTF-8 and national character sets as for example the Swedish ISO-8859-1. Even when parsing simple UTF-8 files with comma separated values things might things might popup to bite you.</p>
<p>One such thing is the occurrence of the UTF byte order mark, or BOM. The UTF-8 character for the byte order mark is U+FEFF, or rather three bytes &#8211; 0xef, 0xbb and 0xbf &#8211; that sits in the beginning of the text file. For UTF-16 it is used to indicate the byte order. For UTF-8 it is not really necessary.</p>
<p>But for UTF-8, especially on Windows, it has become more and more common to use it to indicate that the file is indeed UTF. Most text editors handle this well and you won&#8217;t ever see these bytes. As it should be.</p>
<p>The problems start when you are using PHP binary safe string functions such as strcmp() and substr(). Then these three bytes that won&#8217;t be visible even when using var_dump() can become bothersome. (<em>You would however see that the string length output by var_dump() is correct and also counts the invisible bytes.</em>)</p>
<p>So you need to detect the three bytes and remove the BOM. Below is a simplified example on how to detect and remove the three bytes.</p>
<pre>$str = file_get_contents('file.utf8.csv');
$bom = pack("CCC", 0xef, 0xbb, 0xbf);
if (0 == strncmp($str, $bom, 3)) {
	echo "BOM detected - file is UTF-8\n";
	$str = substr($str, 3);
}</pre>
<p>It&#8217;s as simple as that.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;title=Detecting+UTF+BOM+-+byte+order+mark" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;t=Detecting+UTF+BOM+-+byte+order+mark" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;title=Detecting+UTF+BOM+-+byte+order+mark&amp;summary=When%20integrating%20systems%20with%20many%20different%20data%20sources%20and%20systems%20across%20Europe%20you%20are%20bound%20to%20eventually%20run%20in%20to%20issues%20with%20UTF-8%20and%20national%20character%20sets%20as%20for%20example%20the%20Swedish%20ISO-8859-1.%20Even%20when%20parsing%20simple%20UTF-8%20files%20with%20comma%20separated%20values%20things%20might%20things%20might%20po&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;title=Detecting+UTF+BOM+-+byte+order+mark" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Detecting+UTF+BOM+-+byte+order+mark+-+http://b2l.me/rqfjk&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Dynamically change z-index on Google Maps markers</title>
		<link>http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/</link>
		<comments>http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 15:12:00 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=440</guid>
		<description><![CDATA[As many have noticed Google Maps API does not include a setIndex() method on the marker. You can set the z-index when adding a marker to the map. But it is not possible to change this afterwards.
I didn&#8217;t find a good solution to the problem when searching and had to resort to my own, hacking [...]]]></description>
			<content:encoded><![CDATA[<p>As many have noticed Google Maps API does not include a setIndex() method on the marker. You can set the z-index <em>when adding a marker</em> to the map. But it is not possible to change this afterwards.</p>
<p>I didn&#8217;t find a good solution to the problem when searching and had to resort to my own, hacking away on Google Maps. As I was feeling really good about myself when I had it working really well I just remembered that <a href="http://code.google.com/apis/maps/documentation/v3/">Google Maps Javascript API V3</a> has been released in Google Labs&#8230; And of course there it was. <a href="http://code.google.com/apis/maps/documentation/v3/reference.html#Marker">The Marker class</a> has a new method, <strong><code>setZIndex(<span class="type">zIndex:number</span>)</code></strong>.</p>
<p>Well, version 3 of the API is still only released by Google Labs which is &#8220;<em>home to developer products that are still in their formative stages</em>&#8220;. So for anyone not inclined to use version 3 just yet, I&#8217;ll write down how I did it here.</p>
<p>As I use JQuery in this particular project the example is also using JQuery. If used in production I suggest using try/catch wherever appropriate as the solution depends on a specific dom structure.</p>
<p>I have the below HTML which is the container for the Google map.</p>
<pre id="line197">&lt;<span class="start-tag">div</span><span class="attribute-name"> id</span>=<span class="attribute-value">"indexmap"</span>&gt;&lt;/<span class="end-tag">div</span>&gt;</pre>
<p>The map is created as below (you&#8217;ll have to add the lat/lng variable values yourselves.</p>
<pre id="line197">var map = new GMap2($('#indexamp'));
var point = new GLatLng(lat, lng);
map.setCenter(point, zoom);</pre>
<p>This, as most know, creates the actual map. Then it is time to add the markers. In my case I have a list of locations with the latitude/longitude in the actual html. JQuery helps me loop over these locations and dynamically add markers in the correct spots. This HTML looks like below. Note how each definition list have an id no with &#8220;mm_&#8221; as prefix. (Never mind any objections you have on having many definition lists like this&#8230; Never mind that these coordinates are fiction&#8230;)</p>
<pre>&lt;dl id="mm_0"&gt;
  &lt;dt&gt;...&lt;/dt&gt;
  &lt;dd&gt;
    &lt;span class="lat"&gt;61.333&lt;/span&gt;&lt;span class="lng"&gt;31.1324&lt;/span&gt;
    Random text
  &lt;/dd&gt;
&lt;/dl&gt;
&lt;dl id="mm_1"&gt;
  &lt;dt&gt;...&lt;/dt&gt;
  &lt;dd&gt;
    &lt;span class="lat"&gt;61.333&lt;/span&gt;&lt;span class="lng"&gt;31.1324&lt;/span&gt;
    Random text
  &lt;/dd&gt;
&lt;/dl&gt;</pre>
<p>What I want is the markers to be highlighted with a different icon every time I hover over a definition list element (dl). However, both have the same coordinates and one of the markers will be hidden behind the other.</p>
<p>So to prepare we need to make sure the actual images in the Google generated map can be connected to these defintion list id:s. The Google map have many different layers on top of each other. One layer contain the foreground images, another the shadows, mouse map definitions and so on. Each of these layers (normal div elements) have their own z-index.</p>
<p>In these different layers the images used have their own z-index. However, the z-index for the marker foreground image is the same as for the transparent clickable marker image. This makes it possible to use the transparent image z-index to restore the foreground image z-index. This is important as not to confuse the user when he later click on a marker&#8230;</p>
<p>So let&#8217;s loop over these images and give them appropriate id values as well as put the markers on the map. (No &#8211; Google does not give them id&#8217;s). This is, stripped to the bare essentials, the complete code with some comments.</p>
<pre id="line197">// Create the map
var map = new GMap2($('#indexamp'));
var point = new GLatLng(lat, lng);
map.setCenter(point, zoom);

// Loop over the definition lists picking up coordinates
var n = 0;
$('dl').each(function() {
	var lat = parseFloat($('span.lat', this).text());
	var lng = parseFloat($('span.lng', this).text());
	var point = new GLatLng(lat, lng);

	// Create the marker with custom images
	var markerIcon = new GIcon(G_DEFAULT_ICON);
	markerIcon.image = 'marker_default.png';
	markerIcon.iconSize = new GSize(23, 30);
	markerIcon.shadow = "marker_shadow.png";
	markerIcon.shadowSize = new GSize(50, 30);
	markerIcon.iconAnchor = new GPoint(11, 29);
	markerIcon.infoWindowAnchor = new GPoint(11, 14);

	var marker = new GMarker(point, {icon: markerIcon});

	// Change the foreground image when hovering over a definition list
	// Note that the actual id's have not been created yet.
	var no = this.id.substring(3); // Exclude the prefix
	$(this).hover(
		function() {
			marker.setImage('marker_selected.png');
			// Bring this image to foreground
			$('#mf_' + no)[0].style.zIndex = 1;
		},
		function() {
			marker.setImage('marker_default.png');
			// Reset the z-index based on the transparent image
			// that has the same z-index
			$('#mf_' + no)[0].style.zIndex = $('#mt_' + no)[0].style.zIndex;
		}
	);
}

// Add id values to the foreground images, based on the
// dom structure created beneath the #indexmap div element used
// as the place holder for the map
n = 0;
$('#indexmap div &gt; div &gt; div:eq(6) img').each(function() {
	this.id = 'mf_' + n++;
});

// Add id values to the shadow images the same way
n = 0;
$('#indexmap div &gt; div &gt; div:eq(8) img').each(function() {
	this.id = 'mt_' + n++;
});</pre>
<p>You might have to amend the code to get it working for you as I have cut&#8217;n pasted different parts. In the real code there is a lot of other things going on that would&#8217;ve made the example above hard to read. I do think however that you should be able to understand how it works.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/&amp;title=Dynamically+change+z-index+on+Google+Maps+markers" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/&amp;t=Dynamically+change+z-index+on+Google+Maps+markers" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/&amp;title=Dynamically+change+z-index+on+Google+Maps+markers&amp;summary=As%20many%20have%20noticed%20Google%20Maps%20API%20does%20not%20include%20a%20setIndex%28%29%20method%20on%20the%20marker.%20You%20can%20set%20the%20z-index%20when%20adding%20a%20marker%20to%20the%20map.%20But%20it%20is%20not%20possible%20to%20change%20this%20afterwards.%0D%0A%0D%0AI%20didn%27t%20find%20a%20good%20solution%20to%20the%20problem%20when%20searching%20and%20had%20to%20resort%20to%20my%20own%2C%20hacking%20away&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/&amp;title=Dynamically+change+z-index+on+Google+Maps+markers" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Dynamically+change+z-index+on+Google+Maps+markers+-+http://b2l.me/fjfa4&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2010/02/dymaically-change-z-index-on-google-maps-markers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving on to php 5.3 and Zend Server CE</title>
		<link>http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/</link>
		<comments>http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 00:21:53 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend server]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=437</guid>
		<description><![CDATA[I have had some serious issues with one of my servers these last days. But finally things are starting to get back to normal. It seems /var was full due to mysql wreaking havoc for no particular reason. This lead &#8211; curiously enough &#8211; to network problems. If one of the discs failed because of [...]]]></description>
			<content:encoded><![CDATA[<p>I have had some serious issues with one of my servers these last days. But finally things are starting to get back to normal. It seems /var was full due to mysql wreaking havoc for no particular reason. This lead &#8211; curiously enough &#8211; to network problems. If one of the discs failed because of these events or if it is somehow the original problem causing all this I really can&#8217;t tell&#8230;</p>
<p>Anyway, instead of quickly fixing the problem, I took the time to set up a new <a href="http://www.webhostingsearch.com/virtual-private-server.php">virtual private server</a> running <a href="http://www.zend.com/en/community/zend-server-ce">Zend Server CE</a> with PHP 5.3. It feels good to finally move to 5.3 as well as trying out Zend Server in a production environment.</p>
<p>Now if I only had time to try out the new Zend Server 5.0. I&#8217;m especially curious about the job queue management. As I&#8217;ve more or less lost two days and two nights I guess that&#8217;ll have to wait.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/&amp;title=Moving+on+to+php+5.3+and+Zend+Server+CE" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/&amp;t=Moving+on+to+php+5.3+and+Zend+Server+CE" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/&amp;title=Moving+on+to+php+5.3+and+Zend+Server+CE&amp;summary=I%20have%20had%20some%20serious%20issues%20with%20one%20of%20my%20servers%20these%20last%20days.%20But%20finally%20things%20are%20starting%20to%20get%20back%20to%20normal.%20It%20seems%20%2Fvar%20was%20full%20due%20to%20mysql%20wreaking%20havoc%20for%20no%20particular%20reason.%20This%20lead%20-%20curiously%20enough%20-%20to%20network%20problems.%20If%20one%20of%20the%20discs%20failed%20because%20of%20these%20e&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/&amp;title=Moving+on+to+php+5.3+and+Zend+Server+CE" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Moving+on+to+php+5.3+and+Zend+Server+CE+-+http://b2l.me/wt4yv&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2010/01/moving-on-to-php-53-and-zend-server-ce/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gartner report on PHP</title>
		<link>http://www.dotvoid.com/2010/01/gartner-report-on-php/</link>
		<comments>http://www.dotvoid.com/2010/01/gartner-report-on-php/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 08:23:54 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[integration]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=435</guid>
		<description><![CDATA[A new Gartner report about PHP &#8211; PHP: Past, present and Future is mentioned in the last Zend newsletter. Even though I remain somewhat sceptical towards similar reports it is good to see that even Gartner is catching up. What they say actually do have an impact.
"PHP has been a cornerstone technology on the Web [...]]]></description>
			<content:encoded><![CDATA[<p>A new Gartner report about PHP &#8211; <a href="http://blogs.gartner.com/mark_driver/2009/12/03/php-past-present-and-future/">PHP: Past, present and Future</a> is mentioned in the last Zend newsletter. Even though I remain somewhat sceptical towards similar reports it is good to see that even Gartner is catching up. What they say actually do have an impact.</p>
<pre>"PHP has been a cornerstone technology on the Web for more than a
decade. While its adoption among mainstream IT organizations has been
limited in the past, many corporate application development (AD)
projects are discovering the unique benefits of PHP."</pre>
<p>One particular advice is especially interesting for large companies.</p>
<pre>"Consider PHP as a supporting technology in a broader portfolio of AD
technologies, where it can provide a specialized toolset for building
Web graphical user interface (GUI) front ends to service-oriented
architecture (SOA) back-end services."</pre>
<p>PHP is a fantastic tool for building rich web applications. It&#8217;s extensibility makes it versatile and extremely easy to integrate with modern integration solutions as Web Methods, legacy systems or just about any database technology.</p>
<p>To me &#8211; this has always been where PHP really shines.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2010/01/gartner-report-on-php/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;title=Gartner+report+on+PHP" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;t=Gartner+report+on+PHP" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;title=Gartner+report+on+PHP&amp;summary=A%20new%20Gartner%20report%20about%20PHP%20-%20PHP%3A%20Past%2C%20present%20and%20Future%20is%20mentioned%20in%20the%20last%20Zend%20newsletter.%20Even%20though%20I%20remain%20somewhat%20sceptical%20towards%20similar%20reports%20it%20is%20good%20to%20see%20that%20even%20Gartner%20is%20catching%20up.%20What%20they%20say%20actually%20do%20have%20an%20impact.%0D%0A%22PHP%20has%20been%20a%20cornerstone%20technolo&amp;source=dotvoid.com - PHP and more" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2010/01/gartner-report-on-php/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;title=Gartner+report+on+PHP" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Gartner+report+on+PHP+-+http://b2l.me/wt2ya&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2010/01/gartner-report-on-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

