Skip to content

Commit 3474da7

Browse files
committed
using newest latexgit_py version
1 parent 1d6ef0d commit 3474da7

File tree

5 files changed

+88
-6
lines changed

5 files changed

+88
-6
lines changed

bibliography/bibliography.bib

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,26 @@ @string { summer
1616
@string { autumn = "{\bibstring{autumn}}" }
1717
@string { winter = "{\bibstring{winter}}" }
1818
19+
20+
%% locations
21+
@string { l_cambridge_uk = "{Cambridge, England, UK}" }
22+
23+
24+
%% publishers
25+
@string { p_cambridge_uni_press_ass = "{Cambridge University Press \& Assessment}" }
26+
27+
28+
%% publisher addresses
29+
@string { pa_cambridge_uni_press_ass = l_cambridge_uk }
30+
31+
32+
%% contents
33+
@incollection{CDE2024PMOPIE,
34+
title = {programming: Meaning of \emph{programming} in English},
35+
booktitle = {Cambridge Dictionary English~({UK})},
36+
publisher = p_cambridge_uni_press_ass,
37+
address = pa_cambridge_uni_press_ass,
38+
date = {2024-06},
39+
url = {https://dictionary.cambridge.org/dictionary/english/programming},
40+
urldate = {2024-06-17}
41+
}

make.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We are working in directory: '$currentDir'
1515
scriptDir="$currentDir/scripts"
1616
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): The script directory is '$scriptDir'."
1717

18-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): First we delete all left over data."
18+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We delete all left over data."
1919
rm "book.pdf" || true
2020
rm -rf "$currentDir/website" || true
2121

22-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): First, we need to setup a virtual environment in a temp directory."
22+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We setup a virtual environment in a temp directory."
2323
tempDir="$(mktemp -d)"
2424
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Got temp dir '$tempDir', now creating environment in it."
2525
python3 -m venv "$tempDir"
2626
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Activating virtual environment in '$tempDir'."
2727
. "$tempDir/bin/activate"
28-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Initialization: We install all required Python packages from requirements.txt to virtual environment in '$tempDir'."
28+
export PYTHON_INTERPRETER="$tempDir/bin/python3"
29+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Setting python interpreter to '$PYTHON_INTERPRETER'."
30+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We install all required Python packages from requirements.txt to virtual environment in '$tempDir'."
2931
pip install --no-input --timeout 360 --retries 100 -r requirements.txt
3032
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Finished installing the requirements, now printing all installed packages."
3133
pip freeze

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# You can find it at https://thomasweise.github.io/latexgit_py,
77
# https://github.com/thomasWeise/latexgit_py, or at
88
# https://pypi.org/project/latexgit.
9-
latexgit == 0.8.12
9+
latexgit == 0.8.13
1010

1111
# minify_html is needed to minify html output.
1212
minify_html == 0.15.0

scripts/pdflatex.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We will use ${texProgram[@]} to compile th
2828
bibProgram="$(readlink -f "$(which biber)")"
2929
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We will use '$bibProgram' to process bibliography files."
3030
"$bibProgram" --version
31-
latexGitProgram=("$(readlink -f "$(which python3)")" "-m" "latexgit.aux")
31+
32+
if [[ $(declare -p PYTHON_INTERPRETER) == declare\ ?x* ]]; then
33+
echo "Found python interpreter as: '$PYTHON_INTERPRETER'"
34+
else
35+
export PYTHON_INTERPRETER="$(readlink -f "$(which python3)")"
36+
echo "Setting up python interpreter as '$PYTHON_INTERPRETER'."
37+
fi
38+
39+
latexGitProgram=("$PYTHON_INTERPRETER" "-m" "latexgit.aux")
3240
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We will use latexgit like ${latexGitProgram[@]}."
3341
${latexGitProgram[@]} --version
3442
makeIndexProgram="$(readlink -f "$(which makeindex)")"
Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,56 @@
11
\hsection{}%
22
\hsection{Introduction}%
33
%
4-
This is work in progress.
4+
In this book, we want to learn \emph{program}.
5+
Programming is often described as \emph{the activity or job of writing computer programs}~\cite{CDE2024PMOPIE}.
6+
However, this is only \emph{one} aspect of it.
7+
Actually, in the real world, the act of programming is not just the activity of writing some code.
8+
Imagine the following scenario:
9+
10+
A person, say your future boss, comes to you and says:
11+
\inQuotes{Write a program that solves this task here.}
12+
Then you write the program and give here the text file.
13+
Everybody is happy, the problem is solved.
14+
15+
Sounds kind of unrealistically, right?
16+
You get a task and just write the program that solves it.
17+
Is it that easy?
18+
Well, OK, you can reasonably expect that you learn how to do that in this course.
19+
We will teach you \texttt{Python} programming.
20+
So you expect to learn how to translate some kind of specification into code.
21+
Fine.
22+
23+
But how does your boss know that the program you give her will do the job?
24+
And that it will do so reliably?
25+
What sort of confidence can she have into the assumption that you won't be making any errors?
26+
27+
And what if your program is not just a single-use, stand-alone kind of program?
28+
What if it is part of some sort of software ecosystem?
29+
What if other programs need to use/run it?
30+
Maybe it can access some sort of sensor measuring something, or maybe it can convert data from one file format to another one.
31+
Then, other programmers may need to be able to at least understand how to correctly run the program and what kind of input and output data it will expect or produce, respectively.
32+
33+
What if this program is going to be needed for the next ten or so years?
34+
Maybe it could be necessary to add new functionality?
35+
Maybe some of the libraries you use get outdated and need to be replaced?
36+
There are several reasonable situations in which a totally different person may need to work, read, modify, and improve \emph{your} code.
37+
38+
Or maybe you are a researcher, using \texttt{Python} to implement some algorithm and to run an experiment.
39+
In order to make your experiments and results replicable, you would probably want to publish your algorithm implementation together with the results.
40+
This only makes sense if your code is at least a bit readable.
41+
42+
All of these things need to be considered when we learn how to program.
43+
And in typical courses, they are not.
44+
In a typical course, you learn how to write a small program that solves a certain task.
45+
The task is usually simple, so the teachers are able to read your code even if you have ugliest style imaginable.
46+
Also, nobody is ever going to look at or use the programs you write as your homework again.
47+
So one of the above really matters.
48+
But in reality, things are not always simple.
49+
50+
One may hope that, as one of the very first things, surgery students in medical school are taught to wash their hands before performing surgery.
51+
Hence, we will teach you how to write clean, well-documented, and properly tested programs.
52+
Right from the start.
53+
Such that all of your code will be reusable, readable, clear, clean, and beautiful.%
554
%
655
\endhsection\endhsection%
756
%

0 commit comments

Comments
 (0)