<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title><![CDATA[Clément Delafargue]]></title>
	<description><![CDATA[Flux RSS des articles]]></description>
	<pubDate>Sat, 19 May 2012 12:02:28 +0200</pubDate>
	<link>http://www.divarvel.fr</link>
	<language>fr</language>
	<generator>http://www.eklablog.com</generator>
	
	<item>
		<title><![CDATA[Rédiger un document en français avec Sphinx]]></title>
		<link>http://www.divarvel.fr/rediger-un-document-en-francais-avec-sphinx-a5586833</link>
		<description><![CDATA[Je suis en train de finir la r&eacute;daction de mon rapport de stage. J'ai utilis&eacute; sphinx , l'outil de documentation de python, ce qui me permet de r&eacute;diger le rapport en ReST , puis de l'exporter dans un des formats disponibles (LaTeX, HTML, ePub&hellip;). Le fichier de configuration permet de sp&eacute;cifier...]]></description>
		<content:encoded><![CDATA[<p>Je suis en train de finir la r&eacute;daction de mon rapport de stage. J'ai utilis&eacute; <a href="http://sphinx.pocoo.org/index.html">sphinx</a>, l'outil de documentation de python, ce qui me permet de r&eacute;diger le rapport en <a href="http://docutils.sourceforge.net/rst.html">ReST</a>, puis de l'exporter dans un des formats disponibles (LaTeX, HTML, ePub&hellip;).</p>
<p>Le fichier de configuration permet de sp&eacute;cifier la langue du document, mais il y a d'autres options &agrave; changer pour que l'export LaTeX se passe bien.</p>
<p><div class="code">language = <span style="color: #483d8b;">'fr_FR'</span><br />
<br />
latex_elements = <span style="color: black;">&#123;</span><br />
    <span style="color: #483d8b;">&quot;fncychap&quot;</span>: <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>usepackage[Sonny]{fncychap}&quot;</span><br />
    <span style="color: #483d8b;">&quot;babel&quot;</span>: <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>usepackage[francais]{babel}&quot;</span><br />
<span style="color: black;">&#125;</span><div style="display:none;">[code=python]<br/>language = 'fr_FR'<br/><br/>latex_elements = {<br/>&nbsp;&nbsp;&nbsp; "fncychap": "\\usepackage[Sonny]{fncychap}"<br/>&nbsp;&nbsp;&nbsp; "babel": "\\usepackage[francais]{babel}"<br/>}<br/>[/code]</div></div></p><br /><br />]]></content:encoded>
		<pubDate>Fri, 16 Sep 2011 12:58:28 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/rediger-un-document-en-francais-avec-sphinx-a5586833</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2011-09-16T12:58:28+02:00</dc:date>
	</item>
	<item>
		<title><![CDATA[TypeSafe URLs in Lift]]></title>
		<link>http://www.divarvel.fr/typesafe-urls-in-lift-a4755129</link>
		<description><![CDATA[I've been working for a few months with Lift , a really nice web framework. Lift takes ideas and concepts from a few other frameworks. The main difference between Lift and other frameworks is that Lift does not enforce MVC (even though you can do MVC if you want to). Lift's approach is view-first ,...]]></description>
		<content:encoded><![CDATA[<p>I've been working for a few months with <a href="http://liftweb.net/">Lift</a>, a really nice web framework. Lift takes ideas and concepts from a few other frameworks. The main difference between Lift and other frameworks is that Lift does not enforce MVC (even though you can do MVC if you want to). Lift's approach is <strong>view-first</strong>, which means you first create the view, then you tell which part of the code will take care of dynamism.</p>
<p>For more propaganda: <a href="http://seventhings.liftweb.net/">Seven Things</a> and <a href="http://lift.la/web-framework-manifesto-republished-from-2006">Web Framework Manifesto</a></p>
<p>I'll explain how to build <em>REST-y</em> URLs in a type-safe manner, with the SiteMap. The goal is to access a blog post with this kind of URL: <strong>/posts/<em>{id}</em></strong></p>
<p>I'll illustrate this article with something tremendously original: a Blog, with posts. I'll use mongoDB as a backend, but it's not really important.</p>
<h3>The model</h3>
<p>It's a simple blog post. Let's just assume the author is stored in plain text.</p>
<p><div class="code"><a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">class</span></a> BlogPost <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">private</span></a><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">extends</span></a> MongoRecord <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">with</span></a> ObjectIdPk<span style="color: #F78811;">&#91;</span>BlogPost<span style="color: #F78811;">&#93;</span> <span style="color: #F78811;">&#123;</span><br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">def</span></a> meta <span style="color: #000080;">=</span> BlogPost<br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">object</span></a> author <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">extends</span></a> StringField<span style="color: #F78811;">&#40;</span><a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">this</span></a>, <span style="color: #F78811;">32</span><span style="color: #F78811;">&#41;</span><br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">object</span></a> date <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">extends</span></a> DateField<span style="color: #F78811;">&#40;</span><a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">this</span></a><span style="color: #F78811;">&#41;</span><br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">object</span></a> content <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">extends</span></a> TextareaField<span style="color: #F78811;">&#40;</span><a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">this</span></a>, <span style="color: #F78811;">500</span><span style="color: #F78811;">&#41;</span><br />
<br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">val</span></a> url <span style="color: #000080;">=</span> … <span style="color: #008000; font-style: italic;">// We'll see that later</span><br />
<span style="color: #F78811;">&#125;</span><br />
<br />
<a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">object</span></a> BlogPost <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">extends</span></a> BlogPost <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">with</span></a> MongoMetaRecord<span style="color: #F78811;">&#91;</span>BlogPost<span style="color: #F78811;">&#93;</span> <span style="color: #F78811;">&#123;</span><br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">val</span></a> entry <span style="color: #000080;">=</span> … <span style="color: #008000; font-style: italic;">// We'll see that later</span><br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">def</span></a> calcHref<span style="color: #F78811;">&#40;</span>bp<span style="color: #000080;">:</span> BlogPost<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> … <span style="color: #008000; font-style: italic;">// We'll see that later</span><br />
<span style="color: #F78811;">&#125;</span><div style="display:none;">[code=scala]<br/>class BlogPost private() extends MongoRecord with ObjectIdPk[BlogPost] {<br/>&nbsp; def meta = BlogPost<br/>&nbsp; object author extends StringField(this, 32)<br/>&nbsp; object date extends DateField(this)<br/>&nbsp; object content extends TextareaField(this, 500)<br/><br/>&nbsp; val url = &hellip; // We'll see that later<br/>}<br/><br/>object BlogPost extends BlogPost with MongoMetaRecord[BlogPost] {<br/>&nbsp; val entry = &hellip; // We'll see that later<br/>&nbsp; def calcHref(bp: BlogPost) = &hellip; // We'll see that later<br/>}<br/>[/code]</div></div></p>
<h3>The template</h3>
<p>Nothing special there. Just save it in <code>webapp/posts.html</code>. We have a <code>h1</code> for the title, a <code>p</code> for some info, and a <code>p</code> for the actual post.</p>
<p><div class="code"><span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;lift:surround?with=default;at=content&quot;</span><a href="http://december.com/html/4/element/%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><br />
<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;lift:BlogPostSnippet&quot;</span><a href="http://december.com/html/4/element/%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><br />
<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Eh1.html"><span style="color: #000000; font-weight: bold;">&lt;h1</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;title&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>h1&gt;</span><br />
<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ep.html"><span style="color: #000000; font-weight: bold;">&lt;p</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;info&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>p&gt;</span><br />
<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ep.html"><span style="color: #000000; font-weight: bold;">&lt;p</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;blogpost&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>p&gt;</span><br />
<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fdiv%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></a></span><br />
<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fdiv%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></a></span><div style="display:none;">[code=html]<br/>&lt;div class="lift:surround?with=default;at=content"&gt;<br/>&lt;div class="lift:BlogPostSnippet"&gt;<br/>&lt;h1 class="title"&gt;&lt;/h1&gt;<br/>&lt;p class="info"&gt;&lt;/p&gt;<br/>&lt;p class="blogpost"&gt;&lt;/p&gt;<br/>&lt;/div&gt;<br/>&lt;/div&gt;<br/>[/code]</div></div></p>
<h3>The snippet</h3>
<p>This class will be instantiated with the blog post we want to display. We just inject data in the markup.</p>
<p><div class="code"><a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">class</span></a> BlogPostSnippet<span style="color: #F78811;">&#40;</span><a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">val</span></a> blogPost<span style="color: #000080;">:</span> BlogPost<span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span><br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">def</span></a> render <span style="color: #000080;">=</span> <span style="color: #6666FF;">&quot;.title *&quot;</span> <span style="color: #000080;">#&gt;</span> blogPost.<span style="color: #000000;">title</span>.<span style="color: #000000;">is</span> <span style="color: #000080;">&amp;</span><br />
    <span style="color: #6666FF;">&quot;.info *&quot;</span> <span style="color: #000080;">#&gt;</span> <span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;By &quot;</span> + blogPost.<span style="color: #000000;">author</span>.<span style="color: #000000;">is</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">&amp;</span><br />
    <span style="color: #6666FF;">&quot;.blogpost *&quot;</span> <span style="color: #000080;">#&gt;</span> blogPost.<span style="color: #000000;">content</span>.<span style="color: #000000;">is</span><br />
<span style="color: #F78811;">&#125;</span><div style="display:none;">[code=scala]<br/>class BlogPostSnippet(val blogPost: BlogPost) {<br/>&nbsp; def render = ".title *" #&gt; blogPost.title.is &amp;<br/>&nbsp;&nbsp;&nbsp; ".info *" #&gt; ("By " + blogPost.author.is) &amp;<br/>&nbsp;&nbsp;&nbsp; ".blogpost *" #&gt; blogPost.content.is<br/>}<br/>[/code]</div></div></p>
<h3>The SiteMap</h3>
<p>So, back to <code>BlogPost.entry</code>, where the magic happens. We define an entry of the sitemap which is associated with the <code>BlogPost</code> class. The two first arguments are the id and the displayed name of the link. The third argument is a function which takes a <code>String</code> and returns a <code>Box[BlogPost]</code>. This tells Lift how to instantiate <code>BlogPostSnippet</code> with the right blog post. The fourth argument is used to create an url from a given blog post. Finally, we specify the address and tell Lift we don't want this entry to show up in the menus.</p>
<p>The calcHref method is just a shortcut.</p>
<p><div class="code"><a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">class</span></a> BlogPost … <span style="color: #F78811;">&#123;</span><br />
  <span style="color: #00ff00; font-style: italic;">/* Snip */</span><br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">val</span></a> url <span style="color: #000080;">=</span> BlogPost.<span style="color: #000000;">calcHref</span><span style="color: #F78811;">&#40;</span><a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">this</span></a><span style="color: #F78811;">&#41;</span><br />
<span style="color: #F78811;">&#125;</span><br />
<br />
<a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">object</span></a> BlogPost … <span style="color: #F78811;">&#123;</span><br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">val</span></a> entry <span style="color: #000080;">=</span> Menu.<span style="color: #000000;">param</span><span style="color: #F78811;">&#91;</span>BlogPost<span style="color: #F78811;">&#93;</span><span style="color: #F78811;">&#40;</span><br />
    <span style="color: #6666FF;">&quot;blogpost&quot;</span>,<br />
    S <span style="color: #000080;">?</span> <span style="color: #6666FF;">&quot;blogpost.view&quot;</span>,<br />
    <span style="color: #F78811;">&#40;</span>id<span style="color: #000080;">:</span> String<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=&gt;</span> BlogPost.<span style="color: #000000;">find</span><span style="color: #F78811;">&#40;</span>id<span style="color: #F78811;">&#41;</span>,<br />
    <span style="color: #F78811;">&#40;</span>bp<span style="color: #000080;">:</span> BlogPost<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=&gt;</span> bp.<span style="color: #000000;">id</span>.<span style="color: #000000;">is</span><br />
  <span style="color: #F78811;">&#41;</span> / <span style="color: #6666FF;">&quot;posts&quot;</span> / <span style="color: #000080;">*</span> <span style="color: #000080;">&gt;&gt;</span> Hidden<br />
<br />
  <a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">def</span></a> calcHref<span style="color: #F78811;">&#40;</span>bp<span style="color: #000080;">:</span> BlogPost<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> entry.<span style="color: #000000;">toLoc</span>.<span style="color: #000000;">calcHref</span><span style="color: #F78811;">&#40;</span>bp<span style="color: #F78811;">&#41;</span><br />
<span style="color: #F78811;">&#125;</span><div style="display:none;">[code=scala]<br/>class BlogPost &hellip; {<br/>&nbsp; /* Snip */<br/>&nbsp; val url = BlogPost.calcHref(this)<br/>}<br/><br/>object BlogPost &hellip; {<br/>&nbsp; val entry = Menu.param[BlogPost](<br/>&nbsp;&nbsp;&nbsp; "blogpost",<br/>&nbsp; &nbsp; S ? "blogpost.view",<br/>&nbsp;&nbsp;&nbsp; (id: String) =&gt; BlogPost.find(id),<br/>&nbsp;&nbsp;&nbsp; (bp: BlogPost) =&gt; bp.id.is<br/>&nbsp; ) / "posts" / * &gt;&gt; Hidden<br/><br/>&nbsp; def calcHref(bp: BlogPost) = entry.toLoc.calcHref(bp)<br/>}<br/>[/code]</div></div></p>
<p>Don't forget to add <code>BlogPost.entry</code> to the <code>SiteMap</code></p>
<p><div class="code"><a href="http://scala-lang.org"><span style="color: #0000ff; font-weight: bold;">val</span></a> entries <span style="color: #000080;">=</span> <span style="color: #00ff00; font-style: italic;">/* other entries */</span> <span style="color: #000080;">::</span> BlogPost.<span style="color: #000000;">entry</span> <span style="color: #000080;">::</span> Nil<br />
LiftRules.<span style="color: #000000;">setSiteMap</span><span style="color: #F78811;">&#40;</span>SiteMap<span style="color: #F78811;">&#40;</span>entries<span style="color: #000080;">:</span> <span style="color: #000080;">_*</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span><div style="display:none;">[code=scala]<br/>val entries = /* other entries */ :: BlogPost.entry :: Nil<br/>LiftRules.setSiteMap(SiteMap(entries: _*))<br/>[/code]</div></div></p>
<p><br/>Next time I'll show you how to display comments after the blog post, while keeping the HTML structure of every comment in the template :)</p><br /><br />]]></content:encoded>
		<pubDate>Wed, 03 Aug 2011 16:07:45 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/typesafe-urls-in-lift-a4755129</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2011-08-03T16:07:45+02:00</dc:date>
	</item>
	<item>
		<title><![CDATA[Retour des RMLL]]></title>
		<link>http://www.divarvel.fr/retour-des-rmll-a4420120</link>
		<description><![CDATA[Du 9 au 14 juillet avaient lieu les douzi&egrave;mes Rencontres Mondiales du Logiciel Libre. L'occasion de rencontrer tout un tas de libristes et de contributeurs dans une ambiance sympa et d&eacute;tendue. Des conf&eacute;rences et des keynotes tr&egrave;s int&eacute;ressantes r&eacute;alis&eacute;es par (entre autres) Richard M. Stallman...]]></description>
		<content:encoded><![CDATA[<p>Du 9 au 14 juillet avaient lieu les douzi&egrave;mes Rencontres Mondiales du Logiciel Libre. L'occasion de rencontrer tout un tas de libristes et de contributeurs dans une ambiance sympa et d&eacute;tendue. Des conf&eacute;rences et des <em>keynotes</em> tr&egrave;s int&eacute;ressantes r&eacute;alis&eacute;es par (entre autres) Richard M. Stallman et Benjamin Bayart.</p>
<p>Ces RMLL ont &eacute;t&eacute; l'occasion de pr&eacute;senter notre retour d'exp&eacute;rience sur diff&eacute;rents projets libres men&eacute;s &agrave; l'<a href="http://www.ec-nantes.fr">&Eacute;cole Centrale de Nantes</a>. Avec <a href="http://www.irccyn.ec-nantes.fr/~magnin/">Morgan Magnin</a>, <a href="http://www.bvialle.eu">Benjamin Vialle</a> et Nelle Varoquaux, nous avons eu la chance de faire trois conf&eacute;rences autour de <a href="http://www.markusproject.org">MarkUs</a>, l'application de correction de TP, et d'OpenOffice.org.</p>
<p>Les supports de ces pr&eacute;sentations, ainsi que de plus amples explications sont disponibles dans la suite de l'article.</p><br /><br /><a href="http://www.divarvel.fr/retour-des-rmll-a4420120">Lire la suite...</a><br /><br />]]></content:encoded>
		<pubDate>Fri, 15 Jul 2011 21:17:22 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/retour-des-rmll-a4420120</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2011-07-15T21:17:22+02:00</dc:date>
	</item>
	<item>
		<title><![CDATA[Ma conf vim]]></title>
		<link>http://www.divarvel.fr/ma-conf-vim-a1625602</link>
		<description><![CDATA[Durant mon stage, j'ai eu l'occasion de peaufiner ma conf vim. D'abord le remappage b&eacute;po Grosso modo, je me suis born&eacute; &agrave; remapper les touches de fa&ccedil;on &agrave; avoir les touches de d&eacute;placement sur ctsr. J'ai mis la conf dans un fichier &agrave; part, que je source &agrave; la fin du .vimrc
 J'ai bricol&eacute; &ccedil;a...]]></description>
		<content:encoded><![CDATA[<p>Durant mon stage, j'ai eu l'occasion de peaufiner ma conf vim.</p>
<h2>D'abord le remappage b&eacute;po</h2>
<p>Grosso modo, je me suis born&eacute; &agrave; remapper les touches de fa&ccedil;on &agrave; avoir les touches de d&eacute;placement sur ctsr. J'ai mis la conf dans un fichier &agrave; part, que je source &agrave; la fin du .vimrc<br/> J'ai bricol&eacute; &ccedil;a gr&acirc;ce au Wiki de vim.fr : <a href="http://bepo.fr/wiki/Vim">Page consacr&eacute;e &agrave; vim</a><br/> Il y a plusieus niveaux de remappage, du plus l&eacute;ger au plus extr&egrave;me. J'ai opt&eacute; pour un remappage assez l&eacute;ger, de mani&egrave;re &agrave; ne pas &ecirc;tre trop perdu sur un vim normal</p>
<h2>Ensuite les plugins</h2>
<p>L'ajout de plugins est capital pour bien utiliser vim. Voici ceux que me suis install&eacute;s :</p>
<ul>
<li><a href="http://www.vim.org/scripts/script.php?script_id=39">matchit</a></li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=2540">snipMate</a></li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=3171">phpComplete</a></li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=1785">javaComplete</a></li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=69">project</a></li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=1697">surround</a></li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=1172">template</a></li>
</ul>
<p>Ceux dont je ne pourrais pas me passer, c'est snipMate (Texmate-like snippets) et template (templates pour les nouveaux fichiers). phpComplete et JavaComplete permettent d'avoir l'omnicompl&eacute;tion pour Java et PHP, ce qui est pas mal aussi. Project peut &ecirc;tre sympa pour les gros projets.</p>
<h2>ftplugin</h2>
<p>Ftplugin permet d'associer &agrave; chaque type de fichier ouvert une configuration particuli&egrave;re. Par exemple, pour des r&egrave;gles sp&eacute;cifiques &agrave; python, il suffit de mettre ces r&egrave;gles dans ~/.vim/ftplugin/python.vim</p>
<pre>" Active l'auto-compl&eacute;tion pour python<br/> set omnifunc=pythoncomplete#Complete<br/> " Indentation &agrave; 4 espaces<br/> setlocal tabstop=4<br/> setlocal shiftwidth=4<br/> setlocal expandtab<br/> setlocal softtabstop=4</pre>
<p>Je m'en sers aussi (entre autres) pour mettre le correcteur orthographique pour les mails et les documents LaTeX et ReST</p>
<h2>Le .vimrc, pour finir</h2>
<p>Mon .vimrc complet (et mes autres fichiers de conf) est <a href="https://github.com/divarvel/dotrcfiles">dispo sur github</a>. Mais en gros ce que j'y ai mis, c'est</p>
<ul>
<li>la coloration syntaxique</li>
<li>une petite fonction pour avoir une autocompl&eacute;tion intelligente mapp&eacute;e sur Ctrl-Space</li>
<li>un mapping de certaines extensions &agrave; un type de fichier (quand ce n'est pas fait automatiquement)</li>
</ul>
<h2>Mes sources</h2>
<p>Un bon fichier de conf se construit par tatonnements, et surtout gr&acirc;ce &agrave; l'inspiration fournies par les autres. Voici une liste (non exaustive h&eacute;las) de ce qui m'a inspir&eacute;.</p>
<ul>
<li><a href="http://vim.wikia.com/wiki/Smart_mapping_for_tab_completion">http://vim.wikia.com/wiki/Smart_mapping_for_tab_completion</a></li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=1643">http://www.vim.org/scripts/script.php?script_id=1643</a></li>
<li><a href="http://phollow.fr/2010/11/5-themes-vim-pour-frimer-devant-les-filles/">http://phollow.fr/2010/11/5-themes-vim-pour-frimer-devant-les-filles/</a></li>
<li><a href="http://smartic.us/2009/04/06/code-folding-in-vim/">http://smartic.us/2009/04/06/code-folding-in-vim/</a></li>
<li><a href="http://www.catonmat.net/blog/vim-plugins-surround-vim/">http://www.catonmat.net/blog/vim-plugins-surround-vim/</a></li>
<li>Some tips from <a href="https://github.com/NelleV">Nelle</a></li>
</ul><br /><br />]]></content:encoded>
		<pubDate>Thu, 02 Sep 2010 23:40:43 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/ma-conf-vim-a1625602</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2010-09-02T23:40:43+02:00</dc:date>
	</item>
	<item>
		<title><![CDATA[Tab Candy: They're (poorly) reinventing the Wheel]]></title>
		<link>http://www.divarvel.fr/tab-candy-they-re-poorly-reinventing-the-wheel-a1482303</link>
		<description><![CDATA[It's a fact, more and more applications are web-based, and the tabbed browsing shows its limits. Tabs are now like real applications and need to be managed more precisely and with less hassle. That's why the firefox folks created Tab Candy. This is stupid. There are tons of good window managers out...]]></description>
		<content:encoded><![CDATA[<p>It's a fact, more and more applications are web-based, and the tabbed browsing shows its limits. Tabs are now like real applications and need to be managed more precisely and with less hassle. That's why the firefox folks created Tab Candy.</p>
<p>This is stupid. There are tons of good window managers out there. Why do anybody need to spend time on reinventing one, which won't be as good as existing ones, in addition to create a strong separation between web apps and the regular ones ?</p>
<p>If you want to have several groups of tabs, use several windows. If you want to have a quick access to a web app, give it its own window (with uzbl or jumanji for instance). This way, all your applications (web or regular) behave consistently, and you can use the full power of your WM instead of beeing forced to use a stoneage WM inside your browser.</p>
<p>Problem solved.</p><br /><br />]]></content:encoded>
		<pubDate>Thu, 29 Jul 2010 08:09:16 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/tab-candy-they-re-poorly-reinventing-the-wheel-a1482303</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2010-07-29T08:09:16+02:00</dc:date>
	</item>
	<item>
		<title><![CDATA[Environnement de développement Android - Sans Eclipse]]></title>
		<link>http://www.divarvel.fr/environnement-de-developpement-android-sans-eclipse-a1291837</link>
		<description><![CDATA[Je viens de faire l'acquisisition d'un Nexus One (j'&eacute;tais lass&eacute; des restrictions &agrave; la Apple ), et bien &eacute;videmment la premi&egrave;re envie que j'ai c'est de d&eacute;velopper des applis Android pour faire un peu joujou avec la b&ecirc;te. J'ai trouv&eacute; pas mal de ressources pour d&eacute;buter, mais toute ont pour...]]></description>
		<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/toasty/3538820892/"><img style="float: left; padding-right: 5px;" src="http://data0.eklablog.com/divarvel/mod_article1291837_1.jpg?3561" alt="Android"/></a></p>
<p>Je viens de faire l'acquisisition d'un <strong>Nexus One</strong> (j'&eacute;tais lass&eacute; des <a href="http://www.divarvel.fr/iphone-ou-l-emprisonnement-numerique-a324755">restrictions &agrave; la Apple</a>), et bien &eacute;videmment la premi&egrave;re envie que j'ai c'est de d&eacute;velopper des applis Android pour faire un peu joujou avec la b&ecirc;te.</p>
<p>J'ai trouv&eacute; pas mal de ressources pour d&eacute;buter, mais toute ont pour point commun l'installation d'un CPU / Memory Hog : le tristement c&eacute;l&egrave;bre Eclipse.</p>
<p>Voici donc une petite compilation de ce que j'ai pu trouver pour <strong>d&eacute;ployer et utiliser un environnement de d&eacute;veloppement Android</strong> sous Ubuntu (#<em>Insert troll here</em>#), <strong>qui ne fasse pas appel &agrave; Eclipse</strong>.</p><br /><br /><a href="http://www.divarvel.fr/environnement-de-developpement-android-sans-eclipse-a1291837">Lire la suite...</a><br /><br />]]></content:encoded>
		<pubDate>Mon, 31 May 2010 19:59:17 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/environnement-de-developpement-android-sans-eclipse-a1291837</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2010-05-31T19:59:17+02:00</dc:date>
	</item>
	<item>
		<title><![CDATA[Partager sa musique]]></title>
		<link>http://www.divarvel.fr/partager-sa-musique-a1258244</link>
		<description><![CDATA[Je viens d'avoir une id&eacute;e toute b&ecirc;te, un moyen de partager sa musique et de socialiser. Socialiser dans la vraie vie, en plus. ( IRL pour les pros) &Eacute;norm&eacute;ment de monde se balade avec des &eacute;couteurs sur les oreilles. Pourquoi ne pas de temps en temps, prendre deux minutes et &eacute;changer les...]]></description>
		<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/eriatarka31/3647727697/"><img style="float: left; padding-right: 5px;" src="http://data0.eklablog.com/divarvel/mod_article1258244_2.jpg?170" alt="Guitare"/></a>Je viens d'avoir une id&eacute;e toute b&ecirc;te, un moyen de partager sa musique et de socialiser.</p>
<p>Socialiser dans la vraie vie, en plus. (<abbr title="In Real Life">IRL</abbr> pour les pros)</p>
<p>&Eacute;norm&eacute;ment de monde se balade avec des &eacute;couteurs sur les oreilles. Pourquoi ne pas de temps en temps, prendre deux minutes et &eacute;changer les &eacute;couteurs, pour d&eacute;couvrir ce que les autres &eacute;coutent, et faire d&eacute;couvrir ce qu'on &eacute;coute ?</p>
<p>Il suffirait d'avoir un petit signe distinctif <ins>(Par exemple un morceau d'adh&eacute;sif rouge autour du c&acirc;ble)</ins> sur ses &eacute;couteurs pour signaler qu'on est pr&ecirc;t &agrave; s'arr&ecirc;ter deux minutes pour partager sa musique. &Ccedil;a pourrait &ecirc;tre cool de s'arr&ecirc;ter deux minutes et de discuter musique avec d'autres gens, non ?</p>
<p><em>Vous en pensez quoi ?</em></p>
<p>&nbsp;</p>
<p><em>Cr&eacute;dit Photo :<a href="http://www.flickr.com/photos/eriatarka31/"> Gr&eacute;gory Thonon</a> <a href="http://creativecommons.org/licenses/by-sa/2.0/deed.fr">(CC-BY-SA 2.0 Deed)</a><br /></em></p><br /><br />]]></content:encoded>
		<pubDate>Thu, 20 May 2010 05:10:47 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/partager-sa-musique-a1258244</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2010-05-20T05:10:47+02:00</dc:date>
	</item>
	<item>
		<title><![CDATA[Cowon S9]]></title>
		<link>http://www.divarvel.fr/cowon-s9-a1234661</link>
		<description><![CDATA[J'ai re&ccedil;u hier un Cowon S9 , en remplacement de la solution mixte Archos 604 (batterie explos&eacute;e) / iPhone (j'en peux plus de cette bouse)

 Le Cowon S9 est un petit PMP de fabrication Cor&eacute;enne.

J'ai choisi ce mod&egrave;le principalement pour ses qualit&eacute;s audio et pour son support du format OGG...]]></description>
		<content:encoded><![CDATA[<a href="http://www.flickr.com/photos/divarvel/4603429608/"><img style="float: left; padding-right: 5px;" src="http://farm4.static.flickr.com/3554/4603429608_d5e83cc509_m.jpg" alt="Cowon S9"/></a>J'ai re&ccedil;u hier un <strong>Cowon S9</strong>, en remplacement de la solution mixte Archos 604 (batterie explos&eacute;e) / iPhone (j'en peux plus de cette bouse)<br /><br /> Le Cowon S9 est un petit PMP de fabrication Cor&eacute;enne.<br /><br />J'ai choisi ce mod&egrave;le principalement pour ses qualit&eacute;s audio et pour son <a href="http://www.fsf.org/campaigns/playogg/">support du format OGG</a>, mais la b&ecirc;te a d'autres caract&eacute;ristiques sympa.<br /><br /><br /><a href="http://www.divarvel.fr/cowon-s9-a1234661">Lire la suite...</a><br /><br />]]></content:encoded>
		<pubDate>Wed, 12 May 2010 03:35:10 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/cowon-s9-a1234661</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2010-05-12T03:35:10+02:00</dc:date>
	</item>
	<item>
		<title><![CDATA[Journée Mondiale contre les DRM]]></title>
		<link>http://www.divarvel.fr/journee-mondiale-contre-les-drm-a1210436</link>
		<description><![CDATA[Aujourd'hui, c'est la Journ&eacute;e Mondiale contre les DRM .
L'op&eacute;ration, initi&eacute;e par la FSF , est relay&eacute;e en France par l' April .
C'est l'occasion de sensibiliser les gens autour de vous aux menaces que font peser les DRM sur les utilisateurs, et sur les d&eacute;veloppeurs de logiciels libres....]]></description>
		<content:encoded><![CDATA[<img style="float: left;" src="http://data0.eklablog.com/divarvel/mod_article1210436_1.jpg?7574" alt="Day Against DRM"/>Aujourd'hui, c'est la Journ&eacute;e Mondiale contre les <abbr title="Digital Restriction Management">DRM</abbr>.<br />L'op&eacute;ration, initi&eacute;e par la <a href="http://www.fsf.org"><abbr title="Free Software Foundation">FSF</abbr></a>, est relay&eacute;e en France par l'<a href="http://www.april.org/">April</a>.<br />C'est l'occasion de sensibiliser les gens autour de vous aux menaces que font peser les <abbr title="Digital Restriction Management">DRM</abbr> sur les utilisateurs, et sur les d&eacute;veloppeurs de logiciels libres.<br /><br />M&ecirc;me si en apparence, les <abbr title="Digital Restriction Management">DRM</abbr> ont battu en retraite du domaine de la musique (d&eacute;montrant par l&agrave; m&ecirc;me la vacuit&eacute; des lois type DADVSI, r&eacute;clam&eacute;es par l'industrie pour &ecirc;tre jet&eacute;es aux orties deux ans plus tard), elles n'en sont pas moins pr&eacute;sentes dans le domaine des eBooks. (J'ai re&ccedil;u un Cahier des Charges pour un reader sur iPhone, c'&eacute;tait vraiment dingue : interdiction du copier/coller, d&eacute;cryptage &agrave; la vol&eacute;e, impossibilit&eacute; d'imprimer...) et dans le domaine des applications mobiles. Je pense bien &eacute;videmment &agrave; l'Apple Store, parmi autres.<br /><br />En ce jour international de Star Wars, il est important d'essayer de sensibiliser ses proches aux dangers que repr&eacute;sentent les <abbr title="Digital Restriction Management">DRM</abbr>, et d'agir au maximum pour obtenir leur abandon.<br /><br />Un peu de lecture : <br /> 
<ul>
<li><a href="http://www.april.org/fr/drm">L'article de l'April sur les <abbr title="Digital Restriction Management">DRM</abbr></a></li>
<li><a href="http://www.defectivebydesign.org/">Defective by Design <br /></a></li>
</ul><br /><br />]]></content:encoded>
		<pubDate>Tue, 04 May 2010 05:14:22 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/journee-mondiale-contre-les-drm-a1210436</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2010-05-04T05:14:22+02:00</dc:date>
	</item>
	<item>
		<title><![CDATA[MPD + Quelques tweaks sous Ubuntu]]></title>
		<link>http://www.divarvel.fr/mpd-quelques-tweaks-sous-ubuntu-a1197124</link>
		<description><![CDATA[MPD est, comme son nom s'indique, un daemon qui lit de la musique. L'int&eacute;r&ecirc;t, est que la partie qui lit la musique est d&eacute;coupl&eacute;e de l'IHM qui permet de g&eacute;rer &ccedil;a.

Cette structure apporte plusieurs avantages :
 L&eacute;g&egrave;ret&eacute; (pas besoin d'occuper des ressources en permanence pour l'interface)...]]></description>
		<content:encoded><![CDATA[<abbr title="Media Player Daemon">MPD</abbr> est, comme son nom s'indique, un daemon qui lit de la musique. L'int&eacute;r&ecirc;t, est que la partie qui lit la musique est <strong>d&eacute;coupl&eacute;e</strong> de l'IHM qui permet de g&eacute;rer &ccedil;a.<br /><br />Cette structure apporte plusieurs avantages :<br /> 
<ul>
<li><strong>L&eacute;g&egrave;ret&eacute;</strong> (pas besoin d'occuper des ressources en permanence pour l'interface)</li>
</ul>
<ul>
<li><strong>Choix</strong> du nombre d'interfaces (il y en a vraiment pour tous les go&ucirc;ts, du <a href="http://linux.die.net/man/1/mpc">plus simple</a> au <a href="http://sonata.berlios.de/">plus sophistiqu&eacute;</a>, en passant par le <a href="http://unkart.ovh.org/ncmpcpp/">sobre et efficace</a>)</li>
</ul>
<ul>
<li>Possibilit&eacute; de commander <strong>par le r&eacute;seau</strong></li>
<li><strong>Interfa&ccedil;age rapide</strong> avec tout et n'importe quoi (<a href="http://www.divarvel.fr/un-peu-de-conky-a513079">conky</a>, par exemple)</li>
</ul>
J'ai donc install&eacute; et configur&eacute; <abbr title="Media Player Daemon">MPD</abbr>. (&Agrave; l'aide de la doc d'ubuntu-fr).<br /><br />J'ai eu ensuite &agrave; faire quelques petits tweaks pour int&eacute;grer &ccedil;a correctement &agrave; mon syst&egrave;me.<br />
<h3>Touches multim&eacute;dia</h3>
Comme <abbr title="Media Player Daemon">MPD</abbr> tourne en t&acirc;che de fond, si aucune interface n'est lanc&eacute;e, les touches multim&eacute;dia ne seront pas g&eacute;r&eacute;es.<br />Le plus simple est d'utiliser mpc, qui permet d'envoyer des commandes &agrave; <abbr title="Media Player Daemon">MPD</abbr>.<br />J'ai ainsi associ&eacute; la commande mpc toggle &agrave; la touche <em>XF86Play</em>, mpc stop &agrave; la touche <em>XF86Stop</em>, et ainsi de suite.<br /><br />Pour le fun, j'ai fait un petit script qui permet d'afficher les informations sur le morceau en cours &agrave; l'aide de libnotify.<br /><br /><div class="code"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
DISPLAY<span style="color: #339933;">=:</span><span style="color: #cc66cc;">0</span><br />
notify<span style="color: #339933;">-</span>send <span style="color: #0000ff;">&quot;`mpc --format &quot;</span><span style="color: #339933;">%</span>title<span style="color: #339933;">%</span><span style="color: #0000ff;">&quot;|head -n1`&quot;</span> <span style="color: #0000ff;">&quot;`mpc --format &quot;</span><span style="color: #339933;">%</span>artist<span style="color: #339933;">%</span> <span style="color: #339933;">-</span> <span style="color: #339933;">%</span>album<span style="color: #339933;">%</span><span style="color: #0000ff;">&quot;| head -n1`&quot;</span><div style="display:none;">[code=php]<br />#!/bin/sh<br />DISPLAY=:0<br />notify-send "`mpc --format "%title%"|head -n1`" "`mpc --format "%artist% - %album%"| head -n1`"<br />[/code]</div></div><br /><br />Rien de bien m&eacute;chant, mais &ccedil;a peut &ecirc;tre utile quand on veut savoir le nom du morceau en cours sans perdre trop de temps.<br /><br />
<h3>Scrobbling</h3>
Les clients <abbr title="Media Player Daemon">MPD</abbr> sophistiqu&eacute;s g&egrave;rent le scrobbling, mais, comme je l'ai dit, on n'a pas besoin d'avoir une interface en permanence.<br /><br />J'ai trouv&eacute; <a href="http://codingteam.net/project/scrobd">scrobd</a>, un petit script python qui permet de scrobbler sur libre.fm. (Saymieux que last.fm, et on a moins de risques de voir son nom refil&eacute; &agrave; la RIAA)<br /><br />&Eacute;tant donn&eacute; que tous les clients communiquent avec <abbr title="Media Player Daemon">MPD</abbr> par une interface TCP, il n'y a pas de difficult&eacute;s particuli&egrave;res pour que la musique soit jou&eacute;e sur un ordinateur distant, avec autant de facilit&eacute; que si c'&eacute;tait sur son propre PC.<br /><br />Pour plus d'informations :<br /> 
<ul>
<li><a href="http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki">Le Wiki de <abbr title="Media Player Daemon">MPD</abbr></a></li>
<li><a href="http://doc.ubuntu-fr.org/mpd">La page Ubuntu-fr d&eacute;di&eacute;e &agrave; <abbr title="Media Player Daemon">MPD</abbr></a></li>
</ul>
<br />Et merci &agrave; <a href="http://www.twitter.com/keruspe">@Keruspe</a> et <a href="http://www.twitter.com/efyx">@Efyx</a> pour m'avoir aid&eacute; &agrave; faire mes premiers pas avec <abbr title="Media Player Daemon">MPD</abbr><br /><br />]]></content:encoded>
		<pubDate>Thu, 29 Apr 2010 06:03:09 +0200</pubDate>
		<guid isPermaLink="true">http://www.divarvel.fr/mpd-quelques-tweaks-sous-ubuntu-a1197124</guid>
		<dc:creator>divarvel</dc:creator>
		<dc:date>2010-04-29T06:03:09+02:00</dc:date>
	</item>
</channel>
</rss><!--mdp=-->
