<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Marin Lagacé</title><link href="https://www.marinlagace.ca/en/" rel="alternate"></link><link href="https://www.marinlagace.ca/feeds/all.atom.xml" rel="self"></link><id>https://www.marinlagace.ca/en/</id><updated>2020-12-06T15:32:00-05:00</updated><entry><title>Visionner des PDFs avec 'less'</title><link href="https://www.marinlagace.ca/2020/visionner-des-pdfs-avec-'less'.html" rel="alternate"></link><published>2020-12-06T15:32:00-05:00</published><updated>2020-12-06T15:32:00-05:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-12-06:/2020/visionner-des-pdfs-avec-'less'.html</id><summary type="html">&lt;p class="first last"&gt;Comment visionner des PDFs dans Vifm à l'aide de 'less'.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;J'adore &lt;a class="reference external" href="https://vifm.info"&gt;Vifm&lt;/a&gt;. Une de ses fonctionnalités que j'apprécie
particulièrement est de pouvoir visionner le contenu de n'importe quel fichier
texte simplement en appuyant sur la touche &lt;span class="kbd"&gt;e&lt;/span&gt;. Cependant, j'aimerais
également visionner des PDFs directement dans &lt;span class="app"&gt;Vifm&lt;/span&gt; sans avoir à démarrer
une visionneuse graphique. Pour ce faire, il suffit d'utiliser une application
qui écrit le texte du PDF directement à la console.&lt;/p&gt;
&lt;p&gt;Je cherchais une telle application lorsque je suis tombé sur &lt;a class="reference external" href="https://stackoverflow.com/a/9553096"&gt;cet article&lt;/a&gt; de &lt;span class="app"&gt;StackOverflow&lt;/span&gt;. Il semblerait
que le bon vieux &lt;span class="app"&gt;less&lt;/span&gt; peut très bien se charger des PDFs. J'ai donc
ajouté les lignes suivantes à mon fichier &lt;span class="path"&gt;vifmrc&lt;/span&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;fileviewer *.pdf
        \ less &amp;quot;%c&amp;quot;,
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Je peux maintenant visionner des PDFs directement dans &lt;span class="app"&gt;Vifm&lt;/span&gt; et ça
fonctionne plutôt bien.&lt;/p&gt;
&lt;img alt="Viewing Pdf With Less" class="align-center" src="https://www.marinlagace.ca/en/images/Viewing_Pdf_With_Less.png" /&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="vifm"></category><category term="pdf"></category></entry><entry><title>Using 'less' to view PDFs</title><link href="https://www.marinlagace.ca/en/2020/using-less-to-view-pdfs.html" rel="alternate"></link><published>2020-12-06T14:39:00-05:00</published><updated>2020-12-06T14:39:00-05:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-12-06:/en/2020/using-less-to-view-pdfs.html</id><summary type="html">&lt;p class="first last"&gt;Using 'less' to view PDFs directly in Vifm.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;I love &lt;a class="reference external" href="https://vifm.info"&gt;Vifm&lt;/a&gt;. One of the features I like the most it that
you can easily preview any text file by pressing the &lt;span class="kbd"&gt;e&lt;/span&gt; key. But I would
also like to preview a PDF directly in &lt;span class="app"&gt;Vifm&lt;/span&gt; without having to start up a
GUI viewer. The trick is to use an application that will output the PDF's text
directly to the console.&lt;/p&gt;
&lt;p&gt;I started looking for such an application when I came across &lt;a class="reference external" href="https://stackoverflow.com/a/9553096"&gt;this post&lt;/a&gt; from &lt;span class="app"&gt;StackOverflow&lt;/span&gt;. It seems that
good-old &lt;span class="app"&gt;less&lt;/span&gt; can already do that. So, I added the following line to my
&lt;span class="path"&gt;vifmrc&lt;/span&gt; file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;fileviewer *.pdf
        \ less &amp;quot;%c&amp;quot;,
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I can now preview PDF files in &lt;span class="app"&gt;Vifm&lt;/span&gt; and it works pretty well.&lt;/p&gt;
&lt;img alt="Viewing Pdf With Less" class="align-center" src="https://www.marinlagace.ca/en/images/Viewing_Pdf_With_Less.png" /&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="vifm"></category><category term="pdf"></category></entry><entry><title>Qt Traduction: Qualifying with unknown namespace/class</title><link href="https://www.marinlagace.ca/2020/qt-traduction-qualifying-with-unknown-namespace-class.html" rel="alternate"></link><published>2020-12-05T17:29:00-05:00</published><updated>2020-12-05T17:29:00-05:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-12-05:/2020/qt-traduction-qualifying-with-unknown-namespace-class.html</id><summary type="html">&lt;p class="first last"&gt;Solution pour l'erreur 'Qualifying with unknown namespace/class'
durant le processus de traduction de Qt.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Je traduisais une librarie utilisant &lt;a class="reference external" href="https://www.qt.io"&gt;Qt&lt;/a&gt; lorsque j'ai
rencontré cette erreur.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;[ 44%] Generating foo_fr.ts
Bar.cpp:40: Qualifying with unknown namespace/class ::Bar
Updating &amp;#39;foo_fr.ts&amp;#39;...
    Found 3 source text(s) (3 new and 0 already existing)
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Je n'ai pas trouvé beaucoup d'information concernant cette erreur sur internet.
Heureusement, je suis tombé sur &lt;a class="reference external" href="https://stackoverflow.com/a/24245615"&gt;cet article&lt;/a&gt; de &lt;span class="app"&gt;StackOverflow&lt;/span&gt; qui m'a guidé
vers une solution au problème.&lt;/p&gt;
&lt;p&gt;Le problème provient du design de la librarie. Ses fichiers d'entête ne sont
pas dans le même répertoire que ses fichiers d'implémentation.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;Foo
|-- include
|   &amp;#39;-- foo
|       &amp;#39;-- Bar.hpp
+-- src
|   |-- Bar.cpp
|   +-- CMakeLists.txt
+-- CMakeLists.txt
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ceci pose problème parce que les utilitaires de traduction de &lt;span class="app"&gt;Qt&lt;/span&gt;
s'attendent à retrouver les fichiers d'entête dans le même répertoire que les
fichiers d'implémentation. Si ce n'est pas le cas, on doit spéficier le
répertoire des fichiers d'entête lorsqu'on utilise &lt;code&gt;lupdate&lt;/code&gt;. Puisque la
librarie que je traduisais est compilée à l'aide de &lt;a class="reference external" href="https://cmake.org"&gt;CMake&lt;/a&gt;, il suffit d'utiliser la macro
&lt;code&gt;qt5_create_translation&lt;/code&gt; à laquelle on ajoute l'option &lt;code&gt;-I&lt;/code&gt; suivie
du répertoire des fichiers d'entête au paramètre &lt;code&gt;OPTIONS&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nb"&gt;qt5_create_translation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;QM_FILES&lt;/span&gt;
    &lt;span class="s"&gt;Bar.cpp&lt;/span&gt;
    &lt;span class="s"&gt;foo_fr.ts&lt;/span&gt;
    &lt;span class="s"&gt;OPTIONS&lt;/span&gt; &lt;span class="s"&gt;-I&lt;/span&gt; &lt;span class="o"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CMAKE_CURRENT_SOURCE_DIR&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/../include&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="Qt"></category><category term="CMake"></category></entry><entry><title>Qt Translation: Qualifying with unknown namespace/class</title><link href="https://www.marinlagace.ca/en/2020/qt-translation-qualifying-with-unknown-namespace-class.html" rel="alternate"></link><published>2020-12-05T14:49:00-05:00</published><updated>2020-12-05T14:49:00-05:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-12-05:/en/2020/qt-translation-qualifying-with-unknown-namespace-class.html</id><summary type="html">&lt;p class="first last"&gt;Fixing the 'Qualifying with unknown namespace/class' error when doing
translations in Qt.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;I was translating a widget library written in &lt;a class="reference external" href="https://www.qt.io"&gt;Qt&lt;/a&gt; when I
got the following error.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;[ 44%] Generating foo_fr.ts
Bar.cpp:40: Qualifying with unknown namespace/class ::Bar
Updating &amp;#39;foo_fr.ts&amp;#39;...
    Found 3 source text(s) (3 new and 0 already existing)
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I could not find a lot of info about this error on the internet. Luckily, I ran
across &lt;a class="reference external" href="https://stackoverflow.com/a/24245615"&gt;this post&lt;/a&gt; on
&lt;span class="app"&gt;StackOverflow&lt;/span&gt; that guided me toward a solution.&lt;/p&gt;
&lt;p&gt;The problem came from the way the library was designed. Its public header files
are not in the same directory as its implementation files.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;Foo
|-- include
|   &amp;#39;-- foo
|       &amp;#39;-- Bar.hpp
+-- src
|   |-- Bar.cpp
|   +-- CMakeLists.txt
+-- CMakeLists.txt
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This poses a problem because &lt;span class="app"&gt;Qt&lt;/span&gt;'s translation utilities expect the header
files to be in the same directory as their implementation files. In case they
are not, one must specify their directory when calling &lt;code&gt;lupdate&lt;/code&gt;. Since
the library I was translating uses &lt;a class="reference external" href="https://cmake.org"&gt;CMake&lt;/a&gt; as its build
tool, this is done using the &lt;code&gt;qt5_create_translation&lt;/code&gt; macro and adding the
&lt;code&gt;-I&lt;/code&gt; flag with the header files path to the &lt;code&gt;OPTIONS&lt;/code&gt; parameter.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="c"&gt;# Foo/src/CMakeLists.txt&lt;/span&gt;
&lt;span class="nb"&gt;qt5_create_translation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;QM_FILES&lt;/span&gt;
    &lt;span class="s"&gt;Bar.cpp&lt;/span&gt;
&lt;span class="hll"&gt;    &lt;span class="s"&gt;foo_fr.ts&lt;/span&gt;
&lt;/span&gt;    &lt;span class="s"&gt;OPTIONS&lt;/span&gt; &lt;span class="s"&gt;-I&lt;/span&gt; &lt;span class="o"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CMAKE_CURRENT_SOURCE_DIR&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/../include&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="Qt"></category><category term="CMake"></category></entry><entry><title>Vim Portable sous Windows</title><link href="https://www.marinlagace.ca/2020/vim-portable-sous-windows.html" rel="alternate"></link><published>2020-12-01T22:11:00-05:00</published><updated>2020-12-01T22:11:00-05:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-12-01:/2020/vim-portable-sous-windows.html</id><summary type="html">&lt;p class="first last"&gt;Comment configurer la version portable de Vim sous Windows afin
d'utiliser Fugitive et Ultisnips.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Lorsque j'écris du code sous &lt;span class="os"&gt;Windows&lt;/span&gt;, j'utilise habituellement &lt;a class="reference external" href="https://www.vim.org/"&gt;Vim&lt;/a&gt; sous &lt;a class="reference external" href="https://www.cygwin.com"&gt;Cygwin&lt;/a&gt;. J'utilise ma
&lt;a class="reference external" href="https://www.marinlagace.ca/2020/cygwin-portable.html"&gt;petite astuce&lt;/a&gt; pour rendre mon installation
de &lt;span class="os"&gt;Cygwin&lt;/span&gt; portable. Ceci me permet de la copier sur tous mes ordinateurs.&lt;/p&gt;
&lt;p&gt;J'utilise abondamment &lt;a class="reference external" href="http://github.com/tpope/vim-fugitive"&gt;Fugitive&lt;/a&gt; qui est
un module qui facilite grandement l'utilisation de &lt;span class="app"&gt;Git&lt;/span&gt; sans devoir
quitter &lt;span class="app"&gt;Vim&lt;/span&gt;. Malheureusement, &lt;span class="app"&gt;Fugitive&lt;/span&gt; tourne extrêmement
lentement sur mon princial ordinateur de travail. Ainsi, sur cet ordinateur,
j'utilise plutôt &lt;a class="reference external" href="https://portableapps.com/apps/development/gvim_portable"&gt;gVim Portable&lt;/a&gt; de la plateforme
&lt;span class="app"&gt;PortableApps&lt;/span&gt; . Le petit défi est de faire intéragir &lt;span class="app"&gt;gVim Portable&lt;/span&gt;
avec &lt;span class="app"&gt;Git&lt;/span&gt; (pour &lt;span class="app"&gt;Fugitive&lt;/span&gt;) et &lt;span class="lang"&gt;Python&lt;/span&gt; (pour &lt;a class="reference external" href="https://github.com/sirver/UltiSnips"&gt;UltiSnips&lt;/a&gt;). Le truc est d'installer &lt;span class="app"&gt;Git&lt;/span&gt; et
la version appropriée de &lt;span class="lang"&gt;Python&lt;/span&gt; et ensuite ajuster le fichier de
configuration de &lt;span class="app"&gt;gVim Portable&lt;/span&gt;.&lt;/p&gt;
&lt;div class="section" id="installation-de-git-portable"&gt;
&lt;h2&gt;Installation de Git portable&lt;/h2&gt;
&lt;p&gt;Téléchargez-le du &lt;a class="reference external" href="https://git-scm.com/download/win"&gt;site web&lt;/a&gt;. Assurez-vous
de télécharger la version portable.&lt;/p&gt;
&lt;img alt="Téléchargement Git portable" class="align-center" src="https://www.marinlagace.ca/en/images/Portable_Git_Download.png" /&gt;
&lt;p&gt;Installez-le au côté de &lt;span class="app"&gt;gVim Portable&lt;/span&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;e:
├── gVimPortable
│   ├── App
│   ├── ...
│   ├── gVimPortable.exe
│   └── ...
└── PortableGit
    ├── bin
    ├── ...
    ├── git-bash.exe
    ├── git-cmd.exe
    └── ...
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="installation-de-python"&gt;
&lt;h2&gt;Installation de  Python&lt;/h2&gt;
&lt;p&gt;Il est important d'installer la version appropriée de &lt;span class="lang"&gt;Python&lt;/span&gt;. Vous devez
installer &lt;span class="app"&gt;Python 3&lt;/span&gt; parce qu'&lt;span class="app"&gt;Ultisnips&lt;/span&gt; ne supporte plus
&lt;span class="app"&gt;Python 2&lt;/span&gt;. De plus, vous devez installer la version de &lt;span class="lang"&gt;Python&lt;/span&gt; que
&lt;span class="app"&gt;Vim&lt;/span&gt; s'attend à retrouver sur votre système. Référez-vous à &lt;a class="reference external" href="https://www.marinlagace.ca/2020/ultisnips-sous-cygwin.html"&gt;mon article&lt;/a&gt; sur l'installation d'&lt;span class="app"&gt;Ultisnips&lt;/span&gt;
sous &lt;span class="os"&gt;Cygwin&lt;/span&gt; pour une explication des opérations à exécuter pour déterminer
la version de &lt;span class="lang"&gt;Python&lt;/span&gt; pour laquelle &lt;span class="app"&gt;Vim&lt;/span&gt; a été compilée.&lt;/p&gt;
&lt;p&gt;Au moment de l'écriture de cet article, &lt;span class="app"&gt;gVim&lt;/span&gt; nécessite &lt;a class="reference external" href="https://www.python.org/downloads/release/python-368/"&gt;Python 3.6&lt;/a&gt;. De plus, &lt;span class="app"&gt;gVim&lt;/span&gt; a
été compilé pour la version 32&amp;nbsp;bits de &lt;span class="os"&gt;Windows&lt;/span&gt;.&lt;/p&gt;
&lt;img alt="gVim Portable version 32bit" class="align-center" src="https://www.marinlagace.ca/en/images/gVim_Portable_version_32bit.png" /&gt;
&lt;p&gt;La version portable &lt;em&gt;x86&lt;/em&gt; doit donc être utilisée.&lt;/p&gt;
&lt;img alt="Python 386 X86 Portable Download" class="align-center" src="https://www.marinlagace.ca/en/images/Python_368_X86_Portable_Download.png" /&gt;
&lt;p&gt;Tel que pour &lt;span class="app"&gt;Git&lt;/span&gt;, installez &lt;span class="lang"&gt;Python&lt;/span&gt; au côté de &lt;span class="app"&gt;gVim&lt;/span&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;e:
├── gVimPortable
│   ├── ...
│   ├── gVimPortable.exe
│   └── ...
├── PortableGit
│   ├── ...
│   ├── git-bash.exe
│   ├── git-cmd.exe
│   └── ...
└── Python36-x86
    ├── ...
    ├── python.exe
    ├── ...
    ├── python36.dll
    └── ...
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="configuration-de-gvim-portable"&gt;
&lt;h2&gt;Configuration de gVim Portable&lt;/h2&gt;
&lt;p&gt;Nous devons maintenant informer &lt;span class="app"&gt;gVim Portable&lt;/span&gt; de l'endroit où est
installé &lt;span class="app"&gt;Git&lt;/span&gt; et &lt;span class="app"&gt;Python&lt;/span&gt;. Pour ce faire, nous devons modifier le
fichier &lt;span class="path"&gt;gVimPortable.ini&lt;/span&gt; situé au fin fond de la structure de répertoire
de &lt;span class="app"&gt;gVim Portable&lt;/span&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;e:
└── gVimPortable
    └── App
        └── AppData
            └── Launcher
                └── gVimPortable.ini
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ajoutez les variables &lt;code&gt;PYTHON_HOME&lt;/code&gt; et &lt;code&gt;GIT_HOME&lt;/code&gt; à la section
&lt;code&gt;[Environment]&lt;/code&gt; du fichier.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;[Environment]&lt;/span&gt;
&lt;span class="na"&gt;VIM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:AppDir%\vim&lt;/span&gt;
&lt;span class="na"&gt;VIMRUNTIME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:AppDir%\vim\vim80&lt;/span&gt;
&lt;span class="na"&gt;HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:DataDir%\settings&lt;/span&gt;
&lt;span class="na"&gt;LANG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:LanguageCustom%&lt;/span&gt;
&lt;span class="hll"&gt;&lt;span class="na"&gt;PYTHON_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:PortableAppsDir%\Python36-x86&lt;/span&gt;
&lt;/span&gt;&lt;span class="hll"&gt;&lt;span class="na"&gt;GIT_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:PortableAppsDir%\PortableGit&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Finalement, modifiez la variable &lt;code&gt;PATH&lt;/code&gt; dans votre fichier &lt;span class="path"&gt;.vimrc&lt;/span&gt;
pour y ajouter l'endroit où se situe vos installation de &lt;span class="app"&gt;Git&lt;/span&gt; et
&lt;span class="app"&gt;Python&lt;/span&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;!&lt;/span&gt;empty&lt;span class="p"&gt;(&lt;/span&gt;$PYTHON_HOME&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;let&lt;/span&gt; $PATH .&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;;&amp;#39;&lt;/span&gt; . $PYTHON_HOME . &lt;span class="s1"&gt;&amp;#39;;&amp;#39;&lt;/span&gt; . $PYTHON_HOME . &lt;span class="s1"&gt;&amp;#39;\scripts&amp;#39;&lt;/span&gt;
  &lt;span class="k"&gt;let&lt;/span&gt; $PYTHONHOME &lt;span class="p"&gt;=&lt;/span&gt; $PYTHON_HOME
&lt;span class="k"&gt;endif&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;!&lt;/span&gt;empty&lt;span class="p"&gt;(&lt;/span&gt;$GIT_HOME&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;let&lt;/span&gt; $PATH .&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;;&amp;#39;&lt;/span&gt; . $GIT_HOME . &lt;span class="s1"&gt;&amp;#39;\bin&amp;#39;&lt;/span&gt;
&lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Une fois les modifications terminées, &lt;span class="app"&gt;Fugitive&lt;/span&gt; et &lt;span class="app"&gt;Ultisnips&lt;/span&gt;
devrait fonctionner parfaitement lorsque vous éditerez des fichiers avec votre
installation de &lt;span class="app"&gt;gVim Portable&lt;/span&gt;.&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
&lt;/div&gt;
</content><category term="Vim"></category><category term="Windows"></category></entry><entry><title>Portable Vim on Windows</title><link href="https://www.marinlagace.ca/en/2020/portable-vim-on-windows.html" rel="alternate"></link><published>2020-12-01T21:36:00-05:00</published><updated>2020-12-01T21:36:00-05:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-12-01:/en/2020/portable-vim-on-windows.html</id><summary type="html">&lt;p class="first last"&gt;How to configure a portable version of Vim on Windows to work with
Fugitive and Ultisnips.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;When doing &lt;span class="os"&gt;Windows&lt;/span&gt; development, I usually use &lt;a class="reference external" href="https://www.vim.org/"&gt;Vim&lt;/a&gt; under &lt;a class="reference external" href="https://www.cygwin.com"&gt;Cygwin&lt;/a&gt;. I use my
little &lt;a class="reference external" href="https://www.marinlagace.ca/en/2020/portable-cygwin.html"&gt;Cygwin hack&lt;/a&gt; to make it portable.
This allows me to easily copy my &lt;span class="app"&gt;Cygwin&lt;/span&gt; installation along with all my
settings to multiple computer.&lt;/p&gt;
&lt;p&gt;I rely heavily on &lt;a class="reference external" href="http://github.com/tpope/vim-fugitive"&gt;Fugitive&lt;/a&gt; which is a
great &lt;span class="app"&gt;Vim&lt;/span&gt; plugin for &lt;span class="app"&gt;Git&lt;/span&gt;. Unfortunately, it runs extremely slowly
on my main work computer. So, on that computer, I use &lt;a class="reference external" href="https://portableapps.com/apps/development/gvim_portable"&gt;gVim Portable&lt;/a&gt; from the
&lt;span class="app"&gt;PortableApps&lt;/span&gt; platform. It works great. The tricky part is making it work
along with &lt;span class="app"&gt;Git&lt;/span&gt; (for &lt;span class="app"&gt;Fugitive&lt;/span&gt;) and &lt;span class="lang"&gt;Python&lt;/span&gt; (for &lt;a class="reference external" href="https://github.com/sirver/UltiSnips"&gt;UltiSnips&lt;/a&gt;). It involves installing &lt;span class="app"&gt;Git&lt;/span&gt;
along with the proper version of &lt;span class="lang"&gt;Python&lt;/span&gt; and tweaking a configuration
file of &lt;span class="app"&gt;gVim Portable&lt;/span&gt;.&lt;/p&gt;
&lt;div class="section" id="installing-portable-git"&gt;
&lt;h2&gt;Installing Portable Git&lt;/h2&gt;
&lt;p&gt;Download it from their &lt;a class="reference external" href="https://git-scm.com/download/win"&gt;website&lt;/a&gt;. Make sure
to download the portable version.&lt;/p&gt;
&lt;img alt="Portable Git Download" class="align-center" src="https://www.marinlagace.ca/en/images/Portable_Git_Download.png" /&gt;
&lt;p&gt;Then, install it alongside of &lt;span class="app"&gt;gVim&lt;/span&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;e:
├── gVimPortable
│   ├── App
│   ├── ...
│   ├── gVimPortable.exe
│   └── ...
└── PortableGit
    ├── bin
    ├── ...
    ├── git-bash.exe
    ├── git-cmd.exe
    └── ...
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="installing-python"&gt;
&lt;h2&gt;Installing Python&lt;/h2&gt;
&lt;p&gt;It is important to install the appropriate version of &lt;span class="lang"&gt;Python&lt;/span&gt;. It needs
to be a &lt;span class="lang"&gt;Python 3&lt;/span&gt; version because &lt;span class="app"&gt;UltiSnips&lt;/span&gt; does not support
&lt;span class="lang"&gt;Python 2&lt;/span&gt; anymore. Furthermore, it needs to be the &lt;span class="lang"&gt;Python&lt;/span&gt; version
expected by &lt;span class="app"&gt;Vim&lt;/span&gt;. See my &lt;a class="reference external" href="https://www.marinlagace.ca/en/2020/ultisnips-on-cygwin.html"&gt;previous article&lt;/a&gt; on installing &lt;span class="app"&gt;Ultisnips&lt;/span&gt; on
&lt;span class="os"&gt;Cygwin&lt;/span&gt; for a description of the technique to use to find out which
&lt;span class="lang"&gt;Python&lt;/span&gt; version your installation of &lt;span class="app"&gt;Vim&lt;/span&gt; expects to find on your
system.&lt;/p&gt;
&lt;p&gt;As of this writing, &lt;span class="app"&gt;gVim Portable&lt;/span&gt; needs &lt;a class="reference external" href="https://www.python.org/downloads/release/python-368/"&gt;Python 3.6&lt;/a&gt;. Furthermore,
&lt;span class="app"&gt;gVim Portable&lt;/span&gt; was compiled for 32-bit systems.&lt;/p&gt;
&lt;img alt="gVim Portable version 32bit" class="align-center" src="https://www.marinlagace.ca/en/images/gVim_Portable_version_32bit.png" /&gt;
&lt;p&gt;So the portable &lt;em&gt;x86&lt;/em&gt; version should be used.&lt;/p&gt;
&lt;img alt="Python 386 X86 Portable Download" class="align-center" src="https://www.marinlagace.ca/en/images/Python_368_X86_Portable_Download.png" /&gt;
&lt;p&gt;As for &lt;span class="app"&gt;Git&lt;/span&gt;, install it alongside &lt;span class="app"&gt;gVim&lt;/span&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;e:
├── gVimPortable
│   ├── ...
│   ├── gVimPortable.exe
│   └── ...
├── PortableGit
│   ├── ...
│   ├── git-bash.exe
│   ├── git-cmd.exe
│   └── ...
└── Python36-x86
    ├── ...
    ├── python.exe
    ├── ...
    ├── python36.dll
    └── ...
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="configuring-gvim-portable"&gt;
&lt;h2&gt;Configuring gVim Portable&lt;/h2&gt;
&lt;p&gt;We must now tell &lt;span class="app"&gt;gVim&lt;/span&gt; where to find our intallations of
&lt;span class="app"&gt;Git&lt;/span&gt; and &lt;span class="app"&gt;Python&lt;/span&gt;. For that, we must edit the
&lt;span class="path"&gt;gVimPortable.ini&lt;/span&gt; file located deep into the directory structure.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;e:
└── gVimPortable
    └── App
        └── AppData
            └── Launcher
                └── gVimPortable.ini
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Add the &lt;code&gt;PYTHON_HOME&lt;/code&gt; and &lt;code&gt;GIT_HOME&lt;/code&gt; variable definitions to the
&lt;code&gt;[Environment]&lt;/code&gt; section of the file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;[Environment]&lt;/span&gt;
&lt;span class="na"&gt;VIM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:AppDir%\vim&lt;/span&gt;
&lt;span class="na"&gt;VIMRUNTIME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:AppDir%\vim\vim80&lt;/span&gt;
&lt;span class="na"&gt;HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:DataDir%\settings&lt;/span&gt;
&lt;span class="na"&gt;LANG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:LanguageCustom%&lt;/span&gt;
&lt;span class="hll"&gt;&lt;span class="na"&gt;PYTHON_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:PortableAppsDir%\Python36-x86&lt;/span&gt;
&lt;/span&gt;&lt;span class="hll"&gt;&lt;span class="na"&gt;GIT_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;%PAL:PortableAppsDir%\PortableGit&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Finally, modify the &lt;code&gt;PATH&lt;/code&gt; variable in your &lt;span class="path"&gt;.vimrc&lt;/span&gt; file to add the
path to your &lt;span class="app"&gt;Git&lt;/span&gt; and &lt;span class="app"&gt;Python&lt;/span&gt; installation.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;!&lt;/span&gt;empty&lt;span class="p"&gt;(&lt;/span&gt;$PYTHON_HOME&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;let&lt;/span&gt; $PATH .&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;;&amp;#39;&lt;/span&gt; . $PYTHON_HOME . &lt;span class="s1"&gt;&amp;#39;;&amp;#39;&lt;/span&gt; . $PYTHON_HOME . &lt;span class="s1"&gt;&amp;#39;\scripts&amp;#39;&lt;/span&gt;
  &lt;span class="k"&gt;let&lt;/span&gt; $PYTHONHOME &lt;span class="p"&gt;=&lt;/span&gt; $PYTHON_HOME
&lt;span class="k"&gt;endif&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;!&lt;/span&gt;empty&lt;span class="p"&gt;(&lt;/span&gt;$GIT_HOME&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;let&lt;/span&gt; $PATH .&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;;&amp;#39;&lt;/span&gt; . $GIT_HOME . &lt;span class="s1"&gt;&amp;#39;\bin&amp;#39;&lt;/span&gt;
&lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After this, &lt;span class="app"&gt;Fugitive&lt;/span&gt; and &lt;span class="app"&gt;Ultisnips&lt;/span&gt; should work fine when editing
files in your &lt;span class="app"&gt;gvim&lt;/span&gt; installation.&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
&lt;/div&gt;
</content><category term="Vim"></category><category term="Windows"></category></entry><entry><title>LineScout</title><link href="https://www.marinlagace.ca/en/2020/linescout.html" rel="alternate"></link><published>2020-08-14T11:04:00-04:00</published><updated>2020-08-14T11:04:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-08-14:/en/2020/linescout.html</id><summary type="html">&lt;p class="first last"&gt;Description of the LineScout robot.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;The LineScout is one of the first robots designed at the &lt;a class="reference external" href="http://www.hydroquebec.com/robotics/"&gt;robotics department&lt;/a&gt;. Its main goal is to inspect high
voltage power lines. It can do visual inspection using its four high definition
cameras as well as do resistance measurements on sleeves and corrosion
assessments of the steel spine of the cables. It main advantage is that it can
easily manage most obstacles found on power lines such as spacers and vibration
dampeners.&lt;/p&gt;
&lt;p&gt;Originally, the video feeds were analog and recorded on
&lt;a class="reference external" href="https://en.wikipedia.org/wiki/DV#Magnetic_tape"&gt;MiniDV&lt;/a&gt; magnetic tapes.
During the robot's last update, the analog cameras were changed to digital
cameras. My job was to update the robot control software to display and record
the new digital video feeds coming from the cameras.&lt;/p&gt;
&lt;p&gt;For those who are not familiar with the LineScout, here is a corporate video
describing it. The video was make before the update described above.&lt;/p&gt;
&lt;div class="youtube youtube-16x9"&gt;&lt;iframe src="https://www.youtube.com/embed/zhKWCakOSoE" allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="robotics"></category></entry><entry><title>LineScout</title><link href="https://www.marinlagace.ca/2020/linescout.html" rel="alternate"></link><published>2020-08-14T11:04:00-04:00</published><updated>2020-08-14T11:04:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-08-14:/2020/linescout.html</id><summary type="html">&lt;p class="first last"&gt;Description du robot LineScout.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Le LineScout est un des premiers robots conçus au département de
&lt;a class="reference external" href="http://www.hydroquebec.com/robotique/"&gt;robotique d'inspection et de maintenance&lt;/a&gt;.
Sa principale fonction est l'inspection des lignes à haute tension. Il peut
faire autant de l'inspection visuelle à l'aide des ses quatre caméras à haute
définition que des mesures de résistance sur les manchons et des mesures de
corrosion sur l'âme d'acier des conducteurs. Son principal avantage est qu'il
peut franchir la plupart des obstacles qu'on retrouve sur les lignes tels que
les entretoises et les amortisseurs.&lt;/p&gt;
&lt;p&gt;À l'origine, tous les flux vidéo étaient analogiques et enregistrés sur des
rubans magnétiques de format &lt;a class="reference external" href="https://fr.wikipedia.org/wiki/MiniDV"&gt;MiniDV&lt;/a&gt;.
Lors de la dernière mise à jour du robot, les caméras analogiques ont été
changées pour des caméras numériques. Ma tâche a été de mettre à jour le
logiciel de contrôle du robot afin qu'il puisse faire la visualisation et
l'enregistrement des nouveaux flux vidéo numériques provenant des caméras.&lt;/p&gt;
&lt;p&gt;Pour ceux qui ne serait pas familier avec le robot LineScout, voici un vidéo
corporatif le décrivant. Le vidéo a été réalisé avant la mise à jour décrite
plus haut.&lt;/p&gt;
&lt;div class="youtube youtube-16x9"&gt;&lt;iframe src="https://www.youtube.com/embed/lzZQTNn4KBU" allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="robotique"></category></entry><entry><title>UltiSnips on Cygwin</title><link href="https://www.marinlagace.ca/en/2020/ultisnips-on-cygwin.html" rel="alternate"></link><published>2020-06-27T10:01:00-04:00</published><updated>2020-06-27T10:01:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-06-27:/en/2020/ultisnips-on-cygwin.html</id><summary type="html">&lt;p class="first last"&gt;UltiSnips runs on Python but which version?&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;a href="https://github.com/sirver/UltiSnips" class="reference external"&gt;UltiSnips&lt;/a&gt; is the plugin for
&lt;a href="https://www.vim.org/" class="reference external"&gt;Vim&lt;/a&gt; that I use the most. It allows for the creation of
macros (named &lt;em&gt;snippets&lt;/em&gt;) that insert predefined chuncks of text at the desired
location in a file. These snippets automate the insertion of repetitive lines of
code. They can be very simple like the following one which write the necessary
&lt;span class=lang&gt;C++&lt;/span&gt; code to print text to the console:&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/UltiSnips_cpp_sout.gif" alt="UltiSnips simple snippet" class=align-center&gt;
&lt;p&gt;They can be much more complex like this one which creates the header for a
&lt;span class=lang&gt;C++&lt;/span&gt; class:&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/UltiSnips_cpp_header2.gif" alt="UltiSnips complex snippet" class=align-center&gt;
&lt;p&gt;&lt;span class=app&gt;UltiSnips&lt;/span&gt; requires &lt;span class=lang&gt;Python&lt;/span&gt;3 to run. Thus, &lt;span class=app&gt;Vim&lt;/span&gt; must have
been compiled with &lt;span class=lang&gt;Python&lt;/span&gt;3 support. To check, start &lt;span class=app&gt;Vim&lt;/span&gt; with
the &lt;tt class="docutils literal"&gt;&lt;span class=pre&gt;--version&lt;/span&gt;&lt;/tt&gt; argument.&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/Cygwin_Vim_Version.png" alt="Vim Version on Cygwin" class=align-center&gt;
&lt;p&gt;Fortunately, this is the case for the version of &lt;span class=app&gt;Vim&lt;/span&gt; found in the
&lt;span class=app&gt;Cygwin&lt;/span&gt; repo.&lt;/p&gt;
&lt;p&gt;It is not enough to have installed &lt;span class=lang&gt;Python&lt;/span&gt;
for &lt;span class=app&gt;UltiSnips&lt;/span&gt; to work
out of the box. We need to have installed the same version that &lt;span class=app&gt;Vim&lt;/span&gt; was
compiled for. To check that the link between &lt;span class=app&gt;Vim&lt;/span&gt; and &lt;span class=lang&gt;Python&lt;/span&gt; works
proprely, we can simply try to run any &lt;span class=lang&gt;Python&lt;/span&gt; expression in &lt;span class=app&gt;Vim&lt;/span&gt;
using the &lt;tt class="docutils literal"&gt;:python3&lt;/tt&gt; command.
&lt;sup id=sf-ultisnips-on-cygwin-1-back&gt;&lt;a href=#sf-ultisnips-on-cygwin-1 title=" UltiSnips does not support Python2 since commit d2f42d6. It is thus important to use the :python3 command for our test. " class=simple-footnote&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/Cygwin_Vim_Python_Version_Detection.png" alt="Finding the Python version in Vim on Cygwin" class=align-center&gt;
&lt;p&gt;If the &lt;span class=app&gt;Vim&lt;/span&gt;/&lt;span class=lang&gt;Python&lt;/span&gt; link is correct, the command will be executed
without any error. Otherwise, an error message will be displayed at the bottom
of the window.&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/Cygwin_Vim_Python_Version_Error.png" alt="Error message showing the Python version in Vim on Cygwin" class=align-center&gt;
&lt;p&gt;We see here that &lt;span class=app&gt;Vim&lt;/span&gt; is looking for &lt;span class=lang&gt;Python&lt;/span&gt; 3.7. We just need to
start the &lt;span class=app&gt;Cygwin&lt;/span&gt; installation app and install the &lt;tt class="docutils literal"&gt;python37&lt;/tt&gt; package.&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/Cygwin_Python37_Package.png" alt="Python37 Package on Cygwin" class=align-center&gt;
&lt;p&gt;Once installed, &lt;span class=app&gt;UltiSnips&lt;/span&gt; should properly work.&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
&lt;ol class=simple-footnotes&gt;&lt;li id=sf-ultisnips-on-cygwin-1&gt; &lt;span class=app&gt;UltiSnips&lt;/span&gt; does not support &lt;span class=lang&gt;Python&lt;/span&gt;2 since
commit &lt;a href="https://github.com/SirVer/ultisnips/commit/d2f42d6b43902e5b2ef7bfca2579ccb6cc9f52c0" class="reference external"&gt;d2f42d6&lt;/a&gt;.
It is thus important to use the &lt;tt class="docutils literal"&gt;:python3&lt;/tt&gt; command for our test.
 &lt;a href=#sf-ultisnips-on-cygwin-1-back class=simple-footnote-back&gt;↩&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;</content><category term="vim"></category><category term="cygwin"></category></entry><entry><title>UltiSnips sous Cygwin</title><link href="https://www.marinlagace.ca/2020/ultisnips-sous-cygwin.html" rel="alternate"></link><published>2020-06-27T10:01:00-04:00</published><updated>2020-06-27T10:01:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-06-27:/2020/ultisnips-sous-cygwin.html</id><summary type="html">&lt;p class="first last"&gt;UltiSnips nécessite l'installation de Python. Mais quelle version?&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;a class="reference external" href="https://github.com/sirver/UltiSnips"&gt;UltiSnips&lt;/a&gt; est un des modules
d'extension de &lt;a class="reference external" href="https://www.vim.org/"&gt;Vim&lt;/a&gt; que j'utilise le plus. Il permet
d'écrire des macros (appelés &lt;em&gt;snippets&lt;/em&gt;) qui insèrent des bouts de texte
prédéfinis à l'endroit désiré dans le fichier. Ces &lt;em&gt;snippets&lt;/em&gt; me permettent
d'automatiser l'écriture de bout de code répétitif. Ils peuvent être plutôt
simple comme celui-ci qui écrit le code &lt;span class="lang"&gt;C++&lt;/span&gt; nécessaire pour imprimer du
texte à l'écran:&lt;/p&gt;
&lt;img alt="UltiSnips macro simple" class="align-center" src="https://www.marinlagace.ca/en/images/UltiSnips_cpp_sout.gif" /&gt;
&lt;p&gt;Ils peuvent également être plus complexes comme celui-ci qui crée l'entête d'une
classe en &lt;span class="lang"&gt;C++&lt;/span&gt;:&lt;/p&gt;
&lt;img alt="UltiSnips macro complexe" class="align-center" src="https://www.marinlagace.ca/en/images/UltiSnips_cpp_header2.gif" /&gt;
&lt;p&gt;&lt;span class="app"&gt;UltiSnips&lt;/span&gt; requiert &lt;span class="lang"&gt;Python&lt;/span&gt;3 pour rouler. Il faut donc que
&lt;span class="app"&gt;Vim&lt;/span&gt; ait été compilé avec le support pour &lt;span class="lang"&gt;Python&lt;/span&gt;3. Pour
vérifier, démarrez &lt;span class="app"&gt;Vim&lt;/span&gt; avec l'argument &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;--version&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;img alt="Vim Version sous Cygwin" class="align-center" src="https://www.marinlagace.ca/en/images/Cygwin_Vim_Version.png" /&gt;
&lt;p&gt;C'est heureusement le cas pour la version de &lt;span class="app"&gt;Vim&lt;/span&gt; de la logithèque de
&lt;span class="app"&gt;Cygwin&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Il ne suffit cependant pas d'avoir installé &lt;span class="lang"&gt;Python&lt;/span&gt; pour
qu'&lt;span class="app"&gt;UltiSnips&lt;/span&gt; fonctionne automatiquement. Il faut avoir installé la même
version que celle pour laquelle &lt;span class="app"&gt;Vim&lt;/span&gt; a été compilé. Pour déterminer si le
lien entre &lt;span class="app"&gt;Vim&lt;/span&gt; et &lt;span class="lang"&gt;Python&lt;/span&gt; fonctionne bien, on peut simplement
essayer d'exécuter n'importe quelle expression &lt;span class="lang"&gt;Python&lt;/span&gt; dans &lt;span class="app"&gt;Vim&lt;/span&gt; à
l'aide de la command &lt;tt class="docutils literal"&gt;:python3&lt;/tt&gt;.
[ref] &lt;span class="app"&gt;UltiSnips&lt;/span&gt; ne support plus &lt;span class="lang"&gt;Python&lt;/span&gt;2 depuis le commit
&lt;a class="reference external" href="https://github.com/SirVer/ultisnips/commit/d2f42d6b43902e5b2ef7bfca2579ccb6cc9f52c0"&gt;d2f42d6&lt;/a&gt;.
Il est donc important de tester à l'aide de la command &lt;tt class="docutils literal"&gt;:python3&lt;/tt&gt;.
[/ref]&lt;/p&gt;
&lt;img alt="Détection de la version de Python dans Vim sous Cygwin" class="align-center" src="https://www.marinlagace.ca/en/images/Cygwin_Vim_Python_Version_Detection.png" /&gt;
&lt;p&gt;Si le lien &lt;span class="app"&gt;Vim&lt;/span&gt;/&lt;span class="lang"&gt;Python&lt;/span&gt; est bon, l'expression sera exécutée sans
erreur. Dans le cas contraire, un message d'erreur apparaîtra au bas de la
fenêtre.&lt;/p&gt;
&lt;img alt="Message d'erreur donnant la version de Python dans Vim sous Cygwin" class="align-center" src="https://www.marinlagace.ca/en/images/Cygwin_Vim_Python_Version_Error.png" /&gt;
&lt;p&gt;On voit ici que &lt;span class="app"&gt;Vim&lt;/span&gt; recherche la version 3.7 de &lt;span class="lang"&gt;Python&lt;/span&gt;. Il ne
suffit donc que de retourner dans l'application d'installation de &lt;span class="app"&gt;Cygwin&lt;/span&gt;
et installer le paquet &lt;tt class="docutils literal"&gt;python37&lt;/tt&gt;.&lt;/p&gt;
&lt;img alt="Paquet Python37 sous Cygwin" class="align-center" src="https://www.marinlagace.ca/en/images/Cygwin_Python37_Package.png" /&gt;
&lt;p&gt;Une fois l'installation du paquet complétée, &lt;span class="app"&gt;UltiSnips&lt;/span&gt; devrait
fonctionner correctment.&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="vim"></category><category term="cygwin"></category></entry><entry><title>Portable Cygwin</title><link href="https://www.marinlagace.ca/en/2020/portable-cygwin.html" rel="alternate"></link><published>2020-06-12T21:20:00-04:00</published><updated>2020-06-12T21:20:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-06-12:/en/2020/portable-cygwin.html</id><summary type="html">&lt;p class="first last"&gt;My own hack to make Cygwin run from a USB stick.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;I do most of my software development on &lt;span class=os&gt;Linux&lt;/span&gt;. Since my employer is a
&lt;span class=os&gt;Windows&lt;/span&gt; shop, most of the software I write must run on &lt;span class=os&gt;Windows&lt;/span&gt;.
Since I use cross-platform libraries (like &lt;a href="https://www.boost.org" class="reference external"&gt;Boost&lt;/a&gt; or
&lt;a href="https://www.qt.io" class="reference external"&gt;Qt&lt;/a&gt;), I can still do most of my development work on
&lt;span class=os&gt;Linux&lt;/span&gt;. Unfortunately, at some point, I need to move to &lt;span class=os&gt;Windows&lt;/span&gt; to
compile and test the software.&lt;/p&gt;
&lt;p&gt;On &lt;span class=os&gt;Linux&lt;/span&gt;, I mainly use &lt;a href="https://www.vim.org" class="reference external"&gt;Vim&lt;/a&gt; with &lt;a href="https://github.com/tmux/tmux/wiki" class="reference external"&gt;tmux&lt;/a&gt;. I am very familiar with those tools. I
have my &lt;span class=app&gt;tmux&lt;/span&gt; sessions, windows and panels set up just the way I like
them. I also have fully configured my &lt;span class=app&gt;Vim&lt;/span&gt; plugins and key bindings. I
really would like to keep using these tools and my workspace configuration when
coding on &lt;span class=os&gt;Windows&lt;/span&gt;. And I can by using &lt;a href="https://www.cygwin.com" class="reference external"&gt;Cygwin&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;According to &lt;span class=app&gt;Wikipedia&lt;/span&gt;:&lt;/p&gt;
&lt;blockquote&gt;
Cygwin is a POSIX-compatible environment that runs natively on Microsoft
Windows. Its goal is to allow programs of Unix-like systems to be recompiled
and run natively on Windows with minimal source code modifications by
providing them with the same underlying POSIX API they would expect in those
systems.
&lt;sup id=sf-portable-cygwin-1-back&gt;&lt;a href=#sf-portable-cygwin-1 title=" https://en.wikipedia.org/wiki/Cygwin " class=simple-footnote&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;span class=app&gt;Cygwin&lt;/span&gt; is a great tool. I can use &lt;span class=app&gt;Vim&lt;/span&gt; and &lt;span class=app&gt;tmux&lt;/span&gt; without any
problem. All the plugins and configuration files I used on &lt;span class=os&gt;Linux&lt;/span&gt; work
flawlessly on &lt;span class=app&gt;Cygwin&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;In my work, I have access to multiple computers. I want to use &lt;span class=app&gt;Cygwin&lt;/span&gt; on
all of them so I can have access to all my development tools. The problem is
that &lt;span class=app&gt;Cygwin&lt;/span&gt; can be long and tedious to install and configure. I would
like a version that can be run from a USB drive.&lt;/p&gt;
&lt;p&gt;There are many projects on &lt;a href="https://github.com/search?q=cygwin-portable&amp;amp;type=Repositories&amp;amp;ref=searchresults" class="reference external"&gt;GitHub&lt;/a&gt;
that hack on a local &lt;span class=app&gt;Cygwin&lt;/span&gt; installation to make it portable. Some of
them are quite old and look abandoned. Some others I find too complex for my
needs. So here is my own hack to make &lt;span class=app&gt;Cygwin&lt;/span&gt; portable.&lt;/p&gt;
&lt;p&gt;Install &lt;span class=app&gt;Cygwin&lt;/span&gt; to your hard drive. It does not matter to which directory
you install it. Here, I chose to install it to &lt;span class=path&gt;c:CygwinX86&lt;/span&gt;.&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/Cygwin_Root_Install_Dir.png" alt="Cygwin Root Install Dir" class=align-center&gt;
&lt;p&gt;Set the local package directory location to a subdirectory of the
installation directory. Here, I use the &lt;span class=path&gt;packages&lt;/span&gt; subdirectory.&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/Cygwin_Packages_Install_Dir.png" alt="Cygwin Packages Install Dir" class=align-center&gt;
&lt;p&gt;Follow the installation procedure to the end. There is no other special care to
take during the installation process.&lt;/p&gt;
&lt;p&gt;Once the installation procedure is complete, add a batch file named
&lt;span class=path&gt;PortableCygwin.bat&lt;/span&gt;
&lt;sup id=sf-portable-cygwin-2-back&gt;&lt;a href=#sf-portable-cygwin-2 title=" You can of course name it any way you like. " class=simple-footnote&gt;2&lt;/a&gt;&lt;/sup&gt;
to the &lt;span class=app&gt;Cygwin&lt;/span&gt; root directory.&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/Cygwin_Portable_Batch_File.png" alt="Cygwin Portable Batch File" class=align-center&gt;
&lt;p&gt;The file should contain the following lines:&lt;/p&gt;
&lt;div class=highlight&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=p&gt;@&lt;/span&gt;&lt;span class=k&gt;echo&lt;/span&gt; off
&lt;span class=s2&gt;"&lt;/span&gt;&lt;span class=nv&gt;%~dp0&lt;/span&gt;&lt;span class=s2&gt;\bin\mintty.exe"&lt;/span&gt; -i /Cygwin-Terminal.ico -
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This file will start the &lt;span class=app&gt;Cygwin&lt;/span&gt; terminal from whichever directory it is
installed on.&lt;/p&gt;
&lt;p&gt;&lt;span class=app&gt;Cygwin&lt;/span&gt; will create a home folder using the current &lt;span class=os&gt;Windows&lt;/span&gt; user
name. My user name changes from computer to computer. This means that the name
of my home folder will also change from computer to computer. We thus need to
set a fix home folder to make our installation more portable. This can be easily
accomplished by editing the &lt;span class=path&gt;/etc/nsswitch.conf&lt;/span&gt; file, uncommenting the
&lt;tt class="docutils literal"&gt;&lt;span class=pre&gt;db-home&lt;/span&gt;&lt;/tt&gt; line and setting its value to a fixed path:&lt;/p&gt;
&lt;div class=highlight&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;# /etc/nsswitch.conf
#
#    This file is read once by the first process in a Cygwin process tree.
#    To pick up changes, restart all Cygwin processes.  For a description
#    see https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch
#
# Defaults:
# passwd:   files db
# group:    files db
# db_enum:  cache builtin
db_home:  /home/foo
# db_shell: /bin/bash
# db_gecos: &amp;lt;empty&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In the above case, &lt;span class=app&gt;Cygwin&lt;/span&gt; will always set the home directory to
&lt;span class=path&gt;/home/foo&lt;/span&gt;. Restart your terminal and check that your home directory has
the expected path.&lt;/p&gt;
&lt;div class=highlight&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ cygpath -w ~
c:\CygwinX86\home\foo
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We need to register the proper path to the local package directory. This path is
recorded in the &lt;span class=path&gt;/etc/setup/setup.rc&lt;/span&gt; file.&lt;/p&gt;
&lt;div class=highlight&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;last-cache
        c:\CygwinX86\packages
mirrors-lst
        http://cygwin.mirror.constant.com/;cygwin.mirror.constant.com;United States;New Jersey
        http://cygwin.mirror.hoobly.com/;cygwin.mirror.hoobly.com;United States;Pennsylvania
        http://mirrors.koehn.com/cygwin/;mirrors.koehn.com;United States;Missouri
        http://mirrors.metapeer.com/cygwin/;mirrors.metapeer.com;United States;Washington
        ...
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We need to replace the second line with the path to the local package directory
on our USB key. Adding the following line to your &lt;span class=path&gt;.profile&lt;/span&gt; file will do
the trick.&lt;/p&gt;
&lt;div class=highlight&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;sed -i &lt;span class=s1&gt;'2s|.*|\t'&lt;/span&gt;&lt;span class=k&gt;$(&lt;/span&gt;cygpath -m /&lt;span class=k&gt;)&lt;/span&gt;&lt;span class=s1&gt;'/packages|'&lt;/span&gt; /etc/setup/setup.rc
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It is important to specify the proper subdirectory in the command. Here we
specified &lt;span class=path&gt;packages&lt;/span&gt; since this is the subdirectory we used during
installation earlier. Now, every time we start &lt;span class=app&gt;Cygwin&lt;/span&gt;, the
&lt;span class=path&gt;.profile&lt;/span&gt; file will be run and the &lt;span class=path&gt;setup.rc&lt;/span&gt; file will be updated
with the actual path to the local package directory.&lt;/p&gt;
&lt;p&gt;Finally, copy the whole installation directory anywhere on your USB drive.
Use the &lt;span class=path&gt;PortableCygwin.bat&lt;/span&gt; file to start &lt;span class=app&gt;Cygwin&lt;/span&gt; and enjoy your
portable POSIX experience.&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
&lt;ol class=simple-footnotes&gt;&lt;li id=sf-portable-cygwin-1&gt; &lt;a href="https://en.wikipedia.org/wiki/Cygwin" class="reference external"&gt;https://en.wikipedia.org/wiki/Cygwin&lt;/a&gt;  &lt;a href=#sf-portable-cygwin-1-back class=simple-footnote-back&gt;↩&lt;/a&gt;&lt;/li&gt;&lt;li id=sf-portable-cygwin-2&gt; You can of course name it any way you like.  &lt;a href=#sf-portable-cygwin-2-back class=simple-footnote-back&gt;↩&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;</content><category term="cygwin"></category></entry><entry><title>Cygwin Portable</title><link href="https://www.marinlagace.ca/2020/cygwin-portable.html" rel="alternate"></link><published>2020-06-12T21:20:00-04:00</published><updated>2020-06-12T21:20:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-06-12:/2020/cygwin-portable.html</id><summary type="html">&lt;p class="first last"&gt;Les modifications que j'ai faites pour pouvoir exécuter Cygwin à
partir d'une clef USB.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Je développe principalement sous &lt;span class="os"&gt;Linux&lt;/span&gt;. Comme mon employeur ne supporte
officiellement que les applications &lt;span class="os"&gt;Windows&lt;/span&gt;, la plupart de mes application
doivent rouler sous &lt;span class="os"&gt;Windows&lt;/span&gt;. Puisque j'utilise des librairies
multiplateformes (tel que &lt;a class="reference external" href="https://www.boost.org"&gt;Boost&lt;/a&gt; ou &lt;a class="reference external" href="https://www.qt.io"&gt;Qt&lt;/a&gt;), je peux tout de même développer mes applications sous
&lt;span class="os"&gt;Linux&lt;/span&gt;. Malheureusement, je dois éventuellement passer à &lt;span class="os"&gt;Windows&lt;/span&gt; pour
compiler et tester mon code.&lt;/p&gt;
&lt;p&gt;Sous &lt;span class="os"&gt;Linux&lt;/span&gt;, j'utilise principalement &lt;a class="reference external" href="https://www.vim.org"&gt;Vim&lt;/a&gt; et &lt;a class="reference external" href="https://github.com/tmux/tmux/wiki"&gt;tmux&lt;/a&gt;. Je suis très familier avec ces outils.
J'ai une configuration de sessions, fenêtres et panneaux &lt;span class="app"&gt;tmux&lt;/span&gt; que j'aime
bien. J'ai également une configuration de &lt;span class="app"&gt;Vim&lt;/span&gt; avec des extensions et des
raccourcis clavier qui me conviennent. J'aimerais vraiment conserver ces outils
et leur configuration lorsque je travaille sous &lt;span class="os"&gt;Windows&lt;/span&gt;. Et je le peux
grâce à &lt;a class="reference external" href="https://www.cygwin.com"&gt;Cygwin&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;D'après &lt;span class="app"&gt;Wikipedia&lt;/span&gt;:&lt;/p&gt;
&lt;blockquote&gt;
Cygwin est une collection de logiciels libres à l'origine développés par
Cygnus Solutions permettant à différentes versions de Windows de Microsoft
d'émuler un système Unix. Il vise principalement l'adaptation à Windows de
logiciels qui fonctionnent sur des systèmes POSIX (tels que les systèmes
GNU/Linux, BSD, et Unix). Cygwin simule un environnement Unix sous Windows,
rendant possible l'exécution de ces logiciels après une simple compilation.
[ref] &lt;a class="reference external" href="https://fr.wikipedia.org/wiki/Cygwin"&gt;https://fr.wikipedia.org/wiki/Cygwin&lt;/a&gt; [/ref]&lt;/blockquote&gt;
&lt;p&gt;&lt;span class="app"&gt;Cygwin&lt;/span&gt; est une outil incroyable. On peut utiliser &lt;span class="app"&gt;Vim&lt;/span&gt; et
&lt;span class="app"&gt;tmux&lt;/span&gt; sans problème. Toutes les extensions ainsi que les fichiers de
configuration que j'utilise sous &lt;span class="os"&gt;Linux&lt;/span&gt; fonctionne à la perfection sous
&lt;span class="app"&gt;Cygwin&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;À mon travail, j'ai accès à plusieurs ordinateurs différents. Je voudrais
utiliser &lt;span class="app"&gt;Cygwin&lt;/span&gt; sur chacun d'entre eux afin d'avoir accès à tous mes
outils de développement. Le problème est que &lt;span class="app"&gt;Cygwin&lt;/span&gt; peut être long et
fastidieux à installer et configurer. J'aimerais avoir une version que puisse
rouler à partir d'une clef USB.&lt;/p&gt;
&lt;p&gt;Il existe plusieurs projets sur &lt;a class="reference external" href="https://github.com/search?q=cygwin-portable&amp;amp;type=Repositories&amp;amp;ref=searchresults"&gt;GitHub&lt;/a&gt;
qui modifie une installation locale de &lt;span class="app"&gt;Cygwin&lt;/span&gt; pour la rendre portable.
Certains de ces projets sont plutôt vieux et semblent abandonnés. D'autres me
semblent trop complexes pour mes besoins. Voici donc les modifications que j'ai
faites pour rendre &lt;span class="app"&gt;Cygwin&lt;/span&gt; portable.&lt;/p&gt;
&lt;p&gt;Installez &lt;span class="app"&gt;Cygwin&lt;/span&gt; sur votre disque dur. Peu importe dans quel répertoire
vous décidez de l'installer. J'ai choisi de l'installer dans
&lt;span class="path"&gt;c:CygwinX86&lt;/span&gt;.&lt;/p&gt;
&lt;img alt="Cygwin Root Install Dir" class="align-center" src="https://www.marinlagace.ca/en/images/Cygwin_Root_Install_Dir.png" /&gt;
&lt;p&gt;Fixez le répertoire des paquets téléchargés comme un sous-répertoire de votre
répertoire d'installation. Ici, j'utilise le sous-répertoire &lt;span class="path"&gt;packages&lt;/span&gt;.&lt;/p&gt;
&lt;img alt="Cygwin Packages Install Dir" class="align-center" src="https://www.marinlagace.ca/en/images/Cygwin_Packages_Install_Dir.png" /&gt;
&lt;p&gt;Suivez la procédure d'installation jusqu'à la fin. Il n'y a rien de spécial à
effectuer d'ici la fin de la procédure d'installation.&lt;/p&gt;
&lt;p&gt;Une fois la procédure d'installation terminée, ajoutez un fichier nommé
&lt;span class="path"&gt;PortableCygwin.bat&lt;/span&gt;
[ref] Vous pouvez le nommer comme vous le voulez. [/ref]
au répertoire d'installation de &lt;span class="app"&gt;Cygwin&lt;/span&gt;.&lt;/p&gt;
&lt;img alt="Cygwin Portable Batch File" class="align-center" src="https://www.marinlagace.ca/en/images/Cygwin_Portable_Batch_File.png" /&gt;
&lt;p&gt;Le fichier devrait contenir les lignes suivantes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="k"&gt;echo&lt;/span&gt; off
&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;%~dp0&lt;/span&gt;&lt;span class="s2"&gt;\bin\mintty.exe&amp;quot;&lt;/span&gt; -i /Cygwin-Terminal.ico -
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ce fichier va démarrer la console de &lt;span class="app"&gt;Cygwin&lt;/span&gt; à partir du répertoire dans
laquelle elle se retrouve.&lt;/p&gt;
&lt;p&gt;&lt;span class="app"&gt;Cygwin&lt;/span&gt; va créer une dossier d'accueil utilisant votre nom d'usager
&lt;span class="os"&gt;Windows&lt;/span&gt;. Mon nom d'usager change d'ordinateur à ordinateur. Ceci signifie
que mon dossier d'accueil change également d'ordinateur à ordinateur. Nous
devons donc fixer le nom du dossier d'accueil afin de rendre notre installation
portable. Ceci peut être facilement accompli en modifiant le fichier
&lt;span class="path"&gt;/etc/nsswitch.conf&lt;/span&gt;. Il suffit de modifier la ligne contenant &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;db-home&lt;/span&gt;&lt;/tt&gt;
pour y écrire le nom du dossier d'accueil désiré:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;# /etc/nsswitch.conf
#
#    This file is read once by the first process in a Cygwin process tree.
#    To pick up changes, restart all Cygwin processes.  For a description
#    see https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch
#
# Defaults:
# passwd:   files db
# group:    files db
# db_enum:  cache builtin
db_home:  /home/foo
# db_shell: /bin/bash
# db_gecos: &amp;lt;empty&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Dans l'exemple ci-haut, &lt;span class="app"&gt;Cygwin&lt;/span&gt; fixera toujours son dossier d'accueil à
&lt;span class="path"&gt;/home/foo&lt;/span&gt;. Redémarrez la console et vérifiez que le dossier d'accueil
est bien celui désiré.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ cygpath -w ~
c:\CygwinX86\home\foo
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Maintenant, nous devons modifier le chemin du répertoire de sauvegarde des
paquets. Ce chemin se retrouve dans le fichier &lt;span class="path"&gt;/etc/setup/setup.rc&lt;/span&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;last-cache
        c:\CygwinX86\packages
mirrors-lst
        http://cygwin.mirror.constant.com/;cygwin.mirror.constant.com;United States;New Jersey
        http://cygwin.mirror.hoobly.com/;cygwin.mirror.hoobly.com;United States;Pennsylvania
        http://mirrors.koehn.com/cygwin/;mirrors.koehn.com;United States;Missouri
        http://mirrors.metapeer.com/cygwin/;mirrors.metapeer.com;United States;Washington
        ...
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Nous devons remplacer la seconde ligne avec le chemin du répertoire de
sauvegarde des paquets sur notre clef USB. L'ajout de la ligne suivante à notre
fichier &lt;span class="path"&gt;.profile&lt;/span&gt; fera l'affaire.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;sed -i &lt;span class="s1"&gt;&amp;#39;2s|.*|\t&amp;#39;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;cygpath -m /&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/packages|&amp;#39;&lt;/span&gt; /etc/setup/setup.rc
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Il est important de bien spécifier le bon sous-répertoire dans cette commande.
Ici, nous spécifions &lt;span class="path"&gt;packages&lt;/span&gt; puisqu'il s'agit du sous-répertoire que
nous avons utilisé lors de la procédure d'installation effectuée plus tôt. À
partir de maintenant, à chaque fois que nous démarrerons &lt;span class="app"&gt;Cygwin&lt;/span&gt;, le
fichier &lt;span class="path"&gt;.profile&lt;/span&gt; sera exécuté et le fichier &lt;span class="path"&gt;setup.rc&lt;/span&gt; sera mis à
jour avec le chemin actuel du répertoire de sauvegarde des paquets.&lt;/p&gt;
&lt;p&gt;Les modifications sont terminées. Copiez le répertoire d'installation au complet
sur votre clef USB. Utilisez &lt;span class="path"&gt;PortableCygwin.bat&lt;/span&gt; pour démarrer
&lt;span class="app"&gt;Cygwin&lt;/span&gt; et apprécier votre environnement POSIX portable.&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="cygwin"></category></entry><entry><title>FileBeagle</title><link href="https://www.marinlagace.ca/en/2020/filebeagle.html" rel="alternate"></link><published>2020-05-31T19:50:00-04:00</published><updated>2020-05-31T19:50:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-05-31:/en/2020/filebeagle.html</id><summary type="html">&lt;p class="first last"&gt;A great directory browser for Vim worth discovering.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;a href="https://www.vim.org/" class="reference external"&gt;Vim&lt;/a&gt; has &lt;a href="https://shapeshed.com/vim-netrw/" class="reference external"&gt;netrw&lt;/a&gt; as
a built-in directory browser. It is pretty basic and some people like that.
Others find it a bit too basic or unintuitive. &lt;a href="https://tpo.pe/" class="reference external"&gt;Tim Pope&lt;/a&gt;
wrote &lt;a href="https://github.com/tpope/vim-vinegar" class="reference external"&gt;vinegar&lt;/a&gt; to "enhance
&lt;span class=app&gt;netrw&lt;/span&gt;, partially in an attempt to mitigate the need for more disruptive
'project drawer' style plugins".
&lt;sup id=sf-filebeagle-1-back&gt;&lt;a href=#sf-filebeagle-1 title=" https://github.com/tpope/vim-vinegar/blob/master/README.markdown " class=simple-footnote&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;A very popular tree explorer plugin is &lt;a href="https://github.com/scrooloose/nerdtree" class="reference external"&gt;NERDTree&lt;/a&gt;. It is very pretty and has a &lt;a href="https://www.youtube.com/watch?v=CPu9mDpSYj0" class="reference external"&gt;lot of
features&lt;/a&gt; but I find it a little
too heavy for my taste.&lt;/p&gt;
&lt;p&gt;I prefer to use &lt;a href="https://github.com/jeetsukumaran/vim-filebeagle" class="reference external"&gt;FileBeagle&lt;/a&gt;
as my directory browser. It is simple and efficient. As stated by its developer:&lt;/p&gt;
&lt;blockquote&gt;
&lt;span class=app&gt;Vim&lt;/span&gt; is a text editor, not an operating system that can edit text.
&lt;span class=app&gt;FileBeagle&lt;/span&gt; respects this, and attempts to conform to this both in
spirit and in practice. If you are looking for a plugin to serve as a
filesystem manager from within &lt;span class=app&gt;Vim&lt;/span&gt;, &lt;span class=app&gt;FileBeagle&lt;/span&gt; is not it.
&lt;span class=app&gt;FileBeagle&lt;/span&gt; does not support copying, deleting, moving/renaming, or
any other filesystem operations. &lt;span class=app&gt;FileBeagle&lt;/span&gt; lists and opens files.
&lt;sup id=sf-filebeagle-2-back&gt;&lt;a href=#sf-filebeagle-2 title=" https://github.com/jeetsukumaran/vim-filebeagle/blob/master/README.md " class=simple-footnote&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/blockquote&gt;
&lt;p&gt;The &lt;span class=kbd&gt;-&lt;/span&gt; key is mapped to open &lt;span class=app&gt;FileBeagle&lt;/span&gt; on the directory of the
current buffer. You can then use the standard &lt;span class=app&gt;Vim&lt;/span&gt; navigation keys to move
to a file or a directory or press &lt;span class=kbd&gt;-&lt;/span&gt; to go to the parent directory.
Pressing &lt;span class=kbd&gt;Enter&lt;/span&gt; will either go into the selected directory or open the
selected file for editing. There are many more functions available. I refer you
to the &lt;a href="https://github.com/jeetsukumaran/vim-filebeagle/blob/master/doc/filebeagle.txt" class="reference external"&gt;plugin's documentation&lt;/a&gt;
for more info.&lt;/p&gt;
&lt;img src="https://www.marinlagace.ca/en/images/FileBeagle.gif" alt=FileBeagle class=align-center&gt;
&lt;p&gt;I like &lt;span class=app&gt;FileBeagle&lt;/span&gt; to display hidden files and relative line numbers. Here
are the variables I set in my &lt;tt class="docutils literal"&gt;.vimrc&lt;/tt&gt; file to accomplish that.&lt;/p&gt;
&lt;div class=highlight&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=k&gt;let&lt;/span&gt; filebeagle_show_hidden&lt;span class=p&gt;=&lt;/span&gt;&lt;span class=m&gt;1&lt;/span&gt;
&lt;span class=k&gt;let&lt;/span&gt; filebeagle_show_line_numbers&lt;span class=p&gt;=&lt;/span&gt;&lt;span class=m&gt;1&lt;/span&gt;
&lt;span class=k&gt;let&lt;/span&gt; filebeagle_show_line_relativenumbers&lt;span class=p&gt;=&lt;/span&gt;&lt;span class=m&gt;0&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Give &lt;span class=app&gt;FileBeagle&lt;/span&gt; a try. You might like it.&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
&lt;ol class=simple-footnotes&gt;&lt;li id=sf-filebeagle-1&gt; &lt;a href="https://github.com/tpope/vim-vinegar/blob/master/README.markdown" class="reference external"&gt;https://github.com/tpope/vim-vinegar/blob/master/README.markdown&lt;/a&gt;  &lt;a href=#sf-filebeagle-1-back class=simple-footnote-back&gt;↩&lt;/a&gt;&lt;/li&gt;&lt;li id=sf-filebeagle-2&gt; &lt;a href="https://github.com/jeetsukumaran/vim-filebeagle/blob/master/README.md" class="reference external"&gt;https://github.com/jeetsukumaran/vim-filebeagle/blob/master/README.md&lt;/a&gt;
 &lt;a href=#sf-filebeagle-2-back class=simple-footnote-back&gt;↩&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;</content><category term="vim"></category></entry><entry><title>FileBeagle</title><link href="https://www.marinlagace.ca/2020/filebeagle.html" rel="alternate"></link><published>2020-05-31T19:50:00-04:00</published><updated>2020-05-31T19:50:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-05-31:/2020/filebeagle.html</id><summary type="html">&lt;p class="first last"&gt;Un excellent navigateur de répertoire pour Vim à découvrir.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;a class="reference external" href="https://www.vim.org/"&gt;Vim&lt;/a&gt; possède &lt;a class="reference external" href="https://shapeshed.com/vim-netrw/"&gt;netrw&lt;/a&gt; comme navigateur de répertoire. Il est
plutôt basique ce qui plaît à certaines personnes. D'autre le trouve trop
basique et peu intuitif. &lt;a class="reference external" href="https://tpo.pe/"&gt;Tim Pope&lt;/a&gt; a écrit &lt;a class="reference external" href="https://github.com/tpope/vim-vinegar"&gt;vinegar&lt;/a&gt; afin &amp;quot;d'améliorer &lt;span class="app"&gt;netrw&lt;/span&gt;,
partiellement comme tentative de mitiger le besoin pour des modules de style
'tiroir à projet' plutôt perturbateurs&amp;quot;
[ref] &amp;quot;enhance &lt;span class="app"&gt;netrw&lt;/span&gt;, partially in an attempt to mitigate the need for
more disruptive 'project drawer' style plugins&amp;quot;.
(&lt;a class="reference external" href="https://github.com/tpope/vim-vinegar/blob/master/README.markdown"&gt;https://github.com/tpope/vim-vinegar/blob/master/README.markdown&lt;/a&gt;) [/ref]&lt;/p&gt;
&lt;p&gt;Un navigateur de répertoire très populaire est &lt;a class="reference external" href="https://github.com/scrooloose/nerdtree"&gt;NERDTree&lt;/a&gt;. Il est très joli et comporte
&lt;a class="reference external" href="https://www.youtube.com/watch?v=CPu9mDpSYj0"&gt;beaucoup de fonctionnalités&lt;/a&gt;. Je
le trouve un peu trop lourd à mon goût par contre.&lt;/p&gt;
&lt;p&gt;Je préfère utiliser &lt;a class="reference external" href="https://github.com/jeetsukumaran/vim-filebeagle"&gt;FileBeagle&lt;/a&gt;. Il est simple et efficace.
Son créateur le décrit ainsi:&lt;/p&gt;
&lt;blockquote&gt;
&lt;span class="app"&gt;Vim&lt;/span&gt; est un éditeur de texte et non pas un système d'opération qui
peut éditer du texte. &lt;span class="app"&gt;FileBeagle&lt;/span&gt; respecte ce fait et tente de s'y
conformer autant en esprit qu'en pratique. Si vous recherchez un module
servant de gestionnaire de fichiers à même &lt;span class="app"&gt;Vim&lt;/span&gt;, &lt;span class="app"&gt;FileBeagle&lt;/span&gt;
n'est par pour vous. &lt;span class="app"&gt;FileBeagle&lt;/span&gt; ne peut copier, effacer,
déplacer/renommer ou effectuer toute autre opération sur les fichiers.
&lt;span class="app"&gt;FileBeagle&lt;/span&gt; liste et ouvre les fichiers
[ref] &amp;quot;&lt;span class="app"&gt;Vim&lt;/span&gt; is a text editor, not an operating system that can edit
text. &lt;span class="app"&gt;FileBeagle&lt;/span&gt; respects this, and attempts to conform to this both
in spirit and in practice. If you are looking for a plugin to serve as a
filesystem manager from within &lt;span class="app"&gt;Vim&lt;/span&gt;, &lt;span class="app"&gt;FileBeagle&lt;/span&gt; is not it.
&lt;span class="app"&gt;FileBeagle&lt;/span&gt; does not support copying, deleting, moving/renaming, or
any other filesystem operations. &lt;span class="app"&gt;FileBeagle&lt;/span&gt; lists and opens files&amp;quot;.
(&lt;a class="reference external" href="https://github.com/jeetsukumaran/vim-filebeagle/blob/master/README.md"&gt;https://github.com/jeetsukumaran/vim-filebeagle/blob/master/README.md&lt;/a&gt;)
[/ref]&lt;/blockquote&gt;
&lt;p&gt;La touche &lt;span class="kbd"&gt;-&lt;/span&gt; ouvre le répertoire du fichier courant dans
&lt;span class="app"&gt;FileBeagle&lt;/span&gt;. Vous pouvez utiliser les touches de navigation standard pour
vous déplacer vers un répertoire ou un fichier ou appuyer sur &lt;span class="kbd"&gt;-&lt;/span&gt; pour
remonter au répertoire parent. La touche &lt;span class="kbd"&gt;Enter&lt;/span&gt; vous amène dans le
répertoire sélectionné ou ouvre le fichier sélectionné. Il y a plusieurs autres
fonctions disponibles. Je vous laisse le soin de consulter la &lt;a class="reference external" href="https://github.com/jeetsukumaran/vim-filebeagle/blob/master/doc/filebeagle.txt"&gt;documentation du
module&lt;/a&gt;
pour plus d'information.&lt;/p&gt;
&lt;img alt="FileBeagle" class="align-center" src="https://www.marinlagace.ca/en/images/FileBeagle.gif" /&gt;
&lt;p&gt;J'aime bien que &lt;span class="app"&gt;FileBeagle&lt;/span&gt; affiche les fichiers cachés et les numéros des
lignes. Voici les variables que j'ai ajoutées à mon fichier &lt;tt class="docutils literal"&gt;.vimrc&lt;/tt&gt; afin
d'activer ces caractéristiques.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; filebeagle_show_hidden&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; filebeagle_show_line_numbers&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; filebeagle_show_line_relativenumbers&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Essayez &lt;span class="app"&gt;FileBeagle&lt;/span&gt;. Vous allez probablement l'apprécier.&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="vim"></category></entry><entry><title>Why Pelican?</title><link href="https://www.marinlagace.ca/en/2020/why-pelican.html" rel="alternate"></link><published>2020-05-27T08:50:00-04:00</published><updated>2020-05-27T08:50:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-05-27:/en/2020/why-pelican.html</id><summary type="html">&lt;p class="first last"&gt;The reasons why this website is built using the Pelican static website
generator.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;I created my first website more than twenty years ago. At that time, I wrote it
in good old &lt;a class="reference external" href="http://www.htmlhelp.com/reference/html40/structure.html"&gt;HTML4&lt;/a&gt;.
The page layout was done by using a series of non-intuitively intertwined
tables. This was before &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Cascading_Style_Sheets"&gt;CSS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I then moved on the dynamic websites like &lt;a class="reference external" href="https://wordpress.org/"&gt;Wordpress&lt;/a&gt;.
No need to write code anymore. One just need to concentrate on writing content
and the engine takes care of the rest. This was great since I did not know any
&lt;a class="reference external" href="https://en.wikipedia.org/wiki/JavaScript"&gt;JavaScript&lt;/a&gt; nor any &lt;span class="app"&gt;CSS&lt;/span&gt;.
With the gain in popularity of the platform came the security issues mainly
caused by the number of plugins available. What I found most annoying was the
difficulty to migrate the website from one server to another. Even though there
were plugins available for that, I always ended up having to go mess up with the
database. Eww!!!&lt;/p&gt;
&lt;p&gt;Then came &lt;a class="reference external" href="https://www.dokuwiki.org/dokuwiki"&gt;DokuWiki&lt;/a&gt; which is also a
dynamic website engine. The main difference with &lt;span class="app"&gt;Wordpress&lt;/span&gt; is that
&lt;span class="app"&gt;DokuWiki&lt;/span&gt; does not use a database. All its articles are saved as plain and
simple text files on the server. No more migration problem. Furthermore,
creating backups of the website is a cinch. Great!&lt;/p&gt;
&lt;p&gt;I used &lt;span class="app"&gt;DokuWiki&lt;/span&gt; for a many years until I ran across an article praising
the virtues of static websites. No databases. No &lt;a class="reference external" href="https://en.wikipedia.org/wiki/PHP"&gt;PHP&lt;/a&gt;. One only needs to write articles in some
markup language like &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Markdown"&gt;Markdown&lt;/a&gt; or
&lt;a class="reference external" href="https://en.wikipedia.org/wiki/ReStructuredText"&gt;reStructuredText&lt;/a&gt; using any
text editor. The text goes through a processor called directly on the command
line and the entire website is generated directly in some directory on the hard
drive. The whole thing just needs to be transferred to some server and presto!
Since all the webpages are static, the website is harder to hack. If something
bad was to happen, one only needs to regenerate the website and upload it again
to the server.&lt;/p&gt;
&lt;p&gt;What I like most about this is that I can use all the development tools I am
most familiar with. I write the articles in &lt;span class="app"&gt;reStructuredText&lt;/span&gt;. I use &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Vim_(text_editor)"&gt;Vim&lt;/a&gt; which is my go-to text
editor along with &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Git"&gt;Git&lt;/a&gt; to manage and
backup my articles. Everything is done on the command line. I don't need to
leave the terminal which is where I spend 90% of my time anyway. Writing an
article for my website uses the exact same workflow as I use for software
development.&lt;/p&gt;
&lt;p&gt;Finally, with the &lt;a class="reference external" href="https://www.staticgen.com/"&gt;great quantity of static website engines available&lt;/a&gt;, why choose &lt;a class="reference external" href="https://blog.getpelican.com/"&gt;Pelican&lt;/a&gt;? Simply because it is written in &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Python_(programming_language)"&gt;Python&lt;/a&gt; which is a
programming language that I use. Some of the most popular engines use
&lt;span class="app"&gt;JavaScript&lt;/span&gt;, &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Ruby_(programming_language)"&gt;Ruby&lt;/a&gt; or &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Go_(programming_language)"&gt;Go&lt;/a&gt; which are
programming languages that I don't know. Although it is not necessary to know
any programming to use these engines, it is still useful to know a little bit
about the language in which they are written in order to tweak them to our
liking.&lt;/p&gt;
&lt;p&gt;The circle is now complete. After all this time, here I am right back with good
old &lt;span class="app"&gt;HTML&lt;/span&gt; (5 rather than 4 and with a dash of &lt;span class="app"&gt;CSS&lt;/span&gt;)...&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="pelican"></category></entry><entry><title>Pourquoi Pélican?</title><link href="https://www.marinlagace.ca/2020/pourquoi-pelican.html" rel="alternate"></link><published>2020-05-27T08:50:00-04:00</published><updated>2020-05-27T08:50:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-05-27:/2020/pourquoi-pelican.html</id><summary type="html">&lt;p class="first last"&gt;Les raisons pour lesquelles Pélican a été utilisé pour générer ce site
web.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;J'ai créé mon premier site web personnel il y a plus de vingt ans. À l'époque,
je l'avais écris en bon vieux &lt;a class="reference external" href="http://www.htmlhelp.com/reference/html40/structure.html"&gt;HTML4&lt;/a&gt;. La mise en page
était faite à l'aide d'une série de tableaux imbriqués les uns dans les autres
de façon très peu intuitive. C'était avant l'avènement du &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Cascading_Style_Sheets"&gt;CSS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Je suis ensuite passé aux sites dynamiques tel que &lt;a class="reference external" href="https://wordpress.org/"&gt;Wordpress&lt;/a&gt;. Plus besoin d'écrire de code. On peut uniquement se
concentrer sur le contenu. L'engin se charge du reste. C'était génial puisque je
ne connaissait pas le &lt;a class="reference external" href="https://en.wikipedia.org/wiki/JavaScript"&gt;JavaScript&lt;/a&gt;
ni le &lt;span class="app"&gt;CSS&lt;/span&gt;. Avec la popularité de la plateforme sont venus les problèmes
de sécurité principalement causés par la multitude de modules d'extension
(plugins) disponibles. Ce qui m'irritait le plus cependant était la difficulté à
migrer le site vers un autre serveur. Bien qu'il existait des plugins pour aider
la tâche, je finissais toujours par devoir aller tripoter la base de données.
Ouach!!!&lt;/p&gt;
&lt;p&gt;Ensuite est venu &lt;a class="reference external" href="https://www.dokuwiki.org/dokuwiki"&gt;DokuWiki&lt;/a&gt; qui est
également un engin de site dynamique. La différence avec &lt;span class="app"&gt;Wordpress&lt;/span&gt; est
que &lt;span class="app"&gt;DokuWiki&lt;/span&gt; n'utilise pas de base de données pour stocker ses articles.
Tous les articles sont stockés sous la forme de simples fichiers texte sur le
serveur. Plus de problème de migration. Il suffit simplement de copier tout
l'arbre de fichiers d'un serveur à l'autre. La création de copies de sauvegarde
est en plus très simple. Génial!&lt;/p&gt;
&lt;p&gt;J'ai utilisé &lt;span class="app"&gt;DokuWiki&lt;/span&gt; pendant de nombreuses années jusqu'au moment où je
tombe par hasard sur un article vantant les vertus des sites web statiques. Pas
de base de données. Pas de &lt;a class="reference external" href="https://en.wikipedia.org/wiki/PHP"&gt;PHP&lt;/a&gt;. On écrit
les articles dans un langage de balisage (markup language) tel que le &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Markdown"&gt;Markdown&lt;/a&gt; en ou le &lt;a class="reference external" href="https://en.wikipedia.org/wiki/ReStructuredText"&gt;reStructuredText&lt;/a&gt; en utilisant l'éditeur de
texte de son choix. On passe le tout à travers un processeur appelé directement
de la ligne de commande et on retrouve la totalité de notre site web dans un
répertoire sur notre disque dur. Il suffit alors de transférer le tout sur mon
serveur et presto! Comme toutes les pages sont statiques, le site est plus
difficile à pirater. S'il venait qu'à avoir un problème et que le site soit
corrompu, je n'ai qu'à le régénérer et le transférer à nouveau sur le serveur.&lt;/p&gt;
&lt;p&gt;Ce que j'apprécie le plus cependant est que je peux utiliser tous les outils de
développement de logiciel avec lesquels je suis très familié. J'écris les
articles en &lt;span class="app"&gt;reStructuredText&lt;/span&gt;. J'utilise &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Vim_(text_editor)"&gt;Vim&lt;/a&gt; qui est mon éditeurs de
texte par excellence et &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Git"&gt;Git&lt;/a&gt; pour archiver
et gérer l'historique des articles. Tout se fait directement à partir de la
ligne de commande. Je n'ai donc pas besoin de quitter la fenêtre du terminal qui
est l'endroit où je passe 90% de mon temps. Écrire un article pour mon site web
utilise donc exactement le même processus de travail (workflow) que pour le
développement de logiciel.&lt;/p&gt;
&lt;p&gt;Finalement, avec la &lt;a class="reference external" href="https://www.staticgen.com/"&gt;multitude de générateurs de site web statique disponible&lt;/a&gt;, pourquoi avoir choisi &lt;a class="reference external" href="https://blog.getpelican.com/"&gt;Pélican&lt;/a&gt;? Tout simplement parce qu'il utilise &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Python_(programming_language)"&gt;Python&lt;/a&gt; qui est un
langage de programmation que je maîtrise. Les générateurs les plus populaires
utilisent le &lt;span class="app"&gt;JavaScript&lt;/span&gt;, le &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Ruby_(programming_language)"&gt;Ruby&lt;/a&gt; ou le &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Go_(programming_language)"&gt;Go&lt;/a&gt; qui sont tous des
langages de programmation que je ne connais pas. Bien qu'il ne soit pas
nécessaire de connaître la programmation pour utiliser ces générateurs, çà reste
utile si on a besoin de les modifier pour nos besoins.&lt;/p&gt;
&lt;p&gt;La boucle est finalement bouclée. Après tout ce temps, me revoici au bon vieux
&lt;span class="app"&gt;HTML&lt;/span&gt; (5 plutôt que 4 et avec un peu de &lt;span class="app"&gt;CSS&lt;/span&gt;)...&lt;/p&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="pelican"></category></entry><entry><title>Hello World</title><link href="https://www.marinlagace.ca/en/2020/hello-world.html" rel="alternate"></link><published>2020-05-26T01:31:00-04:00</published><updated>2020-05-26T01:31:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-05-26:/en/2020/hello-world.html</id><summary type="html">&lt;p class="first last"&gt;The traditional Hello World page.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Any respecting developer needs to first write the traditional &lt;tt class="docutils literal"&gt;Hello World&lt;/tt&gt;
app when learning a new programming language.&lt;/p&gt;
&lt;p&gt;So, here we go...&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt; &lt;span class="na"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;charset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;HTML5: Hello World&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello World!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="misc"></category></entry><entry><title>Hello World</title><link href="https://www.marinlagace.ca/2020/hello-world.html" rel="alternate"></link><published>2020-05-26T01:31:00-04:00</published><updated>2020-05-26T01:31:00-04:00</updated><author><name>Marin</name></author><id>tag:www.marinlagace.ca,2020-05-26:/2020/hello-world.html</id><summary type="html">&lt;p class="first last"&gt;La page Hello World traditionnelle.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Tout développeur qui se respecte doit débuter son apprentissage d'un nouveau
langage de programmation par l'écriture du fameux programme &lt;tt class="docutils literal"&gt;Hello World&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Alors voici...&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt; &lt;span class="na"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt; &lt;span class="na"&gt;charset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;HTML5: Hello World&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello World!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;!-- vim: ft=pelican.rst --&gt;
</content><category term="misc"></category></entry></feed>