<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Alessandro Vermeulen]]></title>
  <link href="http://alessandrovermeulen.me/atom.xml" rel="self"/>
  <link href="http://alessandrovermeulen.me/"/>
  <updated>2013-05-20T16:30:36+02:00</updated>
  <id>http://alessandrovermeulen.me/</id>
  <author>
    <name><![CDATA[Alessandro Vermeulen]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Why you should switch to declarative programming]]></title>
    <link href="http://alessandrovermeulen.me/2013/05/19/why-you-should-switch-to-declarative-programming/"/>
    <updated>2013-05-19T12:52:00+02:00</updated>
    <id>http://alessandrovermeulen.me/2013/05/19/why-you-should-switch-to-declarative-programming</id>
    <content type="html"><![CDATA[<p>We are reaching limits of what is feasible with imperative languages and we should move to declarative languages. </p>

<p>When applications written in imperative languages grow, the code becomes convoluted. Why? Imperatively programmed applications contain statements such as <code>if X do Y else do Z</code>. As <code>Y</code> and <code>Z</code> contain <em>invisible</em> side-effects the correctness of the program relies on some implicit invariant. This invariant has to be maintained by the programmer or else the code will break. Thus each time a new feature is added to an application or a bug is fixed the code for the application gets more complex as keeping the invariant intact becomes harder. After a while the code becomes spaghetti-code and bugs are introduced as the programmer fails to maintain the invariant. This is going to happen despite the best intentions of the programmer to keep things clean. Why is this? </p>

<!-- more -->

<p>An imperative language is a type of language that tells the computer what to do and in which order. However, most, if not all, applications are nothing but a translation of some business domain into a computer program. In order to get the imperative code the programmer has to translate the business model to a set of imperative instructions, the business logic. The imperative instructions bear little resemblance to the original description of the business model. When the business model changes the imperative counterpart could change entirely but what happens is that programmers make incremental updates to the code. This is done because either they do not see that a more drastic change is necessary or because they are under pressure to deliver results. Over time this leads to bugs and unmaintainable code. Summarized, bugs are introduced because there is a manual translation step between the business model and the program code.</p>

<p>Imagine a system for calculating whether a person should receive a certain allowance. To receive the allowance a person has to meet several criteria such as <code>age &gt; 18 and income &lt; 2400</code>. We can denote this in the following way:</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
</pre></td><td class="code"><pre><code class="ruby"><span class="line"><span class="k">def</span> <span class="nf">receives_allowance?</span><span class="p">(</span><span class="n">age</span><span class="p">,</span> <span class="n">income</span><span class="p">)</span>
</span><span class="line">  <span class="n">age</span> <span class="o">&gt;</span> <span class="mi">18</span> <span class="o">&amp;&amp;</span> <span class="n">income</span> <span class="o">&lt;</span> <span class="mi">2400</span>
</span><span class="line"><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>There are several remarks to be made for this code. Adding a criteria such as marital status would involve adding a parameter to the function and changing the boolean expression. We could already avoid having to change parameters when we had chosen a parameter of type Person that contains the information about a person. But what if we would introduce time as an aspect in our criteria? We need to change the function again. And what if the age criteria changed? If the programmer erroneously codes something like <code>age &gt; 18 &amp;&amp; age &lt; 18</code> into the condition we would only find the bug during testing, if we are lucky. Additionally when our criteria become more complex we would like to extract criteria to their own functions. In short, it is easy to make mistakes this way.</p>

<p>A solution to this is to avoid the translation process by using a declarative language. A declarative language is a language that describes <em>what</em> is to be computed but not <em>how</em> it should be computed.<sup id="fnref:declarativereference"><a href="#fn:declarativereference" rel="footnote">1</a></sup> In essence: it omits control-flow. By encoding and thereby recording the business model into a set of declarative statements it becomes easier to spot irregularities in the business logic as the business logic reads more like the description of the business model and all invariants are <em>visible</em>. In this manner the programmer no longer tells the computer how to perform a computation but rather what the computation should be. This makes it easier to maintain </p>

<p>However, we take it even to an higher level entirely. By just using the declarative language, such as Haskell or Prolog, you are still using a general-purpose language and are thus lacking domain specific checks. It would be advantageous to devise a Domain Specific Language (DSL) instead. This would be a language specifically geared towards your business domain and can be done easily in a language such as Haskell. Creating a DSL has a great benefit: Because the business domain is written down in code the responsibility of translating the business domain into a program shifts from the programmer to the interpreter of the DSL. This has two benefits: the translation is consolidated in one single point (the interpreter) and can be verified or even proven to be correct. It could be checked that no contradicting statements are present. In this sense we can compare the validation to a spell-checker or JSLint but for our specific domain. Secondly the programmer cannot make mistakes in the translation of the business logic to imperative code.</p>

<p>A simple DSL embedding the idea of the allowance could look like the text in the examples below. The interpreter / compiler is able to inspect the separate rules and check whether they would cause a tautology or contradiction.</p>

<p>We will illustrate this with some examples. Consider the following text below, it is easy to read and it is clear what it means. Each line is a condition that has to hold, so we could read an “AND” at eacht line end. <small>(Whether Income is monthly or annually or weekly is not taken into account here but you get the picture.)</small></p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
</pre></td><td class="code"><pre><code class="ruby"><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">an</span> <span class="n">adult</span> <span class="k">when</span> <span class="n">his</span> <span class="no">Age</span> <span class="n">is</span> <span class="no">GREATER</span> <span class="no">THAN</span> <span class="no">OR</span> <span class="no">EQUAL</span> <span class="no">TO</span> <span class="mi">18</span>
</span><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">allegeable</span> <span class="k">for</span> <span class="n">an</span> <span class="n">allowance</span> <span class="no">IF</span>
</span><span class="line">  <span class="n">he</span> <span class="n">is</span> <span class="n">an</span> <span class="n">adult</span>
</span><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">allegeable</span> <span class="k">for</span> <span class="n">an</span> <span class="n">allowance</span> <span class="no">IF</span>
</span><span class="line">  <span class="n">his</span> <span class="no">Income</span> <span class="n">is</span> <span class="no">NOT</span> <span class="no">GREATER</span> <span class="no">THAN</span> <span class="err">€</span><span class="mi">2400</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>When we would add a rule as shown below, we could get a warning or error from the interpreter telling us that we have two different conditions on a person’s age.</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
</pre></td><td class="code"><pre><code class="ruby"><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">an</span> <span class="n">adult</span> <span class="k">when</span> <span class="n">his</span> <span class="no">Age</span> <span class="n">is</span> <span class="no">GREATER</span> <span class="no">THAN</span> <span class="no">OR</span> <span class="no">EQUAL</span> <span class="no">TO</span> <span class="mi">18</span>
</span><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">allegeable</span> <span class="k">for</span> <span class="n">an</span> <span class="n">allowance</span> <span class="no">IF</span>
</span><span class="line">  <span class="n">he</span> <span class="n">is</span> <span class="n">an</span> <span class="n">adult</span>
</span><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">allegeable</span> <span class="k">for</span> <span class="n">an</span> <span class="n">allowance</span> <span class="no">IF</span>
</span><span class="line">  <span class="n">his</span> <span class="no">Income</span> <span class="n">is</span> <span class="no">NOT</span> <span class="no">GREATER</span> <span class="no">THAN</span> <span class="err">€</span><span class="mi">2400</span>
</span><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">allegeable</span> <span class="k">for</span> <span class="n">an</span> <span class="n">allowance</span> <span class="no">IF</span>
</span><span class="line">  <span class="n">his</span> <span class="no">Age</span> <span class="n">is</span> <span class="no">GREATER</span> <span class="no">THAN</span> <span class="mi">21</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>And when we would add a rule as this it could warn us that no-one will ever get an allowance.</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
</pre></td><td class="code"><pre><code class="ruby"><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">an</span> <span class="n">adult</span> <span class="k">when</span> <span class="n">his</span> <span class="no">Age</span> <span class="n">is</span> <span class="no">GREATER</span> <span class="no">THAN</span> <span class="no">OR</span> <span class="no">EQUAL</span> <span class="no">TO</span> <span class="mi">18</span>
</span><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">allegeable</span> <span class="k">for</span> <span class="n">an</span> <span class="n">allowance</span> <span class="no">IF</span>
</span><span class="line">  <span class="n">he</span> <span class="n">is</span> <span class="n">an</span> <span class="n">adult</span>
</span><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">allegeable</span> <span class="k">for</span> <span class="n">an</span> <span class="n">allowance</span> <span class="no">IF</span>
</span><span class="line">  <span class="n">his</span> <span class="no">Income</span> <span class="n">is</span> <span class="no">NOT</span> <span class="no">GREATER</span> <span class="no">THAN</span> <span class="err">€</span><span class="mi">2400</span>
</span><span class="line"><span class="n">A</span> <span class="n">person</span> <span class="n">is</span> <span class="n">allegeable</span> <span class="k">for</span> <span class="n">an</span> <span class="n">allowance</span> <span class="no">IF</span>
</span><span class="line">  <span class="n">his</span> <span class="no">Age</span> <span class="n">is</span> <span class="no">LESS</span> <span class="no">THAN</span> <span class="mi">12</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>Not only would the interpreter be able to spot these kinds of errors but it would also be easier for the writer of these rules to spot whether there is a mistake.
The astute reader will have noticed than we have not included any control flow into our language making it a declarative language.</p>

<p>Because the business-logic is now represented by the DSL it can be written by domain experts instead of the programmers of the application itself. The compiler can provide feedback when something is wrong in the DSL and there is less chance for errors in the implementation of the business logic. Additionally this frees the programmes for implementing better translations of the DSL or other projects saving time and other resources. </p>

<p>To summarise 4 reasons why you should switch to declarative languages:</p>

<ol>
  <li>Direct translation of the business model into business logic </li>
  <li>Better readability of the business logic</li>
  <li>Better scalability for the program in terms of functionality</li>
  <li>Less bugs</li>
</ol>

<p>And 3 reasons why you should use DSLs to boot:</p>

<ol>
  <li>Free up programmers to do important stuff</li>
  <li>Let the domain-experts handle the business logic and have it machine-checked!</li>
  <li>It is just awesome</li>
</ol>

<div class="footnotes">
  <ol>
    <li id="fn:declarativereference">
      <p><a href="ftp://clip.dia.fi.upm.es/pub/papers/PARFORCE/second_review/D.WP3.1.M2.3.ps.Z">Lloyd, J.W., Practical Advantages of Declarative Programming</a><a href="#fnref:declarativereference" rev="footnote">&#8617;</a></p>
    </li>
  </ol>
</div>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Software and Building Architecture Compared]]></title>
    <link href="http://alessandrovermeulen.me/2012/04/14/software-and-building-architecture-compared/"/>
    <updated>2012-04-14T14:05:00+02:00</updated>
    <id>http://alessandrovermeulen.me/2012/04/14/software-and-building-architecture-compared</id>
    <content type="html"><![CDATA[<p>People tend to only understand what they can see. For most people it is
difficult to grasp more abstract matters without somehow visualizing them.
Software is an example of such an abstract matter. Let us visit the process of
developing software through a comparison with developing a building.</p>

<!-- more -->

<p>Everyone knows that in order to build something you will have to think about it
first. Just putting some sticks together as you did when you were playing
outside does not work very well for a skyscraper. For any construction you will
need an architecture to design it first. After your architect has designed the
project is has to go through some checks as to whether you will have enough
sunlight in the house, enough ventilation and perhaps most importantly that the
structure will not come down on itself! Ideally you only start building when
both the architect, the contractor and yourself are satisfied that the building
meets all requirements. Our knowledge on the construction of buildings has been
growing since we first exited our caves and thus we generally can found our
decisions during each step of the process on this knowledge.</p>

<p>Most people have not had the experience of just building some software that
eventually crashes because they did not think it through, it is not something
you do as a kid when playing outside. This makes things a bit more complicated
to imagine, but the development of software is quite analogous to the
development of some construction.</p>

<p>Coming up with a program is even more complicated than building a construction.
It comes with all the issues mentioned above when creating a building. It first
has to be designed, then it has to be passed along to someone leading the
developers to check for practicality and ideally usability. After that it can be
passed to the developers for the writing proper. The issue at hand being,
however, is that in the world of software wishes from the client and the
environment change continuously during the project. This causes an oscillation
between the stages mentioned above creating long delays before the final product
is finished. To make matters worse, the final product will not be the perfect
fit to the requirements due to the delays.</p>

<p>Why does this happen, you wonder? There are several reasons. For starters the
art of programming is still very young, learning from our mistakes. Even the
Romans had some mishaps when building their famous aqueducts. This entails that
we still lack the experience to found our design decisions on. Another reason is
that demands and wishes change rapidly in our new hyper-dynamic society. When
you set off on constructing a building you have a very good idea of why you want
to do that, what it will take and what your usage of the building will be.
Software projects are generally given less consideration.</p>

<p>A very contributing factor to the complexity of creating a software product is
the fact that most cases the software has to integrate ‘perfectly’ in the
physical process of the client, where most do not fully grasp their own process,
and that it has to communicate with other software products. These other
products might not be designed with the new scenario in mind and thus either
need adjustment or another way around it has to be found.</p>

<p>So, this is why coming up with a software product is just as difficult as
constructing a building, and is in most cases even harder. The next time someone
asks why it takes so long to write (good) software you just ask how long it took
to design his custom made house. :)</p>

<!-- Writing a program is quite complicated. It consists of many steps, most of which
are not even of a technical nature. It requires human interaction, figuring out
requirements and prioritizing them, scheduling of your resources (your
programmers), and continuous feedback to the client. Often you will have to deal
with changing requirements, either because the client decides he wants something
else, or because you discover edge cases when looking more closely at your
original requirements. Only after you have 

 

When people ask me what I do I answer them that I build software. These same
people often cannot grasp why building software is so difficult. I would like to
compare the development of a software product with the development of a
building.

Everyone knows that in order to build a house you first need to get the proper
permissions. After you have received the permission you can start designing your
house. In order to design you will need to know what kind of family will live in
the building, will they have kids, or is it a house for elderly people? What is
the environment the building will be build? Is it dry with soft ground or will
it be in a wet climate on hard rocks?

No grasp on the physical sense of software. Difficult to imagine/abstract. -->
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[JCU App installation script]]></title>
    <link href="http://alessandrovermeulen.me/2012/02/29/JCU-App-installation-script/"/>
    <updated>2012-02-29T18:17:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2012/02/29/JCU-App-installation-script</id>
    <content type="html"><![CDATA[<p>With this script it should be possible to install and build the JCU app in a
local directory. It does <em>not</em> build the UHC for you. If that is wanted the
option could be build in of course!</p>

<div><script src="https://gist.github.com/1902090.js?file="></script>
<noscript><pre><code /></pre></noscript></div>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Getting rid of programming JavaScript with Haskell]]></title>
    <link href="http://alessandrovermeulen.me/2012/01/26/getting-rid-of-javascript-with-haskell/"/>
    <updated>2012-01-26T20:29:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2012/01/26/getting-rid-of-javascript-with-haskell</id>
    <content type="html"><![CDATA[<p>For my Experimentation Project at Utrecht University I ported the “JCU”
application to Haskell. The JCU application is used to give Dutch High school
students the opportunity to taste Prolog.</p>

<p>The project uses the Utrecht Haskell Compiler and its JavaScript backend. The UHC
translates Haskell to Core and then translates this Core language to JavaScript.
For more information on this see the blog of the creator of the 
<a href="http://utrechthaskellcompiler.wordpress.com/2010/10/18/haskell-to-javascript-backend/">UHC JavaScript backend</a>.</p>

<p>Please read my <a href="http://alessandrovermeulen.me/downloads/report-on-getting-rid-of-js.pdf">report</a> on this
project. The project is hosted on GitHub in the following repositories:</p>

<ul>
  <li><a href="https://github.com/spockz/JCU">JCU</a>,</li>
  <li><a href="https://github.com/spockz/uhc-jscript">uhc-jscript</a>,</li>
  <li><a href="https://github.com/spockz/NanoProlog">NanoProlog</a>, and</li>
  <li><a href="http://hackage.haskell.org/package/uu-tc">UU-TC</a>.</li>
</ul>

<p><a href="http://www.flickr.com/photos/spockz/6767517435/" title="Incomplete proof in the HS JCU App by Alessandro Vermeulen, on Flickr"><img src="http://farm8.staticflickr.com/7025/6767517435_b075d1c686_z.jpg" width="640" height="414" alt="Incomplete proof in the HS JCU App" /></a>
<a href="http://www.flickr.com/photos/spockz/6767517241/" title="Complete proof in the HS JCU App by Alessandro Vermeulen, on Flickr"><img src="http://farm8.staticflickr.com/7155/6767517241_eacd8ec0ed_z.jpg" width="640" height="414" alt="Complete proof in the HS JCU App" /></a></p>

<p><strong>update 28-01-2012</strong>:
The keyword <code>jscript</code> in the UHC has been changed to <code>js</code> in order to avoid 
association with <a href="http://en.wikipedia.org/wiki/JScript">Microsoft’s JScript</a>.
Also <code>new Object</code> syntax is now available in the <code>foreign import</code> directives.</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
</pre></td><td class="code"><pre><code class="haskell"><span class="line"><span class="nf">foreign</span> <span class="kr">import</span> <span class="nn">js</span> <span class="s">&quot;new Object()&quot;</span>
</span><span class="line">  <span class="n">newObject</span> <span class="ow">::</span> <span class="kt">IO</span> <span class="p">(</span><span class="kt">JSPtr</span> <span class="n">a</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Photo's of the DMN Seniorenwedstrijd 21-01-2012 are now available]]></title>
    <link href="http://alessandrovermeulen.me/2012/01/23/photos-of-the-dmn-seniorenwedstrijd-21-01-2012-available/"/>
    <updated>2012-01-23T20:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2012/01/23/photos-of-the-dmn-seniorenwedstrijd-21-01-2012-available</id>
    <content type="html"><![CDATA[<p>The photo’s of the DMN Seniorenwedstrijd 21-01-2012 at Colijn Dance Masters are
now available. You can order them <a href="http://oypo.nl/pixxer.asp?id=B1835D91132DA171">here</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[A transition to static site generation]]></title>
    <link href="http://alessandrovermeulen.me/2011/12/14/a-transition-to-static-site-generation/"/>
    <updated>2011-12-14T22:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2011/12/14/a-transition-to-static-site-generation</id>
    <content type="html"><![CDATA[<p>Today I’ve launched my new blog. It is based on <a href="http://octopress.org/docs">Octopress</a>
and works by statically generating the pages and then syncing them with the
server.</p>

<p>If you are for example on OS X Lion and installed XCode 4.2 and you run into
weird errors like a missing gcc-4.2, and Homebrew throws errors like this:</p>

<blockquote>
  <p>Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local</p>
</blockquote>

<p>Please install the gcc package from this nice fellow:
<a href="https://github.com/kennethreitz/osx-gcc-installer">osx-gcc-installer</a></p>

<p>And if you are getting nagged by <code>rb-fsevent</code>. Change</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span>Gemfile</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class="ruby"><span class="line">  <span class="n">gem</span> <span class="s1">&#39;rb-fsevent&#39;</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>to </p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span>Gemfile</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class="ruby"><span class="line">  <span class="n">gem</span> <span class="s1">&#39;rb-fsevent&#39;</span><span class="p">,</span> <span class="s2">&quot;0.9.0.pre4&quot;</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p><strong>Update</strong>
The comments have been exported with the Wordpress plugin to Disqus. I’m
currently looking at how to highlight code within Disqus comments.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Caching hackage]]></title>
    <link href="http://alessandrovermeulen.me/2011/11/13/caching-hackage/"/>
    <updated>2011-11-13T00:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2011/11/13/caching-hackage</id>
    <content type="html"><![CDATA[
<p>On several occasions I noticed that when performing a <code>cabal update</code> that the
index was being downloaded at the rate of plus min 300 KB/s. Finally I got around to do
something about this. I&rsquo;ve set up a caching server located in Utrecht, The
Netherlands. It is a caching proxy for the hackage repository. If you want to
use it, add the following to your <code>~/.cabal/config</code> file. (Or equivalent on
Windows.)</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class="bash"><span class="line">remote-repo: cache:http://spockz.nl:12080/packages/archive
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>Be sure to comment out the already existing remote-repo. Otherwise, cabal will
download both indexes and merge them, and we don&rsquo;t want this.</p>

<h2 id="the-funny-bit">The funny bit</h2>
<p>Apparently this only helps if your machine is fast enough to process the index
(untarring and all extra administration cabal performs).</p>

<p>Plainly getting the file from the cache:</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
</pre></td><td class="code"><pre><code class="bash"><span class="line">&gt; wget http://spockz.nl:12080/packages/archive/00-index.tar.gz
</span><span class="line">Saving to: 00-index.tar.gz
</span><span class="line">100%<span class="o">[======================================</span>&gt;<span class="o">]</span> 3.394.821   10,9M/s   in 0,3s
</span><span class="line">2011-11-13 00:12:35 <span class="o">(</span>10,9 MB/s<span class="o">)</span> - 00-index.tar.gz saved <span class="o">[</span>3394821/3394821<span class="o">]</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>And running cabal update with my cache as source:</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class="bash"><span class="line">cabal update -v3  7,50s user 0,21s system 99% cpu 7,736 total
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>And then finally, with the original repository:</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class="bash"><span class="line">cabal update -v3  7,57s user 0,25s system 28% cpu 27,372 total
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>So here we see that the user time is roughly the same but you spent almost three
times more seconds waiting for your coffee to get cold. Any further speed
improvements for cabal update will probably require optimalisation of the code.</p>

<h2 id="the-caching-server">The caching server</h2>
<p>I&rsquo;m using <a href="https://www.varnish-cache.org/" title="Varnish">Varnish</a>
to cache the request to hackage. And here is my config file. Please shoot if you
see any improvements.</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
<span class="line-number">24</span>
<span class="line-number">25</span>
<span class="line-number">26</span>
<span class="line-number">27</span>
<span class="line-number">28</span>
<span class="line-number">29</span>
<span class="line-number">30</span>
<span class="line-number">31</span>
<span class="line-number">32</span>
<span class="line-number">33</span>
<span class="line-number">34</span>
<span class="line-number">35</span>
<span class="line-number">36</span>
<span class="line-number">37</span>
<span class="line-number">38</span>
<span class="line-number">39</span>
<span class="line-number">40</span>
<span class="line-number">41</span>
<span class="line-number">42</span>
<span class="line-number">43</span>
<span class="line-number">44</span>
<span class="line-number">45</span>
<span class="line-number">46</span>
<span class="line-number">47</span>
<span class="line-number">48</span>
<span class="line-number">49</span>
<span class="line-number">50</span>
<span class="line-number">51</span>
<span class="line-number">52</span>
<span class="line-number">53</span>
<span class="line-number">54</span>
<span class="line-number">55</span>
<span class="line-number">56</span>
<span class="line-number">57</span>
<span class="line-number">58</span>
<span class="line-number">59</span>
<span class="line-number">60</span>
<span class="line-number">61</span>
<span class="line-number">62</span>
<span class="line-number">63</span>
<span class="line-number">64</span>
<span class="line-number">65</span>
<span class="line-number">66</span>
<span class="line-number">67</span>
<span class="line-number">68</span>
<span class="line-number">69</span>
<span class="line-number">70</span>
<span class="line-number">71</span>
<span class="line-number">72</span>
<span class="line-number">73</span>
<span class="line-number">74</span>
<span class="line-number">75</span>
<span class="line-number">76</span>
<span class="line-number">77</span>
<span class="line-number">78</span>
<span class="line-number">79</span>
<span class="line-number">80</span>
<span class="line-number">81</span>
<span class="line-number">82</span>
<span class="line-number">83</span>
<span class="line-number">84</span>
<span class="line-number">85</span>
<span class="line-number">86</span>
<span class="line-number">87</span>
<span class="line-number">88</span>
<span class="line-number">89</span>
<span class="line-number">90</span>
<span class="line-number">91</span>
<span class="line-number">92</span>
<span class="line-number">93</span>
<span class="line-number">94</span>
<span class="line-number">95</span>
<span class="line-number">96</span>
<span class="line-number">97</span>
<span class="line-number">98</span>
<span class="line-number">99</span>
<span class="line-number">100</span>
<span class="line-number">101</span>
<span class="line-number">102</span>
<span class="line-number">103</span>
<span class="line-number">104</span>
<span class="line-number">105</span>
<span class="line-number">106</span>
</pre></td><td class="code"><pre><code class="bash"><span class="line"><span class="c"># This is a basic VCL configuration file for varnish.  See the vcl(7)</span>
</span><span class="line"><span class="c"># man page for details on VCL syntax and semantics.</span>
</span><span class="line">
</span><span class="line">backend backend_0 <span class="o">{</span>
</span><span class="line">	.host <span class="o">=</span> <span class="s2">&quot;hackage.haskell.org&quot;</span>;
</span><span class="line">	.port <span class="o">=</span> <span class="s2">&quot;80&quot;</span>;
</span><span class="line">	.connect_timeout <span class="o">=</span> 0.4s;
</span><span class="line">	.first_byte_timeout <span class="o">=</span> 300s;
</span><span class="line">	.between_bytes_timeout <span class="o">=</span> 60s;
</span><span class="line"><span class="o">}</span>
</span><span class="line">
</span><span class="line">
</span><span class="line">acl purge <span class="o">{</span>
</span><span class="line">  <span class="s2">&quot;localhost&quot;</span>;
</span><span class="line">	<span class="s2">&quot;hackage.haskell.org&quot;</span>;
</span><span class="line"><span class="o">}</span>
</span><span class="line">
</span><span class="line">sub vcl_recv <span class="o">{</span>
</span><span class="line">    <span class="nb">set </span>req.grace <span class="o">=</span> 120s;
</span><span class="line">    <span class="nb">set </span>req.backend <span class="o">=</span> backend_0;
</span><span class="line">
</span><span class="line">		<span class="nb">set </span>req.http.host <span class="o">=</span> <span class="s2">&quot;hackage.haskell.org&quot;</span>;
</span><span class="line">
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>req.request <span class="o">==</span> <span class="s2">&quot;PURGE&quot;</span><span class="o">)</span> <span class="o">{</span>
</span><span class="line">        <span class="k">if</span> <span class="o">(</span>!client.ip ~ purge<span class="o">)</span> <span class="o">{</span>
</span><span class="line">            error 405 <span class="s2">&quot;Not allowed.&quot;</span>;
</span><span class="line">        <span class="o">}</span>
</span><span class="line">        <span class="k">return</span><span class="o">(</span>lookup<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>req.request !<span class="o">=</span> <span class="s2">&quot;GET&quot;</span> &amp;amp;&amp;amp;
</span><span class="line">        req.request !<span class="o">=</span> <span class="s2">&quot;HEAD&quot;</span> &amp;amp;&amp;amp;
</span><span class="line">        req.request !<span class="o">=</span> <span class="s2">&quot;PUT&quot;</span> &amp;amp;&amp;amp;
</span><span class="line">        req.request !<span class="o">=</span> <span class="s2">&quot;POST&quot;</span> &amp;amp;&amp;amp;
</span><span class="line">        req.request !<span class="o">=</span> <span class="s2">&quot;TRACE&quot;</span> &amp;amp;&amp;amp;
</span><span class="line">        req.request !<span class="o">=</span> <span class="s2">&quot;OPTIONS&quot;</span> &amp;amp;&amp;amp;
</span><span class="line">        req.request !<span class="o">=</span> <span class="s2">&quot;DELETE&quot;</span><span class="o">)</span> <span class="o">{</span>
</span><span class="line">        /* Non-RFC2616 or CONNECT which is weird. */
</span><span class="line">        <span class="k">return</span><span class="o">(</span>pipe<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>req.request !<span class="o">=</span> <span class="s2">&quot;GET&quot;</span> &amp;amp;&amp;amp; req.request !<span class="o">=</span> <span class="s2">&quot;HEAD&quot;</span><span class="o">)</span> <span class="o">{</span>
</span><span class="line">        /* We only deal with GET and HEAD by default */
</span><span class="line">        <span class="k">return</span><span class="o">(</span>pass<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>req.http.If-None-Match<span class="o">)</span> <span class="o">{</span>
</span><span class="line">        <span class="k">return</span><span class="o">(</span>pass<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>req.url ~ <span class="s2">&quot;createObject&quot;</span><span class="o">)</span> <span class="o">{</span>
</span><span class="line">        <span class="k">return</span><span class="o">(</span>pass<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">
</span><span class="line">    remove req.http.Accept-Encoding;
</span><span class="line">
</span><span class="line">    <span class="k">return</span><span class="o">(</span>lookup<span class="o">)</span>;
</span><span class="line"><span class="o">}</span>
</span><span class="line">
</span><span class="line">sub vcl_pipe <span class="o">{</span>
</span><span class="line">    <span class="c"># This is not necessary if you do not do any request rewriting.</span>
</span><span class="line">    <span class="nb">set </span>req.http.connection <span class="o">=</span> <span class="s2">&quot;close&quot;</span>;
</span><span class="line">
</span><span class="line"><span class="o">}</span>
</span><span class="line">
</span><span class="line">sub vcl_hit <span class="o">{</span>
</span><span class="line">
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>req.request <span class="o">==</span> <span class="s2">&quot;PURGE&quot;</span><span class="o">)</span> <span class="o">{</span>
</span><span class="line">        purge_url<span class="o">(</span>req.url<span class="o">)</span>;
</span><span class="line">        error 200 <span class="s2">&quot;Purged&quot;</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>!obj.cacheable<span class="o">)</span> <span class="o">{</span>
</span><span class="line">        <span class="k">return</span><span class="o">(</span>pass<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line"><span class="o">}</span>
</span><span class="line">
</span><span class="line">sub vcl_miss <span class="o">{</span>
</span><span class="line">
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>req.request <span class="o">==</span> <span class="s2">&quot;PURGE&quot;</span><span class="o">)</span> <span class="o">{</span>
</span><span class="line">        error 404 <span class="s2">&quot;Not in cache&quot;</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">
</span><span class="line"><span class="o">}</span>
</span><span class="line">
</span><span class="line">sub vcl_fetch <span class="o">{</span>
</span><span class="line">    <span class="nb">set </span>beresp.grace <span class="o">=</span> 120s;
</span><span class="line">
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>!beresp.cacheable<span class="o">)</span> <span class="o">{</span>
</span><span class="line">        <span class="k">return</span><span class="o">(</span>pass<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>beresp.http.Set-Cookie<span class="o">)</span> <span class="o">{</span>
</span><span class="line">        <span class="k">return</span><span class="o">(</span>pass<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>beresp.http.Cache-Control ~ <span class="s2">&quot;(private|no-cache|no-store)&quot;</span><span class="o">)</span> <span class="o">{</span>
</span><span class="line">        <span class="k">return</span><span class="o">(</span>pass<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">    <span class="k">if</span> <span class="o">(</span>beresp.http.Authorization &amp;amp;&amp;amp; !beresp.http.Cache-Control ~ <span class="s2">&quot;public&quot;</span><span class="o">)</span> <span class="o">{</span>
</span><span class="line">        <span class="k">return</span><span class="o">(</span>pass<span class="o">)</span>;
</span><span class="line">    <span class="o">}</span>
</span><span class="line">
</span><span class="line"><span class="o">}</span>
</span><span class="line">
</span><span class="line">sub vcl_deliver <span class="o">{</span>
</span><span class="line">
</span><span class="line"><span class="o">}</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[lhs2TeX-hl version 1.4.5 has been released!]]></title>
    <link href="http://alessandrovermeulen.me/2011/10/15/lhs2tex-hl-version-1.4.5-has-been-released/"/>
    <updated>2011-10-15T00:00:00+02:00</updated>
    <id>http://alessandrovermeulen.me/2011/10/15/lhs2tex-hl-version-1.4.5-has-been-released</id>
    <content type="html"><![CDATA[<p>I’ve just released a new version of <a href="http://alessandrovermeulen.me/projects/lhs2texhl/" title="lhs2TeX HighLighter ">lhs2TeX-hl</a>: 1.4.5 and it includes some new features:</p>

<ol>
	<li>Added support for recursively traversing includes of .lhs files</li>
	<li>The program now doesn&#8217;t fail completely when haskell-src-exts fails to parse
    a file. An error is reported and the program continues. :) A fmt file is
    still generated.</li>
	<li>functions that aren&#8217;t functions but constants are now given the tag `constant&#8217;</li>
	<li>Removed a faulty command from the list.</li>
	<li>Cleaned up some code. (Probably introduced other ugly code) </li>
	<li>Binary operators are now typeset better. (I hope :))</li>
</ol>

<p>Please let me know what you think.</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Installing vacuum-cairo with the help of HomeBrew]]></title>
    <link href="http://alessandrovermeulen.me/2011/09/19/installing-vacuum-cairo-with-the-help-of-homebrew/"/>
    <updated>2011-09-19T00:00:00+02:00</updated>
    <id>http://alessandrovermeulen.me/2011/09/19/installing-vacuum-cairo-with-the-help-of-homebrew</id>
    <content type="html"><![CDATA[<p>I tried installing vacuum-cairo on OS X 10.6 but it failed. With the help of <a href="http://mxcl.github.com/homebrew/" title="HomeBrew">HomeBrew</a> I
installed the dependencies by doing the following:</p>

<p>Be sure to run <code>brew update</code> first.</p>

<p>Then install the dependencies:</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
</pre></td><td class="code"><pre><code class="bash"><span class="line">brew install pkg-config
</span><span class="line">brew install glib
</span><span class="line">brew install librsvg
</span><span class="line">chmod u+w /usr/local/Cellar/gdk-pixbuf/2.23.5/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
</span><span class="line">brew install librsvg
</span><span class="line">brew install pango
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>Note the installing of librsvg twice, this is in accordance with https://github.com/mxcl/homebrew/issues/4970. If you don’t get an error after running the first install of librsvg you might have a new update brew of librsvg.</p>

<p>And finally install vacuum-cairo:</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class="bash"><span class="line">cabal install vacuum-cairo
</span></code></pre></td></tr></table></div></figure></notextile></div>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Applescript script to emulate the behaviour of the `start' command in the windows CMD prompt]]></title>
    <link href="http://alessandrovermeulen.me/2011/07/01/applescript-start-command-windows/"/>
    <updated>2011-07-01T00:00:00+02:00</updated>
    <id>http://alessandrovermeulen.me/2011/07/01/applescript-start-command-windows</id>
    <content type="html"><![CDATA[<p>People have asked me how to launch a program through the terminal in the
background but with it’s own terminal screen similar to the way the “start”
command in the Windows CMD prompt works. Well here it is. Add the following two
files (start.applescript) and start to your path, and make them executable
(<code>chmod +x {start.applescript,start}</code>).</p>

<p>One point of notice is to <strong>always</strong> encapsulate strings with
spaces that should be one parameter in quotes.</p>

<div><script src="https://gist.github.com/1059096.js?file="></script>
<noscript><pre><code /></pre></noscript></div>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Haskell code completion for TextMate]]></title>
    <link href="http://alessandrovermeulen.me/2011/03/26/haskell-code-completion-for-textmate/"/>
    <updated>2011-03-26T00:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2011/03/26/haskell-code-completion-for-textmate</id>
    <content type="html"><![CDATA[<p>Today I released my script for basic code completion support in TextMate.</p>

<p>The package can be found on <a title="The textmatetags package" href="http://hackage.haskell.org/package/textmatetags">hackage</a> and on <a title="Haskell Code Completion for TextMate" href="https://github.com/spockz/Haskell-Code-Completion-for-TextMate">github</a>.</p>

<p>Please read the README for installation instructions. Currently only identifiers
from interpreted source code is available. Future releases will aim at providing
better code completion support by using either Scion or HaskellSrcExts, or both.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Generic Text Markup with CSS]]></title>
    <link href="http://alessandrovermeulen.me/2011/03/18/generic-text-markup-with-css/"/>
    <updated>2011-03-18T00:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2011/03/18/generic-text-markup-with-css</id>
    <content type="html"><![CDATA[<p>Most of you are familiar with CSS reset scripts to reset CSS behaviour to
something uniform across several browsers. I have been searching for a good CSS
stylesheet that would do the same for the formatting of my text. That is, to
give the text on a site a markup, suitable for reading. As a great fan of LaTeX
this markup should follow the default markup of LaTeX as closely as possible.</p>

<p>As I could not find such a stylesheet I build my own. It probably is far from
finished, although I tried to cover the most common cases in this script.</p>

<p>In time there will be a git <a href="http://github.com">repository</a> that will
contain test cases and updated versions of this stylesheet.</p>

<p>I tested this script in the presence of the <a title="CSS Tools: Reset CSS" href="http://meyerweb.com/eric/tools/css/reset/">Meyer CSS reset</a>, but it
should also work without any CSS Reset present, or together with other CSS reset
stylesheets.</p>

<p>Please let me know (either by mail or a reply) if you have any remarks!</p>
<div><script src="https://gist.github.com/876971.js?file="></script>
<noscript><pre><code /></pre></noscript></div>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[UUAG TextMate Bundle released]]></title>
    <link href="http://alessandrovermeulen.me/2011/03/10/uuag-textmate-bundle-released/"/>
    <updated>2011-03-10T00:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2011/03/10/uuag-textmate-bundle-released</id>
    <content type="html"><![CDATA[<p>I’m proud to announce the release of the <a title="GitHub repository of the UUAGC TextMate Bundle" href="https://github.com/spockz/UUAttributeGrammar-TextMate-Bundle">TextMate
bundle</a> for <a title="Utrecht University Attribute Grammar System" href="http://www.cs.uu.nl/wiki/HUT/AttributeGrammarSystem">UUAG</a>. It is
currently very simple and is based on the <a title="Haskell Bundle for TextMate" href="http://weblog.jamisbuck.org/2005/11/1/haskell-bundle-for-textmate">Haskell
TextMate bundle</a> by Jamis Buck.</p>

<p>The only quirk is that you need to add <code>--|</code> after every sem block, otherwise
TextMate will consider everything afterward Haskell code. This token is used to
indicate the end of the Haskell code that officially starts after the <code>=</code>. This
has the effect that every <code>|</code> before every Constructor is coloured blue. If you
want to avoid this, insert <code>--|</code> after every definition.</p>

<div class="bogus-wrapper"><notextile><figure class="code"><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
</pre></td><td class="code"><pre><code class=""><span class="line">sem Foo
</span><span class="line">  | Bar lhs.cafe = ...
</span><span class="line">  | Hotel lhs.desk = ...
</span><span class="line">--|
</span></code></pre></td></tr></table></div></figure></notextile></div>

<p>Happy coding! (<a href="https://github.com/spockz/UUAttributeGrammar-TextMate-Bundle">GitHub repository</a>, develop: <a href="https://github.com/spockz/UUAttributeGrammar-TextMate-Bundle/tarball/master">UUAG.tmbundle.tar.gz</a>)</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[A note on the versionless HTML]]></title>
    <link href="http://alessandrovermeulen.me/2011/01/22/a-note-on-the-versionless-html/"/>
    <updated>2011-01-22T00:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2011/01/22/a-note-on-the-versionless-html</id>
    <content type="html"><![CDATA[<p>Yesterday WhatWG announced to drop the versioning of HTML. HTML is to be a <a href="http://blog.whatwg.org/html-is-the-new-html5">living standard</a>. This
comes at a very inconvenient time I fear.</p>

<p>Over the past few years web standards have, albeit slowly, developed into some
mature state: Most browsers support the current (x)HTML, CSS and JS standards to
the letter and can do more. However, due to the fact that these standards have
evolved so slowly new developments are not included in these standards. HTML5
(<a href="http://dev.w3.org/html5/spec/Overview.html">W3C</a> and <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">WhatWG</a>)
solves a lot of these problems, including features like <code>&lt;canvas&gt;</code> and
<code>&lt;video&gt;</code>.</p>

<p>With WhatWG dropping the version number of HTML I foresee a descent back to the
Dark Ages where every browser supported a different standard and supported the
same standards differently, one browser would support feature X and not Y while
the other supports Y but not X. This is a nightmare for developers: not being
able to rely on the uniformity of the browsers of your visitors. This created
necessities as writing specific CSS and JS code for specific browsers to `fix’
certain behaviour. These fixes mostly had to be done for Internet Explorer as it
had at the time by far the largest install base.</p>

<p>Now that we have finally arrived at an era where all browsers support the same
set of rather advanced techniques we decide to drop versions. In some cases it
is not a disaster to not have a version number. Look at CSS, the changes that
have been made to the standard were mostly additions. New operators and new
properties and values have been added. These changes required a better parser,
and the recognition of the new fields, but never did a semantic
<strong>change</strong>. This, together with the tradition that CSS engines
ignore the statements they don’t understand has led to developers being able to
include new techniques in CSS files and thus implicitly setting the version of
the CSS in the file. As nothing changed older and newer browsers behaved the
same at the old statements and only the newer browsers acted on the new
statements. So up to now the absence of explicit CSS versioning didn’t cause any
problems for CSS.</p>

<p>However, with the absence of versions in HTML5 we have a problem. Not only does
the HTML5 standard describe the structure of HTML but it also describes the JS
that the browser should support. These standards are in contrast to CSS subject
to the changing of their semantics. For example, a JavaScript function can get a
different interface: different parameters and/or return values, but also its
semantic proper might change.</p>

<p>This changing of semantics without version numbers causes a new nightmare for
developers, as they have no way to be sure that their site will look the same
across different browsers as they all may support a slightly different
incarnation of the standard and on top of that the developer cannot be sure his
site will look the same in the same browser a month from now, or even the next
day, as the browser can switch to support a newer instance of the standard. As
different versions of the same browser may have different engines that support
different incarnations of the standard you now also have to worry about the
differences between browser versions that your visitors use.</p>

<p>One might notice the presence of a lot of conditions in the above text and think
“What is the fuss, it might all not happen.”. The main argument I would like to
make here is this: a `living’ standard introduces a lot of uncertainties. At a
time where certainties are just starting to come back, giving developers peace
of mind, going back to living with uncertainties is certainly a descent into
Dark Ages in my opinion.</p>

<h3>A solution?</h3>
<p>There is of course a reason why they choose to declare this standard as
`living’. It denotes the fact that the web is evolving on a faster pace than we
are used to, it is quite dynamic. Having to wait several years before you can
use a very nice new feature on your website is not nice, as you would like to
use it as soon as it becomes defined. Therefore, instead of declaring the
standard completely dynamic and deprived of versions, I suggest something like
annual milestones. This way one can still compare browsers on their
capabilities, new features can be expected to be available rather quickly and
most importantly you provide a frame of reference for the developer.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[lhs2TeX-hl 1.2.2 released]]></title>
    <link href="http://alessandrovermeulen.me/2010/11/23/lhs2tex-hl-1.2.2-released/"/>
    <updated>2010-11-23T00:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2010/11/23/lhs2tex-hl-1.2.2-released</id>
    <content type="html"><![CDATA[<p>Changelog:</p>
<ol>
  <li>Classes are written to the format file;</li>
  <li>There should be less &#8220;ambiguous operator&#8221; errors now;</li>
  <li>Removed the Agda dependency as it didn&#8217;t do anything with Agda at all.</li>
</ol>

<p><a href="http://hackage.haskell.org/package/lhs2TeX-hl">Hackage</a>, <a href="https://github.com/spockz/lhs2texhl">GitHub</a>.</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[lhs2TeX-hl 0.1.1.1 released]]></title>
    <link href="http://alessandrovermeulen.me/2010/11/01/lhs2tex-hl-0.1.1.1-released/"/>
    <updated>2010-11-01T00:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2010/11/01/lhs2tex-hl-0.1.1.1-released</id>
    <content type="html"><![CDATA[<p>After the <a href="http://alessandrovermeulen.me/2010/10/23/lhs2tex-hl-released/">first
release</a> of my tool on hackage <a href="http://hackage.haskell.org/package/lhs2TeX-hl-0.1.1.1">this release</a>
actually is a working package. The previous one didn’t install out of the box.</p>

<p>The most important <code>changes </code> are:</p>

<ol>
  <li>Added a filter for rewrite rules that aren’t “lhs2TeX safe”, e.g. <code>format () = ...</code>;</li>
  <li>I hardcoded the default formatting rules for several of lhs2TeX defaults,
including but not limited to <code>-&gt;</code>, <code>&lt;-</code> and <code>=&gt;</code>. This is not a desirable
solution but it suits my purposes.</li>
</ol>

<p>You can do literal (numeral, character and string) formatting easily with
lhs2TeX itself with the following directives:</p>

<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span /></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
</pre></td><td class="code"><pre><code class="latex"><span class="line"><span class="c">%subst char a    	= &quot;\color{char}\text{\tt &#39;&#39;&quot; a &quot;&#39;&#39;}&quot;</span>
</span><span class="line"><span class="c">%subst string a  	= &quot;\color{string}\text{\tt \char34 &quot; a &quot;\char34}&quot;</span>
</span><span class="line"><span class="c">%subst numeral a =  &quot;\color{numeral}{ &quot; a &quot; }&quot;</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[lhs2TeX-hl released]]></title>
    <link href="http://alessandrovermeulen.me/2010/10/23/lhs2tex-hl-released/"/>
    <updated>2010-10-23T00:00:00+02:00</updated>
    <id>http://alessandrovermeulen.me/2010/10/23/lhs2tex-hl-released</id>
    <content type="html"><![CDATA[<p>I’m proud to announce the first release of my lhs2TeX-hl tool. For us who fancy using colours in our presentations or papers this should now go a whole lot easier. Go to the <a href="http://alessandrovermeulen.me/projects/lhs2texhl/">lhs2TeX-hl homepage</a>!</p>

<p>Install it like this:</p>

<p>[bash]
&gt; cabal install lhs2TeX-hl
[/bash]</p>

<p>lhs2TeX-hl is run before you run lhs2TeX and you supply it with the input file and the output file. A typical execution would look like this:</p>

<p>[bash]
&gt; lhs2TeX-hl -o MyPaper.fmt MyPaper.lhs
&gt; lhs2TeX -o MyPaper.Tex MyPaper.lhs
&gt; pdflatex MyPaper.tex
[/bash]</p>

<p>It’s important to note here that you should’ve added the following line to your MyPaper.lhs file:</p>
<pre>%include MyPaper.fmt</pre>
<p>And that you have the following commands defined in your latex file:</p>
<ul>
	<li> \lhsCHkeyword</li>
	<li>\lhsCHprelude</li>
	<li>\lhsCHtype</li>
	<li>\lhsCHlitNumber</li>
	<li>\lhsCHconstructor</li>
	<li>\lhsCHfunction</li>
	<li>\lhsCHinfixoperator</li>
</ul>
<p>For example, like this:</p>
<pre>\definecolor{datatype}{RGB}{42,0,217}
\definecolor{class}{RGB}{197,11,16}
\definecolor{fieldname}{RGB}{0,0,162}
\definecolor{prelude}{RGB}{64,80,117}
\definecolor{numeral}{RGB}{0,0,205}
\definecolor{infixoperator}{RGB}{42,0,217}
\definecolor{constructor}{RGB}{0,161,0}
\definecolor{keyword}{RGB}{229,120,0}
\definecolor{special1}{RGB}{159,138,0}

\newcommand{\lhsCHfunction}[1]{\color{infixoperator}}
\newcommand{\lhsCHinfixoperator}[1]{\color{infixoperator}}
\newcommand{\lhsCHprelude}[1]{\color{prelude}{\mathbf{#1}}}
\newcommand{\lhsCHkeyword}[1]{\color{keyword}{\textbf{#1}}}
\newcommand{\lhsCHconstructor}[1]{\color{constructor}{\textbf{#1}}}
\newcommand{\lhsCHlitNumber}[1]{\color{numeral}}
\newcommand{\lhsCHtype}[1]{\color{datatype}}</pre>
<p>And then you might end up with something that looks like this:</p>

<p>[caption id=”attachment_306” align=”aligncenter” width=”300” caption=”Literate Highlighter Code v0.1.0.2”]<a href="http://alessandrovermeulen.me/wp-content/2010/10/Screen-shot-2010-10-23-at-18.41.00.png"><img class="size-medium wp-image-306" title="Screen shot 2010-10-23 at 18.41.00" src="http://alessandrovermeulen.me/wp-content/2010/10/Screen-shot-2010-10-23-at-18.41.00-300x255.png" alt="Literate Highlighter Code v0.1.0.2" width="300" height="255" /></a>[/caption]</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[How To setup AFP on Debian Lenny]]></title>
    <link href="http://alessandrovermeulen.me/2010/09/10/how-to-setup-afp-on-debian-lenny/"/>
    <updated>2010-09-10T00:00:00+02:00</updated>
    <id>http://alessandrovermeulen.me/2010/09/10/how-to-setup-afp-on-debian-lenny</id>
    <content type="html"><![CDATA[<p>After some time of struggling with MacFuse (+MacFusion) and SSHFS I set out to get something that works nice, is integrated in OS X nicely and above all, is not sslooow. AFP which is all of this is available for Debian but without support of the new encrypted password mechanism.</p>

<p>To this extent I searched and found a nice tutorial: <a href="http://routerjockey.com/2009/08/28/setting-up-apple-filing-protocol-and-bonjour-under-debian/">Setting up Apple Filing Protocol and Bonjour under Debian</a>.</p>

<p>Apparently is was there when I tried this the last time and I missed it. But now it works. This works seamlessly with OS X 10.6. I now even have a nice heavy duty server icon in the Finder for my Debian machine. This is because of the avahi service.</p>

<p>This how to also explains how to setup your TimeMachine to backup to the Debian server.</p>

<p><a href="http://alessandrovermeulen.me/wp-content/2010/09/Screen-shot-2010-09-10-at-12.24.28.png"><img class="alignnone size-medium wp-image-265" title="Screenshot of my Debian machine in the Finder" src="http://alessandrovermeulen.me/wp-content/2010/09/Screen-shot-2010-09-10-at-12.24.28-300x225.png" alt="Screenshot of my Debian machine in the Finder" width="300" height="225" /></a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Moving to Doctrine 1.2.x]]></title>
    <link href="http://alessandrovermeulen.me/2010/04/28/moving-to-doctrine-1.2.x/"/>
    <updated>2010-04-28T00:00:00+02:00</updated>
    <id>http://alessandrovermeulen.me/2010/04/28/moving-to-doctrine-1.2.x</id>
    <content type="html"><![CDATA[<p>Here are some updates on my previous article. <a href="http://alessandrovermeulen.me/2009/04/17/doctrine-meets-codeigniter/">Doctrine meets Codeigniter</a>.</p>

<p>Do not forget to add the following autoload directive to your hooks/doctrine.php and the doctrine.php cli:</p>

<p>[php]spl_autoload_register(array(‘Doctrine’, ‘modelsAutoload’));[/php]</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Debian Lenny and the Haskell Platform]]></title>
    <link href="http://alessandrovermeulen.me/2010/02/10/debian-lenny-and-the-haskell-platform/"/>
    <updated>2010-02-10T00:00:00+01:00</updated>
    <id>http://alessandrovermeulen.me/2010/02/10/debian-lenny-and-the-haskell-platform</id>
    <content type="html"><![CDATA[<p>Currently there is no package for the Haskell-Platform in Debian stable. However, the source of this platform and GHC is available for download at <a href="http://www.haskell.org/ghc/">ghc</a> and <a href="http://www.haskell.org/platform">platform</a>.</p>

<p>However, there are some issues to solve when installing the platform from source. Mainly you’ll be missing several packages. The following commands worked at my own Debian machine. If you find out that’s something is missing that was apparently already installed on my machine, don’t hesitate to leave a comment.</p>

<p>The following commands are all executed as <em>root</em>.
First we need to download the sources, I’m using the x86 sources, but feel free to use the x64 version:
[bash]
cd /tmp
wget http://www.haskell.org/ghc/dist/6.10.4/ghc-6.10.4-i386-unknown-linux-n.tar.bz2
wget http://hackage.haskell.org/platform/2009.2.0.2/haskell-platform-2009.2.0.2.tar.gz
[/bash]</p>

<p>Now we need to extract these sources:</p>

<p>[bash]
tar xvf ghc-6.10.4-i386-unknown-linux-n.tar.bz2
tar xvzf haskell-platform-2009.2.0.2.tar.gz
[/bash]</p>

<p>Before we do any other stuff, let’s ensure that we have all the packages and libraries we need before continuing.</p>

<p>[bash]
apt-get install build-essential libghc6-opengl-dev libghc6-glut-dev libeditline-dev libedit2 libedit-dev
[/bash]</p>

<p>Also make sure that you apply this patch to the platform, the bug has been around for some time now but hasn’t been fixed apparently, it can be found at <a href="http://trac.haskell.org/haskell-platform/ticket/84">bug #84</a>:</p>

<p>[bash]
patch -p0 haskell-platform-2009.2.0.2/scripts/install.sh
Index: haskell-platform-2009.2.0.2/scripts/install.sh
===================================================================
— haskell-platform-2009.2.0.2.orig/scripts/install.sh
+++ haskell-platform-2009.2.0.2/scripts/install.sh
@@ -34,13 +34,23 @@ install_pkg () {
   fi
 }</p>

<p>+# Is this exact version of the package already installed?
+is_pkg_installed () {
+  PKG_VER=$1
+  grep &quot; ${PKG_VER} &quot; installed.packages &gt; /dev/null 2&gt;&amp;1
+}
+
 # Actually do something!
 cd packages
 for pkg in <code>cat platform.packages</code>; do
-  cd &quot;${pkg}&quot; || die &quot;The directory for the component ${PKG} is missing&quot;
-  echo &quot;Installing ${pkg}…&quot;
-  install_pkg ${pkg}
-  cd ..
+  if is_pkg_installed &quot;${pkg}&quot;; then
+    echo &quot;Platform package ${pkg} is already installed. Skipping…&quot;
+  else
+    cd &quot;${pkg}&quot; || die &quot;The directory for the component ${PKG} is missing&quot;
+    echo &quot;Installing ${pkg}…&quot;
+    install_pkg ${pkg}
+    cd ..
+  fi
 done</p>

<p>echo
[/bash]</p>

<p>Now go to the ghc dir and build it.</p>

<p>[bash]
cd ghc-6.10.4
./configure
make install
[/bash]</p>

<p>And if all of this goes well you can now go to the haskell-platform dir and install it:</p>

<p>[bash]
cd ../haskell-platform-2009.2.0.2/
./configure
make
make install
[/bash]</p>

<p>And done! :)</p>
]]></content>
  </entry>
  
</feed>
