<?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>Thomas Genin</title>
	<atom:link href="http://thomas-genin.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thomas-genin.com</link>
	<description>Follow the projects of a young engineer in CS</description>
	<lastBuildDate>Sat, 17 Mar 2012 04:57:11 +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>Behind the Expensify Chrome Extension</title>
		<link>http://thomas-genin.com/blog/google-chrome/behind-the-expensify-chrome-extension/</link>
		<comments>http://thomas-genin.com/blog/google-chrome/behind-the-expensify-chrome-extension/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 22:01:08 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Expensify]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[genin thomas]]></category>
		<category><![CDATA[ghostscript error: /undefined in cmapname]]></category>
		<category><![CDATA[Google Chrome Extension]]></category>
		<category><![CDATA[imagemagick convert bug font]]></category>
		<category><![CDATA[jQuery Badge plugin]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[Screenshot]]></category>
		<category><![CDATA[windows "Postscript delegate failed"]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=755</guid>
		<description><![CDATA[A few week ago we released a Google Chrome extension for Expensify. This extension is very simple: in one click you create a receipt from a webpage and send it to your Expensify account. The extension itself is cool, but &#8230; <a href="http://thomas-genin.com/blog/google-chrome/behind-the-expensify-chrome-extension/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few week ago we released a <a title="Expensify Google Chrome Extension" href="https://chrome.google.com/webstore/detail/oiicpdkmeclmgmlmbajefnkalcfageek" target="_blank">Google Chrome extension for Expensify</a>.</p>
<p>This extension is very simple: in one click you create a receipt from a webpage and send it to your Expensify account.</p>
<p>The extension itself is cool, but the process of creating it and its implication for Expensify is even better.</p>
<h2>Birth of the Extension</h2>
<p>Back in september, a user send an email to help@expensify.com, asking us if we have a Chrome Extension. At this time we didn&#8217;t, and we had no intention to have one. But it was a friday afternoon, and I was kind of bored so I decided to create the smallest extension possible: an icon in the new tab that open a new tab to the website when you click on it. My background of <a href="http://thomas-genin.com/resume/work-experience/ask-partner-network/">Toolbar developer</a> help me to do that in 5 min and I send an email to everybody: &#8220;Yes we have an extension&#8221;. The pandora box was open. Immediately I tried to do more: what about a popup with an iframe ? Kind of cool but also useless compare to the experience of the real website. We start to brainstorm and the idea of importing a receipt to Expensify directly from the page I&#8217;m seeing was awesome.</p>
<h2>Problem, how to solve the technical problem ?</h2>
<p>First idea: getting the source of the page and send that to Expensify to convert it into an image. Some program allow you to convert HTML into something else, so we could use them. But what about the auth, and the infrastructure work that it is implying ? Also getting the source is not that easy.</p>
<p>So while I was researching for this solution, I went back into the Google Chrome Extension docs, and I discover a new function, that was not available few months ago when I was working for APN.</p>
<p>The extension is mainly build around this method  <a title="captureVisibleTab" href="http://code.google.com/chrome/extensions/tabs.html#method-captureVisibleTab" target="_blank">captureVisibleTab</a>.</p>
<p>It returns a data image URL of the visible part of the current tab. Magical! In one call we get a perfect image, for no cost and very fast. Associate with some scrolling logic, content scripts, canvas, ajax, localStorage and our extension is there!</p>
<h2>Backend</h2>
<p>Now that we have our receipt, we still need to send it to Expensify. As you can imagine, we already had some kind of internal private API to upload an image from &#8220;outside&#8221;. Our mobile app need it!</p>
<p>But we still need to send the receipt to the account of the user using the extension. And this is where it is hard. We can not trust the Chrome Extension the same way we trust our mobile app. Any body can change the code and ship its own version. So we need to provide some kind of public API to authenticate a user and send a receipt to his account. And that&#8217;s how we decided to create the <a title="Expensify Scan Anywhere" href="http://blog.expensify.com/2012/02/13/expensify-leads-scananywhere-alliance-against-toxic-receipt-menace/">&#8220;Scan anywhere&#8221;</a> API.</p>
<h2>Public API</h2>
<p>We receive often request from people to get access to our API or if we have a public API. These people can be individual or working for a company that want to integrate with us.  Expensify used to have a public API, but for some reason, this API has been shutdown. So we decide to reopen a portion of it but with some refactoring in order to make reliable, scalable and available in the long run. We build a great security model and a cool UI/UX to allow people to sign in or register from the partner page.</p>
<p>I&#8217;m really proud of the result. It is working well, it is clear and fast. I&#8217;m sure there is few bugs ( send me an email if you found one ). If you like it, please leave a review on the Chrome Webstore page.</p>
Mots-cl&eacute;s: ghostscript error /undefined in CSI, expensify, tomas genin, animated popup in jquery, expensify javascript table]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/google-chrome/behind-the-expensify-chrome-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Expensify use localStorage</title>
		<link>http://thomas-genin.com/blog/javascript-3/why-expensify-use-localstorage/</link>
		<comments>http://thomas-genin.com/blog/javascript-3/why-expensify-use-localstorage/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 17:57:11 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[alias icon mac]]></category>
		<category><![CDATA[application icon png]]></category>
		<category><![CDATA[applications folder mac]]></category>
		<category><![CDATA[applications icon mac]]></category>
		<category><![CDATA[Expensify]]></category>
		<category><![CDATA[localStorage]]></category>
		<category><![CDATA[mac application folder icon]]></category>
		<category><![CDATA[mac application png]]></category>
		<category><![CDATA[mac folder icons]]></category>
		<category><![CDATA[mac folder icons apps]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=759</guid>
		<description><![CDATA[Recently in the JavaScript world, a lots of discussion have start regarding the localStorage API. People start to worry about the performance implication of relying heavily on localStorage to save network request ( especially caching files ). DOM localStorage considered &#8230; <a href="http://thomas-genin.com/blog/javascript-3/why-expensify-use-localstorage/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently in the JavaScript world, a lots of discussion have start regarding the localStorage API.</p>
<p>People start to worry about the performance implication of relying heavily on localStorage to save network request ( especially caching files ).</p>
<ul>
<li><a href="https://blog.mozilla.com/tglek/2012/02/22/psa-dom-local-storage-considered-harmful/">DOM localStorage considered harmful</a> by Taras Glek</li>
<li><a href="http://hacks.mozilla.org/2012/03/there-is-no-simple-solution-for-local-storage/">There is no simple solution for localStorage</a> by Chris Heilmann</li>
</ul>
<p>localStorage is a synchronous API doing file I/O. So if the computer is busy, the page is going to freeze, making the user experience not that great. This is a reality.</p>
<p>Some other blog post start to pop-up to defend localStorage, and do some benchmark to really measure what kind of &#8220;bad performance&#8221; we should expect.</p>
<ul>
<li><a href="http://www.webdirections.org/blog/localstorage-perhaps-not-so-harmful/">localStorage perhaps not so harmful</a> by John Allsopp</li>
<li><a href="http://www.nczonline.net/blog/2012/03/07/in-defense-of-localstorage/">In defense of localStorage</a> by Nicholas Zakas</li>
</ul>
<p>Both side are right, Taras and Chris were just trying to highlight the fact that localStorage is not the solution for everything and can have some limitation that a Web developer has to know before choosing to use the API.</p>
<p>As I explained in a <a title="localStorage at Expensify" href="http://thomas-genin.com/blog/web-performance/localstorage-ajax-query-cache/">previous post</a>, the Expensify website is now using heavily localStorage. When I design this feature, I haven&#8217;t thought of the problem that file I/O can creating bottleneck in this situation. For us, the problem was to reduce the number of API call has some of them are very slow. And it works. The average page load of the site has decrease. Expensify is still not a really fast website, but this solution has help to improve the situation.</p>
<p>Now, if I should rewrite this feature knowing its limitations, I would almost redo the same thing. As a first iteration, the code is simple and it helps a lot. If we have the opportunity to iterate on it to make it better, I will probably use the solution of Nicholas Zakas: using Web Workers to communicate with the localStorage. This solution will &#8220;restore&#8221; the full asynchronous of our &#8220;ajax request&#8221; and again improve performance.</p>
<p>But Web Workers are not available in the same amount of browser than localStorage. And it would be a fairly complex piece of code in order to avoid communication with the localStorage engine as much as possible.</p>
<p>&nbsp;</p>
Mots-cl&eacute;s: boost performance with localstorage javascript, expensify mac]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/javascript-3/why-expensify-use-localstorage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>localStorage ajax query cache</title>
		<link>http://thomas-genin.com/blog/web-performance/localstorage-ajax-query-cache/</link>
		<comments>http://thomas-genin.com/blog/web-performance/localstorage-ajax-query-cache/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 02:17:58 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Web Performance]]></category>
		<category><![CDATA[download icons folders mac]]></category>
		<category><![CDATA[Expensify]]></category>
		<category><![CDATA[folder icons mac]]></category>
		<category><![CDATA[icon paste music png]]></category>
		<category><![CDATA[icone mac]]></category>
		<category><![CDATA[localStorage]]></category>
		<category><![CDATA[mac application icon]]></category>
		<category><![CDATA[mac applications icon]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=740</guid>
		<description><![CDATA[At expensify, we have a lots of data. So we have lots of data to load on every page. So we use a lots of ajax request. Our site is not a single page site. So for every page we load &#8230; <a href="http://thomas-genin.com/blog/web-performance/localstorage-ajax-query-cache/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.w3.org/html/logo/"><img class="alignright" title="HTML5 Powered with Offline &amp; Storage" src="http://www.w3.org/html/logo/badge/html5-badge-h-storage.png" alt="HTML5 Powered with Offline &amp; Storage" width="133" height="64" /></a> At <a title="expense report that don't suck" href="https://www.expensify.com/">expensify</a>, we have a lots of data. So we have lots of data to load on every page. So we use a lots of ajax request.</p>
<p>Our site is not a single page site. So for every page we load the same data again and again. And that&#8217;s not find. First it is stupid, second it is making the website slower and finally it increase the load on our backend for no valid reason.</p>
<h2>localStorage for cache</h2>
<p>To store the data we will use the HTML5 localStorage. It is available almost on every browser ( IE8 included ). It is available across tab and you can store up to 5MB ( but far less in practice ). Also the API is very simple to use, it is fast, and you get easily debug the content of the cache with the Chrome Developer tools ( under the resources tab ).</p>
<div id="attachment_748" class="wp-caption aligncenter" style="width: 310px"><a href="http://thomas-genin.com/blog/web-performance/localstorage-ajax-query-cache/attachment/localstorage-content/" rel="attachment wp-att-748"><img class="size-medium wp-image-748" title="localStorage content" src="http://thomas-genin.com/wp-content/uploads/2012/02/localStorage-content-300x143.png" alt="localStorage content" width="300" height="143" /></a><p class="wp-caption-text">localStorage content</p></div>
<p>Some jQuery plugins have be written using localStorage to store ajax results. https://github.com/paulirish/jquery-ajax-localstorage-cache But we decided to not used them, not because we want to recreate the wheel but because the model used to invalidate the cache doesn&#8217;t work for us.</p>
<h2>Cache invalidation</h2>
<blockquote><p>There are only two hard things in Computer Science: cache invalidation and naming things — Phil Karlton</p></blockquote>
<p>For every cache system the most sensitive part if the algorithm which determined if the cache content is valid. With Expensify data, this task is very complex. Our data are heavily linked with each others ( receipts link to expenses on a report ). So in order to keep a simple code for our prototype, we decided that if  the user change ANYTHING, we will clear the whole cache. This is very inefficient in a &#8220;cache hit&#8221; point of view, but that way we are sure that what we are displaying is the correct version of the data.</p>
<p>So we know how to invalidate the cache if the user is doing an operation on the website. But what if he is using an other browser, computer or mobile device ?</p>
<p>For example, if you are on the receipt page with your computer and you use your <a title="Expensify mobile app" href="https://www.expensify.com/mobile/">Expensify mobile app</a> to take a picture of a receipt, the web page on the browser is refreshing itself automatically and will display the receipts after few seconds. We want to keep this functionality. So we need some way to know when the cache is becoming invalid because of the action of an &#8220;external&#8221; actor.</p>
<p>So we store on our server the date of the latest modification on an account. If anything happened which impact the account of the user, we update this value. So before we make any request, we ask the server to return this value. If the date is more recent that the one we have stored, our cache is not valid anymore, we need to clear it.</p>
<h2>Clear and performance</h2>
<p>To clear our cache, we use localStorage.clear().  So we delete everything. If the user add an expense, we clear the cache for receipts, reports, etc. Everything. It is dumb and not efficient for cache hits, but we are sure that we are not going to display out of date data. Also keep in mind that this system has been designed has a proof of concept to know if this kind of strategy could help our front end performance.</p>
<p>With the cache, we build a statistic system which will log on the server how many request has been done, how many cache hit, number of polling, etc. And we got the good surprised to see that around <strong>48%</strong> of the request were hitting the cache. For a stupid cache system like that it is a surprisingly good number.</p>
<p>In the future, we will improve these performances by creating a key-based cache expiration system. That we could delete only part of the cache instead of everything.</p>
Mots-cl&eacute;s: less local storage clear, localstorage ajax, store ajax request in localstorage, jquery how to invalidate locally cached page]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/web-performance/localstorage-ajax-query-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GhostScript Convert error /undefined in findresource</title>
		<link>http://thomas-genin.com/blog/command-line-2/ghostscript-convert-error-undefined-in-findresource/</link>
		<comments>http://thomas-genin.com/blog/command-line-2/ghostscript-convert-error-undefined-in-findresource/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 07:53:33 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA["undefined in findresource"]]></category>
		<category><![CDATA["undefined in findresource" windows]]></category>
		<category><![CDATA[awesome terminal icon]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[Error: /undefined in findresource]]></category>
		<category><![CDATA[ghostscript]]></category>
		<category><![CDATA[high res mac folder icon]]></category>
		<category><![CDATA[install ghostscript php#sclient=psy]]></category>
		<category><![CDATA[mac application icon]]></category>
		<category><![CDATA[winform Ghostscript conversion error]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=735</guid>
		<description><![CDATA[At my work I had to correct a bug related to the conversion of a PDF to a jpeg. To do that we use the convert command line tools from ImageMagick. The server which is doing the conversion run an &#8230; <a href="http://thomas-genin.com/blog/command-line-2/ghostscript-convert-error-undefined-in-findresource/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_736" class="wp-caption alignleft" style="width: 66px"><a href="http://thomas-genin.com/blog/command-line-2/ghostscript-convert-error-undefined-in-findresource/attachment/ghost64/" rel="attachment wp-att-736"><img class="size-full wp-image-736" title="Ghostscript Logo" src="http://thomas-genin.com/wp-content/uploads/2011/09/ghost64.gif" alt="Ghostscript Logo" width="56" height="64" /></a><p class="wp-caption-text">Ghostscript Logo</p></div>
<p>At my work I had to correct a bug related to the conversion of a PDF to a jpeg. To do that we use the convert command line tools from <a href="http://www.imagemagick.org/script/convert.php">ImageMagick</a>.</p>
<p>The server which is doing the conversion run an <strong>Ubuntu</strong> with the latest version of the package ghostscript ( 8.71).</p>
<p>Here is the error:</p>
<blockquote><p>11:04 1442 ~/Desktop : convert corrup1.pdf toto.jpg<br />
Error: /undefined in findresource<br />
Operand stack:<br />
&#8211;dict:8/17(L)&#8211; C2_1 1 &#8211;dict:5/5(L)&#8211; &#8211;dict:5/5(L)&#8211; Arial &#8211;dict:9/12(ro)(G)&#8211; &#8211;nostringval&#8211; CIDFontObject &#8211;dict:7/7(L)&#8211; &#8211;dict:7/7(L)&#8211; Adobe-Identity<br />
Execution stack:<br />
%interp_exit .runexec2 &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; 2 %stopped_push &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; false 1 %stopped_push 1878 1 3 %oparray_pop 1877 1 3 %oparray_pop 1861 1 3 %oparray_pop &#8211;nostringval&#8211; &#8211;nostringval&#8211; 2 1 1 &#8211;nostringval&#8211; %for_pos_int_continue &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; %array_continue &#8211;nostringval&#8211; false 1 %stopped_push &#8211;nostringval&#8211; %loop_continue &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; %array_continue &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; %loop_continue<br />
Dictionary stack:<br />
&#8211;dict:1161/1684(ro)(G)&#8211; &#8211;dict:1/20(G)&#8211; &#8211;dict:75/200(L)&#8211; &#8211;dict:75/200(L)&#8211; &#8211;dict:108/127(ro)(G)&#8211; &#8211;dict:288/300(ro)(G)&#8211; &#8211;dict:22/25(L)&#8211; &#8211;dict:6/8(L)&#8211; &#8211;dict:26/40(L)&#8211;<br />
Current allocation mode is local<br />
Last OS error: 2<br />
GPL Ghostscript 8.71: Unrecoverable error, exit code 1<br />
convert: Postscript delegate failed `corrup1.pdf&#8217;: No such file or directory @ pdf.c/ReadPDFImage/634.<br />
convert: missing an image filename `toto.jpg&#8217; @ convert.c/ConvertImageCommand/2838.</p></blockquote>
<p>Weird. A google of the <strong>Error: /undefined in findresource</strong> will lead you to <a href="http://bugs.ghostscript.com/show_bug.cgi?id=691345">this bug</a>.<br />
To sum up the installer of ghostscript is fucked up, and no new version of the package is deploy to solve it. Awesome.</p>
<p>ghostscript is not able to find a font ( Adobe-Identity ) and try to find a substitution font ( Arial ) but can&#8217;t find it.<br />
So let&#8217;s correct the configuration manually.</p>
<p>First make sur that you have install the <a href="http://web.nickshanks.com/fonts/microsoft-core-web-fonts">microsoft webfont</a> on your system.</p>
<p>Then we need to edit our cidmap which is the configuration file which tell ghostscript substitution font. Mine looks like after adding the last line:<br />
<strong>/var/lib/defoma/gs.d/dirs/fonts/cidfmap</strong></p>
<blockquote><p>1 /Dotum-Bold &lt;&lt; /FileType /TrueType /Path (/usr/share/fonts/truetype/unfonts/UnDotumBold.ttf) /SubfontID 0 /CSI [(Korea1) 0] &gt;&gt; ;<br />
2 /Batang-Regular &lt;&lt; /FileType /TrueType /Path (/usr/share/fonts/truetype/unfonts/UnBatang.ttf) /SubfontID 0 /CSI [(Korea1) 0] &gt;&gt; ;<br />
3 /Batang-Bold &lt;&lt; /FileType /TrueType /Path (/usr/share/fonts/truetype/unfonts/UnBatangBold.ttf) /SubfontID 0 /CSI [(Korea1) 0] &gt;&gt; ;<br />
4 /Dotum-Regular &lt;&lt; /FileType /TrueType /Path (/usr/share/fonts/truetype/unfonts/UnDotum.ttf) /SubfontID 0 /CSI [(Korea1) 0] &gt;&gt; ;<br />
<strong>5 /Arial &lt;&lt; /FileType /TrueType /Path (/usr/share/fonts/truetype/msttcorefonts/arial.ttf) /SubfontID 0 /CSI [(Artifex) (Unicode) 0] &gt;&gt; ;<strong> </strong></strong></p></blockquote>
<p>Make sur to use the correct path for the arial.ttf file.</p>
<p>Doing that produce a second error:</p>
<blockquote><p>1:16 1442 ~/Desktop : convert corrup1.pdf toto.jpg<br />
Can&#8217;t find CMap Identity-UTF16-H building a CIDDecoding resource.<br />
Error: /undefinedresource in findresource<br />
Operand stack:<br />
&#8211;dict:8/17(L)&#8211; C2_1 1 &#8211;dict:5/5(L)&#8211; &#8211;dict:5/5(L)&#8211; Arial &#8211;dict:9/12(ro)(G)&#8211; &#8211;nostringval&#8211; CIDFontObject &#8211;dict:7/7(L)&#8211; &#8211;dict:7/7(L)&#8211; Arial CIDFont true Arial false Arial &#8211;dict:23/26(G)&#8211; Unicode.Unicode CIDDecoding true Unicode.Unicode &#8211;dict:28/48(ro)(G)&#8211; Identity-UTF16-H<br />
Execution stack:<br />
%interp_exit .runexec2 &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; 2 %stopped_push &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; false 1 %stopped_push 1878 1 3 %oparray_pop 1877 1 3 %oparray_pop 1861 1 3 %oparray_pop &#8211;nostringval&#8211; &#8211;nostringval&#8211; 2 1 1 &#8211;nostringval&#8211; %for_pos_int_continue &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; %array_continue &#8211;nostringval&#8211; false 1 %stopped_push &#8211;nostringval&#8211; %loop_continue &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; %array_continue &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; %loop_continue &#8211;nostringval&#8211; &#8211;nostringval&#8211; 1829 13 9 %oparray_pop findresource %errorexec_pop &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; %loop_continue &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; 1829 20 10 %oparray_pop findresource %errorexec_pop &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; &#8211;nostringval&#8211; %array_continue &#8211;nostringval&#8211;<br />
Dictionary stack:<br />
&#8211;dict:1161/1684(ro)(G)&#8211; &#8211;dict:1/20(G)&#8211; &#8211;dict:75/200(L)&#8211; &#8211;dict:75/200(L)&#8211; &#8211;dict:108/127(ro)(G)&#8211; &#8211;dict:288/300(ro)(G)&#8211; &#8211;dict:22/25(L)&#8211; &#8211;dict:6/8(L)&#8211; &#8211;dict:26/40(L)&#8211; &#8211;dict:20/26(ro)(G)&#8211; &#8211;dict:18/25(ro)(G)&#8211; &#8211;dict:16/25(ro)(G)&#8211;<br />
Current allocation mode is global<br />
Last OS error: 2<br />
GPL Ghostscript 8.71: Unrecoverable error, exit code 1<br />
convert: Postscript delegate failed `corrup1.pdf&#8217;: No such file or directory @ pdf.c/ReadPDFImage/634.<br />
convert: missing an image filename `toto.jpg&#8217; @ convert.c/ConvertImageCommand/2838.</p></blockquote>
<p>The error is <strong>Can&#8217;t find CMap Identity-UTF16-H</strong>. Ghostscript can&#8217;t find this, so let&#8217;s create it !</p>
<p>Mine need to be created in <strong>/usr/share/ghostscript/8.71/Resource/CMap/Identity-UTF16-H</strong></p>
<p>The content of this file can be find <a href="http://www.amyuni.com/downloads/CMaps/Identity-UTF16-H">here</a>. Or copy it from here:</p>
<blockquote><p>% Copyright (C) 2003 Artifex Software. All rights reserved.<br />
%<br />
% This software is provided AS-IS with no warranty, either express or<br />
% implied.<br />
%<br />
% This software is distributed under license and may not be copied,<br />
% modified or distributed except as expressly authorized under the terms<br />
% of the license contained in the file LICENSE in this distribution.<br />
%<br />
% For more information about licensing, please refer to<br />
% http://www.ghostscript.com/licensing/. For information on<br />
% commercial licensing, go to http://www.artifex.com/licensing/ or<br />
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,<br />
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.<br />
%<br />
% $Id: Identity-UTF16-H 7095 2006-10-10 10:03:37Z leonardo $<br />
% Identity-UTF16-H CMap<br />
% An identity mapping of UTF16 codes to CIDs.</p>
<p>/CIDInit /ProcSet findresource begin</p>
<p>12 dict begin</p>
<p>begincmap</p>
<p>/CIDSystemInfo 3 dict dup begin<br />
/Registry (Artifex) def<br />
/Ordering (Unicode) def<br />
/Supplement 0 def<br />
end def</p>
<p>/CMapName /Identity-UTF16-H def<br />
/CMapVersion 1.000 def<br />
/CMapType 1 def</p>
<p>/UIDOffset 0 def<br />
% No XUID yet obtained.</p>
<p>/WMode 0 def</p>
<p>1 begincodespacerange</p>
<p>endcodespacerange</p>
<p>1 begincidrange<br />
0<br />
endcidrange<br />
endcmap<br />
CMapName currentdict /CMap defineresource pop<br />
end<br />
end</p>
<p>%%EndResource<br />
%%EOF</p></blockquote>
<p>And it is working !!! Woot !</p>
Mots-cl&eacute;s: postscript delegate failed no such file or directory @ error/pdf.c/, Error: /undefined in findresource, ghostscript nostringval, imagemagick can't find cmap identity-utf16-h building a ciddecoding resource., gpl ghostscript 8.71: unrecoverable error, exit code 1]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/command-line-2/ghostscript-convert-error-undefined-in-findresource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome : see thumbnail of your current tabs</title>
		<link>http://thomas-genin.com/blog/google-chrome/google-chrome-see-thumbnail-of-your-current-tabs/</link>
		<comments>http://thomas-genin.com/blog/google-chrome/google-chrome-see-thumbnail-of-your-current-tabs/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 22:02:19 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA["undefined in findresource" windows]]></category>
		<category><![CDATA[about: flag]]></category>
		<category><![CDATA[chrome tab thumbnail]]></category>
		<category><![CDATA[google chrome task thumbnail]]></category>
		<category><![CDATA[high res mac folder icon]]></category>
		<category><![CDATA[mac application icon]]></category>
		<category><![CDATA[thomas genin]]></category>
		<category><![CDATA[thumbnail]]></category>
		<category><![CDATA[what the mac applications folder looks like]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=726</guid>
		<description><![CDATA[Firefox 4 ship with the feature Tab Group ( previously Tab Candy ) which allow you to see and manage all your tabs in a smart and beautiful way. Google Chrome has the same feature since version 8 if I&#8217;m &#8230; <a href="http://thomas-genin.com/blog/google-chrome/google-chrome-see-thumbnail-of-your-current-tabs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_729" class="wp-caption alignleft" style="width: 160px"><a href="http://thomas-genin.com/blog/google-chrome/google-chrome-see-thumbnail-of-your-current-tabs/attachment/chrome-logo/" rel="attachment wp-att-729"><img src="http://thomas-genin.com/wp-content/uploads/2011/04/chrome-logo-150x150.png" alt="Google Chrome logo" title="Google Chrome logo" width="150" height="150" class="size-thumbnail wp-image-729" /></a><p class="wp-caption-text">Google Chrome logo</p></div>Firefox 4 ship with the feature Tab Group ( previously Tab Candy ) which allow you to see and manage all your tabs in a smart and beautiful way. </p>
<p>Google Chrome has the same feature since version 8 if I&#8217;m not wrong. you can see a thumbnail of your current tab and easily move to one with a smooth animation. But this feature is hidden and you need to turn a flag to enable it.<br />
<span id="more-726"></span><br />
To do that, write <strong>about:flags</strong> in your address bar.<br />
<div id="attachment_727" class="wp-caption aligncenter" style="width: 670px"><a href="http://thomas-genin.com/blog/google-chrome/google-chrome-see-thumbnail-of-your-current-tabs/attachment/chrome-flags/" rel="attachment wp-att-727"><img src="http://thomas-genin.com/wp-content/uploads/2011/04/chrome-flags.png" alt="Google Chrome about flags" title="Google Chrome about flags" width="660" height="366" class="size-full wp-image-727" /></a><p class="wp-caption-text">Google Chrome about flags</p></div></p>
<p>Then find and enable the <strong>Tab overview</strong> experiment. </p>
<p>Scroll down and click <strong>Relaunch Now</strong>.</p>
<p>That&#8217;s it ! Now use 3 fingers on your trackpad to use it !<br />
<div id="attachment_728" class="wp-caption aligncenter" style="width: 610px"><a href="http://thomas-genin.com/blog/google-chrome/google-chrome-see-thumbnail-of-your-current-tabs/attachment/chrome-tab-thumbnail/" rel="attachment wp-att-728"><img src="http://thomas-genin.com/wp-content/uploads/2011/04/chrome-tab-thumbnail.jpg" alt="Google Chrome Tab Thumbnail" title="Google Chrome Tab Thumbnail" width="600" height="479" class="size-full wp-image-728" /></a><p class="wp-caption-text">Google Chrome Tab Thumbnail</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/google-chrome/google-chrome-see-thumbnail-of-your-current-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>qunit and Rhino : JavaScript unit test in the console</title>
		<link>http://thomas-genin.com/blog/javascript-3/qunit-and-rhino-javascript-unit-test-in-the-console/</link>
		<comments>http://thomas-genin.com/blog/javascript-3/qunit-and-rhino-javascript-unit-test-in-the-console/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 02:25:02 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA["undefined in findresource" windows]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[high res mac folder icon]]></category>
		<category><![CDATA[mac application icon]]></category>
		<category><![CDATA[qunit]]></category>
		<category><![CDATA[rhino]]></category>
		<category><![CDATA[rhino to run qunit]]></category>
		<category><![CDATA[thomas genin]]></category>
		<category><![CDATA[unit test]]></category>
		<category><![CDATA[what the mac applications folder looks like]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=716</guid>
		<description><![CDATA[If you are wondering if it is possible to use qunit and rhino, the answer is : yes you can. download Rhino download qunit-cli download qunit Unzip every thing Go in your qunit directory, and copy the directory qunit and &#8230; <a href="http://thomas-genin.com/blog/javascript-3/qunit-and-rhino-javascript-unit-test-in-the-console/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are wondering if it is possible to use qunit and rhino, the answer is : yes you can.</p>
<ol>
<li><a href="http://www.mozilla.org/rhino/download.html">download Rhino</a></li>
<li><a href="https://github.com/benjaminplee/QUnit-CLI">download qunit-cli</a></li>
<li><a href="https://github.com/asynchrony/qunit">download qunit</a></li>
<li>Unzip every thing</li>
<li>Go in your qunit directory, and copy the directory <strong>qunit</strong> and <strong>test</strong></li>
<li>Paste them in qunit-cli/qunit</li>
<div id="attachment_720" class="wp-caption aligncenter" style="width: 166px"><a href="http://thomas-genin.com/wp-content/uploads/2011/04/qunit-directory-structure.png"><img class="size-full wp-image-720" title="qunit directory structure" src="http://thomas-genin.com/wp-content/uploads/2011/04/qunit-directory-structure.png" alt="qunit directory structure" width="156" height="271" /></a><p class="wp-caption-text">qunit directory structure</p></div>
<li>Now open your terminal / console and move into qunit-cli/rhino</li>
<li>Run the command to test that it is working</li>
<pre class="brush: bash; title: ; notranslate">
java -cp ../../rhino1_7R2/js.jar org.mozilla.javascript.tools.shell.Main -opt -1 suite.js
</pre>
<li>TADAAAA</li>
<p><div id="attachment_721" class="wp-caption aligncenter" style="width: 536px"><a href="http://thomas-genin.com/wp-content/uploads/2011/04/qunit-rhino-output.png"><img src="http://thomas-genin.com/wp-content/uploads/2011/04/qunit-rhino-output.png" alt="qunit rhino output" title="qunit rhino output" width="526" height="452" class="size-full wp-image-721" /></a><p class="wp-caption-text">qunit rhino output</p></div>
<li>Edit qunit-cli/rhino/suite.js to load your source files ( at the top ) and your test files ( at the bottom )</li>
</ol>
<p>You can also change the formating of the output by editing the suite.js file and using the <a href="http://docs.jquery.com/Qunit#Integration_into_Browser_Automation_Tools">right functions</a>.</p>
<p>Note:<br />
You should consider the creation of an alias to run the command :</p>
<pre class="brush: bash; title: ; notranslate">
export RHINO_HOME=&quot;~/development/rhino1_7R2&quot;
alias js=&quot;java -cp $RHINO_HOME/js.jar org.mozilla.javascript.tools.shell.Main -opt -1&quot;
alias jsd=&quot;java -cp $RHINO_HOME/js.jar org.mozilla.javascript.tools.debugger.Main&quot;
</pre>
<p>Links:<br />
<a href="http://twoguysarguing.wordpress.com/2010/11/02/make-javascript-tests-part-of-your-build-qunit-rhino/">http://twoguysarguing.wordpress.com/2010/11/02/make-javascript-tests-part-of-your-build-qunit-rhino/</a><br />
<a href="https://github.com/asynchrony/qunit">https://github.com/asynchrony/qunit</a><br />
<a href="https://github.com/benjaminplee/QUnit-CLI">https://github.com/benjaminplee/QUnit-CLI</a><br />
<a href="http://www.mozilla.org/rhino/download.html">http://www.mozilla.org/rhino/download.html</a><br />
<a href="http://docs.jquery.com/Qunit">http://docs.jquery.com/Qunit</a></p>
Mots-cl&eacute;s: qunit rhino, junit qunit rhino, qunit terminal, rhino unit testing, qunit console runner]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/javascript-3/qunit-and-rhino-javascript-unit-test-in-the-console/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery conf 2011 San Francisco</title>
		<link>http://thomas-genin.com/blog/jquery/jquery-conf-2011-san-francisco/</link>
		<comments>http://thomas-genin.com/blog/jquery/jquery-conf-2011-san-francisco/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 19:40:14 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA["undefined in findresource" windows]]></category>
		<category><![CDATA[high res mac folder icon]]></category>
		<category><![CDATA[jQuery conf]]></category>
		<category><![CDATA[JQuery картинки]]></category>
		<category><![CDATA[mac application icon]]></category>
		<category><![CDATA[program icon mac]]></category>
		<category><![CDATA[review thomas genin]]></category>
		<category><![CDATA[thomas genin]]></category>
		<category><![CDATA[what the mac applications folder looks like]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=712</guid>
		<description><![CDATA[I was there. It was ok. Some great talks and some other less good ( no offense ). Mots-cl&#233;s: jquery tshirt, jquery t-shirt, jquery conference]]></description>
			<content:encoded><![CDATA[<div id="attachment_714" class="wp-caption aligncenter" style="width: 650px"><a href="http://thomas-genin.com/wp-content/uploads/2011/04/jquery-conf-2011-gift-bag.jpg"><img src="http://thomas-genin.com/wp-content/uploads/2011/04/jquery-conf-2011-gift-bag-1024x765.jpg" alt="jQuery conference San Francisco 2011 badge and Tshirt" title="jQuery conference San Francisco 2011 badge and Tshirt" width="640" height="478" class="size-large wp-image-714" /></a><p class="wp-caption-text">jQuery conference San Francisco 2011 badge and Tshirt</p></div>
<p>I was there. It was ok. Some great talks and some other less good ( no offense ). </p>
Mots-cl&eacute;s: jquery tshirt, jquery t-shirt, jquery conference]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/jquery/jquery-conf-2011-san-francisco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Google Chrome toolbar</title>
		<link>http://thomas-genin.com/blog/google-chrome/a-google-chrome-toolbar/</link>
		<comments>http://thomas-genin.com/blog/google-chrome/a-google-chrome-toolbar/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 08:36:57 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA["undefined in findresource" windows]]></category>
		<category><![CDATA[app icon mac]]></category>
		<category><![CDATA[folder icon mac unzip]]></category>
		<category><![CDATA[Google Chrome Extension]]></category>
		<category><![CDATA[high res mac folder icon]]></category>
		<category><![CDATA[mac application icon]]></category>
		<category><![CDATA[program icon mac]]></category>
		<category><![CDATA[review thomas genin]]></category>
		<category><![CDATA[thomas genin]]></category>
		<category><![CDATA[what the mac applications folder looks like]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=707</guid>
		<description><![CDATA[When you build a Google Chrome extension, you have only 2 UI hooks. The browser action on the top right corner of the browser. Or the page action at the right of the address bar So how can you create &#8230; <a href="http://thomas-genin.com/blog/google-chrome/a-google-chrome-toolbar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When you build a Google Chrome extension, you have only 2 UI hooks.</p>
<p>The browser action on the top right corner of the browser.<br />
<div id="attachment_708" class="wp-caption aligncenter" style="width: 373px"><a href="http://thomas-genin.com/blog/google-chrome/a-google-chrome-toolbar/attachment/browser-action/" rel="attachment wp-att-708"><img src="http://thomas-genin.com/wp-content/uploads/2011/03/browser-action.png" alt="Browser Action icon" title="Browser Action icon" width="363" height="226" class="size-full wp-image-708" /></a><p class="wp-caption-text">Browser Action icon</p></div></p>
<p>Or the page action at the right of the address bar<br />
<div id="attachment_709" class="wp-caption aligncenter" style="width: 371px"><a href="http://thomas-genin.com/wp-content/uploads/2011/03/page-action.png"><img src="http://thomas-genin.com/wp-content/uploads/2011/03/page-action.png" alt="Page Action icon" title="Page Action icon" width="361" height="79" class="size-full wp-image-709" /></a><p class="wp-caption-text">Page Action icon</p></div></p>
<p>So how can you create a toolbar ?</p>
<p>Well Google Chrome provide you &#8220;<a href="http://code.google.com/chrome/extensions/content_scripts.html">content scripts</a>&#8220;. These scripts are running in the parallel of the page. So this script can manipulate the DOM of the page. So we can inject something in the page. And if this something is an iframe, we could inject a &#8220;page&#8221; without worrying about JavaScript or CSS collision. And this iframe can be host on a server or in the extension. In this case you can use the c<a href="http://code.google.com/chrome/extensions/extension.html#method-getURL">hrome.extension.getURL</a> method to get the path of the file.</p>
<p>Et voilà !</p>
]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/google-chrome/a-google-chrome-toolbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Giant Table is dead, long live jQuery UI !</title>
		<link>http://thomas-genin.com/blog/jquery/giant-table-is-dead-long-live-jquery-ui/</link>
		<comments>http://thomas-genin.com/blog/jquery/giant-table-is-dead-long-live-jquery-ui/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 08:19:57 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA["undefined in findresource" windows]]></category>
		<category><![CDATA[giant table]]></category>
		<category><![CDATA[high res mac folder icon]]></category>
		<category><![CDATA[is jquery ui dead]]></category>
		<category><![CDATA[jquery for long tables]]></category>
		<category><![CDATA[jquery ui]]></category>
		<category><![CDATA[jqueryui display: table]]></category>
		<category><![CDATA[logo jquery ui]]></category>
		<category><![CDATA[mac application icon]]></category>
		<category><![CDATA[what the mac applications folder looks like]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=687</guid>
		<description><![CDATA[Hey, Last week, the jQuery UI team made a great announcement : they are finally going to include into the core a plugin to do table manipulation. http://blog.jqueryui.com/2011/02/unleash-the-grid/ I did in the past a jQuery plugin to do that. Here &#8230; <a href="http://thomas-genin.com/blog/jquery/giant-table-is-dead-long-live-jquery-ui/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hey,<br />
<div id="attachment_688" class="wp-caption alignleft" style="width: 160px"><a href="http://thomas-genin.com/blog/jquery/giant-table-is-dead-long-live-jquery-ui/attachment/jquery__ui_logo_color_onwhite/" rel="attachment wp-att-688"><img src="http://thomas-genin.com/wp-content/uploads/2011/02/jQuery__UI_logo_color_onwhite-150x108.png" alt="jQuery UI logo" title="jQuery UI logo" width="150" height="108" class="size-thumbnail wp-image-688" /></a><p class="wp-caption-text">jQuery UI logo</p></div><br />
Last week, the jQuery UI team made a great announcement : they are finally going to include into the core a plugin to do table manipulation.<br />
<a href="http://blog.jqueryui.com/2011/02/unleash-the-grid/">http://blog.jqueryui.com/2011/02/unleash-the-grid/</a></p>
<p>I did in the past a jQuery plugin to do that. Here is the problem I tried to solve: when you have an HTML table with thousand of lines, it is very long to display, instable, impossible to search or to sort element. Even plugins like http://tablesorter.com/docs/ can&#8217;t do th job when you have 10 000 lines. Or they use a pager which give a bad user experience.</p>
<p>So tried to solve this problem and I succeed. Instead of displaying every thing, I keep the data in an array in the memory. Every operation will be done on this array : sorting, filtering, search, selection, &#8230;<br />
And I just display the number of row that the screen can display.<br />
I check every scroll event or action on the fake scrollbar I have create to update the display.</p>
<p>And it works well with 90 000 lines !!! \o/</p>
<p>My plugin also support plugins to change the behavior or to customize the display. </p>
<p>But I&#8217;m sur the jQuery team is going to do something awesome ! Be sur that I will look at their progress very closely and try to be involve into this.</p>
Mots-cl&eacute;s: jquery css table ui, get thead table with jquery, is jquery ui dead]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/jquery/giant-table-is-dead-long-live-jquery-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS Terminal &#8211; How to easily repeat a command with sudo</title>
		<link>http://thomas-genin.com/blog/mac-os/mac-os-terminal/how-to-repeat-a-command/</link>
		<comments>http://thomas-genin.com/blog/mac-os/mac-os-terminal/how-to-repeat-a-command/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 05:41:12 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[Mac OS Terminal]]></category>
		<category><![CDATA["undefined in findresource" windows]]></category>
		<category><![CDATA[app icon mac]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[high res mac folder icon]]></category>
		<category><![CDATA[mac application icon]]></category>
		<category><![CDATA[program icon mac]]></category>
		<category><![CDATA[redo]]></category>
		<category><![CDATA[review thomas genin]]></category>
		<category><![CDATA[thomas genin]]></category>
		<category><![CDATA[what the mac applications folder looks like]]></category>

		<guid isPermaLink="false">http://thomas-genin.com/?p=676</guid>
		<description><![CDATA[Very often, you need to repeat the previous command but with more parameters, or to use sudo. Look at this example: I want to delete a file, but it own by an other user. I&#8217;m sur that I can delete &#8230; <a href="http://thomas-genin.com/blog/mac-os/mac-os-terminal/how-to-repeat-a-command/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_648" class="wp-caption alignleft" style="width: 160px"><a href="http://thomas-genin.com/blog/mac-os/mac-os-terminal/mac-os-terminal-copy-output-of-a-command-directly-to-the-clipboard/attachment/terminal/" rel="attachment wp-att-648"><img src="http://thomas-genin.com/wp-content/uploads/2010/12/Terminal-150x150.png" alt="Terminal icon" title="Terminal icon" width="150" height="150" class="size-thumbnail wp-image-648" /></a><p class="wp-caption-text">Terminal icon</p></div> Very often, you need to repeat the previous command but with more parameters, or to use sudo.</p>
<p>Look at this example: I want to delete a file, but it own by an other user.<br />
<div id="attachment_680" class="wp-caption aligncenter" style="width: 610px"><a href="http://thomas-genin.com/blog/mac-os/mac-os-terminal/how-to-repeat-a-command/attachment/rm/" rel="attachment wp-att-680"><img src="http://thomas-genin.com/wp-content/uploads/2011/01/rm.jpg" alt="rm delete a file" title="rm delete a file" width="600" height="272" class="size-full wp-image-680" /></a><p class="wp-caption-text">rm delete a file</p></div></p>
<p>I&#8217;m sur that I can delete the file, so I have to use the <strong>sudo</strong> command before the <strong>rm</strong> command.<br />
<span id="more-676"></span><br />
So I have 2 solutions: </p>
<ul>
<li>write <strong>sudo rm mysql.sock</strong> = equal rewrite evereything</li>
<li> write <strong> sudo !!</strong> = use a shortcut !!</li>
</ul>
<p>Of course you choose the second solution: it &#8216;s quicker and you don&#8217;t make any mistake by retyping the command. So <strong>!!</strong> contain the last command you wrote. Let&#8217;s see in action:<br />
<div id="attachment_677" class="wp-caption aligncenter" style="width: 545px"><a href="http://thomas-genin.com/blog/mac-os/mac-os-terminal/how-to-repeat-a-command/attachment/677/" rel="attachment wp-att-677"><img src="http://thomas-genin.com/wp-content/uploads/2011/01/jpg" alt="!! contain the last command" title="!! contain the last command" width="535" height="153" class="size-full wp-image-677" /></a><p class="wp-caption-text">!! contain the last command</p></div></p>
<p>And I works also if you want to add a parameter. I will use the example of the command <strong>ls</strong> which list the content of a directoy.<br />
<div id="attachment_678" class="wp-caption aligncenter" style="width: 576px"><a href="http://thomas-genin.com/blog/mac-os/mac-os-terminal/how-to-repeat-a-command/attachment/ls/" rel="attachment wp-att-678"><img src="http://thomas-genin.com/wp-content/uploads/2011/01/ls.jpg" alt="ls list the content of a directory" title="ls list the content of a directory" width="566" height="367" class="size-full wp-image-678" /></a><p class="wp-caption-text">ls list the content of a directory</p></div></p>
<p>I the screenshot, I used <strong>ls</strong> then <strong>!! -a</strong> = ls -a to list all the file of the directory, Then<br />
<div id="attachment_679" class="wp-caption aligncenter" style="width: 530px"><a href="http://thomas-genin.com/blog/mac-os/mac-os-terminal/how-to-repeat-a-command/attachment/ls-l-a/" rel="attachment wp-att-679"><img src="http://thomas-genin.com/wp-content/uploads/2011/01/ls-l-a.jpg" alt="ls -l -a list all file of a directory with more information" title="ls -l -a list all file of a directory with more information" width="520" height="436" class="size-full wp-image-679" /></a><p class="wp-caption-text">ls -l -a list all file of a directory with more information</p></div></p>
<p><strong>!! -l</strong> = ls -a -l = ls -al </p>
<p>So this shortcut is very handy when you have long command to repeat.</p>
Mots-cl&eacute;s: mac os terminal, mac os dir command terminal, mac terminal icon]]></content:encoded>
			<wfw:commentRss>http://thomas-genin.com/blog/mac-os/mac-os-terminal/how-to-repeat-a-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

