<?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>Christoph Hautzinger's Blog</title>
    <link>http://blog.hautzinger.info/</link>
    <description>Freakshow 2.0</description>
    <dc:language>de</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    <pubDate>Mon, 24 Dec 2007 11:37:18 GMT</pubDate>

    <image>
        <url>http://blog.hautzinger.info/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Christoph Hautzinger's Blog - Freakshow 2.0</title>
        <link>http://blog.hautzinger.info/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>entwickler.press Adventskalender</title>
    <link>http://blog.hautzinger.info/archives/33-entwickler.press-Adventskalender.html</link>
    
    <comments>http://blog.hautzinger.info/archives/33-entwickler.press-Adventskalender.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=33</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;p&gt;Ich hab derzeit leider viel um die Ohren, sodass ich nur sehr wenig Zeit zum Bloggen habe...&lt;/p&gt;&lt;p&gt;Dennoch will Euch dieses Schmankerl nicht vorenthalten:&lt;br /&gt;Der Entwickler Press Verlag bietet einen Online-Adventskalender, indem sich hinter jedem Türchen ein cooles IT-eBook befindet.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://entwickler-press.de/ep/xmas/&quot; target=&quot;_blank&quot;&gt;&lt;p&gt;Hier gehts direkt zum Adventskalender&lt;/p&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;b&gt;Nachtrag:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Da ich nicht weiß, wie die rechtliche Lage aussieht, will ich keine Links posten, aber dennoch die Bücher bereitstellen, die Ihr vielleicht verpasst habt &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;&lt;p&gt;http://80.237.217.198/ep/xmas/ebooks/01_Managed%20DirectX_6dgh65.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/02_Java%206%20Einstieg_7ghdhkh.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/03_Visual%20Csharp_7sdgkh.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/04_Google%20Web%20Toolkit_254aklkle7.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/05_Java%206%20PHB_6gdskc.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/06_Dojo%20Toolkit_9fdhsa.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/07_XNA%20Framework_6gdgs3a.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/08_Visual%20Csharp%20PHB_98snbber.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/09_eBay%20API_2bd86d2.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/10_Salesforce_9dhbe3x.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/11_Software%20Life%20Cycle_63gsbd2.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/12_Dateiformate_092ncd0.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/13_Exploring%20JavaScript_63kasd3u.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/14_Axis2_358dfg1.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/15_XSL-FO_8326bdh46s.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/16_C++%20PHB_92dfa.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/17_MS%20Ajax_9264d31.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/18_Sichere%20Webanwendungen_9287hd42.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/19_social_software_365dgh.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/20_XSLT_2df3rfy.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/21_MDSD_9827ddf23l.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/22_Google%20Web%20API_982hd5.pdf&lt;br /&gt;http://80.237.217.198/ep/xmas/ebooks/23_XAML_07scwjeh.pdf&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Ich wünsche Euch allen ein frohes und besinnliches Weihnachtsfest &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;  
    </content:encoded>

    <pubDate>Thu, 13 Dec 2007 02:06:00 +0100</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/33-guid.html</guid>
    
</item>
<item>
    <title>Gartenlaube Homepage online</title>
    <link>http://blog.hautzinger.info/archives/32-Gartenlaube-Homepage-online.html</link>
            <category>diginights.com</category>
            <category>Fun</category>
    
    <comments>http://blog.hautzinger.info/archives/32-Gartenlaube-Homepage-online.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=32</wfw:comment>

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

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Seit dieser Woche ist die neue &lt;a href=&quot;http://www.gartenlaube.com&quot; target=&quot;_blank&quot;&gt;Homepage der Heilbronner Gartenlaube&lt;/a&gt; online - bei genauerer Betrachtung fällt auf, dass es sich bei den eingebunden Partypics um Bilder von diginights handelt - sogar zu meiner Shooterzeit von 2004 sind noch einige Galerien mit dabei.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.gartenlaube.com/index.php?option=com_wrapper&amp;Itemid=37&quot; target=&quot;_blank&quot;&gt;&lt;br /&gt;
&lt;!-- s9ymdb:15 --&gt;&lt;img width=&quot;500&quot; height=&quot;576&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.hautzinger.info/uploads/img/gartenlaube/gartenlaube.jpg&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Um die Integration einfach zu gestalten, bieten wir seit geraumer Zeit einen speziellen Service an, der es externen Webseitenbetreibern ermöglicht, anhand eines speziell definierten Filters eine Teilmenge unseres Bilderrepositories (also beispielsweise sämtliche Bilder zu einer Location) auf ihrer Webseite in einem iFrame einzubinden, um so immer über aktuelle Bilder zu verfügen. Dieser Service wird auch von anderen Heilbronnern Clubs wie dem &lt;a href=&quot;http://creme21derclub.de&quot; target=&quot;_blank&quot;&gt;Creme 21&lt;/a&gt; oder dem &lt;a href=&quot;http://www.barococo-nightclub.de&quot; target=&quot;_blank&quot; target=&quot;_blank&quot;&gt;Barococo&lt;/a&gt; eingesetzt. Ein Webservice stand zur Designzeit damals garnicht zur Debatte, da die meisten Agenturen, die diese Clubwebseiten erstellen garnicht wissen, was das ist, geischweige denn, wie man gegen ihn programmiert &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; .&lt;br /&gt;
&lt;br /&gt;
Bei noch genauerer Betrachtung der Galerien fällt auf, dass es sich hierbei um eine unbeabsichtigte optische Täuschung handelt - unser Gehirn denkt sich zwischen die einzelnen Bildquadrate dunkle Kreise, wie man im folgenden Bild noch besser erkennen kann:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- s9ymdb:16 --&gt;&lt;img width=&quot;200&quot; height=&quot;276&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.hautzinger.info/uploads/img/gartenlaube/opttaeusch.gif&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
  
    </content:encoded>

    <pubDate>Sun, 14 Oct 2007 16:30:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/32-guid.html</guid>
    
</item>
<item>
    <title>Symfony Benchmarks: LigHTTPd vs. Apache</title>
    <link>http://blog.hautzinger.info/archives/31-Symfony-Benchmarks-LigHTTPd-vs.-Apache.html</link>
            <category>Symfony</category>
    
    <comments>http://blog.hautzinger.info/archives/31-Symfony-Benchmarks-LigHTTPd-vs.-Apache.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=31</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=31</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    &lt;a href=&quot;http://blog.bumsdiekuh.net&quot; target=&quot;_blank&quot;&gt;Andy&lt;/a&gt; hat mir gerade einen interessanten Blogeintrag geschickt, in dem mittels &quot;ab&quot; eine Symfony Anwendung für Apache und LigHTTPd gebenchmarkt wird. Das Resultat ist echt fastzinierend, ich hätte niemals gedacht, dass der LigHTTPd hierbei so gut abschneidet.&lt;br /&gt;
&lt;br /&gt;
Seht aber selbst: &lt;a href=&quot;http://www.markround.com/archives/30-LigHTTPd-and-Apache-Symfony-benchmarks.html&quot; target=&quot;_blank&quot;&gt;LigHTTPd and Apache - Symfony benchmarks&lt;/a&gt;  
    </content:encoded>

    <pubDate>Thu, 11 Oct 2007 12:24:37 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/31-guid.html</guid>
    
</item>
<item>
    <title>Webseitenüberschriften mittels Filter &quot;verschönern&quot;</title>
    <link>http://blog.hautzinger.info/archives/30-Webseitenueberschriften-mittels-Filter-verschoenern.html</link>
            <category>Javascript</category>
            <category>PHP</category>
            <category>Symfony</category>
    
    <comments>http://blog.hautzinger.info/archives/30-Webseitenueberschriften-mittels-Filter-verschoenern.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=30</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=30</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Heute will ich etwas über Symfony Filter zum Besten geben. Vorab eine kleine Einführung zum &lt;a href=&quot;http://trac.symfony-project.com/wiki/sfTextReplacementPlugin&quot; target=&quot;_blank&quot;&gt;sfTextReplacementPlugin&lt;/a&gt;, welches es ermöglicht Text auf einer Website in einer beliebigen TTF-Schriftart als (cachbare) Grafik auszugeben um so beispielsweise h1/h2-Überschriften zu ersetzen. Die Einbindung erfolgt über einen simplen Funktionsaufruf, der an jeder gewünschten Stelle gemacht werden muss, hier ein Beispiel:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; use_helper&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;TextReplacement&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; graphical_text&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Dies ist meine Überschrift&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;lt;p&amp;gt;hier fängt dann der Content der Seite an...&amp;lt;/p&amp;gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
Das Plugin bietet von Haus aus die Möglichkeit, die Seite nach dem Laden mit Hilfe des der &lt;em&gt;js_replace_text()&lt;/em&gt;Helper-Methode per Javascript zu durchsuchen um gewisse Tags durch die entsprechenden Bilder ersetzen zu lassen - doch was, wenn der Browser Javascript deaktiviert hat? Zudem wird hierbei ein zusätzliches Javascript File includiert was auch nicht unbedingt sein muss.&lt;br /&gt;
Für einen naiven Programmierer ist es natürlich ärgerlich, diese Replacements in ein großes Projekt zu integrieren weil er jede einzelne Überschrift durch den entsprechenden Funktionsaufruf ersetzt - viel eleganter geschieht dies mittels Filter. Da ich die Ersetzungen nur im Content Bereich der Webseite (also in dem Bereich, der auf jeder Seite anders ist) vorgenommen werden sollen, liegt es auf der Hand, eine abstrakte Klasse zu definieren, die eben diesen Bereich isoliert um ihn dann von einer Subklasse ersetzen zu lassen (eine zusätzliche Anforderung in diesem Projekt war nämlich das Ersetzen einzelner Wörter duch Wikipedia Links). Die (Super-)Klasse sieht in meinem Fall so aus:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt; * abstract class to extract contents of template&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt; * &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt; * @author Christoph Hautzinger &amp;lt;mail at hautzinger.info&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt; */&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;abstract &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ContentFilter extends sfFilter&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; protected &lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;* extracts pages main content and passes it to self::replace()&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;*&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;* @param sfFilter $filterChain&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; execute&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$filterChain&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Execute next filter&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$filterChain&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;execute&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$timer&lt;/span&gt; = sfTimerManager::&lt;span style=&quot;color: #006600;&quot;&gt;getTimer&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/get_class&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;get_class&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; Filter&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$response&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getContext&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;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getResponse&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$response&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getContent&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$startMark&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;&amp;lt;!-- ContentFilter:START --&amp;gt;&#039;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$stopMark&lt;/span&gt;&amp;#160; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;&amp;lt;!-- ContentFilter:STOP --&amp;gt;&#039;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// determine section where replacementes are done&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$startPos&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/strpos&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;strpos&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$startMark&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$stopPos&lt;/span&gt;&amp;#160; = &lt;a href=&quot;http://www.php.net/strpos&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;strpos&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$stopMark&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$startPos&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;a href=&quot;http://www.php.net/strlen&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;strlen&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$stopMark&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;content&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$startPos&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$stopPos&lt;/span&gt; - &lt;span style=&quot;color: #0000ff;&quot;&gt;$startPos&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// do replacements&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;replace&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$response&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setContent&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$startPos&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; . &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;content&lt;/span&gt; . &lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$content&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$stopPos&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$timer&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;addTime&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;* should be overwritten in subclass&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; abstract protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; replace&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt; Zu beachten ist hierbei, dass der Content im dem die Ersetzungen vorgenommen werden sollen im Template durch die beiden Kommentare &lt;em&gt;&amp;lt;!-- ContentFilter:START --&amp;gt;&lt;/em&gt; und &lt;em&gt;&amp;lt;!-- ContentFilter:STOP --&amp;gt;&lt;/em&gt; eingeschlossen werden muss. Der Code enthält keinerlei Magic und sollte auch ohne PHP-Kenntnisse leicht verständlich sein.&lt;br /&gt;
&lt;br /&gt;
Nun aber wieder zurück zum eigentlichen Problem: Wir haben nach einer Lösung gesucht, diese Ersetzungen global vorzunehmen und die sieht wie folgt aus:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt; * replaces all h1, h2 tags with its adequate graphical_text()-call replacements&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt; * &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt; * @author Christoph Hautzinger &amp;lt;mail at hautzinger.info&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt; */&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; TextReplacementFilter extends ContentFilter &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;* searches for all h1 and h2 tags and passes result to self::callbackHeadline()&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; replace&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; sfLoader::&lt;span style=&quot;color: #006600;&quot;&gt;loadHelpers&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&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;&#039;TextReplacement&#039;&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;content&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/preg_replace_callback&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;preg_replace_callback&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;&#039;@&amp;lt;(h[12])&amp;gt;([^&amp;lt;]+)&amp;lt;/&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\\&lt;/span&gt;1&amp;gt;@i&#039;&lt;/span&gt;, &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;callbackHeadline&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;content&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;* replace all matches with a specific h1 tag and our textreplacement-call&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;* @return string&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;#160; &amp;#160;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; callbackHeadline&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$matches&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;&amp;lt;h1&amp;gt;Google Searchword1, Google Searchword2: &#039;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$matches&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;&amp;lt;/h1&amp;gt;&#039;&lt;/span&gt; . PHP_EOL .&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;graphical_text&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$matches&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;headline&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; .&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;&amp;lt;br/&amp;gt;&#039;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
Zusätzlich wird noch eine h1-Überschrift in das Dokument eingefügt, um eine bessere Indizierung durch Suchmaschinen zu gewährleisten - man darf natürlich nicht vergessen, sämtliche dieser &quot;speziellen&quot; h1 Tags per CSS auf &lt;em&gt;display: none&lt;/em&gt; zu setzen und den Filter in der filters.yml zu aktivieren.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Und wir sehen: Mit relativ wenig Code haben wir wieder sehr viel erreicht, wenn man die Vorzüge eines hervorragenden Frameworks nutzt. Sicherlich sind reguläre Ausdrücke langsam und preg_replace_callback noch langsamer - dennoch finde ich den Einsatz hier angebracht, zumal die Ausführung des Filters auf eine mittelgroße Seite angewandt nur ca. 6ms in Anspruch nimmt - und sollte sich später die gesamte Anwendung einmal wegen diesen 6ms aufhängen, so kann man immer noch ein Refactoring in Betracht ziehen und auf triviale Stringmanipulation umsteigen &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;.  
    </content:encoded>

    <pubDate>Sat, 06 Oct 2007 17:25:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/30-guid.html</guid>
    
</item>
<item>
    <title>&quot;Thirteen Simple Rules for Speeding Up Your Web Site&quot;</title>
    <link>http://blog.hautzinger.info/archives/29-Thirteen-Simple-Rules-for-Speeding-Up-Your-Web-Site.html</link>
    
    <comments>http://blog.hautzinger.info/archives/29-Thirteen-Simple-Rules-for-Speeding-Up-Your-Web-Site.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=29</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=29</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Ich bin gerade auf eine Developer Webseite von Yahoo! gestossen, auf der 13 Regeln genannt werden, wie man seine Webanwendungen ohne Codeoptimierung beschleunigen kann.&lt;br /&gt;
&lt;br /&gt;
Diese 13 Regeln lauten:&lt;br /&gt;
&lt;blockquote&gt;1: Minimize HTTP Requests&lt;br /&gt;
2: Use a Content Delivery Network&lt;br /&gt;
3: Add an Expires Header&lt;br /&gt;
4: Gzip Components&lt;br /&gt;
5: Put Stylesheets at the Top&lt;br /&gt;
6: Put Scripts at the Bottom&lt;br /&gt;
7: Avoid CSS Expressions&lt;br /&gt;
8: Make JavaScript and CSS External&lt;br /&gt;
9: Reduce DNS Lookups&lt;br /&gt;
10: Minify JavaScript&lt;br /&gt;
11: Avoid Redirects&lt;br /&gt;
12: Remove Duplicate Scripts&lt;br /&gt;
13: Configure ETags&lt;/blockquote&gt;&lt;br /&gt;
Wer sich unter einzelnen Punkten nichts vorstellen können sollte, darf gerne auf &lt;a href=&quot;http://developer.yahoo.com/performance/rules.html&quot; target=&quot;_blank&quot;&gt;Yahoo!&lt;/a&gt; alles detailliert nachlesen.&lt;br /&gt;
&lt;br /&gt;
Um diese 13 Punkte elegant aus dem Browser zu verifizieren hat Yahoo! ein eigenes &lt;a href=&quot;http://blog.hautzinger.info/comment.php?type=trackback&amp;entry_id=21&quot; target=&quot;_blank&quot;&gt;Firebug&lt;/a&gt; Plugin entwickelt - &lt;a href=&quot;http://developer.yahoo.com/yslow/&quot; target=&quot;_blank&quot;&gt;YSlow&lt;/a&gt;. Den Screencast davon habe ich auch hier mal reingebaut &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;embed width=&quot;408&quot; height=&quot;324&quot; type=&quot;application/x-shockwave-flash&quot; src=&quot;http://www.jumpcut.com/media/flash/jump.swf?id=022841A0450811DCB298000423CF037A&amp;asset_type=movie&amp;asset_id=022841A0450811DCB298000423CF037A&amp;eb=1&quot;/&gt;&lt;br /&gt;
&lt;br /&gt;
Neben dem Firebug sicherlich ein sehr wichtiges Tool zum Web Development.  
    </content:encoded>

    <pubDate>Sat, 22 Sep 2007 11:06:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/29-guid.html</guid>
    
</item>
<item>
    <title>Javascript? Das ist doch Kindergeburtstag! Oder doch nicht!?</title>
    <link>http://blog.hautzinger.info/archives/28-Javascript-Das-ist-doch-Kindergeburtstag!-Oder-doch-nicht!.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.hautzinger.info/archives/28-Javascript-Das-ist-doch-Kindergeburtstag!-Oder-doch-nicht!.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=28</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=28</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Mir fällt immer wieder auf, dass es viele Web Developer gibt, die den Funktionsumfang von Javascript nicht kennen/nutzen, bzw. diese Sprache komplett unterschätzen - &quot;Ist ja nur eine kleine eingebettete Skriptsprache&quot;. Soeben bin ich auf den Blog von &lt;a href=&quot;http://ola-bini.blogspot.com/&quot; target=&quot;_blank&quot;&gt;Ola Bini&lt;/a&gt; gestossen, &lt;a href=&quot;http://ola-bini.blogspot.com/2007/09/javascript-ignorance.html&quot;&gt;in dem er sich wundert&lt;/a&gt;, dass man in Javascript beispielsweise über den Array-Operator auf die Methoden eines Objektes zugreifen kann.&lt;br /&gt;
&lt;br /&gt;
Bei Javascript handelt es sich (wie auch beispielsweise bei &lt;a href=&quot;http://de.wikipedia.org/wiki/Lisp&quot; target=&quot;_blank&quot;&gt;Lisp&lt;/a&gt;) um eine &lt;a href=&quot;http://de.wikipedia.org/wiki/Funktionale_Programmierung&quot; target=&quot;_blank&quot;&gt;Funktionale Sprache&lt;/a&gt;, was u.a. impliziert, dass Funktionsreferenzen als Parameter übergeben werden können, oder eine Funktion eine andere Funktion als Rückgabewert haben kann, wozu ich ein cooles Codebeispiel habe:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; Configuration = &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;Class&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;create&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;Configuration.&lt;span style=&quot;color: #006600;&quot;&gt;prototype&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; _config : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;null&lt;/span&gt;,&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; initialize: &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;config&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;._config = config;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;,&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&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;key&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&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;function&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;vars&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&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: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;new&lt;/span&gt; Template&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;._config&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;key&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&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: #006600;&quot;&gt;evaluate&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;vars&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&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: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
Hierbei handelt es sich um ein der Anschaulichkeit vereinfaches Beispiel einer kleinen Template Engine in Javascript, da ich nach einer Möglichkeit gesucht habe, serverseitige Daten initial elegant an ein includiertes Javascriptfile zu übergeben. Aber ich will nicht vom Thema abschweifen... &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Schauen wir uns die &lt;em&gt;Configuration::get()&lt;/em&gt; Methode an - sie nimmt einen Parameter, der das Template mit einem sog. Hash (oder einem Schlüssel) identifiziert und sofort eine anonyme Funktion zurückgibt, die als Parameter ein JSON Objekt nimmt, welches der &lt;em&gt;evaluate()&lt;/em&gt; Methode aus Prototypes &lt;a href=&quot;http://prototypejs.org/api/template&quot; target=&quot;_blank&quot;&gt;Template-Klasse&lt;/a&gt; übergeben wird.&lt;br /&gt;
&lt;br /&gt;
Die anonyme Funktion tritt also erst in Aktion, nachdem sie explizit ausgeführt wird, wozu sie sich den Wert von &lt;em&gt;key&lt;/em&gt; in einem internen Funktionsenvironment speichern muss.&lt;br /&gt;
&lt;br /&gt;
Angenommen, wir hätten die Configuration bereits mit einem trivialen Template initialisiert, so können wir die anonyme Funktion über den entsprechenden Key abrufen und diese dann mit den Ersetzungswerten aufrufen:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; cfg = &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;new&lt;/span&gt; Configuration&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;say_hallo: &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Hallo #{firstname} #{lastname}, wie gehts?&#039;&lt;/span&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;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// fetch anonymous function&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; fn = cfg.&lt;span style=&quot;color: #006600;&quot;&gt;get&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;say_hallo&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// call anonymous function&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; text = fn&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;firstname: &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Marc&#039;&lt;/span&gt;, lastname: &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Kreibich&#039;&lt;/span&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;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
Tja... und da Javascript wirklich so eine schöne Sprache ist, geht das natürlich auch noch einfacher, indem wir die anonyme Funktion direkt aufrufen, ohne sie in einer temporären Variablen zwischenzuspeichern:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; text = cfg.&lt;span style=&quot;color: #006600;&quot;&gt;get&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;say_hallo&#039;&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;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;firstname: &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Marc&#039;&lt;/span&gt;, lastname: &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Kreibich&#039;&lt;/span&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;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
Einer der vielen Gründe, wieso es sich lohnt sich mit Javascript einmal richtig auseinanderzusetzen!  
    </content:encoded>

    <pubDate>Fri, 21 Sep 2007 13:42:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/28-guid.html</guid>
    
</item>
<item>
    <title>&quot;The IT Crowd&quot;</title>
    <link>http://blog.hautzinger.info/archives/27-The-IT-Crowd.html</link>
            <category>Fun</category>
    
    <comments>http://blog.hautzinger.info/archives/27-The-IT-Crowd.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=27</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=27</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Vorhin wurde ich auf die Britische Serie &lt;a href=&quot;http://www.channel4.com/entertainment/tv/microsites/I/itcrowd/&quot; target=&quot;_blank&quot;&gt;The IT Crowd&lt;/a&gt; aufmerksam gemacht und hab mir gleich mal eine Folge davon angeschaut. Wie der Name bereits vermuten lässt, spielt die Handlung in der IT Abteilung einer fiktiven Firma. Der Humor ist schön schwarz, wie man es bereits aus anderen Britischen Serien wie z.b. &lt;a href=&quot;http://www.bbc.co.uk/comedy/coupling/&quot; target=&quot;_blank&quot;&gt;Coupling&lt;/a&gt; kennt. Nehmt Euch die 22 Minuten und seht am besten selbst:&lt;br /&gt;
&lt;br /&gt;
&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/zSLrhtKmlSE&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/zSLrhtKmlSE&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
Weitere Episoden finden sich auf &lt;a href=&quot;http://www.youtube.com/results?search_query=the%20it%20crowd&amp;search=Search&quot;&gt;Youtube&lt;/a&gt; oder zum &lt;a href=&quot;http://www.filecloud.com/files/category.php?category_id=3720&quot;&gt;direkten Downloaden hier (legal)&lt;/a&gt;.  
    </content:encoded>

    <pubDate>Tue, 11 Sep 2007 01:54:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/27-guid.html</guid>
    
</item>
<item>
    <title>sfPropelZSLSearchPlugin: Die Integration von Lucene in Symfony</title>
    <link>http://blog.hautzinger.info/archives/25-sfPropelZSLSearchPlugin-Die-Integration-von-Lucene-in-Symfony.html</link>
            <category>PHP</category>
            <category>Symfony</category>
    
    <comments>http://blog.hautzinger.info/archives/25-sfPropelZSLSearchPlugin-Die-Integration-von-Lucene-in-Symfony.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=25</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=25</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Letzte Woche fand sich im Symfony Blog (&lt;a href=&quot;http://www.symfony-project.com/blog/2007/08/26/a-week-of-symfony-34-20-26-august-2007&quot; target=&quot;_blank&quot;&gt;A week of symfony #34 (20-&gt;26 August 2007)&lt;/a&gt;) die Ankündigung eines meiner Meinung nach sehr coolen Plugins - dem &lt;a href=&quot;http://trac.symfony-project.com/trac/wiki/sfPropelZSLSearchPlugin&quot; target=&quot;_blank&quot;&gt;sfPropelZSLSearchPlugin&lt;/a&gt;: Es integriert die &lt;a href=&quot;http://framework.zend.com/manual/en/zend.search.lucene.html&quot; target=&quot;_blank&quot;&gt;PHP Portierung&lt;/a&gt; von &lt;a href=&quot;http://lucene.apache.org/java/docs/&quot; target=&quot;_blank&quot;&gt;Apaches Lucene&lt;/a&gt; aus dem &lt;a href=&quot;http://framework.zend.com/&quot; target=&quot;_blank&quot;&gt;Zend Framework&lt;/a&gt; in Symfony. Ich habe früher schon mit dem Gedanken gespielt, Zends Lucene Implementierung für diginights einzusetzen, was allerdings aus mangelnder Zeit und der höhreren Priorisierung anderer Tasks niemals passiert ist.&lt;br /&gt;
&lt;br /&gt;
Für alle, die es nicht wissen: Lucene ist ein index-basiertes Suchsystem welches das schnelle Durchsuchen von Dokumenten/Webseiten ermöglicht. Eine Suchanfrage durchsucht also nicht in Echtzeit jede einzelne Webseite, sondern nur den bereits erwähnten Index, der in einem anderen Schritt (automatisiert) erstellt wird.&lt;br /&gt;
&lt;br /&gt;
Das geniale an dem Plugin ist, dass die Integration (fast) komplett über Konfigurationsdateien erfolgt, zudem wird das Symfony CLI um einige  Tasks erweitert, die beispielsweise den Index optimieren oder komplett neu erzeugen. Die Optimierung sollte wohl hin und wieder mal ausgeführt werden, da Lucene intern mit mehreren Indices arbeitet die dadurch verschmolzen werden. Zudem ist das Handling von i18n-Tabellen bereits komplett abgebildet.&lt;br /&gt;
&lt;br /&gt;
Bei dynamischem Content (welcher i.d.R. durch Propel Objekte abgebildet wird) wird dem entsprechenden Propel Objekt ein spezielles Verhalten hinzugefügt, welches nach Aufruf von save() automatisch den Index aktualisiert.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ForumPost extends BaseForumPost &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;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;sfPZSLBehavior::&lt;span style=&quot;color: #006600;&quot;&gt;getInitializer&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;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setupModel&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;ForumPost&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Aus welchen Daten der Index aufbereitet werden soll, wird in der &lt;em&gt;project/config/search.yml&lt;/em&gt; definiert - zu beachten gilt es, dass zu den Feldnamen die entsprechenden Getter definiert sind (hier ForumPost::getTitle(), ForumPost::getContent(), ForumPost::getStrippedTitle()):&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left&quot;&gt;&lt;ol&gt;models:&lt;br /&gt;&amp;#160; ForumPost:&lt;br /&gt;&amp;#160; &amp;#160; fields:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; title:&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; boost: 1.5&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; type: text&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; content:&amp;#160; &amp;#160; &amp;#160; &amp;#160; unstored&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; strippedtitle:&amp;#160; unindexed&lt;br /&gt;&lt;br /&gt;index:&lt;br /&gt;&amp;#160; name: MyIndex&lt;br /&gt;&amp;#160; encoding: UTF-8&lt;br /&gt;&amp;#160; cultures: [de_DE]&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Die korrekte Verlinkung der entsprechenden Trefferseiten einer Suchanfrage geschieht durch festlegen der einzelnen Routen sämtlicher beteiligter Propel Klassen in der &lt;em&gt;application/config/search.yml&lt;/em&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left&quot;&gt;&lt;ol&gt;models:&lt;br /&gt;&amp;#160; ForumPost:&lt;br /&gt;&amp;#160; &amp;#160; route: &amp;quot;@forum_thread?stripped_title={$strippedtitle}&amp;quot;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
In diesem Beispiel wird {$strippedtitle} durch den Wert, der im Index gespeichert wird ersetzt.&lt;br /&gt;
&lt;br /&gt;
Dafür, dass es sich noch um eine Alpha Version handelt, die erst zwei Releases hatte muss ich sagen, dass ich von der Codequalität und der Umsetzung total überzeugt bin - ganz im Gegensatz zu anderen Plugins wie beispielsweise dem &lt;a href=&quot;http://trac.symfony-project.com/trac/wiki/sfSimpleForumPlugin&quot; target=&quot;_blank&quot;&gt;sfSimpleForumPlugin&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
Für mehr Informationen und Screenshots lohnt ein Vorbeisurfen auf der &lt;a href=&quot;http://trac.symfony-project.com/trac/wiki/sfPropelZSLSearchPlugin&quot; target=&quot;_blank&quot;&gt;Wiki Seite des Plugins&lt;/a&gt;.&lt;br /&gt;
  
    </content:encoded>

    <pubDate>Sun, 02 Sep 2007 21:21:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/25-guid.html</guid>
    
</item>
<item>
    <title>Microsoft Student Program an der Hochschule Heilbronn</title>
    <link>http://blog.hautzinger.info/archives/24-Microsoft-Student-Program-an-der-Hochschule-Heilbronn.html</link>
    
    <comments>http://blog.hautzinger.info/archives/24-Microsoft-Student-Program-an-der-Hochschule-Heilbronn.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=24</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=24</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Nachdem ich jetzt über 2 Monate nichts mehr geschrieben habe, weil ich mein Blog-Passwort vergessen habe *Ausrede* &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; , will ich heute einmal wieder paar Zeilen schreiben:&lt;br /&gt;
&lt;br /&gt;
Jetzt am Mittwoch findet - trotz Semesterferien - bei uns an der Hochschule wieder ein Workshop des &lt;a href=&quot;http://www.studentprogram-south.de/cms/home/layout/122.aspx&quot; target=&quot;_blank&quot;&gt;Microsoft Student Programs&lt;/a&gt; statt - diesmal zu der Thematik ASP.NET, was sicherlich wieder sehr interessant werden wird. Gehalten wird das Ganze von Andreas Maier, einem Studenten im mittlerweile dritten Semester mit einem sehr ausgeprägten .NET Kenntnisstand und einer sehr angenehmen Vortragsart - ganz im Gegensatz zum Dozenten der Vorlesung SEU (Herrn Haid) - hier herrscht das Chaos &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;.&lt;br /&gt;
&lt;br /&gt;
Ich finde es echt schön wie sich Microsoft mit dem Student Program an die Studenten wendet - natürlich ist es letztendlich nur Werbung für ihre Produkte, aber dennoch auf eine sehr informative Weise.&lt;br /&gt;
&lt;br /&gt;
Andreas schreibt auch über .NET spezifische Themen in seinem Blog: &lt;a href=&quot;http://www.technetbloggers.de/dasblogce/&quot; target=&quot;_blank&quot;&gt;technetbloggers&lt;/a&gt;.  
    </content:encoded>

    <pubDate>Tue, 24 Jul 2007 02:39:40 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/24-guid.html</guid>
    
</item>
<item>
    <title>Google Maps Coordinate Picker</title>
    <link>http://blog.hautzinger.info/archives/23-Google-Maps-Coordinate-Picker.html</link>
            <category>diginights.com</category>
            <category>Javascript</category>
            <category>PHP</category>
            <category>Symfony</category>
    
    <comments>http://blog.hautzinger.info/archives/23-Google-Maps-Coordinate-Picker.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=23</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=23</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Lets have a look at one &lt;a href=&quot;http://diginights.com/location/creme21.html&quot; target=&quot;_blank&quot;&gt;diginights location-detail page&lt;/a&gt;: There is a Google Map on the bottom of the page which displays the locations&#039; accurate position. The database-table therfore holds three columns: The two coordinate values for lattitude an longitude and the zoom factor.&lt;br /&gt;
&lt;br /&gt;
Our problem was the missing userfriendly admin interface, so i wrote a little class for this purpose which uses the Google Maps API to select a coordinate by double clicking the map. Additionaly an adress can be looked up which uses Google&#039;s Geocoder class internally.&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset&gt;&lt;legend&gt;&lt;strong&gt;See the code in action&lt;/strong&gt;&lt;/legend&gt;&lt;script src=&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAA4qg3RjPmw94FWwwSfPHZjBTJ4WgYfy1epERbhjESjVKkK-giZBQ_peTKWrLb7P0z7pfACQnmqltvXg&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;script src=&quot;http://diginights.com/sf/prototype/js/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;script src=&quot;http://diginights.com/js/GMapsCoordPicker.class.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;lattitude: &lt;input type=&quot;text&quot; id=&quot;coordinate_x&quot; value=&quot;0&quot; /&gt; &lt;br /&gt;
longitude: &lt;input type=&quot;text&quot; id=&quot;coordinate_y&quot; value=&quot;0&quot; /&gt;&lt;br /&gt;
zoom: &lt;input type=&quot;text&quot; id=&quot;default_zoom&quot; value=&quot;0&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;width:100%;height:400px&quot;&gt;Zoom in first and then double click map to set coordinate!&lt;br /&gt;
&lt;div id=&quot;map&quot; style=&quot;width: 100%; height: 95%&quot;&gt;&lt;/div&gt;&lt;input type=&quot;text&quot; id=&quot;GMapCoordPickerQuery&quot; style=&quot;width:300px&quot; /&gt;&lt;input type=&quot;button&quot; onclick=&quot;gmcp.query($(&#039;GMapCoordPickerQuery&#039;).value)&quot; value=&quot;Lookup&quot; /&gt;&lt;br /&gt;
&lt;/div&gt;&lt;script language=&quot;JavaScript&quot; &gt;gmcp = new GMapsCoordPicker(&#039;coordinate_x&#039;,&#039;coordinate_y&#039;,&#039;default_zoom&#039;,&#039;map&#039;); &lt;/script&gt;&lt;/fieldset&gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to download all necessary files here: &lt;a href=&quot;http://blog.hautzinger.info/uploads/GMapsCoordPicker.zip&quot; title=&quot;GMapsCoordPicker.zip&quot; target=&quot;_blank&quot;&gt;GMapsCoordPicker.zip&lt;/a&gt;. The zip-archive contains 4 files:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;GMapsCoordPicker.class.js&lt;/strong&gt;&lt;br /&gt;
Put this file in your project&#039;s javascript directory (/web/js), it handls client side logic.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;GoogleMapsHelper.php&lt;/strong&gt;&lt;br /&gt;
Put this file in your project&#039;s helper dir (/lib/helper). It supplies a helper function &lt;em&gt;google_maps_coord_picker()&lt;/em&gt;. The following example shows the usage in a symfony template:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; use_helper&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;GoogleMaps&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;longitunde: &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; input_tag&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;lon&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; ?&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;lattitude: &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; input_tag&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;lat&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; ?&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;zoom: &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; input_tag&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;zoom&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; ?&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; google_maps_coord_picker&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;lon&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;lat&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;zoom&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
This helper includes the Google Maps API, thus &lt;a href=&quot;http://www.google.com/apis/maps/signup.html&quot; target=&quot;_blank&quot;&gt;an API key has to be generated&lt;/a&gt; and set up in the application configuration (/apps/[appname]/config/app.yml):&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left&quot;&gt;&lt;ol&gt;# default values&lt;br /&gt;all:&lt;br /&gt;&amp;#160; google:&lt;br /&gt;&amp;#160; &amp;#160; api_key:&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;[your-api-key-here]&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;_google_maps_coordinate_picker.php&lt;/strong&gt;&lt;br /&gt;
To simply integrate in the admin generator, we need a tremplate that includes the helper showed above and displays the map. You have to replace the parameters passed to &lt;em&gt;google_maps_coord_picker()&lt;/em&gt; with the input field ids of your form. Note that symfony uses &lt;em&gt;object_input_tag()&lt;/em&gt; for its form elements which builds unconvenional form-field-ids.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;generator.yml&lt;/strong&gt;&lt;br /&gt;
This file displays the integration of _google_maps_coordinate_picker.php in the admin generator.  
    </content:encoded>

    <pubDate>Sun, 13 May 2007 17:38:16 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/23-guid.html</guid>
    
</item>
<item>
    <title>Hacking Cineplex Online Reservation with Firebug</title>
    <link>http://blog.hautzinger.info/archives/21-Hacking-Cineplex-Online-Reservation-with-Firebug.html</link>
            <category>Fun</category>
    
    <comments>http://blog.hautzinger.info/archives/21-Hacking-Cineplex-Online-Reservation-with-Firebug.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=21</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=21</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Ich wollte schon lange einmal was über den &lt;a href=&quot;http://getfirebug.com&quot; target=&quot;_blank&quot;&gt;Firebug&lt;/a&gt; bloggen, einem sehr nützlichen Plugin für den Firefox Webbrowser. Ich benutze es hauptsächlich bei der Anwendungsentwicklung, da es einen Javascript Debugger und einen DOM-Inspector bietet (näheres hierzu findet sich auf der Webseite des Tools) - es kann allerdings auch dazu verwendet werden, Formularelemente auf einer Seite &quot;on the fly&quot; zu manipulieren und somit einer Serverseitigen Action Fakedaten vorgaukeln.&lt;br /&gt;
&lt;br /&gt;
Mittwochs bin ich immer im Cineplexx in Neckarsulm zur Sneak Preview um 23 Uhr anzutreffen, das Cineplexx hat sein Reservierungssystem auf eine neue Platform umgestellt, welche unter &lt;a href=&quot;http://212.20.182.131/&quot; target=&quot;_blank&quot;&gt;http://212.20.182.131/&lt;/a&gt; zu finden ist. Nach dem Auswählen eines Filmes und dem Einloggen mit seinen Benutzerdaten können (im Gegensatz zum alten System) nur noch bis zu vier Karten reserviert werden was natürlich viel zu wenig ist.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;serendipity_imageComment_center&quot; style=&quot;width: 110px;height:150px&quot;&gt;&lt;div class=&quot;serendipity_imageComment_img&quot;&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://blog.hautzinger.info/uploads/img/cineplex/cineplex_1.JPG&#039; onclick=&quot;F1 = window.open(&#039;/uploads/img/cineplex/cineplex_1.JPG&#039;,&#039;Zoom&#039;,&#039;height=1039,width=1295,top=0,left=0,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!--s9ymdb:13--&gt;&lt;img width=&#039;110&#039; height=&#039;88&#039;  src=&quot;http://blog.hautzinger.info/uploads/img/cineplex/cineplex_1.serendipityThumb.JPG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;serendipity_imageComment_txt&quot;&gt;Manipulation des DOM mittels Firebug&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Abhilfe tut im Firebug ein Klick auf &quot;Inspect&quot; worauf man mit der Maus über das Select Feld fährt, in dem normalerweite die Anzahl der Karten auswählt werden. Im DOM Inspector kann nun der Wert auf die gewünschte Menge geändert und das Forumular abgeschickt werden, worauf man zur Auswahl der Sitzplätze und danach zur Reservierungsbestätigung weitergeleitet wird &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;serendipity_imageComment_center&quot; style=&quot;width: 110px;height:110px&quot;&gt;&lt;div class=&quot;serendipity_imageComment_img&quot;&gt;&lt;a title=&quot;/uploads/img/cineplex/cineplex_2.JPG&quot; id=&quot;s9yisp12&quot;&gt;&lt;/a&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://blog.hautzinger.info/serendipity_admin_image_selector.php?serendipity[step]=showItem&amp;amp;serendipity[image]=12&#039; id=&quot;s9yisphref12&quot; onclick=&quot;javascript:this.href = this.href + &#039;&amp;amp;serendipity[from]=&#039; + self.location.href;&quot;&gt;&lt;!--s9ymdb:12--&gt;&lt;img width=&#039;110&#039; height=&#039;88&#039;  src=&quot;http://blog.hautzinger.info/uploads/img/cineplex/cineplex_2.serendipityThumb.JPG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;serendipity_imageComment_txt&quot;&gt;Das Resultat&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Solch ein Bug darf in einer Anwendung natürlich nicht aufteten - das ist schlichtweg peinlich. Die Formulardaten müssen (nach dem Konzept einem User niemals zu vertrauen) nochmals auf Serverseite validiert werden, aber das kann man von einem ASP Programmierer wohl nicht erwarten &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/tongue.png&quot; alt=&quot;:-P&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;  
    </content:encoded>

    <pubDate>Wed, 11 Apr 2007 12:59:18 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/21-guid.html</guid>
    
</item>
<item>
    <title>Time Warp 2007</title>
    <link>http://blog.hautzinger.info/archives/20-Time-Warp-2007.html</link>
            <category>diginights.com</category>
            <category>Fun</category>
    
    <comments>http://blog.hautzinger.info/archives/20-Time-Warp-2007.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=20</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=20</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Nächsten Samstag werden wieder tausende feierwütige Freunde des Techno nach Mannheim auf die Time Warp pilgern. Nachdem ich letztes Jahr seit vier Jahren zum ersten Mal leider nicht dabei war, wird es dieses Jahr bestimmt wieder richtig geil, auch wenn mich das &lt;a href=&quot;http://www.tdktimewarp.de/e4/e447/e2113/e2799/TW07_TimetableFlyer_70322_ger.pdf&quot; target=&quot;_blank&quot;&gt;Line Up&lt;/a&gt; nicht so wirklich anspricht. Ganz besonders freu ich mich auf DJ Murphy, der letztes Jahr auf der After Hour zur Street Parade im Rohstofflager mit seinem kompromisslos hartem Sound überzeugt hat.&lt;br /&gt;
&lt;br /&gt;
Sogar auf der Wikipedia gibt es eine Seite zur &lt;a href=&quot;http://de.wikipedia.org/wiki/TDK_Time_Warp&quot; target=&quot;_blank&quot;&gt;Time Warp&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Hin geht es mit dem &lt;a href=&quot;http://diginights.com/bustrips/eventshuttle/detail/2007-03-31_EventShuttle_zur_TDK_Timewarp.html&quot; target=&quot;_blank&quot;&gt;diginights Eventshuttle&lt;/a&gt;... da beginnt die Party schon im Bus &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;. Die Eventshuttle-Sektion ist auch zugleich ein neuer Bereich auf &lt;a href=&quot;http://diginights.com&quot; target=&quot;_blank&quot;&gt;diginights&lt;/a&gt;, die von der Logik her nichts neues bietet, sondern auf die der &lt;a href=&quot;http://diginights.com/bustrips/jomotours/list.html&quot; target=&quot;_blank&quot;&gt;Jomotours Busreisen&lt;/a&gt; setzt.&lt;br /&gt;
&lt;br /&gt;
&lt;!--s9ymdb:11--&gt;&lt;img width=&#039;448&#039; height=&#039;299&#039; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.hautzinger.info/uploads/img/time_warp.jpg&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Nach der Party will ich feiertechnisch ein wenig kürzer treten und mich mal wieder etwas mehr um diginights kümmern... da gibt es ja auch genügend zu tun &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;.  
    </content:encoded>

    <pubDate>Sun, 25 Mar 2007 21:50:09 +0200</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/20-guid.html</guid>
    
</item>
<item>
    <title>Das Studium geht wieder weiter...</title>
    <link>http://blog.hautzinger.info/archives/18-Das-Studium-geht-wieder-weiter....html</link>
            <category>Studium</category>
    
    <comments>http://blog.hautzinger.info/archives/18-Das-Studium-geht-wieder-weiter....html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=18</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=18</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Nach nun halbjähriger Abstinenz wegen meines 2. Praxissemesters bin ich seit letzter Woche Dienstag wieder an der Hochschule. Vorlesungstechnisch hab ich in diesem Semester gar nicht soooo viel... &lt;br /&gt;
&lt;br /&gt;
An Kernfächern habe ich in diesem Semester das &lt;a href=&quot;http://mitarbeiter.fh-heilbronn.de/~vstahl/seminar/vorlesung.shtml&quot; target=&quot;_blank&quot;&gt;Softwaretechnische Seminar (SWT)&lt;/a&gt; zu dem Thema &quot;Semantic Web&quot; und mein persönlicher Favourit &lt;a href=&quot;http://www.fh-heilbronn.de/Members/herzberg/akse/&quot; target=&quot;_blank&quot;&gt;Aktuelle Kapitel des Software Engineering (AKSE)&lt;/a&gt; - hier geht es um allgemeine Programmierkonzepte, dazu wird ein Lisp Dialekt unterrichtet: Scheme. Es ist für dieses Semester auf jeden Fall die Vorlesung mit dem höchsten Niveau.&lt;br /&gt;
&lt;br /&gt;
Vertiefungsfächer fehlen mir in meinen letzten beiden Semestern nur noch 10 SWS (Semesterwochenstunden), davon mache ich in diesem schon mal 8 weg, damit es nächstes Semester einen lockeren Endspurt gibt: Bildverarbeitung 2 - ist wohl die langweiligste Vorlesung, was aber am Prof liegt &lt;img src=&quot;http://blog.hautzinger.info/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; - hier werden Gegenstände abfotografiert und deren Größe am Computer über ein Koordinatensystem gemessen. In &lt;a href=&quot;http://mitarbeiter.fh-heilbronn.de/~groth/Veranstaltung_VisMed.htm&quot; target=&quot;_blank&quot;&gt;Visualisierung und Mediengesign&lt;/a&gt; erstellen wir in nem sechsköpfigen Team eine 30-Seitige Homepage mit Flash-Element und in Software Entwicklungsumgebungen (SEU) geht es um die Programmiersprache C#.&lt;br /&gt;
&lt;br /&gt;
Vom Studienschwerpunkt (Technische Systeme) her fehlt mir als letztes Fach noch &lt;a href=&quot;http://mitarbeiter.fh-heilbronn.de/~doneit/embedded.html&quot; target=&quot;_blank&quot;&gt;Embedded Systems&lt;/a&gt; - hier wird ein wenig gelötet und dann ein Microcontroller programmiert.&lt;br /&gt;
&lt;br /&gt;
Zusätzlich werd ich noch das &lt;a href=&quot;http://www.hs-heilbronn.de/diehochschule/hs_aktivitaeten/studiumgenerale&quot; target=&quot;_blank&quot;&gt;Studium Generale&lt;/a&gt; machen, welches laut SPO5 (Studien Prüfungsordnung) Pflicht ist im Hauptstudium. Ein völliger Schwachsinn meiner Meinung nach... man füllt einen Zettel mit dafür angebotenen Vorlesungen aus (Eine langweiliger als die Andere) und wird dann auf eine Vorlesunge ausgelost...&lt;br /&gt;
&lt;br /&gt;
Ich habe meinen HSHN Google-Kalender freigegeben: &lt;a target=&quot;_blank&quot; href=&quot;http://www.google.com/calendar/render?cid=ff4m2msn2nllleqvrkoir875ss%40group.calendar.google.com&quot;&gt;&lt;img src=&quot;http://www.google.com/calendar/images/ext/gc_button1_de.gif&quot; border=0&gt;&lt;/a&gt;  
    </content:encoded>

    <pubDate>Sun, 18 Mar 2007 18:20:08 +0100</pubDate>
    <guid isPermaLink="false">http://blog.hautzinger.info/archives/18-guid.html</guid>
    
</item>
<item>
    <title>Gewinnspiele auf diginights.com</title>
    <link>http://blog.hautzinger.info/archives/17-Gewinnspiele-auf-diginights.com.html</link>
            <category>diginights.com</category>
            <category>PHP</category>
            <category>Symfony</category>
    
    <comments>http://blog.hautzinger.info/archives/17-Gewinnspiele-auf-diginights.com.html#comments</comments>
    <wfw:comment>http://blog.hautzinger.info/wfwcomment.php?cid=17</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://blog.hautzinger.info/rss.php?version=2.0&amp;type=comments&amp;cid=17</wfw:commentRss>
    

    <author>nospam@example.com (Christoph Hautzinger)</author>
    <content:encoded>
    Wie dem ein oder anderen Leser hier sicherlich schon aufgefallen ist, gibt es auf &lt;a href=&quot;http://diginights.com&quot; target=&quot;_blank&quot;&gt;diginights.com&lt;/a&gt; seit geraumer Zeit nun eine &lt;a href=&quot;http://diginights.com/lifestyle/lottery/list.html&quot; target=&quot;_blank&quot;&gt;Gewinnspiel-Section&lt;/a&gt;. Die grundlegende Idee dahinter war, dem User mehr Funktionalität auf der Seite zu bieten, was uns mit dieser Idee (denke ich zumindest) auch ziemlich gut gelungen ist. Um automatische Eintragungen zu verhindern wurde ein &lt;a href=&quot;http://de.wikipedia.org/wiki/Captcha&quot; target=&quot;_blank&quot;&gt;Captcha-Schutz&lt;/a&gt; eingebaut, der nun auf allen anderen Formularseiten Verwendung findet, da es in der Vergangenheit öfters vorkam, dass Spamer die Location-eintragen Seite für ihre Zwecke missbrauchten.&lt;br /&gt;
&lt;br /&gt;
In diesem Beitrag will ich aber ein wenig über die Verlosung schreiben, bzw. die der zu Grunde liegenden Logik. &lt;br /&gt;
&lt;br /&gt;
Es existieren drei von Propel generierte Klassen: &lt;em&gt;LotteryItem&lt;/em&gt; enthält die allgemeinen Infos zu einem Gewinnspiel, wie Name und Beschreibung oder das Auslosedatum, in &lt;em&gt;LotteryPrize&lt;/em&gt; finden sich die einzelnen Preise, die zu einem Gewinnspiel gewonnen werden können und &lt;em&gt;LotteryParticipant&lt;/em&gt; hält die Teilnehmer der jeweiligen Gewinnspiele. Um die Komplexität zu verringern sind die folgenden Codebeispiele auf das Nötigste gekürzt, zudem sind die PHPDoc Kommentare leider auch nicht dabei, da sie von meiner Blogsoftware in strong-Tags umgebaut werden (das muss ich mir nochmal anschauen):&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;1. Die naive Implementierung&lt;/strong&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;private &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; drawSingleLottery&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;LotteryItem &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$prizes&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getLotteryPrizes&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// TODO: this is pretty slow and should be replaced with a piece of faster code in future&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$participants&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getLotteryParticipants&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// determine winner array keys - exactly the amount of available prizes&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$winnersKeys&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array_rand&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array_rand&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$participants&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;countTotalWinnersForPrizes&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$prizes&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a href=&quot;http://www.php.net/is_array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;is_array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$winnersKeys&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$winnersKeys&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$winnersKeys&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$winners&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$j&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$prizes&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$prize&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;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// loop all prizes &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &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: #0000ff;&quot;&gt;$i&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt; &amp;lt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$prize&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getPrizeAmount&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: #0000ff;&quot;&gt;$i&lt;/span&gt;++, &lt;span style=&quot;color: #0000ff;&quot;&gt;$j&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$winner&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$participants&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$winnersKeys&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$j&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$winner&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setLotteryPrize&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$prize&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setIsDrawn&lt;/span&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;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;save&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Der Code läuft zwar, ist aber nicht schön: Die Methode &lt;em&gt;LotteryItem::getLotteryParticipants()&lt;/em&gt; liefert in einem Array sämtliche Objekte der Personen, die am Gewinnspiel teilgenommen haben. Desto mehr Teilnehmer es werden, desto langsamer wird es, da für jede Zeile des Datenbankresultats ein Objekt gebaut wird und die Instanziierung dessen eine teuere Operation ist. &lt;br /&gt;
&lt;br /&gt;
Über &lt;em&gt;array_rand()&lt;/em&gt; werden genausoviele Schlüssel dieses Arrays zurückgegeben wie die in der selben Klasse definierte Methode &lt;em&gt;countTotalWinnersForPrizes()&lt;/em&gt; zurückgibt - sie zählt die gesamte Anzahl aller zu vergebenden Preise. &lt;br /&gt;
&lt;em&gt;mixed &lt;strong&gt;array_rand&lt;/strong&gt; ( array input [, int num_req] )&lt;/em&gt; gibt ein Array mit den Schlüsseln zurück, wenn der 2. Parameter größer als 1 ist, ansonsten einen Schlüssel, also kein Array (als integer in unserem Falle), was ich an der Methodendefinition nicht besonders schön finde, da dieser Fall hier extra abgefragt werden muss.&lt;br /&gt;
&lt;br /&gt;
Zum Schluss wird über die eigentlichen Preise iteriert, jedem Gewinner einen Preis zugeordnet und das Gewinnspiel gespeichert. Konstrukte wie &lt;em&gt;$participants[$winnersKeys[$j]];&lt;/em&gt; sind unschön weil sie schwer zu lesen sind bzw. es schwer fällt, diese später wieder zu verstehen.&lt;br /&gt;
&lt;br /&gt;
Ein &lt;a href=&quot;http://de.wikipedia.org/wiki/Refactoring&quot; target=&quot;_blank&quot;&gt;Refactoring&lt;/a&gt; muss also her ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;2. Die wesentlich eleganter-/performantere Implementierung&lt;/strong&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;private &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; drawSingleLottery&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;LotteryItem &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$prizes&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getLotteryPrizes&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$winners&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;determineWinners&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// set for every winner a prize&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$winner_i&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$prizes&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$prize&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;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// loop all prizes&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &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: #0000ff;&quot;&gt;$i&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt; &amp;lt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$prize&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getPrizeAmount&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: #0000ff;&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$winner&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$winners&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$winner_i&lt;/span&gt;++&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$winner&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setLotteryPrize&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$prize&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setIsDrawn&lt;/span&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;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;save&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;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#039;Courier New&#039;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Alles, was im ersten Codefetzen hässlich war ist verschwunden und die neue Methode &lt;em&gt;LotteryItem::determineWinners()&lt;/em&gt; erblickt das Licht der Welt - diese scheint wohl direkt die Gewinner anstatt nur deren Keys zurückzuliefern, was nach einem Blic