<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Ciaran McCreesh's Blag</title>
	<atom:link href="http://ciaranm.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ciaranm.wordpress.com</link>
	<description>Now with 17% more caffeine</description>
	<lastBuildDate>Sun, 29 Nov 2009 20:25:00 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ciaranm.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/e88e17481c4c56f32f5fd7d5d63aadb1?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Ciaran McCreesh's Blag</title>
		<link>http://ciaranm.wordpress.com</link>
	</image>
			<item>
		<title>The Visual Display of Quantitative Information</title>
		<link>http://ciaranm.wordpress.com/2009/11/29/the-visual-display-of-quantitative-information/</link>
		<comments>http://ciaranm.wordpress.com/2009/11/29/the-visual-display-of-quantitative-information/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 20:25:00 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=674</guid>
		<description><![CDATA[The Visual Display of Quantitative Information by Edward Tufte is a fairly peculiar book. Let&#8217;s start with what it&#8217;s not:

It&#8217;s not a book cataloguing different types of graphs and charts.
It&#8217;s not a book providing comprehensive coverage of any particular subject.
It&#8217;s not a book explaining the principles behind graphs and charts.
It&#8217;s not a book on statistics.
It&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=674&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div id="attachment_715" class="wp-caption alignright" style="width: 245px"><a href="http://ciaranm.files.wordpress.com/2009/11/vdqi_bookcover.png"><img src="http://ciaranm.files.wordpress.com/2009/11/vdqi_bookcover.png?w=235&#038;h=297" alt="The Visual Display of Quantitative Information" title="The Visual Display of Quantitative Information" width="235" height="297" class="size-full wp-image-715" /></a><p class="wp-caption-text">The Visual Display of Quantitative Information</p></div>
<p><a href="http://www.edwardtufte.com/tufte/books_vdqi">The Visual Display of Quantitative Information</a> by Edward Tufte is a fairly peculiar book. Let&#8217;s start with what it&#8217;s not:</p>
<ul>
<li>It&#8217;s not a book cataloguing different types of graphs and charts.</li>
<li>It&#8217;s not a book providing comprehensive coverage of any particular subject.</li>
<li>It&#8217;s not a book explaining the principles behind graphs and charts.</li>
<li>It&#8217;s not a book on statistics.</li>
<li>It&#8217;s not in any way technical.</li>
</ul>
<p>So what is it then?</p>
<p>The best way I can describe it is as a printed museum of graphs and charts. It includes examples of historically important graphs, along with some specimens that are interesting for their design rather than what they convey. Unlike a museum, though, it also includes a fair number of bad examples, along with critical commentary and improved redesigns. The book is especially critical of the recent trend of designing graphs to look pretty rather than to convey information, and showcases some particularly deceptive graphs where the decoration leads to the graph showing an opposite trend to the data.</p>
<p>I probably didn&#8217;t directly learn very much from having read the book. That doesn&#8217;t detract from its value, however. The content was certainly interesting, and as a work of art it is highly impressive. Most of all, though, I strongly suspect that it will serve as inspiration for various things later on.</p>
<p>If you&#8217;re just looking to learn, this isn&#8217;t the book to get. But if you don&#8217;t need to know something specific, your mind will be better off for having read it.</p>
Posted in hardware Tagged: books <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/674/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=674&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/11/29/the-visual-display-of-quantitative-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>

		<media:content url="http://ciaranm.files.wordpress.com/2009/11/vdqi_bookcover.png" medium="image">
			<media:title type="html">The Visual Display of Quantitative Information</media:title>
		</media:content>
	</item>
		<item>
		<title>C++ Explicit Template Instantiation Hate Redux</title>
		<link>http://ciaranm.wordpress.com/2009/11/27/c-explicit-template-instantiation-hate-redux/</link>
		<comments>http://ciaranm.wordpress.com/2009/11/27/c-explicit-template-instantiation-hate-redux/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 17:15:27 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[hate]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[c++0x]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=711</guid>
		<description><![CDATA[Today&#8217;s hatred of C++ is brought to you by the section [temp.explicit]:

A definition of a class template or class member template shall be in scope at the point of the explicit instantiation of the class template or class member template.

Unfortunately, it doesn&#8217;t &#8220;explicit instantiation definition&#8221; there, so you can&#8217;t do an explicit instantiation declaration when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=711&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today&#8217;s hatred of C++ is brought to you by the section <code>[temp.explicit]</code>:</p>
<blockquote><p>
A definition of a class template or class member template shall be in scope at the point of the explicit instantiation of the class template or class member template.
</p></blockquote>
<p>Unfortunately, it doesn&#8217;t &#8220;explicit instantiation definition&#8221; there, so you can&#8217;t do an explicit instantiation declaration when you only have a class declaration available. I can&#8217;t figure out what changing this would break, and whether it&#8217;s just an omission (explicit instantiation declarations are new in C++0x, but explicit instantiations are not) or a deliberate restriction.</p>
<p>Whilst we&#8217;re on the subject, <a href="http://ciaranm.wordpress.com/2008/12/22/c-explicit-template-instantiation-hate/">not being able to use typedef names when explicitly instantiating</a> is still a pain in the arse too, although the implications of allowing that are almost certainly moderately icky.</p>
Posted in hate Tagged: c++, c++0x <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/711/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=711&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/11/27/c-explicit-template-instantiation-hate-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>
	</item>
		<item>
		<title>C++ Template Specialisation Hate</title>
		<link>http://ciaranm.wordpress.com/2009/11/26/c-template-specialisation-hate/</link>
		<comments>http://ciaranm.wordpress.com/2009/11/26/c-template-specialisation-hate/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 18:56:37 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[hate]]></category>
		<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=707</guid>
		<description><![CDATA[Today&#8217;s annoying C++ feature is that partial specialisations of a nested type of a template class don&#8217;t work:

template &#60;typename T_&#62;
struct S;

template &#60;typename T_&#62;
struct T
{
    struct U;
};

template &#60;typename T_&#62;
struct S&#60;typename T&#60;T_&#62;::U&#62;
{
};

Depending upon your compiler, the specialisation will either be rejected with a highly cryptic error message, or accepted but ignored. I don&#8217;t seem [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=707&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today&#8217;s annoying C++ feature is that partial specialisations of a nested type of a template class don&#8217;t work:</p>
<pre style="margin-left:4em;">
<span style="color:#2e8b57;">template</span> &lt;<span style="color:#2e8b57;">typename</span> T_&gt;
<span style="color:#2e8b57;">struct</span> S;

<span style="color:#2e8b57;">template</span> &lt;<span style="color:#2e8b57;">typename</span> T_&gt;
<span style="color:#2e8b57;">struct</span> T
{
    <span style="color:#2e8b57;">struct</span> U;
};

<span style="color:#2e8b57;">template</span> &lt;<span style="color:#2e8b57;">typename</span> T_&gt;
<span style="color:#2e8b57;">struct</span> S&lt;<span style="color:#2e8b57;">typename</span> T&lt;T_&gt;::U&gt;
{
};
</pre>
<p>Depending upon your compiler, the specialisation will either be rejected with a highly cryptic error message, or accepted but ignored. I don&#8217;t seem to be able to find the part of the standard that bans doing this, either, but that doesn&#8217;t necessarily mean it&#8217;s legal&#8230;</p>
<p>The solution, in any case, is to hoist the nested class out of the template, and use a typedef instead:</p>
<pre style="margin-left:4em;">
<span style="color:#2e8b57;">template</span> &lt;<span style="color:#2e8b57;">typename</span> T_&gt;
<span style="color:#2e8b57;">struct</span> S;

<span style="color:#2e8b57;">template</span> &lt;<span style="color:#2e8b57;">typename</span> T_&gt;
<span style="color:#2e8b57;">struct</span> T_U;

<span style="color:#2e8b57;">template</span> &lt;<span style="color:#2e8b57;">typename</span> T_&gt;
<span style="color:#2e8b57;">struct</span> T
{
    <span style="color:#2e8b57;">typedef</span> T_U&lt;T_&gt; U;
};

<span style="color:#2e8b57;">template</span> &lt;<span style="color:#2e8b57;">typename</span> T_&gt;
<span style="color:#2e8b57;">struct</span> S&lt;T_U&lt;T_&gt; &gt;
{
};
</pre>
<p>I&#8217;ve been of the opinion that nested classes are generally far more pain than they&#8217;re worth for a while now (they also can&#8217;t be forward-declared); I&#8217;m highly tempted to just stop using them anywhere at all, and switch exclusively to using typedefs.</p>
Posted in hate Tagged: c++, hate <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/707/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/707/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/707/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/707/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/707/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/707/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/707/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/707/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/707/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/707/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=707&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/11/26/c-template-specialisation-hate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>
	</item>
		<item>
		<title>This Week in Python Stupidity: os.stat, os.utime and Sub-Second Timestamps</title>
		<link>http://ciaranm.wordpress.com/2009/11/15/this-week-in-python-stupidity-os-stat-os-utime-and-sub-second-timestamps/</link>
		<comments>http://ciaranm.wordpress.com/2009/11/15/this-week-in-python-stupidity-os-stat-os-utime-and-sub-second-timestamps/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 22:34:21 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=693</guid>
		<description><![CDATA[The primary design principle behind the Python programming language is to take everything that&#8217;s horrible and wrong with Perl and get it horrible and wrong in a completely different and even more hideous way. Today, however, we shall be looking at a particularly egregious case of stupidity the likes of which not even PHP has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=693&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The primary design principle behind the Python programming language is to take everything that&#8217;s horrible and wrong with Perl and get it horrible and wrong in a completely different and even more hideous way. Today, however, we shall be looking at a particularly egregious case of stupidity the likes of which not even PHP has managed to replicate.</p>
<p>On Unix, timestamps have traditionally been held as an integer number of seconds since the epoch. The modification time for a file is one place such a timestamp has been used. Two groups of system calls are of interest to us here.</p>
<p>First, <code>stat</code> (and its <code>fstat</code> and <code>lstat</code> variants). The <code>stat</code> system call places information about a file into a <code>struct</code> also named <code>stat</code> (which is possible thanks to a lesser case of brain damage in C&#8217;s design). To get the mtime of a file, historically we would have used the <code>st_mtime</code> field, which is of type <code>time_t</code>, which is an integer of some kind:</p>
<pre style="margin-left:4em;">
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;sys/types.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;sys/stat.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;unistd.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;stdlib.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;stdio.h&gt;</span>

<span style="color:#2e8b57;">int</span> main(<span style="color:#2e8b57;">int</span> argc, <span style="color:#2e8b57;">char</span> * argv[])
{
    <span style="color:#2e8b57;">struct</span> stat s;
    <span style="color:#a52a2a;">if</span> (-<span style="color:#ff00ff;">1</span> == stat(<span style="color:#ff00ff;">&quot;timmy&quot;</span>, &amp;s))
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;

    printf(<span style="color:#ff00ff;">&quot;stat.st_mtime for timmy is </span><span style="color:#6a5acd;">%ld</span><span style="color:#6a5acd;">\n</span><span style="color:#ff00ff;">&quot;</span>, s.st_mtime);
    <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_SUCCESS</span>;
}
</pre>
<p>Sometimes we might want to modify a file, but not affect its mtime. Thus, we need a way to set a file&#8217;s mtime to a given value, and to do this we would historically have used a function from the <code>utime</code> family:</p>
<pre style="margin-left:4em;">
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;sys/types.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;sys/stat.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;unistd.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;stdlib.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;utime.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;fcntl.h&gt;</span>

<span style="color:#2e8b57;">int</span> main(<span style="color:#2e8b57;">int</span> argc, <span style="color:#2e8b57;">char</span> * argv[])
{
    <span style="color:#2e8b57;">struct</span> stat s;
    <span style="color:#a52a2a;">if</span> (-<span style="color:#ff00ff;">1</span> == stat(<span style="color:#ff00ff;">&quot;timmy&quot;</span>, &amp;s))
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;

    <span style="color:#2e8b57;">int</span> fd;
    fd = open(<span style="color:#ff00ff;">&quot;timmy&quot;</span>, O_WRONLY, O_TRUNC | O_CREAT);
    <span style="color:#a52a2a;">if</span> (-<span style="color:#ff00ff;">1</span> == fd)
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;
    <span style="color:#a52a2a;">if</span> (<span style="color:#ff00ff;">0</span> != close(fd))
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;

    <span style="color:#2e8b57;">struct</span> <span style="color:#2e8b57;">utimbuf</span> times = { .actime = s.st_atime, .modtime = s.st_mtime };
    <span style="color:#a52a2a;">if</span> (-<span style="color:#ff00ff;">1</span> == utime(<span style="color:#ff00ff;">&quot;timmy&quot;</span>, &amp;times))
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;

    <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_SUCCESS</span>;
}
</pre>
<p>(Sidenote: the above almost certainly should be using <code>fstat</code> and <code>futimes</code> instead to avoid race conditions, but this is irrelevant for our examples.)</p>
<p>But all of this operates only on a second-precision basis. For many applications this is no longer sufficient. Fortunately, some kernels and filesystems now support nanosecond-resolution timestamps.</p>
<p>First, for the <code>stat</code> family: rather than using <code>st_mtime</code>, we now use <code>st_mtim</code>, which is a <code>struct timespec</code>:</p>
<pre style="margin-left:4em;">
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;sys/types.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;sys/stat.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;unistd.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;stdlib.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;stdio.h&gt;</span>

<span style="color:#2e8b57;">int</span> main(<span style="color:#2e8b57;">int</span> argc, <span style="color:#2e8b57;">char</span> * argv[])
{
    <span style="color:#2e8b57;">struct</span> stat s;
    <span style="color:#a52a2a;">if</span> (-<span style="color:#ff00ff;">1</span> == stat(<span style="color:#ff00ff;">&quot;timmy&quot;</span>, &amp;s))
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;

    printf(<span style="color:#ff00ff;">&quot;stat.st_mtim for timmy is </span><span style="color:#6a5acd;">%ld</span><span style="color:#ff00ff;">s </span><span style="color:#6a5acd;">%ld</span><span style="color:#ff00ff;">ns</span><span style="color:#6a5acd;">\n</span><span style="color:#ff00ff;">&quot;</span>,
            s.st_mtim.tv_sec, s.st_mtim.tv_nsec);
    <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_SUCCESS</span>;
}
</pre>
<p>And if our filesystem supports it, we get something like:</p>
<pre style="margin-left:4em;">
$ ./mtimens
stat.st_mtim for timmy is 1258321672s 173919603ns
</pre>
<p>As we can see, running our old <code>utime</code>-using code preserves the seconds but not the nanoseconds:</p>
<pre style="margin-left:4em;">
$ touch timmy
$ ./mtimens
stat.st_mtim for timmy is 1258321978s 62671870ns
$ ./utime
$ ./mtimens
stat.st_mtim for timmy is 1258321978s 0ns
</pre>
<p>To modify preserving nanoseconds, we use either <code>utimensat</code> or <code>futimens</code>:</p>
<pre style="margin-left:4em;">
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;sys/types.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;sys/stat.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;unistd.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;stdlib.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;utime.h&gt;</span>
<span style="color:#a020f0;">#include </span><span style="color:#ff00ff;">&lt;fcntl.h&gt;</span>

<span style="color:#2e8b57;">int</span> main(<span style="color:#2e8b57;">int</span> argc, <span style="color:#2e8b57;">char</span> * argv[])
{
    <span style="color:#2e8b57;">struct</span> stat s;
    <span style="color:#a52a2a;">if</span> (-<span style="color:#ff00ff;">1</span> == stat(<span style="color:#ff00ff;">&quot;timmy&quot;</span>, &amp;s))
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;

    <span style="color:#2e8b57;">int</span> fd;
    fd = open(<span style="color:#ff00ff;">&quot;timmy&quot;</span>, O_WRONLY, O_TRUNC | O_CREAT);
    <span style="color:#a52a2a;">if</span> (-<span style="color:#ff00ff;">1</span> == fd)
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;
    <span style="color:#a52a2a;">if</span> (<span style="color:#ff00ff;">0</span> != close(fd))
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;

    <span style="color:#2e8b57;">struct</span> timespec times[<span style="color:#ff00ff;">2</span>] = { s.st_atim, s.st_mtim };
    <span style="color:#a52a2a;">if</span> (-<span style="color:#ff00ff;">1</span> == utimensat(AT_FDCWD, <span style="color:#ff00ff;">&quot;timmy&quot;</span>, times, <span style="color:#ff00ff;">0</span>))
        <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_FAILURE</span>;

    <span style="color:#a52a2a;">return</span> <span style="color:#ff00ff;">EXIT_SUCCESS</span>;
}
</pre>
<p>And now it works as expected:</p>
<pre style="margin-left:4em;">
$ touch timmy
$ ./mtimens
stat.st_mtim for timmy is 1258322326s 852774523ns
$ ./utimens
$ ./mtimens
stat.st_mtim for timmy is 1258322326s 852774523ns
</pre>
<p>Incidentally, POSIX.1-2008 considers the non-nanosecond-resolution functions and members to be deprecated, although since the nanosecond resolution functions aren&#8217;t universally available yet, a certain amount of autovoodoo is generally required&#8230;</p>
<p>Now we shall look at some Python. First, the old way:</p>
<pre style="margin-left:4em;">
<span style="color:#a020f0;">import</span> os

s = os.stat(&quot;<span style="color:#ff00ff;">timmy</span>&quot;)

f = open(&quot;<span style="color:#ff00ff;">timmy</span>&quot;, &quot;<span style="color:#ff00ff;">w+</span>&quot;)
f.close()

os.utime(&quot;<span style="color:#ff00ff;">timmy</span>&quot;, (s.st_atime, s.st_mtime))
</pre>
<p>Now, to see if we can guess how the new way works:</p>
<pre style="margin-left:4em;">
&gt;&gt;&gt; import os
&gt;&gt;&gt; os.stat("timmy").st_mtim
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'posix.stat_result' object has no attribute 'st_mtim'
</pre>
<p>Mmm, nope. Time to consult <a href="http://python.org/doc/2.5/lib/os-file-dir.html">the documentation</a>. Nothing under <code>stat</code>, but there&#8217;s something interesting called <code>stat_float_times</code>:</p>
<blockquote><p>
<code>stat_float_times([newvalue])</code></p>
<p>Determine whether stat_result represents time stamps as float objects. If newvalue is True, future calls to stat() return floats, if it is False, future calls return ints. If newvalue is omitted, return the current setting.
</p></blockquote>
<p>Uh oh. This can&#8217;t be good. Let&#8217;s look more closely at what happens when we run our code that uses <code>stat.st_mtime</code> and <code>os.utime</code>:</p>
<pre style="margin-left:4em;">
$ touch timmy
$ ./mtimens
stat.st_mtim for timmy is 1258324320s 762942258ns
$ python utime.py
$ ./mtimens
stat.st_mtim for timmy is 1258324320s 762942000ns
$ ./utimens 12345678901 111111111
$ ./mtimens
stat.st_mtim for timmy is 12345678901s 111111111ns
$ python utime.py
$ ./mtimens
stat.st_mtim for timmy is 12345678901s 111110000ns
</pre>
<p>What&#8217;s that, Lassie? Timmy has lost several significant digits of its sub-second mtime? Oh noes!</p>
<p>Yup, that&#8217;s right, Python&#8217;s underlying type for floats is an IEEE 754 double, which is only good for about sixteen decimal digits. With ten digits before the decimal point, that leaves six for sub-second resolutions, which is three short of the range required to preserve POSIX nanosecond-resolution timestamps. With dates after the year 2300 or so, that leaves only five accurate digits, which isn&#8217;t even enough to deal with microseconds correctly. Brilliant.</p>
Posted in python Tagged: python <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/693/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=693&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/11/15/this-week-in-python-stupidity-os-stat-os-utime-and-sub-second-timestamps/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>
	</item>
		<item>
		<title>How Round Is Your Circle?</title>
		<link>http://ciaranm.wordpress.com/2009/11/12/how-round-is-your-circle/</link>
		<comments>http://ciaranm.wordpress.com/2009/11/12/how-round-is-your-circle/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 18:27:44 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=673</guid>
		<description><![CDATA[As everyone knows, a point is that which has no part, a line is a breadthless length, and it is possible to cut a sphere up into a finite number of pieces, move them around and put them back together again to get two spheres identical in every way to the original sphere.
Unfortunately, in reality, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=673&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As everyone knows, a point is that which has no part, a line is a breadthless length, and it is possible to cut a sphere up into a finite number of pieces, move them around and put them back together again to get two spheres identical in every way to the original sphere.</p>
<div id="attachment_675" class="wp-caption aligncenter" style="width: 455px"><img src="http://ciaranm.files.wordpress.com/2009/11/banach-tarski_paradox.png?w=445&#038;h=200" alt="This is what mathematicians actually believe" title="This is what mathematicians actually believe" width="445" height="200" class="size-full wp-image-675" /><p class="wp-caption-text">(picture derived from <a href='http://en.wikipedia.org/wiki/File:Banach-Tarski_Paradox.svg'>original by Benjamin D. Esham for the Wikimedia Commons</a>)</p></div>
<p>Unfortunately, in reality, points have a size, lines have a width, spheres aren&#8217;t spheres and they can&#8217;t be cut up into infinitely complicated pieces. <a href="http://www.howround.com/">How Round Is Your Circle, Where Engineering and Mathematics Meet</a> by John Bryant and Chris Sangwin is an attempt by engineers to convince mathematicians that caring about real world issues can be interesting.</p>
<p>The book covers various practical issues, such as:</p>
<ul>
<li>How to draw a straight line, and how to make a ruler</li>
<li>How to test how circular a circle is</li>
<li>How to measure area</li>
</ul>
<p>In the process, it discusses all kinds of cunning gadgetry used in the olden days before digital computers and mass production, from steam engine linkages and pistons to slide rules and draughting devices. It also covers various physical demonstrations of geometric problems, and illustrates what happens when physical inaccuracies are ignored:</p>
<div id="attachment_683" class="wp-caption aligncenter" style="width: 444px"><img src="http://ciaranm.files.wordpress.com/2009/11/64_equals_651.png?w=434&#038;h=160" alt="64 = 65" title="64 = 65" width="434" height="160" class="size-full wp-image-683" /><p class="wp-caption-text"> </p></div>
<p>It&#8217;s certainly an interesting read, although I would have preferred more emphasis on the tools and gadgets used than on demonstrations of things they can be used to make. The maths isn&#8217;t particularly heavy, and shouldn&#8217;t put too many people off. Similarly, there&#8217;s nothing on the engineering side that would be inaccessible to anyone with no engineering background.</p>
Posted in hardware Tagged: books <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/673/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/673/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=673&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/11/12/how-round-is-your-circle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>

		<media:content url="http://ciaranm.files.wordpress.com/2009/11/banach-tarski_paradox.png" medium="image">
			<media:title type="html">This is what mathematicians actually believe</media:title>
		</media:content>

		<media:content url="http://ciaranm.files.wordpress.com/2009/11/64_equals_651.png" medium="image">
			<media:title type="html">64 = 65</media:title>
		</media:content>
	</item>
		<item>
		<title>Automake and Parallel Tests</title>
		<link>http://ciaranm.wordpress.com/2009/11/05/automake-and-parallel-tests/</link>
		<comments>http://ciaranm.wordpress.com/2009/11/05/automake-and-parallel-tests/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 21:15:29 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[build systems]]></category>
		<category><![CDATA[paludis internals]]></category>
		<category><![CDATA[automake]]></category>
		<category><![CDATA[paludis]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=659</guid>
		<description><![CDATA[One complaint occasionally encountered is that package test suites take too long to run. One of the packages for which that complaint is sometimes encountered is Paludis. The complainers rarely mention the difficulty of recovering a system from an error that should have been caught before installation, but still, running test suites faster cannot be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=659&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One complaint occasionally encountered is that package test suites take too long to run. One of the packages for which that complaint is sometimes encountered is <a href="http://paludis.pioto.org/">Paludis</a>. The complainers rarely mention the difficulty of recovering a system from an error that should have been caught before installation, but still, running test suites faster cannot be a bad thing. One way to go about that is to make better use of parallelism.</p>
<p>There are a number of issues involved here. The first of these doesn&#8217;t apply to Paludis, since we use our own <code>src_test</code> in ebuilds and exhereses (for unrelated reasons), but other package maintainers may find it interesting: the default <code>src_test</code> in <a href="http://www.gentoo.org/proj/en/qa/pms.xml">Gentoo EAPIs</a> calls <code>emake check -j1</code>.</p>
<p>The reasons for this are historical: when Nick and I worked out the original <code>src_test</code>, a good number of the packages upon which we tested it hated parallel tests. Admittedly, it didn&#8217;t help that nearly all of the packages in question were using hand-rolled test suite runners&#8230; Also, those were the bad old days when nearly everyone was using a single core x86 CPU, and very few people cared enough to make sure their packages built in parallel.</p>
<p>Even now, the <code>-j1</code> isn&#8217;t something we could just remove arbitrarily on Gentoo. When looking at it for Exherbo&#8217;s <a href="http://exherbo.org/docs/exheres-for-smarties.html">Exheres format</a>, Ingmar <a href="http://lists.exherbo.org/pipermail/exherbo-dev/2009-October/000578.html">found a non-trivial number of packages</a> that hated not having <code>-j1</code>. For Gentoo, removing the <code>-j1</code> would certainly require EAPI control.</p>
<p>But here&#8217;s the problem: the <code>-j1</code> doesn&#8217;t just affect running the tests. It also affects <em>building</em> the tests. For Paludis, over half the compile time is spent building tests. Were that done with <code>-j1</code> on a typical quad core box, it would double the compile time. In contrast to running the tests, building usually <em>is</em> parallel-safe, so the <code>-j1</code> has considerable impact. Alas, most build systems don&#8217;t provide a target for building tests without running them.</p>
<p>Even without the <code>-j1</code>, the second issue looms large. The Automake test runner doesn&#8217;t parallelise test execution. Tests are run one after another in strict sequence regardless of the number of jobs <code>make</code> is allowed to use.</p>
<p>Fortunately, Automake 1.11 includes <a href="http://www.gnu.org/software/hello/manual/automake/Simple-Tests-using-parallel_002dtests.html">a new test runner</a> that does support parallel execution. Alas, this test runner is only used by packages that explicitly request it, and it isn&#8217;t something that can be shoved into packages externally by the package manager.</p>
<p>Since every Paludis test is already safely parallelisable (no test does any work outside its individual temporary test directory), I&#8217;ve switched us over to using the new test runner. Doing so consisted of the following:</p>
<ul>
<li>Adding <code>AUTOMAKE_OPTIONS = parallel-tests</code> to every <code>Makefile.am</code>. Note that this option cannot simply be set in the top level makefile.</li>
<li>Switching from using <code>TESTS_ENVIRONMENT</code> to <code>LOG_COMPILER</code>. The former still works, but is marked for end user use.</li>
<li>Working around an annoying &#8216;feature&#8217; that prevents rules being generated for running tests for <code>TESTS</code> that include a variable set by <code>configure.ac</code>.
<li>Doing some ungodly hacks with file descriptors to be able to output to stdout from the test script runner.</li>
<li>Splitting up some of the larger tests into multiple smaller tests, to avoid having no output for several minutes, and to increase parallelisability.</li>
</ul>
<p>The <code>LOG_COMPILER</code> deserves further comment. To avoid massive confusion, when running tests in parallel, output is automatically redirected to a .log file. That&#8217;s all very well, but Automake is excessively quiet on this, and it looks a lot like nothing is happening whilst tests run. To work around this, the following ungodly hack appears to work:</p>
<pre style="margin-left:4em;">
LOG_COMPILER = \
    test "x$$BASH_VERSION" == x || \
        eval "exec 3&lt;&amp;1 ; export PALUDIS_TESTS_REAL_STDOUT_FD=3" ; \
    env \
        VARS_NEEDED_FOR_TESTS="whatever" \
        sh $(top_srcdir)/test/run_test.sh
</pre>
<p>Then, the test runner can output progress messages to stdout by using the <code>$PALUDIS_TESTS_REAL_STDOUT_FD</code> file descriptor (if the environment variable is set; unfortunately, some shells won&#8217;t let you do this), while leaving more verbose information to be logged as normal. Since POSIX guarantees writes to pipes of no more than a certain size to be atomic, we don&#8217;t have to worry about intermingled output so long as we keep our lines short.</p>
<p>As for the annoying &#8216;feature&#8217;, things like this work fine with the old test runner, but not the new one:</p>
<pre style="margin-left:4em;">
TESTS = $(variable_set_by_configure)
LOG_COMPILER = blah
</pre>
<p>For Paludis, we use this kind of construct to run <code>tidy</code> on HTML files, where the list of HTML files is taken from some <code>configure.ac</code> voodoo. Fortunately, we can work around it, so long as all of the tests have a common file extension:</p>
<pre style="margin-left:4em;">
TESTS = $(variable_set_by_configure)
TEST_EXTENSIONS = .html
HTML_LOG_COMPILER = blah
</pre>
<p>Note the arbitrary and annoying case change for HTML.</p>
<p>The end result of this tinkering is that Paludis tests on a quad core box now take around two minutes to run rather than six.</p>
<p>I understand it is traditional when writing long, rambling and largely pointless blog posts about parallel builds to <a href="http://www.amazon.co.uk/gp/registry/wishlist/16LVEYP610005?reveal=unpurchased&amp;filter=all&amp;sort=priority&amp;layout=standard">end with shameless whoring of an Amazon wishlist</a>.</p>
Posted in build systems, paludis internals Tagged: automake, paludis <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/659/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=659&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/11/05/automake-and-parallel-tests/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Exherbo Development Workflow</title>
		<link>http://ciaranm.wordpress.com/2009/11/03/exherbo-development-workflow/</link>
		<comments>http://ciaranm.wordpress.com/2009/11/03/exherbo-development-workflow/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 23:43:44 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[exherbo]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[paludis]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=649</guid>
		<description><![CDATA[In answer to what appears to be becoming a frequently asked question in #exherbo, my development workflow (and by extension, the one true workflow, any deviation from which is clearly heresy) is as follows:
For any repository I consider interesting, I have a local copy (but not a clone, because git clone is Satan&#8217;s work) in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=649&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In answer to what appears to be becoming a frequently asked question in <code>#exherbo</code>, my development workflow (and by extension, the one true workflow, any deviation from which is clearly heresy) is as follows:</p>
<p>For any repository I consider interesting, I have a local copy (but not a clone, because <code>git clone</code> is Satan&#8217;s work) in my home directory.</p>
<p>For Paludis, every repository it sees has <code>location</code> under <code>/var</code> somewhere. Paludis is never pointed at a repository that is modified by anything other than itself.</p>
<p>For syncing, any repository I consider interesting is synced using <code>sync = git+file:///home/users/ciaranm/repos/blah</code>, with <code>sync_options = --reset</code> (<a href="http://ciaranm.wordpress.com/2009/09/26/changes-to-the-paludis-git-syncer/">as previously described</a>). Others are synced as normal.</p>
<p>Before syncing normally, I pull all of the interesting repositories I have checked out in my home directory, so that Paludis ends up with everything up to date. The shell one-liner to do this is in my history, so it&#8217;s no additional work thanks to the wonder that is <code>reverse-i-search</code>.</p>
<p>On those rare occasions when I have to do some work on Exherbo that I can&#8217;t either just yell about until someone fixes it for me or force to be fixed by making Paludis reject it, I work as follows:</p>
<ul>
<li>Changes are made and committed in my home directory copy of the repository.</li>
<li>Paludis is synced, picking up those changes.</li>
<li>Testing is done.</li>
<li>More changes are made and committed, since things never work as expected the first time.</li>
<li>Paludis is synced, picking up those changes.</li>
<li>And so on.</li>
<li>When things finally work, <code>git rebase -i</code> is used to turn all my messy work-in-progress commits into something suitable for pushing. Given that other people are often working on the repositories in question, this also rebases my changes against current master.</li>
<li>Things are pushed.</li>
<li>When syncing again, the <code>--reset</code> ensures that Paludis ends up with the history-rewritten result, not some horrible automatic merge of the end result and previous works in progress.</li>
</ul>
<p>Fortunately, Git is easily powerful enough to handle this kind of thing, meaning Exherbo development workflows are designed around what works best, not around what is possible.</p>
<p>On a related note, I am still strongly considering making <code>--reset</code> the default one of these days. Anyone using <code>paludis --sync</code> on a repository they themselves modify should quickly justify their iniquity or risk being horribly surprised when the default changes.</p>
Posted in exherbo Tagged: exherbo, git, paludis <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/649/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=649&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/11/03/exherbo-development-workflow/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Paludis 0.42.2 Released</title>
		<link>http://ciaranm.wordpress.com/2009/11/03/paludis-0-42-2-released/</link>
		<comments>http://ciaranm.wordpress.com/2009/11/03/paludis-0-42-2-released/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 16:15:37 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[paludis releases]]></category>
		<category><![CDATA[paludis]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=656</guid>
		<description><![CDATA[Paludis 0.42.2 has been released:

An obscure resolver bug that results in &#8216;evolution&#8217; trying to downgrade &#8216;gnupg&#8217; on Gentoo has been fixed.
paludis -i foo::installed now gives an explanation of why it doesn&#8217;t do what some people seem to expect.
Assorted documentation tweaks.

Posted in paludis releases Tagged: paludis      <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=656&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://paludis.pioto.org/">Paludis</a> 0.42.2 has been released:</p>
<ul>
<li>An obscure resolver bug that results in &#8216;evolution&#8217; trying to downgrade &#8216;gnupg&#8217; on Gentoo has been fixed.</li>
<li>paludis -i foo::installed now gives an explanation of why it doesn&#8217;t do what some people seem to expect.</li>
<li>Assorted documentation tweaks.</li>
</ul>
Posted in paludis releases Tagged: paludis <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/656/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=656&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/11/03/paludis-0-42-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Paludis 0.42.1 Released</title>
		<link>http://ciaranm.wordpress.com/2009/10/31/paludis-0-42-1-released/</link>
		<comments>http://ciaranm.wordpress.com/2009/10/31/paludis-0-42-1-released/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 20:42:16 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[paludis releases]]></category>
		<category><![CDATA[paludis]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=653</guid>
		<description><![CDATA[Paludis 0.42.1 has been released:

Various improvements to error handling.
Syncing svn repositories no longer breaks when using weird locales.
GNU info handling will now work even if Paludis is run via sudo with env_reset enabled.

Posted in paludis releases Tagged: paludis      <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=653&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://paludis.pioto.org/">Paludis</a> 0.42.1 has been released:</p>
<ul>
<li>Various improvements to error handling.</li>
<li>Syncing svn repositories no longer breaks when using weird locales.</li>
<li>GNU info handling will now work even if Paludis is run via sudo with env_reset enabled.</li>
</ul>
Posted in paludis releases Tagged: paludis <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/653/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=653&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/10/31/paludis-0-42-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Paludis 0.42.0 Released</title>
		<link>http://ciaranm.wordpress.com/2009/10/27/paludis-0-42-0-released/</link>
		<comments>http://ciaranm.wordpress.com/2009/10/27/paludis-0-42-0-released/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 20:05:32 +0000</pubDate>
		<dc:creator>Ciaran McCreesh</dc:creator>
				<category><![CDATA[paludis releases]]></category>
		<category><![CDATA[paludis]]></category>

		<guid isPermaLink="false">http://ciaranm.wordpress.com/?p=650</guid>
		<description><![CDATA[Paludis 0.42.0 has been released:

Qualudis has been removed.
Various cached values are now forcibly discarded when they&#8217;re not going to be used any more, leading to paludis &#8211;owner and reconcilio using considerably less RAM.
Various bug, style and performance fixes related to updates (package moves etc). By default updates will still only be displayed but not carried [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=650&subd=ciaranm&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://paludis.pioto.org/">Paludis</a> 0.42.0 has been released:</p>
<ul>
<li>Qualudis has been removed.</li>
<li>Various cached values are now forcibly discarded when they&#8217;re not going to be used any more, leading to paludis &#8211;owner and reconcilio using considerably less RAM.</li>
<li>Various bug, style and performance fixes related to updates (package moves etc). By default updates will still only be displayed but not carried out; consult the FAQ for details.</li>
</ul>
Posted in paludis releases Tagged: paludis <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ciaranm.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ciaranm.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ciaranm.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ciaranm.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ciaranm.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ciaranm.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ciaranm.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ciaranm.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ciaranm.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ciaranm.wordpress.com/650/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ciaranm.wordpress.com&blog=3715284&post=650&subd=ciaranm&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ciaranm.wordpress.com/2009/10/27/paludis-0-42-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b50674d7755145d39cb70bb24b7ac0ea?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">Ciaran McCreesh</media:title>
		</media:content>
	</item>
	</channel>
</rss>