<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Valles Blog &#8211; ValentinVoigt.info &#187; Programmieren</title>
	<atom:link href="http://www.valentinvoigt.info/category/programmieren/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.valentinvoigt.info</link>
	<description>Über das Leben eines Freaks...</description>
	<lastBuildDate>Sat, 25 Jun 2011 15:09:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>URxvt: Tabbed nur wenn mehr als ein Tab</title>
		<link>http://www.valentinvoigt.info/2011/04/urxvt-tabbed-nur-wenn-mehr-als-ein-tab/</link>
		<comments>http://www.valentinvoigt.info/2011/04/urxvt-tabbed-nur-wenn-mehr-als-ein-tab/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 16:53:38 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=300</guid>
		<description><![CDATA[Vielleicht benutzt der ein oder andere auch rxvt-unicode als Standard Terminalemulator. Ich jedenfalls mache das seit Jahren und bin sehr glücklich damit. Da ich vor einigen Wochen von Debian (mal wieder) auf Gentoo umgestiegen bin, musste ich erneut mein Terminal einrichten. Dabei fiel mir auf, dass es noch durchaus interessantere Scripts gibt als matcher. Besonders [...]]]></description>
			<content:encoded><![CDATA[<p>Vielleicht benutzt der ein oder andere auch rxvt-unicode als Standard Terminalemulator. Ich jedenfalls mache das seit Jahren und bin sehr glücklich damit. Da ich vor einigen Wochen von Debian (mal wieder) auf Gentoo umgestiegen bin, musste ich erneut mein Terminal einrichten. Dabei fiel mir auf, dass es noch durchaus interessantere Scripts gibt als <em>matcher</em>. Besonders angetan hat es mir hierbei das Script <em>tabbed</em>. Tabbed erstellt, wie der Name schon sagt, Tabs im Terminal. Diese sind via Maus oder Tastatur ganz einfach mit Shift+Left oder Shift+Right zu erreichen. Mit Shift+Down kann man einen neuen Tab erstellen. Schließen kann man die Tabs einfach, indem man wie gewöhnlich das darin laufende Programm schließt. Meistens ist das wohl bash, d.h. Ctrl+D oder <em>exit</em> schließen einen Tab.</p>
<p>Leider stört es mich ein wenig, dass die Tab-Leiste immer angezeigt wird, selbst wenn nur ein Tab offen ist. Dabei hat man einen ziemlich unnötigen Overhead, da dann in jedem Terminal völlig redundante Informationen zu sehen sind &#8211; auf Kosten einer ganzen Zeile im Terminal!^^ Da das für seine Funktionalität gar nicht mal so umfangreiche Script in Perl geschrieben ist, habe ich mich kurz rangesetzt und das Problem behoben. Die Tab-Leiste wird jetzt nur noch angezeigt, wenn mehr als ein Tab vorhanden ist. Das Ganze ist sogar über die Konfigurationsoption <em>URxvt.tabbed.hide-when-empty: true</em> einstellbar. Installiert habe ich die Version 9.10 von rxvt-unicode. Wer Interesse an dieser Funktionalität hat, kann folgenden Patch auf  <em>/usr/lib/urxvt/perl/tabbed</em> anwenden.</p>
<div class="geshi diff">
<ol>
<li class="li1">
<div class="de1"><span class="re0">5a6,<span class="nu0">10</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp;my $num_tabs = scalar @<span class="br0">&#123;</span>$self-&gt;<span class="br0">&#123;</span>tabs<span class="br0">&#125;</span><span class="br0">&#125;</span>;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp;if <span class="br0">&#40;</span>$self-&gt;<span class="br0">&#123;</span>hide<span class="br0">&#125;</span> ne <span class="nu0">0</span> and $num_tabs &lt; <span class="nu0">2</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp; &nbsp; return;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp;<span class="br0">&#125;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; </span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">77a83,<span class="nu0">87</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp;my $num_tabs = scalar @<span class="br0">&#123;</span>$self-&gt;<span class="br0">&#123;</span>tabs<span class="br0">&#125;</span><span class="br0">&#125;</span>;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp;if <span class="br0">&#40;</span>$self-&gt;<span class="br0">&#123;</span>hide<span class="br0">&#125;</span> ne <span class="nu0">0</span> and $num_tabs &lt; <span class="nu0">2</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp; &nbsp; return;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp;<span class="br0">&#125;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; </span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">225a236</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp;my $hide &nbsp;= $self-&gt;x_resource <span class="br0">&#40;</span>&quot;hide-when-empty&quot;<span class="br0">&#41;</span>;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">230a242</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp;defined $hide &nbsp;or $hide &nbsp;= <span class="nu0">0</span>;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">233a246</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">&gt; &nbsp; &nbsp;$self-&gt;<span class="br0">&#123;</span>hide<span class="br0">&#125;</span> &nbsp; &nbsp; &nbsp;= $hide;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2011/04/urxvt-tabbed-nur-wenn-mehr-als-ein-tab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metaballs, erste Optimierung</title>
		<link>http://www.valentinvoigt.info/2010/04/metaballs-erste-optimierung/</link>
		<comments>http://www.valentinvoigt.info/2010/04/metaballs-erste-optimierung/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 17:06:05 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=224</guid>
		<description><![CDATA[Okay, ich habe es also weiterhin nicht geschafft von den Metabällen die Finger zu lassen. Nach meinem ersten Versuch mit Python und Pygame, habe ich mich nun mal mit C++ und SDL an die Thematik gewagt. Das Ergebnis kann sich durchaus sehen lassen, denn jetzt läuft die Animation bei mir flüssig &#8211; auch mit mehr [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, ich habe es also weiterhin nicht geschafft von den Metabällen die Finger zu lassen. <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' />  Nach meinem <a title="erster Versuch mit Metabällen" href="http://www.valentinvoigt.info/2010/04/metaballs/" target="_blank">ersten Versuch</a> mit Python und Pygame, habe ich mich nun mal mit C++ und SDL an die Thematik gewagt. Das Ergebnis kann sich durchaus sehen lassen, denn jetzt läuft die Animation bei mir flüssig &#8211; auch mit mehr als 2 Metabällen. Zum Testen benötigt man die libsdl und die libsdl-dev, außerdem natürlich den g++. Ein make-Script in Form eines simplen Shellscripts liegt bei. <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Hier noch ein Bild:</p>
<p style="text-align: center;"><img class="size-full wp-image-236 aligncenter" title="metaball" src="http://www.valentinvoigt.info/wp-content/metaball.png" alt="" width="320" height="240" /></p>
<a href="http://www.valentinvoigt.info/wp-content/plugins/download-monitor/download.php?id=5" title="Downloaded 279 times">Metabälle in C++ (1.79 KB)</a>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2010/04/metaballs-erste-optimierung/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Metaballs</title>
		<link>http://www.valentinvoigt.info/2010/04/metaballs/</link>
		<comments>http://www.valentinvoigt.info/2010/04/metaballs/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 14:48:50 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=227</guid>
		<description><![CDATA[Per Zufall bin ich gestern und heute über den Artikel über Metabälle gestolpert. Was auf den ersten Blick ziemlich kompliziert aussieht, gestaltet sich im Prinzip gar nicht so schwer. Denn wie ich halt so bin, konnte ich leider nicht widerstehen so etwas direkt mal zu probieren. Das Ergebnis ist eine einfache Python-Animation zweier Metabälle. Endlos [...]]]></description>
			<content:encoded><![CDATA[<p>Per Zufall bin ich gestern und heute über den Artikel über <a title="Metaball" href="http://de.wikipedia.org/wiki/Metaball" target="_blank">Metabälle</a> gestolpert. Was auf den ersten Blick ziemlich kompliziert aussieht, gestaltet sich im Prinzip gar nicht so schwer. Denn wie ich halt so bin, konnte ich leider nicht widerstehen so etwas direkt mal zu probieren. Das Ergebnis ist eine einfache Python-Animation zweier Metabälle. Endlos langsam – aber funktioniert. <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Zum Zeichnen der Oberfläche benötigt man die “pygame”-Libraray, die sich (zumindest in Debian-basierten Systemen) leicht über den Packetmanager installieren lässt.</p>
<a href="http://www.valentinvoigt.info/wp-content/plugins/download-monitor/download.php?id=4" title="Downloaded 251 times">Metabälle in Python (932 bytes)</a>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2010/04/metaballs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Moderne Routing-Verfahren in PHP-Apps</title>
		<link>http://www.valentinvoigt.info/2010/02/moderne-routing-verfahren-in-php-apps/</link>
		<comments>http://www.valentinvoigt.info/2010/02/moderne-routing-verfahren-in-php-apps/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 14:19:30 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=194</guid>
		<description><![CDATA[Zwar bin ich schon seit einiger Zeit auf Python umgestiegen und versuche PHP mittlerweile weitgehenst zu vermeiden, aber dennoch wurde ich vor einigen Tagen von einem Freund gefragt, wie man heutzutage seinen URLs den richtigen Controller zuordnet. Aus lauter Langeweile, habe ich so ein relativ umfangreiches Beispiel erstellt, welches die meiner Meinung nach schönste Möglichkeit [...]]]></description>
			<content:encoded><![CDATA[<p>Zwar bin ich schon seit einiger Zeit auf Python umgestiegen und versuche PHP mittlerweile weitgehenst zu vermeiden, aber dennoch wurde ich vor einigen Tagen <a href="http://www.greenalien.de/">von einem Freund</a> gefragt, wie man heutzutage seinen URLs den richtigen Controller zuordnet. Aus lauter Langeweile, habe ich so ein relativ umfangreiches Beispiel erstellt, welches die meiner Meinung nach schönste Möglichkeit aufzeigt.</p>
<p>Undzwar besteht diese aus einer Tabelle, welche mit Hilfe von Regulären Ausdrücken, URLs einen bestimmten Controller (im Beispiel eine einfache Datei) zuordnet. Die Regex-Tabelle hat den Vorteil, eine zentral gelegene, leicht zu ändernde und flexible Möglichkeit zum Registrieren von URLs zu bieten. Weiterhin werden GET-Parameter in Forum von URI-Komponenten (z.B. &#8220;username&#8221; in <em>/profile/username/view</em>) direkt mit geparst und in ein einfach zu bedienendes Array (hier: $matches) gepackt.</p>
<p>Kurze Erklärung, wie man das Script benutzen kann. Man erstellt sich einen Ordner mit beliebigem Namen auf dem eigenen Webserver. Dort erstellt man eine Datei, welche zwingend index.php heißen muss mit dem gleich folgenden Inhalt. Außerdem benötigt man eine Datei namens <em>.htaccess</em>, welche den in der index.php als Kommentar vorhanden Code enthält. Nachdem das getan ist, muss die Variable $url_prefix noch angepasst werden. Diese muss die URI enthalten, unter dem die index.php (bzw. deren übergeordneter Ordner) erreichbar ist. In meinem Beispiel ist dies /test/. wichtig ist der abschließende Slash! anschließend probiert man einfach mal die in der $urls-Variable angegebenen URLs aus.</p>
<p><span id="more-194"></span></p>
<div class="geshi php">
<div class="head">Beispiel für einen modernen URL Resolver</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Inhalt der .htaccess.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">/*</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">RewriteEngine On</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">RewriteCond %{REQUEST_FILENAME} -s [OR]</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">RewriteCond %{REQUEST_FILENAME} -l [OR]</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">RewriteCond %{REQUEST_FILENAME} -d</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">RewriteRule ^.*$ – [NC,L]</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">RewriteRule ^.*$ index.php [NC,L]</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">*/</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Das hier gehört eher in eine Konfigurations-Datei.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$url_prefix</span> <span class="sy0">=</span> <span class="st0">&#39;/test/&#39;</span><span class="sy0">;</span> <span class="co1">// Oder: &quot;/&quot; für root-Verzeichnis</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$urls</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&#39;^$&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;content/index.php&#39;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&#39;^forum$&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;content/forum.php&#39;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="st0">&#39;^profile/(?P&lt;user&gt;.+)&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;content/profile.php&#39;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Und das gehört in den URL-Resolver (extra Datei oder einfach index.php).</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Schneidet aus der URL den führenden Slash und den Prefix weg.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$uri</span> <span class="sy0">=</span> <span class="kw3">substr</span><span class="br0">&#40;</span><span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&#39;REQUEST_URI&#39;</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="kw3">strlen</span><span class="br0">&#40;</span><span class="re1">$url_prefix</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$page_found</span> <span class="sy0">=</span> <span class="kw2">False</span><span class="sy0">;</span> <span class="co1">// Dateiname falls gefunden, sonst False.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re1">$urls</span> <span class="kw1">as</span> <span class="re1">$regex</span> <span class="sy0">=&gt;</span> <span class="re1">$file</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">// Eine Regex muss von Delimitern eingegrenzt werden. Wir nehmen den</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">// Slash, indem wir diesem drumherum setzen und alle vorkommenden Slashs</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">// escapen.</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$regex</span> <span class="sy0">=</span> <span class="st0">&#39;/&#39;</span> <span class="sy0">.</span> <span class="kw3">str_replace</span><span class="br0">&#40;</span><span class="st0">&#39;/&#39;</span><span class="sy0">,</span> <span class="st0">&#39;<span class="es0">\/</span>&#39;</span><span class="sy0">,</span> <span class="re1">$regex</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st0">&#39;/&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">preg_match</span><span class="br0">&#40;</span><span class="re1">$regex</span><span class="sy0">,</span> <span class="re1">$uri</span><span class="sy0">,</span> <span class="re1">$matches</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$page_found</span> <span class="sy0">=</span> <span class="re1">$file</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Ganz wichtig wenn ein passender Eintrag gefunden wurde!</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Nur zu Debugging-Zwecken:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">header</span><span class="br0">&#40;</span><span class="st0">&#39;Content-Type: text/plain&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span> <span class="kw3">is_string</span><span class="br0">&#40;</span><span class="re1">$page_found</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">header</span><span class="br0">&#40;</span><span class="st0">&#39;HTTP/1.1 404 Not Found&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">die</span><span class="br0">&#40;</span><span class="st0">&quot;Error 404 &#8211; File not found:<span class="es0">\n</span>&quot;</span> <span class="sy0">.</span> <span class="re1">$uri</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">print_r</span><span class="br0">&#40;</span><span class="re1">$matches</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">// Zecks Debug auskommentiert&#8230;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//require $file;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2010/02/moderne-routing-verfahren-in-php-apps/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bastelstunde: Schöne URLs</title>
		<link>http://www.valentinvoigt.info/2010/02/bastelstunde-schone-urls/</link>
		<comments>http://www.valentinvoigt.info/2010/02/bastelstunde-schone-urls/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 20:50:12 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=185</guid>
		<description><![CDATA[Durch Zufall bin ich heute auf einen Thread in meinem Forum gestoßen. Dieser Thread hat mich direkt dazu gebracht, eine Funktion zu erstellen, die aus Thread-Titel (oder ähnlichem) URL-taugliche Strings macht. Sie ist wahrscheinlich nicht 100%ig komplett und entspricht auch nicht Jedermans Geschmack, aber ich wollte sie trotzdem mal veröffentlichen. In Aktion kann man das [...]]]></description>
			<content:encoded><![CDATA[<p>Durch Zufall bin ich heute auf <a href="http://www.ibitlive.eu/index.php?p=showthread&amp;id=2410">einen Thread</a> in meinem Forum gestoßen. Dieser Thread hat mich direkt dazu gebracht, eine Funktion zu erstellen, die aus Thread-Titel (oder ähnlichem) URL-taugliche Strings macht. Sie ist wahrscheinlich nicht 100%ig komplett und entspricht auch nicht Jedermans Geschmack, aber ich wollte sie trotzdem mal veröffentlichen. In Aktion kann man das Script <a href="http://www.ibitlive.eu/last-threads-urlname.php">hier</a> bewundern.</p>
<div class="geshi php">
<div class="head">Funktion zum Erstellen von URLs aus Thread-Titeln</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> make_urlname<span class="br0">&#40;</span><span class="re1">$name</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="coMULTI">/* Schritt 1: Kleinbuchstaben */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$name</span> <span class="sy0">=</span> <span class="kw3">strtolower</span><span class="br0">&#40;</span><span class="re1">$name</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="coMULTI">/* Schritt 2: Ausgewählte Zeichen ersetzen */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$name</span> <span class="sy0">=</span> <span class="kw3">str_replace</span><span class="br0">&#40;</span><span class="st0">&quot; &quot;</span><span class="sy0">,</span> <span class="st0">&quot;-&quot;</span><span class="sy0">,</span> <span class="re1">$name</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$name</span> <span class="sy0">=</span> <span class="kw3">str_replace</span><span class="br0">&#40;</span><span class="st0">&quot;ß&quot;</span><span class="sy0">,</span> <span class="st0">&quot;ss&quot;</span><span class="sy0">,</span> <span class="re1">$name</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$name</span> <span class="sy0">=</span> <span class="kw3">str_replace</span><span class="br0">&#40;</span><span class="st0">&quot;ä&quot;</span><span class="sy0">,</span> <span class="st0">&quot;ae&quot;</span><span class="sy0">,</span> <span class="re1">$name</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$name</span> <span class="sy0">=</span> <span class="kw3">str_replace</span><span class="br0">&#40;</span><span class="st0">&quot;ö&quot;</span><span class="sy0">,</span> <span class="st0">&quot;oe&quot;</span><span class="sy0">,</span> <span class="re1">$name</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$name</span> <span class="sy0">=</span> <span class="kw3">str_replace</span><span class="br0">&#40;</span><span class="st0">&quot;ü&quot;</span><span class="sy0">,</span> <span class="st0">&quot;ue&quot;</span><span class="sy0">,</span> <span class="re1">$name</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="coMULTI">/* Schritt 3: Alles andere entfernen */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$whitelist</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="st0">&#39;a&#39;</span><span class="sy0">,</span> <span class="st0">&#39;b&#39;</span><span class="sy0">,</span> <span class="st0">&#39;c&#39;</span><span class="sy0">,</span> <span class="st0">&#39;d&#39;</span><span class="sy0">,</span> <span class="st0">&#39;e&#39;</span><span class="sy0">,</span> <span class="st0">&#39;f&#39;</span><span class="sy0">,</span> <span class="st0">&#39;g&#39;</span><span class="sy0">,</span> <span class="st0">&#39;h&#39;</span><span class="sy0">,</span> <span class="st0">&#39;i&#39;</span><span class="sy0">,</span> <span class="st0">&#39;j&#39;</span><span class="sy0">,</span> <span class="st0">&#39;k&#39;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;l&#39;</span><span class="sy0">,</span> <span class="st0">&#39;m&#39;</span><span class="sy0">,</span> <span class="st0">&#39;n&#39;</span><span class="sy0">,</span> <span class="st0">&#39;o&#39;</span><span class="sy0">,</span> <span class="st0">&#39;p&#39;</span><span class="sy0">,</span> <span class="st0">&#39;q&#39;</span><span class="sy0">,</span> <span class="st0">&#39;r&#39;</span><span class="sy0">,</span> <span class="st0">&#39;s&#39;</span><span class="sy0">,</span> <span class="st0">&#39;t&#39;</span><span class="sy0">,</span> <span class="st0">&#39;u&#39;</span><span class="sy0">,</span> <span class="st0">&#39;v&#39;</span><span class="sy0">,</span> <span class="st0">&#39;w&#39;</span><span class="sy0">,</span> <span class="st0">&#39;x&#39;</span><span class="sy0">,</span> <span class="st0">&#39;y&#39;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;z&#39;</span><span class="sy0">,</span> <span class="st0">&#39;0&#39;</span><span class="sy0">,</span> <span class="st0">&#39;1&#39;</span><span class="sy0">,</span> <span class="st0">&#39;2&#39;</span><span class="sy0">,</span> <span class="st0">&#39;3&#39;</span><span class="sy0">,</span> <span class="st0">&#39;4&#39;</span><span class="sy0">,</span> <span class="st0">&#39;5&#39;</span><span class="sy0">,</span> <span class="st0">&#39;6&#39;</span><span class="sy0">,</span> <span class="st0">&#39;7&#39;</span><span class="sy0">,</span> <span class="st0">&#39;8&#39;</span><span class="sy0">,</span> <span class="st0">&#39;9&#39;</span><span class="sy0">,</span> <span class="st0">&#39;-&#39;</span><span class="sy0">,</span> <span class="st0">&#39;+&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$name_tmp</span> <span class="sy0">=</span> <span class="st0">&quot;&quot;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="re1">$i</span><span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span> <span class="re1">$i</span><span class="sy0">&lt;</span>strlen<span class="br0">&#40;</span><span class="re1">$name</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re1">$i</span><span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$char</span> <span class="sy0">=</span> <span class="kw3">substr</span><span class="br0">&#40;</span><span class="re1">$name</span><span class="sy0">,</span> <span class="re1">$i</span><span class="sy0">,</span> <span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">in_array</span><span class="br0">&#40;</span><span class="re1">$char</span><span class="sy0">,</span> <span class="re1">$whitelist</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$name_tmp</span> <span class="sy0">.=</span> <span class="re1">$char</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="coMULTI">/* Schritt 4: Doppelte Leerzeichen entfernen */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re1">$count</span> <span class="sy0">=</span> <span class="nu0">-1</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span><span class="re1">$count</span> <span class="sy0">!=</span> <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/* Irgendwie macht WP hier nur ein Minus draus, daher so&#8230; */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$name_tmp</span> <span class="sy0">=</span> <span class="kw3">str_replace</span><span class="br0">&#40;</span><span class="st0">&#39;-&#39;</span> <span class="sy0">.</span> <span class="st0">&#39;-&#39;</span><span class="sy0">,</span> <span class="st0">&#39;-&#39;</span><span class="sy0">,</span> <span class="re1">$name_tmp</span><span class="sy0">,</span> <span class="re1">$count</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="coMULTI">/* Schritt 5: Leerzeichen (d.h. &#39;-&#39;) am Anfang und am Ende entfernen */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">trim</span><span class="br0">&#40;</span><span class="re1">$name_tmp</span><span class="sy0">,</span> <span class="st0">&#39;-&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p><strong>Update:</strong> Für eine Übersetzung in die Programmiersprache Python bitte auf <em>mehr</em> klicken. <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p><span id="more-185"></span></p>
<div class="geshi no python">
<div class="head">Python-Übersetzung</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw1">def</span> make_urlname<span class="br0">&#40;</span>name<span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1"># Schritt 1: Kleinbuchstaben</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; name = name.<span class="me1">lower</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1"># Schritt 2: Ausgewählte Zeichen ersetzen</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; replaces = <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; u<span class="st0">&#39; &#39;</span>: u<span class="st0">&#39;-&#39;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; u<span class="st0">&#39;ß&#39;</span>: u<span class="st0">&#39;ss&#39;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; u<span class="st0">&#39;ä&#39;</span>: u<span class="st0">&#39;ae&#39;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; u<span class="st0">&#39;ö&#39;</span>: u<span class="st0">&#39;oe&#39;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; u<span class="st0">&#39;ü&#39;</span>: u<span class="st0">&#39;ue&#39;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">for</span> search, replace <span class="kw1">in</span> replaces.<span class="me1">iteritems</span><span class="br0">&#40;</span><span class="br0">&#41;</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; name = name.<span class="me1">replace</span><span class="br0">&#40;</span>search, replace<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1"># Schritt 3: Alles andere entfernen</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; whitelist = <span class="br0">&#40;</span><span class="st0">&#39;a&#39;</span>, <span class="st0">&#39;b&#39;</span>, <span class="st0">&#39;c&#39;</span>, &nbsp;<span class="st0">&#39;d&#39;</span>, <span class="st0">&#39;e&#39;</span>, <span class="st0">&#39;f&#39;</span>, <span class="st0">&#39;g&#39;</span>, &nbsp;<span class="st0">&#39;h&#39;</span>, <span class="st0">&#39;i&#39;</span>, <span class="st0">&#39;j&#39;</span>, <span class="st0">&#39;k&#39;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;l&#39;</span>, <span class="st0">&#39;m&#39;</span>, <span class="st0">&#39;n&#39;</span>, &nbsp;<span class="st0">&#39;o&#39;</span>, <span class="st0">&#39;p&#39;</span>, <span class="st0">&#39;q&#39;</span>, <span class="st0">&#39;r&#39;</span>, &nbsp;<span class="st0">&#39;s&#39;</span>, <span class="st0">&#39;t&#39;</span>, <span class="st0">&#39;u&#39;</span>, <span class="st0">&#39;v&#39;</span>, &nbsp;<span class="st0">&#39;w&#39;</span>, <span class="st0">&#39;x&#39;</span>, <span class="st0">&#39;y&#39;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;z&#39;</span>, <span class="st0">&#39;0&#39;</span>, <span class="st0">&#39;1&#39;</span>, &nbsp;<span class="st0">&#39;2&#39;</span>, <span class="st0">&#39;3&#39;</span>, <span class="st0">&#39;4&#39;</span>, <span class="st0">&#39;5&#39;</span>, &nbsp;<span class="st0">&#39;6&#39;</span>, <span class="st0">&#39;7&#39;</span>, <span class="st0">&#39;8&#39;</span>, <span class="st0">&#39;9&#39;</span>, &nbsp;<span class="st0">&#39;-&#39;</span>, <span class="st0">&#39;+&#39;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; new_name = <span class="st0">&#39;&#39;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">for</span> char <span class="kw1">in</span> name:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> whitelist.<span class="me1">count</span><span class="br0">&#40;</span>char<span class="br0">&#41;</span> <span class="sy0">&gt;</span> <span class="nu0">0</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_name += char</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1"># Schritt 4: Doppelte Leerzeichen entfernen</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">while</span> new_name.<span class="me1">count</span><span class="br0">&#40;</span><span class="st0">&#39;&#8211;&#39;</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> <span class="nu0">0</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; new_name = new_name.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&#39;&#8211;&#39;</span>, <span class="st0">&#39;-&#39;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1"># Schritt 5: Leerzeichen (d.h. &#39;-&#39;) am Anfang und am Ende entfernen</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> new_name.<span class="me1">strip</span><span class="br0">&#40;</span><span class="st0">&#39;-&#39;</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2010/02/bastelstunde-schone-urls/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Mal wieder: Die IDE</title>
		<link>http://www.valentinvoigt.info/2010/01/mal-wieder-die-ide/</link>
		<comments>http://www.valentinvoigt.info/2010/01/mal-wieder-die-ide/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 20:21:51 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=178</guid>
		<description><![CDATA[Da doch des Programmierers wichtigestes Tool, ist es mir durchaus wert, mal wieder was über die IDE zu schreiben. Ich bin schon über massenweise IDEs gestolpert, von einfach gehaltenen wie Kate oder Notepad++ bis zu Monstern wie Eclipse oder NetBeans. Aber irgendwie war das auf Dauer alles nicht das Wahre. Jetzt benutze ich schon seit [...]]]></description>
			<content:encoded><![CDATA[<p>Da doch des Programmierers wichtigestes Tool, ist es mir durchaus wert, mal wieder was über die IDE zu schreiben. Ich bin schon über massenweise IDEs gestolpert, von einfach gehaltenen wie Kate oder Notepad++ bis zu Monstern wie Eclipse oder NetBeans. Aber irgendwie war das auf Dauer alles nicht das Wahre. Jetzt benutze ich schon seit fast einem Jahr Vim. Und bin wirklich begeistert, wie viele Möglichkeiten man doch haben kann, auch ohne mehrere Hundert Megabyte IDE mit sich rum schleppen zu müssen. Auch wenn besonders anfangs die Eingewöhnung mehr als umständlich war, so kann man doch nun schon eher von effizientem Arbeiten reden.</p>
<p>Heute habe ich meinem Terminal <em>urxvt</em> einen Patch spendiert, der es ermöglich statt nur 16 jetzt 256 Farbein zu verwenden. Ich war es einfach Leid, mir die sehr hässlichen Default Farben von vim anzuschauen. Besonders das so genannte &#8220;cyan&#8221; tat bei vollen CSS-Dateien schon richtig weh. Zwar bin ich mir jetzt noch nicht ganz sicher, welches Colorscheme ich verwenden werde, aber das ist wohl eher ein geringeres Problem. <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Hier jetzt mal ein Screenshot, wie es aktuell aussieht.</p>
<div id="attachment_179" class="wp-caption aligncenter" style="width: 190px"><a href="http://www.valentinvoigt.info/wp-content/2010-01-31-21-14-38.png"><img class="size-medium wp-image-179 " title="2010-01-31-21-14-38" src="http://www.valentinvoigt.info/wp-content/2010-01-31-21-14-38-300x240.png" alt="VIM" width="180" height="144" /></a><p class="wp-caption-text">VIM</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2010/01/mal-wieder-die-ide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IMAP, fetchmail und mehr</title>
		<link>http://www.valentinvoigt.info/2009/05/imap-fetchmail-und-mehr/</link>
		<comments>http://www.valentinvoigt.info/2009/05/imap-fetchmail-und-mehr/#comments</comments>
		<pubDate>Wed, 20 May 2009 19:29:11 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=172</guid>
		<description><![CDATA[Nachdem ich nun schon lange nichts mehr geschrieben habe, berichte ich mal wieder über meinen stetig wachsenden Homeserver, der langsam anfängt echt nützliche Dinge für mich zu erledigen. Seit einigen Wochen nun habe ich ein neues System, meine E-Mails abzurufen. Auf dem Server läuft nun das Programm fetchmail. Fetchmail ist ein Perl-Script, welches in regelmäßigen [...]]]></description>
			<content:encoded><![CDATA[<p>Nachdem ich nun schon lange nichts mehr geschrieben habe, berichte ich mal wieder über meinen stetig wachsenden Homeserver, der langsam anfängt echt nützliche Dinge für mich zu erledigen. <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
<p>Seit einigen Wochen nun habe ich ein neues System, meine E-Mails abzurufen. Auf dem Server läuft nun das Programm fetchmail. Fetchmail ist ein Perl-Script, welches in regelmäßigen Abständen die Mails einer Mailbox abfragt und entsprechend weiterleitet. In meinem Fall checkt fetchmail alle fünf Minuten die Mails auf meinem GMX E-Mail Account und sendet sie an die lokal laufende Postfix Instanz. Wer es nicht weiß, Postfix ist ein Mailserver. <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
<p>Postfix hat seit kurzer Zeit jetzt auch einen Spamfilter, genauer gesagt <em>SpamAssassin</em>. Dieser Spamfilter kann zwar auch Spam aussortieren, ich habe mich aber dazu entschieden, meinen Spam vorerst nur mit einer Änderung des Betreffs zu markieren. Damit möchte ich jetzt erst einmal testen, wie zuverlässig SpamAssassin Spam von nicht-Spam unterscheidet. Später dann kann ich Spam auch direkt löschen lassen. Bei meiner bisherigen Menge hingegen lohnt sich das noch nicht.</p>
<p>Um jetzt meine E-Mails von Postfix auf meine E-Mail-Clients zu bekommen, habe ich außerdem noch einen IMAP-Server installiert, genannt Courier. Courier erlaubt es mir, meine Ordnerstruktur für E-Mails und die E-Mails selbst direkt auf dem Server zu behalten und erleichtert mir somit die Synchronisierung der Mail-Clients enorm. Die gespeicherten Mails liegen außerdem noch in einer RAID1-Partition, was damit also auch die Sicherheit der Daten erhöht. </p>
<p>Neben Courier habe ich außerdem schon seit längerem noch einen Webserver laufen. Auf diesem Webserver befindet sich jetzt seit wenigen Tagen auch eine SquirrelMail-Installation. Mittels SquirrelMail ist die Mobilität meines E-Mail Accounts jetzt komplett. SquirrelMail ist ein Webinterface für IMAP-Accounts. Damit kann ich nun von jedem beliebigen Ort der Welt (Internetanbindung vorausgesetzt) meine E-Mails samt Ordnerstruktur abrufen. <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>Vor lauter Langeweile habe ich heute außerdem noch einen kleinen Python-Bot hinzugefügt. Okay, zugegeben, eigentlich braucht man das nicht. Aber es ist auf jeden Fall mal wieder eine neue Erfahrung. Dieser Bot ist dauerhaft in meinen Jabber-Account eingeloggt und wartet mit Hilfe von FAM auf eine Änderung der Mailserver-Logs. Sollte er eine Änderung feststellen, werden die neuen Zeilen ausgelesen und auf ein Regular Expression überprüft. Konnte der RegEx angewendet werden, so werde ich via Jabber sofort über den Erhalt neuer Mails informiert. Das Ganze kann bei GMX-Mails natürlich bis zu fünf Minuten dauern, da fetchmail leider auf Polling zurückgreifen muss. Bei lokalen Mails hingegen bekomme ich fast eine Realtime-Benachrichtigung. Dinge, die die Welt nicht braucht, nicht wahr? <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2009/05/imap-fetchmail-und-mehr/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP-Klasse zum Lesen und Schreiben von INIs</title>
		<link>http://www.valentinvoigt.info/2008/11/php-klasse-zum-lesen-und-schreiben-von-inis/</link>
		<comments>http://www.valentinvoigt.info/2008/11/php-klasse-zum-lesen-und-schreiben-von-inis/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 22:22:12 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=140</guid>
		<description><![CDATA[Hello World. Braucht jemand eine PHP-Klasse zum Lesen und Schreiben von Ini-Dateien? Habe heute mal eine geschrieben, da ich diese wahrscheinlich demnächst mal benötigen werde. Die Datei hat knapp über 300 Zeilen und ist gut Dokumentiert. Ich habe sie mal hochgeladen, vielleicht braucht das jemand.]]></description>
			<content:encoded><![CDATA[<p>Hello World. Braucht jemand eine PHP-Klasse zum Lesen und Schreiben von Ini-Dateien? Habe heute mal eine geschrieben, da ich diese wahrscheinlich demnächst mal benötigen werde. Die Datei hat knapp über 300 Zeilen und ist gut Dokumentiert. Ich habe sie mal hochgeladen, vielleicht braucht das jemand. <img src='http://www.valentinvoigt.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<a href="http://www.valentinvoigt.info/wp-content/plugins/download-monitor/download.php?id=3" title="Downloaded 418 times"><img alt="zip" title="zip" class="download-icon" src="http://www.valentinvoigt.info/wp-content/plugins/download-monitor/img/filetype_icons/document-zipper.png" /> Read/write PHP Ini-class (3.19 KB, zip)</a>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2008/11/php-klasse-zum-lesen-und-schreiben-von-inis/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Collectd und rrdtool</title>
		<link>http://www.valentinvoigt.info/2008/11/collectd-und-rrdtool/</link>
		<comments>http://www.valentinvoigt.info/2008/11/collectd-und-rrdtool/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 20:03:16 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=118</guid>
		<description><![CDATA[Endlich habe ich mal ein schönes Programm zum Überwachen der Performance eines Computers gefunden. Das Programm nennt sich collectd. Der Collectd selbst, speichert nur die Daten in regelmäßigen Abständen (Ich glabe es sind 15 Sekunden per default) in mehrere Dateien. Diese Dateien sind im so genannten Round Robin Database-Format. Mit Hilfe des Prorgamms rrdtool kannn [...]]]></description>
			<content:encoded><![CDATA[<p>Endlich habe ich mal ein schönes Programm zum Überwachen der Performance eines Computers gefunden. Das Programm nennt sich <em>collectd</em>. Der Collectd selbst, speichert nur die Daten in regelmäßigen Abständen (Ich glabe es sind 15 Sekunden per default) in mehrere Dateien. Diese Dateien sind im so genannten <em>Round Robin Database</em>-Format. Mit Hilfe des Prorgamms <em>rrdtool</em> kannn man dann relativ einfach eine graphische Darstellung dieser Daten erstellen. Das <a title="collectd and rrdtool graph" href="http://dev.ibitlive.eu/dev/rrd/" target="_blank">rrdtool in Aktion</a> kann man hier sehen. Dazu mal ein kleiner Beispiel-Code, der mir einen Graphen über den Verlauf des Load-Averages der letzten 24 Stunden erstellt.</p>
<div class="geshi no bash">
<div class="head">Graph eines Load-Average der letzten 24h</div>
<ol>
<li class="li1">
<div class="de1">rrdtool graph <span class="st0">&quot;/var/www/user/de/dev/htdocs/dev/rrd/load.png&quot;</span> &#8211;start -24h &#8211;en</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &#8211;title <span class="st0">&quot;load average &#8211; last 24h&quot;</span> \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; DEF:<span class="re2">shortterm=</span><span class="sy0">/</span>var<span class="sy0">/</span>lib<span class="sy0">/</span>collectd<span class="sy0">/</span>load.rrd:shortterm:AVERAGE \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; DEF:<span class="re2">midterm=</span><span class="sy0">/</span>var<span class="sy0">/</span>lib<span class="sy0">/</span>collectd<span class="sy0">/</span>load.rrd:midterm:AVERAGE \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; DEF:<span class="re2">longterm=</span><span class="sy0">/</span>var<span class="sy0">/</span>lib<span class="sy0">/</span>collectd<span class="sy0">/</span>load.rrd:longterm:AVERAGE \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; LINE1:shortterm<span class="co0">#00CC00:&quot;last minute&quot; \</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; LINE1:midterm<span class="co0">#FF0000:&quot;last five minutes&quot; \</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; LINE1:longterm<span class="co0">#0000FF:&quot;last fifteen minutes&quot;</span></div>
</li>
</ol>
</div>
<p>Man kann jetzt damit also recht detailiert seine Graphen erstellen lassen. Ich habe mir dazu gleich ein ganzes Shell-Script geschrieben, dem ich einen Parameter mitgebe, der angibt, von welchem Zeitpunkt an bis jetzt der Graph erstellt werden soll. Das Script könnt ihr euch (mit einer PHP-Datei zur Anzeige auf einem Webserver) nach Bedarf gerne einmal runterladen.</p>
<a href="http://www.valentinvoigt.info/wp-content/plugins/download-monitor/download.php?id=2" title="Downloaded 367 times"><img alt="zip" title="zip" class="download-icon" src="http://www.valentinvoigt.info/wp-content/plugins/download-monitor/img/filetype_icons/document-zipper.png" /> Collectd And Rrdtool (1.54 KB, zip)</a>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2008/11/collectd-und-rrdtool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Die perfekte IDE?</title>
		<link>http://www.valentinvoigt.info/2008/11/die-perfekte-ide/</link>
		<comments>http://www.valentinvoigt.info/2008/11/die-perfekte-ide/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 20:46:30 +0000</pubDate>
		<dc:creator>Valle</dc:creator>
				<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://www.valentinvoigt.info/?p=115</guid>
		<description><![CDATA[Es war mal wieder Zeit, mir eine gescheite IDE zu suchen. Jetzt, wo meine Projekte größeren Umfang annehmen und ein normaler Editor nicht mehr reicht (zumindest wenn man trotzdem komfortabel arbeiten will). Die Suche war echt lang. Viele IDEs haben viele tolle Features, aber eben auch Bugs oder fehlende Features, auf die ich nicht verzichten [...]]]></description>
			<content:encoded><![CDATA[<p>Es war mal wieder Zeit, mir eine gescheite IDE zu suchen. Jetzt, wo meine Projekte größeren Umfang annehmen und ein normaler Editor nicht mehr reicht (zumindest wenn man trotzdem komfortabel arbeiten will). Die Suche war echt lang. Viele IDEs haben viele tolle Features, aber eben auch Bugs oder fehlende Features, auf die ich nicht verzichten kann. Jetzt habe ich mich aber vorerst mal entschieden.</p>
<p>And the winner is&#8230; Eclipse. Naja, wen wundert&#8217;s. Eclipse gehört wohl zu den größten, besten und bekanntesten IDEs. Alles, was ich mir so vorgestellt habe (Projekt Manager, SVN integration, Outline) ist da drin und wartet nun noch darauf von mir getestet zu werden. Ich habe mich den heutigen Nachmittag zwar schon recht gut eingearbeitet, aber Eclipse ist so groß, dass ich wohl nichtmal 10% aller Funktionen testen konnte. Ich will mal einen kleinen Screenshot zeigen, damit man sich unter Eclipse was vorstellen kann.</p>
<div id="attachment_116" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.valentinvoigt.info/wp-content/solaesstsichsarbeiten.png"><img class="size-medium wp-image-116" title="So lässt sich's arbeiten" src="http://www.valentinvoigt.info/wp-content/solaesstsichsarbeiten-300x224.png" alt="Eclipse IDE" width="300" height="224" /></a><p class="wp-caption-text">Eclipse IDE</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.valentinvoigt.info/2008/11/die-perfekte-ide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

