<?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>Mats Lindh</title>
	<atom:link href="http://e-mats.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://e-mats.org</link>
	<description>Where desperate is just another word for a regular day.</description>
	<lastBuildDate>Thu, 11 Mar 2010 22:00:40 +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>Unbreak My Hea.. Firefox Ctrl Click Please!</title>
		<link>http://e-mats.org/2010/03/unbreak-my-hea-firefox-ctrl-click-please/</link>
		<comments>http://e-mats.org/2010/03/unbreak-my-hea-firefox-ctrl-click-please/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 21:57:34 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ctrl click]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[stoppropagation]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=765</guid>
		<description><![CDATA[When we launched Gamer.no over a year ago, we had to come up with a wallpaper advertising solution in a rush (everything were a rush back then as we built and launched a site from scratch (after disagreements between the previous owner and Gamer) in just under four days (or 96 hours)). While this solution [...]]]></description>
			<content:encoded><![CDATA[<p>When we launched Gamer.no over a year ago, we had to come up with a wallpaper advertising solution in a rush (everything were a rush back then as we built and launched a site from scratch (after disagreements between the previous owner and Gamer) in just under four days (or 96 hours)). While this solution has worked .. good enough .. it has always had a few irky bugs that I&#8217;ve never really had the right inspiration to uncover the cause of. Usually I&#8217;ve spent an hour and decided that the time wasn&#8217;t worth it at the moment and then moved onto something else, but today! Today is a glorious day! </p>
<p>The bug has been fixed!</p>
<p>The wallpaper element is placed around the main content div, which sadly also makes the wallpaper element receive any click elements that the main content div receives. This leads to the wallpaper getting clicked and the wallpaper ad window opening regardless of where people click &#8211; which will get very, very annoying very quick. So to battle this issue the original solution was to call <code>.stopPropagation()</code> on the evt object in a click handler for the main content div. This solved the issue and everyone rejoiced! However, all was not perfect in paradise.</p>
<p>Some time later we discovered that the .stopPropagation() fix borked ctrl-click a link in Firefox. Other browsers handled it just fine, but Firefox were obviously not happy. Not happy at all. Mad and going on a killing spree it shot down the proposed fixes from both myself and other people who had a brief look at the code. It wasn&#8217;t a big issue as we only run the wallpaper code for small intervals of time and people didn&#8217;t complain (maybe we were some of the few who had the issue).</p>
<p>Today I decided to have a look at the issue again, and finally I realized that we had been way to focused on our call to <code>.stopPropagation()</code>. Everyone had been planning how we could get .stopPropagation to do what we wanted it to do &#8211; after all &#8211; the issue was that stopPropagation didn&#8217;t behave when we ctrl-clicked in Firefox. But wait.</p>
<p>If you instead think of the original problem; the window.open gets triggered when people click the inner element instead of the outer, there may be alternative solutions to using stopPropagation. And yes, THAT was quite a simple fix. Instead of trying to stop the event from bubling up through the cloud.. let&#8217;s just set a status variable that tells the code handling the wallpaper click that THIS CLICK IS NOT FOR YOU BAD HANDLER GO AWAY LET OTHER GROWNUPS HANDLE THIS. So that I did.</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1">$<span class="br0">&#40;</span>document<span class="br0">&#41;</span>.<span class="me1">ready</span><span class="br0">&#40;</span><span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; innerClick = <span class="kw2">false</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#39;#wallpaper&#39;</span><span class="br0">&#41;</span>.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>innerClick<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; innerClick = <span class="kw2">false</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; window.<span class="kw3">open</span><span class="br0">&#40;</span><span class="st0">&quot;..&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#39;#content&#39;</span><span class="br0">&#41;</span>.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span>evt<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; innerClick = <span class="kw2">true</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>As soon as I actually spent some time on what we were trying to solve instead of what seemed like the cause of the issue .. everything went better than expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/03/unbreak-my-hea-firefox-ctrl-click-please/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogging Each Day For A Month – The Results Show Redux</title>
		<link>http://e-mats.org/2010/03/blogging-each-day-for-a-month-%e2%80%93-the-results-show-redux/</link>
		<comments>http://e-mats.org/2010/03/blogging-each-day-for-a-month-%e2%80%93-the-results-show-redux/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 13:43:18 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[The Blog Itself]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[january]]></category>
		<category><![CDATA[search driven]]></category>
		<category><![CDATA[traffic]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=762</guid>
		<description><![CDATA[After I spent January posting an article each day I summed up my experiences in a post about how this had affected the traffic. As I noted back then the traffic to my blog is driven by search engines as I usually provide solutions to issues I encounter during my daily work. This means that [...]]]></description>
			<content:encoded><![CDATA[<p>After I spent January posting an article each day I summed up <a href="http://e-mats.org/2010/02/blogging-each-day-for-a-month-the-results-show/">my experiences in a post about how this had affected the traffic</a>. As I noted back then the traffic to my blog is driven by search engines as I usually provide solutions to issues I encounter during my daily work. This means that the increase in traffic will be a bit delayed until the posts gets indexed and ranked accordingly.</p>
<p>I&#8217;ve added data points for february in the table below, originally seen in the previous post.</p>
<table width="100%">
<tr>
<th></th>
<th>October</th>
<th>January</th>
<th></th>
<th>February</th>
<th></th>
</tr>
<tr>
<th>Visits</th>
<td>3 643</td>
<td>4 352</td>
<td>(+19%)</td>
<td>5 678</td>
<td>(+56%)</td>
</tr>
<tr>
<th>Pageviews</th>
<td>4 529</td>
<td>5 636</td>
<td>(+24%)</td>
<td>7 327</td>
<td>(+62%)</td>
</tr>
</table>
<p>The average time spent on the site has adjusted itself to 58 seconds (one second down from the time in January) &#8211; which is within the bias. Nothing new here.</p>
<p>Obvious conclusion: more content that solves problems people have gives an increase in traffic. Not sure if anyone didn&#8217;t see that one coming.</p>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/03/blogging-each-day-for-a-month-%e2%80%93-the-results-show-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svn: Can&#8217;t convert string from native encoding to &#8216;UTF-8&#8242;</title>
		<link>http://e-mats.org/2010/03/svn-cant-convert-string-from-native-encoding-to-utf-8/</link>
		<comments>http://e-mats.org/2010/03/svn-cant-convert-string-from-native-encoding-to-utf-8/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 12:46:12 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Version control]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=760</guid>
		<description><![CDATA[The error &#8220;svn: Can&#8217;t convert string from native encoding to &#8216;UTF-8&#8242;&#8221; suddenly made it impossible to update one of the projects on our staging servers. The project contains loads of file under SVN control, and several data directories which up to this time wasn&#8217;t svn:ignore&#8217;d. One of the files in one of these directories had [...]]]></description>
			<content:encoded><![CDATA[<p>The error &#8220;svn: Can&#8217;t convert string from native encoding to &#8216;UTF-8&#8242;&#8221; suddenly made it impossible to update one of the projects on our staging servers. The project contains loads of file under SVN control, and several data directories which up to this time wasn&#8217;t svn:ignore&#8217;d. One of the files in one of these directories had norwegian letters in ISO-8859-1 in its filename (which didn&#8217;t work in the project anyhow, as it was something left around from earlier).</p>
<p>This single file borked svn from actually being able to update or do anything useful with the actual files under SVN control. When Subversion analyzed the directory structure to check which files it should attempt to update, it would just barf before seeing any files with the error message about the file name not being in UTF-8. You&#8217;d think it would be better to ignore errors for filenames that aren&#8217;t a part of svn and that you&#8217;re not trying to add, but there&#8217;s probably a good reason for this behaviour.</p>
<p>Anyways: The solution: <strong>delete the file</strong>. We didn&#8217;t use it anyway. There&#8217;s also a good chapter in the SVN Book about localization issues which contain information about how <a href="http://svnbook.red-bean.com/en/1.2/svn.advanced.l10n.html">you can solve the issue by changing your active character set</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/03/svn-cant-convert-string-from-native-encoding-to-utf-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gnome-web-photo segfaults! OH NOES!</title>
		<link>http://e-mats.org/2010/02/gnome-web-photo-segfaults-oh-noes/</link>
		<comments>http://e-mats.org/2010/02/gnome-web-photo-segfaults-oh-noes/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 15:38:40 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[gnome-web-photo]]></category>
		<category><![CDATA[segfaults]]></category>
		<category><![CDATA[strace]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=757</guid>
		<description><![CDATA[We capture images from beautiful web pages all over the world by exposing the gnome-web-photo package through a simple web service. After moving the service to a new server today gnome-web-photo suddenly started segfaulting.
Running the application as the same user as the web server worked (after fixing the home directory so that gconf etc was [...]]]></description>
			<content:encoded><![CDATA[<p>We capture images from beautiful web pages all over the world by exposing the gnome-web-photo package through a simple web service. After moving the service to a new server today gnome-web-photo suddenly started segfaulting.</p>
<p>Running the application as the same user as the web server worked (after fixing the home directory so that gconf etc was able to create its files), but when running in the web server process itself things segfaulted. </p>
<p>The next attempt was to run both the working and non-working version through strace and see what the difference were, and apparently things segfaulted when the working process accessed &lt;home directory&gt;.mozilla/. This was the first access to anything inside the home directory of the user, which provided the solution: </p>
<p>When the process was running under the web server, the HOME environment variable was not set, but while running under the user from the shell (through su -), it was present. gnome-web-photo (or Firefox?) apparently does not feature any sort of fallback if the HOME environment variable is missing and segfaults instead.</p>
<p>Maybe that could be a patch for the weekend, but hey, the Olympic Games are on!</p>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/02/gnome-web-photo-segfaults-oh-noes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fixing dpkg / apt-get Problem With Python2.6</title>
		<link>http://e-mats.org/2010/02/fixing-dpkg-apt-get-problem-with-python2-6/</link>
		<comments>http://e-mats.org/2010/02/fixing-dpkg-apt-get-problem-with-python2-6/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 19:47:48 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dpkg]]></category>
		<category><![CDATA[python 2.6]]></category>
		<category><![CDATA[python-central]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=754</guid>
		<description><![CDATA[While trying to upgrade to Python 2.6 on one of my development machines tonight I was faced by an error message after running apt-get install python2.6:

After unpacking 0B of additional disk space will be used.
Setting up python2.6-minimal (2.6.4-4) ...
Linking and byte-compiling packages for runtime python2.6...
pycentral: pycentral rtinstall: installed runtime python2.6 not found
pycentral rtinstall: installed runtime [...]]]></description>
			<content:encoded><![CDATA[<p>While trying to upgrade to Python 2.6 on one of my development machines tonight I was faced by an error message after running <em>apt-get install python2.6</em>:</p>
<pre>
After unpacking 0B of additional disk space will be used.
Setting up python2.6-minimal (2.6.4-4) ...
Linking and byte-compiling packages for runtime python2.6...
pycentral: pycentral rtinstall: installed runtime python2.6 not found
pycentral rtinstall: installed runtime python2.6 not found
dpkg: error processing python2.6-minimal (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python2.6:
 python2.6 depends on python2.6-minimal (= 2.6.4-4); however:
  Package python2.6-minimal is not configured yet.
dpkg: error processing python2.6 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python2.6-minimal
 python2.6
E: Sub-process /usr/bin/dpkg returned an error code (1)
</pre>
<p>Attempting to install python2.6-minimal wouldn&#8217;t work, attempting to install python2.6 proved to have the same problem. </p>
<p>Luckily the <a href="https://bugs.launchpad.net/ubuntu/+source/python-central/+bug/354228">Launchpad thread for python-central</a> provided the answer: <strong>Upgrade python-central first</strong>!</p>
<pre>
:~# apt-get install python-central
[snip]
Setting up python2.6 (2.6.4-4) ...
Setting up python-central (0.6.14+nmu2) ...
:~#
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/02/fixing-dpkg-apt-get-problem-with-python2-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Issue With PHPs SoapClient Overwriting Duplicate Attribute and Tag Names</title>
		<link>http://e-mats.org/2010/02/fixing-issue-with-phps-soapclient-overwriting-duplicate-attribute-and-tag-names/</link>
		<comments>http://e-mats.org/2010/02/fixing-issue-with-phps-soapclient-overwriting-duplicate-attribute-and-tag-names/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 13:48:59 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[preg_replace]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[soapclient]]></category>
		<category><![CDATA[subclassing]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=750</guid>
		<description><![CDATA[The setting:
An SOAP request contains an Id attribute &#8211; and an element with the exact name in the response (directly beneath the element containing the attribute &#8211; an immediate child):



&#60;res z:Id=&#34;i123&#34;&#62;


&#160; &#60;Id&#62;foobar&#60;/Id&#62;


&#60;/res&#62;



The problem is that the generated result object from the SoapClient (at least of PHP 5.2.12) contains the attribute value, and not the element [...]]]></description>
			<content:encoded><![CDATA[<p>The setting:</p>
<p>An SOAP request contains an Id attribute &#8211; and an element with the exact name in the response (directly beneath the element containing the attribute &#8211; an immediate child):</p>
<div class="geshi no xml">
<ol>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;res</span> <span class="re0">z:Id</span>=<span class="st0">&quot;i123&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;Id<span class="re2">&gt;</span></span></span>foobar<span class="sc3"><span class="re1">&lt;/Id<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;/res<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
<p>The problem is that the generated result object from the SoapClient (at least of PHP 5.2.12) contains the attribute value, and not the element value. In our case we could ignore the z:Id attribute, as it was simply an Id to identify the element in the response (this might be something that ASP.NET or some other .NET component does).</p>
<p>Our solution is to subclass the internal SoapClient and handle the <em>__doRequest</em> method, stripping out the part of the request that gives the wrong value for the Id field:</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">class</span> Provider_SoapClient <span class="kw2">extends</span> SoapClient</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw2">function</span> __doRequest<span class="br0">&#40;</span><span class="re1">$request</span><span class="sy0">,</span> <span class="re1">$location</span><span class="sy0">,</span> <span class="re1">$action</span><span class="sy0">,</span> <span class="re1">$version</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$result</span> <span class="sy0">=</span> parent<span class="sy0">::</span>__doRequest<span class="br0">&#40;</span><span class="re1">$request</span><span class="sy0">,</span> <span class="re1">$location</span><span class="sy0">,</span> <span class="re1">$action</span><span class="sy0">,</span> <span class="re1">$version</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$result</span> <span class="sy0">=</span> <span class="kw3">preg_replace</span><span class="br0">&#40;</span><span class="st0">&#39;/ z:Id=&quot;i[0-9]+&quot;/&#39;</span><span class="sy0">,</span> <span class="st0">&#39;&#39;</span><span class="sy0">,</span> <span class="re1">$result</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re1">$result</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>This removes the attribute from all the values (there is no danger that the string will be present in any other of the elements. If there is &#8211; be sure to adjust the regular expression). And voilá, it works!</p>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/02/fixing-issue-with-phps-soapclient-overwriting-duplicate-attribute-and-tag-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogging Each Day For A Month &#8211; The Results Show</title>
		<link>http://e-mats.org/2010/02/blogging-each-day-for-a-month-the-results-show/</link>
		<comments>http://e-mats.org/2010/02/blogging-each-day-for-a-month-the-results-show/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 19:08:54 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[The Blog Itself]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[each day for a month]]></category>
		<category><![CDATA[pageviews]]></category>
		<category><![CDATA[the blog]]></category>
		<category><![CDATA[visitors]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=747</guid>
		<description><![CDATA[January has come to an end and in total I managed to blog each day except the 2nd and the 31st. I do not have a plan of continuing on that level, so I&#8217;ll probably slide back to the regular frequency of updates (1-2 a month) in the coming weeks. This spur of updates occured [...]]]></description>
			<content:encoded><![CDATA[<p>January has come to an end and in total I managed to blog each day except the 2nd and the 31st. I do not have a plan of continuing on that level, so I&#8217;ll probably slide back to the regular frequency of updates (1-2 a month) in the coming weeks. This spur of updates occured as I suddenly had inspiration to do five or six posts in an evening, actually making it possible to keep up the tempo for a couple of weeks. After a while things got a lot harder and I started to slide away from my regular posting time of 11am, but I got the posts out! Now it&#8217;s time to look at the stats for the previous month!</p>
<p>My blog is mainly search driven &#8211; I cover lots of one-off problems, attempting to include and descriptive error messages and other hints that people may use when they&#8217;re using Google to try to find an answer to a task they&#8217;re having problems with. This means that people don&#8217;t stay around to read other articles than the one they came here for, and so far this has meant that writing a new article usually has given me a small increment in traffic.</p>
<p>As December had the holidays &#8211; and searches for the terms I cover drop in large number during those days &#8211; I&#8217;m using the numbers from October 2009 for comparison. November is a day short.</p>
<table width="100%">
<tr>
<th></th>
<th>October</th>
<th>January</th>
</tr>
<tr>
<th>Visits</th>
<td>3 643</td>
<td>4 352</td>
<td>(+19%)</td>
</tr>
<tr>
<th>Pageviews</th>
<td>4 529</td>
<td>5 636</td>
<td>(+24%)</td>
</tr>
</table>
<p>Time spent on the site increased with 7 seconds to 59 seconds &#8211; still nothing to write home about.</p>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/02/blogging-each-day-for-a-month-the-results-show/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Avoid Escaping Spaces in the Query String in a Solr Query</title>
		<link>http://e-mats.org/2010/01/avoid-escaping-spaces-in-the-query-string-in-a-solr-query/</link>
		<comments>http://e-mats.org/2010/01/avoid-escaping-spaces-in-the-query-string-in-a-solr-query/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 22:24:14 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Solr]]></category>
		<category><![CDATA[escaping]]></category>
		<category><![CDATA[query string]]></category>
		<category><![CDATA[spaces]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=744</guid>
		<description><![CDATA[Following up on the previous post about escaping values in a Solr query string, it&#8217;s important to note that you should not escape spaces in the query itself. The reason for this is that if you escape spaces in the query &#8220;foo bar&#8221;, the search will be performed on the term &#8220;foo bar&#8221; itself, and [...]]]></description>
			<content:encoded><![CDATA[<p>Following up on <a href="http://e-mats.org/2010/01/escaping-characters-in-a-solr-query-solr-url/">the previous post about escaping values in a Solr query string</a>, it&#8217;s important to note that you should not escape spaces in the query itself. The reason for this is that if you escape spaces in the query &#8220;foo bar&#8221;, the search will be performed on the term &#8220;foo bar&#8221; itself, and not with &#8220;foo&#8221; as one term and &#8220;bar&#8221; as the other. This will only return documents that has the string &#8220;foo bar&#8221; in sequence.</p>
<p>The solution is to either remove the space from the escape list in the previous function &#8211; and use another function for escaping values where you actually should escape the spaces &#8211; or break up the string into &#8220;escapable&#8221; parts.</p>
<p>The code included beneath performs the last task; it splits the string into different parts delimited by space and then escapes each part of the query by itself.</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="re1">$queryParts</span> <span class="sy0">=</span> <span class="kw3">explode</span><span class="br0">&#40;</span><span class="st0">&#39; &#39;</span><span class="sy0">,</span> <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">getQuery</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$queryEscaped</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$queryParts</span> <span class="kw1">as</span> <span class="re1">$queryPart</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$queryEscaped</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> self<span class="sy0">::</span><span class="me2">escapeSolrValue</span><span class="br0">&#40;</span><span class="re1">$queryPart</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$queryEscaped</span> <span class="sy0">=</span> <span class="kw3">join</span><span class="br0">&#40;</span><span class="st0">&#39; &#39;</span><span class="sy0">,</span> <span class="re1">$queryEscaped</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/01/avoid-escaping-spaces-in-the-query-string-in-a-solr-query/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Simple Smarty Modifier to Generate a Chart Through Google Chart API</title>
		<link>http://e-mats.org/2010/01/a-simple-smarty-modifier-to-generate-a-chart-through-google-chart-api/</link>
		<comments>http://e-mats.org/2010/01/a-simple-smarty-modifier-to-generate-a-chart-through-google-chart-api/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 22:48:55 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[google chart]]></category>
		<category><![CDATA[google chart api]]></category>
		<category><![CDATA[smarty]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=739</guid>
		<description><![CDATA[After the longest title of my blog so far follows one of the shortest posts.
The function has two required parameters &#8211; the first one is provided automagically for you by smarty (it&#8217;s the value of the variable you&#8217;re applying the modifier to). This should be an array of objects containing the value you want to [...]]]></description>
			<content:encoded><![CDATA[<p>After the longest title of my blog so far follows one of the shortest posts.</p>
<p>The function has two required parameters &#8211; the first one is provided automagically for you by smarty (it&#8217;s the value of the variable you&#8217;re applying the modifier to). This should be an array of objects containing the value you want to graph. The only required argument you have to provide to the modifier is the method to use for fetching the values for graphing. </p>
<p>Usage:<br />
{$objects|googlechart:&#8221;getValue&#8221;}</p>
<p>This will dynamically load your plugin from the file modifier.googlechart.php in your Smarty plugins directory, or you can register the plugin manually by calling register_modifier on the template object after you&#8217;ve created it.</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> smarty_modifier_googlechart<span class="br0">&#40;</span><span class="re1">$points</span><span class="sy0">,</span> <span class="re1">$method</span><span class="sy0">,</span> <span class="re1">$size</span> <span class="sy0">=</span> <span class="st0">&quot;600&#215;200&quot;</span><span class="sy0">,</span> <span class="re1">$low</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="re1">$high</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$pointStr</span> <span class="sy0">=</span> <span class="st0">&#39;&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$maxValue</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$minValue</span> <span class="sy0">=</span> INT_MAX<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$points</span> <span class="kw1">as</span> <span class="re1">$point</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re1">$point</span><span class="sy0">-&gt;</span><span class="re1">$method</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> <span class="re1">$maxValue</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$maxValue</span> <span class="sy0">=</span> <span class="re1">$point</span><span class="sy0">-&gt;</span><span class="re1">$method</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re1">$point</span><span class="sy0">-&gt;</span><span class="re1">$method</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&lt;</span> <span class="re1">$minValue</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$minValue</span> <span class="sy0">=</span> <span class="re1">$point</span><span class="sy0">-&gt;</span><span class="re1">$method</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="kw3">empty</span><span class="br0">&#40;</span><span class="re1">$high</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$maxValue</span> <span class="sy0">=</span> <span class="re1">$high</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$scale</span> <span class="sy0">=</span> <span class="nu0">100</span> <span class="sy0">/</span> <span class="re1">$maxValue</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$points</span> <span class="kw1">as</span> <span class="re1">$point</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$pointStr</span> <span class="sy0">.=</span> <span class="br0">&#40;</span>int<span class="br0">&#41;</span> <span class="br0">&#40;</span><span class="re1">$point</span><span class="sy0">-&gt;</span><span class="re1">$method</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">*</span> <span class="re1">$scale</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st0">&#39;,&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$pointStr</span> <span class="sy0">=</span> <span class="kw3">substr</span><span class="br0">&#40;</span><span class="re1">$pointStr</span><span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="nu0">-1</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">// labels (5)</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$labels</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$steps</span> <span class="sy0">=</span> <span class="nu0">4</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$interval</span> <span class="sy0">=</span> <span class="re1">$maxValue</span> <span class="sy0">/</span> <span class="re1">$steps</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span><span class="re1">$i</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> <span class="re1">$i</span> <span class="sy0">&lt;</span> <span class="re1">$steps</span><span class="sy0">;</span> <span class="re1">$i</span><span class="sy0">++</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$labels</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#40;</span>int<span class="br0">&#41;</span> <span class="br0">&#40;</span><span class="re1">$i</span> <span class="sy0">*</span> <span class="re1">$interval</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$labels</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#40;</span>int<span class="br0">&#41;</span> <span class="re1">$maxValue</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> <span class="st0">&#39;http://chart.apis.google.com/chart?cht=lc&amp;amp;chd=t:&#39;</span> <span class="sy0">.</span> <span class="re1">$pointStr</span> <span class="sy0">.</span> <span class="st0">&#39;&amp;amp;chs=&#39;</span> <span class="sy0">.</span> <span class="re1">$size</span> <span class="sy0">.</span> <span class="st0">&#39;&amp;amp;chxt=y&amp;amp;chxl=0:|&#39;</span> <span class="sy0">.</span> <span class="kw3">join</span><span class="br0">&#40;</span><span class="st0">&#39;|&#39;</span><span class="sy0">,</span> <span class="re1">$labels</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>The function does not support the short version of the Google Chart API Just Yet &#8482; as it is an simple proof of concept hack made a few months ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/01/a-simple-smarty-modifier-to-generate-a-chart-through-google-chart-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Dismantle An Atomic HTTP Query .. String.</title>
		<link>http://e-mats.org/2010/01/how-to-dismantle-an-atomic-http-query-string/</link>
		<comments>http://e-mats.org/2010/01/how-to-dismantle-an-atomic-http-query-string/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 20:48:40 +0000</pubDate>
		<dc:creator>Mats</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Solr]]></category>
		<category><![CDATA[dots]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[http_dismantle_query]]></category>
		<category><![CDATA[POST]]></category>
		<category><![CDATA[query string]]></category>
		<category><![CDATA[underscores]]></category>

		<guid isPermaLink="false">http://e-mats.org/?p=737</guid>
		<description><![CDATA[Following up on yesterday&#8217;s gripe about PHPs (old and now useless) automagic translation of dots in GET and POST parameters to underscores, today&#8217;s edition manipulates the query string in place instead of returning it as an array.
This is useful if you have a query string you want to pass on to another service, and for [...]]]></description>
			<content:encoded><![CDATA[<p>Following up on <a href="/2010/01/getting-dots-to-work-in-php-and-get-post-cookie-variable-names/">yesterday&#8217;s gripe about PHPs (old and now useless) automagic translation of dots in GET and POST parameters to underscores</a>, today&#8217;s edition manipulates the query string in place instead of returning it as an array.</p>
<p>This is useful if you have a query string you want to pass on to another service, and for some reason the default behaviour in PHP will barf barf and barf. That might happen because of the dot translation issue or that some services (such as Solr) rely on a parameter name being repeatable (in PHP the second parameter value will overwrite the first).</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> http_dismantle_query<span class="br0">&#40;</span><span class="re1">$queryString</span><span class="sy0">,</span> <span class="re1">$remove</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$removeKeys</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">is_array</span><span class="br0">&#40;</span><span class="re1">$remove</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$remove</span> <span class="kw1">as</span> <span class="re1">$removeKey</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$removeKeys</span><span class="br0">&#91;</span><span class="re1">$removeKey</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$removeKeys</span><span class="br0">&#91;</span><span class="re1">$remove</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$resultEntries</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$segments</span> <span class="sy0">=</span> <span class="kw3">explode</span><span class="br0">&#40;</span><span class="st0">&quot;&amp;&quot;</span><span class="sy0">,</span> <span class="re1">$queryString</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$segments</span> <span class="kw1">as</span> <span class="re1">$segment</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$parts</span> <span class="sy0">=</span> <span class="kw3">explode</span><span class="br0">&#40;</span><span class="st0">&#39;=&#39;</span><span class="sy0">,</span> <span class="re1">$segment</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$key</span> <span class="sy0">=</span> <span class="kw3">urldecode</span><span class="br0">&#40;</span><span class="kw3">array_shift</span><span class="br0">&#40;</span><span class="re1">$parts</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re1">$removeKeys</span><span class="br0">&#91;</span><span class="re1">$key</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$resultEntries</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re1">$segment</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">join</span><span class="br0">&#40;</span><span class="st0">&#39;&amp;&#39;</span><span class="sy0">,</span> <span class="re1">$resultEntries</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>I&#8217;m not really sure what I&#8217;ll call the next function in this series, but there sure are loads of candidates out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://e-mats.org/2010/01/how-to-dismantle-an-atomic-http-query-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
