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

<channel>
	<title>Le blog de l&#039;agence DEEO Interactive Studio</title>
	<atom:link href="http://blog.deeo.fr/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.deeo.fr</link>
	<description>Agence web à Bordeaux (France)</description>
	<lastBuildDate>Fri, 16 Apr 2010 11:49: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>
			<item>
		<title>Optimiser un script JavaScript avec Firebug</title>
		<link>http://blog.deeo.fr/optimiser-un-script-javascript-avec-firebug-80.html</link>
		<comments>http://blog.deeo.fr/optimiser-un-script-javascript-avec-firebug-80.html#comments</comments>
		<pubDate>Fri, 16 Apr 2010 11:45:04 +0000</pubDate>
		<dc:creator>Kevin Chapelier</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://blog.deeo.fr/?p=80</guid>
		<description><![CDATA[Une rapide étude de cas réel avec des indications sur les aides à l'optimisation (profiling) offertes par l'objet console de Firebug.]]></description>
			<content:encoded><![CDATA[<p>Un de nos projets requérait une façon simple et aussi inobstrusive que possible d&#8217;afficher une image de taille conséquente. Plutôt que d&#8217;utiliser l&#8217;un des traditionnels clones de lightbox, nous nous sommes orientés vers <a href="http://mootools.net/forge/p/zoomer" target="_blank">Zoomer</a> (alors en version 1.7), une classe MooTools permettant de faire un effet de zoom sur une image. Le rendu était assez élégant et correspondait exactement à ce que nous cherchions.</p>
<p>Malheureusement, des problèmes de performance se sont rapidement manifestés, l&#8217;animation était loin d&#8217;être fluide dans certains cas. Nous avons donc examiné la classe et voici la partie du <a href="http://github.com/creaven/Zoomer/blob/b00dd7ef4151140f1b73c5be2221de27df9b78d2/Source/Zoomer.js#L115" target="_blank">code</a> qui a attiré notre attention :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">startZoom<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">position</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">small</span>.<span style="color: #660066;">getPosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">timer</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">zoom</span>.<span style="color: #660066;">periodical</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">big</span>.<span style="color: #660066;">fade</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'in'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//....</span>
&nbsp;
zoom<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dstPos</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> steps <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">options</span>.<span style="color: #660066;">smooth</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> current <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		left<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">big</span>.<span style="color: #660066;">getStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		top<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">big</span>.<span style="color: #660066;">getStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> dst <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		left<span style="color: #339933;">:</span> parseInt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dstPos</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">position</span>.<span style="color: #660066;">x</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">bigSize</span>.<span style="color: #660066;">width</span><span style="color: #339933;">/</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">smallSize</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		top<span style="color: #339933;">:</span> parseInt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dstPos</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">position</span>.<span style="color: #660066;">y</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">bigSize</span>.<span style="color: #660066;">height</span><span style="color: #339933;">/</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">smallSize</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> now <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		left<span style="color: #339933;">:</span> current.<span style="color: #660066;">left</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>current.<span style="color: #660066;">left</span> <span style="color: #339933;">-</span> dst.<span style="color: #660066;">left</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>steps<span style="color: #339933;">,</span>
		top<span style="color: #339933;">:</span> current.<span style="color: #660066;">top</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>current.<span style="color: #660066;">top</span> <span style="color: #339933;">-</span> dst.<span style="color: #660066;">top</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>steps
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">big</span>.<span style="color: #660066;">setStyles</span><span style="color: #009900;">&#40;</span>now<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>La méthode zoom() est exécutée tous les centièmes de secondes avec à chaque fois deux appels à getStyle(), une opération plutôt exigeante en ressource,  sur lesquels est appliqué toInt(). Nous avons donc modifié le script de façon à limiter le nombre d&#8217;opérations effectuées dans la méthode zoom().</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">startZoom<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">position</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">small</span>.<span style="color: #660066;">getPosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009966; font-style: italic;">/** precalculations **/</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ratio</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		x <span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">bigSize</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">/</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">smallSize</span>.<span style="color: #660066;">width</span><span style="color: #339933;">,</span>
		y <span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">bigSize</span>.<span style="color: #660066;">height</span> <span style="color: #339933;">/</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">smallSize</span>.<span style="color: #660066;">height</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">current</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		left<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">big</span>.<span style="color: #660066;">getStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		top<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">big</span>.<span style="color: #660066;">getStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">timer</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">zoom</span>.<span style="color: #660066;">periodical</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">big</span>.<span style="color: #660066;">fade</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'in'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//.....</span>
&nbsp;
zoom<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dstPos</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> steps <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">options</span>.<span style="color: #660066;">smooth</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> current <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">current</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> dst <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		left<span style="color: #339933;">:</span> parseInt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dstPos</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">position</span>.<span style="color: #660066;">x</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ratio</span>.<span style="color: #660066;">x</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		top<span style="color: #339933;">:</span> parseInt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dstPos</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">position</span>.<span style="color: #660066;">y</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ratio</span>.<span style="color: #660066;">y</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">current</span>.<span style="color: #660066;">left</span><span style="color: #339933;">-=</span> <span style="color: #009900;">&#40;</span>current.<span style="color: #660066;">left</span> <span style="color: #339933;">-</span> dst.<span style="color: #660066;">left</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> steps<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">current</span>.<span style="color: #660066;">top</span><span style="color: #339933;">-=</span> <span style="color: #009900;">&#40;</span>current.<span style="color: #660066;">top</span> <span style="color: #339933;">-</span> dst.<span style="color: #660066;">top</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> steps<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">big</span>.<span style="color: #660066;">setStyles</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">current</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Pour estimer l&#8217;impact des modifications, nous avons utilisé cette incontournable extension  Firefox qu&#8217;est Firebug. Si comme moi vous travaillez régulièrement sur  des scripts JS, il est probable que vous connaissez déjà l&#8217;objet console  ainsi que sa méthode log() qui permet d&#8217;afficher la valeur d&#8217;une ou  plusieurs variables. Les fonctions à utiliser dans notre cas sont  console.time(string) et console.timeEnd(string). La première initialise  un timer identifié par la chaîne de caractères donnée, tandis que la  seconde permet de le stopper  et d&#8217;en afficher la valeur. Nous avons procédé comme suit : mis les calculs effectués dans la méthode zoom() dans une boucle avec 10000 itérations, initialisé le timer avant  la boucle et affiché sa valeur après. Au final, la fonction originale  prenait entre 500 et 600ms pour s&#8217;effectuer sur Firefox avec Firebug activé, la version modifiée seulement entre 9 et 12ms. Nos modifications ont été intégrées dans la version 1.8 de la classe disponible sur la forge MooTools.</p>
<p>Autres fonctions utiles pour optimiser votre code, généralement lorsque vous ne parvenez pas à identifier le <em>bottleneck</em> du script : console.trace(), console.profile(string), console.profileEnd() et console.count(string). Voir l&#8217;<a href="http://getfirebug.com/wiki/index.php/Console_API">API Console</a> sur le wiki de Firebug.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deeo.fr/optimiser-un-script-javascript-avec-firebug-80.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discussion sur MooTools dans le podcast de jQuery</title>
		<link>http://blog.deeo.fr/discussion-sur-mootools-dans-le-podcast-de-jquery-97.html</link>
		<comments>http://blog.deeo.fr/discussion-sur-mootools-dans-le-podcast-de-jquery-97.html#comments</comments>
		<pubDate>Fri, 26 Feb 2010 19:09:48 +0000</pubDate>
		<dc:creator>Kevin Chapelier</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://blog.deeo.fr/?p=97</guid>
		<description><![CDATA[Le treizième podcast de jQuery, récemment mis en ligne sur le blog du populaire framework javascript, s&#8217;intéresse à MooTools et à la façon dont chacun pourrait/devrait profiter et apprendre du [...]]]></description>
			<content:encoded><![CDATA[<p>Le <a href="http://blog.jquery.com/2010/02/26/the-official-jquery-podcast-episode-13-david-walsh/" target="_blank">treizième podcast</a> de jQuery, récemment mis en ligne sur le blog du populaire framework javascript, s&#8217;intéresse à MooTools et à la façon dont chacun pourrait/devrait profiter et apprendre du travail de l&#8217;autre. Les principaux thèmes abordés sont les suivants : la compatibilité entre les deux frameworks, les raisons d&#8217;apprendre à utiliser plus d&#8217;un framework,  l&#8217;apport des frameworks javascript au développement web et le support d&#8217;Internet Explorer 6. On notera la présence de <a href="http://davidwalsh.name/jquery-podcast" target="_blank">David Walsh</a>, membre de l&#8217;équipe de développement de mootools-core, en quelque sorte l&#8217;une des figures publiques de MooTools, mais qui est également un utilisateur de jQuery.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deeo.fr/discussion-sur-mootools-dans-le-podcast-de-jquery-97.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FOSDEM 2010</title>
		<link>http://blog.deeo.fr/fosdem-2010-50.html</link>
		<comments>http://blog.deeo.fr/fosdem-2010-50.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 19:23:28 +0000</pubDate>
		<dc:creator>Kevin Chapelier</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[FOSDEM]]></category>
		<category><![CDATA[microblogging]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[statusnet]]></category>

		<guid isPermaLink="false">http://blog.deeo.fr/?p=50</guid>
		<description><![CDATA[Rapide tour d'horizon des conférences de l'édition 2010 du FOSDEM, du point de vue d'un développeur web pragmatique.]]></description>
			<content:encoded><![CDATA[<p>L&#8217;édition 2010 du <a href="http://fosdem.org/" target="_blank">FOSDEM</a> (Free And Open Source Developer&#8217;s European Meeting) s&#8217;est tenue ces 6 et 7 févriers à Bruxelles. Nous n&#8217;y étions pas présents, mais heureusement de nos jours il suffit d&#8217;avoir une bonne connexion internet pour profiter de la plupart des évènements. Vous trouverez ci-dessous les vidéos qui m&#8217;ont semblé être les plus intéressantes en ce qui concerne le développement web en général.</p>
<p><strong><a href="http://fosdem.org/2010/schedule/events/820" target="_blank">Inside StatusNet: How Identi.ca Works</a>, par </strong><span><strong>Evan Prodromou :</strong> Une conférence intéressante sur la plus populaire plateforme de microblogging opensource par son lead developper. La première partie (&laquo;&nbsp;The problem&nbsp;&raquo;) fait un peu office de discours politique, mais les deux suivantes (&laquo;&nbsp;The requirements&nbsp;&raquo; et &laquo;&nbsp;The architecture&nbsp;&raquo;) apportent tout ce que l&#8217;on peu attendre de ce genre de conférence, à savoir une explication très claire de la philosophie et de la réalisation technique des aspects les plus importants du système.</span></p>
<p><strong><a href="http://fosdem.org/2010/schedule/events/mootools" target="_blank">MooTools as a General Purpose Application Framework</a>, par </strong><span><strong>Christoph Pojer :</strong> Une présentation rapide du framework javascript MooTools et de ses principaux projets satellites.</span></p>
<p><strong><a href="http://fosdem.org/2010/schedule/events/dojo" target="_blank">Building High Performance Web Applications with the Dojo Toolkit</a>, par </strong><span><strong>Dylan Schiemann :</strong> Une présentation d&#8217;un autre framework javascript, bien plus poussée que la précédente, mais malheureusement trop théorique. Je doute sincèrement que cela donne envie à qui que ce soit d&#8217;utiliser le framework. Néanmoins une conférence bien menée et instructive.<br />
</span></p>
<p><strong><a href="http://www.youtube.com/watch?v=-FBC-Z3K0nI" target="_blank">Blaming the unknown, a constructive approach to technology</a>, par </strong><span><strong>Guiseppe Maxia :</strong> Une très courte présentation rappelant quelques principes de base</span> servie avec humour, quelques phrases chocs (&laquo;&nbsp;Once upon a time I did not make mistakes. Then, I grew up. And found them.&nbsp;&raquo;) et un chaleureux éloge à cette vertu qu&#8217;est la curiosité.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deeo.fr/fosdem-2010-50.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP : http_build_query() et les objets</title>
		<link>http://blog.deeo.fr/php-http_build_query-et-les-objets-31.html</link>
		<comments>http://blog.deeo.fr/php-http_build_query-et-les-objets-31.html#comments</comments>
		<pubDate>Wed, 10 Feb 2010 14:56:36 +0000</pubDate>
		<dc:creator>Kevin Chapelier</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[POO]]></category>

		<guid isPermaLink="false">http://blog.deeo.fr/?p=31</guid>
		<description><![CDATA[Exemples d'utilisation de la fonction PHP http_build_query() avec des objets et d'un problème de scope pouvant engendrer l'exposition de propriétés privées.]]></description>
			<content:encoded><![CDATA[<p>La fonction PHP <a href="http://php.net/manual/en/function.http-build-query.php" target="_blank">http_build_query</a>() sert à générer une chaîne de requête en encodage URL ce qui est notamment utile pour formater les paramètres à envoyer via une méthode post ou get avec curl et pour implémenter une pagination sur des résultats de recherche complexe. La documentation officielle indique qu&#8217;elle peut être utilisée aussi bien avec un array qu&#8217;avec un objet mais n&#8217;indique qu&#8217;un example simpliste de cette dernière possibilité. Hors, il est important de noter que la fonction peut exposer des propriétés en private et protected si imprudemment utilisée, exposant ainsi des données censées ne pas être affichées.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Test
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$private</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	protected <span style="color: #000088;">$protected</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$public</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">const</span> constante <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$object</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">http_build_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$object</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Résultat :</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">public=1</pre></div></div>

<p>Le résultat est bien celui attendu, les propriétés <em>private</em> et <em>protected</em> sont bien exclue puisque hors du scope général. Maintenant, imaginons que pour une raison ou une autre vous désiriez que l&#8217;objet lui même renvoie la chaîne de requête qui lui correspond :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Test
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$private</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	protected <span style="color: #000088;">$protected</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$public</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">const</span> constante <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
	static <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$stat</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #990000;">http_build_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$object</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$object</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Résultat :</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">private=1&amp;protected=1&amp;public=1</pre></div></div>

<p>La fonction http_build_query() exécutée dans le scope de l&#8217;objet a accès à toutes ses propriétés quelque soit leur visibilité. Je ne sais pas s&#8217;il s&#8217;agit là d&#8217;un bug ou du comportement voulu par les développeurs de PHP, mais en pratique ce n&#8217;est vraisemblablement pas ce que l&#8217;on aurait désiré obtenir. Faisons un dernier test avec une classe parent et un classe enfant :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> TestParent
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$parentPrivate</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	protected <span style="color: #000088;">$parentProtected</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$parentPublic</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Test <span style="color: #000000; font-weight: bold;">extends</span> TestParent
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$private</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	protected <span style="color: #000088;">$protected</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$public</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">const</span> constante <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
	static <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$stat</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #990000;">http_build_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> TestChild <span style="color: #000000; font-weight: bold;">extends</span> Test
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$childPrivate</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	protected <span style="color: #000088;">$childProtected</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$childPublic</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$object</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TestChild<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$object</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Résultat :</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">childProtected=1&amp;childPublic=1&amp;private=1&amp;protected=1&amp;public=1&amp;parentProtected=1&amp;parentPublic=1</pre></div></div>

<p>Les propriétés <em>public</em> et <em>protected</em> définies dans les classes parents et enfants sont reprises, ainsi que toutes les propriétés définies dans la classe déclarant la méthode faisant appel à http_build_query. Rien d&#8217;étonnant là dedans au vu des résultats précédents, mais ce comportement peut être dangereux si l&#8217;on n&#8217;en a pas conscience.</p>
<p>Conclusion : Gardez à l&#8217;esprit que http_build_query utilise le scope courant et, par mesure de précaution, éviter de l&#8217;utiliser avec directement avec des objets. De mon point de vue, implémenter une méthode qui permette à l&#8217;objet de retourner un array contenant les propriétés devant être présentes dans la requête est sans doute la meilleure solution vu que cela permettra de réellement profiter des possibilités offerte par la POO.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deeo.fr/php-http_build_query-et-les-objets-31.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MooTools plugin : microB</title>
		<link>http://blog.deeo.fr/mootools-plugin-microb-25.html</link>
		<comments>http://blog.deeo.fr/mootools-plugin-microb-25.html#comments</comments>
		<pubDate>Fri, 05 Feb 2010 20:17:03 +0000</pubDate>
		<dc:creator>Kevin Chapelier</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[identi.ca]]></category>
		<category><![CDATA[microblogging]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[statusnet]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.deeo.fr/?p=25</guid>
		<description><![CDATA[microB est un plugin de MooTools permettant d'intégrer aisément du contenu provenant de plateformes de microblogging telles que Twitter et Identi.ca...]]></description>
			<content:encoded><![CDATA[<p>microB est une classe basée sur le framework javascript MooTools permettant d&#8217;intégrer aisément du contenu provenant de plateformes de microblogging telles que Twitter et Identi.ca sur une page web, sans avoir à souffrir des défauts des solutions habituelles :</p>
<ul>
<li>Pas d&#8217;appel bloquant à du json en plein milieu du chargement de la page</li>
<li>Pas de complexité à gérer au niveau du serveur (ni appel curl, ni gestion de cache)</li>
<li>Liberté totale quant au style à appliquer au widget</li>
<li>Liberté totale quant au informations affichées et mises en lien</li>
<li>Indépendance par rapport à la plateforme de microblogging</li>
<li>Personnalisation aisée des liens permettant d&#8217;utiliser des services tiers</li>
<li>Protection contre les injections HTML / cross-scripting</li>
</ul>
<p>Par défaut, la plugin peut être utilisé avec Twitter et tout service basé sur la plateforme <a href="http://status.net/" target="_blank">StatusNet</a> (anciennement Laconica) comme par exemple Identi.ca et Emote.in, mais l&#8217;ajout de nouveaux services peut aisément être effectué. Nous aurions apprécié pouvoir ajouter Jaiku à la liste des services supportés, mais celui-ci souffre actuellement d&#8217;un bug (<a href="http://code.google.com/p/jaikuengine/issues/detail?id=30" target="_blank">issue 30</a>) empêchant toute utilisation via javascript. Une correction a bien été effectuée au niveau du JaikuEngine mais ne semble pas avoir été appliquée sur le site. Il va sans dire que nous ajouterons la possibilité d&#8217;utiliser ce service à microB dès que cela sera possible. Les services Qaiku et Emote.in devraient eux être ajoutée dans la prochaine version du plugin.</p>
<p>L&#8217;utilisation de la classe prend tout son sens lorsque vous désirez utiliser des services tiers pour les tags et utilisateurs. microB a en effet été conçu de façon à rendre ce genre de modification réalisable en une seule ligne de code. Dans l&#8217;exemple suivant, nous utilisons Twubs.com et Tweeps.info pour lier les tags et utilisateurs :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">microB.<span style="color: #660066;">services</span>.<span style="color: #660066;">twitter</span>.<span style="color: #660066;">hashUrl</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://twubs.com/{hash}'</span><span style="color: #339933;">;</span>
microB.<span style="color: #660066;">services</span>.<span style="color: #660066;">twitter</span>.<span style="color: #660066;">userUrl</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://tweeps.info/profile/{user}'</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Liens</strong></p>
<ul>
<li><a href="http://mootools.net/forge/p/microb" target="_blank">Téléchargement sur mootools/forge</a></li>
<li><a href="http://github.com/DEEO/microB/blob/master/Docs/microB.md" target="_blank">Documentation sur github</a></li>
<li><a href="http://www.deeo.fr/demo/mootools/microb/" target="_blank">Démo basique</a></li>
</ul>
<p><strong>Todo</strong></p>
<ul>
<li>Ajouter le support des listes sur Twitter</li>
<li>Ajouter le support des groupes sur identi.ca</li>
<li>Ajouter le support de Qaiku et Emote.in</li>
</ul>
<p><strong>Known issues</strong></p>
<ul>
<li>Un problème mineur d&#8217;affichage de certains caractères spéciaux lié à l&#8217;encodage inconsistant du Json du côté de Twitter (voir cette <a href="http://github.com/darkwing/Tweetify/issues/#issue/3" target="_blank">issue</a>).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.deeo.fr/mootools-plugin-microb-25.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bienvenue sur le blog de l&#8217;agence</title>
		<link>http://blog.deeo.fr/bonjour-tout-le-monde-3-11.html</link>
		<comments>http://blog.deeo.fr/bonjour-tout-le-monde-3-11.html#comments</comments>
		<pubDate>Sun, 10 Jan 2010 15:18:55 +0000</pubDate>
		<dc:creator>Gael</dc:creator>
				<category><![CDATA[Vie de l'agence]]></category>

		<guid isPermaLink="false">http://blog.deeo.fr/?p=11</guid>
		<description><![CDATA[Bonjour et bienvenue sur notre blog. Spécialisée dans la réalisation de sites internet et d&#8217;applications web, l&#8217;agence est composée de deux passionnés des NTIC. Via cet espace, nous essaierons de [...]]]></description>
			<content:encoded><![CDATA[<p>Bonjour et bienvenue sur notre blog. Spécialisée dans la réalisation de sites internet et d&#8217;applications web, l&#8217;agence est composée de deux passionnés des NTIC. Via cet espace, nous essaierons de faire partager un peu de la vie de l&#8217;agence, nos astuces, nos découvertes, nos opinions&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deeo.fr/bonjour-tout-le-monde-3-11.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

