Skip to content

Commit 04fd9e7

Browse files
authored
Cheatsheets for CM1015 Computational Mathematics (#18)
1 parent b16d89d commit 04fd9e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1812
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# About
2+
3+
Listed here is a collection of cheatsheet by topic. Those cheatsheets do not
4+
explain the topics in depth, but rather serve as quick lookup documents.
5+
Therefore, the course material provided by the lecturer should still be studied
6+
and understood. Not everything that is tested at the mid-terms or final exams is
7+
covered and the Author does not guarantee that the cheatsheets are free of
8+
errors.
9+
10+
* [Number bases](./cheatsheet_number_bases.pdf)
11+
* [Sequences and Series](./cheatsheet_sequence_series.pdf)
12+
* [Modular Arithmetic](./cheatsheet_modular_arithmetic.pdf)
13+
* [Trigonometry](./cheatsheet_trigonometry.pdf)
14+
* [Graphs of Functions & Kinematics](./cheatsheet_graphs_functions_kinematics.pdf)
15+
* [Trigonometrical Functions & Identities](./cheatsheet_trigonometrical_functions_identities.pdf)
16+
* [Exponential & Logarithm Functions](./cheatsheet_exponential_logarithm_funcions.pdf)
17+
* [Gradients of Curves & Differentiation](./cheatsheet_gradients_curves_differentiation.pdf)
18+
* [Vectors](./cheatsheet_vectors.pdf)
19+
* [Matrices](./cheatsheet_matrices.pdf)
20+
* [Statistics](./cheatsheet_statistics.pdf)
21+
* [Probability & Combinatorics](./cheatsheet_probability_combinatorics.pdf)
22+
23+
# Building
24+
25+
_NOTE_: This step is only necessary if you chose to modify the base docments.
26+
27+
The base documents are written in [AsciiDoc](https://asciidoc.org/) and can be
28+
found in the `src/` directory.
29+
30+
The following dependencies must be installed (Ubuntu):
31+
32+
```console
33+
$ apt install -y ruby-dev wkhtmltopdf
34+
$ gem install asciidoctor
35+
$ chmod +x build.sh
36+
```
37+
38+
To build the documents (PDF version):
39+
40+
```console
41+
$ ./build.sh pdf
42+
```
43+
44+
Optionally, for the HTML version:
45+
46+
```console
47+
$ ./build.sh html
48+
```
49+
50+
and for the PNG version:
51+
52+
```console
53+
$ ./build.sh png
54+
```
55+
56+
The generated output can be deleted with `./build.sh clean`.
57+
58+
# Disclaimer
59+
60+
The Presented Documents ("cheatsheets") by the Author ("Fabio Lama") are
61+
summaries of specific topics. The term "cheatsheet" implies that the Presented
62+
Documents are intended to be used as learning aids or as references for
63+
practicing and does not imply that the Presented Documents should be used for
64+
inappropriate practices during exams such as cheating or other offences.
65+
66+
The Presented Documents are heavily based on the learning material provided by
67+
the University of London, respectively the VLeBooks Collection database in the
68+
Online Library, especially on the books:
69+
70+
* _Foundation maths (Harlow: Pearson, 2016) 6th edition by Croft, A. and R. Davison_
71+
* _Precalculus with Limits (January 1, 2017) 4th edition by Ron Larson_
72+
73+
The Presented Documents may incorporate direct or indirect definitions,
74+
examples, descriptions, graphs, sentences and/or other content used in those
75+
provided materials. **At no point does the Author present the work or ideas
76+
incorporated in the Presented Documents as their own.**
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/bin/bash
2+
3+
# Because `make` sucks.
4+
5+
gen_html() {
6+
# Remove suffix and prefix
7+
FILE=$1
8+
OUT=${FILE%.adoc}
9+
HTML_OUT="cheatsheet_${OUT}.html"
10+
11+
asciidoctor $FILE -o ${HTML_OUT}
12+
}
13+
14+
# Change directory to src/ in order to have images included correctly.
15+
cd "$(dirname "$0")/src/"
16+
17+
case $1 in
18+
html)
19+
for FILE in *.adoc
20+
do
21+
# Generate HTML file.
22+
gen_html ${FILE}
23+
done
24+
25+
# Move up from src/
26+
mv *.html ../
27+
;;
28+
pdf)
29+
for FILE in *.adoc
30+
do
31+
# Generate HTML file.
32+
gen_html ${FILE}
33+
34+
# Convert HTML to PNG.
35+
PDF_OUT="cheatsheet_${OUT}.pdf"
36+
wkhtmltopdf \
37+
--enable-local-file-access \
38+
--javascript-delay 2000\
39+
$HTML_OUT $PDF_OUT
40+
done
41+
42+
# Move up from src/
43+
mv *.pdf ../
44+
45+
# Cleanup temporarily generated HTML files.
46+
rm *.html > /dev/null 2>&1
47+
;;
48+
png | img)
49+
for FILE in *.adoc
50+
do
51+
# Generate HTML file.
52+
gen_html ${FILE}
53+
54+
# Convert HTML to PNG.
55+
IMG_OUT="cheatsheet_${OUT}.png"
56+
wkhtmltopdf \
57+
--enable-local-file-access \
58+
--javascript-delay 2000\
59+
$HTML_OUT $IMG_OUT
60+
done
61+
62+
# Move up from src/
63+
mv *.png ../
64+
65+
# Cleanup temporarily generated HTML files.
66+
rm *.html > /dev/null 2>&1
67+
;;
68+
clean)
69+
rm *.html > /dev/null 2>&1
70+
rm *.png > /dev/null 2>&1
71+
rm ../*.html > /dev/null 2>&1
72+
rm ../*.png > /dev/null 2>&1
73+
;;
74+
*)
75+
echo "Unrecognized command"
76+
;;
77+
esac
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)