<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.ubuntu-fr.org/extern.php?action=feed&amp;tid=444794&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / /* Topic des codeurs couche-tard [4] */]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=444794</link>
		<description><![CDATA[Les sujets les plus récents dans /* Topic des codeurs couche-tard [4] */.]]></description>
		<lastBuildDate>Mon, 06 Jun 2011 18:48:33 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4861841#p4861841</link>
			<description><![CDATA[<p><a href="./viewtopic.php?id=527181">./viewtopic.php?id=527181</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Kanor)]]></author>
			<pubDate>Mon, 06 Jun 2011 18:48:33 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4861841#p4861841</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4860371#p4860371</link>
			<description><![CDATA[<p>Pour les raccourcis multimédia dans les VM, je pense que ce sont les VM qui communiquent via une interface DBUS avec les lecteurs multimédia… pas le lecteur lui même qui reçoit le raccourcis…</p>]]></description>
			<author><![CDATA[dummy@example.com (tshirtman)]]></author>
			<pubDate>Mon, 06 Jun 2011 17:14:42 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4860371#p4860371</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4859261#p4859261</link>
			<description><![CDATA[<div class="quotebox"><cite>Rolinh a écrit&#160;:</cite><blockquote><div><div class="quotebox"><cite>Кຼزດ a écrit&#160;:</cite><blockquote><div><p>Leur strlen reste quand même plus efficace.</p></div></blockquote></div><p>Plus efficace que quoi?</p></div></blockquote></div><p>Bah que la version naïve (mais certes lisible) qu&#039;utilisait BSD.<br />Et la raison est clairement expliqué dans la partie rationale de la nouvelle version de BSD (qui est celle de GNU en plus lisible).</p><div class="quotebox"><cite>Rolinh a écrit&#160;:</cite><blockquote><div><p>Sinon, ouais, j&#039;appuie Pylade: le GNU coding style saylemal.</p></div></blockquote></div><p>Pour ce qui est de la partie mise en forme, je plussoie fortement.<br />Pour le reste du <em>coding style</em> j&#039;ai un avis moins tranché, faut pas jeter le bébé avec l&#039;eau du bain…</p><br /><br /><div class="quotebox"><cite>Pylade a écrit&#160;:</cite><blockquote><div><p>@ Rolinh : j’étais tombé sur une version Gnu encore plus longe ; et surtout avec un appel à <em>malloc</em> dedans. J’ai été scandalisé (<em>malloc</em> peut échouer, or <em>strlen</em> n’est pas censé échouer).</p></div></blockquote></div><p>Heu source ??<br />Parce que efffectivement c&#039;est aberrant et pour le coup ça m&#039;étonne beaucoup <img src="http://forum.ubuntu-fr.org/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p><div class="quotebox"><cite>Pylade a écrit&#160;:</cite><blockquote><div><p>Sinon, pour la nouvelle version de FreeBSD, eux au moins ils expliquent l’algorithme utilisé. Cela dit, je ne suis pas fan du style utilisé pour l’implémentation, mais au moins ça se lit.</p></div></blockquote></div><p>Bah t&#039;es de mauvaise foi, la version GNU aussi explique l&#039;algo (sauf que l&#039;explication est aussi limpide que le code :]).</p>]]></description>
			<author><![CDATA[dummy@example.com (grim7reaper)]]></author>
			<pubDate>Mon, 06 Jun 2011 15:50:00 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4859261#p4859261</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4858821#p4858821</link>
			<description><![CDATA[<p>Plop,</p><p>demain j&#039;ai un examen de concepts et langages orientés objets. Il y a une notion assez importante qui n&#039;est pas bien expliquée dans mon cours et pour laquelle je trouve pas de bonne explication; celui des powertype.<br />Pour moi c&#039;est une métaclasse dont les instances sont une sous-classe d&#039;une classe donnée.<br />Par exemple, si je prend une voiture de marque &quot;Peugeot&quot;, je pourrais avoir comme powertype &quot;Modèle&quot; et les modèles seraient &quot;206&quot;, &quot;307&quot;, etc. <br />Mais bon, ça me semble un peu maigre comme explication et j&#039;ai l&#039;impression que le concept va un peu plus loin. Il me semble que des gens ont déjà parlé des powertype ici alors si quelqu&#039;un arrive à me fournir une brève explication ou un bon lien, ce serait avec plaisir <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /> .</p>]]></description>
			<author><![CDATA[dummy@example.com (Rolinh)]]></author>
			<pubDate>Mon, 06 Jun 2011 15:03:51 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4858821#p4858821</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4858341#p4858341</link>
			<description><![CDATA[<div class="quotebox"><cite>Pylade a écrit&#160;:</cite><blockquote><div><p>généralement il se logent dans le systray,</p></div></blockquote></div><p>C&#039;est ce que j&#039;entendais par fenêtre « icônifiée », même si je reconnais volontiers que ce n&#039;est absolument pas représentatif de ce qui se passe vraiment ^^</p><div class="quotebox"><cite>Pylade a écrit&#160;:</cite><blockquote><div><p>Mais là, c’est le WM qui gère le raccourci. <img src="http://forum.ubuntu-fr.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p></div></blockquote></div><p>Ou pas : quel que soit le WM, si gnome-panel ne tourne pas, ces deux raccourcis ne font rien (ou font une autre tâche qui leur a été assignée par un autre moyen). En revanche, quel que soit le WM, une fois gnome-panel lancé (et à condition que le raccourcis ne soit pas déjà réquisitionnés par autre chose, p&#039;t&#039;être), ça marche : c&#039;est donc bien gnome-panel qui gère ça et pas le WM.</p><p>Ou alors, peut-être que gnome-panel demande au WM de les gérer pour lui, et dans ce cas, ce que je ne sais pas faire se reformule en « demander au WM de gérer des raccourcis clavier pour moi ». Mais ça revient très exactement au même, ce n&#039;est qu&#039;une formulation reflétant la manière de procéder qui est justement l&#039;inconnue.</p><div class="quotebox"><cite>Kanor a écrit&#160;:</cite><blockquote><div><p>pylade regarde la commande xprop</p></div></blockquote></div><p>J&#039;viens d&#039;essayer en vitesse, mais je n&#039;ai pas trouvé de ligne indiquant le display. Peut-être n&#039;y en a-t-il une que pour les fenêtres n&#039;utilisant pas le display par défaut, ou alors peut-être est-ce que j&#039;ai juste mal choisi mon exemple.</p><p>Mais dans l&#039;écrasante majorité des cas, toutes les fenêtres ont :0.0 comme display, non ?</p>]]></description>
			<author><![CDATA[dummy@example.com (Elzen)]]></author>
			<pubDate>Mon, 06 Jun 2011 14:36:21 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4858341#p4858341</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4858331#p4858331</link>
			<description><![CDATA[<p>pylade regarde la commande xprop</p>]]></description>
			<author><![CDATA[dummy@example.com (Kanor)]]></author>
			<pubDate>Mon, 06 Jun 2011 14:36:19 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4858331#p4858331</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4858001#p4858001</link>
			<description><![CDATA[<div class="quotebox"><cite>ArkSeth a écrit&#160;:</cite><blockquote><div><div class="quotebox"><cite>Pylade a écrit&#160;:</cite><blockquote><div><p>Il ne me semble pas que cela soit possible ; et c’est une bonne chose. Sinon, ça serait un bordel innomable.</p></div></blockquote></div><p>Pour autant que je sache, les gestionnaire de raccourcis claviers comme xbindkeys n&#039;ont pas de fenêtre active en permanence.</p></div></blockquote></div><p>Je ne connais pas, mais il ne me semblerai pas délirant que ce soit la fenêtre racine qui hérite des raccourcis clavier, voire que ça communique avec le WM.</p><br /><div class="quotebox"><cite>ArkSeth a écrit&#160;:</cite><blockquote><div><p>Et ce n&#039;est généralement pas le gnome-panel qui a le focus quand on lance Alt+F1 ou Alt+F2 <img src="http://forum.ubuntu-fr.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p></div></blockquote></div><p>Mais là, c’est le WM qui gère le raccourci. <img src="http://forum.ubuntu-fr.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><br /><div class="quotebox"><cite>ArkSeth a écrit&#160;:</cite><blockquote><div><p>Ni les lecteurs musicaux comme AmaroK, auxquels on peut pourtant associer des raccourcis clavier pour lancer/arrêter la musique quand la fenêtre est icônifiée.</p></div></blockquote></div><p>Hum, c’est étrange. Ils se servent peut-être du systray (parce que les lecteurs musicaux, généralement il se logent dans le systray, pour ceux que je connais), et je sais que les applications dans le systray peuvent avoir leur raccourcis clavier (Parcellite en est le plus bel exemple). Si t’es motivé, tu peux regarder les sources. <img src="http://forum.ubuntu-fr.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><br /><p>Sinon, je suis super content : je crois avoir trouvé le moyen de contrôler la disposition de clavier d’une fenêtre en particulier. Il ne me reste plus qu’à savoir comment trouver le <em>display</em> d’une fenêtre.</p>]]></description>
			<author><![CDATA[dummy@example.com (Πυλάδης)]]></author>
			<pubDate>Mon, 06 Jun 2011 14:05:14 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4858001#p4858001</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4857731#p4857731</link>
			<description><![CDATA[<div class="quotebox"><cite>Pylade a écrit&#160;:</cite><blockquote><div><p>Il ne me semble pas que cela soit possible ; et c’est une bonne chose. Sinon, ça serait un bordel innomable.</p></div></blockquote></div><p>Pour autant que je sache, les gestionnaire de raccourcis claviers comme xbindkeys n&#039;ont pas de fenêtre active en permanence.<br />Ni les lecteurs musicaux comme AmaroK, auxquels on peut pourtant associer des raccourcis clavier pour lancer/arrêter la musique quand la fenêtre est icônifiée.<br />Et ce n&#039;est généralement pas le gnome-panel qui a le focus quand on lance Alt+F1 ou Alt+F2 <img src="http://forum.ubuntu-fr.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Elzen)]]></author>
			<pubDate>Mon, 06 Jun 2011 13:42:57 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4857731#p4857731</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4857691#p4857691</link>
			<description><![CDATA[<p>@ Rolinh : j’étais tombé sur une version Gnu encore plus longe ; et surtout avec un appel à <em>malloc</em> dedans. J’ai été scandalisé (<em>malloc</em> peut échouer, or <em>strlen</em> n’est pas censé échouer).</p><p>Sinon, pour la nouvelle version de FreeBSD, eux au moins ils expliquent l’algorithme utilisé. Cela dit, je ne suis pas fan du style utilisé pour l’implémentation, mais au moins ça se lit.</p><br /><div class="quotebox"><cite>ArkSeth a écrit&#160;:</cite><blockquote><div><p>[…] vu que j&#039;sais toujours pas écouter les raccourcis clavier depuis une fenêtre qui n&#039;a pas le focus […]</p></div></blockquote></div><p>Il ne me semble pas que cela soit possible ; et c’est une bonne chose. Sinon, ça serait un bordel innomable.</p><br /><p>@Koin : il n’y a pas un moyen pour que DuckDuckGo affiche le nombre de résultats pour une requête ?</p>]]></description>
			<author><![CDATA[dummy@example.com (Πυλάδης)]]></author>
			<pubDate>Mon, 06 Jun 2011 13:37:33 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4857691#p4857691</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4857471#p4857471</link>
			<description><![CDATA[<p>Kupo les gens, j&#039;ai un petit soucis en PyGTK…</p><p>J&#039;essaye de faire en sorte qu&#039;une action extérieure (pour être précis, un sed sur un fichier destiné à être mis comme action sur un bouton ou sur un raccourcis clavier (vu que j&#039;sais toujours pas écouter les raccourcis clavier depuis une fenêtre qui n&#039;a pas le focus)) fasse s&#039;afficher mon menu principal.</p><p>J&#039;ai donc mon panel principal (fenêtre non-focusable), qui contient une gtk.MenuBar, contenant elle-même le gtk.MenuItem (gtk.ImageMenuItem, même, mais j&#039;crois pas que ça change grand chose) qui ouvre le menu principal, et optionnellement un autre gtk.MenuItem contenant lui un menu spécifique à la fenêtre active.<br />Je récupère bien l&#039;événement que je veux, pas de soucis là-dessus. Par contre, c&#039;est au niveau de l&#039;activation du menu que j&#039;ai quelques soucis.</p><p>Soit je fais</p><div class="codebox"><pre><code>item.select()</code></pre></div><p>et dans ce cas, l&#039;item est sélectionné, le menu s&#039;affiche, il y a des soucis de maniement :<br />– Ça semble avoir du mal à s&#039;enclencher pour la gestion au clavier (il faut que j&#039;appuie sur la touche directionnelle gauche, ou un truc comme ça, avant de pouvoir me déplacer de haut en bas dans le menu).<br />– Toujours pour la gestion au clavier, quand on appuie sur echap, le menu se ferme, mais l&#039;item principal reste en surbrillance.<br />– À la souris, les items se mettent bien en surbrillance au survol, mais le clic n&#039;a pas l&#039;air de marcher.</p><p>Soit je fais</p><div class="codebox"><pre><code>item.get_submenu().popup(menubar, item, move_menu, 0, 0)</code></pre></div><p>et dans ce cas,<br />– l&#039;item ne se met pas en surbrillance tout seul.<br />– il y a le même genre de soucis pour le déplacement au clavier dans les entrées<br />– quand on appuie sur echap, le menu disparaît, mais le truc garde le focus complet jusqu&#039;à ce qu&#039;on vienne cliquer (n&#039;importe où) avec la souris.</p><p>Soit je fais</p><div class="codebox"><pre><code>item.get_submenu().popup(None, None, move_menu, 0, 0)</code></pre></div><p>et dans ce cas, aucun soucis de maniement, mais l&#039;item ne se met pas en surbrillance, et je ne peux pas activer au clavier le second item de la barre de menu s&#039;il est présent.</p><p>Verriez-vous une autre manière de procéder/un complément pour améliorer les choses ?</p>]]></description>
			<author><![CDATA[dummy@example.com (Elzen)]]></author>
			<pubDate>Mon, 06 Jun 2011 13:16:09 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4857471#p4857471</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4856821#p4856821</link>
			<description><![CDATA[<p>Wow <img src="http://forum.ubuntu-fr.org/img/smilies/yikes.png" width="15" height="15" alt="yikes" /><br />Juste énorme le :</p><div class="quotebox"><blockquote><div><p>First off, I&#039;d suggest printing out a copy of the GNU coding standards,<br />and NOT read it.&#160; Burn them, it&#039;s a great symbolic gesture.</p></div></blockquote></div><p>...</p><p><img src="http://forum.ubuntu-fr.org/img/smilies/lol.png" width="15" height="15" alt="lol" /></p>]]></description>
			<author><![CDATA[dummy@example.com (:!pakman)]]></author>
			<pubDate>Mon, 06 Jun 2011 12:12:50 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4856821#p4856821</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4853381#p4853381</link>
			<description><![CDATA[<div class="quotebox"><cite>Кຼزດ a écrit&#160;:</cite><blockquote><div><p>Leur strlen reste quand même plus efficace.</p></div></blockquote></div><p>Plus efficace que quoi?</p><p>Sinon, ouais, j&#039;appuie Pylade: le GNU coding style saylemal.<br />D&#039;ailleurs, au cas où tu ne connaissais pas ce célèbre passage du Linux Kernel coding style, deuxième paragraphe:</p><div class="quotebox"><blockquote><div><p>First off, I&#039;d suggest printing out a copy of the GNU coding standards,<br />and NOT read it.&#160; Burn them, it&#039;s a great symbolic gesture.</p></div></blockquote></div><p>Sinon, bah, je crois que l&#039;exemple de strlen cité par Pylade parle de lui-même:<br /><a href="http://sourceware.org/cgi-bin/cvsweb.cgi/libc/string/strlen.c?cvsroot=glibc&amp;rev=1.1.2.1">strlen</a> GNU:</p><div class="codebox"><pre class="vscroll"><code>#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;

#undef strlen

/* Return the length of the null-terminated string STR.  Scan for
   the null terminator quickly by testing four bytes at a time.  */
size_t
strlen (str)
     const char *str;
{
  const char *char_ptr;
  const unsigned long int *longword_ptr;
  unsigned long int longword, himagic, lomagic;

  /* Handle the first few characters by reading one character at a time.
     Do this until CHAR_PTR is aligned on a longword boundary.  */
  for (char_ptr = str; ((unsigned long int) char_ptr
            &amp; (sizeof (longword) - 1)) != 0;
       ++char_ptr)
    if (*char_ptr == &#039;\0&#039;)
      return char_ptr - str;

  /* All these elucidatory comments refer to 4-byte longwords,
     but the theory applies equally well to 8-byte longwords.  */

  longword_ptr = (unsigned long int *) char_ptr;

  /* Bits 31, 24, 16, and 8 of this number are zero.  Call these bits
     the &quot;holes.&quot;  Note that there is a hole just to the left of
     each byte, with an extra at the end:

     bits:  01111110 11111110 11111110 11111111
     bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD

     The 1-bits make sure that carries propagate to the next 0-bit.
     The 0-bits provide holes for carries to fall into.  */
  himagic = 0x80808080L;
  lomagic = 0x01010101L;
  if (sizeof (longword) &gt; 4)
    {
      /* 64-bit version of the magic.  */
      /* Do the shift in two steps to avoid a warning if long has 32 bits.  */
      himagic = ((himagic &lt;&lt; 16) &lt;&lt; 16) | himagic;
      lomagic = ((lomagic &lt;&lt; 16) &lt;&lt; 16) | lomagic;
    }
  if (sizeof (longword) &gt; 8)
    abort ();

  /* Instead of the traditional loop which tests each character,
     we will test a longword at a time.  The tricky part is testing
     if *any of the four* bytes in the longword in question are zero.  */
  for (;;)
    {
      longword = *longword_ptr++;

      if (((longword - lomagic) &amp; ~longword &amp; himagic) != 0)
    {
      /* Which of the bytes was the zero?  If none of them were, it was
         a misfire; continue the search.  */

      const char *cp = (const char *) (longword_ptr - 1);

      if (cp[0] == 0)
        return cp - str;
      if (cp[1] == 0)
        return cp - str + 1;
      if (cp[2] == 0)
        return cp - str + 2;
      if (cp[3] == 0)
        return cp - str + 3;
      if (sizeof (longword) &gt; 4)
        {
          if (cp[4] == 0)
        return cp - str + 4;
          if (cp[5] == 0)
        return cp - str + 5;
          if (cp[6] == 0)
        return cp - str + 6;
          if (cp[7] == 0)
        return cp - str + 7;
        }
    }
    }
}
libc_hidden_builtin_def (strlen)</code></pre></div><p><a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/string/strlen.c?rev=1.4">strlen</a> FreeBSD:</p><div class="codebox"><pre><code>#include &lt;sys/cdefs.h&gt;
#include &lt;string.h&gt;

size_t
strlen(str)
    const char *str;
{
    register const char *s;

    for (s = str; *s; ++s);
    return(s - str);
}</code></pre></div><p>Au passage, note le coding style affreux de GNU <img src="http://forum.ubuntu-fr.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><p>EDIT: en fait, FreeBSD a fait une révision de son <a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/string/strlen.c?rev=1.10">strlen</a> l&#039;année passée:</p><div class="codebox"><pre class="vscroll"><code>#include &lt;sys/cdefs.h&gt;
__FBSDID(&quot;$FreeBSD: src/lib/libc/string/strlen.c,v 1.10 2010/03/13 00:15:06 delphij Exp $&quot;);

#include &lt;sys/limits.h&gt;
#include &lt;sys/types.h&gt;
#include &lt;string.h&gt;

/*
 * Portable strlen() for 32-bit and 64-bit systems.
 *
 * Rationale: it is generally much more efficient to do word length
 * operations and avoid branches on modern computer systems, as
 * compared to byte-length operations with a lot of branches.
 *
 * The expression:
 *
 *    ((x - 0x01....01) &amp; ~x &amp; 0x80....80)
 *
 * would evaluate to a non-zero value iff any of the bytes in the
 * original word is zero.
 *
 * On multi-issue processors, we can divide the above expression into:
 *    a)  (x - 0x01....01)
 *    b) (~x &amp; 0x80....80)
 *    c) a &amp; b
 *
 * Where, a) and b) can be partially computed in parallel.
 *
 * The algorithm above is found on &quot;Hacker&#039;s Delight&quot; by
 * Henry S. Warren, Jr.
 */

/* Magic numbers for the algorithm */
#if LONG_BIT == 32
static const unsigned long mask01 = 0x01010101;
static const unsigned long mask80 = 0x80808080;
#elif LONG_BIT == 64
static const unsigned long mask01 = 0x0101010101010101;
static const unsigned long mask80 = 0x8080808080808080;
#else
#error Unsupported word size
#endif

#define    LONGPTR_MASK (sizeof(long) - 1)

/*
 * Helper macro to return string length if we caught the zero
 * byte.
 */
#define testbyte(x)                \
    do {                    \
        if (p[x] == &#039;\0&#039;)        \
            return (p - str + x);    \
    } while (0)

size_t
strlen(const char *str)
{
    const char *p;
    const unsigned long *lp;
    long va, vb;

    /*
     * Before trying the hard (unaligned byte-by-byte access) way
     * to figure out whether there is a nul character, try to see
     * if there is a nul character is within this accessible word
     * first.
     *
     * p and (p &amp; ~LONGPTR_MASK) must be equally accessible since
     * they always fall in the same memory page, as long as page
     * boundaries is integral multiple of word size.
     */
    lp = (const unsigned long *)((uintptr_t)str &amp; ~LONGPTR_MASK);
    va = (*lp - mask01);
    vb = ((~*lp) &amp; mask80);
    lp++;
    if (va &amp; vb)
        /* Check if we have \0 in the first part */
        for (p = str; p &lt; (const char *)lp; p++)
            if (*p == &#039;\0&#039;)
                return (p - str);

    /* Scan the rest of the string using word sized operation */
    for (; ; lp++) {
        va = (*lp - mask01);
        vb = ((~*lp) &amp; mask80);
        if (va &amp; vb) {
            p = (const char *)(lp);
            testbyte(0);
            testbyte(1);
            testbyte(2);
            testbyte(3);
#if (LONG_BIT &gt;= 64)
            testbyte(4);
            testbyte(5);
            testbyte(6);
            testbyte(7);
#endif
        }
    }

    /* NOTREACHED */
    return (0);
}</code></pre></div><p>EDIT: il faudrait lancer le 6e topic non?</p>]]></description>
			<author><![CDATA[dummy@example.com (Rolinh)]]></author>
			<pubDate>Mon, 06 Jun 2011 07:48:06 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4853381#p4853381</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4852601#p4852601</link>
			<description><![CDATA[<p>Scores de la période en cours :</p><div class="codebox"><pre><code>1) 50    Pylade
2) 31    cm-t
3) 26    Кຼزດ
4) 24    nesthib
5) 22    samuncle
6) 15    tshirtman
7) 13    na kraïou
8) 9    Rolinh
9) 5    grim7reaper
9) 5    :!pakman
11) 4    \\Ouranos//
11) 4    The Uploader
11) 4    kamui57</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Compteur du TdCCT)]]></author>
			<pubDate>Mon, 06 Jun 2011 05:42:23 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4852601#p4852601</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4852591#p4852591</link>
			<description><![CDATA[<p>Scores totaux, depuis le début :</p><div class="codebox"><pre class="vscroll"><code>1) 3428    nesthib
2) 3065    samuncle
3) 2893    Pylade
4) 2178    Кຼزດ
5) 1698+5  grim7reaper /* ./viewtopic.php?pid=3486252#p3486252 */
6) 1668    cm-t
7) 1292    na kraïou
8) 866    helly
9) 862    \\Ouranos//
10) 659    gnuuat
11) 588    tshirtman
12) 565    Lagierl
13) 428    Rolinh
14) 352    The Uploader
15) 348    nathéo
16) 263    Kanor
17) 196    Askelon
18) 171    :!pakman
19) 121    ǤƦƯƝƬ
20) 99    kamui57
21) 93    petifrancais
22) 78    edge_one
22) 78    pierguiard
24) 70    gulp
25) 42    sakul
26) 39    Le Rouge
27) 37    ilagas
28) 33    xapantu
29) 30    keny
30) 26    gustare
30) 26    d10g3n
32) 25    GentooUser
32) 25    Morgiver
34) 24    ไ୦บเઢ&#039;
34) 24    Steap
36) 20    CROWD
37) 18    Ph3nix_
38) 16    kouskous
39) 15    timsy
40) 12    stratoboy
40) 12    sailing
42) 11    alexises
42) 11    Crocoii
44) 10    Toineo
44) 10    NutMotion
44) 10    pseudovingtcinqcaracteres
44) 10    pfriedZ
44) 10    CasseTaTele
44) 10    Zeibux
44) 10    THS`
51) 8    Mornagest
52) 7    Vista
53) 6    ubuntlin
53) 6    asma.geek
55) 5    tendances-tdct
55) 5    kinouchou
57) 4    danychou56
57) 4    Neros
57) 4    Biaise
57) 4    totoflute
57) 4    pinballyoda ㋛
57) 4    NLS le pingouin
57) 4    ceric
57) 4    Dice-Man
65) 3    Revan26914
65) 3    raspouillas
65) 3    sweetly
68) 2    SoJaS
69) 1    geenux
69) 1    ArzhurBZH</code></pre></div><p><span class="postimg"><img src="http://chart.apis.google.com/chart?chs=675x280&amp;cht=p3&amp;chco=d80020,d88000,ffd840,20d820,2080ff,101080,a020d8&amp;chf=bg,s,00000000&amp;chl=00h%20-%2000h59|01h%20-%2001h59|02h%20-%2002h59|07h%20-%2007h59|10h%20-%2010h59|11h%20-%2011h59|17h%20-%2017h59|21h%20-%2021h59&amp;chd=t:3,6,2,2,1,1,1,2&amp;chp=1.6&amp;chtt=R%C3%A9partition%20des%20posts&amp;chts=606060,16" alt="Répartition" /></span><span class="postimg"><img src="http://chart.apis.google.com/chart?chs=675x280&amp;cht=bvs&amp;chxt=x,y&amp;chds=0,10&amp;chxr=1,0,10&amp;chf=b0,lg,0,803000,0,ffc080,1|bg,s,00000000&amp;chxl=0:|05h|06h|07h|08h|09h|10h|11h|12h|13h|14h|15h|16h|17h|18h|19h|20h|21h|22h|23h|00h|01h|02h|03h|04h&amp;chxp=0,0.7,4.9,9.1,13.2,17.3,21.5,25.6,29.8,33.9,38,42.2,46.3,50.5,54.6,58.8,62.9,67,71.2,75.3,79.4,83.6,87.7,91.8,96&amp;chd=t:0,0,2,0,0,1,1,0,0,0,0,0,1,0,0,0,2,0,0,3,6,2,0,0&amp;chm=N,803000,0,-1,12&amp;chtt=|Nombre%20de%20posts%20par%20heure&amp;chts=606060,16" alt="Posts/heure" /></span></p>]]></description>
			<author><![CDATA[dummy@example.com (Compteur du TdCCT)]]></author>
			<pubDate>Mon, 06 Jun 2011 05:42:09 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4852591#p4852591</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  /* Topic des codeurs couche-tard [4] */]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=4852071#p4852071</link>
			<description><![CDATA[<p>Tiens, python fait un truc bizarre au niveau du garbage collector…</p><p>Genre j&#039;ajoutais dans un conteneur GTK un composant venu d&#039;un autre module que j&#039;avais juste récupéré directement (pas de variable dans le module qui faisait l&#039;ajout), puis pour tester les options, je le virais et je le remettais, et le truc avait été détruit entre temps.</p><p>Du coup j&#039;ai fait autrement, mais ç&#039;t&#039;un peu bizarre quand même.</p>]]></description>
			<author><![CDATA[dummy@example.com (Elzen)]]></author>
			<pubDate>Mon, 06 Jun 2011 00:36:33 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=4852071#p4852071</guid>
		</item>
	</channel>
</rss>
