23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/code/databases/sample-data.sql:
--------------------------------------------------------------------------------
1 | -- to be run as root
2 |
3 | -- create the default user 'vagrant' so 'mysql' on its own works
4 | CREATE USER 'vagrant'@'localhost';
5 | -- database for people to play around with
6 | CREATE DATABASE data;
7 | GRANT ALL ON data.* to 'vagrant'@'localhost';
8 | -- sample data, these are read-only by default to prevent accidents
9 | CREATE DATABASE census;
10 | GRANT SELECT ON census.* to 'vagrant'@'localhost';
11 | CREATE DATABASE elections;
12 | GRANT SELECT ON elections.* to 'vagrant'@'localhost';
13 |
14 | FLUSH PRIVILEGES;
15 |
16 | -- load the data
17 | USE census;
18 | source /vagrant/sampledata/census/setup.sql;
19 | source /vagrant/sampledata/census/import.sql;
20 | USE elections;
21 | source /vagrant/sampledata/elections/setup.sql;
22 | source /vagrant/sampledata/elections/import.sql;
23 |
24 |
--------------------------------------------------------------------------------
/code/databases/secure-setup.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Does the equivalent of mysql_secure_installation, but doesn't prompt
3 | the user each time. This lets us run the script as part of vagrant setup.
4 | */
5 |
6 | UPDATE mysql.user SET Password=PASSWORD('BA/458cR-5p.') WHERE User='root';
7 | DELETE FROM mysql.user WHERE User='';
8 | DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
9 | DROP DATABASE IF EXISTS test;
10 | DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';
11 | FLUSH PRIVILEGES;
12 |
--------------------------------------------------------------------------------
/code/debugging/stackcalc.txt:
--------------------------------------------------------------------------------
1 | Stack Calculator Documentation
2 |
3 | This program implements a simple RPN/stack calculator. You can use the digits 0-9 and the
4 | four operators "+-*/". You can use spaces between numbers and operators, and you must use
5 | spaces to separate numbers e.g. "12" is the number 12 but "1 2" is the number 1 followed
6 | by the number 2. The strings "1 2+" and "1 2 +" and any variation on these that adds more
7 | spaces have exactly the same effect.
8 |
9 | The program reads tokens (numbers or operators) from left to right and
10 | - for every number read, pushes it onto the stack
11 | - for every operator read, pops two values off the stack, operates on them and pushes
12 | the result back on the stack.
13 | An expression is valid if, at the end of evaluating, there is exactly one value on the
14 | stack and there was never an operator encountered while there were fewer than two values
15 | on the stack.
16 |
17 | Terminate the program by closing standard input (e.g. Control+D on a fresh line on the
18 | terminal.)
19 |
20 | Compile with "-lreadline". You might need to "sudo apt-get install libreadline-dev" first.
21 |
22 | For example,
23 |
24 | "1 2 +" -> 3.0000 (all output and calcuations are done on doubles).
25 | "1 2 + 4 *" -> 12.0000 (this is (1+2)*4, note how RPN never needs brackets).
26 | "1" -> 1.0000 (a number on its own just evaluates to itself).
27 | "01" -> 1.0000 (leading zeroes are ignored).
28 |
29 | Errors
30 |
31 | If the stack limit of 10 is exceeded, you get "Error, stack full".
32 |
33 | "1 2 3 4 5 6 7 8 9 0 1" -> Error
34 |
35 | If you put an operator when there are fewer than two values on the stack, you get the
36 | message "Error, operator on empty stack."
37 |
38 | "+ 1" -> Error
39 | "1 + 1" -> Error
40 | "1 1 +" -> 2.0000 (not an error)
41 | "1 +" -> Error
42 | "1 2 + 3 -" -> 0.0000 (not an error)
43 | "1 2 + - 3" -> Error (the minus appears when there is only one value on the stack)
44 |
45 | Any character other than the ones specified above is an error. Note that we don't
46 | need to handle newlines, because readline() strips them for us, and we stop on
47 | reaching the end of the string.
48 |
49 | If there is no value or more than one value on the stack at the end of the line,
50 | you get "Error, expected exactly one value but got #." where # is the number of
51 | values on the stack at the end.
52 |
53 | "" -> Error
54 | "1 2" -> Error
55 | "1" -> 1.0000 (not an error, although not particularly insightful either)
56 | "1 2 + 3" -> Error
57 |
58 | Division by zero produces an inf or -inf double value, inf/inf or 0/0 produces NaN.
59 | These are not errors as far as the program is concerned.
60 |
--------------------------------------------------------------------------------
/code/javascript/Trees.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | /* Loads the first argument as a file, removes all punctuation,
4 | and computes the frequency of each word. */
5 | let ws = null;
6 | fs.readFile(process.argv[2], 'utf8', function (err, data) {
7 | if (err) {
8 | return console.log("error: " + err);
9 | }
10 | const punct = /[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/g;
11 | ws = data.replace(punct, '').trim().split(/\s+/);
12 | });
13 |
14 | count(ws);
15 |
16 | function count(words) {
17 |
18 | function insert(w, t) {
19 | if (t === null) { t = { word : w, count : 1, left : null, right : null }; }
20 | else if (w === t.word) { t.count += 1; }
21 | else if (w < t.word) { t.left = insert(w, t.left); }
22 | else { t.right = insert(w, t.right); }
23 | return t;
24 | }
25 |
26 | function flatten(t) {
27 | if (t === null) { return []; }
28 | else {
29 | return [...flatten(t.left), {"word" : t.word, "count" : t.count}, ...flatten(t.right)];
30 | }
31 | }
32 |
33 | let root = null;
34 | words.forEach(w => { root = insert(w, root); });
35 | const results = flatten(root);
36 | console.log(results);
37 | }
--------------------------------------------------------------------------------
/code/javascript/bristol-app/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | The City of Bristol
6 |
7 |
8 |
9 |
10 |
11 |
The City of Bristol
12 |
15 |
16 |
Please select one of the wards on the left to view more data about it.
CSS conference is a place where you can learn all about modern web design with CSS. You will learn all about responsive design, frameworks, tips and tricks and practical examples from the designers of real websites.
CSS conference is a place where you can learn all about modern web design with CSS. You will learn all about responsive design, frameworks, tips and tricks and practical examples from the designers of real websites.
", ""]
18 |
19 | def process(item):
20 | """
21 | The item has a ['content'] field with the page text.
22 | Process this.
23 | """
24 | content = item['content']
25 | lines = content.split('\n')
26 | out = []
27 | block = False
28 | for line in lines:
29 | if block is False:
30 | if (m := re.match("\|\|\|([a-z]+)", line)) is not None:
31 | begin_block(out, m.group(1))
32 | block = True
33 | else:
34 | out.append(line)
35 | else:
36 | if re.match("\|\|\|", line) is not None:
37 | end_block(out)
38 | block = False
39 | else:
40 | out.append(line)
41 | item['content'] = "\n".join(out)
42 |
43 | context, book = json.load(sys.stdin)
44 |
45 | #log = open("preprocessor.log", "a")
46 |
47 | sections = book['sections']
48 | for section in sections:
49 | #log.write("SECTION\n")
50 | #for k in section:
51 | # log.write(f" {k}\n")
52 |
53 | if 'Chapter' in section:
54 | process(section['Chapter'])
55 | for subitem in section['Chapter']['sub_items']:
56 | process(subitem['Chapter'])
57 |
58 | #log.close()
59 |
60 | #with open("log", "w") as log:
61 | # json.dump(book, log)
62 | json.dump(book, sys.stdout)
63 |
--------------------------------------------------------------------------------
/exercises/part1/src/SUMMARY.md:
--------------------------------------------------------------------------------
1 | # Exercises
2 |
3 | [Overview](./overview.md)
4 |
5 | # Week 1: POSIX Systems
6 | - [System Administration](./posix1/index.md)
7 | - [Secure shell](./posix1/ssh.md)
8 | - [Installing Vagrant and Debian](./posix1/install.md)
9 | - [Debian system administration](./posix1/admin.md)
10 | - [The POSIX Shell](./posix2/index.md)
11 | - [Shell expansion](./posix2/shell.md)
12 | - [Pipes](./posix2/pipes.md)
13 | - [Regular expressions](./posix2/regex.md)
14 |
15 | # Week 2: Version Control
16 | - [Git](./git/index.md)
17 | - [Git](./git/git.md)
18 |
19 | # Week 3: Shell Scripting & Build Tools
20 | - [Shell Scripting](./posix3/index.md)
21 | - [File permissions](./posix3/permissions.md)
22 | - [Shell scripting](./posix3/script.md)
23 | - [Build Tools](./build2/index.md)
24 | - [C](./build2/c.md)
25 | - [Python](./build2/python.md)
26 | - [Java](./build2/java.md)
27 | - [Spring](./build2/spring.md)
28 |
29 | # Week 4: Debugging
30 | - [Debugging](./build1/index.md)
31 | - [Exercise](./build1/exercise.md)
32 | - [Bonus POSIX (unassessed)](./posix4/index.md)
33 | - [inodes and system calls](./posix4/stat.md)
34 | - [Concurrent programming in POSIX](./posix4/concurrent.md)
35 | - [Pipes in C](./posix4/cpipe.md)
36 | - [Input/Output in C](./posix4/c_io.md)
37 | - [Input/Output in POSIX](./posix4/posix_io.md)
38 | - [The final challenge](./posix4/final.md)
39 |
40 | # Week 5: Databases
41 | - [SQL introduction](./db1/sql-introduction.md)
42 | - [Set up the database](./db1/setup.md)
43 | - [ER diagram](./db1/er-diagram.md)
44 | - [More modelling](./db1/er2.md)
45 | - [Explore the database](./db2/explore-database.md)
46 | - [Bristol elections](./db2/elections.md)
47 | - [The UK census](./db2/census.md)
48 | - [Normal forms](./db2/normalforms.md)
49 | - [Intermediate SQL](./db3/sql-intermediate.md)
50 | - [Exercises](./db3/exercises.md)
51 | - [SQL and Java](./db4/sql-java.md)
52 | - [JDBC](./db4/jdbc.md)
53 | - [Hibernate](./db4/hibernate.md)
54 | - [SQLite](./db4/sqlite.md)
55 |
--------------------------------------------------------------------------------
/exercises/part1/src/build1/exercise.md:
--------------------------------------------------------------------------------
1 | # Debugging exercise
2 |
3 | Clone the repository `git@github.com:cs-uob/COMSM0085` if you have not done so already and open the folder `code/debugging`.
4 |
5 | There is a program `stackcalc.c` that attempts to implement the specification in `stackcalc.txt` for a Reverse Polish Notation calculator, but it does not work correctly. For example, `1 2 +` should produce `3.0000` but produces `Error, operator on empty stack`. (Read the notes in the text file about how to compile the program with the required library.)
6 |
7 | Your exercise is to debug and fix the program, making as few changes to the general structure as possible (so don't just rewrite the whole thing from scratch).
8 |
--------------------------------------------------------------------------------
/exercises/part1/src/build1/index.md:
--------------------------------------------------------------------------------
1 | # Build Tools 1
2 |
3 | ## Videos
4 |
5 | | Video | Length | Slides |
6 | |-------|-------:|--------|
7 | | [Debugging](https://web.microsoftstream.com/video/10926ab8-e10e-43b4-b486-495ce9f775c2)| 34 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EX0-s0boltxDq0oNPgudC40BsWc1PnK6pEWXJuRabPQnHA?e=ccd8Gh) |
8 |
9 | ## Exercise
10 |
11 | - [Debugging exercise](./exercise.md)
12 |
--------------------------------------------------------------------------------
/exercises/part1/src/build2/index.md:
--------------------------------------------------------------------------------
1 | # Build Tools 2
2 |
3 | ## Videos
4 |
5 | | Video | Length | Slides |
6 | |-------|-------:|--------|
7 | | [Build Tools 1](https://web.microsoftstream.com/video/48cac422-9b33-4630-8c85-517f1f7cd619) | 17 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EfuDdA92T65GqK6H_89K9IYBaFKiwvRwj7F-unUeP2iB1Q?e=TlIwVN) |
8 | | [Build Tools 2](https://web.microsoftstream.com/video/0edff26c-c5ee-4ac6-9ea8-42238d98a4f1) | 12 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EYzpCf0Y0pBNvGLdeJ3bHHcBZBE7HULs1h8lCNA_NIw1XQ?e=lK2prk) |
9 |
10 | ## Exercises
11 |
12 | - [C](c.html)
13 | - [Python](python.html)
14 | - [Java](java.html)
15 | - [Spring](spring.html)
16 |
--------------------------------------------------------------------------------
/exercises/part1/src/db1/er2.md:
--------------------------------------------------------------------------------
1 | # More modelling
2 |
3 | Using what you have learnt so far about relational modelling, think about and discuss in groups how you would model a university database to store student's academic progress, such as units enrolled on and completed, marks obtained etc. based on your understanding of how the University of Bristol works. For example, a unit can have different assessments with different weights. You will of course also need a `Students` table, and you can make the model more involved if you like by including that different students are on different degree programmes, and that sometimes students have to resit units.
4 |
5 | You should end up with a more detailed version of the model briefly shown at the top of the previous page - if you have the time you can make both an ER diagram and a create/drop script.
6 |
7 | This is also a good point to mention another fact of how marks and credit points work: exam boards. At the end of each academic year around May, your unit directors all report their marks for each student to an exam board, which sits and decides on final marks and awarding credit. For example, an exam board can moderate the marks for a unit. This is why you do not get your exam marks until a long time after the exam has happened, even if it's a multiple choice exam that can be marked automatically: the marks still have to go through an exam board. (There is another, smaller exam board around the start of Teaching Block 2 so you don't have to wait until summer for your January exam marks to be released.)
8 | If you want to model this in your schema, the idea here is that a student has two marks associated with each unit: the "actual mark" (the input to the exam board) and the "agreed mark" (the one that comes out of the board and goes on your transcript). Of course, for most students most of the time, the two are the same. Your schema will need to store "agreed marks" explicitly, but there are ways of doing the model that does not store the "actual mark" directly. Think about how you could recompute it from other information in the database - we will of course learn how to do this in SQL in a later activity.
9 |
10 | The key idea in relational modelling is not to store information more than once if you can avoid it. If you have stored in several places that Fred is taking Introduction to Programming, and then Fred switches his units, you don't want to end up with a situation where this change is only reflected in some parts of the database.
--------------------------------------------------------------------------------
/exercises/part1/src/db1/sql-introduction.md:
--------------------------------------------------------------------------------
1 | # Introduction to SQL
2 |
3 | This is the first of three activities to teach you about relational databases and the SQL programming language.
4 |
5 | ## Videos
6 |
7 | The videos for this activity are:
8 |
9 | | Video | Length | Slides |
10 | |-------|-------:|--------|
11 | | [Introduction to databases](https://web.microsoftstream.com/video/b3d41a41-17ec-4194-bec1-9666cc234e40) | 16 minutes | [PDF](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EX_d8Ny3NAtPuVuybL02Mf8BmK-iwH_AAZKU8aa03RWNow?e=qvMIo6) |
12 | | [Entity Relationship Diagrams](https://web.microsoftstream.com/video/2b6639e2-35e4-42bf-9e50-fc5228c4e321) | 11 minutes | [PDF](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EaEjGii_A6dFlwr9H99i6bgBKenNumCIYqUmZmmOJ1DBFw?e=0yBFi3) |
13 | | [Intro to SQL](https://web.microsoftstream.com/video/8f2881d9-82f7-4364-a227-e555b776cda0) | 29 minutes | [PDF](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EaUps_sEdCNAneB4qz3VcS0Bw-yqRF7knK6ODUGu00GtNA?e=d1Neil) |
14 | | [Normal Forms](https://web.microsoftstream.com/video/6a9b6876-9e38-4e92-afed-7aaa872714cf?list=studio) | 14 minutes | [PDF](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EQzXXyCAs-NCicgguerjs2AB6uzpeLsteXg2I07g0MjLZg?e=SzrlgF) |
15 |
16 | ## Exercises
17 |
18 | - [Set up the database](./setup.md)
19 | - [ER diagrams](./er-diagram.md)
20 | - [More modelling](./er2.md)
21 | - [Explore the database](../db2/explore-database.md)
22 | - [Bristol elections](../db2/elections.md)
23 | - [The UK census](../db2/census.md)
24 | - [Normal forms](../db2/normalforms.md)
25 |
--------------------------------------------------------------------------------
/exercises/part1/src/db2/elections.md:
--------------------------------------------------------------------------------
1 | # Bristol elections
2 |
3 | In 2014, Bristol held council elections for 24 of its wards. Each ward elected one councillor to represent the ward on the city council. The results are in the `elections` database, with the following schema as you have hopefully just discovered:
4 |
5 | 
6 |
7 | From an ER diagram you can derive a _JOIN strategy_, a way of representing all the useful information in a database. For individual queries, you may only need a subset of this information so you can leave off unnecessary parts of the full JOIN strategy. In this case, the following would work:
8 |
9 | ```
10 | SELECT Candidate.name AS name, Party.name AS party, Ward.name AS ward, Candidate.votes, Ward.electorate
11 | FROM Candidate
12 | INNER JOIN Party ON Candidate.party = Party.id
13 | INNER JOIN Ward ON Candidate.ward = Ward.id
14 | ```
15 |
16 | ## Exercises
17 |
18 | Find SQL statements to answer the following questions. Your answer to each question should be a single query, and you should not hard-code any ids. For example, if a question is about the Labour party, you should use the string `'Labour'` in your query somewhere, not look up the party id and hard-code that in your query.
19 |
20 | Although you can answer all the exercises in this section by taking the join strategy and adding clauses where necessary, there is sometimes a quicker way. But if you don't know where to start, consider how you would extract the result you want from the joined table. The WHERE clause determines which rows appear in the result and the SELECT clause picks the columns that appear in the result.
21 |
22 | 1. List the names of all parties that stood in the election, ordered alphabetically by name.
23 | 2. List the names of all parties that stood in the Bedminster ward.
24 | 3. How many votes did Labour get in the Stockwood ward?
25 | 4. List the names, parties and number of votes obtained for all candidates in the Southville ward. Order the candidates by number of votes obtained descending (winner comes first).
26 | 5. List the name, party and number of votes obtained for the winner only in the Knowle ward. *(Hint: apart from changing the ward name, you only need one small modification to the statement from the last question. You may assume no ties.)*
27 |
--------------------------------------------------------------------------------
/exercises/part1/src/db3/sql-intermediate.md:
--------------------------------------------------------------------------------
1 | # Intermediate SQL
2 |
3 | This is the third of four activities to teach you about relational databases and SQL.
4 |
5 | ## Videos
6 |
7 | The videos for this activity are:
8 |
9 | | Video | Length | Slides |
10 | |-------|-------:|--------|
11 | |[Intermediate SQL](https://web.microsoftstream.com/video/455af5a1-bcca-4378-a0e1-6b52891b20a4) | 22 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EWv9-8AjCwpBpO0V9einLsEBSugn1YIDSV_18mknho_Vvw?e=L0TOLh) |
12 |
13 | ## Exercises
14 |
15 | The exercises for this activity are all on one page:
16 |
17 | - [Intermediate SQL](./exercises.md)
18 |
--------------------------------------------------------------------------------
/exercises/part1/src/db4/sql-java.md:
--------------------------------------------------------------------------------
1 | # SQL and Java
2 |
3 | In this activity you will learn how to connect to an SQL database from a Java program using the JDBC interface and the Hibernate ORM.
4 |
5 | ## Videos
6 |
7 | The videos for this activity are:
8 |
9 | | Video | Length | Slides |
10 | |-------|-------:|--------|
11 | | [JDBC](https://web.microsoftstream.com/video/9c046863-65f4-44a2-91bb-0bf1023c78b4) | 25 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EZqSbPzVyMBOjLk7wVVV4ecBcg_JSPIYMPT2AkTC0npttw?e=E2qtCw) |
12 |
13 | ## Exercises
14 |
15 | The exercises for this activity are:
16 |
17 | - [JDBC](./jdbc.md)
18 | - [Hibernate](./hibernate.md)
19 | - [SQLite](./sqlite.md)
20 |
--------------------------------------------------------------------------------
/exercises/part1/src/git/index.md:
--------------------------------------------------------------------------------
1 | # Activity: Git
2 |
3 | ## Videos
4 |
5 | | Video | Length | Slides |
6 | |-------|-------:|--------|
7 | | [Git, part 1](https://web.microsoftstream.com/video/1fb28095-555d-40e5-8b3b-5fb18b178892) | 34 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/ETueHYft1rVKjld7jesRNBwBL-iNbDoDElJRwZ1BymcXnQ?e=obfTVF) |
8 | | [Git, part 2](https://web.microsoftstream.com/video/ea90c1c9-89cd-4cbf-9af1-14675bebdaea) | 27 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EZjMmRvbrndMkCf0wNwv93MBLorPR9KHzlMZ0iEJa1vBJg?e=08BmRQ) |
9 | | [Git, part 3](https://web.microsoftstream.com/video/ecb70e8b-a390-44fa-8bc1-5af08d79a065) | 19 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/Ed3pRweWtgBPlylvSqRa9eMBzieIVzJ_SYjJY-Hw10V_3Q?e=WGEyNg) |
10 |
11 | ## Exercises
12 |
13 | - [Git](./git.md)
14 |
15 | ## Reading
16 |
17 | Optional (but recommended).
18 |
19 | - [`man 7 giteveryday`](https://www.man7.org/linux/man-pages/man7/giteveryday.7.html)
20 |
--------------------------------------------------------------------------------
/exercises/part1/src/overview.md:
--------------------------------------------------------------------------------
1 | # Overview
2 |
3 | This page contains the exercises for Part 1 (the first 5 weeks) of COMSM0085 Software Tools.
4 | Weeks usually contain two workbooks, and each workbook has associated videos to
5 | watch before the lab (on the main page for each workbook) as well as a set of
6 | practical exercises which you'll tackle before and during the lab.
7 |
8 | Part 1 focuses on tools for setting up systems and writing code. We'll start
9 | with system administration tasks (like connecting to machines via ssh and
10 | updating software) and then move on to making good use of Unix tools,
11 | progressing to shell scripting and how to automate or simplify tasks you might
12 | encounter as a developer. Then we'll look at tools you can use to support
13 | programming in several different languages, including version control and
14 | debuggers. Finally, we'll cover how you can store structured information
15 | effectively in a relational database, and write queries to interact with that
16 | database.
17 |
--------------------------------------------------------------------------------
/exercises/part1/src/posix1/index.md:
--------------------------------------------------------------------------------
1 | # System Administration
2 |
3 | ## Videos
4 |
5 | Before this activity, you should watch the following videos - most of them are quite short. The videos are hosted on Microsoft Stream, and you will need to authenticate via university log-in to watch them.
6 |
7 | | Video | Length | Slides |
8 | |-------|-------:|--------|
9 | | [SSH](https://web.microsoftstream.com/video/d2736b4b-80de-4740-9084-2ab458a9dbab) | 10 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/ERXOIS-oCUxMmOguGB0ctO8BSWKpCskLDBmWM3c6wrk90A?e=IobhBb) |
10 | | [Vagrant](https://web.microsoftstream.com/video/373abf95-52ce-45d2-82d0-28250d300184) | 12 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EW4-UCx2St1Gl8AGPwTuq4EBhNt7-KfnKhbewow6w3WuJQ?e=bJeh4g) |
11 | | [Package managers](https://web.microsoftstream.com/video/9091bdf6-2242-4b43-b09e-9641f9401135) | 6 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EUPLvl82HzRGi-nyhSdiBicBb7EBnouRVnT6RAKKyzhqKQ?e=Ow5cmt) |
12 |
13 | _NB: The videos were recorded last year. Almost everything still applies, but you might see us talking about 'Alpine' or 'apk' -- the Linux VM we used to use, and its package manager. Look at the updated slides to see how Alpine-specific commands translate to Debian._
14 |
15 | ## Exercises
16 |
17 | - [Secure shell](./ssh.md)
18 | - [Installing vagrant and Debian](./install.md)
19 | - [Debian system administration](./admin.md)
20 |
--------------------------------------------------------------------------------
/exercises/part1/src/posix2/index.md:
--------------------------------------------------------------------------------
1 | # The POSIX Shell
2 |
3 | ## Videos
4 |
5 | | Video | Length | Slides |
6 | |-------|-------:|--------|
7 | | [The shell](https://web.microsoftstream.com/video/a55ff501-9e8d-4bb3-a00e-b680596b2de3) | 30 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EbOfjsNY9SJAkEXbMb9WorcBAQMW0QuKthcQHRBDvru8eg?e=HWh7D1) |
8 | | [Pipes 1](https://web.microsoftstream.com/video/7b2657a6-a2d4-4c34-a642-da993d468851) | 20 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EdOsJY_EYlRIveTotkGszNoBWeGx5efiVPJPhhbiQfydTQ?e=RHGVol) |
9 | | [Pipes 2](https://web.microsoftstream.com/video/d04fb18c-533b-4ffe-b8a1-f4d46e9b73d1) | 30 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EfGZcNx_ttNCsx8vpo2uZqIBERTzvUzap84BdzMfxLRuQw?e=Ty9yjZ) |
10 |
11 |
12 | ## Exercises
13 |
14 | - [Shell expansion](./shell.md)
15 | - [Pipes](./pipes.md)
16 | - [Regular expressions](./regex.md)
17 |
--------------------------------------------------------------------------------
/exercises/part1/src/posix2/regex.md:
--------------------------------------------------------------------------------
1 | # Regular expressions
2 |
3 | For this exercise you'll want to refer often to a manual for `grep`.
4 | You can access one on the commandline by invoking `man grep`.
5 | You've already tackled some problems involving regular expressions in a previous
6 | exercise. Here are some more advanced questions that will require you to
7 | understand more about `grep`, its options, and how regular expression syntax
8 | works.
9 |
10 |
11 | 1. Study the documentation for the `-w` option. Contrive a file such that `grep
12 | PATTERN FILE` returns two different lines but `grep -w PATTERN FILE` returns
13 | only one line.
14 | 2. You'll have seen beforehand that you can count the results of a search with
15 | `grep PATTERN FILE | wc -l`. However, `grep` also has a `-c` option which
16 | counts matches. Can you find the situation where the `wc -l` approach and the
17 | `-c` approach produce different results? Can you explain why?
18 | 3. Some words have different spelling between British English and American
19 | English. For example, 'encyclopaedia' is valid in British English but not
20 | American. Can you write a regular expression that would match both of these
21 | words, but nothing else? How about matching both 'color' (American) and 'colour'
22 | (British)?
23 | 4. UK postcodes follow a general schema of two letters followed by one number,
24 | followed by an optional space, then another number, followed by two more letters. Can you write
25 | a regular expression that would match such sequences?
26 | 5. In practice, the above is a simplified version of the system, and a better UK
27 | postcode validator regex is known to be
28 | `^(([A-Z]{1,2}[0-9][A-Z0-9]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA)
29 | ?[0-9][A-Z]{2}|BFPO ?[0-9]{1,4}|(KY[0-9]|MSR|VG|AI)[ -]?[0-9]{4}|[A-Z]{2}
30 | ?[0-9]{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$`. Try breaking apart this monster to
31 | understand what is being tested, and find an example that would match the schema
32 | described for the fourth question but fail to match this expression.
33 |
--------------------------------------------------------------------------------
/exercises/part1/src/posix3/index.md:
--------------------------------------------------------------------------------
1 | # Shell Scripting
2 |
3 | ## Videos
4 |
5 | | Video | Length | Slides |
6 | |-------|-------:|--------|
7 | | [Permissions](https://web.microsoftstream.com/video/71b186df-c373-4b98-ba34-035679cb1ec6) | 20 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EUQ3xxCL4xlHtQ1M6uaLdW4Bc2sxbrCrLNQcinAUgCjmOg?e=ciQDX2) |
8 | | [shell scripting 1](https://web.microsoftstream.com/video/bbe017bf-c1b6-44a0-96cf-ef79a9b17f0e) | 17 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/Ebuz7SukPjRLhMYQd3NJRkkBhgkFxVutnYmcv622ePSxkg?e=8hhLWP) |
9 | | [shell scripting 2](https://web.microsoftstream.com/video/0a2a65bc-1655-4089-984f-53c9400dc2d3) | 21 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EVMTcoOLqmVNiflYUpHfRhMB1XzttL_7gHYOux1qznX4ZA?e=mXRBtE) |
10 |
11 | ## Exercises
12 | - [File permissions](./permissions.md)
13 | - [Shell scripting](./script.md)
14 |
--------------------------------------------------------------------------------
/exercises/part1/src/posix4/index.md:
--------------------------------------------------------------------------------
1 | # Bonus POSIX Activity
2 |
3 | *This activity is optional, and non-examinable. We recommend that you watch the videos anyway.*
4 |
5 | ## Videos
6 |
7 | | Video | Length | Slides |
8 | |-------|-------:|--------|
9 | | [inodes](https://web.microsoftstream.com/video/8f01c778-9ead-4e15-b5ad-21305dc96eba) | 18 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EUke3KQirYBEtq809FUGEjMBKbE9VWpbn2q7t9T6KrnGAA?e=kX4ZY6) |
10 | | [The TTY](https://web.microsoftstream.com/video/bc1a7bdd-1f40-47e6-b86b-ec9eef84fe39) | 22 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EaUyN9P0dr5NoHkdvYGPRzkB2mR3hYuHqoJ4W1OqT1830w?e=YdPV0f) |
11 |
12 | ## Exercises
13 |
14 | - [inodes and system calls](./stat.md)
15 | - [Concurrent programming in POSIX](./concurrent.md)
16 | - [Pipes in C](./cpipe.md)
17 | - [Input/Output in C](./c_io.md)
18 | - [Input/Output in POSIX](./posix_io.md)
19 | - [The final challenge](./final.md)
20 |
--------------------------------------------------------------------------------
/exercises/part1/src/resources/Vagrantfile:
--------------------------------------------------------------------------------
1 | Vagrant.configure("2") do |config|
2 | config.vm.box = "generic/debian12"
3 | config.vm.synced_folder ".", "/vagrant"
4 |
5 | config.vm.provision "shell", inline: <<-SHELL
6 | echo "Post-provision installs go here"
7 | SHELL
8 | end
9 |
--------------------------------------------------------------------------------
/exercises/part1/src/resources/after-merge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/after-merge.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/after-rebase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/after-rebase.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/before-rebase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/before-rebase.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/census.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/census.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/elections.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/elections.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/pipe1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/pipe1.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/pipe2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/pipe2.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/pipe3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/pipe3.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/pr-after-rebase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/pr-after-rebase.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/pr-before-rebase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/pr-before-rebase.png
--------------------------------------------------------------------------------
/exercises/part1/src/resources/uni-diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part1/src/resources/uni-diagram.png
--------------------------------------------------------------------------------
/exercises/part2/.gitignore:
--------------------------------------------------------------------------------
1 | book/
--------------------------------------------------------------------------------
/exercises/part2/book.toml:
--------------------------------------------------------------------------------
1 | [book]
2 | authors = ["David"]
3 | language = "en"
4 | multilingual = false
5 | src = "src"
6 | title = "Exercises"
7 |
8 | [preprocessor.python]
9 | command = "python preprocessor.py"
--------------------------------------------------------------------------------
/exercises/part2/build.bat:
--------------------------------------------------------------------------------
1 | mdbook build
2 | xcopy /S /Y book ..\..\docs\exercises\part2\
--------------------------------------------------------------------------------
/exercises/part2/preprocessor.py:
--------------------------------------------------------------------------------
1 | # Preprocessor to handle ||| custom blocks.
2 |
3 | import sys
4 | import json
5 | import re
6 |
7 | # this is for when mdbook first pokes the preprocessor to see if it works
8 | if len(sys.argv) > 1:
9 | if sys.argv[1] == 'supports':
10 | # sys.argv[2] is the renderer name
11 | sys.exit(0)
12 |
13 | def begin_block(acc, type):
14 | acc += ["", f'
", ""]
18 |
19 | def process(item):
20 | """
21 | The item has a ['content'] field with the page text.
22 | Process this.
23 | """
24 | content = item['content']
25 | lines = content.split('\n')
26 | out = []
27 | block = False
28 | for line in lines:
29 | if block is False:
30 | if (m := re.match("\|\|\|([a-z]+)", line)) is not None:
31 | begin_block(out, m.group(1))
32 | block = True
33 | else:
34 | out.append(line)
35 | else:
36 | if re.match("\|\|\|", line) is not None:
37 | end_block(out)
38 | block = False
39 | else:
40 | out.append(line)
41 | item['content'] = "\n".join(out)
42 |
43 | context, book = json.load(sys.stdin)
44 |
45 | #log = open("preprocessor.log", "a")
46 |
47 | sections = book['sections']
48 | for section in sections:
49 | #log.write("SECTION\n")
50 | #for k in section:
51 | # log.write(f" {k}\n")
52 |
53 | if 'Chapter' in section:
54 | process(section['Chapter'])
55 | for subitem in section['Chapter']['sub_items']:
56 | process(subitem['Chapter'])
57 |
58 | #log.close()
59 |
60 | #with open("log", "w") as log:
61 | # json.dump(book, log)
62 | json.dump(book, sys.stdout)
63 |
--------------------------------------------------------------------------------
/exercises/part2/src/SUMMARY.md:
--------------------------------------------------------------------------------
1 | # Exercises
2 |
3 | [Overview](./overview.md)
4 |
5 | # Week 6: The Web
6 | - [HTTP](./http/index.md)
7 | - [Setup](./http/setup.md)
8 | - [Exploring HTTP](./http/explore.md)
9 | - [Online research](./http/research.md)
10 | - [A server in Java](./http/server.md)
11 | - [HTML5](./html5/index.md)
12 | - [Basic HTML5](./html5/basic.md)
13 | - [Templates](./html5/templates.md)
14 |
15 | # Week 7: CSS
16 | - [CSS](./css/index.md)
17 | - [Styling Text](./css/text.md)
18 | - [Frameworks](./css/framework.md)
19 | - [CSS grids](./cssgrid/index.md)
20 | - [Introduction](./cssgrid/intro.md)
21 | - [Curriculum exercise](./cssgrid/curriculum.md)
22 | - [Trees exercise (responsive layout)](./cssgrid/trees.md)
23 |
24 | # Week 8: Javascript
25 | - [JavaScript](./js/index.md)
26 | - [My Cool App](./js/MyCoolApp.md)
27 |
28 | # Week 9: Web Scraping
29 | - [Web scraping](./scrape/index.md)
30 | - [Crawling](./scrape/crawl.md)
31 | - [BeautifulSoup](./scrape/soup.md)
32 |
33 | # Week 10: Practical Encryption
34 | - [Practical Encryption](./encryption/index.md)
35 | - [OpenSSL](./encryption/openssl.md)
36 | - [PGP](./encryption/pgp.md)
37 |
--------------------------------------------------------------------------------
/exercises/part2/src/app1/index.md:
--------------------------------------------------------------------------------
1 | # A complete application, part 1
2 |
3 | In this workshop we will set up and inspect a complete application including database, Java back-end/API and React front-end.
4 |
5 | Just one short video to introduce the topic:
6 |
7 | | Video | Length | Slides |
8 | |-------|-------:|--------|
9 | | [Application](https://web.microsoftstream.com/video/52fa34a2-02f8-4988-9fa1-21a317acbde3) | 9 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EU-n9IGv5SxGu5tR7HrTsz8B4-e8ERD6i7ct2mPeoLZbQQ?e=zUVT6e) |
10 |
11 | Please try the steps on the "setting things up" page before you come to the workshop - ideally you will then be able to start the walkthrough in the workshop itself immediately, but if you get stuck in the set-up, you will be able to ask for help at the very start.
12 |
--------------------------------------------------------------------------------
/exercises/part2/src/cloud/cloud1.md:
--------------------------------------------------------------------------------
1 | # The Cloud
2 |
3 | For this session, there are no videos. Instead, you should read the following
4 | web resources, the content of which is examinable:
5 |
6 | - [What is Cloud Computing?](https://cloud.google.com/learn/what-is-cloud-computing)
7 | - [What is Cloud Economics?](https://www.cloudzero.com/blog/cloud-economics)
8 | - [As A Service](https://www.ibm.com/topics/iaas-paas-saas)
9 |
10 |
11 | There are no exercises for the cloud material. Instead, use this time to
12 | complete the React exercises, recap exercises from earlier in this part of the
13 | unit, and ask questions about this or other material from across the unit. If
14 | there are exercises that you could not solve or want to ask questions about, now
15 | would be a good time to revisit them and ask for help.
16 |
17 |
18 | _(The original intention was to include a non-examinable practical component
19 | here using AWS services, but there was trouble getting this set up for the class
20 | in time. While not the same as a guided exercise, some of you may want to look
21 | at AWS' own onboarding material
22 | [here](https://aws.amazon.com/getting-started/).)_
23 |
24 |
--------------------------------------------------------------------------------
/exercises/part2/src/css/index.md:
--------------------------------------------------------------------------------
1 | # CSS
2 |
3 | CSS, or Cascading Style Sheets, allows you to set what your page looks like, separately from creating the content.
4 |
5 | _Not to be confused with [CSS Bristol](https://cssbristol.co.uk/)._
6 |
7 | ## Videos
8 |
9 | | Video | Length | Slides |
10 | |-------|-------:|--------|
11 | | [CSS part 1](https://web.microsoftstream.com/video/966c07b6-6f2f-4676-b348-e942101be174) | 14 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EXPRGR7nfbdLgB8krc9jTFcBHEH__HvV-vqXfbmYemGfnA?e=lwKNBI) |
12 | | [CSS part 2](https://web.microsoftstream.com/video/b38974b4-2675-4143-82c8-a8ff2c6a3288) | 10 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EaPEjEpM1JtNkDwYQyQ8tCUBFT6Q78VI4QKMSANf6jhfyg?e=VIS7eB) |
13 |
14 | ## MDN
15 |
16 | For this workshop, please read the following pages:
17 |
18 | - [CSS first steps](https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps) including the 5 subpages linked under "Guides" - they are all meant for beginners so you should be able to get through them quickly.
19 | - [CSS selectors](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors)
20 | - [The box model](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/The_box_model)
21 | - [Values and units](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units)
22 |
23 | ## Exercises
24 |
25 | - [Styling Text](./text.md)
26 | - [Frameworks](./framework.md)
27 |
--------------------------------------------------------------------------------
/exercises/part2/src/css/rhythm1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part2/src/css/rhythm1.png
--------------------------------------------------------------------------------
/exercises/part2/src/css/rhythm2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part2/src/css/rhythm2.png
--------------------------------------------------------------------------------
/exercises/part2/src/cssgrid/curriculum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part2/src/cssgrid/curriculum.png
--------------------------------------------------------------------------------
/exercises/part2/src/cssgrid/index.md:
--------------------------------------------------------------------------------
1 | # CSS grids
2 |
3 | ## Videos
4 |
5 | | Video | Length | Slides |
6 | |-------|-------:|--------|
7 | | [Design](https://web.microsoftstream.com/video/ef9e9dcf-f9b8-4bcf-8ac6-f8608514cc22) | 13 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EUlNRBt92L9MmCs7UUPFCnsBfrW30OIZiFGjrzvBEdPAGQ?e=FmmJEW) |
8 | | [CSS grids](https://web.microsoftstream.com/video/93c2a47c-5fd4-432d-9f93-71e7181fd104) | 7 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/EbxgG7O3lb1MoSgwQuUMDZ8B8WBnR0ZyiBD0Q1hQk9P9eg?e=ks2kqT) |
9 | | [Responsive Layout](https://web.microsoftstream.com/video/d2099c95-eef3-474e-9ae8-4f5a84521d18) | 3 minutes | [slides](https://uob-my.sharepoint.com/:b:/g/personal/me17847_bristol_ac_uk/Ebvt4NOYIGtHvJDTNsbXK4kBzon6XArErDCWxs74DzyNgA?e=jJRS8E) |
10 |
11 | ## MDN
12 |
13 | Please read the following pages, and play with the interactive examples:
14 |
15 | - [Normal flow](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Normal_Flow)
16 | - [CSS grids](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Grids)
17 | - [Media queries](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Media_queries)
18 |
19 | ## Exercises
20 |
21 | - [Introduction](./intro.md)
22 | - [Curriculum exercise](./curriculum.md)
23 | - [Trees (responsive layout)](./trees.md)
24 |
--------------------------------------------------------------------------------
/exercises/part2/src/cssgrid/intro.md:
--------------------------------------------------------------------------------
1 | # CSS grids introduction
2 |
3 | To create a CSS grid, you place a container element (usually a `
`) and style it `display: grid`. All its direct children will now be laid out in a grid, and you can configure the general layout on the parent element:
4 |
5 | - `grid-template-columns` defines the number and widths of the columns.
6 | - `gap` (which should have been called `grid-gap`, but is not) defines the gap between different grid cells.
7 | - For a gap around the outside of the grid, give the container a margin (or padding).
8 |
9 | On the child elements, you can set the placement rules for each one and the browser will build the grid accordingly:
10 |
11 | - By default, each child takes up the next free 1x1 space.
12 | - `grid-row` and `grid-column` modify this:
13 | - `span N` makes a child element N cells wide/tall.
14 | - `M / N` positions the child absolutely from dividing line M to dividing line N (you can overlap or stack elements on top of each other this way if you want to).
15 |
16 | There are many more things that you can do with grids, and your best resources if you need to look this up are:
17 |
18 | - [Grids on MDN](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Grids)
19 | - [CSS-tricks complete guide to grids](https://css-tricks.com/snippets/css/complete-guide-grid/)
20 |
--------------------------------------------------------------------------------
/exercises/part2/src/cssgrid/trees-medium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part2/src/cssgrid/trees-medium.png
--------------------------------------------------------------------------------
/exercises/part2/src/cssgrid/trees-wide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs-uob/COMSM0085/0131572bd20fbc2ac105b1c6317db76558961ca0/exercises/part2/src/cssgrid/trees-wide.png
--------------------------------------------------------------------------------
/exercises/part2/src/encryption/index.md:
--------------------------------------------------------------------------------
1 | # Practical Encryption
2 |
3 | ## Videos
4 |
5 | | Video | Length | Slides |
6 | |-------|-------:|--------|
7 |
8 |
9 | ## Exercises
10 |
11 | - [OpenSSL](./openssl.md)
12 | - [PGP](./pgp.md)
13 |
--------------------------------------------------------------------------------
/exercises/part2/src/html5/basic.md:
--------------------------------------------------------------------------------
1 | # Basic HTML5
2 |
3 | For your first exercise, create a page called `index.html` and add the HTML5 template code to it.
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 | A web page
11 |
12 |
13 |
15 |
16 |
17 | ```
18 |
19 | The name `index.html` is a convention: most web servers, if you give an URL that looks like a "folder" e.g. `example.com/pages` (or `example.com/pages/` with slash on the end) will serve the file `index.html` from within that folder, if there is one.
20 |
21 | ## Create a page
22 |
23 | Create content in your page to make it look like the following, then open it in your browser. All body text, but not the bullet list, is contained in paragraph tags.
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
http://localhost:8000
33 |
34 |
36 |
37 |
38 | ## Validate your page
39 |
40 | There are various libraries and services that check if your page is valid HTML5.
41 |
42 | At [validator.w3.org](https://validator.w3.org/) you can enter an URL, upload a file, or paste the contents of a file and validate it. Check that the page you have just written is valid HTML5.
43 |
44 | Your browser's developer tools can also check the page you are viewing. For Chrome/Edge, to to the _Console_ tab and, if the button at the top does not read _No Issues_ but shows a number with a blue (or even yellow or red) icon, then click it to open the _Issues_ tab and see what the browser is complaining about.
45 |
46 | You can check the sample solution [here](../resources/examplepage.html) but you might have a different, equally valid solution.
47 |
--------------------------------------------------------------------------------
/exercises/part2/src/html5/index.md:
--------------------------------------------------------------------------------
1 | # HTML5
2 |
3 | HTML5, officially introduced in 2014, is the modern markup language for writing websites.
4 |
5 | It gets rid of a lot of historical annoyances and inconsistencies from previous versions of HTML and XML and contains a lot of new standard tags and attributes for features that individual sites had built with JavaScript or Adobe Flash in the past. For example, HTML5 has a `