<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>m.i.n.i.b.l.o.g</title>
	
	<link>http://pas-bien.net/blog</link>
	<description>encore un blog de geek</description>
	<lastBuildDate>Fri, 22 Jan 2010 15:58:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/pas-bien/VFhb" /><feedburner:info uri="pas-bien/vfhb" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Firefox : ouvrir les onglets en fin de file</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/0_I6pKGEJzc/firefox-ouvrir-les-onglets-en-fin-de-file</link>
		<comments>http://pas-bien.net/blog/2010/01/22/firefox-ouvrir-les-onglets-en-fin-de-file#comments</comments>
		<pubDate>Fri, 22 Jan 2010 15:57:58 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Notes Techniques]]></category>
		<category><![CDATA[about:config]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[onglet]]></category>
		<category><![CDATA[onglets]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[tabs]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=242</guid>
		<description><![CDATA[Suite au passage en version 3.6 de Firefox, les popup ne s&#8217;ouvrent plus en dernière place dans la liste des onglets mais après l&#8217;onglet actif. Je ne sais pas si c&#8217;est pour copier le fonctionnement de Google Chrome, mais moi j&#8217;aime pas.
Donc pour revenir à l&#8217;ancien comportement, il faut :

Se rendre sur la page : [...]]]></description>
			<content:encoded><![CDATA[<p>Suite au passage en version 3.6 de Firefox, les popup ne s&#8217;ouvrent plus en dernière place dans la liste des onglets mais après l&#8217;onglet actif. Je ne sais pas si c&#8217;est pour copier le fonctionnement de Google Chrome, mais moi j&#8217;aime pas.</p>
<p>Donc pour revenir à l&#8217;ancien comportement, il faut :</p>
<ol>
<li>Se rendre sur la page : <strong>about:config</strong>.</li>
<li>Chercher la valeur <strong>browser.tabs.insertRelatedAfterCurrent</strong>.</li>
<li>Et la<strong> </strong>mettre à <strong>false</strong>.</li>
</ol>
<p>Et voila ! <img src='http://pas-bien.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/0_I6pKGEJzc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2010/01/22/firefox-ouvrir-les-onglets-en-fin-de-file/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2010/01/22/firefox-ouvrir-les-onglets-en-fin-de-file</feedburner:origLink></item>
		<item>
		<title>Nouvelle chanson de Muse :) [Update 08/08/2009]</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/iFHREy81Gv8/nouvelle-chanson-de-muse</link>
		<comments>http://pas-bien.net/blog/2009/07/17/nouvelle-chanson-de-muse#comments</comments>
		<pubDate>Fri, 17 Jul 2009 10:53:05 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[Muse]]></category>
		<category><![CDATA[musique]]></category>
		<category><![CDATA[The Resistance]]></category>
		<category><![CDATA[United States of Eurasia]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=223</guid>
		<description><![CDATA[Extrait d&#8217;une chanson du prochain album de Muse :

Artiste : Muse
Album : The Resistance (sortie en septembre)
Chanson : United States of Eurasia
Source : muse.mu
[Edit (20/07/2009) : chanson complète en ligne]
[Edit (08/08/2009) : Suite à trafic trop important je n'héberge plus la chanson et ai mis la version de youtube qui risque d'être supprimé à tout [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pas-bien.net/blog/wp-content/uploads/2009/07/museLogo.png"><img class="size-full wp-image-230 alignright" title="Muse (Logo)" src="http://pas-bien.net/blog/wp-content/uploads/2009/07/museLogo.png" alt="Muse (Logo)" width="140" height="68" /></a>Extrait d&#8217;une chanson du prochain album de Muse :</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="265" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/0Ok0expLH1o&amp;hl=fr&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="320" height="265" src="http://www.youtube.com/v/0Ok0expLH1o&amp;hl=fr&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>Artiste :</strong> Muse</p>
<p><strong>Album :</strong> The Resistance (sortie en septembre)</p>
<p><strong>Chanson :</strong> United States of Eurasia</p>
<p>Source : <a href="http://ununitedeurasia.muse.mu/music/">muse.mu</a></p>
<p>[Edit (20/07/2009) : chanson complète en ligne]</p>
<p>[Edit (08/08/2009) : Suite à trafic trop important je n'héberge plus la chanson et ai mis la version de youtube qui risque d'être supprimé à tout moment. dsl]</p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/iFHREy81Gv8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/07/17/nouvelle-chanson-de-muse/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/07/17/nouvelle-chanson-de-muse</feedburner:origLink></item>
		<item>
		<title>Pas de tonalité sur les appels entrants chez Free</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/T4B6e8MVah8/pas-de-tonalite-sur-les-appels-entrants-chez-free</link>
		<comments>http://pas-bien.net/blog/2009/03/17/pas-de-tonalite-sur-les-appels-entrants-chez-free#comments</comments>
		<pubDate>Tue, 17 Mar 2009 20:51:41 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Divers]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=207</guid>
		<description><![CDATA[J&#8217;avais un petit problème sur ma ligne freebox :
Les gens qui m&#8217;appelaient n&#8217;entendaient pas de tonalité.
C&#8217;était le seul problème : les appels arrivaient bien, le téléphonne sonnait, j&#8217;avais  une tonalité pour les appels vers l&#8217;extérieur. Bref pas d&#8217;autre problème&#8230;
Au final la solution fut est d&#8217;un simplicité déconcertante :
Activer le Ring Back Tone
Pour cela il suffit [...]]]></description>
			<content:encoded><![CDATA[<p>J&#8217;avais un petit problème sur ma ligne freebox :</p>
<p style="padding-left: 30px;">Les gens qui m&#8217;appelaient n&#8217;entendaient <strong>pas de tonalité</strong>.</p>
<p>C&#8217;était le <strong>seul problème</strong> : les appels arrivaient bien, le téléphonne sonnait, j&#8217;avais  une tonalité pour les appels vers l&#8217;extérieur. Bref pas d&#8217;autre problème&#8230;</p>
<p>Au final la solution fut est d&#8217;un simplicité déconcertante :</p>
<p style="padding-left: 30px;"><strong>Activer le Ring Back Tone</strong></p>
<p>Pour cela il suffit d&#8217;aller dans la partie téléphonie de l&#8217;interface de gestion.</p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/T4B6e8MVah8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/03/17/pas-de-tonalite-sur-les-appels-entrants-chez-free/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/03/17/pas-de-tonalite-sur-les-appels-entrants-chez-free</feedburner:origLink></item>
		<item>
		<title>Bonne année !</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/HPSblMfdq0I/bonne-annee</link>
		<comments>http://pas-bien.net/blog/2009/02/25/bonne-annee#comments</comments>
		<pubDate>Wed, 25 Feb 2009 10:23:16 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Divers]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=197</guid>
		<description><![CDATA[Je vous souhaite une bonne année (très en retard mais je m&#8217;en fout) sur cette chronique déprimante :

Source : Couleur3
]]></description>
			<content:encoded><![CDATA[<p>Je vous souhaite une bonne année (très en retard mais je m&#8217;en fout) sur cette chronique déprimante :</p>
<p style="text-align: center;"><object width="200" height="20" data="http://pas-bien.net/blog/wp-content/uploads/2009/02/dewplayer.swf?mp3=http://pas-bien.net/blog/wp-content/uploads/2009/02/20090105-la-revue-de-stress-du-lundi-05-janvier.mp3&amp;showtime=1" type="application/x-shockwave-flash"><param name="id" value="dewplayer" /><param name="align" value="middle" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="sameDomain" /><param name="quality" value="high" /><param name="bgcolor" value="FFFFFF" /><param name="src" value="http://pas-bien.net/blog/wp-content/uploads/2009/02/dewplayer.swf?mp3=http://pas-bien.net/blog/wp-content/uploads/2009/02/20090105-la-revue-de-stress-du-lundi-05-janvier.mp3&amp;showtime=1" /><param name="name" value="dewplayer" /></object></p>
<p>Source : <a href="http://www.rsr.ch/couleur3">Couleur3</a></p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/HPSblMfdq0I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/02/25/bonne-annee/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/02/25/bonne-annee</feedburner:origLink></item>
		<item>
		<title>Flux RSS des Vie de merde illustrées</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/4CFUiguYBTA/flux-rss-des-vie-de-merde-illustrees</link>
		<comments>http://pas-bien.net/blog/2009/02/16/flux-rss-des-vie-de-merde-illustrees#comments</comments>
		<pubDate>Mon, 16 Feb 2009 19:04:51 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[illustration]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[VDM]]></category>
		<category><![CDATA[Vie de merde]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=157</guid>
		<description><![CDATA[Le site VDM.fr doit être maintenant assez célébre pour que je prenne pas la peine de le présenter. Sur le site régulièrement des illustrations de VDM sont ajoutées. Elles sont souvant sympa mais mon problème c&#8217;était que je les voyais pas : elle sont pas dans le flux RSS.
Donc si j&#8217;utilise les flux RSS c&#8217;est [...]]]></description>
			<content:encoded><![CDATA[<p>Le site <a href="http://www.viedemerde.fr/">VDM.fr</a> doit être maintenant assez célébre pour que je prenne pas la peine de le présenter. Sur le site régulièrement des illustrations de VDM sont ajoutées. Elles sont souvant sympa mais mon problème c&#8217;était que je les voyais pas : elle sont pas dans le flux RSS.</p>
<p>Donc si j&#8217;utilise les flux RSS c&#8217;est bien pour ne pas aller sur des sites. Donc mon problème était qu&#8217;il n&#8217;y avait pas de flux avec les illustrations.</p>
<p>Donc pour résoudre mon problème j&#8217;ai fait un petit script PHP qui fouille dans la page <a href="http://www.viedemerde.fr/illustrations">http://www.viedemerde.fr/illustrations</a> et génére un flux à partir des données trouvées.</p>
<p>Pour l&#8217;utiliser voilà où ça se trouve :</p>
<p><p style="border-top: 2px solid rgb(65, 105, 175); border-bottom: 2px solid rgb(65, 105, 175); padding: 5px 20px 5px 45px; background: rgb(223, 235, 255) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/world.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/divers/rss-vdm-illustratee/">http://pas-bien.net/divers/rss-vdm-illustratee/</a></p></p>
<p>Sources dispo pour ceux qui veulent :</p>
<p><p style="border-top: 2px solid rgb(192, 192, 192); border-bottom: 2px solid rgb(192, 192, 192); padding: 5px 20px 5px 45px; background: rgb(240, 240, 240) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/download.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/divers/rss-vdm-illustratee/sources.txt">http://pas-bien.net/divers/rss-vdm-illustratee/sources.txt</a></p></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl" target="_blank"><img class="size-full wp-image-36 aligncenter" title="Creative Commons GNU GPL" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/cc-gpl-a.png" alt="Creative Commons GNU GPL" width="88" height="62" /></a></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl">Programme sous Creative Commons GNU GPL</a></p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/4CFUiguYBTA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/02/16/flux-rss-des-vie-de-merde-illustrees/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/02/16/flux-rss-des-vie-de-merde-illustrees</feedburner:origLink></item>
		<item>
		<title>Extraire des données du cache Firefox</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/zCcMiDL4NiQ/extraire-des-donnees-du-cache-firefox</link>
		<comments>http://pas-bien.net/blog/2009/02/13/extraire-des-donnees-du-cache-firefox#comments</comments>
		<pubDate>Fri, 13 Feb 2009 16:46:26 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Projets]]></category>
		<category><![CDATA[about:cache]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[hexdump]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=145</guid>
		<description><![CDATA[La fonction about:cache de Firefox (à taper dans la barre d&#8217;adresse) permet d&#8217;afficher les éléments qui ont été mis en cache.  Un jour j&#8217;ai eu à récupérer un fichier CSS que j&#8217;avais supprimé par erreur mais qui était toujours dans le cache. J&#8217;ai donc pu voir mon fichier mais en affichage hexadécimal :
Si on [...]]]></description>
			<content:encoded><![CDATA[<p>La fonction <strong>about:cache</strong> de Firefox (à taper dans la barre d&#8217;adresse) permet d&#8217;afficher les éléments qui ont été mis en cache.  Un jour j&#8217;ai eu à récupérer un fichier CSS que j&#8217;avais supprimé par erreur mais qui était toujours dans le cache. J&#8217;ai donc pu voir mon fichier mais en affichage hexadécimal :</p>
<div id="attachment_146" class="wp-caption aligncenter" style="width: 310px"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/02/aboutcache.gif"><img class="size-medium wp-image-146" title="aboutcache" src="http://pas-bien.net/blog/wp-content/uploads/2009/02/aboutcache-300x246.gif" alt="Affichage d'un fichier du cache Firefox" width="300" height="246" /></a><p class="wp-caption-text">Affichage d&#39;un fichier du cache Firefox</p></div>
<p>Si on fait &#8220;Fichier&#8221; &gt; &#8220;Enregistrer sous&#8230;&#8221; on peut enregistrer ces données dans un fichier (nomé <em>Cache entry information.xhtml</em> par défaut).  J&#8217;ai donc écrit un outil qui permet d&#8217;extraire les données en affichables pour les écrire en binaire. Cet outil est écrit en PHP-CLI (Command Line Interface) et s&#8217;utilise comme ceci :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">php cache2bin.php <span style="color: #ff0000;">&quot;Cache entry information.xhtml&quot;</span> <span style="color: #ff0000;">&quot;test.gif&quot;</span></pre></div></div>

<p>Vous pouvez le télécharger à cette adresse si cela vous intéresse :  <p style="border-top: 2px solid rgb(192, 192, 192); border-bottom: 2px solid rgb(192, 192, 192); padding: 5px 20px 5px 45px; background: rgb(240, 240, 240) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/download.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/02/cache2bin.txt">cache2bin.txt</a></p></p>
<p><p style="border-top: 2px solid rgb(181, 212, 254); border-bottom: 2px solid rgb(181, 212, 254); padding: 5px 20px 5px 45px; background: rgb(248, 250, 252) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/info.gif) no-repeat scroll 15px 50%;color: rgb(94, 98, 115); text-align: left;">Pour l&#8217;exécuter il faudra surement le renommer en .php et ajouter les droit d&#8217;exécution sur Linux.</p></p>
<h2>Personnalisation</h2>
<p>Si vous avez besoin de faire la même chose mais pour un fichier ne provenant pas du cache de Firefox, ce programme peut marcher en l&#8217;état, mais si ce n&#8217;est pas le cas, il n&#8217;y aura sûrement que deux choses à faire :</p>
<ol>
<li>Remplacer $ereg par l&#8217;expression régulière correspondant à votre fichier.</li>
<li>Remplacer $data_per_line par le nombre d&#8217;octets affichés par ligne.</li>
</ol>
<p>Par exemple pour un fichier généré par la commande Linux hexdump on aurait $data_per_line qui reste à 16 et pour $ereg :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$ereg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/[0-9a-f]{8}: ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) - ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2}) ([0-9A-F ]{2})/&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Licence</h2>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl" target="_blank"><img class="size-full wp-image-36 aligncenter" title="Creative Commons GNU GPL" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/cc-gpl-a.png" alt="Creative Commons GNU GPL" width="88" height="62" /></a></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl">Programme sous Creative Commons GNU GPL</a></p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/zCcMiDL4NiQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/02/13/extraire-des-donnees-du-cache-firefox/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/02/13/extraire-des-donnees-du-cache-firefox</feedburner:origLink></item>
		<item>
		<title>Google Reader : ouvrir les items en onglets</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/FDB0auMHjlM/google-reader-ouvrir-les-items-en-onglets</link>
		<comments>http://pas-bien.net/blog/2009/02/07/google-reader-ouvrir-les-items-en-onglets#comments</comments>
		<pubDate>Sat, 07 Feb 2009 15:06:06 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Projets]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google Reader]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=95</guid>
		<description><![CDATA[Pour quoi faire ?
J&#8217;utilise Google Reader pour suivre mes flux RSS préférés. Mais pour certains je suis sûr d&#8217;aller voir le contenu sur le site. C&#8217;est par exemple le cas pour lelombrik.net, j&#8217;irai forcement voir chaque nouvel item puisqu&#8217;il n&#8217;y a qu&#8217;un extrait dans le flux. Google Reader ne permettait pas de base d&#8217;ouvrir chaque [...]]]></description>
			<content:encoded><![CDATA[<h3>Pour quoi faire ?</h3>
<p>J&#8217;utilise Google Reader pour suivre mes flux RSS préférés. Mais pour certains je suis sûr d&#8217;aller voir le contenu sur le site. C&#8217;est par exemple le cas pour <a title="LeLombrik.net" href="http://www.lelombrik.net/">lelombrik.net</a>, j&#8217;irai forcement voir chaque nouvel item puisqu&#8217;il n&#8217;y a qu&#8217;un extrait dans le flux. Google Reader ne permettait pas de base d&#8217;ouvrir chaque nouveauté dans un nouvel onglet.</p>
<h3>Avec quoi ?</h3>
<p>Pour combler ce manque j&#8217;ai écrit un script <a href="https://addons.mozilla.org/fr/firefox/addon/748">Greasemonkey</a>. Pour ceux qui ne connaissent pas cette extension voici <a href="http://znarf.h6e.net/blog/?2005/04/27/221-la-revolution-greasemonkey">un article</a> qui décrit le principe général.</p>
<p>Une grand partie du script a été en grande partie réécrit récemment. Cette réécriture a permis de corriger des vieux problèmes comme l&#8217;incompatibilité avec la vue étendue. Cela s&#8217;est fait facilement puisqu&#8217;une partie du remaniement concernait l&#8217;implantation du framework jQuery qui a tenu ses promesses : &#8220;Write less, do more&#8221;.</p>
<p>Par contre je n&#8217;ai pas réussi à utiliser :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mark-all-as-read'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>J&#8217;ai du utiliser une fonction pour simuler le clic sur un élément :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> oau_fireClick<span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	button <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	evt <span style="color: #339933;">=</span> document.<span style="color: #660066;">createEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'MouseEvents'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	evt.<span style="color: #660066;">initEvent</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	button.<span style="color: #660066;">dispatchEvent</span><span style="color: #009900;">&#40;</span>evt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Ce problème provient sûrement d&#8217;une limitation de Greasemonkey. Si quelqu&#8217;un sait comment remédier je suis preneur. <img src='http://pas-bien.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h3>Comment ça marche</h3>
<p>En ce qui concerne le script, il ajoute un bouton entre deux autres déjà existants :</p>
<div id="attachment_106" class="wp-caption aligncenter" style="width: 634px"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/02/oaunu6.png"><img class="size-full wp-image-106" title="Google Reader - Open All Unread" src="http://pas-bien.net/blog/wp-content/uploads/2009/02/oaunu6.png" alt="Screenshot du script" width="624" height="93" /></a><p class="wp-caption-text">Screenshot du script</p></div>
<p>Quand on clique sur ce bouton :</p>
<ol>
<li>Les items à lire sont ouverts dans nouveaux onglets.</li>
<li>Les items ouverts sont marqués comme lus.</li>
</ol>
<h3>Installler</h3>
<p><p style="border-top: 2px solid rgb(65, 105, 175); border-bottom: 2px solid rgb(65, 105, 175); padding: 5px 20px 5px 45px; background: rgb(223, 235, 255) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/world.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://userscripts.org/scripts/show/22275">Installer le script à partir de Userscripts.org</a></p></p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/FDB0auMHjlM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/02/07/google-reader-ouvrir-les-items-en-onglets/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/02/07/google-reader-ouvrir-les-items-en-onglets</feedburner:origLink></item>
		<item>
		<title>Recevez vos flux RSS Twitter avec Google Reader</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/mS3XtZkTNpc/recevez-vos-flux-rss-twitter-avec-google-reader</link>
		<comments>http://pas-bien.net/blog/2009/02/04/recevez-vos-flux-rss-twitter-avec-google-reader#comments</comments>
		<pubDate>Wed, 04 Feb 2009 12:04:15 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[Projets]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Google Reader]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=89</guid>
		<description><![CDATA[Les flux RSS Twitter sont protégés par des mots de passes, ce qui peut être gênant si votre agrégateur de flux ne supporte pas l&#8217;authentification. C&#8217;était mon cas avec Google Reader.
J&#8217;ai écrit un &#8220;proxy&#8221; de flux qui ne nécessite pas d&#8217;authentification au niveau du protocole HTML. L&#8217;authentification sur mon proxy se fait par un paramètre [...]]]></description>
			<content:encoded><![CDATA[<p>Les <strong>flux RSS Twitter</strong> sont protégés par des mots de passes, ce qui peut être gênant si votre agrégateur de flux <strong>ne supporte pas l&#8217;authentification</strong>. C&#8217;était mon cas avec <strong>Google Reader</strong>.</p>
<p>J&#8217;ai écrit un &#8220;<strong>proxy</strong>&#8221; de flux qui ne nécessite pas d&#8217;authentification au niveau du protocole HTML. L&#8217;authentification sur mon proxy se fait par un paramètre GET et le proxy s&#8217;authentifie sur Twitter.</p>
<p>Il peut sembler risqué de donner un mot de passe à un site aussi peu connu qui le mien et c&#8217;est normal puisque ça l&#8217;est ! Le nom d&#8217;utilisateur et le mot de passe sont codés dans le paramètre <em>key</em>, il n&#8217;est pas inscrit ailleur.</p>
<p>Je peux décoder vos mots de passes sans problème à partir des logs Apache. Mais sérieusement j&#8217;en ai rien à faire de vos comptes Twitter ! Par contre le code source de cet outil ne sera pas révélé pour que le codage reste sûr. Donc même si votre <em>key</em> générée tombe entre les mains de personnes mal intentionnées ils n&#8217;auront accès qu&#8217;à votre flux via mon proxy.</p>
<p>L&#8217;outil est ici:</p>
<p><p style="border-top: 2px solid rgb(65, 105, 175); border-bottom: 2px solid rgb(65, 105, 175); padding: 5px 20px 5px 45px; background: rgb(223, 235, 255) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/world.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a title="Twitter Feeds Proxy" href="http://pas-bien.net/divers/rss-twitter-proxy/">Twitter Feeds Proxy</a></p></p>
<p>Si vous avec des doutes sur la sécurité de mon outil, le mieux est de ne pas l&#8217;utiliser. <img src='http://pas-bien.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/mS3XtZkTNpc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/02/04/recevez-vos-flux-rss-twitter-avec-google-reader/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/02/04/recevez-vos-flux-rss-twitter-avec-google-reader</feedburner:origLink></item>
		<item>
		<title>Fusionnez deux fichiers SRT avec 2srt2ass</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/m0n3xWur3Yw/fusionnez-deux-fichiers-srt-avec-2srt2ass</link>
		<comments>http://pas-bien.net/blog/2009/02/02/fusionnez-deux-fichiers-srt-avec-2srt2ass#comments</comments>
		<pubDate>Mon, 02 Feb 2009 10:07:12 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Projets]]></category>
		<category><![CDATA[ASS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[sous titres]]></category>
		<category><![CDATA[SRT]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=83</guid>
		<description><![CDATA[Pour travailler mon anglais je voulais pouvoir utiliser deux fichiers SRT en même temps : un en VO et l&#8217;autre en français pour avoir la traduction instantanée. Mes lecteurs vidéos préférés (Media Player Classic et VLC) ne permettant pas ça : j&#8217;ai créé un petit outil PHP : 2SRT2ASS (ou Two SRT to ASS).
Il analyse [...]]]></description>
			<content:encoded><![CDATA[<p>Pour travailler mon anglais je voulais pouvoir utiliser deux fichiers SRT en même temps : un en VO et l&#8217;autre en français pour avoir la traduction instantanée. Mes lecteurs vidéos préférés (Media Player Classic et VLC) ne permettant pas ça : j&#8217;ai créé un petit outil PHP : 2SRT2ASS (ou Two SRT to ASS).</p>
<p>Il analyse les fichiers SRT que l&#8217;on lui envoie pour les ressortir fusionnés en un fichiers ASS. Voici un petit apperçu de ce que ça donne avec Knight Rider 2008 (no comment sur la série <img src='http://pas-bien.net/blog/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' />  ) :</p>
<div id="attachment_84" class="wp-caption aligncenter" style="width: 510px"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/2srt2ass.jpg"><img class="size-full wp-image-84" title="2srt2ass" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/2srt2ass.jpg" alt="Aperçu de deux fichiers SRT fusionnés" width="500" height="284" /></a><p class="wp-caption-text">Aperçu de deux fichiers SRT fusionnés</p></div>
<p>Cet outil fonctionne très simplement :</p>
<ol>
<li>Vous lui envoyez les deux fichiers.</li>
<li>Vous cliquez sur &#8220;Envoyer&#8221; et il vous renvoie les fichiers fusionnés.</li>
</ol>
<p>Le fichier généré est un fichier SSA/ASS. C&#8217;était <a title="VLC's Subtitles codecs" href="http://wiki.videolan.org/SubtitlesCodec">le seul format</a> qui permettait d&#8217;avoir une mise en forme (en haut et en bas) tout en étant basé sur les timestamps (comme pour les fichiers SRT).</p>
<p>A noter aussi que VLC semble mal digérer les ASS mais Media Player Classic n&#8217;a aucun problèmes.</p>
<p>Si vous voulez vous aussi utiliser cet outil, il est disponnible avec ses sources ici :</p>
<p><p style="border-top: 2px solid rgb(65, 105, 175); border-bottom: 2px solid rgb(65, 105, 175); padding: 5px 20px 5px 45px; background: rgb(223, 235, 255) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/world.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a title="2SRT2ASS" href="http://pas-bien.net/2srt2ass/">2SRT2ASS</a></p></p>
<p>PS : Si vous souhaitez attrendre le support de cette fonction dans VLC, <a title="VideoLan Forum : Dual subtitles?" href="http://forum.videolan.org/viewtopic.php?f=7&amp;t=21558&amp;start=0">une discution</a> est en cours depuis 2006&#8230;</p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/m0n3xWur3Yw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/02/02/fusionnez-deux-fichiers-srt-avec-2srt2ass/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/02/02/fusionnez-deux-fichiers-srt-avec-2srt2ass</feedburner:origLink></item>
		<item>
		<title>Convertisseur BIN/DEC/HEX</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/0OrW4t-gROU/convertisseur-bindechex</link>
		<comments>http://pas-bien.net/blog/2009/02/01/convertisseur-bindechex#comments</comments>
		<pubDate>Sun, 01 Feb 2009 10:45:33 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Projets]]></category>
		<category><![CDATA[binaire]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[convertisseur]]></category>
		<category><![CDATA[décimal]]></category>
		<category><![CDATA[hexadécimal]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=76</guid>
		<description><![CDATA[Je vais encore vous présenter un vieux projet.

Ce petit outils permet de convertir instantanément en décimal, binaire ou hexadécimal. Il suffit d&#8217;entrer un nombre dans un des 3 champs et les deux autres sont directement mis à jour.
Ce programme est écrit en JAVA et nécessite donc la Java Runtime Environnement. Si vous voulez effectuer des [...]]]></description>
			<content:encoded><![CDATA[<p>Je vais encore vous présenter un vieux projet.</p>
<p><a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/convertisseur.png"><img class="aligncenter size-full wp-image-80" title="Aperçu du convertisseur" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/convertisseur.png" alt="Aperçu du convertisseur" width="404" height="126" /></a></p>
<p>Ce petit outils permet de convertir instantanément en décimal, binaire ou hexadécimal. Il suffit d&#8217;entrer un nombre dans un des 3 champs et les deux autres sont directement mis à jour.</p>
<p>Ce programme est écrit en JAVA et nécessite donc la <a title="Téléchargements Java pour tous les systèmes d'exploitation" href="http://java.com/fr/download/">Java Runtime Environnement</a>. Si vous voulez effectuer des modifications, il vous faudra l&#8217;<a title="Netbeans IDE" href="http://www.netbeans.org/">IDE Netbeans</a>.</p>
<p><p style="border-top: 2px solid rgb(65, 105, 175); border-bottom: 2px solid rgb(65, 105, 175); padding: 5px 20px 5px 45px; background: rgb(223, 235, 255) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/world.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/convertisseur.jar">Exécutable JAR du convertisseur</a></p></p>
<p><p style="border-top: 2px solid rgb(192, 192, 192); border-bottom: 2px solid rgb(192, 192, 192); padding: 5px 20px 5px 45px; background: rgb(240, 240, 240) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/download.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/2007-10-09-convertisseur-v0-1-0-20071009224556.zip">Projet Netbeans</a></p></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl" target="_blank"><img class="size-full wp-image-36 aligncenter" title="Creative Commons GNU GPL" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/cc-gpl-a.png" alt="Creative Commons GNU GPL" width="88" height="62" /></a></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl">Programme sous Creative Commons GNU GPL</a></p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/0OrW4t-gROU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/02/01/convertisseur-bindechex/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/02/01/convertisseur-bindechex</feedburner:origLink></item>
		<item>
		<title>Minuterie Web</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/W53c6kUI6_k/minuterie-web</link>
		<comments>http://pas-bien.net/blog/2009/01/29/minuterie-web#comments</comments>
		<pubDate>Thu, 29 Jan 2009 09:22:53 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Projets]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[pizza]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=73</guid>
		<description><![CDATA[Pizza + Geek = Minuterie Web  
Si comme moi vous restez devant votre PC pendant que votre pizza est en train de cuire dans le four, j&#8217;ai l&#8217;outil qu&#8217;il vous faut ! Une petite minuterie toute simple (en XHTML/CSS/Javascript) :
http://pas-bien.net/divers/decompte/

Bien sûr vous pouvez recopier et modifier les sources à votre guise. Aussi il suffit [...]]]></description>
			<content:encoded><![CDATA[<h2>Pizza + Geek = Minuterie Web <img src='http://pas-bien.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </h2>
<p>Si comme moi vous restez devant votre PC pendant que votre pizza est en train de cuire dans le four, j&#8217;ai l&#8217;outil qu&#8217;il vous faut ! Une petite minuterie toute simple (en XHTML/CSS/Javascript) :</p>
<p><p style="border-top: 2px solid rgb(65, 105, 175); border-bottom: 2px solid rgb(65, 105, 175); padding: 5px 20px 5px 45px; background: rgb(223, 235, 255) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/world.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/divers/decompte/">http://pas-bien.net/divers/decompte/</a></p></p>
<ul></ul>
<p>Bien sûr vous pouvez recopier et modifier les sources à votre guise. Aussi il suffit d&#8217;enregistrer la page pour avoir la minuterie sur votre disque dur (<em>index.html</em> contient tout).</p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/W53c6kUI6_k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/01/29/minuterie-web/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/01/29/minuterie-web</feedburner:origLink></item>
		<item>
		<title>Nombres premiers</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/0-sCKQbhuk8/nombres-premiers</link>
		<comments>http://pas-bien.net/blog/2009/01/28/nombres-premiers#comments</comments>
		<pubDate>Wed, 28 Jan 2009 10:38:55 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Projets]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[conjecture]]></category>
		<category><![CDATA[Goldbach]]></category>
		<category><![CDATA[Mathématiques]]></category>
		<category><![CDATA[nombres]]></category>
		<category><![CDATA[premiers]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=67</guid>
		<description><![CDATA[Liste des nombres premiers
Je sais pas pourquoi mais les nombres premiers m&#8217;ont toujours un peu fascinés. J&#8217;avais donc réalisé il y a un certain temps, un petit script Python qui cherche tous les nombres premiers. Ca sert à rien mais quelqu&#8217;un d&#8217;autre s&#8217;amusera peut être avec :

from math import sqrt;
def tester &#40;aTester&#41;:
	global tab
	index = 0
	racine [...]]]></description>
			<content:encoded><![CDATA[<h2>Liste des nombres premiers</h2>
<p>Je sais pas pourquoi mais les nombres premiers m&#8217;ont toujours un peu fascinés. J&#8217;avais donc réalisé il y a un certain temps, un petit script Python qui cherche tous les nombres premiers. Ca sert à rien mais quelqu&#8217;un d&#8217;autre s&#8217;amusera peut être avec :</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">math</span> <span style="color: #ff7700;font-weight:bold;">import</span> sqrt<span style="color: #66cc66;">;</span>
<span style="color: #ff7700;font-weight:bold;">def</span> tester <span style="color: black;">&#40;</span>aTester<span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">global</span> tab
	index = <span style="color: #ff4500;">0</span>
	racine = sqrt<span style="color: black;">&#40;</span> aTester <span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">while</span> tab<span style="color: black;">&#91;</span>index<span style="color: black;">&#93;</span> <span style="color: #66cc66;">&lt;</span>= sqrt<span style="color: black;">&#40;</span> aTester <span style="color: black;">&#41;</span>:
		index += <span style="color: #ff4500;">1</span>
		<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span> <span style="color: black;">&#40;</span>aTester <span style="color: #66cc66;">%</span> tab<span style="color: black;">&#91;</span>index<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> == <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>:
			<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">0</span>
	tab += <span style="color: black;">&#91;</span>aTester<span style="color: black;">&#93;</span>
	<span style="color: #ff7700;font-weight:bold;">print</span> aTester
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">1</span>
tab,mod,<span style="color: #008000;">max</span> = <span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span>,<span style="color: #ff4500;">3</span>,<span style="color: #ff4500;">5</span>,<span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span>,<span style="color: #ff4500;">10</span>,<span style="color: #ff4500;">1</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #ff4500;">2</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #ff4500;">3</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #ff4500;">5</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #ff4500;">7</span>
<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: black;">&#40;</span>mod <span style="color: #66cc66;">!</span>= <span style="color: #008000;">max</span><span style="color: black;">&#41;</span>:
	tester<span style="color: black;">&#40;</span>mod + <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
	tester<span style="color: black;">&#40;</span>mod + <span style="color: #ff4500;">3</span><span style="color: black;">&#41;</span>
	tester<span style="color: black;">&#40;</span>mod + <span style="color: #ff4500;">7</span><span style="color: black;">&#41;</span>
	tester<span style="color: black;">&#40;</span>mod + <span style="color: #ff4500;">9</span><span style="color: black;">&#41;</span>
	mod += <span style="color: #ff4500;">10</span></pre></div></div>

<h2>Conjecture de Goldbach</h2>
<p>Aussi quelqu&#8217;un m&#8217;a parlé un jour de la conjecture de Goldbach. Voici ce qu&#8217;en dit <a title="Conjecture de Goldbach" href="http://fr.wikipedia.org/wiki/Conjecture_de_Goldbach">l&#8217;article Wikipedia</a> :</p>
<blockquote><p>La conjecture de Goldbach stipule que tout nombre <span class="mw-redirect">entier</span> pair strictement supérieur à 2 peut être écrit comme la somme de deux nombres premiers (le même nombre premier pouvant être utilisé plusieurs fois). C&#8217;est l&#8217;un des plus vieux problèmes non résolus de la théorie des nombres et des mathématiques.</p></blockquote>
<p>J&#8217;ai donc encore fait un script Python. Il s&#8217;arrêtera quand il ne trouvera pas de somme de deux nombre premiers pour un nombre pair.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">math</span> <span style="color: #ff7700;font-weight:bold;">import</span> sqrt<span style="color: #66cc66;">;</span>
<span style="color: #ff7700;font-weight:bold;">def</span> MaJpremiers <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">global</span> tab,i<span style="color: #66cc66;">;</span>
	index,suivant = <span style="color: #ff4500;">0</span>,tab<span style="color: black;">&#91;</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>tab<span style="color: black;">&#41;</span> - <span style="color: #ff4500;">1</span> <span style="color: black;">&#93;</span> + <span style="color: #ff4500;">2</span><span style="color: #66cc66;">;</span>
	<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: black;">&#40;</span>tab<span style="color: black;">&#91;</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>tab<span style="color: black;">&#41;</span> - <span style="color: #ff4500;">1</span> <span style="color: black;">&#93;</span> <span style="color: #66cc66;">&lt;</span>= i<span style="color: black;">&#41;</span>:
		<span style="color: #ff7700;font-weight:bold;">while</span> tab<span style="color: black;">&#91;</span>index<span style="color: black;">&#93;</span> <span style="color: #66cc66;">&lt;</span>= sqrt<span style="color: black;">&#40;</span> suivant <span style="color: black;">&#41;</span>:
			index += <span style="color: #ff4500;">1</span><span style="color: #66cc66;">;</span>
			<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span> <span style="color: black;">&#40;</span>suivant <span style="color: #66cc66;">%</span> tab<span style="color: black;">&#91;</span>index<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> == <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>:
				suivant , index = suivant + <span style="color: #ff4500;">2</span> , <span style="color: #ff4500;">0</span><span style="color: #66cc66;">;</span>
		tab,suivant,index = tab + <span style="color: black;">&#91;</span>suivant<span style="color: black;">&#93;</span> , suivant + <span style="color: #ff4500;">2</span> , <span style="color: #ff4500;">0</span><span style="color: #66cc66;">;</span>
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">1</span><span style="color: #66cc66;">;</span>
<span style="color: #ff7700;font-weight:bold;">def</span> testSomme <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">global</span> tab,i<span style="color: #66cc66;">;</span>
	a,b,t = <span style="color: #ff4500;">0</span>,<span style="color: #ff4500;">0</span>,<span style="color: #008000;">len</span><span style="color: black;">&#40;</span>tab<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
	<span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>,t<span style="color: black;">&#41;</span>:
		<span style="color: #ff7700;font-weight:bold;">for</span> b <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>t-<span style="color: #ff4500;">1</span>,a-<span style="color: #ff4500;">1</span>,-<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:
			<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>tab<span style="color: black;">&#91;</span>a<span style="color: black;">&#93;</span>+tab<span style="color: black;">&#91;</span>b<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>==i<span style="color: black;">&#41;</span>:
				<span style="color: #ff7700;font-weight:bold;">print</span> i,<span style="color: #483d8b;">&quot;=&quot;</span>,tab<span style="color: black;">&#91;</span>a<span style="color: black;">&#93;</span>,<span style="color: #483d8b;">&quot;+&quot;</span>,tab<span style="color: black;">&#91;</span>b<span style="color: black;">&#93;</span><span style="color: #66cc66;">;</span>
				<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">1</span><span style="color: #66cc66;">;</span>
			<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>tab<span style="color: black;">&#91;</span>a<span style="color: black;">&#93;</span>+tab<span style="color: black;">&#91;</span>b<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">&lt;</span>= <span style="color: #008000;">max</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:
	i += <span style="color: #ff4500;">2</span><span style="color: #66cc66;">;</span>
	MaJpremiers<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<h2>Limites</h2>
<p>Ces scripts n&#8217;iront pas plus loin que ce que les super-calculateurs ont démontré jusque là. La simplicité du code fait que ces scripts vont être de plus en plus lent au fur et à mesure qu&#8217;il tournent à cause des listes de premiers qui s&#8217;agrandissent. Pensez donc à faire Ctrl+C pour stopper ces scripts puisque les nombres premiers sont <a title="Infinité des nombres premiers" href="http://fr.wikipedia.org/wiki/Nombre_premier#Infinit.C3.A9_des_nombres_premiers">réputés infinis</a> et la conjecture de Goldbach n&#8217;a <a title="État des recherches" href="http://fr.wikipedia.org/wiki/Conjecture_de_Goldbach#.C3.89tat_des_recherches">toujours pas été infirmées</a>.</p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl" target="_blank"><img class="size-full wp-image-36 aligncenter" title="Creative Commons GNU GPL" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/cc-gpl-a.png" alt="Creative Commons GNU GPL" width="88" height="62" /></a></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl">Programmes sous Creative Commons GNU GPL</a></p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/0-sCKQbhuk8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/01/28/nombres-premiers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/01/28/nombres-premiers</feedburner:origLink></item>
		<item>
		<title>Résolveur de Sudoku en C++</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/cfWB9gbqYpE/resolveur-de-sudoku-en-cpp</link>
		<comments>http://pas-bien.net/blog/2009/01/27/resolveur-de-sudoku-en-cpp#comments</comments>
		<pubDate>Tue, 27 Jan 2009 09:13:03 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Projets]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[résolveur]]></category>
		<category><![CDATA[Sudoku]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=56</guid>
		<description><![CDATA[Je souhaite vous faire profiter d&#8217;un petit projet personnel que j&#8217;avais réalisé en 2006 : un résolveur de sudoku (9&#215;9) en C++. Vous trouverez dans l&#8217;archive :

les sources,
quelques grilles,
le fichier de projet Dev-C++.

Les grilles à résoudre sont représentée dans les fichiers par une suite de chiffre qui peuvent être mis en forme (les caractère qui [...]]]></description>
			<content:encoded><![CDATA[<p>Je souhaite vous faire profiter d&#8217;un petit projet personnel que j&#8217;avais réalisé en 2006 : un résolveur de sudoku (9&#215;9) en C++. Vous trouverez dans l&#8217;archive :</p>
<ul>
<li>les sources,</li>
<li>quelques grilles,</li>
<li>le fichier de projet Dev-C++.</li>
</ul>
<p>Les grilles à résoudre sont représentée dans les fichiers par une suite de chiffre qui peuvent être mis en forme (les caractère qui ne sont pas numériques sont ignorés, les zéros représentent les inconnues). Les deux exemples suivants sont deux représentations de la même grille :</p>
<ul>
<li> <code>907500006006009007001002000<br />
000004130000000000038090000<br />
004700200500400800070003605</code></li>
<li><code>9 0 7|5 0 0|0 0 6<br />
0 0 6|0 0 9|0 0 7<br />
0 0 1|0 0 2|0 0 0<br />
-----------------<br />
0 0 0|0 0 4|1 3 0<br />
0 0 0|0 0 0|0 0 0<br />
0 3 8|0 9 0|0 0 0<br />
-----------------<br />
0 0 4|7 0 0|2 0 0<br />
5 0 0|4 0 0|8 0 0<br />
0 7 0|0 0 3|6 0 5</code></li>
</ul>
<p>Je sais qu&#8217;il existe déjà plein de résolveurs sur le Web mais celui là, il pense comme moi <img src='http://pas-bien.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  : il applique mes méthodes de résolutions et il se trouve bloqué au mêmes endroits que moi sur les grilles complexes&#8230;</p>
<p><p style="border-top: 2px solid rgb(65, 105, 175); border-bottom: 2px solid rgb(65, 105, 175); padding: 5px 20px 5px 45px; background: rgb(223, 235, 255) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/world.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/resolveur-sudoku-001.zip">Télécharger le résolveur (version 0.0.1)</a></p></p>
<ul></ul>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl" target="_blank"><img class="size-full wp-image-36 aligncenter" title="Creative Commons GNU GPL" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/cc-gpl-a.png" alt="Creative Commons GNU GPL" width="88" height="62" /></a></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl">Programme sous Creative Commons GNU GPL</a></p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/cfWB9gbqYpE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/01/27/resolveur-de-sudoku-en-cpp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/01/27/resolveur-de-sudoku-en-cpp</feedburner:origLink></item>
		<item>
		<title>NewZ</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/FOliO0U0dGs/newz</link>
		<comments>http://pas-bien.net/blog/2009/01/26/newz#comments</comments>
		<pubDate>Mon, 26 Jan 2009 18:14:29 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Le blog]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Radio.Blog.Club]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=53</guid>
		<description><![CDATA[Ajourd&#8217;hui, le blog change de thème. Peut être un thème personnel viendra quand je prendrai le temps de le faire.
J&#8217;en profite aussi pour dire (avec un ou deux ans de retard&#8230;) que mes outils pour radioblogclub.com ne marche plus êtant donné que le site a fermé.
Pour rappel :

Radio Blog Tools (http://pas-bien.net/rbtools/) : générateur de playlists [...]]]></description>
			<content:encoded><![CDATA[<p>Ajourd&#8217;hui, le blog change de thème. Peut être un thème personnel viendra quand je prendrai le temps de le faire.</p>
<p>J&#8217;en profite aussi pour dire (avec un ou deux ans de retard&#8230;) que mes outils pour radioblogclub.com ne marche plus êtant donné que le site a fermé.</p>
<p>Pour rappel :</p>
<ul>
<li>Radio Blog Tools (<a href="http://pas-bien.net/rbtools/">http://pas-bien.net/rbtools/</a>) : générateur de playlists et de listes de téléchargement.</li>
<li>Radio Blog Proxy (<a href="http://pas-bien.net/rbproxy/">http://pas-bien.net/rbproxy/</a>) : un proxy basé sur rbtools pour ceux qui étaient bloqués par un proxy.</li>
</ul>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/FOliO0U0dGs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/01/26/newz/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/01/26/newz</feedburner:origLink></item>
		<item>
		<title>Filtrez vos flux RSS avec ce qui vous intéresse</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/IrbZ4hdqEAE/filtrez-vos-flux-rss-avec-ce-qui-vous-interesse</link>
		<comments>http://pas-bien.net/blog/2009/01/26/filtrez-vos-flux-rss-avec-ce-qui-vous-interesse#comments</comments>
		<pubDate>Mon, 26 Jan 2009 17:37:30 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[Projets]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=33</guid>
		<description><![CDATA[Pour quoi faire ?
J&#8217;utilise pas mal les flux RSS pour me simplifier certaines choses. Comme par exemple l&#8217;arrivée d&#8217;un nouvel épisode d&#8217;une des séries que je suis. Un de mes &#8220;problèmes&#8221; était que je recevais des actualités dont je n&#8217;avais rien à faire. Je me suis donc créé un petit outil PHP qui récupère les [...]]]></description>
			<content:encoded><![CDATA[<h2>Pour quoi faire ?</h2>
<p>J&#8217;utilise pas mal les flux RSS pour me simplifier certaines choses. Comme par exemple l&#8217;arrivée d&#8217;un nouvel épisode d&#8217;une des séries que je suis. Un de mes &#8220;problèmes&#8221; était que je recevais des actualités dont je n&#8217;avais rien à faire. Je me suis donc créé un petit outil PHP qui récupère les flux RSS de différents sites, les filtre et les regroupe en un seul.</p>
<h2>Comment ça marche ?</h2>
<p>Il y a deux moyens d&#8217;utiliser cet outil.</p>
<h3>Première utilisation</h3>
<p>Avec des paramètres GET :</p>
<ul>
<li>feeds : la liste des flux séparés par une virgule.</li>
<li>filters : la liste des filtres d&#8217;inclusions aussi séparés par une virgule.</li>
<li>excludes (optionnel) : encore une liste séparée par des virgule pour forcer l&#8217;exclusion d&#8217;items qui sont passés.</li>
<li>debug  (optionnel)  : pour recevoir dans le flux généré les erreurs qui se sont produites.</li>
</ul>
<p>Exemple :</p>
<p style="padding-left: 30px;">http://example.com/rss-filter/rssfilter.php?feeds=http://www.toto.com/rssfr.xml,http://www.tata.fr/rss.xml&amp;filters=CSI,CSI Miami,House&amp;exclude=Desperate&amp;debug=1</p>
<h3>Deuxième utilisation</h3>
<p>Avec un fichier XML dans le sous dossier <em>files</em> qui contient la configuration. Les filtres sont des <a href="http://fr3.php.net/manual/fr/regexp.reference.php">expréssions régulières</a>. Exemle de fichier XML :</p>
<p style="padding-left: 30px;">http://example.com/rss-filter/files/series.xml</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>[EZTV+VTV+subs] Filtrés<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Séries : Dexter, Dirty Sexy Money, Fringe, Grey's Anatomy, Heroes, House, How I Met Your Mother, Lost, My Name Is Earl, Naruto Shippuuden, The IT Crowd, The United State Of Tara, True Blood, Weeds.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;feeds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- sous titres --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.tvsubtitles.net/rssfr.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.sub-way.fr/rss.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://feeds.feedburner.com/seriessub<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- séries --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.mininova.org/rss.xml?user=VTV<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.mininova.org/rss.xml?user=EZTV<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- naruto --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.dattebayo-fr.com/rss-news.php<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/feed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/feeds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;includes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bDexter\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bDirty Sexy Money\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bFringe\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bGrey'?s? Anatomy\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bHeroes\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bHouse\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bHow I Met Your Mother\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bLost\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bMy Name Is Earl\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bNaruto Shippuuden\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bThe Mentalist\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bThe IT Crowd\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bSons of Anarchy\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bUnited States Of Tara\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bTrue Blood\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bWeeds\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/includes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;excludes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bCrooked House\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bDesperate Housewives\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/\bx264\b/i<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/excludes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Le flux correspondant sera disponnible comme ceci :</p>
<p style="padding-left: 30px;">http://example.com/rss-filter/rssfilter.php?file=series</p>
<p style="padding-left: 30px;">http://example.com/rss-filter/rssfilter.php?file=series&amp;debug=1 (pour avoir le debug en plus)</p>
<h2>Installation</h2>
<p><p style="border-top: 2px solid rgb(255, 211, 36); border-bottom: 2px solid rgb(255, 211, 36); padding: 5px 20px 5px 45px; background: rgb(255, 246, 191) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/alert.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(153, 102, 102);">Votre navigateur risque d&#8217;essayer de parser le fichier rssfilter.txt en tant que flux RSS.</p>Posez le fichier <a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/rssfilter.txt">rssfilter.php</a> sur un serveur Web qui dispose de :</p>
<ul>
<li>PHP 5,</li>
<li>la fonction file_get_contents,</li>
<li>L&#8217;extension SimpleXML.</li>
</ul>
<p><p style="border-top: 2px solid rgb(192, 192, 192); border-bottom: 2px solid rgb(192, 192, 192); padding: 5px 20px 5px 45px; background: rgb(240, 240, 240) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/download.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/rssfilter.txt">Télécharger rssfilter.php</a></p></p>
<h2>Questions ?</h2>
<p>En cas de problème n&#8217;ésitez pas à me poser des questions dans les commentaire <img src='http://pas-bien.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl" target="_blank"><img class="size-full wp-image-36 aligncenter" title="Creative Commons GNU GPL" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/cc-gpl-a.png" alt="Creative Commons GNU GPL" width="88" height="62" /></a></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl">Programme sous Creative Commons GNU GPL</a></p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/IrbZ4hdqEAE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/01/26/filtrez-vos-flux-rss-avec-ce-qui-vous-interesse/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/01/26/filtrez-vos-flux-rss-avec-ce-qui-vous-interesse</feedburner:origLink></item>
		<item>
		<title>Résolveur de taquin</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/y1_qEJ7eXoQ/resolveur-de-taquin</link>
		<comments>http://pas-bien.net/blog/2009/01/10/resolveur-de-taquin#comments</comments>
		<pubDate>Sat, 10 Jan 2009 20:47:03 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Projets]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[DS]]></category>
		<category><![CDATA[enigme 135]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[résolveur]]></category>
		<category><![CDATA[Taquin]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/?p=11</guid>
		<description><![CDATA[Je ne sais pas si quand vous vous lancez dans une énigme et que vous ne trouvez pas la solution, vous finissez par juste vouloir la réponse pour passer à autre chose. Ce fût mon cas récemment avec : l&#8217;énigme 135 du jeu Professeur Layton et l&#8217;étrange village sur Nintendo DS.
Quand je suis bloqué comme [...]]]></description>
			<content:encoded><![CDATA[<p>Je ne sais pas si quand vous vous lancez dans une énigme et que vous ne trouvez pas la solution, vous finissez par juste vouloir la réponse pour passer à autre chose. Ce fût mon cas récemment avec : l&#8217;<strong>énigme 135</strong> du jeu <strong><a title="Site officiel du jeu" href="http://www.nintendo.fr/NOE/fr_FR/games/nds/professeur_layton_et_ltrange_village_9436.html" target="_blank">Professeur Layton et l&#8217;étrange village</a></strong> sur <strong>Nintendo DS</strong>.</p>
<p>Quand je suis bloqué comme ça, j&#8217;aime pas non plus qu&#8217;on me donne la solution bêtement. Je préfère un compromis (un peu geek certe) : faire un programme qui va résoudre l&#8217;énigme à ma place.</p>
<h3>Solution</h3>
<p>Pour ceux qui <strong>viennent de Google</strong> et qui en ont rien à faire de mon code, la liste des étapes pour résoudre l&#8217;énigme est là :</p>
<p><p style="border-top: 2px solid rgb(65, 105, 175); border-bottom: 2px solid rgb(65, 105, 175); padding: 5px 20px 5px 45px; background: rgb(223, 235, 255) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/world.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/solution.txt">Solution énigme 135</a></p></p>
<p>Pour comprendre la représentation du taquin :</p>
<table style="text-align: left; height: 138px;" border="0" width="311">
<tbody>
<tr>
<td>
<p style="text-align: center;"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/135e.gif"><img class="alignnone size-full wp-image-133" title="Énigme 135" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/135e.gif" alt="Énigme 135" width="159" height="128" /></a></p>
</td>
<td>&lt;-&gt;</td>
<td>
<pre>&lt;&gt;&lt;&gt;@
12^@
34v@
&lt;&gt;&lt;&gt;@</pre>
</td>
</tr>
</tbody>
</table>
<h3>Code</h3>
<p>Pour ceux qui sont intéressés par comment j&#8217;ai fait, voici une brève explication :</p>
<ol>
<li>Il y a trois listes importantes : celle des taquins générés, celle des taquins à explorer et celle des taquin qui sont dans la position finale (juste avant la sortie).</li>
<li>On insère la position de départ dans les listes.</li>
<li>On explore : c&#8217;est à dire qu&#8217;on génère tous les taquins possibles à partir d&#8217;un autre.</li>
<li>Les nouveaux taquins ne doivent pas correspondre à  un autre déjà existant. Si ce n&#8217;est pas le cas, on ajoute le nouveau à la liste des taquins trouvés et à celle à explorer.</li>
<li>Si certains sont en position finale on les ajoute à la liste de taquins finaux.</li>
<li>Si il y a un taquin (ou plus) dans la liste à explorer, on prend le premier et on retourne à l&#8217;étape 3.</li>
<li>Quand il n&#8217;y a plus rien à explorer, c&#8217;est qu&#8217;on a fait le tour des possibilités de mouvements. On prend le premier des finaux et on affiches les étapes qui ont conduit à sa création.</li>
</ol>
<p>Défauts du scripts :</p>
<ul>
<li>La représentation du taquin est un tableau de caractère ce qui n&#8217;est pas très propre mais ça marche.</li>
<li>La méthode n&#8217;est pas très intelligente, c&#8217;est du brute force qui tâche mais pour une fois j&#8217;ai fait un brute en itératif et non en récursif.</li>
<li>Les solutions ne sont pas forcement les plus courtes.</li>
</ul>
<p>Pour le dernier point, j&#8217;essairai d&#8217;y remédier si j&#8217;en ai la motivation car ça va prendre du temps (pour rien, ça on peut le dire).</p>
<p>Voici la source du programme, c&#8217;est du <strong>python</strong>.</p>
<p><p style="border-top: 2px solid rgb(192, 192, 192); border-bottom: 2px solid rgb(192, 192, 192); padding: 5px 20px 5px 45px; background: rgb(240, 240, 240) url(http://pas-bien.net/blog/wp-content/plugins/NiceWeb2CSS/icon/download.gif) no-repeat scroll 15px 50%; text-align: left; color: rgb(102, 102, 102);"><a href="http://pas-bien.net/blog/wp-content/uploads/2009/01/enigme-1351.py">enigme-135.py</a></p></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl" target="_blank"><img class="size-full wp-image-36 aligncenter" title="Creative Commons GNU GPL" src="http://pas-bien.net/blog/wp-content/uploads/2009/01/cc-gpl-a.png" alt="Creative Commons GNU GPL" width="88" height="62" /></a></p>
<p style="text-align: center;"><a href="http://creativecommons.org/license/cc-gpl">Programme sous Creative Commons GNU GPL</a></p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/y1_qEJ7eXoQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2009/01/10/resolveur-de-taquin/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2009/01/10/resolveur-de-taquin</feedburner:origLink></item>
		<item>
		<title>Playlist deezer ;)</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/utPWbsxfOME/playlist-deezer</link>
		<comments>http://pas-bien.net/blog/2008/06/27/playlist-deezer#comments</comments>
		<pubDate>Fri, 27 Jun 2008 15:33:32 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Musique]]></category>
		<category><![CDATA[Deezer]]></category>
		<category><![CDATA[musique]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/playlist-deezer</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<div style="width:450px;height:345px;"><object width="450" height="345"><param name="movie" value="http://www.deezer.com/embedded/widget_450x345.swf?path=8452919&#038;lang=FR&#038;autoplay=0&#038;autoShuffle=1&#038;id=675926"></param><embed src="http://www.deezer.com/embedded/widget_450x345.swf?path=8452919&#038;lang=FR&#038;autoplay=0&#038;autoShuffle=1&#038;id=675926" type="application/x-shockwave-flash" width="450" height="345"></embed></object></div>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/utPWbsxfOME" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2008/06/27/playlist-deezer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2008/06/27/playlist-deezer</feedburner:origLink></item>
		<item>
		<title>Utilisation avancée de file_get_contents (PHP)</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/kZwC_jWqHP8/utilisation-avancee-de-file_get_contents-php</link>
		<comments>http://pas-bien.net/blog/2007/12/21/utilisation-avancee-de-file_get_contents-php#comments</comments>
		<pubDate>Fri, 21 Dec 2007 09:54:13 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Notes Techniques]]></category>
		<category><![CDATA[authentification]]></category>
		<category><![CDATA[file_get_contents]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/utilisation-avancee-de-file_get_contents-php</guid>
		<description><![CDATA[Préambule
Je fais cette note technique car je me suis plus d&#8217;une fois confronté à différentes configurations pour accéder à une page Web à partir de PHP. Normalement un serveur Web dispose d&#8217;une connection directe à internet et n&#8217;a pas besoin d&#8217;un proxy pour y acceder. Mais si on fait des script PHP en CLI (non [...]]]></description>
			<content:encoded><![CDATA[<h2>Préambule</h2>
<p>Je fais cette note technique car je me suis plus d&#8217;une fois confronté à différentes configurations pour accéder à une page Web à partir de PHP. Normalement un serveur Web dispose d&#8217;une connection directe à internet et n&#8217;a pas besoin d&#8217;un proxy pour y acceder. Mais si on fait des script PHP en CLI (non liès à un serveur Web) on peut se trouver confronter à différents problèmes&#8230;</p>
<h2>Cas 1 : la simplicité même</h2>
<p>Voici le cas le plus simple pour récupérer un page à partir de son URL. Dnas le cas où PHP dispose d&#8217;un accès direct à internet.</p>
<h3>HTTP</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.google.com/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>HTTPS</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;https://www.google.com/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Si il vous manque l&#8217;extension <em>open_ssl</em> vous aurez une erreur dans ce genre :</p>
<pre>Notice: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in ...\test_001.php on line 3

Warning: file_get_contents(https://www.google.com/): failed to open stream: Invalid argument in ...\test_001.php on line 3</pre>
<p>C&#8217;est aussi valable pour les cas suivants.</p>
<h2>Cas 2 : Authentification HTML</h2>
<p>Si la page est protégée par un mot de passe, PHP peut transformer une URL avec utilisateur et mot de passe pour envoyer la requête avec les bons headers.</p>
<h3>HTTP</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://user:pass@www.example.com/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>HTTPS</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;https://user:pass@www.example.com/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Méthode alternative</h3>
<p>Vous pouvez aussi envoyer vous même les headers contenant mots de passe et utilisateur. C&#8217;est plus compliqué mais ça marche aussi.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// URL des données à récupérer</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://protectedstuff.com'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Encodage de l'autentification</span>
<span style="color: #000088;">$auth</span> <span style="color: #339933;">=</span> <span style="color: #990000;">base64_encode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user:password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création des options de la requête</span>
<span style="color: #000088;">$opts</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'http'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'method'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'GET'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'header'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Authorization: Basic <span style="color: #006699; font-weight: bold;">$auth</span>&quot;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'https'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'method'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'GET'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'header'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Authorization: Basic <span style="color: #006699; font-weight: bold;">$auth</span>&quot;</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création du contexte de transaction</span>
<span style="color: #000088;">$ctx</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stream_context_create</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$opts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Récupération des données</span>
<span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$ctx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Source : <a href="http://fr.php.net/manual/fr/function.stream-context-create.php#74431" target="_blank">http://fr.php.net/manual/fr/function.stream-context-create.php#74431</a></p>
<h2>Cas 3 : En passant par un proxy</h2>
<p>Il m&#8217;est arrivé d&#8217;écrire des script en PHP-CLI qui se retrouvaient bloqués par un proxy.</p>
<h3>HTTP ou HTTPS</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// URL des données à récupérer</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'https://www.google.com/'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création des options de la requête</span>
<span style="color: #000088;">$opts</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'http'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'proxy'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tcp://192.168.0.99:3128'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'request_fulluri'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'https'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'proxy'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tcp://192.168.0.99:3128'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'request_fulluri'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création du contexte de transaction</span>
<span style="color: #000088;">$ctx</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stream_context_create</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$opts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Récupération des données</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$ctx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Cas 4 : Proxy et page avec authentification HTML</h2>
<p>Si en plus la page que vous souhaitez télécharger requière une authentification, cela reste simple.</p>
<h3>HTTP ou HTTPS</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// URL des données à récupérer</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'https://user:pass@www.example.com/'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création des options de la requête</span>
<span style="color: #000088;">$opts</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'http'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'proxy'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tcp://192.168.0.99:3128'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'request_fulluri'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'https'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'proxy'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tcp://192.168.0.99:3128'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'request_fulluri'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création du contexte de transaction</span>
<span style="color: #000088;">$ctx</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stream_context_create</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$opts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Récupération des données</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$ctx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Cas 5 : Proxy avec authentification</h2>
<p>Dans certaines entreprises ou administration on peut se trouver derrière un proxy qui filtre les utilisateurs. Voici comment faire passer son script.</p>
<h3>HTTP ou HTTPS</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// URL des données à récupérer</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.example.com/'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Encodage de l'autentification</span>
<span style="color: #000088;">$authProxy</span> <span style="color: #339933;">=</span> <span style="color: #990000;">base64_encode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user:pass'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création des options de la requête</span>
<span style="color: #000088;">$opts</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'http'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'method'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'GET'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'proxy'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tcp://192.168.0.99:3128'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'request_fulluri'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'header'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Proxy-Authorization: Basic <span style="color: #006699; font-weight: bold;">$authProxy</span>&quot;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'https'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'method'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'GET'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'proxy'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tcp://192.168.0.99:3128'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'request_fulluri'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'header'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Proxy-Authorization: Basic <span style="color: #006699; font-weight: bold;">$authProxy</span>&quot;</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création du contexte de transaction</span>
<span style="color: #000088;">$ctx</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stream_context_create</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$opts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Récupération des données</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$ctx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Cas 6 : Proxy avec authentification et page avec authentification</h2>
<p>Voici un des cas les plus complexes lorqu&#8217;il est question de récupérer des données. J&#8217;ai rencontré ce problème lorsque j&#8217;ai fait un script pour récupérer mes logs chez OVH.</p>
<h3>HTTP ou HTTPS</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// URL des données à récupérer</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'https://user:pass@www.example.com/'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Encodage de l'autentification</span>
<span style="color: #000088;">$authProxy</span> <span style="color: #339933;">=</span> <span style="color: #990000;">base64_encode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user:pass'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création des options de la requête</span>
<span style="color: #000088;">$opts</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'http'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'method'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'GET'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'proxy'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tcp://192.168.0.99:3128'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'request_fulluri'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'header'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Proxy-Authorization: Basic <span style="color: #006699; font-weight: bold;">$authProxy</span>&quot;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'https'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'method'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'GET'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'proxy'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tcp://192.168.0.99:3128'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'request_fulluri'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'header'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Proxy-Authorization: Basic <span style="color: #006699; font-weight: bold;">$authProxy</span>&quot;</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Création du contexte de transaction</span>
<span style="color: #000088;">$ctx</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stream_context_create</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$opts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Récupération des données</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$ctx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Conclusion</h2>
<p>Les exemples présentés ne se limitent aux cas typique de récupération de pages distantes. Ces cas seront satisfaisant dans la plupart des cas. Si vous rencontrez un cas non décrit dans cet article vous trouverez peut être de l&#8217;aide <a href="http://www.php.documentation.givah.net/?p=wrappers.http.html" target="_blank">ici</a>. Et si vous avez toujours des problèmes vous pouvez me demander de l&#8217;aide dans les commentaires. <img src='http://pas-bien.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/kZwC_jWqHP8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2007/12/21/utilisation-avancee-de-file_get_contents-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2007/12/21/utilisation-avancee-de-file_get_contents-php</feedburner:origLink></item>
		<item>
		<title>Fréquentation de mon site web</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/MUZSOWMnRqc/frequentation-de-mon-site-web</link>
		<comments>http://pas-bien.net/blog/2007/12/20/frequentation-de-mon-site-web#comments</comments>
		<pubDate>Thu, 20 Dec 2007 09:18:25 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Logs]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/frequentation-de-mon-site-web</guid>
		<description><![CDATA[Je viens de jeter un coup d&#8217;oeil dans le logs bruts d&#8217;Apache et je suis tombé sur :
proxy.kunsan.af.mil pas-bien.net &#8211; [19/Dec/2007:17:53:49 +0100] &#8220;GET /rbproxy/ HTTP/1.1&#8243; 200 33737 &#8220;http://www.google.com/search?q=Radioblog+Proxy&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)&#8221;
Du coup qu&#8217;est ce que af.mil ? Une recherche sur Google : l&#8217;Air [...]]]></description>
			<content:encoded><![CDATA[<p>Je viens de jeter un coup d&#8217;oeil dans le logs bruts d&#8217;Apache et je suis tombé sur :</p>
<blockquote><p>proxy.kunsan.af.mil pas-bien.net &#8211; [19/Dec/2007:17:53:49 +0100] &#8220;GET /rbproxy/ HTTP/1.1&#8243; 200 33737 &#8220;http://www.google.com/search?q=Radioblog+Proxy&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)&#8221;</p></blockquote>
<p>Du coup qu&#8217;est ce que af.mil ? Une recherche sur Google : l&#8217;<a href="http://www.af.mil/">Air Force</a> des États Unis.</p>
<p>Mais Kunsan, c&#8217;est une base ? Ben oui et après une petite recherche, <a href="http://www.kunsan.af.mil/">une base en Corée du sud</a>.</p>
<p align="center"> <iframe src="http://maps.google.fr/maps?f=q&amp;hl=fr&amp;geocode=10559433785258804932,35.910610,126.624502&amp;time=&amp;date=&amp;ttype=&amp;q=Kunsan+Air+Base+%4035.910610,126.624502&amp;ie=UTF8&amp;ll=35.926591,126.632881&amp;spn=0.083983,0.142136&amp;t=h&amp;z=13&amp;iwloc=addr&amp;om=1&amp;output=embed&amp;s=AARTsJpICnTP7hq1fTqSCUbMeOkuewC0Pg" marginheight="0" marginwidth="0" frameborder="0" height="350" scrolling="no" width="425"></iframe><br />
<small><a href="http://maps.google.fr/maps?f=q&amp;hl=fr&amp;geocode=10559433785258804932,35.910610,126.624502&amp;time=&amp;date=&amp;ttype=&amp;q=Kunsan+Air+Base+%4035.910610,126.624502&amp;ie=UTF8&amp;ll=35.926591,126.632881&amp;spn=0.083983,0.142136&amp;t=h&amp;z=13&amp;iwloc=addr&amp;om=1&amp;source=embed" style="color: #0000ff; text-align: left">Agrandir le plan</a></small></p>
<p>Ca doit ceux qui viennent le plus loin sur mon site.</p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/MUZSOWMnRqc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2007/12/20/frequentation-de-mon-site-web/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2007/12/20/frequentation-de-mon-site-web</feedburner:origLink></item>
		<item>
		<title>Permier sujet.</title>
		<link>http://feedproxy.google.com/~r/pas-bien/VFhb/~3/DIgYJliYV-I/permier-article</link>
		<comments>http://pas-bien.net/blog/2007/12/19/permier-article#comments</comments>
		<pubDate>Wed, 19 Dec 2007 12:22:38 +0000</pubDate>
		<dc:creator>Vincent Rémond</dc:creator>
				<category><![CDATA[Le blog]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://pas-bien.net/blog/article/permier-article</guid>
		<description><![CDATA[Bon alors voila je me suis fait un blog mais je sais pas encore pourquoi&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Bon alors voila je me suis fait un blog mais je sais pas encore pourquoi&#8230;</p>
<img src="http://feeds.feedburner.com/~r/pas-bien/VFhb/~4/DIgYJliYV-I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pas-bien.net/blog/2007/12/19/permier-article/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://pas-bien.net/blog/2007/12/19/permier-article</feedburner:origLink></item>
	</channel>
</rss>
