lint all files

This commit is contained in:
2024-01-16 13:48:46 +00:00
parent b515ba4458
commit a321b0ce99
45 changed files with 66985 additions and 23206 deletions

View File

@@ -3,5 +3,5 @@
"theme": "obsidian",
"cssTheme": "Dracula Official",
"nativeMenus": true,
"baseFontSize": 30
"baseFontSize": 16
}

View File

@@ -1,11 +1,9 @@
[
"obsidian-git",
"dataview",
"obsidian-day-planner",
"obsidian-excel-to-markdown-table",
"obsidian-linter",
"omnisearch",
"cm-typewriter-scroll-obsidian",
"local-backup",
"obsidian-diagrams-net"
"obsidian-diagrams-net",
"obsidian-full-calendar"
]

View File

@@ -4,13 +4,13 @@
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"canvas": false,
"outgoing-link": true,
"tag-pane": true,
"properties": true,
"page-preview": true,
"daily-notes": true,
"templates": true,
"daily-notes": false,
"templates": false,
"note-composer": true,
"command-palette": true,
"slash-command": false,

View File

@@ -4,13 +4,10 @@
"switcher",
"graph",
"backlink",
"canvas",
"outgoing-link",
"tag-pane",
"properties",
"page-preview",
"daily-notes",
"templates",
"note-composer",
"command-palette",
"editor-status",

View File

@@ -1,17 +0,0 @@
{
"circularProgress": true,
"nowAndNextInStatusBar": true,
"showTaskNotification": true,
"zoomLevel": 2,
"timelineIcon": "calendar-with-checkmark",
"endLabel": "All done",
"startHour": 6,
"timelineDateFormat": "LLLL",
"centerNeedle": false,
"showHelp": true,
"plannerHeading": "Day planner",
"plannerHeadingLevel": 1,
"timelineColored": false,
"timelineStartColor": "#006466",
"timelineEndColor": "#4d194d"
}

File diff suppressed because one or more lines are too long

View File

@@ -1,11 +0,0 @@
{
"id": "obsidian-day-planner",
"name": "Day Planner",
"version": "0.10.1",
"minAppVersion": "0.16.0",
"description": "A day planner with clean UI and readable syntax",
"author": "James Lynch, continued by Ivan Lednev",
"authorUrl": "https://github.com/ivan-lednev",
"fundingUrl": "https://www.buymeacoffee.com/machineelf",
"isDesktopOnly": false
}

View File

@@ -1,463 +0,0 @@
/* src/styles.scss */
.progress-pie {
width: 60px;
height: 60px;
border-radius: 50%;
background: #eee;
background-image: linear-gradient(to right, transparent 50%, #4CC9D8 0);
position: relative;
display: inline-block;
}
.progress-pie::before {
content: "";
display: block;
margin-left: 50%;
height: 100%;
border-radius: 0 100% 100% 0/50%;
background-color: inherit;
transform-origin: left;
}
.progress-pie::after {
content: attr(data-value);
position: absolute;
width: 70%;
height: 70%;
margin: auto;
border-radius: 50%;
background-color: #fff;
left: 0;
right: 0;
top: 0;
bottom: 0;
text-align: center;
font: 900 20px/41px Tahoma;
}
.progress-pie[data-value="0"]:before {
transform: rotate(0turn);
}
.progress-pie[data-value="1"]:before {
transform: rotate(0.01turn);
}
.progress-pie[data-value="2"]:before {
transform: rotate(0.02turn);
}
.progress-pie[data-value="3"]:before {
transform: rotate(0.03turn);
}
.progress-pie[data-value="4"]:before {
transform: rotate(0.04turn);
}
.progress-pie[data-value="5"]:before {
transform: rotate(0.05turn);
}
.progress-pie[data-value="6"]:before {
transform: rotate(0.06turn);
}
.progress-pie[data-value="7"]:before {
transform: rotate(0.07turn);
}
.progress-pie[data-value="8"]:before {
transform: rotate(0.08turn);
}
.progress-pie[data-value="9"]:before {
transform: rotate(0.09turn);
}
.progress-pie[data-value="10"]:before {
transform: rotate(0.1turn);
}
.progress-pie[data-value="11"]:before {
transform: rotate(0.11turn);
}
.progress-pie[data-value="12"]:before {
transform: rotate(0.12turn);
}
.progress-pie[data-value="13"]:before {
transform: rotate(0.13turn);
}
.progress-pie[data-value="14"]:before {
transform: rotate(0.14turn);
}
.progress-pie[data-value="15"]:before {
transform: rotate(0.15turn);
}
.progress-pie[data-value="16"]:before {
transform: rotate(0.16turn);
}
.progress-pie[data-value="17"]:before {
transform: rotate(0.17turn);
}
.progress-pie[data-value="18"]:before {
transform: rotate(0.18turn);
}
.progress-pie[data-value="19"]:before {
transform: rotate(0.19turn);
}
.progress-pie[data-value="20"]:before {
transform: rotate(0.2turn);
}
.progress-pie[data-value="21"]:before {
transform: rotate(0.21turn);
}
.progress-pie[data-value="22"]:before {
transform: rotate(0.22turn);
}
.progress-pie[data-value="23"]:before {
transform: rotate(0.23turn);
}
.progress-pie[data-value="24"]:before {
transform: rotate(0.24turn);
}
.progress-pie[data-value="25"]:before {
transform: rotate(0.25turn);
}
.progress-pie[data-value="26"]:before {
transform: rotate(0.26turn);
}
.progress-pie[data-value="27"]:before {
transform: rotate(0.27turn);
}
.progress-pie[data-value="28"]:before {
transform: rotate(0.28turn);
}
.progress-pie[data-value="29"]:before {
transform: rotate(0.29turn);
}
.progress-pie[data-value="30"]:before {
transform: rotate(0.3turn);
}
.progress-pie[data-value="31"]:before {
transform: rotate(0.31turn);
}
.progress-pie[data-value="32"]:before {
transform: rotate(0.32turn);
}
.progress-pie[data-value="33"]:before {
transform: rotate(0.33turn);
}
.progress-pie[data-value="34"]:before {
transform: rotate(0.34turn);
}
.progress-pie[data-value="35"]:before {
transform: rotate(0.35turn);
}
.progress-pie[data-value="36"]:before {
transform: rotate(0.36turn);
}
.progress-pie[data-value="37"]:before {
transform: rotate(0.37turn);
}
.progress-pie[data-value="38"]:before {
transform: rotate(0.38turn);
}
.progress-pie[data-value="39"]:before {
transform: rotate(0.39turn);
}
.progress-pie[data-value="40"]:before {
transform: rotate(0.4turn);
}
.progress-pie[data-value="41"]:before {
transform: rotate(0.41turn);
}
.progress-pie[data-value="42"]:before {
transform: rotate(0.42turn);
}
.progress-pie[data-value="43"]:before {
transform: rotate(0.43turn);
}
.progress-pie[data-value="44"]:before {
transform: rotate(0.44turn);
}
.progress-pie[data-value="45"]:before {
transform: rotate(0.45turn);
}
.progress-pie[data-value="46"]:before {
transform: rotate(0.46turn);
}
.progress-pie[data-value="47"]:before {
transform: rotate(0.47turn);
}
.progress-pie[data-value="48"]:before {
transform: rotate(0.48turn);
}
.progress-pie[data-value="49"]:before {
transform: rotate(0.49turn);
}
.progress-pie[data-value="50"]:before {
transform: rotate(0.5turn);
}
.progress-pie[data-value="51"]:before {
background-color: #4CC9D8;
transform: rotate(0.01turn);
}
.progress-pie[data-value="52"]:before {
background-color: #4CC9D8;
transform: rotate(0.02turn);
}
.progress-pie[data-value="53"]:before {
background-color: #4CC9D8;
transform: rotate(0.03turn);
}
.progress-pie[data-value="54"]:before {
background-color: #4CC9D8;
transform: rotate(0.04turn);
}
.progress-pie[data-value="55"]:before {
background-color: #4CC9D8;
transform: rotate(0.05turn);
}
.progress-pie[data-value="56"]:before {
background-color: #4CC9D8;
transform: rotate(0.06turn);
}
.progress-pie[data-value="57"]:before {
background-color: #4CC9D8;
transform: rotate(0.07turn);
}
.progress-pie[data-value="58"]:before {
background-color: #4CC9D8;
transform: rotate(0.08turn);
}
.progress-pie[data-value="59"]:before {
background-color: #4CC9D8;
transform: rotate(0.09turn);
}
.progress-pie[data-value="60"]:before {
background-color: #4CC9D8;
transform: rotate(0.1turn);
}
.progress-pie[data-value="61"]:before {
background-color: #4CC9D8;
transform: rotate(0.11turn);
}
.progress-pie[data-value="62"]:before {
background-color: #4CC9D8;
transform: rotate(0.12turn);
}
.progress-pie[data-value="63"]:before {
background-color: #4CC9D8;
transform: rotate(0.13turn);
}
.progress-pie[data-value="64"]:before {
background-color: #4CC9D8;
transform: rotate(0.14turn);
}
.progress-pie[data-value="65"]:before {
background-color: #4CC9D8;
transform: rotate(0.15turn);
}
.progress-pie[data-value="66"]:before {
background-color: #4CC9D8;
transform: rotate(0.16turn);
}
.progress-pie[data-value="67"]:before {
background-color: #4CC9D8;
transform: rotate(0.17turn);
}
.progress-pie[data-value="68"]:before {
background-color: #4CC9D8;
transform: rotate(0.18turn);
}
.progress-pie[data-value="69"]:before {
background-color: #4CC9D8;
transform: rotate(0.19turn);
}
.progress-pie[data-value="70"]:before {
background-color: #4CC9D8;
transform: rotate(0.2turn);
}
.progress-pie[data-value="71"]:before {
background-color: #4CC9D8;
transform: rotate(0.21turn);
}
.progress-pie[data-value="72"]:before {
background-color: #4CC9D8;
transform: rotate(0.22turn);
}
.progress-pie[data-value="73"]:before {
background-color: #4CC9D8;
transform: rotate(0.23turn);
}
.progress-pie[data-value="74"]:before {
background-color: #4CC9D8;
transform: rotate(0.24turn);
}
.progress-pie[data-value="75"]:before {
background-color: #4CC9D8;
transform: rotate(0.25turn);
}
.progress-pie[data-value="76"]:before {
background-color: #4CC9D8;
transform: rotate(0.26turn);
}
.progress-pie[data-value="77"]:before {
background-color: #4CC9D8;
transform: rotate(0.27turn);
}
.progress-pie[data-value="78"]:before {
background-color: #4CC9D8;
transform: rotate(0.28turn);
}
.progress-pie[data-value="79"]:before {
background-color: #4CC9D8;
transform: rotate(0.29turn);
}
.progress-pie[data-value="80"]:before {
background-color: #4CC9D8;
transform: rotate(0.3turn);
}
.progress-pie[data-value="81"]:before {
background-color: #4CC9D8;
transform: rotate(0.31turn);
}
.progress-pie[data-value="82"]:before {
background-color: #4CC9D8;
transform: rotate(0.32turn);
}
.progress-pie[data-value="83"]:before {
background-color: #4CC9D8;
transform: rotate(0.33turn);
}
.progress-pie[data-value="84"]:before {
background-color: #4CC9D8;
transform: rotate(0.34turn);
}
.progress-pie[data-value="85"]:before {
background-color: #4CC9D8;
transform: rotate(0.35turn);
}
.progress-pie[data-value="86"]:before {
background-color: #4CC9D8;
transform: rotate(0.36turn);
}
.progress-pie[data-value="87"]:before {
background-color: #4CC9D8;
transform: rotate(0.37turn);
}
.progress-pie[data-value="88"]:before {
background-color: #4CC9D8;
transform: rotate(0.38turn);
}
.progress-pie[data-value="89"]:before {
background-color: #4CC9D8;
transform: rotate(0.39turn);
}
.progress-pie[data-value="90"]:before {
background-color: #4CC9D8;
transform: rotate(0.4turn);
}
.progress-pie[data-value="91"]:before {
background-color: #4CC9D8;
transform: rotate(0.41turn);
}
.progress-pie[data-value="92"]:before {
background-color: #4CC9D8;
transform: rotate(0.42turn);
}
.progress-pie[data-value="93"]:before {
background-color: #4CC9D8;
transform: rotate(0.43turn);
}
.progress-pie[data-value="94"]:before {
background-color: #4CC9D8;
transform: rotate(0.44turn);
}
.progress-pie[data-value="95"]:before {
background-color: #4CC9D8;
transform: rotate(0.45turn);
}
.progress-pie[data-value="96"]:before {
background-color: #4CC9D8;
transform: rotate(0.46turn);
}
.progress-pie[data-value="97"]:before {
background-color: #4CC9D8;
transform: rotate(0.47turn);
}
.progress-pie[data-value="98"]:before {
background-color: #4CC9D8;
transform: rotate(0.48turn);
}
.progress-pie[data-value="99"]:before {
background-color: #4CC9D8;
transform: rotate(0.49turn);
}
.progress-pie[data-value="100"]:before {
background-color: #4CC9D8;
transform: rotate(0.5turn);
}
.day-planner {
position: relative;
}
.day-planner .status-bar-item-segment:hover {
cursor: pointer;
}
.day-planner-progress-bar {
overflow: hidden;
display: flex;
align-items: stretch;
align-self: stretch;
min-width: 100px;
background-color: var(--text-faint);
border-radius: var(--radius-s);
}
.day-planner-progress-value {
background-color: var(--color-accent);
}
.day-planner-progress-value.green,
.day-planner .progress-pie.green::before {
background-color: #4caf50;
}
.day-planner .progress-pie.green {
background-image: linear-gradient(to right, transparent 50%, #4caf50 0);
}
.day-planner-status-bar-text {
float: left;
margin-right: 10px;
}
.day-planner-status-card {
position: absolute;
top: -140px;
display: none;
width: 300px;
padding: 8px;
background-color: var(--background-secondary-alt);
border-radius: 4px;
}
.day-planner-status-card .arrow-down {
position: absolute;
width: 20px;
border-top: 20px solid var(--background-secondary-alt);
border-right: 20px solid transparent;
border-left: 20px solid transparent;
}
.progress-pie.day-planner {
float: left;
display: none;
width: 20px;
height: 20px;
margin: 0.3px 10px 0.3px 0;
background-color: var(--text-muted);
}
.progress-pie.day-planner::after {
width: 80%;
height: 80%;
}
.progress-pie.day-planner::after {
font-size: 8px;
font-weight: 900;
line-height: 13px;
color: transparent;
background-color: transparent;
}
[data-type=timeline] .view-content,
[data-type=weekly] .view-content {
--time-ruler-width: 30px;
display: flex;
flex-direction: column;
padding: 0;
}
.absolute-stretch-x {
position: absolute;
right: 0;
left: 0;
}

View File

@@ -0,0 +1,29 @@
{
"calendarSources": [
{
"type": "caldav",
"name": "Personal",
"url": "https://cloud.borishub.co.uk/remote.php/dav",
"homeUrl": "https://cloud.borishub.co.uk/remote.php/dav/calendars/boris/personal/",
"color": "#795AAB",
"username": "boris",
"password": "9PFNM-dwLnK-ZPAQq-ndZNa-H2YSa"
},
{
"type": "caldav",
"name": "Contact birthdays",
"url": "https://cloud.borishub.co.uk/remote.php/dav",
"homeUrl": "https://cloud.borishub.co.uk/remote.php/dav/calendars/boris/contact_birthdays/",
"color": "#E9D859",
"username": "boris",
"password": "9PFNM-dwLnK-ZPAQq-ndZNa-H2YSa"
}
],
"defaultCalendar": 0,
"firstDay": 0,
"initialView": {
"desktop": "timeGridWeek",
"mobile": "timeGrid3Days"
},
"timeFormat24h": false
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
{
"id": "obsidian-full-calendar",
"name": "Full Calendar",
"version": "0.10.7",
"minAppVersion": "0.16.3",
"description": "Obsidian integration with Full Calendar (fullcalendar.io)",
"author": "Davis Haupt",
"authorUrl": "https://davi.sh",
"isDesktopOnly": false,
"fundingUrl": "https://ko-fi.com/davish"
}

File diff suppressed because it is too large Load Diff

View File

@@ -4,30 +4,25 @@
"type": "split",
"children": [
{
"id": "a5a324d300e6e103",
"id": "c7fbd00d7c08bda8",
"type": "tabs",
"children": [
{
"id": "9513a065081c5bb6",
"id": "a094a718d7114385",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Semester 1/Database Systems/Assignment/Querying Database.md",
"mode": "source",
"source": false
}
"type": "full-calendar-view",
"state": {}
}
},
{
"id": "32c79d56306ffbbf",
"id": "23f7f2e2c54fd0d2",
"type": "leaf",
"state": {
"type": "markdown",
"type": "diff-view",
"state": {
"file": "Semester 2/Database Systems/Week 1/Week 1 Database Systems.md",
"mode": "source",
"source": false
"file": ".obsidian/plugins/obsidian-day-planner/data.json",
"staged": false
}
}
}
@@ -99,7 +94,6 @@
"state": {
"type": "backlink",
"state": {
"file": "Semester 2/Database Systems/Week 1/Week 1 Database Systems.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@@ -116,7 +110,6 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "Semester 2/Database Systems/Week 1/Week 1 Database Systems.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
@@ -138,9 +131,7 @@
"type": "leaf",
"state": {
"type": "outline",
"state": {
"file": "Semester 2/Database Systems/Week 1/Week 1 Database Systems.md"
}
"state": {}
}
},
{
@@ -172,21 +163,20 @@
},
"left-ribbon": {
"hiddenItems": {
"obsidian-day-planner:Week plan": false,
"obsidian-full-calendar:Open Full Calendar": false,
"omnisearch:Omnisearch": false,
"switcher:Open quick switcher": false,
"graph:Open graph view": false,
"canvas:Create new canvas": false,
"daily-notes:Open today's daily note": false,
"templates:Insert template": false,
"command-palette:Open command palette": false
"command-palette:Open command palette": false,
"switcher:Open quick switcher": false
}
},
"active": "671043c113c40804",
"active": "23f7f2e2c54fd0d2",
"lastOpenFiles": [
"Semester 2/Database Systems/Week 1/Week 1 Database Systems.md",
"Semester 1/Database Systems/Assignment/Querying Database.md",
"Semester 1/Database Systems/Week 10/Week 10.md",
"Semester 2/Database Systems/Week 1",
"Semester 2/Computer Systems Internals & Linux/Week 1/Week 1 Computer Systems Internals.md",
"Semester 2/Database Systems/Week 1/Week 1 Database Systems.md",
"Semester 2/Database Systems",
"README.md",
"Semester 2/Programming 2/Week 1/Week 1 Programming 2.md",
@@ -200,7 +190,6 @@
"2024-01-15.md",
"Semester 1/Web Development and HCI/Assignment.odt",
"Web Development and HCI/lu11370hmnm.tmp",
"Semester 1/Web Development and HCI/Assignment 1/src/styles/index.css",
"Semester 1/Web Development and HCI/Assignment 1/src/images/proxmox-03.jpg",
"Semester 1/Web Development and HCI/Assignment 1/src/images/proxmox-04.jpg",
"Web Development and HCI/Assignment 1/src/images/Screenshot from 2023-12-07 18-29-51.png",
@@ -211,13 +200,11 @@
"Semester 1/Web Development and HCI/Assignment 1/src/images/proxmox-01.jpg",
"Semester 1/Database Systems/Week 9/Week 9 Database Systems.md",
"Semester 1/Database Systems/Assignment/ERD.png",
"Semester 1/Database Systems/Week 10/Week 10.md",
"Semester 1/Database Systems/Week 8/Week 8 Database Systems.md",
"Semester 1/Database Systems/Week 7/Week 7 Database Systems.md",
"Semester 1/Database Systems/Week 5/Week 5 Database Systems.md",
"Semester 1/Database Systems/Week 6/Week 6 Database Systems.md",
"Semester 1/Database Systems/Assignment/Relational Model.md",
"Semester 1/Database Systems/Assignment/Querying Database.md",
"Semester 1/Database Systems/Assignment/ER Diagram.md",
"Semester 1/Database Systems/Assignment/Populating Database.md",
"Semester 1/Database Systems/Week 11/Week 11 Database Systems.md",

View File

@@ -1,4 +1,3 @@
1)
**a) Choose a number between 51 and 70. This will be number A. Choose another number between 80 and 120. This will be number B. Using 2s complement 8-bit binary arithmetic, calculate number A number B giving your answer in binary and decimal. (5 marks)**
Number A - 64 - 0100 0000

View File

@@ -1,4 +1,4 @@
1) **Choose a short phrase of between 50-60 characters. You could choose a website headline, song title, etc. Convert this phrase using Caesar shift encryption and a key of 5 to create your ciphertext. Carry out a cryptanalytic attack to try to work out the decryption key and plaintext. (10 marks)**
1. **Choose a short phrase of between 50-60 characters. You could choose a website headline, song title, etc. Convert this phrase using Caesar shift encryption and a key of 5 to create your ciphertext. Carry out a cryptanalytic attack to try to work out the decryption key and plaintext. (10 marks)**
F1 veteran to retire and take up new role in 2024.
@@ -26,7 +26,7 @@ This results in a key of 5, so translating the 2nd word: ajyjwfs -> veteran. Thi
`K1 ajyjwfs yt wjynwj fsi yfpj zu sjb wtqj ns 2024.` -> `F1 veteran to retire and take up new role in 2024.`
2) Computer A sends 5 packets of data to computer B using Sliding Windows Flow Control.
1. Computer A sends 5 packets of data to computer B using Sliding Windows Flow Control.
- The transmission time (time to put on the network) for a packet of data is 1 'time units'
- Transmission time for an acknowledgement is 0 time units (they are very small)
- The propagation time (time to travel through network) for any transmission is random (between 3 and 5 time units, you choose a random time for each packet and acknowledgement sent).
@@ -42,5 +42,4 @@ Window Size = 2
For propagation time, I am going to use the following values:
( 0 = 3, 1 = 3, 2 = 4, 3 = 4, 4 = 5), and for simplicity's sake, I will mirror the propagation time there with the propagation time back for the acknowledgement.
-
![](Pasted%20image%2020231127121331.png)

View File

@@ -1,13 +1,17 @@
## Lecture 1 (12:00)
IEEE-754
- 32 and 64 bit numbers
- Float and double in java
- Promotes interoperability among programming languages
- 32 bit
- Leftmost bit is a sign bit (0=+ve 1=-ve)
- 8 bit exponent (127 bit unsigned binary number)
- 23 bit mantissa _without_ the 1 infront of the binary point
- 23 bit mantissa *without* the 1 infront of the binary point
### Scientific Notation
13.5 = 1101.1 = 1.1011x2 ^3
2.75 = 10110.11 = 1.011011x2 ^4
0.125 = 0.001 = 1x2 ^-3

View File

@@ -1,2 +1,3 @@
## Lecture 1 (12:00)
### sed
### Sed

View File

@@ -14,7 +14,7 @@ CREATE TABLE hospital (
);
```
2. **transplant_unit** Table
1. **transplant_unit** Table
Attributes:
`unit_id` (Primary Key)
`hospital_id` (Foreign Key referencing Hospital)
@@ -28,7 +28,7 @@ CREATE TABLE transplant_unit (
);
```
3. **organ** Table:
1. **organ** Table:
Attributes:
`organ_id` (Primary Key)
`organ_type`
@@ -40,7 +40,7 @@ CREATE TABLE organ (
);
```
4. **patient** Table:
1. **patient** Table:
Attributes:
`patient_id` (Primary Key)
`patient_name`
@@ -54,7 +54,7 @@ CREATE TABLE patient (
);
```
5. **donor** Table:
1. **donor** Table:
Attributes:
`donor_id` (Primary Key)
`donor_name`
@@ -68,7 +68,7 @@ CREATE TABLE donor (
);
```
6. **operation** Table
1. **operation** Table
Attributes:
`operation_id` (Primary Key)
`unit_id` (Foreign Key referencing TransplantUnit)

View File

@@ -13,7 +13,7 @@ VALUES ('h01', 'Royal Infirmary', 'Manchester', 'M13 1AB'),
('h04', 'Wythenshawe Hospital', 'Manchester', 'M22 4XD');
```
2. **transplant_unit** Table
1. **transplant_unit** Table
Attributes:
`unit_id` (Primary Key)
`hospital_id` (Foreign Key referencing Hospital)
@@ -28,7 +28,7 @@ VALUES ( 'u001', 'h01', 'Kidney (Renal)' ),
( 'u005', 'h04', 'Cardiothoracic' );
```
3. **organ** Table:
1. **organ** Table:
Attributes:
`organ_id` (Primary Key)
`organ_type`
@@ -42,7 +42,7 @@ VALUES ( 'o1', 'kidney' ),
( 'o5', 'liver' );
```
4. **patient** Table:
1. **patient** Table:
Attributes:
`patient_id` (Primary Key)
`patient_name`
@@ -55,7 +55,7 @@ VALUES ( 'p03', 'ben', 58 ),
( 'p05', 'joan', 50);
```
5. **donor** Table:
1. **donor** Table:
Attributes:
`donor_id` (Primary Key)
`donor_name`
@@ -71,7 +71,7 @@ VALUES ( 'd01', 'tom', 34 ),
( 'd06', 'rose', 34 );
```
6. **operation** Table
1. **operation** Table
Attributes:
`operation_id` (Primary Key)
`unit_id` (Foreign Key referencing TransplantUnit)

View File

@@ -1,4 +1,4 @@
3. List the names of patients who are at least fifty years old. Your query should always generate a list in which the names are sorted in alphabetical order. The ordering must not depend upon the order in which you entered data into your database.
1. List the names of patients who are at least fifty years old. Your query should always generate a list in which the names are sorted in alphabetical order. The ordering must not depend upon the order in which you entered data into your database.
```SQL
SELECT patient_name
@@ -9,7 +9,7 @@ ORDER BY patient_name;
![](Pasted%20image%2020231204184010.png)
4. List the name of each type of organ, together with the total number of donations of that type of organ.
1. List the name of each type of organ, together with the total number of donations of that type of organ.
```SQL
SELECT organ_type, COUNT( organ_type )
@@ -20,7 +20,7 @@ GROUP BY organ_type;
![](Pasted%20image%2020231204184814.png)
5. List the identifiers of hospitals where a transplant has been performed, together with the number of transplant operations at the hospital.
1. List the identifiers of hospitals where a transplant has been performed, together with the number of transplant operations at the hospital.
```SQL
SELECT hospital_id, COUNT( hospital_id )
@@ -31,7 +31,7 @@ GROUP BY hospital_id;
![](Pasted%20image%2020231204191255.png)
6. Output the age of the oldest person who has donated in a hospital in Manchester.
1. Output the age of the oldest person who has donated in a hospital in Manchester.
```SQL
SELECT age

View File

@@ -9,7 +9,7 @@ Attributes:
The Hospital table is in 1NF as values would be atomic with no repeating groups. It is in 2NF as all attributes are dependent on the primary key with no partial dependencies, and it is in 3NF as there are no transitive dependencies; all attributes exclusively depend on the primary key.
2. **TransplantUnit** Table:
1. **TransplantUnit** Table:
Attributes:
`UnitID` (Primary Key)
@@ -18,7 +18,7 @@ Attributes:
The TransplantUnit table is in 1NF as values would be atomic with no repeating groups. It is in 2NF as all attributes are dependent on the primary key with no partial dependencies, and it is in 3NF as there are no transitive dependencies; all attributes exclusively depend on the primary key.
3. **Organ** Table:
1. **Organ** Table:
Attributes:
`OrganID` (Primary Key)
@@ -26,7 +26,7 @@ Attributes:
The OrganType table is in 1NF as values would be atomic with no repeating groups. It is in 2NF as all attributes are dependent on the primary key with no partial dependencies, and it is in 3NF as there are no transitive dependencies; all attributes exclusively depend on the primary key.
4. **Donor** Table:
1. **Donor** Table:
Attributes:
`DonorID` (Primary Key)
@@ -34,7 +34,7 @@ Attributes:
`Age`
The Donor table is in 1NF as values would be atomic with no repeating groups. It is in 2NF as all attributes are dependent on the primary key with no partial dependencies, and it is in 3NF as there are no transitive dependencies; all attributes exclusively depend on the primary key.
5. **Patient** Table:
1. **Patient** Table:
Attributes:
`PatientID` (Primary Key)
@@ -43,7 +43,7 @@ Attributes:
The Patient table is in 1NF as values would be atomic with no repeating groups. It is in 2NF as all attributes are dependent on the primary key with no partial dependencies, and it is in 3NF as there are no transitive dependencies; all attributes exclusively depend on the primary key.
6. **Operation** Table:
1. **Operation** Table:
We need an Operations table to record / capture information related to the operations themselves. This should include an ID for the operation as a primary key, the ID of the unit it was conducted in, the ID of the organ type used, the ID of the donor and the ID of the patient. This allows us to establish proper relationships to the other tables, and allows for a comprehensive record of the transplant process.
This table also allows us to query easier, since all queries can be done on the one table to find essentially any information.

View File

@@ -1,4 +1,5 @@
1. **Hospital** Table
```SQL
CREATE TABLE hospital (
hospital_id CHAR(3) CONSTRAINT hID_pk PRIMARY KEY,
@@ -9,6 +10,7 @@ CREATE TABLE hospital (
```
2. **Transplant_Unit** Table
```SQL
CREATE TABLE transplant_unit (
unit_id CHAR(4) CONSTRAINT uID_pk PRIMARY KEY,
@@ -20,6 +22,7 @@ CREATE TABLE transplant_unit (
```
3. **Organ** Table:
```SQL
CREATE TABLE organ (
organ_id CHAR(3) CONSTRAINT oID_pk PRIMARY KEY,
@@ -28,6 +31,7 @@ CREATE TABLE organ (
```
4. **Patient** Table:
```SQL
CREATE TABLE patient (
patient_id CHAR(3) CONSTRAINT pID_pk PRIMARY KEY,
@@ -37,6 +41,7 @@ CREATE TABLE patient (
```
5. **Donor** Table:
```SQL
CREATE TABLE donor (
donor_id CHAR(3) CONSTRAINT dID_pk PRIMARY KEY,
@@ -46,6 +51,7 @@ CREATE TABLE donor (
```
6. **Operation** Table
```SQL
CREATE TABLE operation (
operation_id CHAR(3),

View File

@@ -169,6 +169,7 @@ SELECT origin FROM pirates;
## Workshop 1 (10:00)
- Implement the two tables using the SQL CREATE TABLE command.
```sql
CREATE TABLE employee(
empNo INTEGER PRIMARY KEY

View File

@@ -75,7 +75,7 @@ WHERE security-level = "normal"
ORDER BY age DESC;
```
2. List the name of each bank which has a branch whose address starts with the word Eccles. The list should not include any duplicates.
1. List the name of each bank which has a branch whose address starts with the word Eccles. The list should not include any duplicates.
```sql
SELECT DISTINCT name
@@ -84,7 +84,7 @@ WHERE Bank.bankID = Branch.bankID
AND address LIKE "Eccles*";
```
3. Calculate the average age of the ATMs with low or normal levels of security. Name the results column “Average age”.
1. Calculate the average age of the ATMs with low or normal levels of security. Name the results column “Average age”.
```sql
SELECT AVG(age) AS "Average Age"
@@ -92,35 +92,36 @@ FROM atm
WHERE security-level = "low" OR security-level = "normal";
```
4. Remove the tuple from the relation ATM whose identifier is atm04.
1. Remove the tuple from the relation ATM whose identifier is atm04.
```sql
DELETE FROM atm
WHERE atmID = "atm04";
```
5. Add a row for an ATM, whose atmID is atm05, whose security level is high and which is located at branch T1.
1. Add a row for an ATM, whose atmID is atm05, whose security level is high and which is located at branch T1.
```sql
INSERT INTO atm
VALUES ("atm05", "high", "0", "T1");
```
6. Add an attribute called telephone number to the relation Branch.
1. Add an attribute called telephone number to the relation Branch.
```sql
ALTER TABLE branch
ADD telephone CHAR(15)
```
7. Set the address of every branch to the value Salford.
1. Set the address of every branch to the value Salford.
```sql
UPDATE branch
SET address = "Salford";
```
1) Bank LEFT OUTER JOIN Branch
1. Bank LEFT OUTER JOIN Branch
```sql
SELECT *
FROM bank

View File

@@ -148,6 +148,7 @@ A car must have exactly one owner.
### Exercise 1
#### Part 1
Project -o---|-/\\- Order
\[1:M] \[o:m] Relationship
@@ -155,6 +156,7 @@ project(proj#, name, start-date, end-date)
order(order#, date, inquiry, proj#\*)
#### Part 2
Supplier -/\\-o---o-/\\- Part
\[M:M] \[o:o] Relationship
@@ -165,6 +167,7 @@ orderList(supplier#\*, part#\*)
- We must create a new composite table to contain the relation, since we cannot sustain the principles of foreign keys.
#### Part 3
Staff -/\\-|---|- Department
\[M:1] \[m:m] Relationship
@@ -174,6 +177,7 @@ department(dept-id, name, location)
- We would create dept-id as a foreign key in the staff table, as multiple values wont occur, and staff must be a part of a department in this scenario.
#### Part 4
Manager -|---|- Project
\[1:1] \[m:m] Relationship
@@ -183,6 +187,7 @@ project(proj-id, name, start-date, end-date)
- We could use either primary key for the alternate table's foreign key, since they are both mandatory and 1:1, so there would be no multiple values nor would there be null values.
#### Part 5
Manager -|---|-/\\- Team -|---|-/\\- Player
\[1:M] \[m:m] (Both) Relationship
@@ -193,6 +198,7 @@ player(player-id, name, address, tel-no, team-name*)
## Tutorial 2 (14:00)
#### Entities & Attributes
| Entities | Attributes |
|----------|------------|
| Regional Office | *regioncode*, name, location |
@@ -201,6 +207,7 @@ player(player-id, name, address, tel-no, team-name*)
| Role | *role_id*, level, role |
#### Relations
Role - \[1:M]\[m:o] - Member
Member - \[M:1]\[o:m] - Branch
Branch - \[M:1]\[m:m] - Region

View File

@@ -75,7 +75,7 @@ WHERE security-level = "normal"
ORDER BY age DESC;
```
2. List the name of each bank which has a branch whose address starts with the word Eccles. The list should not include any duplicates.
1. List the name of each bank which has a branch whose address starts with the word Eccles. The list should not include any duplicates.
```sql
SELECT DISTINCT name
@@ -84,7 +84,7 @@ WHERE Bank.bankID = Branch.bankID
AND address LIKE "Eccles*";
```
3. Calculate the average age of the ATMs with low or normal levels of security. Name the results column “Average age”.
1. Calculate the average age of the ATMs with low or normal levels of security. Name the results column “Average age”.
```sql
SELECT AVG(age) AS "Average Age"
@@ -92,35 +92,36 @@ FROM atm
WHERE security-level = "low" OR security-level = "normal";
```
4. Remove the tuple from the relation ATM whose identifier is atm04.
1. Remove the tuple from the relation ATM whose identifier is atm04.
```sql
DELETE FROM atm
WHERE atmID = "atm04";
```
5. Add a row for an ATM, whose atmID is atm05, whose security level is high and which is located at branch T1.
1. Add a row for an ATM, whose atmID is atm05, whose security level is high and which is located at branch T1.
```sql
INSERT INTO atm
VALUES ("atm05", "high", "0", "T1");
```
6. Add an attribute called telephone number to the relation Branch.
1. Add an attribute called telephone number to the relation Branch.
```sql
ALTER TABLE branch
ADD telephone CHAR(15)
```
7. Set the address of every branch to the value Salford.
1. Set the address of every branch to the value Salford.
```sql
UPDATE branch
SET address = "Salford";
```
1) Bank LEFT OUTER JOIN Branch
1. Bank LEFT OUTER JOIN Branch
```sql
SELECT *
FROM bank

View File

@@ -148,6 +148,7 @@ A car must have exactly one owner.
### Exercise 1
#### Part 1
Project -o---|-/\\- Order
\[1:M] \[o:m] Relationship
@@ -155,6 +156,7 @@ project(proj#, name, start-date, end-date)
order(order#, date, inquiry, proj#\*)
#### Part 2
Supplier -/\\-o---o-/\\- Part
\[M:M] \[o:o] Relationship
@@ -165,6 +167,7 @@ orderList(supplier#\*, part#\*)
- We must create a new composite table to contain the relation, since we cannot sustain the principles of foreign keys.
#### Part 3
Staff -/\\-|---|- Department
\[M:1] \[m:m] Relationship
@@ -174,6 +177,7 @@ department(dept-id, name, location)
- We would create dept-id as a foreign key in the staff table, as multiple values wont occur, and staff must be a part of a department in this scenario.
#### Part 4
Manager -|---|- Project
\[1:1] \[m:m] Relationship
@@ -183,6 +187,7 @@ project(proj-id, name, start-date, end-date)
- We could use either primary key for the alternate table's foreign key, since they are both mandatory and 1:1, so there would be no multiple values nor would there be null values.
#### Part 5
Manager -|---|-/\\- Team -|---|-/\\- Player
\[1:M] \[m:m] (Both) Relationship
@@ -193,6 +198,7 @@ player(player-id, name, address, tel-no, team-name*)
## Tutorial 2 (14:00)
#### Entities & Attributes
| Entities | Attributes |
|----------|------------|
| Regional Office | *regioncode*, name, location |
@@ -201,6 +207,7 @@ player(player-id, name, address, tel-no, team-name*)
| Role | *role_id*, level, role |
#### Relations
Role - \[1:M]\[m:o] - Member
Member - \[M:1]\[o:m] - Branch
Branch - \[M:1]\[m:m] - Region

View File

@@ -8,4 +8,3 @@
#### Steps to Set Goals
- Identify Goals -> Set Objectives -> List Obstacles -> Identify People -> List Skills -> Develop Plan -> List Benefits

View File

@@ -21,6 +21,7 @@ Loop Control:
- Update
for the amount of times in the length of the animalCount array, add the animalCount\[i] to the sum.
#### Example 2:
```java
@@ -47,4 +48,3 @@ i = 2, j = 1, 2, 3, 4 | 2, 4, 6, 8
i = 3, j = 1, 2, 3, 4 | 3, 6, 9, 12
- \\t represents a TAB character.

View File

@@ -13,5 +13,3 @@
- Value is lost when call completed
- Lifetime of an objects field variable is the lifetime of the object itself
- Accessor method allows access to the value of a field without changing the state of an object

View File

@@ -59,19 +59,25 @@ boolean iPositive = i>0; //TRUE
### Object and Memory Diagrams
- null = nothing
```java
Account account;
```
- This causes a memory location to be reserved for account.
```java
account = new Account(100);
```
- This causes account to be instantiated with a balance of 100
```java
Account account;
account = new Account(250);
account = new Account(700);
```
- After declaration and execution of the first assignment, the state of the memory diagram is:
- Account => Account (Balance = 250) => Account ~~(Balance 250)~~ (Balance 700).
- This is an example of Garbage Collection.

View File

@@ -1,9 +1,11 @@
## Lecture 2 (14:00)
### Sequential Execution
- Code usually executed in logical order.
- One exception is calling methods from other methods
ex.
```java
public void moveHorizontal( int distance )
{
@@ -12,4 +14,3 @@ public void moveHorizontal( int distance )
draw();
}
```

View File

@@ -6,9 +6,11 @@ Do not need to specify a size when we create a collection.
Add as many items without concern for space.
### ArrayList
- Imported from java.util
-
### ArrayList Methods
- get()
- remove()

View File

@@ -120,4 +120,3 @@
- Where no element is valid, `<div>` is still used.
- Any content outside of `<header>`, `<footer>` and `<aside>` is considered content, hence there is no "`<content>`" tag.
- `<main>` element is used to specify content however, but can only be used once and cannot be nested inside `<section>` or any similar element.
-

View File

@@ -198,8 +198,8 @@ In this example, `p#intro` text would be coloured green, even though `*` (all te
- We can specify hexadecimal RGB codes this way, using 2 characters for each channel.
- `#66CDAA32`, where `#RRGGBBAA` is used for RGBA, or `#RRGGBB` for RGB, we just convert from the decimal format of `rgba()`, to hexadecimal.
- All values are 2-bit hex values converted to 8-bit binary positive integers, ranging from 0 to 255.
- `#66CDAA32` - `rgba(102, 205, 170, 0.2)` - `hsla(159.612, 51%, 60%, 0.2)`
#### Colour Names
- In CSS, there are 140 hard coded colour names that can be found in several places.

View File

@@ -131,5 +131,3 @@ If we only specify 2 values, they will be treated as \[top/bottom] \[left/right]
- Browser will set the margin to the space it could take up, equally, on each side of the box.
Note: Older browsers may need the property `text-align` set to `centre` too.

View File

@@ -0,0 +1,16 @@
### [Relational Algebra - Recap](obsidian://open?vault=Computer%20Science%20Year%201&file=Semester%201%2FDatabase%20Systems%2FWeek%2010%2FWeek%2010)
- High level & procedural
- Defines how to build relations
#### Data Manipulation Language
- Provides set of operations
- Data retrieval - query language
- ex. SQL
#### Closure
- Operations work on one or more relations to define another relation without changing the original
- Both operands and results are relations, output from one operation can become the input for another operation.
- This allows nested expressions.