<?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>/home/florian</title>
	<atom:link href="http://fcargoet.evolix.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://fcargoet.evolix.net</link>
	<description>le blog de florian cargoet : du linux, du web et du logiciel libre</description>
	<lastBuildDate>Mon, 26 Nov 2012 21:09:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>New adventures</title>
		<link>http://fcargoet.evolix.net/2012/04/new-adventures/</link>
		<comments>http://fcargoet.evolix.net/2012/04/new-adventures/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 11:36:00 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=677</guid>
		<description><![CDATA[Ce blog déménage ici et se met à parler anglais ! This blog has a new home and now speaks English! I will still write about code and I&#8217;ll add some electronics and DIY projects in the mix. If you&#8217;re still interested, update your bookmarks and RSS/Atom feeds: http://floriancargoet.com/ http://blog.floriancargoet.com/ http://blog.floriancargoet.com/atom.xml See you there!]]></description>
			<content:encoded><![CDATA[<p>Ce blog déménage <a href="http://blog.floriancargoet.com">ici</a> et se met à parler anglais !<br />
This blog has a <a href="http://blog.floriancargoet.com">new home</a> and now speaks English!<br />
I will still write about <strong>code</strong> and I&#8217;ll add some <strong>electronics</strong> and <strong><a title="Do it yourself (Wikipedia)" href="http://en.wikipedia.org/wiki/Do_it_yourself">DIY</a> projects</strong> in the mix.</p>
<p>If you&#8217;re still interested, update your bookmarks and RSS/Atom feeds:</p>
<ul>
<li><a href="http://floriancargoet.com/">http://floriancargoet.com/</a></li>
<li><a href="http://blog.floriancargoet.com/">http://blog.floriancargoet.com/</a></li>
<li><a href="http://blog.floriancargoet.com/atom.xml">http://blog.floriancargoet.com/atom.xml</a></li>
</ul>
<p>See you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2012/04/new-adventures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[EN] Use PhantomJS to take screenshots of your webapp for you</title>
		<link>http://fcargoet.evolix.net/2012/01/use-phantomjs-to-take-screenshots-of-you-webapp-for-you/</link>
		<comments>http://fcargoet.evolix.net/2012/01/use-phantomjs-to-take-screenshots-of-you-webapp-for-you/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 18:51:49 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Ext JS]]></category>
		<category><![CDATA[Webdev]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=660</guid>
		<description><![CDATA[Problem You&#8217;ve built a web application and it&#8217;s time to write the user documentation. Your app is localized and you ship new features every three months. In your documentation, you want screenshots of specific parts of your application: the login box, the collapsed Help panel, the main data grid… You need to take screenshots in [...]]]></description>
			<content:encoded><![CDATA[<h3>Problem</h3>
<p>You&#8217;ve built a web application and it&#8217;s time to write the user documentation. Your app is localized and you ship new features every three months.</p>
<p>In your documentation, you want screenshots of specific parts of your application: the login box, the collapsed <em>Help</em> panel, the main data grid…</p>
<p>You need to take screenshots in 4 languages.</p>
<p>Do you want to take them manually? You could probably define a bunch of rectangular zones and automate the process but the login box is bigger in French than in English since the text is longer. And in six months, you&#8217;ll ship a feature which will require a change in the global application layout.</p>
<p>Do you want to define your rectangular zones 4 times? And redefine them (4 times) whenever you resize/move a component?</p>
<h3>Solution: component based screenshots</h3>
<p>What if you could tell: &#8220;Take a screenshot of this div&#8221; instead of &#8220;Take a screenshot of this app and cut here, here and there&#8221;?</p>
<p>Even better: &#8220;Take a screenshot of this <em>&lt;insert your favorite UI framework&gt;</em> component&#8221;.</p>
<p>With <a href="http://www.phantomjs.org/">PhantomJS</a>, you can.</p>
<h3>Installation</h3>
<p>There are builds for Windows and MacOS X available on the <a href="http://code.google.com/p/phantomjs/downloads/list">download page</a>, there is <em>brew install phantomjs</em>, there is a <a href="http://code.google.com/p/phantomjs/wiki/Installation">PPA</a> for Ubuntu, and there are <a href="http://code.google.com/p/phantomjs/wiki/SourceCode?tm=4">several git repositories</a>.</p>
<p>I chose to compile it on my 32 bits Ubuntu computer:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p660code6'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6606"><td class="code" id="p660code6"><pre class="bash" style="font-family:monospace;"><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> libqt4-dev libqtwebkit-dev qt4-qmake
<span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>ariya<span style="color: #000000; font-weight: bold;">/</span>phantomjs.git
<span style="color: #7a0874; font-weight: bold;">cd</span> phantomjs
<span style="color: #c20cb9; font-weight: bold;">git</span> checkout 1.4.1
qmake-qt4
<span style="color: #c20cb9; font-weight: bold;">make</span></pre></td></tr></table></div>

<p>There is no <em>install</em> target in the Makefile so do whatever you usually do in this case (move/symlink the binary to /usr/bin/, add the bin/ directory in your $PATH, use the full path when invoking phantomjs…). The PhantomJS binary is bin/phantomjs.</p>
<h3>Usage</h3>
<p>phantomjs your_script.js [parameters]</p>
<h3>Examples</h3>
<p>You can find some <a href="http://code.google.com/p/phantomjs/wiki/QuickStart">examples</a> on the site. Here are some of them:</p>
<p>Load a web page:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p660code7'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6607"><td class="code" id="p660code7"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> page <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> WebPage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
page.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">status</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// do something</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Take a screenshot a a page:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p660code8'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6608"><td class="code" id="p660code8"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> page <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> WebPage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    address<span style="color: #339933;">,</span> output<span style="color: #339933;">,</span> size<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>phantom.<span style="color: #660066;">args</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">2</span> <span style="color: #339933;">||</span> phantom.<span style="color: #660066;">args</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Usage: rasterize.js URL filename'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    phantom.<span style="color: #660066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
    address <span style="color: #339933;">=</span> phantom.<span style="color: #660066;">args</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    output <span style="color: #339933;">=</span> phantom.<span style="color: #660066;">args</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    page.<span style="color: #660066;">viewportSize</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> width<span style="color: #339933;">:</span> <span style="color: #CC0000;">600</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #CC0000;">600</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    page.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>address<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">status</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: #000066;">status</span> <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'success'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Unable to load the address!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</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>
                page.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</span>output<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                phantom.<span style="color: #660066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">200</span><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: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Evaluate some JS code in the context of the web page:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p660code9'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6609"><td class="code" id="p660code9"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> page <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> WebPage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
page.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">status</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> title <span style="color: #339933;">=</span> page.<span style="color: #660066;">evaluate</span><span style="color: #009900;">&#40;</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;">return</span> document.<span style="color: #660066;">title</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Page title is '</span> <span style="color: #339933;">+</span> title<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Combine of these possibilities and you have a nice screenshotting solution!</p>
<h3>Component screenshotting</h3>
<p>With PhantomJS, this is really simple:</p>
<ol>
<li>Load your app</li>
<li>Find your divs / Find your components</li>
<li>Get their bounding boxes (top, left, width, height)</li>
<li>Render with clipRect</li>
</ol>
<p>Example with an <a href="http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/feed-viewer/feed-viewer.html">ExtJS demo app</a>:</p>
<p>This is a RSS feed viewer and I want screenshots of:</p>
<ul>
<li>The left panel</li>
<li>The preview button</li>
<li>The whole application, with the left panel collapsed</li>
</ul>
<p>Here it is:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p660code10'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p66010"><td class="code" id="p660code10"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> page    <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> WebPage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    address <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/feed-viewer/feed-viewer.html'</span><span style="color: #339933;">;</span>
&nbsp;
page.<span style="color: #660066;">viewportSize</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
    width  <span style="color: #339933;">:</span> <span style="color: #CC0000;">800</span><span style="color: #339933;">,</span>
    height <span style="color: #339933;">:</span> <span style="color: #CC0000;">600</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// define the components we want to capture</span>
<span style="color: #003366; font-weight: bold;">var</span> components <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>
    output <span style="color: #339933;">:</span> <span style="color: #3366CC;">'feed-viewer-left.png'</span><span style="color: #339933;">,</span>
    <span style="color: #006600; font-style: italic;">//ExtJS has a nice component query engine</span>
    selector <span style="color: #339933;">:</span> <span style="color: #3366CC;">'feedpanel'</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
    output <span style="color: #339933;">:</span> <span style="color: #3366CC;">'feed-viewer-preview-btn.png'</span><span style="color: #339933;">,</span>
    selector <span style="color: #339933;">:</span> <span style="color: #3366CC;">'feeddetail &gt; feedgrid &gt; toolbar &gt; cycle'</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
    output <span style="color: #339933;">:</span> <span style="color: #3366CC;">'feed-viewer-collapsed.png'</span><span style="color: #339933;">,</span>
    <span style="color: #006600; font-style: italic;">//executed before the rendering</span>
    before <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: #003366; font-weight: bold;">var</span> panel <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">ComponentQuery</span>.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'feedpanel'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        panel.<span style="color: #660066;">animCollapse</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// cancel animation, no need to wait before capture</span>
        panel.<span style="color: #660066;">collapse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    selector <span style="color: #339933;">:</span> <span style="color: #3366CC;">'viewport'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
page.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>address<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">status</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: #000066;">status</span> <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'success'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Unable to load the address!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">/*
         * give some time to ExtJS to
         *   - render the application
         *   - load asynchronous data
         */</span>
        window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</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>
            components.<span style="color: #660066;">forEach</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>component<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">//execute the before function</span>
                component.<span style="color: #660066;">before</span> <span style="color: #339933;">&amp;&amp;</span> page.<span style="color: #660066;">evaluate</span><span style="color: #009900;">&#40;</span>component.<span style="color: #660066;">before</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">// get the rectangular area to capture</span>
                <span style="color: #006600; font-style: italic;">/*
                 * page.evaluate() is sandboxed
                 * so that 'component' is not defined.
                 *
                 * It should be possible to pass variables in phantomjs 1.5
                 * but for now, workaround!
                 */</span>
                <span style="color: #000066; font-weight: bold;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'function workaround(){ window.componentSelector = &quot;'</span> <span style="color: #339933;">+</span> component.<span style="color: #660066;">selector</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;;}'</span><span style="color: #009900;">&#41;</span>
                page.<span style="color: #660066;">evaluate</span><span style="color: #009900;">&#40;</span>workaround<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #003366; font-weight: bold;">var</span> rect <span style="color: #339933;">=</span> page.<span style="color: #660066;">evaluate</span><span style="color: #009900;">&#40;</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: #006600; font-style: italic;">// find the component</span>
                    <span style="color: #003366; font-weight: bold;">var</span> comp <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">ComponentQuery</span>.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">componentSelector</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    <span style="color: #006600; font-style: italic;">// get its bounding box</span>
                    <span style="color: #003366; font-weight: bold;">var</span> box <span style="color: #339933;">=</span> comp.<span style="color: #660066;">el</span>.<span style="color: #660066;">getBox</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #006600; font-style: italic;">// box is {x, y, width, height}</span>
                    <span style="color: #006600; font-style: italic;">// we want {top, left, width, height}</span>
                    box.<span style="color: #660066;">top</span>  <span style="color: #339933;">=</span> box.<span style="color: #660066;">y</span><span style="color: #339933;">;</span>
                    box.<span style="color: #660066;">left</span> <span style="color: #339933;">=</span> box.<span style="color: #660066;">x</span><span style="color: #339933;">;</span>
                    <span style="color: #000066; font-weight: bold;">return</span> box<span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                page.<span style="color: #660066;">clipRect</span> <span style="color: #339933;">=</span> rect<span style="color: #339933;">;</span>
                page.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</span>component.<span style="color: #660066;">output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #006600; font-style: italic;">// job done, exit</span>
            phantom.<span style="color: #660066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2000</span><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: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>Result</h3>
<p>And here are the screenshots:</p>
<p><a href="http://fcargoet.evolix.net/wp-content/uploads/2012/01/feed-viewer-left.png"><img class="aligncenter size-full wp-image-668" title="feed-viewer-left" src="http://fcargoet.evolix.net/wp-content/uploads/2012/01/feed-viewer-left.png" alt="feed-viewer-left" width="225" height="590" /></a><br />
<a href="http://fcargoet.evolix.net/wp-content/uploads/2012/01/feed-viewer-preview-btn.png"><img class="aligncenter size-full wp-image-669" title="feed-viewer-preview-btn" src="http://fcargoet.evolix.net/wp-content/uploads/2012/01/feed-viewer-preview-btn.png" alt="feed-viewer-preview-btn" width="136" height="22" /></a><br />
<a href="http://fcargoet.evolix.net/wp-content/uploads/2012/01/feed-viewer-collapsed.png"><img class="aligncenter size-full wp-image-667" title="feed-viewer-collapsed" src="http://fcargoet.evolix.net/wp-content/uploads/2012/01/feed-viewer-collapsed.png" alt="feed-viewer-collapsed" width="800" height="600" /></a></p>
<h3>Conclusion</h3>
<p>Now, we can automate screenshotting of specific components, even if we don&#8217;t know their position or size. Relaunch this script with your application in Spanish and <em>voilà</em>: 3 Spanish screenshots in 5 seconds, even if the button is bigger (or smaller, I don&#8217;t speak Spanish)!</p>
<p>Ideas:</p>
<ul>
<li>Components to capture defined in the app itself</li>
<li>Browser extension/Bookmarlet to define the components to capture just by clicking on it</li>
<li>Use it for unit testing, with image comparison</li>
<li>Make a product of this, make profit</li>
</ul>
<p>I hope you liked it!</p>
]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2012/01/use-phantomjs-to-take-screenshots-of-you-webapp-for-you/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>[EN] Change Firebug&#8217;s own style</title>
		<link>http://fcargoet.evolix.net/2012/01/change-firebugs-own-style/</link>
		<comments>http://fcargoet.evolix.net/2012/01/change-firebugs-own-style/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 13:48:21 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Webdev]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=657</guid>
		<description><![CDATA[Problem I recently switched to XFCE, using the NOX theme. Unfortunately, Firebug&#8217;s tabs use the same color as NOX&#8217;s background color. grey text + grey background = invisible tabs! This is extremely specific, nobody&#8217;s going to use it except me but I know I will need it whenever Firebug is updated. Solution Change Firebug! ?View [...]]]></description>
			<content:encoded><![CDATA[<h3>Problem</h3>
<p>I recently switched to XFCE, using the NOX theme. Unfortunately, Firebug&#8217;s tabs use the same color as NOX&#8217;s background color.</p>
<p>grey text + grey background = invisible tabs!</p>
<p>This is extremely specific, nobody&#8217;s going to use it except me but I know I will need it whenever Firebug is updated.</p>
<h3>Solution</h3>
<p>Change Firebug!</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p657code13'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p65713"><td class="code" id="p657code13"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> myfirebug
$ <span style="color: #7a0874; font-weight: bold;">cd</span> myfirebug
$ <span style="color: #c20cb9; font-weight: bold;">unzip</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>firebug<span style="color: #000000; font-weight: bold;">@</span>software.joehewitt.com.xpi
$ <span style="color: #c20cb9; font-weight: bold;">vim</span> skin<span style="color: #000000; font-weight: bold;">/</span>classic<span style="color: #000000; font-weight: bold;">/</span>win<span style="color: #000000; font-weight: bold;">/</span>firebug.css</pre></td></tr></table></div>

<p>Now, edit the color in the <em>panelTab</em> rule.</p>
<p>Zip everything and install it in Firefox.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p657code14'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p65714"><td class="code" id="p657code14"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> myfirebug
$ <span style="color: #c20cb9; font-weight: bold;">zip</span> <span style="color: #660033;">-r</span> custom-firebug<span style="color: #000000; font-weight: bold;">@</span>software.joehewitt.com.xpi <span style="color: #000000; font-weight: bold;">*</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2012/01/change-firebugs-own-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[EN] My entry for the DailyJS &#8220;contest&#8221;</title>
		<link>http://fcargoet.evolix.net/2011/04/en-my-entry-for-the-dailyjs-contest/</link>
		<comments>http://fcargoet.evolix.net/2011/04/en-my-entry-for-the-dailyjs-contest/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 21:45:31 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Webdev]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=634</guid>
		<description><![CDATA[Last Friday, DailyJS had 5 digital subscriptions to Hacker Monthly to give away. They set up a small one-liner contest: If you’d like to read more from Hacker Monthly, we’ve got 5 digital subscriptions to give away — worth $29 each! Just post a comment with your favourite JavaScript one-liner, and I’ll select 5 winners. [...]]]></description>
			<content:encoded><![CDATA[<p>Last Friday, <a href="http://dailyjs.com/">DailyJS</a> had 5 digital subscriptions to <a href="http://hackermonthly.com/">Hacker Monthly</a> to give away. They set up a <a href="http://dailyjs.com/2011/04/08/hacker-news/">small one-liner contest</a>:</p>
<blockquote><p>If you’d like to read more from Hacker Monthly, we’ve got 5 digital subscriptions to give away — worth $29 each! Just post a comment with your favourite JavaScript one-liner, and I’ll select 5 winners.</p></blockquote>
<p>Thanks to this piece of code, I am the happy winner of one of the subscriptions:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code25'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63425"><td class="code" id="p634code25"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</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;">return</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;">return</span> _<span style="color: #339933;">!=</span><span style="color: #3366CC;">'?'</span> <span style="color: #339933;">&amp;&amp;</span> ___<span style="color: #009900;">&#40;</span>__<span style="color: #339933;">+</span>_<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> __<span style="color: #339933;">+</span><span style="color: #3366CC;">'!'</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'d'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'l'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'y'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'j'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'s'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'o'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'c'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'k'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'s'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'?'</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>In this article, I&#8217;ll explain what it does and how it works.<br />
<span id="more-634"></span></p>
<h3>What it does?</h3>
<p>If you copy/paste/run it in your favorite JavaScript debugger you&#8217;ll see that the weirdly formatted question <code>('d')('a')('i')('l')('y')('j')('s')(' ')('r')('o')('c')('k')('s')('?')</code> is answered: <code>"dailyjs rocks!"</code><br />
Yes, this was blatant flattery (<a href="http://dailyjs.com/2011/04/08/hacker-news/#comment-181184886">even called ass-kissing</a> <img src='http://fcargoet.evolix.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ). Well… It worked!</p>
<h3>How it works?</h3>
<p>To understand it I am going to uncompress this one-liner bit by bit. </p>
<p>Let&#8217;s add some new lines and spaces:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code26'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63426"><td class="code" id="p634code26"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</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;">return</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;">return</span> _ <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'?'</span> <span style="color: #339933;">&amp;&amp;</span> ___<span style="color: #009900;">&#40;</span>__ <span style="color: #339933;">+</span> _<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> __ <span style="color: #339933;">+</span> <span style="color: #3366CC;">'!'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'d'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'l'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'y'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'j'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'s'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'o'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'c'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'k'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'s'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'?'</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>I obviously use the underscore character to make the variable and function names more meaningful. Who wants obscure names like these:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code27'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63427"><td class="code" id="p634code27"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> createAccumulator<span style="color: #009900;">&#40;</span>allPreviousLetter<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>newLetter<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">return</span> newLetter <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'?'</span> <span style="color: #339933;">&amp;&amp;</span> createAccumulator<span style="color: #009900;">&#40;</span>allPreviousLetter <span style="color: #339933;">+</span> newLetter<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> allPreviousLetter <span style="color: #339933;">+</span> <span style="color: #3366CC;">'!'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'d'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'l'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'y'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'j'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'s'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'o'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'c'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'k'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'s'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'?'</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p><em>createAccumulator</em> is the best name I could think of but it&#8217;s not that good… I really prefer ___.</p>
<p>It&#8217;s more readable now but what is this &#038;&#038; and || stuff ?</p>
<p>You know what it means here: </p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code28'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63428"><td class="code" id="p634code28"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> conditionA <span style="color: #339933;">&amp;&amp;</span> conditionB <span style="color: #339933;">||</span> conditionC<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Since JavaScript is fun, you can use objects instead of booleans and it works since there are such things as truthy and falsy values (&#8220;&#8221; == false, for instance).</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code29'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63429"><td class="code" id="p634code29"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> newLetter <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'?'</span>  <span style="color: #339933;">&amp;&amp;</span> someFn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> someString <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>What more interesting is that if (A &#038;&#038; B) is true, it doesn&#8217;t &#8220;returns&#8221; true but it returns B! You probably use the same feature with || to specify a default value:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code30'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63430"><td class="code" id="p634code30"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> b <span style="color: #339933;">||</span> c<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>So with all this knowledge it&#8217;s easy to translate</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code31'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63431"><td class="code" id="p634code31"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">return</span> newLetter <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'?'</span> <span style="color: #339933;">&amp;&amp;</span> createAccumulator<span style="color: #009900;">&#40;</span>allPreviousLetter <span style="color: #339933;">+</span> newLetter<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> allPreviousLetter <span style="color: #339933;">+</span> <span style="color: #3366CC;">'!'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>into:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code32'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63432"><td class="code" id="p634code32"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">return</span> newLetter <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'?'</span>  <span style="color: #339933;">?</span> 
    createAccumulator<span style="color: #009900;">&#40;</span>allPreviousLetter <span style="color: #339933;">+</span> newLetter<span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
    <span style="color: #009900;">&#40;</span> allPreviousLetter <span style="color: #339933;">+</span> <span style="color: #3366CC;">'!'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>or more readable:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code33'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63433"><td class="code" id="p634code33"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> newLetter <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'?'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> createAccumulator<span style="color: #009900;">&#40;</span>allPreviousLetter <span style="color: #339933;">+</span> newLetter<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> allPreviousLetter <span style="color: #339933;">+</span> <span style="color: #3366CC;">'!'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Now let&#8217;s remove this disturbing <a href="http://benalman.com/news/2010/11/immediately-invoked-function-expression/">Immediately-Invoked Function Expression (IIFE)</a> and these chained function calls.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p634code34'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63434"><td class="code" id="p634code34"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> createAccumulator<span style="color: #009900;">&#40;</span>allPreviousLetter<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>newLetter<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> newLetter <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'?'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> createAccumulator<span style="color: #009900;">&#40;</span>allPreviousLetter <span style="color: #339933;">+</span> newLetter<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> allPreviousLetter <span style="color: #339933;">+</span> <span style="color: #3366CC;">'!'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> accumulate_D_and_return_a_new_accumulator   <span style="color: #339933;">=</span> createAccumulator<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> accumulate_DA_and_return_a_new_accumulator  <span style="color: #339933;">=</span> accumulate_D_and_return_a_new_accumulator <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> accumulate_DAI_and_return_a_new_accumulator <span style="color: #339933;">=</span> accumulate_DA_and_return_a_new_accumulator<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'i'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//…</span>
<span style="color: #003366; font-weight: bold;">var</span> lastOne                                     <span style="color: #339933;">=</span> accumulate_STUFF_and_return_a_new_accumulator<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> totalStringWithExclamationMark              <span style="color: #339933;">=</span> lastOne<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'?'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Crystal clear now, isn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2011/04/en-my-entry-for-the-dailyjs-contest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controler deux machines avec un seul clavier/souris et x2x</title>
		<link>http://fcargoet.evolix.net/2011/03/controler-deux-machines-avec-un-seul-claviersouris-et-x2x/</link>
		<comments>http://fcargoet.evolix.net/2011/03/controler-deux-machines-avec-un-seul-claviersouris-et-x2x/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 21:52:25 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=431</guid>
		<description><![CDATA[Sur le pc qui contrôle : ?View Code BASHssh -XCf hostname x2x -west -to :0.0 Remplacer -west par la direction la plus appropriée (north, south, east) Sur la cible : installer x2x Et voilà, quand votre souris dépasse le « coté ouest » de l&#8217;écran, elle continue son chemin sur la 2ème machine ! Le [...]]]></description>
			<content:encoded><![CDATA[<p>Sur le pc qui contrôle :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p431code36'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43136"><td class="code" id="p431code36"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-XCf</span> <span style="color: #c20cb9; font-weight: bold;">hostname</span>  x2x <span style="color: #660033;">-west</span> <span style="color: #660033;">-to</span> :<span style="color: #000000;">0.0</span></pre></td></tr></table></div>

<p>Remplacer -west par la direction la plus appropriée (north, south, east)</p>
<p>Sur la cible : installer <a href="apt://x2x">x2x</a></p>
<p>Et voilà, quand votre souris dépasse le « coté ouest » de l&#8217;écran, elle continue son chemin sur la 2ème machine ! Le clavier « suit » la souris, évidemment.</p>
]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2011/03/controler-deux-machines-avec-un-seul-claviersouris-et-x2x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Jeux en bookmarklet</title>
		<link>http://fcargoet.evolix.net/2011/03/jeux-en-bookmarklet/</link>
		<comments>http://fcargoet.evolix.net/2011/03/jeux-en-bookmarklet/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 22:28:57 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=625</guid>
		<description><![CDATA[En vrac quelques jeux lançables via des bookmarklets et dont le principe est d&#8217;interagir avec les éléments de la page : http://kathack.com/ : pour jouer à Katamari Damacy sur n&#8217;importe quelle page http://www.m-ms.dk/spaceheroes/ : un vaisseau M&#38;M&#8217;s qui shoote sur la page http://erkie.github.com/ : l&#8217;original sur lequel se base M&#38;M&#8217;s http://kathack.com est tout particulièrement intéressant pour [...]]]></description>
			<content:encoded><![CDATA[<p>En vrac quelques jeux lançables via des bookmarklets et dont le principe est d&#8217;interagir avec les éléments de la page :</p>
<ul>
<li><a href="http://kathack.com/">http://kathack.com/</a> : pour jouer à <a href="http://en.wikipedia.org/wiki/Katamari_Damacy" target="_blank">Katamari Damacy</a> sur n&#8217;importe quelle page</li>
<li><a href="http://www.m-ms.dk/spaceheroes/">http://www.m-ms.dk/spaceheroes/</a> : un vaisseau M&amp;M&#8217;s qui shoote sur la page</li>
<li><a href="http://erkie.github.com/">http://erkie.github.com/</a> : l&#8217;original sur lequel se base M&amp;M&#8217;s</li>
</ul>
<p><a href="http://kathack.com/">http://kathack.com</a> est tout particulièrement intéressant pour son usage des transformations CSS et du z-index pour produire un bel effet 3D.</p>
]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2011/03/jeux-en-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clavier TypeMatrix Bépo</title>
		<link>http://fcargoet.evolix.net/2011/01/clavier-typematrix-bepo/</link>
		<comments>http://fcargoet.evolix.net/2011/01/clavier-typematrix-bepo/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 22:26:32 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=619</guid>
		<description><![CDATA[Je viens d&#8217;acheter un clavier TypeMatrix 2030 avec une skin bépo. Même s&#8217;il est trop tôt pour dire si c&#8217;est un bon choix, si le bépo c&#8217;est mieux, si je tape plus vite, si c&#8217;est confortable, si la skin est résistante…, même s&#8217;il est trop tôt pour tout ça,  j&#8217;ai déjà quelques trucs techniques à [...]]]></description>
			<content:encoded><![CDATA[<p>Je viens d&#8217;acheter un clavier <a href="http://www.typematrix.com/2030/features.php">TypeMatrix 2030</a> avec une <a href="http://www.typematrix.com/bepo/view_closeup.php?l=&amp;t=skin&amp;id=13">skin bépo</a>. Même s&#8217;il est trop tôt pour dire si c&#8217;est un bon choix, si le bépo c&#8217;est mieux, si je tape plus vite, si c&#8217;est confortable, si la skin est résistante…, même s&#8217;il est trop tôt pour tout ça,  j&#8217;ai déjà quelques trucs techniques à partager.</p>
<p><span id="more-619"></span></p>
<h3>Changer de layout avec setxkbmap</h3>
<p>On peut évidemment utiliser les possibilités de son environnement de bureau (Gnome, KDE&#8230;) qui gèrent en général bien le passage d&#8217;un clavier à l&#8217;autre mais pour ceux qui préfèrent la ligne de commande :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p619code42'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p61942"><td class="code" id="p619code42"><pre class="bash" style="font-family:monospace;">setxkbmap fr bepo</pre></td></tr></table></div>

<p>Pour revenir à la disposition par défaut :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p619code43'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p61943"><td class="code" id="p619code43"><pre class="bash" style="font-family:monospace;">setxkbmap fr</pre></td></tr></table></div>

<h3>Assigner les touches non fonctionnelles avec xmodmap</h3>
<p>J&#8217;ai une bonne raison de préférer la ligne de commande : quand on change de layout, les touches &#8220;spéciales&#8221; mappées avec xmodmap sont perdues&#8230; C&#8217;est valable pour un changement par KDE 3 (pour Gnome et KDE4, j&#8217;ai pas encore testé mais je pense que ce sera pareil) ou par setxkbmap mais au moins, setxkbmap, ça se met dans un script qui peut aussi en profiter pour rétablir les mappings xmodmap.</p>
<p>J&#8217;ai un petit script qui regarde si on est en bépo ou azerty, qui bascule vers l&#8217;autre disposition et qui rétablit les mappings. J&#8217;ai ensuite créer un raccourci clavier pour lancer ce script avec la touche calculatrice qui ne me sert à rien.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p619code44'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p61944"><td class="code" id="p619code44"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
setxkbmap <span style="color: #660033;">-print</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> bepo
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        setxkbmap fr
<span style="color: #000000; font-weight: bold;">else</span>
        setxkbmap fr bepo
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;">#load xmodmap configuration</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;/etc/X11/Xmodmap.fix&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #c20cb9; font-weight: bold;">xmodmap</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>X11<span style="color: #000000; font-weight: bold;">/</span>Xmodmap.fix
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>Le fichier Xmodmap.fix, il est dans /etc/X11 par que je m&#8217;en sers aussi au démarrage, il est chargé par un script xsession : /etc/X11/Xsession.d/60&#215;11-xmodmap-fix</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p619code45'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p61945"><td class="code" id="p619code45"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;/etc/X11/Xmodmap.fix&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #c20cb9; font-weight: bold;">xmodmap</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>X11<span style="color: #000000; font-weight: bold;">/</span>Xmodmap.fix
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>Et enfin, le fichier Xmodmap.fix qui contient les mappings :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p619code46'); return false;">View Code</a> XMODMAP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p61946"><td class="code" id="p619code46"><pre class="xmodmap" style="font-family:monospace;">keycode 160 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 161 = XF86Calculator
keycode 162 = XF86AudioPlay XF86AudioPause
keycode 178 = XF86HomePage
keycode 233 = XF86Forward
keycode 234 = XF86Back
keycode 236 = XF86Mail</pre></td></tr></table></div>

<p>Selon votre distribution, il est possible que certaines touches fonctionnent déjà, mais je suis sur Debian Lenny, et ce n&#8217;est pas le cas. Pour &#8220;keycode 178 = XF86HomePage&#8221;, j&#8217;avoue que j&#8217;ai un doute. C&#8217;est une touche &#8220;Navigateur&#8221; mais je n&#8217;ai pas trouvé de code XF86WWW ou similaire dans /usr/share/X11/XKeysymDB.</p>
<h3>S’entraîner avec klavaro</h3>
<p>Puisque je débute, pas grand chose à dire sur klavaro (logiciel d&#8217;apprentissage de la saisie) si ce n&#8217;est un petit problème (et une solution) : il ne retenait pas ma langue ni mon choix de layout qu&#8217;il fallait donc définir à chaque lancement. Une solution simple qui marche : créer le dossier ~/.klavaro pour qu&#8217;il puisse y stocker vos préférences.</p>
<h3>Quelques remarques sur le clavier</h3>
<p>Les remarques suivantes font suite à une utilisation d&#8217;à peine quelques heures donc seront peut-être revues et corrigées dans quelques temps :</p>
<ul>
<li>la skin est un peu lâche. Elle tient bien sur le haut du clavier mais en bas, ça ne tient pas du tout&#8230; Du coup, on sent un flottement un peu curieux sur les touches du bas. On verra avec l&#8217;habitude.</li>
<li>quand on veut taper correctement (pas comme je fais en AZERTY, disposition apprise sur le tas), on sépara le clavier en deux : une moitié pour les doigts de la main gauche, et l&#8217;autre pour ceux de la droite. Les index s&#8217;occupent de deux colonnes de lettres chacun et sont donc assez mobiles. Sur un clavier classique, je pense qu&#8217;on a facilement tendance à déborder avec l&#8217;index gauche sur la zone de l&#8217;index droit et inversement. Le TypeMatrix empêche ça grâce à sa colonne centrale pour les touches Suppr., Entrée et Retour. Je trouve ça génial pour l&#8217;instant.</li>
<li>les touches en colonnes, ça me semble pas mal non plus. Quand on sait, par exemple, qu&#8217;une touche est deux rangées au-dessus d&#8217;une autre, il suffit d&#8217;avancer le doigt et on trouve automatiquement la touche. Avec un clavier classique, il faut avancer en diagonale (et pour la main gauche, pas dans le sens naturel) et c&#8217;est pas aussi évident. Je pense qu&#8217;on ne peut s&#8217;en rendre compte qu&#8217;en essayant. C&#8217;est pour l&#8217;instant l&#8217;élément que j&#8217;apprécie le plus sur le clavier.</li>
</ul>
<h3>Conclusion</h3>
<p>Pour l&#8217;instant, je n&#8217;ai que ces trucs techniques à partager, je ferais probablement un retour d&#8217;expérience sur la disposition bépo dans quelques semaines.</p>
<p>Pour ceux qui se posent la question, non, cet article n&#8217;est pas tapé en bépo mais cette dernière phrase oui ! Et sans regarder le clavier !</p>
]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2011/01/clavier-typematrix-bepo/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>[EN] Ext.ux.KeySequenceMap</title>
		<link>http://fcargoet.evolix.net/2011/01/en-ext-ux-keysequencemap/</link>
		<comments>http://fcargoet.evolix.net/2011/01/en-ext-ux-keysequencemap/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 19:37:27 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Ext JS]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=608</guid>
		<description><![CDATA[Here is a useless extension I wrote for fun : Ext.ux.KeySequenceMap. As its name suggests, it&#8217;s based on Ext.KeyMap and it handles sequences of keys instead of unique keys. Lecteur francophone : une version en français est disponible. Usage KeySequenceMap works almost the same way as KeyMap : KeyMap : Javascript is required to view [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a useless extension I wrote for fun : <em>Ext.ux.KeySequenceMap</em>. As its name suggests, it&#8217;s based on <a href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.KeyMap">Ext.KeyMap</a> and it handles sequences of keys instead of unique keys.</p>
<p><span id="more-608"></span></p>
<p><a class="lang-link lang-fr" href="http://fcargoet.evolix.net/2011/01/fr-ext-ux-keysequencemap/">Lecteur francophone : une version en français est disponible.</a></p>
<h3>Usage</h3>
<p><em>KeySequenceMap</em> works almost the same way as <em>KeyMap</em> :</p>
<p>KeyMap :</p>
<p><script src="https://gist.github.com/780062.js?file=KeyMap.js"></script> <noscript>Javascript is required to view the source code inline but you can also find it <a href="https://gist.github.com/780062">here</a>.</noscript></p>
<p>KeySequenceMap : </p>
<p><script src="https://gist.github.com/780062.js?file=KeySequenceMap.js"></script><noscript>Javascript is required to view the source code inline but you can also find it <a href="https://gist.github.com/780062">here</a>.</noscript></p>
<p>It&#8217;s the same excepted the key property which is now the sequence property.</p>
<h3>Demo</h3>
<p>Here is the <a href="http://fcargoet.evolix.net/demos/extjs/Ext.ux.KeySequenceMap/">Ext.ux.KeySequenceMap demo page</a> where you can enter cheat codes !</p>
<h3>Source code</h3>
<p>As usual, on Github : <a href="https://github.com/floriancargoet/Ext.ux.KeySequenceMap">Ext.ux.KeySequenceMap</a> under the GPLv3.</p>
]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2011/01/en-ext-ux-keysequencemap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[FR] Ext.ux.KeySequenceMap</title>
		<link>http://fcargoet.evolix.net/2011/01/fr-ext-ux-keysequencemap/</link>
		<comments>http://fcargoet.evolix.net/2011/01/fr-ext-ux-keysequencemap/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 19:36:55 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Ext JS]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=611</guid>
		<description><![CDATA[Voici une extension inutile (donc indispensable) que j&#8217;ai écrite pour m&#8217;amuser : Ext.ux.KeySequenceMap. Comme son nom l&#8217;indique, cette classe hérite de Ext.KeyMap et gère des séquences de touches plutôt que des touches uniques. English reader : an english version is available. Utilisation KeySequenceMap fonctionne quasiment de la même façon que KeyMap : KeyMap : Javascript [...]]]></description>
			<content:encoded><![CDATA[<p>Voici une extension inutile (donc indispensable) que j&#8217;ai écrite pour m&#8217;amuser : <em>Ext.ux.KeySequenceMap</em>. Comme son nom l&#8217;indique, cette classe hérite de <a href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.KeyMap">Ext.KeyMap</a> et gère des séquences de touches plutôt que des touches uniques.</p>
<p><span id="more-611"></span></p>
<p><a class="lang-link lang-en" href="http://fcargoet.evolix.net/2011/01/en-ext-ux-keysequencemap/">English reader : an english version is available.</a></p>
<h3>Utilisation</h3>
<p><em>KeySequenceMap</em> fonctionne quasiment de la même façon que <em>KeyMap</em> :</p>
<p>KeyMap :<br />
<script src="https://gist.github.com/780062.js?file=KeyMap.js"></script> <noscript>Javascript est nécessaire pour afficher le code source mais celui-ci est aussi disponible <a href="https://gist.github.com/780062">ici</a>.</noscript></p>
<p>KeySequenceMap :<br />
<script src="https://gist.github.com/780062.js?file=KeySequenceMap.js"></script><noscript>Javascript est nécessaire pour afficher le code source mais celui-ci est aussi disponible <a href="https://gist.github.com/780062">ici</a>.</noscript></p>
<p>C&#8217;est donc la même chose à part la propriété <em>key</em> qui devient <em>sequence</em>.</p>
<h3>Démo</h3>
<p>Vous pouvez tester tout ça en tapant des cheat codes sur la <a href="http://fcargoet.evolix.net/demos/extjs/Ext.ux.KeySequenceMap/">page de démonstration d&#8217;Ext.ux.KeySequenceMap</a> !</p>
<h3>Code source</h3>
<p>Comme d&#8217;habitude, sur Github : <a href="https://github.com/floriancargoet/Ext.ux.KeySequenceMap">Ext.ux.KeySequenceMap</a> sous licence  GPLv3.</p>
]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2011/01/fr-ext-ux-keysequencemap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell : pipe foireux ?</title>
		<link>http://fcargoet.evolix.net/2010/06/shell-pipe-foireux/</link>
		<comments>http://fcargoet.evolix.net/2010/06/shell-pipe-foireux/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 07:57:24 +0000</pubDate>
		<dc:creator>Florian Cargoet</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://fcargoet.evolix.net/?p=586</guid>
		<description><![CDATA[C&#8217;est peut-être quelque chose de très connu mais je viens seulement de comprendre pourquoi mon shell me dit parfois ça : ?View Code BASH% svn diff &#124; grep toto zsh: command not found:  grep WTF ? Il ne trouve pas grep ? En fait, c&#8217;est très bête comme problème : sur un clavier français, on fait [...]]]></description>
			<content:encoded><![CDATA[<p>C&#8217;est peut-être quelque chose de très connu mais je viens seulement de comprendre pourquoi mon shell me dit parfois ça :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p586code48'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p58648"><td class="code" id="p586code48"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">diff</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> toto
<span style="color: #c20cb9; font-weight: bold;">zsh</span>: <span style="color: #7a0874; font-weight: bold;">command</span> not found:  <span style="color: #c20cb9; font-weight: bold;">grep</span></pre></td></tr></table></div>

<p>WTF ? Il ne trouve pas <em>grep</em> ?</p>
<p>En fait, c&#8217;est très bête comme problème : sur un clavier français, on fait <em>Alt.Gr.+6</em> pour obtenir le pipe, et si on tape un peu vite, il arrive qu&#8217;on tape l&#8217;espace qui suit avant d&#8217;avoir relâché la touche <em>Alt.Gr.</em> ce qui donne une espace insécable au lieu d&#8217;une espace normale (<a href="http://forums.gentoo.org/viewtopic-p-6262504.html#6262504">apparemment</a>, c&#8217;est le cas pour le layout <em>fr-latin9</em>).</p>
<p>Or, par défaut, le séparateur de mots est l&#8217;espace normale donc le shell ne voit pas <em>&#8220;grep&#8221;</em> mais <em>&#8221; grep&#8221;</em> avec une espace insécable. D&#8217;où le<em> &#8220;command not found&#8221;</em>&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://fcargoet.evolix.net/2010/06/shell-pipe-foireux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
