Skip to content

Commit 27fe20d

Browse files
authored
[WIP] Cheatsheets for CM1025 Fundamentals of Computer Science (#23)
Fantastic! Thanks a lot for sharing all this knowledge with us in a useful format like this!
1 parent cd1ac5d commit 27fe20d

19 files changed

+1257
-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+
* [(First-order) Predicate & Propositional Logic](./cheatsheet_predicate_propositional_logic.pdf)
11+
* [Proofs](./cheatsheet_proofs.pdf)
12+
* [Permutations & Combinatorics](/level-4/computational-mathematics/student-notes/fabio-lama/cheatsheet_probability_combinatorics.pdf)
13+
* (covered in the Authors _Computational Mathematics_ module notes).
14+
* [Automata Theory](./cheatsheet_automata_theory.pdf)
15+
* [Formal Languages & Regular Expressions](./cheatsheet_formal_languages_regular_expressions.pdf)
16+
* [Context-Free Languages](./cheatsheet_context_free_languages.pdf)
17+
* [Turing Machines](./cheatsheet_turing_machines.pdf)
18+
* [Recursion](./cheatsheet_recursion.pdf)
19+
* NOTE: some topics discussed in the _Algorithms I/II_ weeks were
20+
skipped given that those were somewhat redundant with the _Algorithms and
21+
Data Structures I_ module. Some of the algorithms are worth it to be studied
22+
independently, however, such as the Gale-Shapely algorithm for stable
23+
matching, etc.
24+
* NOTE: Complexity theory is not covered by the cheatsheets.
25+
26+
# Building
27+
28+
_NOTE_: This step is only necessary if you chose to modify the base documents.
29+
30+
The base documents are written in [AsciiDoc](https://asciidoc.org/) and can be
31+
found in the `src/` directory.
32+
33+
The following dependencies must be installed (Ubuntu):
34+
35+
```console
36+
$ apt install -y ruby-dev wkhtmltopdf
37+
$ gem install asciidoctor
38+
$ chmod +x build.sh
39+
```
40+
41+
To build the documents (PDF version):
42+
43+
```console
44+
$ ./build.sh pdf
45+
```
46+
47+
Optionally, for the HTML version:
48+
49+
```console
50+
$ ./build.sh html
51+
```
52+
53+
and for the PNG version:
54+
55+
```console
56+
$ ./build.sh png
57+
```
58+
59+
The generated output can be deleted with `./build.sh clean`.
60+
61+
# Disclaimer
62+
63+
The Presented Documents ("cheatsheets") by the Author ("Fabio Lama") are
64+
summaries of specific topics. The term "cheatsheet" implies that the Presented
65+
Documents are intended to be used as learning aids or as references for
66+
practicing and does not imply that the Presented Documents should be used for
67+
inappropriate practices during exams such as cheating or other offenses.
68+
69+
The Presented Documents are heavily based on the learning material provided by
70+
the University of London, respectively the VLeBooks Collection database in the
71+
Online Library.
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.
105 KB
Loading

0 commit comments

Comments
 (0)