diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..ff99c90 --- /dev/null +++ b/.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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f70edf4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +*.pdf +*.bbl +*.bcf +*.blg +*.log +*.run.xml +*.aux +*.out +*.cmi +*.cmx +*.toc +*.o +src/svg-inkscape/ +*.dot.svg diff --git a/Makefile b/Makefile index 0f9ff9b..8a1d2bc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -default: build clean +default: build build: scripts/build.sh diff --git a/README.md b/README.md index e69de29..36d3342 100644 --- a/README.md +++ b/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?) diff --git a/scripts/build.sh b/scripts/build.sh index 8e2f5fd..cbe32fd 100755 --- a/scripts/build.sh +++ b/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' diff --git a/scripts/clean.sh b/scripts/clean.sh index 30a569f..ed9113f 100755 --- a/scripts/clean.sh +++ b/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/ ) diff --git a/scripts/test.sh b/scripts/test.sh index c8dd5fe..d4b90b7 100755 --- a/scripts/test.sh +++ b/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... ) diff --git a/src/about_verification.tex b/src/about_verification.tex index 669dcf3..fa5c9bc 100644 --- a/src/about_verification.tex +++ b/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: diff --git a/src/appendix.tex b/src/appendix.tex index f060411..188ce57 100644 --- a/src/appendix.tex +++ b/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: diff --git a/src/internship-report-datacert.tex b/src/internship-report-datacert.tex deleted file mode 100644 index 30bd9a7..0000000 --- a/src/internship-report-datacert.tex +++ /dev/null @@ -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} diff --git a/src/main.tex b/src/main.tex new file mode 100644 index 0000000..a6da8a3 --- /dev/null +++ b/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} diff --git a/src/packages.tex b/src/packages.tex index 20eab79..bbb37e4 100644 --- a/src/packages.tex +++ b/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} diff --git a/src/title.tex b/src/title.tex index d685941..885a5be 100644 --- a/src/title.tex +++ b/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} diff --git a/src/work.tex b/src/work.tex index e4c6b62..a6ba52f 100644 --- a/src/work.tex +++ b/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.