<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.6" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Hyperthèse</title>
	<link>http://hyperthese.net</link>
	<description>La connaissance supposée fausse</description>
	<pubDate>Mon, 08 Sep 2008 09:20:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.6</generator>
	<language>en</language>
			<item>
		<title>Free dans le marché de la téléphonie mobile ?</title>
		<link>http://hyperthese.net/free-dans-le-marche-de-la-telephonie-mobile/</link>
		<comments>http://hyperthese.net/free-dans-le-marche-de-la-telephonie-mobile/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 09:20:10 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>Divers</category>

		<guid isPermaLink="false">http://hyperthese.net/free-dans-le-marche-de-la-telephonie-mobile/</guid>
		<description><![CDATA[Tout est dans le titre&#8230; Avouez que ça ferai du bien non ?
Ils font maintenant une jolie pétition qu&#8217;on peut signer : http://www.freemobileasso.com/

]]></description>
			<content:encoded><![CDATA[<p>Tout est dans le titre&#8230; Avouez que ça ferai du bien non ?<br />
Ils font maintenant une jolie pétition qu&#8217;on peut signer : <a href="http://www.freemobileasso.com/">http://www.freemobileasso.com/</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/free-dans-le-marche-de-la-telephonie-mobile/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Chrome Of The Day</title>
		<link>http://hyperthese.net/chrome-of-the-day/</link>
		<comments>http://hyperthese.net/chrome-of-the-day/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 17:32:28 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>CoTD</category>

		<guid isPermaLink="false">http://hyperthese.net/chrome-of-the-day/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;"><a class="imagelink" href="http://hyperthese.net/wp-content/uploads/2008/09/cotd.png" title="Chrome Of The Day"><img id="image115" src="http://hyperthese.net/wp-content/uploads/2008/09/cotd_mini.png" alt="Chrome Of The Day" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/chrome-of-the-day/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Big Brother is watching you</title>
		<link>http://hyperthese.net/big-brother-is-watching-you/</link>
		<comments>http://hyperthese.net/big-brother-is-watching-you/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 09:50:21 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>Internet</category>

		<category>Google</category>

		<guid isPermaLink="false">http://hyperthese.net/big-brother-is-watching-you/</guid>
		<description><![CDATA[Original le titre hein ?
Allez devinez de qui je vais parler &#8230; G&#8230; goo&#8230;. google ! Supris hein ?
Depuis quelques temps on a installé un proxy dans ma résidence, pour des raisons de meilleur partage des ressources (par ce que on est 150 et que y&#8217;a que 3 misérables lignes ADSL grand public). Mais y&#8217;a [...]]]></description>
			<content:encoded><![CDATA[<p>Original le titre hein ?<br />
Allez devinez de qui je vais parler &#8230; G&#8230; goo&#8230;. google ! Supris hein ?<br />
Depuis quelques temps on a installé un proxy dans ma résidence, pour des raisons de meilleur partage des ressources (par ce que on est 150 et que y&#8217;a que 3 misérables lignes ADSL grand public). Mais y&#8217;a quelques jour j&#8217;ai tilté un truc : vu que y&#8217;a un proxy, on peut faire des logs des <a href="http://fr.wikipedia.org/wiki/Referer">referers</a>. Et avec ces logs on peut trouver des informations intéressantes, comme par exemple les sites qui embarquent des pubs adsense ou qui utilisent google analytics. J&#8217;ai donc laissé mûrir 2 jours (on en est à 106Mo de logs), et j&#8217;ai fait un petit script qui analyse ces logs pour me dire quels domaines ont été vu en referer d&#8217;un site google. Ainsi on peut savoir quel pourcentage de sites utilise un service google (le test a été fait sur 2378 domaines) :</p>
<ul>
<li><em>Google Analytics</em>: 33,22%</li>
<li><em>AdSense</em>: 20,27%</li>
<li><em>DoubleClick</em>: 10,05%</li>
<li><em>Youtube</em>: 2,61%</li>
<li><strong>Total (domaines google)</strong>: 46,30%</li>
<li><strong>Total</strong>: 51,47%</li>
</ul>
<p>(note: si vous aditionnez tout vous allez trouver plus du total, c&#8217;est normal : certains sites ont à la fois google analytics et adsense par exemple)</p>
<p>Pour résumer : 51,47% des sites internet (un peu moins en fait, la methode des referers a ses failles&#8230;) embarquent sur leurs pages un élément qui permet à google d&#8217;avoir des statistiques détaillées des visites du site, et en recoupant avec leurs diverses données leur permet d&#8217;identifier personellement certains utilisateurs, ou encore de tracer les possésseurs de google accounts.</p>
<p>Affaire à suivre ! Au prochain épisode : comment sortir des radars de google ?
</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/big-brother-is-watching-you/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Entroptymisator Image 1</title>
		<link>http://hyperthese.net/entroptymisator-image-1/</link>
		<comments>http://hyperthese.net/entroptymisator-image-1/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 23:17:50 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>Divers</category>

		<category>C++</category>

		<guid isPermaLink="false">http://hyperthese.net/entroptymisator-image-1/</guid>
		<description><![CDATA[Avant hier un ami m&#8217;a filé un lien sur wikipedia expliquant la compression JPEG. J&#8217;ai trouvé ça plutôt amusant, et je me suis dit que ça serait rigolo de faire un format de compression d&#8217;images. Alors j&#8217;ai cherché un concept à appliquer, et puis je me suis souvenu d&#8217;un truc que j&#8217;avais pensé entre deux [...]]]></description>
			<content:encoded><![CDATA[<p>Avant hier un ami m&#8217;a filé un lien sur wikipedia expliquant la compression JPEG. J&#8217;ai trouvé ça plutôt amusant, et je me suis dit que ça serait rigolo de faire un format de compression d&#8217;images. Alors j&#8217;ai cherché un concept à appliquer, et puis je me suis souvenu d&#8217;un truc que j&#8217;avais pensé entre deux baillements pendant un cour de signal : admettons qu&#8217;on veuille stocker 15 valeurs comprises entre 1000000 et 1000100. Soit on stocke bêtement les chiffres, ce qui demande un entier de 16 bits pour chaque valeur, soit prend en compte le fait que toutes les valeurs sont supérieures à 1000000, et qu&#8217;on aura que 100 valeurs différentes au maximum. Donc il suffit de dire au début qu&#8217;on a un offset de 1000000 (donc là un entier de 16 bits), puis on peut stocker le reste avec du 8 bits. Donc pour nos 15 valeurs, on aurait 15 * 16 = 240 bits, ou alors 16 + 15*8 = 136. On a vite fait de voir qu&#8217;il y a un gros gain de place.<br />
Donc je me suis dit qu&#8217;on pouvait appliquer un peu le même principe aux images : on découpe l&#8217;image en carrés de 8 pixels de côté, on passe l&#8217;image en <a href="http://fr.wikipedia.org/wiki/Teinte_Saturation_Valeur">HSV</a>, puis on regarde le minimum et le maximum de chaque composante. Ensuite pour chaque pixel on calcule le pourcentage de chaque composante entre le min et le max : par exemple si on a une teinte entre 130 et 140, et que la valeur du pixel c&#8217;est 133, alors ça nous donne 30%. Ce pourcentage on peut l&#8217;encoder sur 3 bits (2 bits pour la saturation), ce qui permet de rentrer les 3 composantes sur 1 octet. Si on a de la chance et que l&#8217;écart entre le min et le max est faible, alors on peut restituer une couleur assez fidèle (sinon on a un bel artefact).<br />
Avec cette technique, on a une moyenne de 1,2 octet/pixel, ce qui reste 10 fois plus que le JPEG, mais bon&#8230;</p>
<p>Pour ceux que ça intéresse, voici les &#8220;specs&#8221; du format de fichier, c&#8217;est complètement à l&#8217;arrache, comprendra celui qui pourra <img src='http://hyperthese.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>
Trame du fichier

3 octets : "im1"

1 octet : version du standard

n octets : données insignifiantes

2 octets : 2x caractère nul

4 octets : taille x ( nombre de blocs b(x) = int((x+7)/8) )
4 octets : taille y ( nombre de blocs b(y) = int((y+7)/8) )

6+64 octets : bloc [b(x)⋅b(y)]
	1 octet : hue min
	1 octet : hue max
	1 octet : saturation min
	1 octet : saturation max
	1 octet : value min
	1 octet : value max
	1 octet : pixel [8⋅8]
		3 bits : scaled hue
		2 bits : scaled saturation
		3 bits : scaled value
</pre>
<p>Note : pour ce qui est des blocs au bord de l&#8217;image, ils ne font pas 8&#215;8 mais s&#8217;arrêtent au bord (ce qui influe sur la taille du bloc).</p>
<p>Et puis comme je suis sympa j&#8217;ai même fait un programme qui permet de créer/voir/exporter des images au format im1 (abrégé de entroptymisator image 1), que vous pouvez télécharger en <a href="http://hyperthese.net/src/image1.7z">cliquant là</a>, mais je vois préviens : c&#8217;est la première fois que je fais du C++, et c&#8217;est développé vite et à l&#8217;arrache, donc le code est assez ignoble et pas toujours commenté. J&#8217;ai fait une tentative d&#8217;indépendance au boutisme, mais j&#8217;ai eu la flemme d&#8217;aller jusqu&#8217;au bout, alors pour l&#8217;instant les images petitboutistes marcheront pas sur les systèmes grandboutiste et inversement, mais ça changera peut être un jour. Question librairies utilisées, c&#8217;est GD et SDL, donc ça devrai se compiler sans soucis sous windows, même si je n&#8217;ai testé que sous linux. D&#8217;ailleurs voici le <a href="http://hyperthese.net/src/imagetor1.7z">fichier binaire</a> pour linux 32 bits.</p>
<p>Et puis quand même, ce que vous attendez tous, c&#8217;est à dire un joli comparatif :</p>
<div style="text-align: center;"><a id="p110" rel="attachment" class="imagelink" href="http://hyperthese.net/entroptymisator-image-1/imagetor1-comparaison-losslessimagetor1/" title="imagetor1 : comparaison lossless/imagetor1"><img id="image110" src="http://hyperthese.net/wp-content/uploads/2008/08/comp3.png" alt="imagetor1 : comparaison lossless/imagetor1" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/entroptymisator-image-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Les petits hommes vert sont gris !</title>
		<link>http://hyperthese.net/les-petits-hommes-vert-sont-gris/</link>
		<comments>http://hyperthese.net/les-petits-hommes-vert-sont-gris/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 20:50:41 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>Divers</category>

		<guid isPermaLink="false">http://hyperthese.net/les-petits-hommes-vert-sont-gris/</guid>
		<description><![CDATA[Bon en dehors d&#8217;un titre faisant référence à Stargate SG-1, cet article me semble digne d&#8217;intérêt : http://www.news.com.au/story/0,23599,24070088-13762,00.html
Le docteur Edgar Mitchell un ancien astronaute de la NASA, ayant marché sur la Lune, affirme que les aliens existent et qu&#8217;ils ont bien pris contact avec nous, sauf que le gouvernement a étouffé l&#8217;affaire. En fait des [...]]]></description>
			<content:encoded><![CDATA[<p>Bon en dehors d&#8217;un titre faisant référence à Stargate SG-1, cet article me semble digne d&#8217;intérêt : <a href="http://www.news.com.au/story/0,23599,24070088-13762,00.html">http://www.news.com.au/story/0,23599,24070088-13762,00.html</a></p>
<p>Le docteur Edgar Mitchell un ancien astronaute de la NASA, ayant marché sur la Lune, affirme que les aliens existent et qu&#8217;ils ont bien pris contact avec nous, sauf que le gouvernement a étouffé l&#8217;affaire. En fait des évènements comme ceux de Roswell auraient bien eu lieu <img src='http://hyperthese.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Celon lui, l&#8217;information commencerait à s&#8217;ébruiter, et certaiens organisations seraient en train d&#8217;avancer pour dévoiler l&#8217;existence des aliens au public.</p>
<p>Bien que je sois fermement persuadé que si nous étions les seuls dans l&#8217;univers, ça serait un beau gâchis d&#8217;espace, je me sens obligé d&#8217;être sceptique vis à vis de cette information&#8230; Le temps nous en dirra probablement plus <img src='http://hyperthese.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />
</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/les-petits-hommes-vert-sont-gris/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Musique&#8230;</title>
		<link>http://hyperthese.net/musique/</link>
		<comments>http://hyperthese.net/musique/#comments</comments>
		<pubDate>Sat, 31 May 2008 19:16:46 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>Divers</category>

		<guid isPermaLink="false">http://hyperthese.net/musique/</guid>
		<description><![CDATA[
  


    
  


http://svt.se/hogafflahage/hogafflaHage_site/Kor/hestekor.swf

]]></description>
			<content:encoded><![CDATA[<div align="center">
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="420" height="251"></p>
<param name="movie" value="http://svt.se/hogafflahage/hogafflaHage_site/Kor/hestekor.swf">
<param name="quality" value="high">
<p>    <embed src="http://svt.se/hogafflahage/hogafflaHage_site/Kor/hestekor.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="420" height="251"></embed><br />
  </object>
</div>
<p><a href="http://svt.se/hogafflahage/hogafflaHage_site/Kor/hestekor.swf"><br />
http://svt.se/hogafflahage/hogafflaHage_site/Kor/hestekor.swf</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/musique/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Des minutes de 61 secondes ?</title>
		<link>http://hyperthese.net/des-minutes-de-61-secondes/</link>
		<comments>http://hyperthese.net/des-minutes-de-61-secondes/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 08:43:40 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>Divers</category>

		<guid isPermaLink="false">http://hyperthese.net/des-minutes-de-61-secondes/</guid>
		<description><![CDATA[La rotation de la Terre n&#8217;est pas réellement une constante : la positions des astres environants dévie un peu la trajectoire de notre planète, ce qui fait que le temps de rotation de la terre (la durée d&#8217;un jour) varie de manière pratiquement aléatoire ! C&#8217;est pour ça que environ tout les 18 mois, l&#8217;IERS [...]]]></description>
			<content:encoded><![CDATA[<p>La rotation de la Terre n&#8217;est pas réellement une constante : la positions des astres environants dévie un peu la trajectoire de notre planète, ce qui fait que le temps de rotation de la terre (la durée d&#8217;un jour) varie de manière pratiquement aléatoire ! C&#8217;est pour ça que environ tout les 18 mois, l&#8217;<a href="http://www.iers.org/">IERS</a> (Institut International de la Rotation Terrestre et des Systèmes de Référence) publie un bulletin annonçant un saut de 1 seconde (soit fin décembre soit fin juin) pour que l&#8217;heure redevienne réaliste. Vous pourrez trouver ces bulletins <a href="http://www.iers.org/MainDisp.csl?pid=36-25788&#038;prodid=16">ici</a>. (il n&#8217;y a rien de prévu pour juin prochain&#8230; <img src='http://hyperthese.net/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  )</p>
<p>Plus d&#8217;info sur les <a href="http://fr.wikipedia.org/wiki/Seconde_intercalaire">secondes intercalaires</a> dans <a href="http://fr.wikipedia.org/wiki/Seconde_intercalaire">Wikipedia</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/des-minutes-de-61-secondes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Similarité auditive</title>
		<link>http://hyperthese.net/similarite-auditive/</link>
		<comments>http://hyperthese.net/similarite-auditive/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 22:21:30 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>Programmation</category>

		<category>PHP</category>

		<guid isPermaLink="false">http://hyperthese.net/similarite-auditive/</guid>
		<description><![CDATA[Dans un monde où on utilise de plus en plus d&#8217;outils de recherche, dans différentes langues, il est important de pouvoir trouver ce que l&#8217;on cherche même si on n&#8217;utilise pas exactement la bonne orthographe du mot que l&#8217;on cherche. Face à ce genre de problèmes, on a vu l&#8217;apparition de certains algorithmes, comme le [...]]]></description>
			<content:encoded><![CDATA[<p>Dans un monde où on utilise de plus en plus d&#8217;outils de recherche, dans différentes langues, il est important de pouvoir trouver ce que l&#8217;on cherche même si on n&#8217;utilise pas exactement la bonne orthographe du mot que l&#8217;on cherche. Face à ce genre de problèmes, on a vu l&#8217;apparition de certains algorithmes, comme le <a href="http://fr.wikipedia.org/wiki/Soundex">Soundex</a>, qui commence à dater et est loin d&#8217;être parfait. C&#8217;est pour ça que le <a href="http://fr.wikipedia.org/wiki/Metaphone">Metaphone</a> a été créé, sauf qu&#8217;il ne comprend que l&#8217;anglais (tout comme le Soundex d&#8217;ailleurs), alors l&#8217;algorithme a évolué et donné naissance au <a href="http://fr.wikipedia.org/wiki/Double_Metaphone">Double Metaphone</a> qui lui prend en compte les différents langages (principalement l&#8217;anglais, les langues slaves, germaniques, celtiques, le grec, le français, l&#8217;italien, l&#8217;espagnol, ou le chinois) de manière intelligente et qui permet de faire des rapprochements entre des chaines.</p>
<p>Comment ça marche ? C&#8217;est relativement simple (dans l&#8217;idée, par ce que en pratique c&#8217;est loin d&#8217;être le cas, d&#8217;ailleurs je crois que Lawrence Philips, l&#8217;auteur du double metaphone, mérite que la communauté du web se cotise pour lui rembourser ses frais en aspirine) : à partir des combinaisons de lettres et de leur fréquence (si je vous écris &#8220;verwandelt&#8221; vous vous doutez bien que c&#8217;est germanique) en peut savoir le genre de prononciation que ça a, ensuite il ne reste qu&#8217;à appliquer des règles sur la prononciation (&#8221;ba&#8221; se prononce presque comme &#8220;bha&#8221;), ce qui permet de créer une clef (en fait 2 dans le cas du double metaphone). Deux mots ayant la même prononciation auront la même clef.</p>
<p>On peut trouver diverses implantations de cet algorithme dans différents langages, dont <a href="http://swoodbridge.com/DoubleMetaPhone/">celle ci</a> en PHP.
</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/similarite-auditive/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gestion des chemins en PHP</title>
		<link>http://hyperthese.net/gestion-des-chemins-en-php/</link>
		<comments>http://hyperthese.net/gestion-des-chemins-en-php/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 00:45:43 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>Programmation</category>

		<category>PHP</category>

		<category>Classes</category>

		<guid isPermaLink="false">http://hyperthese.net/gestion-des-chemins-en-php/</guid>
		<description><![CDATA[Comme j'en avais marre de devoir constament verrifier si les chemins avec lesquels je travaillais finissaient oui ou non par "/", j'ai décidé de faire une classe pour gérer ça de la manière la plus simple possible. Vous pouvez télécharger cette classe aux formats 7zip, Bzip2 ou Zip.
Voici l'exemple d'utilisation que j'ai fait :
PLAIN TEXT
PHP:




&#60;?php


// [...]]]></description>
			<content:encoded><![CDATA[<p>Comme j'en avais marre de devoir constament verrifier si les chemins avec lesquels je travaillais finissaient oui ou non par "/", j'ai décidé de faire une classe pour gérer ça de la manière la plus simple possible. Vous pouvez télécharger cette classe aux formats <a href="http://hyperthese.net/src/class.path.7z">7zip</a>, <a href="http://hyperthese.net/src/class.path.tar.bz2">Bzip2</a> ou <a href="http://hyperthese.net/src/class.path.zip">Zip</a>.</p>
<p>Voici l'exemple d'utilisation que j'ai fait :</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showCodeTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// First of all, we need to include the class</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">"class.path.php"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Then we'll create a new path, with all options</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// In order, the options are : the path string, is the path pointing a</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// directory, is there some string to put before the path, and what is the</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// separator ?</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$path</span> = <span style="color:#000000; font-weight:bold;">new</span> Path<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"/some/path/to/test/"</span>, <span style="color:#000000; font-weight:bold;">true</span>, <span style="color:#FF0000;">"http://"</span>, <span style="color:#FF0000;">"/"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Obviously, I want to output an URL, just look</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"It's looking like an URL: $path<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Now I create a new path with a completely different delimiter</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$path2</span> = <span style="color:#000000; font-weight:bold;">new</span> Path<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\a</span><span style="color:#000099; font-weight:bold;">\f</span>ile.php"</span>, <span style="color:#000000; font-weight:bold;">false</span>, <span style="color:#000000; font-weight:bold;">null</span>, <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\\</span>"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// And I can just append it to the previous one</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$path</span>-&gt;<span style="color:#006600;">a</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$path2</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// We could have done $path-&gt;b($path2), but it would have returned a new object</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// with $path2 appened instead of changing $path</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// And turn this into a SMB share</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$path</span>-&gt;<span style="color:#006600;">setHead</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\\</span>"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$path</span>-&gt;<span style="color:#006600;">setSeparator</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\\</span>"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Now it's a SMB share: $path<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// You can also use new basename() and dirname()</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Note that dirname() returns a Path and not a string</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"The parent directory is: "</span> . <span style="color:#0000FF;">$path</span>-&gt;<span style="color:#006600;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"The pointed file is: "</span> . <span style="color:#0000FF;">$path</span>-&gt;<span style="color:#006600;">basename</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"But without its extension it would be: "</span> . <span style="color:#0000FF;">$path</span>-&gt;<span style="color:#006600;">basename</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">".php"</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/gestion-des-chemins-en-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Verrification de code EAN8/13 en D</title>
		<link>http://hyperthese.net/verrification-de-code-ean813-en-d/</link>
		<comments>http://hyperthese.net/verrification-de-code-ean813-en-d/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 21:26:15 +0000</pubDate>
		<dc:creator>Rémy Sanchez</dc:creator>
		
		<category>Programmation</category>

		<category>D</category>

		<guid isPermaLink="false">http://hyperthese.net/verrification-de-code-ean813-en-d/</guid>
		<description><![CDATA[Voici une fonction écrite en D qui dit si oui ou non la chaine soumise en entrée est un code EAN correct : on verrifie le nombre de caractères, que tout les caractères sont bien des chiffres, et on regarde que la checksumm est bien la bonne.
PLAIN TEXT
C:




bool eanCheck&#40;string ean&#41; &#123;


&#160; &#160; int summ = [...]]]></description>
			<content:encoded><![CDATA[<p>Voici une fonction écrite en D qui dit si oui ou non la chaine soumise en entrée est un code EAN correct : on verrifie le nombre de caractères, que tout les caractères sont bien des chiffres, et on regarde que la checksumm est bien la bonne.</p>
<div class="igBar"><span id="lc-4"><a href="#" onclick="javascript:showCodeTxt('c-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C:</span>
<div id="c-4">
<div class="c">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">bool eanCheck<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">string</span> ean<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #993333;">int</span> summ = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>ean.<span style="color: #202020;">length</span> != <span style="color: #cc66cc;color:#800000;">13</span> &amp;&amp; ean.<span style="color: #202020;">length</span> !=<span style="color: #cc66cc;color:#800000;">8</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #993333;">int</span> n = ean.<span style="color: #202020;">length</span> - <span style="color: #cc66cc;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i=<span style="color: #cc66cc;color:#800000;">0</span>; i&lt;n; i+=<span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>ean<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> &lt;<span style="color: #cc66cc;color:#800000;">48</span> || ean<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>&gt; <span style="color: #cc66cc;color:#800000;">57</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; summ += ean<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> - <span style="color: #cc66cc;color:#800000;">48</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i=<span style="color: #cc66cc;color:#800000;">1</span>; i&lt;n; i+=<span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>ean<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> &lt;<span style="color: #cc66cc;color:#800000;">48</span> || ean<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>&gt; <span style="color: #cc66cc;color:#800000;">57</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; summ += <span style="color: #cc66cc;color:#800000;">3</span> * <span style="color: #66cc66;">&#40;</span>ean<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> - <span style="color: #cc66cc;color:#800000;">48</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; summ = <span style="color: #cc66cc;color:#800000;">10</span> - <span style="color: #66cc66;">&#40;</span>summ % <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>summ == ean<span style="color: #66cc66;">&#91;</span>n<span style="color: #66cc66;">&#93;</span> - <span style="color: #cc66cc;color:#800000;">48</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Note: pour fonctionner, ce programme requiet une entrée dans un charset compatible ASCII (iso-8859-* ou utf-8 par exemple)
</p>
]]></content:encoded>
			<wfw:commentRss>http://hyperthese.net/verrification-de-code-ean813-en-d/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
