Merge branch 'next' into test
Conflicts: .gitignore
This commit is contained in:
commit
8f500575ea
20 changed files with 1708 additions and 1315 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -16,5 +16,9 @@ output/Scratch/*/*/*/index.html
|
||||||
output/Scratch/*/*/*/*/index.html
|
output/Scratch/*/*/*/*/index.html
|
||||||
output/Scratch/*/*/*/*/*/index.html
|
output/Scratch/*/*/*/*/*/index.html
|
||||||
output/Scratch/*/*/*/*/*/*/index.html
|
output/Scratch/*/*/*/*/*/*/index.html
|
||||||
output/Scratch/assets/**/*
|
output/Scratch/assets/css/*.css
|
||||||
crash.log
|
output/Scratch/*/graph
|
||||||
|
output/Scratch/*/*/graph
|
||||||
|
output/Scratch/*/*/*/graph
|
||||||
|
output/Scratch/*/*/*/*/graph
|
||||||
|
output/Scratch/*/*/*/*/*/graph
|
||||||
|
|
|
@ -13,7 +13,8 @@ What you'll need to use it:
|
||||||
|
|
||||||
- [nanoc](nanoc.stoneship.org) → `gem install nanoc`
|
- [nanoc](nanoc.stoneship.org) → `gem install nanoc`
|
||||||
- [zsh](zsh.org) → Installed by default on most good system
|
- [zsh](zsh.org) → Installed by default on most good system
|
||||||
- A bunch of gems: `gem install ultraviolet krambook sass rainpress`
|
- A bunch of gems: `gem install kramdown builder sass rainpress`
|
||||||
|
- Optionally if you want to serve locally: `gem install unicorn rack rack-contrib rack-rewrite mime-types`
|
||||||
|
|
||||||
Optionally
|
Optionally
|
||||||
|
|
||||||
|
|
5
Rules
5
Rules
|
@ -51,14 +51,13 @@ compile '/html/*' do
|
||||||
elsif ext == 'haml' || ext.nil?
|
elsif ext == 'haml' || ext.nil?
|
||||||
filter :haml
|
filter :haml
|
||||||
elsif ext == 'md' || ext == 'markdown'
|
elsif ext == 'md' || ext == 'markdown'
|
||||||
filter :ultraviolet # must be before kramdown
|
filter :code
|
||||||
filter :graph
|
filter :graph
|
||||||
filter :description
|
filter :description
|
||||||
filter :falacy
|
filter :falacy
|
||||||
filter :blogimage
|
filter :blogimage
|
||||||
filter :erb # I'll try not to use ruby anymore inside content
|
filter :erb # I should try to remove all erb code inside markdown
|
||||||
filter :kramdown
|
filter :kramdown
|
||||||
# filter :math_repair # after kramdown
|
|
||||||
filter :fix_img
|
filter :fix_img
|
||||||
else
|
else
|
||||||
raise "Filter is not configured for #{item.identifier} in Rules file."
|
raise "Filter is not configured for #{item.identifier} in Rules file."
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
-----
|
||||||
|
|
||||||
|
-----
|
||||||
@font-face
|
@font-face
|
||||||
font-family: 'cmuntt'
|
font-family: 'cmuntt'
|
||||||
src: url('fonts/cmuntt.eot')
|
src: url('fonts/cmuntt.eot')
|
||||||
|
|
|
@ -19,244 +19,224 @@ $blue : #268bd2
|
||||||
$cyan : #2aa198
|
$cyan : #2aa198
|
||||||
$green : #859900
|
$green : #859900
|
||||||
|
|
||||||
/* $backtext: #FAFAFC */
|
$unit: 16px
|
||||||
$backtext: $base3 + #151515
|
$lineheight: $unit * 1.5
|
||||||
$fronttext: $base02
|
$hmargin: 4*$unit
|
||||||
$hightext: $base03
|
|
||||||
$borderColor: $base2
|
|
||||||
$altback: $base3
|
|
||||||
|
|
||||||
@import url(/Scratch/assets/css/cmufontface.css)
|
html
|
||||||
|
|
||||||
/* General */
|
|
||||||
body
|
|
||||||
font-family: 'Futura', serif
|
|
||||||
font-size: 20px
|
|
||||||
color: $base3
|
|
||||||
background: $base02
|
|
||||||
|
|
||||||
a, a:link, a:visited, a:active, a:hover
|
|
||||||
color: $hightext
|
|
||||||
text-decoration: none
|
|
||||||
outline: none
|
|
||||||
|
|
||||||
a:hover
|
|
||||||
color: $orange
|
|
||||||
|
|
||||||
hr
|
|
||||||
color: $borderColor
|
|
||||||
border:
|
|
||||||
top: 1px solid $borderColor
|
|
||||||
bottom: none
|
|
||||||
left: none
|
|
||||||
right: none
|
|
||||||
|
|
||||||
ul
|
|
||||||
list-style: none
|
|
||||||
padding-left: 0
|
|
||||||
margin-left: 1.5ex
|
|
||||||
text-indent: -1.5ex
|
|
||||||
ol
|
|
||||||
padding-left: 0
|
|
||||||
|
|
||||||
ul li:before
|
|
||||||
content: "- "
|
|
||||||
|
|
||||||
ol li ul, ol li ol, ul li ol, ul li ul
|
|
||||||
margin: .5em 1.5em
|
|
||||||
list-style: none
|
|
||||||
|
|
||||||
/* fix for possible markdown issues */
|
|
||||||
li p, ol p
|
|
||||||
display: inline
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|
||||||
table tr
|
|
||||||
&:nth-child(odd)
|
|
||||||
background-color: $altback
|
|
||||||
table
|
|
||||||
border:
|
|
||||||
top: solid 2px $borderColor
|
|
||||||
bottom: solid 2px $borderColor
|
|
||||||
|
|
||||||
body
|
body
|
||||||
text-rendering: optimizelegibility
|
padding: 0
|
||||||
line-height: 1.5em
|
margin: 0
|
||||||
|
body
|
||||||
h1, h2, h3, h4, h5, h6
|
font-family: Helvetica, sans-serif !important
|
||||||
color: $hightext
|
font-size: $unit
|
||||||
line-height: 1.1em
|
line-height: $lineheight
|
||||||
padding-left: 30px
|
background: $base2
|
||||||
|
|
||||||
/* Header Numbering */
|
|
||||||
.article #afterheader
|
|
||||||
counter-reset: niv02
|
|
||||||
h2
|
|
||||||
counter-increment: niv02
|
|
||||||
counter-reset: niv03
|
|
||||||
marker-offset: 3em
|
|
||||||
&:before
|
|
||||||
content: counter(niv02) ". "
|
|
||||||
h3
|
|
||||||
counter-increment: niv03
|
|
||||||
counter-reset: niv04
|
|
||||||
&:before
|
|
||||||
content: counter(niv02) "." counter(niv03) ". "
|
|
||||||
h4
|
|
||||||
counter-increment: niv04
|
|
||||||
&:before
|
|
||||||
content: counter(niv02) "." counter(niv03) "." counter(niv04) ". "
|
|
||||||
|
|
||||||
p, ul, ol, h1, h2, h3, h4
|
|
||||||
margin-bottom: 30px
|
|
||||||
padding: 0 30px
|
|
||||||
text-align: justify
|
|
||||||
|
|
||||||
pre
|
|
||||||
line-height: 1.1em
|
|
||||||
margin-bottom: 30px
|
|
||||||
padding: 30px
|
|
||||||
overflow: auto
|
|
||||||
background: $base3
|
|
||||||
font-size: 18px
|
|
||||||
|
|
||||||
=sc
|
|
||||||
text-transform: uppercase
|
|
||||||
font-size: 0.8em
|
|
||||||
|
|
||||||
abbr, acronym
|
|
||||||
+sc
|
|
||||||
text:
|
|
||||||
decoration: none
|
|
||||||
border:
|
|
||||||
bottom:
|
|
||||||
width: 0
|
|
||||||
|
|
||||||
// -- TYPOGRAPHY --
|
|
||||||
.small
|
|
||||||
font-size: 0.8em
|
|
||||||
|
|
||||||
.sc
|
|
||||||
+sc
|
|
||||||
|
|
||||||
.clear,.flush
|
|
||||||
clear: both
|
|
||||||
|
|
||||||
.impact, .darkimpact
|
|
||||||
font-size: 2em
|
|
||||||
margin: 0 auto 1em auto
|
|
||||||
line-height: 1.3em
|
|
||||||
|
|
||||||
figure
|
|
||||||
margin: 3em 0
|
|
||||||
img
|
|
||||||
box-shadow: 0 10px 15px #CCC inset
|
|
||||||
figcaption
|
|
||||||
text-align: center
|
|
||||||
margin: .5em 0
|
|
||||||
figure.left, figure.right
|
|
||||||
max-width: 30%
|
|
||||||
|
|
||||||
/* Specific */
|
|
||||||
#afterheader
|
|
||||||
color: $base01
|
color: $base01
|
||||||
background-color: $backtext
|
|
||||||
|
|
||||||
.intro, .resume, blockquote
|
a
|
||||||
font-style: italic
|
text-decoration: none
|
||||||
padding: 0.5em 1em
|
|
||||||
a:hover
|
|
||||||
color: $orange
|
|
||||||
i, em
|
|
||||||
font-style: normal
|
|
||||||
strong, b
|
|
||||||
font-weight: normal
|
|
||||||
|
|
||||||
.intro, .resume
|
|
||||||
font-size: 0.9em
|
|
||||||
|
|
||||||
blockquote
|
|
||||||
border: solid 1px $borderColor
|
|
||||||
background-color: $altback
|
|
||||||
pre, pre code
|
|
||||||
background-color: $base2
|
|
||||||
pre
|
|
||||||
border: solid 1px rgba(0,0,0,0.1)
|
|
||||||
ul
|
|
||||||
padding-left: 1.5em
|
|
||||||
|
|
||||||
section.slide
|
|
||||||
border-color: $borderColor
|
|
||||||
border: solid 1px
|
|
||||||
margin-bottom: 1em
|
|
||||||
padding: .5em
|
|
||||||
font-family: sans-serif
|
|
||||||
font-size: .8em
|
|
||||||
|
|
||||||
.base03
|
|
||||||
color: $base03
|
|
||||||
.base02
|
|
||||||
color: $base02
|
color: $base02
|
||||||
.base01
|
a:visited
|
||||||
color: $base01
|
|
||||||
.base00
|
|
||||||
color: $base00
|
color: $base00
|
||||||
.base0
|
|
||||||
color: $base0
|
|
||||||
.base1
|
|
||||||
color: $base1
|
|
||||||
.base2
|
|
||||||
color: $base2
|
|
||||||
.base3
|
|
||||||
color: $base3
|
|
||||||
.yellow
|
|
||||||
color: $yellow
|
|
||||||
.orange
|
|
||||||
color: $orange
|
|
||||||
.red
|
|
||||||
color: $red
|
|
||||||
.magenta
|
|
||||||
color: $magenta
|
|
||||||
.violet
|
|
||||||
color: $violet
|
|
||||||
.blue
|
|
||||||
color: $blue
|
|
||||||
.cyan
|
|
||||||
color: $cyan
|
|
||||||
.green
|
|
||||||
color: $green
|
|
||||||
|
|
||||||
/* Black page */
|
|
||||||
#blackpage
|
|
||||||
font-family: sans-serif
|
|
||||||
font-style: italic
|
|
||||||
padding-top: 8em
|
|
||||||
z-index: 9000
|
|
||||||
cursor: wait
|
|
||||||
img
|
|
||||||
background: none
|
|
||||||
border: none
|
|
||||||
max-width: 80%
|
|
||||||
margin: 0 auto
|
|
||||||
a
|
|
||||||
cursor: pointer
|
|
||||||
|
|
||||||
.cut
|
#blackpage, #nojsredirect
|
||||||
font-size: .8em
|
top: 0
|
||||||
text-align: right
|
left: 0
|
||||||
display: inline-block
|
|
||||||
width: 100%
|
width: 100%
|
||||||
opacity: 0.3
|
min-height: 100%
|
||||||
|
margin-left: 0
|
||||||
|
margin-right: 0
|
||||||
|
margin-top: 0
|
||||||
|
margin-bottom: 0
|
||||||
|
position: absolute
|
||||||
|
text-align: center
|
||||||
|
background: $base3
|
||||||
|
|
||||||
.cut:hover
|
#content
|
||||||
opacity: 1
|
width: 37*$unit + 2*$hmargin
|
||||||
|
|
||||||
|
|
||||||
/* Layout */
|
|
||||||
#afterheader
|
|
||||||
width: 35em
|
|
||||||
margin: 0 auto
|
margin: 0 auto
|
||||||
|
padding: 0
|
||||||
|
background: $base3 + #111111
|
||||||
|
color: $base01
|
||||||
|
h1,h2,h3,h4,h5,h6
|
||||||
|
color: $base02
|
||||||
|
padding: 0 $hmargin
|
||||||
|
margin: $unit 0
|
||||||
|
figure
|
||||||
|
margin: 0
|
||||||
|
padding: 0
|
||||||
|
figcaption
|
||||||
|
padding: 0 $hmargin
|
||||||
|
margin: $unit 0
|
||||||
|
p
|
||||||
|
padding: 0 $hmargin
|
||||||
|
margin: $unit 0
|
||||||
img
|
img
|
||||||
width: 100%
|
width: 100%
|
||||||
img.left, img.right
|
pre
|
||||||
width: 30%
|
background: $base3
|
||||||
|
font-family: monaco, monospace
|
||||||
|
overflow: auto
|
||||||
|
padding: $unit
|
||||||
|
line-height: $unit + 2px
|
||||||
|
border-top: solid 1px $base2
|
||||||
|
border-bottom: solid 1px $base2
|
||||||
|
pre code
|
||||||
|
background: $base3
|
||||||
|
ul
|
||||||
|
list-style: none
|
||||||
|
ul li:before
|
||||||
|
content: "- "
|
||||||
|
ul
|
||||||
|
padding-left: 0
|
||||||
|
margin: $unit $hmargin
|
||||||
|
// width of '-'
|
||||||
|
text-indent: -($unit/2)
|
||||||
|
ol
|
||||||
|
padding-left: 0
|
||||||
|
margin: $unit $hmargin
|
||||||
|
.toc
|
||||||
|
ol li, ul li
|
||||||
|
margin: ($unit/2) 0
|
||||||
|
ol li ul, ol li ol, ul li ol, ul li ul
|
||||||
|
margin: ($unit/2) (3*$unit/2)
|
||||||
|
list-style: none
|
||||||
|
li p
|
||||||
|
display: inline
|
||||||
|
margin: 0
|
||||||
|
padding: 0
|
||||||
|
|
||||||
|
#entete > #choix > #choixrss
|
||||||
|
margin: 0
|
||||||
|
padding: 0
|
||||||
|
#entete > #choix > #choixlang
|
||||||
|
float: left
|
||||||
|
|
||||||
|
#choix
|
||||||
|
font-size: (3*$unit / 4)
|
||||||
|
padding: 0 $unit
|
||||||
|
.return
|
||||||
|
float: right
|
||||||
|
.cut
|
||||||
|
font-size: (3*$unit / 4)
|
||||||
|
opacity: .5
|
||||||
|
.cut:hover
|
||||||
|
opacity: 1
|
||||||
|
hr
|
||||||
|
color: $base2
|
||||||
|
border-color: $base2
|
||||||
|
margin: 0 ($unit / 4)
|
||||||
|
p code, li code
|
||||||
|
padding: 1px 2px
|
||||||
|
background: $base3
|
||||||
|
border: solid 1px $base2
|
||||||
|
blockquote
|
||||||
|
border: solid 1px $base2
|
||||||
|
background: $base3
|
||||||
|
code
|
||||||
|
background: $base2
|
||||||
|
border: solid 1px rgba(0,0,0,0.1)
|
||||||
|
|
||||||
|
// Specific elements
|
||||||
|
#social,#choixrss,#comment
|
||||||
|
margin: $unit $hmargin
|
||||||
|
#social
|
||||||
|
float: left
|
||||||
|
opacity: 0.3
|
||||||
|
&:hover
|
||||||
|
opacity: 1
|
||||||
|
#choixrss
|
||||||
|
float: right
|
||||||
|
opacity: 0.3
|
||||||
|
&:hover
|
||||||
|
opacity: 1
|
||||||
|
#comment
|
||||||
|
img
|
||||||
|
width: auto
|
||||||
|
max-width: 100%
|
||||||
|
.intro
|
||||||
|
font-size: 14px
|
||||||
|
line-height: 21px
|
||||||
|
color: $base02
|
||||||
|
.left
|
||||||
|
float: left
|
||||||
|
.right
|
||||||
|
float: right
|
||||||
|
.flush
|
||||||
|
clear: both
|
||||||
|
|
||||||
|
#bottom
|
||||||
|
padding: $unit 0
|
||||||
|
background: $base2
|
||||||
|
text-align: center
|
||||||
|
font-size: 14px
|
||||||
|
line-height: 21px
|
||||||
|
#entete
|
||||||
|
padding: $unit 0
|
||||||
|
background: $base2
|
||||||
|
text-align: center
|
||||||
|
ul
|
||||||
|
text-indent: 0
|
||||||
|
ul li:before
|
||||||
|
content: ""
|
||||||
|
ul li
|
||||||
|
display: inline-block
|
||||||
|
span.active
|
||||||
|
color: $yellow
|
||||||
|
ul li > *
|
||||||
|
padding: 2px $unit
|
||||||
|
border: solid
|
||||||
|
#previous_articles
|
||||||
|
float: left
|
||||||
|
text-align: left
|
||||||
|
#next_articles
|
||||||
|
float: right
|
||||||
|
text-align: right
|
||||||
|
.corps
|
||||||
|
padding-bottom: 2*$unit
|
||||||
|
|
||||||
|
#tagcloud
|
||||||
|
margin: $unit $hmargin
|
||||||
|
font-size: 14px
|
||||||
|
line-height: 21px
|
||||||
|
#sousliens.archive > ul
|
||||||
|
display: none
|
||||||
|
#sousliens.archive > h4:hover
|
||||||
|
cursor: pointer
|
||||||
|
#hiddenDivs > div
|
||||||
|
display: none
|
||||||
|
.list
|
||||||
|
margin: $unit $hmargin
|
||||||
|
#content img#mainlogo
|
||||||
|
width: auto
|
||||||
|
margin: 0 auto
|
||||||
|
display: block
|
||||||
|
max-width: 100%
|
||||||
|
.date, .day, .month, .year
|
||||||
|
display: inline-block
|
||||||
|
padding-left: 10px
|
||||||
|
text-align: right
|
||||||
|
.day
|
||||||
|
width: 10px
|
||||||
|
.month
|
||||||
|
width: 20px
|
||||||
|
.year
|
||||||
|
width: 30px
|
||||||
|
.date
|
||||||
|
margin-right: 10px
|
||||||
|
|
||||||
|
.popularblock
|
||||||
|
display: block
|
||||||
|
float: left
|
||||||
|
margin: 1.5%
|
||||||
|
width: 30%
|
||||||
|
figure
|
||||||
|
width: 100%
|
||||||
|
height: 120px
|
||||||
|
overflow: hidden
|
||||||
|
figcaption
|
||||||
|
display: none
|
||||||
|
|
||||||
|
|
196
lib/graph.mp
Normal file
196
lib/graph.mp
Normal file
|
@ -0,0 +1,196 @@
|
||||||
|
% solarized color scheme
|
||||||
|
color baseZeroThree, baseZeroTwo, baseZeroOne, baseZeroZero
|
||||||
|
, baseZero, baseOne, baseTwo, baseThree, yellow, orange
|
||||||
|
, red, magenta, violet, blue, cyan, green;
|
||||||
|
baseZeroThree :=(0.0 ,0.168627450980392,0.211764705882353);
|
||||||
|
baseZeroTwo :=(0.0274509803921569,0.211764705882353,0.258823529411765);
|
||||||
|
baseZeroOne :=(0.345098039215686 ,0.431372549019608,0.458823529411765);
|
||||||
|
baseZeroZero :=(0.396078431372549 ,0.482352941176471,0.513725490196078);
|
||||||
|
baseZero :=(0.513725490196078 ,0.580392156862745,0.588235294117647);
|
||||||
|
baseOne :=(0.576470588235294 ,0.631372549019608,0.631372549019608);
|
||||||
|
baseTwo :=(0.933333333333333 ,0.909803921568627,0.835294117647059);
|
||||||
|
baseThree :=(0.992156862745098 ,0.964705882352941,0.890196078431372);
|
||||||
|
yellow :=(0.709803921568627 ,0.537254901960784,0.0);
|
||||||
|
orange :=(0.796078431372549 ,0.294117647058824,0.0862745098039216);
|
||||||
|
red :=(0.862745098039216 ,0.196078431372549,0.184313725490196);
|
||||||
|
magenta :=(0.827450980392157 ,0.211764705882353,0.509803921568627);
|
||||||
|
violet :=(0.423529411764706 ,0.443137254901961,0.768627450980392);
|
||||||
|
blue :=(0.149019607843137 ,0.545098039215686,0.823529411764706);
|
||||||
|
cyan :=(0.164705882352941 ,0.631372549019608,0.596078431372549);
|
||||||
|
green :=(0.52156862745098 ,0.6 ,0.0);
|
||||||
|
|
||||||
|
|
||||||
|
vardef shorten(expr p,d) =
|
||||||
|
path q,bcirc,ecirc;
|
||||||
|
bcirc := fullcircle scaled d shifted point 0 of p;
|
||||||
|
ecirc := fullcircle scaled d shifted point length(p) of p;
|
||||||
|
q := p cutbefore bcirc cutafter ecirc;
|
||||||
|
q
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
%%%%%%%%%%%%%%%%%%%%
|
||||||
|
% Automata drawing %
|
||||||
|
%%%%%%%%%%%%%%%%%%%%
|
||||||
|
u:=.5cm; % unity
|
||||||
|
gu:=5u; % distance between states
|
||||||
|
|
||||||
|
% -- Generic private functions
|
||||||
|
|
||||||
|
% return the edge between points A and B.
|
||||||
|
% out angle from A is inan
|
||||||
|
% in angle to B is outan
|
||||||
|
% nodesize is the size of the node
|
||||||
|
vardef _edgeFullParam(expr posA,posB,inan,outan,nodesize) =
|
||||||
|
path sub;
|
||||||
|
if (posA = posB):
|
||||||
|
pair ba,ea,b;
|
||||||
|
path circ,p;
|
||||||
|
b :=posA shifted (0,nodesize);
|
||||||
|
p:=posA{1,1}..b..{1,-1}cycle;
|
||||||
|
circ:= fullcircle scaled nodesize shifted posA;
|
||||||
|
ba = circ intersectionpoint (subpath (0,1) of p);
|
||||||
|
ea = circ intersectionpoint (subpath (1,2) of p);
|
||||||
|
sub:= ba{1,1}..b..{1,-1}ea;
|
||||||
|
else:
|
||||||
|
path s; s := posA {dir inan} .. {dir outan} posB ;
|
||||||
|
pair bA;
|
||||||
|
pair bA; bA = (fullcircle scaled nodesize shifted posA) intersectionpoint s;
|
||||||
|
pair eB; eB = (fullcircle scaled nodesize shifted posB) intersectionpoint s;
|
||||||
|
sub := bA {dir inan} .. {dir outan} eB ;
|
||||||
|
fi
|
||||||
|
sub
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
% return a picture of the label l for edge e
|
||||||
|
vardef _edgelabel(expr e,l) =
|
||||||
|
picture ret;
|
||||||
|
pair mid;
|
||||||
|
mid := point 1/2length(e) of e;
|
||||||
|
numeric an;
|
||||||
|
an := angle (direction 1/2length(e) of e);
|
||||||
|
picture lab;
|
||||||
|
pair height,width;
|
||||||
|
lab:=thelabel(l,origin);
|
||||||
|
height:=(0,ypart (ulcorner l - llcorner l));
|
||||||
|
width:=(ypart (urcorner l - ulcorner l),0);
|
||||||
|
if (an>-35) and (an<35):
|
||||||
|
ret:=lab shifted height rotated an shifted mid;
|
||||||
|
elseif (an>145) or (an<-145):
|
||||||
|
ret:=thelabel(l,origin) shifted height rotated (an+180) shifted mid;
|
||||||
|
elseif (an>75) and (an<120):
|
||||||
|
ret:=lab shifted mid shifted -width;
|
||||||
|
elseif (an>-120) and (an<-75):
|
||||||
|
ret:=lab shifted mid shifted width;
|
||||||
|
else:
|
||||||
|
ret:=lab shifted mid shifted height;
|
||||||
|
fi;
|
||||||
|
ret
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
% draw an edge
|
||||||
|
def _drawEdgeFullParam(expr posA,posB,l,inan,outan,nodesize) =
|
||||||
|
path sub;
|
||||||
|
picture lab;
|
||||||
|
sub := _edgeFullParam(posA,posB,inan,outan,nodesize);
|
||||||
|
drawarrow sub;
|
||||||
|
draw _edgelabel(sub,l);
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
|
||||||
|
% --- LABELED GRAPHS ---
|
||||||
|
% return the edge between points A and B.
|
||||||
|
% out angle from A is inan
|
||||||
|
vardef edgeAngle(expr posA,posB,an) =
|
||||||
|
path sub;
|
||||||
|
sub := _edgeFullParam(posA,posB,an,-an,1.2u);
|
||||||
|
sub
|
||||||
|
enddef;
|
||||||
|
% return the direct edge between A and B
|
||||||
|
vardef edge(expr posA,posB) =
|
||||||
|
numeric an;
|
||||||
|
an := angle(posB-posA);
|
||||||
|
path sub;
|
||||||
|
sub := _edgeFullParam(posA,posB,an,an,1.2u);
|
||||||
|
sub
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
% --- UNLABELED GRAPHS ---
|
||||||
|
% return the edge between points A and B.
|
||||||
|
% out angle from A is inan
|
||||||
|
vardef nl_edgeAngle(expr posA,posB,an) =
|
||||||
|
path sub;
|
||||||
|
sub := _edgeFullParam(posA,posB,an,-an,6);
|
||||||
|
sub
|
||||||
|
enddef;
|
||||||
|
% return the direct edge between A and B
|
||||||
|
vardef nl_edge(expr posA,posB) =
|
||||||
|
numeric an;
|
||||||
|
an := angle(posB-posA);
|
||||||
|
path sub;
|
||||||
|
sub := _edgeFullParam(posA,posB,an,an,6);
|
||||||
|
sub
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
def drawloop(expr a,b,l) =
|
||||||
|
pair ba,ea;
|
||||||
|
path circ,p,s;
|
||||||
|
p:=a{1,1}..b..{1,-1}cycle;
|
||||||
|
circ:= fullcircle scaled 6 shifted a;
|
||||||
|
ba = circ intersectionpoint (subpath (0,1) of p);
|
||||||
|
ea = circ intersectionpoint (subpath (1,2) of p);
|
||||||
|
s:= ba{1,1}..b..{1,-1}ea;
|
||||||
|
drawarrow s;
|
||||||
|
label.top(l,b);
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
def drawLoop(expr a,l) =
|
||||||
|
pair b; b:=a shifted (0,u);
|
||||||
|
pair ba,ea;
|
||||||
|
path circ,p,s;
|
||||||
|
p:=a{1,1}..b..{1,-1}cycle;
|
||||||
|
circ:= fullcircle scaled 1.2u shifted a;
|
||||||
|
ba = circ intersectionpoint (subpath (0,1) of p);
|
||||||
|
ea = circ intersectionpoint (subpath (1,2) of p);
|
||||||
|
s:= ba{1,1}..b..{1,-1}ea;
|
||||||
|
drawarrow s;
|
||||||
|
label.top(l,b);
|
||||||
|
enddef;
|
||||||
|
def drawstate(expr pos) =
|
||||||
|
draw pos withpen pencircle scaled 4bp;
|
||||||
|
enddef;
|
||||||
|
def drawedgeWithDoubleAngle(expr posA,posB,l,inan,outan) =
|
||||||
|
_drawEdgeFullParam(posA,posB,l,inan,outan,6);
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
def drawedgeangle(expr posA,posB,l,an) =
|
||||||
|
_drawEdgeFullParam(posA,posB,l,an,-an,6);
|
||||||
|
enddef;
|
||||||
|
def drawedge(expr posA,posB,l) =
|
||||||
|
numeric an;
|
||||||
|
an=angle(posB-posA);
|
||||||
|
_drawEdgeFullParam(posA,posB,l,an,an,6);
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
def drawState(expr pos,l) =
|
||||||
|
label(l,pos);
|
||||||
|
draw fullcircle scaled u shifted pos;
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
def drawEdgeWithDoubleAngle(expr posA,posB,l,inan,outan) =
|
||||||
|
_drawEdgeFullParam(posA,posB,l,inan,outan,1.2u);
|
||||||
|
enddef;
|
||||||
|
def drawEdgeWithAngle(expr posA,posB,l,an) =
|
||||||
|
drawEdgeWithDoubleAngle(posA,posB,l,an,-an);
|
||||||
|
enddef;
|
||||||
|
def drawEdge(expr posA,posB,l) =
|
||||||
|
numeric an;
|
||||||
|
if (posA = posB):
|
||||||
|
an := 0;
|
||||||
|
else:
|
||||||
|
an=angle(posB-posA);
|
||||||
|
fi
|
||||||
|
drawEdgeWithDoubleAngle(posA,posB,l,an,an);
|
||||||
|
enddef;
|
||||||
|
|
||||||
|
prologues:=3;
|
||||||
|
|
54
lib/graph.rb
54
lib/graph.rb
|
@ -1,6 +1,41 @@
|
||||||
class Graph < Nanoc3::Filter
|
class Graph < Nanoc3::Filter
|
||||||
identifier :graph
|
identifier :graph
|
||||||
@@tmpfic="/tmp/graphtemp.dot"
|
@@tmpfic="/tmp/graphtemp.dot"
|
||||||
|
def solarized(str)
|
||||||
|
str.gsub(
|
||||||
|
%r{color="base03"},'color="#002b36"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="base02"},'color="#073642"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="base01"},'color="#586e75"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="base00"},'color="#657b83"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="base0"},'color="#839496"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="base1"},'color="#93a1a1"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="base2"},'color="#eee8d5"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="base3"},'color="#fdf6e3"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="yellow"},'color="#b58900"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="orange"},'color="#cb4b16"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="red"},'color="#dc322f"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="magenta"},'color="#d33682"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="violet"},'color="#6c71c4"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="blue"},'color="#268bd2"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="cyan"},'color="#2aa198"'
|
||||||
|
).gsub(
|
||||||
|
%r{color="green"},'color="#859900"'
|
||||||
|
)
|
||||||
|
end
|
||||||
def run(content, params={})
|
def run(content, params={})
|
||||||
content.gsub(%r{<graph( title="([^"]*)")?>(.+?)</graph>}m) do |full|
|
content.gsub(%r{<graph( title="([^"]*)")?>(.+?)</graph>}m) do |full|
|
||||||
# FileUtils.rm(@@tmpfic)
|
# FileUtils.rm(@@tmpfic)
|
||||||
|
@ -11,19 +46,24 @@ class Graph < Nanoc3::Filter
|
||||||
f.write %[ digraph Source {
|
f.write %[ digraph Source {
|
||||||
fontsize=10;
|
fontsize=10;
|
||||||
rankdir="LR";
|
rankdir="LR";
|
||||||
graph [truecolor bgcolor="#FAFAFA00"];
|
graph [truecolor bgcolor="#fafafc"];
|
||||||
node [width=0, height=0, fontname="Optima Bold", shape="box", color="#333333", style="filled" fillcolor="#FAFAFA", fontcolor="#333333"] ;
|
node [width=0, height=0, fontname="CMU Serif Italic", shape="circle", color="#657b83", style="filled" fillcolor="#fafafc", fontcolor="#657b83"] ;
|
||||||
edge [arrowsize=.5, color="#333333"] ; ]
|
edge [fontname="CMU Serif Italic", arrowsize=.5, color="#657b83",fontcolor="#657b83"] ; ]
|
||||||
f.write str
|
f.write solarized(str)
|
||||||
f.write %[}]
|
f.write %[}]
|
||||||
end
|
end
|
||||||
FileUtils.mkdir_p('output'+@item.path+'graph')
|
FileUtils.mkdir_p('output'+@item.path+'graph')
|
||||||
webpath=@item.path + 'graph/' + filename + '.png'
|
webpath=@item.path + 'graph/' + filename + '.png'
|
||||||
path='output'+webpath
|
path='output'+webpath
|
||||||
# puts "dot -Tpng -o #{path} /tmp/graphtemp.dot"
|
if str.match(/pos=/)
|
||||||
system("dot -Tpng -o #{path} /tmp/graphtemp.dot")
|
prog="neato"
|
||||||
|
else
|
||||||
|
prog="dot"
|
||||||
|
end
|
||||||
|
# puts "#{prog} -Tpng -o #{path} /tmp/graphtemp.dot"
|
||||||
|
system("#{prog} -Tpng -o #{path} /tmp/graphtemp.dot")
|
||||||
# puts %{<img alt="#{title}" src="#{webpath}"/>}
|
# puts %{<img alt="#{title}" src="#{webpath}"/>}
|
||||||
%{<img alt="#{title}" src="#{webpath}"/>}
|
%{<figure><img alt="#{title}" src="#{webpath}"/><figcaption>#{title}</figcaption></figure>}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
66
lib/mpost.rb
Normal file
66
lib/mpost.rb
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
class MPost < Nanoc3::Filter
|
||||||
|
identifier :mpost
|
||||||
|
@@tmp="/tmp/mp/"
|
||||||
|
@@name=["Zero","One","Two","Three"]
|
||||||
|
def solarized(str)
|
||||||
|
str.gsub(
|
||||||
|
%r{base0([0123])},'base'+@@name[0]+@@name[$1.to_i]
|
||||||
|
).gsub(
|
||||||
|
%r{base([0123])},'base'+@@name[$1.to_i]
|
||||||
|
).gsub(
|
||||||
|
%{red},'s_red'
|
||||||
|
).gsub(
|
||||||
|
%{blue},'s_blue'
|
||||||
|
).gsub(
|
||||||
|
%{green},'s_green'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
def run(content, params={})
|
||||||
|
content.gsub(%r{<mpost( title="([^"]*)")?>(.+?)</mpost>}m) do |full|
|
||||||
|
title=$2
|
||||||
|
str=$3
|
||||||
|
filename=title.gsub(/[^a-zA-Z0-9_]/,"_")
|
||||||
|
# write the mp file using the code
|
||||||
|
code=File.read('lib/graph.mp')
|
||||||
|
code<<=%{beginfig(1)
|
||||||
|
drawoptions (withcolor base01);}
|
||||||
|
code <<= str
|
||||||
|
code <<= %{\nendfig;\nbye;\n}
|
||||||
|
|
||||||
|
# create the directory to compile metapost files
|
||||||
|
FileUtils.mkdir_p(@@tmp)
|
||||||
|
|
||||||
|
# write the code into a temporary file
|
||||||
|
File.open(@@tmp+filename+'.mp','w') do |f|
|
||||||
|
f.write solarized(code)
|
||||||
|
end
|
||||||
|
|
||||||
|
# write the URL of the image
|
||||||
|
imgurl=@item.path + 'mpost/' + filename + '.png'
|
||||||
|
# We compile only if the source changed
|
||||||
|
if not (File.exists?(@@tmp+filename+'.old') and
|
||||||
|
FileUtils.cmp(@@tmp+filename+'.mp', @@tmp+filename+'.old'))
|
||||||
|
then
|
||||||
|
print %{\t[mpost] updating: #{filename}}
|
||||||
|
fspath=FileUtils.pwd+'/output'+imgurl
|
||||||
|
# create the directory for the output file
|
||||||
|
FileUtils.mkdir_p(File.dirname(fspath))
|
||||||
|
|
||||||
|
# Launch the metapost compilation and update
|
||||||
|
# the cache in case of success
|
||||||
|
cmd="cd #{@@tmp} && mpost #{filename}.mp >/dev/null 2>&1 && convert -density 180 #{filename}.1 #{fspath} >/dev/null"
|
||||||
|
if system(cmd)
|
||||||
|
if FileUtils.copy(@@tmp+filename+'.mp',@@tmp+filename+'.old')
|
||||||
|
puts " [SUCCESS]"
|
||||||
|
else
|
||||||
|
puts " [ERROR: couldn't copy]"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts " [ERROR: compilation error; check #{@@tmp}#{filename}.log ]"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# replace the code by the image
|
||||||
|
%{<figure><img alt="#{title}" src="#{imgurl}"/><figcaption>#{title}</figcaption></figure>}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,7 +1,7 @@
|
||||||
class UltraVioletFilter < Nanoc3::Filter
|
class UltraVioletFilter < Nanoc3::Filter
|
||||||
identifier :ultraviolet
|
identifier :code
|
||||||
|
|
||||||
def protect(str)
|
def protect(str)
|
||||||
str.gsub(%r{<([^>]*)>}) do
|
str.gsub(%r{<([^>]*)>}) do
|
||||||
"<#{$1}>"
|
"<#{$1}>"
|
||||||
end
|
end
|
||||||
|
@ -33,4 +33,4 @@ class UltraVioletFilter < Nanoc3::Filter
|
||||||
FileUtils.mkdir_p code_path
|
FileUtils.mkdir_p code_path
|
||||||
File.open(%{#{code_path}/#{@filename}}, 'w'){|f|f.write(@code)}
|
File.open(%{#{code_path}/#{@filename}}, 'w'){|f|f.write(@code)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
pre,code,a.cut{font-family:"cmuntt",Incosolata,Monaco,monospace}body{font-family:"ComputerModern",Georgia,Palatino,"Century Schoolbook L","Times New Roman",Times,serif}
|
|
|
@ -1 +0,0 @@
|
||||||
*{transition-property:all;transition-duration:.5s;-moz-transition-property:all;-moz-transition-duration:.5s;-webkit-transition-property:all;-webkit-transition-duration:.5s;-o-transition-property:all;-o-transition-duration:.5s}#social *,#comment *{transition-property:all;transition-duration:0s;-moz-transition-property:all;-moz-transition-duration:0s;-webkit-transition-property:all;-webkit-transition-duration:0s;-o-transition-property:all;-o-transition-duration:0s}
|
|
File diff suppressed because one or more lines are too long
|
@ -48,7 +48,7 @@
|
||||||
<div class="flush"></div>
|
<div class="flush"></div>
|
||||||
<div id="afterheader">
|
<div id="afterheader">
|
||||||
<div class="corps">
|
<div class="corps">
|
||||||
<p><img alt="The B in Benoît B. Mandelbrot stand for Benoît B. Mandelbrot" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/BenoitBMandelbrot.jpg" /></p>
|
<img alt="The B in Benoît B. Mandelbrot stand for Benoît B. Mandelbrot" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/BenoitBMandelbrot.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -67,7 +67,7 @@ Imperative language could also benefit from this functional organization.</p>
|
||||||
<ul id="markdown-toc">
|
<ul id="markdown-toc">
|
||||||
<li><a href="#introduction">Introduction</a></li>
|
<li><a href="#introduction">Introduction</a></li>
|
||||||
<li><a href="#first-version">First version</a> <ul>
|
<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>
|
<li><a href="#let-us-start">Let us start</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
@ -138,7 +138,7 @@ and something nice to see in 3D.</p>
|
||||||
|
|
||||||
<p>And you can see the intermediate steps to reach this goal:</p>
|
<p>And you can see the intermediate steps to reach this goal:</p>
|
||||||
|
|
||||||
<p><img alt="The parts of the article" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/HGL_Plan.png" /></p>
|
<img alt="The parts of the article" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/HGL_Plan.png" />
|
||||||
|
|
||||||
<p>From the 2<sup>nd</sup> section to the 4<sup>th</sup> it will be <em>dirtier</em> and <em>dirtier</em>.
|
<p>From the 2<sup>nd</sup> section to the 4<sup>th</sup> it will be <em>dirtier</em> and <em>dirtier</em>.
|
||||||
We start cleaning the code at the 5<sup>th</sup> section.</p>
|
We start cleaning the code at the 5<sup>th</sup> section.</p>
|
||||||
|
@ -152,7 +152,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>.
|
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>
|
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">
|
<div class="codehighlight">
|
||||||
|
|
||||||
|
@ -381,20 +381,20 @@ f c z n = if (magnitude z > 2 )
|
||||||
|
|
||||||
<p>Well, if you download this file (look at the bottom of this section), compile it and run it this is the result:</p>
|
<p>Well, if you download this file (look at the bottom of this section), compile it and run it this is the result:</p>
|
||||||
|
|
||||||
<p><img alt="The mandelbrot set version 1" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/hglmandel_v01.png" /></p>
|
<img alt="The mandelbrot set version 1" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/hglmandel_v01.png" />
|
||||||
|
|
||||||
<p>A first very interesting property of this program is that the computation for all the points is done only once.
|
<p>A first very interesting property of this program is that the computation for all the points is done only once.
|
||||||
It is a bit long before the first image appears, but if you resize the window, it updates instantaneously.
|
It is a bit long before the first image appears, but if you resize the window, it updates instantaneously.
|
||||||
This property is a direct consequence of purity.
|
This property is a direct consequence of purity.
|
||||||
If you look closely, you see that <code>allPoints</code> is a pure list.
|
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.
|
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.
|
We did not specified this value should be saved for later use.
|
||||||
It is saved for us.</p>
|
It is saved for us.</p>
|
||||||
|
|
||||||
<p>See what occurs if we make the window bigger:</p>
|
<p>See what occurs if we make the window bigger:</p>
|
||||||
|
|
||||||
<p><img alt="The mandelbrot too wide, black lines and columns" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/hglmandel_v01_too_wide.png" /></p>
|
<img alt="The mandelbrot too wide, black lines and columns" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/hglmandel_v01_too_wide.png" />
|
||||||
|
|
||||||
<p>We see some black lines because we have drawn less point than there is on the surface.
|
<p>We see some black lines because we have drawn less point than there is on the surface.
|
||||||
We can repair this by drawing little squares instead of just points.
|
We can repair this by drawing little squares instead of just points.
|
||||||
|
@ -565,7 +565,7 @@ maxZeroIndex func minval maxval n =
|
||||||
|
|
||||||
<p>No rocket science here. See the result now:</p>
|
<p>No rocket science here. See the result now:</p>
|
||||||
|
|
||||||
<p><img alt="The edges of the mandelbrot set" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/HGLMandelEdges.png" /></p>
|
<img alt="The edges of the mandelbrot set" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/HGLMandelEdges.png" />
|
||||||
|
|
||||||
<div style="display:none">
|
<div style="display:none">
|
||||||
|
|
||||||
|
@ -626,7 +626,7 @@ instead of using a 3D projection of quaternions.
|
||||||
I am pretty sure this construction is not useful for numbers.
|
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>
|
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.
|
most of the code is some OpenGL boilerplate.
|
||||||
If you just want to skim this section,
|
If you just want to skim this section,
|
||||||
here is a high level representation:</p>
|
here is a high level representation:</p>
|
||||||
|
@ -642,7 +642,7 @@ here is a high level representation:</p>
|
||||||
<p>Drawing: </p>
|
<p>Drawing: </p>
|
||||||
|
|
||||||
<ul>
|
<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>
|
<li>Use state to apply some transformations</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
@ -898,7 +898,7 @@ Mainly there are two parts: apply some transformations, draw the object.</p>
|
||||||
|
|
||||||
<h3 id="the-3d-mandelbrot">The 3D Mandelbrot</h3>
|
<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.
|
generate the 3D points and colors.
|
||||||
First, we will set the number of details to 200 pixels in the three dimensions.</p>
|
First, we will set the number of details to 200 pixels in the three dimensions.</p>
|
||||||
|
|
||||||
|
@ -938,7 +938,7 @@ Each three successive point representing the coordinate of each vertex of a tria
|
||||||
<p>In fact, we will provide six ordered points.
|
<p>In fact, we will provide six ordered points.
|
||||||
These points will be used to draw two triangles.</p>
|
These points will be used to draw two triangles.</p>
|
||||||
|
|
||||||
<p><img alt="Explain triangles" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/triangles.png" /></p>
|
<img alt="Explain triangles" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/triangles.png" />
|
||||||
|
|
||||||
<p>The next function is a bit long.
|
<p>The next function is a bit long.
|
||||||
Here is an approximative English version:</p>
|
Here is an approximative English version:</p>
|
||||||
|
@ -1012,7 +1012,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>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>.
|
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>.
|
But it is symmetric relatively to the plan <code>z=0</code>.
|
||||||
Then I mirror these values. </p>
|
Then I mirror these values. </p>
|
||||||
|
@ -1110,7 +1110,7 @@ and change the type signature of <code>f</code> from <code>Complex</code> to <co
|
||||||
|
|
||||||
<p>Here is the result:</p>
|
<p>Here is the result:</p>
|
||||||
|
|
||||||
<p><img alt="A 3D mandelbrot like" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/mandelbrot_3D.png" /></p>
|
<img alt="A 3D mandelbrot like" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/mandelbrot_3D.png" />
|
||||||
|
|
||||||
<p><a href="code/03_Mandelbulb/Mandelbulb.lhs" class="cut">Download the source code of this section → 03_Mandelbulb/<strong>Mandelbulb.lhs</strong> </a></p>
|
<p><a href="code/03_Mandelbulb/Mandelbulb.lhs" class="cut">Download the source code of this section → 03_Mandelbulb/<strong>Mandelbulb.lhs</strong> </a></p>
|
||||||
|
|
||||||
|
@ -1237,7 +1237,7 @@ ymandel x y z = mandel (2*x/width) (2*y/height) (2*z/deep) 64
|
||||||
|
|
||||||
</div>
|
</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.
|
First, all the user interaction code is outside our main file.
|
||||||
I feel it is okay to hide the detail for the rendering.
|
I feel it is okay to hide the detail for the rendering.
|
||||||
But I would have preferred to control the user actions.</p>
|
But I would have preferred to control the user actions.</p>
|
||||||
|
@ -1271,12 +1271,12 @@ We will have two choices: </p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>Our main problem come from user interaction.
|
<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,
|
about how to deal with user interaction with a functional paradigm,
|
||||||
the main answer is to use <em>functional reactive programming</em> (FRP).
|
the main answer is to use <em>functional reactive programming</em> (FRP).
|
||||||
I won’t use FRP in this article.
|
I won’t use FRP in this article.
|
||||||
Instead, I’ll use a simpler while less effective way to deal with user interaction.
|
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>
|
But The method I’ll use will be as pure and functional as possible.</p>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
@ -1298,7 +1298,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>
|
<li>a function taking two parameters: time and world state and render a new world without user interaction.</li>
|
||||||
</ul>
|
</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.
|
The YGL, is a kind of framework to display 3D functions.
|
||||||
But it can easily be extended to many kind of representation.</p>
|
But it can easily be extended to many kind of representation.</p>
|
||||||
|
|
||||||
|
@ -1518,7 +1518,7 @@ idleAction tnew world = world {
|
||||||
<p>Now the function which will generate points in 3D.
|
<p>Now the function which will generate points in 3D.
|
||||||
The first parameter (<code>res</code>) is the resolution of the vertex generation.
|
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.
|
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>.
|
<p>The type <code>Function3D</code> is <code>Point -> Point -> Maybe Point</code>.
|
||||||
Because we consider partial functions
|
Because we consider partial functions
|
||||||
|
@ -1587,7 +1587,7 @@ ymandel x y z = fromIntegral (mandel x y z 64) / 64
|
||||||
|
|
||||||
</div>
|
</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>.
|
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>
|
It is commented a lot.</p>
|
||||||
|
|
||||||
|
@ -1607,8 +1607,8 @@ It is commented a lot.</p>
|
||||||
<p>Our code architecture feel very clean.
|
<p>Our code architecture feel very clean.
|
||||||
All the meaningful code is in our main file and all display details are
|
All the meaningful code is in our main file and all display details are
|
||||||
externalized.
|
externalized.
|
||||||
If you read the code of <code>YGL.hs</code>, you’ll see I didn’t made everything perfect.
|
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.
|
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.
|
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.
|
Unfortunately the program of the preceding session is extremely slow.
|
||||||
We compute the Mandelbulb for each frame now.</p>
|
We compute the Mandelbulb for each frame now.</p>
|
||||||
|
@ -1892,20 +1892,20 @@ ymandel x y z = fromIntegral (mandel x y z 64) / 64
|
||||||
<p>As we can use imperative style in a functional language,
|
<p>As we can use imperative style in a functional language,
|
||||||
know you can use functional style in imperative languages.
|
know you can use functional style in imperative languages.
|
||||||
This article exposed a way to organize some code in a functional way.
|
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,
|
<p>Once you are used to pure functional style,
|
||||||
it is hard not to see all advantages it offers.</p>
|
it is hard not to see all advantages it offers.</p>
|
||||||
|
|
||||||
<p>The code in the two last sections is completely pure and functional.
|
<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,
|
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>
|
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>
|
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.
|
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>
|
Such an optimization would have been harder by using directly the OpenGL library.</p>
|
||||||
|
|
||||||
|
@ -1915,7 +1915,7 @@ O(n².log(n)) to O(n³).</p>
|
||||||
<hr/><div class="footnotes">
|
<hr/><div class="footnotes">
|
||||||
<ol>
|
<ol>
|
||||||
<li id="fn:001">
|
<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>
|
||||||
<li id="fn:011">
|
<li id="fn:011">
|
||||||
<p>Generally in Haskell you need to declare a lot of import lines.
|
<p>Generally in Haskell you need to declare a lot of import lines.
|
||||||
|
@ -2010,10 +2010,14 @@ O(n².log(n)) to O(n³).</p>
|
||||||
next entries
|
next entries
|
||||||
|
|
||||||
<div class="next_article">
|
<div class="next_article">
|
||||||
<a href="/Scratch/en/blog/Category-Theory-Presentation/">Category Theory Presentation <span class="nicer">»</span></a>
|
<a href="/Scratch/en/blog/Category-Theory-Programming/">Category Theory Programming <span class="nicer">»</span></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="next_article">
|
||||||
|
<a href="/Scratch/en/blog/Category-Theory-Presentation/">Category Theory Presentation <span class="nicer">»</span></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -35,6 +35,46 @@ just continue to read as a standard web page.
|
||||||
\(\newcommand{\F}{\mathbf{F}}\)
|
\(\newcommand{\F}{\mathbf{F}}\)
|
||||||
\(\newcommand{\E}{\mathbf{E}}\)
|
\(\newcommand{\E}{\mathbf{E}}\)
|
||||||
\(\newcommand{\C}{\mathc...</div></img></content>
|
\(\newcommand{\C}{\mathc...</div></img></content>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<id>tag:yannesposito.com,2012-10-01:/Scratch/en/blog/Category-Theory-Programming/</id>
|
||||||
|
<title type="html">Category Theory Programming</title>
|
||||||
|
<published>2012-10-01T17:16:43Z</published>
|
||||||
|
<updated>2012-10-01T17:16:43Z</updated>
|
||||||
|
<author>
|
||||||
|
<name>Yann Esposito</name>
|
||||||
|
<uri>yannesposito.com</uri>
|
||||||
|
</author>
|
||||||
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Category-Theory-Programming/"/>
|
||||||
|
<content type="html">
|
||||||
|
<div class="intro">
|
||||||
|
|
||||||
|
|
||||||
|
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> How to program using category theory.</p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"><b>Table of Content</b></span><hr style="width:30%;float:right;border-color:#CCCCD0;margin-top:1em" /></center>
|
||||||
|
|
||||||
|
<ul id="markdown-toc">
|
||||||
|
<li><a href="#introduction">Introduction</a> <ul>
|
||||||
|
<li><a href="#programming-paradigms">Programming Paradigms</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><a href="#get-some-intuition">Get some intuition</a> <ul>
|
||||||
|
<li><a href="#representation-of-category">Representation of Category</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="introduction">Introduction</h2>
|
||||||
|
|
||||||
|
<p>%TODO{Do every...</p></blockquote></div></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2012-06-15:/Scratch/en/blog/Haskell-OpenGL-Mandelbrot/</id>
|
<id>tag:yannesposito.com,2012-06-15:/Scratch/en/blog/Haskell-OpenGL-Mandelbrot/</id>
|
||||||
|
@ -46,7 +86,7 @@ just continue to read as a standard web page.
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Haskell-OpenGL-Mandelbrot/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Haskell-OpenGL-Mandelbrot/"/>
|
||||||
<content type="html"><p><img alt="The B in Benoît B. Mandelbrot stand for Benoît B. Mandelbrot" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/BenoitBMandelbrot.jpg" /></p>
|
<content type="html"><img alt="The B in Benoît B. Mandelbrot stand for Benoît B. Mandelbrot" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/BenoitBMandelbrot.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -60,7 +100,7 @@ The display details will be put in an external module playing the role of a wrap
|
||||||
Imperative language could also benefit from this functional organization.</p>
|
Imperative language could also benefit from this functional organization.</p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"><b>Table of Content</b></span></hr></center></blockquote></div></p></content>
|
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"><b>Table of Content</b></span></hr></center></blockquote></div></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2012-02-08:/Scratch/en/blog/Haskell-the-Hard-Way/</id>
|
<id>tag:yannesposito.com,2012-02-08:/Scratch/en/blog/Haskell-the-Hard-Way/</id>
|
||||||
|
@ -72,7 +112,7 @@ Imperative language could also benefit from this functional organization.</p&
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way/"/>
|
||||||
<content type="html"><p><img alt="Magritte pleasure principle" src="/Scratch/img/blog/Haskell-the-Hard-Way/magritte_pleasure_principle.jpg" /></p>
|
<content type="html"><img alt="Magritte pleasure principle" src="/Scratch/img/blog/Haskell-the-Hard-Way/magritte_pleasure_principle.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -86,7 +126,7 @@ Imperative language could also benefit from this functional organization.</p&
|
||||||
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"><b>Table of Content</b></span><hr style="width:30%;float:right;border-color:#CCCCD0;margin-top:1em" /></center>
|
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"><b>Table of Content</b></span><hr style="width:30%;float:right;border-color:#CCCCD0;margin-top:1em" /></center>
|
||||||
|
|
||||||
|
|
||||||
</hr></center></blockquote></div></p></content>
|
</hr></center></blockquote></div></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2012-02-02:/Scratch/en/blog/Typography-and-the-Web/</id>
|
<id>tag:yannesposito.com,2012-02-02:/Scratch/en/blog/Typography-and-the-Web/</id>
|
||||||
|
@ -98,13 +138,13 @@ Imperative language could also benefit from this functional organization.</p&
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Typography-and-the-Web/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Typography-and-the-Web/"/>
|
||||||
<content type="html"><p><img alt="Screenshot of first in small caps with and without ligatures." src="/Scratch/img/blog/Typography-and-the-Web/first_sc_screenshot.png" /></p>
|
<content type="html"><img alt="Screenshot of first in small caps with and without ligatures." src="/Scratch/img/blog/Typography-and-the-Web/first_sc_screenshot.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<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>
|
</div>
|
||||||
|
@ -119,7 +159,7 @@ We can all create better web typography ourselves, today.»</p>
|
||||||
|
|
||||||
<p>As somebody who tried to make my website using some nice typography features and in particular <em>ligatures</em>, I believe this is wrong.</p>
|
<p>As somebody who tried to make my website using some nice typography features and in particular <em>ligatures</em>, I believe this is wrong.</p>
|
||||||
|
|
||||||
<p>I already made an automa...</p></p></content>
|
<p>I already made an automatic sys...</p></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2012-01-15:/Scratch/en/blog/Yesod-tutorial-for-newbies/</id>
|
<id>tag:yannesposito.com,2012-01-15:/Scratch/en/blog/Yesod-tutorial-for-newbies/</id>
|
||||||
|
@ -131,7 +171,7 @@ We can all create better web typography ourselves, today.»</p>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Yesod-tutorial-for-newbies/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Yesod-tutorial-for-newbies/"/>
|
||||||
<content type="html"><p><img alt="Neo Flying at warp speed" src="/Scratch/img/blog/Yesod-tutorial-for-newbies/flying_neo.jpg" /></p>
|
<content type="html"><img alt="Neo Flying at warp speed" src="/Scratch/img/blog/Yesod-tutorial-for-newbies/flying_neo.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -141,7 +181,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.
|
<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.
|
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>
|
<blockquote>
|
||||||
<center><span class="sc"><b>Table of content</b></span></center>
|
<center><span class="sc"><b>Table of content</b></span></center>
|
||||||
|
@ -154,7 +194,7 @@ You shouldn&rsquo;t need to know Haskell. </p>
|
||||||
<li><a href="#some-last-minute-words">Some last minute words</a></li>
|
<li><a href="#some-last-minute-words">Some last minute words</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
...</ul></blockquote></div></p></content>
|
<li></li></ul></blockquote></div></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-10-20:/Scratch/en/blog/SVG-and-m4-fractals/</id>
|
<id>tag:yannesposito.com,2011-10-20:/Scratch/en/blog/SVG-and-m4-fractals/</id>
|
||||||
|
@ -166,7 +206,7 @@ You shouldn&rsquo;t need to know Haskell. </p>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/SVG-and-m4-fractals/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/SVG-and-m4-fractals/"/>
|
||||||
<content type="html"><p><img alt="Yesod logo made in SVG and m4" src="/Scratch/img/blog/SVG-and-m4-fractals/main.png" /></p>
|
<content type="html"><img alt="Yesod logo made in SVG and m4" src="/Scratch/img/blog/SVG-and-m4-fractals/main.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -183,7 +223,7 @@ Some people where so enthusiastic about <span class="sc">xml</span>
|
||||||
The idea was: the future is <span class="sc">xml</span>.
|
The idea was: the future is <span class="sc">xml</span>.
|
||||||
Then some believed it would be a good idea to invent many <span class="sc">xml</span> compatible format and even programming languages with <span class="sc">xml</span> syntax.</p>
|
Then some believed it would be a good idea to invent many <span class="sc">xml</span> compatible format and even programming languages with <span class="sc">xml</span> syntax.</p>
|
||||||
|
|
||||||
</p></content>
|
<p>Happy...</p></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-10-04:/Scratch/en/blog/Yesod-excellent-ideas/</id>
|
<id>tag:yannesposito.com,2011-10-04:/Scratch/en/blog/Yesod-excellent-ideas/</id>
|
||||||
|
@ -195,7 +235,7 @@ Then some believed it would be a good idea to invent many <span class="sc">
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Yesod-excellent-ideas/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Yesod-excellent-ideas/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/Yesod-excellent-ideas/main.png" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/Yesod-excellent-ideas/main.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -204,7 +244,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><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.
|
<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>
|
Before telling you why you should learn Haskell and use yesod, I will talk about ideas yesod introduced and I didn&#8217;t saw in other frameworks before.</p>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -212,11 +252,11 @@ Before telling you why you should learn Haskell and use yesod, I will talk about
|
||||||
|
|
||||||
<h2 id="type-safety">Type safety</h2>
|
<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>
|
||||||
|
|
||||||
<p><img src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png" alt="SQL injection by a mom" /></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...</p></p></p></content>
|
<p>When you create a web application, a lot of time is spent dealing with ...</p></img></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-09-28:/Scratch/en/blog/Higher-order-function-in-zsh/</id>
|
<id>tag:yannesposito.com,2011-09-28:/Scratch/en/blog/Higher-order-function-in-zsh/</id>
|
||||||
|
@ -228,7 +268,7 @@ Before telling you why you should learn Haskell and use yesod, I will talk about
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Higher-order-function-in-zsh/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Higher-order-function-in-zsh/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/Higher-order-function-in-zsh/main.jpg" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/Higher-order-function-in-zsh/main.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -263,7 +303,7 @@ $ mapa '$1*2' {1..3}
|
||||||
4
|
4
|
||||||
6
|
6
|
||||||
|
|
||||||
$ mapl 'echo result $1' $(m...</code></pre></div></p></content>
|
$ mapl 'echo result $1' $(mapa '$1...</code></pre></div></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-09-28:/Scratch/en/blog/programming-language-experience/</id>
|
<id>tag:yannesposito.com,2011-09-28:/Scratch/en/blog/programming-language-experience/</id>
|
||||||
|
@ -275,7 +315,7 @@ $ mapl 'echo result $1' $(m...</code></pre></div></p></c
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/programming-language-experience/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/programming-language-experience/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/programming-language-experience/dragon.jpg" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/programming-language-experience/dragon.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -287,7 +327,7 @@ $ mapl 'echo result $1' $(m...</code></pre></div></p></c
|
||||||
|
|
||||||
<h3 id="basic"><code>BASIC</code></h3>
|
<h3 id="basic"><code>BASIC</code></h3>
|
||||||
|
|
||||||
<p><img alt="Title image" src="/Scratch/img/blog/programming-language-experience/basic.gif" class=" left" /></p>
|
<img alt="Title image" src="/Scratch/img/blog/programming-language-experience/basic.gif" class=" left" />
|
||||||
|
|
||||||
<p>The language of my firsts programs!
|
<p>The language of my firsts programs!
|
||||||
I was about 10, with an <code>MO5</code> and <code>Amstrad CPC 6128</code> and even with my <code>Atari STe</code>.
|
I was about 10, with an <code>MO5</code> and <code>Amstrad CPC 6128</code> and even with my <code>Atari STe</code>.
|
||||||
|
@ -296,7 +336,7 @@ This is the language of <code>GOTO</code>s.
|
||||||
Unfortunately this might be the only interesting part of this language.</p>
|
Unfortunately this might be the only interesting part of this language.</p>
|
||||||
|
|
||||||
<p>Today this language is obsolescent.
|
<p>Today this language is obsolescent.
|
||||||
It is not even good to lea...</p></p></p></content>
|
It is not even good to learn programming...</p></img></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-08-25:/Scratch/en/blog/Learn-Vim-Progressively/</id>
|
<id>tag:yannesposito.com,2011-08-25:/Scratch/en/blog/Learn-Vim-Progressively/</id>
|
||||||
|
@ -308,7 +348,7 @@ It is not even good to lea...</p></p></p></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/"/>
|
||||||
<content type="html"><p><img alt="Über leet use vim!" src="/Scratch/img/blog/Learn-Vim-Progressively/uber_leet_use_vim.jpg" /></p>
|
<content type="html"><img alt="Über leet use vim!" src="/Scratch/img/blog/Learn-Vim-Progressively/uber_leet_use_vim.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -327,10 +367,10 @@ It is not even good to lea...</p></p></p></content>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p>Learn <a href="http://www.vim.org">vim</a> and it will be your last text editor.
|
<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>
|
It is hard to learn, but incredible to use.</p>
|
||||||
|
|
||||||
<p>I suggest you teach yo...</p></p></content>
|
<p>I suggest you teach yourself ...</p></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-08-17:/Scratch/en/blog/A-more-convenient-diff/</id>
|
<id>tag:yannesposito.com,2011-08-17:/Scratch/en/blog/A-more-convenient-diff/</id>
|
||||||
|
@ -397,7 +437,7 @@ main = putStrLn $ im ...</code></pre></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Password-Management/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/Password-Management/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/Password-Management/main.png" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/Password-Management/main.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -413,12 +453,12 @@ I use a different password on all website.</p>
|
||||||
|
|
||||||
|
|
||||||
<p>Disclamer, this is an unashamed attempt to make you download my iPhone app&nbsp;;-).
|
<p>Disclamer, this is an unashamed attempt to make you download my iPhone app&nbsp;;-).
|
||||||
You&rsquo;re always here?
|
You&#8217;re always here?
|
||||||
Even if you won&rsquo;t download my app, you should read more.
|
Even if you won&#8217;t download my app, you should read more.
|
||||||
My method doesn&rsquo;t necessitate my app.
|
My method doesn&#8217;t necessitate my app.
|
||||||
It is both safe and easy to use everyday.</p>
|
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></p></content>
|
<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>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-04-20:/Scratch/en/blog/2011-04-20-Now-hosted-on-github/</id>
|
<id>tag:yannesposito.com,2011-04-20:/Scratch/en/blog/2011-04-20-Now-hosted-on-github/</id>
|
||||||
|
@ -430,10 +470,10 @@ It is both safe and easy to use everyday.</p>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2011-04-20-Now-hosted-on-github/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2011-04-20-Now-hosted-on-github/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/2011-04-20-Now-hosted-on-github/main.png" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/2011-04-20-Now-hosted-on-github/main.png" />
|
||||||
|
|
||||||
<p>I am now hosted on github.</p>
|
<p>I am now hosted on github.</p>
|
||||||
</p></content>
|
</img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-01-03:/Scratch/en/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/</id>
|
<id>tag:yannesposito.com,2011-01-03:/Scratch/en/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/</id>
|
||||||
|
@ -445,7 +485,7 @@ It is both safe and easy to use everyday.</p>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/main.png" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/main.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="encadre">
|
<div class="encadre">
|
||||||
|
@ -453,7 +493,7 @@ It is both safe and easy to use everyday.</p>
|
||||||
|
|
||||||
<p><em>Update</em>: I might change my mind now. Why?
|
<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.
|
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>
|
</div>
|
||||||
|
@ -469,7 +509,7 @@ And as Denis said: &ldquo;it is time to use Coffeescript as a javascript wit
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<p>Recently I read </p></p></content>
|
<p>Recently I read </p></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-01-01:/Scratch/en/blog/2011-01-03-Happy-New-Year/</id>
|
<id>tag:yannesposito.com,2011-01-01:/Scratch/en/blog/2011-01-03-Happy-New-Year/</id>
|
||||||
|
@ -532,7 +572,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><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>
|
</div>
|
||||||
|
@ -541,7 +581,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.
|
<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>
|
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.
|
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.
|
But in the end I was really impressed by the code I get.
|
||||||
It was really clean.
|
It was really clean.
|
||||||
|
@ -557,7 +597,7 @@ This is even more impressive know...</p></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2010-10-10-Secure-eMail-on-Mac-in-few-steps/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2010-10-10-Secure-eMail-on-Mac-in-few-steps/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/2010-10-10-Secure-eMail-on-Mac-in-few-steps/main.png" class="clean " /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/2010-10-10-Secure-eMail-on-Mac-in-few-steps/main.png" class="clean " />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -578,12 +618,12 @@ This is even more impressive know...</p></content>
|
||||||
</div>
|
</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.
|
I am now suprised how easy it was.
|
||||||
Some years ago it was far more difficult.
|
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>
|
||||||
|
|
||||||
</p></content>
|
<h2 id="why-is-it-important">Why ...</h2></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-10-06:/Scratch/en/blog/2010-10-06-New-Blog-Design-Constraints/</id>
|
<id>tag:yannesposito.com,2010-10-06:/Scratch/en/blog/2010-10-06-New-Blog-Design-Constraints/</id>
|
||||||
|
@ -605,7 +645,7 @@ But the major problem came from, <code>font-shadow</code> and gradie
|
||||||
Then my new design obey to the following rules:</p>
|
Then my new design obey to the following rules:</p>
|
||||||
|
|
||||||
<ul>
|
<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>no text shadow,</li>
|
||||||
<li>clean (I mean delete) most javascript.</li>
|
<li>clean (I mean delete) most javascript.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -626,7 +666,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.
|
<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.
|
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.
|
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.
|
<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.
|
And fortunately I can know the last date of <em>real</em> change of a file.
|
||||||
|
@ -678,8 +718,8 @@ NSString *hex_hash = [self hex_sha1:@"some NSString to be sha1'ed"];
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2010-08-31-send-mail-from-command-line-with-attached-file/"/>
|
<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.
|
<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 was surprised it isn&#8217;t straightforward at all.
|
||||||
I didn&rsquo;t had <code>pine</code> nor <code>mutt</code> or anything like that.
|
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>
|
Just <code>mail</code> and <code>mailx</code>.</p>
|
||||||
|
|
||||||
<p>What Internet say (via google) is</p>
|
<p>What Internet say (via google) is</p>
|
||||||
|
@ -689,7 +729,7 @@ Just <code>mail</code> and <code>mailx</code>.</p>
|
||||||
|
|
||||||
<p>I tried it.
|
<p>I tried it.
|
||||||
And it works almost each times.
|
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>.
|
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.
|
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>
|
Instead of having an attached file I saw this in my email.</p>
|
||||||
|
@ -737,8 +777,42 @@ require 'rack-rewr...</code></pre></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2010-07-09-Indecidabilities/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2010-07-09-Indecidabilities/"/>
|
||||||
<content type="html">
|
<content type="html"><p>&lt;% # toremove_ %&gt;</p>
|
||||||
</content>
|
|
||||||
|
|
||||||
|
<div class="intro">
|
||||||
|
|
||||||
|
|
||||||
|
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> I pretend to create a world to give examples of different meanings behind the word <em>undecidability</em>:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Undecidability due to measure errors, </li>
|
||||||
|
<li>Big errors resulting from small initial measure error,</li>
|
||||||
|
<li>Fractal undecidability&nbsp;;</li>
|
||||||
|
<li>Logic Undecidability.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="corps">
|
||||||
|
|
||||||
|
|
||||||
|
<h1 class="first" id="the-undecidabilities">The Undecidabilities</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="intro">
|
||||||
|
|
||||||
|
|
||||||
|
<p>If a demiurge made our world, he certainly had a great sense of humor.
|
||||||
|
After this read, you should be convinced.
|
||||||
|
I&#8217;ll pretend to be him.
|
||||||
|
I&#8217;ll create a simplified world.
|
||||||
|
A world that obey to simple ma...</p></div></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-07-31:/Scratch/en/blog/2010-07-31-New-style-after-holidays/</id>
|
<id>tag:yannesposito.com,2010-07-31:/Scratch/en/blog/2010-07-31-New-style-after-holidays/</id>
|
||||||
|
@ -769,7 +843,7 @@ I was inspired by Readability and iBooks<small>&copy;</small> (t
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/en/blog/2010-07-07-CSS-rendering-problems-by-navigator/"/>
|
<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.
|
<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>
|
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>
|
<ol>
|
||||||
|
@ -803,7 +877,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>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>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>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>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
@ -929,7 +1003,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><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>Portable with and without javascript, XHTML Strict 1.0 / CSS3,</li>
|
||||||
<li>Write in markdown format (no HTML editing needed),</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>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-06-14:/Scratch/en/blog/2010-06-14-multi-language-choices/</id>
|
<id>tag:yannesposito.com,2010-06-14:/Scratch/en/blog/2010-06-14-multi-language-choices/</id>
|
||||||
|
@ -960,12 +1034,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>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>
|
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.
|
<p>This is why I preferred to handle it differently.
|
||||||
I use <em>tags</em> on a single file.
|
I use <em>tags</em> on a single file.
|
||||||
Finally my files...</p></content>
|
Finally my files ...</p></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-05-24:/Scratch/en/blog/2010-05-24-Trees--Pragmatism-and-Formalism/</id>
|
<id>tag:yannesposito.com,2010-05-24:/Scratch/en/blog/2010-05-24-Trees--Pragmatism-and-Formalism/</id>
|
||||||
|
@ -990,7 +1064,7 @@ Finally my files...</p></content>
|
||||||
<li>Used a pen and a sheet of paper</li>
|
<li>Used a pen and a sheet of paper</li>
|
||||||
<li>Made some math.</li>
|
<li>Made some math.</li>
|
||||||
<li>Crushed the problem in 10 minutes</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>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1052,14 +1126,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>
|
<p>The more you wait to do something, the more difficult it is to start doing it.</p>
|
||||||
</blockquote>
|
</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; 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:
|
<p>In short:
|
||||||
&gt; <strong>Just do it!</strong> ou <strong>Juste fait le</strong> comme auraient dit les nuls.</p>
|
&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>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-03-23:/Scratch/en/blog/2010-03-23-Encapsulate-git/</id>
|
<id>tag:yannesposito.com,2010-03-23:/Scratch/en/blog/2010-03-23-Encapsulate-git/</id>
|
||||||
|
@ -1125,7 +1199,7 @@ clientB: project adapted for client B</p>
|
||||||
|
|
||||||
<p><code>git clone</code> can only fetch the master branch.</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>
|
<div>
|
||||||
|
|
||||||
|
@ -1173,47 +1247,4 @@ ext=File.extname(str)
|
||||||
|
|
||||||
</content>
|
</content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
|
||||||
<id>tag:yannesposito.com,2010-02-18:/Scratch/en/blog/2010-02-18-split-a-file-by-keyword/</id>
|
|
||||||
<title type="html">split a file by keyword</title>
|
|
||||||
<published>2010-02-18T13:29:14Z</published>
|
|
||||||
<updated>2010-02-18T13:29:14Z</updated>
|
|
||||||
<author>
|
|
||||||
<name>Yann Esposito</name>
|
|
||||||
<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.
|
|
||||||
The following code split a file for each line containing the word <code>UTC</code>.</p>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<pre><code class="perl">#!/usr/bin/env awk
|
|
||||||
BEGIN{i=0;}
|
|
||||||
/UTC/ {
|
|
||||||
i+=1;
|
|
||||||
FIC=sprintf("fic.%03d",i);
|
|
||||||
}
|
|
||||||
{print $0&gt;&gt;FIC}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p>In my real world example, I wanted one file per day, each line containing UTC being in the following format:</p>
|
|
||||||
|
|
||||||
<pre class="twilight">
|
|
||||||
Mon Dec 7 10:32:30 UTC 2009
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<p>I then finished with the following code:</p>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<pre><code class="perl">#!/usr/bin/env awk
|
|
||||||
BEGIN{i=0;}
|
|
||||||
/UTC/ {
|
|
||||||
date=$1$2$3;
|
|
||||||
if ( date != olddate ) {
|
|
||||||
...</code></pre></div></content>
|
|
||||||
</entry>
|
|
||||||
</feed>
|
</feed>
|
||||||
|
|
|
@ -48,13 +48,13 @@
|
||||||
<div class="flush"></div>
|
<div class="flush"></div>
|
||||||
<div id="afterheader">
|
<div id="afterheader">
|
||||||
<div class="corps">
|
<div class="corps">
|
||||||
<p><img alt="The B in Benoît B. Mandelbrot stand for Benoît B. Mandelbrot" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/BenoitBMandelbrot.jpg" /></p>
|
<img alt="The B in Benoît B. Mandelbrot stand for Benoît B. Mandelbrot" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/BenoitBMandelbrot.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<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.
|
Vous pourrez voir un ensemble de Mandelbrot étendu à la troisième dimension.
|
||||||
De plus le code sera très propre.
|
De plus le code sera très propre.
|
||||||
Les détails de rendu sont séparés dans un module externe.
|
Les détails de rendu sont séparés dans un module externe.
|
||||||
|
@ -67,7 +67,7 @@ Vous pouvez vous inspirer de ce code utilisant le paradigme fonctional dans tous
|
||||||
<ul id="markdown-toc">
|
<ul id="markdown-toc">
|
||||||
<li><a href="#introduction">Introduction</a></li>
|
<li><a href="#introduction">Introduction</a></li>
|
||||||
<li><a href="#first-version">First version</a> <ul>
|
<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>
|
<li><a href="#let-us-start">Let us start</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
@ -138,7 +138,7 @@ and something nice to see in 3D.</p>
|
||||||
|
|
||||||
<p>And you can see the intermediate steps to reach this goal:</p>
|
<p>And you can see the intermediate steps to reach this goal:</p>
|
||||||
|
|
||||||
<p><img alt="The parts of the article" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/HGL_Plan.png" /></p>
|
<img alt="The parts of the article" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/HGL_Plan.png" />
|
||||||
|
|
||||||
<p>From the 2<sup>nd</sup> section to the 4<sup>th</sup> it will be <em>dirtier</em> and <em>dirtier</em>.
|
<p>From the 2<sup>nd</sup> section to the 4<sup>th</sup> it will be <em>dirtier</em> and <em>dirtier</em>.
|
||||||
We start cleaning the code at the 5<sup>th</sup> section.</p>
|
We start cleaning the code at the 5<sup>th</sup> section.</p>
|
||||||
|
@ -152,7 +152,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>.
|
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>
|
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">
|
<div class="codehighlight">
|
||||||
|
|
||||||
|
@ -381,20 +381,20 @@ f c z n = if (magnitude z > 2 )
|
||||||
|
|
||||||
<p>Well, if you download this file (look at the bottom of this section), compile it and run it this is the result:</p>
|
<p>Well, if you download this file (look at the bottom of this section), compile it and run it this is the result:</p>
|
||||||
|
|
||||||
<p><img alt="The mandelbrot set version 1" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/hglmandel_v01.png" /></p>
|
<img alt="The mandelbrot set version 1" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/hglmandel_v01.png" />
|
||||||
|
|
||||||
<p>A first very interesting property of this program is that the computation for all the points is done only once.
|
<p>A first very interesting property of this program is that the computation for all the points is done only once.
|
||||||
It is a bit long before the first image appears, but if you resize the window, it updates instantaneously.
|
It is a bit long before the first image appears, but if you resize the window, it updates instantaneously.
|
||||||
This property is a direct consequence of purity.
|
This property is a direct consequence of purity.
|
||||||
If you look closely, you see that <code>allPoints</code> is a pure list.
|
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.
|
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.
|
We did not specified this value should be saved for later use.
|
||||||
It is saved for us.</p>
|
It is saved for us.</p>
|
||||||
|
|
||||||
<p>See what occurs if we make the window bigger:</p>
|
<p>See what occurs if we make the window bigger:</p>
|
||||||
|
|
||||||
<p><img alt="The mandelbrot too wide, black lines and columns" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/hglmandel_v01_too_wide.png" /></p>
|
<img alt="The mandelbrot too wide, black lines and columns" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/hglmandel_v01_too_wide.png" />
|
||||||
|
|
||||||
<p>We see some black lines because we have drawn less point than there is on the surface.
|
<p>We see some black lines because we have drawn less point than there is on the surface.
|
||||||
We can repair this by drawing little squares instead of just points.
|
We can repair this by drawing little squares instead of just points.
|
||||||
|
@ -565,7 +565,7 @@ maxZeroIndex func minval maxval n =
|
||||||
|
|
||||||
<p>No rocket science here. See the result now:</p>
|
<p>No rocket science here. See the result now:</p>
|
||||||
|
|
||||||
<p><img alt="The edges of the mandelbrot set" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/HGLMandelEdges.png" /></p>
|
<img alt="The edges of the mandelbrot set" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/HGLMandelEdges.png" />
|
||||||
|
|
||||||
<div style="display:none">
|
<div style="display:none">
|
||||||
|
|
||||||
|
@ -626,7 +626,7 @@ instead of using a 3D projection of quaternions.
|
||||||
I am pretty sure this construction is not useful for numbers.
|
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>
|
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.
|
most of the code is some OpenGL boilerplate.
|
||||||
If you just want to skim this section,
|
If you just want to skim this section,
|
||||||
here is a high level representation:</p>
|
here is a high level representation:</p>
|
||||||
|
@ -642,7 +642,7 @@ here is a high level representation:</p>
|
||||||
<p>Drawing: </p>
|
<p>Drawing: </p>
|
||||||
|
|
||||||
<ul>
|
<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>
|
<li>Use state to apply some transformations</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
@ -898,7 +898,7 @@ Mainly there are two parts: apply some transformations, draw the object.</p>
|
||||||
|
|
||||||
<h3 id="the-3d-mandelbrot">The 3D Mandelbrot</h3>
|
<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.
|
generate the 3D points and colors.
|
||||||
First, we will set the number of details to 200 pixels in the three dimensions.</p>
|
First, we will set the number of details to 200 pixels in the three dimensions.</p>
|
||||||
|
|
||||||
|
@ -938,7 +938,7 @@ Each three successive point representing the coordinate of each vertex of a tria
|
||||||
<p>In fact, we will provide six ordered points.
|
<p>In fact, we will provide six ordered points.
|
||||||
These points will be used to draw two triangles.</p>
|
These points will be used to draw two triangles.</p>
|
||||||
|
|
||||||
<p><img alt="Explain triangles" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/triangles.png" /></p>
|
<img alt="Explain triangles" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/triangles.png" />
|
||||||
|
|
||||||
<p>The next function is a bit long.
|
<p>The next function is a bit long.
|
||||||
Here is an approximative English version:</p>
|
Here is an approximative English version:</p>
|
||||||
|
@ -1012,7 +1012,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>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>.
|
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>.
|
But it is symmetric relatively to the plan <code>z=0</code>.
|
||||||
Then I mirror these values. </p>
|
Then I mirror these values. </p>
|
||||||
|
@ -1110,7 +1110,7 @@ and change the type signature of <code>f</code> from <code>Complex</code> to <co
|
||||||
|
|
||||||
<p>Here is the result:</p>
|
<p>Here is the result:</p>
|
||||||
|
|
||||||
<p><img alt="A 3D mandelbrot like" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/mandelbrot_3D.png" /></p>
|
<img alt="A 3D mandelbrot like" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/mandelbrot_3D.png" />
|
||||||
|
|
||||||
<p><a href="code/03_Mandelbulb/Mandelbulb.lhs" class="cut">Download the source code of this section → 03_Mandelbulb/<strong>Mandelbulb.lhs</strong> </a></p>
|
<p><a href="code/03_Mandelbulb/Mandelbulb.lhs" class="cut">Download the source code of this section → 03_Mandelbulb/<strong>Mandelbulb.lhs</strong> </a></p>
|
||||||
|
|
||||||
|
@ -1237,7 +1237,7 @@ ymandel x y z = mandel (2*x/width) (2*y/height) (2*z/deep) 64
|
||||||
|
|
||||||
</div>
|
</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.
|
First, all the user interaction code is outside our main file.
|
||||||
I feel it is okay to hide the detail for the rendering.
|
I feel it is okay to hide the detail for the rendering.
|
||||||
But I would have preferred to control the user actions.</p>
|
But I would have preferred to control the user actions.</p>
|
||||||
|
@ -1271,12 +1271,12 @@ We will have two choices: </p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>Our main problem come from user interaction.
|
<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,
|
about how to deal with user interaction with a functional paradigm,
|
||||||
the main answer is to use <em>functional reactive programming</em> (FRP).
|
the main answer is to use <em>functional reactive programming</em> (FRP).
|
||||||
I won’t use FRP in this article.
|
I won’t use FRP in this article.
|
||||||
Instead, I’ll use a simpler while less effective way to deal with user interaction.
|
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>
|
But The method I’ll use will be as pure and functional as possible.</p>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
@ -1298,7 +1298,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>
|
<li>a function taking two parameters: time and world state and render a new world without user interaction.</li>
|
||||||
</ul>
|
</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.
|
The YGL, is a kind of framework to display 3D functions.
|
||||||
But it can easily be extended to many kind of representation.</p>
|
But it can easily be extended to many kind of representation.</p>
|
||||||
|
|
||||||
|
@ -1518,7 +1518,7 @@ idleAction tnew world = world {
|
||||||
<p>Now the function which will generate points in 3D.
|
<p>Now the function which will generate points in 3D.
|
||||||
The first parameter (<code>res</code>) is the resolution of the vertex generation.
|
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.
|
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>.
|
<p>The type <code>Function3D</code> is <code>Point -> Point -> Maybe Point</code>.
|
||||||
Because we consider partial functions
|
Because we consider partial functions
|
||||||
|
@ -1587,7 +1587,7 @@ ymandel x y z = fromIntegral (mandel x y z 64) / 64
|
||||||
|
|
||||||
</div>
|
</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>.
|
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>
|
It is commented a lot.</p>
|
||||||
|
|
||||||
|
@ -1607,8 +1607,8 @@ It is commented a lot.</p>
|
||||||
<p>Our code architecture feel very clean.
|
<p>Our code architecture feel very clean.
|
||||||
All the meaningful code is in our main file and all display details are
|
All the meaningful code is in our main file and all display details are
|
||||||
externalized.
|
externalized.
|
||||||
If you read the code of <code>YGL.hs</code>, you’ll see I didn’t made everything perfect.
|
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.
|
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.
|
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.
|
Unfortunately the program of the preceding session is extremely slow.
|
||||||
We compute the Mandelbulb for each frame now.</p>
|
We compute the Mandelbulb for each frame now.</p>
|
||||||
|
@ -1892,20 +1892,20 @@ ymandel x y z = fromIntegral (mandel x y z 64) / 64
|
||||||
<p>As we can use imperative style in a functional language,
|
<p>As we can use imperative style in a functional language,
|
||||||
know you can use functional style in imperative languages.
|
know you can use functional style in imperative languages.
|
||||||
This article exposed a way to organize some code in a functional way.
|
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,
|
<p>Once you are used to pure functional style,
|
||||||
it is hard not to see all advantages it offers.</p>
|
it is hard not to see all advantages it offers.</p>
|
||||||
|
|
||||||
<p>The code in the two last sections is completely pure and functional.
|
<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,
|
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>
|
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>
|
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.
|
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>
|
Such an optimization would have been harder by using directly the OpenGL library.</p>
|
||||||
|
|
||||||
|
@ -1915,7 +1915,7 @@ O(n².log(n)) to O(n³).</p>
|
||||||
<hr/><div class="footnotes">
|
<hr/><div class="footnotes">
|
||||||
<ol>
|
<ol>
|
||||||
<li id="fn:001">
|
<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>
|
||||||
<li id="fn:011">
|
<li id="fn:011">
|
||||||
<p>Generally in Haskell you need to declare a lot of import lines.
|
<p>Generally in Haskell you need to declare a lot of import lines.
|
||||||
|
@ -2010,10 +2010,14 @@ O(n².log(n)) to O(n³).</p>
|
||||||
articles suivants
|
articles suivants
|
||||||
|
|
||||||
<div class="next_article">
|
<div class="next_article">
|
||||||
<a href="/Scratch/fr/blog/Category-Theory-Presentation/">Category Theory Presentation <span class="nicer">»</span></a>
|
<a href="/Scratch/fr/blog/Category-Theory-Programming/">Programmation en Théorie des Catégories <span class="nicer">»</span></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="next_article">
|
||||||
|
<a href="/Scratch/fr/blog/Category-Theory-Presentation/">Category Theory Presentation <span class="nicer">»</span></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -35,6 +35,44 @@ just continue to read as a standard web page.
|
||||||
\(\newcommand{\F}{\mathbf{F}}\)
|
\(\newcommand{\F}{\mathbf{F}}\)
|
||||||
\(\newcommand{\E}{\mathbf{E}}\)
|
\(\newcommand{\E}{\mathbf{E}}\)
|
||||||
\(\newcommand{\C}{\mathc...</div></img></content>
|
\(\newcommand{\C}{\mathc...</div></img></content>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<id>tag:yannesposito.com,2012-10-01:/Scratch/fr/blog/Category-Theory-Programming/</id>
|
||||||
|
<title type="html">Programmation en Théorie des Catégories</title>
|
||||||
|
<published>2012-10-01T17:16:43Z</published>
|
||||||
|
<updated>2012-10-01T17:16:43Z</updated>
|
||||||
|
<author>
|
||||||
|
<name>Yann Esposito</name>
|
||||||
|
<uri>yannesposito.com</uri>
|
||||||
|
</author>
|
||||||
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Category-Theory-Programming/"/>
|
||||||
|
<content type="html">
|
||||||
|
<div class="intro">
|
||||||
|
|
||||||
|
|
||||||
|
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Comment programmer en utilisant la théorie des catégories.</p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"><b>Table of Content</b></span><hr style="width:30%;float:right;border-color:#CCCCD0;margin-top:1em" /></center>
|
||||||
|
|
||||||
|
<ul id="markdown-toc">
|
||||||
|
<li><a href="#introduction">Introduction</a> <ul>
|
||||||
|
<li><a href="#programming-paradigms">Programming Paradigms</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><a href="#get-some-intuition">Get some intuition</a> <ul>
|
||||||
|
<li><a href="#representation-of-category">Representation of Category</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="introduction">Introductio...</h2></blockquote></div></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2012-06-15:/Scratch/fr/blog/Haskell-OpenGL-Mandelbrot/</id>
|
<id>tag:yannesposito.com,2012-06-15:/Scratch/fr/blog/Haskell-OpenGL-Mandelbrot/</id>
|
||||||
|
@ -46,13 +84,13 @@ just continue to read as a standard web page.
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Haskell-OpenGL-Mandelbrot/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Haskell-OpenGL-Mandelbrot/"/>
|
||||||
<content type="html"><p><img alt="The B in Benoît B. Mandelbrot stand for Benoît B. Mandelbrot" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/BenoitBMandelbrot.jpg" /></p>
|
<content type="html"><img alt="The B in Benoît B. Mandelbrot stand for Benoît B. Mandelbrot" src="/Scratch/img/blog/Haskell-OpenGL-Mandelbrot/BenoitBMandelbrot.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<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.
|
Vous pourrez voir un ensemble de Mandelbrot étendu à la troisième dimension.
|
||||||
De plus le code sera très propre.
|
De plus le code sera très propre.
|
||||||
Les détails de rendu sont séparés dans un module externe.
|
Les détails de rendu sont séparés dans un module externe.
|
||||||
|
@ -60,7 +98,7 @@ Le code descriptif intéressant est concentré dans un environnement pur
|
||||||
Vous pouvez vous inspirer de ce code utilisant le paradigme fonctional dans tous les languages.</p>
|
Vous pouvez vous inspirer de ce code utilisant le paradigme fonctional dans tous les languages.</p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"></span></hr></center></blockquote></div></p></content>
|
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"><b>Table...</b></span></hr></center></blockquote></div></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2012-02-08:/Scratch/fr/blog/Haskell-the-Hard-Way/</id>
|
<id>tag:yannesposito.com,2012-02-08:/Scratch/fr/blog/Haskell-the-Hard-Way/</id>
|
||||||
|
@ -72,7 +110,7 @@ Vous pouvez vous inspirer de ce code utilisant le paradigme fonctional dans tous
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Haskell-the-Hard-Way/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Haskell-the-Hard-Way/"/>
|
||||||
<content type="html"><p><img alt="Magritte pleasure principle" src="/Scratch/img/blog/Haskell-the-Hard-Way/magritte_pleasure_principle.jpg" /></p>
|
<content type="html"><img alt="Magritte pleasure principle" src="/Scratch/img/blog/Haskell-the-Hard-Way/magritte_pleasure_principle.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -83,7 +121,7 @@ Vous pouvez vous inspirer de ce code utilisant le paradigme fonctional dans tous
|
||||||
<p>Merci à <a href="https://plus.google.com/u/0/113751420744109290534">Oleg Taykalo</a> vous pouvez trouver une traduction Russe ici: <a href="http://habrahabr.ru/post/152889/">Partie 1</a> <em class="pala">&amp;</em> <a href="http://habrahabr.ru/post/153383/">Partie 2</a>&nbsp;; </p>
|
<p>Merci à <a href="https://plus.google.com/u/0/113751420744109290534">Oleg Taykalo</a> vous pouvez trouver une traduction Russe ici: <a href="http://habrahabr.ru/post/152889/">Partie 1</a> <em class="pala">&amp;</em> <a href="http://habrahabr.ru/post/153383/">Partie 2</a>&nbsp;; </p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"><b>Table of Content</b></span></hr></center></blockquote></div></p></content>
|
<center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em" /><span class="sc"><b>Table of Content</b></span><hr style="width:30%;float:right;border-color:#CCCCD0;margin-top:1em" /></hr></hr></center></blockquote></div></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2012-02-02:/Scratch/fr/blog/Typography-and-the-Web/</id>
|
<id>tag:yannesposito.com,2012-02-02:/Scratch/fr/blog/Typography-and-the-Web/</id>
|
||||||
|
@ -95,30 +133,30 @@ Vous pouvez vous inspirer de ce code utilisant le paradigme fonctional dans tous
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Typography-and-the-Web/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Typography-and-the-Web/"/>
|
||||||
<content type="html"><p><img alt="Screenshot of first in small caps with and without ligatures." src="/Scratch/img/blog/Typography-and-the-Web/first_sc_screenshot.png" /></p>
|
<content type="html"><img alt="Screenshot of first in small caps with and without ligatures." src="/Scratch/img/blog/Typography-and-the-Web/first_sc_screenshot.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
|
||||||
|
|
||||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> La typography sur le web est pourrie et nous ne somme pas près de voir ce problème réparé.</p>
|
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> La typography sur le web est pourrie et nous ne somme pas près de voir ce problème réparé.</p>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<p>Je suis tombé sur ce site: <a href="http://opentypography.org/">open typography</a>. Leur message principal est&nbsp;:</p>
|
<p>Je suis tombé sur ce site: <a href="http://opentypography.org/">open typography</a>. Leur message principal est&nbsp;:</p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>«There is no reason to wait for browser development to catch up.
|
<p>«There is no reason to wait for browser development to catch up.
|
||||||
We can all create better web typography ourselves, today.»</p>
|
We can all create better web typography ourselves, today.»</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p>ou en français&nbsp;:</p>
|
<p>ou en français&nbsp;:</p>
|
||||||
|
|
||||||
<blockquote>
|
<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 pouv...</p></blockquote></p></content>
|
Nous pouvons crÃ...</p></blockquote></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2012-01-15:/Scratch/fr/blog/Yesod-tutorial-for-newbies/</id>
|
<id>tag:yannesposito.com,2012-01-15:/Scratch/fr/blog/Yesod-tutorial-for-newbies/</id>
|
||||||
|
@ -130,7 +168,7 @@ Nous pouv...</p></blockquote></p></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Yesod-tutorial-for-newbies/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Yesod-tutorial-for-newbies/"/>
|
||||||
<content type="html"><p><img alt="Neo Flying at warp speed" src="/Scratch/img/blog/Yesod-tutorial-for-newbies/flying_neo.jpg" /></p>
|
<content type="html"><img alt="Neo Flying at warp speed" src="/Scratch/img/blog/Yesod-tutorial-for-newbies/flying_neo.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -141,7 +179,7 @@ Nous pouv...</p></blockquote></p></content>
|
||||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Un tutoriel pour yesod, un framework web Haskell.
|
<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.
|
Vous ne devriez pas avoir besoin de savoir programmer en Haskell.
|
||||||
Par contre je suis désolé pour les francophones,
|
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>
|
<blockquote>
|
||||||
<center><span class="sc"><b>Table of content</b></span></center>
|
<center><span class="sc"><b>Table of content</b></span></center>
|
||||||
|
@ -149,7 +187,7 @@ mais je n&rsquo;ai pas eu le courage de traduire cet article en Françai
|
||||||
<ul id="markdown-toc">
|
<ul id="markdown-toc">
|
||||||
<li><a href="#before-the-real-start">Before the real start</a> <ul>
|
<li><a href="#before-the-real-start">Before the real start</a> <ul>
|
||||||
<li><a href="#install">Install</a></li>
|
<li><a href="#install">Install</a></li>
|
||||||
<li><a href="#initialize">In...</a></li></ul></li></ul></blockquote></div></p></content>
|
<li><a href="#initialize">Initializ...</a></li></ul></li></ul></blockquote></div></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-10-20:/Scratch/fr/blog/SVG-and-m4-fractals/</id>
|
<id>tag:yannesposito.com,2011-10-20:/Scratch/fr/blog/SVG-and-m4-fractals/</id>
|
||||||
|
@ -161,23 +199,23 @@ mais je n&rsquo;ai pas eu le courage de traduire cet article en Françai
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/SVG-and-m4-fractals/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/SVG-and-m4-fractals/"/>
|
||||||
<content type="html"><p><img alt="Yesod logo made in SVG and m4" src="/Scratch/img/blog/SVG-and-m4-fractals/main.png" /></p>
|
<content type="html"><img alt="Yesod logo made in SVG and m4" src="/Scratch/img/blog/SVG-and-m4-fractals/main.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<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>
|
</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.
|
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.
|
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.
|
À tel point que les les format compatibles <span class="sc">xml</span> naquirent de toute part.
|
||||||
Non seulement comme format de fichie...</p></p></content>
|
Non seulement comme format de fichier, mais...</p></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-10-04:/Scratch/fr/blog/Yesod-excellent-ideas/</id>
|
<id>tag:yannesposito.com,2011-10-04:/Scratch/fr/blog/Yesod-excellent-ideas/</id>
|
||||||
|
@ -189,7 +227,7 @@ Non seulement comme format de fichie...</p></p></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Yesod-excellent-ideas/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Yesod-excellent-ideas/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/Yesod-excellent-ideas/main.png" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/Yesod-excellent-ideas/main.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -198,8 +236,8 @@ Non seulement comme format de fichie...</p></p></content>
|
||||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span></p>
|
<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>.
|
<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).
|
À 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&rsquo;autres) introduites par yesod que je n&rsquo;avais jamais vu ailleurs.</p>
|
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>
|
</div>
|
||||||
|
@ -207,9 +245,9 @@ Avant de vous dire pourquoi vous devriez aussi le considérer, je préf&
|
||||||
|
|
||||||
<h2 id="types-saufs">Types saufs</h2>
|
<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>
|
||||||
|
|
||||||
<p></p></p></content>
|
</img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-09-28:/Scratch/fr/blog/Higher-order-function-in-zsh/</id>
|
<id>tag:yannesposito.com,2011-09-28:/Scratch/fr/blog/Higher-order-function-in-zsh/</id>
|
||||||
|
@ -221,7 +259,7 @@ Avant de vous dire pourquoi vous devriez aussi le considérer, je préf&
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Higher-order-function-in-zsh/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Higher-order-function-in-zsh/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/Higher-order-function-in-zsh/main.jpg" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/Higher-order-function-in-zsh/main.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -252,7 +290,7 @@ X filter Y
|
||||||
X fold Y
|
X fold Y
|
||||||
X map Y
|
X map Y
|
||||||
|
|
||||||
$ mapa '$1*2...</code></pre></div></p></content>
|
$ mapa '$1*2' {1..3...</code></pre></div></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-09-28:/Scratch/fr/blog/programming-language-experience/</id>
|
<id>tag:yannesposito.com,2011-09-28:/Scratch/fr/blog/programming-language-experience/</id>
|
||||||
|
@ -264,26 +302,28 @@ $ mapa '$1*2...</code></pre></div></p></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/programming-language-experience/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/programming-language-experience/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/programming-language-experience/dragon.jpg" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/programming-language-experience/dragon.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<h3 id="basic"><code>BASIC</code></h3>
|
<h3 id="basic"><code>BASIC</code></h3>
|
||||||
|
|
||||||
<p><img alt="Title image" src="/Scratch/img/blog/programming-language-experience/basic.gif" class=" left" /></p>
|
<img alt="Title image" src="/Scratch/img/blog/programming-language-experience/basic.gif" class=" left" />
|
||||||
|
|
||||||
<p>Ah&nbsp;! Le language de mes premiers programmes&nbsp;!
|
<p>Ah&nbsp;! Le language de mes premiers programmes&nbsp;!
|
||||||
Je devais avoir 10-11 ans.
|
Je devais avoir 10-11 ans.
|
||||||
Sous <code>MO5</code>, <code>Amstrad CPC 6128</code> et même <code>Atari STe</code>.
|
Sous <code>MO5</code>, <code>Amstrad CPC 6128</code> et même <code>Atari STe</code>.
|
||||||
Le langage des <code>GOTO</code>s.
|
Le langage des <code>GOTO</code>s.
|
||||||
Je suis empleint de nostalgie rien que d&rsquo;y penser.
|
Je suis empleint de nostalgie rien que d&#8217;y penser.
|
||||||
C&rsquo;est à peu prêt le seul intérêt de ce ...</p></p></p></content>
|
C&#8217;est à peu prêt le seul intérêt de ce langage.</p>
|
||||||
|
|
||||||
|
...</img></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-08-25:/Scratch/fr/blog/Learn-Vim-Progressively/</id>
|
<id>tag:yannesposito.com,2011-08-25:/Scratch/fr/blog/Learn-Vim-Progressively/</id>
|
||||||
|
@ -295,7 +335,7 @@ C&rsquo;est à peu prêt le seul intérêt de ce ...</p&g
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Learn-Vim-Progressively/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Learn-Vim-Progressively/"/>
|
||||||
<content type="html"><p><img alt="Über leet use vim!" src="/Scratch/img/blog/Learn-Vim-Progressively/uber_leet_use_vim.jpg" /></p>
|
<content type="html"><img alt="Über leet use vim!" src="/Scratch/img/blog/Learn-Vim-Progressively/uber_leet_use_vim.jpg" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -307,7 +347,7 @@ C&rsquo;est à peu prêt le seul intérêt de ce ...</p&g
|
||||||
</div>
|
</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>
|
<blockquote>
|
||||||
<p>Meilleur, plus fort, plus rapide.</p>
|
<p>Meilleur, plus fort, plus rapide.</p>
|
||||||
|
@ -315,7 +355,7 @@ C&rsquo;est à peu prêt le seul intérêt de ce ...</p&g
|
||||||
|
|
||||||
<p>Apprenez <a href="http://www.vim.org">vim</a> et ce sera votre dernier éditeur.
|
<p>Apprenez <a href="http://www.vim.org">vim</a> et ce sera votre dernier éditeur.
|
||||||
Aucun éditeur que je connaisse ne le surpasse.
|
Aucun éditeur que je connaisse ne le surpasse.
|
||||||
Sa prise en mais est difficile, mais p...</p></p></content>
|
Sa prise en mais est difficile, mais payante....</p></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-08-17:/Scratch/fr/blog/A-more-convenient-diff/</id>
|
<id>tag:yannesposito.com,2011-08-17:/Scratch/fr/blog/A-more-convenient-diff/</id>
|
||||||
|
@ -327,11 +367,11 @@ Sa prise en mais est difficile, mais p...</p></p></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/A-more-convenient-diff/"/>
|
<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>
|
<div class="codefile"><a href="/Scratch/fr/blog/A-more-convenient-diff/code/ydiff">&#x27A5; ydiff</a></div>
|
||||||
|
|
||||||
|
@ -359,7 +399,7 @@ function colorize_diff {
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Haskell-Mandelbrot/"/>
|
<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>
|
<div class="codefile"><a href="/Scratch/fr/blog/Haskell-Mandelbrot/code/animandel.hs">&#x27A5; animandel.hs</a></div>
|
||||||
|
|
||||||
|
@ -382,25 +422,25 @@ main ...</code></pre></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Password-Management/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/Password-Management/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/Password-Management/main.png" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/Password-Management/main.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<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 />
|
<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é.
|
Je ne mémorise qu&#8217;un seul mot de passe de très bonne qualité.
|
||||||
J&rsquo;utilise des mots de passe différents sur tous les sites.</p>
|
J&#8217;utilise des mots de passe différents sur tous les sites.</p>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</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;?
|
<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 utili...</p></p></div></p></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>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-04-20:/Scratch/fr/blog/2011-04-20-Now-hosted-on-github/</id>
|
<id>tag:yannesposito.com,2011-04-20:/Scratch/fr/blog/2011-04-20-Now-hosted-on-github/</id>
|
||||||
|
@ -412,10 +452,10 @@ Bon, d&rsquo;accord, même si vous ne téléchargez pas mon appl
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2011-04-20-Now-hosted-on-github/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2011-04-20-Now-hosted-on-github/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/2011-04-20-Now-hosted-on-github/main.png" /></p>
|
<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>
|
||||||
</p></content>
|
</img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-01-03:/Scratch/fr/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/</id>
|
<id>tag:yannesposito.com,2011-01-03:/Scratch/fr/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/</id>
|
||||||
|
@ -427,15 +467,15 @@ Bon, d&rsquo;accord, même si vous ne téléchargez pas mon appl
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/main.png" /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/2011-01-03-Why-I-sadly-won-t-use-coffeescript/main.png" />
|
||||||
|
|
||||||
|
|
||||||
<div class="encadre">
|
<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;?
|
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>
|
</div>
|
||||||
|
@ -445,7 +485,7 @@ Tout d&rsquo;abord, je viens de découvrir un convertisseur javascript v
|
||||||
<div class="intro">
|
<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-programm...</p></div></p></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>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2011-01-01:/Scratch/fr/blog/2011-01-03-Happy-New-Year/</id>
|
<id>tag:yannesposito.com,2011-01-01:/Scratch/fr/blog/2011-01-03-Happy-New-Year/</id>
|
||||||
|
@ -459,15 +499,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/"/>
|
<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>
|
<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>
|
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.
|
<p>J&#8217;ai fait un outil qui permet d&#8217;écrire des livre en utilisant une syntaxe proche de markdown.
|
||||||
C&rsquo;est un markdown avec des macros (essentiel pour les textes longs).
|
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.
|
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>
|
<p>Meilleurs vœux à tous&nbsp;!</p>
|
||||||
</content>
|
</content>
|
||||||
|
@ -486,14 +526,14 @@ Je n&rsquo;en ai pas encore terminé avec ça. Mais si je tarde trop
|
||||||
<div class="intro">
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<p>J&rsquo;ai ajouter un système de macro pour mon système de blog.
|
<p>J&#8217;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>
|
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>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-10-14:/Scratch/fr/blog/2010-10-14-Fun-with-wav/</id>
|
<id>tag:yannesposito.com,2010-10-14:/Scratch/fr/blog/2010-10-14-Fun-with-wav/</id>
|
||||||
|
@ -517,10 +557,10 @@ Lorsqu&rsquo;on est habitué à <span style="text-transform: uppe
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<p>J&rsquo;ai eu besoin de calculer la somme des valeurs absolue des données d&rsquo;un fichier <code>wav</code>.
|
<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&rsquo;efficacité (et aussi de fun), j&rsquo;ai fait le programme en <code>C</code>.</p>
|
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>
|
De mémoire il était peu aisé de manipuler des ...</p></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
|
@ -533,7 +573,7 @@ De mémoire il était peu aisé de manipuler des ...</p></cont
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-10-10-Secure-eMail-on-Mac-in-few-steps/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-10-10-Secure-eMail-on-Mac-in-few-steps/"/>
|
||||||
<content type="html"><p><img alt="Title image" src="/Scratch/img/blog/2010-10-10-Secure-eMail-on-Mac-in-few-steps/main.png" class="clean " /></p>
|
<content type="html"><img alt="Title image" src="/Scratch/img/blog/2010-10-10-Secure-eMail-on-Mac-in-few-steps/main.png" class="clean " />
|
||||||
|
|
||||||
|
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
|
@ -545,16 +585,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>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>ouvrez le fichier&nbsp;;</li>
|
||||||
<li>supprimer le fichier en mode sécurisé&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>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<p>J&rsquo;ai (re)découvert comment adoptez la norme S/MIME.
|
<p>J&#8217;ai (re)découvert comment adoptez la norme S/MIME.
|
||||||
J&rsquo;ai été surpris de voir à quel point ce fut aisé.
|
J&#8217;ai été surpris de voir à quel point ce fut aisé.
|
||||||
Il y a seulement quelques années c&r...</p></p></content>
|
Il y a seulement quelques années c&#8217;é...</p></img></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-10-06:/Scratch/fr/blog/2010-10-06-New-Blog-Design-Constraints/</id>
|
<id>tag:yannesposito.com,2010-10-06:/Scratch/fr/blog/2010-10-06-New-Blog-Design-Constraints/</id>
|
||||||
|
@ -566,15 +606,15 @@ Il y a seulement quelques années c&r...</p></p></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-10-06-New-Blog-Design-Constraints/"/>
|
<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.
|
<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&rsquo;avant.
|
Maintenant il doit être beaucoup plus léger qu&#8217;avant.
|
||||||
Je n&rsquo;utilise plus de CSS3 et beaucoup moins de javascript.
|
Je n&#8217;utilise plus de CSS3 et beaucoup moins de javascript.
|
||||||
Bien entendu, même avant, mes pages étaient parfaitement lisibles sans 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.
|
Mais, je me suis aperçu que les systèmes de CSS3 sont loin d&#8217;ê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;
|
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&rsquo;était pas compatible ie6, sous Chrome le rendu était d&rsquo;une lenteur incroyable.
|
Ce n&#8217;était pas compatible ie6, sous Chrome le rendu était d&#8217;une lenteur incroyable.
|
||||||
J&rsquo;ai donc décidé de faire un site à minima.
|
J&#8217;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é.
|
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>
|
Les règles que je me suis fixées sont donc:</p>
|
||||||
|
|
||||||
</content>
|
</content>
|
||||||
|
@ -589,14 +629,14 @@ Les règles que je me suis fixées sont donc:</p>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/"/>
|
<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.
|
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.
|
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&rsquo;est pas nécessairement la <em>vraie</em> de modification du contenue.</p>
|
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.
|
<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&rsquo;un fichier.
|
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&rsquo;y prend avec <a href="http://nanoc.stoneship.org">nanoc</a>&nbsp;:</p>
|
Voici comment je m&#8217;y prend avec <a href="http://nanoc.stoneship.org">nanoc</a>&nbsp;:</p>
|
||||||
|
|
||||||
<div class="codefile"></div></content>
|
<div class="codefile"></div></content>
|
||||||
</entry>
|
</entry>
|
||||||
|
@ -610,10 +650,10 @@ Voici comment je m&rsquo;y prend avec <a href="http://nanoc.stoneship.org
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-09-02-base64-and-sha1-on-iPhone/"/>
|
<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;:
|
<content type="html"><p>Allons directement à l&#8217;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>
|
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>
|
Puis&nbsp;:</p>
|
||||||
|
|
||||||
<pre><code class="objective-c">#import &lt;CommonCrypto/CommonDigest.h&gt;
|
<pre><code class="objective-c">#import &lt;CommonCrypto/CommonDigest.h&gt;
|
||||||
|
@ -623,8 +663,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"];
|
NSString *hex_hash = [self hex_sha1:@"some NSString to be sha1'ed"];
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>L&rsquo;algorithme pour l&rsquo;encodage en <code>base64</code> doit être programmé sur iPhone.
|
<p>L&#8217;algorithme pour l&#8217;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>
|
Il n&#8217;y a pas de librairie officielle qui s&#8217;occupe de ça.</p>
|
||||||
|
|
||||||
<div class="codefile"></div></content>
|
<div class="codefile"></div></content>
|
||||||
</entry>
|
</entry>
|
||||||
|
@ -638,19 +678,19 @@ Il n&rsquo;y a pas de librairie officielle qui s&rsquo;occupe de ça
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-08-31-send-mail-from-command-line-with-attached-file/"/>
|
<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.
|
<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&rsquo;était vraiment pas évident.
|
Quelle ne fût pas ma surprise lorsque je constatais que ce n&#8217;é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>
|
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'
|
<pre><code class="zsh">uuencode fic.jpg fic.jpg | mail -s 'Subject'
|
||||||
</code></pre>
|
</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.
|
Et bien, ça marche <em>presque</em> tout le temps.
|
||||||
Pour mon fichier ça n&rsquo;a pas marché du tout.
|
Pour mon fichier ça n&#8217;a pas marché du tout.
|
||||||
Je l&rsquo;ai compressé au format <code>.gz</code>, <code>.bz2</code> et <code>.zip</code>.
|
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>
|
Avec le format <code>.bz2</code> le mail reçu avait bien un fichie...</p></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
|
@ -665,14 +705,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/"/>
|
<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>
|
<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.
|
<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.
|
J&#8217;utilise <a href="http://nanoc.stoneship.org/">nanoc</a> pour l&#8217;engendrer.
|
||||||
Avoir un site statique amène beaucoup d&rsquo;avantages par rapport à un site dynamique. Surtout en terme de sécurité.
|
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>
|
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>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-08-11:/Scratch/fr/blog/2010-07-09-Indecidabilities/</id>
|
<id>tag:yannesposito.com,2010-08-11:/Scratch/fr/blog/2010-07-09-Indecidabilities/</id>
|
||||||
|
@ -684,8 +724,39 @@ Voici comment configurer un site statique sur heroku.</p>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-07-09-Indecidabilities/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-07-09-Indecidabilities/"/>
|
||||||
<content type="html">
|
<content type="html"><p>&lt;% # toremove_ %&gt;</p>
|
||||||
</content>
|
|
||||||
|
|
||||||
|
<div class="intro">
|
||||||
|
|
||||||
|
|
||||||
|
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span> Je crée un mode mathématique simple pour parler de différents types d&#8217;<em>indécidabilités</em>&nbsp;:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>indécidabilité due aux erreurs d&#8217;observation&nbsp;;</li>
|
||||||
|
<li>grandes erreurs résultant de petites erreurs de mesure&nbsp;;</li>
|
||||||
|
<li>indécidabilité fractales&nbsp;;</li>
|
||||||
|
<li>indécidabilité logique.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="corps">
|
||||||
|
|
||||||
|
|
||||||
|
<h1 class="first" id="les-indcidabilits">Les indécidabilités</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="intro">
|
||||||
|
|
||||||
|
|
||||||
|
<p>Si le monde a été fabriqué par un démiurge, on peut dire que celui-ci devait avoir le sens de l&#8217;humour.
|
||||||
|
Et le récit que je vais faire va vous en fournir la p...</p></div></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-07-31:/Scratch/fr/blog/2010-07-31-New-style-after-holidays/</id>
|
<id>tag:yannesposito.com,2010-07-31:/Scratch/fr/blog/2010-07-31-New-style-after-holidays/</id>
|
||||||
|
@ -697,11 +768,11 @@ Voici comment configurer un site statique sur heroku.</p>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-07-31-New-style-after-holidays/"/>
|
<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.
|
<content type="html"><p>Avant les vacances beaucoup d&#8217;utilisateurs se sont plaints de la lenteur de rendu de mon site.
|
||||||
Il s&rsquo;agit notamment de problèmes avec Chrome en particulier.
|
Il s&#8217;agit notamment de problèmes avec Chrome en particulier.
|
||||||
Mais pour éviter tout problème.
|
Mais pour éviter tout problème.
|
||||||
J&rsquo;ai complètement modifié le style de mon site web.
|
J&#8217;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>
|
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>
|
<p>Dites moi ce que vous pensez de ce nouveau design.</p>
|
||||||
</content>
|
</content>
|
||||||
|
@ -716,10 +787,10 @@ Il est inspiré du style de l&rsquo;application iBooks<small>&
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-07-07-CSS-rendering-problems-by-navigator/"/>
|
<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>.
|
<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&rsquo;il s&rsquo;agissait d&rsquo;un problème dû aux ombres que j&rsquo;applique sur le texte.
|
Ils pensaient qu&#8217;il s&#8217;agissait d&#8217;un problème dû aux ombres que j&#8217;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.
|
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&rsquo;importance&nbsp;:</p>
|
En réalité, ce qui ralenti le rendu de ce site est par ordre d&#8217;importance&nbsp;:</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Les dégradés sur Chrome (pas dans Safari sur Mac)</li>
|
<li>Les dégradés sur Chrome (pas dans Safari sur Mac)</li>
|
||||||
|
@ -728,7 +799,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>
|
<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>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-07-05:/Scratch/fr/blog/2010-07-05-Cappuccino-and-Web-applications/</id>
|
<id>tag:yannesposito.com,2010-07-05:/Scratch/fr/blog/2010-07-05-Cappuccino-and-Web-applications/</id>
|
||||||
|
@ -747,10 +818,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>
|
<p><abbr title="Trop long à lire">tlàl</abbr>:</p>
|
||||||
|
|
||||||
<ul>
|
<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>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&rsquo;application pèse 1.4Mo et n&rsquo;est pas compatible avec l&rsquo;iPhone.</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&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>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&rsquo;essayerai Dashcode 3</li>
|
<li>J&#8217;essayerai Dashcode 3</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
@ -808,12 +879,12 @@ function initCode() {
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-06-17-hide-yourself-to-analytics/"/>
|
<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.
|
<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>
|
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');
|
<pre><code class="javascript"> var admin = $.cookie('admin');
|
||||||
if (! admin) {
|
if (! admin) {
|
||||||
|
@ -833,7 +904,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/"/>
|
<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>
|
<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;
|
<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;
|
&lt;script type="text/javascript" src="yga.js"&gt;&lt;/script&gt;
|
||||||
|
@ -857,7 +928,7 @@ Je centralise tout dans un seul fichier javascript ce qui facilite le travail.&l
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-06-15-Get-my-blog-engine/"/>
|
<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>
|
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>
|
<p>Que pouvez-vous attendre de ce système de blog&nbsp;?</p>
|
||||||
|
@ -879,8 +950,8 @@ Vous pouvez le récupérer sur <a href="http://github.com/yogsototh/n
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-06-14-multi-language-choices/"/>
|
<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.
|
<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&rsquo;on m&rsquo;a conseillé était d&rsquo;avoir un fichier par langue. En général ça donne ça.</p>
|
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">
|
<pre class="twilight">
|
||||||
Bonjour,
|
Bonjour,
|
||||||
|
@ -897,11 +968,11 @@ here is an example of english text.
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>Cette façon de traduire vous impose une certaine façon de traduire.
|
<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>
|
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;
|
<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>
|
Lorsque je m&#...</p></content>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>tag:yannesposito.com,2010-05-24:/Scratch/fr/blog/2010-05-24-Trees--Pragmatism-and-Formalism/</id>
|
<id>tag:yannesposito.com,2010-05-24:/Scratch/fr/blog/2010-05-24-Trees--Pragmatism-and-Formalism/</id>
|
||||||
|
@ -920,13 +991,13 @@ Lorsque je m&...</p></content>
|
||||||
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span>&nbsp;:</p>
|
<p><span class="sc"><abbr title="Trop long à lire">tlàl</abbr>&nbsp;: </span>&nbsp;:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>J&rsquo;ai essayé de programmer un simple filtre&nbsp;;</li>
|
<li>J&#8217;ai essayé de programmer un simple filtre&nbsp;;</li>
|
||||||
<li>J&rsquo;ai été bloqué pendant deux jours&nbsp;;</li>
|
<li>J&#8217;ai été bloqué pendant deux jours&nbsp;;</li>
|
||||||
<li>J&rsquo;ai arrêté de penser comme un robot&nbsp;;</li>
|
<li>J&#8217;ai arrêté de penser comme un robot&nbsp;;</li>
|
||||||
<li>J&rsquo;ai utilisé un papier et un stylo&nbsp;;</li>
|
<li>J&#8217;ai utilisé un papier et un stylo&nbsp;;</li>
|
||||||
<li>J&rsquo;ai fait un peu de maths&nbsp;;</li>
|
<li>J&#8217;ai fait un peu de maths&nbsp;;</li>
|
||||||
<li>J&rsquo;ai résolu le problème en 10 minutes&nbsp;;</li>
|
<li>J&#8217;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>Conclusion: Pragmatisme n&#8217;est pas&nbsp;: &laquo;n&#8217;utilisez jamais la théorie&raquo;.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -944,7 +1015,7 @@ Lorsque je m&...</p></content>
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-05-19-How-to-cut-HTML-and-repair-it/"/>
|
<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>
|
<p>Prenons un exemple&nbsp;:</p>
|
||||||
|
|
||||||
|
@ -958,7 +1029,7 @@ Lorsque je m&...</p></content>
|
||||||
&lt;/div&gt;
|
&lt;/div&gt;
|
||||||
</code></pre>
|
</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;
|
<pre><code class="html">&lt;div class="corps"&gt;
|
||||||
&lt;div class="intro"&gt;
|
&lt;div class="intro"&gt;
|
||||||
|
@ -978,12 +1049,12 @@ Lorsque je m&...</p></content>
|
||||||
<content type="html"><p>Bonjour à tous&nbsp;!</p>
|
<content type="html"><p>Bonjour à tous&nbsp;!</p>
|
||||||
|
|
||||||
<blockquote cite="http://www.madore.org/~david/weblog/2010-05.html#d.2010-05-12.1752">
|
<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>
|
</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.
|
<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&rsquo;écrire des <code>TODO</code> dans votre code est faites le maintenant&nbsp;!<br />
|
&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&rsquo;efficacité de cette mesure.</p>
|
&gt; Vous serez surpris de l&#8217;efficacité de cette mesure.</p>
|
||||||
|
|
||||||
<p>En résumé&nbsp;:
|
<p>En résumé&nbsp;:
|
||||||
&gt; </p></p></content>
|
&gt; </p></p></content>
|
||||||
|
@ -1000,16 +1071,16 @@ Lorsque je m&...</p></content>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-03-23-Encapsulate-git/"/>
|
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-03-23-Encapsulate-git/"/>
|
||||||
<content type="html"><p><span class="intro">
|
<content type="html"><p><span class="intro">
|
||||||
Voici une solution pour conserver des branches divergentes avec <code>git</code>.
|
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>
|
</span></p>
|
||||||
|
|
||||||
<h2 id="se-prmunir-contre-les-erreurs">Se prémunir contre les erreurs</h2>
|
<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>
|
...</content>
|
||||||
</entry>
|
</entry>
|
||||||
|
@ -1047,7 +1118,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><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>
|
<div>
|
||||||
|
|
||||||
|
@ -1063,10 +1134,10 @@ Parce qu&rsquo;il est facile de <em>merger</em> par erreur, je p
|
||||||
<uri>yannesposito.com</uri>
|
<uri>yannesposito.com</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="alternate" href="http://yannesposito.com/Scratch/fr/blog/2010-02-23-When-regexp-is-not-the-best-solution/"/>
|
<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>
|
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>
|
<div>
|
||||||
|
|
||||||
|
@ -1083,44 +1154,6 @@ ext=File.extname(str)
|
||||||
|
|
||||||
</div>
|
</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>
|
|
||||||
<title type="html">découper un fichier par mots clés</title>
|
|
||||||
<published>2010-02-18T13:29:14Z</published>
|
|
||||||
<updated>2010-02-18T13:29:14Z</updated>
|
|
||||||
<author>
|
|
||||||
<name>Yann Esposito</name>
|
|
||||||
<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.
|
|
||||||
Le code suivant découpe un fichier pour chacune de ses ligne contenant le mot <code>UTC</code>.</p>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<pre><code class="perl">#!/usr/bin/env awk
|
|
||||||
BEGIN{i=0;}
|
|
||||||
/UTC/ {
|
|
||||||
i+=1;
|
|
||||||
FIC=sprintf("fic.%03d",i);
|
|
||||||
}
|
|
||||||
{print $0&gt;&gt;FIC}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
</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>
|
|
||||||
|
|
||||||
<pre class="twilight">
|
|
||||||
Mon Dec 7 10:32:30 UTC 2009
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<p>J&rsquo;en suis finallement arrivé au code suivant&nbsp;:</p>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
...</div></content>
|
|
||||||
</entry>
|
</entry>
|
||||||
</feed>
|
</feed>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -72,7 +72,7 @@
|
||||||
<h3><a href="/Scratch/en/about/contact" onclick="setLanguage('en')">Contact <span class="nicer">»</span> </a></h3>
|
<h3><a href="/Scratch/en/about/contact" onclick="setLanguage('en')">Contact <span class="nicer">»</span> </a></h3>
|
||||||
<h3> <a href="/resume/index.html"> Resume <span class="nicer">»</span> </a> </h3>
|
<h3> <a href="/resume/index.html"> Resume <span class="nicer">»</span> </a> </h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="francais right"style="text-align: right; width: 30%; font-size: 0.8em">
|
<div class="francais right"style="text-align: right; width: 32%; font-size: 0.8em">
|
||||||
<div style="color: #AAA">Français</div>
|
<div style="color: #AAA">Français</div>
|
||||||
<h3>
|
<h3>
|
||||||
<a href="/Scratch/fr/blog/" onclick="setLanguage('fr')">
|
<a href="/Scratch/fr/blog/" onclick="setLanguage('fr')">
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Copyright ©, Yann Esposito</a>
|
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Copyright ©, Yann Esposito</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="lastmod">
|
<div id="lastmod">
|
||||||
Modified: 12/19/2012
|
Modified: 01/02/2013
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
Entirely done with
|
Entirely done with
|
||||||
|
|
18
tasks/csswatch
Executable file
18
tasks/csswatch
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# watch and update the css
|
||||||
|
|
||||||
|
typeset -A hmap
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
for src in content/css/*.sass; do
|
||||||
|
val=$(md5sum $src|awk '{print $1}')
|
||||||
|
if [[ $hmap[$src] != "$val" ]]; then
|
||||||
|
print "$src changed. Updating..."
|
||||||
|
hmap[${src}]=$val
|
||||||
|
dst="output/Scratch/assets/css/${${src:t}:r}.css"
|
||||||
|
tail -n +4 $src | sass > $dst
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
sleep 1
|
||||||
|
done
|
|
@ -56,6 +56,7 @@ en: title: $title
|
||||||
fr: title: $title
|
fr: title: $title
|
||||||
author_name: Yann Esposito
|
author_name: Yann Esposito
|
||||||
author_uri: yannesposito.com
|
author_uri: yannesposito.com
|
||||||
|
layout: article2
|
||||||
# tags:
|
# tags:
|
||||||
-----
|
-----
|
||||||
<%= blogimage("main.png","Title image") %>
|
<%= blogimage("main.png","Title image") %>
|
||||||
|
|
Loading…
Reference in a new issue