Browse Source

add build manifest, fix build

master
zapashcanon 4 years ago
parent
commit
0c6e3e5bfd
Signed by: zapashcanon GPG Key ID: 8981C3C62D1D28F1
  1. 22
      .build.yml
  2. 14
      .gitignore
  3. 2
      Makefile
  4. 1
      README.md
  5. 13
      scripts/build.sh
  6. 5
      scripts/clean.sh
  7. 5
      scripts/test.sh
  8. 10
      src/about_verification.tex
  9. 6
      src/appendix.tex
  10. 27
      src/internship-report-datacert.tex
  11. 28
      src/main.tex
  12. 57
      src/packages.tex
  13. 2
      src/title.tex
  14. 4
      src/work.tex

22
.build.yml

@ -0,0 +1,22 @@
image: debian/unstable
packages:
- curl
- fonts-linuxlibertine
- python3-pygments
- texlive-extra-utils
- texlive-fonts-extra
- texlive-lang-french
- texlive-xetex
- unzip
sources:
- https://git.zapashcanon.fr/zapashcanon/internship-report-datacert
tasks:
- setup: |
curl https://www.evertype.com/emono/evermono.zip --output evermono.zip
unzip evermono.zip
sudo cp evermono-7.0.0/Everson\ Mono.ttf /usr/share/fonts/
sudo fc-cache
- build: |
cd internship-report-datacert
make
ls main.pdf

14
.gitignore

@ -0,0 +1,14 @@
*.pdf
*.bbl
*.bcf
*.blg
*.log
*.run.xml
*.aux
*.out
*.cmi
*.cmx
*.toc
*.o
src/svg-inkscape/
*.dot.svg

2
Makefile

@ -1,4 +1,4 @@
default: build clean
default: build
build:
scripts/build.sh

1
README.md

@ -0,0 +1 @@
# Internship Report Datacert [![builds.sr.ht status](https://builds.sr.ht/~zapashcanon/internship-report-datacert.svg)](https://builds.sr.ht/~zapashcanon/internship-report-datacert?)

13
scripts/build.sh

@ -2,9 +2,12 @@
set -eu
( cd "$(dirname "$0")"/../
( cd "$(dirname "$0")"/../src
xelatex -shell-escape src/internship-report-datacert.tex
xelatex -shell-escape src/internship-report-datacert.tex
xelatex -shell-escape src/internship-report-datacert.tex
)
c="texfot xelatex -shell-escape -halt-on-error"
$c main.tex | sed '/Output written/d' | sed '/Rerun to get \/Page/d' | sed '/Warning: Citation/d' | sed '/Warning: Empty bib/d' | sed '/has changed/d' | sed '/Warning: There were/d' | sed '/biblatex Warning/d'
$c main.tex | sed '/Output written/d' | sed '/Warning: There were/d' | sed '/biblatex Warning/d'
$c main.tex
mv main.pdf ../main.pdf
) | sed '/This is/d' | sed '/texfot: invoking/d'

5
scripts/clean.sh

@ -2,8 +2,9 @@
set -eu
( cd "$(dirname "$0")"/../
( cd "$(dirname "$0")"/../src/
rm -f ./*.log ./*.tuc ./*.out ./*.aux ./*.toc ./*.pyg
rm -f ./*.log ./*.tuc ./*.out ./*.aux ./*.toc ./*.pyg ./*.bbl ./*.bcf ./*.blg ./*.run.xml
rm -rf ./svg-inkscape/
)

5
scripts/test.sh

@ -8,8 +8,9 @@ set -eu
# Testing scripts
# shellcheck disable=SC2185
find -O3 . -type f -name '*.sh' -exec shellcheck {} \;
cd src/
# shellcheck disable=SC2185
find -O3 . -type f -name '*.tex' -exec chktex -q --nowarn 26 --nowarn 15 --nowarn 17 {} \;
## shellcheck disable=SC2185
# find -O3 . -type f -name '*.tex' -exec lacheck {} \; # TODO: fix lacheck so it's possible to disable some warnings which are incorrects...
# shellcheck disable=SC2185
find -O3 . -type f -name '*.tex' -exec lacheck {} \; # TODO: fix lacheck so it's possible to disable some warnings which are incorrects...
)

10
src/about_verification.tex

@ -16,25 +16,25 @@ Cependant, avec cette méthode, si l'on oublie un cas particulier dans nos tests
\inputminted[bgcolor=darkBackground]
{ocaml}
{src/max_in_list.ml}
{max_in_list.ml}
Supposons que l'on ait écrit les tests suivants pour notre algorithme:
\inputminted[bgcolor=darkBackground]
{ocaml}
{src/test_max_in_list.ml}
{test_max_in_list.ml}
Notre algorithme ne va échouer sur aucun des tests et l'on pourrait alors croire qu'il est correct. Ce n'est bien évidemment pas le cas. Si notre liste n'est composée que de nombres entiers négatifs, l'algorithme renverra $0$ dans tous les cas\textellipsis\ Le test suivant aurait pu détecter cela:
\inputminted[bgcolor=darkBackground]
{ocaml}
{src/test_max_in_list_bis.ml}
{test_max_in_list_bis.ml}
Une version correcte de l'algorithme serait:
\inputminted[bgcolor=darkBackground]
{ocaml}
{src/max_in_list_correct.ml}
{max_in_list_correct.ml}
On voit bien alors une des faiblesses des tests: on ne peut jamais être certain d'avoir pensé à tous les cas et on ne peut généralement pas tous les tester lorsqu'il y en a une infinité ou qu'ils sont trop nombreux.
@ -52,7 +52,7 @@ Cependant, si on y regarde de plus près, on s'aperçoit que le programme suivan
\inputminted[bgcolor=darkBackground]
{ocaml}
{src/max_in_list_plus_one.ml}
{max_in_list_plus_one.ml}
Ici, le problème n'est donc plus celui des cas particuliers, mais celui de la spécification : ici, on a oublié de préciser que la valeur renvoyée par notre fonction doit être présente dans la liste. Cela pourrait s'exprimer ainsi:

6
src/appendix.tex

@ -2,16 +2,16 @@
\inputminted[bgcolor=darkBackground]
{sql}
{src/query_14.sql}
{query_14.sql}
\inputminted[bgcolor=darkBackground]
{xml}
{src/query_14.xml}
{query_14.xml}
{\setmonofont{Everson Mono}
\inputminted[bgcolor=darkBackground]
{ocaml}
{src/query_14.extalg}
{query_14.extalg}
}
La ligne $27$ indique un \emph{Seq Scan} sur la relation \emph{reserves}, si l'on enlève l'indication de l'algorithme utilisé, cela revient à simplement parler de la relation \emph{reserves}. Sur les lignes $22$ à $29$, on utilise $\omega$ sur cette relation avec des paramètres particuliers. La ligne $23$ nous indique qu'il n'y a aucune partition, ce qui se note \emph{Fine}. La ligne $24$ nous indique qu'on va sélectionner les attributs \emph{sid}, \emph{bid} et \emph{dday} de la relation, et qu'on les renomme respectivement en \emph{r.sid}, \emph{r.bid} et \emph{r.dday}. La ligne $25$ indique quant à elle que l'on va filtrer le résultat en ne gardant que les lignes respectant la condition $bid = 103$. L'écriture mathématique de cette expression, en faisant abstraction des variables notées $x_i$, serait la suivante:

27
src/internship-report-datacert.tex

@ -1,27 +0,0 @@
\documentclass[a4paper,11pt]{article}
\input{src/packages.tex}
\begin{document}
\input{src/title.tex}
\maketitle
\input{src/abstract.tex}
\tableofcontents
\input{src/lri.tex}
\input{src/about_verification.tex}
\input{src/work.tex}
\input{src/lesson.tex}
\appendix
\input{src/appendix.tex}
\end{document}

28
src/main.tex

@ -0,0 +1,28 @@
\documentclass[a4paper,11pt]{article}
\input{packages.tex}
\begin{document}
\input{title.tex}
\maketitle
\input{abstract.tex}
\tableofcontents
\input{lri.tex}
\input{about_verification.tex}
\input{work.tex}
\input{lesson.tex}
\newpage
\appendix
\input{appendix.tex}
\end{document}

57
src/packages.tex

@ -1,13 +1,7 @@
\usepackage[english,french]{babel} % french typo
\frenchbsetup{StandardLists=true} % avoid conflict between frenchbabel and enumitem
\usepackage[french]{babel}
\usepackage{euler}
\usepackage{fontspec} % encoding
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
\setmonofont{Source Code Pro}
\newfontfamily\unicodemonofont{Everson Mono}
\usepackage{graphicx} % to include img
\usepackage{enumitem} % powerful lists
@ -17,34 +11,47 @@
\usepackage{amssymb} % more maths
\usepackage{dsfont} % and even more maths
\usepackage{color} % color power
\usepackage[dvipsnames]{xcolor} % more color power
\definecolor{darkBackground}{HTML}{282c34} % source code background
\definecolor{darkBackgroundHighlight}{HTML}{2c323c} % source code background
\definecolor{lightBackground}{HTML}{D7D3CB} % source code background
\usepackage[dvipsnames, table]{xcolor} % more color power
\usepackage{microtype} % better typo
\usepackage{hyperref} % internal and external links (e.g. mail, www)
\usepackage{cleveref}
\usepackage[cache=false, draft=false]{minted} % source code
\usepackage{placeins} % float displaying
\usepackage{csquotes}
\usepackage{ellipsis} % correct ...
\usepackage[notransparent]{svg}
\usepackage{calligra}
\usepackage[bottom]{footmisc}
\usepackage{wrapfig}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
%\setmonofont{Source Code Pro}
%\newfontfamily\unicodemonofont{Everson Mono}
\newcommand\myshade{85}
\colorlet{mylinkcolor}{violet}
\colorlet{mycitecolor}{YellowOrange}
\colorlet{myurlcolor}{Aquamarine}
\usepackage[cache=false, draft=false]{minted} % source code
\usemintedstyle{paraiso-dark}
\setminted{bgcolor=lightBackground}
\setminted{linenos, autogobble, breaklines, breakanywhere, breakautoindent, fontseries=m, fontsize=\fontsize{9pt}{7pt}, frame=none, stepnumber=2}
\usemintedstyle{paraiso-dark}
\setminted{bgcolor=lightBackground}
\setminted{linenos, autogobble, breaklines, breakanywhere, breakautoindent, fontseries=m, fontsize=\fontsize{12pt}{12pt}, frame=none, stepnumber=2}
\usepackage{placeins} % float displaying
\usepackage{tikz} % .tex figures (e.g. from Dia)
\hypersetup{
linkcolor = mylinkcolor!\myshade!black,
citecolor = mycitecolor!\myshade!black,
urlcolor = myurlcolor!\myshade!black,
colorlinks = true,
pdfstartview=FitH
\hypersetup{linkcolor = mylinkcolor!\myshade!black,
citecolor = mycitecolor!\myshade!black,
urlcolor = myurlcolor!\myshade!black,
colorlinks = true,
pdfstartview=FitH
}
\usepackage{ellipsis} % correct ...
\graphicspath{{./../img/}}
\definecolor{darkBackground}{HTML}{282c34} % source code background
\definecolor{darkBackgroundHighlight}{HTML}{2c323c} % source code background
\definecolor{lightBackground}{HTML}{D7D3CB} % source code background
\definecolor{processblue}{cmyk}{0.96,0,0,0}

2
src/title.tex

@ -4,4 +4,4 @@
\author{\href{mailto:leo@ndrs.fr}{Léo \bsc{Andrès}}}
\date{\today}
\date{28 août 2017}

4
src/work.tex

@ -19,13 +19,13 @@ Interviennent alors les \emph{plans d'exécution}. En effet, \bsc{sql} étant un
\inputminted[bgcolor=darkBackground]
{sql}
{src/movie_01.sql}
{movie_01.sql}
On pourrait obtenir un plan comme celui-ci:
\inputminted[bgcolor=darkBackground]
{xml}
{src/movie_01.xml}
{movie_01.xml}
Cependant, il n'existe pas de standard portant sur les plans d'exécution, les \bsc{sgbd} les présentent de façon différente, utilisent leurs propres algorithmes, utilisent un nom différent pour un même algorithme, ne donnent pas la même quantité d'informations etc.

Loading…
Cancel
Save