<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Blogue ≈ Geek</title>
	
	<link>http://www.sylvainlevesque.com</link>
	<description>Mens sana in PHP sano !</description>
	<lastBuildDate>Tue, 12 Feb 2013 20:48:02 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SylvainLevesqueBlog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="sylvainlevesqueblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>CakePHP 2: Truc rapide pour générer un mot de passe</title>
		<link>http://www.sylvainlevesque.com/2013/02/12/cakephp-2-truc-rapide-pour-generer-un-mot-de-passe/</link>
		<comments>http://www.sylvainlevesque.com/2013/02/12/cakephp-2-truc-rapide-pour-generer-un-mot-de-passe/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 20:48:02 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[CakePHP 2]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=955</guid>
		<description><![CDATA[Astuce permettant de générer des mots de passe dans CakePHP 2 compatible avec la méthode de hachage standard.<div class='yarpp-related-rss'>

Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2009/10/22/generer-un-mot-de-passe-aleatoire-securitaire/' rel='bookmark' title='Générer un mot de passe aléatoire sécuritaire'>Générer un mot de passe aléatoire sécuritaire</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/03/03/un-peu-de-salts-avec-vos-mots-de-passe/' rel='bookmark' title='Un peu de &laquo;&nbsp;Salts&nbsp;&raquo; avec vos mots de passe ?'>Un peu de &laquo;&nbsp;Salts&nbsp;&raquo; avec vos mots de passe ?</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Vous développez le nouveau réseau social qui sera en vogue la semaine prochaine ? Vous avez besoin de générer un mot de passe pour tester le formulaire d&rsquo;identification dans <a href="http://www.cakephp.org" title="CakePHP 2" target="_blank">CakePHP 2</a> ? L&rsquo;astuce se retrouve dans le composant <a href="http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html" title="CakePHP 2 :: AuthComponent" target="_blank">Auth</a> lui-même. Voici ce que vous devez faire:</p>
<ol>
<li>Avoir un <em>CakePHP 2</em> configuré et fonctionnel sous la main. Ce qui implique d&rsquo;avoir changé le paramètre <em>Security.salt</em> dans le fichier de configuration <em>core.php</em>.</li>
<li>Choisissez n&rsquo;importe lequel des vos contrôleurs et ajoutez-lui le composant <em>Auth</em>.</li>
<li>Ensuite, il vous suffit d&rsquo;utiliser la fonction <em>password</em> de ce composant en lui passant le mot de passe à <em>hacher</em>.</li>
<li>Il suffit de visiter votre action (users/login) pour obtenir le mot de passe <em>haché</em>.</li>
</ol>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> UsersController <span style="color: #000000; font-weight: bold;">extends</span> AppController <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Users'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$components</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Auth'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> login<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span> AuthComponent<span style="color: #339933;">::</span><span style="color: #004000;">password</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'1234'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Résultat du hachage similaire à:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">string <span style="color: #ff0000;">'d6680747338986b484c8a167fc12113ba9c28751'</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">length</span>=<span style="color: #000000;">40</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>

<p>Copiez le mot de passe <em>haché</em> et utilisez le pour vos tests.<br />
Happy coding !</p>
<div class='yarpp-related-rss'>
<p>Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2009/10/22/generer-un-mot-de-passe-aleatoire-securitaire/' rel='bookmark' title='Générer un mot de passe aléatoire sécuritaire'>Générer un mot de passe aléatoire sécuritaire</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/03/03/un-peu-de-salts-avec-vos-mots-de-passe/' rel='bookmark' title='Un peu de &laquo;&nbsp;Salts&nbsp;&raquo; avec vos mots de passe ?'>Un peu de &laquo;&nbsp;Salts&nbsp;&raquo; avec vos mots de passe ?</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2013/02/12/cakephp-2-truc-rapide-pour-generer-un-mot-de-passe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LibreOffice Calc: Nombre de jours commun entre deux plages de dates</title>
		<link>http://www.sylvainlevesque.com/2013/02/09/libreoffice-calc-nombre-de-jours-commun-entre-deux-plages-de-dates/</link>
		<comments>http://www.sylvainlevesque.com/2013/02/09/libreoffice-calc-nombre-de-jours-commun-entre-deux-plages-de-dates/#comments</comments>
		<pubDate>Sat, 09 Feb 2013 04:21:35 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[LibreOffice]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=929</guid>
		<description><![CDATA[Script LibreOffice Calc permettant de trouver le nombre de jours commun entre deux plages de dates.<div class='yarpp-related-rss'>

Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2008/04/17/pont-sans-fil-entre-deux-wrt54g/' rel='bookmark' title='Pont sans fil entre deux WRT54G'>Pont sans fil entre deux WRT54G</a></li>
<li><a href='http://www.sylvainlevesque.com/2011/01/05/debuter-lannee-en-libreoffice/' rel='bookmark' title='Débuter l&rsquo;année en LibreOffice'>Débuter l&rsquo;année en LibreOffice</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/05/30/tri-de-tableau-multi-dimension-en-javascript/' rel='bookmark' title='Tri de tableau multi-dimension en javascript'>Tri de tableau multi-dimension en javascript</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Aujourd&rsquo;hui, je cherchais le moyen d&rsquo;obtenir le nombre de jours commun entre deux plages de dates dans un chiffrier LibreOffice. Je voulais utiliser seulement des fonctions natives. Malheureusement, il n&rsquo;y a pas de façon simple d&rsquo;y arriver. Après un moment, j&rsquo;ai décidé de lancer ma question à 2$ via <a href="https://twitter.com/hexenmaster/status/299942745164881920" target="_blank">Twitter</a>, car à plusieurs on a plus de chance de trouver la solution, n&rsquo;est-ce pas ? Et bien non !</p>
<blockquote class="twitter-tweet" lang="fr"><p>Question à 2$. <a href="https://twitter.com/search/%23LibreOffice">#LibreOffice</a> Est-ce possible de connaître le nombre de jours contenu dans l&rsquo;intersection de deux plages de dates ? <a href="https://twitter.com/search/%23date">#date</a></p>
<p>&mdash; Sylvain Lévesque (@hexenmaster) <a href="https://twitter.com/hexenmaster/status/299942745164881920">8 février 2013</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>Par déformation professionnelle, je me suis donc mis à programmer une fonction personnalisée. Il y avait bien longtemps que je n&rsquo;avais pas fait de script dans un chiffrier. Cette façon de faire m&rsquo;a permit rapidement d&rsquo;obtenir un résultat plus que satisfaisant. Je vous partage donc le fruit de mon travail. La fonction est ultra simple, facile à utiliser dans les cellules du chiffrier et réutilisable à souhait. Auriez-vous une façon plus élégante d&rsquo;obtenir le même résultat ?</p>
<p>Voici le code de la fonction à ajouter aux macros de votre chiffrier.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="oobas" style="font-family:monospace;"><span style="color: #b1b100;">Function</span> periodOverlap<span style="color: #66cc66;">&#40;</span> a1, a2, b1, b2 <span style="color: #66cc66;">&#41;</span>
	<span style="color: #b1b100;">dim</span> nbDays <span style="color: #b1b100;">as</span> <span style="color: #b1b100;">Integer</span>
&nbsp;
	<span style="color: #b1b100;">IF</span> a1 &gt; b2 <span style="color: #b1b100;">OR</span> a2 &lt; b1 <span style="color: #b1b100;">THEN</span>
		nbDays <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span>
	<span style="color: #b1b100;">ELSE</span>
		<span style="color: #b1b100;">IF</span> a1 &gt; b1 <span style="color: #b1b100;">AND</span> a1 &lt; b2 <span style="color: #b1b100;">THEN</span>
			nbDays <span style="color: #66cc66;">=</span> b2 - a1
		<span style="color: #b1b100;">ELSE</span>
			nbDays <span style="color: #66cc66;">=</span> a2 - b1
		<span style="color: #b1b100;">END</span> <span style="color: #b1b100;">IF</span>
	<span style="color: #b1b100;">END</span> <span style="color: #b1b100;">IF</span>
&nbsp;
	periodOverlap <span style="color: #66cc66;">=</span> nbDays
<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">function</span></pre></td></tr></table></div>

<p>Avec en plus un exemple en image au haut de l&rsquo;article !</pre>
<div class='yarpp-related-rss'>
<p>Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2008/04/17/pont-sans-fil-entre-deux-wrt54g/' rel='bookmark' title='Pont sans fil entre deux WRT54G'>Pont sans fil entre deux WRT54G</a></li>
<li><a href='http://www.sylvainlevesque.com/2011/01/05/debuter-lannee-en-libreoffice/' rel='bookmark' title='Débuter l&rsquo;année en LibreOffice'>Débuter l&rsquo;année en LibreOffice</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/05/30/tri-de-tableau-multi-dimension-en-javascript/' rel='bookmark' title='Tri de tableau multi-dimension en javascript'>Tri de tableau multi-dimension en javascript</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2013/02/09/libreoffice-calc-nombre-de-jours-commun-entre-deux-plages-de-dates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retrait des sous-répertoires .svn</title>
		<link>http://www.sylvainlevesque.com/2013/01/22/retrait-des-sous-repertoires-svn/</link>
		<comments>http://www.sylvainlevesque.com/2013/01/22/retrait-des-sous-repertoires-svn/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 20:26:58 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=921</guid>
		<description><![CDATA[Avez-vous remarqué, dans la version 1.7 de Subversion, qu&#8217;il n&#8217;y avait plus de sous-répertoires .svn ? Vous savez ces répertoires qui stockaient les méta-données concernant l&#8217;état de votre copie locale. Il en reste un seulement à la racine de votre projet. De plus, l&#8217;information sur les méta-données sont désormais entreposées dans une base de données [...]<div class='yarpp-related-rss'>

Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2009/11/14/jouer-avec-vos-sources-quickbasic-sous-ubuntu/' rel='bookmark' title='Jouer avec vos sources Quickbasic sous Ubuntu'>Jouer avec vos sources Quickbasic sous Ubuntu</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/03/30/cloner-un-vdi-sous-ubuntu-intrepid/' rel='bookmark' title='Cloner un VDI sous Ubuntu Intrepid'>Cloner un VDI sous Ubuntu Intrepid</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/01/31/la-gendarmerie-francaise-bientot-sous-ubuntu/' rel='bookmark' title='La Gendarmerie Française bientôt sous Ubuntu'>La Gendarmerie Française bientôt sous Ubuntu</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Avez-vous remarqué, dans la version 1.7 de <a href="http://subversion.apache.org/docs/release-notes/1.7.html#wc-ng" title="Subversion" target="_blank">Subversion</a>, qu&rsquo;il n&rsquo;y avait plus de sous-répertoires .svn ? Vous savez ces répertoires qui stockaient les méta-données concernant l&rsquo;état de votre copie locale. Il en reste un seulement à la racine de votre projet. De plus, l&rsquo;information sur les méta-données sont désormais entreposées dans une base de données <a href="http://www.sqlite.org/" title="SQLite" target="_blank">SQLite</a>.</p>
<p>Terminé les problèmes de copie de répertoire d&rsquo;un dépôt à l&rsquo;autre avec des répertoires .svn problématiques! Terminé les suppressions récursives! Yeah !</p>
<p>Petite mise en garde par contre. Il semblerait que sous Windows, même si vous avez une version plus récente de subversion que sur mon <a href="http://www.ubuntu.com/" title="Ubuntu 12.10" target="_blank">Ubuntu 12.10</a>, ce ne soit pas le cas. Merci à mon collègue de travail pour la vérification !</p>
<p>Et bien voilà ! C&rsquo;était ma découverte du jour !</p>
<div class='yarpp-related-rss'>
<p>Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2009/11/14/jouer-avec-vos-sources-quickbasic-sous-ubuntu/' rel='bookmark' title='Jouer avec vos sources Quickbasic sous Ubuntu'>Jouer avec vos sources Quickbasic sous Ubuntu</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/03/30/cloner-un-vdi-sous-ubuntu-intrepid/' rel='bookmark' title='Cloner un VDI sous Ubuntu Intrepid'>Cloner un VDI sous Ubuntu Intrepid</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/01/31/la-gendarmerie-francaise-bientot-sous-ubuntu/' rel='bookmark' title='La Gendarmerie Française bientôt sous Ubuntu'>La Gendarmerie Française bientôt sous Ubuntu</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2013/01/22/retrait-des-sous-repertoires-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bonne fin du monde à tout le monde !</title>
		<link>http://www.sylvainlevesque.com/2012/12/21/bonne-fin-du-monde-a-tout-le-monde/</link>
		<comments>http://www.sylvainlevesque.com/2012/12/21/bonne-fin-du-monde-a-tout-le-monde/#comments</comments>
		<pubDate>Fri, 21 Dec 2012 16:05:53 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Musique]]></category>
		<category><![CDATA[fin du monde]]></category>
		<category><![CDATA[the doors]]></category>
		<category><![CDATA[the end]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=915</guid>
		<description><![CDATA[Voici la première chanson qui m&#8217;est venu en tête en cette journée de fin du monde !<div class='yarpp-related-rss'>

Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2011/02/17/lire-les-journaux-du-monde-entier/' rel='bookmark' title='Lire les journaux du monde entier'>Lire les journaux du monde entier</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Voici la première chanson qui m&rsquo;est venu en tête en cette journée de fin du monde !</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/JSUIQgEVDM4" frameborder="0" allowfullscreen></iframe></p>
<div class='yarpp-related-rss'>
<p>Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2011/02/17/lire-les-journaux-du-monde-entier/' rel='bookmark' title='Lire les journaux du monde entier'>Lire les journaux du monde entier</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2012/12/21/bonne-fin-du-monde-a-tout-le-monde/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Transformer un tableau associatif en attributs HTML en une ligne</title>
		<link>http://www.sylvainlevesque.com/2012/12/14/transformer-un-tableau-associatif-en-attributs-html-en-une-ligne/</link>
		<comments>http://www.sylvainlevesque.com/2012/12/14/transformer-un-tableau-associatif-en-attributs-html-en-une-ligne/#comments</comments>
		<pubDate>Fri, 14 Dec 2012 04:30:18 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=907</guid>
		<description><![CDATA[Personnellement, j&#8217;ai pas de meilleure façon! et vous ? $attributes = array&#40; 'href' =&#62; 'http://www.gezere.com/', 'title' =&#62; 'Gezere Solutions Web', 'class' =&#62; 'the-super-strategy-development-and-marketing-company' &#41;; &#160; echo '&#60;a ' . str_replace&#40; array&#40; '{&#34;', '&#34;}', '&#34;:&#34;', '&#34;,&#34;', '\/' &#41;, array&#40; '', '&#34;', '=&#34;', '&#34; ', '/' &#41;, json_encode&#40; $attributes &#41; &#41; . '&#62;The best compagny !&#60;/a&#62;'; Merci [...]<div class='yarpp-related-rss'>

Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2011/07/11/wiki-de-gulquebec-en-ligne/' rel='bookmark' title='Wiki de GULQuébec en ligne'>Wiki de GULQuébec en ligne</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/05/30/tri-de-tableau-multi-dimension-en-javascript/' rel='bookmark' title='Tri de tableau multi-dimension en javascript'>Tri de tableau multi-dimension en javascript</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/06/27/hauteur-minimum-dun-element-html-en-css/' rel='bookmark' title='Hauteur minimum d&rsquo;un élément html en css'>Hauteur minimum d&rsquo;un élément html en css</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Personnellement, j&rsquo;ai pas de meilleure façon! et vous ?</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$attributes</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'href'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'http://www.gezere.com/'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Gezere Solutions Web'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'the-super-strategy-development-and-marketing-company'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'{&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&quot;}'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&quot;:&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&quot;,&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\/'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'=&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&quot; '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attributes</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&gt;The best compagny !&lt;/a&gt;'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Merci pour vos trucs !</p>
<div class='yarpp-related-rss'>
<p>Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2011/07/11/wiki-de-gulquebec-en-ligne/' rel='bookmark' title='Wiki de GULQuébec en ligne'>Wiki de GULQuébec en ligne</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/05/30/tri-de-tableau-multi-dimension-en-javascript/' rel='bookmark' title='Tri de tableau multi-dimension en javascript'>Tri de tableau multi-dimension en javascript</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/06/27/hauteur-minimum-dun-element-html-en-css/' rel='bookmark' title='Hauteur minimum d&rsquo;un élément html en css'>Hauteur minimum d&rsquo;un élément html en css</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2012/12/14/transformer-un-tableau-associatif-en-attributs-html-en-une-ligne/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sortie de WordPress 3.5 « Elvin »</title>
		<link>http://www.sylvainlevesque.com/2012/12/12/sortie-de-wordpress-3-5-elvin/</link>
		<comments>http://www.sylvainlevesque.com/2012/12/12/sortie-de-wordpress-3-5-elvin/#comments</comments>
		<pubDate>Wed, 12 Dec 2012 18:17:43 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=900</guid>
		<description><![CDATA[Yeah ! Sortie de WordPress 3.5 &#171;&#160;Elvin&#160;&#187;. D&#8217;ailleurs, le blogue roule déjà sur cette nouvelle mouture avec un retour au thème par défaut &#171;&#160;Twenty Twelve&#171;&#160;, afin de pourvoir tester les nouvelles fonctionnalités. Le blogue restera ainsi jusqu&#8217;à sa refonte visuelle ! En tant qu&#8217;adepte de la simplicité, j&#8217;aime bien le thème par défaut. De plus, [...]<div class='yarpp-related-rss'>

Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2012/04/21/wordpress-3-3-2-est-la/' rel='bookmark' title='WordPress 3.3.2 est là !'>WordPress 3.3.2 est là !</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/03/20/migration-vers-wordpress-complete/' rel='bookmark' title='Migration vers WordPress complété'>Migration vers WordPress complété</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/03/09/migration-vers-wordpress/' rel='bookmark' title='Migration vers wordpress'>Migration vers wordpress</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Yeah ! Sortie de <a href="http://www.vincentabry.com/wordpress-3-5-elvin-est-disponible-19862" title="Wordpress 3.5 "Elvin"" target="_blank">WordPress 3.5 &laquo;&nbsp;Elvin&nbsp;&raquo;</a>. D&rsquo;ailleurs, le blogue roule déjà sur cette <a href="http://codex.wordpress.org/Version_3.5" title="Détails de la version 3.5 de WordPress" target="_blank">nouvelle mouture</a> avec un retour au thème par défaut &laquo;&nbsp;<a href="http://wordpress.org/extend/themes/twentytwelve" title="Twenty Twelve Theme" target="_blank">Twenty Twelve</a>&laquo;&nbsp;, afin de pourvoir tester les nouvelles fonctionnalités. Le blogue restera ainsi jusqu&rsquo;à sa refonte visuelle ! En tant qu&rsquo;adepte de la simplicité, j&rsquo;aime bien le thème par défaut. De plus, la font est belle et lisible.</p>
<p>Parmi les changements:</p>
<ul>
<li>Nouveau thème (Twenty Twelve) adaptatif (responsive)</li>
<li>Création et gestion de galeries de photos</li>
<li>Gestion des médias hautement amélioré</li>
</ul>
<p>Que pensez-vous de cette version ?</p>
<p>Saviez-vous que WordPress est le moteur de <a href="http://om4.com.au/client/wordpress-market-share/" title="Wordpress market share" target="_blank">54%</a> des sites utilisant un gestionnaire de contenu ?</p>
<div class='yarpp-related-rss'>
<p>Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2012/04/21/wordpress-3-3-2-est-la/' rel='bookmark' title='WordPress 3.3.2 est là !'>WordPress 3.3.2 est là !</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/03/20/migration-vers-wordpress-complete/' rel='bookmark' title='Migration vers WordPress complété'>Migration vers WordPress complété</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/03/09/migration-vers-wordpress/' rel='bookmark' title='Migration vers wordpress'>Migration vers wordpress</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2012/12/12/sortie-de-wordpress-3-5-elvin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonctionnalités de GIMP 2.8.2</title>
		<link>http://www.sylvainlevesque.com/2012/12/07/fonctionnalites-de-gimp-2-8-2/</link>
		<comments>http://www.sylvainlevesque.com/2012/12/07/fonctionnalites-de-gimp-2-8-2/#comments</comments>
		<pubDate>Fri, 07 Dec 2012 18:42:23 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[gimp]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=890</guid>
		<description><![CDATA[J&#8217;ai récemment migré mon portable vers Ubuntu 12.10 (Quantal Quetzal). De belles surprises avec l&#8217;arrivé de GIMP 2.8.2. Je vous avait annoncé la sortie de la version 2.8 dans un précédent billet. Par contre, je n&#8217;avait pas vraiment parlé des nouvelles fonctionnalités. Voici donc les fonctionnalités que j&#8217;attendais avec une grande impatience depuis longtemps. Groupement [...]<div class='yarpp-related-rss'>

Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2012/05/06/gimp-2-8-apres-3-ans-de-developpement/' rel='bookmark' title='GIMP 2.8 après 3 ans de développement'>GIMP 2.8 après 3 ans de développement</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.sylvainlevesque.com/wp-content/uploads/2012/12/gimp-2.8-2_screenshot.png" alt="Screenshot de GIMP 2.8.2" title="gimp-2.8-2_screenshot" width="640" height="353" class="size-full wp-image-895" /></p>
<p>J&rsquo;ai récemment migré mon portable vers <a href="http://releases.ubuntu.com/quantal/" title="Notes de version de Ubuntu 12.10 (Quantal Quetzal)" target="_blank">Ubuntu 12.10</a> (Quantal Quetzal). De belles surprises avec l&rsquo;arrivé de <a href="http://www.gimp.org/" title="Site web du projet GIMP logiciel de retouche d'image" target="_blank">GIMP</a> 2.8.2. Je vous avait annoncé la sortie de la <a href="http://www.sylvainlevesque.com/2012/05/06/gimp-2-8-apres-3-ans-de-developpement/" title="GIMP 2.8 après 3 ans de développement">version 2.8 dans un précédent billet</a>. Par contre, je n&rsquo;avait pas vraiment parlé des nouvelles fonctionnalités.</p>
<p>Voici donc les fonctionnalités que j&rsquo;attendais avec une grande impatience depuis longtemps.</p>
<ol>
<li>Groupement de calques</li>
<li>Fenêtres ancrables multi-colonne</li>
<li>Édition de texte directement dans l&rsquo;image</li>
<li>Verrouillage des calques</li>
</ol>
<p>Yeah ! Ça fait mon bonheur ! Merci à l&rsquo;équipe de développement !</p>
<p>Pour la liste complète, consultez les <a href="http://www.gimp.org/release-notes/gimp-2.8.html" title="Notes de version de  GIMP 2.8">notes de version</a>.<br />
Pour en apprendre d&rsquo;avantage sur <a href="http://libregraphicsworld.org/blog/entry/what-hasnt-happened-to-gimp-2.8" title="L'avenir de GIMP" target="_blank">l&rsquo;avenir de GIMP</a></p>
<div class='yarpp-related-rss'>
<p>Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2012/05/06/gimp-2-8-apres-3-ans-de-developpement/' rel='bookmark' title='GIMP 2.8 après 3 ans de développement'>GIMP 2.8 après 3 ans de développement</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2012/12/07/fonctionnalites-de-gimp-2-8-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nouvelle-Zélande, terre du milieu</title>
		<link>http://www.sylvainlevesque.com/2012/08/28/nouvelle-zelande-terre-du-milieu/</link>
		<comments>http://www.sylvainlevesque.com/2012/08/28/nouvelle-zelande-terre-du-milieu/#comments</comments>
		<pubDate>Tue, 28 Aug 2012 16:21:14 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Tranches de vie]]></category>
		<category><![CDATA[Nouvelle-Zélande]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=871</guid>
		<description><![CDATA[Ça donnes-tu le goût d&#8217;y aller ça ?<div class='yarpp-related-rss yarpp-related-none'>

Aucun article connexes.
</div>
]]></description>
				<content:encoded><![CDATA[<p>Ça donnes-tu le goût d&rsquo;y aller ça ?</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/U5rc-5FinU4" frameborder="0" allowfullscreen></iframe></p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>Aucun article connexes.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2012/08/28/nouvelle-zelande-terre-du-milieu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ajouter de la swap à la volée</title>
		<link>http://www.sylvainlevesque.com/2012/08/01/ajouter-de-la-swap-a-la-volee/</link>
		<comments>http://www.sylvainlevesque.com/2012/08/01/ajouter-de-la-swap-a-la-volee/#comments</comments>
		<pubDate>Wed, 01 Aug 2012 16:45:59 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=857</guid>
		<description><![CDATA[Comment ajouter 10 go de swap à la volée sans refaire ses partitions ni même redémarrer ? Et bien voilà ! sudo fallocate -l 10g /mnt/10GB.swap sudo chmod 600 /mnt/10GB.swap sudo mkswap /mnt/10GB.swap sudo swapon /mnt/10GB.swap Évidemment ce changement n&#8217;est pas permanent et il vous faut de la place sur votre disque dur afin de [...]<div class='yarpp-related-rss'>

Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2011/01/05/debuter-lannee-en-libreoffice/' rel='bookmark' title='Débuter l&rsquo;année en LibreOffice'>Débuter l&rsquo;année en LibreOffice</a></li>
<li><a href='http://www.sylvainlevesque.com/2011/07/11/wiki-de-gulquebec-en-ligne/' rel='bookmark' title='Wiki de GULQuébec en ligne'>Wiki de GULQuébec en ligne</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/09/24/ecouter-radio-canada-sur-ubuntu-904-jaunty-jackalope/' rel='bookmark' title='Écouter Radio-Canada sur Ubuntu 9.04 (Jaunty Jackalope)'>Écouter Radio-Canada sur Ubuntu 9.04 (Jaunty Jackalope)</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Comment ajouter <em>10 go</em> de <em>swap</em> à la volée sans refaire ses partitions ni même redémarrer ? Et bien voilà !</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> fallocate <span style="color: #660033;">-l</span> 10g <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>10GB.swap
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>10GB.swap
<span style="color: #c20cb9; font-weight: bold;">sudo</span> mkswap <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>10GB.swap
<span style="color: #c20cb9; font-weight: bold;">sudo</span> swapon <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>10GB.swap</pre></td></tr></table></div>

<p>Évidemment ce changement n&rsquo;est pas permanent et il vous faut de la place sur votre disque dur afin de pouvoir héberger le <em>10 go</em> en question. Comment le rendre permanent ?</p>
<p>Ajouter cette ligne à la toute fin de votre fichier <em>/etc/fstab</em> et redémarrez.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>10GB.swap  none  swap  sw  <span style="color: #000000;">0</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>Merci <a href="http://askubuntu.com/questions/129862/ubuntu-ami-with-swap-for-micro-instance" title="Ubuntu ami with swap for micro instance" target="_blank">AskUbuntu</a> !</p>
<p>P.S. Peut-être que ça marche sur OS X aussi qui sait.</p>
<div class='yarpp-related-rss'>
<p>Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2011/01/05/debuter-lannee-en-libreoffice/' rel='bookmark' title='Débuter l&rsquo;année en LibreOffice'>Débuter l&rsquo;année en LibreOffice</a></li>
<li><a href='http://www.sylvainlevesque.com/2011/07/11/wiki-de-gulquebec-en-ligne/' rel='bookmark' title='Wiki de GULQuébec en ligne'>Wiki de GULQuébec en ligne</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/09/24/ecouter-radio-canada-sur-ubuntu-904-jaunty-jackalope/' rel='bookmark' title='Écouter Radio-Canada sur Ubuntu 9.04 (Jaunty Jackalope)'>Écouter Radio-Canada sur Ubuntu 9.04 (Jaunty Jackalope)</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2012/08/01/ajouter-de-la-swap-a-la-volee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rotation matricielle en PHP</title>
		<link>http://www.sylvainlevesque.com/2012/07/20/rotation-matriciell-en-php/</link>
		<comments>http://www.sylvainlevesque.com/2012/07/20/rotation-matriciell-en-php/#comments</comments>
		<pubDate>Fri, 20 Jul 2012 19:54:52 +0000</pubDate>
		<dc:creator>Sylvain Lévesque</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[matrice]]></category>
		<category><![CDATA[matrix]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rotation]]></category>

		<guid isPermaLink="false">http://www.sylvainlevesque.com/?p=844</guid>
		<description><![CDATA[Voici une classe qui permet la rotation matricielle simple en PHP. class Matrix &#123; function rotateClockwise90&#40; $matrix &#41; &#123; $newMatrix = array&#40;&#41;; &#160; foreach&#40; $matrix as $line &#41; &#123; foreach&#40; $line as $k =&#62; $v &#41; &#123; if&#40; !isset&#40; $newMatrix&#91; $k &#93; &#41; &#41; &#123; $newMatrix&#91; $k &#93; = array&#40;&#41;; &#125; array_unshift&#40; $newMatrix&#91; $k &#93;, [...]<div class='yarpp-related-rss'>

Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2012/12/14/transformer-un-tableau-associatif-en-attributs-html-en-une-ligne/' rel='bookmark' title='Transformer un tableau associatif en attributs HTML en une ligne'>Transformer un tableau associatif en attributs HTML en une ligne</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/10/22/generer-un-mot-de-passe-aleatoire-securitaire/' rel='bookmark' title='Générer un mot de passe aléatoire sécuritaire'>Générer un mot de passe aléatoire sécuritaire</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/05/30/tri-de-tableau-multi-dimension-en-javascript/' rel='bookmark' title='Tri de tableau multi-dimension en javascript'>Tri de tableau multi-dimension en javascript</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Voici une classe qui permet la rotation matricielle simple en PHP.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Matrix <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> rotateClockwise90<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrix</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$newMatrix</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrix</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$line</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$newMatrix</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$k</span> <span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$newMatrix</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$k</span> <span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #990000;">array_unshift</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$newMatrix</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$k</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$v</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$newMatrix</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> rotateClockwise180<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrix</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rotateClockwise90</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rotateClockwise90</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrix</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> rotateClockwise270<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrix</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rotateClockwise180</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rotateClockwise90</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrix</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Un exemple d&rsquo;utilisation:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> displayMatrix<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrix</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrix</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$line</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> PHP_EOL<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$matrice</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'C'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'D'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'F'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'G'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'H'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'I'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'J'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'K'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'L'</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
displayMatrix<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrice</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> PHP_EOL<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$matrix</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Matrix<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$matrice</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$matrix</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rotateClockwise90</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrice</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
displayMatrix<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$matrice</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Résultat avant la rotation:</p>
<pre>
A,B,C
D,E,F
G,H,I
J,K,L
</pre>
<p>Résultat après la rotation:</p>
<pre>
J,G,D,A
K,H,E,B
L,I,F,C
</pre>
<p>Maintenant, vous me direz: &laquo;&nbsp;Qu&rsquo;est-ce que je peux bien faire avec ça ?&nbsp;&raquo;&#8230; à suivre.</p>
<div class='yarpp-related-rss'>
<p>Articles connexes:<ol>
<li><a href='http://www.sylvainlevesque.com/2012/12/14/transformer-un-tableau-associatif-en-attributs-html-en-une-ligne/' rel='bookmark' title='Transformer un tableau associatif en attributs HTML en une ligne'>Transformer un tableau associatif en attributs HTML en une ligne</a></li>
<li><a href='http://www.sylvainlevesque.com/2009/10/22/generer-un-mot-de-passe-aleatoire-securitaire/' rel='bookmark' title='Générer un mot de passe aléatoire sécuritaire'>Générer un mot de passe aléatoire sécuritaire</a></li>
<li><a href='http://www.sylvainlevesque.com/2008/05/30/tri-de-tableau-multi-dimension-en-javascript/' rel='bookmark' title='Tri de tableau multi-dimension en javascript'>Tri de tableau multi-dimension en javascript</a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvainlevesque.com/2012/07/20/rotation-matriciell-en-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
