<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://phpsymfony.com/index.php?feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>[phpsymfony.com] - Blog par un programmeur pour les programmeurs</title>
  <link>http://phpsymfony.com/index.php?</link>
  <atom:link href="http://phpsymfony.com/index.php?feed/rss2" rel="self" type="application/rss+xml"/>
  <description>Blog de Guillaume BRETOU. Recense les trucs et astuces en programmation et autres codes en PHP, javascript, java, CSS, SQL, Bash...</description>
  <language>fr</language>
  <pubDate>Thu, 17 May 2012 21:26:15 -0400</pubDate>
  <copyright>© Guillaume BRETOU</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>restaurant.michelin.fr en ligne !</title>
    <link>http://phpsymfony.com/index.php?post/2012/03/10/restaurant.michelin.fr-en-ligne-%21</link>
    <guid isPermaLink="false">urn:md5:d5c2d6382c9154bbee5b552a9ac97f11</guid>
    <pubDate>Sat, 10 Mar 2012 15:01:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
            
    <description>    &lt;p&gt;Le site &lt;a hreflang=&quot;fr&quot; href=&quot;http://restaurant.michelin.fr/&quot;&gt;http://restaurant.michelin.fr/&lt;/a&gt; est désormais en ligne. Vous pouvez désormais rechercher des restaurants et laisser des avis.&lt;/p&gt;
&lt;p&gt;Le site B2B est disponible à l'adresse : &lt;a hreflang=&quot;fr&quot; href=&quot;http://pro.restaurant.michelin.fr/&quot;&gt;http://pro.restaurant.michelin.fr/&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2012/03/10/restaurant.michelin.fr-en-ligne-%21#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2012/03/10/restaurant.michelin.fr-en-ligne-%21#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/62</wfw:commentRss>
      </item>
    
  <item>
    <title>[PHP] Spécifier une connexion en utf-8 avec Doctrine DBAL</title>
    <link>http://phpsymfony.com/index.php?post/2011/12/29/%5BPHP%5D-Sp%C3%A9cifier-une-connexion-en-utf-8-avec-Doctrine-DBAL</link>
    <guid isPermaLink="false">urn:md5:42275affd6b65c5cb8ed34a26afd356d</guid>
    <pubDate>Fri, 06 Jan 2012 19:31:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>PHP</category>
            
    <description>    &lt;p&gt;Lorsque vous utilisez Doctrine DBAL (sur un projet Silex par exemple), voici comment spécifier l'encodage de la base de données.&lt;/p&gt;
&lt;p&gt;Ajoutez une classe étendue de DoctrineServiceProvider et surchargez la méthode register(). Vous devrez utiliser le système d'event. &lt;/p&gt;
&lt;p&gt;Exemple pour une base de données Mysql &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&lt;p&gt;&lt;br /&gt;use Silex\Application;&lt;br /&gt;use Doctrine\DBAL\Event\Listeners\MysqlSessionInit;&lt;br /&gt;&lt;br /&gt;class DoctrineServiceProvider extends \Silex\Provider\DoctrineServiceProvider&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; public function register(Application $app)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; parent::register($app);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; $app['db.event_manager']-&amp;gt;addEventSubscriber(new MysqlSessionInit('utf8','utf8_unicode_ci'));&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Notez qu'avec le système d'event, vous pourrez réaliser d'autres actions telles que la mise en place de Behaviors.&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/12/29/%5BPHP%5D-Sp%C3%A9cifier-une-connexion-en-utf-8-avec-Doctrine-DBAL#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/12/29/%5BPHP%5D-Sp%C3%A9cifier-une-connexion-en-utf-8-avec-Doctrine-DBAL#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/61</wfw:commentRss>
      </item>
    
  <item>
    <title>[Java] Débuter avec le développement Android</title>
    <link>http://phpsymfony.com/index.php?post/2011/12/20/%5BJava%5D-D%C3%A9buter-avec-le-d%C3%A9veloppement-sous-Android-%21</link>
    <guid isPermaLink="false">urn:md5:c96c2947040bca0e336bdda5d55395f8</guid>
    <pubDate>Tue, 20 Dec 2011 22:15:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>JAVA</category>
            
    <description>    &lt;p&gt;Ayant reçu un Samsung GALAXY S II (en remplacement de mon HTC Touch HD qui a rendu l’âme), j'ai tout de suite accroché au système des applications disponibles sur l'Android Market. Pour aller plus loin que la simple utilisation, J'ai voulu regarder comment créer une application sous Android. &lt;/p&gt;
&lt;p&gt;Comme le veux la coutume, impossible de passer à coté de l'éternel &quot;Hello World&quot; quand on débute avec une nouvelle technologie. Voici les différentes étapes que j'ai suivi pour faire fonctionner mon application sous Windows :&amp;nbsp; &lt;/p&gt;
&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;Tout d'abord, vous devez vous assurer d'avoir le JDK. Vous pourrez le télécharger ici : http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;/p&gt;
&lt;p&gt;Sélectionnez la version qui correspond à votre OS.&lt;/p&gt;
&lt;p&gt;Ensuite, vous devrez télécharger le SDK Android ici : http://developer.android.com/sdk/index.html&lt;/p&gt;
&lt;p&gt;Pour simplifier l'utilisation du SDK en ligne de commande, nous allons renseigner le chemin vers le répertoire tools du SDK dans le PATH. Sous Windows 7, démarrer &amp;gt; rechercher &quot;paramètres systèmes avancés&quot;. Cliquer sur le bouton &quot;Variables d'environnement&quot;. Puis, dans la variables système, changer la valeur de la variable PATH pour y ajouter le path vers le dossier tools du SDK.&lt;/p&gt;
&lt;h2&gt;Configuration&lt;/h2&gt;
&lt;p&gt;Dans notre cas, nous considérerons l'utilisation de l'IDE Eclipse. Pour installer les plugins nécessaire, il faut suivre la documentation ici : http://developer.android.com/sdk/eclipse-adt.html#downloading&lt;/p&gt;
&lt;p&gt;Notre environnement est désormais prêt et nous allons pouvoir créer l'application;&lt;/p&gt;
&lt;p&gt;Commencez par créer un nouveau projet Android dans eclipse. Un Clic droit dans le package explorer puis sélectionnez &quot;New&quot; puis &quot;Project ...&quot;.&lt;/p&gt;
&lt;p&gt;Sélectionnez &quot;Android Project&quot; puis Next.&lt;/p&gt;
&lt;p&gt;Choisissez un nom au projet, nous l'appellerons &quot;HelloAndroid&quot;. Pour le reste de cet écran, le paramétrage par défaut est suffisant. Cliquez sur &quot;Next&quot;.&lt;/p&gt;
&lt;p&gt;Choisissez ensuite le SDK Android dans la liste. On prendra pour cet example la version 2.3.3. Cliquez ensuite sur &quot;Next&quot;.&lt;/p&gt;
&lt;p&gt;Enfin, choisissez un nom pour le package &quot;HelloWorldAndroid&quot; puis &quot;Finish&quot;&lt;/p&gt;
&lt;p&gt;Dans le dernier écran, vous devrez remplir les champs : &lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Application name : nom de l'application. Dans notre exemple nous utiliserons &quot;Hello Android&quot;&lt;/li&gt;
&lt;li&gt;Pckage name : il s'agit du namespace du package. Dans notre exemple, nous utiliserons &quot;com.example.helloandroid&quot;. Veuillez à bien respecter les règles de nommage de package java. Sinon, vous pourrez rencontrer l'erreur &quot;Aplication package XXX must have a minimum of 2 segments&quot;&lt;/li&gt;
&lt;li&gt;Create Activity : laissez cette case cochée. Cela va permettre la génération d'une classe étendue de Activity sur laquelle nous allons travailler.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Cliquez sur &quot;Finish&quot;.&lt;/p&gt;
&lt;p&gt;Le système va ensuite générer le projet.&lt;/p&gt;
&lt;p&gt;Dans src/com.example.helloandroid/HelloAndroid.java remplacez le code par&amp;nbsp; : &lt;/p&gt;
&lt;p&gt;&lt;code&gt;package com.example.helloandroid;&lt;br /&gt;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;import android.widget.TextView;&lt;br /&gt;&lt;br /&gt;public class HelloAndroid extends Activity {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextView tv = new TextView(this);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tv.setText(&quot;Hello, Android&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(tv);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Astuce&lt;/strong&gt; : sous eclipse, vous pouvez faire Ctrl Shift O pour importer les packages manquants.&lt;/p&gt;
&lt;p&gt;Comme vous vous en doutez, l'idée est d'afficher &quot;Hello, Android&quot; sur l'écran.&lt;/p&gt;
&lt;p&gt;Nous allons maintenant tester notre développement. Pour cela, nous allons utiliser un AVD.&lt;/p&gt;
&lt;h2&gt;
Créer un AVD &lt;/h2&gt;
AVD (pour Android Virtual Device) est un émulateur qui vous permet de choisir un type d'appareil compatible et de le configurer afin de tester votre application.&lt;br /&gt;Nous allons donc créer un AVD pour vérifier que notre application fonctionne bien.&lt;br /&gt;&lt;br /&gt;Pour créer un AVD, il faut commencer par installer de nouveaux packages.&lt;br /&gt;Lancer l'utilitaire &quot;SDK Manager&quot; en tant qu'administrateur.&lt;br /&gt;Puis cocher les packages correspondant aux différentes versions que vous souhaitez installer. Veuillez à bien sélectionner le SDK Android 2.3.3 car c'est celui ci que nous utiliserons pour tester notre application Hello world.&lt;br /&gt;&lt;br /&gt;Cliquez ensuite sur &quot;Install&quot;&lt;br /&gt;Notez l'emplacement du téléchargement.&lt;br /&gt;&lt;br /&gt;Il faudra ensuite enregistrer le bon path pour les SDK dans eclipse. Pour cela, dans eclipse, allez dans Window &amp;gt; Preference &amp;gt; Android.&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casimages.com/img.php?i=111226095222207847.png&quot; target=&quot;_blank&quot; title=&quot;upload image&quot;&gt;&lt;img src=&quot;http://nsa21.casimages.com/img/2011/12/26/mini_111226095222207847.png&quot; alt=&quot;Hebergement gratuit d'image et photo&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ensuite, cliquez sur Window &amp;gt; AVD Manager&lt;br /&gt;Cliquez sur &quot;New ...&quot;. Le système affiche une nouvelle fenêtre vous permettant de configurer votre AVD&lt;br /&gt;&lt;ol&gt;&lt;li&gt;name (obligatoire) : nom de l'AVD.&lt;/li&gt;
&lt;li&gt;target (obligatoire) : version du SDK d'android. Sélectionnez 2.3.3&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Pour le reste, le paramétrage par défaut est suffisant.&lt;/p&gt;
&lt;br /&gt;&lt;h2&gt;Tester l'application&lt;/h2&gt;
&lt;br /&gt;Tester l'application est très simple. Sous eclipse, cliquez sur le projet à tester, puis Run &amp;gt; Run.&lt;br /&gt;Sélectionnez &quot;Android application&quot;&lt;br /&gt;Sélectionner une source de capture pour la vidéo, puis OK.&lt;br /&gt;&lt;br /&gt;Le système va lancer le programme dans l'émulateur. Un peu de patience, cela peut prendre du temps...&lt;br /&gt;&lt;br /&gt;Vous obtenez alors le tant attendu &quot;Hello, Android&quot; ! &lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casimages.com/img.php?i=111226110120891459.png&quot; target=&quot;_blank&quot; title=&quot;upload image&quot;&gt;&lt;img src=&quot;http://nsa21.casimages.com/img/2011/12/26/mini_111226110120891459.png&quot; alt=&quot;Hebergement gratuit d'image et photo&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sources : &lt;br /&gt;http://ydisanto.developpez.com/tutoriels/android/debuter/&lt;br /&gt;http://developer.android.com/resources/tutorials/hello-world.html&lt;br /&gt;&lt;br /&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/12/20/%5BJava%5D-D%C3%A9buter-avec-le-d%C3%A9veloppement-sous-Android-%21#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/12/20/%5BJava%5D-D%C3%A9buter-avec-le-d%C3%A9veloppement-sous-Android-%21#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/60</wfw:commentRss>
      </item>
    
  <item>
    <title>[Mysql] Mise à jour d'un mot de passe root de mysql oublié</title>
    <link>http://phpsymfony.com/index.php?post/2011/09/29/%5BMysql%5D-Mise-%C3%A0-jour-d-un-mot-de-passe-root-de-mysql-oubli%C3%A9</link>
    <guid isPermaLink="false">urn:md5:1791c97a0a623b257502a67ff2b6d7a6</guid>
    <pubDate>Thu, 29 Sep 2011 23:42:00 +0100</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>Mysql</category>
            
    <description>    Vous avez oublié le mot de passe root de mysql ? Pas de problème, il existe une solution pour cela.&lt;br /&gt;&lt;br /&gt;Commencez par couper votre serveur mysql :&lt;br /&gt;&lt;br /&gt;&lt;code&gt;/etc/init.d/mysqld stop&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Lancez la commande suivante :&lt;br /&gt;&lt;br /&gt;&lt;code&gt;/usr/bin/mysqld_safe --skip-grant-tables &amp;amp;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cela permettra de lancer le serveur en arrière plan. L'option --skip-grant-tables vous permet de passer outre l'authentification.&lt;br /&gt;Attention : vous ne pourrez toutefois pas créer d'utilisateur, ni modifier de droits dans ce mode.&lt;br /&gt;&lt;br /&gt;Connectez vous en tant que root : &lt;br /&gt;&lt;br /&gt;&lt;code&gt;mysql -uroot mysql&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;mysql&amp;gt; update user SET Password=PASSWORD('MyNewPassword') Where User='root';&lt;br /&gt;Query OK, 1 row affected (0.00 sec)&lt;br /&gt;Rows matched: 1&amp;nbsp; Changed: 1&amp;nbsp; Warnings: 0&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; flush privileges;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; exit;&lt;br /&gt;Bye&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;Vous pouvez maintenant killer le processus lancé en arrière plan. Puis, relancez votre serveur mysql :&lt;br /&gt;&lt;br /&gt;&lt;code&gt;/etc/init.d/mysqld start&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Vérifiez que votre identifiant a bien été pris en compte : &lt;br /&gt;&lt;br /&gt;&lt;code&gt;mysql -uroot -pMyNewPassword&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;C'est terminé !&lt;br /&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/09/29/%5BMysql%5D-Mise-%C3%A0-jour-d-un-mot-de-passe-root-de-mysql-oubli%C3%A9#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/09/29/%5BMysql%5D-Mise-%C3%A0-jour-d-un-mot-de-passe-root-de-mysql-oubli%C3%A9#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/58</wfw:commentRss>
      </item>
    
  <item>
    <title>[sf2] Symfony 2 : c'est parti !</title>
    <link>http://phpsymfony.com/index.php?post/2011/07/26/%5Bsf2%5D-Symfony-2-%3A-c-est-parti-%21</link>
    <guid isPermaLink="false">urn:md5:1adc62dafe5bb3d0db7d2794efa67812</guid>
    <pubDate>Tue, 26 Jul 2011 13:25:00 +0100</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>Symfony 2</category>
        <category>Symfony 2</category>    
    <description>    C'est annoncé sur le blog officiel de Symfony : la release stable 2.0 est sortie ce jour.&lt;br /&gt;&lt;br /&gt;A cette occasion, plusieurs &quot;launch parties&quot; sont prévues pour permettre aux développeurs de se réunir pour fêter cet évènement.&lt;br /&gt;&lt;br /&gt;Vous trouverez la liste des évènements &lt;a hreflang=&quot;en&quot; href=&quot;http://symfony.com/blog/symfony2-launch-parties&quot;&gt;ici&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Pour ma part, ayant déjà joué un peu avec la béta, je vais préparer un nouveau projet et je posterai différents articles sur son utilisation.&lt;br /&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/07/26/%5Bsf2%5D-Symfony-2-%3A-c-est-parti-%21#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/07/26/%5Bsf2%5D-Symfony-2-%3A-c-est-parti-%21#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/56</wfw:commentRss>
      </item>
    
  <item>
    <title>[Bash] Remplacement de caractères de retour à la ligne par des espaces</title>
    <link>http://phpsymfony.com/index.php?post/2011/07/13/%5BBash%5D-Remplacement-de-caract%C3%A8res-de-retour-%C3%A0-la-ligne-par-des-espaces</link>
    <guid isPermaLink="false">urn:md5:7da7e0778f1865908b117c685e925cdc</guid>
    <pubDate>Wed, 13 Jul 2011 18:54:00 +0100</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>BASH</category>
        <category>bash</category><category>tr</category>    
    <description>    &lt;p&gt;Supposons que vous ayez la liste suivante : &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gbretou@gunix:~$ cat test.txt&lt;br /&gt;aaa&lt;br /&gt;bbb&lt;br /&gt;ccc&lt;br /&gt;ddd&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Et que vous voulez un résultat sur une ligne, vous pouvez utiliser tr pour convertir vos sauts de ligne en espace simple.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gbretou@gunix:~$ cat test.txt | tr '\n' ' '&lt;br /&gt;aaa bbb ccc ddd ati@gm21:~$&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Si vous avez un svn st long comme le bras et que vous commitez en ligne de commande : &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svn st | sed 's/^[AM]//g' | tr '\n' ' ' | xargs svn ci -m'My super fun commit message'&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Si vous voulez éviter des fichiers, pensez au grep -v après le svn st ;)&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/07/13/%5BBash%5D-Remplacement-de-caract%C3%A8res-de-retour-%C3%A0-la-ligne-par-des-espaces#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/07/13/%5BBash%5D-Remplacement-de-caract%C3%A8res-de-retour-%C3%A0-la-ligne-par-des-espaces#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/55</wfw:commentRss>
      </item>
    
  <item>
    <title>[Silex] Premiere utilisation du micro-framework PHP 5.3 Silex</title>
    <link>http://phpsymfony.com/index.php?post/2011/06/13/%5BSilex%5D-Premiere-utilisation-du-micro-framework-Silex</link>
    <guid isPermaLink="false">urn:md5:68b84e8e948cf7dd756c9916b41c10ed</guid>
    <pubDate>Mon, 13 Jun 2011 13:45:00 +0100</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>Silex</category>
        <category>PHP</category><category>Silex</category><category>Twig</category>    
    <description>    &lt;h2&gt;Présentation de Silex&lt;/h2&gt;
&lt;br /&gt;&lt;a hreflang=&quot;en&quot; href=&quot;http://silex-project.org/&quot;&gt;Silex&lt;/a&gt; est un micro-framework pour PHP 5.3 basé sur les briques de Symfony 2 et de Pimple. Ce framework a été créé dans l'objectif de proposer un système simple permettant de réaliser des applications simples sans avoir à utiliser un framework complexe. &lt;br /&gt;Silex a été créé par Fabien Potencier et Igor Wiedler.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Le projet : Jeudi croissants&lt;/h2&gt;
&lt;br /&gt;Nous allons réaliser un projet que vous devriez aimer (ou pas).&lt;br /&gt;Tous les jeudis, nous avons la coutume suivante : une personne désignée doit ramener les croissants et les pains au chocolat pour tout le monde.&lt;br /&gt;Cette personne change bien évidemment chaque semaine.&lt;br /&gt;Nous allons donc réaliser une application se composant de 3 pages: &lt;br /&gt;&amp;nbsp;- d'un front permettant de voir qui est la prochaine personne qui doit ramener les croissants &lt;br /&gt;&amp;nbsp;- d'une page permettant d'augmenter la participation d'un membre&lt;br /&gt;&amp;nbsp;- d'une page permettant de réduire la participation d'un membre&lt;br /&gt;&lt;br /&gt;Cette application n'a pas pour objectif d'être un monstre en matière de sécurité. Il n y aura pas de gestion d'utilisateurs avec des permissions.&lt;br /&gt;Cette coutume est bien évidemment ancrée sous le nom de jeudi croissants (donc pas de Tuesday crescent ou autres ...).&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Mise en place du projet et installation de Silex&lt;/h2&gt;
&lt;br /&gt;Commencons par configurer un vhost très simple : &lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
NameVirtualHost *:80
&lt;virtualhost *:80=&quot;&quot;&gt;&amp;lt;VirtualHost *:80&amp;gt;
ServerAdmin webmaster@localhost
ServerName jeudi.local
ServerAlias jeudi.local
DocumentRoot /var/www/jeudi/
DirectoryIndex index.php&lt;br /&gt;&amp;lt;Directory /var/www/jeudi&amp;gt;&lt;br /&gt;                Options Indexes FollowSymLinks MultiViews&lt;br /&gt;                #AllowOverride None&lt;br /&gt;                Order allow,deny&lt;br /&gt;                allow from all&lt;br /&gt;        &amp;lt;/Directory&amp;gt;&lt;br /&gt;&amp;lt;/VirtualHost&amp;gt; &lt;/virtualhost&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;br /&gt;N'oubliez pas de renseigner jeudi.local dans votre fichier /etc/hosts, d'activer le vhost et de recharger la conf apache.&lt;br /&gt;&lt;br /&gt;Pour l'installation de Silex c'est très facile. Il suffit de récupérer le &lt;a hreflang=&quot;en&quot; href=&quot;http://php.net/manual/en/book.phar.php&quot;&gt;phar&lt;/a&gt; et c'est terminé ! &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;cd /var/www/&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;mkdir jeudi&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;cd jeudi&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;wget &quot;http://silex-project.org/get/silex.phar&quot;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Nous aurons besoin du moteur de template &lt;a hreflang=&quot;en&quot; href=&quot;http://www.twig-project.org/&quot;&gt;Twig&lt;/a&gt; pour ce projet.&lt;br /&gt;Twig n'étant pas inclus dans le phar, vous devrez donc le télécharger vous même. Copiez le dans /var/www/jeudi/vendor/twig&lt;br /&gt;&lt;br /&gt;Concernant le stockage des données, nous allons utiliser un simple fichier texte data.txt. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;cd /var/www/jeudi&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;mkdir data&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;touch data/data.txt&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Voici un jeu de fixtures pour votre fichier : &lt;code&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;gbretou:5&lt;br /&gt;atisset:3&lt;br /&gt;mwolff:3&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Assurez vous que le fichier est accessible en écriture.&lt;br /&gt;NB. Il est possible d'utiliser Doctrine 2 avec Silex. Il existe en effet une extension. Cela fera l'objet soit d'une mise à jour de cet article, soit d'un prochain article.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Le code de l'application&lt;/h2&gt;
&lt;br /&gt;On commence donc avec un fichier index.php très basique : &lt;br /&gt;&lt;code&gt;&lt;br /&gt;//index.php&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;require_once __DIR__.'/silex.phar';&lt;br /&gt;$app = new Silex\Application();&lt;br /&gt;// definitions&lt;br /&gt;$app-&amp;gt;run();&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Nous allons devoir ajouter un service pour gérer les intéractions avec le fichier. Nous allons donc créer la classe ParticipationService.&lt;br /&gt;Ce service devra être enregistré dans l'application Silex.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;//index.php&lt;br /&gt;require_once __DIR__.'/ParticipationService.php';&lt;br /&gt;//...&lt;br /&gt;$app['participation'] = $app-&amp;gt;share(function () {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new ParticipationService('./data/data.txt');&lt;br /&gt;});&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Vous trouverez la classe ParticipationService dans l'archive en pièce jointe.&lt;br /&gt;&lt;br /&gt;Afin de pouvoir utiliser Twig, il faudra enregistrer l'extension : &lt;br /&gt;&lt;br /&gt;&lt;code&gt;$app-&amp;gt;register(new Silex\Extension\TwigExtension(), array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'twig.path'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; __DIR__.'/views',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'twig.class_path' =&amp;gt; __DIR__.'/vendor/twig/lib',&lt;br /&gt;));&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;twig.path doit pointer sur votre dossier contenant les fichiers templates.&lt;br /&gt;twig.class_path doit pointer sur le dossier contenant les classes de Twig.&lt;br /&gt;&lt;br /&gt;Nous avons défini que l'application devait se composer de 3 routes : &lt;br /&gt;&amp;nbsp;- une route pour la visualisation&lt;br /&gt;&amp;nbsp;- une route pour l'incrémentation&lt;br /&gt;&amp;nbsp;- une route pour la décrémentation&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;La visualisation&lt;/h3&gt;
&lt;br /&gt;Nous allons définir la route suivante : &lt;br /&gt;&lt;br /&gt;&lt;code&gt;//index.php&lt;br /&gt;$app-&amp;gt;get('/', function () use ($app) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $app['twig']-&amp;gt;render('index.twig', array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'name'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; 'admin',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'participations' =&amp;gt; $app['participation']-&amp;gt;getParticipations(),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'next'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; $app['participation']-&amp;gt;getNext(),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'matrix'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; $app['participation']-&amp;gt;getParticipationMatrix(),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ));&lt;br /&gt;});&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Avec ce code, lors de l'accès à la homepage du site, le système traitera le template index.twig dans lequel on injecte plusieurs variables : name, participations, next et matrix. Ces variables sont récupérées par le service ParticipationService.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;L'incrémentation et la décrémentation&lt;/h3&gt;
&lt;br /&gt;Voici les routes pour l'incrémentation et la décrémentation : &lt;br /&gt;&lt;code&gt;&lt;br /&gt;//index.php&lt;br /&gt;$app-&amp;gt;get('/increase/{name}/{count}', function ($name, $count) use ($app) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;$app['participation']-&amp;gt;increaseParticipation($name, $count);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;return $app['twig']-&amp;gt;render('update.twig', array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'name' =&amp;gt; $name,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception $e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;return $app['twig']-&amp;gt;render('error.twig', array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'exception' =&amp;gt; $e-&amp;gt;getMessage(),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;$app-&amp;gt;get('/decrease/{name}/{count}', function ($name, $count) use ($app) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;$app['participation']-&amp;gt;decreaseParticipation($name, $count);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;return $app['twig']-&amp;gt;render('update.twig', array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'name' =&amp;gt; $name,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception $e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;return $app['twig']-&amp;gt;render('error.twig', array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'exception' =&amp;gt; $e-&amp;gt;getMessage(),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;});&lt;/code&gt; &lt;br /&gt;&lt;br /&gt;Chaque route se compose de parties variables encadrées par des {}. Ces variables sont ensuite récupérées et transférées à la closure manuellement.&lt;br /&gt;Afin d'avoir une application RESTFUL, on pourrait utiliser un put plutôt qu'un get pour les modifications.&lt;br /&gt;&lt;br /&gt;Pour vous aider dans vos développements, pensez à activer le mode debug : &lt;br /&gt;&lt;br /&gt;&lt;code&gt;$app['debug'] = true;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Edit du 17/06/2011&lt;/strong&gt; : &lt;br /&gt;
Il est possible de catcher les exceptions mieux que je ne l'ai fait : voir la partie sur les &lt;a hreflang=&quot;en&quot; href=&quot;http://silex-project.org/doc/usage.html#error-handlers&quot;&gt;error handlers&lt;/a&gt;. Je mettrai le code à jour.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;br /&gt;Vous trouverez une archive contenant l'application. N'hésitez pas à me faire part de vos remarques.&lt;br /&gt;&lt;br /&gt;&lt;ins&gt;J'ai aimé&lt;/ins&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;- La rapidité et la simplicité : on a une application avec un feedback visuel en quelques secondes&lt;br /&gt;&amp;nbsp;- La documentation : pour mon utilisation, j'ai trouvé la documentation claire&lt;br /&gt;&lt;br /&gt;&lt;ins&gt;Je n'ai pas aimé (?)&lt;/ins&gt;&lt;br /&gt;&lt;br /&gt;J'aurais souhaité utiliser des tâches pour mettre à jour les informations de participation. Cependant, d'après ce que j'ai constaté, Silex fournit une console qui ne prend en paramètre que 3 valeurs possibles : check, update et version. Je ne sais pas s'il est possible d'étendre ce système pour définir des tâches personnalisées dans le framework.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Comme l'a souligné scrumasteriswatchingu, si vous avez installé suhosin, vous devez ajouter la directive suivante dans votre php.ini&lt;br /&gt;&lt;code&gt;suhosin.executor.include.whitelist = phar&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS : La coutume Jeudi Croissant a été inventé mwolff ;p&lt;br /&gt;&lt;br /&gt;L'application Jeudi croissant est disponible sur bitbucket : https://bitbucket.org/guiguiboy/jeudi-croissant&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Edit du 16/03/2012&lt;/strong&gt;&lt;br /&gt;Le projet a été mis à jour pour utiliser la dernière version de Silex&lt;br /&gt;&lt;br /&gt;</description>
    
          <enclosure url="http://phpsymfony.com/public/jeudi_croissant.tar.gz"
      length="185122" type="application/x-gzip" />
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/06/13/%5BSilex%5D-Premiere-utilisation-du-micro-framework-Silex#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/06/13/%5BSilex%5D-Premiere-utilisation-du-micro-framework-Silex#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/54</wfw:commentRss>
      </item>
    
  <item>
    <title>[PHP] Durée de vie et expiration des sessions</title>
    <link>http://phpsymfony.com/index.php?post/2011/05/24/%5BPHP%5D-Dur%C3%A9e-de-vie-et-expiration-des-sessions</link>
    <guid isPermaLink="false">urn:md5:fe3903866be9c339e4dbe898a5dbacd3</guid>
    <pubDate>Tue, 24 May 2011 23:29:00 +0100</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>PHP</category>
        <category>PHP</category><category>session</category>    
    <description>    &lt;p&gt;La gestion de l'expiration des sessions de PHP n'est pas triviale surtout quand on utilise le mécanisme par défaut.&lt;/p&gt;
&lt;p&gt;En effet, les informations de sessions sont stockées dans des fichiers sur le serveur. Ces fichiers sont supprimés par une routine (garbage collector) qui détruit les données obsolètes.&lt;/p&gt;
&lt;p&gt;Vous devrez jongler entre les 3 paramètres suivants : &lt;/p&gt;
&lt;p&gt;&amp;nbsp;- &lt;span class=&quot;term&quot;&gt;&lt;em&gt;&lt;tt class=&quot;parameter&quot;&gt;session.gc_maxlifetime : spécifie une période en secondes pendant laquelle les données sont considérées comme corretes. Une fois cette période passée, les données sont alors considères comme obsolètes et sont susceptibles d'être supprimées par le garbage collector.&lt;br /&gt;&lt;/tt&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;term&quot;&gt;&lt;em&gt;&lt;tt class=&quot;parameter&quot;&gt;- session.gc_probability : &lt;/tt&gt;&lt;/em&gt;&lt;/span&gt;&lt;span class=&quot;term&quot;&gt;&lt;em&gt;&lt;tt class=&quot;parameter&quot;&gt;à utiliser conjointement avec&lt;/tt&gt;&lt;/em&gt;&lt;/span&gt;&lt;span class=&quot;term&quot;&gt;&lt;em&gt;&lt;tt class=&quot;parameter&quot;&gt; session.gc_divisor : permet de définir la probabilité que la routine de garbage collection soit lancé à chaque requête&lt;br /&gt;&lt;/tt&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;term&quot;&gt;&lt;em&gt;&lt;tt class=&quot;parameter&quot;&gt;- session.gc_divisor : à utiliser conjointement avec session.gc_probability : permet de définir une probabilité que la routine de garbage collection soit lancée à chaque requête&lt;br /&gt;&lt;/tt&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;(Ces trois paramètres doivent être définis avant l'appel à session_start() si vous souhaitez modifier leur valeur via votre script)&lt;/p&gt;
&lt;p&gt;Avec les valeurs par défaut (session.gc_probability = 1 et session.gc_divisor = 100), vous aurez donc une probabilité de 1% que la routine de garbage collection soit lancée à chaque requête.&lt;/p&gt;
&lt;p&gt;Vous serez donc tenter d'ajuster les valeurs des deux derniers paramètres afin de maximiser la probabilité d'exécution de la routine de garbage collection.&lt;/p&gt;
&lt;p&gt;Vous devez être conscient que le mécanisme est couteux et si vous avez de multiples sessions ouvertes sur votre site, une fréquence d'exécution trop importante peut entrainer des ralentissements&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/05/24/%5BPHP%5D-Dur%C3%A9e-de-vie-et-expiration-des-sessions#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/05/24/%5BPHP%5D-Dur%C3%A9e-de-vie-et-expiration-des-sessions#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/52</wfw:commentRss>
      </item>
    
  <item>
    <title>[VI] Permissions root lors de l'édition d'un fichier verrouillé en écriture</title>
    <link>http://phpsymfony.com/index.php?post/2011/03/23/%5BVI%5D-Permissions-root-lors-de-l-%C3%A9dition-d-un-fichier-verrouill%C3%A9-en-%C3%A9criture</link>
    <guid isPermaLink="false">urn:md5:6fa50d48cfc8fd34a94c01a38e97a84c</guid>
    <pubDate>Wed, 23 Mar 2011 16:08:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>Editeurs</category>
        <category>vi</category>    
    <description>    &lt;p&gt;Combien de fois, en éditant vos fichiers php.ini par exemple, avez-vous eu ce message&amp;nbsp; &quot;Alerte: Modification d'un fichier en lecture seule&quot;&lt;/p&gt;
&lt;p&gt;Voici la solution :&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:w !sudo tee %&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Avec cette commande, vous n'aurez plus besoin de quitter vi pour le relancer en root juste après.&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/03/23/%5BVI%5D-Permissions-root-lors-de-l-%C3%A9dition-d-un-fichier-verrouill%C3%A9-en-%C3%A9criture#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/03/23/%5BVI%5D-Permissions-root-lors-de-l-%C3%A9dition-d-un-fichier-verrouill%C3%A9-en-%C3%A9criture#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/50</wfw:commentRss>
      </item>
    
  <item>
    <title>[Linux] Utilisation courante de tar</title>
    <link>http://phpsymfony.com/index.php?post/2011/02/22/%5BLinux%5D-Utilisation-courante-de-tar</link>
    <guid isPermaLink="false">urn:md5:acf9013fa464feaeda794a736c126b9a</guid>
    <pubDate>Tue, 22 Feb 2011 18:26:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>Linux</category>
        <category>archive</category><category>linux</category><category>tar</category>    
    <description>    &lt;p&gt;tar est un utilitaire d'archivage permettant de stocker et d'extraire des fichiers d'une archive.&lt;/p&gt;
&lt;p&gt;Voici des cas d'utilisation de cet utilitaire que vous serez amenés à rencontrer le plus souvent dans votre (belle) vie de programmeur : &lt;/p&gt;
&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Création d'archive à partir d'un répertoire : &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;tar -cvf archive.tar %DIR%&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Création d'archive gz à partir d'un répertoire : &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;tar -cvzf archive.tar.gz %DIR%&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Création d'archive bzip2 à partir d'un répertoire : &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;tar -cvjf archive.tar.bz %DIR%&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;&lt;strong&gt;Extraction du contenu d'une archive dans le répertoire courant : &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;tar -xvf archive.tar&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Extraction du fichier test.txt contenu dans une archive dans le répertoire courant : &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;tar -xvf archive.tar test.txt&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Extraction du contenu d'une archive gzippée dans le dossier %DIR% :&lt;/strong&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;tar -xvzf archive.tar.gz -C %DIR%&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Extraction du contenu d'une archive bzip2 dans le répertoire courant :&amp;nbsp;
&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;tar -xvjf archive.tar.bz&lt;/p&gt;
&lt;br /&gt;Pour tous renseignements supplémentaires : man tar est votre ami.&lt;br /&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/02/22/%5BLinux%5D-Utilisation-courante-de-tar#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/02/22/%5BLinux%5D-Utilisation-courante-de-tar#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/49</wfw:commentRss>
      </item>
    
  <item>
    <title>[PHP] remplacement de split par preg_split : split2preg_split</title>
    <link>http://phpsymfony.com/index.php?post/2011/02/08/%5BPHP%5D-remplacement-de-split-par-preg_split-%3A-split2preg_split</link>
    <guid isPermaLink="false">urn:md5:1e1ef218f86770e12fdf34e75fb4732a</guid>
    <pubDate>Tue, 08 Feb 2011 22:46:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>PHP</category>
        <category>PCRE</category><category>PHP</category><category>POSIX</category><category>preg_split</category><category>split</category>    
    <description>    &lt;p&gt;Depuis PHP 5.3, la fonction split est devenue obsolète (voir &lt;a hreflang=&quot;fr&quot; href=&quot;http://fr2.php.net/split&quot;&gt;le manuel PHP&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Il convient donc de la remplacer par preg_split, son équivalente plus moderne qui utilise l'extension PCRE.&lt;/p&gt;
&lt;p&gt;J'ai donc développé un bout de code qui va permettre de remplacer les appels split par preg_split.&lt;/p&gt;
&lt;p&gt;Voici le script : (il affiche sur la sortie standard le fichier converti)&lt;/p&gt;
&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;/****************************************************************************/&lt;br /&gt;/************************ split2preg_split **********************************/&lt;br /&gt;/************************ author : gbretou **********************************/&lt;br /&gt;/****************************************************************************/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$file&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $_SERVER['argv'][1];&lt;br /&gt;$lines&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = file($file);&lt;br /&gt;foreach ($lines as $line)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (preg_match('|(.*)(?&amp;lt;![a-zA-Z0-9-_])(split\(([\'\&quot;\$]{1}(.*)[\'\&quot;]?),(.*)$)|', $line, $matches))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $pattern = $matches[3];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $pattern = recalculateRegex($pattern);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $matches[1] . &quot;preg_split(&quot; . $pattern . &quot;,&quot; . $matches[5] . &quot;\n&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $line;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;&amp;nbsp;* Recalculates the regex&lt;br /&gt;&amp;nbsp;* 2 cases : &lt;br /&gt;&amp;nbsp;*&amp;nbsp; - case 1 : a PHP variable is provided for the pattern&lt;br /&gt;&amp;nbsp;*&amp;nbsp; - case 2 : a simple string is provided&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;function recalculateRegex($pattern)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $delimiter = '/';&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (substr($pattern, 0, 1) == '$')&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return sprintf(&quot;'%s' . str_replace('%s', '\\%s', %s) . '%s'&quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $delimiter,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $delimiter,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $delimiter,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $pattern,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $delimiter&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return sprintf(&quot;%s%s%s%s%s&quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr($pattern, 0, 1),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $delimiter,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; str_replace($delimiter, &quot;\\$delimiter&quot;, substr($pattern, 1, -1)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $delimiter,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; substr($pattern, 0, 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Pour le lancer sur un fichier PHP, vous pouvez faire :
&lt;p&gt;&lt;code&gt;php split_modifier.php [FICHIER]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;ou si vous souhaitez le lancer sur tous les fichiers PHP d'un répertoire : &lt;/p&gt;
&lt;p&gt;&lt;code&gt;find . -name '*.php' | xargs php split_modifier.php &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Ce programme présente plusieurs limites : &lt;/p&gt;
&lt;p&gt;&amp;nbsp;- si votre split est sur plusieurs lignes, il ne sera pas pris en compte car l'expression régulière ne sera pas matchée&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- le fait d'ajouter un délimiteur ne permet pas de convertir toutes les expressions POSIX en PCRE (&lt;a hreflang=&quot;fr&quot; href=&quot;http://fr2.php.net/manual/en/intro.pcre.php#94011&quot;&gt;exemple&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- il affiche le résultat sur la sortie standard et ne fait pas de remplacement directement dans le fichier&lt;/p&gt;
&lt;p&gt;En fonction des retours que j'aurais, je modifierais le script.&lt;/p&gt;
&lt;p&gt;Néanmoins, pour le deuxième point, je vous propose de créer vos propres tests puis de comparer si le retour du fichier avec split est identique que celui avec preg_split. Voici déjà quelques lignes :&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$delimiter = &quot;/&quot;;&lt;br /&gt;var_dump(split('/', &quot;test / test&quot;));&lt;br /&gt;var_dump(split('\|', &quot;test / test&quot;)); //this is a comment&lt;br /&gt;var_dump(split('\|', &quot;test | test&quot;));&lt;br /&gt;var_dump(split('/ ', &quot;test / test&quot;)); //this is a comment&lt;br /&gt;var_dump(split('[/.-]', '31-12-2010'));&lt;br /&gt;var_dump(split('[/.-]', '31/12/2010'));&lt;br /&gt;var_dump(split(&quot;[\n\r\t ]+&quot;, &quot;Please cut&amp;nbsp;&amp;nbsp; \t me \n in pieces&quot;));&lt;br /&gt;var_dump(split('\|/', 'test /test |/ test / test'));&lt;br /&gt;var_dump(split($delimiter, 'test / test / test / test'));&lt;br /&gt;var_dump(preg_split('|t/t|', 'this another test')); //must not be changed&lt;br /&gt;var_dump(my_split('/', 'this / is / another / test'));&lt;br /&gt;&lt;br /&gt;function my_split($pattern, $value) //must not be changed!&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return split($pattern, $value);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;/p&gt;
&lt;br /&gt;Pour faire une comparaison, je vous propose de suivre le cheminement suivant :
&lt;p&gt;&amp;nbsp;- mettez vos tests avec split dans le fichier split_test.php&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- remplacez vos split par preg_split dans un fichier preg_split_test.php&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- lancez les deux fichiers puis comparez leur retour via un diff.&lt;/p&gt;
&lt;p&gt;(MAJ le 18/02 pour gestion des fonctions)&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/02/08/%5BPHP%5D-remplacement-de-split-par-preg_split-%3A-split2preg_split#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/02/08/%5BPHP%5D-remplacement-de-split-par-preg_split-%3A-split2preg_split#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/48</wfw:commentRss>
      </item>
    
  <item>
    <title>[Apache] Module mod_pagespeed</title>
    <link>http://phpsymfony.com/index.php?post/2011/01/11/%5BApache%5D-Module-mod_pagespeed</link>
    <guid isPermaLink="false">urn:md5:96afe2f31d9c7266180774268c5a313e</guid>
    <pubDate>Tue, 11 Jan 2011 22:58:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>Apache</category>
        <category>apache</category>    
    <description>    &lt;p&gt;Depuis l'année dernière, la vitesse de chargement d'une page est devenue un critère pris en compte dans l'algorithme de classement de Google. Il est donc utile, pour le bien de son pagerank, et pour le bien de ses utilisateurs de travailler sur ce critère.&lt;/p&gt;
&lt;p&gt;Il existe de nombreux axes permettant de réduire le temps de chargement des pages : &lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Quantité de données sur une page,&lt;/li&gt;
&lt;li&gt;Complexité algorithmique,&lt;/li&gt;
&lt;li&gt;Compression des données,&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pour ma part, je me suis interessé au module mod_pagespeed pour Apache 2. Il s'agit d'un module développé par Google.&lt;/p&gt;
&lt;p&gt;Ce module va permettre d'optimiser les pages web et les ressources qu'elles comportent. Ceci est réalisé par la réécriture des ressources par des filtres qui implémentent les meilleurs pratiques du développement web. mod_pagespeed inclut de multiples filtres qui optimisent les feuilles de style CSS, le javascript et le HTML. Il inclut également des filtres pour l'optimisation des images JPEG et PNG. &lt;/p&gt;
&lt;p&gt;Les filtres possibles sont : &lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Concaténation de fichiers CSS&lt;/li&gt;
&lt;li&gt;Optimisation des images (mise à l'échelle, recompression)&lt;/li&gt;
&lt;li&gt;Minification du javascript&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Une liste exhaustive peut-être trouvée sur &lt;a hreflang=&quot;en&quot; href=&quot;http://code.google.com/intl/fr/speed/page-speed/docs/filters.html&quot;&gt;ici&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Installation (sur Debian) : &lt;/p&gt;
&lt;p&gt;&amp;nbsp;wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.deb&lt;br /&gt;&amp;nbsp;sudo dpkg -i mod-pagespeed-beta_current_i386.deb&lt;br /&gt;&amp;nbsp;sudo /etc/init.d/apache2 restart&lt;/p&gt;
&lt;p&gt;Pour le moment, je n'ai testé ce module qu'avec un petit site. Je vais voir les résultats et posterai un retour d'expérience après avoir testé sur un site plus conséquent.&lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;en&quot; href=&quot;http://code.google.com/intl/fr/speed/page-speed/docs/module.html&quot;&gt;Lien vers le site officiel du projet.&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2011/01/11/%5BApache%5D-Module-mod_pagespeed#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2011/01/11/%5BApache%5D-Module-mod_pagespeed#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/47</wfw:commentRss>
      </item>
    
  <item>
    <title>[python] Spécial Noel : Tirage &quot;aléatoire&quot; d'une liste de cadeau de noel</title>
    <link>http://phpsymfony.com/index.php?post/2010/12/22/%5Bpython%5D-Sp%C3%A9cial-Noel-%3A-Tirage-al%C3%A9atoire-de-listes-par-personne</link>
    <guid isPermaLink="false">urn:md5:eaa2d15014d204a43294ad1bbcdd4496</guid>
    <pubDate>Wed, 22 Dec 2010 00:04:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>Python</category>
            
    <description>    &lt;p&gt;Article spécial noël ! &lt;/p&gt;
&lt;p&gt;Voici un script en python qui vous permettra de faire une liste de cadeaux &quot;aléatoire&quot; en fonction d'une liste de participants. Ainsi, vous saurez qui va offrir un cadeau à qui.&lt;/p&gt;
&lt;p&gt;Vous précisez en entrée les participants.&lt;/p&gt;
&lt;p&gt;L'algorithme utilisé par ce programme n'est pas efficace dans la mesure où il mélange les tableaux (offreurs et receveurs) puis vérifie que l'ensemble est une solution du système. &lt;/p&gt;
&lt;p&gt;Néanmoins, les résultats sont rapides pour 7 participants.&lt;/p&gt;
&lt;p&gt;import random&lt;br /&gt;
senders &amp;nbsp; = ['AAA', 'BBB', 'CCC', 'DDD', 'EEE', 'FFF', 'GGG']&lt;br /&gt;
receivers = senders[:]&lt;br /&gt;
&lt;br /&gt;
complete = False&lt;br /&gt;
while complete == False:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;random.shuffle(receivers)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;complete = True&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for i in range(len(receivers)):&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if receivers[i] == senders[i]:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;complete = False&lt;br /&gt;
&lt;br /&gt;
for i in range(len(receivers)):&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print senders[i] + &quot; doit offrir un cadeau a &quot; + receivers[i]&lt;/p&gt;
&lt;p&gt;C'était par le même occasion un petit défi me permettant de découvrir python, langage que je souhaiterais approfondir par la suite.&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2010/12/22/%5Bpython%5D-Sp%C3%A9cial-Noel-%3A-Tirage-al%C3%A9atoire-de-listes-par-personne#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2010/12/22/%5Bpython%5D-Sp%C3%A9cial-Noel-%3A-Tirage-al%C3%A9atoire-de-listes-par-personne#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/46</wfw:commentRss>
      </item>
    
  <item>
    <title>[Linux] Mise en place adresse IP statique sur Debian Lenny</title>
    <link>http://phpsymfony.com/index.php?post/2010/12/20/%5BLinux%5D-Mise-en-place-adresse-IP-statique-sur-Debian-Lenny</link>
    <guid isPermaLink="false">urn:md5:1dac376353ac0653b56c3f7a419aafd7</guid>
    <pubDate>Mon, 20 Dec 2010 22:43:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>Linux</category>
        <category>debian</category><category>linux</category>    
    <description>    &lt;p&gt;Pour mettre en place une adresse IP fixe sur une debian, éditez le fichier /etc/network/interfaces&lt;/p&gt;
&lt;p&gt;Exemple : &lt;/p&gt;
&lt;p&gt;gbretou@gunix:~$ cat /etc/network/interfaces&lt;br /&gt;# This file describes the network interfaces available on your system&lt;br /&gt;# and how to activate them. For more information, see interfaces(5).&lt;br /&gt;&lt;br /&gt;# The loopback network interface&lt;br /&gt;auto lo&lt;br /&gt;iface lo inet loopback&lt;br /&gt;&lt;br /&gt;# The primary network interface&lt;br /&gt;allow-hotplug eth0&lt;br /&gt;#iface eth0 inet dhcp&lt;br /&gt;iface eth0 inet static&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address 192.168.0.177&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; netmask 255.255.255.0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; network 192.168.0.0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; broadcast 192.168.0.255&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gateway 192.168.0.254&lt;/p&gt;
&lt;p&gt;Pour configurer les DNS, vous devrez éditer le fichier /etc/resolv.conf&lt;/p&gt;
&lt;p&gt;Exemple : &lt;/p&gt;
&lt;p&gt;gbretou@gunix:~$ cat /etc/resolv.conf&lt;br /&gt;nameserver 192.168.1.1&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2010/12/20/%5BLinux%5D-Mise-en-place-adresse-IP-statique-sur-Debian-Lenny#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2010/12/20/%5BLinux%5D-Mise-en-place-adresse-IP-statique-sur-Debian-Lenny#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/45</wfw:commentRss>
      </item>
    
  <item>
    <title>[VirtualBox] Augmentation taille disque dur virtuel VDI avec HD Clone</title>
    <link>http://phpsymfony.com/index.php?post/2010/11/23/%5BVirtualBox%5D-Augmentation-taille-disque-dur</link>
    <guid isPermaLink="false">urn:md5:045cb6477a2ec1dc9a3b6bc54bc5fe6e</guid>
    <pubDate>Tue, 23 Nov 2010 19:22:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>hd clone</category><category>linux</category><category>machine virtuelle</category><category>virtual box</category>    
    <description>    &lt;p&gt;Lorsque l'on se créé une machine virtuelle avec VirtualBox, il faut associer un disque dur virtuel qui sera attaché à la machine. On lui spécifie une taille à la création et on commence à utiliser sa VM.&lt;/p&gt;
&lt;p&gt;Sauf que, plus le temps passe, plus votre disque se remplit, jusqu'au jour où vous vous rendez compte que vous devez augmenter la taille de votre disque dur. &lt;/p&gt;
&lt;p&gt;Voici les différentes étapes à suivre pour mener à bien votre mission.&lt;/p&gt;
&lt;p&gt;Nous allons procéder en 2 étapes : &lt;/p&gt;
&lt;p&gt;&amp;nbsp;- création d'un nouveau disque de taille supérieure&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- copie du disque principal vers le nouveau disque&lt;/p&gt;
&lt;p&gt;(Personnellement, j'ai compté moins d'une heure pour la totalité de l'opération. Cette information est donnée à titre indicatif car de multiples paramètres peuvent intervenir (puissance machine, taille originale, collègue qui vient vous raconter sa vie, ...).&lt;/p&gt;
&lt;h2&gt;Création d'un nouveau disque dur virtuel&lt;/h2&gt;
&lt;p&gt;Cliquez sur configuration -&amp;gt;puis stockage&lt;/p&gt;
&lt;p&gt;Sélectionnez votre contrôleur, puis Ajouter un nouveau disque dur.&lt;/p&gt;
&lt;p&gt;Créez vous un nouveau média avec une taille fixe ou dynamique. Je n'ai pas fais de benchmarks qui permettrait de savoir si un type de disque est mieux qu'un autre. Puis donnez lui une taille supérieure à celle de votre disque dur.&lt;/p&gt;
&lt;p&gt;Par défaut, ce disque sera en esclave secondaire.&lt;/p&gt;
&lt;p&gt;Montez ensuite l'image de HD Clone. &lt;a hreflang=&quot;en&quot; href=&quot;http://www.miray.de/download/sat.hdclone.html&quot;&gt;Vous pourrez la télécharger ici&lt;/a&gt;. Prenez la version universal package.&lt;/p&gt;
&lt;p&gt;Vérifiez enfin l'ordre de boot (ordre d'amorçage en français). Il faut booter sur le lecteur de cd-rom avant le disque dur.&lt;/p&gt;
&lt;h2&gt;Copie du disque dur principal &lt;/h2&gt;
&lt;p&gt;Une fois ceci fait, vous pouvez démarrer votre VM.&lt;/p&gt;
&lt;p&gt;J'ai pris quelques screenshots pour mieux vous guider durant le processus : &lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://phpsymfony.com/imgs/44/10.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://phpsymfony.com/imgs/44/11.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Choisissez Drive -&amp;gt; Drive, puis Next&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://phpsymfony.com/imgs/44/12.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Sélectionnez le disque source ...&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://phpsymfony.com/imgs/44/13.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Puis le disque cible&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://phpsymfony.com/imgs/44/14.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Choisissez des options pour la copie (les options par défaut sont suffisantes)&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://phpsymfony.com/imgs/44/15.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Vous pourrez ensuite ajuster vos partitions. Si vous souhaitez utiliser la totalité du disque, gardez les valeurs par défaut.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://phpsymfony.com/imgs/44/16.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;La copie commence dès que vous cliquez sur &quot;Start&quot;&lt;/p&gt;
&lt;p&gt;Une fois la copie terminée, choisissez &quot;automatically&quot; lorsque HD Clone vous propose d'ajuster automatiquement des données de partition.&lt;/p&gt;
&lt;p&gt;Vous pouvez ensuite éteindre la VM.&lt;/p&gt;
&lt;p&gt;Retirez HD Clone du lecteur de CD virtuel.&lt;/p&gt;
Retirez l'ancien disque dur (le plus petit) de la liste.&lt;br /&gt;
&lt;p&gt;Puis relancez votre VM&lt;/p&gt;
&lt;p&gt;Et : &lt;/p&gt;
&lt;p&gt;df -h &lt;/p&gt;
&lt;p&gt;Et voila, c'est terminé vous avez votre nouveau disque dur.&lt;/p&gt;
&lt;p&gt;Pour ma part, j'ai eu des erreurs lors de la copie. Ces erreurs ont toutefois été résolues avec l'utilisation de fsck.&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2010/11/23/%5BVirtualBox%5D-Augmentation-taille-disque-dur#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2010/11/23/%5BVirtualBox%5D-Augmentation-taille-disque-dur#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/44</wfw:commentRss>
      </item>
    
  <item>
    <title>[PHP] Slides des conférences du forum PHP 2010</title>
    <link>http://phpsymfony.com/index.php?post/2010/11/10/%5BPHP%5D-Slides-des-conf%C3%A9rences-du-forum-PHP-2010</link>
    <guid isPermaLink="false">urn:md5:12531912d1f837e5ff13e6a357fa6eeb</guid>
    <pubDate>Wed, 10 Nov 2010 09:56:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>PHP</category>
        <category>PHP</category>    
    <description>    &lt;p&gt;Si comme moi, vous n'avez pas eu la chance d'aller à cet évènement incontournable qu'est le forum PHP, voici au moins les slides pour ne pas tout louper&amp;nbsp; ;)&lt;/p&gt;
&lt;p&gt;Optimisation LAMP : &lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;fr&quot; href=&quot;http://www.slideshare.net/cyruss666/optimisation-lamp&quot;&gt;http://www.slideshare.net/cyruss666/optimisation-lamp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Propel : &lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;fr&quot; href=&quot;http://prezi.com/20zx62inia2y/apprendre-en-persistant-propel-php-forum-2010/&quot;&gt;http://prezi.com/20zx62inia2y/apprendre-en-persistant-propel-php-forum-2010/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Git : &lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;fr&quot; href=&quot;http://www.slideshare.net/ubermuda/m-5725576&quot;&gt;http://www.slideshare.net/ubermuda/m-5725576&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Revue de code : &lt;/p&gt;
&lt;p&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CUsers%5Cgbretou%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;link rel=&quot;themeData&quot; href=&quot;file:///C:%5CUsers%5Cgbretou%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot;&gt;&lt;link rel=&quot;colorSchemeMapping&quot; href=&quot;file:///C:%5CUsers%5Cgbretou%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:TrackMoves /&gt;
&lt;w:TrackFormatting /&gt;
&lt;w:HyphenationZone&gt;21&lt;/w:HyphenationZone&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:DoNotPromoteQF /&gt;
&lt;w:LidThemeOther&gt;FR&lt;/w:LidThemeOther&gt;
&lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
&lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;w:SplitPgBreakAndParaMark /&gt;
&lt;w:DontVertAlignCellWithSp /&gt;
&lt;w:DontBreakConstrainedForcedTables /&gt;
&lt;w:DontVertAlignInTxbx /&gt;
&lt;w:Word11KerningPairs /&gt;
&lt;w:CachedColBalance /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;m:mathPr&gt;
&lt;m:mathFont m:val=&quot;Cambria Math&quot; /&gt;
&lt;m:brkBin m:val=&quot;before&quot; /&gt;
&lt;m:brkBinSub m:val=&quot;&amp;#45;-&quot; /&gt;
&lt;m:smallFrac m:val=&quot;off&quot; /&gt;
&lt;m:dispDef /&gt;
&lt;m:lMargin m:val=&quot;0&quot; /&gt;
&lt;m:rMargin m:val=&quot;0&quot; /&gt;
&lt;m:defJc m:val=&quot;centerGroup&quot; /&gt;
&lt;m:wrapIndent m:val=&quot;1440&quot; /&gt;
&lt;m:intLim m:val=&quot;subSup&quot; /&gt;
&lt;m:naryLim m:val=&quot;undOvr&quot; /&gt;
&lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState=&quot;false&quot; DefUnhideWhenUsed=&quot;true&quot;
DefSemiHidden=&quot;true&quot; DefQFormat=&quot;false&quot; DefPriority=&quot;99&quot;
LatentStyleCount=&quot;267&quot;&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;0&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Normal&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;heading 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 7&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 8&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 9&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 7&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 8&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 9&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;35&quot; QFormat=&quot;true&quot; Name=&quot;caption&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;10&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Title&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; Name=&quot;Default Paragraph Font&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;11&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtitle&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;22&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Strong&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;20&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Emphasis&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;59&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Table Grid&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Placeholder Text&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;No Spacing&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Revision&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;34&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;List Paragraph&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;29&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Quote&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;30&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Quote&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 1&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 2&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 3&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 4&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 5&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 6&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;19&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Emphasis&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;21&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Emphasis&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;31&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Reference&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;32&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Reference&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;33&quot; SemiHidden=&quot;false&quot;
UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Book Title&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;37&quot; Name=&quot;Bibliography&quot; /&gt;
&lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; QFormat=&quot;true&quot; Name=&quot;TOC Heading&quot; /&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;![endif]--&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/jmf/revues-de-code-forum-php-2010&quot;&gt;http://www.slideshare.net/jmf/revues-de-code-forum-php-2010&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Développer mieux en PHP avec symfony : &lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;fr&quot; href=&quot;http://www.slideshare.net/hhamon/mieux-dvelopper-en-php-avec-symfony&quot;&gt;http://www.slideshare.net/hhamon/mieux-dvelopper-en-php-avec-symfony&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Les frameworks PHP : &lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;fr&quot; href=&quot;http://www.slideshare.net/xavierlacot/forum-php-2010-les-frameworks-essentiels-danslecosystemephpxavierlacotbastienjaillotcleverage&quot;&gt;http://www.slideshare.net/xavierlacot/forum-php-2010-les-frameworks-essentiels-danslecosystemephpxavierlacotbastienjaillotcleverage&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Le SEO pour les développeurs : &lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;fr&quot; href=&quot;http://s.billard.free.fr/referencement/?2010/11/10/623-le-seo-pour-les-developpeurs&quot;&gt;http://s.billard.free.fr/referencement/?2010/11/10/623-le-seo-pour-les-developpeurs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PHP et Windwos : &lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;fr&quot; href=&quot;http://www.slideshare.net/LeTesteur/php-forum-2010-php-et-microsoft&quot;&gt;http://www.slideshare.net/LeTesteur/php-forum-2010-php-et-microsoft&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Zend framework 2 : &lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;fr&quot; href=&quot;http://www.slideshare.net/mikaelkael/zf2-cequivachanger&quot;&gt;http://www.slideshare.net/mikaelkael/zf2-cequivachanger&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Xdebug : &lt;/p&gt;
&lt;p&gt;&lt;a hreflang=&quot;en&quot; href=&quot;http://www.slideshare.net/cyruss666/optimisation-lamp&quot;&gt;http://derickrethans.nl/talks/xdebug-afup10.pdf&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2010/11/10/%5BPHP%5D-Slides-des-conf%C3%A9rences-du-forum-PHP-2010#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2010/11/10/%5BPHP%5D-Slides-des-conf%C3%A9rences-du-forum-PHP-2010#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/42</wfw:commentRss>
      </item>
    
  <item>
    <title>[Linux] Utilisation de screen - screen sheet cheat</title>
    <link>http://phpsymfony.com/index.php?post/2010/11/05/%5BLinux%5D-Utilisation-de-screen</link>
    <guid isPermaLink="false">urn:md5:d4ab1ffab8cbe0b20c1eae7e57bfce6e</guid>
    <pubDate>Fri, 05 Nov 2010 09:31:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>cheat sheet</category><category>Linux</category><category>screen</category>    
    <description>    &lt;p&gt;Êtes-vous du genre à ouvrir plusieurs fois putty pour travailler sur un même serveur ? Un premier pour lancer des programmes, un deuxième avec un tail -f sur des logs, un troisième pour ... &lt;/p&gt;
&lt;p&gt;Si c'est le cas, cet article est fait pour vous. En effet, je parlerais de screen, une commande de Linux, qui va vous faire gagner beaucoup de temps.&lt;/p&gt;
&lt;h2&gt;Qu'est ce que screen ? &lt;/h2&gt;
&lt;p&gt;screen est un utilitaire disponible sur linux permettant aux utilisateurs d'accéder à des terminaux différents dans un seul terminal ou via une seule session. Il est très utile lorsque l'on doit lancer de multiples programmes en ligne de commande.&lt;/p&gt;
&lt;h2&gt;Comment ca marche ? &lt;/h2&gt;
&lt;p&gt;Pour l'installer, s'il ne l'est pas déjà, il suffit de lancer la commande suivante : &lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo aptitude install screen&lt;/code&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;Ensuite, vous devrez renseigner un fichier ~/.screenrc&lt;/p&gt;
&lt;p&gt;Voici le contenu du screenrc que j'utilise. Si vous en avez des plus pratiques, n'hésitez pas à me les proposer ;) &lt;/p&gt;
&lt;code&gt;&lt;br /&gt;gbretou@gunix:~$ cat ~/.screenrc&lt;br /&gt;# Supprimer le message de dérrage&lt;br /&gt;startup_message off&lt;br /&gt;&lt;br /&gt;# Permettre un retour en arriè plus grand, par déut 100 lignes.&lt;br /&gt;defscrollback 35000&lt;br /&gt;&lt;br /&gt;# Afficher une barre bleue, avec en vert le nom de la machine en vert.&lt;br /&gt;# Suivi des screens dont en rouge la fenêe affichéen cours.&lt;br /&gt;# Avec la date et la charge du serveur.&lt;br /&gt;hardstatus on&lt;br /&gt;hardstatus alwayslastline &quot;%{= BG} %{..G}[%H] %{..W}% %-Lw%{.rW}%n+%f %t%{-}%+Lw %=%{..G}[%d/%m/%y %0c] [%l]&quot;&lt;br /&gt;# supprimer le clignotement de l'éan.&lt;br /&gt;vbell off&lt;br /&gt;autodetach on # permettre de se décher en cas de coupure.&lt;br /&gt;nonblock on # Si une fenêe ne rénd pas, ne pas bloquer toute la session en attendant une ré&lt;br /&gt;&lt;br /&gt;# On ouvre 3 screens au dérrage de screen&lt;br /&gt;# Le premier sera un terminal spéfique pour l'user root&lt;br /&gt;screen -t root&amp;nbsp; 0 su -&lt;br /&gt;# Le second est un terminal utilisateur de base&lt;br /&gt;screen -t bash1 1 bash&lt;br /&gt;# Le troisiè est aussi un terminal utilisateur de base&lt;br /&gt;screen -t bash2 2 bash&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;(&lt;a hreflang=&quot;fr&quot; href=&quot;http://www.informathic.com&quot;&gt;merci @informathic pour cet exemple de fichier&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Vous pouvez maintenant lancer screen avec la commande éponyme.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Vous verrez alors un terminal avec une barre en bas de page avec plusieurs couleurs. Cette barre contient les différents écrans qui existent pour votre session screen.&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;Pour naviguer à travers eux vous pouvez faire : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis X&lt;/code&gt; où X est le numéro de l'écran auquel vous souhaitez accéder (exemple ctrl a 1 pour accéder à l'écran 1)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Vous pouvez aller à l'écran suivant avec : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis n &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Et dans l'autre sens avec : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis p&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Pour créer un nouvel écran : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;screen &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;ou : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis c&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Pour fermer un écran (si vous fermez le dernier écran d'une session screen, la session termine automatiquement) : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;exit&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;ou &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis k&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Renommer un écran : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis A&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Pour scroller dans un écran : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis Echap&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Splitter un écran en deux régions : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis shift s&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;______________________________&lt;/p&gt;
&lt;p&gt;Supprimer une région d'un split : &lt;/p&gt;
&lt;p&gt;&lt;code&gt;ctrl a puis shift x &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Passer d'un split à l'autre : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis Tab &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Un split est comme un écran, vous avez donc accès aux mêmes commandes / combinaisons. C'est très pratique pour du dev ! &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Pour créer une nouvelle session screen en lui donnant un nom :&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;screen -S &quot;plop&quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Pour obtenir la liste des différents session screen : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;screen -ls &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Détacher un screen : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;screen -d &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;ou &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;ctrl a puis d&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Reprendre un screen : &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;screen -r&lt;/code&gt; (sans option s'il n'en existe qu'un seul ou le nom de la session si il y en a plusieurs)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;______________________________&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Effectivement, c'est un peu barbare vu comme ca. Mais vous apprendrez à le maitriser et vous rendrez rapidement compte de son caractère incontournable !&lt;/p&gt;
&lt;br /&gt;&lt;br /&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2010/11/05/%5BLinux%5D-Utilisation-de-screen#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2010/11/05/%5BLinux%5D-Utilisation-de-screen#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/41</wfw:commentRss>
      </item>
    
  <item>
    <title>[PHP] Yet Another Password generation class</title>
    <link>http://phpsymfony.com/index.php?post/2010/11/05/%5BPHP%5D-Yet-Another-Password-generation-class</link>
    <guid isPermaLink="false">urn:md5:87a1f008e79f2883d582107b2d73fe88</guid>
    <pubDate>Fri, 05 Nov 2010 09:18:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>PHP</category>
        <category>Classe</category><category>PHP</category>    
    <description>    &lt;p&gt;Voici une classe de génération de mots de passe que j'utilise.&lt;/p&gt;
&lt;p&gt;Cette classe, sans grande prétention, permet juste de générer un mot de passe en spécifiant 5 paramètres : &lt;/p&gt;
&lt;ul&gt;&lt;li&gt;un nombre de minuscules&lt;/li&gt;
&lt;li&gt;un nombre de majuscules&lt;/li&gt;
&lt;li&gt;un nombre de caractères numériques&lt;/li&gt;
&lt;li&gt;un nombre de caractères spéciaux&lt;/li&gt;
&lt;li&gt;un nombre de caractère total&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Une vérification est faite sur le nombre de caractères maximum, c'est-à-dire que la somme des quatre premiers paramètres ne doit pas être supérieur au dernier.&lt;/p&gt;
&lt;p&gt;Bien évidemment, si la somme des quatre premiers paramètres est inférieure au dernier paramètre, la classe va alors remplir aléatoirement le reste.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;J'ai inclus des exemples en fin de fichier.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;La classe est en annexe.&lt;/p&gt;
&lt;ins&gt;&lt;p&gt;Edit du 25/05&lt;/p&gt;
&lt;/ins&gt;&lt;p&gt;Suite à une remarque pertinente, j'ai réduit la plage des caractères spéciaux disponibles.&lt;/p&gt;</description>
    
          <enclosure url="http://phpsymfony.com/public/PasswordGenerator.class.zip"
      length="978" type="application/zip" />
    
    
          <comments>http://phpsymfony.com/index.php?post/2010/11/05/%5BPHP%5D-Yet-Another-Password-generation-class#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2010/11/05/%5BPHP%5D-Yet-Another-Password-generation-class#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/40</wfw:commentRss>
      </item>
    
  <item>
    <title>[jQuery] Liste des évènements sur un élément</title>
    <link>http://phpsymfony.com/index.php?post/2010/11/02/%5BjQuery%5D-Liste-des-%C3%A9v%C3%A8nements-sur-un-%C3%A9l%C3%A9ment</link>
    <guid isPermaLink="false">urn:md5:6625e222ab1b4c31253c6b3af8700e44</guid>
    <pubDate>Tue, 02 Nov 2010 13:06:00 +0000</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>jQuery</category>
            
    <description>    Grâce à la célèbre extension de Firefox, firebug, vous pouvez voir les évènements qui sont associés à un élément lorsque vous mettez des écouteurs avec jQuery.&lt;br /&gt;Pour se faire, utilisez la commande suivante : &lt;br /&gt;&lt;br /&gt;&lt;code&gt;$('#id').data( &quot;events&quot; );&lt;/code&gt;&lt;br /&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2010/11/02/%5BjQuery%5D-Liste-des-%C3%A9v%C3%A8nements-sur-un-%C3%A9l%C3%A9ment#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2010/11/02/%5BjQuery%5D-Liste-des-%C3%A9v%C3%A8nements-sur-un-%C3%A9l%C3%A9ment#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/38</wfw:commentRss>
      </item>
    
  <item>
    <title>[Vim] Coloration syntaxique sous vim</title>
    <link>http://phpsymfony.com/index.php?post/2010/10/18/%5BVim%5D-Coloration-syntaxique-sous-vi</link>
    <guid isPermaLink="false">urn:md5:2bc921939854ca47cddb1f56f36e07b7</guid>
    <pubDate>Mon, 18 Oct 2010 22:14:00 +0100</pubDate>
    <dc:creator>Guillaume Bretou</dc:creator>
        <category>Editeurs</category>
        <category>Linux</category><category>VI</category>    
    <description>    &lt;p&gt;Si comme moi, vous vous posez la question à chaque réinstallation de Linux, comment activer la coloration syntaxique avec Vim, voici comment faire&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;Editer votre fichier ~/.vimrc pour ajouter&lt;/p&gt;


&lt;p&gt;&lt;code&gt;syn on&lt;/code&gt;&lt;/p&gt;


&lt;p&gt;En espérant ne pas oublier la prochaine fois ;)&lt;/p&gt;</description>
    
    
    
          <comments>http://phpsymfony.com/index.php?post/2010/10/18/%5BVim%5D-Coloration-syntaxique-sous-vi#comment-form</comments>
      <wfw:comment>http://phpsymfony.com/index.php?post/2010/10/18/%5BVim%5D-Coloration-syntaxique-sous-vi#comment-form</wfw:comment>
      <wfw:commentRss>http://phpsymfony.com/index.php?feed/atom/comments/35</wfw:commentRss>
      </item>
    
</channel>
</rss>
