<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Journal !</title>
	
	<link>http://journal.lerouxdelens.com</link>
	<description>bloc note d'Amaury Leroux de Lens : web / php / css / design / real-life</description>
	<lastBuildDate>Thu, 18 Feb 2010 08:44:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</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/lerouxdelens/yFfQ" /><feedburner:info uri="lerouxdelens/yffq" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Fabien Potencier presents : Symfony 2</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/gxFiDp95ufg/</link>
		<comments>http://journal.lerouxdelens.com/2010/02/fabien-potencier-presents-symfony-2/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 08:44:03 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/?p=226</guid>
		<description><![CDATA[here are the slides. Enjoy !
Symfony 2.0 revealed
View more presentations from Fabien Potencier.

]]></description>
			<content:encoded><![CDATA[<p>here are the slides. Enjoy !</p>
<div style="width:425px;text-align:left" id="__ss_3211867"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/fabpot/symfony-20-revealed" title="Symfony 2.0 revealed">Symfony 2.0 revealed</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=symfony2-100217175329-phpapp01&#038;stripped_title=symfony-20-revealed" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=symfony2-100217175329-phpapp01&#038;stripped_title=symfony-20-revealed" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/fabpot">Fabien Potencier</a>.</div>
</div>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/gxFiDp95ufg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2010/02/fabien-potencier-presents-symfony-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2010/02/fabien-potencier-presents-symfony-2/</feedburner:origLink></item>
		<item>
		<title>svn remove –keep-local</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/stof5dAXm74/</link>
		<comments>http://journal.lerouxdelens.com/2010/02/svn-remove-keep-local/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 09:30:02 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[Mémos / Liens]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/?p=223</guid>
		<description><![CDATA[tout est dans le titre !
pour ne plus versionner des fichiers sur voter projets sans pour autant les supprimer du disque local utilisez la commande magique
svn remove --keep-local ./the/file/i/should/not/commit.ext
]]></description>
			<content:encoded><![CDATA[<p>tout est dans le titre !<br />
pour ne plus versionner des fichiers sur voter projets sans pour autant les supprimer du disque local utilisez la commande magique<br />
<code>svn remove --keep-local ./the/file/i/should/not/commit.ext</code></p>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/stof5dAXm74" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2010/02/svn-remove-keep-local/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2010/02/svn-remove-keep-local/</feedburner:origLink></item>
		<item>
		<title>iPad : la fin de l’age d’or d’Apple ?</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/dNcoSvZRcmU/</link>
		<comments>http://journal.lerouxdelens.com/2010/01/ipad-la-fin-de-lage-dor-dapple/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 09:28:00 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[innovation]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/?p=220</guid>
		<description><![CDATA[Grand messe Apple
La grand messe d&#8217;Apple étant finie, l&#8217;émotion de voir Steve Job parler étant passée, nous pouvons désormais nous pencher à froid sur la bête qui nous a été présenté.Beaucoup de blogs vont relayer les infos concernant les capacités de la machine et je vous laisse le soin d&#8217;aller consulter le wMag du klub [...]]]></description>
			<content:encoded><![CDATA[<h3>Grand messe Apple</h3>
<p>La grand messe d&#8217;Apple étant finie, l&#8217;émotion de voir Steve Job parler étant passée, nous pouvons désormais nous pencher à froid sur la bête qui nous a été présenté.<br />Beaucoup de blogs vont relayer les infos concernant les capacités de la machine et je vous laisse le soin d&#8217;aller consulter le wMag du klub iPad pour vous renseigner à ce sujet. </p>
<p>Parlons plutôt de ce qui a manqué cruellement lors de cette keynote. Ou plutôt de ce qu&#8217;on nous présente comme un objet révolutionnaire et qui n&#8217;est qu&#8217;un mashup de deux produit en cummulant plus les inconvénients que les avantages.</p>
<h3>L&#8217;iPad c&#8217;est quoi ?</h3>
<p><img src="http://www.lexpress.fr/reuters/une/2010-01-27T222416Z_01_APAE60Q1JNA00_RTROPTP_3_OFRTP-APPLE-TABLETTE-20100127.JPG"></p>
<p>Concrêtement l&#8217;iPad c&#8217;est quoi ? </p>
<ul>
<li>un ordinateur design à base d&#8217;iPhone</li>
<li>des &#8220;innovations&#8221; qui sont en fait celles de l&#8217;iPhone et des macBook</li>
<li>une interface &#8220;révolutionnaire&#8221; qui n&#8217;est rien d&#8217;autre que celle de l&#8217;iphone avec une diagonale de 9.7&#8243; (plus grand, plus de détails)</li>
</ul>
<h3>Un arrière goût de déception</h3>
<p>mais alors pourquoi parler de produit innovant, d&#8217;outils du futur ?<br />si je ne m&#8217;abuse : </p>
<ul>
<li>le futur du divertissement va vers la haut définition, la personalisation de l&#8217;expérience utilisateur, la réalité augmentée</li>
<li>le futur des outils de travail s&#8217;oriente vers l&#8217;interconnection des machines, la simplification des environnement de travail l&#8217;optimisation de taches parallèles et la mise à disposition de système ouvert permettant à tous d&#8217;utiliser les logiciels dont il a besoin.</li>
</ul>
<p>Et bien rien de tout ça dans l&#8217;iPad! Pour moi il s&#8217;agit d&#8217;un joujou high-tech qui peut s&#8217;avérer pratique pour pas mal d&#8217;utilisations mais qui ne redore pas le blason d&#8217;Apple en terme d&#8217;innovation et de révolution des moeurs. Rien de brillant chez les mac depuis longtemps, et à part l&#8217;épisode iPhone rien de vraiment nouveau parmis tout les produits Apple. Apple ne créé plus du rêve, il vends des produit à la mode &#8230;<br />Ha si ! j&#8217;oubliais de mentionner les efforts considérable d&#8217;Apple pour améliorer la sensibilité des capteurs d&#8217;immersion !</p>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/dNcoSvZRcmU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2010/01/ipad-la-fin-de-lage-dor-dapple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2010/01/ipad-la-fin-de-lage-dor-dapple/</feedburner:origLink></item>
		<item>
		<title>Disctinct IP details in apache access.log</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/butezFZIo0U/</link>
		<comments>http://journal.lerouxdelens.com/2010/01/disctinct-ip-details-in-apache-access-log/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 16:19:24 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[Mémos / Liens]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/?p=218</guid>
		<description><![CDATA[awk 'NR&#60;=10000{a[$1]++; }END{for (i in a) printf "%-6d  %s\n",a[i], i &#124;"sort -n"}' access.log
]]></description>
			<content:encoded><![CDATA[<p><code>awk 'NR&lt;=10000{a[$1]++; }END{for (i in a) printf "%-6d  %s\n",a[i], i |"sort -n"}' access.log</code></p>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/butezFZIo0U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2010/01/disctinct-ip-details-in-apache-access-log/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2010/01/disctinct-ip-details-in-apache-access-log/</feedburner:origLink></item>
		<item>
		<title>Got a Canon EOS 40D !</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/DZyDMj3kQbk/</link>
		<comments>http://journal.lerouxdelens.com/2009/11/got-a-canon-eos-40d/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 06:54:42 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[Général]]></category>
		<category><![CDATA[40D]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[E0S]]></category>
		<category><![CDATA[High tech]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/2009/11/got-a-canon-eos-40d/</guid>
		<description><![CDATA[Le dernier nés de ma collection de joujou high-tech :

(merci à ma femme qui a bien voulu :D et @leboncoin.fr où les occasions sont super !)
Pour les résultats, voir le widget flickr qui a fait son apparition sur ce blog.
Test et présentation de la bête prochainement.
]]></description>
			<content:encoded><![CDATA[<p>Le dernier nés de ma collection de joujou high-tech :<br />
<a href="http://www.canon.fr/For_Home/Product_Finder/Cameras/Digital_SLR/EOS_40D/index.asp"><img class="aligncenter size-full wp-image-215" title="canon EOS 40D" src="http://journal.lerouxdelens.com/wp-content/uploads/2009/11/capture-de28099ecran-2009-11-27-a-075136.png" alt="canon EOS 40D" width="216" height="196" /></a></p>
<p>(merci à ma femme qui a bien voulu :D et @leboncoin.fr où les occasions sont super !)<br />
Pour les résultats, voir le widget flickr qui a fait son apparition sur ce blog.<br />
Test et présentation de la bête prochainement.</p>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/DZyDMj3kQbk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2009/11/got-a-canon-eos-40d/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2009/11/got-a-canon-eos-40d/</feedburner:origLink></item>
		<item>
		<title>Tweeting from PHP</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/F1J1MNyiJ0c/</link>
		<comments>http://journal.lerouxdelens.com/2009/09/tweeting-from-php/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 11:39:13 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[devloppement]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/?p=211</guid>
		<description><![CDATA[Thanks to fabien Potencier for this hint : 
Twitter is everywhere nowadays. Odds are eventually you will want to tweet from PHP. No need to use one of the numerous PHP Twitter libraries, as tweeting is as simple as using the PHP built-in file_get_contents() function:
function tweet($message, $username, $password)
{
  $context = stream_context_create(array(
    [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://fabien.potencier.org/">fabien Potencier</a> for this hint : </p>
<blockquote><p>Twitter is everywhere nowadays. Odds are eventually you will want to tweet from PHP. No need to use one of the numerous PHP Twitter libraries, as tweeting is as simple as using the PHP built-in file_get_contents() function:<br />
<code>function tweet($message, $username, $password)<br />
{<br />
  $context = stream_context_create(array(<br />
    'http' => array(<br />
      'method'  => 'POST',<br />
      'header'  => sprintf("Authorization: Basic %s\r\n", base64_encode($username.':'.$password)).<br />
                   "Content-type: application/x-www-form-urlencoded\r\n",<br />
      'content' => http_build_query(array('status' => $message)),<br />
      'timeout' => 5,<br />
    ),<br />
  ));<br />
  $ret = file_get_contents('http://twitter.com/statuses/update.xml', false, $context);</p>
<p>  return false !== $ret;<br />
}</code></p>
<p>Pretty easy, no? Using the tweet() function is of course a piece of cake:<br />
tweet(&#8216;From PHP, yeah&#8230;&#8217;, &#8216;fabpot&#8217;, &#8216;Pa$$&#8217;)</p></blockquote>
<p>;</p>
<p>source : <a href="http://fabien.potencier.org/article/20/tweeting-from-php">http://fabien.potencier.org/article/20/tweeting-from-php</a></p>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/F1J1MNyiJ0c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2009/09/tweeting-from-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2009/09/tweeting-from-php/</feedburner:origLink></item>
		<item>
		<title>Réinstallation complète de macosx, comment bien configurer son environnement</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/mkPdGKKb0SQ/</link>
		<comments>http://journal.lerouxdelens.com/2009/09/reinstallation-complete-de-macosx-comment-bien-configurer-son-environnement/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 21:33:49 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[Mémos / Liens]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[bonne pratiques]]></category>
		<category><![CDATA[gist]]></category>
		<category><![CDATA[Macosx]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/?p=206</guid>
		<description><![CDATA[Suite à un crash de disque dur (paix à son âme) je profite de cette install tout fraîche de macosx 10.6 pour bien configurer mon environnement.
Pour mémo:

Autoriser l&#8217;accès SSH sur la machine (pref système > partage > session à distance)
créer un fichier /.profile
créer un dossier ~/bin
dans ~.profile, personnaliser le PATH comme suit :export PATH=~/bin:$PATH
mettre dans [...]]]></description>
			<content:encoded><![CDATA[<p>Suite à un crash de disque dur (paix à son âme) je profite de cette install tout fraîche de macosx 10.6 pour bien configurer mon environnement.</p>
<p>Pour mémo:</p>
<ul>
<li>Autoriser l&#8217;accès SSH sur la machine (pref système > partage > session à distance)</li>
<li>créer un fichier /.profile</li>
<li>créer un dossier ~/bin</li>
<li>dans ~.profile, personnaliser le PATH comme suit :<code>export PATH=~/bin:$PATH</code></li>
<li>mettre dans ~/bin les liens symbolique et script utiles
<ol>
<li>contrôle d&#8217;itunes (<a href="http://gist.github.com/184838">http://gist.github.com/184838</a>)</li>
<li>contrôle du volume (<a href="http://gist.github.com/184840">http://gist.github.com/184840</a>)</li>
<li><code>cd ~/bin &#038;&#038; ln -s /Applications/MAMP/bin/php5/php php</code></li>
<li><code>ln -s /Applications/MAMP/Library/bin/mysqladmin mysqladmin<br />
ln -s /Applications/MAMP/Library/bin/mysql mysql<br />
ln -s /Applications/MAMP/Library/bin/mysqldump mysqldump</code></li>
<li>etc &#8230;</li>
</ol>
</li>
<li>virer les applications hadoc de /usr/bin (php au hasard)</li>
</ul>
<p>Bon évidemment l&#8217;idéal aurait été de faire un Rsync du dernier backup sur la lunxbox mais bon c&#8217;ets moins marrant ;-)</p>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/mkPdGKKb0SQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2009/09/reinstallation-complete-de-macosx-comment-bien-configurer-son-environnement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2009/09/reinstallation-complete-de-macosx-comment-bien-configurer-son-environnement/</feedburner:origLink></item>
		<item>
		<title>Safari ne trouve pas Adobe PDF Viewer</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/MAO0S77QlU8/</link>
		<comments>http://journal.lerouxdelens.com/2009/07/safari-ne-trouve-pas-adobe-pdf-viewer/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 11:06:06 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[Général]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Macosx]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/?p=200</guid>
		<description><![CDATA[Depuis quelques temps, impossible d&#8217;ouvrir un PDF dans safari sans devoir manuellement sélectionner l&#8217;emplacement de Adobe PDF Viewer. À l&#8217;origine, Safari ouvre les PDF avec aperçu, plutôt pratique quand on connait la différence énorme de performance de Aperçu et Adobe PDF viewer, en faveur d&#8217;Aperçu.
La solution est simple :
ouvrez un terminal et naviguez jusqu&#8217;à &#8220;Macintosh [...]]]></description>
			<content:encoded><![CDATA[<p>Depuis quelques temps, impossible d&#8217;ouvrir un PDF dans safari sans devoir manuellement sélectionner l&#8217;emplacement de Adobe PDF Viewer. À l&#8217;origine, Safari ouvre les PDF avec aperçu, plutôt pratique quand on connait la différence énorme de performance de Aperçu et Adobe PDF viewer, en faveur d&#8217;Aperçu.</p>
<p>La solution est simple :<br />
ouvrez un terminal et naviguez jusqu&#8217;à &#8220;Macintosh HD -> Library -> Internet Plug-Ins&#8221;<br />
<code>cd /Library/Internet\ Plug-Ins/</code><br />
puis<br />
<code>rm -Rf AdobePDFViewer.plugin/</code><br />
un petit redémarrage de Safari et le tour est joué.<br />
<div id="attachment_203" class="wp-caption aligncenter" style="width: 310px"><img src="http://journal.lerouxdelens.com/wp-content/uploads/2009/07/image-1-300x166.png" alt="Display PDF in Safari with aperçu" title="image-1" width="300" height="166" class="size-medium wp-image-203" /><p class="wp-caption-text">Display PDF in Safari with aperçu</p></div><br />
src : <a href="http://forums.macgeneration.com/internet-et-reseau/probleme-safari-4-et-ouverture-de-pdf-266534.html">macgeneration</a></p>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/MAO0S77QlU8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2009/07/safari-ne-trouve-pas-adobe-pdf-viewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2009/07/safari-ne-trouve-pas-adobe-pdf-viewer/</feedburner:origLink></item>
		<item>
		<title>Evaluate the similarity between objects through a “many to many” SQL relation</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/zDgc6h2M6Ow/</link>
		<comments>http://journal.lerouxdelens.com/2009/07/evaluate-the-similarity-between-objects-through-a-many-to-many-sql-relation/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 21:16:31 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[devloppement]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/?p=191</guid>
		<description><![CDATA[In many database-based projects you have to show your visitors that this &#8220;thing&#8221; is similar to this other one. For example, this blog post is similar to this other one. That&#8217;s a crucial functionnality and at first sight it&#8217;s looks easy to create.
The landscape
let&#8217;s start with this basic example :
In a blog, a &#8220;blog_post&#8221; has [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://journal.lerouxdelens.com/wp-content/uploads/2009/07/link-exchange.jpg" alt="Relations" title="link-exchange" width="106" height="106" class="size-full wp-image-193 postCaption"  style="float:left; margin:0 2em 2em 0;"/>In many database-based projects you have to show your visitors that this &#8220;thing&#8221; is similar to this other one. For example, this blog post is similar to this other one. That&#8217;s a crucial functionnality and at first sight it&#8217;s looks easy to create.</p>
<h3>The landscape</h3>
<p>let&#8217;s start with this basic example :<br />
In a blog, a &#8220;blog_post&#8221; has many &#8220;tag&#8221;. These relations are stored in a &#8220;blog_post_tag&#8221; table. When a blog post is displayed, we want to show the list of similar post to the current blog_post. Our &#8220;blog_post_tag&#8221; table just store &#8220;blog_post_id&#8221; and &#8220;tag_id“.</p>
<h3>The first train of thought</h3>
<p>I wanted to get all blog post that have the same associated tag. But, in this database-relation context &#8220;the same&#8221; may only mean only one of them. Quite annoying. So i finally get something that worked, and that was based on this kind of algorythm:<br />
<code><br />
blogPostTags = $myBlogPost->getTags<br />
postList = array()<br />
foreach(blogPostTags as currentTag)<br />
  tempPostList = getAllBlogPostByTag(currentTag)<br />
  postList = array_merge(postList, array_diff(tempPostList,postList)<br />
endforeach<br />
</code></p>
<p>Quite awfull isn&#8217;t it ? after two hours spent on something else and got back to home and discussed with friends (and whatever you want. Who said IT guy do not have a social life ?!) i just looked back at this problem and finally wrote this :</p>
<h3>The proper way</h3>
<p><code><br />
SELECT COUNT(tag_id) as similarity, blog_post_id FROM blog_post_tag<br />
WHERE tag_id IN (<br />
SELECT tag_id FROM blog_post_tag WHERE blog_post_id = ?<br />
)<br />
GROUP BY blog_post_id<br />
</code></p>
<p>And that&#8217;s all. This SQL code gives you how many common tag you have between all the post that have at least on tag in common with a specific blog_post (replace &#8216;?&#8217; by the correct value). Now just have to write it whith the Doctrine syntax ;-)</p>
<h3>Conclusion</h3>
<p>Just remember : when it sucks, just take a break !</p>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/zDgc6h2M6Ow" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2009/07/evaluate-the-similarity-between-objects-through-a-many-to-many-sql-relation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2009/07/evaluate-the-similarity-between-objects-through-a-many-to-many-sql-relation/</feedburner:origLink></item>
		<item>
		<title>Symfony : SQLSTATE[HY000]: General error: 1005 Can’t create table</title>
		<link>http://feedproxy.google.com/~r/lerouxdelens/yFfQ/~3/aNL3qqqg-1Y/</link>
		<comments>http://journal.lerouxdelens.com/2009/07/symfony-sqlstatehy000-general-error-1005-cant-create-table/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 22:04:39 +0000</pubDate>
		<dc:creator>Amaury</dc:creator>
				<category><![CDATA[Mémos / Liens]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[devloppement]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://journal.lerouxdelens.com/?p=188</guid>
		<description><![CDATA[SQLSTATE[HY000]: General error: 1005 Can't create table
in a
symfony doctrine-build-all-load
command line means you have different integer size in your primary keys references
especially, sfDoctrineGuardPlugin use a integer(4) as primary key definition so, if you want to link your own &#8216;user&#8217; class to sfGaurdUser class, you&#8217;ll have to define sf_uard_user_id as integer(4).
thanks to clear-cache.fr !
]]></description>
			<content:encoded><![CDATA[<p><code>SQLSTATE[HY000]: General error: 1005 Can't create table</code><br />
in a<br />
<code>symfony doctrine-build-all-load</code><br />
command line means you have different integer size in your primary keys references</p>
<p>especially, sfDoctrineGuardPlugin use a integer(4) as primary key definition so, if you want to link your own &#8216;user&#8217; class to sfGaurdUser class, you&#8217;ll have to define sf_uard_user_id as integer(4).</p>
<p>thanks to <a href="http://clear-cache.fr/?post/2009/05/15/SQLSTATE%5BHY000%5D%3A-General-error%3A-1005">clear-cache.fr</a> !</p>
<img src="http://feeds.feedburner.com/~r/lerouxdelens/yFfQ/~4/aNL3qqqg-1Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://journal.lerouxdelens.com/2009/07/symfony-sqlstatehy000-general-error-1005-cant-create-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://journal.lerouxdelens.com/2009/07/symfony-sqlstatehy000-general-error-1005-cant-create-table/</feedburner:origLink></item>
	</channel>
</rss>
