<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/blogs/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://www.php-groupies.de/blogs/feeds/atom10.xml" rel="self" title="PHP, the universe and all the rest" type="application/atom+xml" />
    <link href="http://www.php-groupies.de/blogs/"                        rel="alternate"    title="PHP, the universe and all the rest" type="text/html" />
    <link href="http://www.php-groupies.de/blogs/rss.php?version=2.0"     rel="alternate"    title="PHP, the universe and all the rest" type="application/rss+xml" />
    <title type="html">PHP, the universe and all the rest</title>
    <subtitle type="html">PHP Groupie since 1999 </subtitle>
    <icon>http://www.php-groupies.de/blogs/templates/default/img/s9y_banner_small.png</icon>
    <id>http://www.php-groupies.de/blogs/</id>
    <updated>2011-10-13T07:13:17Z</updated>
    <generator uri="http://www.s9y.org/" version="1.0.3">Serendipity 1.0.3 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>

    <entry>
        <link href="http://www.php-groupies.de/blogs/archives/41-PHPreboot-braindump.html" rel="alternate" title="PHPreboot braindump" />
        <author>
            <name>Hartmut Holzgraefe</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2011-10-10T15:22:12Z</published>
        <updated>2011-10-13T07:13:17Z</updated>
        <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=41</wfw:comment>
    
        <slash:comments>6</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=atom1.0&amp;type=comments&amp;cid=41</wfw:commentRss>
    
            <category scheme="http://www.php-groupies.de/blogs/categories/1-PHP" label="PHP" term="PHP" />
    
        <id>http://www.php-groupies.de/blogs/archives/41-guid.html</id>
        <title type="html">PHPreboot braindump</title>
        <content type="xhtml" xml:base="http://www.php-groupies.de/blogs/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Looks as if we have the next member in the &quot;I want to become Caliph instead of the Caliph&quot; club: <a href="http://code.google.com/p/phpreboot/" onclick="window.open(this.href, '_blank'); return false;">PHPreboot</a></p>

<p>This is just a braindump of thoughts on the various bullet points and examples on the projects home page (but i don't think it's worth any more time to analyze it and comment on it either):</p>


<ul>
    <li><b>less $, less ';' like in javascript</b></li>
</ul>

<p>Not sure whether this is really an improvement, while $ and ; are not really necessary from a parsers (or lazy typers) point of view they <b>do</b> carry some context information ... so this is breaking the &quot;The burden shall be on the writer, not the readers&quot; principle IMHO</p>


<ul>
    <li><b>secure by default: no eval, no magic quotes/string interpolation</b></li>
</ul>

<p>Yes, that's all that needs to be disabled to guarantee secure code ... NOT</p>

<p>Magic quotes were a bad idea, but for slightly different reasons. eval() by itself is not a bad idea either if used properly, same as with backticks, system(), popen(), ...</p>

<p>And just by disabling magic quotes and eval() you do not make code secure by default, XSS and SQL injections can still happen without these, and i'd bet that most malicious code injections in vulnerable PHP apps were not using eval() but include/require as attack vector to make PHP execute their own code ... want to forbid these, too?</p>


<ul>
    <li><b>full unicode support</b> </li>
</ul>

<p>That's a good thing, we may just have different ideas of &quot;full&quot; ...</p>


<ul>
    <li><b>no from/to string auto-conversion</b></li>
</ul>

<p>I do like the &quot;to&quot; part of it ... not really sure about the &quot;from&quot; part ...</p>


<ul>
    <li><b>a SQL compatible syntax</b></li>
</ul>

<p>Which SQL dialect? And looking at the code: how would i handle queries against multiple database connections?</p>


<ul>
    <li><b>Perl 5 regex literal</b></li>
</ul>

<p>I personally prefer to write preg_match() literally ... but that may be just me and my PERL allergy ...</p>


<ul>
    <li><b>URI/file literal</b></li>
</ul>

<p>I don't see that much gain in that one over explicit fopen(), ... calls either</p>


<ul>
    <li><b>fast as Java thanks to a runtime profiler/optimizer and JSR 292 API</b></li>
</ul>

<p>There's room for improvement in PHP optimizers and op code caches for sure ...</p>

<p>In my personal use cases a JVM based PHP would actually be a loss though. Most stuff i'm using PHP for these days is medium complex command line stuff (like my code generators), and for most of this my PHP scripts are already done with their job in a time that would not even be sufficient for a JVM to initialize and execute the very first byte code op of my user code</p>

<p>There's also the more general issue that when going the way of the JVM you either go bytecode all the way and have to say goodbye to all the PHP extensions that are actually just thin wrappers around native C libraries, re-implement those libraries functionality in a language supported by the JVM or go the way of JNI ...</p>


<ul>
    <li><b>provide an embedded database derby and a standalone web server grizzly by default</b></li>
</ul>

<p>... instead of SQLite and ?forgot-the-name-of-the-upcoming-integrated-webserver-thingy? ...?</p>


<ul>
    <li><b>native XML syntax</b></li>
</ul>

<p>Sorry, can't see how that's &quot;native XML syntax&quot;, PHP and its use of XML processing instruction syntax is as native as you can get, hiding executable code in DATA not so much</p>


<ul>
    <li><b>Language as close as possible to PHP</b></li>
</ul>

<p>Sorry but even that simple example does not really look like PHP to me as all. Maybe part of that is due to the use of &quot;elseif&quot; instead of &quot;else if&quot;. I haven't seen any PHP code using &quot;elseif&quot; in years, i even had to double check that it works in this context and not just in the IF: ... ELSEIF: ... ENDIF; form.</p>


<ul>
    <li><b>native XQuery</b> </li>
</ul>

<p>Again i'm not sure whether i want to have that on the Syntax level ...</p>


<ul>
    <li>[...]</li>
</ul>

<p>So to summarize:</p>


<ul>
    <li>the language does hardly look like PHP anymore (actually looks more like a PERL/Python chimera to me personally)</li>
    <li>the language will not be backwards compatible to PHP syntax wise (afaict)</li>
    <li>the language will not have many of the functionality that PHP gets from native C libraries</li>
</ul>

<p>=&gt; so why should it have the letters PHP in its name at all?</p>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.php-groupies.de/blogs/archives/40-Overriding-bind...-in-included-MySQL-option-files.html" rel="alternate" title="Overriding bind=... in included MySQL option files" />
        <author>
            <name>Hartmut Holzgraefe</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2011-10-04T06:29:10Z</published>
        <updated>2011-10-04T06:29:10Z</updated>
        <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=40</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=atom1.0&amp;type=comments&amp;cid=40</wfw:commentRss>
    
            <category scheme="http://www.php-groupies.de/blogs/categories/2-MySQL" label="MySQL" term="MySQL" />
            <category scheme="http://www.php-groupies.de/blogs/categories/10-Puppet" label="Puppet" term="Puppet" />
    
        <id>http://www.php-groupies.de/blogs/archives/40-guid.html</id>
        <title type="html">Overriding bind=... in included MySQL option files</title>
        <content type="xhtml" xml:base="http://www.php-groupies.de/blogs/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Debian and Ubuntu make use of the <b>!includedir</b> directive at the end of the packaged <b>my.cnf</b> to allow for extending and overriding their default configuration without having to modify the distribution config file.</p>

<p>This is especially nice in combination with configuration tools like <b>puppet</b> as it is usually much easier to add a file to the system than to modify an existing file.</p>

<p>I ran into a small gotcha with this though: the default my.cnf binds mysqld to the localhost TCP interface so that it listens IP 127.0.0.1 only. To make the mysql server reachable from other hosts the <b>bind=127.0.0.1</b> setting needs to be overwritten.<br />
How to change the binding to a different IP should be obvious, but how to disable an existing binding completely if you want your mysqld to listen on all available interfaces?</p>

<p>The most obvious would be to simply say</p>

<p>bind=</p>

<p>, this does not have any effect though. What needs to be done instead is</p>

<p>bind=0.0.0.0</p>

<p>to make mysqld listen on all interfaces again.</p>

<p>This is obviously a solution for IPv4 only, for allowing incoming connections from all v4 and v6 interfaces allowing <b>bind=</b> without any argument to reset any existing bindings would probably be more clever?</p>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.php-groupies.de/blogs/archives/39-Multiple-network-adapters-in-Vagrant-VMs.html" rel="alternate" title="Multiple network adapters in Vagrant VMs" />
        <author>
            <name>Hartmut Holzgraefe</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2011-09-17T06:35:29Z</published>
        <updated>2011-09-17T06:35:29Z</updated>
        <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=39</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=atom1.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    
            <category scheme="http://www.php-groupies.de/blogs/categories/9-Vagrant" label="Vagrant" term="Vagrant" />
    
        <id>http://www.php-groupies.de/blogs/archives/39-guid.html</id>
        <title type="html">Multiple network adapters in Vagrant VMs</title>
        <content type="xhtml" xml:base="http://www.php-groupies.de/blogs/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>For testing some stuff related to MySQL Cluster, port binding and having two network interfaces on the same subnet i needed a bit more than my usual &quot;all nodes on localhost&quot; setup. Looking for a reusable solution i this time did not just simply plug several of my old laptops into the same hup but tried to create a <a href="http://vagrantup.com/" onclick="window.open(this.href, '_blank'); return false;">Vagrant</a> setup for this.</p>

<p>This quickly lead to the question how to define multiple network adapters per Vagrant VM. The manual is not too clear about this yet, and the key piece of information is not yet to be seen in the network section but is hiding in the section on port forwarding: the <b>:adapter</b> option.</p>

<p>So to define multiple adapters you need to add <b>:adapter =&gt; $value</b> options on each of the <b>vm.network</b> lines, with <b>$value</b> counting up from one, e.g.:</p>

<p>config.vm.network(&quot;33.33.33.10&quot;, :adapter =&gt; 1);<br />
    config.vm.network(&quot;33.33.33.20&quot;, :adapter =&gt; 2);</p>

<p>In my case i need both adapters to be on the same IP subnet. Vagrant (or VirtualBox?) is not clever enough for this yet and will create two distinct host-only networks for this, routing and binding works as expected though as the kernels inside the VMs do not care about (and are not even aware of) this.</p>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.php-groupies.de/blogs/archives/38-MySQL-Conference-talk-slides.html" rel="alternate" title="MySQL Conference talk slides" />
        <author>
            <name>Hartmut Holzgraefe</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2011-04-15T16:53:55Z</published>
        <updated>2011-04-15T16:53:55Z</updated>
        <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=38</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=atom1.0&amp;type=comments&amp;cid=38</wfw:commentRss>
    
            <category scheme="http://www.php-groupies.de/blogs/categories/2-MySQL" label="MySQL" term="MySQL" />
            <category scheme="http://www.php-groupies.de/blogs/categories/5-OSM" label="OSM" term="OSM" />
    
        <id>http://www.php-groupies.de/blogs/archives/38-guid.html</id>
        <title type="html">MySQL Conference talk slides</title>
        <content type="xhtml" xml:base="http://www.php-groupies.de/blogs/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Slides for my two MySQL Conference talks are now available from the O'Reilly conference site:</p>


<ul>
    <li><a href="http://en.oreilly.com/mysql2011/public/schedule/detail/17383" onclick="window.open(this.href, '_blank'); return false;">From Map to Web - OpenStreetMap -&gt; (PostGIS|MySQL|SpatiaLite) -&gt; Openlayers</a></li>
    <li><a href="http://assets.en.oreilly.com/1/event/56/A%20code%20stub%20generator%20for%20MySQL%20and%20Drizzle%20plugins%20Presentation%201.pdf" onclick="window.open(this.href, '_blank'); return false;">A code stub generator for MySQL and Drizzle plugins</a></li>
</ul>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.php-groupies.de/blogs/archives/37-Why-go-with-On-if-you-can-have-On.html" rel="alternate" title="Why go with O(n) if you can have O(n²)?" />
        <author>
            <name>Hartmut Holzgraefe</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2011-03-03T09:49:01Z</published>
        <updated>2011-03-04T09:04:19Z</updated>
        <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=37</wfw:comment>
    
        <slash:comments>6</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=atom1.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    
            <category scheme="http://www.php-groupies.de/blogs/categories/2-MySQL" label="MySQL" term="MySQL" />
    
        <id>http://www.php-groupies.de/blogs/archives/37-guid.html</id>
        <title type="html">Why go with O(n) if you can have O(n²)?</title>
        <content type="xhtml" xml:base="http://www.php-groupies.de/blogs/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Found this while waiting for the CSV export of a search result from (*undisclosed project*) ...</p>

<p>The export took almost half an hour even though it was just extracting the snail mail addresses of about 40K contacts, so what caused it to only spit out about 20 rows per second? Looking at the PROCESSLIST output a pattern was easy to detect. What greeted me was a single running query which had only been running for a few seconds even though i was already waiting for export results for about 20 minutes:</p>

<p>SELECT ... LIMIT 32900, 100;</p>

<p>And then a few seconds later:</p>

<p>SELECT ... LIMIT 33000, 100;</p>

<p>So instead of retrieving the search results for export by firing a single query and processing the results in one go the same pagination logic seemed to be used as for displaying search results. About 400 queries instead of a single one, and each iteration taking more query time, with finally the last one taking about the same time as the only query in the all-at-once alone.</p>

<p>Somewhere, somehow, something terribly went wrong it seems ....</p>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.php-groupies.de/blogs/archives/36-osm2pgsql-nor-able-to-read-PBF-files-directly.html" rel="alternate" title="osm2pgsql nor able to read PBF files directly" />
        <author>
            <name>Hartmut Holzgraefe</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-11-08T22:35:08Z</published>
        <updated>2010-11-08T22:35:08Z</updated>
        <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=36</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=atom1.0&amp;type=comments&amp;cid=36</wfw:commentRss>
    
            <category scheme="http://www.php-groupies.de/blogs/categories/5-OSM" label="OSM" term="OSM" />
    
        <id>http://www.php-groupies.de/blogs/archives/36-guid.html</id>
        <title type="html">osm2pgsql nor able to read PBF files directly</title>
        <content type="xhtml" xml:base="http://www.php-groupies.de/blogs/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>With the changes i recently committed to the OSM SVN repository osm2pgsql can now read OSM files in the new binary PBF format directly (with parsing code based on that found in pbf2osm). Files in PBF format are available from the geofabrik download site along with their XML counterparts and are usually about 30% smaller than bzip2 compressed XML. osm2pgsql also parses PBF about twice as fast, so substantially reducing the time taken for the first processing step.</p>

<p>Also part of my committed changes are an improved autotools setup that checks for library and header file availability in the configure stage already, and that only includes PBF support if the needed GNU ProtoBuffer related tools and libraries are available.</p>

<p>Unfortunately the PBF code requires at least protobuf-c 0.14, which is not yet part of current distributions, so you'll have to install that one from source yourself. But with proper configure checks in place you'll be at least warned about version mismatches here and osm2pgsql will be built without PBF support then.</p>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.php-groupies.de/blogs/archives/35-DirectDownload-plugin-now-with-track-description.html" rel="alternate" title="DirectDownload plugin now with track description" />
        <author>
            <name>Hartmut Holzgraefe</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-10-12T19:46:40Z</published>
        <updated>2010-10-12T20:11:15Z</updated>
        <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=35</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=atom1.0&amp;type=comments&amp;cid=35</wfw:commentRss>
    
    
        <id>http://www.php-groupies.de/blogs/archives/35-guid.html</id>
        <title type="html">DirectDownload plugin now with track description</title>
        <content type="xhtml" xml:base="http://www.php-groupies.de/blogs/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Thanks to TomH for adding the missing fields to the API response so quickly <img src="http://www.php-groupies.de/blogs/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /></p>

<p><img src="http://www.php-groupies.de/blogs/uploads/Screenshot.png" width="848" height="411" alt="Screenshot.png" /></p>

 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.php-groupies.de/blogs/archives/34-My-first-JOSM-plugin-Direct-GPX-track-download.html" rel="alternate" title="My first JOSM plugin: Direct GPX track download" />
        <author>
            <name>Hartmut Holzgraefe</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-10-11T06:02:52Z</published>
        <updated>2010-10-11T16:53:12Z</updated>
        <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=34</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=atom1.0&amp;type=comments&amp;cid=34</wfw:commentRss>
    
            <category scheme="http://www.php-groupies.de/blogs/categories/8-Java" label="Java" term="Java" />
            <category scheme="http://www.php-groupies.de/blogs/categories/5-OSM" label="OSM" term="OSM" />
    
        <id>http://www.php-groupies.de/blogs/archives/34-guid.html</id>
        <title type="html">My first JOSM plugin: Direct GPX track download</title>
        <content type="xhtml" xml:base="http://www.php-groupies.de/blogs/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>No more need to manually download tracks you previously uploaded to openstreetmap.org first, then opening the downloaded file with JOSMs &quot;Open file ...&quot; dialog. You can now pick an uploaded track and have it loaded into a new GPX layer directly with the help of the <b>DirectDownload</b> <span title="Something that plugs in" class="serendipity_glossaryMarkup">plugin</span>.</p>

<p>You can download the <a href="http://php-baustelle.de/DirectDownload.jar" onclick="window.open(this.href, '_blank'); return false;">compiled plugin .jar</a> or <a href="http://php-baustelle.de/DirectDownload.tar.gz" onclick="window.open(this.href, '_blank'); return false;">the source code</a>, but be warned: current status is &quot;works for me&quot; aka. &quot;proof of concept&quot;.<br />
The desired functionality is there, but it still is a bit rough around the edges.</p>

 <br /><a href="http://www.php-groupies.de/blogs/archives/34-My-first-JOSM-plugin-Direct-GPX-track-download.html#extended">Continue reading "My first JOSM plugin: Direct GPX track download"</a>
            </div>
        </content>
        
    </entry>

</feed>
