<?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/" version="2.0">

<channel>
	<title>GeckoGeek.fr</title>
	
	<link>http://www.geckogeek.fr</link>
	<description>Paradigme d'un lézard</description>
	<lastBuildDate>Tue, 02 Mar 2010 09:02:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</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/Geckogeek" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="geckogeek" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Bioshock 2 : Trailer de Lancement en Français</title>
		<link>http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html</link>
		<comments>http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html#comments</comments>
		<pubDate>Wed, 03 Feb 2010 21:34:18 +0000</pubDate>
		<dc:creator>Vinz</dc:creator>
				<category><![CDATA[Jeux Vidéo]]></category>
		<category><![CDATA[2K]]></category>
		<category><![CDATA[Bioshock 2]]></category>
		<category><![CDATA[Trailer]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=868</guid>
		<description><![CDATA[Et parce que cela fait un moment que l'on n'avait pas fait de billet JV, en voici un sur un jeu qui ne devrait pas tarder puisque sa sortie est prévue pour mardi prochain (9 Février 2010). Il s'agit bien sur de <strong>Bioshock 2</strong>, développé et édité par 2K Games (qui a édité dernièrement Borderlands).]]></description>
			<content:encoded><![CDATA[<p>Et parce que cela fait un moment que l&#8217;on n&#8217;avait pas fait de billet JV, en voici un sur un jeu qui ne devrait pas tarder puisque sa sortie est prévue pour mardi prochain (9 Février 2010). Il s&#8217;agit bien sur de <strong>Bioshock 2</strong>, développé et édité par <strong>2K Games</strong> (qui a édité dernièrement Borderlands).<br />
<img class="aligncenter size-full wp-image-871" title="Bioshock 2" src="http://www.geckogeek.fr/wp-content/uploads/2010/02/bioshock-2.jpg" alt="" width="500" height="313" /></p>
<h2>Qu&#8217;est-ce que Bioshock ?</h2>
<p><strong>Bioshock</strong> premier du nom est sorti fin Août 2007. Ce jeu mélangeant <strong>FPS et Aventure</strong> se situe dans une cité sous-marine (<strong>Rapture</strong>) en plein <strong>océan pacifique</strong>. Vous y débarquez suite à un accident (hasardeux) d&#8217;avion et n&#8217;avez pour autre choix que d&#8217;y rentrer. Malheureusement pour vous la cité est abandonnée depuis longtemps et ses seuls survivants n&#8217;ont plus grand chose &#8220;d&#8217;humain&#8221;. Mais chanceux comme vous êtes vous y trouvez armes à plasmides (fortifiants génétique) qui vous aideront à vous défaire des nombreux pièges qui vous attendent.</p>
<p>Le personnage en fer visible dans la vidéo est un <strong>&#8220;Big Daddy&#8221;</strong>, plus précisément un personnage ayant pour but de protéger les petites filles (qui elles récoltent une matières utile dans le jeu). Dans le premier épisode vous étiez un simple humain contre des monstres et des Big Daddy, donc ce second volet vous êtes un Big Daddy !</p>
<p>Outre le plaisir à pouvoir <strong>congeler ses ennemis et les envoyer valser</strong> dans un mur (grâce à vos plasmides), vous devrez parfois choisir entre le &#8220;bien&#8221; et le &#8220;mal&#8221;. Les petites filles possèdent quelque chose qui peut vous intéresser. Une fois leur protecteur tué (le Big Daddy), vous pourrez choisir de les laisser partir ou de leur faire du mal. Selon vos choix vous aurez plus ou moins d&#8217;ennuis (taper des petites filles c&#8217;est mal !) mais vous serez aussi éventuellement moins fort (moins de pouvoirs)</p>
<h2>Trailer de lancement !</h2>
<p>Passons au plus sympa, le trailer de <strong>3min et 20s</strong> qui vous plonge dans l&#8217;ambiance de Rapture.</p>
<p><center><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="336" 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.dailymotion.com/swf/xc3j3u" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="336" src="http://www.dailymotion.com/swf/xc3j3u" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<strong><a href="http://www.dailymotion.com/video/xc3j3u_bioshock-2-trailer-de-lancement-fr_videogames">Bioshock 2 : Trailer de Lancement (fr)</a></strong><br />
<em>envoyé par <a href="http://www.dailymotion.com/GeckoGeek">GeckoGeek</a>. &#8211; <a href="http://www.dailymotion.com/fr/channel/videogames">Plus de jeux vidéo !</a></em></center></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;title=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;t=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;title=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;title=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais+-+http://b2l.me/ffxmq+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;title=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais&amp;desc=Et%20parce%20que%20cela%20fait%20un%20moment%20que%20l%27on%20n%27avait%20pas%20fait%20de%20billet%20JV%2C%20en%20voici%20un%20sur%20un%20jeu%20qui%20ne%20devrait%20pas%20tarder%20puisque%20sa%20sortie%20est%20pr%C3%A9vue%20pour%20mardi%20prochain%20%289%20F%C3%A9vrier%202010%29.%20Il%20s%27agit%20bien%20sur%20de%20Bioshock%202%2C%20d%C3%A9velopp%C3%A9%20et%20%C3%A9dit%C3%A9%20par%202K%20Games%20%28qui%20a%20%C3%A9dit%C3%A9%20derni%C3%A8rement%20Borderlands%29." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;title=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;title=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;title=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;t=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html&amp;bm_description=Bioshock+2+%3A+Trailer+de+Lancement+en+Fran%C3%A7ais&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/bioshock-2-trailer-de-lancement-en-francais.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keynote 27 Janvier 2010 : iPad (tablette tactile)</title>
		<link>http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html</link>
		<comments>http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 20:06:25 +0000</pubDate>
		<dc:creator>Vinz</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iWork]]></category>
		<category><![CDATA[Keynote]]></category>
		<category><![CDATA[SDK]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=854</guid>
		<description><![CDATA[C'est aujourd'hui qu'a eu lieu la première Keynote 2010. Après de longs mois (voire années) de rumeurs, Apple dévoile enfin son nouveau gros produit : l'iPad.
]]></description>
			<content:encoded><![CDATA[<p>C&#8217;est aujourd&#8217;hui qu&#8217;a eu lieu la première Keynote 2010. Après de longs mois (voire années) de rumeurs, Apple dévoile enfin son nouveau gros produit : l&#8217;iPad.<br />
<img src="http://www.geckogeek.fr/wp-content/uploads/2010/01/www.apple_.png" alt="ipad" title="iPad" class="aligncenter" /></p>
<h2>Apple en quelques chiffres</h2>
<p><strong>Apple</strong> a commencé par publier <strong>quelques chiffres</strong>, très typique aux States (et encore plus durant des Keynotes ^^) :</p>
<ul>
<li>250 millions d&#8217;iPods vendus</li>
<li>284 AppleStores (et 250 millions de visiteurs ce dernier trimestre)</li>
<li>140 000 applications sur l&#8217;AppStore, plus de 3 milliards de téléchargements</li>
<li>&#8230;.</li>
</ul>
<h2>iPad : la tablette d&#8217;Apple</h2>
<h3>En peu de mots</h3>
<p>L&#8217;<strong>iPad</strong> ressemble à une grand iPhone : il est <strong>très fin</strong> et possède un gros bouton en bas. Les icônes ressemblent à ceux de l&#8217;iPhone et l&#8217;interface (<strong>fluide et rapide</strong>) est simple et intuitive. Steeve a précisé qu&#8217;une démonstration est bien plus impressionnante qu&#8217;une image. La version iTunes de l&#8217;iPad semble très simple : proche de la version iPhone mais adapté à l&#8217;écran de la tablette. Comme pour l&#8217;iPhone, <span style="text-decoration: underline;">pas de support de Flash</span> malgré la lecture des vidéos. Quant au support divX semble compromit, c&#8217;est toutefois à confirmer.</p>
<h3>Support des applications iPhone</h3>
<p>La tablette pourra <strong>utiliser les applications déjà présentes</strong> sur l&#8217;AppStore pour l&#8217;iPhone/iPod. Les pixels seront doublés. Cela risque d&#8217;être moyen mais cela devrait faire l&#8217;affaire pour la plupart des applications. Pour le reste il y a SDK(arde).</p>
<h3>SDK iPad</h3>
<p>L&#8217;iPad a <strong>son propre SDK</strong> disponible dès <span style="text-decoration: underline;">aujourd&#8217;hui</span>. De même, donc, un simulateur pour tester vos applications avant la disponibilité de la machine. Les serveurs d&#8217;Apple risquent d&#8217;avoir des problèmes ce soir !</p>
<h3>Premières applications</h3>
<ul>
<li><strong>Lire son journal</strong> : Le NYT était là pour présenter son application. C&#8217;est une sorte de journal papier avec des éléments qui bougent. On devrait bientôt avoir le même journal qu&#8217;Harry Potter mais sur une tablette graphique !</li>
<li><strong>Dessiner</strong> : On pourra dessiner plus facilement que sur un iPhone grâce à la surface plus importante de la tablette. L&#8217;application présentée (Brushes) devrait intégrer des fonctionnalités de base bien appréciées.</li>
<li><strong>Jouer</strong> : Outre Gameloft, EA était là pour présenter  NFS Shift. D&#8217;après eux l&#8217;iPad est comme un écran HD, donc de nouvelles sensations.</li>
</ul>
<h3>iBook</h3>
<p>Probablement une des applications des plus travaillée pour cet event. Elle donne l&#8217;impression d&#8217;un vrai livre (outre l&#8217;écran de l&#8217;iPad bien sur). Les pages se tournent avec un effet sympa, la couverture est présente, etc. De manière général la bibliothèque ressemble à Delicious Library. Les livres devraient être vendus pour le plus bas à <strong>4.99$</strong> (probablement autant en Europe), allant jusqu&#8217;à <strong>14.99$</strong> (voire plus ?). Peu d&#8217;informations quant aux possibilités de vendre ses propres ouvrages.</p>
<h3>iWork</h3>
<p><strong>iWork</strong> semble aussi posséder sa version iPad. Une interface complètement neuve pour chaque application (Pages, Numbers et Keynote), rien à voir avec la version Mac. Les onglets et boutons sont plus gros pour être facilement &#8220;accessibles&#8221; avec le doigt. L&#8217;utilisation du tactile est bien intégrée. Pour éviter de mettre trop d&#8217;options &#8220;inutiles&#8221; l&#8217;essentiel est affiché, puis des sous-menus apparaissent suite à un premier touché afin d&#8217;afficher la suite.</p>
<h3>iPad Wifi, iPad 3G</h3>
<p>Des iPad en 3G seront aussi disponibles. 30$ / mois pour un accès complet (serrez fort) ou bien 15$ / mois pour 250Mo. Dans tous les cas, si vous pensez utiliser votre iPad chez vous, ne prenez pas celui 3G &gt;_&lt;</p>
<h3>Disponible quand ?</h3>
<p>L&#8217;iPad devrait être disponible sous 60 jours pour la version Wifi et sous 90 jours pour la version supportant en plus la 3G.</p>
<h3>Pour quel prix ?</h3>
<p>Alors que les rumeurs parlaient le plus souvent de 1 000$ (aux States en tout cas), et comme Apple a des envies de conquérir le monde, l&#8217;iPad sera proposé au prix de <strong>499$</strong> (soit 360€) pour sa plus maigre version (16Go). 599$ pour le 32Go, ou 699$ pour le 64Go. Le chiffre parait raisonnable, surtout si on estime que le but d&#8217;Apple est de faire vendre un maximum de films et eBook par la suite. La version 3G vous demandera de débourser 130$ en plus (plus les 15 ou 30$ / mois en plus&#8230;)</p>
<h3>Les accessoires</h3>
<ul>
<li>Dock avec un clavier physique</li>
<li>House</li>
</ul>
<h2>Résumé de l&#8217;iPad</h2>
<h3>Caractéristiques</h3>
<ul>
<li>Facade en verre</li>
<li>Epaisseur : 1.27cm</li>
<li>Poids : 680g</li>
<li>Ecran de 9,7&#8243;</li>
<li>Processeur : 1GHz</li>
<li>WiFi &#8220;n&#8221;, Bluetooth2 (et modèles iPad 3G)</li>
<li>Capacités : 16 à 64Go</li>
<li>Batterie : ~10 heures en utilisation, 1 mois en veille</li>
<li>Accéléromètre</li>
<li>Boussole</li>
<li>Haut parleur et micro</li>
<li>&#8230;</li>
</ul>
<h3>Date et Prix</h3>
<p>La sortie de l&#8217;iPad est prévue dans 2 mois.<br />
<strong>Quant aux prix</strong> :</p>
<ul>
<li>499$ (16Go)</li>
<li>599$ (32Go)</li>
<li>699$ (64Go)</li>
</ul>
<p>Rajoutez 130$ si vous souhaitez recevoir la 3G avec !</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;title=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;t=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;title=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;title=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29+-+http://b2l.me/eveew+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;title=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29&amp;desc=C%27est%20aujourd%27hui%20qu%27a%20eu%20lieu%20la%20premi%C3%A8re%20Keynote%202010.%20Apr%C3%A8s%20de%20longs%20mois%20%28voire%20ann%C3%A9es%29%20de%20rumeurs%2C%20Apple%20d%C3%A9voile%20enfin%20son%20nouveau%20gros%20produit%20%3A%20l%27iPad.%0D%0A" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;title=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;title=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;title=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;t=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html&amp;bm_description=Keynote+27+Janvier+2010+%3A+iPad+%28tablette+tactile%29&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/keynote-27-janvier-2010-ipad-tablette.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Créer un Singleton sur iPhone en Cocoa / Objective-C</title>
		<link>http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html</link>
		<comments>http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html#comments</comments>
		<pubDate>Tue, 26 Jan 2010 21:21:43 +0000</pubDate>
		<dc:creator>Vinz</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Singleton]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=844</guid>
		<description><![CDATA[Lorsque l'on a besoin d'un même objet à différents endroits il n'est pas nécessaire de le faire passer d'une classe parente à une classe enfant, et encore moins de lui allouer de la mémoire plusieurs fois. Une bonne solution consiste à transformer votre classe en un singleton. Voyons ainsi comment créer un singleton en objective-c pour iPhone (mais ce qui marche aussi sur Mac).]]></description>
			<content:encoded><![CDATA[<p>Lorsque l&#8217;on a besoin d&#8217;un même objet à différents endroits il n&#8217;est pas nécessaire de le faire passer d&#8217;une classe parente à une classe enfant, et encore moins de lui allouer de la mémoire plusieurs fois. Une bonne solution consiste à transformer votre classe en un <strong>singleton</strong>. Voyons ainsi comment créer un singleton en <strong>objective-c</strong> pour iPhone (mais cela marche aussi sur Mac).</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/11/SDK-iPhone.png"><img class="aligncenter size-full wp-image-504" title="SDK-iPhone" src="http://www.geckogeek.fr/wp-content/uploads/2009/11/SDK-iPhone.png" alt="" width="253" height="231" /></a></p>
<h2>Qu&#8217;est-ce qu&#8217;un singleton ?</h2>
<p>Un singleton est un <strong>design pattern</strong> qui a pour but de n&#8217;allouer de la mémoire qu&#8217;<strong>une fois</strong> pour un objet dans tout le programme. De même cet objet peut être atteint n&#8217;importe où dans le programme et ne nécessite pas d&#8217;être explicitement instancié avant d&#8217;être utilisé. Ce dernier utilisera à chaque appel la même instance ou la créera si c&#8217;est la première utilisation.</p>
<p>L&#8217;implémentation d&#8217;un singleton dans la plupart des langages est chose facile. Sur iPhone il est possible de faire la même chose, toutefois Apple préconise <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32">une certaine implémentation</a> d&#8217;un singleton en cocoa. En voici un exemple tout cuit.</p>
<p>Nous prendrons l&#8217;exemple d&#8217;une classe &#8220;User&#8221; contenant toute sorte d&#8217;informations relatives à l&#8217;utilisateur courant. Mais c&#8217;est juste pour le nom puisque nous ne déclarerons pas tant de méthodes que ça.</p>
<h2>Interface de la classe (.h)</h2>
<p>Commençons par décortiquer le plus simple : l&#8217;<strong>interface de la classe</strong>. Comme notre exemple a pour but d&#8217;être simple, nous prendrons une méthode simple à comprendre. Notre utilisateur comporte une variable &#8220;points&#8221;. Cette variable peut être augmentée et affichée.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">/*
 * User Interface, Singleton
 * Exemple de GeckoGeek.fr
 */</span>
&nbsp;
<span style="color: #a61390;">@interface</span> User <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	NSInteger points;
&nbsp;
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, assign<span style="color: #002200;">&#41;</span> NSInteger points;
<span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span>User <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>sharedUser;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>addPoints<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>nbr;
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>User dérive d&#8217;un &#8220;<strong>NSObject</strong>&#8221; et contient une méthode &#8220;sharedUser&#8221; qui renverra l&#8217;objet instancié une seule fois au cours de la vie du programme. Et pour notre exemple nous avons la variable &#8220;points&#8221; qui est un NSInteger (== int en C) avec la méthode &#8220;addPoints&#8221; pour ajouter plus facilement des points.</p>
<h2>Implémentation de la classe (.m)</h2>
<p>Voyons maintenant comment implémenter la classe. Comme je le disais plus haut, Apple préconise une implémentation particulière d&#8217;un Singleton sur iPhone.</p>
<h3>Variable static pour l&#8217;unique instanciation</h3>
<p>Votre implémentation doit déjà contenir une <strong>variable static</strong> pour stocker l&#8217;unique instanciation de votre objet. Dans notre cas nous aurons quelque chose comme ceci :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">static</span> User <span style="color: #002200;">*</span>sharedUserManager <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;</pre></div></div>

<h3>Méthodes à redéfinir</h3>
<p>Ensuite un ensemble de méthodes sont à <strong>redéfinir</strong> et à laisser telles quelles dans votre implémentation :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>allocWithZone<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">NSZone</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>zone <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self sharedUser<span style="color: #002200;">&#93;</span> retain<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>copyWithZone<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">NSZone</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>zone <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>retain <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>NSUInteger<span style="color: #002200;">&#41;</span>retainCount <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> NSUIntegerMax;  <span style="color: #11740a; font-style: italic;">//denotes an object that cannot be released</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>release <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">//do nothing</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>autorelease <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Vous pourrez retrouver les même conseils sur le lien pointant sur Apple un peu plus haut.</p>
<h3>Méthode d&#8217;accessibilité</h3>
<p>Et enfin vous avez besoin de définir la méthode qui vous permettra d&#8217;accéder à l&#8217;objet ou que vous soyez.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span>User<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>sharedUser
<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>sharedUserManager <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        sharedUserManager <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>super allocWithZone<span style="color: #002200;">:</span><span style="color: #a61390;">NULL</span><span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #a61390;">return</span> sharedUserManager;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Si vous la lisez bien vous verrez qu&#8217;elle fait le travail ordinaire d&#8217;un singleton. Si la variable static est nulle alors elle fait l&#8217;allocation unique et retourne le pointer.</p>
<h3>Tout en un</h3>
<p>Voici l&#8217;ensemble de l&#8217;implémentation de la classe user :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;User.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> User
&nbsp;
<span style="color: #a61390;">@synthesize</span> points;
&nbsp;
<span style="color: #a61390;">static</span> User <span style="color: #002200;">*</span>sharedUserManager <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>init <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
		<span style="color: #11740a; font-style: italic;">// Init points to 0</span>
		points <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
&nbsp;
	<span style="color: #002200;">&#125;</span>
	<span style="color: #a61390;">return</span> self;
&nbsp;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>dealloc <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Do things</span>
	<span style="color: #002200;">&#91;</span> super dealloc <span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">////////////////////</span>
<span style="color: #11740a; font-style: italic;">// Singleton Methods</span>
<span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span>User<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>sharedUser
<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>sharedUserManager <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        sharedUserManager <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>super allocWithZone<span style="color: #002200;">:</span><span style="color: #a61390;">NULL</span><span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #a61390;">return</span> sharedUserManager;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>allocWithZone<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">NSZone</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>zone <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self sharedUser<span style="color: #002200;">&#93;</span> retain<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>copyWithZone<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">NSZone</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>zone <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>retain <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>NSUInteger<span style="color: #002200;">&#41;</span>retainCount <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> NSUIntegerMax;  <span style="color: #11740a; font-style: italic;">//denotes an object that cannot be released</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>release <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">//do nothing</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>autorelease <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>Lors de l&#8217;init nous initialisons la variable &#8220;points&#8221; à 0. Il nous suffit de rajouter la méthode &#8220;addPoints&#8221;</p>
<h3>Méthode &#8220;addPoints&#8221;</h3>
<p>Exemple simple, méthode simple. Cette méthode ne fait que rajouter un nombre à la variable de l&#8217;instanciation.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>addPoints<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>nbr <span style="color: #002200;">&#123;</span>
&nbsp;
	points <span style="color: #002200;">+=</span> nbr;
&nbsp;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h2>Exemple d&#8217;utilisation</h2>
<p>Dans votre classe faites un &#8220;<strong>import</strong>&#8221; de la classe singleton. Dans notre exemple cela donnerait :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;User.h&quot;</span></pre></div></div>

<p>Puis pour utiliser votre classe il suffit d&#8217;écrire &#8220;[ User sharedUser ]&#8221; et appeler une variable ou une méthode. Concrètement pour ajouter des points il suffit d&#8217;écrire :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span> <span style="color: #002200;">&#91;</span> User sharedUser <span style="color: #002200;">&#93;</span> addPoints<span style="color: #002200;">:</span><span style="color: #2400d9;">5</span> <span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>Et pour lire le nombre de points :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Points=%d&quot;</span>, <span style="color: #002200;">&#91;</span> <span style="color: #002200;">&#91;</span> User sharedUser <span style="color: #002200;">&#93;</span> points <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;</pre></div></div>

<p><strong>A vous maintenant d&#8217;ajouter vos propres méthodes et customiser votre singleton comme bon vous semble ! :-]</strong></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;title=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;t=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;title=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;title=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C+-+http://b2l.me/esns6+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;title=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C&amp;desc=Lorsque%20l%27on%20a%20besoin%20d%27un%20m%C3%AAme%20objet%20%C3%A0%20diff%C3%A9rents%20endroits%20il%20n%27est%20pas%20n%C3%A9cessaire%20de%20le%20faire%20passer%20d%27une%20classe%20parente%20%C3%A0%20une%20classe%20enfant%2C%20et%20encore%20moins%20de%20lui%20allouer%20de%20la%20m%C3%A9moire%20plusieurs%20fois.%20Une%20bonne%20solution%20consiste%20%C3%A0%20transformer%20votre%20classe%20en%20un%20singleton.%20Voyons%20ainsi%20comment%20cr%C3%A9er%20un%20singleton%20en%20objective-c%20pour%20iPhone%20%28mais%20ce%20qui%20marche%20aussi%20sur%20Mac%29." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;title=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;title=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;title=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;t=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html&amp;bm_description=Cr%C3%A9er+un+Singleton+sur+iPhone+en+Cocoa+%2F+Objective-C&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/creer-un-singleton-sur-iphone-en-cocoa-objective-c.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nokogiri : le parseur XML sexy de Ruby</title>
		<link>http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html</link>
		<comments>http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html#comments</comments>
		<pubDate>Sat, 09 Jan 2010 14:54:39 +0000</pubDate>
		<dc:creator>Lya</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Nokogiri]]></category>
		<category><![CDATA[Progra]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=796</guid>
		<description><![CDATA[Nous allons découvrir dans ce billet une petite librairie bien sympathique pour Ruby qui vous sera surement très utile. Après une brève description, nous verrons comment l'utiliser dans ses fonctionnalités de bases. Nous nous focaliserons essentiellement sur le côté XML.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Nous allons découvrir dans ce billet une petite <strong>librairie</strong> bien sympathique pour Ruby qui vous sera surement très utile. Après une brève description, nous verrons comment l&#8217;utiliser dans ses <strong>fonctionnalités de bases</strong>. Nous nous focaliserons essentiellement sur le côté <strong>XML</strong>.<br />
<a href="http://www.geckogeek.fr/wp-content/uploads/2010/01/Ruby_Gems.png"><img class="aligncenter size-full wp-image-797" title="Ruby_Gems" src="http://www.geckogeek.fr/wp-content/uploads/2010/01/Ruby_Gems.png" alt="" width="280" height="248" /></a></p>
<h2>Nokogiri en quelques mots</h2>
<p>Cette librairie a été créée par <a href="http://tenderlovemaking.com/">Aaron Patterson</a> et Mike Dalessio. C’est un <strong>parseur HTML/XML/XSLT pour Ruby</strong> qui se sert de <strong>XPATH</strong> et/ou de <strong>CSS3</strong>. Elle est basée sur le modèle <strong>Hpricot</strong> et elle utilise <strong>libXML2</strong> (et libXSLT) pour chercher et parser (d’où sa rapidité).</p>
<p>Vous utilisez peut-être toujours la librairie pure Ruby REXML, ou bien vous avez le soucis de la rapidité et vous êtes déjà passé à Hpricot ? Allez, allez il est temps de changer. La transition n’est pas trop dure de Hpricot vers Nokogiri (je vous rappelle que c’est le même modèle, donc vous n’avez quasiment rien à faire). Et de REXML à Nokogiri ? Très peu de changements, la syntaxe est assez proche mais Nokogiri est tellement plus élégant ;-]  (et fait tellement plus de choses, et va tellement plus vite, et est tellement so cute!). Tentez le changement, vous allez aimer !</p>
<h2>C’est vraiment rapide ?</h2>
<p>C’est tout simple, d’un côté on a les escargots asthmatiques, de l’autre les libellules supraluminiques :-]. Comment ça j’exagère ? On n’en est pas loin.<br />
Regardez ces <strong>benchmarks</strong> réalisés par <a href="http://www.rubyinside.com/ruby-xml-performance-benchmarks-1641.html">RubyInside</a> (ils ne couvrent pas tout, mais pour les fonctions de bases c’est suffisant, pour info l&#8217;axe des y est en seconde) :</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2010/01/Benchmark_Ruby_Nokogiri_Hpricot_LibXML_REXML_by_RubyInside.png"><img class="aligncenter size-full wp-image-798" title="Benchmark_Ruby_Nokogiri_Hpricot_LibXML_REXML_by_RubyInside" src="http://www.geckogeek.fr/wp-content/uploads/2010/01/Benchmark_Ruby_Nokogiri_Hpricot_LibXML_REXML_by_RubyInside.png" alt="" width="287" height="277" /></a></p>
<p>Et puis, n’hésitez pas à faire vos propres benchmarks, il n’y a que ça de mieux pour être convaincu !</p>
<p>Personnellement pour des codes que nous utilisons, pour le chargement d’un arbre XML d’un millier de noeuds à deux/trois étages, nous passons d’une dizaine de secondes (REXML) à moins d’une seconde (Nokogiri). La classe :p. Ne parlons même pas de la recherche ou de l’écriture dans un fichier.</p>
<p>Même pour un tout petit mini document (une cinquantaine de noeuds sur deux étages), vous allez me dire : « on ne va pas s’embêter pour ça… » (au passage, l’embêtement =&gt; <strong>sudo gem install nokogiri</strong>). Ok, mais c’est quand même plus rapide de deux dixièmes de secondes facilement (vous passez d’un centième de seconde à un dix millième hop !), et puis, il faut prendre les bonnes habitudes :-].</p>
<h2>Bref aperçu</h2>
<p>On va voir rapidement les fonctionnalités de base. Afin que vous puissiez tester rapidement et facilement ces codes, j’ai mis tout dans une même classe. Parfois c’est un peu acrobatique, mais le but c’est de montrer les fonctionnalités :p.</p>
<p>Voici la classe dans laquelle nous évoluerons :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'nokogiri'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> XMLNokogiri
&nbsp;
  attr_accessor <span style="color:#ff3333; font-weight:bold;">:myDoc</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
    loadXML<span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>L&#8217;équivalent en REXML pour comparer :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rexml/document'</span>
<span style="color:#9966CC; font-weight:bold;">include</span> REXML
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> XMLREXML
&nbsp;
  attr_accessor <span style="color:#ff3333; font-weight:bold;">:myDoc</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
    loadXML<span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Et voici le fichier XML que l&#8217;on prendra en exemple :</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;gekkonidae<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gecko</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Blue&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;espece<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Tokay<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/espece<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;region<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Asie du Sud-Est<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/region<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;couleur<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Gris-Bleu à points Rouges et Blancs<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/couleur<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taille<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Grand<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taille<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;periode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Nocturne<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/periode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gecko<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gecko</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Leopard&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;espece<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Leopard<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/espece<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;region<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Moyen-Orient et Inde<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/region<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;couleur<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Leopard<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/couleur<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taille<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Moyen<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taille<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;periode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Nocturne<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/periode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gecko<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gecko</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Orange&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;espece<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Rhacodactylus ciliatus<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/espece<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;region<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Nouvelle-Calédonie<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/region<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;couleur<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Orange<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/couleur<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taille<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Moyen<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taille<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;periode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Nocturne<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/periode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gecko<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gecko</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Green&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;espece<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Phelsuma<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/espece<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;region<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Ile de Madagascar et Environs<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/region<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;couleur<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Vert<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/couleur<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taille<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Moyenne<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taille<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;periode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Diurne<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/periode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gecko<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gekkonidae<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Charger un arbre XML en mémoire</h3>
<p>Pour charger le document en mémoire avec Nokogiri :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> loadXML<span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">begin</span>
      myFile = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Can't open the file. Please check the name: &quot;</span> <span style="color:#006600; font-weight:bold;">+</span> myFileName <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;. Try it again: &quot;</span>
      myFileName = <span style="color:#CC0066; font-weight:bold;">gets</span>.<span style="color:#CC0066; font-weight:bold;">chomp</span>
      <span style="color:#9966CC; font-weight:bold;">retry</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#0066ff; font-weight:bold;">@myDoc</span> = <span style="color:#6666ff; font-weight:bold;">Nokogiri::XML</span><span style="color:#006600; font-weight:bold;">&#40;</span>myFile<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Avec REXML, c&#8217;était juste la syntaxe de la ligne qui crée l&#8217;arbre qui changeait :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    <span style="color:#0066ff; font-weight:bold;">@myDoc</span> = Document.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>myFile<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<h3>Affichage basique des éléments</h3>
<p>Globalement j&#8217;affiche l&#8217;arbre, mais le but est plutôt de montrer comment accéder aux différents éléments (de manière basique). Après dans cet exemple je les affiche, mais vous pouvez en faire ce que vous voulez.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> readXML<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Get a node (or many)</span>
    <span style="color:#9966CC; font-weight:bold;">for</span> gecko <span style="color:#9966CC; font-weight:bold;">in</span> <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">root</span>.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;//gecko&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
      <span style="color:#008000; font-style:italic;"># Get an attribute</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> gecko<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'name'</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
      <span style="color:#008000; font-style:italic;"># Get a text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./espece&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./periode&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./region&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./taille&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./couleur&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Avec REXML, on pouvait avoir :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    <span style="color:#008000; font-style:italic;"># Get a node (or many)</span>
    <span style="color:#9966CC; font-weight:bold;">for</span> gecko <span style="color:#9966CC; font-weight:bold;">in</span> <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">root</span>.<span style="color:#9900CC;">elements</span>
&nbsp;
      <span style="color:#008000; font-style:italic;"># Get an attribute</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> gecko.<span style="color:#9900CC;">attributes</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'name'</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
      <span style="color:#008000; font-style:italic;"># Get a text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;espece&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;periode&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;region&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;taille&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">elements</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;couleur&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<h3>Chercher un noeud</h3>
<p>Pour Nokogiri, je le fais avec XPATH, mais il y a d&#8217;autres moyens.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> searchNode<span style="color:#006600; font-weight:bold;">&#40;</span>xpathExpr<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    myNode = <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">at</span><span style="color:#006600; font-weight:bold;">&#40;</span>xpathExpr<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNode == <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Not found...&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> myNode.<span style="color:#9900CC;">to_xml</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> myNode
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Avec REXML, seule la ligne de recherche était un peu différente (attention la méthode to_xml ne marche pas pour REXML) :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    myNode = <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">elements</span>.<span style="color:#9900CC;">to_a</span><span style="color:#006600; font-weight:bold;">&#40;</span>xpathExpr<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<h3>Ajouter un noeud</h3>
<p>Je distingue deux cas, ajouter un noeud à la racine et ajouter un noeud n&#8217;importe où.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> insertAChildNode<span style="color:#006600; font-weight:bold;">&#40;</span>docPosition, myNode<span style="color:#006600; font-weight:bold;">&#41;</span>
    docPosition.<span style="color:#9900CC;">add_child</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNode<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> addARootNode<span style="color:#006600; font-weight:bold;">&#40;</span>myNode<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">root</span> = myNode
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Pour REXML, on utilisait :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#008000; font-style:italic;"># Insert a node in the XML doc</span>
    docPosition.<span style="color:#9900CC;">add_element</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNode<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Insert a root node in the XML doc</span>
    <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">add_element</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNode<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<h3>Créer un nouveau noeud</h3>
<p>Pour créer un nouveau noeud avec Nokogiri (avant de l&#8217;ajouter)</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> createANewNode<span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#6666ff; font-weight:bold;">Nokogiri::XML::Node</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>name, <span style="color:#0066ff; font-weight:bold;">@myDoc</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Avec REXML, on faisait :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    <span style="color:#0000FF; font-weight:bold;">return</span> Element.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<h3>Ajouter un texte et des attributs</h3>
<p>Pour ajouter du texte ou un attribut avec Nokogiri :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> addAnAttribute<span style="color:#006600; font-weight:bold;">&#40;</span>myNode, name, value<span style="color:#006600; font-weight:bold;">&#41;</span>
    myNode<span style="color:#006600; font-weight:bold;">&#91;</span>name<span style="color:#006600; font-weight:bold;">&#93;</span> = value
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> addText<span style="color:#006600; font-weight:bold;">&#40;</span>myNode, text<span style="color:#006600; font-weight:bold;">&#41;</span>
    myNode.<span style="color:#9900CC;">content</span> = text.<span style="color:#9900CC;">to_s</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Avec REXML :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#008000; font-style:italic;"># Add attribute</span>
    myNode.<span style="color:#9900CC;">add_attribute</span><span style="color:#006600; font-weight:bold;">&#40;</span>name, value<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Add text</span>
    myNode.<span style="color:#9900CC;">text</span> = text.<span style="color:#9900CC;">to_s</span></pre></div></div>

<h3>Créer un nouveau document</h3>
<p>Avec Nokogiri :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> createANewDoc<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    myNewDoc = <span style="color:#6666ff; font-weight:bold;">Nokogiri::XML::Document</span>.<span style="color:#9900CC;">new</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Avec REXML c&#8217;était à peu près pareil :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    myNewDoc = Document.<span style="color:#9900CC;">new</span></pre></div></div>

<h3>Sauvegarder l&#8217;arbre XML dans un fichier</h3>
<p>Et pour finir, voici comment sauvegarder l&#8217;arbre dans un fichier avec Nokogiri :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> saveToFile<span style="color:#006600; font-weight:bold;">&#40;</span>myfileName<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">begin</span>
      myFile = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>myfileName<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    myFile = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>myfileName, <span style="color:#996600;">'w'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">write_xml_to</span><span style="color:#006600; font-weight:bold;">&#40;</span>myFile, <span style="color:#ff3333; font-weight:bold;">:indent</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#006666;">4</span>, <span style="color:#ff3333; font-weight:bold;">:encoding</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'UTF-8'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    myFile.<span style="color:#9900CC;">close</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Avec REXML, la ligne d&#8217;écriture était différente :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">write</span><span style="color:#006600; font-weight:bold;">&#40;</span>myFile, <span style="color:#006666;">4</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<h3>Utilisation</h3>
<p>Maintenant vous pouvez utiliser ces fonctions de base (vous pouvez en faire de même avec celle en REXML). En vrac par exemple :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Load the XML doc</span>
myXMLNokogiri = XMLNokogiri.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./Gekkonidae.xml&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#008000; font-style:italic;"># Print the XML doc</span>
myXMLNokogiri.<span style="color:#9900CC;">readXML</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#008000; font-style:italic;"># Get the node of the gecko named Green</span>
myXMLNokogiri.<span style="color:#9900CC;">searchNode</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'//gecko[@name = &quot;Green&quot;]'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Add a new gecko node with an attribute name Color</span>
myNewNode = myXMLNokogiri.<span style="color:#9900CC;">createANewNode</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'gecko'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
myXMLNokogiri.<span style="color:#9900CC;">addAnAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNewNode, <span style="color:#996600;">'name'</span>, <span style="color:#996600;">'Color'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
myXMLNokogiri.<span style="color:#9900CC;">addARootNode</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNewNode<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Add a node couleur to the node we have just added</span>
myNewNode = myXMLNokogiri.<span style="color:#9900CC;">createANewNode</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'couleur'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
myXMLNokogiri.<span style="color:#9900CC;">addText</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNewNode, <span style="color:#996600;">'Multicolor'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
myNode = myXMLNokogiri.<span style="color:#9900CC;">searchNode</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'//gecko[@name = &quot;Color&quot;]'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
myXMLNokogiri.<span style="color:#9900CC;">insertAChildNode</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNode, myNewNode<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># We create a new doc and save it at the place of the old one (yeah, it's just to test eh :p)</span>
myXMLNokogiri.<span style="color:#9900CC;">myDoc</span> = myXMLNokogiri.<span style="color:#9900CC;">createANewDoc</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># We create a new node with an attribute</span>
myNewNode = myXMLNokogiri.<span style="color:#9900CC;">createANewNode</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'gecko'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
myXMLNokogiri.<span style="color:#9900CC;">addAnAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNewNode, <span style="color:#996600;">'name'</span>, <span style="color:#996600;">'Geckogeek'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#008000; font-style:italic;"># We create a new node and add it to the gecko node we have created</span>
myNewChildNode = myXMLNokogiri.<span style="color:#9900CC;">createANewNode</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'espece'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
myXMLNokogiri.<span style="color:#9900CC;">addText</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNewChildNode, <span style="color:#996600;">'Geek'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
myXMLNokogiri.<span style="color:#9900CC;">insertAChildNode</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNewNode, myNewChildNode<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#008000; font-style:italic;"># We add the gecko node to our new tree</span>
myXMLNokogiri.<span style="color:#9900CC;">addARootNode</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNewNode<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># We save this tree in a file</span>
myXMLNokogiri.<span style="color:#9900CC;">saveToFile</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./GekkonidaeGeek.xml&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<h2>Récapitulatif</h2>
<p>Voici en un seul tenant la classe Nokogiri que nous venons d&#8217;écrire :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'nokogiri'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> XMLNokogiri
&nbsp;
  attr_accessor <span style="color:#ff3333; font-weight:bold;">:myDoc</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
    loadXML<span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> loadXML<span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">begin</span>
      myFile = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>myFileName<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Can't open the file. Please check the name: &quot;</span> <span style="color:#006600; font-weight:bold;">+</span> myFileName <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;. Try it again: &quot;</span>
      myFileName = <span style="color:#CC0066; font-weight:bold;">gets</span>.<span style="color:#CC0066; font-weight:bold;">chomp</span>
      <span style="color:#9966CC; font-weight:bold;">retry</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#0066ff; font-weight:bold;">@myDoc</span> = <span style="color:#6666ff; font-weight:bold;">Nokogiri::XML</span><span style="color:#006600; font-weight:bold;">&#40;</span>myFile<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> readXML<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Get a node (or many)</span>
    <span style="color:#9966CC; font-weight:bold;">for</span> gecko <span style="color:#9966CC; font-weight:bold;">in</span> <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">root</span>.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;//gecko&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
      <span style="color:#008000; font-style:italic;"># Get an attribute</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> gecko<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'name'</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
      <span style="color:#008000; font-style:italic;"># Get a text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./espece&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./periode&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./region&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./taille&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> gecko.<span style="color:#9900CC;">xpath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;./couleur&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">text</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> searchNode<span style="color:#006600; font-weight:bold;">&#40;</span>xpathExpr<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    myNode = <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">at</span><span style="color:#006600; font-weight:bold;">&#40;</span>xpathExpr<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNode == <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Not found...&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> myNode.<span style="color:#9900CC;">to_xml</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> myNode
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> insertAChildNode<span style="color:#006600; font-weight:bold;">&#40;</span>docPosition, myNode<span style="color:#006600; font-weight:bold;">&#41;</span>
    docPosition.<span style="color:#9900CC;">add_child</span><span style="color:#006600; font-weight:bold;">&#40;</span>myNode<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> addARootNode<span style="color:#006600; font-weight:bold;">&#40;</span>myNode<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">root</span> = myNode
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> createANewNode<span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#6666ff; font-weight:bold;">Nokogiri::XML::Node</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>name, <span style="color:#0066ff; font-weight:bold;">@myDoc</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> addAnAttribute<span style="color:#006600; font-weight:bold;">&#40;</span>myNode, name, value<span style="color:#006600; font-weight:bold;">&#41;</span>
    myNode<span style="color:#006600; font-weight:bold;">&#91;</span>name<span style="color:#006600; font-weight:bold;">&#93;</span> = value
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> addText<span style="color:#006600; font-weight:bold;">&#40;</span>myNode, text<span style="color:#006600; font-weight:bold;">&#41;</span>
    myNode.<span style="color:#9900CC;">content</span> = text.<span style="color:#9900CC;">to_s</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> createANewDoc<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    myNewDoc = <span style="color:#6666ff; font-weight:bold;">Nokogiri::XML::Document</span>.<span style="color:#9900CC;">new</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> saveToFile<span style="color:#006600; font-weight:bold;">&#40;</span>myfileName<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">begin</span>
      myFile = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>myfileName<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    myFile = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>myfileName, <span style="color:#996600;">'w'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@myDoc</span>.<span style="color:#9900CC;">write_xml_to</span><span style="color:#006600; font-weight:bold;">&#40;</span>myFile, <span style="color:#ff3333; font-weight:bold;">:indent</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#006666;">4</span>, <span style="color:#ff3333; font-weight:bold;">:encoding</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'UTF-8'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    myFile.<span style="color:#9900CC;">close</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Voilà vous avez les bases pour vous lancer dans cette librairie ! N&#8217;hésitez surtout pas à l&#8217;utiliser ;-] ça serait dommage de passer à côté. Vous pouvez aussi aller jeter un oeil sur le <a href="http://nokogiri.org/">site officiel</a> si ça vous dit.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;title=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;t=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;title=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;title=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby+-+http://b2l.me/dbweq+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;title=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby&amp;desc=Nous%20allons%20d%C3%A9couvrir%20dans%20ce%20billet%20une%20petite%20librairie%20bien%20sympathique%20pour%20Ruby%20qui%20vous%20sera%20surement%20tr%C3%A8s%20utile.%20Apr%C3%A8s%20une%20br%C3%A8ve%20description%2C%20nous%20verrons%20comment%20l%27utiliser%20dans%20ses%20fonctionnalit%C3%A9s%20de%20bases.%20Nous%20nous%20focaliserons%20essentiellement%20sur%20le%20c%C3%B4t%C3%A9%20XML." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;title=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;title=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;title=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;t=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html&amp;bm_description=Nokogiri+%3A+le+parseur+XML+sexy+de+Ruby&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/nokogiri-le-parseur-xml-sexy-de-ruby.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON sur iPhone : installation et exemple</title>
		<link>http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html</link>
		<comments>http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html#comments</comments>
		<pubDate>Sun, 03 Jan 2010 20:08:09 +0000</pubDate>
		<dc:creator>Vinz</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=770</guid>
		<description><![CDATA[Nous allons expliquer par ce billet comment lire du code JSON sous iPhone tout en gérant d'éventuelles erreurs. Nous ne ferons que présenter la librairie avec un exemple clair et concis qui peut facilement se customiser selon les besoins.]]></description>
			<content:encoded><![CDATA[<p>Nous allons expliquer par ce billet comment <strong>lire du code JSON</strong> sous <span style="text-decoration: underline;">iPhone</span> tout en gérant d&#8217;éventuelles erreurs. Nous ne ferons que présenter la librairie avec un exemple clair et concis qui peut facilement se customiser selon les besoins.<br />
<img class="aligncenter size-full wp-image-780" title="JSON Logo" src="http://www.geckogeek.fr/wp-content/uploads/2010/01/json.png" alt="" width="160" height="160" /></p>
<h2>Pourquoi du JSON ?</h2>
<p>Même si à l&#8217;heure actuelle les <strong>réseaux mobiles</strong> ne sont pas encore trop saturés en France (contrairement à nos amis Anglophones), il est bon de choisir un moyen relativement léger pour faire <strong>transiter des données</strong>. Le XML, quand bien même très répandu et facile à utiliser, n&#8217;est pas forcément très léger. Voici un rapide exemple pour le prouver (sans en-tête de charset etc).</p>
<h3>Version XML</h3>

<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;bakery<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Au petit Gecko<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;adress<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10 Rue du Soleil, Mer du Paradis<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/adress<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;candies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;candy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>La Spéciale<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.45<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/candy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;candy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Gourmandise du Gecko<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.30<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/candy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/candies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bakery<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Version JSON</h3>

<div class="wp_syntax"><div class="code"><pre class="json" style="font-family:monospace;">{ &quot;bakery&quot;:
  {
    &quot;name&quot;: &quot;Au petit Gecko&quot;,
    &quot;adress&quot;: &quot;10 Rue du Soleil, Mer du Paradis&quot;,
    &quot;candies&quot;: {
      &quot;candy&quot;: [
        {&quot;name&quot;: &quot;La Spéciale&quot;, &quot;price&quot;: &quot;0.45&quot;},
        {&quot;name&quot;: &quot;Gourmandise du Gecko&quot;, &quot;price&quot;: &quot;0.30&quot;}
      ]
    }
  }
}</pre></div></div>

<h3>Quelques statistiques</h3>
<p>Comme on peut le voir, le JSON est bien plus compact. On aurait pu réduire un peu plus le XML en mettant plus d&#8217;attributs dans les éléments, mais c&#8217;est selon les cas. Nous obtenons <strong>311 caractères pour le XML</strong> contre <strong>268 caractères pour le JSON</strong>. Soit un <span style="text-decoration: underline;">gain de d&#8217;environ 14%</span>. Notre exemple n&#8217;a qu&#8217;une valeur modérée puisqu&#8217;il n&#8217;y a que quelques lignes. Toutefois si nous venions à rajouter 100 bonbons (au lieu de 2 actuellement), nous aurions un <strong>gain d&#8217;environ 35/40%</strong>. Donc selon les données le gain est plus ou moins fort et surement non-négligeable lorsqu&#8217;il s&#8217;agit d&#8217;une connexion à faible débit ou s&#8217;il faut transférer beaucoup de données.<br />
Toutefois nous ne prenons pas tout en compte, nous pourrions aussi venir à comparer le temps de parsing. Mais ce n&#8217;est pas le but ici, donc nous passerons sur ce coup-là :-]</p>
<h2>Installer JSON pour iPhone</h2>
<h3>Télécharger le projet</h3>
<p>Avant de pouvoir utiliser du JSON sur iPhone il vous faut d&#8217;abord <strong>télécharger la librairie</strong> qui pourra l&#8217;analyser. Allez sur le projet Google à <a href="http://code.google.com/p/json-framework/downloads/list" target="_blank">cette adresse</a> et téléchargez le dernier dmg.</p>
<h3>L&#8217;ajouter au projet xCode</h3>
<p><strong>Décompressez l&#8217;archive</strong> et ajoutez le dossier &#8220;JSON&#8221; à votre projet <strong>xCode</strong>. Puis il vous suffit de lier la librairie à votre projet avec un :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;JSON.h&quot;</span></pre></div></div>

<h2>Exemple JSON</h2>
<p>Nous partons du principe que vous avez récupéré le <strong>code JSON</strong> via une requête HTTP (nous ferons bientôt un billet à ce propos) ou bien dans un fichier.</p>
<h3>Etape par étape</h3>
<p>Dans un premier temps nous déclarons les variables utilisées :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Vars</span>
SBJSON <span style="color: #002200;">*</span>json;
<span style="color: #400080;">NSError</span> <span style="color: #002200;">*</span>jsonError;
<span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>jsonResults;</pre></div></div>

<ul>
<li>La première variable (<strong>json</strong>) permet de procéder au <span style="text-decoration: underline;">traitement</span> de la chaîne de texte contenant le code JSON.</li>
<li>La deuxième (<strong>jsonError</strong>) est utilisée pour stocker une <span style="text-decoration: underline;">éventuelle erreur</span> lors se la procédure.</li>
<li>Et enfin la dernière (<strong>jsonResults</strong>) contient la <span style="text-decoration: underline;">liste des objets</span> après le traitement</li>
</ul>
<p>Puis nous <strong>initialisons</strong> la variable json :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Init JSON</span>
json <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span> <span style="color: #002200;">&#91;</span> SBJSON new <span style="color: #002200;">&#93;</span> autorelease <span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>Et enfin nous procédons à la <strong>lecture</strong> de la variable contenant le code JSON (response) :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Get result in a NSDictionary</span>
jsonResults <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span> json objectWithString<span style="color: #002200;">:</span>response error<span style="color: #002200;">:&amp;</span>amp;jsonError <span style="color: #002200;">&#93;</span>;</pre></div></div>

<p><strong>Si une erreur est survenue</strong> alors la variable jsonResults sera à &#8220;nil&#8221;. Il nous suffit alors de procéder ainsi :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Check if there is an error</span>
<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>jsonResults <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Erreur lors de la lecture du code JSON (%@).&quot;</span>, <span style="color: #002200;">&#91;</span> jsonError localizedDescription <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Do some stuff</span>
&nbsp;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Il ne nous reste plus qu&#8217;à <strong>parser le code JSON</strong> (voir l&#8217;exemple ci-dessus) :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Check if there is an error</span>
<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>jsonResults <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Erreur lors de la lecture du code JSON (%@).&quot;</span>, <span style="color: #002200;">&#91;</span> jsonError localizedDescription <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #400080;">NSArray</span> <span style="color: #002200;">*</span>candiesList;
	<span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>bakery <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span> jsonResults objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;bakery&quot;</span> <span style="color: #002200;">&#93;</span>;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Nom : %@&quot;</span>, <span style="color: #002200;">&#91;</span> bakery objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;name&quot;</span> <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Adresse : %@&quot;</span>, <span style="color: #002200;">&#91;</span> bakery objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;adress&quot;</span> <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Bonbons :&quot;</span><span style="color: #002200;">&#41;</span>;
	candiesList <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span> <span style="color: #002200;">&#91;</span> bakery objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;candies&quot;</span> <span style="color: #002200;">&#93;</span> objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;candy&quot;</span> <span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>candy <span style="color: #a61390;">in</span> candiesList<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
		NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\t</span>Nom=%@ et Prix=%@&quot;</span>, <span style="color: #002200;">&#91;</span> candy objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;name&quot;</span> <span style="color: #002200;">&#93;</span>,
							<span style="color: #002200;">&#91;</span> candy objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;price&quot;</span> <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Notez que nous avons ici stocké l&#8217;ensemble des bonbons dans un <strong>NSArray</strong> et non un NSDictionnary. Le NSArray contient bien au final un ensemble de NSDictionnary que l&#8217;on peut parcourir sans problème.</p>
<h3>Tout le code</h3>
<p>Et pour finir l&#8217;ensemble des morceaux assemblés bout à bout :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Vars</span>
SBJSON <span style="color: #002200;">*</span>json;
<span style="color: #400080;">NSError</span> <span style="color: #002200;">*</span>jsonError;
<span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>jsonResults;
&nbsp;
<span style="color: #11740a; font-style: italic;">// Init JSON</span>
json <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span> <span style="color: #002200;">&#91;</span> SBJSON new <span style="color: #002200;">&#93;</span> autorelease <span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">// Get result in a NSDictionary</span>
jsonResults <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span> json objectWithString<span style="color: #002200;">:</span>response error<span style="color: #002200;">:&amp;</span>amp;jsonError <span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">// Check if there is an error</span>
<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>jsonResults <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Erreur lors de la lecture du code JSON (%@).&quot;</span>, <span style="color: #002200;">&#91;</span> jsonError localizedDescription <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #400080;">NSArray</span> <span style="color: #002200;">*</span>candiesList;
	<span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>bakery <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span> jsonResults objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;bakery&quot;</span> <span style="color: #002200;">&#93;</span>;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Nom : %@&quot;</span>, <span style="color: #002200;">&#91;</span> bakery objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;name&quot;</span> <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Adresse : %@&quot;</span>, <span style="color: #002200;">&#91;</span> bakery objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;adress&quot;</span> <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Bonbons :&quot;</span><span style="color: #002200;">&#41;</span>;
	candiesList <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span> <span style="color: #002200;">&#91;</span> bakery objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;candies&quot;</span> <span style="color: #002200;">&#93;</span> objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;candy&quot;</span> <span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>candy <span style="color: #a61390;">in</span> candiesList<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
		NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\t</span>Nom=%@ et Prix=%@&quot;</span>, <span style="color: #002200;">&#91;</span> candy objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;name&quot;</span> <span style="color: #002200;">&#93;</span>,
							<span style="color: #002200;">&#91;</span> candy objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;price&quot;</span> <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p><strong>Si ce tutorial vous a été utile ou si vous avez besoin d&#8217;une autre information sur le sujet, n&#8217;hésitez pas à laisser un commentaire :-]</strong></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;title=JSON+sur+iPhone+%3A+installation+et+exemple" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;t=JSON+sur+iPhone+%3A+installation+et+exemple" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;title=JSON+sur+iPhone+%3A+installation+et+exemple" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;title=JSON+sur+iPhone+%3A+installation+et+exemple" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=JSON+sur+iPhone+%3A+installation+et+exemple+-+File: /home/vps_useracct/b2l.me/functions.php<br />Line: 66<br />Message: Duplicate entry 'cu9d5' for key 2+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;title=JSON+sur+iPhone+%3A+installation+et+exemple&amp;desc=Nous%20allons%20expliquer%20par%20ce%20billet%20comment%20lire%20du%20code%20JSON%20sous%20iPhone%20tout%20en%20g%C3%A9rant%20d%27%C3%A9ventuelles%20erreurs.%20Nous%20ne%20ferons%20que%20pr%C3%A9senter%20la%20librairie%20avec%20un%20exemple%20clair%20et%20concis%20qui%20peut%20facilement%20se%20customiser%20selon%20les%20besoins." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;title=JSON+sur+iPhone+%3A+installation+et+exemple" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;title=JSON+sur+iPhone+%3A+installation+et+exemple" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;title=JSON+sur+iPhone+%3A+installation+et+exemple" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;t=JSON+sur+iPhone+%3A+installation+et+exemple" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html&amp;bm_description=JSON+sur+iPhone+%3A+installation+et+exemple&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/json-sur-iphone-installation-et-exemple.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bonne année 2010 !</title>
		<link>http://www.geckogeek.fr/bonne-annee-2010.html</link>
		<comments>http://www.geckogeek.fr/bonne-annee-2010.html#comments</comments>
		<pubDate>Fri, 01 Jan 2010 11:25:19 +0000</pubDate>
		<dc:creator>Vinz</dc:creator>
				<category><![CDATA[GeckoGeek]]></category>
		<category><![CDATA[Nouvelle année]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=722</guid>
		<description><![CDATA[Alors que GeckoGeek n&#8217;est qu&#8217;un jeune Mo&#8217;o de quelques mois, une nouvelle année commence déjà. Nous vous souhaitons à toutes et à tous une bonne et agréable année 2010 ! Quelle soit emplie de projets, de créativité et de magie !

Et surtout, continuez à vous gaver de chocolats, c&#8217;est encore la période, et réjouissez-vous : [...]]]></description>
			<content:encoded><![CDATA[<p>Alors que GeckoGeek n&#8217;est qu&#8217;un jeune Mo&#8217;o de quelques mois, une nouvelle année commence déjà. Nous vous souhaitons à toutes et à tous une bonne et agréable année 2010 ! Quelle soit emplie de projets, de créativité et de magie !</p>
<p style="text-align: center;"><img class="alignnone" title="Gecko" src="http://www.geckogeek.fr/static/design/masquotte.png" alt="" width="127" height="145" /></p>
<p>Et surtout, continuez à vous gaver de chocolats, c&#8217;est encore la période, et réjouissez-vous : le temps des raclettes est arrivé !</p>
<p style="text-align: center;">[ NDLR : ce billet a été programmé automatiquement, évidemment, les geckos sont à la fête ^^ ]</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/bonne-annee-2010.html&amp;title=Bonne+ann%C3%A9e+2010+%21" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/bonne-annee-2010.html&amp;t=Bonne+ann%C3%A9e+2010+%21" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/bonne-annee-2010.html&amp;title=Bonne+ann%C3%A9e+2010+%21" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/bonne-annee-2010.html&amp;title=Bonne+ann%C3%A9e+2010+%21" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Bonne+ann%C3%A9e+2010+%21+-+http://b2l.me/cqt4d+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/bonne-annee-2010.html&amp;title=Bonne+ann%C3%A9e+2010+%21&amp;desc=Alors%20que%20GeckoGeek%20n%27est%20qu%27un%20jeune%20Mo%27o%20de%20quelques%20mois%2C%20une%20nouvelle%20ann%C3%A9e%20commence%20d%C3%A9j%C3%A0.%20Nous%20vous%20souhaitons%20%C3%A0%20toutes%20et%20%C3%A0%20tous%20une%20bonne%20et%20agr%C3%A9able%20ann%C3%A9e%202010%20%21%20Quelle%20soit%20emplie%20de%20projets%2C%20de%20cr%C3%A9ativit%C3%A9%20et%20de%20magie%20%21%0D%0A%0D%0AEt%20surtout%2C%20continuez%20%C3%A0%20vous%20gaver%20de%20chocolats%2C%20c%27est%20enc" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/bonne-annee-2010.html&amp;title=Bonne+ann%C3%A9e+2010+%21" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/bonne-annee-2010.html&amp;title=Bonne+ann%C3%A9e+2010+%21" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/bonne-annee-2010.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/bonne-annee-2010.html&amp;title=Bonne+ann%C3%A9e+2010+%21" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/bonne-annee-2010.html&amp;t=Bonne+ann%C3%A9e+2010+%21" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/bonne-annee-2010.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/bonne-annee-2010.html&amp;bm_description=Bonne+ann%C3%A9e+2010+%21&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/bonne-annee-2010.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Orizuru modifiée ou la grue qui vole…</title>
		<link>http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html</link>
		<comments>http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html#comments</comments>
		<pubDate>Mon, 28 Dec 2009 18:16:35 +0000</pubDate>
		<dc:creator>Lya</dc:creator>
				<category><![CDATA[Origami]]></category>
		<category><![CDATA[Crease Pattern]]></category>
		<category><![CDATA[Grue]]></category>
		<category><![CDATA[Orizuru]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=725</guid>
		<description><![CDATA[Un peu de pliage de papier pour changer. Si vous vous y connaissez un peu en Origami, vous avez surement entendu parler (et même réalisé) du modèle traditionnel de base le plus populaire : la grue (Orizuru). C’est un modèle assez simple à réaliser et le rendu est plutôt bon. On obtient une jolie petite grue, mais malheureusement, elle ne vole pas. Projetez-la dans les airs, et elle va mollement tourbillonner avant de s’écraser sans élégance sur le sol. En modifiant un peu le pliage, il y a moyen d’y remédier.]]></description>
			<content:encoded><![CDATA[<p>Un peu de pliage de papier pour changer. Si vous vous y connaissez un peu en Origami, vous avez surement entendu parler (et même réalisé) du modèle traditionnel de base le plus populaire : la grue (Orizuru). C’est un modèle assez simple à réaliser et le rendu est plutôt bon. On obtient une jolie petite grue, mais malheureusement, elle ne vole pas. Projetez-la dans les airs, et elle va mollement tourbillonner avant de s’écraser sans élégance sur le sol. En modifiant un peu le pliage, il y a moyen d’y remédier.</p>
<p style="text-align: center;"><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru.jpg"><img class="aligncenter size-large wp-image-744" title="Origami_Orizuru" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru-1024x488.jpg" alt="" width="597" height="284" /></a></p>
<h2>Orizuru traditionnelle</h2>
<h3>Légende</h3>
<p>Une légende autour d’Orizuru apporte à sa popularité : « Quiconque plie mille grues de papier verra son voeu exaucé ». Cette légende a été renforcée par l’histoire d’une jeune fille atteinte d’une leucémie près d’Hiroshima. Sadako Sasaki a alors entrepris le pliage des 1000 grues. Ses amis ont dû terminer cet ouvrage pour elle et une statue a été érigée en son souvenir : Orizuru est alors devenu symbole de paix.</p>
<h3>Diagrammes</h3>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_01.png"><img class="aligncenter size-medium wp-image-727" title="Origami_Orizuru_Diagramme_01" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_01-300x83.png" alt="" width="300" height="83" /></a></p>
<p>1. Marquez les plis de l&#8217;horizontale et de la verticale, ainsi que ceux des deux diagonales. Ne dépliez pas la dernière diagonale et positionnez le triangle obtenu tête en bas.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_02-05.png"><img class="aligncenter size-medium wp-image-728" title="Origami_Orizuru_Diagramme_02-05" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_02-05-300x189.png" alt="" width="300" height="189" /></a></p>
<p>2. Rentrez les deux pointes de la base à l&#8217;intérieur en inversant les plis. Vous obtenez alors un losange carré.<br />
3. Rabattez les deux ailes du dessus le long de la ligne médiane. Marquez les plis et redépliez.<br />
4. Rentrez-les à l&#8217;intérieur en inversant les plis.<br />
5. Retournez le modèle et répétez l&#8217;étape 4 sur les deux ailes du dessous.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_06.png"><img class="aligncenter size-full wp-image-730" title="Origami_Orizuru_Diagramme_06" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_06.png" alt="" width="160" height="219" /></a></p>
<p>6. Vous obtenez alors une base. Elle est couramment appelée base du cerf-volant ou base de l&#8217;oiseau.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_07-08.png"><img class="aligncenter size-medium wp-image-731" title="Origami_Orizuru_Diagramme_07-08" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_07-08-300x181.png" alt="" width="300" height="181" /></a></p>
<p>7. Soulevez le premier volet et marquez le pli. Retournez le modèle.<br />
8. Faites de même avec ce volet.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_09-10.png"><img class="aligncenter size-medium wp-image-732" title="Origami_Orizuru_Diagramme_09-10" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_09-10-300x276.png" alt="" width="300" height="276" /></a></p>
<p>9. Ramenez les bords le long de la ligne médiane. Marquez les plis.<br />
10. Retournez le modèle et faites de même avec les deux bords restants.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_11.png"><img class="aligncenter size-medium wp-image-733" title="Origami_Orizuru_Diagramme_11" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_11-300x166.png" alt="" width="300" height="166" /></a></p>
<p>11. Pliez chacune des pointes le long de la ligne comme indiqué sur le schéma. Marquez bien les plis et redépliez. Inversez les plis obtenus.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_12.png"><img class="aligncenter size-medium wp-image-734" title="Origami_Orizuru_Diagramme_12" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_12-300x91.png" alt="" width="300" height="91" /></a></p>
<p>12. Pour la tête pliez une des pointes selon la ligne indiquée. Marquez bien le pli, redépliez. Inversez les plis obtenus.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_13.png"><img class="aligncenter size-full wp-image-735" title="Origami_Orizuru_Diagramme_13" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_13.png" alt="" width="245" height="227" /></a></p>
<p>13. Voilà Orizuru est fini, il ne vous reste plus qu&#8217;à déployer ses ailes. Tirer doucement dessus pour les écarter.</p>
<div style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="275" 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.dailymotion.com/swf/xbra46&amp;related=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="275" src="http://www.dailymotion.com/swf/xbra46&amp;related=0" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<strong><a href="http://www.dailymotion.com/video/xbra46_pliage-de-grue-orizuru-origami_creation">Pliage de Grue Orizuru &#8211; Origami</a></strong></div>
<h2>Pourquoi Orizuru ne vole-t-elle pas ? (Crease Pattern)</h2>
<p>Vous pouvez essayer comme vous voulez, ça ne marchera pas, car le centre de gravité n’est pas bien placé. Il se trouve trop en arrière par rapport à la portance de la grue (composante verticale de la force aérodynamique subit par la grue en plein vol).<br />
Du coup, il faut modifier un peu le modèle original. On peut au choix changer l’angle de flèche et avoir des ailes orientées plus en arrière comme les avions ou bien lui faire une tête plus lourde. Dans ce modèle, c’est l’angle de flèche qui a été modifié.</p>
<p>Voici ce que ça donne sur les Crease Patterns (CP) :<br />
<a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Crease_Pattern_Orizuru_Grue.png"><img class="aligncenter size-medium wp-image-726" title="Origami_Crease_Pattern_Orizuru_Grue" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Crease_Pattern_Orizuru_Grue-300x160.png" alt="" width="300" height="160" /></a></p>
<h2>Orizuru modifiée</h2>
<p>Voyons maintenant les diagrammes pour Orizuru modifiée.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_01.png"><img class="aligncenter size-medium wp-image-727" title="Origami_Orizuru_Diagramme_01" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_Diagramme_01-300x83.png" alt="" width="300" height="83" /></a><br />
1. Marquez les plis de l&#8217;horizontale et de la verticale, ainsi que ceux des deux diagonales. Ne dépliez pas la dernière diagonale et positionnez le triangle obtenu tête en bas.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_02-05.png"><img class="aligncenter size-medium wp-image-738" title="Origami_Orizuru_2_Diagramme_02-05" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_02-05-300x141.png" alt="" width="300" height="141" /></a><br />
2. Ramenez la pointe selon le plis montagne comme indiqué. Vous devez obtenir la forme de la figure 3. Veillez à ce que le pli de l&#8217;horizontale vienne s&#8217;aligner sur le pli de la diagonale sur la pointe.<br />
3. Rabattez les deux ailes le long de la ligne médiane. Marquez les plis et redépliez.<br />
4. Soulevez la pointe et aplatissez selon les plis indiqués.<br />
5. Vous devez obtenir cette figure. Retournez le modèle.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_07-09.png"><img class="aligncenter size-medium wp-image-739" title="Origami_Orizuru_2_Diagramme_07-09" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_07-09-300x91.png" alt="" width="300" height="91" /></a><br />
6. On recommence les étapes 2 à 5. Rabattez le volet vers la gauche.<br />
7. Ramenez la pointe selon le plis montagne comme indiqué. Vous devez obtenir la forme de la figure 8. Veillez à ce que le pli de l&#8217;horizontale vienne s&#8217;aligner sur le pli de la diagonale sur la pointe.<br />
8. Rabattez les deux ailes le long de la ligne médiane. Marquez les plis et redépliez.<br />
9. Soulevez la pointe et aplatissez selon les plis indiqués. Vous obtenez la figure 10.</p>
<p><a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_10.png"><img class="aligncenter size-medium wp-image-740" title="Origami_Orizuru_2_Diagramme_10" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_10-300x286.png" alt="" width="300" height="286" /></a><br />
10. Rabattez les deux ailes supérieures le long de la ligne médiane. Retournez le modèle et rabattez les deux ailes inférieures de la même façon.<br />
<a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_11.png"><img class="aligncenter size-medium wp-image-741" title="Origami_Orizuru_2_Diagramme_11" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_11-300x171.png" alt="" width="300" height="171" /></a><br />
11. Remontez les deux pointes selon les plis indiqués. Marquez bien les plis et redépliez. Remontez les pointes en inversant les plis obtenus.<br />
<a href="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_12.png"><img class="aligncenter size-medium wp-image-742" title="Origami_Orizuru_2_Diagramme_12" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Origami_Orizuru_2_Diagramme_12-300x175.png" alt="" width="300" height="175" /></a><br />
12. Cette fois si le modèle n&#8217;étant pas symétrique, la tête est forcément à gauche. Pliez la pointe selon le pli indiqué. Marquez le pli et redépliez. Pliez à nouveau en inversant les plis obtenus.</p>
<p>Votre Orizuru modifiée est terminée. Déployez les ailes en tirant doucement dessus. Prenez soin de bien les ajuster.  Prenez ensuite votre grue juste en dessous les ailes et lancez-la de la même manière qu’un avion.</p>
<p><center>
<div><object width="480" height="275"><param name="movie" value="http://www.dailymotion.com/swf/xbu0u3&#038;related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/xbu0u3&#038;related=0" type="application/x-shockwave-flash" width="480" height="275" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><b><a href="http://www.dailymotion.com/video/xbu0u3_origami-grue-volant-comme-un-avion_creation">Pliage de Grue Orizuru modifiée &#8211; Origami</a></b></div>
<p></center></p>
<p>Maintenant, si vous voulez changer un peu vos avions en papier, lancez plutôt une grue ;-]</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;title=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole..." rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;t=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole..." rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;title=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole..." rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;title=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole..." rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole...+-+http://b2l.me/cqt9k+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;title=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole...&amp;desc=Un%20peu%20de%20pliage%20de%20papier%20pour%20changer.%20Si%20vous%20vous%20y%20connaissez%20un%20peu%20en%20Origami%2C%20vous%20avez%20surement%20entendu%20parler%20%28et%20m%C3%AAme%20r%C3%A9alis%C3%A9%29%20du%20mod%C3%A8le%20traditionnel%20de%20base%20le%20plus%20populaire%20%3A%20la%20grue%20%28Orizuru%29.%20C%E2%80%99est%20un%20mod%C3%A8le%20assez%20simple%20%C3%A0%20r%C3%A9aliser%20et%20le%20rendu%20est%20plut%C3%B4t%20bon.%20On%20obtient%20une%20jolie%20petite%20grue%2C%20mais%20malheureusement%2C%20elle%20ne%20vole%20pas.%20Projetez-la%20dans%20les%20airs%2C%20et%20elle%20va%20mollement%20tourbillonner%20avant%20de%20s%E2%80%99%C3%A9craser%20sans%20%C3%A9l%C3%A9gance%20sur%20le%20sol.%20En%20modifiant%20un%20peu%20le%20pliage%2C%20il%20y%20a%20moyen%20d%E2%80%99y%20rem%C3%A9dier." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;title=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole..." rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;title=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole..." rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;title=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole..." rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;t=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole..." rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html&amp;bm_description=Orizuru+modifi%C3%A9e+ou+la+grue+qui+vole...&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/orizuru-modifiee-ou-la-grue-qui-vole.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free gagne la 4e licence 3G</title>
		<link>http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html</link>
		<comments>http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html#comments</comments>
		<pubDate>Sat, 19 Dec 2009 09:30:13 +0000</pubDate>
		<dc:creator>Vinz</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[ARCEP]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[Licence 3G]]></category>
		<category><![CDATA[Téléphonie]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=711</guid>
		<description><![CDATA[C'est hier que se tenait la décision finale de l'<strong>ARCEP</strong> quant au destinataire de cette 4ème licence 3G. Et finalement Free a réussi à l'obtenir (pour la bonheur du peuple et le malheur des autres opérateurs). Free devra débourser pas moins de 240 millions d'euros afin de l'obtenir, mais ce n'est au final pas une grande somme si on regarde de près les futures dépenses que Free devra effectuer pour tout mettre en place.]]></description>
			<content:encoded><![CDATA[<p>C&#8217;est hier que se tenait la décision finale de l&#8217;<strong>ARCEP</strong> quant au destinataire de cette 4ème licence 3G. Et finalement Free a réussi à l&#8217;obtenir (pour la bonheur du peuple et le malheur des autres opérateurs). Free devra débourser pas moins de 240 millions d&#8217;euros afin de l&#8217;obtenir, mais ce n&#8217;est au final pas une grande somme si l&#8217;on regarde de près les futures dépenses que Free devra effectuer pour tout mettre en place.</p>
<p><img class="aligncenter size-full wp-image-714" title="Free" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/free.jpg" alt="Free" width="500" height="194" /></p>
<h2>A quand des forfaits Free Mobile ?</h2>
<p>Free se verra officiellement attribuer cette licence <strong>début Janvier 2010</strong>. Ce dernier a annoncé qu&#8217;il lui faudra <strong>au moins 2 ans</strong> pour tout mettre en place avant de pouvoir commercialiser des offres (voire 3 bonnes années). Vous devrez donc attendre début 2012 voire fin 2012 avant de pouvoir changer (ou non) d&#8217;opérateur téléphonique. Orange, Bouygues et SFR ont donc encore 2 ans devant eux pour nous faire payer plein pot leurs forfaits variés. Après ils devront revoir un peu à la baisse leurs offres, ou alors se tirer des exclusivités (comme l&#8217;iPhone pour Orange).</p>
<h2>Promesses promesses, quelles-sont-elles ?</h2>
<ul>
<li>Dans un premier temps de proposer des offres très <strong>compétitives</strong> d&#8217;ici 2 à 3 ans (2 au plus tôt, 3 au plus tard). Cela devrait ainsi un peu casser la concurrence.</li>
<li>Dans les 8 ans de couvrir <strong>90% de la population</strong>.</li>
<li>Accueillir au sein de son réseau des <strong>opérateurs mobiles virtuels</strong> (groupes qui achètent à l&#8217;opérateur des forfaits à un certain prix et vous les revend).</li>
</ul>
<h2>Et la suite ?</h2>
<p>Durant 2010 un nouvel appel d&#8217;offre sera effectué pour attribuer des autorisations sur d&#8217;autres longueurs d&#8217;ondes, dont celle de <strong>2.6GHz pour la &#8220;4G&#8221;</strong>. Donc vous n&#8217;en n&#8217;avez pas fini de vous faire bombarder d&#8217;ondes. Il est clair que les opérateurs actuels vont se ruer sur le coup afin de pouvoir faire contrepoids à Free dans les années à venir.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;title=Free+gagne+la+4e+licence+3G" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;t=Free+gagne+la+4e+licence+3G" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;title=Free+gagne+la+4e+licence+3G" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;title=Free+gagne+la+4e+licence+3G" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Free+gagne+la+4e+licence+3G+-+http://b2l.me/cq836+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;title=Free+gagne+la+4e+licence+3G&amp;desc=C%27est%20hier%20que%20se%20tenait%20la%20d%C3%A9cision%20finale%20de%20l%27ARCEP%20quant%20au%20destinataire%20de%20cette%204%C3%A8me%20licence%203G.%20Et%20finalement%20Free%20a%20r%C3%A9ussi%20%C3%A0%20l%27obtenir%20%28pour%20la%20bonheur%20du%20peuple%20et%20le%20malheur%20des%20autres%20op%C3%A9rateurs%29.%20Free%20devra%20d%C3%A9bourser%20pas%20moins%20de%20240%20millions%20d%27euros%20afin%20de%20l%27obtenir%2C%20mais%20ce%20n%27est%20au%20final%20pas%20une%20grande%20somme%20si%20on%20regarde%20de%20pr%C3%A8s%20les%20futures%20d%C3%A9penses%20que%20Free%20devra%20effectuer%20pour%20tout%20mettre%20en%20place." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;title=Free+gagne+la+4e+licence+3G" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;title=Free+gagne+la+4e+licence+3G" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;title=Free+gagne+la+4e+licence+3G" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;t=Free+gagne+la+4e+licence+3G" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html&amp;bm_description=Free+gagne+la+4e+licence+3G&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/free-gagne-la-4e-licence-3g.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reader Pocket PRS-300 : disponible en france pour Noël</title>
		<link>http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html</link>
		<comments>http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html#comments</comments>
		<pubDate>Fri, 18 Dec 2009 18:06:10 +0000</pubDate>
		<dc:creator>Lya</dc:creator>
				<category><![CDATA[Livres]]></category>
		<category><![CDATA[PRS-300]]></category>
		<category><![CDATA[Reader Pocket]]></category>
		<category><![CDATA[Sony]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=694</guid>
		<description><![CDATA[Après maintes tergiversations, le petit 5 pouces de Sony sort enfin (pour de vrai) en France ! Et vous pouvez même vous le commander pour Noël ;-] Et comme ça fait deux mois que nous avons un petit Reader Pocket PRS-300, nous vous faisons part de notre avis :-] ... ]]></description>
			<content:encoded><![CDATA[<p>Après maintes tergiversations, le petit 5 pouces de Sony sort enfin (pour de vrai cette fois-ci) en France ! Et vous pouvez même vous le commander pour Noël ;-]</p>
<p><img class="aligncenter size-medium wp-image-695" title="Sony-PRS-300-Pocket-Edition" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/Sony-PRS-300-Pocket-Edition-300x250.jpg" alt="Sony-PRS-300-Pocket-Edition" width="300" height="250" /></p>
<h2>Le Pocket Edition en vente</h2>
<p>Nous avions parlé un peu Reader sur un post précédent, mais nous nous étions surtout intéressés au Touch Edition (<a href="http://www.geckogeek.fr/test-du-reader-touch-de-sony-prs-600.html" target="_blank">voir le test</a>), le Pocket n’étant alors vendu qu’aux Etats-Unis. Mais, après plusieurs annonces contradictoires, le PRS-300 est maintenant <strong>en vente</strong> à la <a href="http://telephone-gps-mp3.fnac.com/a2793011/eBook-eBook-Sony-Reader-eBook-Pocket-Edition-PRS-300-Argent?PID=137615" target="_blank">fnac</a> par exemple, ou sur <a href="http://www.amazon.fr/Sony-%C3%A9dition-num%C3%A9riques-PRS300S-couleur/dp/B002PLO5RQ/ref=sr_1_1?ie=UTF8&amp;s=electronics&amp;qid=1261156261&amp;sr=8-1" target="_blank">amazon</a> en <strong>deux coloris</strong>, argent et violet. Il est proposé à 200€.</p>
<h2>Notre avis</h2>
<p>Voilà <strong>deux mois</strong> maintenant que nous en utilisons un (venu des Etats-Unis) et comme nous le disions précédemment, il s’agit grosso-modo d’un 505 évolué et épuré.</p>
<p>La <strong>taille</strong> peut faire peur à certains, mais nous vous rassurons, ce n’est absolument pas trop petit pour lire. Sachant qu’avec des formats d’ebooks comme l’EPUB, on peut facilement zoomer à sa guise, il n&#8217;y a vraiment aucun problème. Nous dirons même que la taille est parfaite : le Reader est légèrement plus petit qu’un livre de poche, ça tient très bien en main et ça se trimballe partout.<br />
Le <strong>rendu</strong> est lui aussi irréprochable, et il n&#8217;y a pas les légers petits reflets du Touch Edition qui sont dus à la couche tactile.</p>
<p>Après sinon, ce sont les <strong>fonctionnalités habituelles</strong>. On branche la petit bête sur l’ordi, on fait glisser des ebooks dedans, il s’occupe tout seul de les ranger.<br />
Ensuite on peut aller au choix, continuer la lecture en cours, aller voir les livres par auteurs ou par date d’ajout. On peut mettre autant de marque-pages que l’on veut et aller farfouiller dedans. Et on lit, lit, lit et relit, …</p>
<p>Pas de couverture en cuir style « livre » par contre pour cette version (une sortira peut-être qui sait, les fixations sont prévues en tout cas) mais bon, l’important c’est que la petite pochette le protège bien des chocs et du transport.</p>
<p>Déjà une bonne centaine de livres dans notre reader, et encore beaucoup de place ^^</p>
<p>Enjoy ! Et n&#8217;hésitez pas à poser vos questions ;-]</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;title=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;t=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;title=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;title=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl+-+http://b2l.me/cqvza+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;title=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl&amp;desc=Apr%C3%A8s%20maintes%20tergiversations%2C%20le%20petit%205%20pouces%20de%20Sony%20sort%20enfin%20%28pour%20de%20vrai%29%20en%20France%20%21%20Et%20vous%20pouvez%20m%C3%AAme%20vous%20le%20commander%20pour%20No%C3%ABl%20%3B-%5D%20Et%20comme%20%C3%A7a%20fait%20deux%20mois%20que%20nous%20avons%20un%20petit%20Reader%20Pocket%20PRS-300%2C%20nous%20vous%20faisons%20part%20de%20notre%20avis%20%3A-%5D%20...%20" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;title=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;title=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;title=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;t=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html&amp;bm_description=Reader+Pocket+PRS-300+%3A+disponible+en+france+pour+No%C3%ABl&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/reader-pocket-prs-300-disponible-en-france-pour-noel.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WinGineer 2010 : la deuxième édition du challenge est lancée !</title>
		<link>http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html</link>
		<comments>http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html#comments</comments>
		<pubDate>Wed, 09 Dec 2009 16:03:37 +0000</pubDate>
		<dc:creator>Lya</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Intelligence Artificielle]]></category>
		<category><![CDATA[WinGineer]]></category>

		<guid isPermaLink="false">http://www.geckogeek.fr/?p=652</guid>
		<description><![CDATA[Demain, le 10 décembre, le challenge WinGineer 2010 sera officiellement lancé ! Vous pouvez d’ores et déjà vous inscrire ! Elèves de terminale, ou BAC+2,  vous vous intéressez à une formation d’ingénieur en informatique ? Alors venez jeter un coup d’oeil ! Curieux ou passionnés d’informatique, vous êtes aussi les bienvenus ! Il y a de quoi s’amuser à tous les niveaux.]]></description>
			<content:encoded><![CDATA[<p>Demain, <strong>le 10 décembre</strong>, le challenge <strong>WinGineer 2010</strong> sera officiellement lancé ! Vous pouvez d’ores et déjà vous inscrire ! Elèves de terminale, ou BAC+2,  vous vous intéressez à une formation d’ingénieur en informatique ? Alors venez jeter un coup d’oeil ! Curieux ou passionnés d’informatique, vous êtes aussi les bienvenus ! Il y a de quoi s’amuser à tous les niveaux.</p>
<p><img class="aligncenter size-medium wp-image-653" title="wingineer_logo2010" src="http://www.geckogeek.fr/wp-content/uploads/2009/12/wingineer_logo2010-300x75.png" alt="wingineer_logo2010" width="300" height="75" /></p>
<h2>Quel est l’objectif de ce challenge ?</h2>
<p>Ce challenge est organisé par le groupe ESIEA, qui rassemble deux écoles : l’ESIEA (Ecole Supérieure d’Informatique, Electronique et Automatique) et In’Tech Info.</p>
<p>Il ne s’agit pas d’un concours d’entrée, mais d’une chance pour les élèves ou étudiants souhaitant rejoindre l’ESIEA de pouvoir remporter la <strong>gratuité de l’ensemble de leur scolarité</strong> dans l’une des écoles du groupe.<br />
Le but de ce challenge n’est donc pas la sélection, et il ne se base absolument pas sur des connaissances quelconques en informatique (ces connaissances-là, c’est la formation qui a le devoir de vous les apporter). Il a une vocation <strong>pédagogique</strong>.</p>
<p>Outre donner un avant goût de ce qu’est la programmation (ça peut toujours être utile avant de se lancer), il a pour objectif de mettre en avant certains profils : curiosité, analyse, logique ou capacité de réflexion et bien d’autres. L’objet du concours ne se base pas sur des connaissances acquises, mais sur des capacités à s’adapter et à apprendre.</p>
<h2>A qui s’adresse-t-il ?</h2>
<p>Et bien tout d’abord aux <strong>lycéens de terminales</strong> (rappelons en passant que l’ESIEA accueille des terminales S aussi bien que des terminales STI) et aux étudiants <strong>Bac+2</strong> qui souhaitent y entrer en troisième année.</p>
<p>Et bien sûr, comme c’est plutôt fun comme challenge, il est aussi ouvert à <strong>tous les autres</strong> qui voudraient juste s’amuser et participer.</p>
<h2>Oui mais si j’y connais rien en informatique ?</h2>
<p>Ah et bien justement, ça tombe bien, il n’y a rien besoin de connaître. Et même si dans le challenge certains seront un peu avantagés au début (je dis bien au début) parce qu’ils ont quelques bases, pas besoin d’avoir des compétences en programmation. (Comme dit plus haut, ça c’est votre formation qui vous les donnera, elle ne peut pas les exiger avant ;-] ou alors il faut se poser des questions&#8230;).</p>
<p>N’oubliez pas que le challenge a une vocation pédagogique, donc il part du principe que vous n’avez jamais touché à la programmation ni une vague idée de ce que c’est.<br />
Vous êtes guidé pas à pas pour que vous puissiez saisir les éléments importants. Vous commencerez par appréhender un peu le contexte et à mettre les doigts dedans en essayant des codes très simples, et vous vous surprendrez pas la suite à élaborer (puis coder ;-]) des stratégies beaucoup plus difficiles !<br />
Et puis il y a un forum sur lequel vous pouvez demander conseil. L’an dernier ça c’est très bien passé, et les participants s’entraidaient volontiers.</p>
<p>Et pour ceux qui ont déjà des bases, ne vous inquiétez pas, vous ne vous ennuierez pas. Il y a moyen de faire des trucs méchamment compliqués en terme de stratégie et de s’éclater (c’est de l’intelligence artificielle après tout ;-]).</p>
<h2>Et on gagne quoi ?</h2>
<p>Nous y venons. Il y a deux catégories de récompenses.</p>
<p>Les trois premiers de la catégorie <strong>bacheliers 2010</strong> :<br />
- 1er prix : <strong>100% des frais de scolarité</strong> à l’ESIEA ou à In’Tech Info pour <strong>5 ans</strong> maximum (soit une économie de 36.000€)<br />
- 2ème prix : <strong>50% des frais annuels de scolarité</strong> à l’ESIEA ou à In’Tech Info pour <strong>5 ans</strong> maximum soit une économie de 18.000€)<br />
- 3ème prix : <strong>25% des frais annuels de scolarité</strong> à l’ESIEA ou à In’Tech Info pour <strong>5 ans</strong> maximum soit une économie de 9.000€)</p>
<p>Les trois premiers de la catégorie <strong>étudiants BAC+2</strong> :<br />
- 1er prix : <strong>100% des frais de scolarité</strong> à l’ESIEA ou à In’Tech Info pour <strong>3 ans</strong> maximum (soit une économie de 21.600€)<br />
- 2ème prix : <strong>50% des frais annuels de scolarité</strong> à l’ESIEA ou à In’Tech Info pour <strong>3 ans</strong> maximum soit une économie de 10.800€)<br />
- 3ème prix : <strong>25% des frais annuels de scolarité</strong> à l’ESIEA ou à In’Tech Info pour <strong>3 ans</strong> maximum soit une économie de 5.400€)</p>
<p>Rappelons les conditions :<br />
Ces bourses ne sont attribuées qui si vous réussissez les épreuves d’admission dans l’une des deux écoles (et que vous vous y inscrivez, bien sûr). Si vous êtes lycéens, vous devez suivre la procédure admission-postbac d’une part (pour l’inscription dans l’un des deux écoles), avoir votre bac à la fin de l’année d’autre part. Si vous êtes étudiants Bac+2, vous devez de la même manière réussir les épreuves du concours d’entrée.</p>
<p>Et ceux qui sont venus pour le fun ? Rien normalement, c’était pour le fun ;-]. L’an dernier les trois premiers du classement général ont reçu un petit cadeau de participation. Pour cette année, je ne sais pas si ça se fera.</p>
<h2>Le challenge se déroule comment ?</h2>
<p>Le challenge s’organise en <strong>deux phases</strong>.</p>
<p>La <strong>première phase</strong> se déroule en ligne, vous soumettez l’intelligence artificielle que vous avez programmée, elle devra se battre contre celles de vos concurrents dans des arènes. Le classement est affiché en live sur le site et vous essayez d’améliorer votre IA. Cette phase est ouverte à tous (terminales, BAC+2, et le groupe « fun »)</p>
<p>La <strong>seconde phase</strong> s’adresse cette fois-ci à ceux qui font l’objet du concours : les candidats admissibles (terminales et BAC+2). En fonction du classement de la première phase, 40 candidats (20 dans chacune des deux catégories) se verront proposer de venir disputer la <strong>finale (le 13 mars)</strong> dans les locaux de l’esiea. L’épreuve est une petite variante de la phase 1 à huis clos.</p>
<h2>Le thème de la nouvelle édition</h2>
<p><center><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" 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/R9h8EFMVrN8&amp;hl=fr_FR&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/R9h8EFMVrN8&amp;hl=fr_FR&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></center></p>
<p>On parle, on parle, mais au juste qu&#8217;est-ce qu&#8217;on doit faire ??? On a déjà parlé d’Intelligence artificielle, alors ?</p>
<p>Et oui, si on y met les grands mots, vous allez devoir programmer l’intelligence artificielle d’un agent qui évolue dans un environnement. Chouette non ? Pour cette édition, adieu papillons, grenouilles, fleurs et abeilles, l’artillerie lourde est sortie ! L’IA que vous devez programmer est celle d’un tank. Vous devez aller récolter des petites étoiles éparpillées dans l’arène, sans vous faire tuer par les autres tanks qui ne sont autres que ceux de vos concurrents (oui, le concours a level-up, cool non ?). </p>
<p>Vous pouvez donc agir sur les actions de votre char (mouvements, direction, …), mais aussi sur le comportement des missiles (là ça devient très fun :-p) que vous tirez. Vous pouvez donc attaquer et vous défendre. </p>
<p>Après vous être tous entretués (on est loin du décors bucolique de la première édition, je vous l&#8217;accorde :p) vous obtiendrez un score de votre performance au cours de cette arène. C’est celui-ci qui va déterminer votre classement (affiché en temps réel sur le site). Il ne tient donc qu’à vous d’améliorer votre robot et de vaincre vos adversaires pour gravir les marches !</p>
<h2>Au fait, pourquoi du Netlogo en langage de programmation ?</h2>
<p>Une question qui a été posée plusieurs fois lors de la dernière édition.<br />
En réalité c’est surtout pour une question pratique tout simplement. Le but étant pédagogique, le langage NetLogo est parfait à ce niveau car il s’agit d’un langage extrêmement proche du langage oral (vous n’avez qu’à traduire en anglais et enlever particules et pronoms qui trainent et ça vous donne quasiment du NetLogo). C&#8217;est ce qui permet aussi de mettre l&#8217;accent sur l&#8217;algorithmie plutôt que sur le langage.<br />
Et puis il n’est pas non plus super utilisé, donc il sera peu connu par les initiés. Autre avantage : ce langage hyper simple permet aussi d’avoir très rapidement un environnement de jeu.</p>
<p>Ce sont ces éléments qui répondent aux contextes du challenge qui ont fait que ce soit ce langage là et pas un autre.</p>
<p>Bref, bref n’oubliez pas d’aller vous inscrire ! Et surtout, have fun ! Parce que c’est ça le plus important (même au cours de votre formation ;-]).</p>
<p>Les inscriptions et le site officiel, c’est par ici : <a href="http://www.wingineer.fr/"> WinGineer</a><br />
La chaîne Youtube où seront postées les vidéos des arènes : <a href="http://www.youtube.com/wingineer">WinGineer on Youtube</a><br />
Pour en savoir plus sur l’esiea : <a href="http://www.esiea.fr">Esiea</a><br />
Et sur In’Tech Info : <a href="http://www.intechinfo.fr/">In&#8217;Tech Info</a><br />
Et si vous voulez fouinez un peu plus : <a href="http://professeurs.esiea.fr/wassner/">;-]</a></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;title=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;t=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;title=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;title=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21+-+http://b2l.me/cqude+(via+@GeckoGeekfr)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;title=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21&amp;desc=Demain%2C%20le%2010%20d%C3%A9cembre%2C%20le%20challenge%20WinGineer%202010%20sera%20officiellement%20lanc%C3%A9%20%21%20Vous%20pouvez%20d%E2%80%99ores%20et%20d%C3%A9j%C3%A0%20vous%20inscrire%20%21%20El%C3%A8ves%20de%20terminale%2C%20ou%20BAC%2B2%2C%20%20vous%20vous%20int%C3%A9ressez%20%C3%A0%20une%20formation%20d%E2%80%99ing%C3%A9nieur%20en%20informatique%20%3F%20Alors%20venez%20jeter%20un%20coup%20d%E2%80%99oeil%20%21%20Curieux%20ou%20passionn%C3%A9s%20d%E2%80%99informatique%2C%20vous%20%C3%AAtes%20aussi%20les%20bienvenus%20%21%20Il%20y%20a%20de%20quoi%20s%E2%80%99amuser%20%C3%A0%20tous%20les%20niveaux." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;title=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;title=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;title=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;t=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html&amp;bm_description=WinGineer+2010+%3A+la+deuxi%C3%A8me+%C3%A9dition+du+challenge+est+lanc%C3%A9e+%21&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.geckogeek.fr/wingineer-2010-la-deuxieme-edition-du-challenge-est-lancee.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
