<?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>Makura no Soshi</title>
	<atom:link href="http://mschuette.name/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://mschuette.name/wp</link>
	<description>枕草子</description>
	<lastBuildDate>Sat, 06 Mar 2010 17:39:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mailing List Statistics</title>
		<link>http://mschuette.name/wp/2010/03/06/mailing-list-statistics/</link>
		<comments>http://mschuette.name/wp/2010/03/06/mailing-list-statistics/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 17:39:42 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[E-Mail]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[statistic]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=481</guid>
		<description><![CDATA[Recently a friend showed me the tool MailListStat to generate mailing list statistics and I thought it would be much easier to implement this in Perl or Python instead of C.
So I tried and the result is Py-MailListStat 1.0 (I am not very creative with names). Maybe someone finds it useful&#8230;

Py-MailListStat 1.0
example output for the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently a friend showed me the tool <a href="http://www.marki-online.net/MLS/">MailListStat</a> to generate mailing list statistics and I thought it would be much easier to implement this in Perl or Python instead of C.<br />
So I tried and the result is Py-MailListStat 1.0 (I am not very creative with names). Maybe someone finds it useful&#8230;</p>
<ul>
<li><a href="http://mschuette.name/files/mls-1.0.py">Py-MailListStat 1.0</a></li>
<li><a href="http://mschuette.name/files/mls.amavisd.out.txt">example output for the amavis-user list</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2010/03/06/mailing-list-statistics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox 3.6 und die Tabs</title>
		<link>http://mschuette.name/wp/2010/02/19/firefox-3-6-und-die-tabs/</link>
		<comments>http://mschuette.name/wp/2010/02/19/firefox-3-6-und-die-tabs/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 12:20:24 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Digital]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[tabs]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=477</guid>
		<description><![CDATA[Wer viele Tabs benutzt findet das Update auf Firefox 3.6 vermutlich verwirrend,  den neue Tabs werden nun nicht mehr am Ende der Tab-Liste, sondern direkt nach dem aktuellen Tab eingefügt. Wenn man dann auch noch öfters zwischen Tabs hin- und herwechselt, wird&#8217;s so völlig unübersichtlich.
Um das bisherige Verhalten wiederherzustellen lässt sich unter about:config die Option [...]]]></description>
			<content:encoded><![CDATA[<p>Wer viele Tabs benutzt findet das Update auf Firefox 3.6 vermutlich verwirrend,  den neue Tabs werden nun nicht mehr am Ende der Tab-Liste, sondern direkt nach dem aktuellen Tab eingefügt. Wenn man dann auch noch öfters zwischen Tabs hin- und herwechselt, wird&#8217;s so völlig unübersichtlich.</p>
<p>Um das bisherige Verhalten wiederherzustellen lässt sich unter <code>about:config</code> die Option <code>browser.tabs.insertRelatedAfterCurrent</code> auf false stellen.</p>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2010/02/19/firefox-3-6-und-die-tabs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Radio Free Albemuth</title>
		<link>http://mschuette.name/wp/2010/01/29/radio-free-albemuth/</link>
		<comments>http://mschuette.name/wp/2010/01/29/radio-free-albemuth/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 18:11:33 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Film]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[cinema]]></category>
		<category><![CDATA[pkd]]></category>
		<category><![CDATA[science-fiction]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=472</guid>
		<description><![CDATA[Last week I read Philip K. Dick&#8217;s novel ‘Radio Free Albemuth’. Today I am nicely surprised to see on io9 there is a movie adaptation of it by John Alan Simon (dickien.fr has a nice interview with him).
It also reminds me that I still have not watched the movie of ‘A Scanner Darkly’. :-/
]]></description>
			<content:encoded><![CDATA[<p>Last week I read Philip K. Dick&#8217;s novel <em>‘Radio Free Albemuth</em>’. Today I am nicely surprised to see on <a href="http://io9.com/5459233/sneak-peek-at-upcoming-philip-k-dick-movie">io9</a> there is a movie adaptation of it by John Alan Simon (dickien.fr has a nice <a href="http://www.dickien.fr/dossiers/johnalansimon/john-alan-simon-2008.html">interview</a> with him).</p>
<p>It also reminds me that I still have not watched the movie of <em>‘</em><em>A Scanner Darkly</em>’. <code>:-/</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2010/01/29/radio-free-albemuth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Acht Wochen Kater</title>
		<link>http://mschuette.name/wp/2010/01/15/acht-wochen-kater/</link>
		<comments>http://mschuette.name/wp/2010/01/15/acht-wochen-kater/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 08:13:27 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Verschiedenes]]></category>
		<category><![CDATA[kater]]></category>
		<category><![CDATA[katze]]></category>
		<category><![CDATA[wg]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=466</guid>
		<description><![CDATA[Diese Woche ist ein temporärer feliner Mitbewohner ausgezogen. Nachdem er für acht Wochen in unserer WG Unterkunft fand, lebt er jetzt mit seiner Besitzerin in neuem Zuhause.

Unsere Wohnung wurde damit gleich leerer, so ohne Katzenklo und Kratzbaum, und lebloser, so ohne dass einem der Tiger beim Heimkommen entgegenkommt und beim Arbeiten auf den Schreibtisch springt. [...]]]></description>
			<content:encoded><![CDATA[<p>Diese Woche ist ein temporärer feliner Mitbewohner ausgezogen. Nachdem er für acht Wochen in unserer WG Unterkunft fand, lebt er jetzt mit seiner Besitzerin in neuem Zuhause.</p>
<p><span id="more-466"></span></p>
<p>Unsere Wohnung wurde damit gleich leerer, so ohne Katzenklo und Kratzbaum, und lebloser, so ohne dass einem der Tiger beim Heimkommen entgegenkommt und beim Arbeiten auf den Schreibtisch springt. Dafür dürfen jetzt wieder alle Türen geschlossen und Zeug in der Küche stehengelassen werden. :)</p>
<p>Und weil&#8217;s ausnahmsweise zum Eintrag passt poste ich hier einmal Katzenbilder, nein schlimmer noch, – ein Katzenvideo (via <a href="http://theparkbencher.blogspot.com/2010/01/who-hasnt-wanted-to-gift-wrap-their-cat.html">The Park Bench</a>):<br />
<object style="width: 700px; height: 421px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="700" height="421" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="play" value="false" /><param name="loop" value="false" /><param name="src" value="http://www.youtube-nocookie.com/v/jm3dm5J5r0A&amp;hl=en_GB&amp;fs=1&amp;border=1" /><embed style="width: 700px; height: 421px;" type="application/x-shockwave-flash" width="700" height="421" src="http://www.youtube-nocookie.com/v/jm3dm5J5r0A&amp;hl=en_GB&amp;fs=1&amp;border=1" loop="false" play="false"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2010/01/15/acht-wochen-kater/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stadt im Schnee</title>
		<link>http://mschuette.name/wp/2010/01/10/stadt-im-schnee/</link>
		<comments>http://mschuette.name/wp/2010/01/10/stadt-im-schnee/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 15:27:14 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Verschiedenes]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=459</guid>
		<description><![CDATA[Alles zugeschneit &#8230; An Tagen wie diesen wünsche ich mir auch eine Kamera &#8230;
(Bild von mcsonne)

]]></description>
			<content:encoded><![CDATA[<p>Alles zugeschneit &#8230; An Tagen wie diesen wünsche ich mir auch eine Kamera &#8230;<br />
(Bild von <a href="http://www.flickr.com/photos/mcsonne/4261252281/">mcsonne</a>)</p>
<p><a href="http://www.flickr.com/photos/mcsonne/4261252281/"><img class="size-full wp-image-461 alignleft" title="Schneetreiben am Neuen Palais" src="https://mschuette.name/wp/wp-content/20100110_NP_im_schnee1.jpg" alt="Schneetreiben am Neuen Palais" width="640" height="427" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2010/01/10/stadt-im-schnee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time to update your blog</title>
		<link>http://mschuette.name/wp/2009/11/21/time-to-update-your-blog/</link>
		<comments>http://mschuette.name/wp/2009/11/21/time-to-update-your-blog/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 06:23:32 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Verschiedenes]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[english]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=449</guid>
		<description><![CDATA[
from toothpastefordinner.com via feministing.com via briansolis.com via soup.io
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-448" title="the-computer-demands-a-blog" src="https://mschuette.name/wp/wp-content/the-computer-demands-a-blog.gif" alt="the-computer-demands-a-blog" width="550" height="330" /><br />
from <a href="http://www.toothpastefordinner.com/">toothpastefordinner.com</a> via <a href="http://www.feministing.com/archives/010525.html">feministing.com</a> via <a href="http://www.briansolis.com/2009/11/rumors-of-the-death-of-blogs-are-greatly-exagerated/">briansolis.com</a> via <a href="http://mugecerman.soup.io/post/33809477/via-Rumors-of-the-Death-of-Blogs">soup.io</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2009/11/21/time-to-update-your-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>25 Jahre Elite</title>
		<link>http://mschuette.name/wp/2009/10/05/25-jahre-elite/</link>
		<comments>http://mschuette.name/wp/2009/10/05/25-jahre-elite/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 23:48:03 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Digital]]></category>
		<category><![CDATA[Verschiedenes]]></category>
		<category><![CDATA[1984]]></category>
		<category><![CDATA[david braben]]></category>
		<category><![CDATA[elite]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[ian bell]]></category>
		<category><![CDATA[oolite]]></category>
		<category><![CDATA[spiel]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=434</guid>
		<description><![CDATA[Im September 1984 erschien die erste Version des Spiels “Elite” – und erschuf damit das Genre der Weltraum-Simu&#173;lations&#173;spiele. In wenigen Kilo&#173;byte erschufen Ian Bell und David Braben 8×256 Planeten, Raum&#173;stationen sowie die Cobra Mk III des Spielers.

Ich sah Elite zum ersten Mal auf dem C64, aber leider blieb es dort eines der wenigen Spiele die ich [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://elite.acornarcade.com/"><img class="alignleft size-full wp-image-438" title="Elite cover picture" src="https://mschuette.name/wp/wp-content/elite_screen.gif" alt="Elite cover picture" width="300" height="240" /></a>Im September 1984 erschien die erste Version des Spiels “<a href="http://elite.frontier.co.uk/">Elite</a>” – und erschuf damit das Genre der Weltraum-Simu&shy;lations&shy;spiele. In wenigen Kilo&shy;byte erschufen <a href="http://www.iancgbell.clara.net/elite/">Ian Bell</a> und <a href="http://www.frontier.co.uk/">David Braben</a> 8×256 Planeten, Raum&shy;stationen sowie die Cobra Mk III des Spielers.</p>
<p><span id="more-434"></span></p>
<p><a href="http://www.c64-wiki.de/index.php/Elite_%28Spiel%29"><img class="size-full wp-image-435 alignright" title="Elite (C64)" src="https://mschuette.name/wp/wp-content/Elite_Andocken1.gif" alt="Elite (C64)" width="320" height="200" /></a>Ich sah Elite zum ersten Mal auf dem C64, aber leider blieb es dort eines der wenigen Spiele die ich (mangels Anleitung) nicht verstand. Die Begeisterung für das Spiel kam daher erst später mit den Nachfolgern “Frontier: Elite II” und “Frontier: First Encounters”.</p>
<p>Wer das Spiel garnicht kennt oder zuviel Zeit hat sollte sich ruhig mal <a href="http://wiki.alioth.net/index.php/Oolite_Main_Page">Oolite</a> ansehen: eine schöne und freie Nach&shy;programmierung des Klassikers.</p>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2009/10/05/25-jahre-elite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create OpenDocument texts with PHP</title>
		<link>http://mschuette.name/wp/2009/09/13/creating-opendocument-texts-with-php/</link>
		<comments>http://mschuette.name/wp/2009/09/13/creating-opendocument-texts-with-php/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 11:05:11 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[data export]]></category>
		<category><![CDATA[odt]]></category>
		<category><![CDATA[opendocument]]></category>
		<category><![CDATA[openoffice]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=392</guid>
		<description><![CDATA[The problem: take a PHP/SQL web application and add a function to export form letters. Because they might have to be edited later, the letters are not to be exported as PDFs but as ODT files for word processing.
When I implemented this I could not find documentation about this, so I wrote a small how-to.

First [...]]]></description>
			<content:encoded><![CDATA[<p>The problem: take a PHP/SQL web application and add a function to export form letters. Because they might have to be edited later, the letters are not to be exported as PDFs but as <a href="http://en.wikipedia.org/wiki/OpenDocument">ODT</a> files for word processing.</p>
<p>When I implemented this I could not find documentation about this, so I wrote a small how-to.</p>
<p><span id="more-392"></span></p>
<p>First create a template file (I use OpenOffice) with filler text. Include all images, fields, tables, paragraph styles, etc. you want to use later. Save the file in ODT format.</p>
<p>A <a href="http://en.wikipedia.org/wiki/OpenDocument_technical_specifications">.odt file</a> is a zip file containing all document components as XML files (as well all embedded files like pictures). Use <code>unzip</code> to extract the content into a subfolder.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[mschuett@dagny] ~&gt; mkdir newdoc &amp;&amp; unzip -d newdoc Untitled\ 1.odt
Archive:  Untitled 1.odt
 extracting: newdoc/mimetype
   creating: newdoc/Configurations2/statusbar/
  inflating: newdoc/Configurations2/accelerator/current.xml
   creating: newdoc/Configurations2/floater/
   creating: newdoc/Configurations2/popupmenu/
   creating: newdoc/Configurations2/progressbar/
   creating: newdoc/Configurations2/menubar/
   creating: newdoc/Configurations2/toolbar/
   creating: newdoc/Configurations2/images/Bitmaps/
 extracting: newdoc/Pictures/1000000000000181000000AD6DC45DA5.png
  inflating: newdoc/content.xml
  inflating: newdoc/styles.xml
 extracting: newdoc/meta.xml
  inflating: newdoc/Thumbnails/thumbnail.png
  inflating: newdoc/settings.xml
  inflating: newdoc/META-INF/manifest.xml</pre></div></div>

<p>The subdirectories <code>Configurations2</code> and <code>Thumbnails</code> as well as the file <code>settings.xml</code> are not required and can be deleted. The file <code>META-INF/manifest.xml</code> contains a list of all files, so the corresponding entries should be removed from this list.</p>
<p>That leaves us with three significant files: <code>meta.xml</code> for document metadata, <code>styles.xml</code> for styles and page elements (headers, footers), and <code>content.xml</code> for the main text. Use <code>xmllint --format</code> (part of <a href="http://xmlsoft.org/">libxml</a>) to make the XML somewhat readable and then open it in an editor to take a look at the general structure and to locate your filler texts. More information about the files can be found in the free book “<a href="http://books.evc-cit.info/">OASIS OpenDocument Essentials</a>”.</p>
<p>After a modification the files can be zipped again to verify the resulting ODF can be opened:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[mschuett@dagny] ~&gt; cd newdoc &amp;&amp; zip -r ../newdoc.odt * &amp;&amp; cd ..</pre></div></div>

<p>Now it&#8217;s up to you to write your application data into all the right places. I simply use <a href="http://www.php.net/str_replace">str_replace()</a> to substitute a number of variables, thus I have a PHP string with the text of <code>content.xml</code> and place holders like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text:p</span> <span style="color: #000066;">text:style-name</span>=<span style="color: #ff0000;">&quot;P2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>%(FirstName) %(LastName)<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/text:p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text:p</span> <span style="color: #000066;">text:style-name</span>=<span style="color: #ff0000;">&quot;P1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>%(AddrComplement)<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/text:p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text:p</span> <span style="color: #000066;">text:style-name</span>=<span style="color: #ff0000;">&quot;P1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>%(Street)<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/text:p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text:p</span> <span style="color: #000066;">text:style-name</span>=<span style="color: #ff0000;">&quot;P1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>%(ZIP) %(City)<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/text:p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text:p</span> <span style="color: #000066;">text:style-name</span>=<span style="color: #ff0000;">&quot;P1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>%(Country)<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/text:p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The replacement uses two arrays &#8212; one with all place holders and one with all strings to replace them with. (Note: Because the database is still in Latin-1 but the XML files declare a UTF-8 encoding, all strings have to be converted. The call to utf8() is just shorthand for a call to <a href="http://www.php.net/manual/en/function.mb-convert-encoding.php">mb_convert_encoding()</a>.)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$replace_from</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">&quot;%(FirstName)&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">&quot;%(LastName)&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #666666; font-style: italic;">// etc.</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$replace_to</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    utf8<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbentry</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    utf8<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbentry</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'lastname'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #666666; font-style: italic;">// etc.</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$content_xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$replace_from</span><span style="color: #339933;">,</span> <span style="color: #000088;">$replace_to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ODT</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'content_xml'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>When the document&#8217;s content is thus prepared, the files have to be zipped and sent to the user. In this example I change only the file <code>content.xml</code> and decide to zip all other files beforehand. (Because my files contain pictures I assume this is more efficient than creating everything on the fly.)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[mschuett@dagny] ~&gt; cd newdoc &amp;&amp; zip -r ../template.zip * --exclude content.xml &amp;&amp; cd ..</pre></div></div>

<p>Finally this is the output function at the end of the PHP file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// headers for download and correct MIME type</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-disposition: attachment; filename=&quot;letter.odt&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type: application/vnd.oasis.opendocument.text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// this is slightly magic</span>
File_Archive<span style="color: #339933;">::</span><span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span>
    File_Archive<span style="color: #339933;">::</span><span style="color: #004000;">readMulti</span><span style="color: #009900;">&#40;</span>    <span style="color: #666666; font-style: italic;">// read sources</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #666666; font-style: italic;">// a) an existing archive</span>
            File_Archive<span style="color: #339933;">::</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;template.zip/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #666666; font-style: italic;">// b) our memory buffers to be named</span>
            File_Archive<span style="color: #339933;">::</span><span style="color: #004000;">readMemory</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content_xml</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;content.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    File_Archive<span style="color: #339933;">::</span><span style="color: #004000;">toArchive</span><span style="color: #009900;">&#40;</span>  <span style="color: #666666; font-style: italic;">// combine sources into one output</span>
        <span style="color: #0000ff;">'letter.odt'</span><span style="color: #339933;">,</span>
        File_Archive<span style="color: #339933;">::</span><span style="color: #004000;">toOutput</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  <span style="color: #666666; font-style: italic;">// send to stdout = browser</span>
        <span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'zip'</span>
    <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>First the HTTP headers are sent, so the browser knows it will receive a file in OpenDocument format (it should then ask the user whether to save the file or open it immediately in a word processor). The PEAR package <a href="http://pear.php.net/package/File_Archive">File_Archive</a> is used for all zipfile actions: first the prepared zipfile is read, then the string <code>$content_xml</code> is added with file name <code>"content.xml"</code>, at last the new zipfile is sent to the user. And that&#8217;s it.</p>
<p>If necessary the other files can be customized in the same way. If the ODT files are not only used for printing but are archived or send to an end-user then you probably want to set a correct document creation date, generator, author information, etc. in <code>meta.xml</code>.</p>
<p>If you are looking for PHP library support of OpenDocument files then take a look at the <a href="http://pear.php.net/package/OpenDocument/">PEAR OpenDocument class</a>. Just like all other projects I have found it is in early alpha status, but now that <a href="http://cweiske.de/tagebuch/OpenDocument%200.2.0%20released.htm">Christian Weiske took over maintainership</a> recently it seems to be the only one under active development.</p>
<p>Last but not least: you can use the <a href="http://tools.odftoolkit.org/odfvalidator/">ODF Validator</a> to validate your documents against the ODF Specification (without having to rely on the &#8220;it is correct if OOo can open it&#8221; approach).</p>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2009/09/13/creating-opendocument-texts-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Freiheit statt Angst</title>
		<link>http://mschuette.name/wp/2009/09/08/freiheit-statt-angst/</link>
		<comments>http://mschuette.name/wp/2009/09/08/freiheit-statt-angst/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 14:36:47 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Politik]]></category>
		<category><![CDATA[überwachung]]></category>
		<category><![CDATA[bürgerrechte]]></category>
		<category><![CDATA[database nation]]></category>
		<category><![CDATA[freiheit]]></category>
		<category><![CDATA[freiheit statt angst]]></category>
		<category><![CDATA[fsa]]></category>
		<category><![CDATA[fsa09]]></category>
		<category><![CDATA[ilija trojanow]]></category>
		<category><![CDATA[juli zeh]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[simson garfinkel]]></category>
		<category><![CDATA[vorratsdatenspeicherung]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=369</guid>
		<description><![CDATA[Nicht vergessen: am Samstag zur Demo kommen (15 Uhr, Potsdamer Platz).



Wer bis dahin (oder danach) noch Zeit zu lesen hat, dem sei das Buch „Angriff auf die Freiheit“ von Ilija Trojanow und Juli Zeh empfohlen. Das recht dünne Buch ist sehr gut geschrieben und gibt einen Überblick über den aktuellen Stand des Abbaus von Bürger- und Freiheitsrechten. [...]]]></description>
			<content:encoded><![CDATA[<p>Nicht vergessen: am Samstag zur <a href="http://wiki.vorratsdatenspeicherung.de/Freiheit_statt_Angst_am_12._September_2009">Demo</a> kommen (15 Uhr, Potsdamer Platz).</p>
<p><a href="http://wiki.vorratsdatenspeicherung.de/Freiheit_statt_Angst_am_12._September_2009"><img class="alignleft" src="/wp/wp-upload/20090912_freiheitstattangst_Demo_berlin_noanim.gif" alt="" width="468" height="60" /></a></p>
<p><span id="more-369"></span></p>
<p><img class="alignright" src="/wp/wp-upload/buchcover_angriff_auf_die_freiheit.jpg" alt="" width="120" height="196" /></p>
<p>Wer bis dahin (oder danach) noch Zeit zu lesen hat, dem sei das Buch „<em><a href="http://www.hanser-literaturverlage.de/buecher/buch.html?isbn=978-3-446-23418-5">Angriff auf die Freiheit</a></em>“ von Ilija Trojanow und Juli Zeh empfohlen. Das recht dünne Buch ist sehr gut geschrieben und gibt einen Überblick über den aktuellen Stand des Abbaus von Bürger- und Freiheitsrechten. Fast noch besser fand ich zudem das <a href="http://chaosradio.ccc.de/cre135.html">Interview mit Juli und Ilija beim Chaosradio Express</a>.</p>
<p>Zum Schluß noch ein Auszug aus Simson Garfinkels “<em><a href="http://www.databasenation.com/">Database Nation</a>”</em> &#8212; ein Buch das exemplarisch zeigt dass Bürgerrechte nicht nur von ‚rechten‘ Regierungen oder von staatlicher Seite aus bedroht sind, sondern dass gerade die Wirtschaft die alltägliche Überwachung vorantreibt.</p>
<blockquote><p>To understand privacy in the next century, we need to rethink what privacy really means today:</p>
<ul>
<li>It&#8217;s not about the man who wants to watch pornography in complete anonymity over the Internet. It&#8217;s about the woman who&#8217;s afraid to use the Internet to organize her community against a proposed toxic dump &#8212; afraid because the dump&#8217;s investors are sure to dig through her past if she becomes too much of a nuisance.</li>
<li>It&#8217;s not about people speeding on the nation&#8217;s highways who get automatically genarated tickets mailed to them thanks to a computerized speed trap. It&#8217;s about lovers who will take less joy in walking around city streets or visiting stores because they know they&#8217;re being photographed by surveillance cameras everywhere they step.</li>
<li>It&#8217;s not about special prosecutors who leave no stone unturned in their search for corruption or political misdeed. It&#8217;s about good, upstanding citizens who are now refusing to enter public service because they don&#8217;t want a bloodthirsty press rummaging through their old school reports, computerized medical records, and email.</li>
<li>It&#8217;s not about the searches, metal detectors, and inquisitions that have become a routine part of our daily lives at airports, schools, and federal buildings. It&#8217;s about a society that views law-abiding citizens as potential terrorists, yet does little to effectively protect its citizens from the real threats to their safety.</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2009/09/08/freiheit-statt-angst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache 2.2.13</title>
		<link>http://mschuette.name/wp/2009/08/29/apache-2-2-13/</link>
		<comments>http://mschuette.name/wp/2009/08/29/apache-2-2-13/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 14:06:36 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[BSD]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[server name indication]]></category>
		<category><![CDATA[sni]]></category>
		<category><![CDATA[tls]]></category>
		<category><![CDATA[vhost]]></category>
		<category><![CDATA[x.509]]></category>

		<guid isPermaLink="false">https://mschuette.name/wp/?p=361</guid>
		<description><![CDATA[I already love the new Apache httpd version 2.2.13 because its mod_ssl finally supports the TLS extension for Server Name Indication. In other words: it allows for every name based VirtualHost to use its own HTTPS certificate.

As a demonstration you can now access this site with https. The only drawback: Internet Explorer on WindowsXP and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="/wp/wp-upload/apache_feather.gif" alt="Apache Logo" width="200" height="60" />I already love the new Apache httpd <a href="http://www.apache.org/dist/httpd/Announcement2.2.html">version 2.2.13</a> because its mod_ssl finally supports the <a href="http://www.ietf.org/rfc/rfc4366.txt">TLS extension</a> for <a href="http://en.wikipedia.org/wiki/Server_Name_Indication">Server Name Indication</a>. In other words: it allows for every name based VirtualHost to use its own HTTPS certificate.</p>
<p><span id="more-361"></span></p>
<p>As a demonstration you can now access this site with <a href="https://mschuette.name/wp/">https</a>. The only drawback: Internet Explorer on WindowsXP and KDE&#8217;s Konqueror do not support the TLS extension but show a certificate error.</p>
<p>Another small but nice feature is the new piped log syntax to launch a process without invoking the shell. On a shared server with about twenty VHosts and all of them logging slightly differently to pipes and syslog this saves a few unnecessary processes.<br />
<strong>Update</strong> to give an example: My httpd.conf now contains these lines for logging</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">CustomLog &quot;||/usr/bin/logger -p local2.info -t apache&quot; complete
ErrorLog &quot;||/usr/bin/logger -p local3.info -t apache&quot;</pre></div></div>

<p>Just one note about updating: OpenSSL (and its FreeBSD port) does not use the TLS extension by default. &#8212; One has to configure it with option <code>enable-tlsext</code> (for the port: change the Makefile so it contains the line “<code>EXTRACONFIGURE+= enable-camellia enable-tlsext</code>”).</p>
]]></content:encoded>
			<wfw:commentRss>http://mschuette.name/wp/2009/08/29/apache-2-2-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
