<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>D-talk</title>
    <link>http://blog.dynom.nl/</link>
    <description>The little things that pop into mind</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2-beta4 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Multiple PHP versions on one webserver</title>
    <link>http://blog.dynom.nl/archives/Multiple-PHP-versions-on-one-webserver_20091103_53.html</link>
            <category>Apache</category>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/Multiple-PHP-versions-on-one-webserver_20091103_53.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=53</wfw:comment>

    <slash:comments>7</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=53</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;h2&gt;Introduction&lt;/h2&gt;&lt;p&gt;This is a blog about running two PHP versions on one webserver and using multiple php.ini files, this combination can be a tricky one to tackle. But luckily one we can tackle quite easily as long as one of the PHP versions is &amp;gt;= 5.2.7. For this example I&#039;ll be using Apache, but the webserver flavor doesn&#039;t really matter. The most important part is the &quot;PHP_INI_SCAN_DIR&quot; environment variable. &lt;/p&gt;&lt;h2&gt;The why&lt;/h2&gt;&lt;p&gt;There could be a number of reasons to want what I&#039;m about to talk about. In my case I have a project where I have a legacy code-base, running on a specific PHP version, and a new code-base which will be run on 5.3. Because the new code-base will be a ongoing progress of replacing the old, it first has to run side by side with the legacy code-base. So I wanted my development image to run two PHP versions.&lt;/p&gt;&lt;p&gt;The old code-base used php.ini settings such as a include-path, error reporting, etc.&amp;#160; Which will be different from the new code-bas, and those can no-longer be set with the &#039;php_value&#039; feature of Apaches since the PHP version we&#039;ll be using for that runs as (f)CGI rather then as module.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Multiple-PHP-versions-on-one-webserver_20091103_53.html#extended&quot;&gt;Continue reading &quot;Multiple PHP versions on one webserver&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 03 Nov 2009 08:39:00 +0100</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091103_53.html</guid>
    <category>apache</category>
<category>environment variable</category>
<category>multiple versions</category>
<category>php</category>
<category>planetphp</category>

</item>
<item>
    <title>Javascript printing a popup window</title>
    <link>http://blog.dynom.nl/archives/Javascript-printing-a-popup-window_20091029_52.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.dynom.nl/archives/Javascript-printing-a-popup-window_20091029_52.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=52</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=52</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;For the impatient, a working example:&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/dynom.nl/jquery/print_popup.html&#039;);&quot;  href=&quot;http://dynom.nl/jquery/print_popup.html&quot; mce_href=&quot;http://dynom.nl/jquery/print_popup.html&quot;&gt;http://dynom.nl/jquery/print_popup.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;It seems so easy, but I had some trouble printing a popup window containing an image. Whenever I printed the page using the following code it failed.&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160;* FAIL&lt;br /&gt;&amp;#160;*/&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; printIt&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; win = window.&lt;span style=&quot;color: #000066;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;/path/to/image.jpg&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Image&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;resizable=yes,...&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;win&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;focus&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt; &lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;So I changed from opening a URL to writing a IMG tag to the opened window, which works like a charm.
&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160;* Works like a charm.&lt;br /&gt;&amp;#160;*/&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; printIt&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; win = window.&lt;span style=&quot;color: #000066;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Image&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;resizable=yes,...&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;win&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;writeln&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&amp;lt;img src=&amp;quot;/path/to/image&amp;quot; alt=&amp;quot;image&amp;quot;&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #000066;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;focus&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;And to put it in jQuery terms: &lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160;* To put it in jQuery terms:&lt;br /&gt;&amp;#160;*/&lt;/span&gt;&lt;br /&gt;Popup = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; init : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;a#action_print&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;bind&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;click&#039;&lt;/span&gt;, Popup.&lt;span style=&quot;color: #006600;&quot;&gt;printIt&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; printIt : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; win = window.&lt;span style=&quot;color: #000066;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Image&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;resizable=yes,...&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;win.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;writeln&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&amp;lt;img src=&amp;quot;&#039;&lt;/span&gt;+ $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;attr&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;href&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; +&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&amp;quot; alt=&amp;quot;image&amp;quot; /&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #000066;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;focus&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;document&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;ready&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; Popup.&lt;span style=&quot;color: #006600;&quot;&gt;init&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 29 Oct 2009 15:25:47 +0100</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091029_52.html</guid>
    
</item>
<item>
    <title>Multiple backend session storage handler</title>
    <link>http://blog.dynom.nl/archives/Multiple-backend-session-storage-handler_20091011_50.html</link>
            <category>PHP</category>
    
    <comments>http://blog.dynom.nl/archives/Multiple-backend-session-storage-handler_20091011_50.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=50</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=50</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Recently I got asked if I knew about a system that supports multiple session back-ends at once. I didn&#039;t know about one and since it&#039;s not rocket-science I decided to spent a few hours and whoop something up. &lt;/p&gt;&lt;p&gt;For the impatient, checkout: &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/github.com/Dynom/SessionHandler&#039;);&quot;  href=&quot;http://github.com/Dynom/SessionHandler&quot; title=&quot;The Session Handler lib on github.com&quot; mce_href=&quot;http://github.com/Dynom/SessionHandler&quot;&gt;http://github.com/Dynom/SessionHandler&lt;/a&gt;&lt;/p&gt;&lt;h2&gt;What does it do?&lt;/h2&gt;&lt;p&gt;It is a drop-in high-availability storage back-end for PHP sessions by offering a redundant session storage system. It&#039;s as easy as including the lib, define the drivers you want to use (e.g. Memcache and MySQL) prepare their configuration/installation and done. If you already have a MySQL server and a Memcache instance running you can set it up in about 5 minutes. It&#039;s also easy to extend and write new drivers, just extend the template class and fill in the blanks.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Multiple-backend-session-storage-handler_20091011_50.html#extended&quot;&gt;Continue reading &quot;Multiple backend session storage handler&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 11 Oct 2009 11:17:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091011_50.html</guid>
    <category>backend</category>
<category>driver</category>
<category>loadbalancing</category>
<category>php</category>
<category>session handler</category>
<category>session_set_save_handler</category>
<category>state</category>
<category>write trough</category>

</item>
<item>
    <title>Sorting of lists in jQuery</title>
    <link>http://blog.dynom.nl/archives/Sorting-of-lists-in-jQuery_20091006_49.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.dynom.nl/archives/Sorting-of-lists-in-jQuery_20091006_49.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=49</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=49</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;A while back I posted a simple sorting algorithm for number sorting, but it doesn&#039;t really do the trick for regular strings (e.g. anchors). But since I needed one recently I wrote another small and very simple sorting solution. &lt;/p&gt;&lt;p&gt;For a working example, see: &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/dynom.nl/jquery/listsort.php&#039;);&quot;  href=&quot;http://dynom.nl/jquery/listsort.php&quot; mce_href=&quot;http://dynom.nl/jquery/listsort.php&quot;&gt;http://dynom.nl/jquery/listsort.php&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;My.&lt;span style=&quot;color: #006600;&quot;&gt;List&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; Sort : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;listSelector&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; sortedElements, left, right;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// If we have any list items to sort on&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;listSelector + &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039; li&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Remove the items from the DOM&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; sortedElements = $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;listSelector + &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039; li&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;remove&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Sort, using a custom sorting and compare by anchor contents&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; sortedElements.&lt;span style=&quot;color: #006600;&quot;&gt;sort&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;a, b&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; left = $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;children&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;a&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; right = $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;b&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;children&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;a&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;left &amp;gt; right&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;right &amp;lt; left&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; -&lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Place the items back on the DOM&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;listSelector&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;sortedElements&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Again, the source should be self explanatory&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 06 Oct 2009 13:00:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091006_49.html</guid>
    <category>anchor</category>
<category>filter</category>
<category>javascript</category>
<category>jquery</category>
<category>link</category>
<category>list</category>
<category>sort</category>
<category>ul</category>

</item>
<item>
    <title>Click many, call once with jQuery</title>
    <link>http://blog.dynom.nl/archives/Click-many,-call-once-with-jQuery_20091006_48.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.dynom.nl/archives/Click-many,-call-once-with-jQuery_20091006_48.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=48</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=48</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Recently I wanted to improve they way some anchors where handled in my recent project, it works a bit like adding and removing items to/from a list. But it was possible to trick the interface by quickly clicking multiple times on a link before the AJAX request was finished, while the back-end handled this without any problems, the interface for the visitor couldn&#039;t. And since I&#039;m a neat freak and I had a few minutes to spare, I came up with the following.&lt;/p&gt;&lt;p&gt;A working example: &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/dynom.nl/jquery/clickmanycallonce.html&#039;);&quot;  href=&quot;http://dynom.nl/jquery/clickmanycallonce.html&quot; mce_href=&quot;http://dynom.nl/jquery/clickmanycallonce.html&quot;&gt;http://dynom.nl/jquery/clickmanycallonce.html&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;
&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;My.&lt;span style=&quot;color: #006600;&quot;&gt;items&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; init : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Bind the real item only once, and the dummy item permanently&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// This way the *real* item is only called once, regardless of the amount of clicks&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// And the link remains clickable but doesn&#039;t trigger the browser to follow it.&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;ul&amp;gt;li&amp;gt;a.item&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;one&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;click&#039;&lt;/span&gt;, My.&lt;span style=&quot;color: #006600;&quot;&gt;items&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;real_action&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;bind&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;click&#039;&lt;/span&gt;, My.&lt;span style=&quot;color: #006600;&quot;&gt;items&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;dummy_action&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; dummy_action : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;.&#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; real_action : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/* Fancy AJAX call, that shouldn&#039;t be executed more then once for every click */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;div#frame&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;div#frame&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;&amp;lt;br&amp;gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;Calling &#039;real_action&#039; for anchor: &quot;&lt;/span&gt; + $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// When the DOM is ready&lt;/span&gt;&lt;br /&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;document&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;ready&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Attach the filter to our input and list&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; My.&lt;span style=&quot;color: #006600;&quot;&gt;items&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;init&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;/p&gt;&lt;p&gt;While the code is fairly self explanatory and quite simple here the steps in a bit more detail:&lt;/p&gt;&lt;ol&gt;
  &lt;li&gt; Unobtrusively binding, as soon as the DOM is ready. &lt;/li&gt;
  &lt;li&gt; Binding the real action handler on &#039;click&#039; action with jQuery&#039;s  &#039;one()&#039; event handler &lt;/li&gt;
  &lt;li&gt; Binding the dummy action handler on &#039;click&#039; action with the &#039;bind()&#039; event handler &lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;This situation is probably only favorable if the item you click is removed from the DOM (or has actions re-bound after the call) else it might not be what you want.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 06 Oct 2009 12:28:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091006_48.html</guid>
    <category>ajax</category>
<category>ignoring double click</category>
<category>javascript</category>
<category>jquery</category>

</item>
<item>
    <title>The PHP Quiz series</title>
    <link>http://blog.dynom.nl/archives/The-PHP-Quiz-series_20090925_46.html</link>
            <category>PHPQuiz</category>
    
    <comments>http://blog.dynom.nl/archives/The-PHP-Quiz-series_20090925_46.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=46</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;I like solving puzzles, probably one of the reason why I like programming as much as I do. I also like finding challenges and experimenting, as such I came to the idea to start the &lt;a href=&quot;http://blog.dynom.nl/categories/PHPQuiz_12&quot; title=&quot;PHP Quizzes&quot; mce_href=&quot;/categories/PHPQuiz_12&quot;&gt;PHP Quiz series&lt;/a&gt;. They contain typical combination of PHP quirks and lesser known features of PHP.&lt;/p&gt;&lt;p&gt;The reason behind the quizzes is not to advocate bad or good coding practices, but it&#039;s intended to let you find out &lt;i&gt;the why&lt;/i&gt; in all of it. I believe that by understanding what happens it can make you a better programmer and you might spot bugs easier then without knowing what happens. &lt;/p&gt;&lt;p&gt;The series are not ordered in level of difficulty but merely in the order that I found out about them,  thought about them or where simply sent in. But in general I think it&#039;s safe to say that your knowledge of PHP should be quite a leap forward from novice before you can answer most questions. This however doesn&#039;t mean that, once you can do the quizzes flawlessly, that you are a superior programmer. There is a big different between knowing how to design an application and knowing why &lt;i&gt;$array = array(1,1) + array(2,2)&lt;/i&gt; only results in an array with two elements.&lt;/p&gt;&lt;p&gt;An overview of all the PHP Quizzes: &lt;a href=&quot;http://blog.dynom.nl/categories/PHPQuiz_12&quot; mce_href=&quot;/categories/PHPQuiz_12&quot;&gt;http://blog.dynom.nl/categories/PHPQuiz_12&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;A special thanks to the people who sent in  code samples, happy quizzing!&lt;/p&gt;&lt;p&gt;-D&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 25 Sep 2009 07:23:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090925_46.html</guid>
    <category>php quiz</category>
<category>phpquiz</category>

</item>
<item>
    <title>PHP Quiz part 3</title>
    <link>http://blog.dynom.nl/archives/PHP-Quiz-part-3_20090921_37.html</link>
            <category>PHP</category>
            <category>PHPQuiz</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/PHP-Quiz-part-3_20090921_37.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=37</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Welcome to another part of the PHP Quiz series, again some interesting questions to crack your brain about. If you have some nice additions or questions, be sure to leave a comment. Enjoy part three!&lt;/p&gt;&lt;p&gt;As always, think of the answer before you execute the code or look it up. You can find round two &lt;a href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-2_20090514_27.html&quot; mce_href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-2_20090514_27.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;h3&gt;Unset cast&lt;/h3&gt;&lt;p&gt;What is the type of $a and what is the type of $b&lt;br /&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;A&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/unset&#039;);&quot;  href=&quot;http://www.php.net/unset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;unset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/var_dump&#039;);&quot;  href=&quot;http://www.php.net/var_dump&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;var_dump&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;, &lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;/div&gt;
&lt;/p&gt;&lt;h3&gt;Form fun&lt;/h3&gt;&lt;p&gt;What will the output be?&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&amp;lt;form method=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;post&quot;&lt;/span&gt; action=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&quot;&lt;/span&gt; enctype=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;lt;input name=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;search&quot;&lt;/span&gt; type=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;text&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;lt;input type=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;submit&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/error_reporting&#039;);&quot;  href=&quot;http://www.php.net/error_reporting&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;error_reporting&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;E_ALL&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;string&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; filter_input&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;INPUT_POST, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;search&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
&lt;/p&gt;&lt;h3&gt;Fun with strings&lt;/h3&gt;&lt;p&gt;Strings in PHP are versatile, but how versatile are they... What will the output be?&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$juggling&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Itffkhmf&quot;&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$rox&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Spy&quot;&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt; = &lt;span style=&quot;color: #ff0000&quot;&gt;$c&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&quot;&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;=&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;&amp;lt;strlen&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$juggling&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;++&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt; .= &lt;span style=&quot;color: #ff0000&quot;&gt;$juggling&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt;++;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;=&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;&amp;lt;strlen&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$rox&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;++&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$c&lt;/span&gt; .= &lt;span style=&quot;color: #ff0000&quot;&gt;$rox&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$c&lt;/span&gt;--; &lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/var_dump&#039;);&quot;  href=&quot;http://www.php.net/var_dump&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;var_dump&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt;, &lt;span style=&quot;color: #ff0000&quot;&gt;$c&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-3_20090921_37.html#extended&quot;&gt;Continue reading &quot;PHP Quiz part 3&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 21 Sep 2009 17:35:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090921_37.html</guid>
    <category>form</category>
<category>php</category>
<category>php quiz</category>
<category>phpquiz</category>
<category>planetphp</category>
<category>precedence</category>
<category>references</category>
<category>string</category>
<category>unset cast</category>

</item>
<item>
    <title>New airfilters and map update</title>
    <link>http://blog.dynom.nl/archives/New-airfilters-and-map-update_20090830_44.html</link>
            <category>Motorbike</category>
    
    <comments>http://blog.dynom.nl/archives/New-airfilters-and-map-update_20090830_44.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=44</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=44</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Last Saturday I went for new air filters and a new (injection) mapping. I was planning to get that done anyway, but then I decided to update my blade with two K&amp;amp;N filters also. Slightly more performance and little to no more maintenance needed in the future regarding that area. (And honestly, while the filters are much more accessible then at my previous bike. It&#039;s still not the most fun part to clean.) After approx. 2 hours they finished tuning and she took one more run on the Dynojet. A total of 165 bhp on the rear wheel and (the most valuable part) a much faster throttle response and better power outtake.&lt;/p&gt;&lt;p&gt;It was costly for something that seems minor, but as soon as I drove off and noticed the difference it was all worth it! &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 30 Aug 2009 23:06:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090830_44.html</guid>
    
</item>
<item>
    <title>The way a developer community works</title>
    <link>http://blog.dynom.nl/archives/The-way-a-developer-community-works_20090805_43.html</link>
            <category>Social</category>
    
    <comments>http://blog.dynom.nl/archives/The-way-a-developer-community-works_20090805_43.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=43</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=43</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;I was watching the talk &quot;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/oscon.blip.tv/file/2400597/&#039;);&quot;  href=&quot;http://oscon.blip.tv/file/2400597/&quot; title=&quot;Standing out in the crowd, Kirrily Robert.&quot; mce_href=&quot;http://oscon.blip.tv/file/2400597/&quot;&gt;Standing out in the crowd&lt;/a&gt;&quot; by speaker &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/infotrope.net/&#039;);&quot;  href=&quot;http://infotrope.net/&quot; title=&quot;Kirrily &amp;quot;Skud&amp;quot; Robert&quot; mce_href=&quot;http://infotrope.net/&quot;&gt;Kirrily Robert&lt;/a&gt; at &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/infotrope.net/blog/2009/07/25/standing-out-in-the-crowd-my-oscon-keynote/&#039;);&quot;  href=&quot;http://infotrope.net/blog/2009/07/25/standing-out-in-the-crowd-my-oscon-keynote/&quot; title=&quot;Details about the talk on OSCON&quot; mce_href=&quot;http://infotrope.net/blog/2009/07/25/standing-out-in-the-crowd-my-oscon-keynote/&quot;&gt;OSCON 09&lt;/a&gt;. And tweeted about this (&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/twitter.com/Dynom/statuses/3142970947/&#039;);&quot;  href=&quot;http://twitter.com/Dynom/statuses/3142970947/&quot; title=&quot;Twitter response to the Standing out in the crowd video report&quot; mce_href=&quot;http://twitter.com/Dynom/statuses/3142970947/&quot;&gt;http://twitter.com/Dynom/statuses/3142970947/&lt;/a&gt;) and when I read it back it got me thinking. And I decided to blog about it.&lt;/p&gt;&lt;p&gt;Much of what Skud (Kirrily) says is without a doubt true, but doesn&#039;t apply sole to women. It&#039;s generally the way it &quot;works&quot; in the open source world and between developers in general. There is a certain attitude that is simply there, not just between language fanbois but also between developers in general. Your sexual orientation, sex, hair color or religion has nothing to do with that. Partially I think the attitude is there to improve yourself, at least that&#039;s how it works for me. You try to be as good as the one you think is better then you are. &lt;/p&gt;&lt;p&gt;In a lot of communities, you don&#039;t explicitly mention your gender. You simply join a community (subscribe to a form or e-mail list) and you start posting/reading etc. And unless your nick is &#039;Girlygirl99&#039; it&#039;s not too obvious in name also, so I wonder how people treat anyone based on their online identity. Feel free to prove me wrong on that, it&#039;s not that I don&#039;t believe it, I simply have never seen discrimination towards sex or sexual orientation in any community I&#039;ve been in. &lt;/p&gt;&lt;p&gt;And maybe it differs a lot per community, I&#039;m involved in the PHP community and from what I hear it has a small percentage PHP developers that are female, and they even have their own &quot;support site&quot; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/PHPWomen.org&#039;);&quot;  href=&quot;http://PHPWomen.org&quot; title=&quot;PHP women&quot; mce_href=&quot;http://PHPWomen.org&quot;&gt;PHPWomen.org&lt;/a&gt;. And they seem to do pretty well.&lt;/p&gt;&lt;p&gt;As Skud quotes in her talk, some projects have a &quot;diversity statement&quot;. I think it&#039;s nonsense to mention it at any community/project. It should only be mentioned  if it doesn&#039;t say &quot;everyone&quot;. If you want to be part of a community, simply step in. Order a beer, listen and join the conversation. If you lack the assertive skills to do that, it&#039;s not something the community can do about. It&#039;s something you need to improve on. If a community helps beginners, well that is a (big) plus. &lt;/p&gt;&lt;p&gt;Personally I don&#039;t care what you are, as long as you aren&#039;t (secretly) part of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/en.wikipedia.org/wiki/Skynet_%28Terminator%29&#039;);&quot;  href=&quot;http://en.wikipedia.org/wiki/Skynet_%28Terminator%29&quot; mce_href=&quot;http://en.wikipedia.org/wiki/Skynet_(Terminator)&quot;&gt;Skynet&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Comments are more then welcome. &lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 05 Aug 2009 13:00:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090805_43.html</guid>
    
</item>
<item>
    <title>Taking her for a dyno run</title>
    <link>http://blog.dynom.nl/archives/Taking-her-for-a-dyno-run_20090712_42.html</link>
            <category>Motorbike</category>
    
    <comments>http://blog.dynom.nl/archives/Taking-her-for-a-dyno-run_20090712_42.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=42</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=42</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Yesterday I took my new bike for a spin on a Dynojet. I did this for a number of reasons, since I didn&#039;t bought the bike from a dealer I didn&#039;t know for sure if the bike was in perfect shape, and also I wanted to know how much *real* BHP it has, since the bike is slightly tuned (&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.powercommander.com&#039;);&quot;  href=&quot;http://www.powercommander.com&quot; title=&quot;Power commander website&quot; mce_href=&quot;http://www.powercommander.com&quot;&gt;Power commander&lt;/a&gt; and &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.termignoni.it/&#039;);&quot;  href=&quot;http://www.termignoni.it/&quot; title=&quot;Termignoni website&quot; mce_href=&quot;http://www.termignoni.it/&quot;&gt;Termignoni&lt;/a&gt; exhaust), which is definitely not stock.&lt;/p&gt;&lt;p&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.flickr.com/photos/dynom/3710836154/in/set-72157620847836023/&#039;);&quot;  href=&quot;http://www.flickr.com/photos/dynom/3710836154/in/set-72157620847836023/&quot; title=&quot;Link to part of the movie of the run&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2592/3710250551_7e06be754c.jpg&quot; mce_src=&quot;http://farm3.static.flickr.com/2592/3710250551_7e06be754c.jpg&quot; alt=&quot;All set, warming up&quot; align=&quot;&quot; border=&quot;0&quot; height=&quot;375&quot; hspace=&quot;&quot; vspace=&quot;&quot; width=&quot;500&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The score was excellent, according to the readout my blade has 161BHP on the wheel (which is proximately 10% less then on the crankshaft, which is mostly used to indicate the power) and performs really nice, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.flickr.com/photos/dynom/3712877660/&#039;);&quot;  href=&quot;http://www.flickr.com/photos/dynom/3712877660/&quot; title=&quot;The graph of the first dynojet run&quot; mce_href=&quot;http://www.flickr.com/photos/dynom/3712877660/&quot;&gt;the graph&lt;/a&gt; shows a near linear output of power, no dips anywhere along the way which is simply near ideal. However there is some misconfiguration between 4k-6k rpm, the fuel maps are not rich enough, which is something that needs correcting! So I&#039;ll make an appointment for a followup meeting with the tune company to create a custom map for my bike.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 12 Jul 2009 14:29:34 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090712_42.html</guid>
    
</item>
<item>
    <title>A new love, black beauty</title>
    <link>http://blog.dynom.nl/archives/A-new-love,-black-beauty_20090704_41.html</link>
            <category>Motorbike</category>
    
    <comments>http://blog.dynom.nl/archives/A-new-love,-black-beauty_20090704_41.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=41</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=41</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Ever since Honda announced the 2007 1000rr model, better known as the &quot;Fireblade&quot;, I fell in love with it. The black color set, the black suspension, the seat pipe exhaust, the aggressive looks and the power makes it a perfect bike. I recently had the possibilities to buy one and after searching for the right bike for about a year, I finally found it. Or, rather: found her!&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;
&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.flickr.com/photos/dynom/3711103386/&#039;);&quot;  href=&quot;http://www.flickr.com/photos/dynom/3711103386/&quot; mce_href=&quot;http://www.flickr.com/photos/dynom/3711103386/&quot; title=&quot;On it&#039;s stand by Dynom, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2526/3711103386_af2a5dde2e.jpg&quot; mce_src=&quot;http://farm3.static.flickr.com/2526/3711103386_af2a5dde2e.jpg&quot; alt=&quot;On it&#039;s stand&quot; align=&quot;&quot; border=&quot;0&quot; height=&quot;375&quot; hspace=&quot;&quot; vspace=&quot;&quot; width=&quot;500&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.flickr.com/photos/dynom/3710294009/&#039;);&quot;  href=&quot;http://www.flickr.com/photos/dynom/3710294009/&quot; title=&quot;Portrait by Dynom, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2422/3710294009_44bef9f070.jpg&quot; mce_src=&quot;http://farm3.static.flickr.com/2422/3710294009_44bef9f070.jpg&quot; alt=&quot;Portrait&quot; align=&quot;&quot; border=&quot;0&quot; height=&quot;375&quot; hspace=&quot;&quot; vspace=&quot;&quot; width=&quot;500&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.flickr.com/photos/dynom/3711102358/&#039;);&quot;  href=&quot;http://www.flickr.com/photos/dynom/3711102358/&quot; title=&quot;Exhaust closeup by Dynom, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2507/3711102358_2930f3bd13.jpg&quot; mce_src=&quot;http://farm3.static.flickr.com/2507/3711102358_2930f3bd13.jpg&quot; alt=&quot;Exhaust closeup&quot; align=&quot;&quot; border=&quot;0&quot; height=&quot;375&quot; hspace=&quot;&quot; vspace=&quot;&quot; width=&quot;500&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;table border=&quot;0&quot; width=&quot;300&quot;&gt;&lt;caption&gt;A few statistics for a stock blade&lt;/caption&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Stock BHP/PK&lt;/td&gt;&lt;td&gt;158.8 (&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/en.wikipedia.org/wiki/Horsepower#Effective_.28true.2C_wheel.29_hp&#039;);&quot;  href=&quot;http://en.wikipedia.org/wiki/Horsepower#Effective_.28true.2C_wheel.29_hp&quot; title=&quot;Explanation between the differences of wheel vs crankshaft bhp&quot; mce_href=&quot;http://en.wikipedia.org/wiki/Horsepower#Effective_.28true.2C_wheel.29_hp&quot;&gt;crankshaft&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Stock Weight (&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/en.wikipedia.org/wiki/Wet_weight_%28motorcycle%29&#039;);&quot;  href=&quot;http://en.wikipedia.org/wiki/Wet_weight_%28motorcycle%29&quot; title=&quot;Wiki explanation of &#039;wet weight&#039;&quot; mce_href=&quot;http://en.wikipedia.org/wiki/Wet_weight_(motorcycle)&quot;&gt;wet&lt;/a&gt;)&lt;/td&gt;&lt;td&gt;205Kg&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Max RPM&lt;/td&gt;&lt;td&gt;12.200 rpm&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt; 
    </content:encoded>

    <pubDate>Sat, 04 Jul 2009 13:37:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090704_41.html</guid>
    
</item>
<item>
    <title>Did you know... part two</title>
    <link>http://blog.dynom.nl/archives/Did-you-know...-part-two_20090625_32.html</link>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/Did-you-know...-part-two_20090625_32.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=32</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=32</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;In these blog series I&#039;d like to talk a bit about some &quot;Did you knows&quot;. These series contain information I came across along the way and I mention them here to give you insight or just to make you aware of it&#039;s existence. The information is by no means in chronological order and mostly not even covering &quot;state of the art&quot; or &quot;brand new&quot; items for that matter. Some are directly code related, others are just brief descriptions. Basically it&#039;s just a pile of PHP and web related information. You can find part one &lt;a href=&quot;http://blog.dynom.nl/archives/Did-you-know...-part-one_20081111_31.html&quot; title=&quot;Did you know... part one&quot; mce_href=&quot;/archives/Did-you-know...-part-one_20081111_31.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Did-you-know...-part-two_20090625_32.html#extended&quot;&gt;Continue reading &quot;Did you know... part two&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 25 Jun 2009 19:14:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090625_32.html</guid>
    <category>did you know</category>
<category>max</category>
<category>min</category>
<category>php</category>
<category>planetphp</category>
<category>references</category>
<category>sscanf</category>
<category>strtok</category>

</item>
<item>
    <title>Apache's fail with 'encoded slashes'</title>
    <link>http://blog.dynom.nl/archives/Apaches-fail-with-encoded-slashes_20090625_40.html</link>
            <category>Apache</category>
    
    <comments>http://blog.dynom.nl/archives/Apaches-fail-with-encoded-slashes_20090625_40.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=40</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=40</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Honestly it took me a while to debug a vague bug I had, at first I ignored it and used different path values, figuring it was a bad rewrite rule. I&#039;m using a project and I&#039;m developing on both Apache and IIS, with the one inconsistency that I always got a 404 when the path contained a encoded /, namely &quot;%2F&quot;. So basically, a URL like this: http://domain.com/show/article/104671-Situation%20details%20n%2Fa (Title being: &quot;Situation details n/a&quot;) is giving a 404. The error log was helpful, because it said:&lt;/p&gt;&lt;p&gt;&lt;code&gt;[..] [info] [client 127.0.0.1] found %2f (encoded &#039;/&#039;) in URI (decoded=&#039;//&#039;), returning 404 &lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Luckily, fixing this &lt;s&gt;bug&lt;/s&gt; feature is easy. Add the following to your httpd.conf (vhost or server directive) and voila:&lt;/p&gt;&lt;p&gt;
&lt;code&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes&#039;);&quot;  href=&quot;http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes&quot; mce_href=&quot;http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes&quot;&gt;AllowEncodedSlashes&lt;/a&gt; On&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Arguably you could be saying that %2F&#039;s simply shouldn&#039;t be in the path, but rather in the POST body or as GET parameter. However in a world where everything has to be SEO and url&#039;s have to be pretty, isn&#039;t this silly default behavior ? Especially since the RFC&#039;s also clearly state that an encoded forward slash (%2F) should not be treated as a regular &#039;/&#039;. To quote &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.faqs.org/rfcs/rfc2616.html&#039;);&quot;  href=&quot;http://www.faqs.org/rfcs/rfc2616.html&quot; mce_href=&quot;http://www.faqs.org/rfcs/rfc2616.html&quot;&gt;RFC 2616&lt;/a&gt;&amp;#160;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.faqs.org/rfcs/rfc2396.html&#039;);&quot;  href=&quot;http://www.faqs.org/rfcs/rfc2396.html&quot; mce_href=&quot;http://www.faqs.org/rfcs/rfc2396.html&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;pre&gt;Characters other than those in the &quot;reserved&quot; and &quot;unsafe&quot; sets (see RFC 2396 [42]) are equivalent to their &quot;&quot;%&quot; HEX HEX&quot; encoding.&lt;/pre&gt;&lt;p&gt;and &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.faqs.org/rfcs/rfc2396.html&#039;);&quot;  href=&quot;http://www.faqs.org/rfcs/rfc2396.html&quot; mce_href=&quot;http://www.faqs.org/rfcs/rfc2396.html&quot;&gt;RFC 2396&lt;/a&gt;&lt;/p&gt;&lt;pre&gt;2.2. Reserved Characters&lt;br /&gt;&lt;br /&gt;   Many URI include components consisting of or delimited by, certain&lt;br /&gt;   special characters.  These characters are called &quot;reserved&quot;, since&lt;br /&gt;   their usage within the URI component is limited to their reserved&lt;br /&gt;   purpose.  If the data for a URI component would conflict with the&lt;br /&gt;   reserved purpose, then the conflicting data must be escaped before&lt;br /&gt;   forming the URI.&lt;br /&gt;&lt;br /&gt;      reserved    = &quot;;&quot; | &quot;/&quot; | &quot;?&quot; | &quot;:&quot; | &quot;@&quot; | &quot;&amp;amp;&quot; | &quot;=&quot; | &quot;+&quot; |&lt;br /&gt;                    &quot;$&quot; | &quot;,&quot;&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Thu, 25 Jun 2009 14:58:45 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090625_40.html</guid>
    <category>%2f</category>
<category>apache</category>
<category>encoded</category>
<category>fail</category>
<category>slashes</category>

</item>
<item>
    <title>jQuery simple unordered list filter</title>
    <link>http://blog.dynom.nl/archives/jQuery-simple-unordered-list-filter_20090624_39.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.dynom.nl/archives/jQuery-simple-unordered-list-filter_20090624_39.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=39</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;I needed a simple filter system on a unordered list. The goal is to filter &#039;realtime&#039; based on what a user is typing. I came up with the following, if you have any suggestions and/or performance tips feel free to drop a line!&lt;/p&gt;
&lt;h2&gt;The HTML:&lt;/h2&gt;&lt;p&gt;The blog software is messing with the HTML, for a working example with ungarbled code. Look at the bottom of this post.&lt;/p&gt;&lt;p&gt;
&lt;div style=&quot;text-align: left&quot;&gt;&amp;lt;/p&amp;gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;input name=&amp;quot;filter&amp;quot; id=&amp;quot;search_filter&amp;quot; type=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&amp;lt;div id=&amp;quot;titles&amp;quot;&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;ul&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;http://blog.dynom.nl/path/to/item/1&amp;quot;&amp;gt;Item 1&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;http://blog.dynom.nl/path/to/item/2&amp;quot;&amp;gt;Item 2&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;http://blog.dynom.nl/path/to/item/3&amp;quot;&amp;gt;Item 3&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;lt;/ul&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;h2&gt;The Javascript&lt;/h2&gt;&lt;p&gt;&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; My = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160;&lt;br /&gt;My.&lt;span style=&quot;color: #006600;&quot;&gt;List&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; Filter : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;inputSelector, listSelector&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Sanity check&amp;#160; &lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; inp, rgx = &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;new&lt;/span&gt; RegExp&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, titles = $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;listSelector&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, keys;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;titles.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt; === &lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// The list with keys to skip (esc, arrows, return, etc)&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// 8 is backspace, you might want to remove that for better usability&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; keys = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #CC0000;&quot;&gt;13&lt;/span&gt;, &lt;span style=&quot;color: #CC0000;&quot;&gt;27&lt;/span&gt;, &lt;span style=&quot;color: #CC0000;&quot;&gt;32&lt;/span&gt;, &lt;span style=&quot;color: #CC0000;&quot;&gt;37&lt;/span&gt;, &lt;span style=&quot;color: #CC0000;&quot;&gt;38&lt;/span&gt;, &lt;span style=&quot;color: #CC0000;&quot;&gt;39&lt;/span&gt;, &lt;span style=&quot;color: #CC0000;&quot;&gt;40&lt;/span&gt;, &lt;span style=&quot;color: #CC0000;&quot;&gt;8&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// binding keyup to the unordered list&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;inputSelector&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;bind&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;keyup&#039;&lt;/span&gt;, &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;jQuery.&lt;span style=&quot;color: #006600;&quot;&gt;inArray&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;e.&lt;span style=&quot;color: #006600;&quot;&gt;keyCode&lt;/span&gt;, keys&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &amp;gt;= &lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Building the regex from our user input, &#039;inp&#039; should be escaped&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; inp = $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;attr&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;value&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; rgx.&lt;span style=&quot;color: #006600;&quot;&gt;compile&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;inp, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;im&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; titles.&lt;span style=&quot;color: #006600;&quot;&gt;each&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;rgx.&lt;span style=&quot;color: #006600;&quot;&gt;source&lt;/span&gt; !== &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&#039;&lt;/span&gt; &amp;amp;&amp;amp; !rgx.&lt;span style=&quot;color: #006600;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;parent&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;li&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;hide&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;parent&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;li&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// When the DOM is ready&lt;/span&gt;&lt;br /&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;document&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;ready&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Attach the filter to our input and list&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; My.&lt;span style=&quot;color: #006600;&quot;&gt;List&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;Filter&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;input#search_filter&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;#titles&amp;gt;ul&amp;gt;li&amp;gt;a&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/p&gt;
&lt;h2&gt;Working example&lt;/h2&gt;&lt;p&gt;Visit &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/dynom.nl/jquery/list.php&#039;);&quot;  href=&quot;http://dynom.nl/jquery/list.php&quot; title=&quot;Working example&quot; mce_href=&quot;http://dynom.nl/jquery/list.php&quot;&gt;http://dynom.nl/jquery/list.php&lt;/a&gt; for a working example. &lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 24 Jun 2009 15:50:21 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090624_39.html</guid>
    <category>each</category>
<category>filter</category>
<category>inarray</category>
<category>javascript</category>
<category>jquery</category>
<category>list</category>
<category>parent</category>
<category>regexp</category>

</item>
<item>
    <title>Javascript cookie helper class</title>
    <link>http://blog.dynom.nl/archives/Javascript-cookie-helper-class_20090526_38.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.dynom.nl/archives/Javascript-cookie-helper-class_20090526_38.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=38</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=38</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Little original perhaps, but I thought I&#039;d share this cookie class. It makes my life a little easier, &lt;/p&gt;&lt;p&gt;&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;My.&lt;span style=&quot;color: #006600;&quot;&gt;Cookie&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * Set a cookie&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * @param {string} n name&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * @param {scalar} v value&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * @param {int} days&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; */&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; set: &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;n, v, days&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; e = &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&#039;&lt;/span&gt;, d;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;days&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; d = &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;new&lt;/span&gt; Date&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; d.&lt;span style=&quot;color: #006600;&quot;&gt;setTime&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;d.&lt;span style=&quot;color: #006600;&quot;&gt;getTime&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;days * &lt;span style=&quot;color: #CC0000;&quot;&gt;86400000&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; e = &lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;; expires=&quot;&lt;/span&gt; + d.&lt;span style=&quot;color: #006600;&quot;&gt;toGMTString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; document.&lt;span style=&quot;color: #006600;&quot;&gt;cookie&lt;/span&gt; = n + &lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;=&quot;&lt;/span&gt; + v + e + &lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;; path=/&quot;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * get a cookie&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * @param {string} n name&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; get: &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;n&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; match = n + &lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;=&quot;&lt;/span&gt;, c = &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&#039;&lt;/span&gt;, ca = document.&lt;span style=&quot;color: #006600;&quot;&gt;cookie&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;split&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;;&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, i;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;i = &lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;; i &amp;lt; ca.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt;, c=ca&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; i++&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;c.&lt;span style=&quot;color: #006600;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;match&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; === &lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; c.&lt;span style=&quot;color: #006600;&quot;&gt;substring&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;match.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt;, c.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * Delete a cookie&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * @param {string} n name&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; del: &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;n&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;n, &lt;span style=&quot;color: #3366CC;&quot;&gt;&quot;&quot;&lt;/span&gt;, -&lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 26 May 2009 12:00:10 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090526_38.html</guid>
    <category>class</category>
<category>cookie</category>
<category>javascript</category>

</item>

</channel>
</rss>