<?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>Niels' Homepage</title>
	<atom:link href="http://www.heirbaut.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.heirbaut.nl</link>
	<description>Everything I want to put on the web</description>
	<lastBuildDate>Sun, 13 Feb 2011 18:21:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Remove Build Dependencies after &#8216;apt-get build-dep&#8217;</title>
		<link>http://www.heirbaut.nl/2011/02/06/remove-build-dependencies-after-apt-get-build-dep/</link>
		<comments>http://www.heirbaut.nl/2011/02/06/remove-build-dependencies-after-apt-get-build-dep/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 14:27:49 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Software engineering]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/?p=295</guid>
		<description><![CDATA[I recently started to have a look at the LibreOffice code to see if I could contribute to it. On their developers web page there is a nice tutorial on how to install all the build dependencies for it using Debian based Linux distributions like Ubuntu. If you want to get rid of all these [...]]]></description>
			<content:encoded><![CDATA[<p> 	I recently started to have a look at the LibreOffice code to see if I could contribute to it. On their developers web page there is a nice tutorial on how to install all the build dependencies for it using Debian based Linux distributions like Ubuntu. If you want to get rid of all these dependencies after a while, for example because you are no longer interested or you need the disk space, it is very hard to delete them. Fortunately I found a working solution <a href="https://answers.launchpad.net/apt/+question/8366">here</a>.<br />
To make things a bit easier I built a script to for command line use that can be downloaded <a href="http://www.heirbaut.nl/downloads/build-dep-rm/build-dep-rm">here</a>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> markauto $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">apt-cache</span> showsrc <span style="color: #ff0000;">&quot;$1&quot;</span> \
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> Build-Depends \
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/(?:[\[(].+?[\])]|Build-Depends:|,|\|)//g'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>

<p>It can be invoked as follows (assuming it is in your PATH):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">build-dep-rm openoffice.org</pre></div></div>

<p>I want to emphasize that I did not invent this method, the credits should have to go to the persons that posted the solution on Launchpad.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2011/02/06/remove-build-dependencies-after-apt-get-build-dep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autotools Cookbook Notes, Part 2</title>
		<link>http://www.heirbaut.nl/2010/12/26/autotools-cookbook-notes-part-2/</link>
		<comments>http://www.heirbaut.nl/2010/12/26/autotools-cookbook-notes-part-2/#comments</comments>
		<pubDate>Sun, 26 Dec 2010 12:26:22 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[Autotools]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/?p=260</guid>
		<description><![CDATA[In the previous installment a skeleton Autotools project was created. In this installment the usage of libraries for the application code will be added. I like putting my application data into libraries as it makes it more convenient to reuse the code, e.g. when doing unit testing (which will be shown in a later installment). [...]]]></description>
			<content:encoded><![CDATA[<p> 	In the <a title="Autotools Cookbook Notes, Part 1" href="# NH: Let the system know where the local M4 macros are located. AC_CONFIG_MACRO_DIR([m4])" target="_blank">previous installment</a> a skeleton Autotools project was created. In this installment the usage of libraries for the application code will be added. I like putting my application data into libraries as it makes it more convenient to reuse the code, e.g. when doing unit testing (which will be shown in a later installment).</p>
<p>In this installment a skeleton setup for handling libraries using Libtool will be presented. At the end the methods to link against the static or dynamic libraries will be shown. The created library will be a very trivial one but the created skeleton should be enough to expand on this.<br />
<span id="more-260"></span></p>
<h1>Necessary files and directories</h1>
<p>Libraries by convention reside in a different directory, namely &#8216;lib&#8217; in your project root directory. This section will create the necessary structure and files.</p>
<h2>Create the &#8216;lib&#8217;-directory</h2>
<p>From the project root directory issue the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> lib</pre></div></div>

<h2>Create lib/print_hello.h</h2>
<p>In the newly created &#8216;lib&#8217;-directory add a file &#8216;print_hello.h&#8217; with the following contents:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#ifndef __PRINT_HELLO_H__</span>
<span style="color: #339933;">#define __PRINT_HELLO_H__</span>
&nbsp;
<span style="color: #993333;">void</span> print_hello<span style="color: #009900;">&#40;</span><span style="color: #993333;">const</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> addressee<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">#endif /* __PRINT_HELLO_H__ */</span></pre></div></div>

<h2>Create lib/print_hello.c</h2>
<p>Of course an implementation is needed. Add the file &#8216;print_hello.c&#8217; with the following contents in the &#8216;lib&#8217;-directory:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &quot;print_hello.h&quot;</span>
&nbsp;
<span style="color: #993333;">void</span> print_hello<span style="color: #009900;">&#40;</span><span style="color: #993333;">const</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> addressee<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Hello, %s!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> addressee<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Create lib/Makefile.am</h2>
<p>The Automake file &#8216;Makefile.am&#8217; in the &#8216;lib&#8217;-directory has the contents as shown below. It will be responsible for a library named &#8216;libfoobar&#8217; against which the application can later link statically or dynamically:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;"># NH: Define the libraries that are to be build</span>
lib_LTLIBRARIES <span style="color: #004400;">=</span> libfoobar<span style="color: #004400;">.</span>la
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: Compile flags for the library</span>
libfoobar_la_CFLAGS <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>Wall <span style="color: #004400;">-</span>Werror <span style="color: #004400;">-</span>pedantic <span style="color: #004400;">-</span>Wextra
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: The sources that make up the library.</span>
<span style="color: #339900; font-style: italic;"># NH: Do not forget the header files!</span>
libfoobar_la_SOURCES <span style="color: #004400;">=</span> print_hello<span style="color: #004400;">.</span>c print_hello<span style="color: #004400;">.</span>h
&nbsp;
MAINTAINERCLEANFILES <span style="color: #004400;">=</span> Makefile<span style="color: #004400;">.</span>in</pre></td></tr></table></div>

<h1>Change existing files</h1>
<p>Several files need to be adjusted to allow the build environment to create the library and to let the application make use of it.</p>
<h2>Adjust configure.ac</h2>
<p>Just below the macro &#8216;AC_CONFIG_MACRO_DIR&#8217; add the following macro:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>32
33
34
</pre></td><td class="code"><pre class="autoconf" style="font-family:monospace;"><span style="color: #339900;"># NH: Initialize Libtool providing us with the possibility to build</span>
<span style="color: #339900;"># NH: (shared) libraries more easily.</span>
LT_INIT</pre></td></tr></table></div>

<p>The parameters to &#8216;AC_CONFIG_FILES&#8217; should be extended with the location of the &#8216;Makefile&#8217; in the &#8216;lib&#8217;-directory:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>53
54
55
56
</pre></td><td class="code"><pre class="autoconf" style="font-family:monospace;"><span style="color: #00ffff;">AC_CONFIG_FILES</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span>
    Makefile
    lib<span style="color: #008000;">/</span>Makefile
    src<span style="color: #008000;">/</span>Makefile<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span></pre></td></tr></table></div>

<h2>Adjust Makefile.am</h2>
<p>The top &#8216;Makefile.am&#8217; should let Automake know that a &#8216;Makefile.am&#8217; is to be found in the &#8216;lib&#8217;-directory. Adjust the value for &#8216;SUBDIRS&#8217; as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>6
</pre></td><td class="code"><pre class="make" style="font-family:monospace;">SUBDIRS <span style="color: #004400;">=</span> lib src</pre></td></tr></table></div>

<p>Libtool leaves some cruft which should be removable when calling the &#8216;maintainer-clean&#8217; target. So adjust the values</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="make" style="font-family:monospace;">MAINTAINERCLEANFILES <span style="color: #004400;">=</span> \
    aclocal<span style="color: #004400;">.</span>m4 \
    configure \
    Makefile<span style="color: #004400;">.</span>in \
    m4<span style="color: #004400;">/</span>libtool<span style="color: #004400;">.</span>m4 \
    m4<span style="color: #004400;">/</span>lt~obsolete<span style="color: #004400;">.</span>m4 \
    m4<span style="color: #004400;">/</span>ltoptions<span style="color: #004400;">.</span>m4 \
    m4<span style="color: #004400;">/</span>ltsugar<span style="color: #004400;">.</span>m4 \
    m4<span style="color: #004400;">/</span>ltversion<span style="color: #004400;">.</span>m4</pre></td></tr></table></div>

<h2>Adjust src/Makefile.am</h2>
<p>The &#8216;Makefile.am&#8217; in the &#8216;src&#8217;-directory should have the following contents:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;"># NH: Define the program to be build</span>
bin_PROGRAMS <span style="color: #004400;">=</span> foobar
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: Define the sources that make up the program</span>
foobar_SOURCES <span style="color: #004400;">=</span> main<span style="color: #004400;">.</span>c
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: Add the include path to the library to the preprocessor flags</span>
foobar_CPPFLAGS <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>I<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">top_srcdir</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>lib
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: Set the compile flags</span>
foobar_CFLAGS  <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>Wall <span style="color: #004400;">-</span>Werror <span style="color: #004400;">-</span>pedantic <span style="color: #004400;">-</span>Wextra
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: Let the linker know where taht we want to link to libfoobar</span>
foobar_LDADD <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">top_srcdir</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>lib<span style="color: #004400;">/</span>libfoobar<span style="color: #004400;">.</span>la
&nbsp;
MAINTAINERCLEANFILES <span style="color: #004400;">=</span> Makefile<span style="color: #004400;">.</span>in</pre></td></tr></table></div>

<h2>Adjust src/main.c</h2>
<p>The &#8216;main.c&#8217; file in the &#8216;src&#8217;-directory should look as follows now if we want to use the new library and the function it provides:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &quot;print_hello.h&quot;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> argc<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> argv<span style="color: #339933;">;</span>
&nbsp;
	print_hello<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;World&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h1>Rebuild and test the current setup</h1>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">autoreconf <span style="color: #660033;">-ivf</span></pre></div></div>

<p>The following steps will define the default link behavior, which is most likely to use the dynamic link-library:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>If a statically linked application is required just disable dynamic linking:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--disable-shared</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>Run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">src<span style="color: #000000; font-weight: bold;">/</span>foobar</pre></div></div>

<p>This finishes this second installment. This is all there is to build and use libraries with the GNU Autotools.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2010/12/26/autotools-cookbook-notes-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autotools Cookbook Notes, Part 1</title>
		<link>http://www.heirbaut.nl/2010/12/25/autotools-cookbook-notes-part-1/</link>
		<comments>http://www.heirbaut.nl/2010/12/25/autotools-cookbook-notes-part-1/#comments</comments>
		<pubDate>Sat, 25 Dec 2010 11:01:58 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[Autotools]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/?p=226</guid>
		<description><![CDATA[For most software projects that go past the trivial state a build environment can assist in helping with finding dependencies, providing alternatives, documentation creation, unit testing, etc. One of the most flexible environments are provided by the GNU Autotools, but setting up a new Autotools project can be a bit cumbersome. It always seem to [...]]]></description>
			<content:encoded><![CDATA[<p> 	For most software projects that go past the trivial state a build environment can assist in helping with finding dependencies, providing alternatives, documentation creation, unit testing, etc. One of the most flexible environments are provided by the <a title="GNU Autotools introduction official site" href="http://http://www.gnu.org/software/hello/manual/automake/Autotools-Introduction.html" target="_blank">GNU Autotools</a>, but setting up a new Autotools project can be a bit cumbersome. It always seem to give me the feeling that I have to rediscover everything about the GNU Autotools and to avoid making the same mistakes over and over again I kept a lot of notes. The disadvantage of personal notes are of course:</p>
<ul>
<li>They get disorganized</li>
<li>They are hard to keep up-to-date</li>
<li>They are not always available</li>
<li>It is difficult to transfer the knowledge contained in them to another person</li>
</ul>
<p>So therefore I decided to do what I always do to solve these issues: I publish the knowledge on a subject that I obtained so far on my homepage. It will be series of installments, each building on the knowledge from the previous installments. In this first installment a trivial &#8216;Hello, World!&#8217; project will be created. Later installments will provide information on:</p>
<ul>
<li>Creating and using libraries</li>
<li>Creating and using unit tests</li>
<li>Creating documentation with Doxygen</li>
<li>Creating documentation with Docbook</li>
</ul>
<p>But more subjects might be added in the future. It is also most likely that new insights will be added to already published parts and I will try to indicate the new additions as good as possible.</p>
<p>Since I consider these my personal notes they are not a replacement for the full GNU Autotools documentation and other resources. For more in-depth information the following on- and off-line resources are recommended:</p>
<ul>
<li><a title="GNU Autotools site of Alexandre Duret-Lutz" href="http://www.lrde.epita.fr/~adl/autotools.html" target="_blank">The Autotools tutorial by Alexandre Duret-Lutz</a>. It not only provides a nice tutorial in the form of a presentation but also provides a lot of links to other resources.</li>
<li><a title="Autotools: a practitioner's guide by John Calcote" href="http://www.freesoftwaremagazine.com/books/autotools_a_guide_to_autoconf_automake_libtool" target="_blank">Autotools: a practitioner&#8217;s guide to Autoconf, Automake and Libtool</a> by John Calcote. based on these he published a <a title="The book of the same name at O'Reilly" href="http://oreilly.com/catalog/9781593272067" target="_blank">book with the same name</a>. Highly recommended.</li>
<li>One of the first books published on the GNU Autotools was the so-called &#8216;<a title="Amazon link to the 'Goat Book'" href="http://www.amazon.com/exec/obidos/ASIN/1578701902" target="_blank">Goat Book</a>&#8216; by Gary V. Vaughan, Ben Elliston, Tom Tromey and Ian Lance Taylor. It has since been <a title="Link to the 'Goat Book' on-line" href="http://sourceware.org/autobook/" target="_blank">published on-line</a> and, although it is not the most accessible text on the subject, it still contains a lot of good information.</li>
</ul>
<p>Although I consider these my notes, complete with rough-edges and warts and all, and by no means a complete tutorial on the subject I do still appreciate any remarks or comments. Nowhere will a setup guide for the used tools be given. These differ to much from system to system and with the use of Google resources with better information than I can provide should be available.</p>
<p><span id="more-226"></span></p>
<h1 id="internal-source-marker_0.6468225507900859">Setup project structure</h1>
<p>Go  to the directory where you want to store your project, create the  project directory and change your current working directory to the newly  created one:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>projects; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> foobar; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">!</span>$</pre></div></div>

<p>Create the source-directory and create the main.c (or .cpp) file there:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> src; <span style="color: #7a0874; font-weight: bold;">cd</span> src; <span style="color: #c20cb9; font-weight: bold;">touch</span> main.c; <span style="color: #7a0874; font-weight: bold;">cd</span> ..</pre></div></div>

<p>Create the directories to hold the M4 macros:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #c20cb9; font-weight: bold;">m4</span></pre></div></div>

<h1>Create initial files</h1>
<p>These  files act as placeholders for later development. However by creating  them the Autotools tool-chain can be gradually created and tested.</p>
<p>The  explanation of the entries are added as comments to the files  themselves and are marked as such with ‘NH:’ on each line. This provides  the possibility to just remove these comments without removing other  possibly more useful comments.</p>
<p>Once  entries are commented with ‘NH:’ in a file they will not be commented  again in following similar files. So if you miss an explaining comment  then please search for it in the sections previous to the one you are  reading.</p>
<h2>Create src/main.c</h2>
<p>Create a &#8216;main.c&#8217; file in the &#8216;src&#8217;-directory with the following contents:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* This is just the normal standard ‘Hello, World!’ source code. */</span>
<span style="color: #339933;">#include </span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> argc<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> argv<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span>“Hello<span style="color: #339933;">,</span> World<span style="color: #339933;">!</span>\n”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Create configure.ac</h2>
<p>In the project&#8217;s root-directory create a &#8216;configure.ac&#8217; file with the following contents:</p>

<div class="wp_syntax"><div class="code"><pre class="autoconf" style="font-family:monospace;"><span style="color: #339900;"># NH: Make sure that a specific minimum version of Autoconf is available</span>
<span style="color: #00ffff;">AC_PREREQ</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span><span style="color:#800080;">2.67</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #339900;"># NH: Initialize Autoconf. Specify the package's name, version</span>
<span style="color: #339900;"># NH: and whom to contact for bug-reports</span>
<span style="color: #00ffff;">AC_INIT</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span>foobar<span style="color: #008000;">&#93;</span>, <span style="color: #008000;">&#91;</span>1.0.0<span style="color: #008000;">&#93;</span>, <span style="color: #008000;">&#91;</span>foobar<span style="color: #008000;">@</span>heirbaut.nl<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #339900;"># NH: Define the place where to find the auxiliary build files like</span>
<span style="color: #339900;"># NH: install-sh, config.sub, config.guess etc.</span>
<span style="color: #339900;"># NH: I do not like them cluttering up my root directory, so I</span>
<span style="color: #339900;"># NH: put them in a directory named 'config'</span>
<span style="color: #00ffff;">AC_CONFIG_AUX_DIR</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span>config<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #339900;"># NH: Initialize Automake. The given options will be passed to</span>
<span style="color: #339900;"># NH: Automake:</span>
<span style="color: #339900;"># NH:   -Wall: Turn on all warnings</span>
<span style="color: #339900;"># NH:   -Werror: Treat Automake warnings as errors</span>
<span style="color: #339900;"># NH:   -Woverride: Warn on user redefinitions of Automake rules</span>
<span style="color: #339900;"># NH:                              or variables</span>
<span style="color: #339900;"># NH:   foreign: Do not build a GNU-standards compliant package. A</span>
<span style="color: #339900;"># NH:                        GNU package would require more files and setup.</span>
AM_INIT_AUTOMAKE<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span>-Wall -Werror -Woverride foreign<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #339900;"># NH: Define a unique source file that is always available. This</span>
<span style="color: #339900;"># NH: macro expands to a sanity check to ensure the for example</span>
<span style="color: #339900;"># NH: not the wrong directory is given with the --srcdir option</span>
<span style="color: #00ffff;">AC_CONFIG_SRCDIR</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span>src<span style="color: #008000;">/</span>main.c<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #339900;"># NH: Let the system know where the local M4 macros are located.</span>
<span style="color: #00ffff;">AC_CONFIG_MACRO_DIR</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span>m4<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #339900;"># Checks for programs.</span>
<span style="color: #339900;"># NH: Find the correct compiler</span>
<span style="color: #00ffff;">AC_PROG_CC</span>
&nbsp;
<span style="color: #339900;"># Checks for libraries.</span>
&nbsp;
<span style="color: #339900;"># Checks for header files.</span>
&nbsp;
<span style="color: #339900;"># Checks for typedefs, structures, and compiler characteristics.</span>
&nbsp;
<span style="color: #339900;"># Checks for library functions.</span>
&nbsp;
<span style="color: #339900;"># Miscellaneous</span>
<span style="color: #339900;">#NH: Make known to the Makefiles where the config dir is.</span>
<span style="color: #00ffff;">AC_SUBST</span><span style="color: #008000;">&#40;</span>ac_aux_dir<span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #339900;"># NH: Define the files to generate</span>
<span style="color: #00ffff;">AC_CONFIG_FILES</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span>
    Makefile
    src<span style="color: #008000;">/</span>Makefile<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #339900;"># NH: Generate the defined files.</span>
<span style="color: #00ffff;">AC_OUTPUT</span></pre></div></div>

<h2>Create Makefile.am</h2>
<p>In the project-root create a &#8216;Makefile.am&#8217; with the following contents:</p>

<div class="wp_syntax"><div class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;"># NH: Notify aclocal to scan for the m4 directory for M4 files.</span>
ACLOCAL_AMFLAGS <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>I m4
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: Indicate in which directories relative to this one other</span>
<span style="color: #339900; font-style: italic;"># NH: Makefile.am files are to be found.</span>
SUBDIRS <span style="color: #004400;">=</span> src
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: All files added to this one will also be deleted when the</span>
<span style="color: #339900; font-style: italic;"># NH: 'maintainer-clean' target is specified with 'make'. If not</span>
<span style="color: #339900; font-style: italic;"># NH: specified here not all files created by the toolchain will</span>
<span style="color: #339900; font-style: italic;"># NH: be deleted.</span>
MAINTAINERCLEANFILES <span style="color: #004400;">=</span> \
    aclocal<span style="color: #004400;">.</span>m4 \
    configure \
    Makefile<span style="color: #004400;">.</span>in
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: 'maintainer-clean-local' is a standard target within Autotools</span>
<span style="color: #339900; font-style: italic;"># NH: that can be used as a hook to trigger further actions when the</span>
<span style="color: #339900; font-style: italic;"># NH: 'maintainer-clean' target is called. In this case it makes sure</span>
<span style="color: #339900; font-style: italic;"># NH: that directory specified by 'AC_CONFIG_AUX_DIR' in configure.ac</span>
<span style="color: #339900; font-style: italic;"># NH: is deleted.</span>
maintainer<span style="color: #004400;">-</span>clean<span style="color: #004400;">-</span>local<span style="color: #004400;">:</span>
	<span style="color: #004400;">-</span>rm <span style="color: #004400;">-</span>rf <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">ac_aux_dir</span><span style="color: #004400;">&#41;</span>
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: A personal target that I use to edit all project files at once</span>
<span style="color: #339900; font-style: italic;"># NH: using my favorite editor.</span>
edit<span style="color: #004400;">:</span>
	find <span style="color: #004400;">.</span> \
		<span style="color: #004400;">-</span>name <span style="color: #CC2200;">'*.h'</span> <span style="color: #004400;">-</span>o \
		<span style="color: #004400;">-</span>name <span style="color: #CC2200;">'*.c'</span> <span style="color: #004400;">-</span>o \
		<span style="color: #004400;">-</span>name <span style="color: #CC2200;">'*.cpp'</span> <span style="color: #004400;">-</span>o \
		<span style="color: #004400;">-</span>name Makefile<span style="color: #004400;">.</span>am <span style="color: #004400;">-</span>o \
		<span style="color: #004400;">-</span>name configure<span style="color: #004400;">.</span>ac <span style="color: #004400;">|</span> \
	xargs gvim</pre></div></div>

<h2>Create src/Makefile.am</h2>
<p>In the project&#8217;s &#8216;src&#8217;-directory create a &#8216;Makefile.am&#8217;:</p>

<div class="wp_syntax"><div class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;"># NH: Define the program to be build</span>
bin_PROGRAMS <span style="color: #004400;">=</span> foobar
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: Define the sources that make up the program</span>
foobar_SOURCES <span style="color: #004400;">=</span> main<span style="color: #004400;">.</span>c
&nbsp;
<span style="color: #339900; font-style: italic;"># NH: Set the compile flags</span>
foobar_CFLAGS  <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>Wall <span style="color: #004400;">-</span>Werror <span style="color: #004400;">-</span>pedantic <span style="color: #004400;">-</span>Wextra
&nbsp;
MAINTAINERCLEANFILES <span style="color: #004400;">=</span> Makefile<span style="color: #004400;">.</span>in</pre></div></div>

<h2>Bootstrap and test the current setup</h2>
<p>All  initial files need to be given to the various tool-chain applications  (aclocal, autoconf and automake), to generate the ‘configure’ script.  This script will create ‘config.h’ and the ‘Makefile’s’. Here is how:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">autoreconf <span style="color: #660033;">-ivf</span></pre></div></div>

<p>Now the application can be build:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>And tested:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">src<span style="color: #000000; font-weight: bold;">/</span>foobar</pre></div></div>

<p>This finishes this first installment. Have fun experimenting!</p>
<h1>Updates</h1>
<h2>2010-12-26</h2>
<p>Added the macro &#8216;AC_CONFIG_MACRO_DIR&#8217; to &#8216;configure.ac.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2010/12/25/autotools-cookbook-notes-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems combining OmniCppComplete with Pathogen</title>
		<link>http://www.heirbaut.nl/2010/10/28/problems-combining-omnicppcomplete-with-pathogen/</link>
		<comments>http://www.heirbaut.nl/2010/10/28/problems-combining-omnicppcomplete-with-pathogen/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 19:22:04 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[ViM]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/?p=213</guid>
		<description><![CDATA[Since a few days I am using the Pathogen plug-in together with the scripts from GitHub as described here. I think it is a wonderful way to maintain my personal ViM installation. However, after installing and trying OmniCppComplete I got the following error messages when attempting to complete something: -- Omni completion (^O^N^P) Pattern not found After a while I found [...]]]></description>
			<content:encoded><![CDATA[<p> 	Since a few days I am using the Pathogen plug-in together with the scripts from GitHub as described <a title="Update ViM using Pathogen" href="http://github.com/bronson/vim-update-bundles#readme" target="_blank">here</a>. I think it is a wonderful way to maintain my personal ViM installation. However, after installing and trying OmniCppComplete I got the following error messages when attempting to complete something:</p>
<p style="padding-left: 30px;"><code>-- Omni completion (^O^N^P) Pattern not found</code></p>
<p>After a while I found out that the used complete-function &#8216;omnifunc&#8217; was set to:</p>
<p style="padding-left: 30px;"><code>ccomplete#Complete</code></p>
<p>This is the generic completion function for C-based programs and does not work well with C++-programs. To fix this add the following line to .vimrc:</p>
<p style="padding-left: 30px;"><code>au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main</code></p>
<p>This should leave you with a working OmniCppComplete plug-in managed from the vim-scripts repositories at GitHub.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2010/10/28/problems-combining-omnicppcomplete-with-pathogen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Computable door de bocht</title>
		<link>http://www.heirbaut.nl/2010/04/08/computable-door-de-bocht/</link>
		<comments>http://www.heirbaut.nl/2010/04/08/computable-door-de-bocht/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 18:49:51 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/?p=198</guid>
		<description><![CDATA[Ik heb me net heerlijk zitten ergeren aan een artikel op de Computable website. De stelling is dat het introduceren (het gebruik wordt niet eens genoemd), van Linux in een bedrijfsomgeving verborgen kosten met zich mee brengt. Dat zou helemaal waar kunnen zijn, maar de auteurs Johan Zwiekhorst en Jozef Schildermans van Data TestLab slaan [...]]]></description>
			<content:encoded><![CDATA[<p> 	Ik heb me net heerlijk zitten ergeren aan <a href="http://www.computable.nl/artikel/ict_topics/besturingssystemen/3311520/1277048/bespaart-linux-echt-zoveel-kosten.html">een artikel</a> op de Computable website. De stelling is dat het introduceren (het gebruik wordt niet eens genoemd), van Linux in een bedrijfsomgeving verborgen kosten met zich mee brengt. Dat zou helemaal waar kunnen zijn, maar de auteurs Johan Zwiekhorst en Jozef Schildermans van Data TestLab slaan volgens mij op een aantal punten behoorlijk door. De argumenten op een rijtje:</p>
<ul>
<li><em>Bovendien is opensourcesoftware minder populair dan Windows, zodat vandalen het vooralsnog grotendeels met rust laten</em>&#8230;Echt waar? Zouden de onderzoekers wel eens een gekeken hebben naar de echte getallen over Open Source? Apache, iemand? PHP? Java? Bovendien gaat het begrip Open Source veel verder dan alleen het operating system, dus het begint al door appels met peren te vergelijken.</li>
</ul>
<ul>
<li><em>Zoals je waarschijnlijk wel weet, bestaan er honderden Linux-distributies.</em> De toon lijkt nu wel gezet. Feitelijk en tendentieus.</li>
</ul>
<ul>
<li><em>De basis van die bundel is de linux kernel: die is hetzelfde voor iedereen. Daarbovenop komt het GNU/Linux platform.</em> Kennis van GNU/Linux ontbreekt blijkbaar bij de auteurs: de kernel is niet bij alle distributies hetzelfde. Ze zijn wel gebaseerd op dezelfde broncode, maar vaak aangepast door de maker van de distributie om zo goed mogelijk aan te sluiten bij de doelgroep van de distributie. De opmerking dat het GNU/Linux platform erbovenop komt is natuurlijk onzin. Het heet GNU/Linux omdat een Linux kernel wordt gecombineerd met de GNU applicaties om een operating system te maken. Richard Stallman zal het niet waarderen dat de GNU applicaties GNU/Linux worden genoemd.</li>
</ul>
<ul>
<li><em>Als je een Windows-gebaseerde server draait, dan moet je die clientlicenties betalen ongeacht het gebruikte desktopsysteem.</em> Wat een raar argument. Als het een homogene Windows-omgeving is, moet er ook voor zowel de client als de server licenties betaald worden. Bij Linux ben je in ieder geval nog het bedrag voor het desktop operating system kwijt.</li>
</ul>
<ul>
<li><em>Zo blijkt het erg moeilijk om computers van A-merken te kopen zonder Windows erop</em>. Dat is alleen <a href="http://en.wikipedia.org/wiki/Criticism_of_Microsoft#Licensing_agreements">Microsoft</a> aan te rekenen. Dus feitelijk weer juist, maar het lijkt mij eerder een argument om zo snel mogelijk te stoppen met het gebruik van Microsoft producten, want daardoor wordt blijkbaar de prijs van apparatuur onnodig opgejaagd.</li>
</ul>
<p>Afgezien van de hierboven beschreven argumenten, staat het artikel bovendien vol met taal- en/of typefouten. Ik ben benieuwd naar het vervolg op dit artikel op 12 april, maar gezien de argumentaties in dit artikel vrees ik het ergste.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2010/04/08/computable-door-de-bocht/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error: Cannot modify header information&#8230;</title>
		<link>http://www.heirbaut.nl/2010/04/02/error-cannot-modify-header-information/</link>
		<comments>http://www.heirbaut.nl/2010/04/02/error-cannot-modify-header-information/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 14:51:58 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software engineering]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/?p=195</guid>
		<description><![CDATA[If PHP ever gives you the following error (I just encountered it while developing with the Yii Framework): Cannot modify header information - headers already sent by Then you probably injected some whitespace somewhere in your output. The easiest way to avoid that is by not using the PHP closing tag &#8216;?>&#8216; at the end [...]]]></description>
			<content:encoded><![CDATA[<p> 	If PHP ever gives you the following error (I just encountered it while developing with the <a href="http://www.yiiframework.com">Yii Framework</a>):</p>
<p><code>Cannot modify header information - headers already sent by</code></p>
<p>Then you probably injected some whitespace somewhere in your output. The easiest way to avoid that is by not using the PHP closing tag &#8216;<code>?></code>&#8216; at the end of PHP source files. <a href="http://choosetheforce.blogspot.com/2008/05/should-you-close-that-php-tag.html">Some people</a> are against that but if I look into the sources for Yii and read  the <a href="http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html">Zend Framework Programmer&#8217;s Reference Guide</a> then it is obviously a well established method of avoiding the mentioned error.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2010/04/02/error-cannot-modify-header-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forcing a Yii application to authenticate</title>
		<link>http://www.heirbaut.nl/2010/02/23/forcing-a-yii-application-to-authenticate/</link>
		<comments>http://www.heirbaut.nl/2010/02/23/forcing-a-yii-application-to-authenticate/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 19:44:08 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[Otime]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/?p=190</guid>
		<description><![CDATA[I wanted my Yii based application to force users to authenticate. After studying the forums, the manuals and searching the web the solution came to me just as I was about to go to bed. It is dead simple: just make sure that the only action a default user can perform is actionLogin(). See the [...]]]></description>
			<content:encoded><![CDATA[<p> 	I wanted my <a href="http://www.yiiframework.com">Yii</a> based application to force users to authenticate. After studying the forums, the manuals and searching the web the solution came to me just as I was about to go to bed. It is dead simple: just make sure that the only action a default user can perform is <code>actionLogin()</code>. See the code below on how to accomplish this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> SiteController <span style="color: #000000; font-weight: bold;">extends</span> Controller
<span style="color: #009900;">&#123;</span>
    <span style="color: #009933; font-style: italic;">/**
     * @return array action filters
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> filters<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'accessControl'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// perform access control for CRUD operations</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     * Specifies the access control rules.
     * This method is used by the 'accessControl' filter.
     * @return array access control rules
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> accessRules<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'allow'</span><span style="color: #339933;">,</span>  <span style="color: #666666; font-style: italic;">// allow all users to perform 'login'</span>
                <span style="color: #0000ff;">'actions'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'login'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'users'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'allow'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// allow authenticated user to perform any action</span>
                <span style="color: #0000ff;">'users'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'deny'</span><span style="color: #339933;">,</span>  <span style="color: #666666; font-style: italic;">// deny all users</span>
                <span style="color: #0000ff;">'users'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// The rest of the SiteController implementation</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>I am not sure if this is the best possible solution, but since it is simple and elegant I am inclined to think it is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2010/02/23/forcing-a-yii-application-to-authenticate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Just blogging again</title>
		<link>http://www.heirbaut.nl/2010/02/07/just-blogging-again/</link>
		<comments>http://www.heirbaut.nl/2010/02/07/just-blogging-again/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 16:16:59 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/?p=184</guid>
		<description><![CDATA[A lot has happened the last couple of years. This has kept me busy and did not leave me with much desire to keep this blog up to data. And just when you think I will blog tomorrow, tomorrow has gone. And when tomorrow has gone, two years are gone. But while I was enjoying [...]]]></description>
			<content:encoded><![CDATA[<p> 	A lot has happened the last couple of years. This has kept me busy and did not leave me with much desire to keep this blog up to data. And just when you think I will blog tomorrow, tomorrow has gone. And when tomorrow has gone, two years are gone.</p>
<p>But while I was enjoying a presentation on <a href="http://www.identi.ca">Identi.ca</a> at <a href="http://www.fosdem.org/2010">FOSDEM</a> I all of a sudden had the idea that now would be a good time to start again. So <a href="http://identi.ca/nielsheirbaut">I joined Identi.ca</a> and added this entry to this site. Expect more in the very near future. Being on-line feels like fun again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2010/02/07/just-blogging-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mmmmm, nerd test&#8230;</title>
		<link>http://www.heirbaut.nl/2008/02/01/mmmmm-nerd-test/</link>
		<comments>http://www.heirbaut.nl/2008/02/01/mmmmm-nerd-test/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 08:55:08 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/2008/02/01/mmmmm-nerd-test/</guid>
		<description><![CDATA[I am not sure if this is good or bad. I just did the Nerd Test and got the following result: Should I be proud or crawl back in the basement? Let&#8217;s see with the second test offered at that site: Ok, back into the basement, I have to dust of some comic books&#8230;]]></description>
			<content:encoded><![CDATA[<p> 	I am not sure if this is good or bad. I just did the <a href="http://www.nerdtests.com/ft_nq.php">Nerd Test</a> and got the following result:<a href="http://www.nerdtests.com/nq_ref.html"><br />
<img src="http://www.nerdtests.com/images/badge/a7f8038bfe082efb.gif" alt="I am nerdier than 94% of all people. Are you a nerd? Click here to find out!" /></a></p>
<p>Should I be proud or crawl back in the basement?</p>
<p>Let&#8217;s see with <a href="http://www.nerdtests.com/ft_nt2.php">the second test</a> offered at that site:<br />
<a href="http://www.nerdtests.com/nt2ref.html"><br />
<img src="http://www.nerdtests.com/images/badge/nt2/89ccbaf784b9056a.png" alt="NerdTests.com says I'm a Cool Nerd King.  What are you?  Click here!"><br />
</a></p>
<p>Ok, back into the basement, I have to dust of some comic books&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2008/02/01/mmmmm-nerd-test/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Color schemes, Color schemes, Color schemes&#8230;</title>
		<link>http://www.heirbaut.nl/2007/11/14/color-schemes-color-schemes-color-schemes/</link>
		<comments>http://www.heirbaut.nl/2007/11/14/color-schemes-color-schemes-color-schemes/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 19:46:55 +0000</pubDate>
		<dc:creator>Niels</dc:creator>
				<category><![CDATA[ViM]]></category>

		<guid isPermaLink="false">http://www.heirbaut.nl/2007/11/14/color-schemes-color-schemes-color-schemes/</guid>
		<description><![CDATA[As a passionate and seasoned user of the best editor in the world I always look around for ways to improve the editing experience. One way to improve that is by selecting a good color scheme. The ViM website offer a ton of color schemes but no way to sample them other then look at [...]]]></description>
			<content:encoded><![CDATA[<p> 	As a passionate and seasoned user of <a href="http://www.vim.org" title="The best editor...">the best editor in the world</a> I always look around for ways to improve the editing experience. One way to improve that is by selecting a good color scheme. The ViM website offer a ton of color schemes but no way to sample them other then look at the user ratings, install them and then judge for yourself. And even then the color schemes on the ViM site are not all schemes that are available.</p>
<p>Fortunately <a href="http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/" title="ViM color schemes overview">someone</a> wrote a page where, as far as I know, all color schemes are shown and downloadable. Even my two favorite ones: <a href="http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/desert.vim" title="Desert color scheme">here</a> and <a href="http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/ekvoli.vim" title="Ekvoli color scheme">here</a>. The only minor annoyance is the fact that the color schemes are not all alphabetically ordered.</p>
<p>I know, I know, old news, but I still like to use this web site as my own long term memory&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.heirbaut.nl/2007/11/14/color-schemes-color-schemes-color-schemes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

