<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hyperthèse</title>
	<atom:link href="http://hyperthese.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://hyperthese.net</link>
	<description>La connaissance supposée fausse</description>
	<lastBuildDate>Mon, 08 Mar 2010 22:09:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nokia Secret Codes</title>
		<link>http://hyperthese.net/nokia-secret-codes/</link>
		<comments>http://hyperthese.net/nokia-secret-codes/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 22:09:14 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[Nokia]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=273</guid>
		<description><![CDATA[Un truc cool avec les téléphones Nokia, c&#8217;est leurs codes secrets. Si on fait le tour du net et du code source de Symbian, on peut trouver les codes suivants (pour info j&#8217;ai un N97 mini) :
*#06# Imei Code
Affiche le code IMEI du téléphone.
*#0000# Sw Version
Affiche des infos sur le firmware : version, date, nombre [...]]]></description>
			<content:encoded><![CDATA[<p>Un truc cool avec les téléphones Nokia, c&#8217;est leurs codes secrets. Si on fait le tour du net et du code source de Symbian, on peut trouver les codes suivants (pour info j&#8217;ai un N97 mini) :</p>
<p><strong>*#06#</strong> Imei Code<br />
Affiche le code IMEI du téléphone.</p>
<p><strong>*#0000#</strong> Sw Version<br />
Affiche des infos sur le firmware : version, date, nombre de langues, modèle, date de mise à jour, &#8230;</p>
<p><strong>**04*</strong> Bad Pin Change<br />
Pas d&#8217;infos, quand testé aucune action.</p>
<p><strong>**042*</strong> Bad Pin2 Change<br />
Pas d&#8217;infos, quand testé aucune action.</p>
<p><strong>**05*</strong> Bad Pin Unblock<br />
Pas d&#8217;infos, quand testé aucune action.</p>
<p><strong>**052*</strong> Bad Pin2 Unblock<br />
Pas d&#8217;infos, quand testé aucune action.</p>
<p><strong>*#7780#</strong> Activate Rfs Normal<br />
&#8220;Reset Factory Settings&#8221;, remise à zero &#8220;soft&#8221;.</p>
<p><strong>*#7370#</strong> Activate Rfs Deep<br />
&#8220;Reset Factory Settings&#8221;, remise à zero &#8220;hard&#8221;.</p>
<p><strong>*#2820#</strong> Bt Adress<br />
Affiche l&#8217;adresse MAC du Bluetooth (en théorie, car sur le miens n&#8217;affiche que &#8220;Bluetooth address:&#8221;, sans l&#8217;adresse elle même).</p>
<p><strong>*#92702689#</strong> Life Timer<br />
Affiche la durée de vie. Sur le N97 mini, est affiché le temps total passé en conversation.</p>
<p><strong>*#9990#</strong> RF Loopback<br />
Manifestement, active un mode de test du Bluetooth. J&#8217;ai un message &#8220;Bluetooth test mode&#8221; qui s&#8217;affiche, mais rien de plus ne se passe.</p>
<p><strong>*#62209526#</strong> WLAN MAC<br />
Affiche l&#8217;adresse MAC de la carte wifi.</p>
<p><strong>*#2873</strong># Bt Debug Mode<br />
Je présume qu&#8217;il s&#8217;agit d&#8217;un mode de test du bluetooth, cependant sur mon téléphone cela n&#8217;entraîne aucune action.</p>
<p>Et on ajoute à ça les astuces habituelles :</p>
<ul>
<li>Appuyer 3 secondes sur la touche du menu fait apparaître la liste des applications ouvertes.</li>
<li>Appuyer 3 secondes sur &#8220;0&#8243; fait apparaître le navigateur web.</li>
<li>Appuyer 3 secondes sur &#8220;#&#8221; passe en mode sliencieux (ou retourne en mode général).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/nokia-secret-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mise à jour d&#8217;Apache dans Sid&#8230;</title>
		<link>http://hyperthese.net/mise-a-jour-dapache-dans-sid/</link>
		<comments>http://hyperthese.net/mise-a-jour-dapache-dans-sid/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 13:37:04 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=269</guid>
		<description><![CDATA[Certains scripts PHP (par exemple Symfony) dépendent lourdement du fait que si on demande la page http://truc/machin.php/bidule/chose, et que http://truc/machin.php est un fichier PHP, alors c&#8217;est ce fichier qui est appellé. Le souci, c&#8217;est que dans lors de la dernière mise à jour d&#8217;Apache dans Sid, ça ne marche plus&#8230;
En fait ce comportement est lié [...]]]></description>
			<content:encoded><![CDATA[<p>Certains scripts PHP (par exemple Symfony) dépendent lourdement du fait que si on demande la page http://truc/machin.php/bidule/chose, et que http://truc/machin.php est un fichier PHP, alors c&#8217;est ce fichier qui est appellé. Le souci, c&#8217;est que dans lors de la dernière mise à jour d&#8217;Apache dans Sid, ça ne marche plus&#8230;</p>
<p>En fait ce comportement est lié à une directive de configuration <a href="http://httpd.apache.org/docs/2.2/mod/core.html#acceptpathinfo" target="_blank">AcceptPathInfo</a>, qu&#8217;il faut placer à On.</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/mise-a-jour-dapache-dans-sid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>But It&#8217;s Not Google</title>
		<link>http://hyperthese.net/but-its-not-google/</link>
		<comments>http://hyperthese.net/but-its-not-google/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 00:13:43 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=265</guid>
		<description><![CDATA[J&#8217;hésite encore, Bing veut-il dire &#8220;But It&#8217;s Not Google&#8221;, ou est-ce le bruit que ça fait quand on tape dessus ? J&#8217;aimais déjà pas Bing, mais là où on se rend compte que c&#8217;est vraiment de la merde, c&#8217;est que cet abruti a réussi à indexer localhost&#8230; Mais quel con ce Bing !
Autre détail intéressant, [...]]]></description>
			<content:encoded><![CDATA[<p>J&#8217;hésite encore, Bing veut-il dire &#8220;But It&#8217;s Not Google&#8221;, ou est-ce le bruit que ça fait quand on tape dessus ? J&#8217;aimais déjà pas Bing, mais là où on se rend compte que c&#8217;est vraiment de la merde, c&#8217;est que cet abruti a réussi à <a href="http://www.bing.com/search?q=site:localhost">indexer localhost</a>&#8230; Mais quel con ce Bing !</p>
<p>Autre détail intéressant, Bing a réussi à indexer 1250 pages sur ce blog&#8230; Contrairement à 165 pour Google. On se demande lequel des deux va fournir les résultats les plus pertinents&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/but-its-not-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Putain de clavier</title>
		<link>http://hyperthese.net/putain-de-clavier/</link>
		<comments>http://hyperthese.net/putain-de-clavier/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 00:17:27 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=259</guid>
		<description><![CDATA[J&#8217;avais jusque peu un combo clavier/souris sans fil d&#8217;une sous marque chinoise qui me plaisait tout à fait, sauf que après 3 ans de bons et loyaux services, les deux se sont mis à ne plus trop marcher comme il fallait. Alors j&#8217;me suis mis en quête d&#8217;une nouvelle paire de clavier/souris.
Pour la souris ça [...]]]></description>
			<content:encoded><![CDATA[<p>J&#8217;avais jusque peu un combo clavier/souris sans fil d&#8217;une sous marque chinoise qui me plaisait tout à fait, sauf que après 3 ans de bons et loyaux services, les deux se sont mis à ne plus trop marcher comme il fallait. Alors j&#8217;me suis mis en quête d&#8217;une nouvelle paire de clavier/souris.</p>
<p>Pour la souris ça a été vite vu, pour Noël on m&#8217;a offert une grosse souris de PGM avec radiateur intégré, ça c&#8217;était nickel. Par contre, pour le clavier&#8230; Quelle horreur !</p>
<p>Déjà, impossible de trouver un magasin où on peut essayer un clavier. Le seul endroit où j&#8217;ai trouvé suffisament de claviers libre à l&#8217;essai, c&#8217;était Boulanger. Alors me voilà parti pour tester tous les clavier du magasin. On remarque que :</p>
<ul>
<li>Ces connards de Logitech ont planqué la touche Inser pour que la touche Suppr fasse 2 touches de haut. Comment vous voulez utiliser vim avec ça ?</li>
<li>Peu importe la gamme, le toucher est horrible, le retour des touches est naze,&nbsp;&#8230; Même un clavier haut de gamme à 250€ ne vaut pas grand chose sur ce plan là.</li>
<li>Les dispositions de clavier deviennent n&#8217;importe quoi. Entre les constructeurs qui prennent des dispositions de clavier d&#8217;ordinateur portable (c&#8217;est débile, on achète pas un clavier de bureau pour qu&#8217;il soit condensé et pas pratique&#8230;), et les constructeurs qui nous font des concepts bizarre du style un pavé numérique détachable sans fil&#8230;</li>
</ul>
<p>Bref, les claviers c&#8217;est devenu de la merde. Le seul truc que j&#8217;ai trouvé de potable à Boulanger, c&#8217;était le Listo le plus bas de gamme possible, qui était le seul clavier à respecter la disposition standard des touches&#8230; En tout cas j&#8217;ai fini par aller sur le site de Dell pour acheter le clavier OEM qu&#8217;ils donnent avec leurs serveurs, car celui ci il est génial <img src='http://hyperthese.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  : un clavier 100% standard avec des touches aux bon emplacements, un toucher nickel et tout et tout. Bref, vive les clavier Dell, dernier survivants d&#8217;une ère révolue où les claviers étaient agréables&#8230;</p>
<p>Je sais que ça fait très post sponsorisé, mais j&#8217;vous promet que je gagne pas un centime, c&#8217;est juste que j&#8217;en ai vraiment marre des constructeurs qui font de la merde, et que j&#8217;me sentais de le crier sur tous les toits. D&#8217;ailleurs la prochaine fois, on parlera des imprimantes et de l&#8217;ethernet&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/putain-de-clavier/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Statut de connexion dans PHP</title>
		<link>http://hyperthese.net/statut-de-connexion-dans-php/</link>
		<comments>http://hyperthese.net/statut-de-connexion-dans-php/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 16:59:04 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Trucs et astuces]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=254</guid>
		<description><![CDATA[Ces derniers je fais un peu de push en HTTP, donc une information importante pour moi est le statut de connexion. En théorie cette information m&#8217;est donnée par la fonction connection_status(). Mais il faut savoir comment PHP connait ce statut (je n&#8217;ai regardé que pour le mod_php5 de apache et le cgi, mais c&#8217;est probablement [...]]]></description>
			<content:encoded><![CDATA[<p>Ces derniers je fais un peu de push en HTTP, donc une information importante pour moi est le statut de connexion. En théorie cette information m&#8217;est donnée par la fonction <a href="http://fr.php.net/connection_status">connection_status()</a>. Mais il faut savoir comment PHP connait ce statut (je n&#8217;ai regardé que pour le mod_php5 de apache et le cgi, mais c&#8217;est probablement vrai dans les autres cas) : en fait, le serveur web n&#8217;envoit jamais de signal à PHP pour dire &#8220;hop c&#8217;est bon on n&#8217;a plus besoin de toi ta gueule&#8221; quand l&#8217;utilisateur ferme sa connexion. PHP ne se rend compte de la fermeture de la connexion uniquement quand il tente d&#8217;envoyer des données au serveur, car le serveur lui dit &#8220;non je peux pas écrire les données, la connexion est fermée&#8221;.</p>
<p>En d&#8217;autres termes, si vous attendez un évènement (grâce à une fonction bloquante par exemple), même si vous appellez régulièrement la fonction <a href="http://fr.php.net/connection_status">connection_status()</a> le résultat sera faux car vous n&#8217;avez envoyé aucune donnée. Et encore plus grave, si vous attendez votre évènement avec une fonction bloquante, le processus passe en mode S (sleep), ce qui fait que le temps est <em>stoppé</em>, et que le <a href="http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time">max_execution_time</a> n&#8217;est jamais atteint : le processus reste bloqué là éternellmement. Face à ça, pas beaucoup de solutions&#8230; Vous pouvez envoyer un espace chaque seconde (en n&#8217;obliant pas d&#8217;appeller <a href="http://fr.php.net/manual/en/function.ob-flush.php">ob_flush()</a> et <a href="http://fr.php.net/manual/en/function.flush.php">flush()</a>), ou alors vous pouvez faire des timeouts et faire en sorte que le client refasse une requête juste après, ou autre hack du genre&#8230; Vous pouvez aussi vous passer de PHP, mais ça c&#8217;est une autre histoire <img src='http://hyperthese.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/statut-de-connexion-dans-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TeamSpeak Proxy</title>
		<link>http://hyperthese.net/teamspeak-proxy/</link>
		<comments>http://hyperthese.net/teamspeak-proxy/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 14:30:30 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Serveurs]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=248</guid>
		<description><![CDATA[Si vous êtes un administrateur système, et que vous avez la gentillesse de bien vouloir laisser TeamSpeak passer sur votre firewall pour les pauvres étudiants de la résidence dont vous êtes l&#8217;administrateur qui ne pourraient sinon pas passer leur temps à jouer à WoW au lieu de travailler, alors vous avez probablement comme moi remarqué [...]]]></description>
			<content:encoded><![CDATA[<p>Si vous êtes un administrateur système, et que vous avez la gentillesse de bien vouloir laisser <a href="http://www.teamspeak.com/">TeamSpeak</a> passer sur votre firewall pour les pauvres étudiants de la résidence dont vous êtes l&#8217;administrateur qui ne pourraient sinon pas passer leur temps à jouer à <a href="http://uncyclopedia.wikia.com/wiki/World_of_warcraft">WoW</a> au lieu de travailler, alors vous avez probablement comme moi remarqué une chose : TeamSpeak n&#8217;a pas de port standard. Et c&#8217;est la merde ! Mon firewall se transforme peu à peu en gruyère&#8230;</p>
<p>Pour repousser la menace, j&#8217;ai donc décidé de coder un proxy pour TeamSpeak. Le principe est de l&#8217;installer sur une machine qui peut sortir sur tous les ports en UDP. Les clients utilisent un petit logiciel spécial pour ouvrir un canal temporaire le temps de l&#8217;utilisation de TS, et le proxy fait du port forwarding.</p>
<p>Pour l&#8217;instant</p>
<ul>
<li>Le projet est hébergé sur <a href="http://github.com/EquiNux/TS-Proxy">Github</a>, c&#8217;est aussi là que vous trouverez les tarballs, installeurs, &#8230;</lo>
<li>Il y a un installeur pour le client sous Windows, pour les autres OS vous devez compiler le client à la main (c&#8217;est du C++).</li>
<li>Le serveur est codé en <a href="http://python.org/">Python</a>, et utilise <a href="http://twistedmatrix.com/trac/">Twisted</a>. Il n&#8217;y pas de paquet Debian ou de truc du genre&#8230;</li>
<li>Pour le support de TeamSpeak 2, je suis à peu près sûr de moi, par contre ce qui est de TeamSpeak 3 c&#8217;est encore en version β, histoire de faire un peu moderne.</li>
</ul>
<p>N&#8217;hésitez pas à me contacter si vous n&#8217;avez pas la moindre idée de comment ça fonctionne (ça se comprend, c&#8217;est moi qui ai codé&#8230;) mais que ça vous intéresse quand même <img src='http://hyperthese.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/teamspeak-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Radiateur&#8230;</title>
		<link>http://hyperthese.net/radiateur/</link>
		<comments>http://hyperthese.net/radiateur/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 23:42:50 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[IRL]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=244</guid>
		<description><![CDATA[J&#8217;aurai jamais pensé écrire un article là dessus, mais vu que j&#8217;ai eu du mal à trouver de l&#8217;aide sur internet&#8230; C&#8217;est dingue ce que la vie réelle nous ratrappe des fois  
Donc depuis pas longtemps j&#8217;ai un appartement chauffé au gaz, ce qui fait que j&#8217;ai eu quelques manips à faire (pour info, [...]]]></description>
			<content:encoded><![CDATA[<p>J&#8217;aurai jamais pensé écrire un article là dessus, mais vu que j&#8217;ai eu du mal à trouver de l&#8217;aide sur internet&#8230; C&#8217;est dingue ce que la vie réelle nous ratrappe des fois <img src='http://hyperthese.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Donc depuis pas longtemps j&#8217;ai un appartement chauffé au gaz, ce qui fait que j&#8217;ai eu quelques manips à faire (pour info, ma chaudière est une Saunier Duval &#8220;Thema F 23&#8243;) :</p>
<ul>
<li>La chaudière ne démarre que si la pression est suffisante (grosso modo 1,5 bar chez moi). Si la pression est trop faible, il y a des manettes sous la chaudière à tourner en même temps pour la remplir, ça fait augmenter la pression (de toute façon, ça c&#8217;est marqué sur l&#8217;étiquette).</li>
<li>Si la pression est trop importante, on peu la baisser en purgeant un radiateur : en haut du radiateur il y a un petit trou avec un truc à faire tourner par un tourenvis. Quand on tourne, ça ouvre le &#8220;robinet&#8221; et ça laisse sortir de l&#8217;eau, ce qui diminue la pression dans la chaudière. Attention à pas trop vider non plus&#8230;</li>
<li>Si le radiateur fait &#8220;glouglou&#8221; c&#8217;est que y&#8217;a de l&#8217;air. Si y&#8217;a de l&#8217;air, alors c&#8217;est de l&#8217;espace en moins occupé par l&#8217;eau chaude, et donc en plus de faire &#8220;glouglou&#8221; ça chauffe moins. La solution est simple : il faut purger. Au lieu d&#8217;avoir de l&#8217;eau qui sort, ça sera de l&#8217;air. Il faut purger jusqu&#8217;à ce que l&#8217;eau arrive&#8230; Attention conséquence du point précédent : ça baisse la pression. Attention donc à ne pas se retrouver avec une chaudière dépressurisée&#8230; (sinon, faut faire comme au premier point <img src='http://hyperthese.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</li>
</ul>
<p>/me gagne +1 en compétence plomberie \o/</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/radiateur/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>La cohésion interne chez Google</title>
		<link>http://hyperthese.net/la-cohesion-interne-chez-google/</link>
		<comments>http://hyperthese.net/la-cohesion-interne-chez-google/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 23:05:50 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[Go]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=240</guid>
		<description><![CDATA[Quand une boite devient un peu grosse, il peut arriver qu'elle choppe des tendance schizophréniques. Par exemple, si on fouille bien dans le code source de Go, on trouve ça :
PLAIN TEXT
C:




// Is it a broken browser?


&#160; &#160; var msg string;


&#160; &#160; switch agent := req.UserAgent; &#123;


&#160; &#160; case strings.Index&#40;agent, "MSIE"&#41;&#62;= 0:


&#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Quand une boite devient un peu grosse, il peut arriver qu'elle choppe des tendance schizophréniques. Par exemple, si on fouille bien dans le code source de Go, on trouve ça :</p>
<div class="igBar"><span id="lc-2"><a href="#" onclick="javascript:showCodeTxt('c-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C:</span>
<div id="c-2">
<div class="c">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Is it a broken browser?</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; var msg <span style="color: #993333;">string</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">switch</span> agent := req.<span style="color: #202020;">UserAgent</span>; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">case</span> strings.<span style="color: #202020;">Index</span><span style="color: #66cc66;">&#40;</span>agent, <span style="color: #ff0000;">"MSIE"</span><span style="color: #66cc66;">&#41;</span>&gt;= <span style="color: #cc66cc;color:#800000;">0</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; msg = <span style="color: #ff0000;">"Internet Explorer"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">case</span> strings.<span style="color: #202020;">Index</span><span style="color: #66cc66;">&#40;</span>agent, <span style="color: #ff0000;">"Chrome/"</span><span style="color: #66cc66;">&#41;</span>&gt;= <span style="color: #cc66cc;color:#800000;">0</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; msg = <span style="color: #ff0000;">"Chrome"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">default</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>J'aime bien le principe d'un produit "Google" (le Go n'a pas l'air si Google que ça) qui en insulte un autre <img src='http://hyperthese.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(pour info, on trouve ça dans le fichier <em>$GOROOT/src/pkg/http/server.go</em>, vous aurez l'explication complète de pourquoi Chrome se fait traiter de broken en commentaire de la fonction <img src='http://hyperthese.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/la-cohesion-interne-chez-google/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Go : un serveur TCP</title>
		<link>http://hyperthese.net/go-un-serveur-tcp/</link>
		<comments>http://hyperthese.net/go-un-serveur-tcp/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 05:11:48 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[Go]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=236</guid>
		<description><![CDATA[Dans la catégorie je fais mumuse avec Go : je fais un serveur TCP qui répond invariablement "Hello, World !" à tous les clients qui se connectent.
PLAIN TEXT
C:




package main


&#160;


import &#40;


&#160; &#160; "fmt";


&#160; &#160; "net";


&#160; &#160; "strings";


&#41;;


&#160;


func handler&#40;c *net.TCPConn&#41; &#123;


&#160; &#160; c.Write&#40;strings.Bytes&#40;"Hello, World !\n"&#41;&#41;;


&#160; &#160; c.Close&#40;&#41;;


&#125;


&#160;


func main&#40;&#41; &#123;


&#160; &#160; addr, err := net.ResolveTCPAddr&#40;"127.0.0.1:5896"&#41;;


&#160; &#160; l, err [...]]]></description>
			<content:encoded><![CDATA[<p>Dans la catégorie je fais mumuse avec Go : je fais un serveur TCP qui répond invariablement "Hello, World !" à tous les clients qui se connectent.</p>
<div class="igBar"><span id="lc-4"><a href="#" onclick="javascript:showCodeTxt('c-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C:</span>
<div id="c-4">
<div class="c">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package main</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import <span style="color: #66cc66;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff0000;">"fmt"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff0000;">"net"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff0000;">"strings"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">func handler<span style="color: #66cc66;">&#40;</span>c *net.<span style="color: #202020;">TCPConn</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; c.<span style="color: #202020;">Write</span><span style="color: #66cc66;">&#40;</span>strings.<span style="color: #202020;">Bytes</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Hello, World !<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; c.<span style="color: #202020;">Close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">func main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; addr, err := net.<span style="color: #202020;">ResolveTCPAddr</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"127.0.0.1:5896"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; l, err := net.<span style="color: #202020;">ListenTCP</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"tcp4"</span>, addr<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> l == nil <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; fmt.<span style="color: #202020;">Println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Could not listen : "</span>, err<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; a, err := l.<span style="color: #202020;">AcceptTCP</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> a == nil <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fmt.<span style="color: #202020;">Println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Could not accept : "</span>, err<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; go handler<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/go-un-serveur-tcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chaîne aléatoire en PHP</title>
		<link>http://hyperthese.net/chaine-aleatoire-en-php/</link>
		<comments>http://hyperthese.net/chaine-aleatoire-en-php/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 23:08:55 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Trucs et astuces]]></category>

		<guid isPermaLink="false">http://hyperthese.net/?p=232</guid>
		<description><![CDATA[Ça sert toujours, une fonction pour générer une chaîne aléatoire :
PLAIN TEXT
PHP:




function randStr&#40;$len, $alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"&#41; &#123;


&#160; &#160; $as = strlen&#40;$alphabet&#41; - 1;


&#160; &#160; $str = "";


&#160;


&#160; &#160; for&#40;$i = 0; $i &#60;$len; $i++&#41; &#123;


&#160; &#160; &#160; &#160; $str .= $alphabet&#91;rand&#40;0, $as&#41;&#93;;


&#160; &#160; &#125;


&#160;


&#160; &#160; return $str;


&#125; 






]]></description>
			<content:encoded><![CDATA[<p>Ça sert toujours, une fonction pour générer une chaîne aléatoire :</p>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showCodeTxt('php-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> randStr<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$len</span>, <span style="color:#0000FF;">$alphabet</span> = <span style="color:#FF0000;">"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$as</span> = <a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$alphabet</span><span style="color:#006600; font-weight:bold;">&#41;</span> - <span style="color:#CC66CC;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$str</span> = <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span> = <span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span> &lt;<span style="color:#0000FF;">$len</span>; <span style="color:#0000FF;">$i</span>++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$str</span> .= <span style="color:#0000FF;">$alphabet</span><span style="color:#006600; font-weight:bold;">&#91;</span><a href="http://www.php.net/rand"><span style="color:#000066;">rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#0000FF;">$as</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$str</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/chaine-aleatoire-en-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
