<?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>Pesches Schlauch &#187; Programming</title>
	<atom:link href="http://pesche.schlau.ch/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://pesche.schlau.ch</link>
	<description>Sind Schläuche schlau?</description>
	<lastBuildDate>Thu, 01 Apr 2010 06:00:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Merge down, copy up</title>
		<link>http://pesche.schlau.ch/2007/07/03/merge-down-copy-up/</link>
		<comments>http://pesche.schlau.ch/2007/07/03/merge-down-copy-up/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 17:06:15 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[Hug-Witschi]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/2007/07/03/merge-down-copy-up/</guid>
		<description><![CDATA[If you are using any SCM that allows cheap branches (like  Perforce) and are following the advices from the High-level Best Practices document, you might be interested in (or already know) Laura Wingerd&#8217;s presentation Convergence vs. Divergence: Purposeful Merging with Perforce about how to converge to codelines using Merge Down, Copy Up [PDF]. I [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using any SCM that allows cheap branches (like  <a href="http://www.perforce.com/">Perforce</a>) and are following the advices from the <a href="http://www.perforce.com/perforce/bestpractices.html">High-level Best Practices</a> document, you might be interested in (or already know) Laura Wingerd&#8217;s presentation <a href="http://www.perforce.com/perforce/conferences/eu/2006/presentations/laura_wingerd/ConvergenceVsDivergence.html">Convergence vs. Divergence: Purposeful Merging with Perforce</a> about how to converge to codelines using <a href="http://www.perforce.com/perforce/conferences/us/2005/presentations/Wingerd.pdf">Merge Down, Copy Up [PDF]</a>. I have seen it many times that a main codeline got broken because the Merge Down, Copy Up idiom was ignored.</p>
<p>The detailed procedure of Merge Down, Copy Up is explained on <a href="http://www.perforce.com/perforce/conferences/eu/2006/presentations/laura_wingerd/ConvergenceVsDivergence.html#ConvergenceVsDivergence.section.22">Slide 22</a> of the talk. Unfortunately it doesn&#8217;t work in the presence of files with expanded <a href="http://www.perforce.com/perforce/doc.072/manuals/cmdref/o.ftypes.html#1042691">keywords</a> (type <code>text+k</code>). All these files don&#8217;t get reverted in step 4 (<code>p4 diff -sr | p4 -x - revert</code>), although they differ only in keyword expansion.</p>
<p>There is currently no direct way using <a href="http://www.perforce.com/">Perforce</a> commands to work around this problem. However, the <code>p4 diff</code> commands to plug in a different diff tool. My solution on Windows therefore consists of two scripts, one to set up <code>P4DIFF</code> and call <code>p4 diff</code> (<a href="http://public.perforce.com:8080/guest/peter_steiner/merge-down-copy-up/revert_unchanged.bat"><code>revert_unchanged.bat</code></a>), the other as the plug in diff tool (<a href="http://public.perforce.com:8080/guest/peter_steiner/merge-down-copy-up/diff_no_keywords.bat"><code>diff_no_keywords.bat</code></a>). The scripts need a couple of additional filters like <code>diff</code>, <code>grep</code> and <code>cut</code>. While the <a href="http://cygwin.com/">cygwin</a> <code>grep</code> is fine, you must not use its <code>diff</code> and <code>cut</code> binaries, because these are too much unixish and have problems with the backslash path delimiters that <code>p4 diff</code> is handing out (or you could perhaps use the <a href="http://www.perforce.com/perforce/downloads/cygwinx86.html">cygwin variant of p4</a>, if you have a current one). I have used the binaries from <a href="http://unxutils.sourceforge.net/">http://unxutils.sourceforge.net/</a>.</p>
<p>Both scripts are available from the <a href="http://public.perforce.com/public/index.html">Perforce Public Depot</a>: <a href="http://public.perforce.com:8080/guest/peter_steiner/merge-down-copy-up/revert_unchanged.bat"><code>revert_unchanged.bat</code></a>, <a href="http://public.perforce.com:8080/guest/peter_steiner/merge-down-copy-up/diff_no_keywords.bat"><code>diff_no_keywords.bat</code></a>. You use them as additional step 4a after the <code>p4 diff -sr</code> step.</p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2007/07/03/merge-down-copy-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Psion SIBO SDK</title>
		<link>http://pesche.schlau.ch/2007/05/16/psion-sibo-sdk/</link>
		<comments>http://pesche.schlau.ch/2007/05/16/psion-sibo-sdk/#comments</comments>
		<pubDate>Wed, 16 May 2007 08:43:53 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[Life/the Universe...]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/2007/05/16/psion-sibo-sdk/</guid>
		<description><![CDATA[I&#8217;m cleaning up shelves and have got an old &#8220;SIBO SDK 2.10&#8243; which I haven&#8217;t used in years. It is a Software Development Kit for 16-Bit Psion handheld computers like Psion Series 3 or Psion Workabout.
If you are interested in two floppy disks and four folders of documentation, please drop me a note.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m cleaning up shelves and have got an old &#8220;<a href="http://www.scss.com.au/family/andrew/pdas/psion/sibo/">SIBO</a> SDK 2.10&#8243; which I haven&#8217;t used in years. It is a <a href="http://www.garethjmsaunders.co.uk/psion/programming16.html">Software Development Kit for 16-Bit Psion handheld computers</a> like Psion Series 3 or Psion Workabout.</p>
<p>If you are interested in two floppy disks and four folders of documentation, please drop me a note.</p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2007/05/16/psion-sibo-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>envvc</title>
		<link>http://pesche.schlau.ch/2007/04/05/envvc/</link>
		<comments>http://pesche.schlau.ch/2007/04/05/envvc/#comments</comments>
		<pubDate>Thu, 05 Apr 2007 11:34:14 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[Hug-Witschi]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/2007/04/05/envvc/</guid>
		<description><![CDATA[Did you ever have the need to use different versions of Microsofts Visual C++ compiler from the command line? Did you wish you wouldn&#8217;t have to constantly call vcvars32.bat or change your environment (PATH, INCLUDE and LIB variables)?
In comes a little tool called envvc.exe. It sets the environment for the chosen version and then calls [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever have the need to use different versions of Microsofts Visual C++ compiler from the command line? Did you wish you wouldn&#8217;t have to constantly call vcvars32.bat or change your environment (PATH, INCLUDE and LIB variables)?</p>
<p>In comes a little tool called <tt>envvc.exe</tt>. It sets the environment for the chosen version and then calls any chosen executable. As additional feature it verifies that you have installed the latest service pack for the chosen version.</p>
<p>Supported configurations:</p>
<ul>
<li>VC 6, example:<br />
<pre><code>envvc 60 cl ...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80</code></pre><pre><code>x86
...</code></pre></li>
<li>VC 7.1 (VS 2003). Example (without the current SP1, simulating an error message):<br />
<pre><code>envvc -f 71 cl ...
C:\Program Files\Microsoft Visual Studio .NET 2003\install.htm(1) : error SP: there&#039;s a newer service pack available!
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80</code></pre><pre><code>x86
...</code></pre></li>
<li>VC 8 (VS 2005) Example:<br />
<pre><code>envvc 80 cl ...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80</code></pre><pre><code>x86
...</code></pre></li>
<li>VC 8 with the .NET 3 SDK. Example:<br />
<pre><code>envvc fx 80 svcutil ...
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.30]
...</code></pre></li>
</ul>
<p>No configuration is needed for envvc; all informations about where the compilers are installed and which service packs have been applied are read from the Windows Registry. But the known service packs are hard coded, so you have to patch envvc whenever Microsoft releases another service pack.</p>
<p>The source to envvc is available under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License</a> (<a href="/files/LICENSE_1_0.txt">local copy</a>): <a href="/files/envvc.cpp">envvc.cpp</a>. Feedback is appreciated!</p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2007/04/05/envvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving the Santa Claus Problem with Barriers</title>
		<link>http://pesche.schlau.ch/2006/05/22/solving-the-santa-claus-problem-with-barriers/</link>
		<comments>http://pesche.schlau.ch/2006/05/22/solving-the-santa-claus-problem-with-barriers/#comments</comments>
		<pubDate>Mon, 22 May 2006 07:34:43 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/2006/05/22/solving-the-santa-claus-problem-with-barriers/</guid>
		<description><![CDATA[There are already many solutions to the &#8220;Santa Claus Problem&#8221; by John Trono[1]. It&#8217;s a &#8220;problem simple to understand and yet far from easy to solve&#8221;; the author&#8217;s original solution (based on semaphores) was only partly correct. The probably most known analysis of the problem was written by Mordechai Ben-Ari[2], who also provided solutions in [...]]]></description>
			<content:encoded><![CDATA[<p>There are already many solutions to the &#8220;Santa Claus Problem&#8221; by John Trono<sup><a name="scpB1" href="#scp1">[1]</a></sup>. It&#8217;s a <a href="/2005/04/25/back-from-oxford/">&#8220;problem simple to understand and yet far from easy to solve&#8221;</a>; the author&#8217;s original solution (based on semaphores) was only partly correct. The probably most known analysis of the problem was written by Mordechai Ben-Ari<sup><a name="scpB2" href="#scp2">[2]</a></sup>, who also provided solutions in Ada95 and Java.</p>
<p>This is the original problem description:</p>
<blockquote><p>Santa Claus sleeps in his shop up at the North Pole, and can only be wakened by either all nine reindeer being back from their year long vacation on the beaches of some tropical island in the South Pacific, or by some elves who are having some difficulties making the toys. One elf&#8217;s problem is never serious enough to wake up Santa (otherwise, he may never get any sleep), so, the elves visit Santa in a group of three. When three elves are having their problems solved, any other elves wishing to visit Santa must wait for those elves to return. If Santa wakes up to find three elves waiting at his shop&#8217;s door, along with the last reindeer having come back from the tropics, Santa has decided that the elves can wait until after Christmas, because it is more important to get his sleigh ready as soon as possible. (It is assumed that the reindeer don&#8217;t want to leave the tropics, and therefore they stay there until the last possible moment. They might not even come back, but since Santa is footing the bill for their year in paradise&#8230; This could also explain the quickness in their delivering of presents, since the reindeer can&#8217;t wait to get back to where it is warm.) The penalty for the last reindeer to arrive is that it must get Santa while the others wait in a warming hut before being harnessed to the sleigh.</p></blockquote>
<p>As an exercise to learn the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/package-summary.html">java.util.concurrent</a> package of <a href="http://java.sun.com/j2se/1.5.0/">Java J2SE 5.0</a> I implemented another solution using barriers (<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/CyclicBarrier.html">CyclicBarrier</a> objects). As either three elves or all nine reindeer must assemble before they are allowed to wake Santa, this seems to me an obvious choice.</p>
<p>The solution consists mainly of an outer class <tt>SantaClaus</tt>, that sets up all needed synchronisation variables and controls the program termination, and two inner classes <tt>Elf</tt> and <tt>Reindeer</tt>, that are instantiated on a separate thread for each individual elf and reindeer behaviour. The <a href="/files/santa/SantaClaus.java">source code</a> is also available as <a href="/files/santa/SantaClaus.java.html">syntax coloured HTML</a>; an <a href="http://se.ethz.ch/teaching/ss2006/0268/exercises/exercise_7/SantaClaus.java">earlier version</a> without the harnessing part can be found <a href="http://se.inf.ethz.ch/teaching/ss2006/0268/index.html">here</a>.</p>
<p>The barrier that manages the grouping of the elves is protected by a <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Semaphore.html">Semaphore</a> <tt>queueElves</tt> with three permits. This implements the requirement <em>&#8220;any other elves wishing to visit Santa must wait for those elves to return&#8221;</em> in a rather defensive manner: there is some virtual waiting room for the elves to wait before waking Santa that has room for only three elves.</p>
<p>This defensive approach makes the priority requirement (if nine reindeer and three elves are waiting, Santa must deliver toys first) simple to fulfill; a <strong>fair semaphore</strong> (semaphore with a FIFO queue) is enough:</p>
<p>As no more than one group of elves can sit in the virtual waiting room and access to the waiting room is blocked until the first group of elves have got back to the toy manufacture, the ninth reindeer will never encounter more than two elves in the waiting room<sup><a name="scpB3" href="#scp3">[3]</a></sup>. It is therefore enough to guarantee that the reindeer are serviced first if they are the first to try the semaphore that protects Santa&#8217;s office.</p>
<p>Using a fair semaphore also for <tt>queueElves</tt> guarantees that no elf is starved when he would like to consult with Santa.</p>
<p>If we would want the get rid of the <tt>queueElves</tt> semaphore or expand the problem (eg. Santa could start answering the letters from kids), we had to replace the semaphore <tt>santasAttention</tt> with a advanced mechanism like a <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/PriorityBlockingQueue.html">PriorityBlockingQueue</a> to guarantee priority for the reindeer.</p>
<p><sup><a name="scp1" href="#scpB1">[1]</a></sup> J. A. Trono. <a href="http://portal.acm.org/citation.cfm?id=187391&#038;coll=portal&#038;dl=ACM">A new exercise in concurrency</a>. SIGCSE Bulletin, 26(3):8–10, 1994. Corrigendum: 26(4):63.</p>
<p><sup><a name="scp2" href="#scpB2">[2]</a></sup> M. Ben-Ari. <a href="http://citeseer.ist.psu.edu/ben-ari97how.html">How to solve the santa claus problem</a>. Concurrency: Practice &amp; Experience, 10(6):485–496, 1998.</p>
<p><sup><a name="scp3" href="#scpB3">[3]</a></sup> This assumes that the short time between having realised that there are enough (elves/reindeer) to wake Santa and Santa coming out of his office is indivisible.</p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2006/05/22/solving-the-santa-claus-problem-with-barriers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dmake Stories</title>
		<link>http://pesche.schlau.ch/2006/04/17/dmake-stories/</link>
		<comments>http://pesche.schlau.ch/2006/04/17/dmake-stories/#comments</comments>
		<pubDate>Mon, 17 Apr 2006 17:16:14 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[Hug-Witschi]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/2006/04/17/dmake-stories/</guid>
		<description><![CDATA[At work, we started using dmake in 1991 (or even earlier) for building the firmware for the Vending Machine Controller Euro&#8217;90. The firmware consisted mostly of PL/M and C code and the compilers suffered from the DOS limitation of 127 characters per command line. Dennis Vadura&#8217;s dmake 3.70 (hosted by the University of Waterloo and [...]]]></description>
			<content:encoded><![CDATA[<p>At <a title="Hug-Witschi" href="http://www.hugwi.ch/">work</a>, we started using <a href="http://tools.openoffice.org/dmake/index.html">dmake</a> in 1991 (or even earlier) for building the firmware for the Vending Machine Controller <a href="http://www.hugwi.ch/german/prod-main-ctrl.html#euro90">Euro&#8217;90</a>. The firmware consisted mostly of PL/M and C code and the compilers suffered from the DOS limitation of 127 characters per command line. Dennis Vadura&#8217;s dmake 3.70 (hosted by the <a href="http://www.uwaterloo.ca/">University of Waterloo</a> and available as DOS version) featured the <tt>$(mktmp )</tt> macro that let me create any needed temporary config and response files.</p>
<p>Later we kept using dmake for the software for our <a href="http://www.diva-interface.com/">DIVA</a> and <a href="http://www.cci-csi-interface.com/">CCI/CSI</a> interface families. The build system had grown quite complex and the makefiles made heavy use of the percent pattern rules and delegation to makefiles in other directories.</p>
<p>A couple of years ago, when I first tried to define a target that builds everything (several firmware variants, debug and release builds), I encountered a strange error from dmake:</p>
<p><pre>dmake.exe:&nbsp;&nbsp;Error: -- Unable to change to directory `xy?&#039;, target is [sub-b]</pre></p>
<p>The latest release then (dmake 4.1) was labeled as &#8220;final free release&#8221;; the last dmake homepage from Dennis Vadura (dmake.wticorp.com, online ca. 2001), once tried to sell &#8220;dmake Gold&#8221;, but was already unreachable at this time. As the days of open source dmake seemed over, I was hesitating to invest time finding bugs and thought that we would move soon to another build system anyway.</p>
<p>Recently (we&#8217;re still using dmake&#8230;) I have learned that <a href="http://tools.openoffice.org/dmake/index.html">OpenOffice.org has &#8220;adopted&#8221; dmake</a> and resumed its development. This gave me the energy to finally hunt down this bug: a dangling pointer.</p>
<p>Until my fix is integrated into a future dmake release, you can get the patch from the <a href="http://www.openoffice.org/issues/show_bug.cgi?id=64431">OpenOffice Issue Tracker</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2006/04/17/dmake-stories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tiger and Realpolitik</title>
		<link>http://pesche.schlau.ch/2005/05/23/tiger-and-realpolitik/</link>
		<comments>http://pesche.schlau.ch/2005/05/23/tiger-and-realpolitik/#comments</comments>
		<pubDate>Mon, 23 May 2005 21:01:19 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[OS X/Windows/Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/2005/05/23/tiger-and-realpolitik/</guid>
		<description><![CDATA[Even before I upgraded to OS X 10.4 (Tiger), I got the report that the Save File dialog in Realpolitik crashes. Now I have applied a quick&#8217;n'dirty fix for the next couple of days for all Tiger users and released Realpolitik 1.7.0 Alpha 2 earlier than planned.
Currently I&#8217;m revamping the dialogs known to Mac developers [...]]]></description>
			<content:encoded><![CDATA[<p>Even before I upgraded to OS X 10.4 (Tiger), I got the report that the Save File dialog in <a href="http://sourceforge.net/projects/realpolitik">Realpolitik</a> crashes. Now I have applied a <em>quick&#8217;n'dirty</em> fix for the next couple of days for all Tiger users and released <a href="http://prdownloads.sourceforge.net/realpolitik/Realpolitik-1.7.0a2.dmg?download">Realpolitik 1.7.0 Alpha 2</a> earlier than planned.</p>
<p>Currently I&#8217;m revamping the dialogs known to Mac developers as Navigation Services. Already done in Alpha 2 is the Open File dialog:</p>
<p><img src="http://pesche.schlau.ch/wp-content/rp-open-170a2.png" width="560" height="390" alt="RP 170a2 Open File Dialog" /></p>
<p>From the users perspective you have now a working <em>type pop-up</em>, where you can choose Realpolitik Files (<tt>.dpy</tt> files and files created by Realpolitik), Text Files or just any document. <span id="more-17"></span></p>
<p>The old dialog (from Alpha 1, see below) had a a type pop-up too, but it was not working. Though both dialogs look identical except for the type pop-up, there are major technical differences. The old dialog used the deprecated NavGetFile() function, the new dialog relies on the recommended<br />
NavCreateGetFileDialog().</p>
<p><img src="http://pesche.schlau.ch/wp-content/rp-open-170a1.png" width="560" height="390" alt="RP 170a1 Open File Dialog" /></p>
<p>The most difficult part was to find out how to use NavCreateGetFileDialog(). For a simple type pop-up it is enough to fill a type list with the four character type codes. If you want more control (use file extensions, specify the text shown in the pop-up, etc.), you need to write custom event and filter callbacks. There are no examples how to do this in Apples online documentation (!), only the downloadable Carbon SDK contains a sample application using a custom type pop-up. But this <em>NavSample</em> has its own problems: it still uses the old <em>WaitNextEvent</em> programming model and had to be adapted for the <em>Carbon Events</em> model used by Realpolitik.</p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2005/05/23/tiger-and-realpolitik/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back from Oxford</title>
		<link>http://pesche.schlau.ch/2005/04/25/back-from-oxford/</link>
		<comments>http://pesche.schlau.ch/2005/04/25/back-from-oxford/#comments</comments>
		<pubDate>Mon, 25 Apr 2005 19:54:47 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/2005/04/25/back-from-oxford/</guid>
		<description><![CDATA[The four days at the ACCU Conference in Oxford are over. Except Günter nobody seems to have blogged the C++ track.
Apart from the discussions and presentations what should go into the next C++ standard (called C++0x and scheduled for 2009), one of the big topics was concurrency and a new awareness that some new ideas [...]]]></description>
			<content:encoded><![CDATA[<p>The four days at the <a href="http://www.accu.org/conference/">ACCU Conference</a> in Oxford are over. Except <a href="http://www.obiltschnig.com/archives/000097.html">Günter</a> nobody seems to have blogged the C++ track.</p>
<p>Apart from the discussions and presentations what should go into the next C++ standard (called C++0x and scheduled for 2009), one of the big topics was concurrency and a new awareness that some new ideas are needed. Herb Sutter presented the points of his recent <a href="http://www.gotw.ca/publications/concurrency-ddj.htm">DDJ article</a>. As an example for an exercise simple to understand and yet far from easy to solve he mentioned the Santa Claus Problem:</p>
<blockquote><p>
Santa repeatedly sleeps until wakened by either all of his nine reindeer, back from their holidays, or by a group of three of his ten elves. If awakened by the reindeer, he harnesses each of them to his sleigh, delivers toys with them and finally unharnesses them (allowing them to go off on holiday). If awakened by a group of elves, he shows each of the group into his study, consults with them on toy R&#038;D and finally shows them each out (allowing them to go back to work).</p>
<p>Santa should give priority to the reindeer in the case that there is both a group of elves and a group of reindeer waiting. <em>(Description taken from <a href="http://research.microsoft.com/~nick/polyphony/santa.pdf">here</a>)</em></p></blockquote>
<p>According to Sutter there is no simple solution known yet. And even using mature frameworks like Java and .NET doesn&#8217;t guarantee a deadlock free program, because nobody knows yet how to compose separate deadlock-free components into a bigger deadlock-free program.</p>
<p>At least two other talks covered concurrency too. In the Python track Michael Sparks presented <a href="http://kamaelia.sourceforge.net/">Kamaelia</a> and explained that they chose to implement concurrency with cooperative multitasking using generators. And in the very last talk of the conference <a href="http://vollmann.ch/en/presentations/index.html">Detlev Vollmann</a> considered threads as harmful. Detlevs point was that even widely respected authors don&#8217;t get multithreading right, how should an ordinary developer be able to succeed? He explored using cooperative multitasking (suitable only for small projects) and using processes instead of threads, because with processes no data is implicitly shared. This was a lively and interesting talk with much discussion. Unfortunately I had to leave early to catch my flight and I missed the last 15 minutes, but I don&#8217;t expect that the problems were solved in these 15 minutes.</p>
<p>Perhaps the most important fact to remember: <a href="http://pluralsight.com/blogs/hsutter/archive/2005/03/19/6804.aspx">sharing data</a> between processes or threads should be avoided when possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2005/04/25/back-from-oxford/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Realpolitik for OS X</title>
		<link>http://pesche.schlau.ch/2005/03/15/realpolitik-for-os-x/</link>
		<comments>http://pesche.schlau.ch/2005/03/15/realpolitik-for-os-x/#comments</comments>
		<pubDate>Tue, 15 Mar 2005 22:36:28 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[Games and Sports]]></category>
		<category><![CDATA[OS X/Windows/Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/?p=13</guid>
		<description><![CDATA[After much carbonizing by Ben Hines and some polishing by me a new Realpolitik Release is available on Sourceforge, the first release for OS X.
The release version Realpolitik 1.7.0 Alpha1 is not yet stable (hence Alpha 1), there are still some known (and probably many more unknown) errors like selection and redrawing problems with the [...]]]></description>
			<content:encoded><![CDATA[<p>After much carbonizing by <a href="http://homepage.mac.com/bhines/realpolitik.html">Ben Hines</a> and some polishing by me a new <a href="http://realpolitik.sourceforge.net/">Realpolitik</a> Release is available on <a href="http://sourceforge.net/projects/realpolitik">Sourceforge</a>, the first release for OS X.</p>
<p>The release version <a href="http://prdownloads.sourceforge.net/realpolitik/Realpolitik-1.7.0a1.dmg?download">Realpolitik 1.7.0 Alpha1</a> is not yet stable (hence <b>Alpha 1</b>), there are still some known (and probably many more unknown) errors like selection and redrawing problems with the orders window, but with some care (backup your .dpy files!) it should be usable.</p>
<p>Parallel to the Mac version a new Windows version is out. It&#8217;s called Alpha too, but should be as stable as the old releases. The only major change for the windows version is the switch from Mindvision Installer VISE to the <a href="http://nsis.sourceforge.net/" >NSIS</a> installer. VISE was once free for shareware developers, but is not anymore. And NSIS looks at least as good as VISE, is open source and has CVS-friendly plain text configuration files.</p>
<p>Unfortunately I can&#8217;t maintain the version for Mac Classic OS; there is no free compiler available and I have no access to a commercial one.</p>
<p>There are some bugfixes in the new version that existed for some time in the <a href="https://sourceforge.net/cvs/?group_id=24361" >CVS</a> repository and just waited for someone to compile a new version. More bugs are known and will hopefully be corrected in the near future. <img src='http://pesche.schlau.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2005/03/15/realpolitik-for-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CVS with AppleSingle files</title>
		<link>http://pesche.schlau.ch/2005/02/07/cvs-with-applesingle-files/</link>
		<comments>http://pesche.schlau.ch/2005/02/07/cvs-with-applesingle-files/#comments</comments>
		<pubDate>Mon, 07 Feb 2005 10:07:04 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[OS X/Windows/Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/?p=11</guid>
		<description><![CDATA[Longtime Apple developers probably know this intuitively, but I needed some time to figure it out: When CVS-ing files with a resource fork, you must not use the /usr/bin/cvs that ships with OS X!
Because Apple used to separate data and metadata, most files in the pre OS X era had a data fork and a [...]]]></description>
			<content:encoded><![CDATA[<p>Longtime Apple developers probably know this intuitively, but I needed some time to figure it out: When CVS-ing files with a resource fork, you <b>must not</b> use the <tt>/usr/bin/cvs</tt> that ships with OS X!</p>
<p>Because Apple used to separate data and metadata, most files in the pre OS X era had a data fork and a resource fork, but for the user this was transparent; the user just manipulated one file. Tools without this &#8220;Classic&#8221; background know nothing of the resource fork. Files without data fork appear in the Terminal to have 0 bytes.</p>
<p>CVS is one of these tools that is ignorant of resource forks. For such cases there is the AppleSingle file format (see <a href="http://www.ietf.org/rfc/rfc1740.txt">RFC1740</a>); it is common to put files with a resource fork as AppleSingle file into CVS. To not bother the CVS user, Mac CVS clients like <a href="http://sourceforge.net/projects/maccvspro/">MacCvsPro</a>, <a href="http://www.wincvs.org/download.html#MACCVS">MacCvsX</a> or <a href="http://www.heilancoo.net/MacCVSClient/">MacCvsClient</a> perform the necessary conversions transparently.</p>
<p>Usually you can accomplish more and have more power on the command line, but in this case it is much easier to use MacCvsPro, MacCvsX or MacCvsClient than the command line. There exist some scripts (<a href="http://www.opensource.apple.com/darwinsource/10.2.8/python-3/python/Mac/Lib/applesingle.py" title="Python Script">applesingle.py</a> and <a href="http://down.physik.uni-mainz.de/cgi-bin/viewcvs.cgi/aleph/tools/single2forks.pl?rev=HEAD&#038;cvsroot=alephone" title="Perl Script">single2forks.pl</a>) to help out command line users, but I was lazy and didn&#8217;t try them.</p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2005/02/07/cvs-with-applesingle-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>El Niño Drawing</title>
		<link>http://pesche.schlau.ch/2004/12/10/el-nino-drawing/</link>
		<comments>http://pesche.schlau.ch/2004/12/10/el-nino-drawing/#comments</comments>
		<pubDate>Fri, 10 Dec 2004 13:08:31 +0000</pubDate>
		<dc:creator>Pesche</dc:creator>
				<category><![CDATA[Games and Sports]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pesche.schlau.ch/?p=7</guid>
		<description><![CDATA[Every year after christmas the El Niño Cup takes place. It is a tournament where the result is less important than exercising and having fun. There is a team day, where every team plays Volleyball, Basketball and Unihockey, and a single day, where the disciplines are Badminton, Table Tennis and Archery.
Last year I wrote a [...]]]></description>
			<content:encoded><![CDATA[<p>Every year after christmas the <a href="http://verein-oskar.ch/index3.htm">El Niño Cup</a> takes place. It is a tournament where the result is less important than exercising and having fun. There is a team day, where every team plays Volleyball, Basketball and Unihockey, and a single day, where the disciplines are Badminton, Table Tennis and Archery.</p>
<p>Last year I wrote a program to ease the drawing. It is a fairly complex problem:</p>
<ul>
<li>Every participant must have six matches, two for every discipline, against members of its category (men, women, mixed&#8230;)</li>
<li>There should be not two matches against the same adversary (except if the category has less than 7 players)</li>
<li>Between two matches there should be a break of at least the duration of one match</li>
</ul>
<p>This year I enhanced the program some more. The amount of tweaking the program output by hand is now almost zero. Just some games remained to be exchanged to satisfy the at-least-one-break condition.</p>
]]></content:encoded>
			<wfw:commentRss>http://pesche.schlau.ch/2004/12/10/el-nino-drawing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
