new version working (almost)

This commit is contained in:
Yann Esposito (Yogsototh) 2010-04-15 11:45:50 +02:00
parent 0adfc39d8d
commit c27ef7e205
58 changed files with 775 additions and 493 deletions

View file

@ -55,11 +55,24 @@ newcorps
## In two words ## In two words
<en>
Im a passionate guy. Passionate about Im a passionate guy. Passionate about
- Computer Science: [Ive got a post Ph. D. degree in Computer Science](http://yann.esposito.free.fr/recherche.php). - Computer Science: [Ive got a post Ph. D. degree in Computer Science](http://yann.esposito.free.fr/recherche.php).
- Programming: [I developed two scientific apps](http://yann.esposito.free.fr/logiciels.php), [two Mac screen savers](/YBlog/Softwares.html), - Programming: [I developed two scientific apps](http://yann.esposito.free.fr/logiciels.php), [two Mac screen savers](/YBlog/Softwares.html),
- Computer Security: [I designed a secure web protocol (similar to TOR)](http://yann.esposito.free.fr/enseignement/rez0.php#projet), [a method to securely remember strong passwords](/YBlog/Computer/Entries/2008/7/30_Easy,_secure_and_portable_password_management_system.html) ([programmed a dashboard widget](/YBlog/YPassword.html) and a shell script to use this method). - Computer Security: [I designed a secure web protocol (similar to TOR)](http://yann.esposito.free.fr/enseignement/rez0.php#projet), [a method to securely remember strong passwords](/YBlog/Computer/Entries/2008/7/30_Easy,_secure_and_portable_password_management_system.html) ([programmed a dashboard widget](/YBlog/YPassword.html) and a shell script to use this method).
</en>
<fr>
Je suis un passioné. Passioné par :
- L'informatique scientifique : [j'ai un doctorat en Informatique](http://yann.esposito.free.fr/recherche.php?lang=fr) ;
- Programmation: j'ai développé [deux applications scientifiques](http://yann.esposito.free.fr/logiciels.php) ainsi que des [éconimiseurs d'écran pour Mac](/YBlog/Softwares.html).
- Sécurité informatique: j'ai modélisé [un protocole sécurisé (similaire à TOR)](http://yann.esposito.free.fr/enseignement/rez0.php#projet), [une méthode pour gérer de façon sécurisé ses mots de passes](/YBlog/Computer/Entries/2008/7/30_Easy,_secure_and_portable_password_management_system.html), un [widget](/YBlog/YPassword.html) et un script shell pour utiliser cette méthode.
</fr>
But before all, I love to learn. For example, I learned many programming languages: `C`, `C++`, `Objective-C`, `Python`, `Java`, `Perl`, `awk`, `bash`, `zsh`, `LaTeX`, `Metapost`, `camL`... And Ive got the same passion about computer science research, computer security, philosophy and many other things.

View file

@ -36,7 +36,151 @@ newcorps
Professional background Professional background
</h1> </h1>
<div>
<desc Professionnal background>
from 2007 : Airfrance consultant, Astek, Sophia Antipolis, France ::
2006-2007 : Post PhD in the Laboratory Hubert Curien, Saint-Etienne, France ::
2004-2006 : ATER, (College Degree Teacher) ::
2001-2004 : Allocataire Moniteur (PhD student with a grant + a teach grant) ::
1999-2000 : College degree teaching ::
</desc>
newcorps
<h1>
Education
</h1>
<desc>
2004 : PhD Degree in computer science in the
<a href="http://www.lif.univ-mrs.fr"><abbr title="Laboratoire d'Informatique Fondamentale">LIF</abbr></a>,
<a href="http://www.up.univ-mrs.fr/"> Université de Provence</a>,
Marseille (France) ::
2001 : DEA in computer science ::
2000 : Maîtrise in computer science ::
1999 : Licence in computer science ::
1998 : DEUG MIAS (Math) ::
1995 : BAC S ::
</desc>
newcorps
<h1>
Research activities
</h1>
<h4>
Background
</h4>
<ul>
<li>Machine Learning, </li>
<li>Data Mining, </li>
<li>Grammatical Inference </li>
</ul>
<h4>
studied objects
</h4>
<ul>
<li>Markov chains,</li>
<li>Hidden Markov Models, </li>
<li>Multiplicity Automata, </li>
<li>Weighted Transducer, </li>
<li>Tree Weighted Automata, </li>
<li>Tree Edit Distance</li>
</ul>
<h4>
main theoretical results
</h4>
<ul class="long">
<li>
Multiplicity Automata Algorithm which identifie the class of
rational stocastic languages in the limit with probability one,
</li>
<li>
The problem to know whether an MA generates a
probabilistic distribution is undecidable (was left open in
Probabilistic Automata, Azaria Paz, 1977),
</li>
<li>
Algorithm of identification in the limit with
probability one of some subclass of non deterministic <abbr title="Hidden Markov Model">HMM</abbr>
</li>
</ul>
<h2>
Softwares
</h2>
<h4><a href="http://yann.esposito.free.fr/sedil.php">SEDiL</a></h4>
<p>
<a href="http://yann.esposito.free.fr/sedil.php?lang=en">SEDiL</a>:
Software aimed to learn tree edit distances.
Developped in JAVA (11.000 lines with javadoc comments) ;
</p>
<p>
main features:
</p>
<ul class="petit">
<li>
edition operations cost matrix learning,
</li>
<li>
tree or string edit distance computation,
</li>
<li>
tree and strings visualisation,
</li>
<li>
classification using the K nearest
neighbor algorithm,
</li>
<li>
Tree pairs generation,
</li>
</ul>
<h4> <a href="http://yann.esposito.free.fr/dees.php">DEES</a> </h4>
<a href="http://yann.esposito.free.fr/dees.php">DEES</a>: <a href="http://yann.esposito.free.fr/dees.php">DEES</a>:
Software of Multiplicity Automata inference Software of Multiplicity Automata inference
@ -82,7 +226,6 @@ newcorps
</li> </li>
<li> And many others... </li> <li> And many others... </li>
</ul> </ul>
</div>
newcorps newcorps

View file

@ -15,7 +15,7 @@ multiDescription:
----- -----
<%= blogimage( 'intro.jpg' , 'Lost Highway' ) %> <%= blogimage( 'Lost Highway' , 'intro.jpg' ) %>
@ -68,7 +68,7 @@ I believe I had found a coherent interpretation which allow to follow the movie
## The Rorschach test ## The Rorschach test
<%= leftblogimage('rorschach.gif' , 'test de Rorschach') %> <%= leftblogimage( 'test de Rorschach','rorschach.gif' ) %>
!!fr!! !!fr!!
À l'instar du protagoniste chacun voit dans ce film ce qu'il a envie d'y voir. Nous pouvons nous y perdre simplement parce que nous pouvons nous perdre dans notre propre esprit. C'est une invitation à la réflexion. Regarder ce film c'est un peu comme passer un test de Rorschach. Qu'y voit-on ? Chacun y met un peu de sa propre personnalité dans l'explication du film. À l'instar du protagoniste chacun voit dans ce film ce qu'il a envie d'y voir. Nous pouvons nous y perdre simplement parce que nous pouvons nous perdre dans notre propre esprit. C'est une invitation à la réflexion. Regarder ce film c'est un peu comme passer un test de Rorschach. Qu'y voit-on ? Chacun y met un peu de sa propre personnalité dans l'explication du film.
@ -104,5 +104,5 @@ I write this post because I believe I had found an interpretation which seems co
<div style="text-align: center"> <div style="text-align: center">
<span style="font-size: 2em"> <a href="./03_losthighway_1/"><fr>Lire la suite</fr><en>Read more</en></a></span> <span style="font-size: 2em"> <a href="./03_losthighway_1/">Read more</a></span>
</div> </div>

View file

@ -14,7 +14,7 @@ multiTitle:
## Who is the mysterious man? ## Who is the mysterious man?
<%= leftblogimage( "mysteryman.jpg" , "l'homme mystérieux" ) %> <%= leftblogimage( "l'homme mystérieux" , "mysteryman.jpg" ) %>
Who's this mysterious man? He tells Fred it's him who invited him in his house. He's present at the party and in the house of Fred in the same time. Eyes wide open, looking everything Fred's doing? Who's this mysterious man? He tells Fred it's him who invited him in his house. He's present at the party and in the house of Fred in the same time. Eyes wide open, looking everything Fred's doing?

View file

@ -31,9 +31,9 @@ Dans ma première vision du film, j'avais envie de dire qu'il ne la tue pas. Mai
!!!! !!!!
!!en!!
The protagonist is a garagist fallen in love with a porno actress. He believe the producer is the bad guy who go again his will. Then he kills Dick Laurent. The protagonist is a garagist fallen in love with a porno actress. He believe the producer is the bad guy who go again his will. Then he kills Dick Laurent.
!!!!
### #2 Hypothesis ### #2 Hypothesis

View file

@ -19,7 +19,7 @@ tags:
----- -----
<%= blogimage("central_architecture.png","central architecture") %> <%= blogimage("central architecture","central_architecture.png") %>
I use [Git](http://www.git-scm.org/) to manage my personnal projects. I use [Git](http://www.git-scm.org/) to manage my personnal projects.
@ -162,12 +162,12 @@ This is why I created two simple scripts to automate this. One for creating a br
Then when you want to create a new branch (locally and remotely) ; you simply have to do a: Then when you want to create a new branch (locally and remotely) ; you simply have to do a:
<code class="zsh">git-create-new-branch branch_name</code> <div><code class="zsh">git-create-new-branch branch_name</code></div>
and when you are on another computer and want to get locally all the remote branches you execute: and when you are on another computer and want to get locally all the remote branches you execute:
<code class="zsh">git-get-remote-branches</code> <div><code class="zsh">git-get-remote-branches</code></div>
Here are the code of theese two scripts: Here are the code of theese two scripts:

View file

@ -27,7 +27,7 @@ After a bit more research (thanks to [ElectricSheep](http://community.electricsh
I discovered the good parameters for compilation. I discovered the good parameters for compilation.
<%= blogimage("xcodeConfig.png","XCode configuration") %> <%= blogimage("XCode configuration","xcodeConfig.png") %>
For now I didn't compiled it to work also on Tiger and Leopard. I don't know XCode enought to know how to make the Garbage collector to be disabled on 32 bits version and enabled on 64 bits version. For now I didn't compiled it to work also on Tiger and Leopard. I don't know XCode enought to know how to make the Garbage collector to be disabled on 32 bits version and enabled on 64 bits version.

View file

@ -53,8 +53,8 @@ Here is the script I use in order to synchronize my website with maximum safety.
The idea are: The idea are:
- synchronize to a temporary folder then swap the name therefore the website isn't accessible only during the swap time. It takes only the time of two rename. - Synchroniser vers un répertoire temporaire sur le serveur distant, puis "swapper" les noms des répertoires. Ainsi le site ne reste indisponible que le temps du "swap" du nom des deux répertoires.
- reiterate all operations until they work (for example, renaming). - Réitérer toutes les opérations jusqu'à ce qu'elle aient réussi (par exemple pour le renommage)
For now I use `rsync` which in fact is no more efficient than a simple `cp` with WebDav. And I should use a method to keep track of elements who have changed. before the publication. For now I use `rsync` which in fact is no more efficient than a simple `cp` with WebDav. And I should use a method to keep track of elements who have changed. before the publication.
@ -69,6 +69,113 @@ My script take a `-s` option in order to make only the swap option. It also take
In order to keep this script working for you, just modify the username by yours (the value of the `mobileMeUser`). In order to keep this script working for you, just modify the username by yours (the value of the `mobileMeUser`).
<div class="fr">
<code class="zsh" file="publish">
#!/usr/bin/env zsh
# Script synchronisant le site sur me.com
# normalement, le site est indisponible le moins de temps possible
# le temps de deux renommages de répertoire
mobileMeUser="yann.esposito"
siteName="siteName"
# Depending of my hostname the
if [[ $(hostname) == 'ubuntu' ]]; then
iDisk='/mnt/iDisk'
else
iDisk="/Volumes/$mobileMeUser"
fi
root=$HOME/Sites/$siteName
destRep=$iDisk/Web/Sites/$siteName
[[ ! -d $root ]] && {
print -- "$root n'existe pas ; vérifiez la conf" >&2;
exit 1
}
[[ ! -d $destRep ]] && {
print -- "$destRep n'existe pas, veuillez remonter le FS" >&2;
exit 1
}
if [[ $1 == '-h' ]]; then
print -- "usage: $0:h [-h|-a|-s]"
print -- " -a sychronise aussi l'index"
print -- " -h affiche l'aide"
print -- " -s swappe simplement les répertoires"
fi
if [[ $1 == '-a' ]]; then
print -- "Synchronisation de l'index (${destRep:h})"
rsync -av $root/index.html ${destRep:h}/index.html
fi
print -- "Root = $root"
print -- "Dest = $destRep"
if [[ ! $1 = '-s' ]]; then
[[ ! -d $destRep.tmp ]] && mkdir $destRep.tmp
print -P -- "%B[Sync => tmp]%b"
result=1
essai=1
while (( $result > 0 )); do
rsync -arv $root/Scratch/ $destRep.tmp
result=$?
if (( $result > 0 )); then
print -P -- "%BEchec du rsync%b (essai n°$essai)" >&2
fi
((essai++))
done
fi
# SWAP
print -P -- "%B[Swap des Répertoires (tmp <=> target)]%b"
essai=1
while [[ -e $destRep.old ]]; do
print -n -- "suppression de $destRep.old"
if ((essai>1)); then
print " (essai n°$essai)"
else
print
fi
((essai++))
\rm -rf $destRep.old
done
print -- " renommage du repertoire sandard vers le .old"
essai=1
while [[ -e $destRep ]]; do
mv $destRep $destRep.old
(($?)) && print -- "Echec du renommage (essai n°$essai)" >&2
((essai++))
done
print -- " renommage du repertoire tmp (nouveau) vers le standard"
print -P -- " %BSite Indisponible%b $(date)"
essai=1
while [[ ! -e $destRep ]]; do
mv $destRep.tmp $destRep
(($?)) && print -P -- "%B[Site Indisponible]%b(essai n°$essai) Echec du renommage (mv $destRep.tmp $destRep)" >&2
((essai++))
done
print -P -- "\t===\t%BSITE DISPONIBLE%b\t==="
print -- " renommage du repertoire old vers le tmp"
essai=1
while [[ ! -e $destRep ]]; do
mv $destRep.old $destRep.tmp
(($?)) && print -P -- "Echec du renommage n°$essai" >&2
((essai++))
done
print -P -- " publication terminée"
</code>
</div>
<div class="en"> <div class="en">
<code class="zsh" file="publish"> <code class="zsh" file="publish">
#!/usr/bin/env zsh #!/usr/bin/env zsh

View file

@ -31,17 +31,17 @@ Here is my new script, it first create a map which associate to each file its ha
Even with this script I also have some problem. Mostly due to 'webdav' issues. For example, renaming a folder work really badly (on Linux at least). I use webdavfs. For example: Even with this script I also have some problem. Mostly due to 'webdav' issues. For example, renaming a folder work really badly (on Linux at least). I use webdavfs. For example:
<code class="zsh"> <div><code class="zsh">
mv folder folder2 mv folder folder2
</code> </code></div>
It returns OK and I've got: It returns OK and I've got:
<code class="zsh"> <div><code class="zsh">
$ ls $ ls
folder folder2 folder folder2
</code> </code></div>
Booh.... Booh....
@ -49,7 +49,7 @@ Booh....
In order to handle most webdav issues I use a *framework* in zsh. It handle almost all except the correct renaming of folder. Working on it... Anyway here is the code I use. In order to handle most webdav issues I use a *framework* in zsh. It handle almost all except the correct renaming of folder. Working on it... Anyway here is the code I use.
<code class="zsh" file="webdav-framework"> <div><code class="zsh" file="webdav-framework">
#!/usr/bin/env zsh #!/usr/bin/env zsh
function samelineprint { function samelineprint {
@ -158,12 +158,12 @@ function trymv {
done done
print print
} }
</code> </code></div>
And here is the code on how I synchronize my website. There is a little cryptic code. It correspond a problem caused by the bluecloth filter which is a markdown program made in ruby. Each time my email is written it is transformed differently. This is why I remove this part from the content of each html file. Without it, all my files containing email are different at each regeneration of my website. And here is the code on how I synchronize my website. There is a little cryptic code. It correspond a problem caused by the bluecloth filter which is a markdown program made in ruby. Each time my email is written it is transformed differently. This is why I remove this part from the content of each html file. Without it, all my files containing email are different at each regeneration of my website.
<code class="zsh" file="publish"> <div><code class="zsh" file="publish">
#!/usr/bin/env zsh #!/usr/bin/env zsh
# Script synchronisant le site sur me.com # Script synchronisant le site sur me.com
@ -285,7 +285,7 @@ else
print -P -- "%BSync%b[${Root:t} => ${destRep:t}$suffix]" print -P -- "%BSync%b[${Root:t} => ${destRep:t}$suffix]"
incrementalPublish incrementalPublish
fi fi
</code> </code></div>
This is my way to replace `rsync` with filesystem not handling it. This is my way to replace `rsync` with filesystem not handling it.

View file

@ -24,16 +24,16 @@ For developer IE is a nightmare. This is why, I use a method to disable my stand
<code class="javascript"> <div><code class="javascript">
$(document).ready( function() { $(document).ready( function() {
if ($.browser["msie"]) { if ($.browser["msie"]) {
// include the ie.js file // include the ie.js file
$('head').append('<script type="text/javascript" src="/js/ie.js"></scr' + 'ipt>'); $('head').append('<script type="text/javascript" src="/js/ie.js"></scr' + 'ipt>');
} }
}); });
</code> </code></div>
<code class="javascript" file="ie.js"> <div><code class="javascript" file="ie.js">
// Remove all CSS I don't want to use on IE // Remove all CSS I don't want to use on IE
$('link[rel=stylesheet]').each(function(i) $('link[rel=stylesheet]').each(function(i)
{ {
@ -51,6 +51,6 @@ $('head').append('<link rel="stylesheet" type="text/css" href="/css/ie.css"/>');
// I also add a message on top of the page // I also add a message on top of the page
$('body').prepend('<div id="iemessage"><p><span class="fr"><em>Avec <a href="http://www.firefox.com"> Firefox </a> et <a href="http://www.apple.com/safari">Safari</a> cette page est bien plus jolie !</em></span><span class="en"><em>This page is far nicer with <a href="http://www.firefox.com"> Firefox </a> and <a href="http://www.apple.com/safari">Safari</a>!</em></span></p>.</div>'); $('body').prepend('<div id="iemessage"><p><span class="fr"><em>Avec <a href="http://www.firefox.com"> Firefox </a> et <a href="http://www.apple.com/safari">Safari</a> cette page est bien plus jolie !</em></span><span class="en"><em>This page is far nicer with <a href="http://www.firefox.com"> Firefox </a> and <a href="http://www.apple.com/safari">Safari</a>!</em></span></p>.</div>');
</code> </code></div>
That's it. That's it.

View file

@ -48,7 +48,7 @@ The HTML:
The CSS: The CSS:
<code class="css"> <div><code class="css">
#menuButton { #menuButton {
font-size: 2em; font-size: 2em;
height: 2em; height: 2em;

View file

@ -25,8 +25,8 @@ Here is a live example of what appear while loading my pages.
<div id="demo" style="width:45%; position: relative; height: 8em; background-image: url('/Scratch/css/img/red.jpg'); background-position: 50% 50%; color: #fff; text-align: center; padding-top: 1em; margin-left: auto; margin-right: auto; border: solid 10px rgba(255,255,255,0.7); -webkit-border-radius: 1em; -moz-border-radius: 1em; border-radius: 1em; cursor: pointer; "> <div id="demo" style="width:45%; position: relative; height: 8em; background-image: url('/Scratch/css/img/red.jpg'); background-position: 50% 50%; color: #fff; text-align: center; padding-top: 1em; margin-left: auto; margin-right: auto; border: solid 10px rgba(255,255,255,0.7); -webkit-border-radius: 1em; -moz-border-radius: 1em; border-radius: 1em; cursor: pointer; ">
<p><en>Hello! I've finished loading!</en><fr>Voilà ! Je suis chargée !</fr></p> <p>Hello! I've finished loading!</p>
<p><en>Click me to see me disapear again.</en><fr>Cliquez-moi dessus pour recommencer.</fr></p> <p>Click me to see me disapear again.</p>
<div id="todisapear" style="color: #000; position:absolute;top:0;left:0;text-align: center; padding-top: 1em; width: 100%; background-color: #eee; height: 8em;"> <div id="todisapear" style="color: #000; position:absolute;top:0;left:0;text-align: center; padding-top: 1em; width: 100%; background-color: #eee; height: 8em;">
Loading... Loading...
<img style="border: none; background-color: none; background: none" src="/Scratch/img/loading.gif" alt="loading logo"/> <img style="border: none; background-color: none; background: none" src="/Scratch/img/loading.gif" alt="loading logo"/>

View file

@ -42,7 +42,7 @@ HTML:
CSS: CSS:
<code class="css"> <div><code class="css">
#entete { #entete {
top: 1em; top: 1em;
left: 0; left: 0;
@ -56,11 +56,11 @@ CSS:
left: 0; left: 0;
position: fixed; position: fixed;
width: 10em; } width: 10em; }
</code> </code></div>
Javascript: Javascript:
<code class="javascript"> <div><code class="javascript">
var last=0; var last=0;
// will hide the menu in 5 seconds // will hide the menu in 5 seconds
@ -100,7 +100,7 @@ function showMenu() {
autoHideMenu(last); autoHideMenu(last);
} }
</code> </code></div>
Simple and lightweight. No timer (almost), no memory leak, no Date... Simple and lightweight. No timer (almost), no memory leak, no Date...

View file

@ -26,7 +26,7 @@ Here is a tip, I don't know why, but I almost always forgot how to do that.
When you want to launch a command and this command should not be killed after you close your terminal. Here is how to accomplish that from command line: When you want to launch a command and this command should not be killed after you close your terminal. Here is how to accomplish that from command line:
<code class="zsh"> <div><code class="zsh">
nohup cmd & nohup cmd &
</code> </code>
<small>where <code>cmd</code> is your command.</small> <small>where <code>cmd</code> is your command.</small>

View file

@ -19,19 +19,15 @@ tags:
----- -----
<en>
<small> <em>I explain why I had so much difficulties to use Git. There is an "untaught rule" that make hard to work without. Until I read the good document. </em></small>
</en>
<fr>
<small> <em>Je décris pourquoi j'ai eu tant de mal à me faire à Git. Il y a en effet une partie "non dite" qui m'a bloqué pendant un bon moment. Jusqu'à ce que je découvre le bon document. </em></small>
</fr>
<en> <small> <em>I explain why I had so much difficulties to use Git. There is an "untaught rule" that make hard to work without. Until I read the good document. </em></small>
<small> <em> "Cheap branches" aren't designed to be totally isolated branches but rather should follow a "Master Branch". There is a </em>Standard Workflow<em> to follow. If you don't follow it, you prepare yourself with some hard time with Git.</em> </small> <small> <em> "Cheap branches" aren't designed to be totally isolated branches but rather should follow a "Master Branch". There is a </em>Standard Workflow<em> to follow. If you don't follow it, you prepare yourself with some hard time with Git.</em> </small>
</en>
<fr>
<small> <em> Le fait est que les *branches légères* ne sont pas destinée à être des branches isolées. Ainsi, il y a un </em>"workflow standard"<em> qui s'il n'est pas suivi rend l'utilisation de Git inappropriée. </em> </small>
</fr>
newcorps newcorps
@ -179,19 +175,19 @@ And I return exactly in branches Bazaar provided me.
For now, I prefer (from far) Bazaar terminology. They are cleaner and more understandable. For now, I prefer (from far) Bazaar terminology. They are cleaner and more understandable.
<code class="zsh">bzr revert</code> <div><code class="zsh">bzr revert</code></div>
Is clearer than Is clearer than
<code class="zsh">git reset --hard HEAD</code> <div><code class="zsh">git reset --hard HEAD</code></div>
We can tell the same thing about We can tell the same thing about
<code class="zsh">bzr revert -r -3</code> <div><code class="zsh">bzr revert -r -3</code></div>
which seems preferable to which seems preferable to
<code class="zsh">git reset --hard HEAD~3</code> <div><code class="zsh">git reset --hard HEAD~3</code></div>
Until now, it is not big business. But now, things will go worse. Until now, it is not big business. But now, things will go worse.
@ -204,7 +200,7 @@ If we want to revert time on all the tree we use the keyword `reset`.
Now, if I want to revert time on on file. We should naturally imagine the command will be: Now, if I want to revert time on on file. We should naturally imagine the command will be:
<code class="zsh">git reset --hard FILE</code> <div><code class="zsh">git reset --hard FILE</code></div>
<center>**OF COURSE NOT!**</center> <center>**OF COURSE NOT!**</center>
@ -212,14 +208,14 @@ Now, if I want to revert time on on file. We should naturally imagine the comman
The solution is: The solution is:
<code class="zsh">git checkout FILE</code> <div><code class="zsh">git checkout FILE</code></div>
What? **`checkout`** !? Well, ok. I accept. why not? What? **`checkout`** !? Well, ok. I accept. why not?
With Bazaar it is: With Bazaar it is:
<code class="zsh">git revert FILE</code> <div><code class="zsh">git revert FILE</code></div>
What I personally found far more natural. What I personally found far more natural.
@ -230,13 +226,13 @@ But the command to change the current *cheap branch* is really hard to be accept
With Bazaar it is: With Bazaar it is:
<code class="zsh">cd ../branch</code> <div><code class="zsh">cd ../branch</code></div>
Well yes. With Bazaar you have to change your directory to change your branch. It needs more disk resources but it is really clear. Which is my current branch, is just a `pwd` away. For Git here is the command: Well yes. With Bazaar you have to change your directory to change your branch. It needs more disk resources but it is really clear. Which is my current branch, is just a `pwd` away. For Git here is the command:
<code class="zsh">git checkout branch</code> <div><code class="zsh">git checkout branch</code></div>
**WTF?** I believed `checkout` was the key to get a file in some state (not the entire tree). **WTF?** I believed `checkout` was the key to get a file in some state (not the entire tree).

View file

@ -37,14 +37,14 @@ Here is the list of sufficient and necessary command to use [Git][git]. There is
Get a project from the web: Get a project from the web:
<code class="zsh"> <div><code class="zsh">
git clone ssh://server/path/to/project git clone ssh://server/path/to/project
</code> </code></div>
Everyday [Git][git] usage: Everyday [Git][git] usage:
<code class="zsh"> <div><code class="zsh">
# get modifications from other # get modifications from other
git pull git pull
# read what was done # read what was done
@ -66,7 +66,7 @@ git commit -a -m "Fix bug #321"
# send local modifications to other # send local modifications to other
git push git push
</code> </code></div>

View file

@ -39,7 +39,7 @@ When somebody work with files without a versions system, the following happens f
When you modify a somehow critical file you don't want to loose. You copy naturally this file with another name. For example: When you modify a somehow critical file you don't want to loose. You copy naturally this file with another name. For example:
<code class="zsh">$ cp fichier_important.c fichier_important.c.bak</code> <div><code class="zsh">$ cp fichier_important.c fichier_important.c.bak</code></div>
In consequence of what, the new file, play the role of *backup*. If you break everything, you can always return in the last state by overwriting your modifications. In consequence of what, the new file, play the role of *backup*. If you break everything, you can always return in the last state by overwriting your modifications.
@ -82,18 +82,13 @@ begindiv(black)
*What gives versions system?* (I didn't mention everything at all) *What gives versions system?* (I didn't mention everything at all)
<fr>
- backup automatique de tous les fichiers: *Revenir dans le temps.* ;
- donne la possibilité de voir les différences entre chaque version et les différences entre la version en cours et les modifications locales ;
- permet de poser un *tag* sur certaines versions et ainsi pouvoir s'y référer facilement ;
- permet d'avoir un historique des modifications. Car en général il est demandé aux utilisateur d'ajouter un petit commentaire à chaque nouvelle version.
</fr>
<en>
- automatic backups: *back in time*, - automatic backups: *back in time*,
- gives the ability to see differences between each version, - gives the ability to see differences between each version,
- put a *tag* on some version to be able to refer to them easily, - put a *tag* on some version to be able to refer to them easily,
- gives the ability to see an historic of all modifications. Generally the user must add a comment for each new version. - gives the ability to see an historic of all modifications. Generally the user must add a comment for each new version.
</en>
enddiv enddiv
@ -112,7 +107,7 @@ Let's begin by an example, a two person project ; Alex and Beatrice. On a file c
Cthulhu Cthulhu
Shubniggurath Shubniggurath
Yogsototh Yogsototh
</code> </code></div>
Say Alex is home and modify the file: Say Alex is home and modify the file:
<div style="width: 10em; margin-left: auto; margin-right: auto"> <div style="width: 10em; margin-left: auto; margin-right: auto">
@ -168,18 +163,13 @@ begindiv(black)
**In what Concurrent Versions System help?** **In what Concurrent Versions System help?**
<fr>
- récupérer sans problème les modifications des autres ;
- envoyer sans problème ses modifications aux autres ;
- permet de gérer les conflits. Je n'en ai pas parlé, mais quand un conflit arrive (ça peut arriver si deux personnes modifient la même ligne avec deux contenus différents), les <abbr title="Systèmes de versions concurrentes">SVC</abbr> proposent leur aide pour les résoudre. J'en dirai un mot plus loin.
- permet de savoir qui a fait quoi et quand
</fr>
<en>
- get without any problem others modifications, - get without any problem others modifications,
- send without any problem its own modifications to others, - send without any problem its own modifications to others,
- manage conflicts. I didn't speak about it, but sometimes a conflict can occur (when two different people modify the same line on a file for example). SVC help to resolve such problem. More on that later, - manage conflicts. I didn't speak about it, but sometimes a conflict can occur (when two different people modify the same line on a file for example). SVC help to resolve such problem. More on that later,
- help to know who done what and when. - help to know who done what and when.
</en>
enddiv enddiv

View file

@ -24,18 +24,9 @@ Here is one from many way to use [Git][git]. This method is sufficient to work o
Work with [Git][git] immediately: Work with [Git][git] immediately:
<fr>
+ récupérer les modifications des autres <span class="black">`git pull`</span>
+ voir les détails de ces modifications <span class="black">`git log`</span>
+ Plusieurs fois:
+ *Faire une modification atomique*
+ verifier le details de ses modifications <span class="black">`git status`</span> et <span class="black">`git diff`</span>
+ indiquer si nécessaire que de nouveaux fichiers doivent être *versionnés* <span class="black">`git add [file]`</span>
+ enregistrer ses modifications <br/><span class="black">`git commit -a -m "message"`</span>
+ envoyer ses modifications aux autres <span class="black">`git push`</span> (refaire un `git pull` si le push renvoie une erreur).
</fr>
<en>
+ Get modification done by others <span class="black">`git pull`</span>, + Get modification done by others <span class="black">`git pull`</span>,
+ See details of these modifications <span class="black">`git log`</span>, + See details of these modifications <span class="black">`git log`</span>,
+ Many times: + Many times:
@ -44,7 +35,7 @@ Work with [Git][git] immediately:
+ Add some file to be versionned if necessary:<br/><span class="black">`git add [file]`</span>, + Add some file to be versionned if necessary:<br/><span class="black">`git add [file]`</span>,
+ Save you modifications <br/><span class="black">`git commit -a -m "message"`</span>, + Save you modifications <br/><span class="black">`git commit -a -m "message"`</span>,
+ Send your modifications to others: <span class="black">`git push`</span> (redo a `git pull` if push return an error). + Send your modifications to others: <span class="black">`git push`</span> (redo a `git pull` if push return an error).
</en>
With these few commands you can use [Git][git]. Even if it is sufficient, you need to know one more thing before really begin ; How to manage *conflicts*. With these few commands you can use [Git][git]. Even if it is sufficient, you need to know one more thing before really begin ; How to manage *conflicts*.

View file

@ -21,18 +21,8 @@ tags:
In the first part, we saw the list of resolved problem by [Git][git]. To resume [Git][git] should do: In the first part, we saw the list of resolved problem by [Git][git]. To resume [Git][git] should do:
<fr>
- récupérer les modifications des autres ;
- envoyer ses modifications aux autres ;
- revenir dans le temps ;
- lister les différences entre chaque version ;
- nommer certaines versions pour s'y référer facilement ;
- afficher l'historique des modifications ;
- savoir qui a fait quoi et quand ;
- gérer des conflits ;
- manipuler facilement des branches.
</fr>
<en>
- get others modifications, - get others modifications,
- send modifications to others, - send modifications to others,
- get back in time, - get back in time,
@ -42,121 +32,121 @@ In the first part, we saw the list of resolved problem by [Git][git]. To resume
- know who did what and when, - know who did what and when,
- manage conflicts, - manage conflicts,
- easily manage branches. - easily manage branches.
</en>
### get others modifications ### get others modifications
<code class="zsh"> <div><code class="zsh">
$ git pull $ git pull
</code> </code></div>
### send modifications to others ### send modifications to others
<code class="zsh"> <div><code class="zsh">
$ git push $ git push
</code> </code></div>
or more generally or more generally
<code class="zsh"> <div><code class="zsh">
$ git pull $ git pull
$ git push $ git push
</code> </code></div>
### get back in time ### get back in time
#### For all tree #### For all tree
<code class="zsh"> <div><code class="zsh">
$ git checkout $ git checkout
</code> </code></div>
<code class="zsh"> <div><code class="zsh">
$ git revert $ git revert
</code> </code></div>
revert three version before (see my `.gitconfig` file). revert three version before (see my `.gitconfig` file).
<code class="zsh"> <div><code class="zsh">
$ git uncommit 3 $ git uncommit 3
</code> </code></div>
Undo the las merge (if something goes wrong) Undo the las merge (if something goes wrong)
<code class="zsh"> <div><code class="zsh">
$ git revertbeforemerge $ git revertbeforemerge
</code> </code></div>
#### For one file #### For one file
<code class="zsh"> <div><code class="zsh">
$ git checkout file $ git checkout file
$ git checkout VersionHash file $ git checkout VersionHash file
$ git checkout HEAD~3 file $ git checkout HEAD~3 file
</code> </code></div>
### list differences between each version ### list differences between each version
list files being modified list files being modified
<code class="zsh"> <div><code class="zsh">
$ git status $ git status
</code> </code></div>
fr:différences entre les fichier de la dernière version et les fichiers locaux. fr:différences entre les fichier de la dernière version et les fichiers locaux.
<code class="zsh"> <div><code class="zsh">
$ git diff $ git diff
</code> </code></div>
liste les différences entre les fichier d'une certaine version et les fichiers locaux. liste les différences entre les fichier d'une certaine version et les fichiers locaux.
<code class="zsh"> <div><code class="zsh">
$ git diff VersionHash fichier $ git diff VersionHash fichier
</code> </code></div>
### name some version to refer to them in the future ### name some version to refer to them in the future
<code class="zsh"> <div><code class="zsh">
$ git tag 'toto' $ git tag 'toto'
</code> </code></div>
### show historic of modifications ### show historic of modifications
<code class="zsh"> <div><code class="zsh">
$ git log $ git log
$ git lg $ git lg
$ git logfull $ git logfull
</code> </code></div>
### en:know who did what and when:: ### en:know who did what and when::
<code class="zsh"> <div><code class="zsh">
$ git blame fichier $ git blame fichier
</code> </code></div>
### handle conflicts ### handle conflicts
<code class="zsh"> <div><code class="zsh">
$ git conflict $ git conflict
</code> </code></div>
### manage branches ### manage branches
To create a branch: To create a branch:
<code class="zsh"> <div><code class="zsh">
$ git branch branch_name $ git branch branch_name
</code> </code></div>
To change the current branch: To change the current branch:
<code class="zsh"> <div><code class="zsh">
$ git checkout branch_name $ git checkout branch_name
</code> </code></div>
[git]: http://git-scm.org "Git" [git]: http://git-scm.org "Git"

View file

@ -19,7 +19,7 @@ multiTitle:
Under Linux Ubuntu or Debian: Under Linux Ubuntu or Debian:
<code class="zsh">$ sudo apt-get install git</code> <div><code class="zsh">$ sudo apt-get install git</code></div>
Under Mac OS X: Under Mac OS X:
@ -27,18 +27,18 @@ Under Mac OS X:
* install [MacPorts](http://macports.org/install.php) * install [MacPorts](http://macports.org/install.php)
* install [Git][git] * install [Git][git]
<code class="zsh"> <div><code class="zsh">
$ sudo port selfupdate $ sudo port selfupdate
$ sudo port install git-core $ sudo port install git-core
</code> </code></div>
## Global configuration ## Global configuration
Save the following file as your `~/.gitconfig`. Save the following file as your `~/.gitconfig`.
<code class="zsh" file="gitconfig"> <div><code class="zsh" file="gitconfig">
[color] [color]
branch = auto branch = auto
diff = auto diff = auto
@ -59,17 +59,17 @@ Save the following file as your `~/.gitconfig`.
# conflict = !gitx --left-right HEAD...MERGE_HEAD # conflict = !gitx --left-right HEAD...MERGE_HEAD
[branch] [branch]
autosetupmerge = true autosetupmerge = true
</code> </code></div>
You can achieve the same result using for each entry the command: `git config --global`. Next, configure your name and your email. For example, if your name is John Doe and your email is `john.doe@email.com`. Launch the following commands: You can achieve the same result using for each entry the command: `git config --global`. Next, configure your name and your email. For example, if your name is John Doe and your email is `john.doe@email.com`. Launch the following commands:
<code class="zsh"> <div><code class="zsh">
$ git config --global user.name John Doe $ git config --global user.name John Doe
$ git config --global user.email john.doe@email.com $ git config --global user.email john.doe@email.com
</code> </code></div>
Here it is. Base configuration is over. The file containing alias will help to type shorter commands. Here it is. Base configuration is over. The file containing alias will help to type shorter commands.
@ -81,31 +81,31 @@ Here it is. Base configuration is over. The file containing alias will help to t
If a project is already versionned with [Git][git] you should have an `URL` of the sources. Then use the following command: If a project is already versionned with [Git][git] you should have an `URL` of the sources. Then use the following command:
<code class="zsh"> <div><code class="zsh">
$ cd ~/Projets $ cd ~/Projets
$ git clone git://main.server/path/to/file $ git clone git://main.server/path/to/file
</code> </code></div>
If there is no git server but you've got an `ssh` access. Just replace the `git://host` by `ssh://user@host`. In order not to type your password each time, use: If there is no git server but you've got an `ssh` access. Just replace the `git://host` by `ssh://user@host`. In order not to type your password each time, use:
<code class="zsh"> <div><code class="zsh">
$ ssh-keygen -t rsa $ ssh-keygen -t rsa
</code> </code></div>
Reply to question and **do not enter* a password. Then copy your keys to the distant server. This is not the safest way to do this. The safest being, using `ssh-agent`. Reply to question and **do not enter* a password. Then copy your keys to the distant server. This is not the safest way to do this. The safest being, using `ssh-agent`.
<code class="zsh"> <div><code class="zsh">
me@locahost$ scp ~/.ssh/id_rsa.pub me@main.server: me@locahost$ scp ~/.ssh/id_rsa.pub me@main.server:
me@locahost$ ssh me@main.server me@locahost$ ssh me@main.server
password: password:
me@main.server$ cat id_rsa.pub >> ~/.ssh/authorized_keys me@main.server$ cat id_rsa.pub >> ~/.ssh/authorized_keys
me@main.server$ rm id_rsa.pub me@main.server$ rm id_rsa.pub
me@main.server$ logout me@main.server$ logout
</code> </code></div>
Now you don't need to write your password to access the `main.server`. Now you don't need to write your password to access the `main.server`.
@ -117,40 +117,40 @@ Now you don't need to write your password to access the `main.server`.
Suppose you already have a project with files. Then it is really easy to version it. Suppose you already have a project with files. Then it is really easy to version it.
<code class="zsh"> <div><code class="zsh">
$ cd /path/to/project $ cd /path/to/project
$ git init $ git init
$ git add . $ git add .
$ git commit -m "Initial commit" $ git commit -m "Initial commit"
</code> </code></div>
Let do a small remark. If you don't want to *version* every file. Typically intermediate compilation file, swap files... Then you need to exclude them. Just before launching the `git add .` command. You need to create a `.gitignore` file in the root directory of your project. This file will contain all exclude *pattern*. For example: Let do a small remark. If you don't want to *version* every file. Typically intermediate compilation file, swap files... Then you need to exclude them. Just before launching the `git add .` command. You need to create a `.gitignore` file in the root directory of your project. This file will contain all exclude *pattern*. For example:
<code class="zsh"> <div><code class="zsh">
*.o *.o
*.bak *.bak
*.swp *.swp
*~ *~
</code> </code></div>
Now, if you want to create a repository on a distant server, it *must* not be in `bare` mode. The repository will contain only versionning informations, but not the files of the project. To achieve that: Now, if you want to create a repository on a distant server, it *must* not be in `bare` mode. The repository will contain only versionning informations, but not the files of the project. To achieve that:
<code class="zsh"> <div><code class="zsh">
$ cd /path/to/local/project $ cd /path/to/local/project
$ git clone --bare . ssh://server/path/to/project $ git clone --bare . ssh://server/path/to/project
</code> </code></div>
Others will be able to get your modifications. Others will be able to get your modifications.
<code class="zsh"> <div><code class="zsh">
git clone ssh://server/path/to/project git clone ssh://server/path/to/project
</code> </code></div>
## Abstract of the second step ## Abstract of the second step

View file

@ -64,16 +64,16 @@ And it was so fastidious! The `git` terminology was *horrible*! And it is nothin
The first example, `checkout` is used to make only one thing from the technical point of vue. But from the user perspective, you make many *different* things with this word. Example: The first example, `checkout` is used to make only one thing from the technical point of vue. But from the user perspective, you make many *different* things with this word. Example:
<code class="zsh"> <div><code class="zsh">
git checkout pipo git checkout pipo
</code> </code></div>
undo the current modification of the file `pipo` undo the current modification of the file `pipo`
<code class="zsh"> <div><code class="zsh">
git checkout pipo git checkout pipo
</code> </code></div>
change the current branch to the branch `pipo` change the current branch to the branch `pipo`
@ -82,9 +82,9 @@ change the current branch to the branch `pipo`
And, like me, you remark, it is exactly the same command to make two completely different things. What occur when you have a `pipo` branch and a `pipo` file? By default, it change the current branch. In order to leave the ambiguity you have to use the following syntax: And, like me, you remark, it is exactly the same command to make two completely different things. What occur when you have a `pipo` branch and a `pipo` file? By default, it change the current branch. In order to leave the ambiguity you have to use the following syntax:
<code class="zsh"> <div><code class="zsh">
git checkout ./pipo git checkout ./pipo
</code> </code></div>
Yes, hum... Yes, hum...
@ -97,25 +97,25 @@ It works, but it is clearly not really user friendly. Furthermore, checkout had
Bazaar terminology is far more natural, because there is no command to change the current branch as there is only one branch per directory. Changing a branch in Bazaar is changing the current directory. I also believe it is the biggest problem of Bazaar, I'll tell you why. And to undo things in Bazaar: Bazaar terminology is far more natural, because there is no command to change the current branch as there is only one branch per directory. Changing a branch in Bazaar is changing the current directory. I also believe it is the biggest problem of Bazaar, I'll tell you why. And to undo things in Bazaar:
<code class="zsh"> <div><code class="zsh">
bzr revert pipo bzr revert pipo
</code> </code></div>
Furthermore, most Bazaar command take a revision number in parameter. For example, to get back 3 versions earlier, it is enough to write: Furthermore, most Bazaar command take a revision number in parameter. For example, to get back 3 versions earlier, it is enough to write:
<code class="zsh"> <div><code class="zsh">
bzr revert -r -3 pipo bzr revert -r -3 pipo
</code> </code></div>
The `git` equivalent is far more cryptic: The `git` equivalent is far more cryptic:
<code class="zsh"> <div><code class="zsh">
bzr checkout HEAD~3 pipo bzr checkout HEAD~3 pipo
</code> </code></div>
One more time, Bazaar is far more readable. One more time, Bazaar is far more readable.
@ -126,37 +126,37 @@ Back in time for all the project:
with Bazaar: with Bazaar:
<code class="zsh"> <div><code class="zsh">
bzr revert -r -3 pipo bzr revert -r -3 pipo
</code> </code></div>
and with `git`? `git checkout`? Of course not! It would be too simple. What we find in the documentation (`man`) and everywhere on the net: and with `git`? `git checkout`? Of course not! It would be too simple. What we find in the documentation (`man`) and everywhere on the net:
<code class="zsh"> <div><code class="zsh">
git reset --hard HEAD~3 git reset --hard HEAD~3
</code> </code></div>
Except that this command is horrible. It forget revisions! Then you must use it with prudence. And you cannot tell other people working on the project you discard some changes. If someone had pulled the *bad* version, you are *doomed*. This is why you can also use: Except that this command is horrible. It forget revisions! Then you must use it with prudence. And you cannot tell other people working on the project you discard some changes. If someone had pulled the *bad* version, you are *doomed*. This is why you can also use:
<code class="zsh"> <div><code class="zsh">
git checkout HEAD~3 -- . && git commit -m 'back in time' git checkout HEAD~3 -- . && git commit -m 'back in time'
</code> </code></div>
Just to keep a backup branch. Without it we can definitively loose the current version HEAD. But some error may rest when there were some addition and deletion of files. *The unique way to be really clean without any risk is to use the following command:* Just to keep a backup branch. Without it we can definitively loose the current version HEAD. But some error may rest when there were some addition and deletion of files. *The unique way to be really clean without any risk is to use the following command:*
<code class="zsh"> <div><code class="zsh">
for i in $(seq 0 2); do for i in $(seq 0 2); do
git revert -n --no-edit head~$i; git revert -n --no-edit head~$i;
done done
git commit -m "reverted 3 versions back" git commit -m "reverted 3 versions back"
</code> </code></div>
@ -170,10 +170,10 @@ The rule is simple: *NEVER use the `git reset` command on a version somebody els
It was said. Discover the best method took me some time. I'd made many different tries. The safer and best way of reverting back your tree is to use this method. If you want to make it automatic just had the following alias in your `~/.gitconfig`. Of course this alias will work only on environment having `zsh` installed. Which is the cas for most UNIX (Ubuntu, Mac OS X...). It was said. Discover the best method took me some time. I'd made many different tries. The safer and best way of reverting back your tree is to use this method. If you want to make it automatic just had the following alias in your `~/.gitconfig`. Of course this alias will work only on environment having `zsh` installed. Which is the cas for most UNIX (Ubuntu, Mac OS X...).
<code class="zsh" file="gitconfig"> <div><code class="zsh" file="gitconfig">
[alias] [alias]
uncommit = !zsh -c '"if (($0)); then nb=$(( $0 - 1 )); else nb=0; fi; i=0; while ((i<=nb)); do git revert -n --no-edit HEAD~$i; ((i++)); done; git commit -m \"revert to $0 version(s) back\""' uncommit = !zsh -c '"if (($0)); then nb=$(( $0 - 1 )); else nb=0; fi; i=0; while ((i<=nb)); do git revert -n --no-edit HEAD~$i; ((i++)); done; git commit -m \"revert to $0 version(s) back\""'
</code> </code></div>
# What make `git` by far the best DCVS today # What make `git` by far the best DCVS today
@ -188,7 +188,7 @@ After talking about the negatives points of `git`, now it's time to speak about
You always work into the same main directory. For example, you can work on two fix in the same time. Say `fix1` require you to work on `file1` and `fix2` to work on `file2`. You can work in any order on `file1` and `file2` in the `master` branch. And then go to branch `fix1`, commit `file1` into it. Then go to branch `fix2` and commit `file2` into it. And finally merge the two branches `fix1` and `fix2` into `master`. You always work into the same main directory. For example, you can work on two fix in the same time. Say `fix1` require you to work on `file1` and `fix2` to work on `file2`. You can work in any order on `file1` and `file2` in the `master` branch. And then go to branch `fix1`, commit `file1` into it. Then go to branch `fix2` and commit `file2` into it. And finally merge the two branches `fix1` and `fix2` into `master`.
<code class="zsh"> <div><code class="zsh">
> vim file1 > vim file1
> vim file2 > vim file2
> git br fix1 > git br fix1
@ -200,7 +200,7 @@ You always work into the same main directory. For example, you can work on two f
> git commit master > git commit master
> git merge fix1 > git merge fix1
> git merge fix2 > git merge fix2
</code> </code></div>

View file

@ -22,6 +22,6 @@ tags:
I just found a way to change the default shell on Mac OS X. This note is mostly for me, but somebody else should find it useful. Just launch the following command: I just found a way to change the default shell on Mac OS X. This note is mostly for me, but somebody else should find it useful. Just launch the following command:
<code class="zsh"> <div><code class="zsh">
> chsh > chsh
</code> </code></div>

View file

@ -19,17 +19,17 @@ tags:
Sometimes you cannot simply write: Sometimes you cannot simply write:
<code class="ruby"> <div><code class="ruby">
if str.match(regexp) and if str.match(regexp) and
not str.match(other_regexp) not str.match(other_regexp)
do_something do_something
</code> </code></div>
and you have to make this behaviour with only one regular expression. The problem is the complementary of regular languages is not regular. Then, for some expression it is absolutely not impossible. and you have to make this behaviour with only one regular expression. The problem is the complementary of regular languages is not regular. Then, for some expression it is absolutely not impossible.
But sometimes with some simple regular expression it should be possible<sup><a href="#note1">&dagger;</a></sup>. Say you want to match everything containing the some word say `bull` but don't want to match `bullshit`. Here is a nice way to do that: But sometimes with some simple regular expression it should be possible<sup><a href="#note1">&dagger;</a></sup>. Say you want to match everything containing the some word say `bull` but don't want to match `bullshit`. Here is a nice way to do that:
<code class="ruby"> <div><code class="ruby">
# match all string containing 'bull' (bullshit comprised) # match all string containing 'bull' (bullshit comprised)
/bull/ /bull/
@ -41,7 +41,7 @@ bullshi([^t]|$)/
# another way to write it would be # another way to write it would be
/bull([^s]|$|s([^h]|$)|sh([^i]|$)|shi([^t]|$))/ /bull([^s]|$|s([^h]|$)|sh([^i]|$)|shi([^t]|$))/
</code> </code></div>
Let look closer. In the first line the expression is: Let look closer. In the first line the expression is:
`bull([^s]|$)`, why does the `$` is needed? `bull([^s]|$)`, why does the `$` is needed?
@ -54,7 +54,7 @@ Because, without it the word `bull` would be no more matched. This expression me
And this is it. I hope it could help you. And this is it. I hope it could help you.
Notice this method is not always the best. For example try to write a regular expression equivalent to the following conditional expression: Notice this method is not always the best. For example try to write a regular expression equivalent to the following conditional expression:
<code class="ruby"> <div><code class="ruby">
# Begin with 'a': ^a # Begin with 'a': ^a
# End with 'a': c$ # End with 'a': c$
# Contain 'b': .*b.* # Contain 'b': .*b.*
@ -63,18 +63,18 @@ if str.match(/^a.*b.*c$/) and
not str.match(/^axbxc$/) not str.match(/^axbxc$/)
do_something do_something
end end
</code> </code></div>
A nice solution is: A nice solution is:
<code class="ruby"> <div><code class="ruby">
/abc| # length 3 /abc| # length 3
a.bc| # length 4 a.bc| # length 4
ab.c| ab.c|
a[^x]b[^x]c| # length 5 a[^x]b[^x]c| # length 5
a...*b.*c| # length >5 a...*b.*c| # length >5
a.*b...*c/ a.*b...*c/
</code> </code></div>
This solution uses the maximal length of the string not to be matched. This solution uses the maximal length of the string not to be matched.
There certainly exists many other methods. But the important lesson is There certainly exists many other methods. But the important lesson is

View file

@ -46,36 +46,36 @@ The first error is to use the *evil* `.*`. Because you will match from the first
Until now, that was, easy. Now, how do you manage when instead of `a` you have a string? Until now, that was, easy. Now, how do you manage when instead of `a` you have a string?
Say you want to match: Say you want to match:
<code class="perl"> <div><code class="perl">
<li>...<li> <li>...<li>
</code> </code></div>
This is a bit difficult. You need to match This is a bit difficult. You need to match
<code class="perl"> <div><code class="perl">
<li>[anything not containing <li>]</li> <li>[anything not containing <li>]</li>
</code> </code></div>
The first method would be to use the same reasoning as in my [previous post](previouspost). Here is a first try: The first method would be to use the same reasoning as in my [previous post](previouspost). Here is a first try:
<code class="perl"> <div><code class="perl">
<li>([^<]|<[^l]|<l[^i]|<li[^>])*</li> <li>([^<]|<[^l]|<l[^i]|<li[^>])*</li>
</code> </code></div>
But what about the following string: But what about the following string:
<code class="perl"> <div><code class="perl">
<li>...<li</li> <li>...<li</li>
</code> </code></div>
That string should not match. This is why if we really want to match it correctly<sup><a href="#note1">&dagger;</a></sup> we need to add: That string should not match. This is why if we really want to match it correctly<sup><a href="#note1">&dagger;</a></sup> we need to add:
<code class="perl"> <div><code class="perl">
<li>([^<]|<[^l]|<l[^i]|<li[^>])*(|<|<l|<li)</li> <li>([^<]|<[^l]|<l[^i]|<li[^>])*(|<|<l|<li)</li>
</code> </code></div>
Yes a bit complicated. But what if the string I wanted to match was even longer? Yes a bit complicated. But what if the string I wanted to match was even longer?
Here is the algorithm way to handle this easily. You reduce the problem to the first one letter matching: Here is the algorithm way to handle this easily. You reduce the problem to the first one letter matching:
<code class="perl"> <div><code class="perl">
# transform a simple randomly choosen character # transform a simple randomly choosen character
# to an unique ID # to an unique ID
# (you should verify the identifier is REALLY unique) # (you should verify the identifier is REALLY unique)
@ -98,7 +98,7 @@ s/Y/<\/li>/g
# retransform the choosen character back # retransform the choosen character back
s/_was_x_/X/g s/_was_x_/X/g
s/_was_y_/Y/g s/_was_y_/Y/g
</code> </code></div>
And it works in only 9 lines for any beginning and ending string. This solution should look less *I AM THE GREAT REGEXP M45T3R, URAN00B*, but is more convenient in my humble opinion. Further more, using this last solution prove you master regexp, because you know it is difficult to manage such problems with only a regexp. And it works in only 9 lines for any beginning and ending string. This solution should look less *I AM THE GREAT REGEXP M45T3R, URAN00B*, but is more convenient in my humble opinion. Further more, using this last solution prove you master regexp, because you know it is difficult to manage such problems with only a regexp.

View file

@ -22,7 +22,7 @@ tags:
Strangely enough, I didn't find any built-in tool to split a file by keyword. I made one myself in `awk`. I put it here mostly for myself. But it could also helps someone else. Strangely enough, I didn't find any built-in tool to split a file by keyword. I made one myself in `awk`. 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 `UTC`. The following code split a file for each line containing the word `UTC`.
<code class="perl"> <div><code class="perl">
#!/usr/bin/env awk #!/usr/bin/env awk
BEGIN{i=0;} BEGIN{i=0;}
/UTC/ { /UTC/ {
@ -30,7 +30,7 @@ BEGIN{i=0;}
FIC=sprintf("fic.%03d",i); FIC=sprintf("fic.%03d",i);
} }
{print $0>>FIC} {print $0>>FIC}
</code> </code></div>
In my real world example, I wanted one file per day, each line containing UTC being in the following format: In my real world example, I wanted one file per day, each line containing UTC being in the following format:
@ -40,7 +40,7 @@ Mon Dec 7 10:32:30 UTC 2009
I then finished with the following code: I then finished with the following code:
<code class="perl"> <div><code class="perl">
#!/usr/bin/env awk #!/usr/bin/env awk
BEGIN{i=0;} BEGIN{i=0;}
/UTC/ { /UTC/ {
@ -52,4 +52,4 @@ BEGIN{i=0;}
} }
} }
{print $0>>FIC} {print $0>>FIC}
</code> </code></div>

View file

@ -10,6 +10,7 @@ isHidden: true
kind: article kind: article
created_at: 2009-07-06T16:15:23+02:00 created_at: 2009-07-06T16:15:23+02:00
title: MVC explained title: MVC explained
created_at: 01/01/2009
multiTitle: multiTitle:
fr: Les raisons du MVC fr: Les raisons du MVC
en: Why MVC? en: Why MVC?

View file

@ -5,7 +5,10 @@ filters_pre:
- bluecloth - bluecloth
# Custom # Custom
title: Contact title: About
multiTitle:
fr: Contact
en: Contact
menupriority: 5 menupriority: 5
----- -----
# How to contact me # How to contact me

View file

@ -13,4 +13,4 @@ multiTitle:
noSubMenu: true noSubMenu: true
----- -----
Hello and welcome on my personnal website. This is mainly my blog. Hello and welcome on my personnal website. This is mainly my blog.

View file

@ -71,13 +71,11 @@ Je suis un passioné. Passioné par :
- Sécurité informatique: j'ai modélisé [un protocole sécurisé (similaire à TOR)](http://yann.esposito.free.fr/enseignement/rez0.php#projet), [une méthode pour gérer de façon sécurisé ses mots de passes](/YBlog/Computer/Entries/2008/7/30_Easy,_secure_and_portable_password_management_system.html), un [widget](/YBlog/YPassword.html) et un script shell pour utiliser cette méthode. - Sécurité informatique: j'ai modélisé [un protocole sécurisé (similaire à TOR)](http://yann.esposito.free.fr/enseignement/rez0.php#projet), [une méthode pour gérer de façon sécurisé ses mots de passes](/YBlog/Computer/Entries/2008/7/30_Easy,_secure_and_portable_password_management_system.html), un [widget](/YBlog/YPassword.html) et un script shell pour utiliser cette méthode.
</fr> </fr>
<en>
But before all, I love to learn. For example, I learned many programming languages: `C`, `C++`, `Objective-C`, `Python`, `Java`, `Perl`, `awk`, `bash`, `zsh`, `LaTeX`, `Metapost`, `camL`... And Ive got the same passion about computer science research, computer security, philosophy and many other things.
</en>
<fr>
Mais avant tout j'adore apprendre. Par exemple, j'ai appris de nombreux langages de programmation: Mais avant tout j'adore apprendre. Par exemple, j'ai appris de nombreux langages de programmation:
`C`, `C++`, `Objective-C`, `Python`, `Java`, `Perl`, `awk`, `bash`, `zsh`, `LaTeX`, `Metapost`, `CamL`... Et j'ai la même passion pour la recherche scientifique, la sécurité informatique, la philosophie et encore pas mal d'autres choses. `C`, `C++`, `Objective-C`, `Python`, `Java`, `Perl`, `awk`, `bash`, `zsh`, `LaTeX`, `Metapost`, `CamL`... Et j'ai la même passion pour la recherche scientifique, la sécurité informatique, la philosophie et encore pas mal d'autres choses.
</fr>
newcorps newcorps

View file

@ -36,7 +36,7 @@ newcorps
Expérience professionnelle Expérience professionnelle
</h1> </h1>
<fr>
<desc Expérience professionnelle> <desc Expérience professionnelle>
<small>depuis</small> 2007 : Consultant Airfrance, Astek, Sophia Antipolis :: <small>depuis</small> 2007 : Consultant Airfrance, Astek, Sophia Antipolis ::
2006-2007 : Post Doctorat au Laboratoire Hubert Curien, Saint-etienne :: 2006-2007 : Post Doctorat au Laboratoire Hubert Curien, Saint-etienne ::
@ -44,17 +44,9 @@ newcorps
2001-2004 : Allocataire Moniteur (Étudiant ayant reçu une bourse ministérielle ainsi qu'une bourse permettant d'enseigner en faculté) :: 2001-2004 : Allocataire Moniteur (Étudiant ayant reçu une bourse ministérielle ainsi qu'une bourse permettant d'enseigner en faculté) ::
1999-2000 : Vacataire (enseignant pour DEUG) :: 1999-2000 : Vacataire (enseignant pour DEUG) ::
</desc> </desc>
</fr>
<en>
<desc Professionnal background>
from 2007 : Airfrance consultant, Astek, Sophia Antipolis, France ::
2006-2007 : Post PhD in the Laboratory Hubert Curien, Saint-Etienne, France ::
2004-2006 : ATER, (College Degree Teacher) ::
2001-2004 : Allocataire Moniteur (PhD student with a grant + a teach grant) ::
1999-2000 : College degree teaching ::
</desc>
</en>
newcorps newcorps
@ -63,7 +55,7 @@ newcorps
</h1> </h1>
<fr>
<desc> <desc>
2004 : Doctorat en informatique au 2004 : Doctorat en informatique au
<a href="http://www.lif.univ-mrs.fr"><abbr title="Laboratoire d'Informatique Fondamentale">LIF</abbr></a>, <a href="http://www.lif.univ-mrs.fr"><abbr title="Laboratoire d'Informatique Fondamentale">LIF</abbr></a>,
@ -75,20 +67,8 @@ newcorps
1998 : DEUG MIAS (Mathématiques) :: 1998 : DEUG MIAS (Mathématiques) ::
1995 : BAC S option mathématiques :: 1995 : BAC S option mathématiques ::
</desc> </desc>
</fr>
<en>
<desc>
2004 : PhD Degree in computer science in the
<a href="http://www.lif.univ-mrs.fr"><abbr title="Laboratoire d'Informatique Fondamentale">LIF</abbr></a>,
<a href="http://www.up.univ-mrs.fr/"> Université de Provence</a>,
Marseille (France) ::
2001 : DEA in computer science ::
2000 : Maîtrise in computer science ::
1999 : Licence in computer science ::
1998 : DEUG MIAS (Math) ::
1995 : BAC S ::
</desc>
</en>
newcorps newcorps
@ -102,37 +82,22 @@ newcorps
Domaines Domaines
</h4> </h4>
<en>
<ul>
<li>Machine Learning, </li>
<li>Data Mining, </li>
<li>Grammatical Inference </li>
</ul>
</en>
<fr>
<ul> <ul>
<li>Apprentissage automatique ; </li> <li>Apprentissage automatique ; </li>
<li>Fouille de données ; </li> <li>Fouille de données ; </li>
<li>Inférence grammaticale </li> <li>Inférence grammaticale </li>
</ul> </ul>
</fr>
<h4> <h4>
Objets étudiés Objets étudiés
</h4> </h4>
<en>
<ul>
<li>Markov chains,</li>
<li>Hidden Markov Models, </li>
<li>Multiplicity Automata, </li>
<li>Weighted Transducer, </li>
<li>Tree Weighted Automata, </li>
<li>Tree Edit Distance</li>
</ul>
</en>
<fr>
<ul> <ul>
<li>Chaînes de Markov Cachées ; </li> <li>Chaînes de Markov Cachées ; </li>
<li>Automates à multiplicité ; </li> <li>Automates à multiplicité ; </li>
@ -140,7 +105,7 @@ newcorps
<li>Automates d'arbres pondérés ; </li> <li>Automates d'arbres pondérés ; </li>
<li>Distances d'edition d'arbres</li> <li>Distances d'edition d'arbres</li>
</ul> </ul>
</fr>
<h4> <h4>
Principaux résultats théoriques Principaux résultats théoriques
@ -216,16 +181,12 @@ newcorps
<h4> <a href="http://yann.esposito.free.fr/dees.php">DEES</a> </h4> <h4> <a href="http://yann.esposito.free.fr/dees.php">DEES</a> </h4>
<fr>
<a href="http://yann.esposito.free.fr/dees.php?lang=fr">DEES</a> : <a href="http://yann.esposito.free.fr/dees.php?lang=fr">DEES</a> :
Programme d'inférence d'automates à multiplicité Programme d'inférence d'automates à multiplicité
écrit en C++ (7<small>500</small> lignes, 10<small>000</small> avec les commentaires) ; écrit en C++ (7<small>500</small> lignes, 10<small>000</small> avec les commentaires) ;
</fr>
<en>
<a href="http://yann.esposito.free.fr/dees.php">DEES</a>:
Software of Multiplicity Automata inference
written in C++ (7.500 lines, 10.000 with comments) ;
</en>
<p> <p>
Principales fonctionnalités : Principales fonctionnalités :

View file

@ -15,7 +15,7 @@ multiDescription:
----- -----
<%= blogimage( 'intro.jpg' , 'Lost Highway' ) %> <%= blogimage( 'Lost Highway' , 'intro.jpg' ) %>
Lost Highway ne laisse pas indiférent. Le revoir ne lasse pas même s'il parrait complètement obscur. C'est une des forces de David Lynch. Lost Highway ne laisse pas indiférent. Le revoir ne lasse pas même s'il parrait complètement obscur. C'est une des forces de David Lynch.
@ -68,7 +68,7 @@ I believe I had found a coherent interpretation which allow to follow the movie
## Le test de Rorschach ## Le test de Rorschach
<%= leftblogimage('rorschach.gif' , 'test de Rorschach') %> <%= leftblogimage( 'test de Rorschach','rorschach.gif' ) %>
!!fr!! !!fr!!
À l'instar du protagoniste chacun voit dans ce film ce qu'il a envie d'y voir. Nous pouvons nous y perdre simplement parce que nous pouvons nous perdre dans notre propre esprit. C'est une invitation à la réflexion. Regarder ce film c'est un peu comme passer un test de Rorschach. Qu'y voit-on ? Chacun y met un peu de sa propre personnalité dans l'explication du film. À l'instar du protagoniste chacun voit dans ce film ce qu'il a envie d'y voir. Nous pouvons nous y perdre simplement parce que nous pouvons nous perdre dans notre propre esprit. C'est une invitation à la réflexion. Regarder ce film c'est un peu comme passer un test de Rorschach. Qu'y voit-on ? Chacun y met un peu de sa propre personnalité dans l'explication du film.
@ -104,5 +104,5 @@ J'écris cet article, parce que j'ai l'impression d'en avoir trouver une qui mar
<div style="text-align: center"> <div style="text-align: center">
<span style="font-size: 2em"> <a href="./03_losthighway_1/"><fr>Lire la suite</fr><en>Read more</en></a></span> <span style="font-size: 2em"> <a href="./03_losthighway_1/">Lire la suite</a></span>
</div> </div>

View file

@ -14,7 +14,7 @@ multiTitle:
## Qui est l'homme mystérieux ? ## Qui est l'homme mystérieux ?
<%= leftblogimage( "mysteryman.jpg" , "l'homme mystérieux" ) %> <%= leftblogimage( "l'homme mystérieux" , "mysteryman.jpg" ) %>
Qui est donc ce personnage étrange et inquiétant ? Qui est donc ce personnage étrange et inquiétant ?
Un être capable d'ubiquité qui dit être invité par Fred dans sa maison ? Un être capable d'ubiquité qui dit être invité par Fred dans sa maison ?

View file

@ -31,9 +31,7 @@ Dans ma première vision du film, j'avais envie de dire qu'il ne la tue pas. Mai
!!!! !!!!
!!en!!
The protagonist is a garagist fallen in love with a porno actress. He believe the producer is the bad guy who go again his will. Then he kills Dick Laurent.
!!!!
### Hypothese n°2 ### Hypothese n°2

View file

@ -19,7 +19,7 @@ tags:
----- -----
<%= blogimage("central_architecture.png","central architecture") %> <%= blogimage("central architecture","central_architecture.png") %>
J'utilise [Git](http://www.git-scm.org/) pour gérer mes projets personnels. J'utilise [Git](http://www.git-scm.org/) pour gérer mes projets personnels.
J'ai un *repository* centralisé et tous mes ordinateurs se synchronisent avec lui. J'ai un *repository* centralisé et tous mes ordinateurs se synchronisent avec lui.
@ -164,14 +164,14 @@ C'est pourquoi j'ai créé deux simples scripts pour automatiser cette opératio
Ainsi, lorsque je veux créer une nouvelle branche (localement et ligne) ; je lance le script : Ainsi, lorsque je veux créer une nouvelle branche (localement et ligne) ; je lance le script :
<code class="zsh">git-create-new-branch branch_name</code> <div><code class="zsh">git-create-new-branch branch_name</code></div>
et quand je suis sur un autre ordinateur et que je veux récupérer les branches crées sur un autre poste, j'exécute : et quand je suis sur un autre ordinateur et que je veux récupérer les branches crées sur un autre poste, j'exécute :
<code class="zsh">git-get-remote-branches</code> <div><code class="zsh">git-get-remote-branches</code></div>
Voici le code des deux script (en zsh) : Voici le code des deux script (en zsh) :

View file

@ -27,7 +27,7 @@ After a bit more research (thanks to [ElectricSheep](http://community.electricsh
I discovered the good parameters for compilation. I discovered the good parameters for compilation.
<%= blogimage("xcodeConfig.png","XCode configuration") %> <%= blogimage("XCode configuration","xcodeConfig.png") %>
For now I didn't compiled it to work also on Tiger and Leopard. I don't know XCode enought to know how to make the Garbage collector to be disabled on 32 bits version and enabled on 64 bits version. For now I didn't compiled it to work also on Tiger and Leopard. I don't know XCode enought to know how to make the Garbage collector to be disabled on 32 bits version and enabled on 64 bits version.

View file

@ -53,8 +53,8 @@ Voici le script que j'utilise pour synchroniser mon site web (non créé avec iW
Les idées sont : Les idées sont :
- Synchroniser vers un répertoire temporaire sur le serveur distant, puis "swapper" les noms des répertoires. Ainsi le site ne reste indisponible que le temps du "swap" du nom des deux répertoires. - synchronize to a temporary folder then swap the name therefore the website isn't accessible only during the swap time. It takes only the time of two rename.
- Réitérer toutes les opérations jusqu'à ce qu'elle aient réussi (par exemple pour le renommage) - reiterate all operations until they work (for example, renaming).
Jusqu'ici j'utilise `rsync` qui n'est en fait pas plus efficace qu'une simple copie `cp` avec WebDav. Je devrais utiliser une méthode pour mémoriser les changements entre chaque publication. Jusqu'ici j'utilise `rsync` qui n'est en fait pas plus efficace qu'une simple copie `cp` avec WebDav. Je devrais utiliser une méthode pour mémoriser les changements entre chaque publication.
@ -177,3 +177,109 @@ done
print -P -- " publication terminée" print -P -- " publication terminée"
</code> </code>
</div> </div>
<div class="en">
<code class="zsh" file="publish">
#!/usr/bin/env zsh
# Author: Yann Esposito
# Mail: yann.esposito@gmail.com
# Synchronize with "mobileMe" iDisk account.
mobileMeUser="firstname.lastname"
siteName="siteName"
# Depending of my hostname the
if [[ $(hostname) == 'ubuntu' ]]; then
iDisk='/mnt/iDisk'
else
iDisk="/Volumes/$mobileMeUser"
fi
root=$HOME/Sites/$siteName
destRep=$iDisk/Web/Sites/$siteName
[[ ! -d $root ]] && {
print -- "$root does not exist ; please verify the configuration ($0)" >&2;
exit 1
}
[[ ! -d $destRep ]] && {
print -- "$destRep does not exist, please mount the filesystem" >&2;
exit 1
}
if [[ $1 == '-h' ]]; then
print -- "usage: $0:h [-h|-a|-s]"
print -- " -a sychronize primary index"
print -- " -h show this help"
print -- " -s only swap directories"
fi
if [[ $1 == '-a' ]]; then
print -- "Index synchronisation (${destRep:h})"
rsync -av $root/index.html ${destRep:h}/index.html
fi
print -- "Root = $root"
print -- "Dest = $destRep"
if [[ ! $1 = '-s' ]]; then
[[ ! -d $destRep.tmp ]] && mkdir $destRep.tmp
print -P -- "%B[Sync => tmp]%b"
result=1
essai=1
while (( $result > 0 )); do
rsync -arv $root/Scratch/ $destRep.tmp
result=$?
if (( $result > 0 )); then
print -P -- "%Brsync failed%b (try n°$essai)" >&2
fi
((essai++))
done
fi
# SWAP
print -P -- "%B[Directory Swap (tmp <=> target)]%b"
essai=1
while [[ -e $destRep.old ]]; do
print -n -- "remove $destRep.old"
if ((essai>1)); then
print " (try n°$essai)"
else
print
fi
((essai++))
\rm -rf $destRep.old
done
print -- " renommage du repertoire sandard vers le .old"
essai=1
while [[ -e $destRep ]]; do
mv $destRep $destRep.old
(($?)) && print -- "Failed to rename (try n°$essai)" >&2
((essai++))
done
print -- " renaming folder tmp (new) to the standard one"
print -P -- " %BThe WebSite isn't working%b $(date)"
essai=1
while [[ ! -e $destRep ]]; do
mv $destRep.tmp $destRep
(($?)) && print -P -- "%B[WebSite not working]%b(try n°$essai) Failed to rename (mv $destRep.tmp $destRep)" >&2
((essai++))
done
print -P -- "\t===\t%BWEBSITE SHOULD WORK NOW%b\t==="
print -- " rename old folder to tmp folder"
essai=1
while [[ ! -e $destRep ]]; do
mv $destRep.old $destRep.tmp
(($?)) && print -P -- "Failed to rename n°$essai" >&2
((essai++))
done
print -P -- " Publish terminated"
</code>
</div>

View file

@ -33,17 +33,17 @@ Voici mon script, il créé tout d'abord un fichier qui contient la liste des fi
Cependant même avec ce script j'ai encore des problèmes. Dû à webdav. En particulier le renommage de répertoire. Par exemple : Cependant même avec ce script j'ai encore des problèmes. Dû à webdav. En particulier le renommage de répertoire. Par exemple :
<code class="zsh"> <div><code class="zsh">
mv folder folder2 mv folder folder2
</code> </code></div>
Retourne OK et pourtant : Retourne OK et pourtant :
<code class="zsh"> <div><code class="zsh">
$ ls $ ls
folder folder2 folder folder2
</code> </code></div>
Bouuhh... Bouuhh...
@ -52,7 +52,7 @@ Bouuhh...
Pour résoudre ce type de problèmes j'utilise un *framework* en zsh. Il résout presque tous les problèmes liés à webdav à l'exception du renommage de répertoire. Pour résoudre ce type de problèmes j'utilise un *framework* en zsh. Il résout presque tous les problèmes liés à webdav à l'exception du renommage de répertoire.
<code class="zsh" file="webdav-framework"> <div><code class="zsh" file="webdav-framework">
#!/usr/bin/env zsh #!/usr/bin/env zsh
function samelineprint { function samelineprint {
@ -161,13 +161,13 @@ function trymv {
done done
print print
} }
</code> </code></div>
Et voici le code qui me permet de synchroniser mon site web. Il y a une partie un peu incompréhensible. C'est pour enlever les mail réencodés par le filtre bluecloth qui est une implémentation de markdown. Mes mails, sont encodés à chaque fois de façon différente à chaque réengendrement de page html. C'est pourquoi je les enlève pour ne pas les *uploadés* inutilement à chaque fois. Et voici le code qui me permet de synchroniser mon site web. Il y a une partie un peu incompréhensible. C'est pour enlever les mail réencodés par le filtre bluecloth qui est une implémentation de markdown. Mes mails, sont encodés à chaque fois de façon différente à chaque réengendrement de page html. C'est pourquoi je les enlève pour ne pas les *uploadés* inutilement à chaque fois.
<code class="zsh" file="publish"> <div><code class="zsh" file="publish">
#!/usr/bin/env zsh #!/usr/bin/env zsh
# Script synchronisant le site sur me.com # Script synchronisant le site sur me.com
@ -289,7 +289,7 @@ else
print -P -- "%BSync%b[${Root:t} => ${destRep:t}$suffix]" print -P -- "%BSync%b[${Root:t} => ${destRep:t}$suffix]"
incrementalPublish incrementalPublish
fi fi
</code> </code></div>
C'est ma façon de remplacer `rsync` avec des filesystem qui ne permettent pas de l'utiliser. J'espère que ça pourra vous être utile. Je serai heureux de savoir si quelqu'un à une idée sur comment gérer le problème de renommage de répertoire avec webdav. C'est ma façon de remplacer `rsync` avec des filesystem qui ne permettent pas de l'utiliser. J'espère que ça pourra vous être utile. Je serai heureux de savoir si quelqu'un à une idée sur comment gérer le problème de renommage de répertoire avec webdav.

View file

@ -24,16 +24,16 @@ tags:
Pour les développeur de site web Internet Explorer est un cauchemar. C'est pourquoi j'utilise un style complètement différent pour ce navigateur. Avec la librairie jQuery. Pour les développeur de site web Internet Explorer est un cauchemar. C'est pourquoi j'utilise un style complètement différent pour ce navigateur. Avec la librairie jQuery.
<code class="javascript"> <div><code class="javascript">
$(document).ready( function() { $(document).ready( function() {
if ($.browser["msie"]) { if ($.browser["msie"]) {
// include the ie.js file // include the ie.js file
$('head').append('<script type="text/javascript" src="/js/ie.js"></scr' + 'ipt>'); $('head').append('<script type="text/javascript" src="/js/ie.js"></scr' + 'ipt>');
} }
}); });
</code> </code></div>
<code class="javascript" file="ie.js"> <div><code class="javascript" file="ie.js">
// Remove all CSS I don't want to use on IE // Remove all CSS I don't want to use on IE
$('link[rel=stylesheet]').each(function(i) $('link[rel=stylesheet]').each(function(i)
{ {
@ -51,6 +51,6 @@ $('head').append('<link rel="stylesheet" type="text/css" href="/css/ie.css"/>');
// I also add a message on top of the page // I also add a message on top of the page
$('body').prepend('<div id="iemessage"><p><span class="fr"><em>Avec <a href="http://www.firefox.com"> Firefox </a> et <a href="http://www.apple.com/safari">Safari</a> cette page est bien plus jolie !</em></span><span class="en"><em>This page is far nicer with <a href="http://www.firefox.com"> Firefox </a> and <a href="http://www.apple.com/safari">Safari</a>!</em></span></p>.</div>'); $('body').prepend('<div id="iemessage"><p><span class="fr"><em>Avec <a href="http://www.firefox.com"> Firefox </a> et <a href="http://www.apple.com/safari">Safari</a> cette page est bien plus jolie !</em></span><span class="en"><em>This page is far nicer with <a href="http://www.firefox.com"> Firefox </a> and <a href="http://www.apple.com/safari">Safari</a>!</em></span></p>.</div>');
</code> </code></div>
Voilà. Voilà.

View file

@ -50,7 +50,7 @@ L'HTML :
La CSS : La CSS :
<code class="css"> <div><code class="css">
#menuButton { #menuButton {
font-size: 2em; font-size: 2em;
height: 2em; height: 2em;

View file

@ -25,8 +25,8 @@ tags:
Voici comment apparaissent mes pages pendant leur chargement. Voici comment apparaissent mes pages pendant leur chargement.
<div id="demo" style="width:45%; position: relative; height: 8em; background-image: url('/Scratch/css/img/red.jpg'); background-position: 50% 50%; color: #fff; text-align: center; padding-top: 1em; margin-left: auto; margin-right: auto; border: solid 10px rgba(255,255,255,0.7); -webkit-border-radius: 1em; -moz-border-radius: 1em; border-radius: 1em; cursor: pointer; "> <div id="demo" style="width:45%; position: relative; height: 8em; background-image: url('/Scratch/css/img/red.jpg'); background-position: 50% 50%; color: #fff; text-align: center; padding-top: 1em; margin-left: auto; margin-right: auto; border: solid 10px rgba(255,255,255,0.7); -webkit-border-radius: 1em; -moz-border-radius: 1em; border-radius: 1em; cursor: pointer; ">
<p><en>Hello! I've finished loading!</en><fr>Voilà ! Je suis chargée !</fr></p> <p>Voilà ! Je suis chargée !</p>
<p><en>Click me to see me disapear again.</en><fr>Cliquez-moi dessus pour recommencer.</fr></p> <p>Cliquez-moi dessus pour recommencer.</p>
<div id="todisapear" style="color: #000; position:absolute;top:0;left:0;text-align: center; padding-top: 1em; width: 100%; background-color: #eee; height: 8em;"> <div id="todisapear" style="color: #000; position:absolute;top:0;left:0;text-align: center; padding-top: 1em; width: 100%; background-color: #eee; height: 8em;">
Loading... Loading...
<img style="border: none; background-color: none; background: none" src="/Scratch/img/loading.gif" alt="loading logo"/> <img style="border: none; background-color: none; background: none" src="/Scratch/img/loading.gif" alt="loading logo"/>

View file

@ -43,7 +43,7 @@ HTML :
CSS : CSS :
<code class="css"> <div><code class="css">
#entete { #entete {
top: 1em; top: 1em;
left: 0; left: 0;
@ -57,11 +57,11 @@ CSS :
left: 0; left: 0;
position: fixed; position: fixed;
width: 10em; } width: 10em; }
</code> </code></div>
Javascript : Javascript :
<code class="javascript"> <div><code class="javascript">
var last=0; var last=0;
// will hide the menu in 5 seconds // will hide the menu in 5 seconds
@ -101,7 +101,7 @@ function showMenu() {
autoHideMenu(last); autoHideMenu(last);
} }
</code> </code></div>
Simple et peu gourmand en ressources. Pas de timer (ou presque), pas de fuite de mémoire, pas d'utilisation de date... Simple et peu gourmand en ressources. Pas de timer (ou presque), pas de fuite de mémoire, pas d'utilisation de date...

View file

@ -26,7 +26,7 @@ Une petite astuce dont je ne me souvient jamais (je ne sais pas pourquoi).
Lorsque que vous souhaitez lancer une commande qui ne soit pas tuée après la fermeture du terminal voici comment s'y prendre : Lorsque que vous souhaitez lancer une commande qui ne soit pas tuée après la fermeture du terminal voici comment s'y prendre :
<code class="zsh"> <div><code class="zsh">
nohup cmd & nohup cmd &
</code> </code>
<small><code>cmd</code> est la commande que vous souhaitez lancer.</small> <small><code>cmd</code> est la commande que vous souhaitez lancer.</small>

View file

@ -19,19 +19,15 @@ tags:
----- -----
<en>
<small> <em>I explain why I had so much difficulties to use Git. There is an "untaught rule" that make hard to work without. Until I read the good document. </em></small>
</en>
<fr>
<small> <em>Je décris pourquoi j'ai eu tant de mal à me faire à Git. Il y a en effet une partie "non dite" qui m'a bloqué pendant un bon moment. Jusqu'à ce que je découvre le bon document. </em></small>
</fr>
<en>
<small> <em> "Cheap branches" aren't designed to be totally isolated branches but rather should follow a "Master Branch". There is a </em>Standard Workflow<em> to follow. If you don't follow it, you prepare yourself with some hard time with Git.</em> </small> <small> <em>Je décris pourquoi j'ai eu tant de mal à me faire à Git. Il y a en effet une partie "non dite" qui m'a bloqué pendant un bon moment. Jusqu'à ce que je découvre le bon document. </em></small>
</en>
<fr>
<small> <em> Le fait est que les *branches légères* ne sont pas destinée à être des branches isolées. Ainsi, il y a un </em>"workflow standard"<em> qui s'il n'est pas suivi rend l'utilisation de Git inappropriée. </em> </small> <small> <em> Le fait est que les *branches légères* ne sont pas destinée à être des branches isolées. Ainsi, il y a un </em>"workflow standard"<em> qui s'il n'est pas suivi rend l'utilisation de Git inappropriée. </em> </small>
</fr>
newcorps newcorps
@ -173,19 +169,19 @@ Mais dans ce cas-là, je n'ai qu'à utiliser des *clônes* et pas des *branches
Je trouve toujours que les terminologies de bazaar sont plus claires et plus concises. Je trouve toujours que les terminologies de bazaar sont plus claires et plus concises.
<code class="zsh">bzr revert</code> <div><code class="zsh">bzr revert</code></div>
est quand même plus clair que est quand même plus clair que
<code class="zsh">git reset --hard HEAD</code> <div><code class="zsh">git reset --hard HEAD</code></div>
De la même façon De la même façon
<code class="zsh">bzr revert -r -3</code> <div><code class="zsh">bzr revert -r -3</code></div>
je trouve ça mieux que je trouve ça mieux que
<code class="zsh">git reset --hard HEAD~3</code> <div><code class="zsh">git reset --hard HEAD~3</code></div>
Là ça va commencer à se compliquer. Si on veut revenir dans le temps sur toute l'arborescence, avec Git on utilise `reset`. Là ça va commencer à se compliquer. Si on veut revenir dans le temps sur toute l'arborescence, avec Git on utilise `reset`.
@ -195,20 +191,20 @@ Là ça va commencer à se compliquer. Si on veut revenir dans le temps sur tout
Maintenant si je veux revenir dans le temps sur un seul fichier. Naturellement on se dit : Maintenant si je veux revenir dans le temps sur un seul fichier. Naturellement on se dit :
<code class="zsh">git reset --hard FILE</code> <div><code class="zsh">git reset --hard FILE</code></div>
<center>**ET BIEN NON !**</center> <center>**ET BIEN NON !**</center>
La solution c'est : La solution c'est :
<code class="zsh">git checkout FILE</code> <div><code class="zsh">git checkout FILE</code></div>
Quoi ? **`checkout`** !? Bon, d'accord, j'accepte, pourquoi pas après tout ? Quoi ? **`checkout`** !? Bon, d'accord, j'accepte, pourquoi pas après tout ?
En plus quand on est habitué à Bazaar c'est : En plus quand on est habitué à Bazaar c'est :
<code class="zsh">git revert FILE</code> <div><code class="zsh">git revert FILE</code></div>
Ce que je trouve quand même bien plus naturel. Ce que je trouve quand même bien plus naturel.
@ -217,12 +213,12 @@ Mais là où ça devient vraiment difficile de s'y faire c'est pour changer de b
Avec Bazaar ça donne : Avec Bazaar ça donne :
<code class="zsh">cd ../branch</code> <div><code class="zsh">cd ../branch</code></div>
Bon ok, il faut changer de répertoire, un répertoire par branche. Ça consomme de l'espace disque mais au moins on voit où on est. Avec Git voilà comment on change de branche (*branche légère*) : Bon ok, il faut changer de répertoire, un répertoire par branche. Ça consomme de l'espace disque mais au moins on voit où on est. Avec Git voilà comment on change de branche (*branche légère*) :
<code class="zsh">git checkout branch</code> <div><code class="zsh">git checkout branch</code></div>
Alors là, on se dit "<abbr title="What the Fuck?">WTF?</abbr>" ; en français : mais qu'est-ce que c'est que ça ? Je croyais que `checkout` c'était pour récupérer l'état d'un fichier ? Alors là, on se dit "<abbr title="What the Fuck?">WTF?</abbr>" ; en français : mais qu'est-ce que c'est que ça ? Je croyais que `checkout` c'était pour récupérer l'état d'un fichier ?

View file

@ -36,14 +36,14 @@ Voici la liste des commandes nécessaires et suffisantes pour utiliser [Git][git
Récupérer un projet : Récupérer un projet :
<code class="zsh"> <div><code class="zsh">
git clone ssh://server/path/to/project git clone ssh://server/path/to/project
</code> </code></div>
Utiliser [Git][git] tous les jours : Utiliser [Git][git] tous les jours :
<code class="zsh"> <div><code class="zsh">
# get modifications from other # get modifications from other
git pull git pull
# read what was done # read what was done
@ -65,7 +65,7 @@ git commit -a -m "Fix bug #321"
# send local modifications to other # send local modifications to other
git push git push
</code> </code></div>
Cet article est écrit pour ceux qui en savent très peu sur les systèmes de version. Il est aussi écrit pour ceux qui n'ont pas suivi les progrès accomplis depuis CVS ou subversion (SVN). C'est pourquoi dans un premier temps j'explique rapidement quel sont le buts poursuivis par les systèmes de versions. J'explique ensuite comment installer et configurer [Git][git]. Puis, pour chaque action que doivent accomplir les <abbr title="Decentralized Concurent Versions System">DCVS</abbr> je donne les commandes [Git][git] qui y correspondent. Cet article est écrit pour ceux qui en savent très peu sur les systèmes de version. Il est aussi écrit pour ceux qui n'ont pas suivi les progrès accomplis depuis CVS ou subversion (SVN). C'est pourquoi dans un premier temps j'explique rapidement quel sont le buts poursuivis par les systèmes de versions. J'explique ensuite comment installer et configurer [Git][git]. Puis, pour chaque action que doivent accomplir les <abbr title="Decentralized Concurent Versions System">DCVS</abbr> je donne les commandes [Git][git] qui y correspondent.

View file

@ -39,7 +39,7 @@ Lorsqu'on modifie un fichier un peu critique et qu'on a pas envie de perdre, on
<code class="zsh">$ cp fichier_important.c fichier_important.c.bak</code> <div><code class="zsh">$ cp fichier_important.c fichier_important.c.bak</code></div>
Du coups, ce nouveau fichier joue le rôle de *backup*. Si on casse tout, on peut toujours écraser les modifications que nous avons faites. Évidemment le problème avec cette façon de faire c'est que ce n'est pas très professionnel. Et puis c'est un peu limité. Si on veut faire trois ou quatre modifications on se retrouve avec plein de fichiers. Parfois avec des nom bizarres comme : Du coups, ce nouveau fichier joue le rôle de *backup*. Si on casse tout, on peut toujours écraser les modifications que nous avons faites. Évidemment le problème avec cette façon de faire c'est que ce n'est pas très professionnel. Et puis c'est un peu limité. Si on veut faire trois ou quatre modifications on se retrouve avec plein de fichiers. Parfois avec des nom bizarres comme :
@ -81,18 +81,13 @@ begindiv(black)
*Qu'apportent les systèmes de versions ?* (je n'ai pas tout mentionné) *Qu'apportent les systèmes de versions ?* (je n'ai pas tout mentionné)
<fr>
- backup automatique de tous les fichiers: *Revenir dans le temps.* ; - backup automatique de tous les fichiers: *Revenir dans le temps.* ;
- donne la possibilité de voir les différences entre chaque version et les différences entre la version en cours et les modifications locales ; - donne la possibilité de voir les différences entre chaque version et les différences entre la version en cours et les modifications locales ;
- permet de poser un *tag* sur certaines versions et ainsi pouvoir s'y référer facilement ; - permet de poser un *tag* sur certaines versions et ainsi pouvoir s'y référer facilement ;
- permet d'avoir un historique des modifications. Car en général il est demandé aux utilisateur d'ajouter un petit commentaire à chaque nouvelle version. - permet d'avoir un historique des modifications. Car en général il est demandé aux utilisateur d'ajouter un petit commentaire à chaque nouvelle version.
</fr>
<en>
- automatic backups: *back in time*,
- gives the ability to see differences between each version,
- put a *tag* on some version to be able to refer to them easily,
- gives the ability to see an historic of all modifications. Generally the user must add a comment for each new version.
</en>
enddiv enddiv
@ -110,7 +105,7 @@ Sur un fichier contenant un liste de dieux *Lovecraftiens* :
Cthulhu Cthulhu
Shubniggurath Shubniggurath
Yogsototh Yogsototh
</code> </code></div>
Disons que Alex est chez lui, il modifie le fichier : Disons que Alex est chez lui, il modifie le fichier :
@ -162,18 +157,13 @@ begindiv(black)
**Qu'apportent les Systèmes de Versions Concurrentes ?** **Qu'apportent les Systèmes de Versions Concurrentes ?**
<fr>
- récupérer sans problème les modifications des autres ; - récupérer sans problème les modifications des autres ;
- envoyer sans problème ses modifications aux autres ; - envoyer sans problème ses modifications aux autres ;
- permet de gérer les conflits. Je n'en ai pas parlé, mais quand un conflit arrive (ça peut arriver si deux personnes modifient la même ligne avec deux contenus différents), les <abbr title="Systèmes de versions concurrentes">SVC</abbr> proposent leur aide pour les résoudre. J'en dirai un mot plus loin. - permet de gérer les conflits. Je n'en ai pas parlé, mais quand un conflit arrive (ça peut arriver si deux personnes modifient la même ligne avec deux contenus différents), les <abbr title="Systèmes de versions concurrentes">SVC</abbr> proposent leur aide pour les résoudre. J'en dirai un mot plus loin.
- permet de savoir qui a fait quoi et quand - permet de savoir qui a fait quoi et quand
</fr>
<en>
- get without any problem others modifications,
- send without any problem its own modifications to others,
- manage conflicts. I didn't speak about it, but sometimes a conflict can occur (when two different people modify the same line on a file for example). SVC help to resolve such problem. More on that later,
- help to know who done what and when.
</en>
enddiv enddiv

View file

@ -24,7 +24,7 @@ Voici une parmi de nombreuses autres façon d'utiliser [Git][git]. Cette méthod
La façon immédiate de travailler avec [Git][git] : La façon immédiate de travailler avec [Git][git] :
<fr>
+ récupérer les modifications des autres <span class="black">`git pull`</span> + récupérer les modifications des autres <span class="black">`git pull`</span>
+ voir les détails de ces modifications <span class="black">`git log`</span> + voir les détails de ces modifications <span class="black">`git log`</span>
+ Plusieurs fois: + Plusieurs fois:
@ -33,18 +33,9 @@ La façon immédiate de travailler avec [Git][git] :
+ indiquer si nécessaire que de nouveaux fichiers doivent être *versionnés* <span class="black">`git add [file]`</span> + indiquer si nécessaire que de nouveaux fichiers doivent être *versionnés* <span class="black">`git add [file]`</span>
+ enregistrer ses modifications <br/><span class="black">`git commit -a -m "message"`</span> + enregistrer ses modifications <br/><span class="black">`git commit -a -m "message"`</span>
+ envoyer ses modifications aux autres <span class="black">`git push`</span> (refaire un `git pull` si le push renvoie une erreur). + envoyer ses modifications aux autres <span class="black">`git push`</span> (refaire un `git pull` si le push renvoie une erreur).
</fr>
<en>
+ Get modification done by others <span class="black">`git pull`</span>,
+ See details of these modifications <span class="black">`git log`</span>,
+ Many times:
+ *Make an atomic modification*
+ Verify details of this modification: <span class="black">`git status`</span> and <span class="black">`git diff`</span>,
+ Add some file to be versionned if necessary:<br/><span class="black">`git add [file]`</span>,
+ Save you modifications <br/><span class="black">`git commit -a -m "message"`</span>,
+ Send your modifications to others: <span class="black">`git push`</span> (redo a `git pull` if push return an error).
</en>
Voilà, avec ces quelques commandes vous pouvez utiliser [Git][git] sur un projet avec d'autres personnes. Même si c'est suffisant, il faut quand même connaître une chose avant de se lancer ; la gestion des *conflits*. Voilà, avec ces quelques commandes vous pouvez utiliser [Git][git] sur un projet avec d'autres personnes. Même si c'est suffisant, il faut quand même connaître une chose avant de se lancer ; la gestion des *conflits*.

View file

@ -21,7 +21,7 @@ tags:
Dans la première partie, nous avons vu la liste des problèmes résolus par [Git][git]. En résumé Git doit pouvoir : Dans la première partie, nous avons vu la liste des problèmes résolus par [Git][git]. En résumé Git doit pouvoir :
<fr>
- récupérer les modifications des autres ; - récupérer les modifications des autres ;
- envoyer ses modifications aux autres ; - envoyer ses modifications aux autres ;
- revenir dans le temps ; - revenir dans le temps ;
@ -31,133 +31,123 @@ Dans la première partie, nous avons vu la liste des problèmes résolus par [Gi
- savoir qui a fait quoi et quand ; - savoir qui a fait quoi et quand ;
- gérer des conflits ; - gérer des conflits ;
- manipuler facilement des branches. - manipuler facilement des branches.
</fr>
<en>
- get others modifications,
- send modifications to others,
- get back in time,
- list differences between each version,
- name some versions in order to refer easily to them,
- write an historic of modifications,
- know who did what and when,
- manage conflicts,
- easily manage branches.
</en>
### récupérer les modifications des autres ### récupérer les modifications des autres
<code class="zsh"> <div><code class="zsh">
$ git pull $ git pull
</code> </code></div>
### envoyer ses modifications aux autres ### envoyer ses modifications aux autres
<code class="zsh"> <div><code class="zsh">
$ git push $ git push
</code> </code></div>
ou plus généralement ou plus généralement
<code class="zsh"> <div><code class="zsh">
$ git pull $ git pull
$ git push $ git push
</code> </code></div>
### revenir dans le temps ### revenir dans le temps
#### Pour toute l'arborescence #### Pour toute l'arborescence
<code class="zsh"> <div><code class="zsh">
$ git checkout $ git checkout
</code> </code></div>
<code class="zsh"> <div><code class="zsh">
$ git revert $ git revert
</code> </code></div>
revenir trois versions en arrière revenir trois versions en arrière
<code class="zsh"> <div><code class="zsh">
$ git uncommit 3 $ git uncommit 3
</code> </code></div>
Revenir avant le dernier merge (s'il s'est mal passé). Revenir avant le dernier merge (s'il s'est mal passé).
<code class="zsh"> <div><code class="zsh">
$ git revertbeforemerge $ git revertbeforemerge
</code> </code></div>
#### Pour un seul fichier #### Pour un seul fichier
<code class="zsh"> <div><code class="zsh">
$ git checkout file $ git checkout file
$ git checkout VersionHash file $ git checkout VersionHash file
$ git checkout HEAD~3 file $ git checkout HEAD~3 file
</code> </code></div>
### lister les différences entre chaque version ### lister les différences entre chaque version
liste les fichier en cours de modifications liste les fichier en cours de modifications
<code class="zsh"> <div><code class="zsh">
$ git status $ git status
</code> </code></div>
fr:différences entre les fichier de la dernière version et les fichiers locaux. fr:différences entre les fichier de la dernière version et les fichiers locaux.
<code class="zsh"> <div><code class="zsh">
$ git diff $ git diff
</code> </code></div>
liste les différences entre les fichier d'une certaine version et les fichiers locaux. liste les différences entre les fichier d'une certaine version et les fichiers locaux.
<code class="zsh"> <div><code class="zsh">
$ git diff VersionHash fichier $ git diff VersionHash fichier
</code> </code></div>
### nommer certaines versions pour s'y référer facilement ### nommer certaines versions pour s'y référer facilement
<code class="zsh"> <div><code class="zsh">
$ git tag 'toto' $ git tag 'toto'
</code> </code></div>
### afficher l'historique des modifications ### afficher l'historique des modifications
<code class="zsh"> <div><code class="zsh">
$ git log $ git log
$ git lg $ git lg
$ git logfull $ git logfull
</code> </code></div>
### savoir qui a fait quoi et quanden:know who did what and when:: ### savoir qui a fait quoi et quanden:know who did what and when::
<code class="zsh"> <div><code class="zsh">
$ git blame fichier $ git blame fichier
</code> </code></div>
### gérer des conflits ### gérer des conflits
<code class="zsh"> <div><code class="zsh">
$ git conflict $ git conflict
</code> </code></div>
### manipuler facilement des branches ### manipuler facilement des branches
Pour créer une branche : Pour créer une branche :
<code class="zsh"> <div><code class="zsh">
$ git branch branch_name $ git branch branch_name
</code> </code></div>
Pour changer de branche courante : Pour changer de branche courante :
<code class="zsh"> <div><code class="zsh">
$ git checkout branch_name $ git checkout branch_name
</code> </code></div>
[git]: http://git-scm.org "Git" [git]: http://git-scm.org "Git"

View file

@ -19,7 +19,7 @@ multiTitle:
Sous Linux Ubuntu ou Debian : Sous Linux Ubuntu ou Debian :
<code class="zsh">$ sudo apt-get install git</code> <div><code class="zsh">$ sudo apt-get install git</code></div>
Sous Mac OS X : Sous Mac OS X :
@ -27,18 +27,18 @@ Sous Mac OS X :
* installez [MacPorts](http://macports.org/install.php) * installez [MacPorts](http://macports.org/install.php)
* installez [Git][git] * installez [Git][git]
<code class="zsh"> <div><code class="zsh">
$ sudo port selfupdate $ sudo port selfupdate
$ sudo port install git-core $ sudo port install git-core
</code> </code></div>
## Configuration globale ## Configuration globale
Enregistrez le fichier suivant comme le fichier `~/.gitconfig`. Enregistrez le fichier suivant comme le fichier `~/.gitconfig`.
<code class="zsh" file="gitconfig"> <div><code class="zsh" file="gitconfig">
[color] [color]
branch = auto branch = auto
diff = auto diff = auto
@ -59,18 +59,18 @@ Enregistrez le fichier suivant comme le fichier `~/.gitconfig`.
# conflict = !gitx --left-right HEAD...MERGE_HEAD # conflict = !gitx --left-right HEAD...MERGE_HEAD
[branch] [branch]
autosetupmerge = true autosetupmerge = true
</code> </code></div>
Vous pouvez obtenir le même résultat en utilisant pour chaque entrée la commande `git config --global`. Vous pouvez obtenir le même résultat en utilisant pour chaque entrée la commande `git config --global`.
Configurez ensuite votre nom et votre email. Par exemple si vous vous appelez John Doe et que votre email est `john.doe@email.com`. Lancez les commandes suivantes : Configurez ensuite votre nom et votre email. Par exemple si vous vous appelez John Doe et que votre email est `john.doe@email.com`. Lancez les commandes suivantes :
<code class="zsh"> <div><code class="zsh">
$ git config --global user.name John Doe $ git config --global user.name John Doe
$ git config --global user.email john.doe@email.com $ git config --global user.email john.doe@email.com
</code> </code></div>
Voilà, la configuration de base est terminée. J'ai créé dans le fichier de configuration global des *alias* qui vont permettre de taper des commandes un peu plus courtes. Voilà, la configuration de base est terminée. J'ai créé dans le fichier de configuration global des *alias* qui vont permettre de taper des commandes un peu plus courtes.
@ -80,29 +80,29 @@ Voilà, la configuration de base est terminée. J'ai créé dans le fichier de c
Si un projet est déjà versionné avec [Git][git] vous devez avoir une `URL` pointant vers les sources du projet. La commande a exécuter est alors très simple. Si un projet est déjà versionné avec [Git][git] vous devez avoir une `URL` pointant vers les sources du projet. La commande a exécuter est alors très simple.
<code class="zsh"> <div><code class="zsh">
$ cd ~/Projets $ cd ~/Projets
$ git clone git://main.server/path/to/file $ git clone git://main.server/path/to/file
</code> </code></div>
S'il n'y a pas de serveur git sur le serveur distant, mais que vous avez un accès `ssh`, il suffit de remplacer le `git` de l'url par `ssh`. Pour ne pas avoir à entrer votre mot de passe à chaque fois le plus simple est de procéder comme suit : S'il n'y a pas de serveur git sur le serveur distant, mais que vous avez un accès `ssh`, il suffit de remplacer le `git` de l'url par `ssh`. Pour ne pas avoir à entrer votre mot de passe à chaque fois le plus simple est de procéder comme suit :
<code class="zsh"> <div><code class="zsh">
$ ssh-keygen -t rsa $ ssh-keygen -t rsa
</code> </code></div>
Répondez aux question et n'entrez **surtout PAS** de mot de passe. Ensuite copiez les clés sur le serveur distant. Ce n'est pas la façon la plus sûre de procéder. L'idéal étant d'écrire quand même un mot de passe et d'utiliser `ssh-agent`. Répondez aux question et n'entrez **surtout PAS** de mot de passe. Ensuite copiez les clés sur le serveur distant. Ce n'est pas la façon la plus sûre de procéder. L'idéal étant d'écrire quand même un mot de passe et d'utiliser `ssh-agent`.
<code class="zsh"> <div><code class="zsh">
me@locahost$ scp ~/.ssh/id_rsa.pub me@main.server: me@locahost$ scp ~/.ssh/id_rsa.pub me@main.server:
me@locahost$ ssh me@main.server me@locahost$ ssh me@main.server
password: password:
me@main.server$ cat id_rsa.pub >> ~/.ssh/authorized_keys me@main.server$ cat id_rsa.pub >> ~/.ssh/authorized_keys
me@main.server$ rm id_rsa.pub me@main.server$ rm id_rsa.pub
me@main.server$ logout me@main.server$ logout
</code> </code></div>
Maintenant vous n'avez plus besoin de taper votre mot de passe pour accéder à `main.server`. Et donc aussi pour les commandes `git`. Maintenant vous n'avez plus besoin de taper votre mot de passe pour accéder à `main.server`. Et donc aussi pour les commandes `git`.
@ -112,37 +112,37 @@ Maintenant vous n'avez plus besoin de taper votre mot de passe pour accéder à
Supposons que vous avez déjà un projet avec des fichiers. Alors il est très facile de le versionner. Supposons que vous avez déjà un projet avec des fichiers. Alors il est très facile de le versionner.
<code class="zsh"> <div><code class="zsh">
$ cd /path/to/project $ cd /path/to/project
$ git init $ git init
$ git add . $ git add .
$ git commit -m "Initial commit" $ git commit -m "Initial commit"
</code> </code></div>
Une petite précision. Si vous ne souhaitez pas *versionner* tous les fichiers. Par exemple, les fichiers de compilations intermédiaires. Alors il faut les exclure. Pour cela, avant de lancer la commande `git add .`. Il faut créer un fichier `.gitignore` qui va contenir les *pattern* que git doit ignorer. Par exemple : Une petite précision. Si vous ne souhaitez pas *versionner* tous les fichiers. Par exemple, les fichiers de compilations intermédiaires. Alors il faut les exclure. Pour cela, avant de lancer la commande `git add .`. Il faut créer un fichier `.gitignore` qui va contenir les *pattern* que git doit ignorer. Par exemple :
<code class="zsh"> <div><code class="zsh">
*.o *.o
*.bak *.bak
*.swp *.swp
*~ *~
</code> </code></div>
Maintenant si vous voulez créer un repository sur un serveur distant, il faut absolument qu'il soit en mode `bare`. C'est-à-dire que le repository ne contiendra que la partie contenant les informations utile à la gestion de git, mais pas les fichiers du projet. Sans rentrer dans les détails, il suffit de lancer : Maintenant si vous voulez créer un repository sur un serveur distant, il faut absolument qu'il soit en mode `bare`. C'est-à-dire que le repository ne contiendra que la partie contenant les informations utile à la gestion de git, mais pas les fichiers du projet. Sans rentrer dans les détails, il suffit de lancer :
<code class="zsh"> <div><code class="zsh">
$ cd /path/to/local/project $ cd /path/to/local/project
$ git clone --bare . ssh://server/path/to/project $ git clone --bare . ssh://server/path/to/project
</code> </code></div>
Les autres pourront alors récupérer les modifications via la commande vue précédemment : Les autres pourront alors récupérer les modifications via la commande vue précédemment :
<code class="zsh"> <div><code class="zsh">
git clone ssh://server/path/to/project git clone ssh://server/path/to/project
</code> </code></div>
## Résumé de la seconde étape ## Résumé de la seconde étape

View file

@ -65,16 +65,16 @@ Par exemple, `checkout` qui sert certainement à la même chose du point de vue
<code class="zsh"> <div><code class="zsh">
git checkout pipo git checkout pipo
</code> </code></div>
annule une modification courante du fichier `pipo` annule une modification courante du fichier `pipo`
<code class="zsh"> <div><code class="zsh">
git checkout pipo git checkout pipo
</code> </code></div>
change de la branche courante vers la branche `pipo` change de la branche courante vers la branche `pipo`
@ -82,9 +82,9 @@ change de la branche courante vers la branche `pipo`
Et là, comme moi, vous remarquez que la même commande à deux sens complètement différents. Comment ça se passe alors, quand il y a une branche `pipo` et un fichier `pipo` alors ? Et bien par défaut, ça change de branche. Pour lever l'ambigüité il faut utiliser la syntaxe Et là, comme moi, vous remarquez que la même commande à deux sens complètement différents. Comment ça se passe alors, quand il y a une branche `pipo` et un fichier `pipo` alors ? Et bien par défaut, ça change de branche. Pour lever l'ambigüité il faut utiliser la syntaxe
<code class="zsh"> <div><code class="zsh">
git checkout ./pipo git checkout ./pipo
</code> </code></div>
Oui, bon... Voilà, voilà, voilà.... Oui, bon... Voilà, voilà, voilà....
@ -96,24 +96,24 @@ Oui, bon... Voilà, voilà, voilà....
Là où la différence se creuse c'est avec la terminologie Bazaar qui est bien plus naturelle. Car il n'y a pas de commande pour changer de branche, puisqu'il y a une branche par répertoire. Ainsi, pour changer de branche, il suffit de faire `cd path/to/branch`. Et pour revenir en arrière : Là où la différence se creuse c'est avec la terminologie Bazaar qui est bien plus naturelle. Car il n'y a pas de commande pour changer de branche, puisqu'il y a une branche par répertoire. Ainsi, pour changer de branche, il suffit de faire `cd path/to/branch`. Et pour revenir en arrière :
<code class="zsh"> <div><code class="zsh">
bzr revert pipo bzr revert pipo
</code> </code></div>
De plus, la plupart des commandes bazaar prennent en paramètre un numéro de révision, par exemple pour revenir 3 versions précédentes il suffit d'écrire : De plus, la plupart des commandes bazaar prennent en paramètre un numéro de révision, par exemple pour revenir 3 versions précédentes il suffit d'écrire :
<code class="zsh"> <div><code class="zsh">
bzr revert -r -3 pipo bzr revert -r -3 pipo
</code> </code></div>
L'équivalent sous git est beaucoup plus cryptique : L'équivalent sous git est beaucoup plus cryptique :
<code class="zsh"> <div><code class="zsh">
bzr checkout HEAD~3 pipo bzr checkout HEAD~3 pipo
</code> </code></div>
Encore un fois, Bazaar est bien plus lisible. Encore un fois, Bazaar est bien plus lisible.
@ -124,36 +124,36 @@ Revenir dans le temps pour tout le projet :
avec Bazaar : avec Bazaar :
<code class="zsh"> <div><code class="zsh">
bzr revert -r -3 pipo bzr revert -r -3 pipo
</code> </code></div>
et avec `git` ? `git checkout` ? Bien sûr que non voyons ! Ce serait bien trop simple. Ce que l'on trouve dans les forums c'est : et avec `git` ? `git checkout` ? Bien sûr que non voyons ! Ce serait bien trop simple. Ce que l'on trouve dans les forums c'est :
<code class="zsh"> <div><code class="zsh">
git reset --hard HEAD~3 git reset --hard HEAD~3
</code> </code></div>
Sauf que cette syntaxe est horrible. Elle oublie 'réellement' les révisions. Il faut donc l'utiliser avec prudence. Mais en effet, je conseillerai plutôt : Sauf que cette syntaxe est horrible. Elle oublie 'réellement' les révisions. Il faut donc l'utiliser avec prudence. Mais en effet, je conseillerai plutôt :
<code class="zsh"> <div><code class="zsh">
git checkout HEAD~3 -- . && git commit -m 'back in time' git checkout HEAD~3 -- . && git commit -m 'back in time'
</code> </code></div>
Histoire d'avoir la branche backup sous la main, car sinon, on risque de perdre définitivement la version courante de HEAD. Qui ramène la branche locale à ce point. Mais il reste des erreur s'il y a eu des ajouts de fichier entre temps. *Le seul et l'unique vraiment propre de revenir en arrière dans git c'est de lancer la commande suivante :* Histoire d'avoir la branche backup sous la main, car sinon, on risque de perdre définitivement la version courante de HEAD. Qui ramène la branche locale à ce point. Mais il reste des erreur s'il y a eu des ajouts de fichier entre temps. *Le seul et l'unique vraiment propre de revenir en arrière dans git c'est de lancer la commande suivante :*
<code class="zsh"> <div><code class="zsh">
for i in $(seq 0 2); do for i in $(seq 0 2); do
git revert -n --no-edit head~$i; git revert -n --no-edit head~$i;
done done
git commit -m "reverted 3 versions back" git commit -m "reverted 3 versions back"
</code> </code></div>
ce qui signifie sur un système `UNIX` en `zsh` (ou `bash`) faire `git revert` de toutes les dernières versions. Même si quelqu'un d'autre à fait un pull de vos modification intermédiaire il ne sera pas embêté et il sera au courant de ce qu'il s'est passé. ce qui signifie sur un système `UNIX` en `zsh` (ou `bash`) faire `git revert` de toutes les dernières versions. Même si quelqu'un d'autre à fait un pull de vos modification intermédiaire il ne sera pas embêté et il sera au courant de ce qu'il s'est passé.
@ -166,10 +166,10 @@ La règle est simple : *Ne JAMAIS utiliser la commande `git reset` avec une vers
Voilà, c'est dit. Découvrir ça m'a pris pas mal de temps, avec plein d'essai de tous les cotés. Le plus sûr reste toujours la méthode vue plus haut. Si vous souhaitez automatiser cela, le plus simple est d'ajouter l'alias suivant à votre fichier `~/.gitconfig`. Bien sûr l'alias ne fonctionnera que sur les environnement possédant `zsh`, ce qui est le cas de la plupart des environnements UNIX (Ubuntu, Mac OS X...). Voilà, c'est dit. Découvrir ça m'a pris pas mal de temps, avec plein d'essai de tous les cotés. Le plus sûr reste toujours la méthode vue plus haut. Si vous souhaitez automatiser cela, le plus simple est d'ajouter l'alias suivant à votre fichier `~/.gitconfig`. Bien sûr l'alias ne fonctionnera que sur les environnement possédant `zsh`, ce qui est le cas de la plupart des environnements UNIX (Ubuntu, Mac OS X...).
<code class="zsh" file="gitconfig"> <div><code class="zsh" file="gitconfig">
[alias] [alias]
uncommit = !zsh -c '"if (($0)); then nb=$(( $0 - 1 )); else nb=0; fi; i=0; while ((i<=nb)); do git revert -n --no-edit HEAD~$i; ((i++)); done; git commit -m \"revert to $0 version(s) back\""' uncommit = !zsh -c '"if (($0)); then nb=$(( $0 - 1 )); else nb=0; fi; i=0; while ((i<=nb)); do git revert -n --no-edit HEAD~$i; ((i++)); done; git commit -m \"revert to $0 version(s) back\""'
</code> </code></div>
# Ce qui fait que `git` est le meilleur DCVS jusqu'à aujourd'hui # Ce qui fait que `git` est le meilleur DCVS jusqu'à aujourd'hui
@ -183,7 +183,7 @@ Vous travaillez toujours dans le même répertoire principal. Par exemple, vous
<code class="zsh"> <div><code class="zsh">
> vim file1 > vim file1
> vim file2 > vim file2
> git br fix1 > git br fix1
@ -195,7 +195,7 @@ Vous travaillez toujours dans le même répertoire principal. Par exemple, vous
> git commit master > git commit master
> git merge fix1 > git merge fix1
> git merge fix2 > git merge fix2
</code> </code></div>
Et il est vraiment très agréable de ne pas se soucier d'être dans la *bonne* branche. Vous n'avez à vous occuper que de votre code et seulement ensuite vous occuper du système de version. Et il est vraiment très agréable de ne pas se soucier d'être dans la *bonne* branche. Vous n'avez à vous occuper que de votre code et seulement ensuite vous occuper du système de version.

View file

@ -22,6 +22,6 @@ tags:
Je viens de trouver le moyen de changer son shell par défaut sous Mac OS X. Cette note est plus pour moi. Mais elle peut aussi servir à quelqu'un d'autre. Il suffit de lancer la commande : Je viens de trouver le moyen de changer son shell par défaut sous Mac OS X. Cette note est plus pour moi. Mais elle peut aussi servir à quelqu'un d'autre. Il suffit de lancer la commande :
<code class="zsh"> <div><code class="zsh">
> chsh > chsh
</code> </code></div>

View file

@ -19,17 +19,17 @@ tags:
Sometimes you cannot simply write: Sometimes you cannot simply write:
<code class="ruby"> <div><code class="ruby">
if str.match(regexp) and if str.match(regexp) and
not str.match(other_regexp) not str.match(other_regexp)
do_something do_something
</code> </code></div>
and you have to make this behaviour with only one regular expression. The problem is the complementary of regular languages is not regular. Then, for some expression it is absolutely not impossible. and you have to make this behaviour with only one regular expression. The problem is the complementary of regular languages is not regular. Then, for some expression it is absolutely not impossible.
But sometimes with some simple regular expression it should be possible<sup><a href="#note1">&dagger;</a></sup>. Say you want to match everything containing the some word say `bull` but don't want to match `bullshit`. Here is a nice way to do that: But sometimes with some simple regular expression it should be possible<sup><a href="#note1">&dagger;</a></sup>. Say you want to match everything containing the some word say `bull` but don't want to match `bullshit`. Here is a nice way to do that:
<code class="ruby"> <div><code class="ruby">
# match all string containing 'bull' (bullshit comprised) # match all string containing 'bull' (bullshit comprised)
/bull/ /bull/
@ -41,7 +41,7 @@ bullshi([^t]|$)/
# another way to write it would be # another way to write it would be
/bull([^s]|$|s([^h]|$)|sh([^i]|$)|shi([^t]|$))/ /bull([^s]|$|s([^h]|$)|sh([^i]|$)|shi([^t]|$))/
</code> </code></div>
Let look closer. In the first line the expression is: Let look closer. In the first line the expression is:
`bull([^s]|$)`, why does the `$` is needed? `bull([^s]|$)`, why does the `$` is needed?
@ -54,7 +54,7 @@ Because, without it the word `bull` would be no more matched. This expression me
And this is it. I hope it could help you. And this is it. I hope it could help you.
Notice this method is not always the best. For example try to write a regular expression equivalent to the following conditional expression: Notice this method is not always the best. For example try to write a regular expression equivalent to the following conditional expression:
<code class="ruby"> <div><code class="ruby">
# Begin with 'a': ^a # Begin with 'a': ^a
# End with 'a': c$ # End with 'a': c$
# Contain 'b': .*b.* # Contain 'b': .*b.*
@ -63,18 +63,18 @@ if str.match(/^a.*b.*c$/) and
not str.match(/^axbxc$/) not str.match(/^axbxc$/)
do_something do_something
end end
</code> </code></div>
A nice solution is: A nice solution is:
<code class="ruby"> <div><code class="ruby">
/abc| # length 3 /abc| # length 3
a.bc| # length 4 a.bc| # length 4
ab.c| ab.c|
a[^x]b[^x]c| # length 5 a[^x]b[^x]c| # length 5
a...*b.*c| # length >5 a...*b.*c| # length >5
a.*b...*c/ a.*b...*c/
</code> </code></div>
This solution uses the maximal length of the string not to be matched. This solution uses the maximal length of the string not to be matched.
There certainly exists many other methods. But the important lesson is There certainly exists many other methods. But the important lesson is

View file

@ -46,36 +46,36 @@ The first error is to use the *evil* `.*`. Because you will match from the first
Until now, that was, easy. Now, how do you manage when instead of `a` you have a string? Until now, that was, easy. Now, how do you manage when instead of `a` you have a string?
Say you want to match: Say you want to match:
<code class="perl"> <div><code class="perl">
<li>...<li> <li>...<li>
</code> </code></div>
This is a bit difficult. You need to match This is a bit difficult. You need to match
<code class="perl"> <div><code class="perl">
<li>[anything not containing <li>]</li> <li>[anything not containing <li>]</li>
</code> </code></div>
The first method would be to use the same reasoning as in my [previous post](previouspost). Here is a first try: The first method would be to use the same reasoning as in my [previous post](previouspost). Here is a first try:
<code class="perl"> <div><code class="perl">
<li>([^<]|<[^l]|<l[^i]|<li[^>])*</li> <li>([^<]|<[^l]|<l[^i]|<li[^>])*</li>
</code> </code></div>
But what about the following string: But what about the following string:
<code class="perl"> <div><code class="perl">
<li>...<li</li> <li>...<li</li>
</code> </code></div>
That string should not match. This is why if we really want to match it correctly<sup><a href="#note1">&dagger;</a></sup> we need to add: That string should not match. This is why if we really want to match it correctly<sup><a href="#note1">&dagger;</a></sup> we need to add:
<code class="perl"> <div><code class="perl">
<li>([^<]|<[^l]|<l[^i]|<li[^>])*(|<|<l|<li)</li> <li>([^<]|<[^l]|<l[^i]|<li[^>])*(|<|<l|<li)</li>
</code> </code></div>
Yes a bit complicated. But what if the string I wanted to match was even longer? Yes a bit complicated. But what if the string I wanted to match was even longer?
Here is the algorithm way to handle this easily. You reduce the problem to the first one letter matching: Here is the algorithm way to handle this easily. You reduce the problem to the first one letter matching:
<code class="perl"> <div><code class="perl">
# transform a simple randomly choosen character # transform a simple randomly choosen character
# to an unique ID # to an unique ID
# (you should verify the identifier is REALLY unique) # (you should verify the identifier is REALLY unique)
@ -98,7 +98,7 @@ s/Y/<\/li>/g
# retransform the choosen character back # retransform the choosen character back
s/_was_x_/X/g s/_was_x_/X/g
s/_was_y_/Y/g s/_was_y_/Y/g
</code> </code></div>
And it works in only 9 lines for any beginning and ending string. This solution should look less *I AM THE GREAT REGEXP M45T3R, URAN00B*, but is more convenient in my humble opinion. Further more, using this last solution prove you master regexp, because you know it is difficult to manage such problems with only a regexp. And it works in only 9 lines for any beginning and ending string. This solution should look less *I AM THE GREAT REGEXP M45T3R, URAN00B*, but is more convenient in my humble opinion. Further more, using this last solution prove you master regexp, because you know it is difficult to manage such problems with only a regexp.

View file

@ -22,7 +22,7 @@ tags:
Strangely enough, I didn't find any built-in tool to split a file by keyword. I made one myself in `awk`. I put it here mostly for myself. But it could also helps someone else. Strangely enough, I didn't find any built-in tool to split a file by keyword. I made one myself in `awk`. 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 `UTC`. The following code split a file for each line containing the word `UTC`.
<code class="perl"> <div><code class="perl">
#!/usr/bin/env awk #!/usr/bin/env awk
BEGIN{i=0;} BEGIN{i=0;}
/UTC/ { /UTC/ {
@ -30,7 +30,7 @@ BEGIN{i=0;}
FIC=sprintf("fic.%03d",i); FIC=sprintf("fic.%03d",i);
} }
{print $0>>FIC} {print $0>>FIC}
</code> </code></div>
In my real world example, I wanted one file per day, each line containing UTC being in the following format: In my real world example, I wanted one file per day, each line containing UTC being in the following format:
@ -40,7 +40,7 @@ Mon Dec 7 10:32:30 UTC 2009
I then finished with the following code: I then finished with the following code:
<code class="perl"> <div><code class="perl">
#!/usr/bin/env awk #!/usr/bin/env awk
BEGIN{i=0;} BEGIN{i=0;}
/UTC/ { /UTC/ {
@ -52,4 +52,4 @@ BEGIN{i=0;}
} }
} }
{print $0>>FIC} {print $0>>FIC}
</code> </code></div>

View file

@ -5,7 +5,10 @@ filters_pre:
- bluecloth - bluecloth
# Custom # Custom
title: Contact title: About
multiTitle:
Contact
en: Contact
menupriority: 5 menupriority: 5
----- -----
# en:How to contact meComment me contacter # en:How to contact meComment me contacter

View file

@ -13,5 +13,4 @@ multiTitle:
noSubMenu: true noSubMenu: true
----- -----
Bonjour et bienvenue sur mon site personnel. C'est principalement ma plateforme de blog. Bonjour et bienvenue sur mon site personnel. C'est principalement ma plateforme de blog.

View file

@ -4,11 +4,15 @@ root=/home/e640846/Sites/n3blog
cd $root cd $root
for langue in fr en; do for langue in fr en; do
\cp -r ../webroot/content/* content/html/$langue \cp -r ../webroot/content/* content/html/$langue
for fic in content/html/$langue/**/*.html; do
mv -f $fic $(dirname $fic)/$(basename $fic .html).md
done
\rm -f content/html/$langue/**/*.xml
cp recup.pl recup$langue.pl cp recup.pl recup$langue.pl
[[ $langue = "fr" ]] && other=en [[ $langue = "fr" ]] && other=en
[[ $langue = "en" ]] && other=fr [[ $langue = "en" ]] && other=fr
echo 'replaceminim( "'$langue':","::" 1);' >> recup$langue.pl echo 'replaceminim( "'$langue':","::", 1);' >> recup$langue.pl
echo 'replaceminim( "'$other':","::" 0);' >> recup$langue.pl echo 'replaceminim( "'$other':","::", 0);' >> recup$langue.pl
echo 'replaceminim( "<'$langue'>", "</'$langue'>", 1);' >> recup$langue.pl echo 'replaceminim( "<'$langue'>", "</'$langue'>", 1);' >> recup$langue.pl
echo 'replaceminim( "<'$other'>", "</'$other'>", 0);' >> recup$langue.pl echo 'replaceminim( "<'$other'>", "</'$other'>", 0);' >> recup$langue.pl
echo 'replaceminim( "!!'$langue'!!", "!!!!", 1);' >> recup$langue.pl echo 'replaceminim( "!!'$langue'!!", "!!!!", 1);' >> recup$langue.pl

View file

@ -4,16 +4,17 @@ BEGIN{
} }
sub replaceminim { sub replaceminim {
my $langue = $_[0] ; my $begin = $_[0] ;
my $keep = $_[1] ; my $end = $_[1] ;
my $keep = $_[2] ;
# protection des X et Y pour qu'ils disparaissent # protection des X et Y pour qu'ils disparaissent
s/X/_wasx_/g; s/X/_wasx_/g;
s/Y/_wasy_/g; s/Y/_wasy_/g;
# remplacement de la chaine en un seul caractère # remplacement de la chaine en un seul caractère
s/$langue/X/g; # begin s/$begin/X/g; # begin
s/::/Y/g; # end s/$end/Y/g; # end
# A partir de maintenant tous les X sont les begin # A partir de maintenant tous les X sont les begin
# tous les Y sont les ends # tous les Y sont les ends
@ -25,10 +26,15 @@ sub replaceminim {
} }
# recuperation des X, Y, et begin et end non traites # recuperation des X, Y, et begin et end non traites
s/X/$langue/g; s/X/$begin/g;
s/Y/::/g; s/Y/$end/g;
s/_wasx_/X/g; s/_wasx_/X/g;
s/_wasy_/Y/g; s/_wasy_/Y/g;
} }
replaceminim( "en:", 1); replaceminim( "en:","::", 1);
replaceminim( "fr:", 0); replaceminim( "fr:","::", 0);
replaceminim( "<en>", "</en>", 1);
replaceminim( "<fr>", "</fr>", 0);
replaceminim( "!!en!!", "!!!!", 1);
replaceminim( "!!fr!!", "!!!!", 0);
s#date:#created_at:#

View file

@ -4,16 +4,17 @@ BEGIN{
} }
sub replaceminim { sub replaceminim {
my $langue = $_[0] ; my $begin = $_[0] ;
my $keep = $_[1] ; my $end = $_[1] ;
my $keep = $_[2] ;
# protection des X et Y pour qu'ils disparaissent # protection des X et Y pour qu'ils disparaissent
s/X/_wasx_/g; s/X/_wasx_/g;
s/Y/_wasy_/g; s/Y/_wasy_/g;
# remplacement de la chaine en un seul caractère # remplacement de la chaine en un seul caractère
s/$langue/X/g; # begin s/$begin/X/g; # begin
s/::/Y/g; # end s/$end/Y/g; # end
# A partir de maintenant tous les X sont les begin # A partir de maintenant tous les X sont les begin
# tous les Y sont les ends # tous les Y sont les ends
@ -25,10 +26,15 @@ sub replaceminim {
} }
# recuperation des X, Y, et begin et end non traites # recuperation des X, Y, et begin et end non traites
s/X/$langue/g; s/X/$begin/g;
s/Y/::/g; s/Y/$end/g;
s/_wasx_/X/g; s/_wasx_/X/g;
s/_wasy_/Y/g; s/_wasy_/Y/g;
} }
replaceminim( "fr:", 1); replaceminim( "fr:","::", 1);
replaceminim( "en:", 0); replaceminim( "en:","::", 0);
replaceminim( "<fr>", "</fr>", 1);
replaceminim( "<en>", "</en>", 0);
replaceminim( "!!fr!!", "!!!!", 1);
replaceminim( "!!en!!", "!!!!", 0);
s#date:#created_at:#