<?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>Benoît Vidis</title>
	<atom:link href="http://www.benoitvidis.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benoitvidis.com</link>
	<description>Another web developer</description>
	<lastBuildDate>Mon, 13 Feb 2012 19:24:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>My x264 settings</title>
		<link>http://www.benoitvidis.com/2012/02/my-x264-settings/</link>
		<comments>http://www.benoitvidis.com/2012/02/my-x264-settings/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 16:40:51 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=344</guid>
		<description><![CDATA[For the time being, here are the x264 settings I am using to rip my DVDs and gives me the best output: ref=2:me=umh:b-adapt=2:weightb=0:vbv-maxrate=9500:vbv-bufsize=9500:subme=9:trellis=2:psy-rd=1&#124;0.1 I use a CRF20. [Edit]: A very helpful source about x/h264 options: https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping]]></description>
			<content:encoded><![CDATA[<p>For the time being, here are the x264 settings I am using to rip my DVDs and gives me the best output:</p>
<pre>
ref=2:me=umh:b-adapt=2:weightb=0:vbv-maxrate=9500:vbv-bufsize=9500:subme=9:trellis=2:psy-rd=1|0.1
</pre>
<p>I use a CRF20.</p>
<div id="attachment_346" class="wp-caption alignnone" style="width: 310px"><a href="http://www.benoitvidis.com/wordpress/wp-content/uploads/2012/02/2012-02-12-1329064340_1920x1080_scrot.png"><img src="http://www.benoitvidis.com/wordpress/wp-content/uploads/2012/02/2012-02-12-1329064340_1920x1080_scrot-300x168.png" alt="" title="handbrake x264 settings for DVD rip" width="300" height="168" class="size-medium wp-image-346" /></a><p class="wp-caption-text">handbrake x264 settings for DVD rip</p></div>
<p>[Edit]: A very helpful source about x/h264 options: <a href="https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping">https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2012/02/my-x264-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inject JQuery &#8211; bookmarklet</title>
		<link>http://www.benoitvidis.com/2012/02/inject-jquery-bookmarklet/</link>
		<comments>http://www.benoitvidis.com/2012/02/inject-jquery-bookmarklet/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 10:29:49 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=337</guid>
		<description><![CDATA[If you want to inject jquery in a page from your browser, you can use the following bookmarlet. Just drag &#38; drop the following link to you bookmark address: Inject jQuery. NB: jQuery is then inserted without using the compatibility mode (typing &#8220;jQuery&#8221; instead of &#8220;$&#8221; is too much a hassle for me). Once jQuery ]]></description>
			<content:encoded><![CDATA[<p>If you want to inject jquery in a page from your browser, you can use the following bookmarlet.</p>
<p>Just drag &amp; drop the following link to you bookmark address: <a href="javascript: (function(){var e = document.createElement('script');e.type = 'text/javascript';e.async = true;e.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(e, s);})();">Inject jQuery</a>.</p>
<p>NB: jQuery is then inserted <strong>without using the compatibility mode</strong> (typing &#8220;jQuery&#8221; instead of &#8220;$&#8221; is too much a hassle for me).</p>
<p>Once jQuery is loaded, you can then play around in the console. You can do a lot things. For instance on <a href="http://news.google.com">google news</a>, </p>
<pre language="javascript">
$('.esc-layout-article-cell h2 a span').each(function(){ console.log($(this).text()); });
</pre>
<p> will scrape the news titles on the page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2012/02/inject-jquery-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install a Canon LBP7200Cdn printer on Ubuntu 11.10 64bits</title>
		<link>http://www.benoitvidis.com/2011/11/install-a-canon-lbp7200cdn-printer-on-ubuntu-11-10-64bits/</link>
		<comments>http://www.benoitvidis.com/2011/11/install-a-canon-lbp7200cdn-printer-on-ubuntu-11-10-64bits/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 12:38:45 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=330</guid>
		<description><![CDATA[The main documentation about installing Canon CAPT based driver can be found here I followed the instructions given on the page above but it just did not work. The issue there is that the 64bits version of the 2.3 CAPT drivers do not work on Ubuntu 11.10. After struggling several hours trying to build the ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.benoitvidis.com/wordpress/wp-content/uploads/2011/11/0001.gif"><img src="http://www.benoitvidis.com/wordpress/wp-content/uploads/2011/11/0001-300x300.gif" alt="" title="0001" width="300" height="300" class="alignnone size-medium wp-image-332" /></a><br />
The main documentation about installing Canon CAPT based driver can be found <a href="https://help.ubuntu.com/community/CanonCaptDrv190">here</a></p>
<p>I followed the instructions given on the page above but it just did not work. The issue there is that the 64bits version of the 2.3 CAPT drivers do not work on Ubuntu 11.10.</p>
<p>After struggling several hours trying to build the proper symlinks for the driver and figuring out why AppArmor was blocking cups, I ended up with a much simpler solution.<br />
The solution for me was to use the 2.2 version of Michael Grutz&#8217;s repository.</p>
<pre language="bash">
sudo add-apt-repository ppa:michael-gruz/canon
</pre>
<p>The repository does not include an oneiric version. You will need to update your  /etc/apt/sources.list.d/michael-gruz-canon.list file and replace <strong>oneiric</strong> with <strong>natty</strong>.</p>
<p>Then :<br />
1- Install the driver</p>
<pre language="bash">
$ sudo apt-get update
$ sudo apt-get install cndrvcups-common cndrvcups-capt
</pre>
<p>2 &#8211; Restart Cups</p>
<pre language="bash">
$ sudo service cups restart
</pre>
<p>3 &#8211; Add your printer to Cups</p>
<pre language="bash">
$ sudo /usr/sbin/lpadmin -p PRINTERNAME -m CNCUPSLBP7200CCAPTK.ppd -v ccpd://localhost:59787 -E
</pre>
<p>The ppd given here is for the LBP7200Cdn. If you have another printer, select the appropriate driver for it (refer to the Ubuntu page above or have a look at your /usr/share/cups/model folder).</p>
<p>4 &#8211; Link your cups printer to the canon ccp daemon</p>
<pre language="bash">
$ sudo ccpdadmin -p PRINTERNAME -o net:THE_PRINTER_IP
</pre>
<p>This command is for a network printer. If you are installing an USB printer, replace the net:IP part by your usb device : /dev/lp0</p>
<p>5 &#8211; Start the canon printing daemon</p>
<pre language="bash">
$ sudo /etc/init.d/ccpd start
</pre>
<p>Check that the daemon is properly started:</p>
<pre language="bash">
$ sudo /etc/init.d/ccpd status
</pre>
<p>You should get something like</p>
<pre language="bash">
/usr/sbin/ccpd: 15263 15258
</pre>
<p>With two process ids running. </p>
<p>You should now be able to print. If everything went fine, you can now add the canon daemon to your startup.</p>
<pre language="bash">
$ sudo update-rc.d ccpd defaults 90
</pre>
<p>PS : My ubuntu systems are now able to print but I still cannot make it work on my beloved <a href="http://crunchbanglinux.org/">CrunchBang</a> distro.<br />
If anyone made it work on Debian, I am looking for the installation process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2011/11/install-a-canon-lbp7200cdn-printer-on-ubuntu-11-10-64bits/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Hotot on CrunchBang stater</title>
		<link>http://www.benoitvidis.com/2011/10/hotot-on-crunchbang-stater/</link>
		<comments>http://www.benoitvidis.com/2011/10/hotot-on-crunchbang-stater/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 20:01:44 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=322</guid>
		<description><![CDATA[Just using the Ubuntu repository works fine for me Add deb http://ppa.launchpad.net/hotot-team/ppa/ubuntu maverick main to your /etc/apt/sources.list Then $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A29228DD41011AE2 $ sudo apt-get update $ sudo apt-get install hotot]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.benoitvidis.com/wordpress/wp-content/uploads/2011/10/Twitter-Whale.jpg"><img src="http://www.benoitvidis.com/wordpress/wp-content/uploads/2011/10/Twitter-Whale-300x225.jpg" alt="" title="Twitter Whale" width="300" height="225" class="alignnone size-medium wp-image-326" /></a><br />
Just using the Ubuntu repository works fine for me</p>
<p>Add</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">deb http:<span style="color: #000000; font-weight: bold;">//</span>ppa.launchpad.net<span style="color: #000000; font-weight: bold;">/</span>hotot-team<span style="color: #000000; font-weight: bold;">/</span>ppa<span style="color: #000000; font-weight: bold;">/</span>ubuntu maverick main</pre></div></div>

<p>to your /etc/apt/sources.list</p>
<p>Then</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-key</span> adv <span style="color: #660033;">--keyserver</span> keyserver.ubuntu.com <span style="color: #660033;">--recv-keys</span> A29228DD41011AE2
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> hotot</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2011/10/hotot-on-crunchbang-stater/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keep your 2 barrels of Mootools, I am keeping my barrel of jQuery</title>
		<link>http://www.benoitvidis.com/2011/03/keep-your-mootools-barrel-i-keep-my-barrel-of-jquery/</link>
		<comments>http://www.benoitvidis.com/2011/03/keep-your-mootools-barrel-i-keep-my-barrel-of-jquery/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 17:05:04 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=282</guid>
		<description><![CDATA[As I was latetly assigned to a new project at my new job, the question of the choice of the javascript framework to use raised. My fellow co-workers were used to Mootools and our talented HTML integrator had already used some Mootools code in here work. So Mootools would it be. jQuery was the only ]]></description>
			<content:encoded><![CDATA[<p><a title="x.tra de tizef, sur Flickr" href="http://www.flickr.com/photos/tizef/2659786953/"><img src="http://farm4.static.flickr.com/3268/2659786953_9ffd2a274c.jpg" alt="x.tra" width="375" height="500" /></a></p>
<p id="internal-source-marker_0.04321548398007968">As  I was latetly assigned to a new project at my new job, the question of  the choice of the javascript framework to use raised. My fellow  co-workers were used to Mootools and our talented HTML integrator had  already used some Mootools code in here work.</p>
<p>So Mootools would it be.</p>
<p>jQuery  was the only javascript I had really worked with and I took this as a  great opportunity to learn something new. So I went for it quite  enthusiastically.</p>
<p>After  a few weeks have passed by, I start to get my own opinion on the  relative lacks and strengths of both frameworks. Note that I am still a  new user of Mootols and my opinion will probably evolve.</p>
<p>As I am a little lazy, this post will be organised as a comment of the one from <a href="http://www.clientcide.com/">Aaron Newton of Clientcide</a>, which he posted on <a href="http://jqueryvsmootools.com/">http://jqueryvsmootools.com/</a></p>
<p>As you might have already gotten it from the title, my opinion is not exactly always matching his’.</p>
<h3>2 good frameworks</h3>
<p>jQuery and Mootools are 2 good frameworks. When playing the “who is using what” game, jQuery presents a <a href="http://docs.jquery.com/Sites_Using_jQuery">very impressive reference list</a>.  But if Mootools’list is shorter, it can be proud of containing some  prestigious names that suffice to prove its quality (w3c, vimeo,  netvibes etc.)</p>
<p>I obviously agree with Aaron Newton on this point: none of these two frameworks is a bad choice.</p>
<h3>The mottos say it all</h3>
<p>Indeed, mottos say long.</p>
<blockquote><p>[..]f you go to the jQuery site, here&#8217;s what it says at the top of the page:</p>
<p>jQuery  is a fast and concise JavaScript Library that simplifies HTML document  traversing, event handling, animating, and Ajax interactions for rapid  web development. jQuery is designed to change the way that you write  JavaScript.</p>
<p>..and if you go to MooTools, this is what you&#8217;ll find:</p>
<p>MooTools  is a compact, modular, Object-Oriented JavaScript framework designed  for the intermediate to advanced JavaScript developer. It allows you to  write powerful, flexible, and cross-browser code with its elegant, well  documented, and coherent API. [..]</p></blockquote>
<p>Am I the only one to find that one of the two mottos is a little more arrogant than the other? Seriously?…</p>
<p>« .. designe for the intermediate to advanced Javascript developer.».. .</p>
<p>The  important fact here is not about the truth of the statement  (personally, I consider Mootools as being very usable by a beginer).  The important fact about this statement is that <strong>the Mootools team addresses people who consider themselves as confirmed developer</strong>s.</p>
<p>Aaron  even goes further this way by, if I sum it up, considering that “If you  are interested in JavaScript and what makes it interesting, powerful,  and expressive, then, […] MooTools is the better choice.</p>
<p><strong>I strongly disagree with this last point</strong>. Actually, I even think that liking Javascript is a reason not to use Mootools. But more about this later.</p>
<h3>The Learning Curve and The Community</h3>
<p>Indeed,  the jQuery community is much broader than Mootools’ one. The author is  skipping an important point here: The bigger your community is, the more  you get reported bugs, the more developers you have to work on them and  to improve th code base, the more contributors you get to develop and  share plugins.<br />
When talking about stability, frequency and importance of release, there again, jQuery is an enormous step ahead.</p>
<p>As  an example: Maybe I am not lucky but a just a couple of days after I  started using Mootools, I encountered a annoying bug. In Mootools More  1.3.1.1, the Form validation does not work on select elements.<br />
Just try to implement a callback for elementFail and you won’t get ever anything in your element variable.</p>
<p>The bug is referenced and corrected on Github for a while:<br />
<a href="https://github.com/mootools/mootools-more/commit/358378c5b">https://github.com/mootools/mootools-more/commit/358378c5b</a>. But it is still not fixed yet in the official download version.</p>
<h3>What Javascript is Good For</h3>
<p>The  author here briefly describes the <a href="http://en.wikipedia.org/wiki/Prototype-based_programming">prototypal approach</a> of the object  model used by Javascript. His conclusion is that “the bad news is that  vanilla JavaScript doesn&#8217;t make these powerful things very useful or  accessible”.</p>
<p>Huuh? oO? What?</p>
<p>OK, I agree that the prototypal model is (too) often unknown of developers. The <a href="http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html">excellent article from Steve Yegge on the subject</a> and “<a href="http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb">Javascript, the good parts</a>”  from the also excellent <a href="http://en.wikipedia.org/wiki/Douglas_Crockford">Douglas Crockford</a>, will help the curious ones  to get an insight on the subject and about how Javascript implements it.</p>
<p>But how can one say that the <strong>language</strong> is responsible for making these powerful things <strong>useless</strong> or <strong>inaccessible</strong>?<br />
Here how you declare an object in javascript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> my_object <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	property<span style="color: #339933;">:</span> ‘a property’<span style="color: #339933;">,</span>
	method<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;">alert</span><span style="color: #009900;">&#40;</span>‘Hello World’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And here is how to inherit from this object:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> tmp <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: #009900;">&#125;</span><span style="color: #339933;">;</span>
tmp.<span style="color: #660066;">prototype</span> <span style="color: #339933;">=</span> my_object<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> my_herited_object <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> tmp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>OK,  maybe I am not totally sincere. The last bit of code may not be that  obvious to everybody. But still, where does Javascript make it useless or inacessible?</p>
<h3>Mootools makes Javascript itself more fun</h3>
<p>Aaron Newton explains here that Mootools is trying to make Javascript better, to make it “the way it should be”.</p>
<p>So, Mootools extends the prototypes of the native types to bring them missing functionalities.</p>
<p>Let’s  just remember here that the augmentation provided to Element are mainly  focused on the DOM manipulation, a domain where jQuery is excellent.<br />
The  other “ameliorations” given to the native types, like Array or String  are sure welcome, but they are not a Mootools exclusivity.<br />
jQuery also <a href="http://api.jquery.com/category/utilities/">includes some helper functions</a>, without integrating them to the native prototypes.</p>
<p>Finally, Mootools proposes its famous <a href="http://mootools.net/docs/core/Class/Class">Class</a> concept.<br />
The  author pretends here that Mootools is not trying to introduce a  class-based object model in javascript but that its purpose is instead  to simplify the use of the prototypal model.</p>
<p>Sure… And I am the Queen of England…</p>
<p>Simple  question then: Why call an object/namespace that is dedicated to  simplify the use of the prototypal model with the name of its concurrent  model?<br />
In practice, the use of Mootools Class is clearly a mimic of a “classical” class object model.</p>
<p>Assuming  that the will of Mootools was really to facilitate the use of the  prototypal system, the term “Class” can only lead to confusion for the  developer.</p>
<p>I  like Javascript for, among other things, its prototypal approach. And  because I like Javascript, I do not need Mootools Class system.</p>
<p>jQuery does not provide any “inheritance model” for one good reason: it is already built in Javascript and works perfectly well.<br />
The  additional layer provided by Mootools is confusing and unnatural to me,  and should, I believe, be to any javascript developer.</p>
<h3>jQuery makes the DOM more fun</h3>
<p>Another  sophism from the author. jQuery would only be a “toolbox” dedicated to  the manipulation of the DOM only, where Mootols would a real, much more  abstract and noble “framework”.</p>
<p>The fact is it is false.</p>
<p>The main thing is that jQuery is focused on utile  things. Even if, notably thanks to node.js, we start seeing some  javascript running out of the browser, the truth is the huge majority of  the existing javascript worldwide is interpreted by the browsers.<br />
And the manipulation of the DOM is, indeed, a very important point for the developer.</p>
<p>But  reducing jQuery to the DOM handling is fallacious. The Ajax layer, the  utility functions we already talked about or the processing of events by  groups introduced in 1.5 do not have any direct relation with the DOM.</p>
<h3>Anything You Can Do I Can Do Better</h3>
<p>Let’s  skip this chapter where the author is trying to convince us without any  evidence that the scope of Mootools is wider than jQuery’s one.<br />
I already explained how useless the so-said extra area covered by Mootools was to me.</p>
<h3>Mootools Lets You Have It Your Way</h3>
<p>Let’s skip it too.</p>
<p>I just do not understand one willing to mimic Mootools.</p>
<p>When manipulating the DOM, Mootools is incoherent and verbose.<br />
On all the Class stuff, everything can be done simpler and cleaner in vanilla Javascript.</p>
<h3>Chaining as a Design Pattern</h3>
<p>Where we are explained that we can access the properties of an object that is sent as a result of a function.<br />
Thank, we knew it already.</p>
<h3>Reusing Code with JQuery</h3>
<p>Here again, we are told that using jQuery, we can only manipulate the DOM.<br />
I  am sorry Aaron but far before knowing Mootools, I was creating, using  and _even_ using some inheritance principles in Javascript.</p>
<p>A  little word on “There&#8217;s not a lot of complexity here, which makes it  easy for anyone to write jQuery plug-ins &#8211; they&#8217;re just single  functions.”<br />
Let’s  just remember that, contrary to a language like PHP, in Javascript, a  function is an Object, that we can freely define and use complete  objects in it, or other embed functions.<br />
Because  functions are closures, they can also access everything outside  themselves that were accessible from their definition scope.<br />
There is actually no limit to how complex a function can be.<br />
Actually, the whole jQuery framework (I use this word on purpose) is one single function.</p>
<p>The  point about jQuery-UI also looks out-of-subject to me. The way  jQuery-UI is included in jQuery is not dictated by jQuery. It is just a  choice from the jQuery UI team. Let’s just remember one simple statement  that one may have forgotten:<br />
This is all javascript. The source is right there. We can code around the way we want.</p>
<h3>Reusing Code with Mootools</h3>
<p>First a word about the extension of the native prototypes.<br />
Personally, I am balanced on this question.</p>
<p>Of  course, I find (too) dangerous to modify or extend the behaviour of  objects that are share across the whole execution context and then, most  probably, by other scripts and libraries (including Google Analytics or  Maps).<br />
On the other hand, I can understand how tempting it can be to have a trim method right from any String.</p>
<p>Using an inherited prototype is not a solution as this would obviously imply lots of tedious casts.</p>
<p>The alternative, and my personal choice, it to externalise these functions, like jQuery does with c jQuery.trim() for instance.<br />
Of  course, we loose in syntaxic quality by writing jQuery.trim( my_string )  rather than my_string.trim() but at least, we are sure that we do not  interfere with an insane external programmer who decided to use  String.trim as a way to give the current date.</p>
<h3>About the use of CSS selectors</h3>
<p>One question: What’s the use of the $ function in Mootools?</p>
<p>It is just an alias for document.getElementById, does not provide any additional value and introduces some confusion with $$.</p>
<p>Let’s just remember that $$(‘#myid’)[0] will give the same result as $(‘myid’).<br />
So, the purpose of $ would be to save 4 chars?</p>
<p>I am starting to assume that the $ function’s real purpose is to conflict with other frameworks like jQuery or Prototype.</p>
<h3>About the Namespaces</h3>
<p>Let’s finish with a point that I have not talked about yet and that I suspect Aaron Newton to avoid.<br />
This point is one of the big ones that make me think Mootools won’t ever be my favourite framework.<br />
I am of course talking about the use of namespaces.</p>
<p>While  we can see jQuery’s constant effort to limit its impact on the window  namespace to the two $ and jQuery variables, we cannot say the same  thing about Mootools.</p>
<p>Mootools is not very shy when talking about exposing its insides to the global world.</p>
<p>We  of course get $ and $$ but also a lot of other ones: Element, Class,  Slick. If you use Mootools More, some more objects wil also be set  globally: Form, FX etc.</p>
<p>Seriously, what is the risk another script uses a variable named Form?<br />
Quite high if you ask me.</p>
<p>For a framework “designed for the intermediate to advanced JavaScript developer”, I find this is quite a big noob mistake.</p>
<h3>Conclusion</h3>
<p>As  you may have understood, I am not a Mootools fanboy. jQuery of course  does not need me to still be the dominant framework for a while.</p>
<p>Let’s just remember somethins that may have been forgottent during the reading of this post: Mootools is not a bad framework.<br />
The only fact that the w3c or netvibes use it for their site should be enough to be sure about it.</p>
<p>But  I have some points of disagreement with Mootools: I find it infatuous,  too buggy for me and for a large part uselesss or even counter-productive.<br />
Yes,  this is a little proselyte _I would spend my time doing other things  that writing this post if I would’nt want people to read it.<br />
To me, Mootools is promoting itself by using a corporatist argument being “Mootools is for 31337 ; jQuery is for Noobs”.</p>
<p>I think this argument is bullshit. And I do not like corporatism. Real 31337 are open to the world.</p>
<p>You  still can have good reasons to choose Mootols over jQuery (or any other  framework) but please don’t fall into this gross trap.</p>
<p>PS: If you want to learn more on Javascript, I invite you to consult the <a href="http://javascript.crockford.com/">essays and media from  Douglas Crockford.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2011/03/keep-your-mootools-barrel-i-keep-my-barrel-of-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inforegistre – Scam on company creation</title>
		<link>http://www.benoitvidis.com/2010/10/inforegistre-%e2%80%93-scam-on-company-creation/</link>
		<comments>http://www.benoitvidis.com/2010/10/inforegistre-%e2%80%93-scam-on-company-creation/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 12:22:17 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[arnaque]]></category>
		<category><![CDATA[inforegistre]]></category>
		<category><![CDATA[scam]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=251</guid>
		<description><![CDATA[This morning, I received that mail: No additional note. The form just looks like any form. A long boring list of tedious to fill fields. A name that sounds good bureaucracy. And a cheque of 143,52€ to send : &#8230; But.. wait a minute! Let&#8217;s look at the small bottom lines: This mail is in ]]></description>
			<content:encoded><![CDATA[<p>This morning, I received that mail:<br />
<a href="http://www.benoitvidis.com/wordpress/wp-content/uploads/2010/10/20101020_0081.jpg"><img class="size-medium wp-image-254" title="Inforegistre - Scam" src="http://www.benoitvidis.com/wordpress/wp-content/uploads/2010/10/20101020_0081-216x300.jpg" alt="Inforegistre - Scam form" width="216" height="300" /></a></p>
<p>No additional note. The form just looks like any form. A long boring list of tedious to fill fields. A name that sounds good bureaucracy.<br />
And a cheque of 143,52€ to send : &#8230;</p>
<p>But.. wait a minute!<br />
Let&#8217;s look at the small bottom lines:<br />
<a href="http://www.benoitvidis.com/wordpress/wp-content/uploads/2010/10/20101020_007.jpg"><img class="size-medium wp-image-255" title="Inforegistre scam - bottom lines" src="http://www.benoitvidis.com/wordpress/wp-content/uploads/2010/10/20101020_007-300x53.jpg" alt="Inforegistre scam - bottom lines" width="300" height="53" /></a></p>
<p>This mail is in fact a commercial offer. Nothing to do with any administrative obligation.<br />
Regarding the actual interest of the service, it looks very dubious to me.</p>
<p>We have a nice little business here, that is playing with the auto-entrepreneuriat mood in France (a very easy way to build your own small company).</p>
<p>So, beware if you just registered your company.<br />
Read the small bottom lines.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2010/10/inforegistre-%e2%80%93-scam-on-company-creation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blank Page after WP Super Cache upgrade</title>
		<link>http://www.benoitvidis.com/2010/06/blank-page-after-wp-super-cache-upgrade/</link>
		<comments>http://www.benoitvidis.com/2010/06/blank-page-after-wp-super-cache-upgrade/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 14:03:29 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=240</guid>
		<description><![CDATA[Today, I upgraded my WordPress version to 3.0. As usual, this has been a necessary pain. As usual, the automatic upgrade failed. As usual, my qtranslate version was said to be incompatible and I had to tweak it a little (setting it to 3.0 for me). But, far more annoying, after I upgraded WP Super ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/picsbycam/3564484484/" title="Blank. by Cameron Cassan, on Flickr"><img src="http://farm4.static.flickr.com/3555/3564484484_c350b85f3e.jpg" width="333" height="500" alt="Blank." /></a><br />
Today, I upgraded my WordPress version to 3.0.</p>
<p>As usual, this has been a necessary pain.<br />
As usual, the automatic upgrade failed.<br />
As usual, my <a href="http://wordpress.org/extend/plugins/qtranslate/">qtranslate</a> version was said to be incompatible and I had to <a href="http://boring-group.com/custom-musings/wordpress-3-0-alpha-and-qtranslate/">tweak it a little</a> (setting it to 3.0 for me).</p>
<p>But, far more annoying, after I upgraded <a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache</a>, and for the second time, the visitors could only see a blank page visiting my site.</p>
<p>I had had the same issue on the last update and had to tweak the wp-cache source files but I was hoping that such a big thing would be corrected in the next version. Before I submit a fix to the author, here is the way I solved it on my system.</p>
<p>The problem was in my case that the plugin was properly caching the page, generating a nice html static file. It was also properly detecting the page had been cached on the second visit and still properly get the file name.</p>
<p>Then, it was doing this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$cache_file</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Doesn&#8217;t tilt? Remember, the plugin had generated an <b>html</b> file. Including it from php just resulted in  a Parse error.</p>
<p>So, here is my fix.  just replaced the include by:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cache_file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'php'</span><span style="color: #339933;">:</span>
		<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$cache_file</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
		<span style="color: #990000;">readfile</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$cache_file</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span> 					
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>On the version I use (0.9.9.3), it is located in wp-content/plugin/wp-cache/wp-cache-phase1.php, line 212.</p>
<p>If you turned on crompression, the code located just above is probably faulty too.</p>
<p>Of course, the fix is not nice either as I should not rely on the file extension to detect its type but I am lazy (and a bit sick).<br />
A nicer way would be to ensure that everything is cached is in a proper php format and keep the include method. (meaning, adding &#8220;?>&#8221; and &#8220;&lt;?php&#8221; respectively at the top and bottom of the html files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2010/06/blank-page-after-wp-super-cache-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to capture the KeypressEvent on a GTK Custom Widget</title>
		<link>http://www.benoitvidis.com/2010/05/how-to-capture-the-keypressevent-on-a-gtk-custom-widget/</link>
		<comments>http://www.benoitvidis.com/2010/05/how-to-capture-the-keypressevent-on-a-gtk-custom-widget/#comments</comments>
		<pubDate>Tue, 11 May 2010 10:57:16 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=232</guid>
		<description><![CDATA[Let&#8217;s say you want for instance to change the cursor icon when the user presses the control key on your widget. This apparently simple task almost drove me crazy. Subscribing to the KeyPressEvent is not enough. Using AddEvent to add the KeyPress event is not enough either. Actually, to be able to fire the KeyPress ]]></description>
			<content:encoded><![CDATA[<p><a title="Keyboard in action by lapideo, on Flickr" href="http://www.flickr.com/photos/lapideo/198046070/"><img src="http://farm1.static.flickr.com/66/198046070_730a2474d2.jpg" alt="Keyboard in action" width="500" height="375" /></a> Let&#8217;s say you want for instance to change the cursor icon when the user presses the control key on your widget. This apparently simple task almost drove me crazy.</p>
<p>Subscribing to the KeyPressEvent is not enough.<br />
Using AddEvent to add the KeyPress event is not enough either.</p>
<p>Actually, to be able to fire the KeyPress event, your widget, like a Winform Control, needs to receive focus.</p>
<p>So, I set the CanFocus property to true and&#8230; it does not work!<br />
Arhgle!&#8230;.</p>
<p>Thanks to <a href="http://www.mail-archive.com/gtk-list@gnome.org/msg03381.html">this link</a>, I finally got all the requirements:</p>
<ul>
<li>You need to use the AddEvent method to add the KeyPress event to your widget&#8217;s event list</li>
<li>You need to set the CanFocus to true</li>
<li>You need to subscribe to the FocusIn event and set the HasFocus property to true when it is fired</li>
<li>You need to subscribe to the FocusOut event and set the HasFocus property to false when it is fired</li>
<li>On the event you&#8217;d like the widget to receive focus (probably ButtonPress), you need to call the GrabFocus method</li>
</ul>
<p>Then only you will be able to get the event.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2010/05/how-to-capture-the-keypressevent-on-a-gtk-custom-widget/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How many poppies on the photograph?</title>
		<link>http://www.benoitvidis.com/2010/04/how-many-poppies-on-the-photograph/</link>
		<comments>http://www.benoitvidis.com/2010/04/how-many-poppies-on-the-photograph/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 08:57:07 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=227</guid>
		<description><![CDATA[Maybe you already have had to count a large number of items on a picture. I you have, you know it was tedious and needed quite a lot of focus for an apparently basic task. So, I put online a very basic application to help you doing it. It does exactly this: Upload your photo ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/onkel_wart/2516993618/" title="poppy love.... #9 -- I see red by onkel_wart, on Flickr"><img src="http://farm3.static.flickr.com/2184/2516993618_fc438fe3e1.jpg" width="500" height="500" alt="poppy love.... #9 -- I see red" /></a>Maybe you already have had to count a large number of items on a picture.</p>
<p>I you have, you know it was tedious and needed quite a lot of focus for an apparently basic task.</p>
<p>So, <a href="http://www.benoitvidis.com/clickcount">I put online a very basic application to help you doing it</a>. It does exactly this: </p>
<ol>
<li>Upload your photo</li>
<li>Mark the items you want to count by clicking them</li>
</ol>
<p>That&#8217;s it. The script will count the marks for you.</p>
<p>Additional tips:<br />
You can modify the picture size by drag-dropping the bottom right handle. You can also use the &#8220;+&#8221; and &#8220;-&#8221; keys on your keyboard. The &#8220;*&#8221; key will set the picture to its original (when loaded) size.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2010/04/how-many-poppies-on-the-photograph/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I&#8217;d rather not have to read over my fellow&#8217;s shoulder</title>
		<link>http://www.benoitvidis.com/2010/03/about-peer-code-review/</link>
		<comments>http://www.benoitvidis.com/2010/03/about-peer-code-review/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 11:02:16 +0000</pubDate>
		<dc:creator>Benoit</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.benoitvidis.com/?p=220</guid>
		<description><![CDATA[I generally agree with Agile principles. For the most part, I have not had the chance to put them in practice yet but most of them just seem to be the right thing to do. I must admit I am still very defensive on one Agile engineering practice though: The binomial programming, promoted by the ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/babymanji/3643481742/" title="don't read over my shoulder de babymanji, sur Flickr"><img src="http://farm4.static.flickr.com/3407/3643481742_3c2f18b290.jpg" width="500" height="375" alt="don't read over my shoulder" /></a><br />
I generally agree with Agile principles. For the most part, I have not had the chance to put them in practice yet but most of them just seem to be the right thing to do.</p>
<p>I must admit I am still very defensive on one Agile engineering practice though: The binomial programming, promoted by the <a href="http://en.wikipedia.org/wiki/Extreme_programming">XP method</a>. While I fully understand the big benefits of a code review, I just cannot imagine myself looking over a brother fellow&#8217;s shoulder while he is coding.</p>
<p>Being watched, while not very pleasant, is bearable. But the reviewer position just sounds like hell to me. Not only is he <strong>not</strong> coding, but he cannot control the rhythm of the code that is produced in front of him. Either it is going too slow and he is going to get bored and/or irritated or it is going too fast and he won&#8217;t understand and will get bored and/or irritated.</p>
<p>Fortunately, <a href="http://goo.gl/fb/iW8m">it looks like some alternatives do exist</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitvidis.com/2010/03/about-peer-code-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

