updated yesod intro
This commit is contained in:
parent
9c09c371dc
commit
186d5364dc
8 changed files with 874 additions and 877 deletions
|
@ -20,8 +20,7 @@ begindiv(intro)
|
|||
%tldr
|
||||
|
||||
|
||||
[Yesod](http://www.yesodweb.com) is a web framework which recently reached the maturity for which you should consider to use it.
|
||||
Before telling you why you should learn Haskell and use yesod, I will talk about ideas yesod introduced and I didn't saw in other frameworks before.
|
||||
[Yesod](http://www.yesodweb.com) is a framework which has recently matured to the point where you should consider using it. Before telling you why you should learn Haskell and use Yesod, I will illustrate the many features Yesod introduces which are missing in other frameworks.
|
||||
|
||||
enddiv
|
||||
|
||||
|
|
|
@ -22,8 +22,7 @@ en: %tldr
|
|||
|
||||
fr: %tlal
|
||||
|
||||
en: [Yesod](http://www.yesodweb.com) is a web framework which recently reached the maturity for which you should consider to use it.
|
||||
en: Before telling you why you should learn Haskell and use yesod, I will talk about ideas yesod introduced and I didn't saw in other frameworks before.
|
||||
en: [Yesod](http://www.yesodweb.com) is a framework which has recently matured to the point where you should consider using it. Before telling you why you should learn Haskell and use Yesod, I will illustrate the many features Yesod introduces which are missing in other frameworks.
|
||||
fr: Cela fait un moment que je suis la progression du [framework yesod](http://www.yesodweb.com).
|
||||
fr: À mon humble avis on peut commencer à l'utiliser pour des applications sérieuses (comprendre en prod).
|
||||
fr: Avant de vous dire pourquoi vous devriez aussi le considérer, je préfère vous parler de bonnes idées (parmi d'autres) introduites par yesod que je n'avais jamais vu ailleurs.
|
||||
|
|
|
@ -72,7 +72,7 @@ Imperative language could also benefit from this functional organization.</p>
|
|||
<ul id="markdown-toc">
|
||||
<li><a href="#introduction">Introduction</a></li>
|
||||
<li><a href="#first-version">First version</a> <ul>
|
||||
<li><a href="#lets-play-the-song-of-our-people">Let’s play the song of our people</a></li>
|
||||
<li><a href="#lets-play-the-song-of-our-people">Let’s play the song of our people</a></li>
|
||||
<li><a href="#let-us-start">Let us start</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -157,7 +157,7 @@ We start cleaning the code at the 5<sup>th</sup> section.</p>
|
|||
The first being mostly some boilerplate<sup id="fnref:011"><a href="#fn:011" rel="footnote">2</a></sup>.
|
||||
And the second part more focused on OpenGL and content.</p>
|
||||
|
||||
<h3 id="lets-play-the-song-of-our-people">Let’s play the song of our people</h3>
|
||||
<h3 id="lets-play-the-song-of-our-people">Let’s play the song of our people</h3>
|
||||
|
||||
<div class="codehighlight">
|
||||
|
||||
|
@ -393,7 +393,7 @@ It is a bit long before the first image appears, but if you resize the window, i
|
|||
This property is a direct consequence of purity.
|
||||
If you look closely, you see that <code>allPoints</code> is a pure list.
|
||||
Therefore, calling <code>allPoints</code> will always render the same result and Haskell is clever enough to use this property.
|
||||
While Haskell doesn’t garbage collect <code>allPoints</code> the result is reused for free.
|
||||
While Haskell doesn’t garbage collect <code>allPoints</code> the result is reused for free.
|
||||
We did not specified this value should be saved for later use.
|
||||
It is saved for us.</p>
|
||||
|
||||
|
@ -631,7 +631,7 @@ instead of using a 3D projection of quaternions.
|
|||
I am pretty sure this construction is not useful for numbers.
|
||||
But it will be enough for us to create something that look nice.</p>
|
||||
|
||||
<p>This section is quite long, but don’t be afraid,
|
||||
<p>This section is quite long, but don’t be afraid,
|
||||
most of the code is some OpenGL boilerplate.
|
||||
If you just want to skim this section,
|
||||
here is a high level representation:</p>
|
||||
|
@ -647,7 +647,7 @@ here is a high level representation:</p>
|
|||
<p>Drawing: </p>
|
||||
|
||||
<ul>
|
||||
<li>set doubleBuffer, handle depth, window size…</li>
|
||||
<li>set doubleBuffer, handle depth, window size…</li>
|
||||
<li>Use state to apply some transformations</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -903,7 +903,7 @@ Mainly there are two parts: apply some transformations, draw the object.</p>
|
|||
|
||||
<h3 id="the-3d-mandelbrot">The 3D Mandelbrot</h3>
|
||||
|
||||
<p>We have finished with the OpenGL section, let’s talk about how we
|
||||
<p>We have finished with the OpenGL section, let’s talk about how we
|
||||
generate the 3D points and colors.
|
||||
First, we will set the number of details to 200 pixels in the three dimensions.</p>
|
||||
|
||||
|
@ -1017,7 +1017,7 @@ depthPoints = do
|
|||
|
||||
<p>If you prefer the first version, then just imagine how hard it will be to change the enumeration of the point from (x,y) to (x,z) for example.</p>
|
||||
|
||||
<p>Also, we didn’t searched for negative values.
|
||||
<p>Also, we didn’t searched for negative values.
|
||||
This modified Mandelbrot is no more symmetric relatively to the plan <code>y=0</code>.
|
||||
But it is symmetric relatively to the plan <code>z=0</code>.
|
||||
Then I mirror these values. </p>
|
||||
|
@ -1242,7 +1242,7 @@ ymandel x y z = mandel (2*x/width) (2*y/height) (2*z/deep) 64
|
|||
|
||||
</div>
|
||||
|
||||
<p>This code is cleaner but many things doesn’t feel right.
|
||||
<p>This code is cleaner but many things doesn’t feel right.
|
||||
First, all the user interaction code is outside our main file.
|
||||
I feel it is okay to hide the detail for the rendering.
|
||||
But I would have preferred to control the user actions.</p>
|
||||
|
@ -1276,12 +1276,12 @@ We will have two choices: </p>
|
|||
</li>
|
||||
<li>
|
||||
<p>Our main problem come from user interaction.
|
||||
If you ask “the Internet”,
|
||||
If you ask “the Internet”,
|
||||
about how to deal with user interaction with a functional paradigm,
|
||||
the main answer is to use <em>functional reactive programming</em> (FRP).
|
||||
I won’t use FRP in this article.
|
||||
Instead, I’ll use a simpler while less effective way to deal with user interaction.
|
||||
But The method I’ll use will be as pure and functional as possible.</p>
|
||||
I won’t use FRP in this article.
|
||||
Instead, I’ll use a simpler while less effective way to deal with user interaction.
|
||||
But The method I’ll use will be as pure and functional as possible.</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
|
@ -1303,7 +1303,7 @@ First, what the main loop should look like if we could make our own:</p>
|
|||
<li>a function taking two parameters: time and world state and render a new world without user interaction.</li>
|
||||
</ul>
|
||||
|
||||
<p>Here is a real working code, I’ve hidden most display functions.
|
||||
<p>Here is a real working code, I’ve hidden most display functions.
|
||||
The YGL, is a kind of framework to display 3D functions.
|
||||
But it can easily be extended to many kind of representation.</p>
|
||||
|
||||
|
@ -1523,7 +1523,7 @@ idleAction tnew world = world {
|
|||
<p>Now the function which will generate points in 3D.
|
||||
The first parameter (<code>res</code>) is the resolution of the vertex generation.
|
||||
More precisely, <code>res</code> is distance between two points on one direction.
|
||||
We need it to “close” our shape.</p>
|
||||
We need it to “close” our shape.</p>
|
||||
|
||||
<p>The type <code>Function3D</code> is <code>Point -> Point -> Maybe Point</code>.
|
||||
Because we consider partial functions
|
||||
|
@ -1592,7 +1592,7 @@ ymandel x y z = fromIntegral (mandel x y z 64) / 64
|
|||
|
||||
</div>
|
||||
|
||||
<p>I won’t explain how the magic occurs here.
|
||||
<p>I won’t explain how the magic occurs here.
|
||||
If you are interested, just read the file <a href="code/05_Mandelbulb/YGL.hs"><code>YGL.hs</code></a>.
|
||||
It is commented a lot.</p>
|
||||
|
||||
|
@ -1612,8 +1612,8 @@ It is commented a lot.</p>
|
|||
<p>Our code architecture feel very clean.
|
||||
All the meaningful code is in our main file and all display details are
|
||||
externalized.
|
||||
If you read the code of <code>YGL.hs</code>, you’ll see I didn’t made everything perfect.
|
||||
For example, I didn’t finished the code of the lights.
|
||||
If you read the code of <code>YGL.hs</code>, you’ll see I didn’t made everything perfect.
|
||||
For example, I didn’t finished the code of the lights.
|
||||
But I believe it is a good first step and it will be easy to go further.
|
||||
Unfortunately the program of the preceding session is extremely slow.
|
||||
We compute the Mandelbulb for each frame now.</p>
|
||||
|
@ -1897,20 +1897,20 @@ ymandel x y z = fromIntegral (mandel x y z 64) / 64
|
|||
<p>As we can use imperative style in a functional language,
|
||||
know you can use functional style in imperative languages.
|
||||
This article exposed a way to organize some code in a functional way.
|
||||
I’d like to stress the usage of Haskell made it very simple to achieve this.</p>
|
||||
I’d like to stress the usage of Haskell made it very simple to achieve this.</p>
|
||||
|
||||
<p>Once you are used to pure functional style,
|
||||
it is hard not to see all advantages it offers.</p>
|
||||
|
||||
<p>The code in the two last sections is completely pure and functional.
|
||||
Furthermore I don’t use <code>GLfloat</code>, <code>Color3</code> or any other OpenGL type.
|
||||
Furthermore I don’t use <code>GLfloat</code>, <code>Color3</code> or any other OpenGL type.
|
||||
If I want to use another library in the future,
|
||||
I would be able to keep all the pure code and simply update the YGL module.</p>
|
||||
|
||||
<p>The <code>YGL</code> module can be seen as a “wrapper” around 3D display and user interaction.
|
||||
<p>The <code>YGL</code> module can be seen as a “wrapper” around 3D display and user interaction.
|
||||
It is a clean separator between the imperative paradigm and functional paradigm.</p>
|
||||
|
||||
<p>If you want to go further, it shouldn’t be hard to add parallelism.
|
||||
<p>If you want to go further, it shouldn’t be hard to add parallelism.
|
||||
This should be easy mainly because most of the visible code is pure.
|
||||
Such an optimization would have been harder by using directly the OpenGL library.</p>
|
||||
|
||||
|
@ -1920,7 +1920,7 @@ O(n².log(n)) to O(n³).</p>
|
|||
<hr/><div class="footnotes">
|
||||
<ol>
|
||||
<li id="fn:001">
|
||||
<p>Unfortunately, I couldn’t make this program to work on my Mac. More precisely, I couldn’t make the <a href="http://openil.sourceforge.net/">DevIL</a> library work on Mac to output the image. Yes I have done a <code>brew install libdevil</code>. But even a minimal program who simply write some <code>jpg</code> didn’t worked. I tried both with <code>Haskell</code> and <code>C</code>.<a href="#fnref:001" rel="reference">↩</a></p>
|
||||
<p>Unfortunately, I couldn’t make this program to work on my Mac. More precisely, I couldn’t make the <a href="http://openil.sourceforge.net/">DevIL</a> library work on Mac to output the image. Yes I have done a <code>brew install libdevil</code>. But even a minimal program who simply write some <code>jpg</code> didn’t worked. I tried both with <code>Haskell</code> and <code>C</code>.<a href="#fnref:001" rel="reference">↩</a></p>
|
||||
</li>
|
||||
<li id="fn:011">
|
||||
<p>Generally in Haskell you need to declare a lot of import lines.
|
||||
|
|
|
@ -104,7 +104,7 @@ Imperative language could also benefit from this functional organization.</p&
|
|||
<div class="intro">
|
||||
|
||||
|
||||
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> Web typography sucks and we&rsquo;ll have to wait forever before it will be fixed.</p>
|
||||
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> Web typography sucks and we&#8217;ll have to wait forever before it will be fixed.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -141,7 +141,7 @@ We can all create better web typography ourselves, today.»</p>
|
|||
|
||||
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> A simple yesod tutorial.
|
||||
Yesod is a Haskell web framework.
|
||||
You shouldn&rsquo;t need to know Haskell. </p>
|
||||
You shouldn&#8217;t need to know Haskell. </p>
|
||||
|
||||
<blockquote>
|
||||
<center><span class="sc"><b>Table of content</b></span></center>
|
||||
|
@ -203,8 +203,7 @@ Then some believed it would be a good idea to invent many <span class="sc">
|
|||
|
||||
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span></p>
|
||||
|
||||
<p><a href="http://www.yesodweb.com">Yesod</a> is a web framework which recently reached the maturity for which you should consider to use it.
|
||||
Before telling you why you should learn Haskell and use yesod, I will talk about ideas yesod introduced and I didn&rsquo;t saw in other frameworks before.</p>
|
||||
<p><a href="http://www.yesodweb.com">Yesod</a> is a framework which has recently matured to the point where you should consider using it. Before telling you why you should learn Haskell and use Yesod, I will illustrate the many features Yesod introduces which are missing in other frameworks.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -212,11 +211,11 @@ Before telling you why you should learn Haskell and use yesod, I will talk about
|
|||
|
||||
<h2 id="type-safety">Type safety</h2>
|
||||
|
||||
<p>Let&rsquo;s start by an obligatory link from <a href="http://xkcd.com">xkcd</a>:</p>
|
||||
<p>Let&#8217;s start by an obligatory link from <a href="http://xkcd.com">xkcd</a>:</p>
|
||||
|
||||
<img src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png" alt="SQL injection by a mom" />
|
||||
|
||||
<p>When you create a web application, a lot of time is spent dealing with ...</p></img></img></content>
|
||||
<p>When you create a web application, a lot of time is spent dealing with strin...</p></img></img></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2011-09-28:/Scratch/en/blog/Higher-order-function-in-zsh/</id>
|
||||
|
@ -327,7 +326,7 @@ It is not even good to learn programming...</p></img></img></c
|
|||
</blockquote>
|
||||
|
||||
<p>Learn <a href="http://www.vim.org">vim</a> and it will be your last text editor.
|
||||
There isn&rsquo;t any better text editor that I know of.
|
||||
There isn&#8217;t any better text editor that I know of.
|
||||
It is hard to learn, but incredible to use.</p>
|
||||
|
||||
<p>I suggest you teach yourself ...</p></img></content>
|
||||
|
@ -413,9 +412,9 @@ I use a different password on all website.</p>
|
|||
|
||||
|
||||
<p>Disclamer, this is an unashamed attempt to make you download my iPhone app&nbsp;;-).
|
||||
You&rsquo;re always here?
|
||||
Even if you won&rsquo;t download my app, you should read more.
|
||||
My method doesn&rsquo;t necessitate my app.
|
||||
You&#8217;re always here?
|
||||
Even if you won&#8217;t download my app, you should read more.
|
||||
My method doesn&#8217;t necessitate my app.
|
||||
It is both safe and easy to use everyday.</p>
|
||||
|
||||
<p>If you just want to <em>use</em> the tools without searching to understand why it is safe, just jump at the </p></p></div></img></content>
|
||||
|
@ -453,7 +452,7 @@ It is both safe and easy to use everyday.</p>
|
|||
|
||||
<p><em>Update</em>: I might change my mind now. Why?
|
||||
I just discovered a <a href="https://github.com/rstacruz/js2coffee">js2coffee converter</a>. Furthermore Denis Knauf told me about a <code>CoffeeScript.eval</code> function.
|
||||
And as Denis said: &ldquo;it is time to use Coffeescript as a javascript with Ruby-like syntax not a Ruby-like programming language&rdquo;.</p>
|
||||
And as Denis said: &#8220;it is time to use Coffeescript as a javascript with Ruby-like syntax not a Ruby-like programming language&#8221;.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -532,7 +531,7 @@ When we are used to <span style="text-transform: uppercase">L<sup style
|
|||
|
||||
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> Played to process a <code>wav</code> file. <code>C</code> was easier and cleaner than Ruby.</p>
|
||||
|
||||
<p>edit: I wanted this program to work only on one specific machine (a x86 on a 32 bit Ubuntu). Therefore I didn&rsquo;t had any portability consideration. This is only a <em>hack</em>.</p>
|
||||
<p>edit: I wanted this program to work only on one specific machine (a x86 on a 32 bit Ubuntu). Therefore I didn&#8217;t had any portability consideration. This is only a <em>hack</em>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -541,7 +540,7 @@ When we are used to <span style="text-transform: uppercase">L<sup style
|
|||
<p>I had to compute the sum of the absolute values of data of a <code>.wav</code> file.
|
||||
For efficiency (and fun) reasons, I had chosen <code>C</code> language.</p>
|
||||
|
||||
<p>I didn&rsquo;t programmed in <code>C</code> for a long time.
|
||||
<p>I didn&#8217;t programmed in <code>C</code> for a long time.
|
||||
From my memory it was a pain to read and write to files.
|
||||
But in the end I was really impressed by the code I get.
|
||||
It was really clean.
|
||||
|
@ -578,10 +577,10 @@ This is even more impressive know...</p></content>
|
|||
</div>
|
||||
|
||||
|
||||
<p>I&rsquo;ve (re)discovered how to become S/MIME compliant.
|
||||
<p>I&#8217;ve (re)discovered how to become S/MIME compliant.
|
||||
I am now suprised how easy it was.
|
||||
Some years ago it was far more difficult.
|
||||
Now I&rsquo;m able to sign and encrypt my emails.</p>
|
||||
Now I&#8217;m able to sign and encrypt my emails.</p>
|
||||
|
||||
<h2 id="why-is-it-important">Why ...</h2></img></content>
|
||||
</entry>
|
||||
|
@ -605,7 +604,7 @@ But the major problem came from, <code>font-shadow</code> and gradie
|
|||
Then my new design obey to the following rules:</p>
|
||||
|
||||
<ul>
|
||||
<li>no CSS element begining by &lsquo;-moz&rsquo; or &lsquo;-webkit&rsquo;, etc&hellip;,</li>
|
||||
<li>no CSS element begining by &#8216;-moz&#8217; or &#8216;-webkit&#8217;, etc&#8230;,</li>
|
||||
<li>no text shadow,</li>
|
||||
<li>clean (I mean delete) most javascript.</li>
|
||||
</ul>
|
||||
|
@ -626,7 +625,7 @@ Then my new design obey to the following rules:</p>
|
|||
<content type="html"><p>You can remark at the bottom of each page I provide a last modification date.
|
||||
This label was first calculated using the <code>mtime</code> of the file on the file system.
|
||||
But many times I modify this date just to force some recompilation.
|
||||
Therefore the date wasn&rsquo;t a date of <em>real</em> modification.</p>
|
||||
Therefore the date wasn&#8217;t a date of <em>real</em> modification.</p>
|
||||
|
||||
<p>I use <a href="http://git-scm.org">git</a> to version my website.
|
||||
And fortunately I can know the last date of <em>real</em> change of a file.
|
||||
|
@ -678,8 +677,8 @@ NSString *hex_hash = [self hex_sha1:@"some NSString to be sha1'ed"];
|
|||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2010-08-31-send-mail-from-command-line-with-attached-file/"/>
|
||||
<content type="html"><p>I had to send a mail using only command line.
|
||||
I was surprised it isn&rsquo;t straightforward at all.
|
||||
I didn&rsquo;t had <code>pine</code> nor <code>mutt</code> or anything like that.
|
||||
I was surprised it isn&#8217;t straightforward at all.
|
||||
I didn&#8217;t had <code>pine</code> nor <code>mutt</code> or anything like that.
|
||||
Just <code>mail</code> and <code>mailx</code>.</p>
|
||||
|
||||
<p>What Internet say (via google) is</p>
|
||||
|
@ -689,7 +688,7 @@ Just <code>mail</code> and <code>mailx</code>.</p>
|
|||
|
||||
<p>I tried it.
|
||||
And it works almost each times.
|
||||
But for my file, it didn&rsquo;t worked.
|
||||
But for my file, it didn&#8217;t worked.
|
||||
I compressed it to <code>.gz</code>, <code>.bz2</code> and <code>.zip</code>.
|
||||
Using <code>.bz2</code> format it worked nicely, but not with other formats.
|
||||
Instead of having an attached file I saw this in my email.</p>
|
||||
|
@ -769,7 +768,7 @@ I was inspired by Readability and iBooks<small>&copy;</small> (t
|
|||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2010-07-07-CSS-rendering-problems-by-navigator/"/>
|
||||
<content type="html"><p>Some <a href="http://reddit.com">Reddit</a> users reported my website was really long to load and to scroll.
|
||||
They thinks it was because of the &lsquo;1px shadow&rsquo; I apply on all the text.
|
||||
They thinks it was because of the &#8216;1px shadow&#8217; I apply on all the text.
|
||||
I was a bit surprised, because I make some test into a really <em>slow</em> virtual machine. And all have always worked fine. In fact, what slow down so much are by order of importance:</p>
|
||||
|
||||
<ol>
|
||||
|
@ -803,7 +802,7 @@ I was a bit surprised, because I make some test into a really <em>slow<
|
|||
<li>Tried to make <a href="http://yannesposito.com/Softwares/YPassword.html">YPassword</a> in jQuery and with Cappuccino.</li>
|
||||
<li>Cappuccino nice in desktop browser but 1.4MB, not compatible with iPhone.</li>
|
||||
<li>jQuery not as nice as the Cappuccino version but 106KB. iPhone compatible.</li>
|
||||
<li>I&rsquo;ll give a try to Dashcode 3.</li>
|
||||
<li>I&#8217;ll give a try to Dashcode 3.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
@ -929,7 +928,7 @@ You can get it on <a href="http://github.com/yogsototh/nanoc3_blog">github
|
|||
<li><a href="http://intensedebate.org">intenseDebate</a> comments integration (asynchronous)&nbsp;;</li>
|
||||
<li>Portable with and without javascript, XHTML Strict 1.0 / CSS3,</li>
|
||||
<li>Write in markdown format (no HTML editing needed),</li>
|
||||
<li>Typographic ameliorations (no &lsquo;:&rsquo; ...</li></ul></content>
|
||||
<li>Typographic ameliorations (no &#8216;:&#8217; ...</li></ul></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2010-06-14:/Scratch/en/blog/2010-06-14-multi-language-choices/</id>
|
||||
|
@ -960,12 +959,12 @@ here is an example of english text.
|
|||
|
||||
<p>This way of handling translations force you to write completely an article in one language, copy it, and translate it.</p>
|
||||
|
||||
<p>However, most of time, there are common parts like images, source code, etc&hellip;
|
||||
<p>However, most of time, there are common parts like images, source code, etc&#8230;
|
||||
When I want to correct some mistake on these parts, I have to make twice the work. With sometimes adding another mistake in only one language.</p>
|
||||
|
||||
<p>This is why I preferred to handle it differently.
|
||||
I use <em>tags</em> on a single file.
|
||||
Finally my files...</p></content>
|
||||
Finally my files ...</p></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2010-05-24:/Scratch/en/blog/2010-05-24-Trees--Pragmatism-and-Formalism/</id>
|
||||
|
@ -990,7 +989,7 @@ Finally my files...</p></content>
|
|||
<li>Used a pen and a sheet of paper</li>
|
||||
<li>Made some math.</li>
|
||||
<li>Crushed the problem in 10 minutes</li>
|
||||
<li>Conclusion: The pragmatism shouldn&rsquo;t mean &ldquo;never use theory&rdquo;.</li>
|
||||
<li>Conclusion: The pragmatism shouldn&#8217;t mean &#8220;never use theory&#8221;.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
@ -1052,14 +1051,14 @@ I entered in the...</p></content>
|
|||
<p>The more you wait to do something, the more difficult it is to start doing it.</p>
|
||||
</blockquote>
|
||||
|
||||
<p>I had to write another post for this blog. I had added many article idea in my todolist. But, I made many other things, and I&rsquo;ve always said (until now), I&rsquo;ll do this later. What changed my mind is the haunt of this simple remark about how to be productive in programming.
|
||||
<p>I had to write another post for this blog. I had added many article idea in my todolist. But, I made many other things, and I&#8217;ve always said (until now), I&#8217;ll do this later. What changed my mind is the haunt of this simple remark about how to be productive in programming.
|
||||
&gt; Stop write <code>TODO</code> in your code and make it now!<br />
|
||||
&gt; You&rsquo;ll be surprised by the results.</p>
|
||||
&gt; You&#8217;ll be surprised by the results.</p>
|
||||
|
||||
<p>In short:
|
||||
&gt; <strong>Just do it!</strong> ou <strong>Juste fait le</strong> comme auraient dit les nuls.</p>
|
||||
|
||||
<p>Finally I&rsquo;ll certainly write blog post more often for a ...</p></p></content>
|
||||
<p>Finally I&#8217;ll certainly write blog post more often for a ...</p></p></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2010-03-23:/Scratch/en/blog/2010-03-23-Encapsulate-git/</id>
|
||||
|
@ -1125,7 +1124,7 @@ clientB: project adapted for client B</p>
|
|||
|
||||
<p><code>git clone</code> can only fetch the master branch.</p>
|
||||
|
||||
<p>If you don&rsquo;t have much branches, you can simply use clone your project and then use the following command:</p>
|
||||
<p>If you don&#8217;t have much branches, you can simply use clone your project and then use the following command:</p>
|
||||
|
||||
<div>
|
||||
|
||||
|
@ -1183,7 +1182,7 @@ ext=File.extname(str)
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2010-02-18-split-a-file-by-keyword/"/>
|
||||
<content type="html"><p>Strangely enough, I didn&rsquo;t find any built-in tool to split a file by keyword. I made one myself in <code>awk</code>. I put it here mostly for myself. But it could also helps someone else.
|
||||
<content type="html"><p>Strangely enough, I didn&#8217;t find any built-in tool to split a file by keyword. I made one myself in <code>awk</code>. I put it here mostly for myself. But it could also helps someone else.
|
||||
The following code split a file for each line containing the word <code>UTC</code>.</p>
|
||||
|
||||
<div>
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<div class="intro">
|
||||
|
||||
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr> : </span> Un exemple progressif d’utilisation d’Haskell.
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr> : </span> Un exemple progressif d’utilisation d’Haskell.
|
||||
Vous pourrez voir un ensemble de Mandelbrot étendu à la troisième dimension.
|
||||
De plus le code sera très propre.
|
||||
Les détails de rendu sont séparés dans un module externe.
|
||||
|
@ -72,7 +72,7 @@ Vous pouvez vous inspirer de ce code utilisant le paradigme fonctional dans tous
|
|||
<ul id="markdown-toc">
|
||||
<li><a href="#introduction">Introduction</a></li>
|
||||
<li><a href="#first-version">First version</a> <ul>
|
||||
<li><a href="#lets-play-the-song-of-our-people">Let’s play the song of our people</a></li>
|
||||
<li><a href="#lets-play-the-song-of-our-people">Let’s play the song of our people</a></li>
|
||||
<li><a href="#let-us-start">Let us start</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -157,7 +157,7 @@ We start cleaning the code at the 5<sup>th</sup> section.</p>
|
|||
The first being mostly some boilerplate<sup id="fnref:011"><a href="#fn:011" rel="footnote">2</a></sup>.
|
||||
And the second part more focused on OpenGL and content.</p>
|
||||
|
||||
<h3 id="lets-play-the-song-of-our-people">Let’s play the song of our people</h3>
|
||||
<h3 id="lets-play-the-song-of-our-people">Let’s play the song of our people</h3>
|
||||
|
||||
<div class="codehighlight">
|
||||
|
||||
|
@ -393,7 +393,7 @@ It is a bit long before the first image appears, but if you resize the window, i
|
|||
This property is a direct consequence of purity.
|
||||
If you look closely, you see that <code>allPoints</code> is a pure list.
|
||||
Therefore, calling <code>allPoints</code> will always render the same result and Haskell is clever enough to use this property.
|
||||
While Haskell doesn’t garbage collect <code>allPoints</code> the result is reused for free.
|
||||
While Haskell doesn’t garbage collect <code>allPoints</code> the result is reused for free.
|
||||
We did not specified this value should be saved for later use.
|
||||
It is saved for us.</p>
|
||||
|
||||
|
@ -631,7 +631,7 @@ instead of using a 3D projection of quaternions.
|
|||
I am pretty sure this construction is not useful for numbers.
|
||||
But it will be enough for us to create something that look nice.</p>
|
||||
|
||||
<p>This section is quite long, but don’t be afraid,
|
||||
<p>This section is quite long, but don’t be afraid,
|
||||
most of the code is some OpenGL boilerplate.
|
||||
If you just want to skim this section,
|
||||
here is a high level representation:</p>
|
||||
|
@ -647,7 +647,7 @@ here is a high level representation:</p>
|
|||
<p>Drawing: </p>
|
||||
|
||||
<ul>
|
||||
<li>set doubleBuffer, handle depth, window size…</li>
|
||||
<li>set doubleBuffer, handle depth, window size…</li>
|
||||
<li>Use state to apply some transformations</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -903,7 +903,7 @@ Mainly there are two parts: apply some transformations, draw the object.</p>
|
|||
|
||||
<h3 id="the-3d-mandelbrot">The 3D Mandelbrot</h3>
|
||||
|
||||
<p>We have finished with the OpenGL section, let’s talk about how we
|
||||
<p>We have finished with the OpenGL section, let’s talk about how we
|
||||
generate the 3D points and colors.
|
||||
First, we will set the number of details to 200 pixels in the three dimensions.</p>
|
||||
|
||||
|
@ -1017,7 +1017,7 @@ depthPoints = do
|
|||
|
||||
<p>If you prefer the first version, then just imagine how hard it will be to change the enumeration of the point from (x,y) to (x,z) for example.</p>
|
||||
|
||||
<p>Also, we didn’t searched for negative values.
|
||||
<p>Also, we didn’t searched for negative values.
|
||||
This modified Mandelbrot is no more symmetric relatively to the plan <code>y=0</code>.
|
||||
But it is symmetric relatively to the plan <code>z=0</code>.
|
||||
Then I mirror these values. </p>
|
||||
|
@ -1242,7 +1242,7 @@ ymandel x y z = mandel (2*x/width) (2*y/height) (2*z/deep) 64
|
|||
|
||||
</div>
|
||||
|
||||
<p>This code is cleaner but many things doesn’t feel right.
|
||||
<p>This code is cleaner but many things doesn’t feel right.
|
||||
First, all the user interaction code is outside our main file.
|
||||
I feel it is okay to hide the detail for the rendering.
|
||||
But I would have preferred to control the user actions.</p>
|
||||
|
@ -1276,12 +1276,12 @@ We will have two choices: </p>
|
|||
</li>
|
||||
<li>
|
||||
<p>Our main problem come from user interaction.
|
||||
If you ask “the Internet”,
|
||||
If you ask “the Internet”,
|
||||
about how to deal with user interaction with a functional paradigm,
|
||||
the main answer is to use <em>functional reactive programming</em> (FRP).
|
||||
I won’t use FRP in this article.
|
||||
Instead, I’ll use a simpler while less effective way to deal with user interaction.
|
||||
But The method I’ll use will be as pure and functional as possible.</p>
|
||||
I won’t use FRP in this article.
|
||||
Instead, I’ll use a simpler while less effective way to deal with user interaction.
|
||||
But The method I’ll use will be as pure and functional as possible.</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
|
@ -1303,7 +1303,7 @@ First, what the main loop should look like if we could make our own:</p>
|
|||
<li>a function taking two parameters: time and world state and render a new world without user interaction.</li>
|
||||
</ul>
|
||||
|
||||
<p>Here is a real working code, I’ve hidden most display functions.
|
||||
<p>Here is a real working code, I’ve hidden most display functions.
|
||||
The YGL, is a kind of framework to display 3D functions.
|
||||
But it can easily be extended to many kind of representation.</p>
|
||||
|
||||
|
@ -1523,7 +1523,7 @@ idleAction tnew world = world {
|
|||
<p>Now the function which will generate points in 3D.
|
||||
The first parameter (<code>res</code>) is the resolution of the vertex generation.
|
||||
More precisely, <code>res</code> is distance between two points on one direction.
|
||||
We need it to “close” our shape.</p>
|
||||
We need it to “close” our shape.</p>
|
||||
|
||||
<p>The type <code>Function3D</code> is <code>Point -> Point -> Maybe Point</code>.
|
||||
Because we consider partial functions
|
||||
|
@ -1592,7 +1592,7 @@ ymandel x y z = fromIntegral (mandel x y z 64) / 64
|
|||
|
||||
</div>
|
||||
|
||||
<p>I won’t explain how the magic occurs here.
|
||||
<p>I won’t explain how the magic occurs here.
|
||||
If you are interested, just read the file <a href="code/05_Mandelbulb/YGL.hs"><code>YGL.hs</code></a>.
|
||||
It is commented a lot.</p>
|
||||
|
||||
|
@ -1612,8 +1612,8 @@ It is commented a lot.</p>
|
|||
<p>Our code architecture feel very clean.
|
||||
All the meaningful code is in our main file and all display details are
|
||||
externalized.
|
||||
If you read the code of <code>YGL.hs</code>, you’ll see I didn’t made everything perfect.
|
||||
For example, I didn’t finished the code of the lights.
|
||||
If you read the code of <code>YGL.hs</code>, you’ll see I didn’t made everything perfect.
|
||||
For example, I didn’t finished the code of the lights.
|
||||
But I believe it is a good first step and it will be easy to go further.
|
||||
Unfortunately the program of the preceding session is extremely slow.
|
||||
We compute the Mandelbulb for each frame now.</p>
|
||||
|
@ -1897,20 +1897,20 @@ ymandel x y z = fromIntegral (mandel x y z 64) / 64
|
|||
<p>As we can use imperative style in a functional language,
|
||||
know you can use functional style in imperative languages.
|
||||
This article exposed a way to organize some code in a functional way.
|
||||
I’d like to stress the usage of Haskell made it very simple to achieve this.</p>
|
||||
I’d like to stress the usage of Haskell made it very simple to achieve this.</p>
|
||||
|
||||
<p>Once you are used to pure functional style,
|
||||
it is hard not to see all advantages it offers.</p>
|
||||
|
||||
<p>The code in the two last sections is completely pure and functional.
|
||||
Furthermore I don’t use <code>GLfloat</code>, <code>Color3</code> or any other OpenGL type.
|
||||
Furthermore I don’t use <code>GLfloat</code>, <code>Color3</code> or any other OpenGL type.
|
||||
If I want to use another library in the future,
|
||||
I would be able to keep all the pure code and simply update the YGL module.</p>
|
||||
|
||||
<p>The <code>YGL</code> module can be seen as a “wrapper” around 3D display and user interaction.
|
||||
<p>The <code>YGL</code> module can be seen as a “wrapper” around 3D display and user interaction.
|
||||
It is a clean separator between the imperative paradigm and functional paradigm.</p>
|
||||
|
||||
<p>If you want to go further, it shouldn’t be hard to add parallelism.
|
||||
<p>If you want to go further, it shouldn’t be hard to add parallelism.
|
||||
This should be easy mainly because most of the visible code is pure.
|
||||
Such an optimization would have been harder by using directly the OpenGL library.</p>
|
||||
|
||||
|
@ -1920,7 +1920,7 @@ O(n².log(n)) to O(n³).</p>
|
|||
<hr/><div class="footnotes">
|
||||
<ol>
|
||||
<li id="fn:001">
|
||||
<p>Unfortunately, I couldn’t make this program to work on my Mac. More precisely, I couldn’t make the <a href="http://openil.sourceforge.net/">DevIL</a> library work on Mac to output the image. Yes I have done a <code>brew install libdevil</code>. But even a minimal program who simply write some <code>jpg</code> didn’t worked. I tried both with <code>Haskell</code> and <code>C</code>.<a href="#fnref:001" rel="reference">↩</a></p>
|
||||
<p>Unfortunately, I couldn’t make this program to work on my Mac. More precisely, I couldn’t make the <a href="http://openil.sourceforge.net/">DevIL</a> library work on Mac to output the image. Yes I have done a <code>brew install libdevil</code>. But even a minimal program who simply write some <code>jpg</code> didn’t worked. I tried both with <code>Haskell</code> and <code>C</code>.<a href="#fnref:001" rel="reference">↩</a></p>
|
||||
</li>
|
||||
<li id="fn:011">
|
||||
<p>Generally in Haskell you need to declare a lot of import lines.
|
||||
|
|
|
@ -52,7 +52,7 @@ just continue to read as a standard web page.
|
|||
<div class="intro">
|
||||
|
||||
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Un exemple progressif d&rsquo;utilisation d&rsquo;Haskell.
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Un exemple progressif d&#8217;utilisation d&#8217;Haskell.
|
||||
Vous pourrez voir un ensemble de Mandelbrot étendu à la troisième dimension.
|
||||
De plus le code sera très propre.
|
||||
Les détails de rendu sont séparés dans un module externe.
|
||||
|
@ -117,7 +117,7 @@ We can all create better web typography ourselves, today.»</p>
|
|||
<p>ou en français&nbsp;:</p>
|
||||
|
||||
<blockquote>
|
||||
<p>«Nous ne somme pas obligé d&rsquo;attendre le développement des navigateurs.
|
||||
<p>«Nous ne somme pas obligé d&#8217;attendre le développement des navigateurs.
|
||||
Nous pouvons crÃ...</p></blockquote></img></content>
|
||||
</entry>
|
||||
<entry>
|
||||
|
@ -141,7 +141,7 @@ Nous pouvons crÃ...</p></blockquote></img></content>
|
|||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Un tutoriel pour yesod, un framework web Haskell.
|
||||
Vous ne devriez pas avoir besoin de savoir programmer en Haskell.
|
||||
Par contre je suis désolé pour les francophones,
|
||||
mais je n&rsquo;ai pas eu le courage de traduire cet article en Français.</p>
|
||||
mais je n&#8217;ai pas eu le courage de traduire cet article en Français.</p>
|
||||
|
||||
<blockquote>
|
||||
<center><span class="sc"><b>Table of content</b></span></center>
|
||||
|
@ -167,13 +167,13 @@ mais je n&rsquo;ai pas eu le courage de traduire cet article en Françai
|
|||
<div class="intro">
|
||||
|
||||
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Utiliser m4 pour accroître le pouvoir d&rsquo;<span class="sc">xslt</span> et d&rsquo;<span class="sc">svg</span>. Example cool, les fractales.</p>
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Utiliser m4 pour accroître le pouvoir d&#8217;<span class="sc">xslt</span> et d&#8217;<span class="sc">svg</span>. Example cool, les fractales.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<p>Lorsqu&rsquo;<span class="sc">xml</span> fût inventé beaucoup pensaient que c&rsquo;était l&rsquo;avenir.
|
||||
<p>Lorsqu&#8217;<span class="sc">xml</span> fût inventé beaucoup pensaient que c&#8217;était l&#8217;avenir.
|
||||
Passer de fichiers plat à des fichiers structurés standardisés fût un grand progrès dans beaucoup de domaines.
|
||||
Cerain se mirent à voir du <span class="sc">xml</span> de partout.
|
||||
À tel point que les les format compatibles <span class="sc">xml</span> naquirent de toute part.
|
||||
|
@ -198,8 +198,8 @@ Non seulement comme format de fichier, mais...</p></img></content>
|
|||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span></p>
|
||||
|
||||
<p>Cela fait un moment que je suis la progression du <a href="http://www.yesodweb.com">framework yesod</a>.
|
||||
À mon humble avis on peut commencer à l&rsquo;utiliser pour des applications sérieuses (comprendre en prod).
|
||||
Avant de vous dire pourquoi vous devriez aussi le considérer, je préfère vous parler de bonnes idées (parmi d&rsquo;autres) introduites par yesod que je n&rsquo;avais jamais vu ailleurs.</p>
|
||||
À mon humble avis on peut commencer à l&#8217;utiliser pour des applications sérieuses (comprendre en prod).
|
||||
Avant de vous dire pourquoi vous devriez aussi le considérer, je préfère vous parler de bonnes idées (parmi d&#8217;autres) introduites par yesod que je n&#8217;avais jamais vu ailleurs.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -207,7 +207,7 @@ Avant de vous dire pourquoi vous devriez aussi le considérer, je préf&
|
|||
|
||||
<h2 id="types-saufs">Types saufs</h2>
|
||||
|
||||
<p>Commençons par une BD d&rsquo;<a href="http://xkcd.com">xkcd</a>&nbsp;:</p>
|
||||
<p>Commençons par une BD d&#8217;<a href="http://xkcd.com">xkcd</a>&nbsp;:</p>
|
||||
|
||||
</img></content>
|
||||
</entry>
|
||||
|
@ -269,7 +269,7 @@ $ mapa '$1*2' {1..3...</code></pre></div></img></content
|
|||
|
||||
<div class="intro">
|
||||
|
||||
<span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Mon avis succinct et hautement subjectif concernant les différents languages de programmation que j&rsquo;ai utilisé.
|
||||
<span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Mon avis succinct et hautement subjectif concernant les différents languages de programmation que j&#8217;ai utilisé.
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -282,8 +282,8 @@ $ mapa '$1*2' {1..3...</code></pre></div></img></content
|
|||
Je devais avoir 10-11 ans.
|
||||
Sous <code>MO5</code>, <code>Amstrad CPC 6128</code> et même <code>Atari STe</code>.
|
||||
Le langage des <code>GOTO</code>s.
|
||||
Je suis empleint de nostalgie rien que d&rsquo;y penser.
|
||||
C&rsquo;est à peu prêt le seul intérêt de ce langage.</p>
|
||||
Je suis empleint de nostalgie rien que d&#8217;y penser.
|
||||
C&#8217;est à peu prêt le seul intérêt de ce langage.</p>
|
||||
|
||||
...</img></img></content>
|
||||
</entry>
|
||||
|
@ -309,7 +309,7 @@ C&rsquo;est à peu prêt le seul intérêt de ce langage.<
|
|||
</div>
|
||||
|
||||
|
||||
<p><a href="http://www.vim.org">Vim</a> ou l&rsquo;éditeur qui vallait 3 milliards&nbsp;:</p>
|
||||
<p><a href="http://www.vim.org">Vim</a> ou l&#8217;éditeur qui vallait 3 milliards&nbsp;:</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Meilleur, plus fort, plus rapide.</p>
|
||||
|
@ -329,11 +329,11 @@ Sa prise en mais est difficile, mais payante....</p></img></content>
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/A-more-convenient-diff/"/>
|
||||
<content type="html"><p><code>diff</code> est un utilitaire très pratique, mais il n&rsquo;est pas facile à lire pour nous, les Hommes.</p>
|
||||
<content type="html"><p><code>diff</code> est un utilitaire très pratique, mais il n&#8217;est pas facile à lire pour nous, les Hommes.</p>
|
||||
|
||||
<p>C&rsquo;est pourquoi, lorsque vous utilisez <code>git</code>, il vous montre un formatage plus agréable avec des couleurs.</p>
|
||||
<p>C&#8217;est pourquoi, lorsque vous utilisez <code>git</code>, il vous montre un formatage plus agréable avec des couleurs.</p>
|
||||
|
||||
<p>Voici le script que j&rsquo;utilise lorsque je veux avoir un <code>diff</code> à la git.</p>
|
||||
<p>Voici le script que j&#8217;utilise lorsque je veux avoir un <code>diff</code> à la git.</p>
|
||||
|
||||
<div class="codefile"><a href="/Scratch/fr/blog/A-more-convenient-diff/code/ydiff">&#x27A5; ydiff</a></div>
|
||||
|
||||
|
@ -361,7 +361,7 @@ function colorize_diff {
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Haskell-Mandelbrot/"/>
|
||||
<content type="html"><p>Voici le code &ldquo;obfusqué&rdquo;&nbsp;:</p>
|
||||
<content type="html"><p>Voici le code &#8220;obfusqué&#8221;&nbsp;:</p>
|
||||
|
||||
<div class="codefile"><a href="/Scratch/fr/blog/Haskell-Mandelbrot/code/animandel.hs">&#x27A5; animandel.hs</a></div>
|
||||
|
||||
|
@ -390,19 +390,19 @@ main ...</code></pre></content>
|
|||
<div class="intro">
|
||||
|
||||
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Une méthode de gestion des mots de passes que j&rsquo;utilise avec succès depuis quelques années.<br />
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Une méthode de gestion des mots de passes que j&#8217;utilise avec succès depuis quelques années.<br />
|
||||
<strong><code>sha1( mot_de_passe + nom_de_domaine )</code></strong><br />
|
||||
Je ne mémorise qu&rsquo;un seul mot de passe de très bonne qualité.
|
||||
J&rsquo;utilise des mots de passe différents sur tous les sites.</p>
|
||||
Je ne mémorise qu&#8217;un seul mot de passe de très bonne qualité.
|
||||
J&#8217;utilise des mots de passe différents sur tous les sites.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<p>Avant de commencer, je tiens à préciser qu&rsquo;il s&rsquo;agit d&rsquo;une tentative de vous vendre mon appli iPhone&nbsp;;-).</p>
|
||||
<p>Avant de commencer, je tiens à préciser qu&#8217;il s&#8217;agit d&#8217;une tentative de vous vendre mon appli iPhone&nbsp;;-).</p>
|
||||
|
||||
<p>Vous êtes toujours là&nbsp;?
|
||||
Bon, d&rsquo;accord, même si vous ne téléchargez pas mon application vous pouvez quand même utiliser ma ...</p></p></div></img></content>
|
||||
Bon, d&#8217;accord, même si vous ne téléchargez pas mon application vous pouvez quand même utiliser ma ...</p></p></div></img></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2011-04-20:/Scratch/fr/blog/2011-04-20-Now-hosted-on-github/</id>
|
||||
|
@ -416,7 +416,7 @@ Bon, d&rsquo;accord, même si vous ne téléchargez pas mon appl
|
|||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2011-04-20-Now-hosted-on-github/"/>
|
||||
<content type="html"><img alt="Title image" src="/Scratch/img/blog/2011-04-20-Now-hosted-on-github/main.png" />
|
||||
|
||||
<p>J&rsquo;héberge mon site sur github à partir d&rsquo;aujourd&rsquo;hui.</p>
|
||||
<p>J&#8217;héberge mon site sur github à partir d&#8217;aujourd&#8217;hui.</p>
|
||||
</img></content>
|
||||
</entry>
|
||||
<entry>
|
||||
|
@ -435,9 +435,9 @@ Bon, d&rsquo;accord, même si vous ne téléchargez pas mon appl
|
|||
<div class="encadre">
|
||||
|
||||
|
||||
<p><em>Mise à jour&nbsp;:</em> Je pense que je vais finallement changer d&rsquo;avis.
|
||||
<p><em>Mise à jour&nbsp;:</em> Je pense que je vais finallement changer d&#8217;avis.
|
||||
Pourquoi&nbsp;?
|
||||
Tout d&rsquo;abord, je viens de découvrir un convertisseur javascript vers coffeescript, ensuite Denis Knauf m&rsquo;a laissé un commentaire et m&rsquo;a appris l&rsquo;existence d&rsquo;une fonction <code>CoffeeScript.eval</code>. De plus, il faut voir CoffeeScript comme javascript avec une syntaxe similaire à Ruby et pas comme un langage similaire à Ruby.</p>
|
||||
Tout d&#8217;abord, je viens de découvrir un convertisseur javascript vers coffeescript, ensuite Denis Knauf m&#8217;a laissé un commentaire et m&#8217;a appris l&#8217;existence d&#8217;une fonction <code>CoffeeScript.eval</code>. De plus, il faut voir CoffeeScript comme javascript avec une syntaxe similaire à Ruby et pas comme un langage similaire à Ruby.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -447,7 +447,7 @@ Tout d&rsquo;abord, je viens de découvrir un convertisseur javascript v
|
|||
<div class="intro">
|
||||
|
||||
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Qu&rsquo;est-ce qui n&rsquo;allait pas avec Coffeescript? La meta-programmation, ...</p></div></img></content>
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Qu&#8217;est-ce qui n&#8217;allait pas avec Coffeescript? La meta-programmation, ...</p></div></img></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2011-01-01:/Scratch/fr/blog/2011-01-03-Happy-New-Year/</id>
|
||||
|
@ -461,15 +461,15 @@ Tout d&rsquo;abord, je viens de découvrir un convertisseur javascript v
|
|||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2011-01-03-Happy-New-Year/"/>
|
||||
<content type="html"><p>Bonne et heureuse année&nbsp;!</p>
|
||||
|
||||
<p>J&rsquo;étais très occupé ces derniers mois.
|
||||
<p>J&#8217;étais très occupé ces derniers mois.
|
||||
Maintenant il me semble que je vais pouvoir faire revivre ce blog.</p>
|
||||
|
||||
<p>J&rsquo;ai fait un outil qui permet d&rsquo;écrire des livre en utilisant une syntaxe proche de markdown.
|
||||
C&rsquo;est un markdown avec des macros (essentiel pour les textes longs).
|
||||
<p>J&#8217;ai fait un outil qui permet d&#8217;écrire des livre en utilisant une syntaxe proche de markdown.
|
||||
C&#8217;est un markdown avec des macros (essentiel pour les textes longs).
|
||||
De plus le système gère la génération de pages HTML ainsi que du PDF engendré avec du XeLaTeX.
|
||||
Je n&rsquo;en ai pas encore terminé avec ça. Mais si je tarde trop, je communiquerai lorsque j&rsquo;aurai fini le minimum.</p>
|
||||
Je n&#8217;en ai pas encore terminé avec ça. Mais si je tarde trop, je communiquerai lorsque j&#8217;aurai fini le minimum.</p>
|
||||
|
||||
<p>J&rsquo;ai écrit un framework MVC pour application javascript simple mais néanmoins très rapide.</p>
|
||||
<p>J&#8217;ai écrit un framework MVC pour application javascript simple mais néanmoins très rapide.</p>
|
||||
|
||||
<p>Meilleurs vœux à tous&nbsp;!</p>
|
||||
</content>
|
||||
|
@ -488,14 +488,14 @@ Je n&rsquo;en ai pas encore terminé avec ça. Mais si je tarde trop
|
|||
<div class="intro">
|
||||
|
||||
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> J&rsquo;ai fait un système simple de macros pour mon blog. Par exemple, il me suffit d&rsquo;écrire %<span></span>latex et ça affiche <span style="text-transform: uppercase">L<sup style="vertical-align: 0.15em; margin-left: -0.36em; margin-right: -0.15em; font-size: .85em">a</sup>T<sub style="vertical-align: -0.5ex; margin-left: -0.1667em; margin-right: -0.125em; font-size: 1em">e</sub>X</span>.</p>
|
||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> J&#8217;ai fait un système simple de macros pour mon blog. Par exemple, il me suffit d&#8217;écrire %<span></span>latex et ça affiche <span style="text-transform: uppercase">L<sup style="vertical-align: 0.15em; margin-left: -0.36em; margin-right: -0.15em; font-size: .85em">a</sup>T<sub style="vertical-align: -0.5ex; margin-left: -0.1667em; margin-right: -0.125em; font-size: 1em">e</sub>X</span>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<p>J&rsquo;ai ajouter un système de macro pour mon système de blog.
|
||||
Lorsqu&rsquo;on est habitué à <span style="text-transform: uppercase">L<sup style="vertical-align: 0.15em; margin-left: -0.36em; margin-right: -0.15em; font-size: .85em">a</sup>T</span></p></content>
|
||||
<p>J&#8217;ai ajouter un système de macro pour mon système de blog.
|
||||
Lorsqu&#8217;on est habitué à <span style="text-transform: uppercase">L<sup style="vertical-align: 0.15em; margin-left: -0.36em; margin-right: -0.15em; font-size: .85em">a</sup>T</span></p></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2010-10-14:/Scratch/fr/blog/2010-10-14-Fun-with-wav/</id>
|
||||
|
@ -519,10 +519,10 @@ Lorsqu&rsquo;on est habitué à <span style="text-transform: uppe
|
|||
</div>
|
||||
|
||||
|
||||
<p>J&rsquo;ai eu besoin de calculer la somme des valeurs absolue des données d&rsquo;un fichier <code>wav</code>.
|
||||
Pour des raison d&rsquo;efficacité (et aussi de fun), j&rsquo;ai fait le programme en <code>C</code>.</p>
|
||||
<p>J&#8217;ai eu besoin de calculer la somme des valeurs absolue des données d&#8217;un fichier <code>wav</code>.
|
||||
Pour des raison d&#8217;efficacité (et aussi de fun), j&#8217;ai fait le programme en <code>C</code>.</p>
|
||||
|
||||
<p>Celà faisait longtemps que je n&rsquo;avais pas programmé en <code>C</code>.
|
||||
<p>Celà faisait longtemps que je n&#8217;avais pas programmé en <code>C</code>.
|
||||
De mémoire il était peu aisé de manipuler des ...</p></content>
|
||||
</entry>
|
||||
<entry>
|
||||
|
@ -547,16 +547,16 @@ De mémoire il était peu aisé de manipuler des ...</p></cont
|
|||
<li>Récupérez un certificat signé par une AC: <a href="http://www.instantssl.com/ssl-certificate-products/free-email-certificate.html">cliquez ici pour un certificat gratuit</a>&nbsp;;</li>
|
||||
<li>ouvrez le fichier&nbsp;;</li>
|
||||
<li>supprimer le fichier en mode sécurisé&nbsp;;</li>
|
||||
<li>utilisez Mail plutôt que l&rsquo;interface web de gmail.</li>
|
||||
<li>utilisez Mail plutôt que l&#8217;interface web de gmail.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<p>J&rsquo;ai (re)découvert comment adoptez la norme S/MIME.
|
||||
J&rsquo;ai été surpris de voir à quel point ce fut aisé.
|
||||
Il y a seulement quelques années c&rsquo;é...</p></img></content>
|
||||
<p>J&#8217;ai (re)découvert comment adoptez la norme S/MIME.
|
||||
J&#8217;ai été surpris de voir à quel point ce fut aisé.
|
||||
Il y a seulement quelques années c&#8217;é...</p></img></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2010-10-06:/Scratch/fr/blog/2010-10-06-New-Blog-Design-Constraints/</id>
|
||||
|
@ -568,15 +568,15 @@ Il y a seulement quelques années c&rsquo;é...</p></img>
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-10-06-New-Blog-Design-Constraints/"/>
|
||||
<content type="html"><p>Vous avez pu constater que j&rsquo;ai modifié le design de mon blog.
|
||||
Maintenant il doit être beaucoup plus léger qu&rsquo;avant.
|
||||
Je n&rsquo;utilise plus de CSS3 et beaucoup moins de javascript.
|
||||
<content type="html"><p>Vous avez pu constater que j&#8217;ai modifié le design de mon blog.
|
||||
Maintenant il doit être beaucoup plus léger qu&#8217;avant.
|
||||
Je n&#8217;utilise plus de CSS3 et beaucoup moins de javascript.
|
||||
Bien entendu, même avant, mes pages étaient parfaitement lisibles sans javascript.
|
||||
Mais, je me suis aperçu que les systèmes de CSS3 sont loin d&rsquo;être au point.
|
||||
J&rsquo;utilisait des gradient en CSS3, ainsi que des ombres sous le texte. Ça avait un rendu très sympa. Sauf&hellip;
|
||||
Ce n&rsquo;était pas compatible ie6, sous Chrome le rendu était d&rsquo;une lenteur incroyable.
|
||||
J&rsquo;ai donc décidé de faire un site à minima.
|
||||
Je voulais qu&rsquo;il soit joli <em>et</em> le plus simple possible pour assurer sa compatibilité.
|
||||
Mais, je me suis aperçu que les systèmes de CSS3 sont loin d&#8217;être au point.
|
||||
J&#8217;utilisait des gradient en CSS3, ainsi que des ombres sous le texte. Ça avait un rendu très sympa. Sauf&#8230;
|
||||
Ce n&#8217;était pas compatible ie6, sous Chrome le rendu était d&#8217;une lenteur incroyable.
|
||||
J&#8217;ai donc décidé de faire un site à minima.
|
||||
Je voulais qu&#8217;il soit joli <em>et</em> le plus simple possible pour assurer sa compatibilité.
|
||||
Les règles que je me suis fixées sont donc:</p>
|
||||
|
||||
</content>
|
||||
|
@ -591,14 +591,14 @@ Les règles que je me suis fixées sont donc:</p>
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/"/>
|
||||
<content type="html"><p>Vous pouvez remarquer qu&rsquo;à la fin de chaque page je donne une date de dernière modification.
|
||||
<content type="html"><p>Vous pouvez remarquer qu&#8217;à la fin de chaque page je donne une date de dernière modification.
|
||||
Précédemment cette date était calculée en utilisant la date du fichier.
|
||||
Mais il arrive fréquemment que je fasse un <code>touch</code> d&rsquo;un fichier pour engendrer tout le site de nouveau.
|
||||
Donc la date n&rsquo;est pas nécessairement la <em>vraie</em> de modification du contenue.</p>
|
||||
Mais il arrive fréquemment que je fasse un <code>touch</code> d&#8217;un fichier pour engendrer tout le site de nouveau.
|
||||
Donc la date n&#8217;est pas nécessairement la <em>vraie</em> de modification du contenue.</p>
|
||||
|
||||
<p>J&rsquo;utilise <a href="http://git-scm.org">git</a> pour <em>versionner</em> mon site web.
|
||||
Et cet outil me permet de récupérer la dernière date de <em>vraie</em> modification d&rsquo;un fichier.
|
||||
Voici comment je m&rsquo;y prend avec <a href="http://nanoc.stoneship.org">nanoc</a>&nbsp;:</p>
|
||||
<p>J&#8217;utilise <a href="http://git-scm.org">git</a> pour <em>versionner</em> mon site web.
|
||||
Et cet outil me permet de récupérer la dernière date de <em>vraie</em> modification d&#8217;un fichier.
|
||||
Voici comment je m&#8217;y prend avec <a href="http://nanoc.stoneship.org">nanoc</a>&nbsp;:</p>
|
||||
|
||||
<div class="codefile"></div></content>
|
||||
</entry>
|
||||
|
@ -612,10 +612,10 @@ Voici comment je m&rsquo;y prend avec <a href="http://nanoc.stoneship.org
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-09-02-base64-and-sha1-on-iPhone/"/>
|
||||
<content type="html"><p>Allons directement à l&rsquo;essentiel&nbsp;:
|
||||
voici deux fonctions à intégrer à votre application iPhone pour afficher l&rsquo;encodage en base64 ou en hexadecimal du hash sha1 d&rsquo;un string en Objective-C pour iPhone.</p>
|
||||
<content type="html"><p>Allons directement à l&#8217;essentiel&nbsp;:
|
||||
voici deux fonctions à intégrer à votre application iPhone pour afficher l&#8217;encodage en base64 ou en hexadecimal du hash sha1 d&#8217;un string en Objective-C pour iPhone.</p>
|
||||
|
||||
<p>Pour l&rsquo;usage c&rsquo;est très simple, copiez le code dans la classe de votre choix.
|
||||
<p>Pour l&#8217;usage c&#8217;est très simple, copiez le code dans la classe de votre choix.
|
||||
Puis&nbsp;:</p>
|
||||
|
||||
<pre><code class="objective-c">#import &lt;CommonCrypto/CommonDigest.h&gt;
|
||||
|
@ -625,8 +625,8 @@ NSString *b64_hash = [self b64_sha1:@"some NSString to be sha1'ed"];
|
|||
NSString *hex_hash = [self hex_sha1:@"some NSString to be sha1'ed"];
|
||||
</code></pre>
|
||||
|
||||
<p>L&rsquo;algorithme pour l&rsquo;encodage en <code>base64</code> doit être programmé sur iPhone.
|
||||
Il n&rsquo;y a pas de librairie officielle qui s&rsquo;occupe de ça.</p>
|
||||
<p>L&#8217;algorithme pour l&#8217;encodage en <code>base64</code> doit être programmé sur iPhone.
|
||||
Il n&#8217;y a pas de librairie officielle qui s&#8217;occupe de ça.</p>
|
||||
|
||||
<div class="codefile"></div></content>
|
||||
</entry>
|
||||
|
@ -640,19 +640,19 @@ Il n&rsquo;y a pas de librairie officielle qui s&rsquo;occupe de ça
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-08-31-send-mail-from-command-line-with-attached-file/"/>
|
||||
<content type="html"><p>J&rsquo;ai dû envoyer un mail en ligne de commande récemment.
|
||||
Quelle ne fût pas ma surprise lorsque je constatais que ce n&rsquo;était vraiment pas évident.
|
||||
Je n&rsquo;avais ni <code>pine</code> ni <code>mutt</code>. Seulement <code>mail</code> et <code>mailx</code>.</p>
|
||||
<content type="html"><p>J&#8217;ai dû envoyer un mail en ligne de commande récemment.
|
||||
Quelle ne fût pas ma surprise lorsque je constatais que ce n&#8217;était vraiment pas évident.
|
||||
Je n&#8217;avais ni <code>pine</code> ni <code>mutt</code>. Seulement <code>mail</code> et <code>mailx</code>.</p>
|
||||
|
||||
<p>Ce qu&rsquo;on trouve sur internet pour envoyer un mail avec fichier attaché c&rsquo;est ça&nbsp;:</p>
|
||||
<p>Ce qu&#8217;on trouve sur internet pour envoyer un mail avec fichier attaché c&#8217;est ça&nbsp;:</p>
|
||||
|
||||
<pre><code class="zsh">uuencode fic.jpg fic.jpg | mail -s 'Subject'
|
||||
</code></pre>
|
||||
|
||||
<p>Bon, alors, bête et discipliné j&rsquo;ai essayé.
|
||||
<p>Bon, alors, bête et discipliné j&#8217;ai essayé.
|
||||
Et bien, ça marche <em>presque</em> tout le temps.
|
||||
Pour mon fichier ça n&rsquo;a pas marché du tout.
|
||||
Je l&rsquo;ai compressé au format <code>.gz</code>, <code>.bz2</code> et <code>.zip</code>.
|
||||
Pour mon fichier ça n&#8217;a pas marché du tout.
|
||||
Je l&#8217;ai compressé au format <code>.gz</code>, <code>.bz2</code> et <code>.zip</code>.
|
||||
Avec le format <code>.bz2</code> le mail reçu avait bien un fichie...</p></content>
|
||||
</entry>
|
||||
<entry>
|
||||
|
@ -667,14 +667,14 @@ Avec le format <code>.bz2</code> le mail reçu avait bien un fic
|
|||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-08-23-Now-heberged-on-heroku/"/>
|
||||
<content type="html"><h1 class="first" id="maintenant-sur-herokuhttpherokucom">Maintenant sur <a href="http://heroku.com">Heroku</a></h1>
|
||||
|
||||
<p>J&rsquo;ai changé mon hébergeur. Mobileme n&rsquo;est absolument pas adapté à la diffusion de mon blog. C&rsquo;est pourquoi je suis passé à <a href="http://heroku.com">Heroku</a>.</p>
|
||||
<p>J&#8217;ai changé mon hébergeur. Mobileme n&#8217;est absolument pas adapté à la diffusion de mon blog. C&#8217;est pourquoi je suis passé à <a href="http://heroku.com">Heroku</a>.</p>
|
||||
|
||||
<p>Mais comme vous devez le savoir mon blog est un site complètement statique.
|
||||
J&rsquo;utilise <a href="http://nanoc.stoneship.org/">nanoc</a> pour l&rsquo;engendrer.
|
||||
Avoir un site statique amène beaucoup d&rsquo;avantages par rapport à un site dynamique. Surtout en terme de sécurité.
|
||||
J&#8217;utilise <a href="http://nanoc.stoneship.org/">nanoc</a> pour l&#8217;engendrer.
|
||||
Avoir un site statique amène beaucoup d&#8217;avantages par rapport à un site dynamique. Surtout en terme de sécurité.
|
||||
Voici comment configurer un site statique sur heroku.</p>
|
||||
|
||||
<p>La racine de mes fichiers est &lsquo;/output&rsquo;. Vous devez simplement créer deux fichiers. Un fichier <code>config.ru</code></p></content>
|
||||
<p>La racine de mes fichiers est &#8216;/output&#8217;. Vous devez simplement créer deux fichiers. Un fichier <code>config.ru</code></p></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2010-08-11:/Scratch/fr/blog/2010-07-09-Indecidabilities/</id>
|
||||
|
@ -699,11 +699,11 @@ Voici comment configurer un site statique sur heroku.</p>
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-07-31-New-style-after-holidays/"/>
|
||||
<content type="html"><p>Avant les vacances beaucoup d&rsquo;utilisateurs se sont plaints de la lenteur de rendu de mon site.
|
||||
Il s&rsquo;agit notamment de problèmes avec Chrome en particulier.
|
||||
<content type="html"><p>Avant les vacances beaucoup d&#8217;utilisateurs se sont plaints de la lenteur de rendu de mon site.
|
||||
Il s&#8217;agit notamment de problèmes avec Chrome en particulier.
|
||||
Mais pour éviter tout problème.
|
||||
J&rsquo;ai complètement modifié le style de mon site web.
|
||||
Il est inspiré du style de l&rsquo;application iBooks<small>&copy;</small> sur iPhone<small>&copy;</small>.</p>
|
||||
J&#8217;ai complètement modifié le style de mon site web.
|
||||
Il est inspiré du style de l&#8217;application iBooks<small>&copy;</small> sur iPhone<small>&copy;</small>.</p>
|
||||
|
||||
<p>Dites moi ce que vous pensez de ce nouveau design.</p>
|
||||
</content>
|
||||
|
@ -718,10 +718,10 @@ Il est inspiré du style de l&rsquo;application iBooks<small>&
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-07-07-CSS-rendering-problems-by-navigator/"/>
|
||||
<content type="html"><p>Beaucoup d&rsquo;utilisateurs de <a href="http://reddit.com">Reddit</a> m&rsquo;ont rapporté que mon site était très long à charger et à <em>scroller</em>.
|
||||
Ils pensaient qu&rsquo;il s&rsquo;agissait d&rsquo;un problème dû aux ombres que j&rsquo;applique sur le texte.
|
||||
J&rsquo;étais un peu surpris puisque je fais mes tests sur une machine vraiment très lente et je n&rsquo;avais jamais détecté ces problèmes.
|
||||
En réalité, ce qui ralenti le rendu de ce site est par ordre d&rsquo;importance&nbsp;:</p>
|
||||
<content type="html"><p>Beaucoup d&#8217;utilisateurs de <a href="http://reddit.com">Reddit</a> m&#8217;ont rapporté que mon site était très long à charger et à <em>scroller</em>.
|
||||
Ils pensaient qu&#8217;il s&#8217;agissait d&#8217;un problème dû aux ombres que j&#8217;applique sur le texte.
|
||||
J&#8217;étais un peu surpris puisque je fais mes tests sur une machine vraiment très lente et je n&#8217;avais jamais détecté ces problèmes.
|
||||
En réalité, ce qui ralenti le rendu de ce site est par ordre d&#8217;importance&nbsp;:</p>
|
||||
|
||||
<ol>
|
||||
<li>Les dégradés sur Chrome (pas dans Safari sur Mac)</li>
|
||||
|
@ -730,7 +730,7 @@ En réalité, ce qui ralenti le rendu de ce site est par ordre d&rsq
|
|||
|
||||
<h2 id="les-dgrads">les dégradés</h2>
|
||||
|
||||
<p>Sur Safari il n&rsquo;y a absolument aucun problème avec les dégradés. Par contre sur Chrome sous Linux le si...</p></content>
|
||||
<p>Sur Safari il n&#8217;y a absolument aucun problème avec les dégradés. Par contre sur Chrome sous Linux le si...</p></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2010-07-05:/Scratch/fr/blog/2010-07-05-Cappuccino-and-Web-applications/</id>
|
||||
|
@ -749,10 +749,10 @@ En réalité, ce qui ralenti le rendu de ce site est par ordre d&rsq
|
|||
<p><abbr title="Trop long à lire">tlàl</abbr>:</p>
|
||||
|
||||
<ul>
|
||||
<li>J&rsquo;ai essayé de faire une version de <a href="http://yannesposito.com/Softwares/YPassword.html">YPassword</a> en jQuery et avec Cappuccino.</li>
|
||||
<li>Cappuccino est très bien sur les navigateurs non mobile mais l&rsquo;application pèse 1.4Mo et n&rsquo;est pas compatible avec l&rsquo;iPhone.</li>
|
||||
<li>la version jQuery n&rsquo;est pas aussi jolie que la version réalisée avec Cappuccino mais elle pèse seulement 106Ko et est compatible avec l&rsquo;iPhone.</li>
|
||||
<li>J&rsquo;essayerai Dashcode 3</li>
|
||||
<li>J&#8217;ai essayé de faire une version de <a href="http://yannesposito.com/Softwares/YPassword.html">YPassword</a> en jQuery et avec Cappuccino.</li>
|
||||
<li>Cappuccino est très bien sur les navigateurs non mobile mais l&#8217;application pèse 1.4Mo et n&#8217;est pas compatible avec l&#8217;iPhone.</li>
|
||||
<li>la version jQuery n&#8217;est pas aussi jolie que la version réalisée avec Cappuccino mais elle pèse seulement 106Ko et est compatible avec l&#8217;iPhone.</li>
|
||||
<li>J&#8217;essayerai Dashcode 3</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
@ -810,12 +810,12 @@ function initCode() {
|
|||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-06-17-hide-yourself-to-analytics/"/>
|
||||
<content type="html"><p>Voici un moyen très simple de ne plus être comptabilisé dans les visites de son propre site.
|
||||
Tout d&rsquo;abord, vous devriez jeter un coup d&rsquo;œil sur comment <a href="/Scratch/fr/blog/2010-06-17-track-events-with-google-analytics">je gère les systèmes de récupération de statistiques</a>.
|
||||
Tout d&#8217;abord, vous devriez jeter un coup d&#8217;œil sur comment <a href="/Scratch/fr/blog/2010-06-17-track-events-with-google-analytics">je gère les systèmes de récupération de statistiques</a>.
|
||||
Je centralise tout dans un seul fichier javascript ce qui facilite le travail.</p>
|
||||
|
||||
<p>Cette méthode nécessite l&rsquo;utilisation de <code>jquery-cookie</code>.</p>
|
||||
<p>Cette méthode nécessite l&#8217;utilisation de <code>jquery-cookie</code>.</p>
|
||||
|
||||
<p>Avant de comptabiliser les visites, je vérifie que la clé <code>admin</code> n&rsquo;est pas utilisée dans mes cookies.</p>
|
||||
<p>Avant de comptabiliser les visites, je vérifie que la clé <code>admin</code> n&#8217;est pas utilisée dans mes cookies.</p>
|
||||
|
||||
<pre><code class="javascript"> var admin = $.cookie('admin');
|
||||
if (! admin) {
|
||||
|
@ -835,7 +835,7 @@ Je centralise tout dans un seul fichier javascript ce qui facilite le travail.&l
|
|||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-06-17-track-events-with-google-analytics/"/>
|
||||
<content type="html"><p>Voici comment analyser tous les clics que font vos utilisateurs sur votre blog en incluant google analytics de façon asynchrone.</p>
|
||||
|
||||
<p>Dans le html, il faut utiliser <a href="http://jquery.com">jQuery</a> et un fichier que j&rsquo;ai appelé <code>yga.js</code>&nbsp;:</p>
|
||||
<p>Dans le html, il faut utiliser <a href="http://jquery.com">jQuery</a> et un fichier que j&#8217;ai appelé <code>yga.js</code>&nbsp;:</p>
|
||||
|
||||
<pre><code class="html"> &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
|
||||
&lt;script type="text/javascript" src="yga.js"&gt;&lt;/script&gt;
|
||||
|
@ -859,7 +859,7 @@ Je centralise tout dans un seul fichier javascript ce qui facilite le travail.&l
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-06-15-Get-my-blog-engine/"/>
|
||||
<content type="html"><p>J&rsquo;ai publié une version <em>light</em> de mon système de blog hier soir. Par <em>light</em> il faut comprendre avec un CSS plus épuré et plus portable (sans les bords ronds).
|
||||
<content type="html"><p>J&#8217;ai publié une version <em>light</em> de mon système de blog hier soir. Par <em>light</em> il faut comprendre avec un CSS plus épuré et plus portable (sans les bords ronds).
|
||||
Vous pouvez le récupérer sur <a href="http://github.com/yogsototh/nanoc3_blog">github.com</a>.</p>
|
||||
|
||||
<p>Que pouvez-vous attendre de ce système de blog&nbsp;?</p>
|
||||
|
@ -881,8 +881,8 @@ Vous pouvez le récupérer sur <a href="http://github.com/yogsototh/n
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-06-14-multi-language-choices/"/>
|
||||
<content type="html"><p>Je traduis la plupart de mes articles pour qu&rsquo;ils soient disponibles en français et en anglais.
|
||||
La façon que l&rsquo;on m&rsquo;a conseillé était d&rsquo;avoir un fichier par langue. En général ça donne ça.</p>
|
||||
<content type="html"><p>Je traduis la plupart de mes articles pour qu&#8217;ils soient disponibles en français et en anglais.
|
||||
La façon que l&#8217;on m&#8217;a conseillé était d&#8217;avoir un fichier par langue. En général ça donne ça.</p>
|
||||
|
||||
<pre class="twilight">
|
||||
Bonjour,
|
||||
|
@ -899,11 +899,11 @@ here is an example of english text.
|
|||
</pre>
|
||||
|
||||
<p>Cette façon de traduire vous impose une certaine façon de traduire.
|
||||
D&rsquo;abord écrire entièrement le texte dans une langue,
|
||||
D&#8217;abord écrire entièrement le texte dans une langue,
|
||||
puis copier le fichier et enfin retraduire dans une nouvelle langue.</p>
|
||||
|
||||
<p>Le problème, c&rsquo;est que très souvent, les articles ont des parties communes non négligeables. Par exemple, les images, les codes sources, etc&hellip;
|
||||
Lorsque je m&...</p></content>
|
||||
<p>Le problème, c&#8217;est que très souvent, les articles ont des parties communes non négligeables. Par exemple, les images, les codes sources, etc&#8230;
|
||||
Lorsque je m&#...</p></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2010-05-24:/Scratch/fr/blog/2010-05-24-Trees--Pragmatism-and-Formalism/</id>
|
||||
|
@ -922,13 +922,13 @@ Lorsque je m&...</p></content>
|
|||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span>&nbsp;:</p>
|
||||
|
||||
<ul>
|
||||
<li>J&rsquo;ai essayé de programmer un simple filtre&nbsp;;</li>
|
||||
<li>J&rsquo;ai été bloqué pendant deux jours&nbsp;;</li>
|
||||
<li>J&rsquo;ai arrêté de penser comme un robot&nbsp;;</li>
|
||||
<li>J&rsquo;ai utilisé un papier et un stylo&nbsp;;</li>
|
||||
<li>J&rsquo;ai fait un peu de maths&nbsp;;</li>
|
||||
<li>J&rsquo;ai résolu le problème en 10 minutes&nbsp;;</li>
|
||||
<li>Conclusion: Pragmatisme n&rsquo;est pas&nbsp;: &laquo;n&rsquo;utilisez jamais la théorie&raquo;.
|
||||
<li>J&#8217;ai essayé de programmer un simple filtre&nbsp;;</li>
|
||||
<li>J&#8217;ai été bloqué pendant deux jours&nbsp;;</li>
|
||||
<li>J&#8217;ai arrêté de penser comme un robot&nbsp;;</li>
|
||||
<li>J&#8217;ai utilisé un papier et un stylo&nbsp;;</li>
|
||||
<li>J&#8217;ai fait un peu de maths&nbsp;;</li>
|
||||
<li>J&#8217;ai résolu le problème en 10 minutes&nbsp;;</li>
|
||||
<li>Conclusion: Pragmatisme n&#8217;est pas&nbsp;: &laquo;n&#8217;utilisez jamais la théorie&raquo;.
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -946,7 +946,7 @@ Lorsque je m&...</p></content>
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-05-19-How-to-cut-HTML-and-repair-it/"/>
|
||||
<content type="html"><p>Sur ma page d&rsquo;accueil vous pouvez voir la liste des mes derniers articles avec le début de ceux-ci. Pour arriver à faire ça, j&rsquo;ai besoin de couper le code XHTML de mes pages en plein milieu. Il m&rsquo;a donc fallu trouver un moyen de les réparer.</p>
|
||||
<content type="html"><p>Sur ma page d&#8217;accueil vous pouvez voir la liste des mes derniers articles avec le début de ceux-ci. Pour arriver à faire ça, j&#8217;ai besoin de couper le code XHTML de mes pages en plein milieu. Il m&#8217;a donc fallu trouver un moyen de les réparer.</p>
|
||||
|
||||
<p>Prenons un exemple&nbsp;:</p>
|
||||
|
||||
|
@ -960,7 +960,7 @@ Lorsque je m&...</p></content>
|
|||
&lt;/div&gt;
|
||||
</code></pre>
|
||||
|
||||
<p>Après avoir coupé, j&rsquo;obtiens&nbsp;:</p>
|
||||
<p>Après avoir coupé, j&#8217;obtiens&nbsp;:</p>
|
||||
|
||||
<pre><code class="html">&lt;div class="corps"&gt;
|
||||
&lt;div class="intro"&gt;
|
||||
|
@ -980,12 +980,12 @@ Lorsque je m&...</p></content>
|
|||
<content type="html"><p>Bonjour à tous&nbsp;!</p>
|
||||
|
||||
<blockquote cite="http://www.madore.org/~david/weblog/2010-05.html#d.2010-05-12.1752">
|
||||
<p>&hellip;plus on retarde quelque chose, plus il devient difficile de s&rsquo;y mettre&hellip;</p>
|
||||
<p>&#8230;plus on retarde quelque chose, plus il devient difficile de s&#8217;y mettre&#8230;</p>
|
||||
</blockquote>
|
||||
|
||||
<p>Je devais écrire d&rsquo;autres articles pour ce blog. J&rsquo;ai noté plein d&rsquo;idées dans mes <em>todolist</em>. Mais j&rsquo;avais pas mal d&rsquo;autres choses à faire. Et jusqu&rsquo;ici, j&rsquo;ai toujours dit &laquo;je le ferai plus tard&raquo;. Ce qui m&rsquo;a fait agir, c&rsquo;est la petite réflexion que j&rsquo;avais lu une fois.
|
||||
&gt; Arrétez d&rsquo;écrire des <code>TODO</code> dans votre code est faites le maintenant&nbsp;!<br />
|
||||
&gt; Vous serez surpris de l&rsquo;efficacité de cette mesure.</p>
|
||||
<p>Je devais écrire d&#8217;autres articles pour ce blog. J&#8217;ai noté plein d&#8217;idées dans mes <em>todolist</em>. Mais j&#8217;avais pas mal d&#8217;autres choses à faire. Et jusqu&#8217;ici, j&#8217;ai toujours dit &laquo;je le ferai plus tard&raquo;. Ce qui m&#8217;a fait agir, c&#8217;est la petite réflexion que j&#8217;avais lu une fois.
|
||||
&gt; Arrétez d&#8217;écrire des <code>TODO</code> dans votre code est faites le maintenant&nbsp;!<br />
|
||||
&gt; Vous serez surpris de l&#8217;efficacité de cette mesure.</p>
|
||||
|
||||
<p>En résumé&nbsp;:
|
||||
&gt; </p></p></content>
|
||||
|
@ -1002,16 +1002,16 @@ Lorsque je m&...</p></content>
|
|||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-03-23-Encapsulate-git/"/>
|
||||
<content type="html"><p><span class="intro">
|
||||
Voici une solution pour conserver des branches divergentes avec <code>git</code>.
|
||||
Parce qu&rsquo;il est facile de <em>merger</em> par erreur, je propose un script qui encapsule le comportement de <code>git</code> pour interdire certains <em>merges</em> dangereux. Mais qui permet aussi de faire des merges en cascades de la racines vers les autres branches.
|
||||
Parce qu&#8217;il est facile de <em>merger</em> par erreur, je propose un script qui encapsule le comportement de <code>git</code> pour interdire certains <em>merges</em> dangereux. Mais qui permet aussi de faire des merges en cascades de la racines vers les autres branches.
|
||||
</span></p>
|
||||
|
||||
<h2 id="se-prmunir-contre-les-erreurs">Se prémunir contre les erreurs</h2>
|
||||
|
||||
<p>Je travaille sur un projet dans lequel certaines de mes branches <code>git</code> doivent rester divergentes. Et les divergences devraient aller en s&rsquo;accentuant.</p>
|
||||
<p>Je travaille sur un projet dans lequel certaines de mes branches <code>git</code> doivent rester divergentes. Et les divergences devraient aller en s&#8217;accentuant.</p>
|
||||
|
||||
<p>J&rsquo;utilise aussi certaines branches qui contiennent la partie commune de ces projets.</p>
|
||||
<p>J&#8217;utilise aussi certaines branches qui contiennent la partie commune de ces projets.</p>
|
||||
|
||||
<p>Disons que j&rsquo;ai les branches&nbsp;:</p>
|
||||
<p>Disons que j&#8217;ai les branches&nbsp;:</p>
|
||||
|
||||
...</content>
|
||||
</entry>
|
||||
|
@ -1049,7 +1049,7 @@ Parce qu&rsquo;il est facile de <em>merger</em> par erreur, je p
|
|||
|
||||
<p><code>git clone</code> peut seulement récuper la branche <code>master</code>.</p>
|
||||
|
||||
<p>Si vous n&rsquo;avez pas beaucoup de branches, vous pouvez simplement les clone le project et ensuite pour chacune d&rsquo;entre elle lancer la commande suivante&nbsp;:</p>
|
||||
<p>Si vous n&#8217;avez pas beaucoup de branches, vous pouvez simplement les clone le project et ensuite pour chacune d&#8217;entre elle lancer la commande suivante&nbsp;:</p>
|
||||
|
||||
<div>
|
||||
|
||||
|
@ -1065,10 +1065,10 @@ Parce qu&rsquo;il est facile de <em>merger</em> par erreur, je p
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-02-23-When-regexp-is-not-the-best-solution/"/>
|
||||
<content type="html"><p>Les expressions régulières sont très utiles. Cependant, elles ne sont pas toujours la meilleure manière d&rsquo;aborder certain problème autour des chaines de caractères.
|
||||
<content type="html"><p>Les expressions régulières sont très utiles. Cependant, elles ne sont pas toujours la meilleure manière d&#8217;aborder certain problème autour des chaines de caractères.
|
||||
Et surtout quand les transformations que vous voulez accomplir sont simples.</p>
|
||||
|
||||
<p>Je voulais savoir comment récupérer le plus vite possible l&rsquo;extension d&rsquo;un nom de fichier. Il y a trois manière naturelle d&rsquo;accomplir celà&nbsp;:</p>
|
||||
<p>Je voulais savoir comment récupérer le plus vite possible l&#8217;extension d&#8217;un nom de fichier. Il y a trois manière naturelle d&#8217;accomplir celà&nbsp;:</p>
|
||||
|
||||
<div>
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ ext=File.extname(str)
|
|||
|
||||
</div>
|
||||
|
||||
<p>A première vue, je pensais que l&rsquo;expression régulière serait plus rapide que le <code>split</code> parce qu&rsquo;il pouvait y avoir plusieurs de <code>.</code> dans un nom de fichie...</p></content>
|
||||
<p>A première vue, je pensais que l&#8217;expression régulière serait plus rapide que le <code>split</code> parce qu&#8217;il pouvait y avoir plusieurs de <code>.</code> dans un nom de fichie...</p></content>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:yannesposito.com,2010-02-18:/Scratch/fr/blog/2010-02-18-split-a-file-by-keyword/</id>
|
||||
|
@ -1097,8 +1097,8 @@ ext=File.extname(str)
|
|||
<uri>yannesposito.com</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-02-18-split-a-file-by-keyword/"/>
|
||||
<content type="html"><p>Assez bizarrement, je n&rsquo;ai trouvé aucun outil UNIX pour découper un fichier par mot clé.
|
||||
Alors j&rsquo;en ai fait un en <code>awk</code>. Je le met ici principalement pour moi, mais ça peut toujours servir à quelqu&rsquo;un d&rsquo;autre.
|
||||
<content type="html"><p>Assez bizarrement, je n&#8217;ai trouvé aucun outil UNIX pour découper un fichier par mot clé.
|
||||
Alors j&#8217;en ai fait un en <code>awk</code>. Je le met ici principalement pour moi, mais ça peut toujours servir à quelqu&#8217;un d&#8217;autre.
|
||||
Le code suivant découpe un fichier pour chacune de ses ligne contenant le mot <code>UTC</code>.</p>
|
||||
|
||||
<div>
|
||||
|
@ -1114,13 +1114,13 @@ BEGIN{i=0;}
|
|||
|
||||
</div>
|
||||
|
||||
<p>En réalité, j&rsquo;avais besoin de cet outils pour avoir un fichier par jour. Chaque ligne contenant UTC ayant le format suivant&nbsp;:</p>
|
||||
<p>En réalité, j&#8217;avais besoin de cet outils pour avoir un fichier par jour. Chaque ligne contenant UTC ayant le format suivant&nbsp;:</p>
|
||||
|
||||
<pre class="twilight">
|
||||
Mon Dec 7 10:32:30 UTC 2009
|
||||
</pre>
|
||||
|
||||
<p>J&rsquo;en suis finallement arrivé au code suivant&nbsp;:</p>
|
||||
<p>J&#8217;en suis finallement arrivé au code suivant&nbsp;:</p>
|
||||
|
||||
<div>
|
||||
...</div></content>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -107,7 +107,7 @@
|
|||
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Copyright ©, Yann Esposito</a>
|
||||
</div>
|
||||
<div id="lastmod">
|
||||
Modified: 01/23/2013
|
||||
Modified: 01/30/2013
|
||||
</div>
|
||||
<div>
|
||||
Entirely done with
|
||||
|
|
Loading…
Reference in a new issue