diff --git a/second/semester1/CT2106/CT2106-Slides.pdf b/second/semester1/CT2106/CT2106-Slides.pdf
new file mode 100644
index 00000000..23eac3d0
Binary files /dev/null and b/second/semester1/CT2106/CT2106-Slides.pdf differ
diff --git a/second/semester1/CT213/CT213-Labs.pdf b/second/semester1/CT213/CT213-Labs.pdf
new file mode 100644
index 00000000..aee8cfef
Binary files /dev/null and b/second/semester1/CT213/CT213-Labs.pdf differ
diff --git a/second/semester1/CT213/CT213-Slides.pdf b/second/semester1/CT213/CT213-Slides.pdf
new file mode 100644
index 00000000..cb7bc4f8
Binary files /dev/null and b/second/semester1/CT213/CT213-Slides.pdf differ
diff --git a/second/semester1/CT216/CT216-Slides.pdf b/second/semester1/CT216/CT216-Slides.pdf
new file mode 100644
index 00000000..461ac1ad
Binary files /dev/null and b/second/semester1/CT216/CT216-Slides.pdf differ
diff --git a/second/semester1/CT230/CT230-Slides.pdf b/second/semester1/CT230/CT230-Slides.pdf
new file mode 100644
index 00000000..9321b3cc
Binary files /dev/null and b/second/semester1/CT230/CT230-Slides.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/.gitignore b/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/misc.xml b/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/misc.xml
new file mode 100644
index 00000000..1133087f
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/modules.xml b/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/modules.xml
new file mode 100644
index 00000000..23fbca6d
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/uiDesigner.xml b/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/uiDesigner.xml
new file mode 100644
index 00000000..2b63946d
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/CT255-Assignment-2.iml b/second/semester1/CT255/Assessment/CT255-Assignment-1/CT255-Assignment-2.iml
new file mode 100644
index 00000000..c90834f2
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/CT255-Assignment-2.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/docs/CT255 Assignment 1(1).pdf b/second/semester1/CT255/Assessment/CT255-Assignment-1/docs/CT255 Assignment 1(1).pdf
new file mode 100644
index 00000000..e957ea10
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-1/docs/CT255 Assignment 1(1).pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/docs/CT255_Assignment_2___Breaking_Hash_Functions.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-1/docs/CT255_Assignment_2___Breaking_Hash_Functions.pdf
new file mode 100644
index 00000000..4f2a3f4a
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-1/docs/CT255_Assignment_2___Breaking_Hash_Functions.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/CT255 Assignment 1.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/CT255 Assignment 1.pdf
new file mode 100644
index 00000000..afd5ec20
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/CT255 Assignment 1.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/head.tex b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/head.tex
new file mode 100644
index 00000000..a312e8f6
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/head.tex
@@ -0,0 +1,50 @@
+\addtolength{\hoffset}{-2.25cm}
+\addtolength{\textwidth}{4.5cm}
+\addtolength{\voffset}{-3.25cm}
+\addtolength{\textheight}{5cm}
+\setlength{\parskip}{0pt}
+\setlength{\parindent}{0in}
+
+%----------------------------------------------------------------------------------------
+% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
+%----------------------------------------------------------------------------------------
+
+\usepackage{blindtext} % Package to generate dummy text
+\usepackage{charter} % Use the Charter font
+\usepackage[utf8]{inputenc} % Use UTF-8 encoding
+\usepackage{microtype} % Slightly tweak font spacing for aesthetics
+\usepackage[english, ngerman]{babel} % Language hyphenation and typographical rules
+\usepackage{amsthm, amsmath, amssymb} % Mathematical typesetting
+\usepackage{float} % Improved interface for floating objects
+\usepackage[final, colorlinks = true,
+ linkcolor = black,
+ citecolor = black]{hyperref} % For hyperlinks in the PDF
+\usepackage{graphicx, multicol} % Enhanced support for graphics
+\usepackage{xcolor} % Driver-independent color extensions
+\usepackage{marvosym, wasysym} % More symbols
+\usepackage{rotating} % Rotation tools
+\usepackage{censor} % Facilities for controlling restricted text
+\usepackage{listings, style/lstlisting} % Environment for non-formatted code, !uses style file!
+\usepackage{pseudocode} % Environment for specifying algorithms in a natural way
+\usepackage{style/avm} % Environment for f-structures, !uses style file!
+\usepackage{booktabs} % Enhances quality of tables
+\usepackage{tikz-qtree} % Easy tree drawing tool
+\tikzset{every tree node/.style={align=center,anchor=north},
+ level distance=2cm} % Configuration for q-trees
+\usepackage{style/btree} % Configuration for b-trees and b+-trees, !uses style file!
+\usepackage[backend=biber,style=numeric,
+ sorting=nyt]{biblatex} % Complete reimplementation of bibliographic facilities
+\addbibresource{ecl.bib}
+\usepackage{csquotes} % Context sensitive quotation facilities
+\usepackage[yyyymmdd]{datetime} % Uses YEAR-MONTH-DAY format for dates
+\renewcommand{\dateseparator}{-} % Sets dateseparator to '-'
+\usepackage{fancyhdr} % Headers and footers
+\pagestyle{fancy} % All pages have headers and footers
+\fancyhead{}\renewcommand{\headrulewidth}{0pt} % Blank out the default header
+\fancyfoot[L]{} % Custom footer text
+\fancyfoot[C]{} % Custom footer text
+\fancyfoot[R]{\thepage} % Custom footer text
+\newcommand{\note}[1]{\marginpar{\scriptsize \textcolor{red}{#1}}} % Enables comments in red on margin
+
+%----------------------------------------------------------------------------------------
+
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/main.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/main.pdf
new file mode 100644
index 00000000..9c9f58d6
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/main.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/main.run.xml b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/main.run.xml
new file mode 100644
index 00000000..c60e32b3
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/main.run.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+ latex
+
+ main.bcf
+
+
+ main.bbl
+
+
+ blx-dm.def
+ blx-compat.def
+ biblatex.def
+ standard.bbx
+ numeric.bbx
+ numeric.cbx
+ biblatex.cfg
+ german.lbx
+ ngerman.lbx
+ english.lbx
+
+
+
+ biber
+
+ biber
+ main
+
+
+ main.bcf
+
+
+
+ main.bbl
+
+
+ main.bcf
+
+
+ ecl.bib
+
+
+
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/main.tex b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/main.tex
new file mode 100644
index 00000000..a10edf89
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/latex/latex/main.tex
@@ -0,0 +1,121 @@
+\documentclass[a4paper]{article}
+\input{head}
+\begin{document}
+
+%-------------------------------
+% TITLE SECTION
+%-------------------------------
+
+\fancyhead[C]{}
+\hrule \medskip % Upper rule
+\begin{minipage}{0.295\textwidth}
+\raggedright
+\footnotesize
+Andrew Hayes \hfill\\
+21321503 \hfill\\
+a.hayes18@nuigalway.ie
+\end{minipage}
+\begin{minipage}{0.4\textwidth}
+\centering
+\large
+CT255 Assignment 1\\
+\normalsize
+GDPR\\
+\end{minipage}
+\begin{minipage}{0.295\textwidth}
+\raggedleft
+\today\hfill\\
+\end{minipage}
+\medskip\hrule
+\bigskip
+
+%-------------------------------
+% CONTENTS
+%-------------------------------
+
+\section{Problem 1}
+\subsection{What is GDPR?}
+The \textbf{General Data Protection Regulation (GDPR)} is a legal regulation in EU law pertaining to the protection of data within the European Union and the European Economic Area (EEA), and the protection of this data when it is transferred out of this region. GDPR applies to any organisation that is processing the personal data of individuals who are in the EEA, regardless of the location of said organisation or the citizenship / residence status of the individuals whose data is being processed. GDPR sets out several key principles in relation to the processing of personal data:
+
+\begin{itemize}
+ \item \textbf{Lawfulness -} You must identify a \textit{lawful basis} under the GDPR for the processing of personal data.
+ \item \textbf{Fairness \& Transparency -} You must be open \& honest with the Data Subjects about how and why their data is being processed, and you must not use this data in a way that doesn't align with these methods.
+ \item \textbf{Purpose Limitation -} You must clearly state your purposes for processing the personal data of Data Subjects from the start, and may only use the data for different purpose if it is either compatible with your original purpose, you get \textit{consent}, or if you have a \textit{clear basis} in law.
+ \item \textbf{Data Minimisation -} The personal data you process must be \textit{adequate}, \textit{relevant}, and \textit{limited} only to what is necessary.
+ \item \textbf{Accuracy -} Personal data should not be incorrect or misleading.
+ \item \textbf{Storage Limitation -} You must not keep personal data for longer than you need it.
+ \item \textbf{Integrity \& Confidentiality -} You must take appropriate technical \& organisational measures to ensure that the personal data of data subjects remains \textit{secure}.
+ \item \textbf{Accountability -} You must be able to demonstrate your compliance with GDPR.
+\end{itemize}
+\bigbreak
+
+All Data Processors (i.e., anyone who is responsible for the processing of personal information) are motivated to obey GDPR by threat of strict penalties. For particularly serious GDPR breaches, a Data Processor could be fined up to €20 million, or 4\% of the firm's global turnover. For less serious breaches, the Data Processor can be fined up to €10 million, or 2\% of the firm's global turnover.
+
+
+\subsection{Why was GDPR introduced? What was the motivation for this legislation?}
+GDPR was introduced with the aim of enhancing the rights \& control of individuals over their personal data and to simplify data processing regulations with regards to international businesses.
+\bigbreak
+As the processing of the personal data of individuals increases in the modern world with the advent of modern technology, it has became necessary to update the laws governing the processing of personal data to protect the interests of data subjects in an era of unprecedented data collection, surveillance, \& processing. GDPR sets out clear \& concise principles \& rules that determine who's personal data may be processed, what information this data may consist of, when it is acceptable to process it, where this data can be processed \& relocated to, why this data may or may not be processed, and how this data processing can be undertaken.
+\bigbreak
+The European Parliament adopted the GDPR in April 2016 to replace the then-outdated Data Protection Directive, which was first enacted in 1995.
+There were 2 main issues with the Data Protection Directive that made it necessary to replace it:
+\begin{enumerate}
+ \item Under EU law, a ``Directive'' is less strict than a ``Regulation''.
+ A Directive allows the EU member states to adapt \& change the law to fit the needs of their citizens, while a Regulation does not allow this.
+ A Regulation forces the member states to adopt it, and does not allow them to adapt or change it at all.
+ \item The Data Protection Directive was too outdated for the modern world.
+ It did not address how data is collected, stored, or transferred in the digital world, and thus largely failed to regulate digital data processing.
+\end{enumerate}
+
+\bigskip
+
+%------------------------------------------------
+
+\section{Problem 2}
+This company needs to be extremely careful with their GDPR compliance, as they are handling some extremely sensitive personal information.
+\newline\newline
+With regards to the GDPR key principle of \textbf{Lawfulness}, I think that this website is in the clear.
+Since the users are uploading their own data of their own volition, this gives the website a clear lawful basis for data processing - they have the \textit{consent} of the data subjects for the processing of their data.
+\newline\newline
+I do, however, have some concerns about the compliance of the company with GDPR key principle \textbf{Fairness \& Transparency}. The company is quite vague about how they process the personal data of the users, how the data is stored, etc.
+There is no mention of any kind of Data Protection Notice that informs the user of the identity \& contact details of the Data Controller, the contact details of the Data Protection officer, the details of any data transfer out of of the EEA or the safeguards in place, the data retention period, or the individual's rights.
+The only information that the Data Subjects really have is the purpose of the processing and (at least some of) the recipients of the data.
+It's possible that other people are in receipt of the users' personal data as well, but there is no mention of this.
+
+\bigbreak
+
+The company should be in the clear with regards to \textbf{Purpose Limitation}, assuming that they are being fully open \& honest about their purposes for processing the data, and stick to these purposes, but if they are not doing this, then that is a massive issue.
+\newline\newline
+The principle of \textbf{Data Minimisation} is a bit more of a grey area for this website.
+It's hard to say what data is and isn't adequate \& relevant to the purpose of "keeping in touch".
+Personally, I would be of the opinion that absolutely none of the data mentioned is relevant for the purposes of "keeping in touch", but it is plausible that some people would feel otherwise.
+It could be problematic for the company that they allow the users to upload pretty much whatever they want, as the company may end up in possession of a lot of irrelevant data that the users uploaded.
+The company needs to be extremely careful with receiving data that they didn't expect to receive, which may or may not be relevant to the purposes of the company.
+\newline\newline
+The principle of \textbf{Accuracy} is another potentially problematic one for this company.
+The company must take all reasonable steps to ensure that the personal data that they hold is not incorrect or misleading as to any matter of fact.
+It's not unlikely that some, if not many, of the users of the website will ``exaggerate'' (or just make up) positive aspects of their life after university, their salary, etc.
+There also doesn't seem to be any protocol to verify that the users are who they say they are, so anyone could be uploading the personal data, fictitious or otherwise, of anyone else, and this data could be viewed by anyone in the world, so long as they claimed to be an alumni of a particular course.
+This is a problem for the company, as they have the responsibility to ensure that the data is accurate, although this may be considered to be something that the company cannot reasonably be expected to regulate / control.
+\newline\newline
+The company does not seem to comply with the principle of \textbf{Storage Limitation} at all.
+There is no mention of data retention period, or how the users might be able to learn their data retention periods.
+\newline\newline
+Similarly, the company doesn't seem to comply with \textbf{Accountability \& Governance} at all either.
+There is no attempt to provide an assurance of GDPR compliance, or to explain why the data is held, when it will be deleted, and who may gain access to it.
+\newline\newline
+There is no mention of any attempt to comply with \textbf{Integrity \& Confidentiality} either.
+There is no mention of any security measure such as encryption, nor do they mention any other technical measures that they might use to process the data securely.
+
+\bigskip
+
+\section{References}
+\begin{enumerate}
+ \item Schukat, M. (2022-09-09). \textit{CT255 Lecture Slides - GDPR.} Blackboard.
+ \item Wolford, B. \textit{What is GDPR, the EU's new data protection law?} Proton. https://gdpr.eu/what-is-gdpr/
+ \item Sivula, A. \textit{GDPR: What Happens If You Don't Comply}. AMD Solicitors. https://amdsolicitors.com/gdpr-what-happens-if-you-dont-comply/
+ \item Rossow, A. \textit{The Birth of GDPR: What Is It And What You Need To Know}. Forbes\\ https://www.forbes.com/sites/andrewrossow/2018/05/25/the-birth-of-gdpr-what-is-it-and-what-you-need-to-know/?sh=62b80a5a55e5
+\end{enumerate}
+%------------------------------------------------
+
+\end{document}
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/src/CT255_HashFunction1.java b/second/semester1/CT255/Assessment/CT255-Assignment-1/src/CT255_HashFunction1.java
new file mode 100644
index 00000000..aaa287ca
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/src/CT255_HashFunction1.java
@@ -0,0 +1,97 @@
+//package ct255;
+
+import java.util.Random;
+
+public class CT255_HashFunction1 {
+
+ public static void main(String[] args) {
+ int res = 0;
+
+ if (args != null && args.length > 0) { // Check for value
+ res = hashF1(args[0]); // call hash function with
+ if (res < 0) { // Error
+ System.out.println("Error: must be 1 to 64 characters long.");
+ }
+ else {
+ System.out.println("input = " + args[0] + " : Hash = " + res);
+
+
+ System.out.println("Start searching for collisions");
+ int collisionCount = 0; // variable to count the number of collisions found
+
+ // string containing all possible ASCII characters (exclusding control characters such as [NULL])
+ String allChars = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
+
+ for (int i = 0; i < 100000; i++) { // checking one million randomly generated strings for hash collisions
+ StringBuilder str = new StringBuilder(); // creating a new StringBuilder to build char by char
+
+ // generating 64 random characters & appending them to str
+ for (int j = 0; j < 64; j++) {
+ char c = allChars.charAt(new Random().nextInt(allChars.length())); // selecting a random character from allChars
+ str.append(c); // appending the randomly selected character to str
+ }
+
+ // hashing str & checking if the hash matches res
+ if (hashF1(str.toString()) == res) {
+ collisionCount++; // iterating collisionCount if collision found
+ System.out.println(str); // printing the String that generated the collision
+ }
+ }
+
+ // printing the number of collisions found
+ System.out.printf("%d hash collisions found!", collisionCount);
+ }
+ }
+ else { // No
+ System.out.println("Use: CT255_HashFunction1 ");
+ }
+ }
+
+ private static int hashF1(String s){
+ int ret = -1, i;
+ int[] hashA = new int[]{1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; // i extended this array by 6 indices to make code more robust
+ // essentially, the extent of my improvements was just increasing the size of the hashA array
+
+ String filler, sIn;
+
+ filler = new String("ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGH");
+
+ if ((s.length() > 64) || (s.length() < 1)) { // String does not have required length
+ ret = -1;
+ }
+ else {
+ sIn = s + filler; // Add characters, now have "HABCDEF..."
+ sIn = sIn.substring(0, 64); // // Limit string to first 64 characters
+ // System.out.println(sIn); // FYI
+ for (i = 0; i < sIn.length(); i++){
+ char byPos = sIn.charAt(i); // get ith character
+ hashA[0] += (byPos * 17); // Note: A += B means A = A + B
+ hashA[1] += (byPos * 31);
+ hashA[2] += (byPos * 101);
+ hashA[3] += (byPos * 79);
+ hashA[4] += byPos * 83;
+ hashA[5] += byPos * 89;
+ hashA[6] += byPos * 103;
+ hashA[7] += byPos * 107;
+ hashA[8] += byPos * 109;
+ hashA[9] += byPos * 113;
+ }
+
+ hashA[0] %= 255; // % is the modulus operation, i.e. division with rest
+ hashA[1] %= 255;
+ hashA[2] %= 255;
+ hashA[3] %= 255;
+ hashA[4] %= 255;
+ hashA[5] %= 255;
+ hashA[6] %= 255;
+ hashA[7] %= 255;
+ hashA[8] %= 255;
+ hashA[9] %= 255;
+
+ ret = hashA[0] + (hashA[1] * 256) + (hashA[2] * 256 * 256) + (hashA[3] * 256 * 256 * 256) + (hashA[4] * 256*256*256*256) + (hashA[5] * 256*256*256*256*256) + (hashA[6] * 256*236*256*256*256*256)
+ + (hashA[6] * 256*256*256*256*256*256) + (hashA[7] * 256*256*256*256*256*256*256) + (hashA[8] * 256*256*256*256*256*256*256*256) + (hashA[9] * 256*256*256*256*256*256*256*256*256);
+ if (ret < 0) ret *= -1;
+ }
+ return ret;
+ }
+}
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/submission.zip b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission.zip
new file mode 100644
index 00000000..901be966
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission.zip differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/CT255_Assignment_2___Breaking_Hash_Functions.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/CT255_Assignment_2___Breaking_Hash_Functions.pdf
new file mode 100644
index 00000000..4f2a3f4a
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/CT255_Assignment_2___Breaking_Hash_Functions.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/CT255_HashFunction1.java b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/CT255_HashFunction1.java
new file mode 100644
index 00000000..aaa287ca
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/CT255_HashFunction1.java
@@ -0,0 +1,97 @@
+//package ct255;
+
+import java.util.Random;
+
+public class CT255_HashFunction1 {
+
+ public static void main(String[] args) {
+ int res = 0;
+
+ if (args != null && args.length > 0) { // Check for value
+ res = hashF1(args[0]); // call hash function with
+ if (res < 0) { // Error
+ System.out.println("Error: must be 1 to 64 characters long.");
+ }
+ else {
+ System.out.println("input = " + args[0] + " : Hash = " + res);
+
+
+ System.out.println("Start searching for collisions");
+ int collisionCount = 0; // variable to count the number of collisions found
+
+ // string containing all possible ASCII characters (exclusding control characters such as [NULL])
+ String allChars = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
+
+ for (int i = 0; i < 100000; i++) { // checking one million randomly generated strings for hash collisions
+ StringBuilder str = new StringBuilder(); // creating a new StringBuilder to build char by char
+
+ // generating 64 random characters & appending them to str
+ for (int j = 0; j < 64; j++) {
+ char c = allChars.charAt(new Random().nextInt(allChars.length())); // selecting a random character from allChars
+ str.append(c); // appending the randomly selected character to str
+ }
+
+ // hashing str & checking if the hash matches res
+ if (hashF1(str.toString()) == res) {
+ collisionCount++; // iterating collisionCount if collision found
+ System.out.println(str); // printing the String that generated the collision
+ }
+ }
+
+ // printing the number of collisions found
+ System.out.printf("%d hash collisions found!", collisionCount);
+ }
+ }
+ else { // No
+ System.out.println("Use: CT255_HashFunction1 ");
+ }
+ }
+
+ private static int hashF1(String s){
+ int ret = -1, i;
+ int[] hashA = new int[]{1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; // i extended this array by 6 indices to make code more robust
+ // essentially, the extent of my improvements was just increasing the size of the hashA array
+
+ String filler, sIn;
+
+ filler = new String("ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGH");
+
+ if ((s.length() > 64) || (s.length() < 1)) { // String does not have required length
+ ret = -1;
+ }
+ else {
+ sIn = s + filler; // Add characters, now have "HABCDEF..."
+ sIn = sIn.substring(0, 64); // // Limit string to first 64 characters
+ // System.out.println(sIn); // FYI
+ for (i = 0; i < sIn.length(); i++){
+ char byPos = sIn.charAt(i); // get ith character
+ hashA[0] += (byPos * 17); // Note: A += B means A = A + B
+ hashA[1] += (byPos * 31);
+ hashA[2] += (byPos * 101);
+ hashA[3] += (byPos * 79);
+ hashA[4] += byPos * 83;
+ hashA[5] += byPos * 89;
+ hashA[6] += byPos * 103;
+ hashA[7] += byPos * 107;
+ hashA[8] += byPos * 109;
+ hashA[9] += byPos * 113;
+ }
+
+ hashA[0] %= 255; // % is the modulus operation, i.e. division with rest
+ hashA[1] %= 255;
+ hashA[2] %= 255;
+ hashA[3] %= 255;
+ hashA[4] %= 255;
+ hashA[5] %= 255;
+ hashA[6] %= 255;
+ hashA[7] %= 255;
+ hashA[8] %= 255;
+ hashA[9] %= 255;
+
+ ret = hashA[0] + (hashA[1] * 256) + (hashA[2] * 256 * 256) + (hashA[3] * 256 * 256 * 256) + (hashA[4] * 256*256*256*256) + (hashA[5] * 256*256*256*256*256) + (hashA[6] * 256*236*256*256*256*256)
+ + (hashA[6] * 256*256*256*256*256*256) + (hashA[7] * 256*256*256*256*256*256*256) + (hashA[8] * 256*256*256*256*256*256*256*256) + (hashA[9] * 256*256*256*256*256*256*256*256*256);
+ if (ret < 0) ret *= -1;
+ }
+ return ret;
+ }
+}
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/image.png b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/image.png
new file mode 100644
index 00000000..a76881b5
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/image.png differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/image1.png b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/image1.png
new file mode 100644
index 00000000..924bc698
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-1/submission/image1.png differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/.idea/.gitignore b/second/semester1/CT255/Assessment/CT255-Assignment-2/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/.idea/misc.xml b/second/semester1/CT255/Assessment/CT255-Assignment-2/.idea/misc.xml
new file mode 100644
index 00000000..7505e256
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/.idea/modules.xml b/second/semester1/CT255/Assessment/CT255-Assignment-2/.idea/modules.xml
new file mode 100644
index 00000000..23fbca6d
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/CT255 Assignment 2.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-2/CT255 Assignment 2.pdf
new file mode 100644
index 00000000..94e993ba
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-2/CT255 Assignment 2.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/CT255-Assignment-2.iml b/second/semester1/CT255/Assessment/CT255-Assignment-2/CT255-Assignment-2.iml
new file mode 100644
index 00000000..b107a2dd
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/CT255-Assignment-2.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/CT255_Assignment_2___Rainbow_Tables.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-2/CT255_Assignment_2___Rainbow_Tables.pdf
new file mode 100644
index 00000000..b9885842
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-2/CT255_Assignment_2___Rainbow_Tables.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/RainbowTable.java b/second/semester1/CT255/Assessment/CT255-Assignment-2/RainbowTable.java
new file mode 100644
index 00000000..54db3faa
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/RainbowTable.java
@@ -0,0 +1,123 @@
+import java.util.HashMap;
+
+/* CT255 Assignment 2
+ * This class provides functionality to build rainbow tables (with a different reduction function per round) for 8 character long strings, which
+ consist of the symbols "a .. z", "A .. Z", "0 .. 9", "!" and "#" (64 symbols in total).
+ Properly used, it creates the following value pairs (start value - end value) after 10,000 iterations of hashFunction() and reductionFunction():
+ start value - end value
+ Kermit12 lsXcRAuN
+ Modulus! L2rEsY8h
+ Pigtail1 R0NoLf0w
+ GalwayNo 9PZjwF5c
+ Trumpets !oeHRZpK
+ HelloPat dkMPG7!U
+ pinky##! eDx58HRq
+ 01!19!56 vJ90ePjV
+ aaaaaaaa rLtVvpQS
+ aaaaaaaa klQ6IeQJ
+
+
+ *
+ * @author Michael Schukat
+ * @version 1.0
+ */
+public class RainbowTable
+{
+ public static void main(String[] args) {
+ long res = 0;
+
+ // String array of the known passwords
+ String[] passwords = {"Kermit12", "Modulus!", "Pigtail1", "GalwayNo", "Trumpets", "HelloPat", "pinky##!", "01!19!56", "aaaaaaaa", "aaaaaaaa"};
+
+ HashMap rainbowTable = new HashMap<>(); // declaring a HashTable that i'll use to store the password : hash pairs
+
+
+ // looping through the passwords array
+ for (String start : passwords) {
+ if (start.length() != 8) {
+ System.out.println("Input " + start + " must be 8 characters long - Exit");
+ }
+ else {
+ String hash = start; // declaring a String hash that will hold the final reduced hash of a given password
+
+ // hashing & reducing the start String 10000 times.
+ for (int i = 0; i < 10000; i++) {
+ hash = reductionFunction((hashFunction(hash)), i);
+ }
+
+ // adding the password & its hash value to the rainbowTable HashMap
+ rainbowTable.put(start, hash);
+ }
+ }
+ // printing out the contents of the rainbowTable
+ System.out.println(rainbowTable);
+
+ // chain lookup section
+ // long array of the 4 hashes to be searched for
+ long[] hashes = {895210601874431214L, 750105908431234638L, 111111111115664932L, 977984261343652499L};
+
+ // for each loop that loops through each hash in the array of hashes
+ for (long hash : hashes) {
+
+ // looping 10000 times to search for the password - this will function as our max number of iterations, as 10000 iterations should just take use back to where we started.
+ for (int i = 0; i < 10000; i++) {
+ // reducing the hash
+ String str = reductionFunction(hash, i);
+ System.out.println(hash + " : " + str);
+ // checking if the reduced hash is a value (final plaintext) in the rainbowTable HashMap
+ if (rainbowTable.containsValue(str)) {
+ System.out.println("Found password " + str + " for hash value " + hash); // printing the found password
+ break; // breaking out of the for loop
+ }
+ else {
+ hash = hashFunction(str); // hashing str before continuing the for loop
+ }
+ }
+ }
+ }
+
+ private static long hashFunction(String s){
+ long ret = 0;
+ int i;
+ long[] hashA = new long[]{1, 1, 1, 1};
+
+ String filler, sIn;
+
+ int DIV = 65536;
+
+ filler = new String("ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGH");
+
+ sIn = s + filler; // Add characters, now have "HABCDEF..."
+ sIn = sIn.substring(0, 64); // Limit string to first 64 characters
+
+ for (i = 0; i < sIn.length(); i++) {
+ char byPos = sIn.charAt(i); // get i'th character
+ hashA[0] += (byPos * 17111); // Note: A += B means A = A + B
+ hashA[1] += (hashA[0] + byPos * 31349);
+ hashA[2] += (hashA[1] - byPos * 101302);
+ hashA[3] += (byPos * 79001);
+ }
+
+ ret = (hashA[0] + hashA[2]) + (hashA[1] * hashA[3]);
+ if (ret < 0) ret *= -1;
+ return ret;
+ }
+
+ private static String reductionFunction(long val, int round) { // Note that for the first function call "round" has to be 0,
+ String car, out; // and has to be incremented by one with every subsequent call.
+ int i; // I.e. "round" created variations of the reduction function.
+ char dat;
+
+ car = new String("0123456789ABCDEFGHIJKLMNOPQRSTUNVXYZabcdefghijklmnopqrstuvwxyz!#");
+ out = new String("");
+
+ for (i = 0; i < 8; i++) {
+ val -= round;
+ dat = (char) (val % 63);
+ val = val / 83;
+ out = out + car.charAt(dat);
+ }
+
+ return out;
+ }
+}
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/head.tex b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/head.tex
new file mode 100644
index 00000000..395f2b28
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/head.tex
@@ -0,0 +1,49 @@
+\addtolength{\hoffset}{-2.25cm}
+\addtolength{\textwidth}{4.5cm}
+\addtolength{\voffset}{-3.25cm}
+\addtolength{\textheight}{5cm}
+\setlength{\parskip}{0pt}
+\setlength{\parindent}{0in}
+
+%----------------------------------------------------------------------------------------
+% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
+%----------------------------------------------------------------------------------------
+
+\usepackage{blindtext} % Package to generate dummy text
+\usepackage{charter} % Use the Charter font
+\usepackage[utf8]{inputenc} % Use UTF-8 encoding
+\usepackage{microtype} % Slightly tweak font spacing for aesthetics
+\usepackage[english, ngerman]{babel} % Language hyphenation and typographical rules
+\usepackage{amsthm, amsmath, amssymb} % Mathematical typesetting
+\usepackage{float} % Improved interface for floating objects
+\usepackage[final, colorlinks = true,
+ linkcolor = black,
+ citecolor = black]{hyperref} % For hyperlinks in the PDF
+\usepackage{graphicx, multicol} % Enhanced support for graphics
+\usepackage{xcolor} % Driver-independent color extensions
+\usepackage{marvosym, wasysym} % More symbols
+\usepackage{rotating} % Rotation tools
+\usepackage{censor} % Facilities for controlling restricted text
+\usepackage{listings, style/lstlisting} % Environment for non-formatted code, !uses style file!
+\usepackage{pseudocode} % Environment for specifying algorithms in a natural way
+\usepackage{style/avm} % Environment for f-structures, !uses style file!
+\usepackage{booktabs} % Enhances quality of tables
+\usepackage{tikz-qtree} % Easy tree drawing tool
+\tikzset{every tree node/.style={align=center,anchor=north},
+ level distance=2cm} % Configuration for q-trees
+\usepackage{style/btree} % Configuration for b-trees and b+-trees, !uses style file!
+\usepackage[backend=biber,style=numeric,
+ sorting=nyt]{biblatex} % Complete reimplementation of bibliographic facilities
+\addbibresource{ecl.bib}
+\usepackage{csquotes} % Context sensitive quotation facilities
+\usepackage[yyyymmdd]{datetime} % Uses YEAR-MONTH-DAY format for dates
+\renewcommand{\dateseparator}{-} % Sets dateseparator to '-'
+\usepackage{fancyhdr} % Headers and footers
+\pagestyle{fancy} % All pages have headers and footers
+\fancyhead{}\renewcommand{\headrulewidth}{0pt} % Blank out the default header
+\fancyfoot[L]{} % Custom footer text
+\fancyfoot[C]{} % Custom footer text
+\fancyfoot[R]{\thepage} % Custom footer text
+\newcommand{\note}[1]{\marginpar{\scriptsize \textcolor{red}{#1}}} % Enables comments in red on margin
+
+%----------------------------------------------------------------------------------------
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/image.png b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/image.png
new file mode 100644
index 00000000..70c38797
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/image.png differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/image1.png b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/image1.png
new file mode 100644
index 00000000..924bc698
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/image1.png differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/main.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/main.pdf
new file mode 100644
index 00000000..06992f2b
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/main.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/main.run.xml b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/main.run.xml
new file mode 100644
index 00000000..ef627f13
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/main.run.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+ latex
+
+ main.bcf
+
+
+ main.bbl
+
+
+ blx-dm.def
+ blx-compat.def
+ biblatex.def
+ standard.bbx
+ numeric.bbx
+ numeric.cbx
+ biblatex.cfg
+ german.lbx
+ ngerman.lbx
+ english.lbx
+
+
+
+ biber
+
+ biber
+ main
+
+
+ main.bcf
+
+
+
+ main.bbl
+
+
+ main.bcf
+
+
+ ecl.bib
+
+
+
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/main.tex b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/main.tex
new file mode 100644
index 00000000..1e0df2cd
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/main.tex
@@ -0,0 +1,281 @@
+\documentclass[a4paper]{article}
+\input{head}
+\begin{document}
+
+%-------------------------------
+% TITLE SECTION
+%-------------------------------
+
+\fancyhead[C]{}
+\hrule \medskip % Upper rule
+\begin{minipage}{0.295\textwidth}
+\raggedright
+\footnotesize
+Andrew Hayes \hfill\\
+21321503 \hfill\\
+a.hayes18@nuigalway.ie
+\end{minipage}
+\begin{minipage}{0.4\textwidth}
+\centering
+\large
+CT255 Assignment 2\\
+\normalsize
+Rainbow Tables\\
+\end{minipage}
+\begin{minipage}{0.295\textwidth}
+\raggedleft
+\today\hfill\\
+\end{minipage}
+\medskip\hrule
+\bigskip
+
+%-------------------------------
+% CONTENTS
+%-------------------------------
+
+\section{Problem 1}
+\subsection{Code}
+\begin{lstlisting}[language=Java]
+import java.util.HashMap;
+
+/* CT255 Assignment 2
+ * This class provides functionality to build rainbow tables (with a different reduction function per round) for 8 character long strings, which
+ consist of the symbols "a .. z", "A .. Z", "0 .. 9", "!" and "#" (64 symbols in total).
+ Properly used, it creates the following value pairs (start value - end value) after 10,000 iterations of hashFunction() and reductionFunction():
+ start value - end value
+ Kermit12 lsXcRAuN
+ Modulus! L2rEsY8h
+ Pigtail1 R0NoLf0w
+ GalwayNo 9PZjwF5c
+ Trumpets !oeHRZpK
+ HelloPat dkMPG7!U
+ pinky##! eDx58HRq
+ 01!19!56 vJ90ePjV
+ aaaaaaaa rLtVvpQS
+ aaaaaaaa klQ6IeQJ
+
+
+ *
+ * @author Michael Schukat
+ * @version 1.0
+ */
+public class RainbowTable
+{
+ public static void main(String[] args) {
+ long res = 0;
+
+ // String array of the known passwords
+ String[] passwords = {"Kermit12", "Modulus!", "Pigtail1", "GalwayNo", "Trumpets", "HelloPat", "pinky##!", "01!19!56", "aaaaaaaa", "aaaaaaaa"};
+
+ HashMap rainbowTable = new HashMap<>(); // declaring a HashTable that i'll use to store the password : hash pairs
+
+
+ // looping through the passwords array
+ for (String start : passwords) {
+ if (start.length() != 8) {
+ System.out.println("Input " + start + " must be 8 characters long - Exit");
+ }
+ else {
+ String hash = start; // declaring a String hash that will hold the final reduced hash of a given password
+
+ // hashing & reducing the start String 10000 times.
+ for (int i = 0; i < 10000; i++) {
+ hash = reductionFunction((hashFunction(hash)), i);
+ }
+
+ // adding the password & its hash value to the rainbowTable HashMap
+ rainbowTable.put(start, hash);
+ }
+ }
+ // printing out the contents of the rainbowTable
+ System.out.println(rainbowTable);
+ }
+
+ private static long hashFunction(String s){
+ long ret = 0;
+ int i;
+ long[] hashA = new long[]{1, 1, 1, 1};
+
+ String filler, sIn;
+
+ int DIV = 65536;
+
+ filler = new String("ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGH");
+
+ sIn = s + filler; // Add characters, now have "HABCDEF..."
+ sIn = sIn.substring(0, 64); // // Limit string to first 64 characters
+
+ for (i = 0; i < sIn.length(); i++) {
+ char byPos = sIn.charAt(i); // get i'th character
+ hashA[0] += (byPos * 17111); // Note: A += B means A = A + B
+ hashA[1] += (hashA[0] + byPos * 31349);
+ hashA[2] += (hashA[1] - byPos * 101302);
+ hashA[3] += (byPos * 79001);
+ }
+
+ ret = (hashA[0] + hashA[2]) + (hashA[1] * hashA[3]);
+ if (ret < 0) ret *= -1;
+ return ret;
+ }
+
+ private static String reductionFunction(long val, int round) { // Note that for the first function call "round" has to be 0,
+ String car, out; // and has to be incremented by one with every subsequent call.
+ int i; // I.e. "round" created variations of the reduction function.
+ char dat;
+
+ car = new String("0123456789ABCDEFGHIJKLMNOPQRSTUNVXYZabcdefghijklmnopqrstuvwxyz!#");
+ out = new String("");
+
+ for (i = 0; i < 8; i++) {
+ val -= round;
+ dat = (char) (val % 63);
+ val = val / 83;
+ out = out + car.charAt(dat);
+ }
+
+ return out;
+ }
+}
+\end{lstlisting}
+
+\subsection{Output}
+\includegraphics[width = 16cm]{image.png}
+
+\bigskip
+
+%------------------------------------------------
+
+\section{Problem 2}
+\subsection{Code}
+\begin{lstlisting}[language=java]
+import java.util.HashMap;
+
+/* CT255 Assignment 2
+ * This class provides functionality to build rainbow tables (with a different reduction function per round) for 8 character long strings, which
+ consist of the symbols "a .. z", "A .. Z", "0 .. 9", "!" and "#" (64 symbols in total).
+ Properly used, it creates the following value pairs (start value - end value) after 10,000 iterations of hashFunction() and reductionFunction():
+ start value - end value
+ Kermit12 lsXcRAuN
+ Modulus! L2rEsY8h
+ Pigtail1 R0NoLf0w
+ GalwayNo 9PZjwF5c
+ Trumpets !oeHRZpK
+ HelloPat dkMPG7!U
+ pinky##! eDx58HRq
+ 01!19!56 vJ90ePjV
+ aaaaaaaa rLtVvpQS
+ aaaaaaaa klQ6IeQJ
+
+
+ *
+ * @author Michael Schukat
+ * @version 1.0
+ */
+public class RainbowTable
+{
+ public static void main(String[] args) {
+ long res = 0;
+
+ // String array of the known passwords
+ String[] passwords = {"Kermit12", "Modulus!", "Pigtail1", "GalwayNo", "Trumpets", "HelloPat", "pinky##!", "01!19!56", "aaaaaaaa", "aaaaaaaa"};
+
+ HashMap rainbowTable = new HashMap<>(); // declaring a HashTable that i'll use to store the password : hash pairs
+
+
+ // looping through the passwords array
+ for (String start : passwords) {
+ if (start.length() != 8) {
+ System.out.println("Input " + start + " must be 8 characters long - Exit");
+ }
+ else {
+ String hash = start; // declaring a String hash that will hold the final reduced hash of a given password
+
+ // hashing & reducing the start String 10000 times.
+ for (int i = 0; i < 10000; i++) {
+ hash = reductionFunction((hashFunction(hash)), i);
+ }
+
+ // adding the password & its hash value to the rainbowTable HashMap
+ rainbowTable.put(start, hash);
+ }
+ }
+ // printing out the contents of the rainbowTable
+ System.out.println(rainbowTable);
+
+ // chain lookup section
+ // long array of the 4 hashes to be searched for
+ long[] hashes = {895210601874431214L, 750105908431234638L, 111111111115664932L, 977984261343652499L};
+
+ // for each loop that loops through each hash in the array of hashes
+ for (long hash : hashes) {
+
+ // looping 10000 times to search for the password - this will function as our max number of iterations, as 10000 iterations should just take use back to where we started.
+ for (int i = 0; i < 10000; i++) {
+ // reducing the hash
+ String str = reductionFunction(hash, i);
+ // checking if the reduced hash is a key (password) in the rainbowTable HashMap
+ if (rainbowTable.containsValue(str)) {
+ System.out.println("Found password " + str + " for hash value " + hash); // printing the found password
+ break; // breaking out of the for loop
+ }
+ else {
+ hash = hashFunction(str); // hashing str before continuing the for loop
+ }
+ }
+ }
+ }
+
+ private static long hashFunction(String s){
+ long ret = 0;
+ int i;
+ long[] hashA = new long[]{1, 1, 1, 1};
+
+ String filler, sIn;
+
+ int DIV = 65536;
+
+ filler = new String("ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGH");
+
+ sIn = s + filler; // Add characters, now have "HABCDEF..."
+ sIn = sIn.substring(0, 64); // // Limit string to first 64 characters
+
+ for (i = 0; i < sIn.length(); i++) {
+ char byPos = sIn.charAt(i); // get i'th character
+ hashA[0] += (byPos * 17111); // Note: A += B means A = A + B
+ hashA[1] += (hashA[0] + byPos * 31349);
+ hashA[2] += (hashA[1] - byPos * 101302);
+ hashA[3] += (byPos * 79001);
+ }
+
+ ret = (hashA[0] + hashA[2]) + (hashA[1] * hashA[3]);
+ if (ret < 0) ret *= -1;
+ return ret;
+ }
+
+ private static String reductionFunction(long val, int round) { // Note that for the first function call "round" has to be 0,
+ String car, out; // and has to be incremented by one with every subsequent call.
+ int i; // I.e. "round" created variations of the reduction function.
+ char dat;
+
+ car = new String("0123456789ABCDEFGHIJKLMNOPQRSTUNVXYZabcdefghijklmnopqrstuvwxyz!#");
+ out = new String("");
+
+ for (i = 0; i < 8; i++) {
+ val -= round;
+ dat = (char) (val % 63);
+ val = val / 83;
+ out = out + car.charAt(dat);
+ }
+
+ return out;
+ }
+}
+
+\end{lstlisting}
+\subsection{Output}
+I couldn't actually find a password match with the above code, and I'm not sure why. My current guess would be that the reduction function wasn't being called properly, as everything else \textit{seemed} to be working as expected. I didn't call the reduction more than 10,000 times as that would theoretically just lead me back to the same place in the chain. I think that my problem is with the passing of the integer \verb|i| to the reduction function, as I think that I correctly implemented the rest of the steps for performing a chain lookup - I input a hash value, reduce it, check if the reduced form is in the list of final plaintexts (the ``Values'' in the HashMap), and if so break out of the loop (but this never occurs), assigning the relevant ``Key'' from the HashMap as the original plaintext password that produced the original input hash. Otherwise, I continue until I'm back at the same place in the chain after the 10,000\textsuperscript{th} iteration, where the code gives up.
+
+\bigskip
+
+\includegraphics[width = 16cm]{image.png}
+\end{document}
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/avm.sty b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/avm.sty
new file mode 100644
index 00000000..a872483c
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/avm.sty
@@ -0,0 +1,165 @@
+% avm.sty -- for attribute-value matrices -- mar 29, 1992; rev. dec 6, 1993
+% (c) 1992 christopher manning (manning@csli.stanford.edu) -- see avm.doc.tex
+
+\newif\ifavmactive\newif\ifavmsorted\newif\ifavmlabeled
+\newif\ifavmcenter\newif\ifavmbottom
+\newif\ifavmbottomright\newif\ifavmtopleft\newif\ifavmtopright
+
+\newdimen\avmdimen
+\newbox\avmboxone\newbox\avmboxthree
+
+\def\avmoptions#1{\avmactivefalse\avmsortedfalse\avmlabeledfalse
+ \avmcenterfalse\avmbottomfalse
+ \avmbottomrightfalse\avmtopleftfalse\avmtoprightfalse
+ \def\more{#1}\ifx\more\empty\else\avmjoptions#1,\@nil\fi}
+\def\avmjoptions#1,#2\@nil{\def\more{#2}\csname avm#1true\endcsname
+ \ifx\more\empty\else\avmjoptions#2\@nil\fi}
+
+
+\def\avmfont#1{\def\avmjfont{#1}}
+\def\avmjfont{}
+
+\def\avmvalfont#1{\def\avmjvalfont{#1}}
+\def\avmjvalfont{}
+
+\def\avmsortfont#1{\def\avmjsortfont{#1}}
+\def\avmjsortfont{}
+
+\def\avmhskip#1{\def\avmjhskip{#1}}
+\def\avmjhskip{1em}
+
+\def\avmbskip#1{\def\avmjbskip{#1}}
+\def\avmjbskip{0em}
+
+\def\avmvskip#1{\def\avmjvskip{#1}}
+\def\avmjvskip{0.385ex}%was .3875
+
+
+\def\avmjprolog#1{$\mskip-\thinmuskip
+ \left#1\hskip\avmjbskip\vcenter\bgroup\vskip\avmjvskip
+ \ialign\bgroup\avmjfont
+ \strut ##\unskip\hfil
+ &&\hskip\avmjhskip\avmjvalfont ##\unskip\hfil\cr}
+\def\avmjpostlog#1{\crcr\egroup\vskip\avmjvskip\egroup
+ \hskip\avmjbskip\right#1\mskip-\thinmuskip$\ignorespaces}
+
+
+\def\avmjcatcode{\let\lparen=(\let\rparen=)\catcode`\[=13\catcode`\]=13
+ \catcode`\<=13\catcode`\@=13\catcode`\(=13\catcode`\)=13
+ \catcode`\>=13\catcode`\|=13}
+
+{\avmjcatcode % new group: redefine above catcodes as active
+
+\gdef\specialavm{\avmjcatcode
+\def({\avmjprolog\lparen}%
+\def){\avmjpostlog\rparen}%
+\def<{\avmjprolog\langle}%
+\def>{\avmjpostlog\rangle}%
+\ifavmsorted
+\def[##1{\setbox\avmboxthree=\hbox{\avmjsortfont##1\/}\setbox2=\hbox
+ \bgroup\avmjprolog\lbrack}%
+\def]{\avmjpostlog\rbrack\egroup\avmjsort}%
+\else\ifavmlabeled
+\def[##1{\def\more{##1}\setbox2=\hbox\bgroup\avmjprolog[}%
+\def]{\avmjpostlog]\egroup\node{\more}{\box2}}%
+\else
+\def[{\avmjprolog\lbrack}%
+\def]{\avmjpostlog\rbrack}%
+\fi\fi
+%
+\def\<{$\langle$}\def\>{$\rangle$}%
+\def\({\lparen}\def\){\rparen}%
+\def\[{\lbrack}\def\]{\rbrack}%
+\def|{$\,\vert\,$}%
+\def@##1{\avmbox{##1}}%
+} % end defn of \specialavm
+} % restore active catcodes
+
+
+\long\def\avm{\begingroup
+\ifavmactive\specialavm
+\else
+\def\({\avmjprolog(}%
+\def\){\avmjpostlog)}%
+\def\<{\avmjprolog\langle}%
+\def\>{\avmjpostlog\rangle}%
+%
+\ifavmsorted
+\def\[##1{\setbox\avmboxthree=\hbox{\avmjsortfont##1\/}\setbox
+ 2=\hbox\bgroup\avmjprolog[}%
+\def\]{\avmjpostlog]\egroup\avmjsort}%
+\else\ifavmlabeled
+\def\[##1{\def\more{##1}\setbox2=\hbox\bgroup\avmjprolog[}%
+\def\]{\avmjpostlog]\egroup\node{\more}{\box2}}%
+\else
+\def\[{\avmjprolog[}%
+\def\]{\avmjpostlog]}%
+\fi\fi
+%
+\def\|{$\,\vert\,$}%
+\def\@##1{\avmbox{##1}}%
+\fi % end not active
+%
+\ifx\LaTeX\undefined\def\\{\cr}% running under TeX
+\else \def\\{\@tabularcr}% Leverage off LaTeX's \\*[dimen] options
+\fi
+\def\!{\node}%
+\long\def\avmjsort{\dimen2=\ht2\advance\dimen2 by -.25\baselineskip
+ \global\dimen\avmdimen=\wd\avmboxthree
+ \ifavmtopleft \raise\dimen2\llap{\box\avmboxthree}\box2%
+ \else\ifavmtopright \box2\raise\dimen2\box\avmboxthree%
+ \else\ifavmbottomright \box2\lower\dimen2\box\avmboxthree%
+ \else \lower\dimen2\llap{\box\avmboxthree}\box2%
+ \fi\fi\fi}%
+\long\def\sort##1##2{\setbox2=\hbox{##2}\setbox
+ \avmboxthree=\hbox{\avmjsortfont##1\/}\dimen2=\ht2
+ \advance\dimen2 by -.25\baselineskip
+ \ifavmtopleft \raise\dimen2\box\avmboxthree\box2%
+ \else\ifavmtopright \box2\raise\dimen2\box\avmboxthree%
+ \else\ifavmbottomright \box2\lower\dimen2\box\avmboxthree%
+ \else \lower\dimen2\box\avmboxthree\box2%
+ \fi\fi\fi}%
+\long\def\osort##1##2{\setbox2=\hbox{##2}\setbox
+ \avmboxthree=\hbox{\avmjsortfont ##1\/}\avmjsort}%
+\def\avml{\avmjprolog.}%
+\def\avmr{\avmjpostlog.}%
+\def\avmb##1{\node{##1}{\lbrack\;\rbrack}}%
+\def\avmd##1{\node{##1}{---}}%
+\def\q##1{\ifx ##1\{$\lbrace$\else
+ \ifx ##1\}$\rbrace$\else
+ \ifx ##1<$\langle$\else
+ \ifx ##1>$\rangle$\fi \fi \fi \fi}%
+\def\{{\avmjprolog\lbrace}%
+\def\}{\avmjpostlog\rbrace}%
+\def\;{\hskip\avmjhskip}%
+\def\avmspan##1{\multispan2\strut ##1\expandafter\hfil}%
+\avmjfont
+\openup\avmjvskip
+\setbox\avmboxone=\hbox\bgroup\ignorespaces
+} % end defn of \avm
+
+
+\def\endavm{\egroup\ifvmode\leavevmode\fi % this if is useful!
+ \ifavmsorted\null\hskip\dimen\avmdimen\fi
+ \ifavmcenter
+ \box\avmboxone
+ \else \ifavmbottom
+ \lower.575\baselineskip\hbox{\vbox{\box\avmboxone\null}}%
+ \else
+% the next bit is ripped off from Emma's \evnup in lingmacros.sty
+ \dimen2=\ht\avmboxone\advance\dimen2 by -.725\baselineskip
+ \lower\dimen2\box\avmboxone
+\fi \fi \endgroup}
+
+
+% based on TeXbook exercise 21.3
+\def\avmbox#1{\setbox2=\hbox{$\scriptstyle #1$}\lower.2ex\vbox{\hrule
+ \hbox{\vrule\kern1.25pt
+ \vbox{\kern1.25pt\box2\kern1.25pt}\kern1.25pt\vrule}\hrule}}
+
+% ============ COSTOM CONFIGURATION =============
+\avmfont{\sc}
+\avmoptions{sorted,active}
+\avmvalfont{\rm}
+\avmsortfont{\scriptsize\it}
+% ===============================================
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/btree.sty b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/btree.sty
new file mode 100644
index 00000000..edec4533
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/btree.sty
@@ -0,0 +1,131 @@
+%% Last Modified: Thu Oct 18 18:26:25 2007.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{style/btree}
+\typeout{Document Style `weiw_BTree - Support drawing B+-Tree (ver 0.999)}
+
+\RequirePackage{tikz}
+\RequirePackage{ifthen}
+
+% use libraries
+\usetikzlibrary{arrows,shapes,decorations,matrix}
+
+
+%% global declaration
+\tikzstyle{btreeptr} = [draw, semithick, minimum height=2em]
+\tikzstyle{btreeval} = [draw, semithick, minimum size=2em]
+\tikzstyle{btreevale} = [draw,semithick, minimum size=2em]
+\tikzstyle{btlink} = [draw, semithick, ->, >=triangle 45]
+
+%% macro
+%% helper macros
+\newcommand{\suppressemptystr}[1]{% leave blank for entries in leaf nodes
+ \ifthenelse{\equal{#1}{}}%
+ {%
+ \relax%
+ }%
+ % Else
+ {%
+ #1\textsuperscript{*}%
+ }%
+}%
+
+\newcommand{\xyshift}[3]{% help to place the nodes
+ \begin{scope}[xshift=#1, yshift=#2]
+ #3
+ \end{scope}%
+}
+
+%% Common btree macros
+\newcommand{\btreelink}[2]{% #1: src node; #2: dest node;
+ \draw[btlink] ([yshift=3pt] #1.south) -- (#2-b.north);
+}
+
+\newcommand{\btreelinknorth}[2]{% #1: src node; #2: dest node;
+ \draw[btlink] ([yshift=3pt] #1.south) -- (#2.north);
+}
+
+\newcommand{\btreetriangle}[2]{% #1: node name; #2 text inside
+ \node[anchor=north, regular polygon, regular polygon sides=3, draw] (#1) {#2};
+}
+
+%%======================================================================
+%% btree with capacity = 4
+\newcommand{\btreeinodefour}[5]{%
+ \matrix [ampersand replacement=\&] (#1)
+ {
+ \node[btreeptr] (#1-1) {\vphantom{1}}; \& \node[btreeval] (#1-a) {#2}; \&
+ \node[btreeptr] (#1-2) {\vphantom{1}}; \& \node[btreeval] (#1-b) {#3}; \&
+ \node[btreeptr] (#1-3) {\vphantom{1}}; \& \node[btreeval] (#1-c) {#4}; \&
+ \node[btreeptr] (#1-4) {\vphantom{1}}; \& \node[btreeval] (#1-d) {#5}; \&
+ \node[btreeptr] (#1-5) {\vphantom{1}}; \\
+ };
+}
+\newcommand{\btreelnodefour}[5]{%
+ \matrix [ampersand replacement=\&, outer sep=0pt, matrix anchor=north] (#1)
+ {
+ \node[btreevale] (#1-a) {\suppressemptystr{#2}}; \&
+ \node[btreevale] (#1-b) {\suppressemptystr{#3}}; \&
+ \node[btreevale] (#1-c) {\suppressemptystr{#4}}; \&
+ \node[btreevale] (#1-d) {\suppressemptystr{#5}}; \\
+ };
+}
+
+%%======================================================================
+%% btree with capacity = 3
+\newcommand{\btreeinodethree}[4]{%
+ \matrix [ampersand replacement=\&] (#1)
+ {
+ \node[btreeptr] (#1-1) {\vphantom{1}}; \& \node[btreeval] (#1-a) {#2}; \&
+ \node[btreeptr] (#1-2) {\vphantom{1}}; \& \node[btreeval] (#1-b) {#3}; \&
+ \node[btreeptr] (#1-3) {\vphantom{1}}; \& \node[btreeval] (#1-c) {#4}; \&
+ \node[btreeptr] (#1-4) {\vphantom{1}}; \\
+ };
+}
+\newcommand{\btreelnodethree}[4]{%
+ \matrix [ampersand replacement=\&, outer sep=0pt, matrix anchor=north] (#1)
+ {
+ \node[btreevale] (#1-a) {\suppressemptystr{#2}}; \&
+ \node[btreevale] (#1-b) {\suppressemptystr{#3}}; \&
+ \node[btreevale] (#1-c) {\suppressemptystr{#4}}; \\
+ };
+}
+
+%%======================================================================
+%% btree with capacity = 2
+\newcommand{\btreeinodetwo}[4]{%
+ \matrix [ampersand replacement=\&] (#1)
+ {
+ \node[btreeptr] (#1-1) {\vphantom{1}}; \& \node[btreeval] (#1-a) {#2}; \&
+ \node[btreeptr] (#1-2) {\vphantom{1}}; \& \node[btreeval] (#1-b) {#3}; \&
+ \node[btreeptr] (#1-3) {\vphantom{1}}; \\
+ };
+}
+\newcommand{\btreelnodetwo}[3]{%
+ \matrix [ampersand replacement=\&, outer sep=0pt, matrix anchor=north] (#1)
+ {
+ \node[btreevale] (#1-a) {\suppressemptystr{#2}}; \&
+ \node[btreevale] (#1-b) {\suppressemptystr{#3}}; \\
+ };
+}
+%%======================================================================
+
+
+
+
+%% simple example
+% \begin{center}
+% \scalebox{0.7}{
+% \begin{tikzpicture}
+% %
+% \btreeinodefour{root}{13}{17}{24}{30};
+% \xyshift{-40mm}{-20mm}{\btreelnodefour{n1}{2}{3}{5}{7}}
+% \xyshift{-0mm}{-20mm}{\btreelnodefour{n2}{14}{16}{}{}}
+% \xyshift{40mm}{-20mm}{\btreelnodefour{n3}{19}{20}{22}{}}
+% \xyshift{80mm}{-20mm}{\btreelnodefour{n4}{24}{27}{29}{}}
+% \xyshift{120mm}{-20mm}{\btreelnodefour{n5}{33}{34}{38}{39}}
+% %
+% \foreach \x in {1,2,...,5} { \btreelink{root-\x}{n\x} }
+% \end{tikzpicture}
+% }
+% \end{center}
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/image.png b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/image.png
new file mode 100644
index 00000000..a76881b5
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/image.png differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/lstlisting.sty b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/lstlisting.sty
new file mode 100644
index 00000000..3d6ba743
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-2/latex/style/lstlisting.sty
@@ -0,0 +1,38 @@
+% Source: ss17_wissschreib (Eva)
+
+\lstset{
+ basicstyle=\ttfamily\scriptsize\mdseries,
+ keywordstyle=\bfseries\color[rgb]{0.171875, 0.242188, 0.3125},
+ identifierstyle=,
+ commentstyle=\color[rgb]{0.257813, 0.15625, 0},
+ stringstyle=\itshape\color[rgb]{0.0195313, 0.195313, 0.0117188},
+ numbers=left,
+ numberstyle=\tiny,
+ stepnumber=1,
+ breaklines=true,
+ frame=none,
+ showstringspaces=false,
+ tabsize=4,
+ backgroundcolor=\color[rgb]{0.98,0.98,0.98},
+ captionpos=b,
+ float=htbp,
+ language=Python,
+ xleftmargin=15pt,
+ xrightmargin=15pt
+}
+
+%(deutsche) Sonderzeichen
+\lstset{literate=%
+ {Ä}{{\"A}}1
+ {Ö}{{\"O}}1
+ {Ü}{{\"U}}1
+ {ä}{{\"a}}1
+ {ö}{{\"o}}1
+ {ü}{{\"u}}1
+ {ß}{{\ss}}1
+}
+
+%Verwendung im Text:
+%-> \begin{lstlisting}[language=Python,firstnumber=27] ... \end{lstlisting}
+%-> \begin{lstlisting}[language=Python,numbers=none] ... \end{lstlisting}
+%-> \lstinline[language=JAVA]{...}
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/CT255 Assignment 3.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-3/CT255 Assignment 3.pdf
new file mode 100644
index 00000000..99393a2f
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-3/CT255 Assignment 3.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/Stegano1.java b/second/semester1/CT255/Assessment/CT255-Assignment-3/Stegano1.java
new file mode 100644
index 00000000..8c60f131
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/Stegano1.java
@@ -0,0 +1,173 @@
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.regex.Pattern;
+
+public class Stegano1
+{
+ public static void main(String[] args) {
+ // Strings to hold the arguments. mode is either A or E for "Add" or "Extract".
+ String mode, inputfile, outputfile, bitstring;
+ Boolean err = false; // Boolean to tell if the arguments were passed correctly or not
+
+ if (args.length > 1) { // checking that at least one argument was passed to main
+ // assigning the mode & inputfile arguments
+ mode = args[0];
+ inputfile = args[1];
+
+ if (inputfile.equals("")) { // checking that an inputfile was provided (String was not empty)
+ err = true;
+ }
+ else if ((mode.equals("A")) && (args.length > 3)){ // checking if the mode is "Add" & that the number of arguments provided was greater than 3
+ // assigning the outputfile & bitstring arguments
+ outputfile = args[2];
+ bitstring = args[3];
+
+ if (outputfile.equals("") || bitstring.equals("")) { // checking that neither the outputfile nor bitstring were empty strings
+ err = true;
+ }
+ else {
+ // hiding the bitstring
+ hide(inputfile, outputfile, bitstring);
+ }
+ }
+ else if (mode.equals("E")){ // checking if the mode is "Extract"
+ // retrieving (extracting) the bitstring from text
+ retrieve(inputfile);
+ }
+ else {
+ err = true;
+ }
+ }
+ else {
+ err = true;
+ }
+
+ if (err) {
+ System.out.println();
+ System.out.println("Use: Stegano1 ");
+ System.out.println("Example to add a bitvector to a file: Stegano1 A inp.txt out.txt 0010101");
+ System.out.println("Example to extract a bitvector from a file: Stegano1 E inp.txt");
+
+ }
+ }
+
+ // method to hide a bitstring in a copy the input file provided
+ static void hide(String inpFile, String outFile, String bitString) {
+ // to encode 2 bits with just one symbol, i'm going to represent the binary digits as an analog represenation of the number it represents plus one
+ // e.g., 00 will be represented as " " (1 space), 01 as " " (2 spaces), 10 as " " (3 spaces), and 11 as " " (4 spaces)
+ // the two bits are treated as a binary number, and then i add one to said binary number to get the number of spaces that will represent that number
+
+ BufferedReader reader; // declaring a BufferedReader for the input file
+ BufferedWriter writer; // declaring a BufferedWriter for the output file
+
+ try {
+ // initialising the reader & writer to FileReaders of their respective files (inpFile & outFile)
+ reader = new BufferedReader(new FileReader(inpFile));
+ writer = new BufferedWriter(new FileWriter(outFile));
+
+ String line = reader.readLine(); // reading in the first line from the input file
+
+ // checking if the number of bits in the bitstring is uneven, and if so, adding a '0' onto the end
+ if (bitString.length() % 2 != 0) { bitString = bitString.concat("0"); }
+
+ // will loop until there are no more lines to be read in from the input file (inpFile)
+ while (line != null) {
+
+ // if the bitString is not (yet) an empty String
+ if (!bitString.equals("")) {
+
+ // if the first 2-bit substring is 00, adding one space to the end of the line
+ if (bitString.substring(0,2).equals("00")) {
+ line = line.concat(" ");
+ }
+ // if the first 2-bit substring is 01, adding two spaces to the end of the line
+ else if (bitString.substring(0,2).equals("01")) {
+ line = line.concat(" ");
+ }
+ // if the first 2-bit substring is 10, adding three spaces to the end of the line
+ else if (bitString.substring(0,2).equals("10")) {
+ line = line.concat(" ");
+ }
+ // if the first 2-bit substring is 11, adding four spaces to the end of the line
+ else if (bitString.substring(0,2).equals("11")) {
+ line = line.concat(" ");
+ }
+ // removing the first two bits from the bitString now that they have been used
+ bitString = bitString.substring(2, bitString.length()); // replacing bitString with it's substring that goes from the third character to the last character
+ }
+
+ // writing the amended line to the output file
+ writer.write(line);
+ writer.newLine();
+
+ // reading the next line
+ line = reader.readLine();
+ }
+
+ // closing the reader & the writer
+ reader.close();
+ writer.close();
+ }
+
+ // catching any IOExceptions
+ catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // method to retrieve a hidden string from the input file provided
+ static void retrieve(String inpFile) {
+ BufferedReader reader; // declaring a BufferedReader for the input file (inpFile)
+ String message = "";
+
+ try {
+ reader = new BufferedReader(new FileReader(inpFile)); // initialising the reader to a FileReader of the input file (inpFile)
+
+ String line = reader.readLine(); // reading in the first line from the input file
+
+ // will loop until there are no more lines to be read in from the input file
+ while (line != null) {
+ // checking if the line ends in a space using a regular expression
+ if (Pattern.matches(".* $", line)) { // (checking if the String line contains any amount of any characters, followed by a space followed by the end of a line)
+
+ if (Pattern.matches(".* $", line)) { // checking if the line ends in four spaces using a regular expression
+ message = message.concat("11"); // concatenating "11" onto the end of the message String (four spaces represents "11")
+ }
+ else if (Pattern.matches(".* $", line)) { // checking if the line ends in three spaces using a regular expression
+ message = message.concat("10"); // concatenating "10" onto the end of the message String (three spaces represents "10")
+ }
+ else if (Pattern.matches(".* $", line)) { // (checking if the String line contains any amount of any characters, followed by two spaces followed by the end of a line)
+ message = message.concat("01"); // concatenating a "1" onto the message String (two spaces represent a "1")
+ }
+ else { // essentially, this "else" means "if the line ends with one space but not two"
+ message = message.concat("00"); // concatenating a "0" onto the message String (one space represents a "0")
+ }
+ }
+ else { // if the String does not end in a space, then there is no (more) message to read
+ break;
+ }
+
+ // reading the next line
+ line = reader.readLine();
+ }
+
+ // closing in the reader
+ reader.close();
+
+ // checking if the message String is empty so that an error message can be printed if no hidden message was found
+ if (message.equals("")) {
+ message = "Error: No hidden message found!";
+ }
+
+ // printing out the message
+ System.out.println(message);
+ }
+ // catching any IOExceptions
+ catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/head.tex b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/head.tex
new file mode 100644
index 00000000..395f2b28
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/head.tex
@@ -0,0 +1,49 @@
+\addtolength{\hoffset}{-2.25cm}
+\addtolength{\textwidth}{4.5cm}
+\addtolength{\voffset}{-3.25cm}
+\addtolength{\textheight}{5cm}
+\setlength{\parskip}{0pt}
+\setlength{\parindent}{0in}
+
+%----------------------------------------------------------------------------------------
+% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
+%----------------------------------------------------------------------------------------
+
+\usepackage{blindtext} % Package to generate dummy text
+\usepackage{charter} % Use the Charter font
+\usepackage[utf8]{inputenc} % Use UTF-8 encoding
+\usepackage{microtype} % Slightly tweak font spacing for aesthetics
+\usepackage[english, ngerman]{babel} % Language hyphenation and typographical rules
+\usepackage{amsthm, amsmath, amssymb} % Mathematical typesetting
+\usepackage{float} % Improved interface for floating objects
+\usepackage[final, colorlinks = true,
+ linkcolor = black,
+ citecolor = black]{hyperref} % For hyperlinks in the PDF
+\usepackage{graphicx, multicol} % Enhanced support for graphics
+\usepackage{xcolor} % Driver-independent color extensions
+\usepackage{marvosym, wasysym} % More symbols
+\usepackage{rotating} % Rotation tools
+\usepackage{censor} % Facilities for controlling restricted text
+\usepackage{listings, style/lstlisting} % Environment for non-formatted code, !uses style file!
+\usepackage{pseudocode} % Environment for specifying algorithms in a natural way
+\usepackage{style/avm} % Environment for f-structures, !uses style file!
+\usepackage{booktabs} % Enhances quality of tables
+\usepackage{tikz-qtree} % Easy tree drawing tool
+\tikzset{every tree node/.style={align=center,anchor=north},
+ level distance=2cm} % Configuration for q-trees
+\usepackage{style/btree} % Configuration for b-trees and b+-trees, !uses style file!
+\usepackage[backend=biber,style=numeric,
+ sorting=nyt]{biblatex} % Complete reimplementation of bibliographic facilities
+\addbibresource{ecl.bib}
+\usepackage{csquotes} % Context sensitive quotation facilities
+\usepackage[yyyymmdd]{datetime} % Uses YEAR-MONTH-DAY format for dates
+\renewcommand{\dateseparator}{-} % Sets dateseparator to '-'
+\usepackage{fancyhdr} % Headers and footers
+\pagestyle{fancy} % All pages have headers and footers
+\fancyhead{}\renewcommand{\headrulewidth}{0pt} % Blank out the default header
+\fancyfoot[L]{} % Custom footer text
+\fancyfoot[C]{} % Custom footer text
+\fancyfoot[R]{\thepage} % Custom footer text
+\newcommand{\note}[1]{\marginpar{\scriptsize \textcolor{red}{#1}}} % Enables comments in red on margin
+
+%----------------------------------------------------------------------------------------
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/main.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/main.pdf
new file mode 100644
index 00000000..726b9e61
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/main.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/main.run.xml b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/main.run.xml
new file mode 100644
index 00000000..c60e32b3
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/main.run.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+ latex
+
+ main.bcf
+
+
+ main.bbl
+
+
+ blx-dm.def
+ blx-compat.def
+ biblatex.def
+ standard.bbx
+ numeric.bbx
+ numeric.cbx
+ biblatex.cfg
+ german.lbx
+ ngerman.lbx
+ english.lbx
+
+
+
+ biber
+
+ biber
+ main
+
+
+ main.bcf
+
+
+
+ main.bbl
+
+
+ main.bcf
+
+
+ ecl.bib
+
+
+
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/main.tex b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/main.tex
new file mode 100644
index 00000000..53c28622
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/main.tex
@@ -0,0 +1,383 @@
+\documentclass[a4paper]{article}
+\input{head}
+\begin{document}
+
+%-------------------------------
+% TITLE SECTION
+%-------------------------------
+
+\fancyhead[C]{}
+\hrule \medskip % Upper rule
+\begin{minipage}{0.295\textwidth}
+\raggedright
+\footnotesize
+Andrew Hayes \hfill\\
+21321503 \hfill\\
+a.hayes18@nuigalway.ie
+\end{minipage}
+\begin{minipage}{0.4\textwidth}
+\centering
+\large
+CT255 Assignment 3\\
+\normalsize
+Steganography\\
+\end{minipage}
+\begin{minipage}{0.295\textwidth}
+\raggedleft
+\today\hfill\\
+\end{minipage}
+\medskip\hrule
+\bigskip
+
+%-------------------------------
+% CONTENTS
+%-------------------------------
+
+\section{Problem 1}
+\subsection{Code}
+\begin{lstlisting}[language=Java]
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.regex.Pattern;
+
+public class Stegano1
+{
+ public static void main(String[] args) {
+ // Strings to hold the arguments. mode is either A or E for "Add" or "Extract".
+ String mode, inputfile, outputfile, bitstring;
+ Boolean err = false; // Boolean to tell if the arguments were passed correctly or not
+
+ if (args.length > 1) { // checking that at least one argument was passed to main
+ // assigning the mode & inputfile arguments
+ mode = args[0];
+ inputfile = args[1];
+
+ if (inputfile.equals("")) { // checking that an inputfile was provided (String was not empty)
+ err = true;
+ }
+ else if ((mode.equals("A")) && (args.length > 3)){ // checking if the mode is "Add" & that the number of arguments provided was greater than 3
+ // assigning the outputfile & bitstring arguments
+ outputfile = args[2];
+ bitstring = args[3];
+
+ if (outputfile.equals("") || bitstring.equals("")) { // checking that neither the outputfile nor bitstring were empty strings
+ err = true;
+ }
+ else {
+ // hiding the bitstring
+ hide(inputfile, outputfile, bitstring);
+ }
+ }
+ else if (mode.equals("E")){ // checking if the mode is "Extract"
+ // retrieving (extracting) the bitstring from text
+ retrieve(inputfile);
+ }
+ else {
+ err = true;
+ }
+ }
+ else {
+ err = true;
+ }
+
+ if (err) {
+ System.out.println();
+ System.out.println("Use: Stegano1 ");
+ System.out.println("Example to add a bitvector to a file: Stegano1 A inp.txt out.txt 0010101");
+ System.out.println("Example to extract a bitvector from a file: Stegano1 E inp.txt");
+
+ }
+ }
+
+ // method to hide a bitstring in a copy the input file provided
+ static void hide(String inpFile, String outFile, String bitString) {
+ BufferedReader reader; // declaring a BufferedReader for the input file
+ BufferedWriter writer; // declaring a BufferedWriter for the output file
+
+ try {
+ // initialising the reader & writer to FileReaders of their respective files (inpFile & outFile)
+ reader = new BufferedReader(new FileReader(inpFile));
+ writer = new BufferedWriter(new FileWriter(outFile));
+
+ String line = reader.readLine(); // reading in the first line from the input file
+
+ // will loop until there are no more lines to be read in from the input file (inpFile)
+ while (line != null) {
+
+ // if the bitString is not (yet) an empty String
+ if (!bitString.equals("")) {
+
+ // if the first bit (char) of the bitString is 0
+ if (bitString.charAt(0) == '0') { // note: must use '' instead of "" for char literals
+ line = line.concat(" "); // concatenating a space to the end of the line (one space represents a 0)
+ }
+
+ // if the first bit of the bitString is 1
+ if (bitString.charAt(0) == '1') {
+ line = line.concat(" "); // concatenating two spaces to the end of the line (two spaces represents a 1)
+ }
+
+ // removing the first bit from the bitString now that it has been used
+ bitString = bitString.substring(1, bitString.length()); // replacing bitString with it's substring that goes from the second character to the last character
+ }
+
+ // writing the amended line to the output file
+ writer.write(line);
+ writer.newLine();
+
+ // reading the next line
+ line = reader.readLine();
+ }
+
+ // closing the reader & the writer
+ reader.close();
+ writer.close();
+ }
+
+ // catching any IOExceptions
+ catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // method to retrieve a hidden string from the input file provided
+ static void retrieve(String inpFile) {
+ BufferedReader reader; // declaring a BufferedReader for the input file (inpFile)
+ String message = "";
+
+ try {
+ reader = new BufferedReader(new FileReader(inpFile)); // initialising the reader to a FileReader of the input file (inpFile)
+
+ String line = reader.readLine(); // reading in the first line from the input file
+
+ // will loop until there are no more lines to be read in from the input file
+ while (line != null) {
+
+ // checking if the line ends in a space using a regular expression
+ if (Pattern.matches(".* $", line)) { // (checking if the String line contains any amount of any characters, followed by a space followed by the end of a line)
+
+ // checking if the line ends in two spaces using a regular expression
+ if (Pattern.matches(".* $", line)) { // (checking if the String line contains any amount of any characters, followed by two spaces followed by the end of a line)
+ message = message.concat("1"); // concatenating a "1" onto the message String (two spaces represent a "1")
+ }
+ else { // essentially, this "else" means "if the line ends with one space but not two"
+ message = message.concat("0"); // concatenating a "0" onto the message String (one space represents a "0")
+ }
+ }
+ else { // if the String does not end in a space, then there is no (more) message to read
+ break;
+ }
+
+ // reading the next line
+ line = reader.readLine();
+ }
+
+ // closing in the reader
+ reader.close();
+
+ // checking if the message String is empty so that an error message can be printed if no hidden message was found
+ if (message.equals("")) {
+ message = "Error: No hidden message found!";
+ }
+
+ // printing out the message
+ System.out.println(message);
+ }
+ // catching any IOExceptions
+ catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
+\end{lstlisting}
+
+\subsection{Screenshot of Compilation \& Output}
+\includegraphics[width = 15cm]{output1.png}
+\bigskip
+
+%------------------------------------------------
+
+\section{Problem 2}
+\subsection{Code}
+\begin{lstlisting}[language=java]
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.regex.Pattern;
+
+public class Stegano1
+{
+ public static void main(String[] args) {
+ // Strings to hold the arguments. mode is either A or E for "Add" or "Extract".
+ String mode, inputfile, outputfile, bitstring;
+ Boolean err = false; // Boolean to tell if the arguments were passed correctly or not
+
+ if (args.length > 1) { // checking that at least one argument was passed to main
+ // assigning the mode & inputfile arguments
+ mode = args[0];
+ inputfile = args[1];
+
+ if (inputfile.equals("")) { // checking that an inputfile was provided (String was not empty)
+ err = true;
+ }
+ else if ((mode.equals("A")) && (args.length > 3)){ // checking if the mode is "Add" & that the number of arguments provided was greater than 3
+ // assigning the outputfile & bitstring arguments
+ outputfile = args[2];
+ bitstring = args[3];
+
+ if (outputfile.equals("") || bitstring.equals("")) { // checking that neither the outputfile nor bitstring were empty strings
+ err = true;
+ }
+ else {
+ // hiding the bitstring
+ hide(inputfile, outputfile, bitstring);
+ }
+ }
+ else if (mode.equals("E")){ // checking if the mode is "Extract"
+ // retrieving (extracting) the bitstring from text
+ retrieve(inputfile);
+ }
+ else {
+ err = true;
+ }
+ }
+ else {
+ err = true;
+ }
+
+ if (err) {
+ System.out.println();
+ System.out.println("Use: Stegano1 ");
+ System.out.println("Example to add a bitvector to a file: Stegano1 A inp.txt out.txt 0010101");
+ System.out.println("Example to extract a bitvector from a file: Stegano1 E inp.txt");
+
+ }
+ }
+
+ // method to hide a bitstring in a copy the input file provided
+ static void hide(String inpFile, String outFile, String bitString) {
+ // to encode 2 bits with just one symbol, i'm going to represent the binary digits as an analog represenation of the number it represents plus one
+ // e.g., 00 will be represented as " " (1 space), 01 as " " (2 spaces), 10 as " " (3 spaces), and 11 as " " (4 spaces)
+ // the two bits are treated as a binary number, and then i add one to said binary number to get the number of spaces that will represent that number
+
+ BufferedReader reader; // declaring a BufferedReader for the input file
+ BufferedWriter writer; // declaring a BufferedWriter for the output file
+
+ try {
+ // initialising the reader & writer to FileReaders of their respective files (inpFile & outFile)
+ reader = new BufferedReader(new FileReader(inpFile));
+ writer = new BufferedWriter(new FileWriter(outFile));
+
+ String line = reader.readLine(); // reading in the first line from the input file
+
+ // checking if the number of bits in the bitstring is uneven, and if so, adding a '0' onto the end
+ if (bitString.length() % 2 != 0) { bitString = bitString.concat("0"); }
+
+ // will loop until there are no more lines to be read in from the input file (inpFile)
+ while (line != null) {
+
+ // if the bitString is not (yet) an empty String
+ if (!bitString.equals("")) {
+
+ // if the first 2-bit substring is 00, adding one space to the end of the line
+ if (bitString.substring(0,2).equals("00")) {
+ line = line.concat(" ");
+ }
+ // if the first 2-bit substring is 01, adding two spaces to the end of the line
+ else if (bitString.substring(0,2).equals("01")) {
+ line = line.concat(" ");
+ }
+ // if the first 2-bit substring is 10, adding three spaces to the end of the line
+ else if (bitString.substring(0,2).equals("10")) {
+ line = line.concat(" ");
+ }
+ // if the first 2-bit substring is 11, adding four spaces to the end of the line
+ else if (bitString.substring(0,2).equals("11")) {
+ line = line.concat(" ");
+ }
+ // removing the first two bits from the bitString now that they have been used
+ bitString = bitString.substring(2, bitString.length()); // replacing bitString with it's substring that goes from the third character to the last character
+ }
+
+ // writing the amended line to the output file
+ writer.write(line);
+ writer.newLine();
+
+ // reading the next line
+ line = reader.readLine();
+ }
+
+ // closing the reader & the writer
+ reader.close();
+ writer.close();
+ }
+
+ // catching any IOExceptions
+ catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // method to retrieve a hidden string from the input file provided
+ static void retrieve(String inpFile) {
+ BufferedReader reader; // declaring a BufferedReader for the input file (inpFile)
+ String message = "";
+
+ try {
+ reader = new BufferedReader(new FileReader(inpFile)); // initialising the reader to a FileReader of the input file (inpFile)
+
+ String line = reader.readLine(); // reading in the first line from the input file
+
+ // will loop until there are no more lines to be read in from the input file
+ while (line != null) {
+ // checking if the line ends in a space using a regular expression
+ if (Pattern.matches(".* $", line)) { // (checking if the String line contains any amount of any characters, followed by a space followed by the end of a line)
+
+ if (Pattern.matches(".* $", line)) { // checking if the line ends in four spaces using a regular expression
+ message = message.concat("11"); // concatenating "11" onto the end of the message String (four spaces represents "11")
+ }
+ else if (Pattern.matches(".* $", line)) { // checking if the line ends in three spaces using a regular expression
+ message = message.concat("10"); // concatenating "10" onto the end of the message String (three spaces represents "10")
+ }
+ else if (Pattern.matches(".* $", line)) { // (checking if the String line contains any amount of any characters, followed by two spaces followed by the end of a line)
+ message = message.concat("01"); // concatenating a "1" onto the message String (two spaces represent a "1")
+ }
+ else { // essentially, this "else" means "if the line ends with one space but not two"
+ message = message.concat("00"); // concatenating a "0" onto the message String (one space represents a "0")
+ }
+ }
+ else { // if the String does not end in a space, then there is no (more) message to read
+ break;
+ }
+
+ // reading the next line
+ line = reader.readLine();
+ }
+
+ // closing in the reader
+ reader.close();
+
+ // checking if the message String is empty so that an error message can be printed if no hidden message was found
+ if (message.equals("")) {
+ message = "Error: No hidden message found!";
+ }
+
+ // printing out the message
+ System.out.println(message);
+ }
+ // catching any IOExceptions
+ catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
+\end{lstlisting}
+\subsection{Output}
+\includegraphics[width = 15cm]{output2.png}
+
+\end{document}
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/output1.png b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/output1.png
new file mode 100644
index 00000000..44f647a2
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/output1.png differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/output2.png b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/output2.png
new file mode 100644
index 00000000..15d7e682
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/output2.png differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/avm.sty b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/avm.sty
new file mode 100644
index 00000000..a872483c
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/avm.sty
@@ -0,0 +1,165 @@
+% avm.sty -- for attribute-value matrices -- mar 29, 1992; rev. dec 6, 1993
+% (c) 1992 christopher manning (manning@csli.stanford.edu) -- see avm.doc.tex
+
+\newif\ifavmactive\newif\ifavmsorted\newif\ifavmlabeled
+\newif\ifavmcenter\newif\ifavmbottom
+\newif\ifavmbottomright\newif\ifavmtopleft\newif\ifavmtopright
+
+\newdimen\avmdimen
+\newbox\avmboxone\newbox\avmboxthree
+
+\def\avmoptions#1{\avmactivefalse\avmsortedfalse\avmlabeledfalse
+ \avmcenterfalse\avmbottomfalse
+ \avmbottomrightfalse\avmtopleftfalse\avmtoprightfalse
+ \def\more{#1}\ifx\more\empty\else\avmjoptions#1,\@nil\fi}
+\def\avmjoptions#1,#2\@nil{\def\more{#2}\csname avm#1true\endcsname
+ \ifx\more\empty\else\avmjoptions#2\@nil\fi}
+
+
+\def\avmfont#1{\def\avmjfont{#1}}
+\def\avmjfont{}
+
+\def\avmvalfont#1{\def\avmjvalfont{#1}}
+\def\avmjvalfont{}
+
+\def\avmsortfont#1{\def\avmjsortfont{#1}}
+\def\avmjsortfont{}
+
+\def\avmhskip#1{\def\avmjhskip{#1}}
+\def\avmjhskip{1em}
+
+\def\avmbskip#1{\def\avmjbskip{#1}}
+\def\avmjbskip{0em}
+
+\def\avmvskip#1{\def\avmjvskip{#1}}
+\def\avmjvskip{0.385ex}%was .3875
+
+
+\def\avmjprolog#1{$\mskip-\thinmuskip
+ \left#1\hskip\avmjbskip\vcenter\bgroup\vskip\avmjvskip
+ \ialign\bgroup\avmjfont
+ \strut ##\unskip\hfil
+ &&\hskip\avmjhskip\avmjvalfont ##\unskip\hfil\cr}
+\def\avmjpostlog#1{\crcr\egroup\vskip\avmjvskip\egroup
+ \hskip\avmjbskip\right#1\mskip-\thinmuskip$\ignorespaces}
+
+
+\def\avmjcatcode{\let\lparen=(\let\rparen=)\catcode`\[=13\catcode`\]=13
+ \catcode`\<=13\catcode`\@=13\catcode`\(=13\catcode`\)=13
+ \catcode`\>=13\catcode`\|=13}
+
+{\avmjcatcode % new group: redefine above catcodes as active
+
+\gdef\specialavm{\avmjcatcode
+\def({\avmjprolog\lparen}%
+\def){\avmjpostlog\rparen}%
+\def<{\avmjprolog\langle}%
+\def>{\avmjpostlog\rangle}%
+\ifavmsorted
+\def[##1{\setbox\avmboxthree=\hbox{\avmjsortfont##1\/}\setbox2=\hbox
+ \bgroup\avmjprolog\lbrack}%
+\def]{\avmjpostlog\rbrack\egroup\avmjsort}%
+\else\ifavmlabeled
+\def[##1{\def\more{##1}\setbox2=\hbox\bgroup\avmjprolog[}%
+\def]{\avmjpostlog]\egroup\node{\more}{\box2}}%
+\else
+\def[{\avmjprolog\lbrack}%
+\def]{\avmjpostlog\rbrack}%
+\fi\fi
+%
+\def\<{$\langle$}\def\>{$\rangle$}%
+\def\({\lparen}\def\){\rparen}%
+\def\[{\lbrack}\def\]{\rbrack}%
+\def|{$\,\vert\,$}%
+\def@##1{\avmbox{##1}}%
+} % end defn of \specialavm
+} % restore active catcodes
+
+
+\long\def\avm{\begingroup
+\ifavmactive\specialavm
+\else
+\def\({\avmjprolog(}%
+\def\){\avmjpostlog)}%
+\def\<{\avmjprolog\langle}%
+\def\>{\avmjpostlog\rangle}%
+%
+\ifavmsorted
+\def\[##1{\setbox\avmboxthree=\hbox{\avmjsortfont##1\/}\setbox
+ 2=\hbox\bgroup\avmjprolog[}%
+\def\]{\avmjpostlog]\egroup\avmjsort}%
+\else\ifavmlabeled
+\def\[##1{\def\more{##1}\setbox2=\hbox\bgroup\avmjprolog[}%
+\def\]{\avmjpostlog]\egroup\node{\more}{\box2}}%
+\else
+\def\[{\avmjprolog[}%
+\def\]{\avmjpostlog]}%
+\fi\fi
+%
+\def\|{$\,\vert\,$}%
+\def\@##1{\avmbox{##1}}%
+\fi % end not active
+%
+\ifx\LaTeX\undefined\def\\{\cr}% running under TeX
+\else \def\\{\@tabularcr}% Leverage off LaTeX's \\*[dimen] options
+\fi
+\def\!{\node}%
+\long\def\avmjsort{\dimen2=\ht2\advance\dimen2 by -.25\baselineskip
+ \global\dimen\avmdimen=\wd\avmboxthree
+ \ifavmtopleft \raise\dimen2\llap{\box\avmboxthree}\box2%
+ \else\ifavmtopright \box2\raise\dimen2\box\avmboxthree%
+ \else\ifavmbottomright \box2\lower\dimen2\box\avmboxthree%
+ \else \lower\dimen2\llap{\box\avmboxthree}\box2%
+ \fi\fi\fi}%
+\long\def\sort##1##2{\setbox2=\hbox{##2}\setbox
+ \avmboxthree=\hbox{\avmjsortfont##1\/}\dimen2=\ht2
+ \advance\dimen2 by -.25\baselineskip
+ \ifavmtopleft \raise\dimen2\box\avmboxthree\box2%
+ \else\ifavmtopright \box2\raise\dimen2\box\avmboxthree%
+ \else\ifavmbottomright \box2\lower\dimen2\box\avmboxthree%
+ \else \lower\dimen2\box\avmboxthree\box2%
+ \fi\fi\fi}%
+\long\def\osort##1##2{\setbox2=\hbox{##2}\setbox
+ \avmboxthree=\hbox{\avmjsortfont ##1\/}\avmjsort}%
+\def\avml{\avmjprolog.}%
+\def\avmr{\avmjpostlog.}%
+\def\avmb##1{\node{##1}{\lbrack\;\rbrack}}%
+\def\avmd##1{\node{##1}{---}}%
+\def\q##1{\ifx ##1\{$\lbrace$\else
+ \ifx ##1\}$\rbrace$\else
+ \ifx ##1<$\langle$\else
+ \ifx ##1>$\rangle$\fi \fi \fi \fi}%
+\def\{{\avmjprolog\lbrace}%
+\def\}{\avmjpostlog\rbrace}%
+\def\;{\hskip\avmjhskip}%
+\def\avmspan##1{\multispan2\strut ##1\expandafter\hfil}%
+\avmjfont
+\openup\avmjvskip
+\setbox\avmboxone=\hbox\bgroup\ignorespaces
+} % end defn of \avm
+
+
+\def\endavm{\egroup\ifvmode\leavevmode\fi % this if is useful!
+ \ifavmsorted\null\hskip\dimen\avmdimen\fi
+ \ifavmcenter
+ \box\avmboxone
+ \else \ifavmbottom
+ \lower.575\baselineskip\hbox{\vbox{\box\avmboxone\null}}%
+ \else
+% the next bit is ripped off from Emma's \evnup in lingmacros.sty
+ \dimen2=\ht\avmboxone\advance\dimen2 by -.725\baselineskip
+ \lower\dimen2\box\avmboxone
+\fi \fi \endgroup}
+
+
+% based on TeXbook exercise 21.3
+\def\avmbox#1{\setbox2=\hbox{$\scriptstyle #1$}\lower.2ex\vbox{\hrule
+ \hbox{\vrule\kern1.25pt
+ \vbox{\kern1.25pt\box2\kern1.25pt}\kern1.25pt\vrule}\hrule}}
+
+% ============ COSTOM CONFIGURATION =============
+\avmfont{\sc}
+\avmoptions{sorted,active}
+\avmvalfont{\rm}
+\avmsortfont{\scriptsize\it}
+% ===============================================
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/btree.sty b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/btree.sty
new file mode 100644
index 00000000..edec4533
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/btree.sty
@@ -0,0 +1,131 @@
+%% Last Modified: Thu Oct 18 18:26:25 2007.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{style/btree}
+\typeout{Document Style `weiw_BTree - Support drawing B+-Tree (ver 0.999)}
+
+\RequirePackage{tikz}
+\RequirePackage{ifthen}
+
+% use libraries
+\usetikzlibrary{arrows,shapes,decorations,matrix}
+
+
+%% global declaration
+\tikzstyle{btreeptr} = [draw, semithick, minimum height=2em]
+\tikzstyle{btreeval} = [draw, semithick, minimum size=2em]
+\tikzstyle{btreevale} = [draw,semithick, minimum size=2em]
+\tikzstyle{btlink} = [draw, semithick, ->, >=triangle 45]
+
+%% macro
+%% helper macros
+\newcommand{\suppressemptystr}[1]{% leave blank for entries in leaf nodes
+ \ifthenelse{\equal{#1}{}}%
+ {%
+ \relax%
+ }%
+ % Else
+ {%
+ #1\textsuperscript{*}%
+ }%
+}%
+
+\newcommand{\xyshift}[3]{% help to place the nodes
+ \begin{scope}[xshift=#1, yshift=#2]
+ #3
+ \end{scope}%
+}
+
+%% Common btree macros
+\newcommand{\btreelink}[2]{% #1: src node; #2: dest node;
+ \draw[btlink] ([yshift=3pt] #1.south) -- (#2-b.north);
+}
+
+\newcommand{\btreelinknorth}[2]{% #1: src node; #2: dest node;
+ \draw[btlink] ([yshift=3pt] #1.south) -- (#2.north);
+}
+
+\newcommand{\btreetriangle}[2]{% #1: node name; #2 text inside
+ \node[anchor=north, regular polygon, regular polygon sides=3, draw] (#1) {#2};
+}
+
+%%======================================================================
+%% btree with capacity = 4
+\newcommand{\btreeinodefour}[5]{%
+ \matrix [ampersand replacement=\&] (#1)
+ {
+ \node[btreeptr] (#1-1) {\vphantom{1}}; \& \node[btreeval] (#1-a) {#2}; \&
+ \node[btreeptr] (#1-2) {\vphantom{1}}; \& \node[btreeval] (#1-b) {#3}; \&
+ \node[btreeptr] (#1-3) {\vphantom{1}}; \& \node[btreeval] (#1-c) {#4}; \&
+ \node[btreeptr] (#1-4) {\vphantom{1}}; \& \node[btreeval] (#1-d) {#5}; \&
+ \node[btreeptr] (#1-5) {\vphantom{1}}; \\
+ };
+}
+\newcommand{\btreelnodefour}[5]{%
+ \matrix [ampersand replacement=\&, outer sep=0pt, matrix anchor=north] (#1)
+ {
+ \node[btreevale] (#1-a) {\suppressemptystr{#2}}; \&
+ \node[btreevale] (#1-b) {\suppressemptystr{#3}}; \&
+ \node[btreevale] (#1-c) {\suppressemptystr{#4}}; \&
+ \node[btreevale] (#1-d) {\suppressemptystr{#5}}; \\
+ };
+}
+
+%%======================================================================
+%% btree with capacity = 3
+\newcommand{\btreeinodethree}[4]{%
+ \matrix [ampersand replacement=\&] (#1)
+ {
+ \node[btreeptr] (#1-1) {\vphantom{1}}; \& \node[btreeval] (#1-a) {#2}; \&
+ \node[btreeptr] (#1-2) {\vphantom{1}}; \& \node[btreeval] (#1-b) {#3}; \&
+ \node[btreeptr] (#1-3) {\vphantom{1}}; \& \node[btreeval] (#1-c) {#4}; \&
+ \node[btreeptr] (#1-4) {\vphantom{1}}; \\
+ };
+}
+\newcommand{\btreelnodethree}[4]{%
+ \matrix [ampersand replacement=\&, outer sep=0pt, matrix anchor=north] (#1)
+ {
+ \node[btreevale] (#1-a) {\suppressemptystr{#2}}; \&
+ \node[btreevale] (#1-b) {\suppressemptystr{#3}}; \&
+ \node[btreevale] (#1-c) {\suppressemptystr{#4}}; \\
+ };
+}
+
+%%======================================================================
+%% btree with capacity = 2
+\newcommand{\btreeinodetwo}[4]{%
+ \matrix [ampersand replacement=\&] (#1)
+ {
+ \node[btreeptr] (#1-1) {\vphantom{1}}; \& \node[btreeval] (#1-a) {#2}; \&
+ \node[btreeptr] (#1-2) {\vphantom{1}}; \& \node[btreeval] (#1-b) {#3}; \&
+ \node[btreeptr] (#1-3) {\vphantom{1}}; \\
+ };
+}
+\newcommand{\btreelnodetwo}[3]{%
+ \matrix [ampersand replacement=\&, outer sep=0pt, matrix anchor=north] (#1)
+ {
+ \node[btreevale] (#1-a) {\suppressemptystr{#2}}; \&
+ \node[btreevale] (#1-b) {\suppressemptystr{#3}}; \\
+ };
+}
+%%======================================================================
+
+
+
+
+%% simple example
+% \begin{center}
+% \scalebox{0.7}{
+% \begin{tikzpicture}
+% %
+% \btreeinodefour{root}{13}{17}{24}{30};
+% \xyshift{-40mm}{-20mm}{\btreelnodefour{n1}{2}{3}{5}{7}}
+% \xyshift{-0mm}{-20mm}{\btreelnodefour{n2}{14}{16}{}{}}
+% \xyshift{40mm}{-20mm}{\btreelnodefour{n3}{19}{20}{22}{}}
+% \xyshift{80mm}{-20mm}{\btreelnodefour{n4}{24}{27}{29}{}}
+% \xyshift{120mm}{-20mm}{\btreelnodefour{n5}{33}{34}{38}{39}}
+% %
+% \foreach \x in {1,2,...,5} { \btreelink{root-\x}{n\x} }
+% \end{tikzpicture}
+% }
+% \end{center}
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/image.png b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/image.png
new file mode 100644
index 00000000..a76881b5
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/image.png differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/lstlisting.sty b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/lstlisting.sty
new file mode 100644
index 00000000..3d6ba743
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/latex/style/lstlisting.sty
@@ -0,0 +1,38 @@
+% Source: ss17_wissschreib (Eva)
+
+\lstset{
+ basicstyle=\ttfamily\scriptsize\mdseries,
+ keywordstyle=\bfseries\color[rgb]{0.171875, 0.242188, 0.3125},
+ identifierstyle=,
+ commentstyle=\color[rgb]{0.257813, 0.15625, 0},
+ stringstyle=\itshape\color[rgb]{0.0195313, 0.195313, 0.0117188},
+ numbers=left,
+ numberstyle=\tiny,
+ stepnumber=1,
+ breaklines=true,
+ frame=none,
+ showstringspaces=false,
+ tabsize=4,
+ backgroundcolor=\color[rgb]{0.98,0.98,0.98},
+ captionpos=b,
+ float=htbp,
+ language=Python,
+ xleftmargin=15pt,
+ xrightmargin=15pt
+}
+
+%(deutsche) Sonderzeichen
+\lstset{literate=%
+ {Ä}{{\"A}}1
+ {Ö}{{\"O}}1
+ {Ü}{{\"U}}1
+ {ä}{{\"a}}1
+ {ö}{{\"o}}1
+ {ü}{{\"u}}1
+ {ß}{{\ss}}1
+}
+
+%Verwendung im Text:
+%-> \begin{lstlisting}[language=Python,firstnumber=27] ... \end{lstlisting}
+%-> \begin{lstlisting}[language=Python,numbers=none] ... \end{lstlisting}
+%-> \lstinline[language=JAVA]{...}
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/ogStegano1.java b/second/semester1/CT255/Assessment/CT255-Assignment-3/ogStegano1.java
new file mode 100644
index 00000000..1af07e4a
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/ogStegano1.java
@@ -0,0 +1,116 @@
+
+/**
+ * CT255 - Assignment 3
+ * Skeleton code for Steganography assignment.
+ *
+ * @author Michael Schukat
+ * @version 1.0
+ */
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+public class Stegano1
+{
+ /**
+ * Constructor for objects of class Stegano1
+ */
+ public Stegano1()
+ {
+ }
+
+ public static void main(String[] args) {
+ String arg1, arg2, arg3, arg4;
+ Boolean err = false;
+
+ if (args != null && args.length > 1) { // Check for minimum number of arguments
+ arg1 = args[0];
+ arg2 = args[1];
+
+ if (arg2 == "") {
+ err = true;
+ }
+ else if ((arg1 == "A") && (args.length > 3)){
+ // Get other arguments
+ arg3 = args[2];
+ arg4 = args[3];
+ if (arg3 == "" || arg4 == "") {
+ err = true;
+ }
+ else {
+ // Hide bitstring
+ hide(arg2, arg3, arg4);
+ }
+ }
+ else if (arg1 == "E"){
+ // Extract bitstring from text
+ retrieve(arg2);
+ }
+ else {
+ err = true;
+ }
+ }
+ else {
+ err = true;
+ }
+
+ if (err == true) {
+ System.out.println();
+ System.out.println("Use: Stegano1 ");
+ System.out.println("Example: Stegano1 A inp.txt out.txt 0010101");
+ System.out.println("Example: Stegano1 E inp.txt");
+
+ }
+ }
+
+ static void hide(String inpFile, String outFile, String binString) {
+ //
+ BufferedReader reader;
+ BufferedWriter writer;
+
+ try {
+ reader = new BufferedReader(new FileReader(inpFile));
+ writer = new BufferedWriter(new FileWriter(outFile));
+ String line = reader.readLine();
+ while (line != null) {
+ // Your code starts here
+
+
+ // Store amended line in output file
+ writer.write(line);
+ writer.newLine();
+ // read next line
+ line = reader.readLine();
+ }
+ reader.close();
+ writer.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ static void retrieve(String inpFile) {
+ BufferedReader reader;
+
+ try {
+ reader = new BufferedReader(new FileReader(inpFile));
+ String line = reader.readLine();
+ while (line != null) {
+ // Your code starts here
+
+ // System.out.println(line);
+
+ // read next line
+ line = reader.readLine();
+ }
+ reader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+}
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/output.txt b/second/semester1/CT255/Assessment/CT255-Assignment-3/output.txt
new file mode 100644
index 00000000..d083c9a1
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/output.txt
@@ -0,0 +1,57 @@
+The Stolen Child
+Where dips the rocky highland
+Of Sleuth Wood in the lake,
+There lies a leafy island
+Where flapping herons wake
+The drowsy water rats;
+There we've hid our faery vats,
+Full of berrys
+And of reddest stolen cherries.
+Come away, O human child!
+To the waters and the wild
+With a faery, hand in hand,
+For the world's more full of weeping than you can understand.
+
+Where the wave of moonlight glosses
+The dim gray sands with light,
+Far off by furthest Rosses
+We foot it all the night,
+Weaving olden dances
+Mingling hands and mingling glances
+Till the moon has taken flight;
+To and fro we leap
+And chase the frothy bubbles,
+While the world is full of troubles
+And anxious in its sleep.
+Come away, O human child!
+To the waters and the wild
+With a faery, hand in hand,
+For the world's more full of weeping than you can understand.
+
+Where the wandering water gushes
+From the hills above Glen-Car,
+In pools among the rushes
+That scarce could bathe a star,
+We seek for slumbering trout
+And whispering in their ears
+Give them unquiet dreams;
+Leaning softly out
+From ferns that drop their tears
+Over the young streams.
+Come away, O human child!
+To the waters and the wild
+With a faery, hand in hand,
+For the world's more full of weeping than you can understand.
+
+Away with us he's going,
+The solemn-eyed:
+He'll hear no more the lowing
+Of the calves on the warm hillside
+Or the kettle on the hob
+Sing peace into his breast,
+Or see the brown mice bob
+Round and round the oatmeal chest.
+For he comes, the human child,
+To the waters and the wild
+With a faery, hand in hand,
+For the world's more full of weeping than he can understand.
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-3/wby1.txt b/second/semester1/CT255/Assessment/CT255-Assignment-3/wby1.txt
new file mode 100644
index 00000000..548d75ce
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-3/wby1.txt
@@ -0,0 +1,57 @@
+The Stolen Child
+Where dips the rocky highland
+Of Sleuth Wood in the lake,
+There lies a leafy island
+Where flapping herons wake
+The drowsy water rats;
+There we've hid our faery vats,
+Full of berrys
+And of reddest stolen cherries.
+Come away, O human child!
+To the waters and the wild
+With a faery, hand in hand,
+For the world's more full of weeping than you can understand.
+
+Where the wave of moonlight glosses
+The dim gray sands with light,
+Far off by furthest Rosses
+We foot it all the night,
+Weaving olden dances
+Mingling hands and mingling glances
+Till the moon has taken flight;
+To and fro we leap
+And chase the frothy bubbles,
+While the world is full of troubles
+And anxious in its sleep.
+Come away, O human child!
+To the waters and the wild
+With a faery, hand in hand,
+For the world's more full of weeping than you can understand.
+
+Where the wandering water gushes
+From the hills above Glen-Car,
+In pools among the rushes
+That scarce could bathe a star,
+We seek for slumbering trout
+And whispering in their ears
+Give them unquiet dreams;
+Leaning softly out
+From ferns that drop their tears
+Over the young streams.
+Come away, O human child!
+To the waters and the wild
+With a faery, hand in hand,
+For the world's more full of weeping than you can understand.
+
+Away with us he's going,
+The solemn-eyed:
+He'll hear no more the lowing
+Of the calves on the warm hillside
+Or the kettle on the hob
+Sing peace into his breast,
+Or see the brown mice bob
+Round and round the oatmeal chest.
+For he comes, the human child,
+To the waters and the wild
+With a faery, hand in hand,
+For the world's more full of weeping than he can understand.
\ No newline at end of file
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-4/CT255 Assignment 4.pdf b/second/semester1/CT255/Assessment/CT255-Assignment-4/CT255 Assignment 4.pdf
new file mode 100644
index 00000000..6faf7cf9
Binary files /dev/null and b/second/semester1/CT255/Assessment/CT255-Assignment-4/CT255 Assignment 4.pdf differ
diff --git a/second/semester1/CT255/Assessment/CT255-Assignment-4/DiffieHellman.java b/second/semester1/CT255/Assessment/CT255-Assignment-4/DiffieHellman.java
new file mode 100644
index 00000000..6f7ab92f
--- /dev/null
+++ b/second/semester1/CT255/Assessment/CT255-Assignment-4/DiffieHellman.java
@@ -0,0 +1,91 @@
+import java.util.ArrayList;
+
+public class DiffieHellman {
+
+ public static void main(String[] args) {
+ generate_params();
+ }
+
+ // method to generate the random DH parameters
+ public static void generate_params() {
+ int prime = generate_prime(); // generating a prime number
+ System.out.println("prime: " + prime);
+ int primitive_root = generate_primitive_root(prime); // generating a primitive root of that prime
+ System.out.println("prime: " + prime + ". primtive root : " + primitive_root);
+ }
+
+ // method to generate a prime number in the range 10000 - 100000
+ public static int generate_prime() {
+ // generating an ArrayList of prime numbers in the range 10,000 to 100,000 using the Sieve of Eratosthenes
+ // creating a list of consecutive integers from 2 through 100,000
+ ArrayList integers = new ArrayList();
+
+ for (int n = 2; n <= 100000; n++) {
+ integers.add(n);
+ }
+
+ // initially, let p equal 2, the smallest prime number in the list.
+ int p = integers.get(0);
+
+ // variable to hold the number of known primes in the ArrayList
+ int primes_count = 1;
+
+ // looping while p is less than the final value in the list
+ while (p < integers.get(integers.size() - 1)) {
+ // removing the mutliples of p from the list
+ for (int i = 2; (i * p) <= integers.get(integers.size() - 1); i++) {
+ integers.remove(Integer.valueOf(i * p));
+ }
+
+ // let p equal the new smallest element in the ArrayList
+ p = integers.get(primes_count++);
+ }
+
+ // cutting out the section of the ArrayList that contains prime number outside the appropriate range
+ while (integers.get(0) < 10000) { // removing the first element of the ArrayList while the first index of the ArrayList holds a value less than 10,000
+ integers.remove(0);
+ }
+
+ // selecting the element at a random index in the ArrayList of primes as our prime number
+ int prime = integers.get((int) (Math.random() * (integers.size() - 1)));
+
+ return prime;
+ }
+
+ public static int generate_primitive_root(int prime) {
+ // ArrayList primitive_roots = new ArrayList(); // ArrayList to hold the primitive roots found
+
+ // looping through all the numbers in the range 2 to the prime minus 1 to see if they're primitive roots of the prime, breaking when we find the first primitive root
+ for (int n = 3; n < prime - 1; n++) {
+ boolean is_n_a_primtive_root = true; // boolean to tell whether or not n is a primtive root
+ ArrayList distinct_values = new ArrayList(); // ArrayList to hold the distinct values of a candidate primitive root modulo the prime
+
+ // loop to check if n is a primitive root by raising it to the power of x modulo the prime
+ for (int x = 2; x < prime - 2; x++) {
+
+ // setting is_n_a_primtive_root to false and breaking out of the loop if n to the power of x modulo the prime is already in the distinct_values ArrayList
+ if (distinct_values.contains((n^x) % prime)) {
+ is_n_a_primtive_root = false;
+ System.out.println(n + " is not a primitive root");
+ break;
+ }
+ else {
+ distinct_values.add((n^x) % prime);
+ }
+ }
+ // adding n to the list of primitive roots if it is a primitive root of the prime passed to the function
+ if (is_n_a_primtive_root) {
+ // primitive_roots.add(n);
+ return n;
+ }
+ }
+
+ // selecting a random value in the list of primitive roots to be our primtitive root
+ // int random_primitive_root = primitive_roots.get((int) (Math.random() * (primitive_roots.size() - 1)));
+ // int random_primitive_root = -1;
+ // return random_primitive_root;
+ //
+ // returning -1 if no primitive root found
+ return -1;
+ }
+}
diff --git a/second/semester1/CT255/CT255-Slides.pdf b/second/semester1/CT255/CT255-Slides.pdf
new file mode 100644
index 00000000..295d9af6
Binary files /dev/null and b/second/semester1/CT255/CT255-Slides.pdf differ
diff --git a/second/semester1/CT255/tmpdbmt7myg_ct255_05.pdf b/second/semester1/CT255/tmpdbmt7myg_ct255_05.pdf
new file mode 100644
index 00000000..39c3f0be
Binary files /dev/null and b/second/semester1/CT255/tmpdbmt7myg_ct255_05.pdf differ
diff --git a/second/semester1/MA284/MA284-Slides.pdf b/second/semester1/MA284/MA284-Slides.pdf
new file mode 100644
index 00000000..e41b6611
Binary files /dev/null and b/second/semester1/MA284/MA284-Slides.pdf differ
diff --git a/second/semester1/ST2001/Assignments/.Rhistory b/second/semester1/ST2001/Assignments/.Rhistory
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/ST2001/Assignments/Example Report Template.Rmd b/second/semester1/ST2001/Assignments/Example Report Template.Rmd
new file mode 100644
index 00000000..a53221d0
--- /dev/null
+++ b/second/semester1/ST2001/Assignments/Example Report Template.Rmd
@@ -0,0 +1,78 @@
+---
+title: "Assignment 2"
+author: "Andrew Hayes, id = 21321503"
+date: "`r format(Sys.time(), '%d %B, %Y')`"
+output:
+ word_document: default
+ pdf_document: default
+---
+
+## Starting with R-Markdown
+
+In the following R-Markdown document some data are created followed by calculation of some summary statistics and display of graphical summaries. All the results are embedded for you in the report when you `knit` the document into a report.
+
+The following `R` chunk creates a dataset in a vector and stores it in `R`'s memory using the name `x`. You will have been given some directions in how to adapt this dataset on Blackboard.
+
+```{r}
+
+x = c(10, 23, 14, 12, 34, 26, 28, 24)
+
+```
+
+The mean of this data is
+
+```{r}
+
+mean(x)
+
+```
+
+The summary statistics (minimum, maximum, $Q_1$, median, mean and $Q_3$) obtained from the `summary()` function are:
+
+```{r}
+# Insert your code here
+summary(x)
+
+
+
+```
+
+The five number summary which uses Tukey's method to estimate the lower and upper quartiles ($Q_1$ and $Q_3$) is given below. Notice the small differences in these quartiles.
+
+```{r}
+# Insert your code here
+fivenum(x)
+
+
+
+```
+
+The boxplot of the data below also uses Tukey's method. I would describe the shape of the distribution using the boxplot as right-skewed, as the tail on the right is significantly longer than the tail on the left. However, the median is offset to the right of the box, which would normally indicate a left-skew. One possible reason for this inconsistency is the small size of the dataset used for this boxplot, as boxplots are not very accurate for small data sets.
+
+```{r}
+
+boxplot(x)
+
+```
+
+A histogram is given below. I would describe the shape of the distribution using the histogram as right-skewed, as it peaks on the left, and decreases as it goes to the right.
+```{r}
+hist(x)
+```
+
+
+
+
+
+
+
+
+
+Use the help system in `R` to learn how to use the `breaks` argument in the `hist` function to include around 10 breakpoints. To use the help system type `help(hist)`
+```{r}
+hist(x, breaks = 10)
+```
+
+
+
+
diff --git a/second/semester1/ST2001/Assignments/Example-Report-Template.docx b/second/semester1/ST2001/Assignments/Example-Report-Template.docx
new file mode 100644
index 00000000..81ba800c
Binary files /dev/null and b/second/semester1/ST2001/Assignments/Example-Report-Template.docx differ
diff --git a/second/semester1/ST2001/Assignments/Example-Report-Template.pdf b/second/semester1/ST2001/Assignments/Example-Report-Template.pdf
new file mode 100644
index 00000000..b2147fb3
Binary files /dev/null and b/second/semester1/ST2001/Assignments/Example-Report-Template.pdf differ
diff --git a/second/semester1/ST2001/Assignments/certificate.pdf b/second/semester1/ST2001/Assignments/certificate.pdf
new file mode 100644
index 00000000..4915b72c
Binary files /dev/null and b/second/semester1/ST2001/Assignments/certificate.pdf differ
diff --git a/second/semester1/ST2001/Assignments/gapminder.csv b/second/semester1/ST2001/Assignments/gapminder.csv
new file mode 100644
index 00000000..810c4362
--- /dev/null
+++ b/second/semester1/ST2001/Assignments/gapminder.csv
@@ -0,0 +1,1705 @@
+"country","continent","year","lifeExp","pop","gdpPercap"
+"Afghanistan","Asia",1952,28.801,8425333,779.4453145
+"Afghanistan","Asia",1957,30.332,9240934,820.8530296
+"Afghanistan","Asia",1962,31.997,10267083,853.10071
+"Afghanistan","Asia",1967,34.02,11537966,836.1971382
+"Afghanistan","Asia",1972,36.088,13079460,739.9811058
+"Afghanistan","Asia",1977,38.438,14880372,786.11336
+"Afghanistan","Asia",1982,39.854,12881816,978.0114388
+"Afghanistan","Asia",1987,40.822,13867957,852.3959448
+"Afghanistan","Asia",1992,41.674,16317921,649.3413952
+"Afghanistan","Asia",1997,41.763,22227415,635.341351
+"Afghanistan","Asia",2002,42.129,25268405,726.7340548
+"Afghanistan","Asia",2007,43.828,31889923,974.5803384
+"Albania","Europe",1952,55.23,1282697,1601.056136
+"Albania","Europe",1957,59.28,1476505,1942.284244
+"Albania","Europe",1962,64.82,1728137,2312.888958
+"Albania","Europe",1967,66.22,1984060,2760.196931
+"Albania","Europe",1972,67.69,2263554,3313.422188
+"Albania","Europe",1977,68.93,2509048,3533.00391
+"Albania","Europe",1982,70.42,2780097,3630.880722
+"Albania","Europe",1987,72,3075321,3738.932735
+"Albania","Europe",1992,71.581,3326498,2497.437901
+"Albania","Europe",1997,72.95,3428038,3193.054604
+"Albania","Europe",2002,75.651,3508512,4604.211737
+"Albania","Europe",2007,76.423,3600523,5937.029526
+"Algeria","Africa",1952,43.077,9279525,2449.008185
+"Algeria","Africa",1957,45.685,10270856,3013.976023
+"Algeria","Africa",1962,48.303,11000948,2550.81688
+"Algeria","Africa",1967,51.407,12760499,3246.991771
+"Algeria","Africa",1972,54.518,14760787,4182.663766
+"Algeria","Africa",1977,58.014,17152804,4910.416756
+"Algeria","Africa",1982,61.368,20033753,5745.160213
+"Algeria","Africa",1987,65.799,23254956,5681.358539
+"Algeria","Africa",1992,67.744,26298373,5023.216647
+"Algeria","Africa",1997,69.152,29072015,4797.295051
+"Algeria","Africa",2002,70.994,31287142,5288.040382
+"Algeria","Africa",2007,72.301,33333216,6223.367465
+"Angola","Africa",1952,30.015,4232095,3520.610273
+"Angola","Africa",1957,31.999,4561361,3827.940465
+"Angola","Africa",1962,34,4826015,4269.276742
+"Angola","Africa",1967,35.985,5247469,5522.776375
+"Angola","Africa",1972,37.928,5894858,5473.288005
+"Angola","Africa",1977,39.483,6162675,3008.647355
+"Angola","Africa",1982,39.942,7016384,2756.953672
+"Angola","Africa",1987,39.906,7874230,2430.208311
+"Angola","Africa",1992,40.647,8735988,2627.845685
+"Angola","Africa",1997,40.963,9875024,2277.140884
+"Angola","Africa",2002,41.003,10866106,2773.287312
+"Angola","Africa",2007,42.731,12420476,4797.231267
+"Argentina","Americas",1952,62.485,17876956,5911.315053
+"Argentina","Americas",1957,64.399,19610538,6856.856212
+"Argentina","Americas",1962,65.142,21283783,7133.166023
+"Argentina","Americas",1967,65.634,22934225,8052.953021
+"Argentina","Americas",1972,67.065,24779799,9443.038526
+"Argentina","Americas",1977,68.481,26983828,10079.02674
+"Argentina","Americas",1982,69.942,29341374,8997.897412
+"Argentina","Americas",1987,70.774,31620918,9139.671389
+"Argentina","Americas",1992,71.868,33958947,9308.41871
+"Argentina","Americas",1997,73.275,36203463,10967.28195
+"Argentina","Americas",2002,74.34,38331121,8797.640716
+"Argentina","Americas",2007,75.32,40301927,12779.37964
+"Australia","Oceania",1952,69.12,8691212,10039.59564
+"Australia","Oceania",1957,70.33,9712569,10949.64959
+"Australia","Oceania",1962,70.93,10794968,12217.22686
+"Australia","Oceania",1967,71.1,11872264,14526.12465
+"Australia","Oceania",1972,71.93,13177000,16788.62948
+"Australia","Oceania",1977,73.49,14074100,18334.19751
+"Australia","Oceania",1982,74.74,15184200,19477.00928
+"Australia","Oceania",1987,76.32,16257249,21888.88903
+"Australia","Oceania",1992,77.56,17481977,23424.76683
+"Australia","Oceania",1997,78.83,18565243,26997.93657
+"Australia","Oceania",2002,80.37,19546792,30687.75473
+"Australia","Oceania",2007,81.235,20434176,34435.36744
+"Austria","Europe",1952,66.8,6927772,6137.076492
+"Austria","Europe",1957,67.48,6965860,8842.59803
+"Austria","Europe",1962,69.54,7129864,10750.72111
+"Austria","Europe",1967,70.14,7376998,12834.6024
+"Austria","Europe",1972,70.63,7544201,16661.6256
+"Austria","Europe",1977,72.17,7568430,19749.4223
+"Austria","Europe",1982,73.18,7574613,21597.08362
+"Austria","Europe",1987,74.94,7578903,23687.82607
+"Austria","Europe",1992,76.04,7914969,27042.01868
+"Austria","Europe",1997,77.51,8069876,29095.92066
+"Austria","Europe",2002,78.98,8148312,32417.60769
+"Austria","Europe",2007,79.829,8199783,36126.4927
+"Bahrain","Asia",1952,50.939,120447,9867.084765
+"Bahrain","Asia",1957,53.832,138655,11635.79945
+"Bahrain","Asia",1962,56.923,171863,12753.27514
+"Bahrain","Asia",1967,59.923,202182,14804.6727
+"Bahrain","Asia",1972,63.3,230800,18268.65839
+"Bahrain","Asia",1977,65.593,297410,19340.10196
+"Bahrain","Asia",1982,69.052,377967,19211.14731
+"Bahrain","Asia",1987,70.75,454612,18524.02406
+"Bahrain","Asia",1992,72.601,529491,19035.57917
+"Bahrain","Asia",1997,73.925,598561,20292.01679
+"Bahrain","Asia",2002,74.795,656397,23403.55927
+"Bahrain","Asia",2007,75.635,708573,29796.04834
+"Bangladesh","Asia",1952,37.484,46886859,684.2441716
+"Bangladesh","Asia",1957,39.348,51365468,661.6374577
+"Bangladesh","Asia",1962,41.216,56839289,686.3415538
+"Bangladesh","Asia",1967,43.453,62821884,721.1860862
+"Bangladesh","Asia",1972,45.252,70759295,630.2336265
+"Bangladesh","Asia",1977,46.923,80428306,659.8772322
+"Bangladesh","Asia",1982,50.009,93074406,676.9818656
+"Bangladesh","Asia",1987,52.819,103764241,751.9794035
+"Bangladesh","Asia",1992,56.018,113704579,837.8101643
+"Bangladesh","Asia",1997,59.412,123315288,972.7700352
+"Bangladesh","Asia",2002,62.013,135656790,1136.39043
+"Bangladesh","Asia",2007,64.062,150448339,1391.253792
+"Belgium","Europe",1952,68,8730405,8343.105127
+"Belgium","Europe",1957,69.24,8989111,9714.960623
+"Belgium","Europe",1962,70.25,9218400,10991.20676
+"Belgium","Europe",1967,70.94,9556500,13149.04119
+"Belgium","Europe",1972,71.44,9709100,16672.14356
+"Belgium","Europe",1977,72.8,9821800,19117.97448
+"Belgium","Europe",1982,73.93,9856303,20979.84589
+"Belgium","Europe",1987,75.35,9870200,22525.56308
+"Belgium","Europe",1992,76.46,10045622,25575.57069
+"Belgium","Europe",1997,77.53,10199787,27561.19663
+"Belgium","Europe",2002,78.32,10311970,30485.88375
+"Belgium","Europe",2007,79.441,10392226,33692.60508
+"Benin","Africa",1952,38.223,1738315,1062.7522
+"Benin","Africa",1957,40.358,1925173,959.6010805
+"Benin","Africa",1962,42.618,2151895,949.4990641
+"Benin","Africa",1967,44.885,2427334,1035.831411
+"Benin","Africa",1972,47.014,2761407,1085.796879
+"Benin","Africa",1977,49.19,3168267,1029.161251
+"Benin","Africa",1982,50.904,3641603,1277.897616
+"Benin","Africa",1987,52.337,4243788,1225.85601
+"Benin","Africa",1992,53.919,4981671,1191.207681
+"Benin","Africa",1997,54.777,6066080,1232.975292
+"Benin","Africa",2002,54.406,7026113,1372.877931
+"Benin","Africa",2007,56.728,8078314,1441.284873
+"Bolivia","Americas",1952,40.414,2883315,2677.326347
+"Bolivia","Americas",1957,41.89,3211738,2127.686326
+"Bolivia","Americas",1962,43.428,3593918,2180.972546
+"Bolivia","Americas",1967,45.032,4040665,2586.886053
+"Bolivia","Americas",1972,46.714,4565872,2980.331339
+"Bolivia","Americas",1977,50.023,5079716,3548.097832
+"Bolivia","Americas",1982,53.859,5642224,3156.510452
+"Bolivia","Americas",1987,57.251,6156369,2753.69149
+"Bolivia","Americas",1992,59.957,6893451,2961.699694
+"Bolivia","Americas",1997,62.05,7693188,3326.143191
+"Bolivia","Americas",2002,63.883,8445134,3413.26269
+"Bolivia","Americas",2007,65.554,9119152,3822.137084
+"Bosnia and Herzegovina","Europe",1952,53.82,2791000,973.5331948
+"Bosnia and Herzegovina","Europe",1957,58.45,3076000,1353.989176
+"Bosnia and Herzegovina","Europe",1962,61.93,3349000,1709.683679
+"Bosnia and Herzegovina","Europe",1967,64.79,3585000,2172.352423
+"Bosnia and Herzegovina","Europe",1972,67.45,3819000,2860.16975
+"Bosnia and Herzegovina","Europe",1977,69.86,4086000,3528.481305
+"Bosnia and Herzegovina","Europe",1982,70.69,4172693,4126.613157
+"Bosnia and Herzegovina","Europe",1987,71.14,4338977,4314.114757
+"Bosnia and Herzegovina","Europe",1992,72.178,4256013,2546.781445
+"Bosnia and Herzegovina","Europe",1997,73.244,3607000,4766.355904
+"Bosnia and Herzegovina","Europe",2002,74.09,4165416,6018.975239
+"Bosnia and Herzegovina","Europe",2007,74.852,4552198,7446.298803
+"Botswana","Africa",1952,47.622,442308,851.2411407
+"Botswana","Africa",1957,49.618,474639,918.2325349
+"Botswana","Africa",1962,51.52,512764,983.6539764
+"Botswana","Africa",1967,53.298,553541,1214.709294
+"Botswana","Africa",1972,56.024,619351,2263.611114
+"Botswana","Africa",1977,59.319,781472,3214.857818
+"Botswana","Africa",1982,61.484,970347,4551.14215
+"Botswana","Africa",1987,63.622,1151184,6205.88385
+"Botswana","Africa",1992,62.745,1342614,7954.111645
+"Botswana","Africa",1997,52.556,1536536,8647.142313
+"Botswana","Africa",2002,46.634,1630347,11003.60508
+"Botswana","Africa",2007,50.728,1639131,12569.85177
+"Brazil","Americas",1952,50.917,56602560,2108.944355
+"Brazil","Americas",1957,53.285,65551171,2487.365989
+"Brazil","Americas",1962,55.665,76039390,3336.585802
+"Brazil","Americas",1967,57.632,88049823,3429.864357
+"Brazil","Americas",1972,59.504,100840058,4985.711467
+"Brazil","Americas",1977,61.489,114313951,6660.118654
+"Brazil","Americas",1982,63.336,128962939,7030.835878
+"Brazil","Americas",1987,65.205,142938076,7807.095818
+"Brazil","Americas",1992,67.057,155975974,6950.283021
+"Brazil","Americas",1997,69.388,168546719,7957.980824
+"Brazil","Americas",2002,71.006,179914212,8131.212843
+"Brazil","Americas",2007,72.39,190010647,9065.800825
+"Bulgaria","Europe",1952,59.6,7274900,2444.286648
+"Bulgaria","Europe",1957,66.61,7651254,3008.670727
+"Bulgaria","Europe",1962,69.51,8012946,4254.337839
+"Bulgaria","Europe",1967,70.42,8310226,5577.0028
+"Bulgaria","Europe",1972,70.9,8576200,6597.494398
+"Bulgaria","Europe",1977,70.81,8797022,7612.240438
+"Bulgaria","Europe",1982,71.08,8892098,8224.191647
+"Bulgaria","Europe",1987,71.34,8971958,8239.854824
+"Bulgaria","Europe",1992,71.19,8658506,6302.623438
+"Bulgaria","Europe",1997,70.32,8066057,5970.38876
+"Bulgaria","Europe",2002,72.14,7661799,7696.777725
+"Bulgaria","Europe",2007,73.005,7322858,10680.79282
+"Burkina Faso","Africa",1952,31.975,4469979,543.2552413
+"Burkina Faso","Africa",1957,34.906,4713416,617.1834648
+"Burkina Faso","Africa",1962,37.814,4919632,722.5120206
+"Burkina Faso","Africa",1967,40.697,5127935,794.8265597
+"Burkina Faso","Africa",1972,43.591,5433886,854.7359763
+"Burkina Faso","Africa",1977,46.137,5889574,743.3870368
+"Burkina Faso","Africa",1982,48.122,6634596,807.1985855
+"Burkina Faso","Africa",1987,49.557,7586551,912.0631417
+"Burkina Faso","Africa",1992,50.26,8878303,931.7527731
+"Burkina Faso","Africa",1997,50.324,10352843,946.2949618
+"Burkina Faso","Africa",2002,50.65,12251209,1037.645221
+"Burkina Faso","Africa",2007,52.295,14326203,1217.032994
+"Burundi","Africa",1952,39.031,2445618,339.2964587
+"Burundi","Africa",1957,40.533,2667518,379.5646281
+"Burundi","Africa",1962,42.045,2961915,355.2032273
+"Burundi","Africa",1967,43.548,3330989,412.9775136
+"Burundi","Africa",1972,44.057,3529983,464.0995039
+"Burundi","Africa",1977,45.91,3834415,556.1032651
+"Burundi","Africa",1982,47.471,4580410,559.603231
+"Burundi","Africa",1987,48.211,5126023,621.8188189
+"Burundi","Africa",1992,44.736,5809236,631.6998778
+"Burundi","Africa",1997,45.326,6121610,463.1151478
+"Burundi","Africa",2002,47.36,7021078,446.4035126
+"Burundi","Africa",2007,49.58,8390505,430.0706916
+"Cambodia","Asia",1952,39.417,4693836,368.4692856
+"Cambodia","Asia",1957,41.366,5322536,434.0383364
+"Cambodia","Asia",1962,43.415,6083619,496.9136476
+"Cambodia","Asia",1967,45.415,6960067,523.4323142
+"Cambodia","Asia",1972,40.317,7450606,421.6240257
+"Cambodia","Asia",1977,31.22,6978607,524.9721832
+"Cambodia","Asia",1982,50.957,7272485,624.4754784
+"Cambodia","Asia",1987,53.914,8371791,683.8955732
+"Cambodia","Asia",1992,55.803,10150094,682.3031755
+"Cambodia","Asia",1997,56.534,11782962,734.28517
+"Cambodia","Asia",2002,56.752,12926707,896.2260153
+"Cambodia","Asia",2007,59.723,14131858,1713.778686
+"Cameroon","Africa",1952,38.523,5009067,1172.667655
+"Cameroon","Africa",1957,40.428,5359923,1313.048099
+"Cameroon","Africa",1962,42.643,5793633,1399.607441
+"Cameroon","Africa",1967,44.799,6335506,1508.453148
+"Cameroon","Africa",1972,47.049,7021028,1684.146528
+"Cameroon","Africa",1977,49.355,7959865,1783.432873
+"Cameroon","Africa",1982,52.961,9250831,2367.983282
+"Cameroon","Africa",1987,54.985,10780667,2602.664206
+"Cameroon","Africa",1992,54.314,12467171,1793.163278
+"Cameroon","Africa",1997,52.199,14195809,1694.337469
+"Cameroon","Africa",2002,49.856,15929988,1934.011449
+"Cameroon","Africa",2007,50.43,17696293,2042.09524
+"Canada","Americas",1952,68.75,14785584,11367.16112
+"Canada","Americas",1957,69.96,17010154,12489.95006
+"Canada","Americas",1962,71.3,18985849,13462.48555
+"Canada","Americas",1967,72.13,20819767,16076.58803
+"Canada","Americas",1972,72.88,22284500,18970.57086
+"Canada","Americas",1977,74.21,23796400,22090.88306
+"Canada","Americas",1982,75.76,25201900,22898.79214
+"Canada","Americas",1987,76.86,26549700,26626.51503
+"Canada","Americas",1992,77.95,28523502,26342.88426
+"Canada","Americas",1997,78.61,30305843,28954.92589
+"Canada","Americas",2002,79.77,31902268,33328.96507
+"Canada","Americas",2007,80.653,33390141,36319.23501
+"Central African Republic","Africa",1952,35.463,1291695,1071.310713
+"Central African Republic","Africa",1957,37.464,1392284,1190.844328
+"Central African Republic","Africa",1962,39.475,1523478,1193.068753
+"Central African Republic","Africa",1967,41.478,1733638,1136.056615
+"Central African Republic","Africa",1972,43.457,1927260,1070.013275
+"Central African Republic","Africa",1977,46.775,2167533,1109.374338
+"Central African Republic","Africa",1982,48.295,2476971,956.7529907
+"Central African Republic","Africa",1987,50.485,2840009,844.8763504
+"Central African Republic","Africa",1992,49.396,3265124,747.9055252
+"Central African Republic","Africa",1997,46.066,3696513,740.5063317
+"Central African Republic","Africa",2002,43.308,4048013,738.6906068
+"Central African Republic","Africa",2007,44.741,4369038,706.016537
+"Chad","Africa",1952,38.092,2682462,1178.665927
+"Chad","Africa",1957,39.881,2894855,1308.495577
+"Chad","Africa",1962,41.716,3150417,1389.817618
+"Chad","Africa",1967,43.601,3495967,1196.810565
+"Chad","Africa",1972,45.569,3899068,1104.103987
+"Chad","Africa",1977,47.383,4388260,1133.98495
+"Chad","Africa",1982,49.517,4875118,797.9081006
+"Chad","Africa",1987,51.051,5498955,952.386129
+"Chad","Africa",1992,51.724,6429417,1058.0643
+"Chad","Africa",1997,51.573,7562011,1004.961353
+"Chad","Africa",2002,50.525,8835739,1156.18186
+"Chad","Africa",2007,50.651,10238807,1704.063724
+"Chile","Americas",1952,54.745,6377619,3939.978789
+"Chile","Americas",1957,56.074,7048426,4315.622723
+"Chile","Americas",1962,57.924,7961258,4519.094331
+"Chile","Americas",1967,60.523,8858908,5106.654313
+"Chile","Americas",1972,63.441,9717524,5494.024437
+"Chile","Americas",1977,67.052,10599793,4756.763836
+"Chile","Americas",1982,70.565,11487112,5095.665738
+"Chile","Americas",1987,72.492,12463354,5547.063754
+"Chile","Americas",1992,74.126,13572994,7596.125964
+"Chile","Americas",1997,75.816,14599929,10118.05318
+"Chile","Americas",2002,77.86,15497046,10778.78385
+"Chile","Americas",2007,78.553,16284741,13171.63885
+"China","Asia",1952,44,556263527,400.448611
+"China","Asia",1957,50.54896,637408000,575.9870009
+"China","Asia",1962,44.50136,665770000,487.6740183
+"China","Asia",1967,58.38112,754550000,612.7056934
+"China","Asia",1972,63.11888,862030000,676.9000921
+"China","Asia",1977,63.96736,943455000,741.2374699
+"China","Asia",1982,65.525,1000281000,962.4213805
+"China","Asia",1987,67.274,1084035000,1378.904018
+"China","Asia",1992,68.69,1164970000,1655.784158
+"China","Asia",1997,70.426,1230075000,2289.234136
+"China","Asia",2002,72.028,1280400000,3119.280896
+"China","Asia",2007,72.961,1318683096,4959.114854
+"Colombia","Americas",1952,50.643,12350771,2144.115096
+"Colombia","Americas",1957,55.118,14485993,2323.805581
+"Colombia","Americas",1962,57.863,17009885,2492.351109
+"Colombia","Americas",1967,59.963,19764027,2678.729839
+"Colombia","Americas",1972,61.623,22542890,3264.660041
+"Colombia","Americas",1977,63.837,25094412,3815.80787
+"Colombia","Americas",1982,66.653,27764644,4397.575659
+"Colombia","Americas",1987,67.768,30964245,4903.2191
+"Colombia","Americas",1992,68.421,34202721,5444.648617
+"Colombia","Americas",1997,70.313,37657830,6117.361746
+"Colombia","Americas",2002,71.682,41008227,5755.259962
+"Colombia","Americas",2007,72.889,44227550,7006.580419
+"Comoros","Africa",1952,40.715,153936,1102.990936
+"Comoros","Africa",1957,42.46,170928,1211.148548
+"Comoros","Africa",1962,44.467,191689,1406.648278
+"Comoros","Africa",1967,46.472,217378,1876.029643
+"Comoros","Africa",1972,48.944,250027,1937.577675
+"Comoros","Africa",1977,50.939,304739,1172.603047
+"Comoros","Africa",1982,52.933,348643,1267.100083
+"Comoros","Africa",1987,54.926,395114,1315.980812
+"Comoros","Africa",1992,57.939,454429,1246.90737
+"Comoros","Africa",1997,60.66,527982,1173.618235
+"Comoros","Africa",2002,62.974,614382,1075.811558
+"Comoros","Africa",2007,65.152,710960,986.1478792
+"Congo, Dem. Rep.","Africa",1952,39.143,14100005,780.5423257
+"Congo, Dem. Rep.","Africa",1957,40.652,15577932,905.8602303
+"Congo, Dem. Rep.","Africa",1962,42.122,17486434,896.3146335
+"Congo, Dem. Rep.","Africa",1967,44.056,19941073,861.5932424
+"Congo, Dem. Rep.","Africa",1972,45.989,23007669,904.8960685
+"Congo, Dem. Rep.","Africa",1977,47.804,26480870,795.757282
+"Congo, Dem. Rep.","Africa",1982,47.784,30646495,673.7478181
+"Congo, Dem. Rep.","Africa",1987,47.412,35481645,672.774812
+"Congo, Dem. Rep.","Africa",1992,45.548,41672143,457.7191807
+"Congo, Dem. Rep.","Africa",1997,42.587,47798986,312.188423
+"Congo, Dem. Rep.","Africa",2002,44.966,55379852,241.1658765
+"Congo, Dem. Rep.","Africa",2007,46.462,64606759,277.5518587
+"Congo, Rep.","Africa",1952,42.111,854885,2125.621418
+"Congo, Rep.","Africa",1957,45.053,940458,2315.056572
+"Congo, Rep.","Africa",1962,48.435,1047924,2464.783157
+"Congo, Rep.","Africa",1967,52.04,1179760,2677.939642
+"Congo, Rep.","Africa",1972,54.907,1340458,3213.152683
+"Congo, Rep.","Africa",1977,55.625,1536769,3259.178978
+"Congo, Rep.","Africa",1982,56.695,1774735,4879.507522
+"Congo, Rep.","Africa",1987,57.47,2064095,4201.194937
+"Congo, Rep.","Africa",1992,56.433,2409073,4016.239529
+"Congo, Rep.","Africa",1997,52.962,2800947,3484.164376
+"Congo, Rep.","Africa",2002,52.97,3328795,3484.06197
+"Congo, Rep.","Africa",2007,55.322,3800610,3632.557798
+"Costa Rica","Americas",1952,57.206,926317,2627.009471
+"Costa Rica","Americas",1957,60.026,1112300,2990.010802
+"Costa Rica","Americas",1962,62.842,1345187,3460.937025
+"Costa Rica","Americas",1967,65.424,1588717,4161.727834
+"Costa Rica","Americas",1972,67.849,1834796,5118.146939
+"Costa Rica","Americas",1977,70.75,2108457,5926.876967
+"Costa Rica","Americas",1982,73.45,2424367,5262.734751
+"Costa Rica","Americas",1987,74.752,2799811,5629.915318
+"Costa Rica","Americas",1992,75.713,3173216,6160.416317
+"Costa Rica","Americas",1997,77.26,3518107,6677.045314
+"Costa Rica","Americas",2002,78.123,3834934,7723.447195
+"Costa Rica","Americas",2007,78.782,4133884,9645.06142
+"Cote d'Ivoire","Africa",1952,40.477,2977019,1388.594732
+"Cote d'Ivoire","Africa",1957,42.469,3300000,1500.895925
+"Cote d'Ivoire","Africa",1962,44.93,3832408,1728.869428
+"Cote d'Ivoire","Africa",1967,47.35,4744870,2052.050473
+"Cote d'Ivoire","Africa",1972,49.801,6071696,2378.201111
+"Cote d'Ivoire","Africa",1977,52.374,7459574,2517.736547
+"Cote d'Ivoire","Africa",1982,53.983,9025951,2602.710169
+"Cote d'Ivoire","Africa",1987,54.655,10761098,2156.956069
+"Cote d'Ivoire","Africa",1992,52.044,12772596,1648.073791
+"Cote d'Ivoire","Africa",1997,47.991,14625967,1786.265407
+"Cote d'Ivoire","Africa",2002,46.832,16252726,1648.800823
+"Cote d'Ivoire","Africa",2007,48.328,18013409,1544.750112
+"Croatia","Europe",1952,61.21,3882229,3119.23652
+"Croatia","Europe",1957,64.77,3991242,4338.231617
+"Croatia","Europe",1962,67.13,4076557,5477.890018
+"Croatia","Europe",1967,68.5,4174366,6960.297861
+"Croatia","Europe",1972,69.61,4225310,9164.090127
+"Croatia","Europe",1977,70.64,4318673,11305.38517
+"Croatia","Europe",1982,70.46,4413368,13221.82184
+"Croatia","Europe",1987,71.52,4484310,13822.58394
+"Croatia","Europe",1992,72.527,4494013,8447.794873
+"Croatia","Europe",1997,73.68,4444595,9875.604515
+"Croatia","Europe",2002,74.876,4481020,11628.38895
+"Croatia","Europe",2007,75.748,4493312,14619.22272
+"Cuba","Americas",1952,59.421,6007797,5586.53878
+"Cuba","Americas",1957,62.325,6640752,6092.174359
+"Cuba","Americas",1962,65.246,7254373,5180.75591
+"Cuba","Americas",1967,68.29,8139332,5690.268015
+"Cuba","Americas",1972,70.723,8831348,5305.445256
+"Cuba","Americas",1977,72.649,9537988,6380.494966
+"Cuba","Americas",1982,73.717,9789224,7316.918107
+"Cuba","Americas",1987,74.174,10239839,7532.924763
+"Cuba","Americas",1992,74.414,10723260,5592.843963
+"Cuba","Americas",1997,76.151,10983007,5431.990415
+"Cuba","Americas",2002,77.158,11226999,6340.646683
+"Cuba","Americas",2007,78.273,11416987,8948.102923
+"Czech Republic","Europe",1952,66.87,9125183,6876.14025
+"Czech Republic","Europe",1957,69.03,9513758,8256.343918
+"Czech Republic","Europe",1962,69.9,9620282,10136.86713
+"Czech Republic","Europe",1967,70.38,9835109,11399.44489
+"Czech Republic","Europe",1972,70.29,9862158,13108.4536
+"Czech Republic","Europe",1977,70.71,10161915,14800.16062
+"Czech Republic","Europe",1982,70.96,10303704,15377.22855
+"Czech Republic","Europe",1987,71.58,10311597,16310.4434
+"Czech Republic","Europe",1992,72.4,10315702,14297.02122
+"Czech Republic","Europe",1997,74.01,10300707,16048.51424
+"Czech Republic","Europe",2002,75.51,10256295,17596.21022
+"Czech Republic","Europe",2007,76.486,10228744,22833.30851
+"Denmark","Europe",1952,70.78,4334000,9692.385245
+"Denmark","Europe",1957,71.81,4487831,11099.65935
+"Denmark","Europe",1962,72.35,4646899,13583.31351
+"Denmark","Europe",1967,72.96,4838800,15937.21123
+"Denmark","Europe",1972,73.47,4991596,18866.20721
+"Denmark","Europe",1977,74.69,5088419,20422.9015
+"Denmark","Europe",1982,74.63,5117810,21688.04048
+"Denmark","Europe",1987,74.8,5127024,25116.17581
+"Denmark","Europe",1992,75.33,5171393,26406.73985
+"Denmark","Europe",1997,76.11,5283663,29804.34567
+"Denmark","Europe",2002,77.18,5374693,32166.50006
+"Denmark","Europe",2007,78.332,5468120,35278.41874
+"Djibouti","Africa",1952,34.812,63149,2669.529475
+"Djibouti","Africa",1957,37.328,71851,2864.969076
+"Djibouti","Africa",1962,39.693,89898,3020.989263
+"Djibouti","Africa",1967,42.074,127617,3020.050513
+"Djibouti","Africa",1972,44.366,178848,3694.212352
+"Djibouti","Africa",1977,46.519,228694,3081.761022
+"Djibouti","Africa",1982,48.812,305991,2879.468067
+"Djibouti","Africa",1987,50.04,311025,2880.102568
+"Djibouti","Africa",1992,51.604,384156,2377.156192
+"Djibouti","Africa",1997,53.157,417908,1895.016984
+"Djibouti","Africa",2002,53.373,447416,1908.260867
+"Djibouti","Africa",2007,54.791,496374,2082.481567
+"Dominican Republic","Americas",1952,45.928,2491346,1397.717137
+"Dominican Republic","Americas",1957,49.828,2923186,1544.402995
+"Dominican Republic","Americas",1962,53.459,3453434,1662.137359
+"Dominican Republic","Americas",1967,56.751,4049146,1653.723003
+"Dominican Republic","Americas",1972,59.631,4671329,2189.874499
+"Dominican Republic","Americas",1977,61.788,5302800,2681.9889
+"Dominican Republic","Americas",1982,63.727,5968349,2861.092386
+"Dominican Republic","Americas",1987,66.046,6655297,2899.842175
+"Dominican Republic","Americas",1992,68.457,7351181,3044.214214
+"Dominican Republic","Americas",1997,69.957,7992357,3614.101285
+"Dominican Republic","Americas",2002,70.847,8650322,4563.808154
+"Dominican Republic","Americas",2007,72.235,9319622,6025.374752
+"Ecuador","Americas",1952,48.357,3548753,3522.110717
+"Ecuador","Americas",1957,51.356,4058385,3780.546651
+"Ecuador","Americas",1962,54.64,4681707,4086.114078
+"Ecuador","Americas",1967,56.678,5432424,4579.074215
+"Ecuador","Americas",1972,58.796,6298651,5280.99471
+"Ecuador","Americas",1977,61.31,7278866,6679.62326
+"Ecuador","Americas",1982,64.342,8365850,7213.791267
+"Ecuador","Americas",1987,67.231,9545158,6481.776993
+"Ecuador","Americas",1992,69.613,10748394,7103.702595
+"Ecuador","Americas",1997,72.312,11911819,7429.455877
+"Ecuador","Americas",2002,74.173,12921234,5773.044512
+"Ecuador","Americas",2007,74.994,13755680,6873.262326
+"Egypt","Africa",1952,41.893,22223309,1418.822445
+"Egypt","Africa",1957,44.444,25009741,1458.915272
+"Egypt","Africa",1962,46.992,28173309,1693.335853
+"Egypt","Africa",1967,49.293,31681188,1814.880728
+"Egypt","Africa",1972,51.137,34807417,2024.008147
+"Egypt","Africa",1977,53.319,38783863,2785.493582
+"Egypt","Africa",1982,56.006,45681811,3503.729636
+"Egypt","Africa",1987,59.797,52799062,3885.46071
+"Egypt","Africa",1992,63.674,59402198,3794.755195
+"Egypt","Africa",1997,67.217,66134291,4173.181797
+"Egypt","Africa",2002,69.806,73312559,4754.604414
+"Egypt","Africa",2007,71.338,80264543,5581.180998
+"El Salvador","Americas",1952,45.262,2042865,3048.3029
+"El Salvador","Americas",1957,48.57,2355805,3421.523218
+"El Salvador","Americas",1962,52.307,2747687,3776.803627
+"El Salvador","Americas",1967,55.855,3232927,4358.595393
+"El Salvador","Americas",1972,58.207,3790903,4520.246008
+"El Salvador","Americas",1977,56.696,4282586,5138.922374
+"El Salvador","Americas",1982,56.604,4474873,4098.344175
+"El Salvador","Americas",1987,63.154,4842194,4140.442097
+"El Salvador","Americas",1992,66.798,5274649,4444.2317
+"El Salvador","Americas",1997,69.535,5783439,5154.825496
+"El Salvador","Americas",2002,70.734,6353681,5351.568666
+"El Salvador","Americas",2007,71.878,6939688,5728.353514
+"Equatorial Guinea","Africa",1952,34.482,216964,375.6431231
+"Equatorial Guinea","Africa",1957,35.983,232922,426.0964081
+"Equatorial Guinea","Africa",1962,37.485,249220,582.8419714
+"Equatorial Guinea","Africa",1967,38.987,259864,915.5960025
+"Equatorial Guinea","Africa",1972,40.516,277603,672.4122571
+"Equatorial Guinea","Africa",1977,42.024,192675,958.5668124
+"Equatorial Guinea","Africa",1982,43.662,285483,927.8253427
+"Equatorial Guinea","Africa",1987,45.664,341244,966.8968149
+"Equatorial Guinea","Africa",1992,47.545,387838,1132.055034
+"Equatorial Guinea","Africa",1997,48.245,439971,2814.480755
+"Equatorial Guinea","Africa",2002,49.348,495627,7703.4959
+"Equatorial Guinea","Africa",2007,51.579,551201,12154.08975
+"Eritrea","Africa",1952,35.928,1438760,328.9405571
+"Eritrea","Africa",1957,38.047,1542611,344.1618859
+"Eritrea","Africa",1962,40.158,1666618,380.9958433
+"Eritrea","Africa",1967,42.189,1820319,468.7949699
+"Eritrea","Africa",1972,44.142,2260187,514.3242082
+"Eritrea","Africa",1977,44.535,2512642,505.7538077
+"Eritrea","Africa",1982,43.89,2637297,524.8758493
+"Eritrea","Africa",1987,46.453,2915959,521.1341333
+"Eritrea","Africa",1992,49.991,3668440,582.8585102
+"Eritrea","Africa",1997,53.378,4058319,913.47079
+"Eritrea","Africa",2002,55.24,4414865,765.3500015
+"Eritrea","Africa",2007,58.04,4906585,641.3695236
+"Ethiopia","Africa",1952,34.078,20860941,362.1462796
+"Ethiopia","Africa",1957,36.667,22815614,378.9041632
+"Ethiopia","Africa",1962,40.059,25145372,419.4564161
+"Ethiopia","Africa",1967,42.115,27860297,516.1186438
+"Ethiopia","Africa",1972,43.515,30770372,566.2439442
+"Ethiopia","Africa",1977,44.51,34617799,556.8083834
+"Ethiopia","Africa",1982,44.916,38111756,577.8607471
+"Ethiopia","Africa",1987,46.684,42999530,573.7413142
+"Ethiopia","Africa",1992,48.091,52088559,421.3534653
+"Ethiopia","Africa",1997,49.402,59861301,515.8894013
+"Ethiopia","Africa",2002,50.725,67946797,530.0535319
+"Ethiopia","Africa",2007,52.947,76511887,690.8055759
+"Finland","Europe",1952,66.55,4090500,6424.519071
+"Finland","Europe",1957,67.49,4324000,7545.415386
+"Finland","Europe",1962,68.75,4491443,9371.842561
+"Finland","Europe",1967,69.83,4605744,10921.63626
+"Finland","Europe",1972,70.87,4639657,14358.8759
+"Finland","Europe",1977,72.52,4738902,15605.42283
+"Finland","Europe",1982,74.55,4826933,18533.15761
+"Finland","Europe",1987,74.83,4931729,21141.01223
+"Finland","Europe",1992,75.7,5041039,20647.16499
+"Finland","Europe",1997,77.13,5134406,23723.9502
+"Finland","Europe",2002,78.37,5193039,28204.59057
+"Finland","Europe",2007,79.313,5238460,33207.0844
+"France","Europe",1952,67.41,42459667,7029.809327
+"France","Europe",1957,68.93,44310863,8662.834898
+"France","Europe",1962,70.51,47124000,10560.48553
+"France","Europe",1967,71.55,49569000,12999.91766
+"France","Europe",1972,72.38,51732000,16107.19171
+"France","Europe",1977,73.83,53165019,18292.63514
+"France","Europe",1982,74.89,54433565,20293.89746
+"France","Europe",1987,76.34,55630100,22066.44214
+"France","Europe",1992,77.46,57374179,24703.79615
+"France","Europe",1997,78.64,58623428,25889.78487
+"France","Europe",2002,79.59,59925035,28926.03234
+"France","Europe",2007,80.657,61083916,30470.0167
+"Gabon","Africa",1952,37.003,420702,4293.476475
+"Gabon","Africa",1957,38.999,434904,4976.198099
+"Gabon","Africa",1962,40.489,455661,6631.459222
+"Gabon","Africa",1967,44.598,489004,8358.761987
+"Gabon","Africa",1972,48.69,537977,11401.94841
+"Gabon","Africa",1977,52.79,706367,21745.57328
+"Gabon","Africa",1982,56.564,753874,15113.36194
+"Gabon","Africa",1987,60.19,880397,11864.40844
+"Gabon","Africa",1992,61.366,985739,13522.15752
+"Gabon","Africa",1997,60.461,1126189,14722.84188
+"Gabon","Africa",2002,56.761,1299304,12521.71392
+"Gabon","Africa",2007,56.735,1454867,13206.48452
+"Gambia","Africa",1952,30,284320,485.2306591
+"Gambia","Africa",1957,32.065,323150,520.9267111
+"Gambia","Africa",1962,33.896,374020,599.650276
+"Gambia","Africa",1967,35.857,439593,734.7829124
+"Gambia","Africa",1972,38.308,517101,756.0868363
+"Gambia","Africa",1977,41.842,608274,884.7552507
+"Gambia","Africa",1982,45.58,715523,835.8096108
+"Gambia","Africa",1987,49.265,848406,611.6588611
+"Gambia","Africa",1992,52.644,1025384,665.6244126
+"Gambia","Africa",1997,55.861,1235767,653.7301704
+"Gambia","Africa",2002,58.041,1457766,660.5855997
+"Gambia","Africa",2007,59.448,1688359,752.7497265
+"Germany","Europe",1952,67.5,69145952,7144.114393
+"Germany","Europe",1957,69.1,71019069,10187.82665
+"Germany","Europe",1962,70.3,73739117,12902.46291
+"Germany","Europe",1967,70.8,76368453,14745.62561
+"Germany","Europe",1972,71,78717088,18016.18027
+"Germany","Europe",1977,72.5,78160773,20512.92123
+"Germany","Europe",1982,73.8,78335266,22031.53274
+"Germany","Europe",1987,74.847,77718298,24639.18566
+"Germany","Europe",1992,76.07,80597764,26505.30317
+"Germany","Europe",1997,77.34,82011073,27788.88416
+"Germany","Europe",2002,78.67,82350671,30035.80198
+"Germany","Europe",2007,79.406,82400996,32170.37442
+"Ghana","Africa",1952,43.149,5581001,911.2989371
+"Ghana","Africa",1957,44.779,6391288,1043.561537
+"Ghana","Africa",1962,46.452,7355248,1190.041118
+"Ghana","Africa",1967,48.072,8490213,1125.69716
+"Ghana","Africa",1972,49.875,9354120,1178.223708
+"Ghana","Africa",1977,51.756,10538093,993.2239571
+"Ghana","Africa",1982,53.744,11400338,876.032569
+"Ghana","Africa",1987,55.729,14168101,847.0061135
+"Ghana","Africa",1992,57.501,16278738,925.060154
+"Ghana","Africa",1997,58.556,18418288,1005.245812
+"Ghana","Africa",2002,58.453,20550751,1111.984578
+"Ghana","Africa",2007,60.022,22873338,1327.60891
+"Greece","Europe",1952,65.86,7733250,3530.690067
+"Greece","Europe",1957,67.86,8096218,4916.299889
+"Greece","Europe",1962,69.51,8448233,6017.190733
+"Greece","Europe",1967,71,8716441,8513.097016
+"Greece","Europe",1972,72.34,8888628,12724.82957
+"Greece","Europe",1977,73.68,9308479,14195.52428
+"Greece","Europe",1982,75.24,9786480,15268.42089
+"Greece","Europe",1987,76.67,9974490,16120.52839
+"Greece","Europe",1992,77.03,10325429,17541.49634
+"Greece","Europe",1997,77.869,10502372,18747.69814
+"Greece","Europe",2002,78.256,10603863,22514.2548
+"Greece","Europe",2007,79.483,10706290,27538.41188
+"Guatemala","Americas",1952,42.023,3146381,2428.237769
+"Guatemala","Americas",1957,44.142,3640876,2617.155967
+"Guatemala","Americas",1962,46.954,4208858,2750.364446
+"Guatemala","Americas",1967,50.016,4690773,3242.531147
+"Guatemala","Americas",1972,53.738,5149581,4031.408271
+"Guatemala","Americas",1977,56.029,5703430,4879.992748
+"Guatemala","Americas",1982,58.137,6395630,4820.49479
+"Guatemala","Americas",1987,60.782,7326406,4246.485974
+"Guatemala","Americas",1992,63.373,8486949,4439.45084
+"Guatemala","Americas",1997,66.322,9803875,4684.313807
+"Guatemala","Americas",2002,68.978,11178650,4858.347495
+"Guatemala","Americas",2007,70.259,12572928,5186.050003
+"Guinea","Africa",1952,33.609,2664249,510.1964923
+"Guinea","Africa",1957,34.558,2876726,576.2670245
+"Guinea","Africa",1962,35.753,3140003,686.3736739
+"Guinea","Africa",1967,37.197,3451418,708.7595409
+"Guinea","Africa",1972,38.842,3811387,741.6662307
+"Guinea","Africa",1977,40.762,4227026,874.6858643
+"Guinea","Africa",1982,42.891,4710497,857.2503577
+"Guinea","Africa",1987,45.552,5650262,805.5724718
+"Guinea","Africa",1992,48.576,6990574,794.3484384
+"Guinea","Africa",1997,51.455,8048834,869.4497668
+"Guinea","Africa",2002,53.676,8807818,945.5835837
+"Guinea","Africa",2007,56.007,9947814,942.6542111
+"Guinea-Bissau","Africa",1952,32.5,580653,299.850319
+"Guinea-Bissau","Africa",1957,33.489,601095,431.7904566
+"Guinea-Bissau","Africa",1962,34.488,627820,522.0343725
+"Guinea-Bissau","Africa",1967,35.492,601287,715.5806402
+"Guinea-Bissau","Africa",1972,36.486,625361,820.2245876
+"Guinea-Bissau","Africa",1977,37.465,745228,764.7259628
+"Guinea-Bissau","Africa",1982,39.327,825987,838.1239671
+"Guinea-Bissau","Africa",1987,41.245,927524,736.4153921
+"Guinea-Bissau","Africa",1992,43.266,1050938,745.5398706
+"Guinea-Bissau","Africa",1997,44.873,1193708,796.6644681
+"Guinea-Bissau","Africa",2002,45.504,1332459,575.7047176
+"Guinea-Bissau","Africa",2007,46.388,1472041,579.231743
+"Haiti","Americas",1952,37.579,3201488,1840.366939
+"Haiti","Americas",1957,40.696,3507701,1726.887882
+"Haiti","Americas",1962,43.59,3880130,1796.589032
+"Haiti","Americas",1967,46.243,4318137,1452.057666
+"Haiti","Americas",1972,48.042,4698301,1654.456946
+"Haiti","Americas",1977,49.923,4908554,1874.298931
+"Haiti","Americas",1982,51.461,5198399,2011.159549
+"Haiti","Americas",1987,53.636,5756203,1823.015995
+"Haiti","Americas",1992,55.089,6326682,1456.309517
+"Haiti","Americas",1997,56.671,6913545,1341.726931
+"Haiti","Americas",2002,58.137,7607651,1270.364932
+"Haiti","Americas",2007,60.916,8502814,1201.637154
+"Honduras","Americas",1952,41.912,1517453,2194.926204
+"Honduras","Americas",1957,44.665,1770390,2220.487682
+"Honduras","Americas",1962,48.041,2090162,2291.156835
+"Honduras","Americas",1967,50.924,2500689,2538.269358
+"Honduras","Americas",1972,53.884,2965146,2529.842345
+"Honduras","Americas",1977,57.402,3055235,3203.208066
+"Honduras","Americas",1982,60.909,3669448,3121.760794
+"Honduras","Americas",1987,64.492,4372203,3023.096699
+"Honduras","Americas",1992,66.399,5077347,3081.694603
+"Honduras","Americas",1997,67.659,5867957,3160.454906
+"Honduras","Americas",2002,68.565,6677328,3099.72866
+"Honduras","Americas",2007,70.198,7483763,3548.330846
+"Hong Kong, China","Asia",1952,60.96,2125900,3054.421209
+"Hong Kong, China","Asia",1957,64.75,2736300,3629.076457
+"Hong Kong, China","Asia",1962,67.65,3305200,4692.648272
+"Hong Kong, China","Asia",1967,70,3722800,6197.962814
+"Hong Kong, China","Asia",1972,72,4115700,8315.928145
+"Hong Kong, China","Asia",1977,73.6,4583700,11186.14125
+"Hong Kong, China","Asia",1982,75.45,5264500,14560.53051
+"Hong Kong, China","Asia",1987,76.2,5584510,20038.47269
+"Hong Kong, China","Asia",1992,77.601,5829696,24757.60301
+"Hong Kong, China","Asia",1997,80,6495918,28377.63219
+"Hong Kong, China","Asia",2002,81.495,6762476,30209.01516
+"Hong Kong, China","Asia",2007,82.208,6980412,39724.97867
+"Hungary","Europe",1952,64.03,9504000,5263.673816
+"Hungary","Europe",1957,66.41,9839000,6040.180011
+"Hungary","Europe",1962,67.96,10063000,7550.359877
+"Hungary","Europe",1967,69.5,10223422,9326.64467
+"Hungary","Europe",1972,69.76,10394091,10168.65611
+"Hungary","Europe",1977,69.95,10637171,11674.83737
+"Hungary","Europe",1982,69.39,10705535,12545.99066
+"Hungary","Europe",1987,69.58,10612740,12986.47998
+"Hungary","Europe",1992,69.17,10348684,10535.62855
+"Hungary","Europe",1997,71.04,10244684,11712.7768
+"Hungary","Europe",2002,72.59,10083313,14843.93556
+"Hungary","Europe",2007,73.338,9956108,18008.94444
+"Iceland","Europe",1952,72.49,147962,7267.688428
+"Iceland","Europe",1957,73.47,165110,9244.001412
+"Iceland","Europe",1962,73.68,182053,10350.15906
+"Iceland","Europe",1967,73.73,198676,13319.89568
+"Iceland","Europe",1972,74.46,209275,15798.06362
+"Iceland","Europe",1977,76.11,221823,19654.96247
+"Iceland","Europe",1982,76.99,233997,23269.6075
+"Iceland","Europe",1987,77.23,244676,26923.20628
+"Iceland","Europe",1992,78.77,259012,25144.39201
+"Iceland","Europe",1997,78.95,271192,28061.09966
+"Iceland","Europe",2002,80.5,288030,31163.20196
+"Iceland","Europe",2007,81.757,301931,36180.78919
+"India","Asia",1952,37.373,372000000,546.5657493
+"India","Asia",1957,40.249,409000000,590.061996
+"India","Asia",1962,43.605,454000000,658.3471509
+"India","Asia",1967,47.193,506000000,700.7706107
+"India","Asia",1972,50.651,567000000,724.032527
+"India","Asia",1977,54.208,634000000,813.337323
+"India","Asia",1982,56.596,708000000,855.7235377
+"India","Asia",1987,58.553,788000000,976.5126756
+"India","Asia",1992,60.223,872000000,1164.406809
+"India","Asia",1997,61.765,959000000,1458.817442
+"India","Asia",2002,62.879,1034172547,1746.769454
+"India","Asia",2007,64.698,1110396331,2452.210407
+"Indonesia","Asia",1952,37.468,82052000,749.6816546
+"Indonesia","Asia",1957,39.918,90124000,858.9002707
+"Indonesia","Asia",1962,42.518,99028000,849.2897701
+"Indonesia","Asia",1967,45.964,109343000,762.4317721
+"Indonesia","Asia",1972,49.203,121282000,1111.107907
+"Indonesia","Asia",1977,52.702,136725000,1382.702056
+"Indonesia","Asia",1982,56.159,153343000,1516.872988
+"Indonesia","Asia",1987,60.137,169276000,1748.356961
+"Indonesia","Asia",1992,62.681,184816000,2383.140898
+"Indonesia","Asia",1997,66.041,199278000,3119.335603
+"Indonesia","Asia",2002,68.588,211060000,2873.91287
+"Indonesia","Asia",2007,70.65,223547000,3540.651564
+"Iran","Asia",1952,44.869,17272000,3035.326002
+"Iran","Asia",1957,47.181,19792000,3290.257643
+"Iran","Asia",1962,49.325,22874000,4187.329802
+"Iran","Asia",1967,52.469,26538000,5906.731805
+"Iran","Asia",1972,55.234,30614000,9613.818607
+"Iran","Asia",1977,57.702,35480679,11888.59508
+"Iran","Asia",1982,59.62,43072751,7608.334602
+"Iran","Asia",1987,63.04,51889696,6642.881371
+"Iran","Asia",1992,65.742,60397973,7235.653188
+"Iran","Asia",1997,68.042,63327987,8263.590301
+"Iran","Asia",2002,69.451,66907826,9240.761975
+"Iran","Asia",2007,70.964,69453570,11605.71449
+"Iraq","Asia",1952,45.32,5441766,4129.766056
+"Iraq","Asia",1957,48.437,6248643,6229.333562
+"Iraq","Asia",1962,51.457,7240260,8341.737815
+"Iraq","Asia",1967,54.459,8519282,8931.459811
+"Iraq","Asia",1972,56.95,10061506,9576.037596
+"Iraq","Asia",1977,60.413,11882916,14688.23507
+"Iraq","Asia",1982,62.038,14173318,14517.90711
+"Iraq","Asia",1987,65.044,16543189,11643.57268
+"Iraq","Asia",1992,59.461,17861905,3745.640687
+"Iraq","Asia",1997,58.811,20775703,3076.239795
+"Iraq","Asia",2002,57.046,24001816,4390.717312
+"Iraq","Asia",2007,59.545,27499638,4471.061906
+"Ireland","Europe",1952,66.91,2952156,5210.280328
+"Ireland","Europe",1957,68.9,2878220,5599.077872
+"Ireland","Europe",1962,70.29,2830000,6631.597314
+"Ireland","Europe",1967,71.08,2900100,7655.568963
+"Ireland","Europe",1972,71.28,3024400,9530.772896
+"Ireland","Europe",1977,72.03,3271900,11150.98113
+"Ireland","Europe",1982,73.1,3480000,12618.32141
+"Ireland","Europe",1987,74.36,3539900,13872.86652
+"Ireland","Europe",1992,75.467,3557761,17558.81555
+"Ireland","Europe",1997,76.122,3667233,24521.94713
+"Ireland","Europe",2002,77.783,3879155,34077.04939
+"Ireland","Europe",2007,78.885,4109086,40675.99635
+"Israel","Asia",1952,65.39,1620914,4086.522128
+"Israel","Asia",1957,67.84,1944401,5385.278451
+"Israel","Asia",1962,69.39,2310904,7105.630706
+"Israel","Asia",1967,70.75,2693585,8393.741404
+"Israel","Asia",1972,71.63,3095893,12786.93223
+"Israel","Asia",1977,73.06,3495918,13306.61921
+"Israel","Asia",1982,74.45,3858421,15367.0292
+"Israel","Asia",1987,75.6,4203148,17122.47986
+"Israel","Asia",1992,76.93,4936550,18051.52254
+"Israel","Asia",1997,78.269,5531387,20896.60924
+"Israel","Asia",2002,79.696,6029529,21905.59514
+"Israel","Asia",2007,80.745,6426679,25523.2771
+"Italy","Europe",1952,65.94,47666000,4931.404155
+"Italy","Europe",1957,67.81,49182000,6248.656232
+"Italy","Europe",1962,69.24,50843200,8243.58234
+"Italy","Europe",1967,71.06,52667100,10022.40131
+"Italy","Europe",1972,72.19,54365564,12269.27378
+"Italy","Europe",1977,73.48,56059245,14255.98475
+"Italy","Europe",1982,74.98,56535636,16537.4835
+"Italy","Europe",1987,76.42,56729703,19207.23482
+"Italy","Europe",1992,77.44,56840847,22013.64486
+"Italy","Europe",1997,78.82,57479469,24675.02446
+"Italy","Europe",2002,80.24,57926999,27968.09817
+"Italy","Europe",2007,80.546,58147733,28569.7197
+"Jamaica","Americas",1952,58.53,1426095,2898.530881
+"Jamaica","Americas",1957,62.61,1535090,4756.525781
+"Jamaica","Americas",1962,65.61,1665128,5246.107524
+"Jamaica","Americas",1967,67.51,1861096,6124.703451
+"Jamaica","Americas",1972,69,1997616,7433.889293
+"Jamaica","Americas",1977,70.11,2156814,6650.195573
+"Jamaica","Americas",1982,71.21,2298309,6068.05135
+"Jamaica","Americas",1987,71.77,2326606,6351.237495
+"Jamaica","Americas",1992,71.766,2378618,7404.923685
+"Jamaica","Americas",1997,72.262,2531311,7121.924704
+"Jamaica","Americas",2002,72.047,2664659,6994.774861
+"Jamaica","Americas",2007,72.567,2780132,7320.880262
+"Japan","Asia",1952,63.03,86459025,3216.956347
+"Japan","Asia",1957,65.5,91563009,4317.694365
+"Japan","Asia",1962,68.73,95831757,6576.649461
+"Japan","Asia",1967,71.43,100825279,9847.788607
+"Japan","Asia",1972,73.42,107188273,14778.78636
+"Japan","Asia",1977,75.38,113872473,16610.37701
+"Japan","Asia",1982,77.11,118454974,19384.10571
+"Japan","Asia",1987,78.67,122091325,22375.94189
+"Japan","Asia",1992,79.36,124329269,26824.89511
+"Japan","Asia",1997,80.69,125956499,28816.58499
+"Japan","Asia",2002,82,127065841,28604.5919
+"Japan","Asia",2007,82.603,127467972,31656.06806
+"Jordan","Asia",1952,43.158,607914,1546.907807
+"Jordan","Asia",1957,45.669,746559,1886.080591
+"Jordan","Asia",1962,48.126,933559,2348.009158
+"Jordan","Asia",1967,51.629,1255058,2741.796252
+"Jordan","Asia",1972,56.528,1613551,2110.856309
+"Jordan","Asia",1977,61.134,1937652,2852.351568
+"Jordan","Asia",1982,63.739,2347031,4161.415959
+"Jordan","Asia",1987,65.869,2820042,4448.679912
+"Jordan","Asia",1992,68.015,3867409,3431.593647
+"Jordan","Asia",1997,69.772,4526235,3645.379572
+"Jordan","Asia",2002,71.263,5307470,3844.917194
+"Jordan","Asia",2007,72.535,6053193,4519.461171
+"Kenya","Africa",1952,42.27,6464046,853.540919
+"Kenya","Africa",1957,44.686,7454779,944.4383152
+"Kenya","Africa",1962,47.949,8678557,896.9663732
+"Kenya","Africa",1967,50.654,10191512,1056.736457
+"Kenya","Africa",1972,53.559,12044785,1222.359968
+"Kenya","Africa",1977,56.155,14500404,1267.613204
+"Kenya","Africa",1982,58.766,17661452,1348.225791
+"Kenya","Africa",1987,59.339,21198082,1361.936856
+"Kenya","Africa",1992,59.285,25020539,1341.921721
+"Kenya","Africa",1997,54.407,28263827,1360.485021
+"Kenya","Africa",2002,50.992,31386842,1287.514732
+"Kenya","Africa",2007,54.11,35610177,1463.249282
+"Korea, Dem. Rep.","Asia",1952,50.056,8865488,1088.277758
+"Korea, Dem. Rep.","Asia",1957,54.081,9411381,1571.134655
+"Korea, Dem. Rep.","Asia",1962,56.656,10917494,1621.693598
+"Korea, Dem. Rep.","Asia",1967,59.942,12617009,2143.540609
+"Korea, Dem. Rep.","Asia",1972,63.983,14781241,3701.621503
+"Korea, Dem. Rep.","Asia",1977,67.159,16325320,4106.301249
+"Korea, Dem. Rep.","Asia",1982,69.1,17647518,4106.525293
+"Korea, Dem. Rep.","Asia",1987,70.647,19067554,4106.492315
+"Korea, Dem. Rep.","Asia",1992,69.978,20711375,3726.063507
+"Korea, Dem. Rep.","Asia",1997,67.727,21585105,1690.756814
+"Korea, Dem. Rep.","Asia",2002,66.662,22215365,1646.758151
+"Korea, Dem. Rep.","Asia",2007,67.297,23301725,1593.06548
+"Korea, Rep.","Asia",1952,47.453,20947571,1030.592226
+"Korea, Rep.","Asia",1957,52.681,22611552,1487.593537
+"Korea, Rep.","Asia",1962,55.292,26420307,1536.344387
+"Korea, Rep.","Asia",1967,57.716,30131000,2029.228142
+"Korea, Rep.","Asia",1972,62.612,33505000,3030.87665
+"Korea, Rep.","Asia",1977,64.766,36436000,4657.22102
+"Korea, Rep.","Asia",1982,67.123,39326000,5622.942464
+"Korea, Rep.","Asia",1987,69.81,41622000,8533.088805
+"Korea, Rep.","Asia",1992,72.244,43805450,12104.27872
+"Korea, Rep.","Asia",1997,74.647,46173816,15993.52796
+"Korea, Rep.","Asia",2002,77.045,47969150,19233.98818
+"Korea, Rep.","Asia",2007,78.623,49044790,23348.13973
+"Kuwait","Asia",1952,55.565,160000,108382.3529
+"Kuwait","Asia",1957,58.033,212846,113523.1329
+"Kuwait","Asia",1962,60.47,358266,95458.11176
+"Kuwait","Asia",1967,64.624,575003,80894.88326
+"Kuwait","Asia",1972,67.712,841934,109347.867
+"Kuwait","Asia",1977,69.343,1140357,59265.47714
+"Kuwait","Asia",1982,71.309,1497494,31354.03573
+"Kuwait","Asia",1987,74.174,1891487,28118.42998
+"Kuwait","Asia",1992,75.19,1418095,34932.91959
+"Kuwait","Asia",1997,76.156,1765345,40300.61996
+"Kuwait","Asia",2002,76.904,2111561,35110.10566
+"Kuwait","Asia",2007,77.588,2505559,47306.98978
+"Lebanon","Asia",1952,55.928,1439529,4834.804067
+"Lebanon","Asia",1957,59.489,1647412,6089.786934
+"Lebanon","Asia",1962,62.094,1886848,5714.560611
+"Lebanon","Asia",1967,63.87,2186894,6006.983042
+"Lebanon","Asia",1972,65.421,2680018,7486.384341
+"Lebanon","Asia",1977,66.099,3115787,8659.696836
+"Lebanon","Asia",1982,66.983,3086876,7640.519521
+"Lebanon","Asia",1987,67.926,3089353,5377.091329
+"Lebanon","Asia",1992,69.292,3219994,6890.806854
+"Lebanon","Asia",1997,70.265,3430388,8754.96385
+"Lebanon","Asia",2002,71.028,3677780,9313.93883
+"Lebanon","Asia",2007,71.993,3921278,10461.05868
+"Lesotho","Africa",1952,42.138,748747,298.8462121
+"Lesotho","Africa",1957,45.047,813338,335.9971151
+"Lesotho","Africa",1962,47.747,893143,411.8006266
+"Lesotho","Africa",1967,48.492,996380,498.6390265
+"Lesotho","Africa",1972,49.767,1116779,496.5815922
+"Lesotho","Africa",1977,52.208,1251524,745.3695408
+"Lesotho","Africa",1982,55.078,1411807,797.2631074
+"Lesotho","Africa",1987,57.18,1599200,773.9932141
+"Lesotho","Africa",1992,59.685,1803195,977.4862725
+"Lesotho","Africa",1997,55.558,1982823,1186.147994
+"Lesotho","Africa",2002,44.593,2046772,1275.184575
+"Lesotho","Africa",2007,42.592,2012649,1569.331442
+"Liberia","Africa",1952,38.48,863308,575.5729961
+"Liberia","Africa",1957,39.486,975950,620.9699901
+"Liberia","Africa",1962,40.502,1112796,634.1951625
+"Liberia","Africa",1967,41.536,1279406,713.6036483
+"Liberia","Africa",1972,42.614,1482628,803.0054535
+"Liberia","Africa",1977,43.764,1703617,640.3224383
+"Liberia","Africa",1982,44.852,1956875,572.1995694
+"Liberia","Africa",1987,46.027,2269414,506.1138573
+"Liberia","Africa",1992,40.802,1912974,636.6229191
+"Liberia","Africa",1997,42.221,2200725,609.1739508
+"Liberia","Africa",2002,43.753,2814651,531.4823679
+"Liberia","Africa",2007,45.678,3193942,414.5073415
+"Libya","Africa",1952,42.723,1019729,2387.54806
+"Libya","Africa",1957,45.289,1201578,3448.284395
+"Libya","Africa",1962,47.808,1441863,6757.030816
+"Libya","Africa",1967,50.227,1759224,18772.75169
+"Libya","Africa",1972,52.773,2183877,21011.49721
+"Libya","Africa",1977,57.442,2721783,21951.21176
+"Libya","Africa",1982,62.155,3344074,17364.27538
+"Libya","Africa",1987,66.234,3799845,11770.5898
+"Libya","Africa",1992,68.755,4364501,9640.138501
+"Libya","Africa",1997,71.555,4759670,9467.446056
+"Libya","Africa",2002,72.737,5368585,9534.677467
+"Libya","Africa",2007,73.952,6036914,12057.49928
+"Madagascar","Africa",1952,36.681,4762912,1443.011715
+"Madagascar","Africa",1957,38.865,5181679,1589.20275
+"Madagascar","Africa",1962,40.848,5703324,1643.38711
+"Madagascar","Africa",1967,42.881,6334556,1634.047282
+"Madagascar","Africa",1972,44.851,7082430,1748.562982
+"Madagascar","Africa",1977,46.881,8007166,1544.228586
+"Madagascar","Africa",1982,48.969,9171477,1302.878658
+"Madagascar","Africa",1987,49.35,10568642,1155.441948
+"Madagascar","Africa",1992,52.214,12210395,1040.67619
+"Madagascar","Africa",1997,54.978,14165114,986.2958956
+"Madagascar","Africa",2002,57.286,16473477,894.6370822
+"Madagascar","Africa",2007,59.443,19167654,1044.770126
+"Malawi","Africa",1952,36.256,2917802,369.1650802
+"Malawi","Africa",1957,37.207,3221238,416.3698064
+"Malawi","Africa",1962,38.41,3628608,427.9010856
+"Malawi","Africa",1967,39.487,4147252,495.5147806
+"Malawi","Africa",1972,41.766,4730997,584.6219709
+"Malawi","Africa",1977,43.767,5637246,663.2236766
+"Malawi","Africa",1982,45.642,6502825,632.8039209
+"Malawi","Africa",1987,47.457,7824747,635.5173634
+"Malawi","Africa",1992,49.42,10014249,563.2000145
+"Malawi","Africa",1997,47.495,10419991,692.2758103
+"Malawi","Africa",2002,45.009,11824495,665.4231186
+"Malawi","Africa",2007,48.303,13327079,759.3499101
+"Malaysia","Asia",1952,48.463,6748378,1831.132894
+"Malaysia","Asia",1957,52.102,7739235,1810.066992
+"Malaysia","Asia",1962,55.737,8906385,2036.884944
+"Malaysia","Asia",1967,59.371,10154878,2277.742396
+"Malaysia","Asia",1972,63.01,11441462,2849.09478
+"Malaysia","Asia",1977,65.256,12845381,3827.921571
+"Malaysia","Asia",1982,68,14441916,4920.355951
+"Malaysia","Asia",1987,69.5,16331785,5249.802653
+"Malaysia","Asia",1992,70.693,18319502,7277.912802
+"Malaysia","Asia",1997,71.938,20476091,10132.90964
+"Malaysia","Asia",2002,73.044,22662365,10206.97794
+"Malaysia","Asia",2007,74.241,24821286,12451.6558
+"Mali","Africa",1952,33.685,3838168,452.3369807
+"Mali","Africa",1957,35.307,4241884,490.3821867
+"Mali","Africa",1962,36.936,4690372,496.1743428
+"Mali","Africa",1967,38.487,5212416,545.0098873
+"Mali","Africa",1972,39.977,5828158,581.3688761
+"Mali","Africa",1977,41.714,6491649,686.3952693
+"Mali","Africa",1982,43.916,6998256,618.0140641
+"Mali","Africa",1987,46.364,7634008,684.1715576
+"Mali","Africa",1992,48.388,8416215,739.014375
+"Mali","Africa",1997,49.903,9384984,790.2579846
+"Mali","Africa",2002,51.818,10580176,951.4097518
+"Mali","Africa",2007,54.467,12031795,1042.581557
+"Mauritania","Africa",1952,40.543,1022556,743.1159097
+"Mauritania","Africa",1957,42.338,1076852,846.1202613
+"Mauritania","Africa",1962,44.248,1146757,1055.896036
+"Mauritania","Africa",1967,46.289,1230542,1421.145193
+"Mauritania","Africa",1972,48.437,1332786,1586.851781
+"Mauritania","Africa",1977,50.852,1456688,1497.492223
+"Mauritania","Africa",1982,53.599,1622136,1481.150189
+"Mauritania","Africa",1987,56.145,1841240,1421.603576
+"Mauritania","Africa",1992,58.333,2119465,1361.369784
+"Mauritania","Africa",1997,60.43,2444741,1483.136136
+"Mauritania","Africa",2002,62.247,2828858,1579.019543
+"Mauritania","Africa",2007,64.164,3270065,1803.151496
+"Mauritius","Africa",1952,50.986,516556,1967.955707
+"Mauritius","Africa",1957,58.089,609816,2034.037981
+"Mauritius","Africa",1962,60.246,701016,2529.067487
+"Mauritius","Africa",1967,61.557,789309,2475.387562
+"Mauritius","Africa",1972,62.944,851334,2575.484158
+"Mauritius","Africa",1977,64.93,913025,3710.982963
+"Mauritius","Africa",1982,66.711,992040,3688.037739
+"Mauritius","Africa",1987,68.74,1042663,4783.586903
+"Mauritius","Africa",1992,69.745,1096202,6058.253846
+"Mauritius","Africa",1997,70.736,1149818,7425.705295
+"Mauritius","Africa",2002,71.954,1200206,9021.815894
+"Mauritius","Africa",2007,72.801,1250882,10956.99112
+"Mexico","Americas",1952,50.789,30144317,3478.125529
+"Mexico","Americas",1957,55.19,35015548,4131.546641
+"Mexico","Americas",1962,58.299,41121485,4581.609385
+"Mexico","Americas",1967,60.11,47995559,5754.733883
+"Mexico","Americas",1972,62.361,55984294,6809.40669
+"Mexico","Americas",1977,65.032,63759976,7674.929108
+"Mexico","Americas",1982,67.405,71640904,9611.147541
+"Mexico","Americas",1987,69.498,80122492,8688.156003
+"Mexico","Americas",1992,71.455,88111030,9472.384295
+"Mexico","Americas",1997,73.67,95895146,9767.29753
+"Mexico","Americas",2002,74.902,102479927,10742.44053
+"Mexico","Americas",2007,76.195,108700891,11977.57496
+"Mongolia","Asia",1952,42.244,800663,786.5668575
+"Mongolia","Asia",1957,45.248,882134,912.6626085
+"Mongolia","Asia",1962,48.251,1010280,1056.353958
+"Mongolia","Asia",1967,51.253,1149500,1226.04113
+"Mongolia","Asia",1972,53.754,1320500,1421.741975
+"Mongolia","Asia",1977,55.491,1528000,1647.511665
+"Mongolia","Asia",1982,57.489,1756032,2000.603139
+"Mongolia","Asia",1987,60.222,2015133,2338.008304
+"Mongolia","Asia",1992,61.271,2312802,1785.402016
+"Mongolia","Asia",1997,63.625,2494803,1902.2521
+"Mongolia","Asia",2002,65.033,2674234,2140.739323
+"Mongolia","Asia",2007,66.803,2874127,3095.772271
+"Montenegro","Europe",1952,59.164,413834,2647.585601
+"Montenegro","Europe",1957,61.448,442829,3682.259903
+"Montenegro","Europe",1962,63.728,474528,4649.593785
+"Montenegro","Europe",1967,67.178,501035,5907.850937
+"Montenegro","Europe",1972,70.636,527678,7778.414017
+"Montenegro","Europe",1977,73.066,560073,9595.929905
+"Montenegro","Europe",1982,74.101,562548,11222.58762
+"Montenegro","Europe",1987,74.865,569473,11732.51017
+"Montenegro","Europe",1992,75.435,621621,7003.339037
+"Montenegro","Europe",1997,75.445,692651,6465.613349
+"Montenegro","Europe",2002,73.981,720230,6557.194282
+"Montenegro","Europe",2007,74.543,684736,9253.896111
+"Morocco","Africa",1952,42.873,9939217,1688.20357
+"Morocco","Africa",1957,45.423,11406350,1642.002314
+"Morocco","Africa",1962,47.924,13056604,1566.353493
+"Morocco","Africa",1967,50.335,14770296,1711.04477
+"Morocco","Africa",1972,52.862,16660670,1930.194975
+"Morocco","Africa",1977,55.73,18396941,2370.619976
+"Morocco","Africa",1982,59.65,20198730,2702.620356
+"Morocco","Africa",1987,62.677,22987397,2755.046991
+"Morocco","Africa",1992,65.393,25798239,2948.047252
+"Morocco","Africa",1997,67.66,28529501,2982.101858
+"Morocco","Africa",2002,69.615,31167783,3258.495584
+"Morocco","Africa",2007,71.164,33757175,3820.17523
+"Mozambique","Africa",1952,31.286,6446316,468.5260381
+"Mozambique","Africa",1957,33.779,7038035,495.5868333
+"Mozambique","Africa",1962,36.161,7788944,556.6863539
+"Mozambique","Africa",1967,38.113,8680909,566.6691539
+"Mozambique","Africa",1972,40.328,9809596,724.9178037
+"Mozambique","Africa",1977,42.495,11127868,502.3197334
+"Mozambique","Africa",1982,42.795,12587223,462.2114149
+"Mozambique","Africa",1987,42.861,12891952,389.8761846
+"Mozambique","Africa",1992,44.284,13160731,410.8968239
+"Mozambique","Africa",1997,46.344,16603334,472.3460771
+"Mozambique","Africa",2002,44.026,18473780,633.6179466
+"Mozambique","Africa",2007,42.082,19951656,823.6856205
+"Myanmar","Asia",1952,36.319,20092996,331
+"Myanmar","Asia",1957,41.905,21731844,350
+"Myanmar","Asia",1962,45.108,23634436,388
+"Myanmar","Asia",1967,49.379,25870271,349
+"Myanmar","Asia",1972,53.07,28466390,357
+"Myanmar","Asia",1977,56.059,31528087,371
+"Myanmar","Asia",1982,58.056,34680442,424
+"Myanmar","Asia",1987,58.339,38028578,385
+"Myanmar","Asia",1992,59.32,40546538,347
+"Myanmar","Asia",1997,60.328,43247867,415
+"Myanmar","Asia",2002,59.908,45598081,611
+"Myanmar","Asia",2007,62.069,47761980,944
+"Namibia","Africa",1952,41.725,485831,2423.780443
+"Namibia","Africa",1957,45.226,548080,2621.448058
+"Namibia","Africa",1962,48.386,621392,3173.215595
+"Namibia","Africa",1967,51.159,706640,3793.694753
+"Namibia","Africa",1972,53.867,821782,3746.080948
+"Namibia","Africa",1977,56.437,977026,3876.485958
+"Namibia","Africa",1982,58.968,1099010,4191.100511
+"Namibia","Africa",1987,60.835,1278184,3693.731337
+"Namibia","Africa",1992,61.999,1554253,3804.537999
+"Namibia","Africa",1997,58.909,1774766,3899.52426
+"Namibia","Africa",2002,51.479,1972153,4072.324751
+"Namibia","Africa",2007,52.906,2055080,4811.060429
+"Nepal","Asia",1952,36.157,9182536,545.8657229
+"Nepal","Asia",1957,37.686,9682338,597.9363558
+"Nepal","Asia",1962,39.393,10332057,652.3968593
+"Nepal","Asia",1967,41.472,11261690,676.4422254
+"Nepal","Asia",1972,43.971,12412593,674.7881296
+"Nepal","Asia",1977,46.748,13933198,694.1124398
+"Nepal","Asia",1982,49.594,15796314,718.3730947
+"Nepal","Asia",1987,52.537,17917180,775.6324501
+"Nepal","Asia",1992,55.727,20326209,897.7403604
+"Nepal","Asia",1997,59.426,23001113,1010.892138
+"Nepal","Asia",2002,61.34,25873917,1057.206311
+"Nepal","Asia",2007,63.785,28901790,1091.359778
+"Netherlands","Europe",1952,72.13,10381988,8941.571858
+"Netherlands","Europe",1957,72.99,11026383,11276.19344
+"Netherlands","Europe",1962,73.23,11805689,12790.84956
+"Netherlands","Europe",1967,73.82,12596822,15363.25136
+"Netherlands","Europe",1972,73.75,13329874,18794.74567
+"Netherlands","Europe",1977,75.24,13852989,21209.0592
+"Netherlands","Europe",1982,76.05,14310401,21399.46046
+"Netherlands","Europe",1987,76.83,14665278,23651.32361
+"Netherlands","Europe",1992,77.42,15174244,26790.94961
+"Netherlands","Europe",1997,78.03,15604464,30246.13063
+"Netherlands","Europe",2002,78.53,16122830,33724.75778
+"Netherlands","Europe",2007,79.762,16570613,36797.93332
+"New Zealand","Oceania",1952,69.39,1994794,10556.57566
+"New Zealand","Oceania",1957,70.26,2229407,12247.39532
+"New Zealand","Oceania",1962,71.24,2488550,13175.678
+"New Zealand","Oceania",1967,71.52,2728150,14463.91893
+"New Zealand","Oceania",1972,71.89,2929100,16046.03728
+"New Zealand","Oceania",1977,72.22,3164900,16233.7177
+"New Zealand","Oceania",1982,73.84,3210650,17632.4104
+"New Zealand","Oceania",1987,74.32,3317166,19007.19129
+"New Zealand","Oceania",1992,76.33,3437674,18363.32494
+"New Zealand","Oceania",1997,77.55,3676187,21050.41377
+"New Zealand","Oceania",2002,79.11,3908037,23189.80135
+"New Zealand","Oceania",2007,80.204,4115771,25185.00911
+"Nicaragua","Americas",1952,42.314,1165790,3112.363948
+"Nicaragua","Americas",1957,45.432,1358828,3457.415947
+"Nicaragua","Americas",1962,48.632,1590597,3634.364406
+"Nicaragua","Americas",1967,51.884,1865490,4643.393534
+"Nicaragua","Americas",1972,55.151,2182908,4688.593267
+"Nicaragua","Americas",1977,57.47,2554598,5486.371089
+"Nicaragua","Americas",1982,59.298,2979423,3470.338156
+"Nicaragua","Americas",1987,62.008,3344353,2955.984375
+"Nicaragua","Americas",1992,65.843,4017939,2170.151724
+"Nicaragua","Americas",1997,68.426,4609572,2253.023004
+"Nicaragua","Americas",2002,70.836,5146848,2474.548819
+"Nicaragua","Americas",2007,72.899,5675356,2749.320965
+"Niger","Africa",1952,37.444,3379468,761.879376
+"Niger","Africa",1957,38.598,3692184,835.5234025
+"Niger","Africa",1962,39.487,4076008,997.7661127
+"Niger","Africa",1967,40.118,4534062,1054.384891
+"Niger","Africa",1972,40.546,5060262,954.2092363
+"Niger","Africa",1977,41.291,5682086,808.8970728
+"Niger","Africa",1982,42.598,6437188,909.7221354
+"Niger","Africa",1987,44.555,7332638,668.3000228
+"Niger","Africa",1992,47.391,8392818,581.182725
+"Niger","Africa",1997,51.313,9666252,580.3052092
+"Niger","Africa",2002,54.496,11140655,601.0745012
+"Niger","Africa",2007,56.867,12894865,619.6768924
+"Nigeria","Africa",1952,36.324,33119096,1077.281856
+"Nigeria","Africa",1957,37.802,37173340,1100.592563
+"Nigeria","Africa",1962,39.36,41871351,1150.927478
+"Nigeria","Africa",1967,41.04,47287752,1014.514104
+"Nigeria","Africa",1972,42.821,53740085,1698.388838
+"Nigeria","Africa",1977,44.514,62209173,1981.951806
+"Nigeria","Africa",1982,45.826,73039376,1576.97375
+"Nigeria","Africa",1987,46.886,81551520,1385.029563
+"Nigeria","Africa",1992,47.472,93364244,1619.848217
+"Nigeria","Africa",1997,47.464,106207839,1624.941275
+"Nigeria","Africa",2002,46.608,119901274,1615.286395
+"Nigeria","Africa",2007,46.859,135031164,2013.977305
+"Norway","Europe",1952,72.67,3327728,10095.42172
+"Norway","Europe",1957,73.44,3491938,11653.97304
+"Norway","Europe",1962,73.47,3638919,13450.40151
+"Norway","Europe",1967,74.08,3786019,16361.87647
+"Norway","Europe",1972,74.34,3933004,18965.05551
+"Norway","Europe",1977,75.37,4043205,23311.34939
+"Norway","Europe",1982,75.97,4114787,26298.63531
+"Norway","Europe",1987,75.89,4186147,31540.9748
+"Norway","Europe",1992,77.32,4286357,33965.66115
+"Norway","Europe",1997,78.32,4405672,41283.16433
+"Norway","Europe",2002,79.05,4535591,44683.97525
+"Norway","Europe",2007,80.196,4627926,49357.19017
+"Oman","Asia",1952,37.578,507833,1828.230307
+"Oman","Asia",1957,40.08,561977,2242.746551
+"Oman","Asia",1962,43.165,628164,2924.638113
+"Oman","Asia",1967,46.988,714775,4720.942687
+"Oman","Asia",1972,52.143,829050,10618.03855
+"Oman","Asia",1977,57.367,1004533,11848.34392
+"Oman","Asia",1982,62.728,1301048,12954.79101
+"Oman","Asia",1987,67.734,1593882,18115.22313
+"Oman","Asia",1992,71.197,1915208,18616.70691
+"Oman","Asia",1997,72.499,2283635,19702.05581
+"Oman","Asia",2002,74.193,2713462,19774.83687
+"Oman","Asia",2007,75.64,3204897,22316.19287
+"Pakistan","Asia",1952,43.436,41346560,684.5971438
+"Pakistan","Asia",1957,45.557,46679944,747.0835292
+"Pakistan","Asia",1962,47.67,53100671,803.3427418
+"Pakistan","Asia",1967,49.8,60641899,942.4082588
+"Pakistan","Asia",1972,51.929,69325921,1049.938981
+"Pakistan","Asia",1977,54.043,78152686,1175.921193
+"Pakistan","Asia",1982,56.158,91462088,1443.429832
+"Pakistan","Asia",1987,58.245,105186881,1704.686583
+"Pakistan","Asia",1992,60.838,120065004,1971.829464
+"Pakistan","Asia",1997,61.818,135564834,2049.350521
+"Pakistan","Asia",2002,63.61,153403524,2092.712441
+"Pakistan","Asia",2007,65.483,169270617,2605.94758
+"Panama","Americas",1952,55.191,940080,2480.380334
+"Panama","Americas",1957,59.201,1063506,2961.800905
+"Panama","Americas",1962,61.817,1215725,3536.540301
+"Panama","Americas",1967,64.071,1405486,4421.009084
+"Panama","Americas",1972,66.216,1616384,5364.249663
+"Panama","Americas",1977,68.681,1839782,5351.912144
+"Panama","Americas",1982,70.472,2036305,7009.601598
+"Panama","Americas",1987,71.523,2253639,7034.779161
+"Panama","Americas",1992,72.462,2484997,6618.74305
+"Panama","Americas",1997,73.738,2734531,7113.692252
+"Panama","Americas",2002,74.712,2990875,7356.031934
+"Panama","Americas",2007,75.537,3242173,9809.185636
+"Paraguay","Americas",1952,62.649,1555876,1952.308701
+"Paraguay","Americas",1957,63.196,1770902,2046.154706
+"Paraguay","Americas",1962,64.361,2009813,2148.027146
+"Paraguay","Americas",1967,64.951,2287985,2299.376311
+"Paraguay","Americas",1972,65.815,2614104,2523.337977
+"Paraguay","Americas",1977,66.353,2984494,3248.373311
+"Paraguay","Americas",1982,66.874,3366439,4258.503604
+"Paraguay","Americas",1987,67.378,3886512,3998.875695
+"Paraguay","Americas",1992,68.225,4483945,4196.411078
+"Paraguay","Americas",1997,69.4,5154123,4247.400261
+"Paraguay","Americas",2002,70.755,5884491,3783.674243
+"Paraguay","Americas",2007,71.752,6667147,4172.838464
+"Peru","Americas",1952,43.902,8025700,3758.523437
+"Peru","Americas",1957,46.263,9146100,4245.256698
+"Peru","Americas",1962,49.096,10516500,4957.037982
+"Peru","Americas",1967,51.445,12132200,5788.09333
+"Peru","Americas",1972,55.448,13954700,5937.827283
+"Peru","Americas",1977,58.447,15990099,6281.290855
+"Peru","Americas",1982,61.406,18125129,6434.501797
+"Peru","Americas",1987,64.134,20195924,6360.943444
+"Peru","Americas",1992,66.458,22430449,4446.380924
+"Peru","Americas",1997,68.386,24748122,5838.347657
+"Peru","Americas",2002,69.906,26769436,5909.020073
+"Peru","Americas",2007,71.421,28674757,7408.905561
+"Philippines","Asia",1952,47.752,22438691,1272.880995
+"Philippines","Asia",1957,51.334,26072194,1547.944844
+"Philippines","Asia",1962,54.757,30325264,1649.552153
+"Philippines","Asia",1967,56.393,35356600,1814.12743
+"Philippines","Asia",1972,58.065,40850141,1989.37407
+"Philippines","Asia",1977,60.06,46850962,2373.204287
+"Philippines","Asia",1982,62.082,53456774,2603.273765
+"Philippines","Asia",1987,64.151,60017788,2189.634995
+"Philippines","Asia",1992,66.458,67185766,2279.324017
+"Philippines","Asia",1997,68.564,75012988,2536.534925
+"Philippines","Asia",2002,70.303,82995088,2650.921068
+"Philippines","Asia",2007,71.688,91077287,3190.481016
+"Poland","Europe",1952,61.31,25730551,4029.329699
+"Poland","Europe",1957,65.77,28235346,4734.253019
+"Poland","Europe",1962,67.64,30329617,5338.752143
+"Poland","Europe",1967,69.61,31785378,6557.152776
+"Poland","Europe",1972,70.85,33039545,8006.506993
+"Poland","Europe",1977,70.67,34621254,9508.141454
+"Poland","Europe",1982,71.32,36227381,8451.531004
+"Poland","Europe",1987,70.98,37740710,9082.351172
+"Poland","Europe",1992,70.99,38370697,7738.881247
+"Poland","Europe",1997,72.75,38654957,10159.58368
+"Poland","Europe",2002,74.67,38625976,12002.23908
+"Poland","Europe",2007,75.563,38518241,15389.92468
+"Portugal","Europe",1952,59.82,8526050,3068.319867
+"Portugal","Europe",1957,61.51,8817650,3774.571743
+"Portugal","Europe",1962,64.39,9019800,4727.954889
+"Portugal","Europe",1967,66.6,9103000,6361.517993
+"Portugal","Europe",1972,69.26,8970450,9022.247417
+"Portugal","Europe",1977,70.41,9662600,10172.48572
+"Portugal","Europe",1982,72.77,9859650,11753.84291
+"Portugal","Europe",1987,74.06,9915289,13039.30876
+"Portugal","Europe",1992,74.86,9927680,16207.26663
+"Portugal","Europe",1997,75.97,10156415,17641.03156
+"Portugal","Europe",2002,77.29,10433867,19970.90787
+"Portugal","Europe",2007,78.098,10642836,20509.64777
+"Puerto Rico","Americas",1952,64.28,2227000,3081.959785
+"Puerto Rico","Americas",1957,68.54,2260000,3907.156189
+"Puerto Rico","Americas",1962,69.62,2448046,5108.34463
+"Puerto Rico","Americas",1967,71.1,2648961,6929.277714
+"Puerto Rico","Americas",1972,72.16,2847132,9123.041742
+"Puerto Rico","Americas",1977,73.44,3080828,9770.524921
+"Puerto Rico","Americas",1982,73.75,3279001,10330.98915
+"Puerto Rico","Americas",1987,74.63,3444468,12281.34191
+"Puerto Rico","Americas",1992,73.911,3585176,14641.58711
+"Puerto Rico","Americas",1997,74.917,3759430,16999.4333
+"Puerto Rico","Americas",2002,77.778,3859606,18855.60618
+"Puerto Rico","Americas",2007,78.746,3942491,19328.70901
+"Reunion","Africa",1952,52.724,257700,2718.885295
+"Reunion","Africa",1957,55.09,308700,2769.451844
+"Reunion","Africa",1962,57.666,358900,3173.72334
+"Reunion","Africa",1967,60.542,414024,4021.175739
+"Reunion","Africa",1972,64.274,461633,5047.658563
+"Reunion","Africa",1977,67.064,492095,4319.804067
+"Reunion","Africa",1982,69.885,517810,5267.219353
+"Reunion","Africa",1987,71.913,562035,5303.377488
+"Reunion","Africa",1992,73.615,622191,6101.255823
+"Reunion","Africa",1997,74.772,684810,6071.941411
+"Reunion","Africa",2002,75.744,743981,6316.1652
+"Reunion","Africa",2007,76.442,798094,7670.122558
+"Romania","Europe",1952,61.05,16630000,3144.613186
+"Romania","Europe",1957,64.1,17829327,3943.370225
+"Romania","Europe",1962,66.8,18680721,4734.997586
+"Romania","Europe",1967,66.8,19284814,6470.866545
+"Romania","Europe",1972,69.21,20662648,8011.414402
+"Romania","Europe",1977,69.46,21658597,9356.39724
+"Romania","Europe",1982,69.66,22356726,9605.314053
+"Romania","Europe",1987,69.53,22686371,9696.273295
+"Romania","Europe",1992,69.36,22797027,6598.409903
+"Romania","Europe",1997,69.72,22562458,7346.547557
+"Romania","Europe",2002,71.322,22404337,7885.360081
+"Romania","Europe",2007,72.476,22276056,10808.47561
+"Rwanda","Africa",1952,40,2534927,493.3238752
+"Rwanda","Africa",1957,41.5,2822082,540.2893983
+"Rwanda","Africa",1962,43,3051242,597.4730727
+"Rwanda","Africa",1967,44.1,3451079,510.9637142
+"Rwanda","Africa",1972,44.6,3992121,590.5806638
+"Rwanda","Africa",1977,45,4657072,670.0806011
+"Rwanda","Africa",1982,46.218,5507565,881.5706467
+"Rwanda","Africa",1987,44.02,6349365,847.991217
+"Rwanda","Africa",1992,23.599,7290203,737.0685949
+"Rwanda","Africa",1997,36.087,7212583,589.9445051
+"Rwanda","Africa",2002,43.413,7852401,785.6537648
+"Rwanda","Africa",2007,46.242,8860588,863.0884639
+"Sao Tome and Principe","Africa",1952,46.471,60011,879.5835855
+"Sao Tome and Principe","Africa",1957,48.945,61325,860.7369026
+"Sao Tome and Principe","Africa",1962,51.893,65345,1071.551119
+"Sao Tome and Principe","Africa",1967,54.425,70787,1384.840593
+"Sao Tome and Principe","Africa",1972,56.48,76595,1532.985254
+"Sao Tome and Principe","Africa",1977,58.55,86796,1737.561657
+"Sao Tome and Principe","Africa",1982,60.351,98593,1890.218117
+"Sao Tome and Principe","Africa",1987,61.728,110812,1516.525457
+"Sao Tome and Principe","Africa",1992,62.742,125911,1428.777814
+"Sao Tome and Principe","Africa",1997,63.306,145608,1339.076036
+"Sao Tome and Principe","Africa",2002,64.337,170372,1353.09239
+"Sao Tome and Principe","Africa",2007,65.528,199579,1598.435089
+"Saudi Arabia","Asia",1952,39.875,4005677,6459.554823
+"Saudi Arabia","Asia",1957,42.868,4419650,8157.591248
+"Saudi Arabia","Asia",1962,45.914,4943029,11626.41975
+"Saudi Arabia","Asia",1967,49.901,5618198,16903.04886
+"Saudi Arabia","Asia",1972,53.886,6472756,24837.42865
+"Saudi Arabia","Asia",1977,58.69,8128505,34167.7626
+"Saudi Arabia","Asia",1982,63.012,11254672,33693.17525
+"Saudi Arabia","Asia",1987,66.295,14619745,21198.26136
+"Saudi Arabia","Asia",1992,68.768,16945857,24841.61777
+"Saudi Arabia","Asia",1997,70.533,21229759,20586.69019
+"Saudi Arabia","Asia",2002,71.626,24501530,19014.54118
+"Saudi Arabia","Asia",2007,72.777,27601038,21654.83194
+"Senegal","Africa",1952,37.278,2755589,1450.356983
+"Senegal","Africa",1957,39.329,3054547,1567.653006
+"Senegal","Africa",1962,41.454,3430243,1654.988723
+"Senegal","Africa",1967,43.563,3965841,1612.404632
+"Senegal","Africa",1972,45.815,4588696,1597.712056
+"Senegal","Africa",1977,48.879,5260855,1561.769116
+"Senegal","Africa",1982,52.379,6147783,1518.479984
+"Senegal","Africa",1987,55.769,7171347,1441.72072
+"Senegal","Africa",1992,58.196,8307920,1367.899369
+"Senegal","Africa",1997,60.187,9535314,1392.368347
+"Senegal","Africa",2002,61.6,10870037,1519.635262
+"Senegal","Africa",2007,63.062,12267493,1712.472136
+"Serbia","Europe",1952,57.996,6860147,3581.459448
+"Serbia","Europe",1957,61.685,7271135,4981.090891
+"Serbia","Europe",1962,64.531,7616060,6289.629157
+"Serbia","Europe",1967,66.914,7971222,7991.707066
+"Serbia","Europe",1972,68.7,8313288,10522.06749
+"Serbia","Europe",1977,70.3,8686367,12980.66956
+"Serbia","Europe",1982,70.162,9032824,15181.0927
+"Serbia","Europe",1987,71.218,9230783,15870.87851
+"Serbia","Europe",1992,71.659,9826397,9325.068238
+"Serbia","Europe",1997,72.232,10336594,7914.320304
+"Serbia","Europe",2002,73.213,10111559,7236.075251
+"Serbia","Europe",2007,74.002,10150265,9786.534714
+"Sierra Leone","Africa",1952,30.331,2143249,879.7877358
+"Sierra Leone","Africa",1957,31.57,2295678,1004.484437
+"Sierra Leone","Africa",1962,32.767,2467895,1116.639877
+"Sierra Leone","Africa",1967,34.113,2662190,1206.043465
+"Sierra Leone","Africa",1972,35.4,2879013,1353.759762
+"Sierra Leone","Africa",1977,36.788,3140897,1348.285159
+"Sierra Leone","Africa",1982,38.445,3464522,1465.010784
+"Sierra Leone","Africa",1987,40.006,3868905,1294.447788
+"Sierra Leone","Africa",1992,38.333,4260884,1068.696278
+"Sierra Leone","Africa",1997,39.897,4578212,574.6481576
+"Sierra Leone","Africa",2002,41.012,5359092,699.489713
+"Sierra Leone","Africa",2007,42.568,6144562,862.5407561
+"Singapore","Asia",1952,60.396,1127000,2315.138227
+"Singapore","Asia",1957,63.179,1445929,2843.104409
+"Singapore","Asia",1962,65.798,1750200,3674.735572
+"Singapore","Asia",1967,67.946,1977600,4977.41854
+"Singapore","Asia",1972,69.521,2152400,8597.756202
+"Singapore","Asia",1977,70.795,2325300,11210.08948
+"Singapore","Asia",1982,71.76,2651869,15169.16112
+"Singapore","Asia",1987,73.56,2794552,18861.53081
+"Singapore","Asia",1992,75.788,3235865,24769.8912
+"Singapore","Asia",1997,77.158,3802309,33519.4766
+"Singapore","Asia",2002,78.77,4197776,36023.1054
+"Singapore","Asia",2007,79.972,4553009,47143.17964
+"Slovak Republic","Europe",1952,64.36,3558137,5074.659104
+"Slovak Republic","Europe",1957,67.45,3844277,6093.26298
+"Slovak Republic","Europe",1962,70.33,4237384,7481.107598
+"Slovak Republic","Europe",1967,70.98,4442238,8412.902397
+"Slovak Republic","Europe",1972,70.35,4593433,9674.167626
+"Slovak Republic","Europe",1977,70.45,4827803,10922.66404
+"Slovak Republic","Europe",1982,70.8,5048043,11348.54585
+"Slovak Republic","Europe",1987,71.08,5199318,12037.26758
+"Slovak Republic","Europe",1992,71.38,5302888,9498.467723
+"Slovak Republic","Europe",1997,72.71,5383010,12126.23065
+"Slovak Republic","Europe",2002,73.8,5410052,13638.77837
+"Slovak Republic","Europe",2007,74.663,5447502,18678.31435
+"Slovenia","Europe",1952,65.57,1489518,4215.041741
+"Slovenia","Europe",1957,67.85,1533070,5862.276629
+"Slovenia","Europe",1962,69.15,1582962,7402.303395
+"Slovenia","Europe",1967,69.18,1646912,9405.489397
+"Slovenia","Europe",1972,69.82,1694510,12383.4862
+"Slovenia","Europe",1977,70.97,1746919,15277.03017
+"Slovenia","Europe",1982,71.063,1861252,17866.72175
+"Slovenia","Europe",1987,72.25,1945870,18678.53492
+"Slovenia","Europe",1992,73.64,1999210,14214.71681
+"Slovenia","Europe",1997,75.13,2011612,17161.10735
+"Slovenia","Europe",2002,76.66,2011497,20660.01936
+"Slovenia","Europe",2007,77.926,2009245,25768.25759
+"Somalia","Africa",1952,32.978,2526994,1135.749842
+"Somalia","Africa",1957,34.977,2780415,1258.147413
+"Somalia","Africa",1962,36.981,3080153,1369.488336
+"Somalia","Africa",1967,38.977,3428839,1284.73318
+"Somalia","Africa",1972,40.973,3840161,1254.576127
+"Somalia","Africa",1977,41.974,4353666,1450.992513
+"Somalia","Africa",1982,42.955,5828892,1176.807031
+"Somalia","Africa",1987,44.501,6921858,1093.244963
+"Somalia","Africa",1992,39.658,6099799,926.9602964
+"Somalia","Africa",1997,43.795,6633514,930.5964284
+"Somalia","Africa",2002,45.936,7753310,882.0818218
+"Somalia","Africa",2007,48.159,9118773,926.1410683
+"South Africa","Africa",1952,45.009,14264935,4725.295531
+"South Africa","Africa",1957,47.985,16151549,5487.104219
+"South Africa","Africa",1962,49.951,18356657,5768.729717
+"South Africa","Africa",1967,51.927,20997321,7114.477971
+"South Africa","Africa",1972,53.696,23935810,7765.962636
+"South Africa","Africa",1977,55.527,27129932,8028.651439
+"South Africa","Africa",1982,58.161,31140029,8568.266228
+"South Africa","Africa",1987,60.834,35933379,7825.823398
+"South Africa","Africa",1992,61.888,39964159,7225.069258
+"South Africa","Africa",1997,60.236,42835005,7479.188244
+"South Africa","Africa",2002,53.365,44433622,7710.946444
+"South Africa","Africa",2007,49.339,43997828,9269.657808
+"Spain","Europe",1952,64.94,28549870,3834.034742
+"Spain","Europe",1957,66.66,29841614,4564.80241
+"Spain","Europe",1962,69.69,31158061,5693.843879
+"Spain","Europe",1967,71.44,32850275,7993.512294
+"Spain","Europe",1972,73.06,34513161,10638.75131
+"Spain","Europe",1977,74.39,36439000,13236.92117
+"Spain","Europe",1982,76.3,37983310,13926.16997
+"Spain","Europe",1987,76.9,38880702,15764.98313
+"Spain","Europe",1992,77.57,39549438,18603.06452
+"Spain","Europe",1997,78.77,39855442,20445.29896
+"Spain","Europe",2002,79.78,40152517,24835.47166
+"Spain","Europe",2007,80.941,40448191,28821.0637
+"Sri Lanka","Asia",1952,57.593,7982342,1083.53203
+"Sri Lanka","Asia",1957,61.456,9128546,1072.546602
+"Sri Lanka","Asia",1962,62.192,10421936,1074.47196
+"Sri Lanka","Asia",1967,64.266,11737396,1135.514326
+"Sri Lanka","Asia",1972,65.042,13016733,1213.39553
+"Sri Lanka","Asia",1977,65.949,14116836,1348.775651
+"Sri Lanka","Asia",1982,68.757,15410151,1648.079789
+"Sri Lanka","Asia",1987,69.011,16495304,1876.766827
+"Sri Lanka","Asia",1992,70.379,17587060,2153.739222
+"Sri Lanka","Asia",1997,70.457,18698655,2664.477257
+"Sri Lanka","Asia",2002,70.815,19576783,3015.378833
+"Sri Lanka","Asia",2007,72.396,20378239,3970.095407
+"Sudan","Africa",1952,38.635,8504667,1615.991129
+"Sudan","Africa",1957,39.624,9753392,1770.337074
+"Sudan","Africa",1962,40.87,11183227,1959.593767
+"Sudan","Africa",1967,42.858,12716129,1687.997641
+"Sudan","Africa",1972,45.083,14597019,1659.652775
+"Sudan","Africa",1977,47.8,17104986,2202.988423
+"Sudan","Africa",1982,50.338,20367053,1895.544073
+"Sudan","Africa",1987,51.744,24725960,1507.819159
+"Sudan","Africa",1992,53.556,28227588,1492.197043
+"Sudan","Africa",1997,55.373,32160729,1632.210764
+"Sudan","Africa",2002,56.369,37090298,1993.398314
+"Sudan","Africa",2007,58.556,42292929,2602.394995
+"Swaziland","Africa",1952,41.407,290243,1148.376626
+"Swaziland","Africa",1957,43.424,326741,1244.708364
+"Swaziland","Africa",1962,44.992,370006,1856.182125
+"Swaziland","Africa",1967,46.633,420690,2613.101665
+"Swaziland","Africa",1972,49.552,480105,3364.836625
+"Swaziland","Africa",1977,52.537,551425,3781.410618
+"Swaziland","Africa",1982,55.561,649901,3895.384018
+"Swaziland","Africa",1987,57.678,779348,3984.839812
+"Swaziland","Africa",1992,58.474,962344,3553.0224
+"Swaziland","Africa",1997,54.289,1054486,3876.76846
+"Swaziland","Africa",2002,43.869,1130269,4128.116943
+"Swaziland","Africa",2007,39.613,1133066,4513.480643
+"Sweden","Europe",1952,71.86,7124673,8527.844662
+"Sweden","Europe",1957,72.49,7363802,9911.878226
+"Sweden","Europe",1962,73.37,7561588,12329.44192
+"Sweden","Europe",1967,74.16,7867931,15258.29697
+"Sweden","Europe",1972,74.72,8122293,17832.02464
+"Sweden","Europe",1977,75.44,8251648,18855.72521
+"Sweden","Europe",1982,76.42,8325260,20667.38125
+"Sweden","Europe",1987,77.19,8421403,23586.92927
+"Sweden","Europe",1992,78.16,8718867,23880.01683
+"Sweden","Europe",1997,79.39,8897619,25266.59499
+"Sweden","Europe",2002,80.04,8954175,29341.63093
+"Sweden","Europe",2007,80.884,9031088,33859.74835
+"Switzerland","Europe",1952,69.62,4815000,14734.23275
+"Switzerland","Europe",1957,70.56,5126000,17909.48973
+"Switzerland","Europe",1962,71.32,5666000,20431.0927
+"Switzerland","Europe",1967,72.77,6063000,22966.14432
+"Switzerland","Europe",1972,73.78,6401400,27195.11304
+"Switzerland","Europe",1977,75.39,6316424,26982.29052
+"Switzerland","Europe",1982,76.21,6468126,28397.71512
+"Switzerland","Europe",1987,77.41,6649942,30281.70459
+"Switzerland","Europe",1992,78.03,6995447,31871.5303
+"Switzerland","Europe",1997,79.37,7193761,32135.32301
+"Switzerland","Europe",2002,80.62,7361757,34480.95771
+"Switzerland","Europe",2007,81.701,7554661,37506.41907
+"Syria","Asia",1952,45.883,3661549,1643.485354
+"Syria","Asia",1957,48.284,4149908,2117.234893
+"Syria","Asia",1962,50.305,4834621,2193.037133
+"Syria","Asia",1967,53.655,5680812,1881.923632
+"Syria","Asia",1972,57.296,6701172,2571.423014
+"Syria","Asia",1977,61.195,7932503,3195.484582
+"Syria","Asia",1982,64.59,9410494,3761.837715
+"Syria","Asia",1987,66.974,11242847,3116.774285
+"Syria","Asia",1992,69.249,13219062,3340.542768
+"Syria","Asia",1997,71.527,15081016,4014.238972
+"Syria","Asia",2002,73.053,17155814,4090.925331
+"Syria","Asia",2007,74.143,19314747,4184.548089
+"Taiwan","Asia",1952,58.5,8550362,1206.947913
+"Taiwan","Asia",1957,62.4,10164215,1507.86129
+"Taiwan","Asia",1962,65.2,11918938,1822.879028
+"Taiwan","Asia",1967,67.5,13648692,2643.858681
+"Taiwan","Asia",1972,69.39,15226039,4062.523897
+"Taiwan","Asia",1977,70.59,16785196,5596.519826
+"Taiwan","Asia",1982,72.16,18501390,7426.354774
+"Taiwan","Asia",1987,73.4,19757799,11054.56175
+"Taiwan","Asia",1992,74.26,20686918,15215.6579
+"Taiwan","Asia",1997,75.25,21628605,20206.82098
+"Taiwan","Asia",2002,76.99,22454239,23235.42329
+"Taiwan","Asia",2007,78.4,23174294,28718.27684
+"Tanzania","Africa",1952,41.215,8322925,716.6500721
+"Tanzania","Africa",1957,42.974,9452826,698.5356073
+"Tanzania","Africa",1962,44.246,10863958,722.0038073
+"Tanzania","Africa",1967,45.757,12607312,848.2186575
+"Tanzania","Africa",1972,47.62,14706593,915.9850592
+"Tanzania","Africa",1977,49.919,17129565,962.4922932
+"Tanzania","Africa",1982,50.608,19844382,874.2426069
+"Tanzania","Africa",1987,51.535,23040630,831.8220794
+"Tanzania","Africa",1992,50.44,26605473,825.682454
+"Tanzania","Africa",1997,48.466,30686889,789.1862231
+"Tanzania","Africa",2002,49.651,34593779,899.0742111
+"Tanzania","Africa",2007,52.517,38139640,1107.482182
+"Thailand","Asia",1952,50.848,21289402,757.7974177
+"Thailand","Asia",1957,53.63,25041917,793.5774148
+"Thailand","Asia",1962,56.061,29263397,1002.199172
+"Thailand","Asia",1967,58.285,34024249,1295.46066
+"Thailand","Asia",1972,60.405,39276153,1524.358936
+"Thailand","Asia",1977,62.494,44148285,1961.224635
+"Thailand","Asia",1982,64.597,48827160,2393.219781
+"Thailand","Asia",1987,66.084,52910342,2982.653773
+"Thailand","Asia",1992,67.298,56667095,4616.896545
+"Thailand","Asia",1997,67.521,60216677,5852.625497
+"Thailand","Asia",2002,68.564,62806748,5913.187529
+"Thailand","Asia",2007,70.616,65068149,7458.396327
+"Togo","Africa",1952,38.596,1219113,859.8086567
+"Togo","Africa",1957,41.208,1357445,925.9083202
+"Togo","Africa",1962,43.922,1528098,1067.53481
+"Togo","Africa",1967,46.769,1735550,1477.59676
+"Togo","Africa",1972,49.759,2056351,1649.660188
+"Togo","Africa",1977,52.887,2308582,1532.776998
+"Togo","Africa",1982,55.471,2644765,1344.577953
+"Togo","Africa",1987,56.941,3154264,1202.201361
+"Togo","Africa",1992,58.061,3747553,1034.298904
+"Togo","Africa",1997,58.39,4320890,982.2869243
+"Togo","Africa",2002,57.561,4977378,886.2205765
+"Togo","Africa",2007,58.42,5701579,882.9699438
+"Trinidad and Tobago","Americas",1952,59.1,662850,3023.271928
+"Trinidad and Tobago","Americas",1957,61.8,764900,4100.3934
+"Trinidad and Tobago","Americas",1962,64.9,887498,4997.523971
+"Trinidad and Tobago","Americas",1967,65.4,960155,5621.368472
+"Trinidad and Tobago","Americas",1972,65.9,975199,6619.551419
+"Trinidad and Tobago","Americas",1977,68.3,1039009,7899.554209
+"Trinidad and Tobago","Americas",1982,68.832,1116479,9119.528607
+"Trinidad and Tobago","Americas",1987,69.582,1191336,7388.597823
+"Trinidad and Tobago","Americas",1992,69.862,1183669,7370.990932
+"Trinidad and Tobago","Americas",1997,69.465,1138101,8792.573126
+"Trinidad and Tobago","Americas",2002,68.976,1101832,11460.60023
+"Trinidad and Tobago","Americas",2007,69.819,1056608,18008.50924
+"Tunisia","Africa",1952,44.6,3647735,1468.475631
+"Tunisia","Africa",1957,47.1,3950849,1395.232468
+"Tunisia","Africa",1962,49.579,4286552,1660.30321
+"Tunisia","Africa",1967,52.053,4786986,1932.360167
+"Tunisia","Africa",1972,55.602,5303507,2753.285994
+"Tunisia","Africa",1977,59.837,6005061,3120.876811
+"Tunisia","Africa",1982,64.048,6734098,3560.233174
+"Tunisia","Africa",1987,66.894,7724976,3810.419296
+"Tunisia","Africa",1992,70.001,8523077,4332.720164
+"Tunisia","Africa",1997,71.973,9231669,4876.798614
+"Tunisia","Africa",2002,73.042,9770575,5722.895655
+"Tunisia","Africa",2007,73.923,10276158,7092.923025
+"Turkey","Europe",1952,43.585,22235677,1969.10098
+"Turkey","Europe",1957,48.079,25670939,2218.754257
+"Turkey","Europe",1962,52.098,29788695,2322.869908
+"Turkey","Europe",1967,54.336,33411317,2826.356387
+"Turkey","Europe",1972,57.005,37492953,3450.69638
+"Turkey","Europe",1977,59.507,42404033,4269.122326
+"Turkey","Europe",1982,61.036,47328791,4241.356344
+"Turkey","Europe",1987,63.108,52881328,5089.043686
+"Turkey","Europe",1992,66.146,58179144,5678.348271
+"Turkey","Europe",1997,68.835,63047647,6601.429915
+"Turkey","Europe",2002,70.845,67308928,6508.085718
+"Turkey","Europe",2007,71.777,71158647,8458.276384
+"Uganda","Africa",1952,39.978,5824797,734.753484
+"Uganda","Africa",1957,42.571,6675501,774.3710692
+"Uganda","Africa",1962,45.344,7688797,767.2717398
+"Uganda","Africa",1967,48.051,8900294,908.9185217
+"Uganda","Africa",1972,51.016,10190285,950.735869
+"Uganda","Africa",1977,50.35,11457758,843.7331372
+"Uganda","Africa",1982,49.849,12939400,682.2662268
+"Uganda","Africa",1987,51.509,15283050,617.7244065
+"Uganda","Africa",1992,48.825,18252190,644.1707969
+"Uganda","Africa",1997,44.578,21210254,816.559081
+"Uganda","Africa",2002,47.813,24739869,927.7210018
+"Uganda","Africa",2007,51.542,29170398,1056.380121
+"United Kingdom","Europe",1952,69.18,50430000,9979.508487
+"United Kingdom","Europe",1957,70.42,51430000,11283.17795
+"United Kingdom","Europe",1962,70.76,53292000,12477.17707
+"United Kingdom","Europe",1967,71.36,54959000,14142.85089
+"United Kingdom","Europe",1972,72.01,56079000,15895.11641
+"United Kingdom","Europe",1977,72.76,56179000,17428.74846
+"United Kingdom","Europe",1982,74.04,56339704,18232.42452
+"United Kingdom","Europe",1987,75.007,56981620,21664.78767
+"United Kingdom","Europe",1992,76.42,57866349,22705.09254
+"United Kingdom","Europe",1997,77.218,58808266,26074.53136
+"United Kingdom","Europe",2002,78.471,59912431,29478.99919
+"United Kingdom","Europe",2007,79.425,60776238,33203.26128
+"United States","Americas",1952,68.44,157553000,13990.48208
+"United States","Americas",1957,69.49,171984000,14847.12712
+"United States","Americas",1962,70.21,186538000,16173.14586
+"United States","Americas",1967,70.76,198712000,19530.36557
+"United States","Americas",1972,71.34,209896000,21806.03594
+"United States","Americas",1977,73.38,220239000,24072.63213
+"United States","Americas",1982,74.65,232187835,25009.55914
+"United States","Americas",1987,75.02,242803533,29884.35041
+"United States","Americas",1992,76.09,256894189,32003.93224
+"United States","Americas",1997,76.81,272911760,35767.43303
+"United States","Americas",2002,77.31,287675526,39097.09955
+"United States","Americas",2007,78.242,301139947,42951.65309
+"Uruguay","Americas",1952,66.071,2252965,5716.766744
+"Uruguay","Americas",1957,67.044,2424959,6150.772969
+"Uruguay","Americas",1962,68.253,2598466,5603.357717
+"Uruguay","Americas",1967,68.468,2748579,5444.61962
+"Uruguay","Americas",1972,68.673,2829526,5703.408898
+"Uruguay","Americas",1977,69.481,2873520,6504.339663
+"Uruguay","Americas",1982,70.805,2953997,6920.223051
+"Uruguay","Americas",1987,71.918,3045153,7452.398969
+"Uruguay","Americas",1992,72.752,3149262,8137.004775
+"Uruguay","Americas",1997,74.223,3262838,9230.240708
+"Uruguay","Americas",2002,75.307,3363085,7727.002004
+"Uruguay","Americas",2007,76.384,3447496,10611.46299
+"Venezuela","Americas",1952,55.088,5439568,7689.799761
+"Venezuela","Americas",1957,57.907,6702668,9802.466526
+"Venezuela","Americas",1962,60.77,8143375,8422.974165
+"Venezuela","Americas",1967,63.479,9709552,9541.474188
+"Venezuela","Americas",1972,65.712,11515649,10505.25966
+"Venezuela","Americas",1977,67.456,13503563,13143.95095
+"Venezuela","Americas",1982,68.557,15620766,11152.41011
+"Venezuela","Americas",1987,70.19,17910182,9883.584648
+"Venezuela","Americas",1992,71.15,20265563,10733.92631
+"Venezuela","Americas",1997,72.146,22374398,10165.49518
+"Venezuela","Americas",2002,72.766,24287670,8605.047831
+"Venezuela","Americas",2007,73.747,26084662,11415.80569
+"Vietnam","Asia",1952,40.412,26246839,605.0664917
+"Vietnam","Asia",1957,42.887,28998543,676.2854478
+"Vietnam","Asia",1962,45.363,33796140,772.0491602
+"Vietnam","Asia",1967,47.838,39463910,637.1232887
+"Vietnam","Asia",1972,50.254,44655014,699.5016441
+"Vietnam","Asia",1977,55.764,50533506,713.5371196
+"Vietnam","Asia",1982,58.816,56142181,707.2357863
+"Vietnam","Asia",1987,62.82,62826491,820.7994449
+"Vietnam","Asia",1992,67.662,69940728,989.0231487
+"Vietnam","Asia",1997,70.672,76048996,1385.896769
+"Vietnam","Asia",2002,73.017,80908147,1764.456677
+"Vietnam","Asia",2007,74.249,85262356,2441.576404
+"West Bank and Gaza","Asia",1952,43.16,1030585,1515.592329
+"West Bank and Gaza","Asia",1957,45.671,1070439,1827.067742
+"West Bank and Gaza","Asia",1962,48.127,1133134,2198.956312
+"West Bank and Gaza","Asia",1967,51.631,1142636,2649.715007
+"West Bank and Gaza","Asia",1972,56.532,1089572,3133.409277
+"West Bank and Gaza","Asia",1977,60.765,1261091,3682.831494
+"West Bank and Gaza","Asia",1982,64.406,1425876,4336.032082
+"West Bank and Gaza","Asia",1987,67.046,1691210,5107.197384
+"West Bank and Gaza","Asia",1992,69.718,2104779,6017.654756
+"West Bank and Gaza","Asia",1997,71.096,2826046,7110.667619
+"West Bank and Gaza","Asia",2002,72.37,3389578,4515.487575
+"West Bank and Gaza","Asia",2007,73.422,4018332,3025.349798
+"Yemen, Rep.","Asia",1952,32.548,4963829,781.7175761
+"Yemen, Rep.","Asia",1957,33.97,5498090,804.8304547
+"Yemen, Rep.","Asia",1962,35.18,6120081,825.6232006
+"Yemen, Rep.","Asia",1967,36.984,6740785,862.4421463
+"Yemen, Rep.","Asia",1972,39.848,7407075,1265.047031
+"Yemen, Rep.","Asia",1977,44.175,8403990,1829.765177
+"Yemen, Rep.","Asia",1982,49.113,9657618,1977.55701
+"Yemen, Rep.","Asia",1987,52.922,11219340,1971.741538
+"Yemen, Rep.","Asia",1992,55.599,13367997,1879.496673
+"Yemen, Rep.","Asia",1997,58.02,15826497,2117.484526
+"Yemen, Rep.","Asia",2002,60.308,18701257,2234.820827
+"Yemen, Rep.","Asia",2007,62.698,22211743,2280.769906
+"Zambia","Africa",1952,42.038,2672000,1147.388831
+"Zambia","Africa",1957,44.077,3016000,1311.956766
+"Zambia","Africa",1962,46.023,3421000,1452.725766
+"Zambia","Africa",1967,47.768,3900000,1777.077318
+"Zambia","Africa",1972,50.107,4506497,1773.498265
+"Zambia","Africa",1977,51.386,5216550,1588.688299
+"Zambia","Africa",1982,51.821,6100407,1408.678565
+"Zambia","Africa",1987,50.821,7272406,1213.315116
+"Zambia","Africa",1992,46.1,8381163,1210.884633
+"Zambia","Africa",1997,40.238,9417789,1071.353818
+"Zambia","Africa",2002,39.193,10595811,1071.613938
+"Zambia","Africa",2007,42.384,11746035,1271.211593
+"Zimbabwe","Africa",1952,48.451,3080907,406.8841148
+"Zimbabwe","Africa",1957,50.469,3646340,518.7642681
+"Zimbabwe","Africa",1962,52.358,4277736,527.2721818
+"Zimbabwe","Africa",1967,53.995,4995432,569.7950712
+"Zimbabwe","Africa",1972,55.635,5861135,799.3621758
+"Zimbabwe","Africa",1977,57.674,6642107,685.5876821
+"Zimbabwe","Africa",1982,60.363,7636524,788.8550411
+"Zimbabwe","Africa",1987,62.351,9216418,706.1573059
+"Zimbabwe","Africa",1992,60.377,10704340,693.4207856
+"Zimbabwe","Africa",1997,46.809,11404948,792.4499603
+"Zimbabwe","Africa",2002,39.989,11926563,672.0386227
+"Zimbabwe","Africa",2007,43.487,12311143,469.7092981
diff --git a/second/semester1/ST2001/Assignments/lab_week_5.Rmd b/second/semester1/ST2001/Assignments/lab_week_5.Rmd
new file mode 100644
index 00000000..960ae941
--- /dev/null
+++ b/second/semester1/ST2001/Assignments/lab_week_5.Rmd
@@ -0,0 +1,429 @@
+---
+title: "Reading Datafiles into R"
+output:
+ word_document: default
+ html_document: default
+ pdf_document: default
+---
+
+```{r setup, include=FALSE}
+knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
+```
+
+So far we have learned how to summarise (both numerically and graphically) different types of variables. We also learned how to produce numerical and graphical summaries of a variable across different groups of another categorical variable. But all the variables we used so far are from datasets that are already available in $\texttt{R}$.
+
+
+A key next skill to learn is to import datasets into $\texttt{R}$. There are a lot of common mistakes when downloading files using browsers and then reading them into R. So we have produced a set of slides explaining these and how to avoid or overcome them, entitled "Working with R or R-Markdown and Datafiles". You may wish to read these slides first. They are posted with this lab material and in the Discussion Board.
+
+
+## Reading datasets into `R`
+
+The datasets we want to import into $\texttt{R}$ might be in different file format, e.g. ".csv", ".xlsx", ".sav", ".dat", ".xml", etc. Among all these file format ".csv" is the simplest and most portable (from one machine to the other) file format. When working with different people you cannot assume they a particular piece of software (e.g. Excel), and you need to be aware that many datafile formats do not have well defined standards so can be unreliable when sharing across different systems.
+
+It is possible to import dataset in any of the file formats listed above and many others besides. But for the purpose of demonstration, we will show you how to import a dataset in ".csv" format using the function `read.csv()`.
+
+**Firstly, you need to ensure the ".csv" file and this markdown file are stored in the same folder. Next ensure `R` is using that folder as the working directory (go to Session > Set Working Directory > To Source File Location if you need to set it).**
+
+# Gapminder Dataset
+
+We are going to use the gapminder dataset which is available in the "gapminder.csv" file. The dataset contains life expectancy at birth (under `lifeExp` variable name), total population (`pop`), and GDP per capita (`gdpPercap`) of 142 different countries from five different continents over 1952 to 2007. You can find more information and more variables from [here](https://www.gapminder.org/data/). Hans Rosling, the co-founder and chairman of the Gapminder Foundation, gave a mesmerizing Ted talk on this data which you can watch [here](https://www.ted.com/talks/hans_rosling_the_best_stats_you_ve_ever_seen?language=en).
+
+The following code chunk reads the "gapminder.csv" into an $\texttt{R}$ object `gapminder`. If you get an error message, please read the slides on "Working with R or R-Markdown and Datafiles" and if you cannot resolve the problem discuss it with the tutor.
+
+```{r }
+library(tidyverse)
+
+gapminder = read.csv("gapminder.csv")
+```
+
+The first thing to do when reading a dataset into statistical software is to check it has been read in correctly. You can get an overview of the dataset using the `glimpse()` function.
+
+```{r }
+gapminder %>% glimpse()
+```
+
+To understand the dataset contents, please complete the following task
+
+**Task 1:**
+
+* What is the experimental unit here?
+* What is the dimension of the dataset (number of rows and columns)?
+
+```{r}
+
+
+
+
+
+```
+
+
+## Filtering rows with the `filter()` function
+
+You can see that there are 1,704 (=142*12) rows in the dataset along with 6 columns. The unit of observation here is country, since all the information available here belong to countries. In the `mtcars` dataset the experiments units were a particular model of car and for the `titanic_train` dataset it was a passenger. However, the `gapminder` dataset is somewhat more complex in the sense that for the `mtcars` dataset each car occupied only one row and for the `titanic_train` dataset each passenger occupied only one row of the dataset but for the `gapminder` dataset each country occupies 12 rows of the dataset. For a particular country, these 12 rows contain information related to different year of data collection.
+
+Now, if we want to calculate the average population of European countries in 2007, we simply cannot use `summaries(mean(pop))` because it will give the average population of all the countries across all the years. So we have to keep the rows corresponding to European countries for 2007 by filtering out the rows we do not want. The `filter()` function from the `tidyverse` package can help us to keep the rows corresponding to European countries for 2007.
+
+Run the code below. `"Europe"` is a value for the `continent` variable and `2007` is a value for the `year` variable. To keep the rows corresponding to the `"Europe"` value of the `continent` variable we can use `filter(continent == "Europe")`. To keep the rows corresponding to the `2007` value of the `year` variable we can use `filter(year == 2007)`. But to keep the rows belonging to both of them we need to use `filter(continent == "Europe" & year == 2007)`. Here we used a logical operator `&`. If you are not sure how it works please revisit the first lab.
+
+```{r , max.print=5}
+library(tidyverse)
+
+gapminder %>% filter(continent == "Europe" & year == 2007)
+```
+
+Instead of using the logical operator `&` we can separate each condition in the `filter()` function with a comma. Take a look at the help for the `filter()` function typing `help(filter)` in the `R` Console, scroll down to "Arguments" and the entry for `...` which explains that it just combines them with an `&` operator.
+
+```{r , max.print=5}
+gapminder %>% filter(continent == "Europe", year == 2007)
+```
+
+**Task 2:** In the following code chunk, use the `filter()` function to keep the rows corresponding to the countries in the Americas only for the year 1952.
+
+```{r}
+
+
+
+
+```
+
+## Selecting Columns With the `select()` Function
+
+To keep the desired rows of a dataset we can use `filter()` function. Similarly, to keep the desired columns (variables) we can use the `select()` function. Here we select the country and population columns.
+
+
+```{r}
+gapminder %>%
+ filter(continent == "Europe" & year == 2007) %>%
+ select(country, pop)
+```
+
+**Task 3:** In the following code chunk, use the `select()` function to retain the `country`, `continent`, `year`, and `lifeExp` of the `gapminder` dataset.
+
+
+```{r}
+
+
+
+
+
+```
+
+
+## Create a New Variable With the `mutate()` Function
+
+The `filter()` and `select()` functions help us take "actions" on the dataset, so they are described as "verbs for data manipulation". The most commonly used verbs (functions) are: `select()` , `filter()`, `summarise()`, `mutate()`, and `arrange()`. Let's now demonstrate using the last two verbs.
+
+The `pop` variable gives the population size for each countries. But it is hard to read such big numbers in the table above. So we could create a variable to store that number in millions (as population are usually expressed in millions). The `mutate()` function enables us to change variables in the dataset, including creating new variables.
+
+In the code below we created a new variable `pop_mill` using the `mutate()` function by dividing the existing variable `pop` by a million (1,000,000). To keep only two decimal places we use the `round()` function.
+
+
+```{r}
+gapminder %>%
+ filter(continent == "Europe" & year == 2007) %>%
+ select(country, pop) %>%
+ mutate(pop_mill = round(pop / 1000000, 2))
+```
+
+**Task 4:** Create a new variable to store the total GDP of each country each year in billions (1,000,000,000) rounded to two decimal places. Hint: you need to multiply the GDP per capita by the total population to get total GDP of that year using the `mutate()` function.
+
+```{r}
+
+
+
+
+
+
+```
+
+## Arrange rows of a dataset using `arrange()` function
+
+We may also want to rank the five European countries by population size in 2007. We can do that using the `arrange()` function.
+
+The code below arranges the dataset in **ascending** order by the `pop` variable, using the `arrange()` function. Not surprisingly Ireland made the list due its small size within Europe!
+
+```{r}
+gapminder %>%
+ filter(continent == "Europe" & year == 2007) %>%
+ select(country, pop) %>%
+ mutate(pop_mill = round(pop / 1000000, 2)) %>%
+ arrange(pop)
+```
+
+Now, if we want to see the top five most populous countries in Europe in 2007, we can use the `desc()` function inside the `arrange()` function. By default the `arrange()` function arrange the dataset from the smallest to the largest, but with the help of `desc()` function we can arrange the dataset from the largest to the smallest. See the code below, how we can use the `desc()` function inside the `arrange()` function to arrange the dataset from the largest to the smallest.
+
+```{r}
+gapminder %>%
+ filter(continent == "Europe" & year == 2007) %>%
+ select(country, pop) %>%
+ mutate(pop_mill = round(pop / 1000000, 2)) %>%
+ arrange(desc(pop))
+```
+
+**Task 5:** Now write the code below to find out the top five most economically productive countries (measured by GDP per capita) in Africa in 2002.
+
+```{r}
+
+
+
+
+
+```
+
+
+## Filtering Rows Based on Multiple Values of a Variable
+
+One way to filter more than one year at a time, or multiple countries, is to use the `%in%` operator.
+Suppose we want to extract rows for Ireland and New Zealand, in both 2002 and 2007. In $\texttt{R}$, we can create a vector of these countries using `c("Ireland","New Zealand")` and the two years `c(2002, 2007)`.
+
+The following code extracts the rows for these two countries for those two years. Note: the code deliberately uses single quotes to demonstrate that a **character string** can use double "" or single '' quotation marks.
+
+
+```{r}
+library(tidyverse)
+
+gapminder %>%
+ filter(country %in% c('Ireland', 'New Zealand') & year %in% c(2002, 2007))
+```
+
+**Task 6:** Now write the code to extract rows corresponding to the Europe and Oceania from 1997 and 2007.
+
+```{r}
+
+
+
+```
+
+## Revisiting `group_by()` function
+
+Now, if we want to calculate the average GDP per capita for each of the continent by year, we could do that using the `group_by()` function that you are already familiar with.
+
+The following code groups the dataset by `continent` and `year`, and then calculates the average GDP per capita for each continent per year
+
+```{r message = FALSE, warning = FALSE}
+gapminder %>%
+ group_by(continent, year) %>%
+ summarise(mean(gdpPercap))
+```
+
+You can see the resulting dataset has 60 rows because there are 12 year * 5 continent groups. The `summarise(mean(gdpPercap))` calculate the average GDP per capita over all the countries in that continent for that particular year.
+
+If you want to count how many countries belong to a particular group and used this to calculate the average you can generate that number using the counting function `n()` inside the `summarise()` function. In statistics, "n" oft refers to as sample size.
+
+From the code below, you can see for each year 52 countries used to calculate the average in Africa. If you scroll through the table then you can see it varies for each continent.
+
+
+```{r}
+gapminder %>%
+ group_by(continent, year) %>%
+ summarise(n(), mean(gdpPercap))
+```
+
+**Task 7:** Write code below to find out how many countries were used to calculate the mean for the Oceania continent over different years.
+
+```{r}
+
+
+
+```
+
+## Creating a Cross-tabulation of Summary Statistics
+
+To see how many countries are there in the dataset for each continent by years. We can generate a cross-table using the `table()` function as follows.
+
+```{r}
+gapminder %>%
+ select(continent, year) %>%
+ table()
+```
+
+Here, each row refers to the name of the continent, each column refers to the corresponding year, and the value in each cell of the table is the count of the entries. We may want to generate such a table but with the average value of the GDP per capita not the number of countries. How can we do that? To this we need to learn another function `pivot_wider()`.
+
+Run the following code.
+```{r}
+gapminder %>%
+ group_by(continent, year) %>%
+ summarise(mean(gdpPercap)) %>%
+ pivot_wider(names_from = year, values_from = `mean(gdpPercap)`)
+```
+
+Now instead of the count, now we have average GDP per capita for each continent by year. It is very easy to compare the average GDP per capitat across year and continent.
+
+It is slightly easier to code if you name the result from the `summary()` function as you can then just refer to it by name in `pivot_wider()`. Notice that the results are the same, but the code is maybe a little easier to understand.
+
+```{r}
+gapminder %>%
+ group_by(continent, year) %>%
+ summarise(meanGDP = mean(gdpPercap)) %>%
+ pivot_wider(names_from = year, values_from = meanGDP)
+```
+
+The `pivot_wider()` function *reshaped* the dataset by taking the column `year` and making each of its category as separate column. Then it fills the cell by taking values from the `meanGDP` variable. The part of the name of the function is "wider" because it makes the dataset "wide" by creating more variables than it has before. This type of transformation of dataset is called "reshaping". If this concept seems a bit advanced, do not worry we will discuss more about reshaping in future labs.
+
+
+**Task 8:** Create a cross-table of continent and year with median life expectancy as the value for each cell.
+
+```{r}
+
+
+
+```
+
+## Creating a Scatterplot With `geom_point()`
+
+We have created a nice summary table to compare the average GDP per capita among different continents across different years. A graphical summary may be useful for audiences that don't like tables of numbers. **A picture is worth a thousand words, or numbers!*
+
+Suppose, we want to see the change of life expectancy over the years for Ireland. First, we can filter the dataset to get the rows related to Ireland and then we can put `year` variable on the x-axis and `lifeExp` on the y-axis for the `ggplot`. Then we can represent each value as a point (geometric shape). In the following code we used the `geom_point()` function to create such a plot with "points" as geometric shape. This kind of plot is commonly known as *scatterplot*.
+
+
+```{r}
+gapminder %>%
+ filter(country == "Ireland") %>%
+ ggplot(aes(x = year, y = lifeExp)) +
+ geom_point() +
+ labs(x = "Year", y = "Life Expectancy at Birth")
+```
+
+**Task 9:** Create a scatterplot of Irish population against year to see how Irish population is changing.
+
+```{r}
+
+
+
+```
+
+## Layered Graphics with `ggplot`
+
+If we want to connect each of the dots by a line then we could use the `geom_line()` function in the plot above. In the code below, notice that we just added a new geometric shape in the plot and we have two plots (a scatter plot and a line plot) on the same plot! So we added a new *layer* by `geom_line()` function on the existing plot.
+
+We can add as many layers we want to the plot to make it more informative. This is a very powerful feature of `ggplot`. It is part of the "grammar of graphics", hence the **gg* in `ggplot`.
+
+
+```{r}
+gapminder %>%
+ filter(country == "Ireland") %>%
+ ggplot(aes(x = year, y = lifeExp)) +
+ geom_point() +
+ geom_line() +
+ labs(x = "Year", y = "Life Expectancy at Birth")
+```
+
+**Task 10:** Create a layered graphics (with both a scatterplot and line plot) of Irish population against year.
+
+```{r}
+
+
+
+```
+
+## Using `group` and `colour` aesthetics
+
+Now, why only Ireland? You might want to add more countries to the plot to compare between countries. There is a very nice way we could do that in `ggplot` using the `group` aesthetic.
+
+In the following code, we keep three countries and tell `ggplot` to create different lines for the different countries by specifying `group = country` inside the aesthetic `aes()` function which creates the environment for the plot.
+
+```{r}
+gapminder %>%
+ filter(country %in% c("Ireland", "Iceland", "Japan" )) %>%
+ ggplot(aes(x = year, y = lifeExp, group = country)) +
+ geom_point() +
+ geom_line() +
+ labs(x = "Year", y = "Life Expectancy at Birth")
+```
+
+The problem with the above plot is that we do not know what line represent what countries. To solve this, we can use `colour` aesthetic of `ggplot`.
+
+```{r}
+gapminder %>%
+ filter(country %in% c("Ireland", "Iceland", "Japan" )) %>%
+ ggplot(aes(x = year, y = lifeExp, group = country, colour = country)) +
+ geom_point() +
+ geom_line() +
+ labs(x = "Year", y = "Life Expectancy at Birth")
+```
+
+Now we have nice label for each country. This is called *legend* in plotting terminology.
+
+**Task 11:** In the following R chunk, change the previous code to add two more countries: Norway and Italy. This time instead of life expectancy, plot total population in millions. Note: you have to create a new variable to convert the population in millions and you also need to change the level appropriately.
+
+
+```{r}
+
+
+
+
+```
+
+
+## Plotting summary statistics
+
+Now, if we wish to compare `lifeExp` across different continent, the line plot above might not be helpful because there are many countries belong to the same continent. So we first need to summarise them using a summary statistics (`median()` for example) and then can plot that for each continent over the years.
+
+
+```{r}
+gapminder %>%
+ group_by(continent, year) %>%
+ summarise(medianlifeExp = median(lifeExp)) %>%
+ ggplot(aes(x = year, y = medianlifeExp, colour = continent)) +
+ geom_point() +
+ geom_line() +
+ labs(x = "Year", y = "Median Life Expectancy at Birth")
+```
+
+**Task 12:** In the following code chunk, create a plot to compare mean GDP per capita across different continents over the years. Label the plot appropriately.
+
+```{r}
+
+
+
+```
+
+
+## Object manipulation in `R`
+
+Whenever you use `<-` of `=` operator in $\texttt{R}$ you are creating an object on the right and "assigning" it the name on the left of the operator. All the objects you create in an $\texttt{R}$ session are available in `R`'s memory for your to use. You can use the `objects()` or `ls()` functions to see what objects are available in the memory.
+
+```{r}
+objects()
+
+ls()
+```
+
+The only object you should have stored in memory from this lab is the `gapminder` dataset, we imported at the beginning. No other objects have been created so far. Now, let's create some more objects.
+
+```{r}
+x = c(1, 2, 3, 4, 5)
+y = c("A", "B", "C")
+
+ireland = gapminder %>% filter(country == "Ireland")
+```
+
+and check what objects are available now.
+
+```{r}
+ls()
+```
+
+If you want to delete an object you can use the `rm()` function to do so. Lets delete the `x` object.
+
+```{r}
+rm("x")
+ls()
+```
+
+You can also delete all the objects in the `R` memory using the following code.
+
+```{r}
+rm(list = ls())
+```
+
+
+After this complete deletion there will be nothing left, hence why the `ls()` function returns `character(0)` which mean a character vector with 0 entries, i.e. an empty list!
+
+```{r}
+ls()
+```
+
+
+
diff --git a/second/semester1/ST2001/Assignments/lowbirthweight_scaffold.Rmd b/second/semester1/ST2001/Assignments/lowbirthweight_scaffold.Rmd
new file mode 100644
index 00000000..8e6f43e7
--- /dev/null
+++ b/second/semester1/ST2001/Assignments/lowbirthweight_scaffold.Rmd
@@ -0,0 +1,175 @@
+---
+title: "Investigating the Factors Affecting Birthweight"
+author: "Andrew Hayes, id = 21321503"
+date: "`r format(Sys.time(), '%d %B, %Y')`"
+output:
+ pdf_document: default
+ word_document: default
+---
+
+
+# Question of Interest
+
+Are the factors of smoking, previous history of hypertension or urinary irritability associated with whether babies were born with low birthweight (less than 2,500 grams)?
+
+## Load the Libraries and Data Needed
+Load the required libraries so you can use them, and then make the birthweight data available ('lowbwt') as follows:
+
+```{r, message = FALSE, warning = FALSE}
+library(tidyverse)
+library(aplore3)
+
+data(lowbwt)
+```
+
+The low birthweight data is from the "Applied Logistic Regression" textbook by Hosmer and Lemeshow. The following is a description of the variables in this dataset.
+
+|Name| Description|
+|:------|:------------------------------------------------------------------------|
+|subject| identification code|
+|low |low birthweight ("< 2500 g" or ">= 2500 g")|
+|age |age of mother|
+|lwt|weight at last menstrual period (pounds)|
+|race |race (Black, White, Other)|
+|smoke |smoked during pregnancy (Yes, No)|
+|ptl |premature labour history (None, One, Two, etc.)|
+|ht |history of hypertension (Yes, No)|
+|ui |uterine irritability (Yes, No)|
+|ftv |number of visits to physician during 1st trimester (None, One, Two, etc.)|
+|bwt |birthweight (in grams)|
+
+## Subjective Impressions
+
+The key variable of interest is `low` which represents whether a baby is born with low birthweight, defined as a birthweight below 2,500 grams.
+
+```{r}
+lowbwt %>% select(low) %>% table()
+```
+
+Let's explore the association between history of hypertension and low birthweight by tabulating the data.
+
+```{r}
+lowbwt %>% select(low, ht) %>% table()
+```
+
+It seems there were not many mothers with hypertension, but the proportions of low weight babies is very much higher for mothers suffering from hypertension status than those that were not.
+
+```{r}
+lowbwt %>% select(low, ht) %>% table() %>% prop.table(margin = 2)
+```
+
+Task: In the following `R` chunk explore the association between uterine irritability and whether the babies were born with low birthweight, using both the counts and appropriate percentages. Explain the results in words.
+
+```{r}
+lowbwt %>% select(low, ui) %>% table()
+lowbwt %>% select(low, ui) %>% table() %>% prop.table(margin = 2)
+
+```
+It seems that there were relatively few mothers with uterine irritability in the dataset, only 28. Of those 28, precisely half the babies had low weight, and the rest did not. When we compare these proportions to the rest of the dataset, we see that uterine irritability is definitely associated with low birth rate, although to a lesser degree than hypertension. Babies were almost 1.8 times more likely to be born with low weight if their mother suffered from uterine irritability than babies whose mothers did not.
+
+
+Task: In the following `R` chunk explore the association between smoking status and whether the babies were born with low birthweight, using both the counts and appropriate percentages. Explain the results in words.
+
+```{r}
+lowbwt %>% select(low, smoke) %>% table()
+lowbwt %>% select(low, smoke) %>% table() %>% prop.table(margin = 2)
+
+```
+Smoking definitely has an association with low birth weight, although to a lesser degree than uterine irritability. Babies of smokers were about 1.6 times more likely than the babies of non-smokers to have low birth rate. However, babies of smokers were more likely to be non-low weight than low weight. There are also a lot more mothers who are smokers than have uterine irritability, so the smoker data should be less sensitive to outliers.
+
+Now we will create some barcharts.
+
+# Barchart of Low Birthweight
+
+The following is a frequency plot of the low birthweight status.
+
+```{r}
+ggplot(lowbwt, aes(x = low, fill = low)) +
+ geom_bar()
+```
+
+Task: In the following `R` chunk create a frequency plot of the smoking status.
+
+```{r}
+ggplot(lowbwt, aes(x = smoke, fill = smoke)) +
+ geom_bar()
+
+```
+
+
+# Stacked Barchart of Low Birthweight by Hypertension Status
+
+Below is a relative frequency plot of the low birthweight of the babies against the hypertension status of the mothers using a stacked barchart.
+
+```{r}
+ggplot(lowbwt, aes(x = ht)) +
+ geom_bar(aes(fill = low), position = "fill") +
+ ylab("Proportion")
+```
+
+
+Task: Create a stacked barchart of low birthweight by smoking status by inserting an `R` chunk and relevant code below.
+```{r}
+ggplot(lowbwt, aes(x = smoke)) +
+ geom_bar(aes(fill = low), position = "fill") +
+ ylab("Proportion")
+```
+
+
+
+Task: Create a stacked barchart of low birthweight by uterine irritability by inserting an `R` chunk and relevant code below.
+```{r}
+ggplot(lowbwt, aes(x = ui)) +
+ geom_bar(aes(fill = low), position = "fill") +
+ ylab("Proportion")
+```
+
+
+Task: Once you have created the plots, explain your interpretation of which factors are associated with low birthweight based on the three barcharts. State which factor you think is most associated with birthweight.
+
+Based off of the 3 barcharts, I would say that all 3 factors are associated with low birthweight. It appears to me that hypertension is most associated with low birthweight (0.5833333), followed by uterine irritability (0.5000000), followed by smoke (0.4054054). However, it may be relevant to note that the sample size of each of those factors is rather small, and therefore sensitive to outliers.
+
+
+The following `R` chunk produces a boxplot of the birthweight distribution.
+
+```{r}
+lowbwt %>% ggplot(aes(y = bwt)) +
+ geom_boxplot() +
+ labs(y = "Birthweight (in grams)")
+
+```
+
+
+Task: In the previous task you stated which factor you believe was most associated with birthweight, so you can explore the impact on the distribution in more detail. Create a graph of side-by-side boxplots comparing the birthweight distribution for each level of that factor (e.g. comparing mothers who had uterine irritability and those who did not), by inserting an `R` chunk and relevant code below.
+
+[Hint: we used side-by-side boxplots in the week 4 lab and in the Exploratory Data Analysis worksheet]
+
+```{r}
+lowbwt %>% ggplot(aes(y = bwt, x = factor(ht))) +
+ geom_boxplot() +
+ labs(x = "ht")
+```
+
+
+
+
+
+
+# Conclusion
+
+Task: Write a short conclusion of whether you think low birthweight of babies can be predicted based on whether the mother smoked, has hypertension or uterine irritability.
+
+It's clear that there is some association between low birthweight of babies based off whether the mother smoked, had hyptertension, or uterine irritability,
+However, it's more difficult to say whether low birthweight can be predicted by any of these factors.
+
+I would say that low birthweight can be predicted by hypertension, as the majority of babies born to mothers with hypertension have low birthrate (0.5833333).
+
+However, uterine irritability is a predictor of an increased chance of low birthweight, but not low birthweight itself. It appears from the data that it is 50-50 (0.5000000) whether a baby born to a mother with uterine irritability will have low birthrate, so you couldn't make an accurate prediction about the baby of a mother with uterine irritability. However, it most certainly does predict increased chances of low birthweight.
+
+Finally, while smoking is a predictor of increased chance of low birthweight (0.4054054), the majority of babies born to smokers do not have low birthweight, which means that the only reasonable prediction you could make about a baby born to a smoker is that it *will not* have a low birthweight, although there is a significant chance that it will, which is significantly higher than the chance of a non-smoker having a baby with low birthweight.
+
+
+Final Task: "knit" the file as a Word of PDF document and submit it via the relevant link on Blackboard before the deadline.
+
+
+
diff --git a/second/semester1/ST2001/Assignments/lowbirthweight_scaffold.docx b/second/semester1/ST2001/Assignments/lowbirthweight_scaffold.docx
new file mode 100644
index 00000000..89ea2625
Binary files /dev/null and b/second/semester1/ST2001/Assignments/lowbirthweight_scaffold.docx differ
diff --git a/second/semester1/ST2001/Assignments/lowbirthweight_scaffold.pdf b/second/semester1/ST2001/Assignments/lowbirthweight_scaffold.pdf
new file mode 100644
index 00000000..fad9bc3a
Binary files /dev/null and b/second/semester1/ST2001/Assignments/lowbirthweight_scaffold.pdf differ
diff --git a/second/semester1/ST2001/ST2001-Slides.pdf b/second/semester1/ST2001/ST2001-Slides.pdf
new file mode 100644
index 00000000..40c4bdcf
Binary files /dev/null and b/second/semester1/ST2001/ST2001-Slides.pdf differ
diff --git a/second/semester1/SUISL/Calendar/1.mp4 b/second/semester1/SUISL/Calendar/1.mp4
new file mode 100755
index 00000000..995fa456
Binary files /dev/null and b/second/semester1/SUISL/Calendar/1.mp4 differ
diff --git a/second/semester1/SUISL/Calendar/2.mp4 b/second/semester1/SUISL/Calendar/2.mp4
new file mode 100755
index 00000000..723f2333
Binary files /dev/null and b/second/semester1/SUISL/Calendar/2.mp4 differ
diff --git a/second/semester1/SUISL/Calendar/3.mp4 b/second/semester1/SUISL/Calendar/3.mp4
new file mode 100755
index 00000000..84b1857f
Binary files /dev/null and b/second/semester1/SUISL/Calendar/3.mp4 differ
diff --git a/second/semester1/SUISL/Calendar/4.mp4 b/second/semester1/SUISL/Calendar/4.mp4
new file mode 100755
index 00000000..7d74cd5c
Binary files /dev/null and b/second/semester1/SUISL/Calendar/4.mp4 differ
diff --git a/second/semester1/SUISL/Calendar/5.mp4 b/second/semester1/SUISL/Calendar/5.mp4
new file mode 100755
index 00000000..25c19a8e
Binary files /dev/null and b/second/semester1/SUISL/Calendar/5.mp4 differ
diff --git a/second/semester1/SUISL/Calendar/6.mp4 b/second/semester1/SUISL/Calendar/6.mp4
new file mode 100755
index 00000000..8bbac04f
Binary files /dev/null and b/second/semester1/SUISL/Calendar/6.mp4 differ
diff --git a/second/semester1/SUISL/Calendar/7.mp4 b/second/semester1/SUISL/Calendar/7.mp4
new file mode 100755
index 00000000..fe78fa24
Binary files /dev/null and b/second/semester1/SUISL/Calendar/7.mp4 differ
diff --git a/second/semester1/SUISL/Calendar/8.mp4 b/second/semester1/SUISL/Calendar/8.mp4
new file mode 100755
index 00000000..8ff45024
Binary files /dev/null and b/second/semester1/SUISL/Calendar/8.mp4 differ
diff --git a/second/semester1/SUISL/Daily Life/1.mp4 b/second/semester1/SUISL/Daily Life/1.mp4
new file mode 100755
index 00000000..992d306f
Binary files /dev/null and b/second/semester1/SUISL/Daily Life/1.mp4 differ
diff --git a/second/semester1/SUISL/Daily Life/2. daily 1.mp4 b/second/semester1/SUISL/Daily Life/2. daily 1.mp4
new file mode 100755
index 00000000..6573db7f
Binary files /dev/null and b/second/semester1/SUISL/Daily Life/2. daily 1.mp4 differ
diff --git a/second/semester1/SUISL/Food and Drink/1.mp4 b/second/semester1/SUISL/Food and Drink/1.mp4
new file mode 100755
index 00000000..533d67ce
Binary files /dev/null and b/second/semester1/SUISL/Food and Drink/1.mp4 differ
diff --git a/second/semester1/SUISL/Food and Drink/2.mp4 b/second/semester1/SUISL/Food and Drink/2.mp4
new file mode 100755
index 00000000..b820c566
Binary files /dev/null and b/second/semester1/SUISL/Food and Drink/2.mp4 differ
diff --git a/second/semester1/SUISL/Food and Drink/3.mp4 b/second/semester1/SUISL/Food and Drink/3.mp4
new file mode 100755
index 00000000..00bd71a9
Binary files /dev/null and b/second/semester1/SUISL/Food and Drink/3.mp4 differ
diff --git a/second/semester1/SUISL/Sharing Information/SI.mp4 b/second/semester1/SUISL/Sharing Information/SI.mp4
new file mode 100755
index 00000000..dc3d77fb
Binary files /dev/null and b/second/semester1/SUISL/Sharing Information/SI.mp4 differ
diff --git a/second/semester1/SUISL/Telling the time/1.mp4 b/second/semester1/SUISL/Telling the time/1.mp4
new file mode 100755
index 00000000..819259a5
Binary files /dev/null and b/second/semester1/SUISL/Telling the time/1.mp4 differ
diff --git a/second/semester1/SUISL/Telling the time/2.mp4 b/second/semester1/SUISL/Telling the time/2.mp4
new file mode 100755
index 00000000..f0f8950a
Binary files /dev/null and b/second/semester1/SUISL/Telling the time/2.mp4 differ
diff --git a/second/semester1/SUISL/Transport/Transport.mp4 b/second/semester1/SUISL/Transport/Transport.mp4
new file mode 100755
index 00000000..d5ff029c
Binary files /dev/null and b/second/semester1/SUISL/Transport/Transport.mp4 differ
diff --git a/second/semester1/SUISL/alphabet/Alphabet.png b/second/semester1/SUISL/alphabet/Alphabet.png
new file mode 100755
index 00000000..8f3b6345
Binary files /dev/null and b/second/semester1/SUISL/alphabet/Alphabet.png differ
diff --git a/second/semester1/SUISL/introduction/1.mp4 b/second/semester1/SUISL/introduction/1.mp4
new file mode 100755
index 00000000..a795a459
Binary files /dev/null and b/second/semester1/SUISL/introduction/1.mp4 differ
diff --git a/second/semester1/SUISL/introduction/2.mp4 b/second/semester1/SUISL/introduction/2.mp4
new file mode 100755
index 00000000..eab3c0e2
Binary files /dev/null and b/second/semester1/SUISL/introduction/2.mp4 differ
diff --git a/second/semester1/SUISL/introduction/3.mp4 b/second/semester1/SUISL/introduction/3.mp4
new file mode 100755
index 00000000..7e69c100
Binary files /dev/null and b/second/semester1/SUISL/introduction/3.mp4 differ
diff --git a/second/semester1/SUISL/introduction/4.mp4 b/second/semester1/SUISL/introduction/4.mp4
new file mode 100755
index 00000000..c601a80e
Binary files /dev/null and b/second/semester1/SUISL/introduction/4.mp4 differ
diff --git a/second/semester1/SUISL/introduction/5.mp4 b/second/semester1/SUISL/introduction/5.mp4
new file mode 100755
index 00000000..404ed6ad
Binary files /dev/null and b/second/semester1/SUISL/introduction/5.mp4 differ
diff --git a/second/semester1/SUISL/introduction/6.mp4 b/second/semester1/SUISL/introduction/6.mp4
new file mode 100755
index 00000000..997811c4
Binary files /dev/null and b/second/semester1/SUISL/introduction/6.mp4 differ
diff --git a/second/semester1/SUISL/introduction/7.mp4 b/second/semester1/SUISL/introduction/7.mp4
new file mode 100755
index 00000000..86720ab1
Binary files /dev/null and b/second/semester1/SUISL/introduction/7.mp4 differ
diff --git a/second/semester1/SUISL/introduction/8.mp4 b/second/semester1/SUISL/introduction/8.mp4
new file mode 100755
index 00000000..cc50b49f
Binary files /dev/null and b/second/semester1/SUISL/introduction/8.mp4 differ
diff --git a/second/semester1/SUISL/introduction/space introduction L3.mp4 b/second/semester1/SUISL/introduction/space introduction L3.mp4
new file mode 100755
index 00000000..cc50b49f
Binary files /dev/null and b/second/semester1/SUISL/introduction/space introduction L3.mp4 differ
diff --git a/second/semester1/SUISL/meeting People/1.mp4 b/second/semester1/SUISL/meeting People/1.mp4
new file mode 100755
index 00000000..63df32de
Binary files /dev/null and b/second/semester1/SUISL/meeting People/1.mp4 differ
diff --git a/second/semester1/SUISL/meeting People/2.mp4 b/second/semester1/SUISL/meeting People/2.mp4
new file mode 100755
index 00000000..4dd6e9e2
Binary files /dev/null and b/second/semester1/SUISL/meeting People/2.mp4 differ
diff --git a/second/semester1/SUISL/meeting People/introduction/Alphabet.png b/second/semester1/SUISL/meeting People/introduction/Alphabet.png
new file mode 100755
index 00000000..8f3b6345
Binary files /dev/null and b/second/semester1/SUISL/meeting People/introduction/Alphabet.png differ
diff --git a/second/semester1/logseq-stuff/assets/2BCT-1_1662890969894_0.edn b/second/semester1/logseq-stuff/assets/2BCT-1_1662890969894_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/2BCT-1_1662890969894_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/2BCT-1_1662890969894_0.pdf b/second/semester1/logseq-stuff/assets/2BCT-1_1662890969894_0.pdf
new file mode 100644
index 00000000..6d5eef4b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/2BCT-1_1662890969894_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/CT213-Slides_1662818364324_0.edn b/second/semester1/logseq-stuff/assets/CT213-Slides_1662818364324_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/CT213-Slides_1662818364324_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/CT213-Slides_1662818364324_0.pdf b/second/semester1/logseq-stuff/assets/CT213-Slides_1662818364324_0.pdf
new file mode 100644
index 00000000..bdef5248
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/CT213-Slides_1662818364324_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/ER-models_1664888140370_0.edn b/second/semester1/logseq-stuff/assets/ER-models_1664888140370_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/ER-models_1664888140370_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/ER-models_1664888140370_0.pdf b/second/semester1/logseq-stuff/assets/ER-models_1664888140370_0.pdf
new file mode 100644
index 00000000..4a9e905e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/ER-models_1664888140370_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/FileOrganisations_1668521188976_0.edn b/second/semester1/logseq-stuff/assets/FileOrganisations_1668521188976_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/FileOrganisations_1668521188976_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/FileOrganisations_1668521188976_0.pdf b/second/semester1/logseq-stuff/assets/FileOrganisations_1668521188976_0.pdf
new file mode 100644
index 00000000..190ce62f
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/FileOrganisations_1668521188976_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-10_2022_1665044307581_0.edn b/second/semester1/logseq-stuff/assets/Lecture-10_2022_1665044307581_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-10_2022_1665044307581_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-10_2022_1665044307581_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-10_2022_1665044307581_0.pdf
new file mode 100644
index 00000000..b68319d7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-10_2022_1665044307581_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-13_2022_1666253165381_0.edn b/second/semester1/logseq-stuff/assets/Lecture-13_2022_1666253165381_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-13_2022_1666253165381_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-13_2022_1666253165381_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-13_2022_1666253165381_0.pdf
new file mode 100644
index 00000000..b8a58625
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-13_2022_1666253165381_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-14_2022_1666343488472_0.edn b/second/semester1/logseq-stuff/assets/Lecture-14_2022_1666343488472_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-14_2022_1666343488472_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-14_2022_1666343488472_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-14_2022_1666343488472_0.pdf
new file mode 100644
index 00000000..612f6b5e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-14_2022_1666343488472_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-15_2022_1666857889307_0.edn b/second/semester1/logseq-stuff/assets/Lecture-15_2022_1666857889307_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-15_2022_1666857889307_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-15_2022_1666857889307_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-15_2022_1666857889307_0.pdf
new file mode 100644
index 00000000..76da3252
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-15_2022_1666857889307_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-16_2022_1666857979984_0.edn b/second/semester1/logseq-stuff/assets/Lecture-16_2022_1666857979984_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-16_2022_1666857979984_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-16_2022_1666857979984_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-16_2022_1666857979984_0.pdf
new file mode 100644
index 00000000..a918d21b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-16_2022_1666857979984_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-21_2022_1668676202336_0.edn b/second/semester1/logseq-stuff/assets/Lecture-21_2022_1668676202336_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-21_2022_1668676202336_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-21_2022_1668676202336_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-21_2022_1668676202336_0.pdf
new file mode 100644
index 00000000..bbe5bcc2
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-21_2022_1668676202336_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-22_2022_1668765583448_0.edn b/second/semester1/logseq-stuff/assets/Lecture-22_2022_1668765583448_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-22_2022_1668765583448_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-22_2022_1668765583448_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-22_2022_1668765583448_0.pdf
new file mode 100644
index 00000000..1981b690
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-22_2022_1668765583448_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-6_2022_1663835887381_0.edn b/second/semester1/logseq-stuff/assets/Lecture-6_2022_1663835887381_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-6_2022_1663835887381_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-6_2022_1663835887381_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-6_2022_1663835887381_0.pdf
new file mode 100644
index 00000000..d83d3bb0
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-6_2022_1663835887381_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-7_2022_1664439118886_0.edn b/second/semester1/logseq-stuff/assets/Lecture-7_2022_1664439118886_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-7_2022_1664439118886_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-7_2022_1664439118886_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-7_2022_1664439118886_0.pdf
new file mode 100644
index 00000000..8a33ae1c
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-7_2022_1664439118886_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-8_2022_1664528150319_0.edn b/second/semester1/logseq-stuff/assets/Lecture-8_2022_1664528150319_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-8_2022_1664528150319_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-8_2022_1664528150319_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-8_2022_1664528150319_0.pdf
new file mode 100644
index 00000000..ca19c884
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-8_2022_1664528150319_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture-9_2022_1665043655336_0.edn b/second/semester1/logseq-stuff/assets/Lecture-9_2022_1665043655336_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture-9_2022_1665043655336_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture-9_2022_1665043655336_0.pdf b/second/semester1/logseq-stuff/assets/Lecture-9_2022_1665043655336_0.pdf
new file mode 100644
index 00000000..368f0ec3
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture-9_2022_1665043655336_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture00_1662819191194_0.edn b/second/semester1/logseq-stuff/assets/Lecture00_1662819191194_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture00_1662819191194_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture00_1662819191194_0.pdf b/second/semester1/logseq-stuff/assets/Lecture00_1662819191194_0.pdf
new file mode 100644
index 00000000..79abd1d5
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture00_1662819191194_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture00_1662845418512_0.pdf b/second/semester1/logseq-stuff/assets/Lecture00_1662845418512_0.pdf
new file mode 100644
index 00000000..336f8192
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture00_1662845418512_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture00_1662845487478_0.pdf b/second/semester1/logseq-stuff/assets/Lecture00_1662845487478_0.pdf
new file mode 100644
index 00000000..336f8192
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture00_1662845487478_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture00_1662846689898_0.pdf b/second/semester1/logseq-stuff/assets/Lecture00_1662846689898_0.pdf
new file mode 100644
index 00000000..c3abae5b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture00_1662846689898_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture00_1662850272554_0.edn b/second/semester1/logseq-stuff/assets/Lecture00_1662850272554_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture00_1662850272554_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture00_1662850272554_0.pdf b/second/semester1/logseq-stuff/assets/Lecture00_1662850272554_0.pdf
new file mode 100644
index 00000000..3e957446
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture00_1662850272554_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662819128126_0.edn b/second/semester1/logseq-stuff/assets/Lecture01_1662819128126_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture01_1662819128126_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662819128126_0.pdf b/second/semester1/logseq-stuff/assets/Lecture01_1662819128126_0.pdf
new file mode 100644
index 00000000..41e8d6cc
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture01_1662819128126_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662819169570_0.pdf b/second/semester1/logseq-stuff/assets/Lecture01_1662819169570_0.pdf
new file mode 100644
index 00000000..41e8d6cc
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture01_1662819169570_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662828507609_0.edn b/second/semester1/logseq-stuff/assets/Lecture01_1662828507609_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture01_1662828507609_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662828507609_0.pdf b/second/semester1/logseq-stuff/assets/Lecture01_1662828507609_0.pdf
new file mode 100644
index 00000000..bdef5248
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture01_1662828507609_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662845512365_0.edn b/second/semester1/logseq-stuff/assets/Lecture01_1662845512365_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture01_1662845512365_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662845512365_0.pdf b/second/semester1/logseq-stuff/assets/Lecture01_1662845512365_0.pdf
new file mode 100644
index 00000000..89c5b681
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture01_1662845512365_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662846749778_0.edn b/second/semester1/logseq-stuff/assets/Lecture01_1662846749778_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture01_1662846749778_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662846749778_0.pdf b/second/semester1/logseq-stuff/assets/Lecture01_1662846749778_0.pdf
new file mode 100644
index 00000000..cd795abf
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture01_1662846749778_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662850796416_0.edn b/second/semester1/logseq-stuff/assets/Lecture01_1662850796416_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture01_1662850796416_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662850796416_0.pdf b/second/semester1/logseq-stuff/assets/Lecture01_1662850796416_0.pdf
new file mode 100644
index 00000000..1725b032
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture01_1662850796416_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662914505882_0.edn b/second/semester1/logseq-stuff/assets/Lecture01_1662914505882_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture01_1662914505882_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1662914505882_0.pdf b/second/semester1/logseq-stuff/assets/Lecture01_1662914505882_0.pdf
new file mode 100644
index 00000000..dd968172
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture01_1662914505882_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1663056989584_0.edn b/second/semester1/logseq-stuff/assets/Lecture01_1663056989584_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture01_1663056989584_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1663056989584_0.pdf b/second/semester1/logseq-stuff/assets/Lecture01_1663056989584_0.pdf
new file mode 100644
index 00000000..03d1a9b3
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture01_1663056989584_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1663153689773_0.edn b/second/semester1/logseq-stuff/assets/Lecture01_1663153689773_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture01_1663153689773_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture01_1663153689773_0.pdf b/second/semester1/logseq-stuff/assets/Lecture01_1663153689773_0.pdf
new file mode 100644
index 00000000..e327f041
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture01_1663153689773_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture02_1662842733013_0.edn b/second/semester1/logseq-stuff/assets/Lecture02_1662842733013_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture02_1662842733013_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture02_1662842733013_0.pdf b/second/semester1/logseq-stuff/assets/Lecture02_1662842733013_0.pdf
new file mode 100644
index 00000000..c7ce3840
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture02_1662842733013_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture02_1663059993088_0.edn b/second/semester1/logseq-stuff/assets/Lecture02_1663059993088_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture02_1663059993088_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture02_1663059993088_0.pdf b/second/semester1/logseq-stuff/assets/Lecture02_1663059993088_0.pdf
new file mode 100644
index 00000000..6640252c
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture02_1663059993088_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture02_1663148803122_0.edn b/second/semester1/logseq-stuff/assets/Lecture02_1663148803122_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture02_1663148803122_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture02_1663148803122_0.pdf b/second/semester1/logseq-stuff/assets/Lecture02_1663148803122_0.pdf
new file mode 100644
index 00000000..1f3a4dad
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture02_1663148803122_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture03_1663063871202_0.edn b/second/semester1/logseq-stuff/assets/Lecture03_1663063871202_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture03_1663063871202_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture03_1663063871202_0.pdf b/second/semester1/logseq-stuff/assets/Lecture03_1663063871202_0.pdf
new file mode 100644
index 00000000..05f55b86
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture03_1663063871202_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture03_1663270555849_0.pdf b/second/semester1/logseq-stuff/assets/Lecture03_1663270555849_0.pdf
new file mode 100644
index 00000000..05f55b86
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture03_1663270555849_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_10-_Hypothesis_tests(1)_1667837679625_0.edn b/second/semester1/logseq-stuff/assets/Lecture_10-_Hypothesis_tests(1)_1667837679625_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_10-_Hypothesis_tests(1)_1667837679625_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_10-_Hypothesis_tests(1)_1667837679625_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_10-_Hypothesis_tests(1)_1667837679625_0.pdf
new file mode 100644
index 00000000..2d988378
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_10-_Hypothesis_tests(1)_1667837679625_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_11-_Correlation_and_Regression(1)_1668682885675_0.edn b/second/semester1/logseq-stuff/assets/Lecture_11-_Correlation_and_Regression(1)_1668682885675_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_11-_Correlation_and_Regression(1)_1668682885675_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_11-_Correlation_and_Regression(1)_1668682885675_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_11-_Correlation_and_Regression(1)_1668682885675_0.pdf
new file mode 100644
index 00000000..ef00d5e1
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_11-_Correlation_and_Regression(1)_1668682885675_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_11_and_Lecture_12_2022_1665648153439_0.edn b/second/semester1/logseq-stuff/assets/Lecture_11_and_Lecture_12_2022_1665648153439_0.edn
new file mode 100644
index 00000000..78d6d813
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_11_and_Lecture_12_2022_1665648153439_0.edn
@@ -0,0 +1 @@
+{:highlights [], :extra {:page 1}}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_11_and_Lecture_12_2022_1665648153439_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_11_and_Lecture_12_2022_1665648153439_0.pdf
new file mode 100644
index 00000000..c8c9459f
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_11_and_Lecture_12_2022_1665648153439_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_3_1663453274726_0.edn b/second/semester1/logseq-stuff/assets/Lecture_3_1663453274726_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_3_1663453274726_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_3_1663453274726_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_3_1663453274726_0.pdf
new file mode 100644
index 00000000..a4aa358d
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_3_1663453274726_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_4_1664197052447_0.edn b/second/semester1/logseq-stuff/assets/Lecture_4_1664197052447_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_4_1664197052447_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_4_1664197052447_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_4_1664197052447_0.pdf
new file mode 100644
index 00000000..993e9ccc
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_4_1664197052447_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_5_1664977340413_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_5_1664977340413_0.pdf
new file mode 100644
index 00000000..b8a27152
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_5_1664977340413_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_5_1664977343897_0.edn b/second/semester1/logseq-stuff/assets/Lecture_5_1664977343897_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_5_1664977343897_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_5_1664977343897_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_5_1664977343897_0.pdf
new file mode 100644
index 00000000..b8a27152
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_5_1664977343897_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_5_2022_1663833716061_0.edn b/second/semester1/logseq-stuff/assets/Lecture_5_2022_1663833716061_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_5_2022_1663833716061_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_5_2022_1663833716061_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_5_2022_1663833716061_0.pdf
new file mode 100644
index 00000000..ce757fcd
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_5_2022_1663833716061_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_6_1665406709809_0.edn b/second/semester1/logseq-stuff/assets/Lecture_6_1665406709809_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_6_1665406709809_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_6_1665406709809_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_6_1665406709809_0.pdf
new file mode 100644
index 00000000..6b248252
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_6_1665406709809_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_7_1666616453389_0.edn b/second/semester1/logseq-stuff/assets/Lecture_7_1666616453389_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_7_1666616453389_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_7_1666616453389_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_7_1666616453389_0.pdf
new file mode 100644
index 00000000..bc54760d
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_7_1666616453389_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_8-_Sampling_dist._and_Confidence_Intervals(1)_1666624233800_0.edn b/second/semester1/logseq-stuff/assets/Lecture_8-_Sampling_dist._and_Confidence_Intervals(1)_1666624233800_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_8-_Sampling_dist._and_Confidence_Intervals(1)_1666624233800_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_8-_Sampling_dist._and_Confidence_Intervals(1)_1666624233800_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_8-_Sampling_dist._and_Confidence_Intervals(1)_1666624233800_0.pdf
new file mode 100644
index 00000000..dc729b27
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_8-_Sampling_dist._and_Confidence_Intervals(1)_1666624233800_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Lecture_8_-_Device_Management_1668429132526_0.edn b/second/semester1/logseq-stuff/assets/Lecture_8_-_Device_Management_1668429132526_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Lecture_8_-_Device_Management_1668429132526_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Lecture_8_-_Device_Management_1668429132526_0.pdf b/second/semester1/logseq-stuff/assets/Lecture_8_-_Device_Management_1668429132526_0.pdf
new file mode 100644
index 00000000..077431d5
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Lecture_8_-_Device_Management_1668429132526_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week03_1663699934644_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week03_1663699934644_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week03_1663699934644_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week03_1663699934644_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week03_1663699934644_0.pdf
new file mode 100644
index 00000000..1bccb7bc
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week03_1663699934644_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week04_1664365603740_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week04_1664365603740_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week04_1664365603740_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week04_1664365603740_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week04_1664365603740_0.pdf
new file mode 100644
index 00000000..997ceaea
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week04_1664365603740_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week05_1664971430860_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week05_1664971430860_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week05_1664971430860_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week05_1664971430860_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week05_1664971430860_0.pdf
new file mode 100644
index 00000000..ef03dfcd
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week05_1664971430860_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week06_1665576169094_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week06_1665576169094_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week06_1665576169094_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week06_1665576169094_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week06_1665576169094_0.pdf
new file mode 100644
index 00000000..a2a18b47
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week06_1665576169094_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week07_1666180762321_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week07_1666180762321_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week07_1666180762321_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week07_1666180762321_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week07_1666180762321_0.pdf
new file mode 100644
index 00000000..31aaea2d
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week07_1666180762321_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week08_1666785726176_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week08_1666785726176_0.edn
new file mode 100644
index 00000000..199a9b0a
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week08_1666785726176_0.edn
@@ -0,0 +1 @@
+{:highlights [], :extra {:page 4}}
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week08_1666785726176_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week08_1666785726176_0.pdf
new file mode 100644
index 00000000..3dfcb855
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week08_1666785726176_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week09_1667912503367_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week09_1667912503367_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week09_1667912503367_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week09_1667912503367_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week09_1667912503367_0.pdf
new file mode 100644
index 00000000..26571f48
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week09_1667912503367_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week10_1667999565189_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week10_1667999565189_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week10_1667999565189_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week10_1667999565189_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week10_1667999565189_0.pdf
new file mode 100644
index 00000000..abb42af7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week10_1667999565189_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week11_1668603812290_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week11_1668603812290_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week11_1668603812290_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week11_1668603812290_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week11_1668603812290_0.pdf
new file mode 100644
index 00000000..5d2c236a
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week11_1668603812290_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week12_1669208668908_0.edn b/second/semester1/logseq-stuff/assets/MA284-Week12_1669208668908_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/MA284-Week12_1669208668908_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/MA284-Week12_1669208668908_0.pdf b/second/semester1/logseq-stuff/assets/MA284-Week12_1669208668908_0.pdf
new file mode 100644
index 00000000..e85eb639
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/MA284-Week12_1669208668908_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/SQL_Joins_and_Union_Queries_class_1665572555489_0.edn b/second/semester1/logseq-stuff/assets/SQL_Joins_and_Union_Queries_class_1665572555489_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/SQL_Joins_and_Union_Queries_class_1665572555489_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/SQL_Joins_and_Union_Queries_class_1665572555489_0.pdf b/second/semester1/logseq-stuff/assets/SQL_Joins_and_Union_Queries_class_1665572555489_0.pdf
new file mode 100644
index 00000000..c134e2a4
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/SQL_Joins_and_Union_Queries_class_1665572555489_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Topic_3_-_Sampling_1663599787566_0.edn b/second/semester1/logseq-stuff/assets/Topic_3_-_Sampling_1663599787566_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Topic_3_-_Sampling_1663599787566_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Topic_3_-_Sampling_1663599787566_0.pdf b/second/semester1/logseq-stuff/assets/Topic_3_-_Sampling_1663599787566_0.pdf
new file mode 100644
index 00000000..9ba97925
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Topic_3_-_Sampling_1663599787566_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Topic_4_-_Probability_1664204337770_0.edn b/second/semester1/logseq-stuff/assets/Topic_4_-_Probability_1664204337770_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Topic_4_-_Probability_1664204337770_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Topic_4_-_Probability_1664204337770_0.pdf b/second/semester1/logseq-stuff/assets/Topic_4_-_Probability_1664204337770_0.pdf
new file mode 100644
index 00000000..01382768
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Topic_4_-_Probability_1664204337770_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Topic_4_DML_SQL_part1_1663680318777_0.edn b/second/semester1/logseq-stuff/assets/Topic_4_DML_SQL_part1_1663680318777_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Topic_4_DML_SQL_part1_1663680318777_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Topic_4_DML_SQL_part1_1663680318777_0.pdf b/second/semester1/logseq-stuff/assets/Topic_4_DML_SQL_part1_1663680318777_0.pdf
new file mode 100644
index 00000000..503d7ba3
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Topic_4_DML_SQL_part1_1663680318777_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Topic_5_-_Random_Variables_1665050186799_0.edn b/second/semester1/logseq-stuff/assets/Topic_5_-_Random_Variables_1665050186799_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Topic_5_-_Random_Variables_1665050186799_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Topic_5_-_Random_Variables_1665050186799_0.pdf b/second/semester1/logseq-stuff/assets/Topic_5_-_Random_Variables_1665050186799_0.pdf
new file mode 100644
index 00000000..e3f65775
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Topic_5_-_Random_Variables_1665050186799_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Topic_5_DML_SELECT_strings_and_subqueries_1664273683998_0.edn b/second/semester1/logseq-stuff/assets/Topic_5_DML_SELECT_strings_and_subqueries_1664273683998_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Topic_5_DML_SELECT_strings_and_subqueries_1664273683998_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Topic_5_DML_SELECT_strings_and_subqueries_1664273683998_0.pdf b/second/semester1/logseq-stuff/assets/Topic_5_DML_SELECT_strings_and_subqueries_1664273683998_0.pdf
new file mode 100644
index 00000000..9a2ba1e6
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Topic_5_DML_SELECT_strings_and_subqueries_1664273683998_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Topic_6_-_Binomial_and_Poisson_1665414148124_0.edn b/second/semester1/logseq-stuff/assets/Topic_6_-_Binomial_and_Poisson_1665414148124_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Topic_6_-_Binomial_and_Poisson_1665414148124_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Topic_6_-_Binomial_and_Poisson_1665414148124_0.pdf b/second/semester1/logseq-stuff/assets/Topic_6_-_Binomial_and_Poisson_1665414148124_0.pdf
new file mode 100644
index 00000000..db783c3f
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Topic_6_-_Binomial_and_Poisson_1665414148124_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Topic_6_SQL_DML_aggregateFns_and_Group_By_Having_1664362673690_0.edn b/second/semester1/logseq-stuff/assets/Topic_6_SQL_DML_aggregateFns_and_Group_By_Having_1664362673690_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Topic_6_SQL_DML_aggregateFns_and_Group_By_Having_1664362673690_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Topic_6_SQL_DML_aggregateFns_and_Group_By_Having_1664362673690_0.pdf b/second/semester1/logseq-stuff/assets/Topic_6_SQL_DML_aggregateFns_and_Group_By_Having_1664362673690_0.pdf
new file mode 100644
index 00000000..b90bb898
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Topic_6_SQL_DML_aggregateFns_and_Group_By_Having_1664362673690_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Topic_7_-_Normal_Distribution_1665655416597_0.edn b/second/semester1/logseq-stuff/assets/Topic_7_-_Normal_Distribution_1665655416597_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Topic_7_-_Normal_Distribution_1665655416597_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Topic_7_-_Normal_Distribution_1665655416597_0.pdf b/second/semester1/logseq-stuff/assets/Topic_7_-_Normal_Distribution_1665655416597_0.pdf
new file mode 100644
index 00000000..829f64ec
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Topic_7_-_Normal_Distribution_1665655416597_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week01_1662844828934_0.pdf b/second/semester1/logseq-stuff/assets/Week01_1662844828934_0.pdf
new file mode 100644
index 00000000..d7ed1b28
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week01_1662844828934_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week02_1663097329077_0.edn b/second/semester1/logseq-stuff/assets/Week02_1663097329077_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week02_1663097329077_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week02_1663097329077_0.pdf b/second/semester1/logseq-stuff/assets/Week02_1663097329077_0.pdf
new file mode 100644
index 00000000..cc9b7893
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week02_1663097329077_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_10_-_Firebase_functions,_Callbacks,_Creating_our_first_function_1668085262844_0.edn b/second/semester1/logseq-stuff/assets/Week_10_-_Firebase_functions,_Callbacks,_Creating_our_first_function_1668085262844_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_10_-_Firebase_functions,_Callbacks,_Creating_our_first_function_1668085262844_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_10_-_Firebase_functions,_Callbacks,_Creating_our_first_function_1668085262844_0.pdf b/second/semester1/logseq-stuff/assets/Week_10_-_Firebase_functions,_Callbacks,_Creating_our_first_function_1668085262844_0.pdf
new file mode 100644
index 00000000..70539242
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_10_-_Firebase_functions,_Callbacks,_Creating_our_first_function_1668085262844_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_11_-_Introduction_to_Firestore,_Creating_our_first_database_1668690492589_0.edn b/second/semester1/logseq-stuff/assets/Week_11_-_Introduction_to_Firestore,_Creating_our_first_database_1668690492589_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_11_-_Introduction_to_Firestore,_Creating_our_first_database_1668690492589_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_11_-_Introduction_to_Firestore,_Creating_our_first_database_1668690492589_0.pdf b/second/semester1/logseq-stuff/assets/Week_11_-_Introduction_to_Firestore,_Creating_our_first_database_1668690492589_0.pdf
new file mode 100644
index 00000000..2cd23ba2
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_11_-_Introduction_to_Firestore,_Creating_our_first_database_1668690492589_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_2_-_Software_Processes_1663178767479_0.edn b/second/semester1/logseq-stuff/assets/Week_2_-_Software_Processes_1663178767479_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_2_-_Software_Processes_1663178767479_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_2_-_Software_Processes_1663178767479_0.pdf b/second/semester1/logseq-stuff/assets/Week_2_-_Software_Processes_1663178767479_0.pdf
new file mode 100644
index 00000000..5d7f7a9d
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_2_-_Software_Processes_1663178767479_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_3_-_Introduction_to_Agile_Methods_-_Scrum(1)_1663848442133_0.edn b/second/semester1/logseq-stuff/assets/Week_3_-_Introduction_to_Agile_Methods_-_Scrum(1)_1663848442133_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_3_-_Introduction_to_Agile_Methods_-_Scrum(1)_1663848442133_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_3_-_Introduction_to_Agile_Methods_-_Scrum(1)_1663848442133_0.pdf b/second/semester1/logseq-stuff/assets/Week_3_-_Introduction_to_Agile_Methods_-_Scrum(1)_1663848442133_0.pdf
new file mode 100644
index 00000000..d6e2c64f
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_3_-_Introduction_to_Agile_Methods_-_Scrum(1)_1663848442133_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_3_-_SCRUM_-_Roles_and_Ceremonies_1663849748773_0.edn b/second/semester1/logseq-stuff/assets/Week_3_-_SCRUM_-_Roles_and_Ceremonies_1663849748773_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_3_-_SCRUM_-_Roles_and_Ceremonies_1663849748773_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_3_-_SCRUM_-_Roles_and_Ceremonies_1663849748773_0.pdf b/second/semester1/logseq-stuff/assets/Week_3_-_SCRUM_-_Roles_and_Ceremonies_1663849748773_0.pdf
new file mode 100644
index 00000000..25d89621
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_3_-_SCRUM_-_Roles_and_Ceremonies_1663849748773_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_4_-_Agile_Methods,_XP_1664439416140_0.edn b/second/semester1/logseq-stuff/assets/Week_4_-_Agile_Methods,_XP_1664439416140_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_4_-_Agile_Methods,_XP_1664439416140_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_4_-_Agile_Methods,_XP_1664439416140_0.pdf b/second/semester1/logseq-stuff/assets/Week_4_-_Agile_Methods,_XP_1664439416140_0.pdf
new file mode 100644
index 00000000..91e393a2
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_4_-_Agile_Methods,_XP_1664439416140_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_7_-_Bootstrap_1666267219478_0.edn b/second/semester1/logseq-stuff/assets/Week_7_-_Bootstrap_1666267219478_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_7_-_Bootstrap_1666267219478_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_7_-_Bootstrap_1666267219478_0.pdf b/second/semester1/logseq-stuff/assets/Week_7_-_Bootstrap_1666267219478_0.pdf
new file mode 100644
index 00000000..4d3a3297
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_7_-_Bootstrap_1666267219478_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_8_-_JavaScript_-_Functions,_Events_1668007671511_0.edn b/second/semester1/logseq-stuff/assets/Week_8_-_JavaScript_-_Functions,_Events_1668007671511_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_8_-_JavaScript_-_Functions,_Events_1668007671511_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_8_-_JavaScript_-_Functions,_Events_1668007671511_0.pdf b/second/semester1/logseq-stuff/assets/Week_8_-_JavaScript_-_Functions,_Events_1668007671511_0.pdf
new file mode 100644
index 00000000..0cc1f534
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_8_-_JavaScript_-_Functions,_Events_1668007671511_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_9_-_Introduction_to_NodeJS_1668008966428_0.edn b/second/semester1/logseq-stuff/assets/Week_9_-_Introduction_to_NodeJS_1668008966428_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_9_-_Introduction_to_NodeJS_1668008966428_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_9_-_Introduction_to_NodeJS_1668008966428_0.pdf b/second/semester1/logseq-stuff/assets/Week_9_-_Introduction_to_NodeJS_1668008966428_0.pdf
new file mode 100644
index 00000000..77636770
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_9_-_Introduction_to_NodeJS_1668008966428_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_9_-_JavaScript_-_Objects,_Arrays_1668008884027_0.edn b/second/semester1/logseq-stuff/assets/Week_9_-_JavaScript_-_Objects,_Arrays_1668008884027_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_9_-_JavaScript_-_Objects,_Arrays_1668008884027_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_9_-_JavaScript_-_Objects,_Arrays_1668008884027_0.pdf b/second/semester1/logseq-stuff/assets/Week_9_-_JavaScript_-_Objects,_Arrays_1668008884027_0.pdf
new file mode 100644
index 00000000..90dda878
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_9_-_JavaScript_-_Objects,_Arrays_1668008884027_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/Week_9_-_NodeJS,_APIs,_Deploying_to_Firebase_1668009200983_0.edn b/second/semester1/logseq-stuff/assets/Week_9_-_NodeJS,_APIs,_Deploying_to_Firebase_1668009200983_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/Week_9_-_NodeJS,_APIs,_Deploying_to_Firebase_1668009200983_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/Week_9_-_NodeJS,_APIs,_Deploying_to_Firebase_1668009200983_0.pdf b/second/semester1/logseq-stuff/assets/Week_9_-_NodeJS,_APIs,_Deploying_to_Firebase_1668009200983_0.pdf
new file mode 100644
index 00000000..4cad0b1f
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/Week_9_-_NodeJS,_APIs,_Deploying_to_Firebase_1668009200983_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/ct255_02_1663458790357_0.edn b/second/semester1/logseq-stuff/assets/ct255_02_1663458790357_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/ct255_02_1663458790357_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/ct255_02_1663458790357_0.pdf b/second/semester1/logseq-stuff/assets/ct255_02_1663458790357_0.pdf
new file mode 100644
index 00000000..4e7ddba7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/ct255_02_1663458790357_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/ct255_03_1664798420872_0.edn b/second/semester1/logseq-stuff/assets/ct255_03_1664798420872_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/ct255_03_1664798420872_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/ct255_03_1664798420872_0.pdf b/second/semester1/logseq-stuff/assets/ct255_03_1664798420872_0.pdf
new file mode 100644
index 00000000..8dfe28f7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/ct255_03_1664798420872_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/ct255_03_1666007884698_0.edn b/second/semester1/logseq-stuff/assets/ct255_03_1666007884698_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/ct255_03_1666007884698_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/ct255_03_1666007884698_0.pdf b/second/semester1/logseq-stuff/assets/ct255_03_1666007884698_0.pdf
new file mode 100644
index 00000000..8dfe28f7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/ct255_03_1666007884698_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/ct255_05_1665403304356_0.edn b/second/semester1/logseq-stuff/assets/ct255_05_1665403304356_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/ct255_05_1665403304356_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/ct255_05_1665403304356_0.pdf b/second/semester1/logseq-stuff/assets/ct255_05_1665403304356_0.pdf
new file mode 100644
index 00000000..7e656056
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/ct255_05_1665403304356_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/ct255_05_1666008161657_0.edn b/second/semester1/logseq-stuff/assets/ct255_05_1666008161657_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/ct255_05_1666008161657_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/ct255_05_1666008161657_0.pdf b/second/semester1/logseq-stuff/assets/ct255_05_1666008161657_0.pdf
new file mode 100644
index 00000000..39c3f0be
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/ct255_05_1666008161657_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/ct255_07_1667826292487_0.edn b/second/semester1/logseq-stuff/assets/ct255_07_1667826292487_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/ct255_07_1667826292487_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/ct255_07_1667826292487_0.pdf b/second/semester1/logseq-stuff/assets/ct255_07_1667826292487_0.pdf
new file mode 100644
index 00000000..97165de5
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/ct255_07_1667826292487_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/ct255_08_1668429069832_0.edn b/second/semester1/logseq-stuff/assets/ct255_08_1668429069832_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/ct255_08_1668429069832_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/ct255_08_1668429069832_0.pdf b/second/semester1/logseq-stuff/assets/ct255_08_1668429069832_0.pdf
new file mode 100644
index 00000000..640d4ce0
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/ct255_08_1668429069832_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/ct255_09_1668712193123_0.edn b/second/semester1/logseq-stuff/assets/ct255_09_1668712193123_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/ct255_09_1668712193123_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/ct255_09_1668712193123_0.pdf b/second/semester1/logseq-stuff/assets/ct255_09_1668712193123_0.pdf
new file mode 100644
index 00000000..4bd0399b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/ct255_09_1668712193123_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662811965440_0.png b/second/semester1/logseq-stuff/assets/image_1662811965440_0.png
new file mode 100644
index 00000000..1554458b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662811965440_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662819462897_0.png b/second/semester1/logseq-stuff/assets/image_1662819462897_0.png
new file mode 100644
index 00000000..77ab48f4
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662819462897_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662820020814_0.png b/second/semester1/logseq-stuff/assets/image_1662820020814_0.png
new file mode 100644
index 00000000..77ab48f4
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662820020814_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662820187995_0.png b/second/semester1/logseq-stuff/assets/image_1662820187995_0.png
new file mode 100644
index 00000000..286c792b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662820187995_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662829382080_0.png b/second/semester1/logseq-stuff/assets/image_1662829382080_0.png
new file mode 100644
index 00000000..12d17686
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662829382080_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662830400492_0.png b/second/semester1/logseq-stuff/assets/image_1662830400492_0.png
new file mode 100644
index 00000000..d20a4ea8
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662830400492_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662830846361_0.png b/second/semester1/logseq-stuff/assets/image_1662830846361_0.png
new file mode 100644
index 00000000..a4b7f2d3
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662830846361_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662837864357_0.png b/second/semester1/logseq-stuff/assets/image_1662837864357_0.png
new file mode 100644
index 00000000..5b778d78
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662837864357_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662989698764_0.png b/second/semester1/logseq-stuff/assets/image_1662989698764_0.png
new file mode 100644
index 00000000..09b9237c
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662989698764_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662991772859_0.png b/second/semester1/logseq-stuff/assets/image_1662991772859_0.png
new file mode 100644
index 00000000..4505a1d7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662991772859_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662992719528_0.png b/second/semester1/logseq-stuff/assets/image_1662992719528_0.png
new file mode 100644
index 00000000..dc36a305
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662992719528_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1662992825434_0.png b/second/semester1/logseq-stuff/assets/image_1662992825434_0.png
new file mode 100644
index 00000000..b61c561c
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1662992825434_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663005545935_0.png b/second/semester1/logseq-stuff/assets/image_1663005545935_0.png
new file mode 100644
index 00000000..823161f6
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663005545935_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663057796785_0.png b/second/semester1/logseq-stuff/assets/image_1663057796785_0.png
new file mode 100644
index 00000000..834977ee
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663057796785_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663063179688_0.png b/second/semester1/logseq-stuff/assets/image_1663063179688_0.png
new file mode 100644
index 00000000..4359d2b4
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663063179688_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663063508214_0.png b/second/semester1/logseq-stuff/assets/image_1663063508214_0.png
new file mode 100644
index 00000000..e3441c75
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663063508214_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663236210540_0.png b/second/semester1/logseq-stuff/assets/image_1663236210540_0.png
new file mode 100644
index 00000000..2d269da9
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663236210540_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663237164731_0.png b/second/semester1/logseq-stuff/assets/image_1663237164731_0.png
new file mode 100644
index 00000000..7c2aadd9
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663237164731_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663237245117_0.png b/second/semester1/logseq-stuff/assets/image_1663237245117_0.png
new file mode 100644
index 00000000..c572fc39
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663237245117_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663271062397_0.png b/second/semester1/logseq-stuff/assets/image_1663271062397_0.png
new file mode 100644
index 00000000..14f6a9fa
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663271062397_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663456127205_0.png b/second/semester1/logseq-stuff/assets/image_1663456127205_0.png
new file mode 100644
index 00000000..d34b91f0
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663456127205_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663459919021_0.png b/second/semester1/logseq-stuff/assets/image_1663459919021_0.png
new file mode 100644
index 00000000..ecbf022d
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663459919021_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663488626792_0.png b/second/semester1/logseq-stuff/assets/image_1663488626792_0.png
new file mode 100644
index 00000000..70542d99
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663488626792_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663491286810_0.png b/second/semester1/logseq-stuff/assets/image_1663491286810_0.png
new file mode 100644
index 00000000..3e5a03ce
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663491286810_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663494147352_0.png b/second/semester1/logseq-stuff/assets/image_1663494147352_0.png
new file mode 100644
index 00000000..e39d67d4
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663494147352_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663494236099_0.png b/second/semester1/logseq-stuff/assets/image_1663494236099_0.png
new file mode 100644
index 00000000..0c2b9e32
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663494236099_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663494544463_0.png b/second/semester1/logseq-stuff/assets/image_1663494544463_0.png
new file mode 100644
index 00000000..0c2b9e32
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663494544463_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663494553173_0.png b/second/semester1/logseq-stuff/assets/image_1663494553173_0.png
new file mode 100644
index 00000000..0c2b9e32
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663494553173_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663500888551_0.png b/second/semester1/logseq-stuff/assets/image_1663500888551_0.png
new file mode 100644
index 00000000..1d8cc5ae
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663500888551_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663501467907_0.png b/second/semester1/logseq-stuff/assets/image_1663501467907_0.png
new file mode 100644
index 00000000..d7dcb9b2
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663501467907_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663501773385_0.png b/second/semester1/logseq-stuff/assets/image_1663501773385_0.png
new file mode 100644
index 00000000..ff37ea52
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663501773385_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663504895182_0.png b/second/semester1/logseq-stuff/assets/image_1663504895182_0.png
new file mode 100644
index 00000000..c79cf811
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663504895182_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663504922118_0.png b/second/semester1/logseq-stuff/assets/image_1663504922118_0.png
new file mode 100644
index 00000000..cd7af89f
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663504922118_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663586535352_0.png b/second/semester1/logseq-stuff/assets/image_1663586535352_0.png
new file mode 100644
index 00000000..ef99d1cc
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663586535352_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663745526135_0.png b/second/semester1/logseq-stuff/assets/image_1663745526135_0.png
new file mode 100644
index 00000000..e92c1803
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663745526135_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663751328603_0.png b/second/semester1/logseq-stuff/assets/image_1663751328603_0.png
new file mode 100644
index 00000000..75cae595
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663751328603_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663751601406_0.png b/second/semester1/logseq-stuff/assets/image_1663751601406_0.png
new file mode 100644
index 00000000..75cae595
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663751601406_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663751709631_0.png b/second/semester1/logseq-stuff/assets/image_1663751709631_0.png
new file mode 100644
index 00000000..c2e2557f
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663751709631_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663833948956_0.png b/second/semester1/logseq-stuff/assets/image_1663833948956_0.png
new file mode 100644
index 00000000..99be2ba9
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663833948956_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663834185000_0.png b/second/semester1/logseq-stuff/assets/image_1663834185000_0.png
new file mode 100644
index 00000000..1cd65ac9
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663834185000_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1663942604788_0.png b/second/semester1/logseq-stuff/assets/image_1663942604788_0.png
new file mode 100644
index 00000000..0f75bdb7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1663942604788_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664197421384_0.png b/second/semester1/logseq-stuff/assets/image_1664197421384_0.png
new file mode 100644
index 00000000..a2166e8e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664197421384_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664197699342_0.png b/second/semester1/logseq-stuff/assets/image_1664197699342_0.png
new file mode 100644
index 00000000..0a674024
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664197699342_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664199064013_0.png b/second/semester1/logseq-stuff/assets/image_1664199064013_0.png
new file mode 100644
index 00000000..4e5224b6
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664199064013_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664199424570_0.png b/second/semester1/logseq-stuff/assets/image_1664199424570_0.png
new file mode 100644
index 00000000..5dc60740
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664199424570_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664199491346_0.png b/second/semester1/logseq-stuff/assets/image_1664199491346_0.png
new file mode 100644
index 00000000..fe87350a
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664199491346_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664199613805_0.png b/second/semester1/logseq-stuff/assets/image_1664199613805_0.png
new file mode 100644
index 00000000..a569d16d
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664199613805_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664209742517_0.png b/second/semester1/logseq-stuff/assets/image_1664209742517_0.png
new file mode 100644
index 00000000..e9e802a5
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664209742517_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664275471660_0.png b/second/semester1/logseq-stuff/assets/image_1664275471660_0.png
new file mode 100644
index 00000000..c5580e5d
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664275471660_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664366784504_0.png b/second/semester1/logseq-stuff/assets/image_1664366784504_0.png
new file mode 100644
index 00000000..77d26715
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664366784504_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664439564890_0.png b/second/semester1/logseq-stuff/assets/image_1664439564890_0.png
new file mode 100644
index 00000000..43e4c07c
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664439564890_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664799869963_0.png b/second/semester1/logseq-stuff/assets/image_1664799869963_0.png
new file mode 100644
index 00000000..11be6e67
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664799869963_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664800188644_0.png b/second/semester1/logseq-stuff/assets/image_1664800188644_0.png
new file mode 100644
index 00000000..a0b0929b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664800188644_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664889325926_0.png b/second/semester1/logseq-stuff/assets/image_1664889325926_0.png
new file mode 100644
index 00000000..46190115
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664889325926_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664889343582_0.png b/second/semester1/logseq-stuff/assets/image_1664889343582_0.png
new file mode 100644
index 00000000..f77cd38a
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664889343582_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664889461415_0.png b/second/semester1/logseq-stuff/assets/image_1664889461415_0.png
new file mode 100644
index 00000000..30b48ba3
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664889461415_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664889737597_0.png b/second/semester1/logseq-stuff/assets/image_1664889737597_0.png
new file mode 100644
index 00000000..0129365a
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664889737597_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664889775094_0.png b/second/semester1/logseq-stuff/assets/image_1664889775094_0.png
new file mode 100644
index 00000000..fb1aa5b8
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664889775094_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664890028074_0.png b/second/semester1/logseq-stuff/assets/image_1664890028074_0.png
new file mode 100644
index 00000000..c12a9ba2
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664890028074_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664890159607_0.png b/second/semester1/logseq-stuff/assets/image_1664890159607_0.png
new file mode 100644
index 00000000..4cc5228b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664890159607_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664890167971_0.png b/second/semester1/logseq-stuff/assets/image_1664890167971_0.png
new file mode 100644
index 00000000..4cc5228b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664890167971_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664890277505_0.png b/second/semester1/logseq-stuff/assets/image_1664890277505_0.png
new file mode 100644
index 00000000..f1eba5b7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664890277505_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664890907305_0.png b/second/semester1/logseq-stuff/assets/image_1664890907305_0.png
new file mode 100644
index 00000000..80dbdc7a
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664890907305_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664968200677_0.png b/second/semester1/logseq-stuff/assets/image_1664968200677_0.png
new file mode 100644
index 00000000..f1c24eaf
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664968200677_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664968259633_0.png b/second/semester1/logseq-stuff/assets/image_1664968259633_0.png
new file mode 100644
index 00000000..3d5789bb
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664968259633_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664968387620_0.png b/second/semester1/logseq-stuff/assets/image_1664968387620_0.png
new file mode 100644
index 00000000..03b4ff1d
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664968387620_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664969067049_0.png b/second/semester1/logseq-stuff/assets/image_1664969067049_0.png
new file mode 100644
index 00000000..b66a98d5
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664969067049_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664969168410_0.png b/second/semester1/logseq-stuff/assets/image_1664969168410_0.png
new file mode 100644
index 00000000..b1089382
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664969168410_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664969357926_0.png b/second/semester1/logseq-stuff/assets/image_1664969357926_0.png
new file mode 100644
index 00000000..1b711b58
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664969357926_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664969566989_0.png b/second/semester1/logseq-stuff/assets/image_1664969566989_0.png
new file mode 100644
index 00000000..10730557
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664969566989_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1664978282949_0.png b/second/semester1/logseq-stuff/assets/image_1664978282949_0.png
new file mode 100644
index 00000000..015748bf
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1664978282949_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665133543483_0.png b/second/semester1/logseq-stuff/assets/image_1665133543483_0.png
new file mode 100644
index 00000000..d66a3bad
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665133543483_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665408592493_0.png b/second/semester1/logseq-stuff/assets/image_1665408592493_0.png
new file mode 100644
index 00000000..750ae917
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665408592493_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665408998543_0.png b/second/semester1/logseq-stuff/assets/image_1665408998543_0.png
new file mode 100644
index 00000000..27616f05
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665408998543_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665409357957_0.png b/second/semester1/logseq-stuff/assets/image_1665409357957_0.png
new file mode 100644
index 00000000..32b44d5f
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665409357957_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665411940127_0.png b/second/semester1/logseq-stuff/assets/image_1665411940127_0.png
new file mode 100644
index 00000000..de02b7ee
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665411940127_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665412210604_0.png b/second/semester1/logseq-stuff/assets/image_1665412210604_0.png
new file mode 100644
index 00000000..5c6be7fa
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665412210604_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665655597308_0.png b/second/semester1/logseq-stuff/assets/image_1665655597308_0.png
new file mode 100644
index 00000000..66938a4e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665655597308_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665656325639_0.png b/second/semester1/logseq-stuff/assets/image_1665656325639_0.png
new file mode 100644
index 00000000..66938a4e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665656325639_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665656352371_0.png b/second/semester1/logseq-stuff/assets/image_1665656352371_0.png
new file mode 100644
index 00000000..66938a4e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665656352371_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665656362242_0.png b/second/semester1/logseq-stuff/assets/image_1665656362242_0.png
new file mode 100644
index 00000000..66938a4e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665656362242_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665656431162_0.png b/second/semester1/logseq-stuff/assets/image_1665656431162_0.png
new file mode 100644
index 00000000..af2bfd75
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665656431162_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665656481794_0.png b/second/semester1/logseq-stuff/assets/image_1665656481794_0.png
new file mode 100644
index 00000000..bcd98663
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665656481794_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665656707958_0.png b/second/semester1/logseq-stuff/assets/image_1665656707958_0.png
new file mode 100644
index 00000000..4301094e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665656707958_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1665657089191_0.png b/second/semester1/logseq-stuff/assets/image_1665657089191_0.png
new file mode 100644
index 00000000..9820c5b0
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1665657089191_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666178440078_0.png b/second/semester1/logseq-stuff/assets/image_1666178440078_0.png
new file mode 100644
index 00000000..16b9a315
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666178440078_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666183748304_0.png b/second/semester1/logseq-stuff/assets/image_1666183748304_0.png
new file mode 100644
index 00000000..bb5fa2b7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666183748304_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666260304759_0.png b/second/semester1/logseq-stuff/assets/image_1666260304759_0.png
new file mode 100644
index 00000000..94ff5834
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666260304759_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666260339357_0.png b/second/semester1/logseq-stuff/assets/image_1666260339357_0.png
new file mode 100644
index 00000000..3adebae7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666260339357_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666260376811_0.png b/second/semester1/logseq-stuff/assets/image_1666260376811_0.png
new file mode 100644
index 00000000..65672723
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666260376811_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666260397597_0.png b/second/semester1/logseq-stuff/assets/image_1666260397597_0.png
new file mode 100644
index 00000000..6143ff62
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666260397597_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666260421397_0.png b/second/semester1/logseq-stuff/assets/image_1666260421397_0.png
new file mode 100644
index 00000000..9f1b4c78
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666260421397_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666260436611_0.png b/second/semester1/logseq-stuff/assets/image_1666260436611_0.png
new file mode 100644
index 00000000..99e64e4b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666260436611_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666346387818_0.png b/second/semester1/logseq-stuff/assets/image_1666346387818_0.png
new file mode 100644
index 00000000..d8ab5de7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666346387818_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666614334301_0.png b/second/semester1/logseq-stuff/assets/image_1666614334301_0.png
new file mode 100644
index 00000000..6099dbdb
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666614334301_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666615503819_0.png b/second/semester1/logseq-stuff/assets/image_1666615503819_0.png
new file mode 100644
index 00000000..c8a19772
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666615503819_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666617361777_0.png b/second/semester1/logseq-stuff/assets/image_1666617361777_0.png
new file mode 100644
index 00000000..a7bb6e11
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666617361777_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1666951300835_0.png b/second/semester1/logseq-stuff/assets/image_1666951300835_0.png
new file mode 100644
index 00000000..a2ea84fe
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1666951300835_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667808692354_0.png b/second/semester1/logseq-stuff/assets/image_1667808692354_0.png
new file mode 100644
index 00000000..2b7aa271
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667808692354_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667809354147_0.png b/second/semester1/logseq-stuff/assets/image_1667809354147_0.png
new file mode 100644
index 00000000..59eb50b8
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667809354147_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667809510030_0.png b/second/semester1/logseq-stuff/assets/image_1667809510030_0.png
new file mode 100644
index 00000000..897b309c
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667809510030_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667814474478_0.png b/second/semester1/logseq-stuff/assets/image_1667814474478_0.png
new file mode 100644
index 00000000..806e66d8
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667814474478_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667822368192_0.png b/second/semester1/logseq-stuff/assets/image_1667822368192_0.png
new file mode 100644
index 00000000..d2399c1b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667822368192_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667824994941_0.png b/second/semester1/logseq-stuff/assets/image_1667824994941_0.png
new file mode 100644
index 00000000..9ce48a70
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667824994941_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667828493859_0.png b/second/semester1/logseq-stuff/assets/image_1667828493859_0.png
new file mode 100644
index 00000000..663c563b
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667828493859_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667835066957_0.png b/second/semester1/logseq-stuff/assets/image_1667835066957_0.png
new file mode 100644
index 00000000..5ef4d85e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667835066957_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667835934573_0.png b/second/semester1/logseq-stuff/assets/image_1667835934573_0.png
new file mode 100644
index 00000000..212e992d
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667835934573_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667917791219_0.png b/second/semester1/logseq-stuff/assets/image_1667917791219_0.png
new file mode 100644
index 00000000..a1255089
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667917791219_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667928018973_0.png b/second/semester1/logseq-stuff/assets/image_1667928018973_0.png
new file mode 100644
index 00000000..3a354343
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667928018973_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667928043357_0.png b/second/semester1/logseq-stuff/assets/image_1667928043357_0.png
new file mode 100644
index 00000000..15566b02
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667928043357_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1667928165364_0.png b/second/semester1/logseq-stuff/assets/image_1667928165364_0.png
new file mode 100644
index 00000000..747593f3
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1667928165364_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668111313285_0.png b/second/semester1/logseq-stuff/assets/image_1668111313285_0.png
new file mode 100644
index 00000000..9950e96e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668111313285_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668153745659_0.png b/second/semester1/logseq-stuff/assets/image_1668153745659_0.png
new file mode 100644
index 00000000..defdfe6c
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668153745659_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668164848583_0.png b/second/semester1/logseq-stuff/assets/image_1668164848583_0.png
new file mode 100644
index 00000000..6dac69e1
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668164848583_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668165195209_0.png b/second/semester1/logseq-stuff/assets/image_1668165195209_0.png
new file mode 100644
index 00000000..ae187bec
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668165195209_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668431250725_0.png b/second/semester1/logseq-stuff/assets/image_1668431250725_0.png
new file mode 100644
index 00000000..03b87957
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668431250725_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668431388924_0.png b/second/semester1/logseq-stuff/assets/image_1668431388924_0.png
new file mode 100644
index 00000000..a83e9afa
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668431388924_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668431515541_0.png b/second/semester1/logseq-stuff/assets/image_1668431515541_0.png
new file mode 100644
index 00000000..14ee8e12
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668431515541_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668431596578_0.png b/second/semester1/logseq-stuff/assets/image_1668431596578_0.png
new file mode 100644
index 00000000..a62145e3
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668431596578_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668432986453_0.png b/second/semester1/logseq-stuff/assets/image_1668432986453_0.png
new file mode 100644
index 00000000..0ec36d09
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668432986453_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668433058620_0.png b/second/semester1/logseq-stuff/assets/image_1668433058620_0.png
new file mode 100644
index 00000000..032c3b77
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668433058620_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668439625225_0.png b/second/semester1/logseq-stuff/assets/image_1668439625225_0.png
new file mode 100644
index 00000000..83d3f238
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668439625225_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668440272307_0.png b/second/semester1/logseq-stuff/assets/image_1668440272307_0.png
new file mode 100644
index 00000000..0f1fe368
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668440272307_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668440350590_0.png b/second/semester1/logseq-stuff/assets/image_1668440350590_0.png
new file mode 100644
index 00000000..ca62f606
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668440350590_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668440540052_0.png b/second/semester1/logseq-stuff/assets/image_1668440540052_0.png
new file mode 100644
index 00000000..253b9b7c
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668440540052_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668602284161_0.png b/second/semester1/logseq-stuff/assets/image_1668602284161_0.png
new file mode 100644
index 00000000..7db7b187
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668602284161_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668683655403_0.png b/second/semester1/logseq-stuff/assets/image_1668683655403_0.png
new file mode 100644
index 00000000..2ecc66e7
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668683655403_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668683691530_0.png b/second/semester1/logseq-stuff/assets/image_1668683691530_0.png
new file mode 100644
index 00000000..de4e60e6
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668683691530_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668683714985_0.png b/second/semester1/logseq-stuff/assets/image_1668683714985_0.png
new file mode 100644
index 00000000..ff32c9d5
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668683714985_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668684641221_0.png b/second/semester1/logseq-stuff/assets/image_1668684641221_0.png
new file mode 100644
index 00000000..8363a19a
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668684641221_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1668690700546_0.png b/second/semester1/logseq-stuff/assets/image_1668690700546_0.png
new file mode 100644
index 00000000..3269ac9e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1668690700546_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/image_1669209153547_0.png b/second/semester1/logseq-stuff/assets/image_1669209153547_0.png
new file mode 100644
index 00000000..1d76b5c3
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/image_1669209153547_0.png differ
diff --git a/second/semester1/logseq-stuff/assets/normalisation_2022_part1_1666176964798_0.pdf b/second/semester1/logseq-stuff/assets/normalisation_2022_part1_1666176964798_0.pdf
new file mode 100644
index 00000000..6758075e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/normalisation_2022_part1_1666176964798_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/normalisation_2022_part1_1666177004532_0.edn b/second/semester1/logseq-stuff/assets/normalisation_2022_part1_1666177004532_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/normalisation_2022_part1_1666177004532_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/normalisation_2022_part1_1666177004532_0.pdf b/second/semester1/logseq-stuff/assets/normalisation_2022_part1_1666177004532_0.pdf
new file mode 100644
index 00000000..6758075e
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/normalisation_2022_part1_1666177004532_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/normalisation_2022_part2_1666776016494_0.edn b/second/semester1/logseq-stuff/assets/normalisation_2022_part2_1666776016494_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/normalisation_2022_part2_1666776016494_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/normalisation_2022_part2_1666776016494_0.pdf b/second/semester1/logseq-stuff/assets/normalisation_2022_part2_1666776016494_0.pdf
new file mode 100644
index 00000000..7cd7158c
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/normalisation_2022_part2_1666776016494_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/queryProcRelAlgebra_1667899219134_0.edn b/second/semester1/logseq-stuff/assets/queryProcRelAlgebra_1667899219134_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/queryProcRelAlgebra_1667899219134_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/queryProcRelAlgebra_1667899219134_0.pdf b/second/semester1/logseq-stuff/assets/queryProcRelAlgebra_1667899219134_0.pdf
new file mode 100644
index 00000000..6a1c9a72
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/queryProcRelAlgebra_1667899219134_0.pdf differ
diff --git a/second/semester1/logseq-stuff/assets/queryProcessing_and_Optimisation_1667916524592_0.edn b/second/semester1/logseq-stuff/assets/queryProcessing_and_Optimisation_1667916524592_0.edn
new file mode 100644
index 00000000..11baae5d
--- /dev/null
+++ b/second/semester1/logseq-stuff/assets/queryProcessing_and_Optimisation_1667916524592_0.edn
@@ -0,0 +1 @@
+{:highlights []}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/assets/queryProcessing_and_Optimisation_1667916524592_0.pdf b/second/semester1/logseq-stuff/assets/queryProcessing_and_Optimisation_1667916524592_0.pdf
new file mode 100644
index 00000000..51c840df
Binary files /dev/null and b/second/semester1/logseq-stuff/assets/queryProcessing_and_Optimisation_1667916524592_0.pdf differ
diff --git a/second/semester1/logseq-stuff/draws/2022-10-28-10-59-13.excalidraw b/second/semester1/logseq-stuff/draws/2022-10-28-10-59-13.excalidraw
new file mode 100644
index 00000000..cfa7d78c
--- /dev/null
+++ b/second/semester1/logseq-stuff/draws/2022-10-28-10-59-13.excalidraw
@@ -0,0 +1,343 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "file://",
+ "elements": [
+ {
+ "id": "OC4sYhSC3DRPspujCKMrT",
+ "type": "freedraw",
+ "x": 307.8125,
+ "y": 220.796875,
+ "width": 89,
+ "height": 22,
+ "angle": 0,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "seed": 554465363,
+ "version": 23,
+ "versionNonce": 1606201907,
+ "isDeleted": false,
+ "boundElements": null,
+ "updated": 1666951160509,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 4,
+ -2
+ ],
+ [
+ 9,
+ -3
+ ],
+ [
+ 13,
+ -4
+ ],
+ [
+ 20,
+ -5
+ ],
+ [
+ 22,
+ -6
+ ],
+ [
+ 23,
+ -6
+ ],
+ [
+ 24,
+ -6
+ ],
+ [
+ 32,
+ -8
+ ],
+ [
+ 44,
+ -11
+ ],
+ [
+ 59,
+ -15
+ ],
+ [
+ 78,
+ -19
+ ],
+ [
+ 83,
+ -21
+ ],
+ [
+ 88,
+ -22
+ ],
+ [
+ 89,
+ -22
+ ],
+ [
+ 89,
+ -21
+ ],
+ [
+ 88,
+ -21
+ ],
+ [
+ 87,
+ -21
+ ],
+ [
+ 86,
+ -21
+ ],
+ [
+ 85,
+ -21
+ ],
+ [
+ 85,
+ -20
+ ],
+ [
+ 85,
+ -20
+ ]
+ ],
+ "pressures": [],
+ "simulatePressure": true,
+ "lastCommittedPoint": [
+ 85,
+ -20
+ ]
+ },
+ {
+ "id": "UZOHSc_ECqyweMQsOCNMO",
+ "type": "freedraw",
+ "x": 196.8125,
+ "y": 134.796875,
+ "width": 38,
+ "height": 41,
+ "angle": 0,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "seed": 222625405,
+ "version": 46,
+ "versionNonce": 294171539,
+ "isDeleted": false,
+ "boundElements": null,
+ "updated": 1666951162863,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 1
+ ],
+ [
+ 0,
+ 4
+ ],
+ [
+ 0,
+ 8
+ ],
+ [
+ 1,
+ 11
+ ],
+ [
+ 6,
+ 17
+ ],
+ [
+ 9,
+ 18
+ ],
+ [
+ 13,
+ 20
+ ],
+ [
+ 16,
+ 21
+ ],
+ [
+ 18,
+ 21
+ ],
+ [
+ 22,
+ 18
+ ],
+ [
+ 24,
+ 18
+ ],
+ [
+ 27,
+ 15
+ ],
+ [
+ 29,
+ 13
+ ],
+ [
+ 30,
+ 12
+ ],
+ [
+ 31,
+ 11
+ ],
+ [
+ 33,
+ 10
+ ],
+ [
+ 34,
+ 9
+ ],
+ [
+ 36,
+ 5
+ ],
+ [
+ 37,
+ 1
+ ],
+ [
+ 38,
+ -4
+ ],
+ [
+ 38,
+ -7
+ ],
+ [
+ 38,
+ -10
+ ],
+ [
+ 36,
+ -12
+ ],
+ [
+ 32,
+ -15
+ ],
+ [
+ 27,
+ -18
+ ],
+ [
+ 22,
+ -20
+ ],
+ [
+ 15,
+ -20
+ ],
+ [
+ 12,
+ -18
+ ],
+ [
+ 9,
+ -17
+ ],
+ [
+ 7,
+ -16
+ ],
+ [
+ 7,
+ -14
+ ],
+ [
+ 6,
+ -12
+ ],
+ [
+ 5,
+ -11
+ ],
+ [
+ 4,
+ -10
+ ],
+ [
+ 4,
+ -9
+ ],
+ [
+ 3,
+ -8
+ ],
+ [
+ 3,
+ -7
+ ],
+ [
+ 3,
+ -6
+ ],
+ [
+ 3,
+ -5
+ ],
+ [
+ 4,
+ -4
+ ],
+ [
+ 5,
+ -2
+ ],
+ [
+ 5,
+ -1
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "pressures": [],
+ "simulatePressure": true,
+ "lastCommittedPoint": [
+ 5,
+ -1
+ ]
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#FFF"
+ }
+}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/draws/2022-10-28-10-59-33.excalidraw b/second/semester1/logseq-stuff/draws/2022-10-28-10-59-33.excalidraw
new file mode 100644
index 00000000..a50a4044
--- /dev/null
+++ b/second/semester1/logseq-stuff/draws/2022-10-28-10-59-33.excalidraw
@@ -0,0 +1,63 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "file://",
+ "elements": [
+ {
+ "id": "B1s-qHdOhQUcvlmqUpDzq",
+ "type": "ellipse",
+ "x": 196.8125,
+ "y": 97.796875,
+ "width": 46,
+ "height": 42,
+ "angle": 0,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "seed": 603113779,
+ "version": 61,
+ "versionNonce": 1129897459,
+ "isDeleted": false,
+ "boundElements": null,
+ "updated": 1666951179359,
+ "link": null,
+ "locked": false
+ },
+ {
+ "id": "dY0flLVm0mSzNB_uzsmOn",
+ "type": "ellipse",
+ "x": 340.8125,
+ "y": 107.796875,
+ "width": 59,
+ "height": 58,
+ "angle": 0,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "seed": 184715293,
+ "version": 46,
+ "versionNonce": 945916915,
+ "isDeleted": false,
+ "boundElements": null,
+ "updated": 1666951185540,
+ "link": null,
+ "locked": false
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#FFF"
+ }
+}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/draws/2022-10-28-11-04-05.excalidraw b/second/semester1/logseq-stuff/draws/2022-10-28-11-04-05.excalidraw
new file mode 100644
index 00000000..d424a0e0
--- /dev/null
+++ b/second/semester1/logseq-stuff/draws/2022-10-28-11-04-05.excalidraw
@@ -0,0 +1,3921 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "file://",
+ "elements": [
+ {
+ "type": "ellipse",
+ "version": 53,
+ "versionNonce": 1818893619,
+ "isDeleted": false,
+ "id": "Ola4dz3PdvKp0K46hoX5_",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 204.8125,
+ "y": -1756.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 36,
+ "height": 35,
+ "seed": 1687240509,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 73,
+ "versionNonce": 2092417917,
+ "isDeleted": false,
+ "id": "9OsOaiiGL--t-xmlIrD_S",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 161.8125,
+ "y": -1657.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 25,
+ "height": 29,
+ "seed": 539022205,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 116,
+ "versionNonce": 506855123,
+ "isDeleted": false,
+ "id": "arnjzo5sjumfFIdbBHjgE",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 221.8125,
+ "y": -1634.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 34,
+ "height": 32,
+ "seed": 1676320637,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 49,
+ "versionNonce": 122440669,
+ "isDeleted": false,
+ "id": "d62qiI1sIZpbzb6RMlnbq",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 288.8125,
+ "y": -1665.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 42,
+ "height": 39,
+ "seed": 335584605,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 44,
+ "versionNonce": 458534003,
+ "isDeleted": false,
+ "id": "TRbdzIJMlaEYeRBmOA_E7",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 203.8125,
+ "y": -1567.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 45,
+ "height": 35,
+ "seed": 1585753309,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "line",
+ "version": 43,
+ "versionNonce": 1928382525,
+ "isDeleted": false,
+ "id": "WwwyUvngbQ2cNMUnROQqx",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 216.8125,
+ "y": -1723.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 35,
+ "height": 72,
+ "seed": 1351806739,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -35,
+ 72
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 41,
+ "versionNonce": 126658067,
+ "isDeleted": false,
+ "id": "cU6iNn3AM6IDnBp-8_wgT",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 229.8125,
+ "y": -1721.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 8,
+ "height": 86,
+ "seed": 445664947,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 8,
+ 86
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 46,
+ "versionNonce": 25606301,
+ "isDeleted": false,
+ "id": "UaH-zmMDHlHtcYTMcMCtO",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 238.8125,
+ "y": -1734.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 65,
+ "height": 72,
+ "seed": 641927347,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 65,
+ 72
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 35,
+ "versionNonce": 1238657971,
+ "isDeleted": false,
+ "id": "A_utsEwp6kGp_5fas8Ha5",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 175.8125,
+ "y": -1628.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 38,
+ "height": 70,
+ "seed": 1570085565,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 38,
+ 70
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 61,
+ "versionNonce": 1019190525,
+ "isDeleted": false,
+ "id": "cRmUYcBg874_3JY-dNsPC",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 233.2663976870291,
+ "y": -1605.4203744186275,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 6.453897687029098,
+ "height": 42.40474941862749,
+ "seed": 710416285,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -6.453897687029098,
+ 42.40474941862749
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 52,
+ "versionNonce": 642940243,
+ "isDeleted": false,
+ "id": "JAF70GMh22UvAbBKp3RGA",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 308.8125,
+ "y": -1624.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 63,
+ "height": 57,
+ "seed": 2118793075,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -63,
+ 57
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 116,
+ "versionNonce": 1420183728,
+ "isDeleted": false,
+ "id": "uDzdur2XBcFc_KlI91l-n",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 338.8125,
+ "y": -1748.015625,
+ "strokeColor": "#c92a2a",
+ "backgroundColor": "transparent",
+ "width": 372.39959716796875,
+ "height": 25,
+ "seed": 277701299,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1701910600837,
+ "link": null,
+ "locked": false,
+ "fontSize": 20,
+ "fontFamily": 1,
+ "text": "Planar representation of above graph",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "Planar representation of above graph",
+ "lineHeight": 1.25,
+ "baseline": 18
+ },
+ {
+ "type": "freedraw",
+ "version": 174,
+ "versionNonce": 408771315,
+ "isDeleted": false,
+ "id": "izvKxJzi6JCp38U5i6li0",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 203.8125,
+ "y": -1671.015625,
+ "strokeColor": "#c92a2a",
+ "backgroundColor": "transparent",
+ "width": 30,
+ "height": 134,
+ "seed": 122937875,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 1,
+ -1
+ ],
+ [
+ 2,
+ -3
+ ],
+ [
+ 4,
+ -5
+ ],
+ [
+ 5,
+ -6
+ ],
+ [
+ 7,
+ -7
+ ],
+ [
+ 10,
+ -8
+ ],
+ [
+ 12,
+ -10
+ ],
+ [
+ 14,
+ -11
+ ],
+ [
+ 17,
+ -13
+ ],
+ [
+ 18,
+ -14
+ ],
+ [
+ 19,
+ -17
+ ],
+ [
+ 19,
+ -20
+ ],
+ [
+ 19,
+ -23
+ ],
+ [
+ 19,
+ -26
+ ],
+ [
+ 19,
+ -28
+ ],
+ [
+ 18,
+ -30
+ ],
+ [
+ 17,
+ -31
+ ],
+ [
+ 15,
+ -35
+ ],
+ [
+ 12,
+ -37
+ ],
+ [
+ 11,
+ -38
+ ],
+ [
+ 10,
+ -38
+ ],
+ [
+ 8,
+ -38
+ ],
+ [
+ 7,
+ -36
+ ],
+ [
+ 5,
+ -32
+ ],
+ [
+ 4,
+ -29
+ ],
+ [
+ 2,
+ -24
+ ],
+ [
+ 1,
+ -15
+ ],
+ [
+ 1,
+ -12
+ ],
+ [
+ -1,
+ -2
+ ],
+ [
+ -2,
+ 0
+ ],
+ [
+ -4,
+ 7
+ ],
+ [
+ -5,
+ 10
+ ],
+ [
+ -5,
+ 14
+ ],
+ [
+ -5,
+ 19
+ ],
+ [
+ -5,
+ 22
+ ],
+ [
+ -5,
+ 24
+ ],
+ [
+ -2,
+ 24
+ ],
+ [
+ 1,
+ 23
+ ],
+ [
+ 4,
+ 21
+ ],
+ [
+ 8,
+ 16
+ ],
+ [
+ 10,
+ 14
+ ],
+ [
+ 11,
+ 14
+ ],
+ [
+ 10,
+ 15
+ ],
+ [
+ 8,
+ 18
+ ],
+ [
+ 5,
+ 23
+ ],
+ [
+ 2,
+ 28
+ ],
+ [
+ -2,
+ 35
+ ],
+ [
+ -4,
+ 37
+ ],
+ [
+ -8,
+ 42
+ ],
+ [
+ -8,
+ 43
+ ],
+ [
+ -7,
+ 42
+ ],
+ [
+ -5,
+ 39
+ ],
+ [
+ 0,
+ 32
+ ],
+ [
+ 5,
+ 25
+ ],
+ [
+ 10,
+ 17
+ ],
+ [
+ 13,
+ 12
+ ],
+ [
+ 15,
+ 10
+ ],
+ [
+ 16,
+ 10
+ ],
+ [
+ 17,
+ 8
+ ],
+ [
+ 18,
+ 8
+ ],
+ [
+ 19,
+ 6
+ ],
+ [
+ 20,
+ 3
+ ],
+ [
+ 21,
+ 1
+ ],
+ [
+ 22,
+ 1
+ ],
+ [
+ 21,
+ 4
+ ],
+ [
+ 16,
+ 12
+ ],
+ [
+ 12,
+ 17
+ ],
+ [
+ 9,
+ 21
+ ],
+ [
+ 7,
+ 25
+ ],
+ [
+ 4,
+ 30
+ ],
+ [
+ 1,
+ 35
+ ],
+ [
+ 0,
+ 37
+ ],
+ [
+ -2,
+ 39
+ ],
+ [
+ -2,
+ 40
+ ],
+ [
+ -2,
+ 42
+ ],
+ [
+ -2,
+ 46
+ ],
+ [
+ -2,
+ 47
+ ],
+ [
+ -2,
+ 50
+ ],
+ [
+ -2,
+ 51
+ ],
+ [
+ 2,
+ 45
+ ],
+ [
+ 6,
+ 38
+ ],
+ [
+ 10,
+ 33
+ ],
+ [
+ 12,
+ 29
+ ],
+ [
+ 13,
+ 28
+ ],
+ [
+ 14,
+ 28
+ ],
+ [
+ 15,
+ 28
+ ],
+ [
+ 16,
+ 28
+ ],
+ [
+ 16,
+ 32
+ ],
+ [
+ 17,
+ 34
+ ],
+ [
+ 17,
+ 36
+ ],
+ [
+ 15,
+ 40
+ ],
+ [
+ 13,
+ 44
+ ],
+ [
+ 10,
+ 47
+ ],
+ [
+ 7,
+ 51
+ ],
+ [
+ 5,
+ 52
+ ],
+ [
+ 5,
+ 54
+ ],
+ [
+ 5,
+ 55
+ ],
+ [
+ 5,
+ 56
+ ],
+ [
+ 6,
+ 55
+ ],
+ [
+ 8,
+ 53
+ ],
+ [
+ 9,
+ 52
+ ],
+ [
+ 10,
+ 52
+ ],
+ [
+ 10,
+ 51
+ ],
+ [
+ 11,
+ 52
+ ],
+ [
+ 11,
+ 55
+ ],
+ [
+ 11,
+ 57
+ ],
+ [
+ 11,
+ 59
+ ],
+ [
+ 10,
+ 60
+ ],
+ [
+ 9,
+ 64
+ ],
+ [
+ 8,
+ 66
+ ],
+ [
+ 8,
+ 69
+ ],
+ [
+ 7,
+ 73
+ ],
+ [
+ 8,
+ 72
+ ],
+ [
+ 9,
+ 72
+ ],
+ [
+ 10,
+ 72
+ ],
+ [
+ 11,
+ 72
+ ],
+ [
+ 13,
+ 71
+ ],
+ [
+ 15,
+ 71
+ ],
+ [
+ 16,
+ 70
+ ],
+ [
+ 18,
+ 70
+ ],
+ [
+ 21,
+ 72
+ ],
+ [
+ 21,
+ 75
+ ],
+ [
+ 22,
+ 80
+ ],
+ [
+ 22,
+ 83
+ ],
+ [
+ 22,
+ 85
+ ],
+ [
+ 22,
+ 89
+ ],
+ [
+ 22,
+ 92
+ ],
+ [
+ 21,
+ 94
+ ],
+ [
+ 21,
+ 96
+ ],
+ [
+ 19,
+ 95
+ ],
+ [
+ 16,
+ 94
+ ],
+ [
+ 13,
+ 92
+ ],
+ [
+ 12,
+ 91
+ ],
+ [
+ 8,
+ 90
+ ],
+ [
+ 7,
+ 89
+ ],
+ [
+ 1,
+ 83
+ ],
+ [
+ -1,
+ 80
+ ],
+ [
+ -4,
+ 76
+ ],
+ [
+ -4,
+ 74
+ ],
+ [
+ -4,
+ 71
+ ],
+ [
+ -4,
+ 66
+ ],
+ [
+ -4,
+ 63
+ ],
+ [
+ -4,
+ 61
+ ],
+ [
+ -4,
+ 60
+ ],
+ [
+ -3,
+ 59
+ ],
+ [
+ -2,
+ 57
+ ],
+ [
+ 1,
+ 54
+ ],
+ [
+ 2,
+ 52
+ ],
+ [
+ 2,
+ 51
+ ],
+ [
+ 3,
+ 51
+ ],
+ [
+ 3,
+ 50
+ ],
+ [
+ 3,
+ 49
+ ],
+ [
+ 4,
+ 45
+ ],
+ [
+ 4,
+ 39
+ ],
+ [
+ 5,
+ 34
+ ],
+ [
+ 7,
+ 31
+ ],
+ [
+ 8,
+ 29
+ ],
+ [
+ 9,
+ 27
+ ],
+ [
+ 10,
+ 26
+ ],
+ [
+ 11,
+ 25
+ ],
+ [
+ 12,
+ 23
+ ],
+ [
+ 12,
+ 19
+ ],
+ [
+ 12,
+ 16
+ ],
+ [
+ 11,
+ 11
+ ],
+ [
+ 9,
+ 8
+ ],
+ [
+ 8,
+ 6
+ ],
+ [
+ 6,
+ 3
+ ],
+ [
+ 6,
+ 1
+ ],
+ [
+ 6,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 199,
+ "versionNonce": 720388541,
+ "isDeleted": false,
+ "id": "7pN7FuMR7rOz72OUaUJC8",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 240.8125,
+ "y": -1714.015625,
+ "strokeColor": "#5f3dc4",
+ "backgroundColor": "transparent",
+ "width": 51,
+ "height": 120,
+ "seed": 862789853,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 1,
+ 0
+ ],
+ [
+ 2,
+ 1
+ ],
+ [
+ 3,
+ 4
+ ],
+ [
+ 3,
+ 8
+ ],
+ [
+ 3,
+ 9
+ ],
+ [
+ 3,
+ 14
+ ],
+ [
+ 2,
+ 17
+ ],
+ [
+ 1,
+ 20
+ ],
+ [
+ 0,
+ 23
+ ],
+ [
+ -2,
+ 28
+ ],
+ [
+ -2,
+ 29
+ ],
+ [
+ -2,
+ 30
+ ],
+ [
+ 0,
+ 28
+ ],
+ [
+ 1,
+ 26
+ ],
+ [
+ 3,
+ 24
+ ],
+ [
+ 4,
+ 23
+ ],
+ [
+ 6,
+ 23
+ ],
+ [
+ 10,
+ 23
+ ],
+ [
+ 12,
+ 23
+ ],
+ [
+ 13,
+ 23
+ ],
+ [
+ 15,
+ 23
+ ],
+ [
+ 16,
+ 23
+ ],
+ [
+ 17,
+ 23
+ ],
+ [
+ 17,
+ 25
+ ],
+ [
+ 17,
+ 28
+ ],
+ [
+ 14,
+ 34
+ ],
+ [
+ 12,
+ 38
+ ],
+ [
+ 11,
+ 38
+ ],
+ [
+ 10,
+ 41
+ ],
+ [
+ 9,
+ 43
+ ],
+ [
+ 8,
+ 45
+ ],
+ [
+ 9,
+ 44
+ ],
+ [
+ 14,
+ 39
+ ],
+ [
+ 16,
+ 38
+ ],
+ [
+ 19,
+ 38
+ ],
+ [
+ 21,
+ 38
+ ],
+ [
+ 24,
+ 38
+ ],
+ [
+ 29,
+ 38
+ ],
+ [
+ 33,
+ 38
+ ],
+ [
+ 36,
+ 38
+ ],
+ [
+ 37,
+ 39
+ ],
+ [
+ 40,
+ 44
+ ],
+ [
+ 40,
+ 47
+ ],
+ [
+ 40,
+ 49
+ ],
+ [
+ 38,
+ 55
+ ],
+ [
+ 36,
+ 58
+ ],
+ [
+ 33,
+ 61
+ ],
+ [
+ 32,
+ 62
+ ],
+ [
+ 31,
+ 63
+ ],
+ [
+ 31,
+ 64
+ ],
+ [
+ 29,
+ 65
+ ],
+ [
+ 28,
+ 66
+ ],
+ [
+ 28,
+ 67
+ ],
+ [
+ 28,
+ 65
+ ],
+ [
+ 30,
+ 62
+ ],
+ [
+ 31,
+ 60
+ ],
+ [
+ 34,
+ 60
+ ],
+ [
+ 38,
+ 60
+ ],
+ [
+ 42,
+ 59
+ ],
+ [
+ 45,
+ 59
+ ],
+ [
+ 48,
+ 62
+ ],
+ [
+ 49,
+ 65
+ ],
+ [
+ 49,
+ 68
+ ],
+ [
+ 48,
+ 70
+ ],
+ [
+ 46,
+ 73
+ ],
+ [
+ 43,
+ 75
+ ],
+ [
+ 40,
+ 78
+ ],
+ [
+ 39,
+ 79
+ ],
+ [
+ 38,
+ 79
+ ],
+ [
+ 37,
+ 80
+ ],
+ [
+ 35,
+ 82
+ ],
+ [
+ 33,
+ 84
+ ],
+ [
+ 31,
+ 84
+ ],
+ [
+ 31,
+ 85
+ ],
+ [
+ 31,
+ 86
+ ],
+ [
+ 31,
+ 87
+ ],
+ [
+ 31,
+ 88
+ ],
+ [
+ 35,
+ 91
+ ],
+ [
+ 39,
+ 95
+ ],
+ [
+ 40,
+ 98
+ ],
+ [
+ 42,
+ 100
+ ],
+ [
+ 42,
+ 104
+ ],
+ [
+ 42,
+ 105
+ ],
+ [
+ 41,
+ 106
+ ],
+ [
+ 39,
+ 108
+ ],
+ [
+ 36,
+ 111
+ ],
+ [
+ 33,
+ 115
+ ],
+ [
+ 28,
+ 119
+ ],
+ [
+ 27,
+ 119
+ ],
+ [
+ 25,
+ 120
+ ],
+ [
+ 24,
+ 120
+ ],
+ [
+ 23,
+ 120
+ ],
+ [
+ 21,
+ 120
+ ],
+ [
+ 20,
+ 120
+ ],
+ [
+ 19,
+ 120
+ ],
+ [
+ 18,
+ 119
+ ],
+ [
+ 17,
+ 118
+ ],
+ [
+ 16,
+ 111
+ ],
+ [
+ 17,
+ 100
+ ],
+ [
+ 19,
+ 83
+ ],
+ [
+ 22,
+ 66
+ ],
+ [
+ 23,
+ 64
+ ],
+ [
+ 24,
+ 62
+ ],
+ [
+ 22,
+ 58
+ ],
+ [
+ 19,
+ 55
+ ],
+ [
+ 17,
+ 54
+ ],
+ [
+ 16,
+ 54
+ ],
+ [
+ 15,
+ 57
+ ],
+ [
+ 15,
+ 61
+ ],
+ [
+ 15,
+ 63
+ ],
+ [
+ 15,
+ 65
+ ],
+ [
+ 15,
+ 67
+ ],
+ [
+ 16,
+ 68
+ ],
+ [
+ 17,
+ 73
+ ],
+ [
+ 17,
+ 78
+ ],
+ [
+ 18,
+ 82
+ ],
+ [
+ 18,
+ 83
+ ],
+ [
+ 15,
+ 81
+ ],
+ [
+ 13,
+ 76
+ ],
+ [
+ 13,
+ 75
+ ],
+ [
+ 13,
+ 72
+ ],
+ [
+ 13,
+ 69
+ ],
+ [
+ 16,
+ 68
+ ],
+ [
+ 21,
+ 68
+ ],
+ [
+ 24,
+ 68
+ ],
+ [
+ 28,
+ 70
+ ],
+ [
+ 31,
+ 73
+ ],
+ [
+ 33,
+ 74
+ ],
+ [
+ 36,
+ 77
+ ],
+ [
+ 37,
+ 78
+ ],
+ [
+ 38,
+ 79
+ ],
+ [
+ 39,
+ 81
+ ],
+ [
+ 39,
+ 82
+ ],
+ [
+ 40,
+ 80
+ ],
+ [
+ 42,
+ 76
+ ],
+ [
+ 43,
+ 71
+ ],
+ [
+ 43,
+ 63
+ ],
+ [
+ 42,
+ 60
+ ],
+ [
+ 40,
+ 58
+ ],
+ [
+ 37,
+ 57
+ ],
+ [
+ 34,
+ 57
+ ],
+ [
+ 34,
+ 58
+ ],
+ [
+ 34,
+ 63
+ ],
+ [
+ 34,
+ 67
+ ],
+ [
+ 34,
+ 71
+ ],
+ [
+ 34,
+ 75
+ ],
+ [
+ 34,
+ 78
+ ],
+ [
+ 34,
+ 80
+ ],
+ [
+ 34,
+ 81
+ ],
+ [
+ 33,
+ 81
+ ],
+ [
+ 32,
+ 79
+ ],
+ [
+ 31,
+ 78
+ ],
+ [
+ 31,
+ 78
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 524,
+ "versionNonce": 1820034195,
+ "isDeleted": false,
+ "id": "m0KuxOh4leXRpFDPz1RpH",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 199.8125,
+ "y": -1774.015625,
+ "strokeColor": "#087f5b",
+ "backgroundColor": "transparent",
+ "width": 257,
+ "height": 300,
+ "seed": 301892755,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -3,
+ 4
+ ],
+ [
+ -7,
+ 8
+ ],
+ [
+ -14,
+ 13
+ ],
+ [
+ -20,
+ 17
+ ],
+ [
+ -25,
+ 19
+ ],
+ [
+ -28,
+ 21
+ ],
+ [
+ -31,
+ 22
+ ],
+ [
+ -33,
+ 25
+ ],
+ [
+ -33,
+ 26
+ ],
+ [
+ -33,
+ 27
+ ],
+ [
+ -33,
+ 29
+ ],
+ [
+ -30,
+ 29
+ ],
+ [
+ -27,
+ 29
+ ],
+ [
+ -24,
+ 29
+ ],
+ [
+ -21,
+ 30
+ ],
+ [
+ -18,
+ 32
+ ],
+ [
+ -18,
+ 35
+ ],
+ [
+ -18,
+ 36
+ ],
+ [
+ -18,
+ 38
+ ],
+ [
+ -19,
+ 40
+ ],
+ [
+ -22,
+ 43
+ ],
+ [
+ -24,
+ 45
+ ],
+ [
+ -25,
+ 45
+ ],
+ [
+ -26,
+ 46
+ ],
+ [
+ -27,
+ 49
+ ],
+ [
+ -28,
+ 52
+ ],
+ [
+ -30,
+ 55
+ ],
+ [
+ -31,
+ 58
+ ],
+ [
+ -33,
+ 60
+ ],
+ [
+ -34,
+ 65
+ ],
+ [
+ -40,
+ 73
+ ],
+ [
+ -46,
+ 84
+ ],
+ [
+ -51,
+ 92
+ ],
+ [
+ -53,
+ 95
+ ],
+ [
+ -54,
+ 95
+ ],
+ [
+ -55,
+ 94
+ ],
+ [
+ -56,
+ 93
+ ],
+ [
+ -59,
+ 90
+ ],
+ [
+ -60,
+ 88
+ ],
+ [
+ -61,
+ 85
+ ],
+ [
+ -61,
+ 84
+ ],
+ [
+ -62,
+ 85
+ ],
+ [
+ -62,
+ 87
+ ],
+ [
+ -62,
+ 89
+ ],
+ [
+ -62,
+ 90
+ ],
+ [
+ -63,
+ 91
+ ],
+ [
+ -63,
+ 94
+ ],
+ [
+ -64,
+ 100
+ ],
+ [
+ -65,
+ 108
+ ],
+ [
+ -67,
+ 116
+ ],
+ [
+ -68,
+ 117
+ ],
+ [
+ -68,
+ 119
+ ],
+ [
+ -68,
+ 120
+ ],
+ [
+ -69,
+ 120
+ ],
+ [
+ -72,
+ 117
+ ],
+ [
+ -73,
+ 115
+ ],
+ [
+ -72,
+ 115
+ ],
+ [
+ -71,
+ 116
+ ],
+ [
+ -71,
+ 117
+ ],
+ [
+ -71,
+ 118
+ ],
+ [
+ -71,
+ 121
+ ],
+ [
+ -75,
+ 131
+ ],
+ [
+ -83,
+ 142
+ ],
+ [
+ -84,
+ 145
+ ],
+ [
+ -84,
+ 146
+ ],
+ [
+ -84,
+ 147
+ ],
+ [
+ -81,
+ 147
+ ],
+ [
+ -77,
+ 147
+ ],
+ [
+ -74,
+ 149
+ ],
+ [
+ -72,
+ 150
+ ],
+ [
+ -71,
+ 151
+ ],
+ [
+ -70,
+ 152
+ ],
+ [
+ -67,
+ 155
+ ],
+ [
+ -62,
+ 160
+ ],
+ [
+ -60,
+ 163
+ ],
+ [
+ -56,
+ 171
+ ],
+ [
+ -55,
+ 174
+ ],
+ [
+ -55,
+ 175
+ ],
+ [
+ -55,
+ 177
+ ],
+ [
+ -55,
+ 180
+ ],
+ [
+ -55,
+ 181
+ ],
+ [
+ -54,
+ 185
+ ],
+ [
+ -58,
+ 203
+ ],
+ [
+ -62,
+ 215
+ ],
+ [
+ -64,
+ 223
+ ],
+ [
+ -64,
+ 225
+ ],
+ [
+ -63,
+ 225
+ ],
+ [
+ -62,
+ 225
+ ],
+ [
+ -59,
+ 225
+ ],
+ [
+ -57,
+ 224
+ ],
+ [
+ -50,
+ 225
+ ],
+ [
+ -43,
+ 229
+ ],
+ [
+ -37,
+ 236
+ ],
+ [
+ -32,
+ 242
+ ],
+ [
+ -29,
+ 247
+ ],
+ [
+ -28,
+ 247
+ ],
+ [
+ -27,
+ 247
+ ],
+ [
+ -22,
+ 251
+ ],
+ [
+ -17,
+ 256
+ ],
+ [
+ -12,
+ 260
+ ],
+ [
+ -10,
+ 262
+ ],
+ [
+ -9,
+ 262
+ ],
+ [
+ -7,
+ 264
+ ],
+ [
+ -4,
+ 266
+ ],
+ [
+ -2,
+ 268
+ ],
+ [
+ -1,
+ 269
+ ],
+ [
+ 0,
+ 270
+ ],
+ [
+ 0,
+ 271
+ ],
+ [
+ 2,
+ 275
+ ],
+ [
+ 3,
+ 280
+ ],
+ [
+ 5,
+ 284
+ ],
+ [
+ 6,
+ 286
+ ],
+ [
+ 7,
+ 286
+ ],
+ [
+ 7,
+ 285
+ ],
+ [
+ 9,
+ 282
+ ],
+ [
+ 13,
+ 277
+ ],
+ [
+ 18,
+ 274
+ ],
+ [
+ 23,
+ 274
+ ],
+ [
+ 28,
+ 273
+ ],
+ [
+ 31,
+ 272
+ ],
+ [
+ 33,
+ 271
+ ],
+ [
+ 34,
+ 270
+ ],
+ [
+ 37,
+ 268
+ ],
+ [
+ 39,
+ 266
+ ],
+ [
+ 42,
+ 265
+ ],
+ [
+ 44,
+ 264
+ ],
+ [
+ 46,
+ 263
+ ],
+ [
+ 48,
+ 262
+ ],
+ [
+ 49,
+ 262
+ ],
+ [
+ 49,
+ 263
+ ],
+ [
+ 49,
+ 265
+ ],
+ [
+ 48,
+ 268
+ ],
+ [
+ 48,
+ 269
+ ],
+ [
+ 49,
+ 269
+ ],
+ [
+ 49,
+ 268
+ ],
+ [
+ 54,
+ 267
+ ],
+ [
+ 59,
+ 265
+ ],
+ [
+ 64,
+ 263
+ ],
+ [
+ 67,
+ 262
+ ],
+ [
+ 69,
+ 260
+ ],
+ [
+ 71,
+ 258
+ ],
+ [
+ 73,
+ 257
+ ],
+ [
+ 85,
+ 249
+ ],
+ [
+ 96,
+ 242
+ ],
+ [
+ 106,
+ 235
+ ],
+ [
+ 111,
+ 230
+ ],
+ [
+ 114,
+ 224
+ ],
+ [
+ 116,
+ 220
+ ],
+ [
+ 123,
+ 213
+ ],
+ [
+ 131,
+ 206
+ ],
+ [
+ 135,
+ 202
+ ],
+ [
+ 138,
+ 200
+ ],
+ [
+ 138,
+ 198
+ ],
+ [
+ 140,
+ 196
+ ],
+ [
+ 141,
+ 195
+ ],
+ [
+ 141,
+ 194
+ ],
+ [
+ 151,
+ 181
+ ],
+ [
+ 157,
+ 174
+ ],
+ [
+ 159,
+ 172
+ ],
+ [
+ 159,
+ 171
+ ],
+ [
+ 157,
+ 169
+ ],
+ [
+ 156,
+ 167
+ ],
+ [
+ 156,
+ 165
+ ],
+ [
+ 156,
+ 160
+ ],
+ [
+ 155,
+ 154
+ ],
+ [
+ 155,
+ 151
+ ],
+ [
+ 155,
+ 148
+ ],
+ [
+ 154,
+ 143
+ ],
+ [
+ 152,
+ 139
+ ],
+ [
+ 152,
+ 134
+ ],
+ [
+ 152,
+ 129
+ ],
+ [
+ 152,
+ 124
+ ],
+ [
+ 152,
+ 120
+ ],
+ [
+ 152,
+ 118
+ ],
+ [
+ 154,
+ 112
+ ],
+ [
+ 159,
+ 103
+ ],
+ [
+ 162,
+ 96
+ ],
+ [
+ 162,
+ 95
+ ],
+ [
+ 161,
+ 95
+ ],
+ [
+ 158,
+ 95
+ ],
+ [
+ 156,
+ 97
+ ],
+ [
+ 153,
+ 99
+ ],
+ [
+ 151,
+ 99
+ ],
+ [
+ 147,
+ 98
+ ],
+ [
+ 145,
+ 98
+ ],
+ [
+ 143,
+ 98
+ ],
+ [
+ 139,
+ 98
+ ],
+ [
+ 135,
+ 98
+ ],
+ [
+ 132,
+ 98
+ ],
+ [
+ 129,
+ 96
+ ],
+ [
+ 129,
+ 95
+ ],
+ [
+ 129,
+ 90
+ ],
+ [
+ 128,
+ 83
+ ],
+ [
+ 129,
+ 78
+ ],
+ [
+ 132,
+ 73
+ ],
+ [
+ 134,
+ 69
+ ],
+ [
+ 133,
+ 69
+ ],
+ [
+ 130,
+ 69
+ ],
+ [
+ 126,
+ 66
+ ],
+ [
+ 124,
+ 62
+ ],
+ [
+ 122,
+ 59
+ ],
+ [
+ 121,
+ 56
+ ],
+ [
+ 119,
+ 53
+ ],
+ [
+ 115,
+ 45
+ ],
+ [
+ 114,
+ 43
+ ],
+ [
+ 113,
+ 43
+ ],
+ [
+ 111,
+ 43
+ ],
+ [
+ 105,
+ 39
+ ],
+ [
+ 102,
+ 35
+ ],
+ [
+ 99,
+ 31
+ ],
+ [
+ 96,
+ 27
+ ],
+ [
+ 90,
+ 24
+ ],
+ [
+ 87,
+ 24
+ ],
+ [
+ 79,
+ 22
+ ],
+ [
+ 77,
+ 21
+ ],
+ [
+ 77,
+ 19
+ ],
+ [
+ 77,
+ 13
+ ],
+ [
+ 78,
+ 0
+ ],
+ [
+ 79,
+ -4
+ ],
+ [
+ 79,
+ -3
+ ],
+ [
+ 78,
+ 0
+ ],
+ [
+ 77,
+ 4
+ ],
+ [
+ 75,
+ 6
+ ],
+ [
+ 72,
+ 8
+ ],
+ [
+ 68,
+ 8
+ ],
+ [
+ 65,
+ 8
+ ],
+ [
+ 58,
+ 11
+ ],
+ [
+ 53,
+ 11
+ ],
+ [
+ 46,
+ 12
+ ],
+ [
+ 41,
+ 12
+ ],
+ [
+ 31,
+ 6
+ ],
+ [
+ 29,
+ 5
+ ],
+ [
+ 28,
+ 5
+ ],
+ [
+ 27,
+ 5
+ ],
+ [
+ 25,
+ 3
+ ],
+ [
+ 22,
+ 1
+ ],
+ [
+ 19,
+ -2
+ ],
+ [
+ 16,
+ -4
+ ],
+ [
+ 15,
+ -2
+ ],
+ [
+ 15,
+ 2
+ ],
+ [
+ 15,
+ 4
+ ],
+ [
+ 14,
+ 5
+ ],
+ [
+ 11,
+ 10
+ ],
+ [
+ 11,
+ 15
+ ],
+ [
+ 10,
+ 19
+ ],
+ [
+ 10,
+ 20
+ ],
+ [
+ 6,
+ 23
+ ],
+ [
+ -2,
+ 28
+ ],
+ [
+ -7,
+ 29
+ ],
+ [
+ -12,
+ 29
+ ],
+ [
+ -18,
+ 29
+ ],
+ [
+ -20,
+ 29
+ ],
+ [
+ -21,
+ 28
+ ],
+ [
+ -22,
+ 28
+ ],
+ [
+ -24,
+ 27
+ ],
+ [
+ -26,
+ 24
+ ],
+ [
+ -32,
+ 19
+ ],
+ [
+ -36,
+ 16
+ ],
+ [
+ -39,
+ 13
+ ],
+ [
+ -41,
+ 12
+ ],
+ [
+ -42,
+ 12
+ ],
+ [
+ -40,
+ 19
+ ],
+ [
+ -39,
+ 27
+ ],
+ [
+ -39,
+ 44
+ ],
+ [
+ -40,
+ 60
+ ],
+ [
+ -41,
+ 73
+ ],
+ [
+ -41,
+ 75
+ ],
+ [
+ -41,
+ 77
+ ],
+ [
+ -42,
+ 77
+ ],
+ [
+ -43,
+ 75
+ ],
+ [
+ -47,
+ 71
+ ],
+ [
+ -49,
+ 70
+ ],
+ [
+ -51,
+ 69
+ ],
+ [
+ -54,
+ 68
+ ],
+ [
+ -58,
+ 67
+ ],
+ [
+ -62,
+ 66
+ ],
+ [
+ -63,
+ 65
+ ],
+ [
+ -64,
+ 65
+ ],
+ [
+ -63,
+ 70
+ ],
+ [
+ -60,
+ 76
+ ],
+ [
+ -57,
+ 83
+ ],
+ [
+ -52,
+ 90
+ ],
+ [
+ -48,
+ 103
+ ],
+ [
+ -46,
+ 110
+ ],
+ [
+ -45,
+ 114
+ ],
+ [
+ -44,
+ 117
+ ],
+ [
+ -45,
+ 117
+ ],
+ [
+ -47,
+ 117
+ ],
+ [
+ -50,
+ 115
+ ],
+ [
+ -54,
+ 113
+ ],
+ [
+ -58,
+ 112
+ ],
+ [
+ -64,
+ 108
+ ],
+ [
+ -66,
+ 108
+ ],
+ [
+ -68,
+ 108
+ ],
+ [
+ -68,
+ 111
+ ],
+ [
+ -68,
+ 114
+ ],
+ [
+ -68,
+ 115
+ ],
+ [
+ -68,
+ 116
+ ],
+ [
+ -69,
+ 117
+ ],
+ [
+ -69,
+ 121
+ ],
+ [
+ -71,
+ 132
+ ],
+ [
+ -71,
+ 137
+ ],
+ [
+ -72,
+ 138
+ ],
+ [
+ -73,
+ 139
+ ],
+ [
+ -76,
+ 141
+ ],
+ [
+ -83,
+ 148
+ ],
+ [
+ -88,
+ 151
+ ],
+ [
+ -89,
+ 152
+ ],
+ [
+ -89,
+ 151
+ ],
+ [
+ -86,
+ 149
+ ],
+ [
+ -83,
+ 145
+ ],
+ [
+ -80,
+ 144
+ ],
+ [
+ -79,
+ 144
+ ],
+ [
+ -77,
+ 150
+ ],
+ [
+ -77,
+ 160
+ ],
+ [
+ -80,
+ 170
+ ],
+ [
+ -82,
+ 173
+ ],
+ [
+ -82,
+ 174
+ ],
+ [
+ -83,
+ 175
+ ],
+ [
+ -81,
+ 174
+ ],
+ [
+ -77,
+ 171
+ ],
+ [
+ -74,
+ 171
+ ],
+ [
+ -71,
+ 171
+ ],
+ [
+ -69,
+ 173
+ ],
+ [
+ -68,
+ 174
+ ],
+ [
+ -66,
+ 176
+ ],
+ [
+ -65,
+ 179
+ ],
+ [
+ -64,
+ 187
+ ],
+ [
+ -64,
+ 193
+ ],
+ [
+ -63,
+ 198
+ ],
+ [
+ -62,
+ 202
+ ],
+ [
+ -61,
+ 204
+ ],
+ [
+ -59,
+ 208
+ ],
+ [
+ -57,
+ 211
+ ],
+ [
+ -56,
+ 212
+ ],
+ [
+ -56,
+ 213
+ ],
+ [
+ -56,
+ 215
+ ],
+ [
+ -56,
+ 220
+ ],
+ [
+ -57,
+ 230
+ ],
+ [
+ -58,
+ 234
+ ],
+ [
+ -59,
+ 236
+ ],
+ [
+ -58,
+ 235
+ ],
+ [
+ -57,
+ 234
+ ],
+ [
+ -55,
+ 231
+ ],
+ [
+ -52,
+ 230
+ ],
+ [
+ -50,
+ 230
+ ],
+ [
+ -49,
+ 230
+ ],
+ [
+ -47,
+ 230
+ ],
+ [
+ -46,
+ 233
+ ],
+ [
+ -44,
+ 240
+ ],
+ [
+ -43,
+ 250
+ ],
+ [
+ -42,
+ 259
+ ],
+ [
+ -42,
+ 264
+ ],
+ [
+ -42,
+ 269
+ ],
+ [
+ -42,
+ 271
+ ],
+ [
+ -42,
+ 272
+ ],
+ [
+ -42,
+ 271
+ ],
+ [
+ -41,
+ 270
+ ],
+ [
+ -40,
+ 266
+ ],
+ [
+ -39,
+ 265
+ ],
+ [
+ -37,
+ 263
+ ],
+ [
+ -34,
+ 263
+ ],
+ [
+ -32,
+ 263
+ ],
+ [
+ -29,
+ 263
+ ],
+ [
+ -26,
+ 263
+ ],
+ [
+ -23,
+ 263
+ ],
+ [
+ -19,
+ 266
+ ],
+ [
+ -19,
+ 267
+ ],
+ [
+ -18,
+ 267
+ ],
+ [
+ -16,
+ 266
+ ],
+ [
+ -10,
+ 262
+ ],
+ [
+ -4,
+ 261
+ ],
+ [
+ 3,
+ 260
+ ],
+ [
+ 10,
+ 259
+ ],
+ [
+ 18,
+ 259
+ ],
+ [
+ 22,
+ 260
+ ],
+ [
+ 24,
+ 260
+ ],
+ [
+ 25,
+ 260
+ ],
+ [
+ 26,
+ 257
+ ],
+ [
+ 27,
+ 257
+ ],
+ [
+ 27,
+ 256
+ ],
+ [
+ 28,
+ 256
+ ],
+ [
+ 30,
+ 255
+ ],
+ [
+ 38,
+ 256
+ ],
+ [
+ 44,
+ 258
+ ],
+ [
+ 49,
+ 260
+ ],
+ [
+ 54,
+ 264
+ ],
+ [
+ 61,
+ 270
+ ],
+ [
+ 65,
+ 275
+ ],
+ [
+ 69,
+ 277
+ ],
+ [
+ 70,
+ 277
+ ],
+ [
+ 71,
+ 277
+ ],
+ [
+ 71,
+ 276
+ ],
+ [
+ 71,
+ 273
+ ],
+ [
+ 71,
+ 269
+ ],
+ [
+ 71,
+ 264
+ ],
+ [
+ 72,
+ 261
+ ],
+ [
+ 73,
+ 260
+ ],
+ [
+ 73,
+ 259
+ ],
+ [
+ 74,
+ 257
+ ],
+ [
+ 81,
+ 257
+ ],
+ [
+ 90,
+ 257
+ ],
+ [
+ 100,
+ 259
+ ],
+ [
+ 103,
+ 259
+ ],
+ [
+ 104,
+ 259
+ ],
+ [
+ 105,
+ 258
+ ],
+ [
+ 105,
+ 256
+ ],
+ [
+ 108,
+ 249
+ ],
+ [
+ 112,
+ 241
+ ],
+ [
+ 117,
+ 234
+ ],
+ [
+ 118,
+ 233
+ ],
+ [
+ 119,
+ 232
+ ],
+ [
+ 120,
+ 232
+ ],
+ [
+ 121,
+ 231
+ ],
+ [
+ 127,
+ 228
+ ],
+ [
+ 133,
+ 225
+ ],
+ [
+ 142,
+ 219
+ ],
+ [
+ 143,
+ 216
+ ],
+ [
+ 145,
+ 216
+ ],
+ [
+ 146,
+ 214
+ ],
+ [
+ 147,
+ 211
+ ],
+ [
+ 149,
+ 204
+ ],
+ [
+ 151,
+ 197
+ ],
+ [
+ 151,
+ 196
+ ],
+ [
+ 151,
+ 195
+ ],
+ [
+ 151,
+ 194
+ ],
+ [
+ 149,
+ 192
+ ],
+ [
+ 147,
+ 187
+ ],
+ [
+ 142,
+ 180
+ ],
+ [
+ 138,
+ 177
+ ],
+ [
+ 137,
+ 177
+ ],
+ [
+ 136,
+ 177
+ ],
+ [
+ 137,
+ 177
+ ],
+ [
+ 142,
+ 175
+ ],
+ [
+ 150,
+ 172
+ ],
+ [
+ 158,
+ 168
+ ],
+ [
+ 167,
+ 165
+ ],
+ [
+ 168,
+ 164
+ ],
+ [
+ 167,
+ 162
+ ],
+ [
+ 164,
+ 151
+ ],
+ [
+ 158,
+ 140
+ ],
+ [
+ 149,
+ 121
+ ],
+ [
+ 145,
+ 115
+ ],
+ [
+ 143,
+ 112
+ ],
+ [
+ 143,
+ 111
+ ],
+ [
+ 143,
+ 109
+ ],
+ [
+ 146,
+ 105
+ ],
+ [
+ 152,
+ 99
+ ],
+ [
+ 157,
+ 94
+ ],
+ [
+ 158,
+ 92
+ ],
+ [
+ 159,
+ 92
+ ],
+ [
+ 158,
+ 91
+ ],
+ [
+ 153,
+ 90
+ ],
+ [
+ 149,
+ 87
+ ],
+ [
+ 143,
+ 82
+ ],
+ [
+ 142,
+ 80
+ ],
+ [
+ 140,
+ 79
+ ],
+ [
+ 137,
+ 76
+ ],
+ [
+ 133,
+ 73
+ ],
+ [
+ 130,
+ 73
+ ],
+ [
+ 128,
+ 72
+ ],
+ [
+ 127,
+ 71
+ ],
+ [
+ 126,
+ 69
+ ],
+ [
+ 127,
+ 60
+ ],
+ [
+ 128,
+ 55
+ ],
+ [
+ 127,
+ 50
+ ],
+ [
+ 125,
+ 48
+ ],
+ [
+ 124,
+ 48
+ ],
+ [
+ 121,
+ 48
+ ],
+ [
+ 119,
+ 49
+ ],
+ [
+ 113,
+ 50
+ ],
+ [
+ 104,
+ 51
+ ],
+ [
+ 98,
+ 52
+ ],
+ [
+ 94,
+ 52
+ ],
+ [
+ 93,
+ 52
+ ],
+ [
+ 91,
+ 47
+ ],
+ [
+ 91,
+ 38
+ ],
+ [
+ 93,
+ 29
+ ],
+ [
+ 93,
+ 24
+ ],
+ [
+ 91,
+ 24
+ ],
+ [
+ 90,
+ 24
+ ],
+ [
+ 89,
+ 23
+ ],
+ [
+ 89,
+ 21
+ ],
+ [
+ 88,
+ 21
+ ],
+ [
+ 86,
+ 21
+ ],
+ [
+ 84,
+ 21
+ ],
+ [
+ 82,
+ 21
+ ],
+ [
+ 80,
+ 19
+ ],
+ [
+ 78,
+ 16
+ ],
+ [
+ 73,
+ 15
+ ],
+ [
+ 68,
+ 14
+ ],
+ [
+ 61,
+ 12
+ ],
+ [
+ 54,
+ 7
+ ],
+ [
+ 50,
+ 3
+ ],
+ [
+ 48,
+ -1
+ ],
+ [
+ 46,
+ -4
+ ],
+ [
+ 44,
+ -6
+ ],
+ [
+ 42,
+ -8
+ ],
+ [
+ 41,
+ -9
+ ],
+ [
+ 39,
+ -10
+ ],
+ [
+ 35,
+ -13
+ ],
+ [
+ 32,
+ -14
+ ],
+ [
+ 27,
+ -14
+ ],
+ [
+ 18,
+ -14
+ ],
+ [
+ 13,
+ -11
+ ],
+ [
+ 11,
+ -5
+ ],
+ [
+ 9,
+ 3
+ ],
+ [
+ 8,
+ 9
+ ],
+ [
+ 8,
+ 15
+ ],
+ [
+ 8,
+ 16
+ ],
+ [
+ 8,
+ 17
+ ],
+ [
+ 7,
+ 18
+ ],
+ [
+ 5,
+ 20
+ ],
+ [
+ 5,
+ 22
+ ],
+ [
+ 5,
+ 23
+ ],
+ [
+ 4,
+ 22
+ ],
+ [
+ 3,
+ 20
+ ],
+ [
+ 2,
+ 18
+ ],
+ [
+ 2,
+ 15
+ ],
+ [
+ 1,
+ 12
+ ],
+ [
+ 1,
+ 12
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#FFF"
+ }
+}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/draws/2022-10-28-11-22-12.excalidraw b/second/semester1/logseq-stuff/draws/2022-10-28-11-22-12.excalidraw
new file mode 100644
index 00000000..f73edfbb
--- /dev/null
+++ b/second/semester1/logseq-stuff/draws/2022-10-28-11-22-12.excalidraw
@@ -0,0 +1,4432 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "file://",
+ "elements": [
+ {
+ "type": "ellipse",
+ "version": 29,
+ "versionNonce": 619313491,
+ "isDeleted": false,
+ "id": "FaApldjwmPGceZg3aELGy",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 288.8125,
+ "y": 109.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 27,
+ "height": 25,
+ "seed": 324038653,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1666952552574,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 34,
+ "versionNonce": 1909143901,
+ "isDeleted": false,
+ "id": "y1vJq_RNCcUp-Qi0skNYm",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 232.8125,
+ "y": 186.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 28,
+ "height": 30,
+ "seed": 147838333,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1666952552574,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 28,
+ "versionNonce": 1319458547,
+ "isDeleted": false,
+ "id": "pzBDrrcvLVZlCWSVgqnXm",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 339.8125,
+ "y": 185.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 35,
+ "height": 32,
+ "seed": 843220691,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1666952552574,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 21,
+ "versionNonce": 1513489853,
+ "isDeleted": false,
+ "id": "pJhbRRAcnLIhL_KTZ9aiS",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 280.8125,
+ "y": 285.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 32,
+ "height": 26,
+ "seed": 199355581,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1666952552574,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "line",
+ "version": 22,
+ "versionNonce": 23192179,
+ "isDeleted": false,
+ "id": "mU3vX3dWSq_EKJXmHA7kK",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 294.8125,
+ "y": 128.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 41,
+ "height": 60,
+ "seed": 407389725,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952555514,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -41,
+ 60
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 26,
+ "versionNonce": 1019541395,
+ "isDeleted": false,
+ "id": "x0jT0TJtrLrSaEx6mK6Nn",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 308.8125,
+ "y": 127.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 39,
+ "height": 61,
+ "seed": 670691901,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952557530,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 39,
+ 61
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 49,
+ "versionNonce": 2039035933,
+ "isDeleted": false,
+ "id": "VsLGHcJVprgTwcsV720eU",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 299.8125,
+ "y": 134.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 6,
+ "height": 148,
+ "seed": 399916829,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952559627,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -6,
+ 148
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 34,
+ "versionNonce": 832508541,
+ "isDeleted": false,
+ "id": "lx9uSgOFlonJ4iSMTzv4E",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 243.8125,
+ "y": 215.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 48,
+ "height": 69,
+ "seed": 685483059,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952562027,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 48,
+ 69
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 17,
+ "versionNonce": 373546195,
+ "isDeleted": false,
+ "id": "c2748Lsl4sM5JIdpF2DwW",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 357.8125,
+ "y": 221.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 45,
+ "height": 60,
+ "seed": 158277587,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952564246,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -45,
+ 60
+ ]
+ ]
+ },
+ {
+ "type": "freedraw",
+ "version": 79,
+ "versionNonce": 1063371901,
+ "isDeleted": false,
+ "id": "BMhbB29bDUh1fz5u0EB4E",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 365.8125,
+ "y": 215.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 148,
+ "height": 143,
+ "seed": 1175670237,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952570718,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 1,
+ 2
+ ],
+ [
+ 2,
+ 13
+ ],
+ [
+ 4,
+ 22
+ ],
+ [
+ 4,
+ 28
+ ],
+ [
+ 4,
+ 33
+ ],
+ [
+ 4,
+ 36
+ ],
+ [
+ 4,
+ 42
+ ],
+ [
+ 2,
+ 50
+ ],
+ [
+ 1,
+ 58
+ ],
+ [
+ 0,
+ 66
+ ],
+ [
+ -1,
+ 67
+ ],
+ [
+ -1,
+ 68
+ ],
+ [
+ -2,
+ 69
+ ],
+ [
+ -9,
+ 76
+ ],
+ [
+ -18,
+ 89
+ ],
+ [
+ -23,
+ 95
+ ],
+ [
+ -24,
+ 98
+ ],
+ [
+ -24,
+ 99
+ ],
+ [
+ -27,
+ 100
+ ],
+ [
+ -34,
+ 109
+ ],
+ [
+ -44,
+ 120
+ ],
+ [
+ -51,
+ 126
+ ],
+ [
+ -53,
+ 127
+ ],
+ [
+ -54,
+ 127
+ ],
+ [
+ -59,
+ 130
+ ],
+ [
+ -71,
+ 137
+ ],
+ [
+ -78,
+ 139
+ ],
+ [
+ -83,
+ 141
+ ],
+ [
+ -85,
+ 141
+ ],
+ [
+ -87,
+ 141
+ ],
+ [
+ -91,
+ 141
+ ],
+ [
+ -101,
+ 141
+ ],
+ [
+ -108,
+ 140
+ ],
+ [
+ -117,
+ 138
+ ],
+ [
+ -123,
+ 134
+ ],
+ [
+ -129,
+ 132
+ ],
+ [
+ -132,
+ 128
+ ],
+ [
+ -135,
+ 125
+ ],
+ [
+ -138,
+ 119
+ ],
+ [
+ -141,
+ 109
+ ],
+ [
+ -143,
+ 104
+ ],
+ [
+ -143,
+ 101
+ ],
+ [
+ -143,
+ 98
+ ],
+ [
+ -143,
+ 94
+ ],
+ [
+ -142,
+ 88
+ ],
+ [
+ -142,
+ 80
+ ],
+ [
+ -143,
+ 69
+ ],
+ [
+ -144,
+ 66
+ ],
+ [
+ -144,
+ 65
+ ],
+ [
+ -144,
+ 64
+ ],
+ [
+ -144,
+ 61
+ ],
+ [
+ -144,
+ 56
+ ],
+ [
+ -142,
+ 51
+ ],
+ [
+ -142,
+ 50
+ ],
+ [
+ -142,
+ 49
+ ],
+ [
+ -142,
+ 48
+ ],
+ [
+ -142,
+ 47
+ ],
+ [
+ -141,
+ 44
+ ],
+ [
+ -137,
+ 28
+ ],
+ [
+ -135,
+ 17
+ ],
+ [
+ -134,
+ 9
+ ],
+ [
+ -133,
+ 5
+ ],
+ [
+ -132,
+ 4
+ ],
+ [
+ -132,
+ 3
+ ],
+ [
+ -132,
+ 1
+ ],
+ [
+ -132,
+ 0
+ ],
+ [
+ -131,
+ 0
+ ],
+ [
+ -131,
+ -1
+ ],
+ [
+ -130,
+ -1
+ ],
+ [
+ -129,
+ -1
+ ],
+ [
+ -128,
+ -1
+ ],
+ [
+ -127,
+ -1
+ ],
+ [
+ -127,
+ -2
+ ],
+ [
+ -128,
+ -2
+ ],
+ [
+ -129,
+ -2
+ ],
+ [
+ -131,
+ -2
+ ],
+ [
+ -131,
+ -2
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 136,
+ "versionNonce": 2125510141,
+ "isDeleted": false,
+ "id": "Hb-IHenmv3PnP2CxiBnja",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 282.8125,
+ "y": 156.546875,
+ "strokeColor": "#087f5b",
+ "backgroundColor": "transparent",
+ "width": 21,
+ "height": 88,
+ "seed": 870878675,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952583559,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -2,
+ 7
+ ],
+ [
+ -4,
+ 12
+ ],
+ [
+ -7,
+ 17
+ ],
+ [
+ -10,
+ 20
+ ],
+ [
+ -13,
+ 22
+ ],
+ [
+ -14,
+ 23
+ ],
+ [
+ -15,
+ 26
+ ],
+ [
+ -15,
+ 27
+ ],
+ [
+ -12,
+ 23
+ ],
+ [
+ -9,
+ 17
+ ],
+ [
+ -5,
+ 10
+ ],
+ [
+ 0,
+ 2
+ ],
+ [
+ 0,
+ 1
+ ],
+ [
+ 1,
+ 1
+ ],
+ [
+ 4,
+ 6
+ ],
+ [
+ 4,
+ 12
+ ],
+ [
+ 4,
+ 17
+ ],
+ [
+ 1,
+ 24
+ ],
+ [
+ 0,
+ 28
+ ],
+ [
+ -1,
+ 31
+ ],
+ [
+ -3,
+ 33
+ ],
+ [
+ -3,
+ 35
+ ],
+ [
+ -4,
+ 37
+ ],
+ [
+ -5,
+ 41
+ ],
+ [
+ -5,
+ 42
+ ],
+ [
+ -5,
+ 40
+ ],
+ [
+ -5,
+ 39
+ ],
+ [
+ -5,
+ 40
+ ],
+ [
+ -4,
+ 44
+ ],
+ [
+ -5,
+ 49
+ ],
+ [
+ -7,
+ 54
+ ],
+ [
+ -9,
+ 59
+ ],
+ [
+ -10,
+ 60
+ ],
+ [
+ -11,
+ 61
+ ],
+ [
+ -11,
+ 60
+ ],
+ [
+ -11,
+ 59
+ ],
+ [
+ -11,
+ 60
+ ],
+ [
+ -12,
+ 62
+ ],
+ [
+ -12,
+ 63
+ ],
+ [
+ -12,
+ 64
+ ],
+ [
+ -13,
+ 63
+ ],
+ [
+ -15,
+ 60
+ ],
+ [
+ -15,
+ 57
+ ],
+ [
+ -14,
+ 44
+ ],
+ [
+ -13,
+ 38
+ ],
+ [
+ -11,
+ 35
+ ],
+ [
+ -9,
+ 33
+ ],
+ [
+ -8,
+ 33
+ ],
+ [
+ -7,
+ 33
+ ],
+ [
+ -7,
+ 35
+ ],
+ [
+ -7,
+ 38
+ ],
+ [
+ -7,
+ 43
+ ],
+ [
+ -7,
+ 48
+ ],
+ [
+ -7,
+ 52
+ ],
+ [
+ -8,
+ 57
+ ],
+ [
+ -8,
+ 61
+ ],
+ [
+ -8,
+ 62
+ ],
+ [
+ -8,
+ 67
+ ],
+ [
+ -8,
+ 71
+ ],
+ [
+ -7,
+ 78
+ ],
+ [
+ -7,
+ 81
+ ],
+ [
+ -6,
+ 79
+ ],
+ [
+ -6,
+ 76
+ ],
+ [
+ -6,
+ 75
+ ],
+ [
+ -6,
+ 74
+ ],
+ [
+ -4,
+ 68
+ ],
+ [
+ -3,
+ 61
+ ],
+ [
+ -2,
+ 54
+ ],
+ [
+ -2,
+ 47
+ ],
+ [
+ -2,
+ 40
+ ],
+ [
+ -2,
+ 32
+ ],
+ [
+ -2,
+ 30
+ ],
+ [
+ -2,
+ 29
+ ],
+ [
+ -2,
+ 27
+ ],
+ [
+ -2,
+ 26
+ ],
+ [
+ 0,
+ 29
+ ],
+ [
+ 0,
+ 34
+ ],
+ [
+ 1,
+ 38
+ ],
+ [
+ 1,
+ 42
+ ],
+ [
+ -1,
+ 48
+ ],
+ [
+ -3,
+ 55
+ ],
+ [
+ -3,
+ 62
+ ],
+ [
+ -4,
+ 68
+ ],
+ [
+ -4,
+ 70
+ ],
+ [
+ -4,
+ 73
+ ],
+ [
+ -4,
+ 75
+ ],
+ [
+ -4,
+ 83
+ ],
+ [
+ -4,
+ 87
+ ],
+ [
+ -3,
+ 88
+ ],
+ [
+ -4,
+ 85
+ ],
+ [
+ -5,
+ 72
+ ],
+ [
+ -6,
+ 59
+ ],
+ [
+ -7,
+ 47
+ ],
+ [
+ -9,
+ 36
+ ],
+ [
+ -9,
+ 28
+ ],
+ [
+ -9,
+ 24
+ ],
+ [
+ -9,
+ 23
+ ],
+ [
+ -8,
+ 22
+ ],
+ [
+ -7,
+ 18
+ ],
+ [
+ -7,
+ 16
+ ],
+ [
+ -7,
+ 14
+ ],
+ [
+ -4,
+ 14
+ ],
+ [
+ -2,
+ 16
+ ],
+ [
+ -2,
+ 17
+ ],
+ [
+ 0,
+ 19
+ ],
+ [
+ 0,
+ 29
+ ],
+ [
+ 1,
+ 37
+ ],
+ [
+ 1,
+ 40
+ ],
+ [
+ -1,
+ 47
+ ],
+ [
+ -1,
+ 51
+ ],
+ [
+ -2,
+ 57
+ ],
+ [
+ -2,
+ 64
+ ],
+ [
+ -2,
+ 77
+ ],
+ [
+ -1,
+ 83
+ ],
+ [
+ -1,
+ 86
+ ],
+ [
+ 0,
+ 86
+ ],
+ [
+ 0,
+ 83
+ ],
+ [
+ 1,
+ 79
+ ],
+ [
+ 2,
+ 76
+ ],
+ [
+ 4,
+ 72
+ ],
+ [
+ 6,
+ 64
+ ],
+ [
+ 6,
+ 56
+ ],
+ [
+ 6,
+ 50
+ ],
+ [
+ 6,
+ 43
+ ],
+ [
+ 6,
+ 30
+ ],
+ [
+ 6,
+ 27
+ ],
+ [
+ 6,
+ 26
+ ],
+ [
+ 5,
+ 24
+ ],
+ [
+ 5,
+ 23
+ ],
+ [
+ 4,
+ 20
+ ],
+ [
+ 4,
+ 19
+ ],
+ [
+ 4,
+ 18
+ ],
+ [
+ 3,
+ 18
+ ],
+ [
+ 3,
+ 18
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 124,
+ "versionNonce": 1740224829,
+ "isDeleted": false,
+ "id": "6Y_BLIHJAzS0iPCHfcAcs",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 310.8125,
+ "y": 159.546875,
+ "strokeColor": "#495057",
+ "backgroundColor": "transparent",
+ "width": 28,
+ "height": 112,
+ "seed": 173765715,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952593226,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 2
+ ],
+ [
+ 0,
+ 4
+ ],
+ [
+ -3,
+ 14
+ ],
+ [
+ -4,
+ 17
+ ],
+ [
+ -5,
+ 23
+ ],
+ [
+ -5,
+ 28
+ ],
+ [
+ -5,
+ 33
+ ],
+ [
+ -5,
+ 40
+ ],
+ [
+ -3,
+ 48
+ ],
+ [
+ -3,
+ 53
+ ],
+ [
+ -3,
+ 57
+ ],
+ [
+ -3,
+ 62
+ ],
+ [
+ -3,
+ 69
+ ],
+ [
+ -3,
+ 73
+ ],
+ [
+ -3,
+ 76
+ ],
+ [
+ -2,
+ 75
+ ],
+ [
+ -1,
+ 64
+ ],
+ [
+ 1,
+ 44
+ ],
+ [
+ 1,
+ 39
+ ],
+ [
+ 2,
+ 31
+ ],
+ [
+ 2,
+ 27
+ ],
+ [
+ 3,
+ 25
+ ],
+ [
+ 5,
+ 26
+ ],
+ [
+ 8,
+ 33
+ ],
+ [
+ 8,
+ 42
+ ],
+ [
+ 7,
+ 50
+ ],
+ [
+ 5,
+ 58
+ ],
+ [
+ 4,
+ 63
+ ],
+ [
+ 2,
+ 69
+ ],
+ [
+ 1,
+ 70
+ ],
+ [
+ 1,
+ 74
+ ],
+ [
+ 1,
+ 80
+ ],
+ [
+ 1,
+ 88
+ ],
+ [
+ 1,
+ 91
+ ],
+ [
+ 0,
+ 89
+ ],
+ [
+ 0,
+ 84
+ ],
+ [
+ 0,
+ 77
+ ],
+ [
+ 0,
+ 73
+ ],
+ [
+ 3,
+ 68
+ ],
+ [
+ 4,
+ 65
+ ],
+ [
+ 6,
+ 61
+ ],
+ [
+ 8,
+ 59
+ ],
+ [
+ 10,
+ 56
+ ],
+ [
+ 11,
+ 52
+ ],
+ [
+ 13,
+ 48
+ ],
+ [
+ 14,
+ 45
+ ],
+ [
+ 16,
+ 42
+ ],
+ [
+ 18,
+ 42
+ ],
+ [
+ 19,
+ 42
+ ],
+ [
+ 21,
+ 43
+ ],
+ [
+ 21,
+ 51
+ ],
+ [
+ 21,
+ 56
+ ],
+ [
+ 19,
+ 60
+ ],
+ [
+ 16,
+ 66
+ ],
+ [
+ 14,
+ 70
+ ],
+ [
+ 13,
+ 75
+ ],
+ [
+ 12,
+ 80
+ ],
+ [
+ 12,
+ 81
+ ],
+ [
+ 12,
+ 82
+ ],
+ [
+ 12,
+ 83
+ ],
+ [
+ 12,
+ 86
+ ],
+ [
+ 12,
+ 88
+ ],
+ [
+ 14,
+ 82
+ ],
+ [
+ 16,
+ 76
+ ],
+ [
+ 17,
+ 71
+ ],
+ [
+ 19,
+ 66
+ ],
+ [
+ 20,
+ 63
+ ],
+ [
+ 21,
+ 60
+ ],
+ [
+ 22,
+ 59
+ ],
+ [
+ 22,
+ 62
+ ],
+ [
+ 23,
+ 67
+ ],
+ [
+ 20,
+ 74
+ ],
+ [
+ 19,
+ 80
+ ],
+ [
+ 17,
+ 87
+ ],
+ [
+ 16,
+ 89
+ ],
+ [
+ 15,
+ 94
+ ],
+ [
+ 14,
+ 97
+ ],
+ [
+ 13,
+ 103
+ ],
+ [
+ 12,
+ 107
+ ],
+ [
+ 12,
+ 111
+ ],
+ [
+ 12,
+ 112
+ ],
+ [
+ 12,
+ 110
+ ],
+ [
+ 12,
+ 109
+ ],
+ [
+ 12,
+ 105
+ ],
+ [
+ 13,
+ 100
+ ],
+ [
+ 14,
+ 97
+ ],
+ [
+ 15,
+ 92
+ ],
+ [
+ 16,
+ 90
+ ],
+ [
+ 17,
+ 81
+ ],
+ [
+ 18,
+ 79
+ ],
+ [
+ 18,
+ 78
+ ],
+ [
+ 19,
+ 77
+ ],
+ [
+ 19,
+ 75
+ ],
+ [
+ 19,
+ 70
+ ],
+ [
+ 20,
+ 63
+ ],
+ [
+ 19,
+ 58
+ ],
+ [
+ 18,
+ 53
+ ],
+ [
+ 17,
+ 50
+ ],
+ [
+ 14,
+ 44
+ ],
+ [
+ 10,
+ 35
+ ],
+ [
+ 7,
+ 31
+ ],
+ [
+ 5,
+ 26
+ ],
+ [
+ 4,
+ 25
+ ],
+ [
+ 4,
+ 24
+ ],
+ [
+ 4,
+ 22
+ ],
+ [
+ 3,
+ 20
+ ],
+ [
+ 2,
+ 18
+ ],
+ [
+ 2,
+ 15
+ ],
+ [
+ 2,
+ 14
+ ],
+ [
+ 1,
+ 14
+ ],
+ [
+ 0,
+ 11
+ ],
+ [
+ -2,
+ 10
+ ],
+ [
+ 0,
+ 12
+ ],
+ [
+ 1,
+ 13
+ ],
+ [
+ 1,
+ 14
+ ],
+ [
+ 2,
+ 14
+ ],
+ [
+ 3,
+ 15
+ ],
+ [
+ 4,
+ 16
+ ],
+ [
+ 5,
+ 17
+ ],
+ [
+ 6,
+ 18
+ ],
+ [
+ 6,
+ 20
+ ],
+ [
+ 6,
+ 20
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 141,
+ "versionNonce": 542442195,
+ "isDeleted": false,
+ "id": "MPQPe49UtS4YpepDFyvb9",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 244.8125,
+ "y": 239.546875,
+ "strokeColor": "#c92a2a",
+ "backgroundColor": "transparent",
+ "width": 113,
+ "height": 100,
+ "seed": 1422345491,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952601528,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -1,
+ 2
+ ],
+ [
+ -4,
+ 6
+ ],
+ [
+ -7,
+ 10
+ ],
+ [
+ -9,
+ 14
+ ],
+ [
+ -9,
+ 22
+ ],
+ [
+ -9,
+ 26
+ ],
+ [
+ -8,
+ 29
+ ],
+ [
+ -7,
+ 32
+ ],
+ [
+ -6,
+ 32
+ ],
+ [
+ -3,
+ 31
+ ],
+ [
+ 0,
+ 27
+ ],
+ [
+ 4,
+ 24
+ ],
+ [
+ 8,
+ 20
+ ],
+ [
+ 13,
+ 16
+ ],
+ [
+ 15,
+ 14
+ ],
+ [
+ 18,
+ 13
+ ],
+ [
+ 18,
+ 12
+ ],
+ [
+ 19,
+ 12
+ ],
+ [
+ 19,
+ 14
+ ],
+ [
+ 19,
+ 18
+ ],
+ [
+ 19,
+ 24
+ ],
+ [
+ 17,
+ 26
+ ],
+ [
+ 16,
+ 29
+ ],
+ [
+ 14,
+ 33
+ ],
+ [
+ 13,
+ 38
+ ],
+ [
+ 13,
+ 43
+ ],
+ [
+ 13,
+ 45
+ ],
+ [
+ 13,
+ 47
+ ],
+ [
+ 13,
+ 48
+ ],
+ [
+ 13,
+ 49
+ ],
+ [
+ 12,
+ 49
+ ],
+ [
+ 12,
+ 48
+ ],
+ [
+ 12,
+ 45
+ ],
+ [
+ 12,
+ 42
+ ],
+ [
+ 12,
+ 41
+ ],
+ [
+ 12,
+ 49
+ ],
+ [
+ 12,
+ 60
+ ],
+ [
+ 10,
+ 67
+ ],
+ [
+ 9,
+ 72
+ ],
+ [
+ 9,
+ 74
+ ],
+ [
+ 9,
+ 73
+ ],
+ [
+ 9,
+ 72
+ ],
+ [
+ 9,
+ 71
+ ],
+ [
+ 10,
+ 69
+ ],
+ [
+ 12,
+ 67
+ ],
+ [
+ 13,
+ 64
+ ],
+ [
+ 16,
+ 61
+ ],
+ [
+ 19,
+ 57
+ ],
+ [
+ 20,
+ 56
+ ],
+ [
+ 21,
+ 56
+ ],
+ [
+ 21,
+ 58
+ ],
+ [
+ 21,
+ 70
+ ],
+ [
+ 21,
+ 80
+ ],
+ [
+ 21,
+ 87
+ ],
+ [
+ 22,
+ 92
+ ],
+ [
+ 22,
+ 95
+ ],
+ [
+ 22,
+ 97
+ ],
+ [
+ 21,
+ 99
+ ],
+ [
+ 21,
+ 100
+ ],
+ [
+ 20,
+ 97
+ ],
+ [
+ 20,
+ 92
+ ],
+ [
+ 19,
+ 86
+ ],
+ [
+ 20,
+ 82
+ ],
+ [
+ 23,
+ 77
+ ],
+ [
+ 27,
+ 72
+ ],
+ [
+ 29,
+ 68
+ ],
+ [
+ 32,
+ 67
+ ],
+ [
+ 34,
+ 66
+ ],
+ [
+ 35,
+ 69
+ ],
+ [
+ 35,
+ 72
+ ],
+ [
+ 35,
+ 73
+ ],
+ [
+ 35,
+ 76
+ ],
+ [
+ 36,
+ 77
+ ],
+ [
+ 36,
+ 78
+ ],
+ [
+ 36,
+ 79
+ ],
+ [
+ 37,
+ 81
+ ],
+ [
+ 37,
+ 82
+ ],
+ [
+ 37,
+ 83
+ ],
+ [
+ 39,
+ 84
+ ],
+ [
+ 40,
+ 86
+ ],
+ [
+ 40,
+ 87
+ ],
+ [
+ 41,
+ 87
+ ],
+ [
+ 44,
+ 87
+ ],
+ [
+ 47,
+ 87
+ ],
+ [
+ 53,
+ 88
+ ],
+ [
+ 60,
+ 89
+ ],
+ [
+ 62,
+ 89
+ ],
+ [
+ 64,
+ 89
+ ],
+ [
+ 65,
+ 89
+ ],
+ [
+ 67,
+ 89
+ ],
+ [
+ 69,
+ 87
+ ],
+ [
+ 70,
+ 84
+ ],
+ [
+ 71,
+ 83
+ ],
+ [
+ 73,
+ 81
+ ],
+ [
+ 73,
+ 79
+ ],
+ [
+ 74,
+ 78
+ ],
+ [
+ 74,
+ 77
+ ],
+ [
+ 76,
+ 74
+ ],
+ [
+ 77,
+ 73
+ ],
+ [
+ 79,
+ 72
+ ],
+ [
+ 80,
+ 71
+ ],
+ [
+ 81,
+ 70
+ ],
+ [
+ 82,
+ 67
+ ],
+ [
+ 84,
+ 64
+ ],
+ [
+ 86,
+ 60
+ ],
+ [
+ 87,
+ 58
+ ],
+ [
+ 87,
+ 56
+ ],
+ [
+ 87,
+ 53
+ ],
+ [
+ 87,
+ 50
+ ],
+ [
+ 87,
+ 49
+ ],
+ [
+ 87,
+ 48
+ ],
+ [
+ 86,
+ 48
+ ],
+ [
+ 84,
+ 48
+ ],
+ [
+ 83,
+ 48
+ ],
+ [
+ 81,
+ 48
+ ],
+ [
+ 80,
+ 47
+ ],
+ [
+ 80,
+ 44
+ ],
+ [
+ 79,
+ 42
+ ],
+ [
+ 79,
+ 40
+ ],
+ [
+ 81,
+ 37
+ ],
+ [
+ 86,
+ 33
+ ],
+ [
+ 94,
+ 28
+ ],
+ [
+ 97,
+ 26
+ ],
+ [
+ 101,
+ 24
+ ],
+ [
+ 102,
+ 24
+ ],
+ [
+ 103,
+ 24
+ ],
+ [
+ 103,
+ 25
+ ],
+ [
+ 102,
+ 27
+ ],
+ [
+ 102,
+ 29
+ ],
+ [
+ 102,
+ 30
+ ],
+ [
+ 102,
+ 31
+ ],
+ [
+ 102,
+ 32
+ ],
+ [
+ 102,
+ 33
+ ],
+ [
+ 103,
+ 33
+ ],
+ [
+ 104,
+ 33
+ ],
+ [
+ 104,
+ 35
+ ],
+ [
+ 103,
+ 37
+ ],
+ [
+ 103,
+ 38
+ ],
+ [
+ 103,
+ 38
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 329,
+ "versionNonce": 694529373,
+ "isDeleted": false,
+ "id": "DHA_B7S_kSyWEd_7zNnrg",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 239.8125,
+ "y": 118.546875,
+ "strokeColor": "#e67700",
+ "backgroundColor": "transparent",
+ "width": 299,
+ "height": 323,
+ "seed": 2106558429,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952614098,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 4,
+ -2
+ ],
+ [
+ 7,
+ -4
+ ],
+ [
+ 14,
+ -5
+ ],
+ [
+ 21,
+ -5
+ ],
+ [
+ 29,
+ -6
+ ],
+ [
+ 44,
+ -9
+ ],
+ [
+ 55,
+ -13
+ ],
+ [
+ 67,
+ -17
+ ],
+ [
+ 77,
+ -20
+ ],
+ [
+ 84,
+ -21
+ ],
+ [
+ 86,
+ -22
+ ],
+ [
+ 88,
+ -22
+ ],
+ [
+ 88,
+ -21
+ ],
+ [
+ 88,
+ -18
+ ],
+ [
+ 88,
+ -16
+ ],
+ [
+ 91,
+ -16
+ ],
+ [
+ 97,
+ -17
+ ],
+ [
+ 101,
+ -18
+ ],
+ [
+ 104,
+ -19
+ ],
+ [
+ 105,
+ -18
+ ],
+ [
+ 110,
+ -15
+ ],
+ [
+ 116,
+ -10
+ ],
+ [
+ 122,
+ -4
+ ],
+ [
+ 126,
+ 2
+ ],
+ [
+ 129,
+ 7
+ ],
+ [
+ 129,
+ 9
+ ],
+ [
+ 129,
+ 10
+ ],
+ [
+ 129,
+ 12
+ ],
+ [
+ 129,
+ 15
+ ],
+ [
+ 132,
+ 19
+ ],
+ [
+ 135,
+ 22
+ ],
+ [
+ 140,
+ 27
+ ],
+ [
+ 152,
+ 36
+ ],
+ [
+ 166,
+ 48
+ ],
+ [
+ 175,
+ 56
+ ],
+ [
+ 181,
+ 64
+ ],
+ [
+ 189,
+ 75
+ ],
+ [
+ 193,
+ 83
+ ],
+ [
+ 196,
+ 90
+ ],
+ [
+ 196,
+ 95
+ ],
+ [
+ 196,
+ 98
+ ],
+ [
+ 196,
+ 101
+ ],
+ [
+ 194,
+ 106
+ ],
+ [
+ 191,
+ 115
+ ],
+ [
+ 189,
+ 140
+ ],
+ [
+ 189,
+ 165
+ ],
+ [
+ 189,
+ 187
+ ],
+ [
+ 190,
+ 202
+ ],
+ [
+ 191,
+ 206
+ ],
+ [
+ 191,
+ 207
+ ],
+ [
+ 190,
+ 207
+ ],
+ [
+ 188,
+ 206
+ ],
+ [
+ 185,
+ 205
+ ],
+ [
+ 182,
+ 203
+ ],
+ [
+ 175,
+ 203
+ ],
+ [
+ 158,
+ 215
+ ],
+ [
+ 149,
+ 221
+ ],
+ [
+ 143,
+ 229
+ ],
+ [
+ 140,
+ 233
+ ],
+ [
+ 138,
+ 235
+ ],
+ [
+ 137,
+ 237
+ ],
+ [
+ 134,
+ 242
+ ],
+ [
+ 131,
+ 247
+ ],
+ [
+ 127,
+ 252
+ ],
+ [
+ 123,
+ 254
+ ],
+ [
+ 119,
+ 254
+ ],
+ [
+ 112,
+ 255
+ ],
+ [
+ 98,
+ 253
+ ],
+ [
+ 87,
+ 253
+ ],
+ [
+ 77,
+ 253
+ ],
+ [
+ 67,
+ 253
+ ],
+ [
+ 60,
+ 254
+ ],
+ [
+ 57,
+ 254
+ ],
+ [
+ 53,
+ 257
+ ],
+ [
+ 41,
+ 263
+ ],
+ [
+ 32,
+ 269
+ ],
+ [
+ 21,
+ 273
+ ],
+ [
+ 15,
+ 275
+ ],
+ [
+ 12,
+ 275
+ ],
+ [
+ 11,
+ 275
+ ],
+ [
+ 10,
+ 275
+ ],
+ [
+ 2,
+ 276
+ ],
+ [
+ -12,
+ 276
+ ],
+ [
+ -25,
+ 276
+ ],
+ [
+ -34,
+ 275
+ ],
+ [
+ -40,
+ 273
+ ],
+ [
+ -53,
+ 271
+ ],
+ [
+ -63,
+ 268
+ ],
+ [
+ -74,
+ 262
+ ],
+ [
+ -84,
+ 252
+ ],
+ [
+ -90,
+ 234
+ ],
+ [
+ -93,
+ 211
+ ],
+ [
+ -93,
+ 208
+ ],
+ [
+ -93,
+ 204
+ ],
+ [
+ -92,
+ 203
+ ],
+ [
+ -91,
+ 201
+ ],
+ [
+ -89,
+ 200
+ ],
+ [
+ -84,
+ 198
+ ],
+ [
+ -78,
+ 198
+ ],
+ [
+ -70,
+ 198
+ ],
+ [
+ -65,
+ 198
+ ],
+ [
+ -59,
+ 198
+ ],
+ [
+ -53,
+ 196
+ ],
+ [
+ -47,
+ 192
+ ],
+ [
+ -38,
+ 184
+ ],
+ [
+ -32,
+ 176
+ ],
+ [
+ -27,
+ 165
+ ],
+ [
+ -22,
+ 152
+ ],
+ [
+ -20,
+ 145
+ ],
+ [
+ -20,
+ 142
+ ],
+ [
+ -20,
+ 140
+ ],
+ [
+ -23,
+ 137
+ ],
+ [
+ -26,
+ 129
+ ],
+ [
+ -27,
+ 115
+ ],
+ [
+ -27,
+ 97
+ ],
+ [
+ -27,
+ 86
+ ],
+ [
+ -26,
+ 82
+ ],
+ [
+ -27,
+ 80
+ ],
+ [
+ -28,
+ 79
+ ],
+ [
+ -28,
+ 76
+ ],
+ [
+ -28,
+ 62
+ ],
+ [
+ -27,
+ 48
+ ],
+ [
+ -27,
+ 45
+ ],
+ [
+ -28,
+ 43
+ ],
+ [
+ -29,
+ 42
+ ],
+ [
+ -29,
+ 40
+ ],
+ [
+ -29,
+ 38
+ ],
+ [
+ -28,
+ 37
+ ],
+ [
+ -25,
+ 35
+ ],
+ [
+ -17,
+ 32
+ ],
+ [
+ -4,
+ 21
+ ],
+ [
+ 3,
+ 15
+ ],
+ [
+ 9,
+ 10
+ ],
+ [
+ 10,
+ 10
+ ],
+ [
+ 9,
+ 8
+ ],
+ [
+ 8,
+ 8
+ ],
+ [
+ 7,
+ 8
+ ],
+ [
+ 3,
+ 6
+ ],
+ [
+ 0,
+ 5
+ ],
+ [
+ -3,
+ 3
+ ],
+ [
+ -3,
+ 1
+ ],
+ [
+ -3,
+ -2
+ ],
+ [
+ -5,
+ -1
+ ],
+ [
+ -9,
+ 7
+ ],
+ [
+ -14,
+ 27
+ ],
+ [
+ -15,
+ 35
+ ],
+ [
+ -15,
+ 39
+ ],
+ [
+ -15,
+ 43
+ ],
+ [
+ -14,
+ 49
+ ],
+ [
+ -14,
+ 63
+ ],
+ [
+ -19,
+ 93
+ ],
+ [
+ -23,
+ 107
+ ],
+ [
+ -25,
+ 113
+ ],
+ [
+ -26,
+ 115
+ ],
+ [
+ -27,
+ 115
+ ],
+ [
+ -29,
+ 115
+ ],
+ [
+ -30,
+ 115
+ ],
+ [
+ -32,
+ 115
+ ],
+ [
+ -35,
+ 115
+ ],
+ [
+ -38,
+ 115
+ ],
+ [
+ -48,
+ 117
+ ],
+ [
+ -62,
+ 124
+ ],
+ [
+ -70,
+ 127
+ ],
+ [
+ -76,
+ 129
+ ],
+ [
+ -78,
+ 129
+ ],
+ [
+ -79,
+ 130
+ ],
+ [
+ -80,
+ 133
+ ],
+ [
+ -78,
+ 139
+ ],
+ [
+ -79,
+ 153
+ ],
+ [
+ -82,
+ 160
+ ],
+ [
+ -84,
+ 168
+ ],
+ [
+ -87,
+ 177
+ ],
+ [
+ -89,
+ 189
+ ],
+ [
+ -91,
+ 203
+ ],
+ [
+ -94,
+ 213
+ ],
+ [
+ -94,
+ 219
+ ],
+ [
+ -94,
+ 221
+ ],
+ [
+ -93,
+ 223
+ ],
+ [
+ -85,
+ 239
+ ],
+ [
+ -83,
+ 247
+ ],
+ [
+ -81,
+ 251
+ ],
+ [
+ -81,
+ 252
+ ],
+ [
+ -80,
+ 252
+ ],
+ [
+ -75,
+ 252
+ ],
+ [
+ -69,
+ 253
+ ],
+ [
+ -64,
+ 254
+ ],
+ [
+ -60,
+ 255
+ ],
+ [
+ -57,
+ 255
+ ],
+ [
+ -54,
+ 255
+ ],
+ [
+ -47,
+ 255
+ ],
+ [
+ -39,
+ 255
+ ],
+ [
+ -29,
+ 257
+ ],
+ [
+ -19,
+ 259
+ ],
+ [
+ -13,
+ 260
+ ],
+ [
+ -8,
+ 260
+ ],
+ [
+ -2,
+ 260
+ ],
+ [
+ 7,
+ 259
+ ],
+ [
+ 19,
+ 258
+ ],
+ [
+ 30,
+ 258
+ ],
+ [
+ 38,
+ 258
+ ],
+ [
+ 42,
+ 258
+ ],
+ [
+ 43,
+ 258
+ ],
+ [
+ 44,
+ 258
+ ],
+ [
+ 46,
+ 258
+ ],
+ [
+ 52,
+ 260
+ ],
+ [
+ 61,
+ 264
+ ],
+ [
+ 70,
+ 268
+ ],
+ [
+ 80,
+ 274
+ ],
+ [
+ 89,
+ 282
+ ],
+ [
+ 96,
+ 288
+ ],
+ [
+ 100,
+ 289
+ ],
+ [
+ 101,
+ 289
+ ],
+ [
+ 102,
+ 288
+ ],
+ [
+ 102,
+ 286
+ ],
+ [
+ 102,
+ 283
+ ],
+ [
+ 102,
+ 278
+ ],
+ [
+ 103,
+ 272
+ ],
+ [
+ 110,
+ 264
+ ],
+ [
+ 117,
+ 256
+ ],
+ [
+ 123,
+ 252
+ ],
+ [
+ 130,
+ 243
+ ],
+ [
+ 135,
+ 237
+ ],
+ [
+ 136,
+ 236
+ ],
+ [
+ 137,
+ 235
+ ],
+ [
+ 139,
+ 233
+ ],
+ [
+ 143,
+ 229
+ ],
+ [
+ 147,
+ 228
+ ],
+ [
+ 151,
+ 225
+ ],
+ [
+ 158,
+ 222
+ ],
+ [
+ 163,
+ 220
+ ],
+ [
+ 164,
+ 219
+ ],
+ [
+ 166,
+ 216
+ ],
+ [
+ 169,
+ 205
+ ],
+ [
+ 172,
+ 194
+ ],
+ [
+ 176,
+ 180
+ ],
+ [
+ 178,
+ 175
+ ],
+ [
+ 179,
+ 171
+ ],
+ [
+ 181,
+ 166
+ ],
+ [
+ 184,
+ 160
+ ],
+ [
+ 189,
+ 148
+ ],
+ [
+ 191,
+ 144
+ ],
+ [
+ 192,
+ 143
+ ],
+ [
+ 192,
+ 142
+ ],
+ [
+ 194,
+ 137
+ ],
+ [
+ 199,
+ 127
+ ],
+ [
+ 202,
+ 119
+ ],
+ [
+ 203,
+ 115
+ ],
+ [
+ 204,
+ 113
+ ],
+ [
+ 204,
+ 109
+ ],
+ [
+ 204,
+ 101
+ ],
+ [
+ 205,
+ 90
+ ],
+ [
+ 203,
+ 82
+ ],
+ [
+ 201,
+ 74
+ ],
+ [
+ 201,
+ 73
+ ],
+ [
+ 200,
+ 72
+ ],
+ [
+ 196,
+ 68
+ ],
+ [
+ 192,
+ 65
+ ],
+ [
+ 188,
+ 61
+ ],
+ [
+ 186,
+ 58
+ ],
+ [
+ 185,
+ 57
+ ],
+ [
+ 183,
+ 55
+ ],
+ [
+ 181,
+ 53
+ ],
+ [
+ 177,
+ 48
+ ],
+ [
+ 174,
+ 46
+ ],
+ [
+ 173,
+ 45
+ ],
+ [
+ 171,
+ 44
+ ],
+ [
+ 163,
+ 40
+ ],
+ [
+ 157,
+ 37
+ ],
+ [
+ 150,
+ 34
+ ],
+ [
+ 146,
+ 30
+ ],
+ [
+ 144,
+ 29
+ ],
+ [
+ 143,
+ 29
+ ],
+ [
+ 142,
+ 27
+ ],
+ [
+ 137,
+ 20
+ ],
+ [
+ 132,
+ 11
+ ],
+ [
+ 127,
+ 2
+ ],
+ [
+ 122,
+ -9
+ ],
+ [
+ 121,
+ -11
+ ],
+ [
+ 121,
+ -12
+ ],
+ [
+ 118,
+ -12
+ ],
+ [
+ 116,
+ -12
+ ],
+ [
+ 115,
+ -12
+ ],
+ [
+ 114,
+ -12
+ ],
+ [
+ 112,
+ -14
+ ],
+ [
+ 104,
+ -18
+ ],
+ [
+ 97,
+ -24
+ ],
+ [
+ 88,
+ -29
+ ],
+ [
+ 83,
+ -32
+ ],
+ [
+ 79,
+ -33
+ ],
+ [
+ 77,
+ -34
+ ],
+ [
+ 76,
+ -34
+ ],
+ [
+ 75,
+ -34
+ ],
+ [
+ 72,
+ -34
+ ],
+ [
+ 69,
+ -33
+ ],
+ [
+ 65,
+ -33
+ ],
+ [
+ 59,
+ -33
+ ],
+ [
+ 54,
+ -33
+ ],
+ [
+ 45,
+ -32
+ ],
+ [
+ 38,
+ -28
+ ],
+ [
+ 29,
+ -23
+ ],
+ [
+ 22,
+ -16
+ ],
+ [
+ 15,
+ -10
+ ],
+ [
+ 11,
+ -8
+ ],
+ [
+ 9,
+ -6
+ ],
+ [
+ 4,
+ 1
+ ],
+ [
+ 1,
+ 11
+ ],
+ [
+ 0,
+ 18
+ ],
+ [
+ -2,
+ 25
+ ],
+ [
+ -4,
+ 29
+ ],
+ [
+ -4,
+ 30
+ ],
+ [
+ -5,
+ 30
+ ],
+ [
+ -6,
+ 27
+ ],
+ [
+ -9,
+ 25
+ ],
+ [
+ -11,
+ 23
+ ],
+ [
+ -11,
+ 24
+ ],
+ [
+ -12,
+ 27
+ ],
+ [
+ -17,
+ 32
+ ],
+ [
+ -18,
+ 32
+ ],
+ [
+ -20,
+ 32
+ ],
+ [
+ -21,
+ 30
+ ],
+ [
+ -24,
+ 28
+ ],
+ [
+ -26,
+ 27
+ ],
+ [
+ -30,
+ 26
+ ],
+ [
+ -38,
+ 22
+ ],
+ [
+ -40,
+ 20
+ ],
+ [
+ -42,
+ 18
+ ],
+ [
+ -42,
+ 18
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 173,
+ "versionNonce": 1516352179,
+ "isDeleted": false,
+ "id": "byhLi6Jak_cr7nwB-mUf3",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 242.8125,
+ "y": 235.546875,
+ "strokeColor": "#c92a2a",
+ "backgroundColor": "transparent",
+ "width": 134,
+ "height": 113,
+ "seed": 1260135155,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1666952624073,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 2
+ ],
+ [
+ -1,
+ 4
+ ],
+ [
+ -2,
+ 8
+ ],
+ [
+ -4,
+ 13
+ ],
+ [
+ -5,
+ 19
+ ],
+ [
+ -5,
+ 30
+ ],
+ [
+ -4,
+ 36
+ ],
+ [
+ -4,
+ 38
+ ],
+ [
+ -4,
+ 39
+ ],
+ [
+ -3,
+ 36
+ ],
+ [
+ 0,
+ 32
+ ],
+ [
+ 3,
+ 28
+ ],
+ [
+ 6,
+ 25
+ ],
+ [
+ 7,
+ 24
+ ],
+ [
+ 9,
+ 24
+ ],
+ [
+ 13,
+ 23
+ ],
+ [
+ 15,
+ 20
+ ],
+ [
+ 18,
+ 18
+ ],
+ [
+ 21,
+ 17
+ ],
+ [
+ 22,
+ 17
+ ],
+ [
+ 24,
+ 19
+ ],
+ [
+ 25,
+ 25
+ ],
+ [
+ 24,
+ 29
+ ],
+ [
+ 22,
+ 34
+ ],
+ [
+ 18,
+ 39
+ ],
+ [
+ 14,
+ 44
+ ],
+ [
+ 11,
+ 47
+ ],
+ [
+ 10,
+ 48
+ ],
+ [
+ 9,
+ 48
+ ],
+ [
+ 6,
+ 50
+ ],
+ [
+ 2,
+ 55
+ ],
+ [
+ -1,
+ 58
+ ],
+ [
+ -2,
+ 58
+ ],
+ [
+ -6,
+ 58
+ ],
+ [
+ -12,
+ 55
+ ],
+ [
+ -14,
+ 53
+ ],
+ [
+ -15,
+ 52
+ ],
+ [
+ -17,
+ 51
+ ],
+ [
+ -15,
+ 55
+ ],
+ [
+ -13,
+ 58
+ ],
+ [
+ -12,
+ 59
+ ],
+ [
+ -12,
+ 58
+ ],
+ [
+ -13,
+ 55
+ ],
+ [
+ -13,
+ 52
+ ],
+ [
+ -13,
+ 48
+ ],
+ [
+ -13,
+ 46
+ ],
+ [
+ -11,
+ 43
+ ],
+ [
+ -9,
+ 43
+ ],
+ [
+ -6,
+ 43
+ ],
+ [
+ -4,
+ 43
+ ],
+ [
+ -1,
+ 46
+ ],
+ [
+ -1,
+ 48
+ ],
+ [
+ 0,
+ 52
+ ],
+ [
+ 0,
+ 56
+ ],
+ [
+ 0,
+ 58
+ ],
+ [
+ 0,
+ 60
+ ],
+ [
+ 1,
+ 62
+ ],
+ [
+ 2,
+ 64
+ ],
+ [
+ 2,
+ 66
+ ],
+ [
+ 2,
+ 69
+ ],
+ [
+ 2,
+ 71
+ ],
+ [
+ 2,
+ 76
+ ],
+ [
+ 2,
+ 80
+ ],
+ [
+ 2,
+ 83
+ ],
+ [
+ 2,
+ 86
+ ],
+ [
+ 2,
+ 87
+ ],
+ [
+ 3,
+ 88
+ ],
+ [
+ 4,
+ 90
+ ],
+ [
+ 6,
+ 95
+ ],
+ [
+ 7,
+ 98
+ ],
+ [
+ 8,
+ 101
+ ],
+ [
+ 8,
+ 102
+ ],
+ [
+ 8,
+ 101
+ ],
+ [
+ 8,
+ 98
+ ],
+ [
+ 8,
+ 87
+ ],
+ [
+ 8,
+ 81
+ ],
+ [
+ 8,
+ 78
+ ],
+ [
+ 9,
+ 78
+ ],
+ [
+ 11,
+ 82
+ ],
+ [
+ 12,
+ 83
+ ],
+ [
+ 12,
+ 87
+ ],
+ [
+ 12,
+ 91
+ ],
+ [
+ 12,
+ 94
+ ],
+ [
+ 12,
+ 96
+ ],
+ [
+ 12,
+ 98
+ ],
+ [
+ 12,
+ 99
+ ],
+ [
+ 13,
+ 104
+ ],
+ [
+ 15,
+ 107
+ ],
+ [
+ 16,
+ 110
+ ],
+ [
+ 16,
+ 112
+ ],
+ [
+ 17,
+ 113
+ ],
+ [
+ 18,
+ 113
+ ],
+ [
+ 19,
+ 109
+ ],
+ [
+ 20,
+ 105
+ ],
+ [
+ 21,
+ 103
+ ],
+ [
+ 23,
+ 101
+ ],
+ [
+ 24,
+ 101
+ ],
+ [
+ 25,
+ 101
+ ],
+ [
+ 26,
+ 101
+ ],
+ [
+ 27,
+ 102
+ ],
+ [
+ 28,
+ 102
+ ],
+ [
+ 32,
+ 103
+ ],
+ [
+ 37,
+ 104
+ ],
+ [
+ 43,
+ 105
+ ],
+ [
+ 49,
+ 106
+ ],
+ [
+ 53,
+ 106
+ ],
+ [
+ 57,
+ 107
+ ],
+ [
+ 59,
+ 107
+ ],
+ [
+ 60,
+ 107
+ ],
+ [
+ 60,
+ 104
+ ],
+ [
+ 60,
+ 100
+ ],
+ [
+ 60,
+ 96
+ ],
+ [
+ 60,
+ 91
+ ],
+ [
+ 60,
+ 90
+ ],
+ [
+ 61,
+ 90
+ ],
+ [
+ 62,
+ 90
+ ],
+ [
+ 64,
+ 90
+ ],
+ [
+ 66,
+ 93
+ ],
+ [
+ 66,
+ 94
+ ],
+ [
+ 68,
+ 94
+ ],
+ [
+ 69,
+ 94
+ ],
+ [
+ 71,
+ 94
+ ],
+ [
+ 75,
+ 91
+ ],
+ [
+ 83,
+ 85
+ ],
+ [
+ 90,
+ 79
+ ],
+ [
+ 95,
+ 73
+ ],
+ [
+ 99,
+ 68
+ ],
+ [
+ 102,
+ 65
+ ],
+ [
+ 104,
+ 61
+ ],
+ [
+ 107,
+ 57
+ ],
+ [
+ 108,
+ 55
+ ],
+ [
+ 110,
+ 53
+ ],
+ [
+ 111,
+ 52
+ ],
+ [
+ 111,
+ 49
+ ],
+ [
+ 111,
+ 48
+ ],
+ [
+ 111,
+ 46
+ ],
+ [
+ 111,
+ 45
+ ],
+ [
+ 111,
+ 44
+ ],
+ [
+ 111,
+ 42
+ ],
+ [
+ 112,
+ 39
+ ],
+ [
+ 113,
+ 30
+ ],
+ [
+ 115,
+ 22
+ ],
+ [
+ 117,
+ 16
+ ],
+ [
+ 117,
+ 15
+ ],
+ [
+ 117,
+ 14
+ ],
+ [
+ 117,
+ 13
+ ],
+ [
+ 115,
+ 13
+ ],
+ [
+ 109,
+ 18
+ ],
+ [
+ 105,
+ 24
+ ],
+ [
+ 101,
+ 31
+ ],
+ [
+ 99,
+ 34
+ ],
+ [
+ 101,
+ 34
+ ],
+ [
+ 102,
+ 34
+ ],
+ [
+ 105,
+ 37
+ ],
+ [
+ 106,
+ 38
+ ],
+ [
+ 107,
+ 39
+ ],
+ [
+ 108,
+ 40
+ ],
+ [
+ 109,
+ 43
+ ],
+ [
+ 109,
+ 46
+ ],
+ [
+ 109,
+ 48
+ ],
+ [
+ 109,
+ 54
+ ],
+ [
+ 107,
+ 57
+ ],
+ [
+ 104,
+ 62
+ ],
+ [
+ 101,
+ 66
+ ],
+ [
+ 98,
+ 67
+ ],
+ [
+ 98,
+ 68
+ ],
+ [
+ 97,
+ 68
+ ],
+ [
+ 95,
+ 65
+ ],
+ [
+ 92,
+ 60
+ ],
+ [
+ 92,
+ 58
+ ],
+ [
+ 92,
+ 58
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#FFF"
+ }
+}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/draws/2022-10-28-11-25-20.excalidraw b/second/semester1/logseq-stuff/draws/2022-10-28-11-25-20.excalidraw
new file mode 100644
index 00000000..c9943780
--- /dev/null
+++ b/second/semester1/logseq-stuff/draws/2022-10-28-11-25-20.excalidraw
@@ -0,0 +1,1321 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "file://",
+ "elements": [
+ {
+ "type": "line",
+ "version": 23,
+ "versionNonce": 1941381733,
+ "isDeleted": false,
+ "id": "yvWaWYUkWRQb9hIzKbVOX",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 192.8125,
+ "y": 163.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 42,
+ "height": 49,
+ "seed": 1791484733,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 42,
+ -49
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 32,
+ "versionNonce": 546202219,
+ "isDeleted": false,
+ "id": "kEicRRx29H6NOIWpsKrIZ",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 234.8125,
+ "y": 115.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 61,
+ "height": 2,
+ "seed": 2022655645,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 61,
+ -2
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 59,
+ "versionNonce": 1070566853,
+ "isDeleted": false,
+ "id": "-hijp5yq9dv3zU9taQIG9",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 191.8125,
+ "y": 165.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 82,
+ "height": 2,
+ "seed": 1845398227,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 82,
+ 2
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 41,
+ "versionNonce": 286055691,
+ "isDeleted": false,
+ "id": "SlmqGw9yUDX0pmtX4uHiY",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 265.8125,
+ "y": 163.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 27,
+ "height": 43,
+ "seed": 659951283,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 27,
+ -43
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 35,
+ "versionNonce": 2021887269,
+ "isDeleted": false,
+ "id": "Rw0TY8Wlt_CCKBeJW_Tta",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 193.8125,
+ "y": 167.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 2,
+ "height": 60,
+ "seed": 945715187,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 2,
+ 60
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 55,
+ "versionNonce": 1831011243,
+ "isDeleted": false,
+ "id": "QxFFRRgfpUxWKyuE17KUW",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 191.8125,
+ "y": 223.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 80,
+ "height": 3,
+ "seed": 302691411,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 80,
+ 3
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 40,
+ "versionNonce": 759210117,
+ "isDeleted": false,
+ "id": "_gkobFjBxh3gu1tAe6ZYR",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 262.8125,
+ "y": 221.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 1,
+ "height": 51,
+ "seed": 940148979,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -1,
+ -51
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 45,
+ "versionNonce": 1023104587,
+ "isDeleted": false,
+ "id": "XK9yGsPzp0zLx2zGpYn64",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 267.8125,
+ "y": 217.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 30,
+ "height": 40,
+ "seed": 1490033181,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 30,
+ -40
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 38,
+ "versionNonce": 600066021,
+ "isDeleted": false,
+ "id": "j-3HwtVLKQpT9JUeG8Zyb",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 291.8125,
+ "y": 121.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 3,
+ "height": 57,
+ "seed": 404638109,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 3,
+ 57
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 46,
+ "versionNonce": 527455467,
+ "isDeleted": false,
+ "id": "uHDtZRnexpuXhrdCqfhUN",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 196.8125,
+ "y": 218.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 38,
+ "height": 34,
+ "seed": 485827763,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 38,
+ -34
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 68,
+ "versionNonce": 236716869,
+ "isDeleted": false,
+ "id": "DCvbuNGvQi799Um599bPt",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 227.8125,
+ "y": 184.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 62,
+ "height": 6,
+ "seed": 2072343421,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 62,
+ -6
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 46,
+ "versionNonce": 1946976139,
+ "isDeleted": false,
+ "id": "72d9zoxuBCrIPvjtEplv3",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 231.8125,
+ "y": 116.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 4,
+ "height": 63,
+ "seed": 679206461,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -4,
+ 63
+ ]
+ ]
+ },
+ {
+ "type": "ellipse",
+ "version": 62,
+ "versionNonce": 10834597,
+ "isDeleted": false,
+ "id": "CUJibKSw6thH5mkQd9UQO",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 377.8125,
+ "y": 185.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 19,
+ "height": 19,
+ "seed": 304531603,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 57,
+ "versionNonce": 1158305323,
+ "isDeleted": false,
+ "id": "f0HO3nvDJJCPeYMZrQ3UY",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 431.8125,
+ "y": 235.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 16,
+ "height": 17,
+ "seed": 644365139,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 64,
+ "versionNonce": 671987205,
+ "isDeleted": false,
+ "id": "qtB2ZbzYZ7IR3ZW-9CA_W",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 491.8125,
+ "y": 243.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 14,
+ "height": 17,
+ "seed": 401148797,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 55,
+ "versionNonce": 1901353163,
+ "isDeleted": false,
+ "id": "WHTsZNTKK-LdB8TEEvL61",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 421.8125,
+ "y": 287.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 17,
+ "height": 13,
+ "seed": 1694211357,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 73,
+ "versionNonce": 1062382949,
+ "isDeleted": false,
+ "id": "dmoQkJ5hUT92iNEgem4GL",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 481.8125,
+ "y": 292.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 14,
+ "height": 14,
+ "seed": 1593326451,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 61,
+ "versionNonce": 377816939,
+ "isDeleted": false,
+ "id": "s_FM0khZu-PG-IE-VuGmb",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 360.8125,
+ "y": 318.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 8,
+ "height": 12,
+ "seed": 685153373,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 84,
+ "versionNonce": 1170323653,
+ "isDeleted": false,
+ "id": "LuiPoReZCSt4K3dAnpGH5",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 504.8125,
+ "y": 331.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 17,
+ "height": 19,
+ "seed": 1426475283,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 51,
+ "versionNonce": 988209675,
+ "isDeleted": false,
+ "id": "Op3RQpMfp3LG6A4B_j7Uv",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 555.8125,
+ "y": 177.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 22,
+ "height": 18,
+ "seed": 948623955,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "line",
+ "version": 66,
+ "versionNonce": 1962432549,
+ "isDeleted": false,
+ "id": "xzCDjiBbGLsZLnJPwF74V",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 396.8125,
+ "y": 194.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 157,
+ "height": 4,
+ "seed": 325122909,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 157,
+ -4
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 76,
+ "versionNonce": 930375851,
+ "isDeleted": false,
+ "id": "ibNSJIcpOMNqK8HBYIr6c",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 384.8125,
+ "y": 203.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 25,
+ "height": 113,
+ "seed": 516956509,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -25,
+ 113
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 106,
+ "versionNonce": 1994656645,
+ "isDeleted": false,
+ "id": "wpuSuXJy2N3BnEbW6-q9k",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 367.8125,
+ "y": 327.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 129,
+ "height": 16,
+ "seed": 1317670205,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 129,
+ 16
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 71,
+ "versionNonce": 1641552715,
+ "isDeleted": false,
+ "id": "xDT4GrQZk-elMBMm4Gtqf",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 514.8125,
+ "y": 329.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 47,
+ "height": 130,
+ "seed": 652550077,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 47,
+ -130
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 65,
+ "versionNonce": 1539461861,
+ "isDeleted": false,
+ "id": "z6oorwrd5qjeb8pEG5oDz",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 439.8125,
+ "y": 245.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 11,
+ "height": 42,
+ "seed": 1398400947,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -11,
+ 42
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 50,
+ "versionNonce": 1986820587,
+ "isDeleted": false,
+ "id": "qljDCoDwQjQRkPP9SAHiu",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 440.8125,
+ "y": 294.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 40,
+ "height": 9,
+ "seed": 2005148317,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 40,
+ 9
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 49,
+ "versionNonce": 1344319045,
+ "isDeleted": false,
+ "id": "60HDTNYeEU6xAIXjzdSYT",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 493.8125,
+ "y": 290.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 4,
+ "height": 33,
+ "seed": 443676061,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 4,
+ -33
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 93,
+ "versionNonce": 1111229579,
+ "isDeleted": false,
+ "id": "eIT9YIGz_KdH4jou8asr1",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 490.8125,
+ "y": 249.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 45,
+ "height": 9,
+ "seed": 1086166547,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -45,
+ -9
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 72,
+ "versionNonce": 316448165,
+ "isDeleted": false,
+ "id": "0_kME3iJSdL1Kk9-LW42E",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 432.8125,
+ "y": 238.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 39,
+ "height": 36,
+ "seed": 878211475,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -39,
+ -36
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 67,
+ "versionNonce": 218184491,
+ "isDeleted": false,
+ "id": "Wozt3F4wIn74MRP-RoJOJ",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 426.8125,
+ "y": 300.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 69,
+ "height": 24,
+ "seed": 1244532851,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -69,
+ 24
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 103,
+ "versionNonce": 723755269,
+ "isDeleted": false,
+ "id": "Uj9tL5aUD4OW-xtt0OKD-",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 491.8125,
+ "y": 300.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 16,
+ "height": 40,
+ "seed": 945883709,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 16,
+ 40
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 95,
+ "versionNonce": 1715722832,
+ "isDeleted": false,
+ "id": "CBqTDJT1XGQex387m1cVV",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 323.8125,
+ "y": 114.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 331.9595947265625,
+ "height": 25,
+ "seed": 319754493,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1701910600883,
+ "link": null,
+ "locked": false,
+ "fontSize": 20,
+ "fontFamily": 1,
+ "text": "Picture of a cube - has 6 faces.",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "Picture of a cube - has 6 faces.",
+ "lineHeight": 1.25,
+ "baseline": 18
+ },
+ {
+ "type": "text",
+ "version": 149,
+ "versionNonce": 1949938352,
+ "isDeleted": false,
+ "id": "Kcie8gw3FVG_HOdZoI4h2",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 361.8125,
+ "y": 396.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 444.85943603515625,
+ "height": 25,
+ "seed": 160254611,
+ "groupIds": [],
+ "roundness": null,
+ "boundElements": [],
+ "updated": 1701910600884,
+ "link": null,
+ "locked": false,
+ "fontSize": 20,
+ "fontFamily": 1,
+ "text": "It is also a graph - that also has 4 faces.",
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "It is also a graph - that also has 4 faces.",
+ "lineHeight": 1.25,
+ "baseline": 18
+ },
+ {
+ "type": "line",
+ "version": 35,
+ "versionNonce": 1606855787,
+ "isDeleted": false,
+ "id": "sQN-Mf4y1UPkBbfmCRCWF",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 499.41168212890625,
+ "y": 245.362548828125,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 59.336669921875,
+ "height": 52.946502685546875,
+ "seed": 2035601968,
+ "groupIds": [],
+ "roundness": {
+ "type": 2
+ },
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 59.336669921875,
+ -52.946502685546875
+ ]
+ ]
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#FFF"
+ }
+}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/draws/2022-10-28-11-38-31.excalidraw b/second/semester1/logseq-stuff/draws/2022-10-28-11-38-31.excalidraw
new file mode 100644
index 00000000..4289982b
--- /dev/null
+++ b/second/semester1/logseq-stuff/draws/2022-10-28-11-38-31.excalidraw
@@ -0,0 +1,10 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "https://logseq.com",
+ "elements": [],
+ "appState": {
+ "viewBackgroundColor": "#FFF",
+ "gridSize": null
+ }
+}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/journals/2022_10_20.md b/second/semester1/logseq-stuff/journals/2022_10_20.md
new file mode 100644
index 00000000..4e38b76a
--- /dev/null
+++ b/second/semester1/logseq-stuff/journals/2022_10_20.md
@@ -0,0 +1,6 @@
+- 
+- 
+- 
+- 
+- 
+- 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_10.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_10.md
new file mode 100644
index 00000000..c4362916
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_10.md
@@ -0,0 +1,31 @@
+- DONE Migrate Entirely to Logseq
+ :LOGBOOK:
+ CLOCK: [2022-09-10 Sat 13:49:57]--[2022-09-11 Sun 00:19:31] => 10:29:34
+ :END:
+ - DONE [[CT255 - Next Generation Technologies II]]
+ :LOGBOOK:
+ CLOCK: [2022-09-10 Sat 13:49:51]--[2022-09-10 Sat 13:50:39] => 00:00:48
+ CLOCK: [2022-09-10 Sat 13:50:40]--[2022-09-10 Sat 13:50:41] => 00:00:01
+ CLOCK: [2022-09-10 Sat 13:50:42]--[2022-09-10 Sat 13:50:47] => 00:00:05
+ CLOCK: [2022-09-10 Sat 13:50:52]--[2022-09-10 Sat 13:50:53] => 00:00:01
+ CLOCK: [2022-09-10 Sat 13:50:54]--[2022-09-10 Sat 13:50:56] => 00:00:02
+ CLOCK: [2022-09-10 Sat 13:50:58]--[2022-09-10 Sat 13:50:58] => 00:00:00
+ CLOCK: [2022-09-10 Sat 13:50:59]--[2022-09-10 Sat 17:27:55] => 03:36:56
+ :END:
+ - DONE [[ST2001 - Statistics in Data Science I]]
+ - DONE [[MA284 - Discrete Mathematics]]
+ :LOGBOOK:
+ CLOCK: [2022-09-10 Sat 22:16:59]--[2022-09-10 Sat 22:27:54] => 00:10:55
+ :END:
+ - DONE [[CT213 - Computer Systems & Organisation]]
+ - DONE [[ CT230 - Database Systems I]]
+ - DONE [[CT216 - Software Engineering I]]
+ :LOGBOOK:
+ CLOCK: [2022-09-10 Sat 22:49:58]--[2022-09-10 Sat 23:02:44] => 00:12:46
+ :END:
+ - DONE [[CT2106 - Object-Oriented Programming]]
+ :LOGBOOK:
+ CLOCK: [2022-09-10 Sat 23:02:54]--[2022-09-10 Sat 23:03:46] => 00:00:52
+ :END:
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_11.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_11.md
new file mode 100644
index 00000000..4badb79a
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_11.md
@@ -0,0 +1,15 @@
+- DONE Learn set notation in katex
+- DONE Check ST2001 survey stats
+ :LOGBOOK:
+ CLOCK: [2022-09-11 Sun 09:22:57]--[2022-09-11 Sun 09:24:00] => 00:01:03
+ :END:
+- DONE Check ST2001 Blackboard for assignments
+ :LOGBOOK:
+ CLOCK: [2022-09-11 Sun 09:23:02]--[2022-09-11 Sun 09:33:05] => 00:10:03
+ :END:
+ - DONE Do assignment
+- DONE Laundry
+ :LOGBOOK:
+ CLOCK: [2022-09-11 Sun 17:35:54]
+ :END:
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_13.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_13.md
new file mode 100644
index 00000000..f7ff9d86
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_13.md
@@ -0,0 +1,10 @@
+- By the end of the week:
+ - DONE achieve flashcard 0
+- DONE CT2106 Notes
+ :LOGBOOK:
+ CLOCK: [2022-09-13 Tue 12:45:14]--[2022-09-13 Tue 12:45:16] => 00:00:02
+ :END:
+- TODO Get card activated
+- TODO pick MA284 tutorial
+- TODO do MA284 exercises
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_14.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_14.md
new file mode 100644
index 00000000..19e82061
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_14.md
@@ -0,0 +1,10 @@
+- DONE CT230 Notes
+ :LOGBOOK:
+ CLOCK: [2022-09-14 Wed 11:41:04]--[2022-09-14 Wed 18:01:05] => 06:20:01
+ :END:
+- DONE MA284 Notes
+- DONE add definition for semantic integrity constraints
+ :LOGBOOK:
+ CLOCK: [2022-09-14 Wed 18:09:33]--[2022-09-14 Wed 18:17:23] => 00:07:50
+ :END:
+- TODO fla
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_15.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_15.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_15.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_16.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_16.md
new file mode 100644
index 00000000..265b99b3
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_16.md
@@ -0,0 +1,5 @@
+- :LOGBOOK:
+ CLOCK: [2022-09-16 Fri 09:06:48]--[2022-09-17 Sat 15:38:37] => 30:31:49
+ :END:
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_17.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_17.md
new file mode 100644
index 00000000..6c8a9a14
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_17.md
@@ -0,0 +1,4 @@
+-
+- ## Medium Priority
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_18.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_18.md
new file mode 100644
index 00000000..7d1196e7
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_18.md
@@ -0,0 +1,31 @@
+- ## High Priority
+ - TODO MA284 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-17 Sat 15:45:51]
+ CLOCK: [2022-09-17 Sat 15:47:59]--[2022-09-17 Sat 18:50:09] => 03:02:10
+ :END:
+ - Leave last 5 questions until I've seen the notes on them.
+ - TODO Software Engineering Project Proof of Concept
+ - TODO Flashcard 0
+ - DONE Set up CT230 Database
+ :LOGBOOK:
+ CLOCK: [2022-09-17 Sat 18:52:52]--[2022-09-17 Sat 19:02:55] => 00:10:03
+ :END:
+ - TODO Merge PDFs from Week 1 and Week 2
+ - TODO PDF unite script
+-
+- ## Subjects
+ - ### CT213
+ - DONE CT213 Notes - Due Monday
+ :LOGBOOK:
+ CLOCK: [2022-09-18 Sun 00:51:10]--[2022-09-19 Mon 17:36:26] => 40:45:16
+ :END:
+ - TODO CT213 Lab Materials - Due Tuesday
+ - ### CT230
+ - TODO CT230 Notes - Due Tuesday
+ - TODO CT230 Lab Materials - Due Tuesday
+ - ### CT255
+ - DONE CT255 Notes - Due Monday
+ - ### MA284
+ - TODO MA284 Assignment - Due 3rd October
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_19.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_19.md
new file mode 100644
index 00000000..915bcec1
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_19.md
@@ -0,0 +1,7 @@
+- DONE ST2001 Lab
+- DONE ST2001 Assignment 2
+- DONE find st2001 lab
+- DONE ct213 notes
+- DONE ct255 notes
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_20.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_20.md
new file mode 100644
index 00000000..a82ff496
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_20.md
@@ -0,0 +1,25 @@
+- # Today's Work
+ - #### CT2106
+ - LATER CT2106 Lab Assignment
+ - #### CT230
+ - DONE CT230 Notes
+ - TODO CT230 Lab Assignment
+ :LOGBOOK:
+ CLOCK: [2022-09-20 Tue 09:22:54]--[2022-09-20 Tue 10:35:49] => 01:12:55
+ CLOCK: [2022-09-20 Tue 18:10:23]--[2022-09-20 Tue 18:13:34] => 00:03:11
+ CLOCK: [2022-09-20 Tue 18:14:08]--[2022-09-20 Tue 18:14:09] => 00:00:01
+ CLOCK: [2022-09-20 Tue 18:14:09]--[2022-09-20 Tue 18:14:10] => 00:00:01
+ CLOCK: [2022-09-20 Tue 18:14:10]--[2022-09-20 Tue 18:14:11] => 00:00:01
+ CLOCK: [2022-09-20 Tue 18:14:11]--[2022-09-20 Tue 18:14:12] => 00:00:01
+ :END:
+ -
+-
+- # Tomorrow's Work
+ - #### MA284
+ - TODO MA284 Notes
+ - TODO MA284 Assignment
+ - #### CT255
+ - TODO CT255 Lab Assignment
+ - #### CT213
+ - TODO CT213 Lab Assignment
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_21.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_21.md
new file mode 100644
index 00000000..04ebf1c9
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_21.md
@@ -0,0 +1,13 @@
+- DONE MA284 Slides
+- DONE CT230 slides, if any
+-
+- DONE MA284 Homework
+ - very nearly almost done
+ -
+- DONE Finish CT213 Assignment
+ - low priority
+ -
+- TODO CT2106 Assignment
+-
+- DONE CT255 Lab?
+- DONE CT213 lab
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_23.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_23.md
new file mode 100644
index 00000000..ca0e519b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_23.md
@@ -0,0 +1,22 @@
+- Ideally, we would be finished this all by the Monday 00:00
+- ## CT2106
+ - TODO Finish Week 3 Topic - Variables & OOP Modelling
+ - TODO Lecture 5 Slides
+ - TODO Lecture 6 Slides
+ - TODO Assignment 1 - Due 2022-09-30 11:59 (1 Week)
+-
+- ## CT213
+ - TODO Quiz 3
+ :LOGBOOK:
+ CLOCK: [2022-09-23 Fri 20:13:00]--[2022-09-23 Fri 20:13:23] => 00:00:23
+ :END:
+ -
+- ## CT230
+ - TODO Finish Lab Problem Sheet 1
+-
+- ## CT255
+ - TODO Assignment 1 - A Reflective Review on GDPR - Due 2022-09-30 23:59
+-
+- ## ST2001
+ - TODO Finish Topic Data Collection & Study Design
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_24.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_24.md
new file mode 100644
index 00000000..d17592f3
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_24.md
@@ -0,0 +1,11 @@
+- Idea for 日本語 かんじ input:
+ - # Kanji
+ - ## 日 (for example) # card
+ - **おん Reading:** ひ。
+ - **くん Reading:** に。
+ - **Meaning:** Sun, day.
+ - **Strokes:** 5.
+ - ### Vocabulary
+ - **日曜日 ->** Sunday.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_25.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_25.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_25.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_26.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_26.md
new file mode 100644
index 00000000..dd2a822f
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_26.md
@@ -0,0 +1,17 @@
+- ## Assignments
+ - DOING Finish CT2106 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 17:48:37]--[2022-09-27 Tue 20:08:34] => 26:19:57
+ CLOCK: [2022-09-27 Tue 20:08:37]
+ :END:
+ - DONE Finish Code
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:03:43]--[2022-09-26 Mon 16:03:45] => 00:00:02
+ :END:
+ - DOING Make PDF
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 09:31:32]--[2022-09-27 Tue 20:08:33] => 10:37:01
+ CLOCK: [2022-09-27 Tue 20:08:39]
+ :END:
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_27.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_27.md
new file mode 100644
index 00000000..0ee115a2
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_27.md
@@ -0,0 +1,28 @@
+- # 大学
+ - ##
+ - ## CT213
+ - DONE CT213 Quiz 4
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 09:47:43]--[2022-09-27 Tue 09:48:45] => 00:01:02
+ CLOCK: [2022-09-27 Tue 09:48:47]--[2022-09-27 Tue 09:48:48] => 00:00:01
+ :END:
+ - TODO CT213 Lab 4 - 明日
+ - ## CT230
+ collapsed:: true
+ - DONE `SELECT`: Working with strings & subqueries slides
+ - DONE CT230 Lab Week 4 - Problem Sheet 2
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 12:56:14]--[2022-09-27 Tue 16:06:20] => 03:10:06
+ :END:
+ - DONE Sample Test 1
+ -
+ - ## CT255
+ - TODO Reflective Assignment 1 - 2022年09月30日 11時59分。
+ - TODO Next Week's lecture notes - optional
+ - ## MA284
+ collapsed:: true
+ - TODO Assignment 2 - optional for now
+ - TODO Combinatorial Proofs Lecture Slides - optional
+ - ## ST2001
+ - TODO Lab Assignment Week 4
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_28.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_28.md
new file mode 100644
index 00000000..d650bd2f
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_28.md
@@ -0,0 +1,26 @@
+- # 大学
+ - ## レクチャス
+ - ### CT230
+ - DONE Lecture Notes
+ :LOGBOOK:
+ CLOCK: [2022-09-28 Wed 20:26:22]--[2022-09-28 Wed 20:26:22] => 00:00:00
+ :END:
+ - ### MA284
+ :LOGBOOK:
+ CLOCK: [2022-09-28 Wed 20:26:26]--[2022-09-28 Wed 20:26:26] => 00:00:00
+ :END:
+ - DONE Lecture Notes
+ :LOGBOOK:
+ CLOCK: [2022-09-28 Wed 20:26:31]--[2022-09-28 Wed 20:26:32] => 00:00:01
+ :END:
+ - ## Assignments
+ - ### CT2106
+ - DONE Assignment 1
+ - DONE Write code
+ :LOGBOOK:
+ CLOCK: [2022-09-28 Wed 10:31:50]
+ :END:
+ - DONE Finish PDF
+ - ### CT213
+ - TODO Lab Assignment 4
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_29.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_29.md
new file mode 100644
index 00000000..441f24d8
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_09_29.md
@@ -0,0 +1,31 @@
+- # 大学
+ - ## CT255
+ - TODO ^^CT255 Assignment 1^^
+ - TODO Problem 1
+ - TODO Part 1
+ - TODO Part 2
+ - DONE Problem 2
+ :LOGBOOK:
+ CLOCK: [2022-09-29 Thu 16:49:43]--[2022-09-29 Thu 16:49:44] => 00:00:01
+ :END:
+ - TODO Human Security Slides (very low priority).
+ - ## MA284
+ - TODO Assignment 2
+ - TODO Take notes from annotated slides
+ - TODO Finish combinatorial proofs slides
+ - ## CT213
+ - TODO Quiz Week 4
+ - TODO Week 4 Lab
+ - ## CT216
+ - DONE XP Notes
+ :LOGBOOK:
+ CLOCK: [2022-09-29 Thu 15:21:56]--[2022-09-29 Thu 15:21:59] => 00:00:03
+ :END:
+ - ## CT230
+ - TODO Practice Quiz
+ - TODO Revise for quiz
+ - ## ST2001
+ - TODO Week 4 lab
+-
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_03.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_03.md
new file mode 100644
index 00000000..96bb819c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_03.md
@@ -0,0 +1,14 @@
+- # 大学
+ - ## CT213
+ - TODO Lecture Notes
+ - TODO Exercises?
+ - TODO Quiz
+ - ## ST2001
+ - TODO Finish Probability Slides
+ - DONE ST2001 Assignment 3 - 2022年10月13日 15:00。
+ :LOGBOOK:
+ CLOCK: [2022-10-03 Mon 18:14:55]--[2022-10-04 Tue 13:02:51] => 18:47:56
+ :END:
+ - ## MA284
+ - TODO Assignment 2 - 2022年10月14日。
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_04.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_04.md
new file mode 100644
index 00000000..095b11f9
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_04.md
@@ -0,0 +1,2 @@
+- goal: get to & stay on flashcard zero by the end of each day.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_06.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_06.md
new file mode 100644
index 00000000..7498bceb
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_06.md
@@ -0,0 +1,7 @@
+- ## Assignments
+ - TODO CT2106 Assignment 2
+- ## Good to do
+ - TODO CT213 Lab 3
+ - TODO Fingerprint scanner
+ - TODO Finish Probability notes
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_08.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_08.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_08.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_11.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_11.md
new file mode 100644
index 00000000..b0ace232
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_11.md
@@ -0,0 +1,7 @@
+- DONE CT2106 Assignment 2 - 2022年10月14日 23:59。
+- DONE MA284 Assignment 2 - 2022年10月14日 23:00。
+ :LOGBOOK:
+ CLOCK: [2022-10-14 Fri 16:13:16]--[2022-10-14 Fri 16:13:21] => 00:00:05
+ :END:
+- TODO CT255 Assignment "1" - Breaking Hash Functions - 2022年10月23日 23:50。
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_14.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_14.md
new file mode 100644
index 00000000..eba12642
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_14.md
@@ -0,0 +1 @@
+- petition to rename abjads to bjds
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_17.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_17.md
new file mode 100644
index 00000000..e31360a3
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_17.md
@@ -0,0 +1,10 @@
+- # 大学
+ - ## Ongoing
+ - DONE CT255 Assignment 1 - Breaking Hash Functions. Due: 2022年10月23日 23:59。
+ - DONE ST2001 Assignment 4. Due: 2022年10月27日 15:00。
+ :LOGBOOK:
+ CLOCK: [2022-10-20 Thu 16:18:09]--[2022-10-20 Thu 16:18:10] => 00:00:01
+ :END:
+ - DONE CT2106 Assignment 3. Due: 2022年10月28日 23:59。
+ - DONE CT255 Assignment 2 - Rainbow Tables. Due: 2022年10月30日 23:59。
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_18.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_18.md
new file mode 100644
index 00000000..c70d130d
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_18.md
@@ -0,0 +1,3 @@
+- https://www.earthcam.com/world/ireland/dublin/?cam=templebar
+- https://yewtu.be/watch?v=i3Lzj3sS-wg
+- https://www.tepco.co.jp/decommission/progress/about/livecamera/index-j.html
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_19.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_19.md
new file mode 100644
index 00000000..bf878b57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_19.md
@@ -0,0 +1,2 @@
+- finish advance pie
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_21.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_21.md
new file mode 100644
index 00000000..24b6fd5c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_21.md
@@ -0,0 +1,6 @@
+- | **Time** | **Activity** |
+ | 1415 | Leave for station |
+ | 1440 | Get on train |
+ | 1505 | Be on train|
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_24.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_24.md
new file mode 100644
index 00000000..4742f24e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_24.md
@@ -0,0 +1,14 @@
+- TODO CT213 Last week's slides
+ - TODO Download
+ - TODO take notes
+-
+- # Tasks (In Order of Importance)
+ - TODO CT255 Assignment 2 - Rainbow Tables. Due: 2022年11月01日 23:59。
+ - TODO CT213 Assignment 1. Due 2022年11月04日 17:00。
+ - TODO MA284 Assignment 3. Due: 2022年11月04日 23:00。
+ :LOGBOOK:
+ CLOCK: [2022-10-26 Wed 10:09:57]--[2022-10-27 Thu 10:05:58] => 23:56:01
+ :END:
+-
+- **CT213 Idea:** store the count of late trains etc. and visualize em using grafana
+ background-color:: pink
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_25.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_25.md
new file mode 100644
index 00000000..4ee97b25
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_25.md
@@ -0,0 +1,4 @@
+- TODO CT230 Notes
+- DONE CT230 Lab
+- TODO ST2001 Lab
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_27.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_27.md
new file mode 100644
index 00000000..b2064811
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_27.md
@@ -0,0 +1,7 @@
+- # プラン 「2022年10月27日」。
+ - TODO CT2106 Assignment 3
+ :LOGBOOK:
+ CLOCK: [2022-10-27 Thu 14:13:22]
+ :END:
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_28.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_28.md
new file mode 100644
index 00000000..0923da22
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_28.md
@@ -0,0 +1,3 @@
+- TODO CT2106 Assignment 3
+- TODO CT230 MCQ
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_31.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_31.md
new file mode 100644
index 00000000..e4f84d19
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_10_31.md
@@ -0,0 +1,6 @@
+- # チャーリ・バンズ。
+ - look for bible
+ - bell jar
+ - the trouble with being born
+ - phenomenology of spirit
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_02.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_02.md
new file mode 100644
index 00000000..6f27523b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_02.md
@@ -0,0 +1,17 @@
+- # Assignments
+ - ## 今週
+ - DONE MA284 Assignment 3. Due: 2022年11月04日 17:00。
+ :LOGBOOK:
+ CLOCK: [2022-11-03 Thu 11:29:46]--[2022-11-05 Sat 15:46:52] => 52:17:06
+ :END:
+ - DONE CT213 Assignment 1. Due 2022年11月04日 17:00。
+ :LOGBOOK:
+ CLOCK: [2022-11-03 Thu 11:29:42]--[2022-11-03 Thu 11:29:44] => 00:00:02
+ :END:
+ - ## 未来
+ - TODO ST2001 Assignment 5. Due 2022年11月10日 15:00。
+ - TODO CT255 Assignment 3. Due 2022年11月13日 23:59。
+ - TODO CT2106 Assignment 4. Due 2022年11月18日 23:59。
+- # Lecture Notes
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_05.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_05.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_06.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_06.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_06.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_07.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_07.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_07.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_08.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_08.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_08.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_10.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_10.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_11.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_11.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_13.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_13.md
new file mode 100644
index 00000000..b4b0481c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_13.md
@@ -0,0 +1,6 @@
+- # Highest Priority
+ - DONE Fix CT255 Assignment.
+ - DONE ST2001 Assignment 5. Due: 2022-11-14 15:00.
+ background-color:: red
+ - DONE Laundry
+ - DONE Tidy room
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_14.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_14.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_15.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_15.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_16.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_16.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_17.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_17.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_18.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_18.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_19.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_19.md
new file mode 100644
index 00000000..51d8a115
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_19.md
@@ -0,0 +1,25 @@
+- # ストフ:
+ - ## 今週
+ - TODO CT213 Assignment 2. Due: 2022-11-25 17:00.
+ background-color:: yellow
+ - TODO Writeup.
+ - TODO MA284 Assignment 5. Due: 2022-11-25 17:00.
+ background-color:: red
+ :LOGBOOK:
+ CLOCK: [2022-11-18 Fri 17:24:46]--[2022-11-18 Fri 18:20:24] => 00:55:38
+ CLOCK: [2022-11-19 Sat 17:48:39]--[2022-11-21 Mon 07:33:03] => 37:44:24
+ :END:
+ - TODO CT255 Assignment 4. Due: 2022-11-25 23:59.
+ background-color:: red
+ :LOGBOOK:
+ CLOCK: [2022-11-16 Wed 18:55:47]--[2022-11-17 Thu 09:08:37] => 14:12:50
+ :END:
+ - ## Later
+ - TODO ST2001 Final Assignment. Due: 2022-11-28 15:00.
+ background-color:: red
+ - TODO ST2001 Sample Exam. Due: 2022-12-14 23:59.
+ background-color:: yellow
+ -
+- # タスク。
+ - TODO Studenet leap card
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_20.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_20.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_20.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_21.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_21.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_22.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_22.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_22.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_23.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_23.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_24.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_24.md
new file mode 100644
index 00000000..a637c013
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_24.md
@@ -0,0 +1,22 @@
+- # ストフ:
+ - ## 今週
+ - TODO CT213 Assignment 2. Due: 2022-11-25 17:00. (Do Wednesday).
+ background-color:: yellow
+ - DONE Finish Application.
+ - TODO Writeup.
+ - TODO CT255 Assignment 4. Due: 2022-11-25 23:59.
+ background-color:: red
+ :LOGBOOK:
+ CLOCK: [2022-11-16 Wed 18:55:47]--[2022-11-17 Thu 09:08:37] => 14:12:50
+ :END:
+ - ## Later
+ - TODO ST2001 Final Assignment. Due: 2022-11-28 15:00.
+ background-color:: red
+ - TODO ST2001 Sample Exam. Due: 2022-12-14 23:59.
+ background-color:: yellow
+ -
+- | **日** | **Task** |
+ | 木曜日 | CT213 Assignment 2 |
+ | 金曜日 | CT255 Assignment 4 |
+ | 金曜日 | 日本語 |
+ | 土曜日 | ST2001 Final Assignment |
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_25.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_25.md
new file mode 100644
index 00000000..66bd2244
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_25.md
@@ -0,0 +1,2 @@
+- slowdive music video, mars argo, ukiyo by oceans ate alaska, inspiral carpets, sleep deprivation, up til 5am, ancient youtube videos and shiey freedom, trainhopping dying llama, stealing beer, maths homework, texting miska, sneaking out at 4am, ripstik, cold air,
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_27.md b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_27.md
new file mode 100644
index 00000000..2f1175e5
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/journals_2022_11_27.md
@@ -0,0 +1,6 @@
+- General Study Plan:
+ - Flashcard 0 everyday.
+ - Study a subject per day.
+ - Revise subject slides.
+ - Do exam paper.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal%2Fuibk%2Flocal%2F0.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal%2Fuibk%2Flocal%2F0.md
new file mode 100644
index 00000000..66b7e7fe
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal%2Fuibk%2Flocal%2F0.md
@@ -0,0 +1,3 @@
+title:: : https://dbis-uibk.github.io/relax/calc/local/uibk/local/0
+
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal%2Fuibk%2Flocal.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal%2Fuibk%2Flocal.md
new file mode 100644
index 00000000..3d84c246
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal%2Fuibk%2Flocal.md
@@ -0,0 +1 @@
+title:: : https://dbis-uibk.github.io/relax/calc/local/uibk/local
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal%2Fuibk.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal%2Fuibk.md
new file mode 100644
index 00000000..53d36028
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal%2Fuibk.md
@@ -0,0 +1 @@
+title:: : https://dbis-uibk.github.io/relax/calc/local/uibk
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal.md
new file mode 100644
index 00000000..a3eefc97
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc%2Flocal.md
@@ -0,0 +1 @@
+title:: : https://dbis-uibk.github.io/relax/calc/local
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc.md
new file mode 100644
index 00000000..6e4a03d2
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax%2Fcalc.md
@@ -0,0 +1 @@
+title:: : https://dbis-uibk.github.io/relax/calc
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax.md
new file mode 100644
index 00000000..18e32937
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io%2Frelax.md
@@ -0,0 +1 @@
+title:: : https://dbis-uibk.github.io/relax
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io.md
new file mode 100644
index 00000000..a7a5634f
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A%2F%2Fdbis-uibk.github.io.md
@@ -0,0 +1 @@
+title:: : https://dbis-uibk.github.io
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_%3A https%3A.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_Chapter 11 かんじ.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_Chapter 11 かんじ.md
new file mode 100644
index 00000000..0296026a
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_Chapter 11 かんじ.md
@@ -0,0 +1,8 @@
+- # 目 #card
+ - **目** (め、チク) -> eye(s).
+ - **科目** (かもく) -> subject.
+ - **注目** (ちゅうまく) -> attention.
+- # 見 #card
+ - **見る** (みーる) -> look, see.
+ - **花見** (はなみ) -> flower, viewing.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_Composition & Scenarios.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_Composition & Scenarios.md
new file mode 100644
index 00000000..4965ae3e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_Composition & Scenarios.md
@@ -0,0 +1,6 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:**
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_MA284 Assignment 1.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_MA284 Assignment 1.md
new file mode 100644
index 00000000..48043590
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_MA284 Assignment 1.md
@@ -0,0 +1,2 @@
+- ##
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_Study Timetable.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_Study Timetable.md
new file mode 100644
index 00000000..006b06bf
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_Study Timetable.md
@@ -0,0 +1,11 @@
+- #Timetables
+- | **Day** | **Subject** | **Extra-Curricular** |
+ | :--- | :----: | ---: |
+ | Monday | [[CT213 - Computer Systems & Organisation]] | |
+ | Tuesday | [[CT230 - Database Systems I]] | |
+ | Wednesday | [[MA284 - Discrete Mathematics]] | [[Irish Sign Language]] |
+ | Thursday | [[CT216 - Software Engineering I]] | |
+ | Friday | [[CT2106 - Object-Oriented Programming]] | [[]] |
+ | Saturday | [[ST2001 - Statistics in Data Science I]] | |
+ | Sunday | [[CT255 - Next Generation Technologies II]] | |
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_Timetables.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_Timetables.md
new file mode 100644
index 00000000..a79d06dc
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_Timetables.md
@@ -0,0 +1,2 @@
+- [[Study Timetable]]
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_University Todo.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_University Todo.md
new file mode 100644
index 00000000..0ce74795
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_University Todo.md
@@ -0,0 +1,18 @@
+- #[[Second Year University]]
+- ## CT2106 - Object-Oriented Programming
+ - DONE Short Exercise in Week One folder
+ -
+- ## CT213 - Computer Systems & Organisation
+ - DONE Quiz 1 (not graded)
+ - TODO Quiz 2 (not graded)
+-
+- ## CT216 - Software Engineering I
+-
+- ## CT230 - Database Systems I
+-
+- ## MA284 - Discrete Mathematics
+-
+- ## ST2001 - Statistics for Data Science I
+ - DONE Datacamp: Introduction to R
+ - DONE Lab 1: Using R as a Calculator
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_duck addresses.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_duck addresses.md
new file mode 100644
index 00000000..3cf20d57
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_duck addresses.md
@@ -0,0 +1 @@
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_hls__ct255_02_1663458790357_0.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_hls__ct255_02_1663458790357_0.md
new file mode 100644
index 00000000..8cbafacf
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_hls__ct255_02_1663458790357_0.md
@@ -0,0 +1,3 @@
+file-path:: ../assets/ct255_02_1663458790357_0.pdf
+file:: [ct255_02_1663458790357_0.pdf](../assets/ct255_02_1663458790357_0.pdf)
+title:: hls__ct255_02_1663458790357_0
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_must not interfere with other program's use of I%2FO devices..md b/second/semester1/logseq-stuff/logseq/.recycle/pages_must not interfere with other program's use of I%2FO devices..md
new file mode 100644
index 00000000..d06186e7
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/.recycle/pages_must not interfere with other program's use of I%2FO devices..md
@@ -0,0 +1,3 @@
+title:: must not interfere with other program's use of I/O devices.
+
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/.recycle/pages_sequences to read.md b/second/semester1/logseq-stuff/logseq/.recycle/pages_sequences to read.md
new file mode 100644
index 00000000..e69de29b
diff --git a/second/semester1/logseq-stuff/logseq/bak/assets/Lecture01_1662828507609_0/2022-09-10T17_04_33.830Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/assets/Lecture01_1662828507609_0/2022-09-10T17_04_33.830Z.Desktop.edn
new file mode 100644
index 00000000..c6a04b69
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/assets/Lecture01_1662828507609_0/2022-09-10T17_04_33.830Z.Desktop.edn
@@ -0,0 +1 @@
+{:highlights [{:id #uuid "631cc39c-051b-437e-8a65-326995871c13", :page 27, :position {:bounding {:x1 407.4342346191406, :y1 109.45645141601562, :x2 543.2783813476562, :y2 136.45645141601562, :width 983.9999999999999, :height 553.5}, :rects ({:x1 407.4342346191406, :y1 109.45645141601562, :x2 543.2783813476562, :y2 136.45645141601562, :width 983.9999999999999, :height 553.5}), :page 27}, :content {:text "torage locatio"}, :properties {:color "yellow"}}]}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/assets/ct255_02_1663458790357_0/2022-09-18T11_45_29.419Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/assets/ct255_02_1663458790357_0/2022-09-18T11_45_29.419Z.Desktop.edn
new file mode 100644
index 00000000..7618b16b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/assets/ct255_02_1663458790357_0/2022-09-18T11_45_29.419Z.Desktop.edn
@@ -0,0 +1 @@
+{:highlights [{:id #uuid "632704cc-60cb-429f-a0de-8ec41e5ed5c4", :page 54, :position {:bounding {:x1 314.5216064453125, :y1 229.361083984375, :x2 416.1688232421875, :y2 266.3611145019531, :width 821, :height 615.75}, :rects ({:x1 314.5216064453125, :y1 229.361083984375, :x2 416.1688232421875, :y2 266.3611145019531, :width 821, :height 615.75}), :page 54}, :content {:text "PSMTEL"}, :properties {:color "yellow"}}]}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/draws/2022-10-28-11-04-05/2023-12-07T00_56_40.948Z.Desktop.excalidraw b/second/semester1/logseq-stuff/logseq/bak/draws/2022-10-28-11-04-05/2023-12-07T00_56_40.948Z.Desktop.excalidraw
new file mode 100644
index 00000000..3a9c663a
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/draws/2022-10-28-11-04-05/2023-12-07T00_56_40.948Z.Desktop.excalidraw
@@ -0,0 +1,3902 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "file://",
+ "elements": [
+ {
+ "type": "ellipse",
+ "version": 53,
+ "versionNonce": 1818893619,
+ "isDeleted": false,
+ "id": "Ola4dz3PdvKp0K46hoX5_",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 204.8125,
+ "y": -1756.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 36,
+ "height": 35,
+ "seed": 1687240509,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 73,
+ "versionNonce": 2092417917,
+ "isDeleted": false,
+ "id": "9OsOaiiGL--t-xmlIrD_S",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 161.8125,
+ "y": -1657.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 25,
+ "height": 29,
+ "seed": 539022205,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 116,
+ "versionNonce": 506855123,
+ "isDeleted": false,
+ "id": "arnjzo5sjumfFIdbBHjgE",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 221.8125,
+ "y": -1634.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 34,
+ "height": 32,
+ "seed": 1676320637,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 49,
+ "versionNonce": 122440669,
+ "isDeleted": false,
+ "id": "d62qiI1sIZpbzb6RMlnbq",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 288.8125,
+ "y": -1665.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 42,
+ "height": 39,
+ "seed": 335584605,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 44,
+ "versionNonce": 458534003,
+ "isDeleted": false,
+ "id": "TRbdzIJMlaEYeRBmOA_E7",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 203.8125,
+ "y": -1567.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 45,
+ "height": 35,
+ "seed": 1585753309,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "line",
+ "version": 43,
+ "versionNonce": 1928382525,
+ "isDeleted": false,
+ "id": "WwwyUvngbQ2cNMUnROQqx",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 216.8125,
+ "y": -1723.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 35,
+ "height": 72,
+ "seed": 1351806739,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -35,
+ 72
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 41,
+ "versionNonce": 126658067,
+ "isDeleted": false,
+ "id": "cU6iNn3AM6IDnBp-8_wgT",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 229.8125,
+ "y": -1721.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 8,
+ "height": 86,
+ "seed": 445664947,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 8,
+ 86
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 46,
+ "versionNonce": 25606301,
+ "isDeleted": false,
+ "id": "UaH-zmMDHlHtcYTMcMCtO",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 238.8125,
+ "y": -1734.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 65,
+ "height": 72,
+ "seed": 641927347,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 65,
+ 72
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 35,
+ "versionNonce": 1238657971,
+ "isDeleted": false,
+ "id": "A_utsEwp6kGp_5fas8Ha5",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 175.8125,
+ "y": -1628.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 38,
+ "height": 70,
+ "seed": 1570085565,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 38,
+ 70
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 61,
+ "versionNonce": 1019190525,
+ "isDeleted": false,
+ "id": "cRmUYcBg874_3JY-dNsPC",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 233.2663976870291,
+ "y": -1605.4203744186275,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 6.453897687029098,
+ "height": 42.40474941862749,
+ "seed": 710416285,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -6.453897687029098,
+ 42.40474941862749
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 52,
+ "versionNonce": 642940243,
+ "isDeleted": false,
+ "id": "JAF70GMh22UvAbBKp3RGA",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 308.8125,
+ "y": -1624.015625,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 63,
+ "height": 57,
+ "seed": 2118793075,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -63,
+ 57
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 115,
+ "versionNonce": 2082272605,
+ "isDeleted": false,
+ "id": "uDzdur2XBcFc_KlI91l-n",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 338.8125,
+ "y": -1748.015625,
+ "strokeColor": "#c92a2a",
+ "backgroundColor": "transparent",
+ "width": 373,
+ "height": 25,
+ "seed": 277701299,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "fontSize": 20,
+ "fontFamily": 1,
+ "text": "Planar representation of above graph",
+ "baseline": 18,
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "Planar representation of above graph"
+ },
+ {
+ "type": "freedraw",
+ "version": 174,
+ "versionNonce": 408771315,
+ "isDeleted": false,
+ "id": "izvKxJzi6JCp38U5i6li0",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 203.8125,
+ "y": -1671.015625,
+ "strokeColor": "#c92a2a",
+ "backgroundColor": "transparent",
+ "width": 30,
+ "height": 134,
+ "seed": 122937875,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 1,
+ -1
+ ],
+ [
+ 2,
+ -3
+ ],
+ [
+ 4,
+ -5
+ ],
+ [
+ 5,
+ -6
+ ],
+ [
+ 7,
+ -7
+ ],
+ [
+ 10,
+ -8
+ ],
+ [
+ 12,
+ -10
+ ],
+ [
+ 14,
+ -11
+ ],
+ [
+ 17,
+ -13
+ ],
+ [
+ 18,
+ -14
+ ],
+ [
+ 19,
+ -17
+ ],
+ [
+ 19,
+ -20
+ ],
+ [
+ 19,
+ -23
+ ],
+ [
+ 19,
+ -26
+ ],
+ [
+ 19,
+ -28
+ ],
+ [
+ 18,
+ -30
+ ],
+ [
+ 17,
+ -31
+ ],
+ [
+ 15,
+ -35
+ ],
+ [
+ 12,
+ -37
+ ],
+ [
+ 11,
+ -38
+ ],
+ [
+ 10,
+ -38
+ ],
+ [
+ 8,
+ -38
+ ],
+ [
+ 7,
+ -36
+ ],
+ [
+ 5,
+ -32
+ ],
+ [
+ 4,
+ -29
+ ],
+ [
+ 2,
+ -24
+ ],
+ [
+ 1,
+ -15
+ ],
+ [
+ 1,
+ -12
+ ],
+ [
+ -1,
+ -2
+ ],
+ [
+ -2,
+ 0
+ ],
+ [
+ -4,
+ 7
+ ],
+ [
+ -5,
+ 10
+ ],
+ [
+ -5,
+ 14
+ ],
+ [
+ -5,
+ 19
+ ],
+ [
+ -5,
+ 22
+ ],
+ [
+ -5,
+ 24
+ ],
+ [
+ -2,
+ 24
+ ],
+ [
+ 1,
+ 23
+ ],
+ [
+ 4,
+ 21
+ ],
+ [
+ 8,
+ 16
+ ],
+ [
+ 10,
+ 14
+ ],
+ [
+ 11,
+ 14
+ ],
+ [
+ 10,
+ 15
+ ],
+ [
+ 8,
+ 18
+ ],
+ [
+ 5,
+ 23
+ ],
+ [
+ 2,
+ 28
+ ],
+ [
+ -2,
+ 35
+ ],
+ [
+ -4,
+ 37
+ ],
+ [
+ -8,
+ 42
+ ],
+ [
+ -8,
+ 43
+ ],
+ [
+ -7,
+ 42
+ ],
+ [
+ -5,
+ 39
+ ],
+ [
+ 0,
+ 32
+ ],
+ [
+ 5,
+ 25
+ ],
+ [
+ 10,
+ 17
+ ],
+ [
+ 13,
+ 12
+ ],
+ [
+ 15,
+ 10
+ ],
+ [
+ 16,
+ 10
+ ],
+ [
+ 17,
+ 8
+ ],
+ [
+ 18,
+ 8
+ ],
+ [
+ 19,
+ 6
+ ],
+ [
+ 20,
+ 3
+ ],
+ [
+ 21,
+ 1
+ ],
+ [
+ 22,
+ 1
+ ],
+ [
+ 21,
+ 4
+ ],
+ [
+ 16,
+ 12
+ ],
+ [
+ 12,
+ 17
+ ],
+ [
+ 9,
+ 21
+ ],
+ [
+ 7,
+ 25
+ ],
+ [
+ 4,
+ 30
+ ],
+ [
+ 1,
+ 35
+ ],
+ [
+ 0,
+ 37
+ ],
+ [
+ -2,
+ 39
+ ],
+ [
+ -2,
+ 40
+ ],
+ [
+ -2,
+ 42
+ ],
+ [
+ -2,
+ 46
+ ],
+ [
+ -2,
+ 47
+ ],
+ [
+ -2,
+ 50
+ ],
+ [
+ -2,
+ 51
+ ],
+ [
+ 2,
+ 45
+ ],
+ [
+ 6,
+ 38
+ ],
+ [
+ 10,
+ 33
+ ],
+ [
+ 12,
+ 29
+ ],
+ [
+ 13,
+ 28
+ ],
+ [
+ 14,
+ 28
+ ],
+ [
+ 15,
+ 28
+ ],
+ [
+ 16,
+ 28
+ ],
+ [
+ 16,
+ 32
+ ],
+ [
+ 17,
+ 34
+ ],
+ [
+ 17,
+ 36
+ ],
+ [
+ 15,
+ 40
+ ],
+ [
+ 13,
+ 44
+ ],
+ [
+ 10,
+ 47
+ ],
+ [
+ 7,
+ 51
+ ],
+ [
+ 5,
+ 52
+ ],
+ [
+ 5,
+ 54
+ ],
+ [
+ 5,
+ 55
+ ],
+ [
+ 5,
+ 56
+ ],
+ [
+ 6,
+ 55
+ ],
+ [
+ 8,
+ 53
+ ],
+ [
+ 9,
+ 52
+ ],
+ [
+ 10,
+ 52
+ ],
+ [
+ 10,
+ 51
+ ],
+ [
+ 11,
+ 52
+ ],
+ [
+ 11,
+ 55
+ ],
+ [
+ 11,
+ 57
+ ],
+ [
+ 11,
+ 59
+ ],
+ [
+ 10,
+ 60
+ ],
+ [
+ 9,
+ 64
+ ],
+ [
+ 8,
+ 66
+ ],
+ [
+ 8,
+ 69
+ ],
+ [
+ 7,
+ 73
+ ],
+ [
+ 8,
+ 72
+ ],
+ [
+ 9,
+ 72
+ ],
+ [
+ 10,
+ 72
+ ],
+ [
+ 11,
+ 72
+ ],
+ [
+ 13,
+ 71
+ ],
+ [
+ 15,
+ 71
+ ],
+ [
+ 16,
+ 70
+ ],
+ [
+ 18,
+ 70
+ ],
+ [
+ 21,
+ 72
+ ],
+ [
+ 21,
+ 75
+ ],
+ [
+ 22,
+ 80
+ ],
+ [
+ 22,
+ 83
+ ],
+ [
+ 22,
+ 85
+ ],
+ [
+ 22,
+ 89
+ ],
+ [
+ 22,
+ 92
+ ],
+ [
+ 21,
+ 94
+ ],
+ [
+ 21,
+ 96
+ ],
+ [
+ 19,
+ 95
+ ],
+ [
+ 16,
+ 94
+ ],
+ [
+ 13,
+ 92
+ ],
+ [
+ 12,
+ 91
+ ],
+ [
+ 8,
+ 90
+ ],
+ [
+ 7,
+ 89
+ ],
+ [
+ 1,
+ 83
+ ],
+ [
+ -1,
+ 80
+ ],
+ [
+ -4,
+ 76
+ ],
+ [
+ -4,
+ 74
+ ],
+ [
+ -4,
+ 71
+ ],
+ [
+ -4,
+ 66
+ ],
+ [
+ -4,
+ 63
+ ],
+ [
+ -4,
+ 61
+ ],
+ [
+ -4,
+ 60
+ ],
+ [
+ -3,
+ 59
+ ],
+ [
+ -2,
+ 57
+ ],
+ [
+ 1,
+ 54
+ ],
+ [
+ 2,
+ 52
+ ],
+ [
+ 2,
+ 51
+ ],
+ [
+ 3,
+ 51
+ ],
+ [
+ 3,
+ 50
+ ],
+ [
+ 3,
+ 49
+ ],
+ [
+ 4,
+ 45
+ ],
+ [
+ 4,
+ 39
+ ],
+ [
+ 5,
+ 34
+ ],
+ [
+ 7,
+ 31
+ ],
+ [
+ 8,
+ 29
+ ],
+ [
+ 9,
+ 27
+ ],
+ [
+ 10,
+ 26
+ ],
+ [
+ 11,
+ 25
+ ],
+ [
+ 12,
+ 23
+ ],
+ [
+ 12,
+ 19
+ ],
+ [
+ 12,
+ 16
+ ],
+ [
+ 11,
+ 11
+ ],
+ [
+ 9,
+ 8
+ ],
+ [
+ 8,
+ 6
+ ],
+ [
+ 6,
+ 3
+ ],
+ [
+ 6,
+ 1
+ ],
+ [
+ 6,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 199,
+ "versionNonce": 720388541,
+ "isDeleted": false,
+ "id": "7pN7FuMR7rOz72OUaUJC8",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 240.8125,
+ "y": -1714.015625,
+ "strokeColor": "#5f3dc4",
+ "backgroundColor": "transparent",
+ "width": 51,
+ "height": 120,
+ "seed": 862789853,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 1,
+ 0
+ ],
+ [
+ 2,
+ 1
+ ],
+ [
+ 3,
+ 4
+ ],
+ [
+ 3,
+ 8
+ ],
+ [
+ 3,
+ 9
+ ],
+ [
+ 3,
+ 14
+ ],
+ [
+ 2,
+ 17
+ ],
+ [
+ 1,
+ 20
+ ],
+ [
+ 0,
+ 23
+ ],
+ [
+ -2,
+ 28
+ ],
+ [
+ -2,
+ 29
+ ],
+ [
+ -2,
+ 30
+ ],
+ [
+ 0,
+ 28
+ ],
+ [
+ 1,
+ 26
+ ],
+ [
+ 3,
+ 24
+ ],
+ [
+ 4,
+ 23
+ ],
+ [
+ 6,
+ 23
+ ],
+ [
+ 10,
+ 23
+ ],
+ [
+ 12,
+ 23
+ ],
+ [
+ 13,
+ 23
+ ],
+ [
+ 15,
+ 23
+ ],
+ [
+ 16,
+ 23
+ ],
+ [
+ 17,
+ 23
+ ],
+ [
+ 17,
+ 25
+ ],
+ [
+ 17,
+ 28
+ ],
+ [
+ 14,
+ 34
+ ],
+ [
+ 12,
+ 38
+ ],
+ [
+ 11,
+ 38
+ ],
+ [
+ 10,
+ 41
+ ],
+ [
+ 9,
+ 43
+ ],
+ [
+ 8,
+ 45
+ ],
+ [
+ 9,
+ 44
+ ],
+ [
+ 14,
+ 39
+ ],
+ [
+ 16,
+ 38
+ ],
+ [
+ 19,
+ 38
+ ],
+ [
+ 21,
+ 38
+ ],
+ [
+ 24,
+ 38
+ ],
+ [
+ 29,
+ 38
+ ],
+ [
+ 33,
+ 38
+ ],
+ [
+ 36,
+ 38
+ ],
+ [
+ 37,
+ 39
+ ],
+ [
+ 40,
+ 44
+ ],
+ [
+ 40,
+ 47
+ ],
+ [
+ 40,
+ 49
+ ],
+ [
+ 38,
+ 55
+ ],
+ [
+ 36,
+ 58
+ ],
+ [
+ 33,
+ 61
+ ],
+ [
+ 32,
+ 62
+ ],
+ [
+ 31,
+ 63
+ ],
+ [
+ 31,
+ 64
+ ],
+ [
+ 29,
+ 65
+ ],
+ [
+ 28,
+ 66
+ ],
+ [
+ 28,
+ 67
+ ],
+ [
+ 28,
+ 65
+ ],
+ [
+ 30,
+ 62
+ ],
+ [
+ 31,
+ 60
+ ],
+ [
+ 34,
+ 60
+ ],
+ [
+ 38,
+ 60
+ ],
+ [
+ 42,
+ 59
+ ],
+ [
+ 45,
+ 59
+ ],
+ [
+ 48,
+ 62
+ ],
+ [
+ 49,
+ 65
+ ],
+ [
+ 49,
+ 68
+ ],
+ [
+ 48,
+ 70
+ ],
+ [
+ 46,
+ 73
+ ],
+ [
+ 43,
+ 75
+ ],
+ [
+ 40,
+ 78
+ ],
+ [
+ 39,
+ 79
+ ],
+ [
+ 38,
+ 79
+ ],
+ [
+ 37,
+ 80
+ ],
+ [
+ 35,
+ 82
+ ],
+ [
+ 33,
+ 84
+ ],
+ [
+ 31,
+ 84
+ ],
+ [
+ 31,
+ 85
+ ],
+ [
+ 31,
+ 86
+ ],
+ [
+ 31,
+ 87
+ ],
+ [
+ 31,
+ 88
+ ],
+ [
+ 35,
+ 91
+ ],
+ [
+ 39,
+ 95
+ ],
+ [
+ 40,
+ 98
+ ],
+ [
+ 42,
+ 100
+ ],
+ [
+ 42,
+ 104
+ ],
+ [
+ 42,
+ 105
+ ],
+ [
+ 41,
+ 106
+ ],
+ [
+ 39,
+ 108
+ ],
+ [
+ 36,
+ 111
+ ],
+ [
+ 33,
+ 115
+ ],
+ [
+ 28,
+ 119
+ ],
+ [
+ 27,
+ 119
+ ],
+ [
+ 25,
+ 120
+ ],
+ [
+ 24,
+ 120
+ ],
+ [
+ 23,
+ 120
+ ],
+ [
+ 21,
+ 120
+ ],
+ [
+ 20,
+ 120
+ ],
+ [
+ 19,
+ 120
+ ],
+ [
+ 18,
+ 119
+ ],
+ [
+ 17,
+ 118
+ ],
+ [
+ 16,
+ 111
+ ],
+ [
+ 17,
+ 100
+ ],
+ [
+ 19,
+ 83
+ ],
+ [
+ 22,
+ 66
+ ],
+ [
+ 23,
+ 64
+ ],
+ [
+ 24,
+ 62
+ ],
+ [
+ 22,
+ 58
+ ],
+ [
+ 19,
+ 55
+ ],
+ [
+ 17,
+ 54
+ ],
+ [
+ 16,
+ 54
+ ],
+ [
+ 15,
+ 57
+ ],
+ [
+ 15,
+ 61
+ ],
+ [
+ 15,
+ 63
+ ],
+ [
+ 15,
+ 65
+ ],
+ [
+ 15,
+ 67
+ ],
+ [
+ 16,
+ 68
+ ],
+ [
+ 17,
+ 73
+ ],
+ [
+ 17,
+ 78
+ ],
+ [
+ 18,
+ 82
+ ],
+ [
+ 18,
+ 83
+ ],
+ [
+ 15,
+ 81
+ ],
+ [
+ 13,
+ 76
+ ],
+ [
+ 13,
+ 75
+ ],
+ [
+ 13,
+ 72
+ ],
+ [
+ 13,
+ 69
+ ],
+ [
+ 16,
+ 68
+ ],
+ [
+ 21,
+ 68
+ ],
+ [
+ 24,
+ 68
+ ],
+ [
+ 28,
+ 70
+ ],
+ [
+ 31,
+ 73
+ ],
+ [
+ 33,
+ 74
+ ],
+ [
+ 36,
+ 77
+ ],
+ [
+ 37,
+ 78
+ ],
+ [
+ 38,
+ 79
+ ],
+ [
+ 39,
+ 81
+ ],
+ [
+ 39,
+ 82
+ ],
+ [
+ 40,
+ 80
+ ],
+ [
+ 42,
+ 76
+ ],
+ [
+ 43,
+ 71
+ ],
+ [
+ 43,
+ 63
+ ],
+ [
+ 42,
+ 60
+ ],
+ [
+ 40,
+ 58
+ ],
+ [
+ 37,
+ 57
+ ],
+ [
+ 34,
+ 57
+ ],
+ [
+ 34,
+ 58
+ ],
+ [
+ 34,
+ 63
+ ],
+ [
+ 34,
+ 67
+ ],
+ [
+ 34,
+ 71
+ ],
+ [
+ 34,
+ 75
+ ],
+ [
+ 34,
+ 78
+ ],
+ [
+ 34,
+ 80
+ ],
+ [
+ 34,
+ 81
+ ],
+ [
+ 33,
+ 81
+ ],
+ [
+ 32,
+ 79
+ ],
+ [
+ 31,
+ 78
+ ],
+ [
+ 31,
+ 78
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 524,
+ "versionNonce": 1820034195,
+ "isDeleted": false,
+ "id": "m0KuxOh4leXRpFDPz1RpH",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 199.8125,
+ "y": -1774.015625,
+ "strokeColor": "#087f5b",
+ "backgroundColor": "transparent",
+ "width": 257,
+ "height": 300,
+ "seed": 301892755,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952998012,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -3,
+ 4
+ ],
+ [
+ -7,
+ 8
+ ],
+ [
+ -14,
+ 13
+ ],
+ [
+ -20,
+ 17
+ ],
+ [
+ -25,
+ 19
+ ],
+ [
+ -28,
+ 21
+ ],
+ [
+ -31,
+ 22
+ ],
+ [
+ -33,
+ 25
+ ],
+ [
+ -33,
+ 26
+ ],
+ [
+ -33,
+ 27
+ ],
+ [
+ -33,
+ 29
+ ],
+ [
+ -30,
+ 29
+ ],
+ [
+ -27,
+ 29
+ ],
+ [
+ -24,
+ 29
+ ],
+ [
+ -21,
+ 30
+ ],
+ [
+ -18,
+ 32
+ ],
+ [
+ -18,
+ 35
+ ],
+ [
+ -18,
+ 36
+ ],
+ [
+ -18,
+ 38
+ ],
+ [
+ -19,
+ 40
+ ],
+ [
+ -22,
+ 43
+ ],
+ [
+ -24,
+ 45
+ ],
+ [
+ -25,
+ 45
+ ],
+ [
+ -26,
+ 46
+ ],
+ [
+ -27,
+ 49
+ ],
+ [
+ -28,
+ 52
+ ],
+ [
+ -30,
+ 55
+ ],
+ [
+ -31,
+ 58
+ ],
+ [
+ -33,
+ 60
+ ],
+ [
+ -34,
+ 65
+ ],
+ [
+ -40,
+ 73
+ ],
+ [
+ -46,
+ 84
+ ],
+ [
+ -51,
+ 92
+ ],
+ [
+ -53,
+ 95
+ ],
+ [
+ -54,
+ 95
+ ],
+ [
+ -55,
+ 94
+ ],
+ [
+ -56,
+ 93
+ ],
+ [
+ -59,
+ 90
+ ],
+ [
+ -60,
+ 88
+ ],
+ [
+ -61,
+ 85
+ ],
+ [
+ -61,
+ 84
+ ],
+ [
+ -62,
+ 85
+ ],
+ [
+ -62,
+ 87
+ ],
+ [
+ -62,
+ 89
+ ],
+ [
+ -62,
+ 90
+ ],
+ [
+ -63,
+ 91
+ ],
+ [
+ -63,
+ 94
+ ],
+ [
+ -64,
+ 100
+ ],
+ [
+ -65,
+ 108
+ ],
+ [
+ -67,
+ 116
+ ],
+ [
+ -68,
+ 117
+ ],
+ [
+ -68,
+ 119
+ ],
+ [
+ -68,
+ 120
+ ],
+ [
+ -69,
+ 120
+ ],
+ [
+ -72,
+ 117
+ ],
+ [
+ -73,
+ 115
+ ],
+ [
+ -72,
+ 115
+ ],
+ [
+ -71,
+ 116
+ ],
+ [
+ -71,
+ 117
+ ],
+ [
+ -71,
+ 118
+ ],
+ [
+ -71,
+ 121
+ ],
+ [
+ -75,
+ 131
+ ],
+ [
+ -83,
+ 142
+ ],
+ [
+ -84,
+ 145
+ ],
+ [
+ -84,
+ 146
+ ],
+ [
+ -84,
+ 147
+ ],
+ [
+ -81,
+ 147
+ ],
+ [
+ -77,
+ 147
+ ],
+ [
+ -74,
+ 149
+ ],
+ [
+ -72,
+ 150
+ ],
+ [
+ -71,
+ 151
+ ],
+ [
+ -70,
+ 152
+ ],
+ [
+ -67,
+ 155
+ ],
+ [
+ -62,
+ 160
+ ],
+ [
+ -60,
+ 163
+ ],
+ [
+ -56,
+ 171
+ ],
+ [
+ -55,
+ 174
+ ],
+ [
+ -55,
+ 175
+ ],
+ [
+ -55,
+ 177
+ ],
+ [
+ -55,
+ 180
+ ],
+ [
+ -55,
+ 181
+ ],
+ [
+ -54,
+ 185
+ ],
+ [
+ -58,
+ 203
+ ],
+ [
+ -62,
+ 215
+ ],
+ [
+ -64,
+ 223
+ ],
+ [
+ -64,
+ 225
+ ],
+ [
+ -63,
+ 225
+ ],
+ [
+ -62,
+ 225
+ ],
+ [
+ -59,
+ 225
+ ],
+ [
+ -57,
+ 224
+ ],
+ [
+ -50,
+ 225
+ ],
+ [
+ -43,
+ 229
+ ],
+ [
+ -37,
+ 236
+ ],
+ [
+ -32,
+ 242
+ ],
+ [
+ -29,
+ 247
+ ],
+ [
+ -28,
+ 247
+ ],
+ [
+ -27,
+ 247
+ ],
+ [
+ -22,
+ 251
+ ],
+ [
+ -17,
+ 256
+ ],
+ [
+ -12,
+ 260
+ ],
+ [
+ -10,
+ 262
+ ],
+ [
+ -9,
+ 262
+ ],
+ [
+ -7,
+ 264
+ ],
+ [
+ -4,
+ 266
+ ],
+ [
+ -2,
+ 268
+ ],
+ [
+ -1,
+ 269
+ ],
+ [
+ 0,
+ 270
+ ],
+ [
+ 0,
+ 271
+ ],
+ [
+ 2,
+ 275
+ ],
+ [
+ 3,
+ 280
+ ],
+ [
+ 5,
+ 284
+ ],
+ [
+ 6,
+ 286
+ ],
+ [
+ 7,
+ 286
+ ],
+ [
+ 7,
+ 285
+ ],
+ [
+ 9,
+ 282
+ ],
+ [
+ 13,
+ 277
+ ],
+ [
+ 18,
+ 274
+ ],
+ [
+ 23,
+ 274
+ ],
+ [
+ 28,
+ 273
+ ],
+ [
+ 31,
+ 272
+ ],
+ [
+ 33,
+ 271
+ ],
+ [
+ 34,
+ 270
+ ],
+ [
+ 37,
+ 268
+ ],
+ [
+ 39,
+ 266
+ ],
+ [
+ 42,
+ 265
+ ],
+ [
+ 44,
+ 264
+ ],
+ [
+ 46,
+ 263
+ ],
+ [
+ 48,
+ 262
+ ],
+ [
+ 49,
+ 262
+ ],
+ [
+ 49,
+ 263
+ ],
+ [
+ 49,
+ 265
+ ],
+ [
+ 48,
+ 268
+ ],
+ [
+ 48,
+ 269
+ ],
+ [
+ 49,
+ 269
+ ],
+ [
+ 49,
+ 268
+ ],
+ [
+ 54,
+ 267
+ ],
+ [
+ 59,
+ 265
+ ],
+ [
+ 64,
+ 263
+ ],
+ [
+ 67,
+ 262
+ ],
+ [
+ 69,
+ 260
+ ],
+ [
+ 71,
+ 258
+ ],
+ [
+ 73,
+ 257
+ ],
+ [
+ 85,
+ 249
+ ],
+ [
+ 96,
+ 242
+ ],
+ [
+ 106,
+ 235
+ ],
+ [
+ 111,
+ 230
+ ],
+ [
+ 114,
+ 224
+ ],
+ [
+ 116,
+ 220
+ ],
+ [
+ 123,
+ 213
+ ],
+ [
+ 131,
+ 206
+ ],
+ [
+ 135,
+ 202
+ ],
+ [
+ 138,
+ 200
+ ],
+ [
+ 138,
+ 198
+ ],
+ [
+ 140,
+ 196
+ ],
+ [
+ 141,
+ 195
+ ],
+ [
+ 141,
+ 194
+ ],
+ [
+ 151,
+ 181
+ ],
+ [
+ 157,
+ 174
+ ],
+ [
+ 159,
+ 172
+ ],
+ [
+ 159,
+ 171
+ ],
+ [
+ 157,
+ 169
+ ],
+ [
+ 156,
+ 167
+ ],
+ [
+ 156,
+ 165
+ ],
+ [
+ 156,
+ 160
+ ],
+ [
+ 155,
+ 154
+ ],
+ [
+ 155,
+ 151
+ ],
+ [
+ 155,
+ 148
+ ],
+ [
+ 154,
+ 143
+ ],
+ [
+ 152,
+ 139
+ ],
+ [
+ 152,
+ 134
+ ],
+ [
+ 152,
+ 129
+ ],
+ [
+ 152,
+ 124
+ ],
+ [
+ 152,
+ 120
+ ],
+ [
+ 152,
+ 118
+ ],
+ [
+ 154,
+ 112
+ ],
+ [
+ 159,
+ 103
+ ],
+ [
+ 162,
+ 96
+ ],
+ [
+ 162,
+ 95
+ ],
+ [
+ 161,
+ 95
+ ],
+ [
+ 158,
+ 95
+ ],
+ [
+ 156,
+ 97
+ ],
+ [
+ 153,
+ 99
+ ],
+ [
+ 151,
+ 99
+ ],
+ [
+ 147,
+ 98
+ ],
+ [
+ 145,
+ 98
+ ],
+ [
+ 143,
+ 98
+ ],
+ [
+ 139,
+ 98
+ ],
+ [
+ 135,
+ 98
+ ],
+ [
+ 132,
+ 98
+ ],
+ [
+ 129,
+ 96
+ ],
+ [
+ 129,
+ 95
+ ],
+ [
+ 129,
+ 90
+ ],
+ [
+ 128,
+ 83
+ ],
+ [
+ 129,
+ 78
+ ],
+ [
+ 132,
+ 73
+ ],
+ [
+ 134,
+ 69
+ ],
+ [
+ 133,
+ 69
+ ],
+ [
+ 130,
+ 69
+ ],
+ [
+ 126,
+ 66
+ ],
+ [
+ 124,
+ 62
+ ],
+ [
+ 122,
+ 59
+ ],
+ [
+ 121,
+ 56
+ ],
+ [
+ 119,
+ 53
+ ],
+ [
+ 115,
+ 45
+ ],
+ [
+ 114,
+ 43
+ ],
+ [
+ 113,
+ 43
+ ],
+ [
+ 111,
+ 43
+ ],
+ [
+ 105,
+ 39
+ ],
+ [
+ 102,
+ 35
+ ],
+ [
+ 99,
+ 31
+ ],
+ [
+ 96,
+ 27
+ ],
+ [
+ 90,
+ 24
+ ],
+ [
+ 87,
+ 24
+ ],
+ [
+ 79,
+ 22
+ ],
+ [
+ 77,
+ 21
+ ],
+ [
+ 77,
+ 19
+ ],
+ [
+ 77,
+ 13
+ ],
+ [
+ 78,
+ 0
+ ],
+ [
+ 79,
+ -4
+ ],
+ [
+ 79,
+ -3
+ ],
+ [
+ 78,
+ 0
+ ],
+ [
+ 77,
+ 4
+ ],
+ [
+ 75,
+ 6
+ ],
+ [
+ 72,
+ 8
+ ],
+ [
+ 68,
+ 8
+ ],
+ [
+ 65,
+ 8
+ ],
+ [
+ 58,
+ 11
+ ],
+ [
+ 53,
+ 11
+ ],
+ [
+ 46,
+ 12
+ ],
+ [
+ 41,
+ 12
+ ],
+ [
+ 31,
+ 6
+ ],
+ [
+ 29,
+ 5
+ ],
+ [
+ 28,
+ 5
+ ],
+ [
+ 27,
+ 5
+ ],
+ [
+ 25,
+ 3
+ ],
+ [
+ 22,
+ 1
+ ],
+ [
+ 19,
+ -2
+ ],
+ [
+ 16,
+ -4
+ ],
+ [
+ 15,
+ -2
+ ],
+ [
+ 15,
+ 2
+ ],
+ [
+ 15,
+ 4
+ ],
+ [
+ 14,
+ 5
+ ],
+ [
+ 11,
+ 10
+ ],
+ [
+ 11,
+ 15
+ ],
+ [
+ 10,
+ 19
+ ],
+ [
+ 10,
+ 20
+ ],
+ [
+ 6,
+ 23
+ ],
+ [
+ -2,
+ 28
+ ],
+ [
+ -7,
+ 29
+ ],
+ [
+ -12,
+ 29
+ ],
+ [
+ -18,
+ 29
+ ],
+ [
+ -20,
+ 29
+ ],
+ [
+ -21,
+ 28
+ ],
+ [
+ -22,
+ 28
+ ],
+ [
+ -24,
+ 27
+ ],
+ [
+ -26,
+ 24
+ ],
+ [
+ -32,
+ 19
+ ],
+ [
+ -36,
+ 16
+ ],
+ [
+ -39,
+ 13
+ ],
+ [
+ -41,
+ 12
+ ],
+ [
+ -42,
+ 12
+ ],
+ [
+ -40,
+ 19
+ ],
+ [
+ -39,
+ 27
+ ],
+ [
+ -39,
+ 44
+ ],
+ [
+ -40,
+ 60
+ ],
+ [
+ -41,
+ 73
+ ],
+ [
+ -41,
+ 75
+ ],
+ [
+ -41,
+ 77
+ ],
+ [
+ -42,
+ 77
+ ],
+ [
+ -43,
+ 75
+ ],
+ [
+ -47,
+ 71
+ ],
+ [
+ -49,
+ 70
+ ],
+ [
+ -51,
+ 69
+ ],
+ [
+ -54,
+ 68
+ ],
+ [
+ -58,
+ 67
+ ],
+ [
+ -62,
+ 66
+ ],
+ [
+ -63,
+ 65
+ ],
+ [
+ -64,
+ 65
+ ],
+ [
+ -63,
+ 70
+ ],
+ [
+ -60,
+ 76
+ ],
+ [
+ -57,
+ 83
+ ],
+ [
+ -52,
+ 90
+ ],
+ [
+ -48,
+ 103
+ ],
+ [
+ -46,
+ 110
+ ],
+ [
+ -45,
+ 114
+ ],
+ [
+ -44,
+ 117
+ ],
+ [
+ -45,
+ 117
+ ],
+ [
+ -47,
+ 117
+ ],
+ [
+ -50,
+ 115
+ ],
+ [
+ -54,
+ 113
+ ],
+ [
+ -58,
+ 112
+ ],
+ [
+ -64,
+ 108
+ ],
+ [
+ -66,
+ 108
+ ],
+ [
+ -68,
+ 108
+ ],
+ [
+ -68,
+ 111
+ ],
+ [
+ -68,
+ 114
+ ],
+ [
+ -68,
+ 115
+ ],
+ [
+ -68,
+ 116
+ ],
+ [
+ -69,
+ 117
+ ],
+ [
+ -69,
+ 121
+ ],
+ [
+ -71,
+ 132
+ ],
+ [
+ -71,
+ 137
+ ],
+ [
+ -72,
+ 138
+ ],
+ [
+ -73,
+ 139
+ ],
+ [
+ -76,
+ 141
+ ],
+ [
+ -83,
+ 148
+ ],
+ [
+ -88,
+ 151
+ ],
+ [
+ -89,
+ 152
+ ],
+ [
+ -89,
+ 151
+ ],
+ [
+ -86,
+ 149
+ ],
+ [
+ -83,
+ 145
+ ],
+ [
+ -80,
+ 144
+ ],
+ [
+ -79,
+ 144
+ ],
+ [
+ -77,
+ 150
+ ],
+ [
+ -77,
+ 160
+ ],
+ [
+ -80,
+ 170
+ ],
+ [
+ -82,
+ 173
+ ],
+ [
+ -82,
+ 174
+ ],
+ [
+ -83,
+ 175
+ ],
+ [
+ -81,
+ 174
+ ],
+ [
+ -77,
+ 171
+ ],
+ [
+ -74,
+ 171
+ ],
+ [
+ -71,
+ 171
+ ],
+ [
+ -69,
+ 173
+ ],
+ [
+ -68,
+ 174
+ ],
+ [
+ -66,
+ 176
+ ],
+ [
+ -65,
+ 179
+ ],
+ [
+ -64,
+ 187
+ ],
+ [
+ -64,
+ 193
+ ],
+ [
+ -63,
+ 198
+ ],
+ [
+ -62,
+ 202
+ ],
+ [
+ -61,
+ 204
+ ],
+ [
+ -59,
+ 208
+ ],
+ [
+ -57,
+ 211
+ ],
+ [
+ -56,
+ 212
+ ],
+ [
+ -56,
+ 213
+ ],
+ [
+ -56,
+ 215
+ ],
+ [
+ -56,
+ 220
+ ],
+ [
+ -57,
+ 230
+ ],
+ [
+ -58,
+ 234
+ ],
+ [
+ -59,
+ 236
+ ],
+ [
+ -58,
+ 235
+ ],
+ [
+ -57,
+ 234
+ ],
+ [
+ -55,
+ 231
+ ],
+ [
+ -52,
+ 230
+ ],
+ [
+ -50,
+ 230
+ ],
+ [
+ -49,
+ 230
+ ],
+ [
+ -47,
+ 230
+ ],
+ [
+ -46,
+ 233
+ ],
+ [
+ -44,
+ 240
+ ],
+ [
+ -43,
+ 250
+ ],
+ [
+ -42,
+ 259
+ ],
+ [
+ -42,
+ 264
+ ],
+ [
+ -42,
+ 269
+ ],
+ [
+ -42,
+ 271
+ ],
+ [
+ -42,
+ 272
+ ],
+ [
+ -42,
+ 271
+ ],
+ [
+ -41,
+ 270
+ ],
+ [
+ -40,
+ 266
+ ],
+ [
+ -39,
+ 265
+ ],
+ [
+ -37,
+ 263
+ ],
+ [
+ -34,
+ 263
+ ],
+ [
+ -32,
+ 263
+ ],
+ [
+ -29,
+ 263
+ ],
+ [
+ -26,
+ 263
+ ],
+ [
+ -23,
+ 263
+ ],
+ [
+ -19,
+ 266
+ ],
+ [
+ -19,
+ 267
+ ],
+ [
+ -18,
+ 267
+ ],
+ [
+ -16,
+ 266
+ ],
+ [
+ -10,
+ 262
+ ],
+ [
+ -4,
+ 261
+ ],
+ [
+ 3,
+ 260
+ ],
+ [
+ 10,
+ 259
+ ],
+ [
+ 18,
+ 259
+ ],
+ [
+ 22,
+ 260
+ ],
+ [
+ 24,
+ 260
+ ],
+ [
+ 25,
+ 260
+ ],
+ [
+ 26,
+ 257
+ ],
+ [
+ 27,
+ 257
+ ],
+ [
+ 27,
+ 256
+ ],
+ [
+ 28,
+ 256
+ ],
+ [
+ 30,
+ 255
+ ],
+ [
+ 38,
+ 256
+ ],
+ [
+ 44,
+ 258
+ ],
+ [
+ 49,
+ 260
+ ],
+ [
+ 54,
+ 264
+ ],
+ [
+ 61,
+ 270
+ ],
+ [
+ 65,
+ 275
+ ],
+ [
+ 69,
+ 277
+ ],
+ [
+ 70,
+ 277
+ ],
+ [
+ 71,
+ 277
+ ],
+ [
+ 71,
+ 276
+ ],
+ [
+ 71,
+ 273
+ ],
+ [
+ 71,
+ 269
+ ],
+ [
+ 71,
+ 264
+ ],
+ [
+ 72,
+ 261
+ ],
+ [
+ 73,
+ 260
+ ],
+ [
+ 73,
+ 259
+ ],
+ [
+ 74,
+ 257
+ ],
+ [
+ 81,
+ 257
+ ],
+ [
+ 90,
+ 257
+ ],
+ [
+ 100,
+ 259
+ ],
+ [
+ 103,
+ 259
+ ],
+ [
+ 104,
+ 259
+ ],
+ [
+ 105,
+ 258
+ ],
+ [
+ 105,
+ 256
+ ],
+ [
+ 108,
+ 249
+ ],
+ [
+ 112,
+ 241
+ ],
+ [
+ 117,
+ 234
+ ],
+ [
+ 118,
+ 233
+ ],
+ [
+ 119,
+ 232
+ ],
+ [
+ 120,
+ 232
+ ],
+ [
+ 121,
+ 231
+ ],
+ [
+ 127,
+ 228
+ ],
+ [
+ 133,
+ 225
+ ],
+ [
+ 142,
+ 219
+ ],
+ [
+ 143,
+ 216
+ ],
+ [
+ 145,
+ 216
+ ],
+ [
+ 146,
+ 214
+ ],
+ [
+ 147,
+ 211
+ ],
+ [
+ 149,
+ 204
+ ],
+ [
+ 151,
+ 197
+ ],
+ [
+ 151,
+ 196
+ ],
+ [
+ 151,
+ 195
+ ],
+ [
+ 151,
+ 194
+ ],
+ [
+ 149,
+ 192
+ ],
+ [
+ 147,
+ 187
+ ],
+ [
+ 142,
+ 180
+ ],
+ [
+ 138,
+ 177
+ ],
+ [
+ 137,
+ 177
+ ],
+ [
+ 136,
+ 177
+ ],
+ [
+ 137,
+ 177
+ ],
+ [
+ 142,
+ 175
+ ],
+ [
+ 150,
+ 172
+ ],
+ [
+ 158,
+ 168
+ ],
+ [
+ 167,
+ 165
+ ],
+ [
+ 168,
+ 164
+ ],
+ [
+ 167,
+ 162
+ ],
+ [
+ 164,
+ 151
+ ],
+ [
+ 158,
+ 140
+ ],
+ [
+ 149,
+ 121
+ ],
+ [
+ 145,
+ 115
+ ],
+ [
+ 143,
+ 112
+ ],
+ [
+ 143,
+ 111
+ ],
+ [
+ 143,
+ 109
+ ],
+ [
+ 146,
+ 105
+ ],
+ [
+ 152,
+ 99
+ ],
+ [
+ 157,
+ 94
+ ],
+ [
+ 158,
+ 92
+ ],
+ [
+ 159,
+ 92
+ ],
+ [
+ 158,
+ 91
+ ],
+ [
+ 153,
+ 90
+ ],
+ [
+ 149,
+ 87
+ ],
+ [
+ 143,
+ 82
+ ],
+ [
+ 142,
+ 80
+ ],
+ [
+ 140,
+ 79
+ ],
+ [
+ 137,
+ 76
+ ],
+ [
+ 133,
+ 73
+ ],
+ [
+ 130,
+ 73
+ ],
+ [
+ 128,
+ 72
+ ],
+ [
+ 127,
+ 71
+ ],
+ [
+ 126,
+ 69
+ ],
+ [
+ 127,
+ 60
+ ],
+ [
+ 128,
+ 55
+ ],
+ [
+ 127,
+ 50
+ ],
+ [
+ 125,
+ 48
+ ],
+ [
+ 124,
+ 48
+ ],
+ [
+ 121,
+ 48
+ ],
+ [
+ 119,
+ 49
+ ],
+ [
+ 113,
+ 50
+ ],
+ [
+ 104,
+ 51
+ ],
+ [
+ 98,
+ 52
+ ],
+ [
+ 94,
+ 52
+ ],
+ [
+ 93,
+ 52
+ ],
+ [
+ 91,
+ 47
+ ],
+ [
+ 91,
+ 38
+ ],
+ [
+ 93,
+ 29
+ ],
+ [
+ 93,
+ 24
+ ],
+ [
+ 91,
+ 24
+ ],
+ [
+ 90,
+ 24
+ ],
+ [
+ 89,
+ 23
+ ],
+ [
+ 89,
+ 21
+ ],
+ [
+ 88,
+ 21
+ ],
+ [
+ 86,
+ 21
+ ],
+ [
+ 84,
+ 21
+ ],
+ [
+ 82,
+ 21
+ ],
+ [
+ 80,
+ 19
+ ],
+ [
+ 78,
+ 16
+ ],
+ [
+ 73,
+ 15
+ ],
+ [
+ 68,
+ 14
+ ],
+ [
+ 61,
+ 12
+ ],
+ [
+ 54,
+ 7
+ ],
+ [
+ 50,
+ 3
+ ],
+ [
+ 48,
+ -1
+ ],
+ [
+ 46,
+ -4
+ ],
+ [
+ 44,
+ -6
+ ],
+ [
+ 42,
+ -8
+ ],
+ [
+ 41,
+ -9
+ ],
+ [
+ 39,
+ -10
+ ],
+ [
+ 35,
+ -13
+ ],
+ [
+ 32,
+ -14
+ ],
+ [
+ 27,
+ -14
+ ],
+ [
+ 18,
+ -14
+ ],
+ [
+ 13,
+ -11
+ ],
+ [
+ 11,
+ -5
+ ],
+ [
+ 9,
+ 3
+ ],
+ [
+ 8,
+ 9
+ ],
+ [
+ 8,
+ 15
+ ],
+ [
+ 8,
+ 16
+ ],
+ [
+ 8,
+ 17
+ ],
+ [
+ 7,
+ 18
+ ],
+ [
+ 5,
+ 20
+ ],
+ [
+ 5,
+ 22
+ ],
+ [
+ 5,
+ 23
+ ],
+ [
+ 4,
+ 22
+ ],
+ [
+ 3,
+ 20
+ ],
+ [
+ 2,
+ 18
+ ],
+ [
+ 2,
+ 15
+ ],
+ [
+ 1,
+ 12
+ ],
+ [
+ 1,
+ 12
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#FFF"
+ }
+}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/draws/2022-10-28-11-22-12/2023-12-07T00_56_40.966Z.Desktop.excalidraw b/second/semester1/logseq-stuff/logseq/bak/draws/2022-10-28-11-22-12/2023-12-07T00_56_40.966Z.Desktop.excalidraw
new file mode 100644
index 00000000..2cfeb05b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/draws/2022-10-28-11-22-12/2023-12-07T00_56_40.966Z.Desktop.excalidraw
@@ -0,0 +1,4410 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "file://",
+ "elements": [
+ {
+ "type": "ellipse",
+ "version": 29,
+ "versionNonce": 619313491,
+ "isDeleted": false,
+ "id": "FaApldjwmPGceZg3aELGy",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 288.8125,
+ "y": 109.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 27,
+ "height": 25,
+ "seed": 324038653,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952552574,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 34,
+ "versionNonce": 1909143901,
+ "isDeleted": false,
+ "id": "y1vJq_RNCcUp-Qi0skNYm",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 232.8125,
+ "y": 186.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 28,
+ "height": 30,
+ "seed": 147838333,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952552574,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 28,
+ "versionNonce": 1319458547,
+ "isDeleted": false,
+ "id": "pzBDrrcvLVZlCWSVgqnXm",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 339.8125,
+ "y": 185.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 35,
+ "height": 32,
+ "seed": 843220691,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952552574,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 21,
+ "versionNonce": 1513489853,
+ "isDeleted": false,
+ "id": "pJhbRRAcnLIhL_KTZ9aiS",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 280.8125,
+ "y": 285.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 32,
+ "height": 26,
+ "seed": 199355581,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1666952552574,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "line",
+ "version": 22,
+ "versionNonce": 23192179,
+ "isDeleted": false,
+ "id": "mU3vX3dWSq_EKJXmHA7kK",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 294.8125,
+ "y": 128.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 41,
+ "height": 60,
+ "seed": 407389725,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952555514,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -41,
+ 60
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 26,
+ "versionNonce": 1019541395,
+ "isDeleted": false,
+ "id": "x0jT0TJtrLrSaEx6mK6Nn",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 308.8125,
+ "y": 127.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 39,
+ "height": 61,
+ "seed": 670691901,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952557530,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 39,
+ 61
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 49,
+ "versionNonce": 2039035933,
+ "isDeleted": false,
+ "id": "VsLGHcJVprgTwcsV720eU",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 299.8125,
+ "y": 134.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 6,
+ "height": 148,
+ "seed": 399916829,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952559627,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -6,
+ 148
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 34,
+ "versionNonce": 832508541,
+ "isDeleted": false,
+ "id": "lx9uSgOFlonJ4iSMTzv4E",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 243.8125,
+ "y": 215.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 48,
+ "height": 69,
+ "seed": 685483059,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952562027,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 48,
+ 69
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 17,
+ "versionNonce": 373546195,
+ "isDeleted": false,
+ "id": "c2748Lsl4sM5JIdpF2DwW",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 357.8125,
+ "y": 221.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 45,
+ "height": 60,
+ "seed": 158277587,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952564246,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -45,
+ 60
+ ]
+ ]
+ },
+ {
+ "type": "freedraw",
+ "version": 79,
+ "versionNonce": 1063371901,
+ "isDeleted": false,
+ "id": "BMhbB29bDUh1fz5u0EB4E",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 365.8125,
+ "y": 215.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 148,
+ "height": 143,
+ "seed": 1175670237,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952570718,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 1,
+ 2
+ ],
+ [
+ 2,
+ 13
+ ],
+ [
+ 4,
+ 22
+ ],
+ [
+ 4,
+ 28
+ ],
+ [
+ 4,
+ 33
+ ],
+ [
+ 4,
+ 36
+ ],
+ [
+ 4,
+ 42
+ ],
+ [
+ 2,
+ 50
+ ],
+ [
+ 1,
+ 58
+ ],
+ [
+ 0,
+ 66
+ ],
+ [
+ -1,
+ 67
+ ],
+ [
+ -1,
+ 68
+ ],
+ [
+ -2,
+ 69
+ ],
+ [
+ -9,
+ 76
+ ],
+ [
+ -18,
+ 89
+ ],
+ [
+ -23,
+ 95
+ ],
+ [
+ -24,
+ 98
+ ],
+ [
+ -24,
+ 99
+ ],
+ [
+ -27,
+ 100
+ ],
+ [
+ -34,
+ 109
+ ],
+ [
+ -44,
+ 120
+ ],
+ [
+ -51,
+ 126
+ ],
+ [
+ -53,
+ 127
+ ],
+ [
+ -54,
+ 127
+ ],
+ [
+ -59,
+ 130
+ ],
+ [
+ -71,
+ 137
+ ],
+ [
+ -78,
+ 139
+ ],
+ [
+ -83,
+ 141
+ ],
+ [
+ -85,
+ 141
+ ],
+ [
+ -87,
+ 141
+ ],
+ [
+ -91,
+ 141
+ ],
+ [
+ -101,
+ 141
+ ],
+ [
+ -108,
+ 140
+ ],
+ [
+ -117,
+ 138
+ ],
+ [
+ -123,
+ 134
+ ],
+ [
+ -129,
+ 132
+ ],
+ [
+ -132,
+ 128
+ ],
+ [
+ -135,
+ 125
+ ],
+ [
+ -138,
+ 119
+ ],
+ [
+ -141,
+ 109
+ ],
+ [
+ -143,
+ 104
+ ],
+ [
+ -143,
+ 101
+ ],
+ [
+ -143,
+ 98
+ ],
+ [
+ -143,
+ 94
+ ],
+ [
+ -142,
+ 88
+ ],
+ [
+ -142,
+ 80
+ ],
+ [
+ -143,
+ 69
+ ],
+ [
+ -144,
+ 66
+ ],
+ [
+ -144,
+ 65
+ ],
+ [
+ -144,
+ 64
+ ],
+ [
+ -144,
+ 61
+ ],
+ [
+ -144,
+ 56
+ ],
+ [
+ -142,
+ 51
+ ],
+ [
+ -142,
+ 50
+ ],
+ [
+ -142,
+ 49
+ ],
+ [
+ -142,
+ 48
+ ],
+ [
+ -142,
+ 47
+ ],
+ [
+ -141,
+ 44
+ ],
+ [
+ -137,
+ 28
+ ],
+ [
+ -135,
+ 17
+ ],
+ [
+ -134,
+ 9
+ ],
+ [
+ -133,
+ 5
+ ],
+ [
+ -132,
+ 4
+ ],
+ [
+ -132,
+ 3
+ ],
+ [
+ -132,
+ 1
+ ],
+ [
+ -132,
+ 0
+ ],
+ [
+ -131,
+ 0
+ ],
+ [
+ -131,
+ -1
+ ],
+ [
+ -130,
+ -1
+ ],
+ [
+ -129,
+ -1
+ ],
+ [
+ -128,
+ -1
+ ],
+ [
+ -127,
+ -1
+ ],
+ [
+ -127,
+ -2
+ ],
+ [
+ -128,
+ -2
+ ],
+ [
+ -129,
+ -2
+ ],
+ [
+ -131,
+ -2
+ ],
+ [
+ -131,
+ -2
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 136,
+ "versionNonce": 2125510141,
+ "isDeleted": false,
+ "id": "Hb-IHenmv3PnP2CxiBnja",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 282.8125,
+ "y": 156.546875,
+ "strokeColor": "#087f5b",
+ "backgroundColor": "transparent",
+ "width": 21,
+ "height": 88,
+ "seed": 870878675,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952583559,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -2,
+ 7
+ ],
+ [
+ -4,
+ 12
+ ],
+ [
+ -7,
+ 17
+ ],
+ [
+ -10,
+ 20
+ ],
+ [
+ -13,
+ 22
+ ],
+ [
+ -14,
+ 23
+ ],
+ [
+ -15,
+ 26
+ ],
+ [
+ -15,
+ 27
+ ],
+ [
+ -12,
+ 23
+ ],
+ [
+ -9,
+ 17
+ ],
+ [
+ -5,
+ 10
+ ],
+ [
+ 0,
+ 2
+ ],
+ [
+ 0,
+ 1
+ ],
+ [
+ 1,
+ 1
+ ],
+ [
+ 4,
+ 6
+ ],
+ [
+ 4,
+ 12
+ ],
+ [
+ 4,
+ 17
+ ],
+ [
+ 1,
+ 24
+ ],
+ [
+ 0,
+ 28
+ ],
+ [
+ -1,
+ 31
+ ],
+ [
+ -3,
+ 33
+ ],
+ [
+ -3,
+ 35
+ ],
+ [
+ -4,
+ 37
+ ],
+ [
+ -5,
+ 41
+ ],
+ [
+ -5,
+ 42
+ ],
+ [
+ -5,
+ 40
+ ],
+ [
+ -5,
+ 39
+ ],
+ [
+ -5,
+ 40
+ ],
+ [
+ -4,
+ 44
+ ],
+ [
+ -5,
+ 49
+ ],
+ [
+ -7,
+ 54
+ ],
+ [
+ -9,
+ 59
+ ],
+ [
+ -10,
+ 60
+ ],
+ [
+ -11,
+ 61
+ ],
+ [
+ -11,
+ 60
+ ],
+ [
+ -11,
+ 59
+ ],
+ [
+ -11,
+ 60
+ ],
+ [
+ -12,
+ 62
+ ],
+ [
+ -12,
+ 63
+ ],
+ [
+ -12,
+ 64
+ ],
+ [
+ -13,
+ 63
+ ],
+ [
+ -15,
+ 60
+ ],
+ [
+ -15,
+ 57
+ ],
+ [
+ -14,
+ 44
+ ],
+ [
+ -13,
+ 38
+ ],
+ [
+ -11,
+ 35
+ ],
+ [
+ -9,
+ 33
+ ],
+ [
+ -8,
+ 33
+ ],
+ [
+ -7,
+ 33
+ ],
+ [
+ -7,
+ 35
+ ],
+ [
+ -7,
+ 38
+ ],
+ [
+ -7,
+ 43
+ ],
+ [
+ -7,
+ 48
+ ],
+ [
+ -7,
+ 52
+ ],
+ [
+ -8,
+ 57
+ ],
+ [
+ -8,
+ 61
+ ],
+ [
+ -8,
+ 62
+ ],
+ [
+ -8,
+ 67
+ ],
+ [
+ -8,
+ 71
+ ],
+ [
+ -7,
+ 78
+ ],
+ [
+ -7,
+ 81
+ ],
+ [
+ -6,
+ 79
+ ],
+ [
+ -6,
+ 76
+ ],
+ [
+ -6,
+ 75
+ ],
+ [
+ -6,
+ 74
+ ],
+ [
+ -4,
+ 68
+ ],
+ [
+ -3,
+ 61
+ ],
+ [
+ -2,
+ 54
+ ],
+ [
+ -2,
+ 47
+ ],
+ [
+ -2,
+ 40
+ ],
+ [
+ -2,
+ 32
+ ],
+ [
+ -2,
+ 30
+ ],
+ [
+ -2,
+ 29
+ ],
+ [
+ -2,
+ 27
+ ],
+ [
+ -2,
+ 26
+ ],
+ [
+ 0,
+ 29
+ ],
+ [
+ 0,
+ 34
+ ],
+ [
+ 1,
+ 38
+ ],
+ [
+ 1,
+ 42
+ ],
+ [
+ -1,
+ 48
+ ],
+ [
+ -3,
+ 55
+ ],
+ [
+ -3,
+ 62
+ ],
+ [
+ -4,
+ 68
+ ],
+ [
+ -4,
+ 70
+ ],
+ [
+ -4,
+ 73
+ ],
+ [
+ -4,
+ 75
+ ],
+ [
+ -4,
+ 83
+ ],
+ [
+ -4,
+ 87
+ ],
+ [
+ -3,
+ 88
+ ],
+ [
+ -4,
+ 85
+ ],
+ [
+ -5,
+ 72
+ ],
+ [
+ -6,
+ 59
+ ],
+ [
+ -7,
+ 47
+ ],
+ [
+ -9,
+ 36
+ ],
+ [
+ -9,
+ 28
+ ],
+ [
+ -9,
+ 24
+ ],
+ [
+ -9,
+ 23
+ ],
+ [
+ -8,
+ 22
+ ],
+ [
+ -7,
+ 18
+ ],
+ [
+ -7,
+ 16
+ ],
+ [
+ -7,
+ 14
+ ],
+ [
+ -4,
+ 14
+ ],
+ [
+ -2,
+ 16
+ ],
+ [
+ -2,
+ 17
+ ],
+ [
+ 0,
+ 19
+ ],
+ [
+ 0,
+ 29
+ ],
+ [
+ 1,
+ 37
+ ],
+ [
+ 1,
+ 40
+ ],
+ [
+ -1,
+ 47
+ ],
+ [
+ -1,
+ 51
+ ],
+ [
+ -2,
+ 57
+ ],
+ [
+ -2,
+ 64
+ ],
+ [
+ -2,
+ 77
+ ],
+ [
+ -1,
+ 83
+ ],
+ [
+ -1,
+ 86
+ ],
+ [
+ 0,
+ 86
+ ],
+ [
+ 0,
+ 83
+ ],
+ [
+ 1,
+ 79
+ ],
+ [
+ 2,
+ 76
+ ],
+ [
+ 4,
+ 72
+ ],
+ [
+ 6,
+ 64
+ ],
+ [
+ 6,
+ 56
+ ],
+ [
+ 6,
+ 50
+ ],
+ [
+ 6,
+ 43
+ ],
+ [
+ 6,
+ 30
+ ],
+ [
+ 6,
+ 27
+ ],
+ [
+ 6,
+ 26
+ ],
+ [
+ 5,
+ 24
+ ],
+ [
+ 5,
+ 23
+ ],
+ [
+ 4,
+ 20
+ ],
+ [
+ 4,
+ 19
+ ],
+ [
+ 4,
+ 18
+ ],
+ [
+ 3,
+ 18
+ ],
+ [
+ 3,
+ 18
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 124,
+ "versionNonce": 1740224829,
+ "isDeleted": false,
+ "id": "6Y_BLIHJAzS0iPCHfcAcs",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 310.8125,
+ "y": 159.546875,
+ "strokeColor": "#495057",
+ "backgroundColor": "transparent",
+ "width": 28,
+ "height": 112,
+ "seed": 173765715,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952593226,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 2
+ ],
+ [
+ 0,
+ 4
+ ],
+ [
+ -3,
+ 14
+ ],
+ [
+ -4,
+ 17
+ ],
+ [
+ -5,
+ 23
+ ],
+ [
+ -5,
+ 28
+ ],
+ [
+ -5,
+ 33
+ ],
+ [
+ -5,
+ 40
+ ],
+ [
+ -3,
+ 48
+ ],
+ [
+ -3,
+ 53
+ ],
+ [
+ -3,
+ 57
+ ],
+ [
+ -3,
+ 62
+ ],
+ [
+ -3,
+ 69
+ ],
+ [
+ -3,
+ 73
+ ],
+ [
+ -3,
+ 76
+ ],
+ [
+ -2,
+ 75
+ ],
+ [
+ -1,
+ 64
+ ],
+ [
+ 1,
+ 44
+ ],
+ [
+ 1,
+ 39
+ ],
+ [
+ 2,
+ 31
+ ],
+ [
+ 2,
+ 27
+ ],
+ [
+ 3,
+ 25
+ ],
+ [
+ 5,
+ 26
+ ],
+ [
+ 8,
+ 33
+ ],
+ [
+ 8,
+ 42
+ ],
+ [
+ 7,
+ 50
+ ],
+ [
+ 5,
+ 58
+ ],
+ [
+ 4,
+ 63
+ ],
+ [
+ 2,
+ 69
+ ],
+ [
+ 1,
+ 70
+ ],
+ [
+ 1,
+ 74
+ ],
+ [
+ 1,
+ 80
+ ],
+ [
+ 1,
+ 88
+ ],
+ [
+ 1,
+ 91
+ ],
+ [
+ 0,
+ 89
+ ],
+ [
+ 0,
+ 84
+ ],
+ [
+ 0,
+ 77
+ ],
+ [
+ 0,
+ 73
+ ],
+ [
+ 3,
+ 68
+ ],
+ [
+ 4,
+ 65
+ ],
+ [
+ 6,
+ 61
+ ],
+ [
+ 8,
+ 59
+ ],
+ [
+ 10,
+ 56
+ ],
+ [
+ 11,
+ 52
+ ],
+ [
+ 13,
+ 48
+ ],
+ [
+ 14,
+ 45
+ ],
+ [
+ 16,
+ 42
+ ],
+ [
+ 18,
+ 42
+ ],
+ [
+ 19,
+ 42
+ ],
+ [
+ 21,
+ 43
+ ],
+ [
+ 21,
+ 51
+ ],
+ [
+ 21,
+ 56
+ ],
+ [
+ 19,
+ 60
+ ],
+ [
+ 16,
+ 66
+ ],
+ [
+ 14,
+ 70
+ ],
+ [
+ 13,
+ 75
+ ],
+ [
+ 12,
+ 80
+ ],
+ [
+ 12,
+ 81
+ ],
+ [
+ 12,
+ 82
+ ],
+ [
+ 12,
+ 83
+ ],
+ [
+ 12,
+ 86
+ ],
+ [
+ 12,
+ 88
+ ],
+ [
+ 14,
+ 82
+ ],
+ [
+ 16,
+ 76
+ ],
+ [
+ 17,
+ 71
+ ],
+ [
+ 19,
+ 66
+ ],
+ [
+ 20,
+ 63
+ ],
+ [
+ 21,
+ 60
+ ],
+ [
+ 22,
+ 59
+ ],
+ [
+ 22,
+ 62
+ ],
+ [
+ 23,
+ 67
+ ],
+ [
+ 20,
+ 74
+ ],
+ [
+ 19,
+ 80
+ ],
+ [
+ 17,
+ 87
+ ],
+ [
+ 16,
+ 89
+ ],
+ [
+ 15,
+ 94
+ ],
+ [
+ 14,
+ 97
+ ],
+ [
+ 13,
+ 103
+ ],
+ [
+ 12,
+ 107
+ ],
+ [
+ 12,
+ 111
+ ],
+ [
+ 12,
+ 112
+ ],
+ [
+ 12,
+ 110
+ ],
+ [
+ 12,
+ 109
+ ],
+ [
+ 12,
+ 105
+ ],
+ [
+ 13,
+ 100
+ ],
+ [
+ 14,
+ 97
+ ],
+ [
+ 15,
+ 92
+ ],
+ [
+ 16,
+ 90
+ ],
+ [
+ 17,
+ 81
+ ],
+ [
+ 18,
+ 79
+ ],
+ [
+ 18,
+ 78
+ ],
+ [
+ 19,
+ 77
+ ],
+ [
+ 19,
+ 75
+ ],
+ [
+ 19,
+ 70
+ ],
+ [
+ 20,
+ 63
+ ],
+ [
+ 19,
+ 58
+ ],
+ [
+ 18,
+ 53
+ ],
+ [
+ 17,
+ 50
+ ],
+ [
+ 14,
+ 44
+ ],
+ [
+ 10,
+ 35
+ ],
+ [
+ 7,
+ 31
+ ],
+ [
+ 5,
+ 26
+ ],
+ [
+ 4,
+ 25
+ ],
+ [
+ 4,
+ 24
+ ],
+ [
+ 4,
+ 22
+ ],
+ [
+ 3,
+ 20
+ ],
+ [
+ 2,
+ 18
+ ],
+ [
+ 2,
+ 15
+ ],
+ [
+ 2,
+ 14
+ ],
+ [
+ 1,
+ 14
+ ],
+ [
+ 0,
+ 11
+ ],
+ [
+ -2,
+ 10
+ ],
+ [
+ 0,
+ 12
+ ],
+ [
+ 1,
+ 13
+ ],
+ [
+ 1,
+ 14
+ ],
+ [
+ 2,
+ 14
+ ],
+ [
+ 3,
+ 15
+ ],
+ [
+ 4,
+ 16
+ ],
+ [
+ 5,
+ 17
+ ],
+ [
+ 6,
+ 18
+ ],
+ [
+ 6,
+ 20
+ ],
+ [
+ 6,
+ 20
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 141,
+ "versionNonce": 542442195,
+ "isDeleted": false,
+ "id": "MPQPe49UtS4YpepDFyvb9",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 244.8125,
+ "y": 239.546875,
+ "strokeColor": "#c92a2a",
+ "backgroundColor": "transparent",
+ "width": 113,
+ "height": 100,
+ "seed": 1422345491,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952601528,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -1,
+ 2
+ ],
+ [
+ -4,
+ 6
+ ],
+ [
+ -7,
+ 10
+ ],
+ [
+ -9,
+ 14
+ ],
+ [
+ -9,
+ 22
+ ],
+ [
+ -9,
+ 26
+ ],
+ [
+ -8,
+ 29
+ ],
+ [
+ -7,
+ 32
+ ],
+ [
+ -6,
+ 32
+ ],
+ [
+ -3,
+ 31
+ ],
+ [
+ 0,
+ 27
+ ],
+ [
+ 4,
+ 24
+ ],
+ [
+ 8,
+ 20
+ ],
+ [
+ 13,
+ 16
+ ],
+ [
+ 15,
+ 14
+ ],
+ [
+ 18,
+ 13
+ ],
+ [
+ 18,
+ 12
+ ],
+ [
+ 19,
+ 12
+ ],
+ [
+ 19,
+ 14
+ ],
+ [
+ 19,
+ 18
+ ],
+ [
+ 19,
+ 24
+ ],
+ [
+ 17,
+ 26
+ ],
+ [
+ 16,
+ 29
+ ],
+ [
+ 14,
+ 33
+ ],
+ [
+ 13,
+ 38
+ ],
+ [
+ 13,
+ 43
+ ],
+ [
+ 13,
+ 45
+ ],
+ [
+ 13,
+ 47
+ ],
+ [
+ 13,
+ 48
+ ],
+ [
+ 13,
+ 49
+ ],
+ [
+ 12,
+ 49
+ ],
+ [
+ 12,
+ 48
+ ],
+ [
+ 12,
+ 45
+ ],
+ [
+ 12,
+ 42
+ ],
+ [
+ 12,
+ 41
+ ],
+ [
+ 12,
+ 49
+ ],
+ [
+ 12,
+ 60
+ ],
+ [
+ 10,
+ 67
+ ],
+ [
+ 9,
+ 72
+ ],
+ [
+ 9,
+ 74
+ ],
+ [
+ 9,
+ 73
+ ],
+ [
+ 9,
+ 72
+ ],
+ [
+ 9,
+ 71
+ ],
+ [
+ 10,
+ 69
+ ],
+ [
+ 12,
+ 67
+ ],
+ [
+ 13,
+ 64
+ ],
+ [
+ 16,
+ 61
+ ],
+ [
+ 19,
+ 57
+ ],
+ [
+ 20,
+ 56
+ ],
+ [
+ 21,
+ 56
+ ],
+ [
+ 21,
+ 58
+ ],
+ [
+ 21,
+ 70
+ ],
+ [
+ 21,
+ 80
+ ],
+ [
+ 21,
+ 87
+ ],
+ [
+ 22,
+ 92
+ ],
+ [
+ 22,
+ 95
+ ],
+ [
+ 22,
+ 97
+ ],
+ [
+ 21,
+ 99
+ ],
+ [
+ 21,
+ 100
+ ],
+ [
+ 20,
+ 97
+ ],
+ [
+ 20,
+ 92
+ ],
+ [
+ 19,
+ 86
+ ],
+ [
+ 20,
+ 82
+ ],
+ [
+ 23,
+ 77
+ ],
+ [
+ 27,
+ 72
+ ],
+ [
+ 29,
+ 68
+ ],
+ [
+ 32,
+ 67
+ ],
+ [
+ 34,
+ 66
+ ],
+ [
+ 35,
+ 69
+ ],
+ [
+ 35,
+ 72
+ ],
+ [
+ 35,
+ 73
+ ],
+ [
+ 35,
+ 76
+ ],
+ [
+ 36,
+ 77
+ ],
+ [
+ 36,
+ 78
+ ],
+ [
+ 36,
+ 79
+ ],
+ [
+ 37,
+ 81
+ ],
+ [
+ 37,
+ 82
+ ],
+ [
+ 37,
+ 83
+ ],
+ [
+ 39,
+ 84
+ ],
+ [
+ 40,
+ 86
+ ],
+ [
+ 40,
+ 87
+ ],
+ [
+ 41,
+ 87
+ ],
+ [
+ 44,
+ 87
+ ],
+ [
+ 47,
+ 87
+ ],
+ [
+ 53,
+ 88
+ ],
+ [
+ 60,
+ 89
+ ],
+ [
+ 62,
+ 89
+ ],
+ [
+ 64,
+ 89
+ ],
+ [
+ 65,
+ 89
+ ],
+ [
+ 67,
+ 89
+ ],
+ [
+ 69,
+ 87
+ ],
+ [
+ 70,
+ 84
+ ],
+ [
+ 71,
+ 83
+ ],
+ [
+ 73,
+ 81
+ ],
+ [
+ 73,
+ 79
+ ],
+ [
+ 74,
+ 78
+ ],
+ [
+ 74,
+ 77
+ ],
+ [
+ 76,
+ 74
+ ],
+ [
+ 77,
+ 73
+ ],
+ [
+ 79,
+ 72
+ ],
+ [
+ 80,
+ 71
+ ],
+ [
+ 81,
+ 70
+ ],
+ [
+ 82,
+ 67
+ ],
+ [
+ 84,
+ 64
+ ],
+ [
+ 86,
+ 60
+ ],
+ [
+ 87,
+ 58
+ ],
+ [
+ 87,
+ 56
+ ],
+ [
+ 87,
+ 53
+ ],
+ [
+ 87,
+ 50
+ ],
+ [
+ 87,
+ 49
+ ],
+ [
+ 87,
+ 48
+ ],
+ [
+ 86,
+ 48
+ ],
+ [
+ 84,
+ 48
+ ],
+ [
+ 83,
+ 48
+ ],
+ [
+ 81,
+ 48
+ ],
+ [
+ 80,
+ 47
+ ],
+ [
+ 80,
+ 44
+ ],
+ [
+ 79,
+ 42
+ ],
+ [
+ 79,
+ 40
+ ],
+ [
+ 81,
+ 37
+ ],
+ [
+ 86,
+ 33
+ ],
+ [
+ 94,
+ 28
+ ],
+ [
+ 97,
+ 26
+ ],
+ [
+ 101,
+ 24
+ ],
+ [
+ 102,
+ 24
+ ],
+ [
+ 103,
+ 24
+ ],
+ [
+ 103,
+ 25
+ ],
+ [
+ 102,
+ 27
+ ],
+ [
+ 102,
+ 29
+ ],
+ [
+ 102,
+ 30
+ ],
+ [
+ 102,
+ 31
+ ],
+ [
+ 102,
+ 32
+ ],
+ [
+ 102,
+ 33
+ ],
+ [
+ 103,
+ 33
+ ],
+ [
+ 104,
+ 33
+ ],
+ [
+ 104,
+ 35
+ ],
+ [
+ 103,
+ 37
+ ],
+ [
+ 103,
+ 38
+ ],
+ [
+ 103,
+ 38
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 329,
+ "versionNonce": 694529373,
+ "isDeleted": false,
+ "id": "DHA_B7S_kSyWEd_7zNnrg",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 239.8125,
+ "y": 118.546875,
+ "strokeColor": "#e67700",
+ "backgroundColor": "transparent",
+ "width": 299,
+ "height": 323,
+ "seed": 2106558429,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952614098,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 4,
+ -2
+ ],
+ [
+ 7,
+ -4
+ ],
+ [
+ 14,
+ -5
+ ],
+ [
+ 21,
+ -5
+ ],
+ [
+ 29,
+ -6
+ ],
+ [
+ 44,
+ -9
+ ],
+ [
+ 55,
+ -13
+ ],
+ [
+ 67,
+ -17
+ ],
+ [
+ 77,
+ -20
+ ],
+ [
+ 84,
+ -21
+ ],
+ [
+ 86,
+ -22
+ ],
+ [
+ 88,
+ -22
+ ],
+ [
+ 88,
+ -21
+ ],
+ [
+ 88,
+ -18
+ ],
+ [
+ 88,
+ -16
+ ],
+ [
+ 91,
+ -16
+ ],
+ [
+ 97,
+ -17
+ ],
+ [
+ 101,
+ -18
+ ],
+ [
+ 104,
+ -19
+ ],
+ [
+ 105,
+ -18
+ ],
+ [
+ 110,
+ -15
+ ],
+ [
+ 116,
+ -10
+ ],
+ [
+ 122,
+ -4
+ ],
+ [
+ 126,
+ 2
+ ],
+ [
+ 129,
+ 7
+ ],
+ [
+ 129,
+ 9
+ ],
+ [
+ 129,
+ 10
+ ],
+ [
+ 129,
+ 12
+ ],
+ [
+ 129,
+ 15
+ ],
+ [
+ 132,
+ 19
+ ],
+ [
+ 135,
+ 22
+ ],
+ [
+ 140,
+ 27
+ ],
+ [
+ 152,
+ 36
+ ],
+ [
+ 166,
+ 48
+ ],
+ [
+ 175,
+ 56
+ ],
+ [
+ 181,
+ 64
+ ],
+ [
+ 189,
+ 75
+ ],
+ [
+ 193,
+ 83
+ ],
+ [
+ 196,
+ 90
+ ],
+ [
+ 196,
+ 95
+ ],
+ [
+ 196,
+ 98
+ ],
+ [
+ 196,
+ 101
+ ],
+ [
+ 194,
+ 106
+ ],
+ [
+ 191,
+ 115
+ ],
+ [
+ 189,
+ 140
+ ],
+ [
+ 189,
+ 165
+ ],
+ [
+ 189,
+ 187
+ ],
+ [
+ 190,
+ 202
+ ],
+ [
+ 191,
+ 206
+ ],
+ [
+ 191,
+ 207
+ ],
+ [
+ 190,
+ 207
+ ],
+ [
+ 188,
+ 206
+ ],
+ [
+ 185,
+ 205
+ ],
+ [
+ 182,
+ 203
+ ],
+ [
+ 175,
+ 203
+ ],
+ [
+ 158,
+ 215
+ ],
+ [
+ 149,
+ 221
+ ],
+ [
+ 143,
+ 229
+ ],
+ [
+ 140,
+ 233
+ ],
+ [
+ 138,
+ 235
+ ],
+ [
+ 137,
+ 237
+ ],
+ [
+ 134,
+ 242
+ ],
+ [
+ 131,
+ 247
+ ],
+ [
+ 127,
+ 252
+ ],
+ [
+ 123,
+ 254
+ ],
+ [
+ 119,
+ 254
+ ],
+ [
+ 112,
+ 255
+ ],
+ [
+ 98,
+ 253
+ ],
+ [
+ 87,
+ 253
+ ],
+ [
+ 77,
+ 253
+ ],
+ [
+ 67,
+ 253
+ ],
+ [
+ 60,
+ 254
+ ],
+ [
+ 57,
+ 254
+ ],
+ [
+ 53,
+ 257
+ ],
+ [
+ 41,
+ 263
+ ],
+ [
+ 32,
+ 269
+ ],
+ [
+ 21,
+ 273
+ ],
+ [
+ 15,
+ 275
+ ],
+ [
+ 12,
+ 275
+ ],
+ [
+ 11,
+ 275
+ ],
+ [
+ 10,
+ 275
+ ],
+ [
+ 2,
+ 276
+ ],
+ [
+ -12,
+ 276
+ ],
+ [
+ -25,
+ 276
+ ],
+ [
+ -34,
+ 275
+ ],
+ [
+ -40,
+ 273
+ ],
+ [
+ -53,
+ 271
+ ],
+ [
+ -63,
+ 268
+ ],
+ [
+ -74,
+ 262
+ ],
+ [
+ -84,
+ 252
+ ],
+ [
+ -90,
+ 234
+ ],
+ [
+ -93,
+ 211
+ ],
+ [
+ -93,
+ 208
+ ],
+ [
+ -93,
+ 204
+ ],
+ [
+ -92,
+ 203
+ ],
+ [
+ -91,
+ 201
+ ],
+ [
+ -89,
+ 200
+ ],
+ [
+ -84,
+ 198
+ ],
+ [
+ -78,
+ 198
+ ],
+ [
+ -70,
+ 198
+ ],
+ [
+ -65,
+ 198
+ ],
+ [
+ -59,
+ 198
+ ],
+ [
+ -53,
+ 196
+ ],
+ [
+ -47,
+ 192
+ ],
+ [
+ -38,
+ 184
+ ],
+ [
+ -32,
+ 176
+ ],
+ [
+ -27,
+ 165
+ ],
+ [
+ -22,
+ 152
+ ],
+ [
+ -20,
+ 145
+ ],
+ [
+ -20,
+ 142
+ ],
+ [
+ -20,
+ 140
+ ],
+ [
+ -23,
+ 137
+ ],
+ [
+ -26,
+ 129
+ ],
+ [
+ -27,
+ 115
+ ],
+ [
+ -27,
+ 97
+ ],
+ [
+ -27,
+ 86
+ ],
+ [
+ -26,
+ 82
+ ],
+ [
+ -27,
+ 80
+ ],
+ [
+ -28,
+ 79
+ ],
+ [
+ -28,
+ 76
+ ],
+ [
+ -28,
+ 62
+ ],
+ [
+ -27,
+ 48
+ ],
+ [
+ -27,
+ 45
+ ],
+ [
+ -28,
+ 43
+ ],
+ [
+ -29,
+ 42
+ ],
+ [
+ -29,
+ 40
+ ],
+ [
+ -29,
+ 38
+ ],
+ [
+ -28,
+ 37
+ ],
+ [
+ -25,
+ 35
+ ],
+ [
+ -17,
+ 32
+ ],
+ [
+ -4,
+ 21
+ ],
+ [
+ 3,
+ 15
+ ],
+ [
+ 9,
+ 10
+ ],
+ [
+ 10,
+ 10
+ ],
+ [
+ 9,
+ 8
+ ],
+ [
+ 8,
+ 8
+ ],
+ [
+ 7,
+ 8
+ ],
+ [
+ 3,
+ 6
+ ],
+ [
+ 0,
+ 5
+ ],
+ [
+ -3,
+ 3
+ ],
+ [
+ -3,
+ 1
+ ],
+ [
+ -3,
+ -2
+ ],
+ [
+ -5,
+ -1
+ ],
+ [
+ -9,
+ 7
+ ],
+ [
+ -14,
+ 27
+ ],
+ [
+ -15,
+ 35
+ ],
+ [
+ -15,
+ 39
+ ],
+ [
+ -15,
+ 43
+ ],
+ [
+ -14,
+ 49
+ ],
+ [
+ -14,
+ 63
+ ],
+ [
+ -19,
+ 93
+ ],
+ [
+ -23,
+ 107
+ ],
+ [
+ -25,
+ 113
+ ],
+ [
+ -26,
+ 115
+ ],
+ [
+ -27,
+ 115
+ ],
+ [
+ -29,
+ 115
+ ],
+ [
+ -30,
+ 115
+ ],
+ [
+ -32,
+ 115
+ ],
+ [
+ -35,
+ 115
+ ],
+ [
+ -38,
+ 115
+ ],
+ [
+ -48,
+ 117
+ ],
+ [
+ -62,
+ 124
+ ],
+ [
+ -70,
+ 127
+ ],
+ [
+ -76,
+ 129
+ ],
+ [
+ -78,
+ 129
+ ],
+ [
+ -79,
+ 130
+ ],
+ [
+ -80,
+ 133
+ ],
+ [
+ -78,
+ 139
+ ],
+ [
+ -79,
+ 153
+ ],
+ [
+ -82,
+ 160
+ ],
+ [
+ -84,
+ 168
+ ],
+ [
+ -87,
+ 177
+ ],
+ [
+ -89,
+ 189
+ ],
+ [
+ -91,
+ 203
+ ],
+ [
+ -94,
+ 213
+ ],
+ [
+ -94,
+ 219
+ ],
+ [
+ -94,
+ 221
+ ],
+ [
+ -93,
+ 223
+ ],
+ [
+ -85,
+ 239
+ ],
+ [
+ -83,
+ 247
+ ],
+ [
+ -81,
+ 251
+ ],
+ [
+ -81,
+ 252
+ ],
+ [
+ -80,
+ 252
+ ],
+ [
+ -75,
+ 252
+ ],
+ [
+ -69,
+ 253
+ ],
+ [
+ -64,
+ 254
+ ],
+ [
+ -60,
+ 255
+ ],
+ [
+ -57,
+ 255
+ ],
+ [
+ -54,
+ 255
+ ],
+ [
+ -47,
+ 255
+ ],
+ [
+ -39,
+ 255
+ ],
+ [
+ -29,
+ 257
+ ],
+ [
+ -19,
+ 259
+ ],
+ [
+ -13,
+ 260
+ ],
+ [
+ -8,
+ 260
+ ],
+ [
+ -2,
+ 260
+ ],
+ [
+ 7,
+ 259
+ ],
+ [
+ 19,
+ 258
+ ],
+ [
+ 30,
+ 258
+ ],
+ [
+ 38,
+ 258
+ ],
+ [
+ 42,
+ 258
+ ],
+ [
+ 43,
+ 258
+ ],
+ [
+ 44,
+ 258
+ ],
+ [
+ 46,
+ 258
+ ],
+ [
+ 52,
+ 260
+ ],
+ [
+ 61,
+ 264
+ ],
+ [
+ 70,
+ 268
+ ],
+ [
+ 80,
+ 274
+ ],
+ [
+ 89,
+ 282
+ ],
+ [
+ 96,
+ 288
+ ],
+ [
+ 100,
+ 289
+ ],
+ [
+ 101,
+ 289
+ ],
+ [
+ 102,
+ 288
+ ],
+ [
+ 102,
+ 286
+ ],
+ [
+ 102,
+ 283
+ ],
+ [
+ 102,
+ 278
+ ],
+ [
+ 103,
+ 272
+ ],
+ [
+ 110,
+ 264
+ ],
+ [
+ 117,
+ 256
+ ],
+ [
+ 123,
+ 252
+ ],
+ [
+ 130,
+ 243
+ ],
+ [
+ 135,
+ 237
+ ],
+ [
+ 136,
+ 236
+ ],
+ [
+ 137,
+ 235
+ ],
+ [
+ 139,
+ 233
+ ],
+ [
+ 143,
+ 229
+ ],
+ [
+ 147,
+ 228
+ ],
+ [
+ 151,
+ 225
+ ],
+ [
+ 158,
+ 222
+ ],
+ [
+ 163,
+ 220
+ ],
+ [
+ 164,
+ 219
+ ],
+ [
+ 166,
+ 216
+ ],
+ [
+ 169,
+ 205
+ ],
+ [
+ 172,
+ 194
+ ],
+ [
+ 176,
+ 180
+ ],
+ [
+ 178,
+ 175
+ ],
+ [
+ 179,
+ 171
+ ],
+ [
+ 181,
+ 166
+ ],
+ [
+ 184,
+ 160
+ ],
+ [
+ 189,
+ 148
+ ],
+ [
+ 191,
+ 144
+ ],
+ [
+ 192,
+ 143
+ ],
+ [
+ 192,
+ 142
+ ],
+ [
+ 194,
+ 137
+ ],
+ [
+ 199,
+ 127
+ ],
+ [
+ 202,
+ 119
+ ],
+ [
+ 203,
+ 115
+ ],
+ [
+ 204,
+ 113
+ ],
+ [
+ 204,
+ 109
+ ],
+ [
+ 204,
+ 101
+ ],
+ [
+ 205,
+ 90
+ ],
+ [
+ 203,
+ 82
+ ],
+ [
+ 201,
+ 74
+ ],
+ [
+ 201,
+ 73
+ ],
+ [
+ 200,
+ 72
+ ],
+ [
+ 196,
+ 68
+ ],
+ [
+ 192,
+ 65
+ ],
+ [
+ 188,
+ 61
+ ],
+ [
+ 186,
+ 58
+ ],
+ [
+ 185,
+ 57
+ ],
+ [
+ 183,
+ 55
+ ],
+ [
+ 181,
+ 53
+ ],
+ [
+ 177,
+ 48
+ ],
+ [
+ 174,
+ 46
+ ],
+ [
+ 173,
+ 45
+ ],
+ [
+ 171,
+ 44
+ ],
+ [
+ 163,
+ 40
+ ],
+ [
+ 157,
+ 37
+ ],
+ [
+ 150,
+ 34
+ ],
+ [
+ 146,
+ 30
+ ],
+ [
+ 144,
+ 29
+ ],
+ [
+ 143,
+ 29
+ ],
+ [
+ 142,
+ 27
+ ],
+ [
+ 137,
+ 20
+ ],
+ [
+ 132,
+ 11
+ ],
+ [
+ 127,
+ 2
+ ],
+ [
+ 122,
+ -9
+ ],
+ [
+ 121,
+ -11
+ ],
+ [
+ 121,
+ -12
+ ],
+ [
+ 118,
+ -12
+ ],
+ [
+ 116,
+ -12
+ ],
+ [
+ 115,
+ -12
+ ],
+ [
+ 114,
+ -12
+ ],
+ [
+ 112,
+ -14
+ ],
+ [
+ 104,
+ -18
+ ],
+ [
+ 97,
+ -24
+ ],
+ [
+ 88,
+ -29
+ ],
+ [
+ 83,
+ -32
+ ],
+ [
+ 79,
+ -33
+ ],
+ [
+ 77,
+ -34
+ ],
+ [
+ 76,
+ -34
+ ],
+ [
+ 75,
+ -34
+ ],
+ [
+ 72,
+ -34
+ ],
+ [
+ 69,
+ -33
+ ],
+ [
+ 65,
+ -33
+ ],
+ [
+ 59,
+ -33
+ ],
+ [
+ 54,
+ -33
+ ],
+ [
+ 45,
+ -32
+ ],
+ [
+ 38,
+ -28
+ ],
+ [
+ 29,
+ -23
+ ],
+ [
+ 22,
+ -16
+ ],
+ [
+ 15,
+ -10
+ ],
+ [
+ 11,
+ -8
+ ],
+ [
+ 9,
+ -6
+ ],
+ [
+ 4,
+ 1
+ ],
+ [
+ 1,
+ 11
+ ],
+ [
+ 0,
+ 18
+ ],
+ [
+ -2,
+ 25
+ ],
+ [
+ -4,
+ 29
+ ],
+ [
+ -4,
+ 30
+ ],
+ [
+ -5,
+ 30
+ ],
+ [
+ -6,
+ 27
+ ],
+ [
+ -9,
+ 25
+ ],
+ [
+ -11,
+ 23
+ ],
+ [
+ -11,
+ 24
+ ],
+ [
+ -12,
+ 27
+ ],
+ [
+ -17,
+ 32
+ ],
+ [
+ -18,
+ 32
+ ],
+ [
+ -20,
+ 32
+ ],
+ [
+ -21,
+ 30
+ ],
+ [
+ -24,
+ 28
+ ],
+ [
+ -26,
+ 27
+ ],
+ [
+ -30,
+ 26
+ ],
+ [
+ -38,
+ 22
+ ],
+ [
+ -40,
+ 20
+ ],
+ [
+ -42,
+ 18
+ ],
+ [
+ -42,
+ 18
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ },
+ {
+ "type": "freedraw",
+ "version": 173,
+ "versionNonce": 1516352179,
+ "isDeleted": false,
+ "id": "byhLi6Jak_cr7nwB-mUf3",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 242.8125,
+ "y": 235.546875,
+ "strokeColor": "#c92a2a",
+ "backgroundColor": "transparent",
+ "width": 134,
+ "height": 113,
+ "seed": 1260135155,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1666952624073,
+ "link": null,
+ "locked": false,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 2
+ ],
+ [
+ -1,
+ 4
+ ],
+ [
+ -2,
+ 8
+ ],
+ [
+ -4,
+ 13
+ ],
+ [
+ -5,
+ 19
+ ],
+ [
+ -5,
+ 30
+ ],
+ [
+ -4,
+ 36
+ ],
+ [
+ -4,
+ 38
+ ],
+ [
+ -4,
+ 39
+ ],
+ [
+ -3,
+ 36
+ ],
+ [
+ 0,
+ 32
+ ],
+ [
+ 3,
+ 28
+ ],
+ [
+ 6,
+ 25
+ ],
+ [
+ 7,
+ 24
+ ],
+ [
+ 9,
+ 24
+ ],
+ [
+ 13,
+ 23
+ ],
+ [
+ 15,
+ 20
+ ],
+ [
+ 18,
+ 18
+ ],
+ [
+ 21,
+ 17
+ ],
+ [
+ 22,
+ 17
+ ],
+ [
+ 24,
+ 19
+ ],
+ [
+ 25,
+ 25
+ ],
+ [
+ 24,
+ 29
+ ],
+ [
+ 22,
+ 34
+ ],
+ [
+ 18,
+ 39
+ ],
+ [
+ 14,
+ 44
+ ],
+ [
+ 11,
+ 47
+ ],
+ [
+ 10,
+ 48
+ ],
+ [
+ 9,
+ 48
+ ],
+ [
+ 6,
+ 50
+ ],
+ [
+ 2,
+ 55
+ ],
+ [
+ -1,
+ 58
+ ],
+ [
+ -2,
+ 58
+ ],
+ [
+ -6,
+ 58
+ ],
+ [
+ -12,
+ 55
+ ],
+ [
+ -14,
+ 53
+ ],
+ [
+ -15,
+ 52
+ ],
+ [
+ -17,
+ 51
+ ],
+ [
+ -15,
+ 55
+ ],
+ [
+ -13,
+ 58
+ ],
+ [
+ -12,
+ 59
+ ],
+ [
+ -12,
+ 58
+ ],
+ [
+ -13,
+ 55
+ ],
+ [
+ -13,
+ 52
+ ],
+ [
+ -13,
+ 48
+ ],
+ [
+ -13,
+ 46
+ ],
+ [
+ -11,
+ 43
+ ],
+ [
+ -9,
+ 43
+ ],
+ [
+ -6,
+ 43
+ ],
+ [
+ -4,
+ 43
+ ],
+ [
+ -1,
+ 46
+ ],
+ [
+ -1,
+ 48
+ ],
+ [
+ 0,
+ 52
+ ],
+ [
+ 0,
+ 56
+ ],
+ [
+ 0,
+ 58
+ ],
+ [
+ 0,
+ 60
+ ],
+ [
+ 1,
+ 62
+ ],
+ [
+ 2,
+ 64
+ ],
+ [
+ 2,
+ 66
+ ],
+ [
+ 2,
+ 69
+ ],
+ [
+ 2,
+ 71
+ ],
+ [
+ 2,
+ 76
+ ],
+ [
+ 2,
+ 80
+ ],
+ [
+ 2,
+ 83
+ ],
+ [
+ 2,
+ 86
+ ],
+ [
+ 2,
+ 87
+ ],
+ [
+ 3,
+ 88
+ ],
+ [
+ 4,
+ 90
+ ],
+ [
+ 6,
+ 95
+ ],
+ [
+ 7,
+ 98
+ ],
+ [
+ 8,
+ 101
+ ],
+ [
+ 8,
+ 102
+ ],
+ [
+ 8,
+ 101
+ ],
+ [
+ 8,
+ 98
+ ],
+ [
+ 8,
+ 87
+ ],
+ [
+ 8,
+ 81
+ ],
+ [
+ 8,
+ 78
+ ],
+ [
+ 9,
+ 78
+ ],
+ [
+ 11,
+ 82
+ ],
+ [
+ 12,
+ 83
+ ],
+ [
+ 12,
+ 87
+ ],
+ [
+ 12,
+ 91
+ ],
+ [
+ 12,
+ 94
+ ],
+ [
+ 12,
+ 96
+ ],
+ [
+ 12,
+ 98
+ ],
+ [
+ 12,
+ 99
+ ],
+ [
+ 13,
+ 104
+ ],
+ [
+ 15,
+ 107
+ ],
+ [
+ 16,
+ 110
+ ],
+ [
+ 16,
+ 112
+ ],
+ [
+ 17,
+ 113
+ ],
+ [
+ 18,
+ 113
+ ],
+ [
+ 19,
+ 109
+ ],
+ [
+ 20,
+ 105
+ ],
+ [
+ 21,
+ 103
+ ],
+ [
+ 23,
+ 101
+ ],
+ [
+ 24,
+ 101
+ ],
+ [
+ 25,
+ 101
+ ],
+ [
+ 26,
+ 101
+ ],
+ [
+ 27,
+ 102
+ ],
+ [
+ 28,
+ 102
+ ],
+ [
+ 32,
+ 103
+ ],
+ [
+ 37,
+ 104
+ ],
+ [
+ 43,
+ 105
+ ],
+ [
+ 49,
+ 106
+ ],
+ [
+ 53,
+ 106
+ ],
+ [
+ 57,
+ 107
+ ],
+ [
+ 59,
+ 107
+ ],
+ [
+ 60,
+ 107
+ ],
+ [
+ 60,
+ 104
+ ],
+ [
+ 60,
+ 100
+ ],
+ [
+ 60,
+ 96
+ ],
+ [
+ 60,
+ 91
+ ],
+ [
+ 60,
+ 90
+ ],
+ [
+ 61,
+ 90
+ ],
+ [
+ 62,
+ 90
+ ],
+ [
+ 64,
+ 90
+ ],
+ [
+ 66,
+ 93
+ ],
+ [
+ 66,
+ 94
+ ],
+ [
+ 68,
+ 94
+ ],
+ [
+ 69,
+ 94
+ ],
+ [
+ 71,
+ 94
+ ],
+ [
+ 75,
+ 91
+ ],
+ [
+ 83,
+ 85
+ ],
+ [
+ 90,
+ 79
+ ],
+ [
+ 95,
+ 73
+ ],
+ [
+ 99,
+ 68
+ ],
+ [
+ 102,
+ 65
+ ],
+ [
+ 104,
+ 61
+ ],
+ [
+ 107,
+ 57
+ ],
+ [
+ 108,
+ 55
+ ],
+ [
+ 110,
+ 53
+ ],
+ [
+ 111,
+ 52
+ ],
+ [
+ 111,
+ 49
+ ],
+ [
+ 111,
+ 48
+ ],
+ [
+ 111,
+ 46
+ ],
+ [
+ 111,
+ 45
+ ],
+ [
+ 111,
+ 44
+ ],
+ [
+ 111,
+ 42
+ ],
+ [
+ 112,
+ 39
+ ],
+ [
+ 113,
+ 30
+ ],
+ [
+ 115,
+ 22
+ ],
+ [
+ 117,
+ 16
+ ],
+ [
+ 117,
+ 15
+ ],
+ [
+ 117,
+ 14
+ ],
+ [
+ 117,
+ 13
+ ],
+ [
+ 115,
+ 13
+ ],
+ [
+ 109,
+ 18
+ ],
+ [
+ 105,
+ 24
+ ],
+ [
+ 101,
+ 31
+ ],
+ [
+ 99,
+ 34
+ ],
+ [
+ 101,
+ 34
+ ],
+ [
+ 102,
+ 34
+ ],
+ [
+ 105,
+ 37
+ ],
+ [
+ 106,
+ 38
+ ],
+ [
+ 107,
+ 39
+ ],
+ [
+ 108,
+ 40
+ ],
+ [
+ 109,
+ 43
+ ],
+ [
+ 109,
+ 46
+ ],
+ [
+ 109,
+ 48
+ ],
+ [
+ 109,
+ 54
+ ],
+ [
+ 107,
+ 57
+ ],
+ [
+ 104,
+ 62
+ ],
+ [
+ 101,
+ 66
+ ],
+ [
+ 98,
+ 67
+ ],
+ [
+ 98,
+ 68
+ ],
+ [
+ 97,
+ 68
+ ],
+ [
+ 95,
+ 65
+ ],
+ [
+ 92,
+ 60
+ ],
+ [
+ 92,
+ 58
+ ],
+ [
+ 92,
+ 58
+ ]
+ ],
+ "lastCommittedPoint": null,
+ "simulatePressure": true,
+ "pressures": []
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#FFF"
+ }
+}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/draws/2022-10-28-11-25-20/2023-12-07T00_56_40.991Z.Desktop.excalidraw b/second/semester1/logseq-stuff/logseq/bak/draws/2022-10-28-11-25-20/2023-12-07T00_56_40.991Z.Desktop.excalidraw
new file mode 100644
index 00000000..6cc15274
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/draws/2022-10-28-11-25-20/2023-12-07T00_56_40.991Z.Desktop.excalidraw
@@ -0,0 +1,1271 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "file://",
+ "elements": [
+ {
+ "type": "line",
+ "version": 23,
+ "versionNonce": 1941381733,
+ "isDeleted": false,
+ "id": "yvWaWYUkWRQb9hIzKbVOX",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 192.8125,
+ "y": 163.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 42,
+ "height": 49,
+ "seed": 1791484733,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 42,
+ -49
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 32,
+ "versionNonce": 546202219,
+ "isDeleted": false,
+ "id": "kEicRRx29H6NOIWpsKrIZ",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 234.8125,
+ "y": 115.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 61,
+ "height": 2,
+ "seed": 2022655645,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 61,
+ -2
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 59,
+ "versionNonce": 1070566853,
+ "isDeleted": false,
+ "id": "-hijp5yq9dv3zU9taQIG9",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 191.8125,
+ "y": 165.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 82,
+ "height": 2,
+ "seed": 1845398227,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 82,
+ 2
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 41,
+ "versionNonce": 286055691,
+ "isDeleted": false,
+ "id": "SlmqGw9yUDX0pmtX4uHiY",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 265.8125,
+ "y": 163.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 27,
+ "height": 43,
+ "seed": 659951283,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 27,
+ -43
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 35,
+ "versionNonce": 2021887269,
+ "isDeleted": false,
+ "id": "Rw0TY8Wlt_CCKBeJW_Tta",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 193.8125,
+ "y": 167.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 2,
+ "height": 60,
+ "seed": 945715187,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247593,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 2,
+ 60
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 55,
+ "versionNonce": 1831011243,
+ "isDeleted": false,
+ "id": "QxFFRRgfpUxWKyuE17KUW",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 191.8125,
+ "y": 223.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 80,
+ "height": 3,
+ "seed": 302691411,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 80,
+ 3
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 40,
+ "versionNonce": 759210117,
+ "isDeleted": false,
+ "id": "_gkobFjBxh3gu1tAe6ZYR",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 262.8125,
+ "y": 221.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 1,
+ "height": 51,
+ "seed": 940148979,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -1,
+ -51
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 45,
+ "versionNonce": 1023104587,
+ "isDeleted": false,
+ "id": "XK9yGsPzp0zLx2zGpYn64",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 267.8125,
+ "y": 217.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 30,
+ "height": 40,
+ "seed": 1490033181,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 30,
+ -40
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 38,
+ "versionNonce": 600066021,
+ "isDeleted": false,
+ "id": "j-3HwtVLKQpT9JUeG8Zyb",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 291.8125,
+ "y": 121.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 3,
+ "height": 57,
+ "seed": 404638109,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 3,
+ 57
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 46,
+ "versionNonce": 527455467,
+ "isDeleted": false,
+ "id": "uHDtZRnexpuXhrdCqfhUN",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 196.8125,
+ "y": 218.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 38,
+ "height": 34,
+ "seed": 485827763,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 38,
+ -34
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 68,
+ "versionNonce": 236716869,
+ "isDeleted": false,
+ "id": "DCvbuNGvQi799Um599bPt",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 227.8125,
+ "y": 184.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 62,
+ "height": 6,
+ "seed": 2072343421,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 62,
+ -6
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 46,
+ "versionNonce": 1946976139,
+ "isDeleted": false,
+ "id": "72d9zoxuBCrIPvjtEplv3",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 231.8125,
+ "y": 116.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 4,
+ "height": 63,
+ "seed": 679206461,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -4,
+ 63
+ ]
+ ]
+ },
+ {
+ "type": "ellipse",
+ "version": 62,
+ "versionNonce": 10834597,
+ "isDeleted": false,
+ "id": "CUJibKSw6thH5mkQd9UQO",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 377.8125,
+ "y": 185.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 19,
+ "height": 19,
+ "seed": 304531603,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 57,
+ "versionNonce": 1158305323,
+ "isDeleted": false,
+ "id": "f0HO3nvDJJCPeYMZrQ3UY",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 431.8125,
+ "y": 235.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 16,
+ "height": 17,
+ "seed": 644365139,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 64,
+ "versionNonce": 671987205,
+ "isDeleted": false,
+ "id": "qtB2ZbzYZ7IR3ZW-9CA_W",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 491.8125,
+ "y": 243.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 14,
+ "height": 17,
+ "seed": 401148797,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 55,
+ "versionNonce": 1901353163,
+ "isDeleted": false,
+ "id": "WHTsZNTKK-LdB8TEEvL61",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 421.8125,
+ "y": 287.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 17,
+ "height": 13,
+ "seed": 1694211357,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 73,
+ "versionNonce": 1062382949,
+ "isDeleted": false,
+ "id": "dmoQkJ5hUT92iNEgem4GL",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 481.8125,
+ "y": 292.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 14,
+ "height": 14,
+ "seed": 1593326451,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 61,
+ "versionNonce": 377816939,
+ "isDeleted": false,
+ "id": "s_FM0khZu-PG-IE-VuGmb",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 360.8125,
+ "y": 318.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 8,
+ "height": 12,
+ "seed": 685153373,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 84,
+ "versionNonce": 1170323653,
+ "isDeleted": false,
+ "id": "LuiPoReZCSt4K3dAnpGH5",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 504.8125,
+ "y": 331.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 17,
+ "height": 19,
+ "seed": 1426475283,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "ellipse",
+ "version": 51,
+ "versionNonce": 988209675,
+ "isDeleted": false,
+ "id": "Op3RQpMfp3LG6A4B_j7Uv",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 555.8125,
+ "y": 177.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 22,
+ "height": 18,
+ "seed": 948623955,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false
+ },
+ {
+ "type": "line",
+ "version": 66,
+ "versionNonce": 1962432549,
+ "isDeleted": false,
+ "id": "xzCDjiBbGLsZLnJPwF74V",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 396.8125,
+ "y": 194.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 157,
+ "height": 4,
+ "seed": 325122909,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 157,
+ -4
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 76,
+ "versionNonce": 930375851,
+ "isDeleted": false,
+ "id": "ibNSJIcpOMNqK8HBYIr6c",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 384.8125,
+ "y": 203.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 25,
+ "height": 113,
+ "seed": 516956509,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247594,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -25,
+ 113
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 106,
+ "versionNonce": 1994656645,
+ "isDeleted": false,
+ "id": "wpuSuXJy2N3BnEbW6-q9k",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 367.8125,
+ "y": 327.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 129,
+ "height": 16,
+ "seed": 1317670205,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 129,
+ 16
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 71,
+ "versionNonce": 1641552715,
+ "isDeleted": false,
+ "id": "xDT4GrQZk-elMBMm4Gtqf",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 514.8125,
+ "y": 329.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 47,
+ "height": 130,
+ "seed": 652550077,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 47,
+ -130
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 65,
+ "versionNonce": 1539461861,
+ "isDeleted": false,
+ "id": "z6oorwrd5qjeb8pEG5oDz",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 439.8125,
+ "y": 245.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 11,
+ "height": 42,
+ "seed": 1398400947,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -11,
+ 42
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 50,
+ "versionNonce": 1986820587,
+ "isDeleted": false,
+ "id": "qljDCoDwQjQRkPP9SAHiu",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 440.8125,
+ "y": 294.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 40,
+ "height": 9,
+ "seed": 2005148317,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 40,
+ 9
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 49,
+ "versionNonce": 1344319045,
+ "isDeleted": false,
+ "id": "60HDTNYeEU6xAIXjzdSYT",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 493.8125,
+ "y": 290.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 4,
+ "height": 33,
+ "seed": 443676061,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 4,
+ -33
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 93,
+ "versionNonce": 1111229579,
+ "isDeleted": false,
+ "id": "eIT9YIGz_KdH4jou8asr1",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 490.8125,
+ "y": 249.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 45,
+ "height": 9,
+ "seed": 1086166547,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -45,
+ -9
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 72,
+ "versionNonce": 316448165,
+ "isDeleted": false,
+ "id": "0_kME3iJSdL1Kk9-LW42E",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 432.8125,
+ "y": 238.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 39,
+ "height": 36,
+ "seed": 878211475,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -39,
+ -36
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 67,
+ "versionNonce": 218184491,
+ "isDeleted": false,
+ "id": "Wozt3F4wIn74MRP-RoJOJ",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 426.8125,
+ "y": 300.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 69,
+ "height": 24,
+ "seed": 1244532851,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -69,
+ 24
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 103,
+ "versionNonce": 723755269,
+ "isDeleted": false,
+ "id": "Uj9tL5aUD4OW-xtt0OKD-",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 491.8125,
+ "y": 300.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 16,
+ "height": 40,
+ "seed": 945883709,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 16,
+ 40
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 94,
+ "versionNonce": 1126604235,
+ "isDeleted": false,
+ "id": "CBqTDJT1XGQex387m1cVV",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 323.8125,
+ "y": 114.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 333,
+ "height": 25,
+ "seed": 319754493,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "fontSize": 20,
+ "fontFamily": 1,
+ "text": "Picture of a cube - has 6 faces.",
+ "baseline": 18,
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "Picture of a cube - has 6 faces."
+ },
+ {
+ "type": "text",
+ "version": 148,
+ "versionNonce": 1584609381,
+ "isDeleted": false,
+ "id": "Kcie8gw3FVG_HOdZoI4h2",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 361.8125,
+ "y": 396.546875,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 446,
+ "height": 25,
+ "seed": 160254611,
+ "groupIds": [],
+ "strokeSharpness": "sharp",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "fontSize": 20,
+ "fontFamily": 1,
+ "text": "It is also a graph - that also has 4 faces.",
+ "baseline": 18,
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "It is also a graph - that also has 4 faces."
+ },
+ {
+ "type": "line",
+ "version": 35,
+ "versionNonce": 1606855787,
+ "isDeleted": false,
+ "id": "sQN-Mf4y1UPkBbfmCRCWF",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 499.41168212890625,
+ "y": 245.362548828125,
+ "strokeColor": "#000000",
+ "backgroundColor": "transparent",
+ "width": 59.336669921875,
+ "height": 52.946502685546875,
+ "seed": 2035601968,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1667512247595,
+ "link": null,
+ "locked": false,
+ "startBinding": null,
+ "endBinding": null,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 59.336669921875,
+ -52.946502685546875
+ ]
+ ]
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#FFF"
+ }
+}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_11/2022-09-12T11_56_37.220Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_11/2022-09-12T11_56_37.220Z.Desktop.md
new file mode 100644
index 00000000..26e97f2d
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_11/2022-09-12T11_56_37.220Z.Desktop.md
@@ -0,0 +1,15 @@
+- LATER Learn set notation in katex
+- DONE Check ST2001 survey stats
+ :LOGBOOK:
+ CLOCK: [2022-09-11 Sun 09:22:57]--[2022-09-11 Sun 09:24:00] => 00:01:03
+ :END:
+- DONE Check ST2001 Blackboard for assignments
+ :LOGBOOK:
+ CLOCK: [2022-09-11 Sun 09:23:02]--[2022-09-11 Sun 09:33:05] => 00:10:03
+ :END:
+ - DONE Do assignment
+- DOING Laundry
+ :LOGBOOK:
+ CLOCK: [2022-09-11 Sun 17:35:54]
+ :END:
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_16/2022-09-16T09_01_15.127Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_16/2022-09-16T09_01_15.127Z.Desktop.md
new file mode 100644
index 00000000..92f48f45
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_16/2022-09-16T09_01_15.127Z.Desktop.md
@@ -0,0 +1,3 @@
+- TODO PDF unite script
+- TODO Merge PDFs from Week 1 and Week 2
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_16/2022-09-16T09_59_15.501Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_16/2022-09-16T09_59_15.501Z.Desktop.md
new file mode 100644
index 00000000..92f48f45
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_16/2022-09-16T09_59_15.501Z.Desktop.md
@@ -0,0 +1,3 @@
+- TODO PDF unite script
+- TODO Merge PDFs from Week 1 and Week 2
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_16/2022-09-17T14_38_29.990Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_16/2022-09-17T14_38_29.990Z.Desktop.md
new file mode 100644
index 00000000..92f48f45
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_16/2022-09-17T14_38_29.990Z.Desktop.md
@@ -0,0 +1,3 @@
+- TODO PDF unite script
+- TODO Merge PDFs from Week 1 and Week 2
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-27T10_08_55.497Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-27T10_08_55.497Z.Desktop.md
new file mode 100644
index 00000000..b9df7e43
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-27T10_08_55.497Z.Desktop.md
@@ -0,0 +1,25 @@
+- Idea for 日本語 かんじ input:
+ - # Kanji
+ - ## 日 (for example) # card
+ - **うん Reading:** ひ。
+ - **くん Reading:** に。
+ - **Meaning:** Sun, day.
+ - **Strokes:** 5.
+ - ### Vocabulary
+ - **日曜日 ->** Sunday.
+ -
+- DOING CT2106 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-24 Sat 17:55:48]
+ CLOCK: [2022-09-24 Sat 17:55:50]
+ :END:
+ - DUE 2022年09月30日 金曜日 23:59
+ - DONE Watch Lecture 2
+ - DONE Lecture Slides
+ - DONE Lecture 1 Slides
+ :LOGBOOK:
+ CLOCK: [2022-09-24 Sat 18:32:35]--[2022-09-24 Sat 18:32:36] => 00:00:01
+ :END:
+ - DONE Lecture 2 Slides
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-27T11_50_47.795Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-27T11_50_47.795Z.Desktop.md
new file mode 100644
index 00000000..b9df7e43
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-27T11_50_47.795Z.Desktop.md
@@ -0,0 +1,25 @@
+- Idea for 日本語 かんじ input:
+ - # Kanji
+ - ## 日 (for example) # card
+ - **うん Reading:** ひ。
+ - **くん Reading:** に。
+ - **Meaning:** Sun, day.
+ - **Strokes:** 5.
+ - ### Vocabulary
+ - **日曜日 ->** Sunday.
+ -
+- DOING CT2106 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-24 Sat 17:55:48]
+ CLOCK: [2022-09-24 Sat 17:55:50]
+ :END:
+ - DUE 2022年09月30日 金曜日 23:59
+ - DONE Watch Lecture 2
+ - DONE Lecture Slides
+ - DONE Lecture 1 Slides
+ :LOGBOOK:
+ CLOCK: [2022-09-24 Sat 18:32:35]--[2022-09-24 Sat 18:32:36] => 00:00:01
+ :END:
+ - DONE Lecture 2 Slides
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-27T13_09_31.376Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-27T13_09_31.376Z.Desktop.md
new file mode 100644
index 00000000..b9df7e43
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-27T13_09_31.376Z.Desktop.md
@@ -0,0 +1,25 @@
+- Idea for 日本語 かんじ input:
+ - # Kanji
+ - ## 日 (for example) # card
+ - **うん Reading:** ひ。
+ - **くん Reading:** に。
+ - **Meaning:** Sun, day.
+ - **Strokes:** 5.
+ - ### Vocabulary
+ - **日曜日 ->** Sunday.
+ -
+- DOING CT2106 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-24 Sat 17:55:48]
+ CLOCK: [2022-09-24 Sat 17:55:50]
+ :END:
+ - DUE 2022年09月30日 金曜日 23:59
+ - DONE Watch Lecture 2
+ - DONE Lecture Slides
+ - DONE Lecture 1 Slides
+ :LOGBOOK:
+ CLOCK: [2022-09-24 Sat 18:32:35]--[2022-09-24 Sat 18:32:36] => 00:00:01
+ :END:
+ - DONE Lecture 2 Slides
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-29T09_57_09.797Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-29T09_57_09.797Z.Desktop.md
new file mode 100644
index 00000000..1721bd87
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_24/2022-09-29T09_57_09.797Z.Desktop.md
@@ -0,0 +1,11 @@
+- Idea for 日本語 かんじ input:
+ - # Kanji
+ - ## 日 (for example) # card
+ - **うん Reading:** ひ。
+ - **くん Reading:** に。
+ - **Meaning:** Sun, day.
+ - **Strokes:** 5.
+ - ### Vocabulary
+ - **日曜日 ->** Sunday.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-26T15_56_07.810Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-26T15_56_07.810Z.Desktop.md
new file mode 100644
index 00000000..4fc5821e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-26T15_56_07.810Z.Desktop.md
@@ -0,0 +1,18 @@
+- ## Lectures
+ - TODO CT255 Lecture Notes
+ - TODO CT213 Lecture Notes
+ - TODO Lecture 1
+ - TODO Lecture 2
+ - TODO ST2001 Lecture Notes
+ - TODO Last week's
+ - TODO This week's
+-
+- ## Assignments
+ - TODO Finish CT2106 Assignment 1
+ - TODO ST2001 Lab Assignment
+ - TODO CT255 Assignment 1
+ - DONE Finish CT230 Lab Assignment
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 12:26:06]--[2022-09-26 Mon 12:33:29] => 00:07:23
+ :END:
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-27T10_08_55.501Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-27T10_08_55.501Z.Desktop.md
new file mode 100644
index 00000000..f4b14fa3
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-27T10_08_55.501Z.Desktop.md
@@ -0,0 +1,32 @@
+- ## Lectures
+ collapsed:: true
+ - DONE CT255 Lecture Notes
+ - DONE CT213 Lecture Notes
+ collapsed:: true
+ - nearly done
+ - DONE ST2001 Lecture Notes
+ collapsed:: true
+ - DONE Last week's
+ - DONE This week's
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:56:14]--[2022-09-26 Mon 16:56:15] => 00:00:01
+ CLOCK: [2022-09-26 Mon 16:56:16]--[2022-09-26 Mon 16:56:17] => 00:00:01
+ :END:
+-
+- ## Assignments
+ - DOING Finish CT2106 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 17:48:37]
+ :END:
+ - DONE Finish Code
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:03:43]--[2022-09-26 Mon 16:03:45] => 00:00:02
+ :END:
+ - TODO Make PDF
+ - TODO ST2001 Lab Assignment
+ - TODO CT255 Assignment 1
+ - DONE Finish CT230 Lab Assignment
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 12:26:06]--[2022-09-26 Mon 12:33:29] => 00:07:23
+ :END:
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-27T11_50_47.798Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-27T11_50_47.798Z.Desktop.md
new file mode 100644
index 00000000..f4b14fa3
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-27T11_50_47.798Z.Desktop.md
@@ -0,0 +1,32 @@
+- ## Lectures
+ collapsed:: true
+ - DONE CT255 Lecture Notes
+ - DONE CT213 Lecture Notes
+ collapsed:: true
+ - nearly done
+ - DONE ST2001 Lecture Notes
+ collapsed:: true
+ - DONE Last week's
+ - DONE This week's
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:56:14]--[2022-09-26 Mon 16:56:15] => 00:00:01
+ CLOCK: [2022-09-26 Mon 16:56:16]--[2022-09-26 Mon 16:56:17] => 00:00:01
+ :END:
+-
+- ## Assignments
+ - DOING Finish CT2106 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 17:48:37]
+ :END:
+ - DONE Finish Code
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:03:43]--[2022-09-26 Mon 16:03:45] => 00:00:02
+ :END:
+ - TODO Make PDF
+ - TODO ST2001 Lab Assignment
+ - TODO CT255 Assignment 1
+ - DONE Finish CT230 Lab Assignment
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 12:26:06]--[2022-09-26 Mon 12:33:29] => 00:07:23
+ :END:
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-27T13_09_31.378Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-27T13_09_31.378Z.Desktop.md
new file mode 100644
index 00000000..f4b14fa3
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-27T13_09_31.378Z.Desktop.md
@@ -0,0 +1,32 @@
+- ## Lectures
+ collapsed:: true
+ - DONE CT255 Lecture Notes
+ - DONE CT213 Lecture Notes
+ collapsed:: true
+ - nearly done
+ - DONE ST2001 Lecture Notes
+ collapsed:: true
+ - DONE Last week's
+ - DONE This week's
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:56:14]--[2022-09-26 Mon 16:56:15] => 00:00:01
+ CLOCK: [2022-09-26 Mon 16:56:16]--[2022-09-26 Mon 16:56:17] => 00:00:01
+ :END:
+-
+- ## Assignments
+ - DOING Finish CT2106 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 17:48:37]
+ :END:
+ - DONE Finish Code
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:03:43]--[2022-09-26 Mon 16:03:45] => 00:00:02
+ :END:
+ - TODO Make PDF
+ - TODO ST2001 Lab Assignment
+ - TODO CT255 Assignment 1
+ - DONE Finish CT230 Lab Assignment
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 12:26:06]--[2022-09-26 Mon 12:33:29] => 00:07:23
+ :END:
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-28T08_06_59.936Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-28T08_06_59.936Z.Desktop.md
new file mode 100644
index 00000000..22871990
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-28T08_06_59.936Z.Desktop.md
@@ -0,0 +1,35 @@
+- ## Lectures
+ collapsed:: true
+ - DONE CT255 Lecture Notes
+ - DONE CT213 Lecture Notes
+ collapsed:: true
+ - nearly done
+ - DONE ST2001 Lecture Notes
+ collapsed:: true
+ - DONE Last week's
+ - DONE This week's
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:56:14]--[2022-09-26 Mon 16:56:15] => 00:00:01
+ CLOCK: [2022-09-26 Mon 16:56:16]--[2022-09-26 Mon 16:56:17] => 00:00:01
+ :END:
+-
+- ## Assignments
+ - DOING Finish CT2106 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 17:48:37]
+ :END:
+ - DONE Finish Code
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:03:43]--[2022-09-26 Mon 16:03:45] => 00:00:02
+ :END:
+ - DOING Make PDF
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 09:31:32]
+ :END:
+ - TODO ST2001 Lab Assignment
+ - TODO CT255 Assignment 1
+ - DONE Finish CT230 Lab Assignment
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 12:26:06]--[2022-09-26 Mon 12:33:29] => 00:07:23
+ :END:
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-28T09_29_44.001Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-28T09_29_44.001Z.Desktop.md
new file mode 100644
index 00000000..22871990
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_26/2022-09-28T09_29_44.001Z.Desktop.md
@@ -0,0 +1,35 @@
+- ## Lectures
+ collapsed:: true
+ - DONE CT255 Lecture Notes
+ - DONE CT213 Lecture Notes
+ collapsed:: true
+ - nearly done
+ - DONE ST2001 Lecture Notes
+ collapsed:: true
+ - DONE Last week's
+ - DONE This week's
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:56:14]--[2022-09-26 Mon 16:56:15] => 00:00:01
+ CLOCK: [2022-09-26 Mon 16:56:16]--[2022-09-26 Mon 16:56:17] => 00:00:01
+ :END:
+-
+- ## Assignments
+ - DOING Finish CT2106 Assignment 1
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 17:48:37]
+ :END:
+ - DONE Finish Code
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 16:03:43]--[2022-09-26 Mon 16:03:45] => 00:00:02
+ :END:
+ - DOING Make PDF
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 09:31:32]
+ :END:
+ - TODO ST2001 Lab Assignment
+ - TODO CT255 Assignment 1
+ - DONE Finish CT230 Lab Assignment
+ :LOGBOOK:
+ CLOCK: [2022-09-26 Mon 12:26:06]--[2022-09-26 Mon 12:33:29] => 00:07:23
+ :END:
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_27/2022-09-27T18_52_25.894Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_27/2022-09-27T18_52_25.894Z.Desktop.md
new file mode 100644
index 00000000..05ba202e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_27/2022-09-27T18_52_25.894Z.Desktop.md
@@ -0,0 +1,26 @@
+- # 大学
+ - No laptop charger - critical path.
+ - ## CT213
+ - DONE CT213 Quiz 4
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 09:47:43]--[2022-09-27 Tue 09:48:45] => 00:01:02
+ CLOCK: [2022-09-27 Tue 09:48:47]--[2022-09-27 Tue 09:48:48] => 00:00:01
+ :END:
+ - TODO CT213 Lab 4
+ - ## CT230
+ - DONE `SELECT`: Working with strings & subqueries slides
+ - DOING CT230 Lab Week 4 - Problem Sheet 2
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 12:56:14]
+ :END:
+ - DONE Sample Test 1
+ -
+ - ## CT255
+ - TODO Reflective Assignment 1
+ - TODO Next Week's lecture notes - optional
+ - ## MA284
+ - TODO Assignment 2 - optional for now
+ - TODO Combinatorial Proofs Lecture Slides - optional
+ - ## ST2001
+ - TODO Lab Assignment Week 4
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_27/2022-09-28T08_06_59.939Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_27/2022-09-28T08_06_59.939Z.Desktop.md
new file mode 100644
index 00000000..05ba202e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_27/2022-09-28T08_06_59.939Z.Desktop.md
@@ -0,0 +1,26 @@
+- # 大学
+ - No laptop charger - critical path.
+ - ## CT213
+ - DONE CT213 Quiz 4
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 09:47:43]--[2022-09-27 Tue 09:48:45] => 00:01:02
+ CLOCK: [2022-09-27 Tue 09:48:47]--[2022-09-27 Tue 09:48:48] => 00:00:01
+ :END:
+ - TODO CT213 Lab 4
+ - ## CT230
+ - DONE `SELECT`: Working with strings & subqueries slides
+ - DOING CT230 Lab Week 4 - Problem Sheet 2
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 12:56:14]
+ :END:
+ - DONE Sample Test 1
+ -
+ - ## CT255
+ - TODO Reflective Assignment 1
+ - TODO Next Week's lecture notes - optional
+ - ## MA284
+ - TODO Assignment 2 - optional for now
+ - TODO Combinatorial Proofs Lecture Slides - optional
+ - ## ST2001
+ - TODO Lab Assignment Week 4
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_27/2022-09-28T09_29_44.004Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_27/2022-09-28T09_29_44.004Z.Desktop.md
new file mode 100644
index 00000000..05ba202e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_09_27/2022-09-28T09_29_44.004Z.Desktop.md
@@ -0,0 +1,26 @@
+- # 大学
+ - No laptop charger - critical path.
+ - ## CT213
+ - DONE CT213 Quiz 4
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 09:47:43]--[2022-09-27 Tue 09:48:45] => 00:01:02
+ CLOCK: [2022-09-27 Tue 09:48:47]--[2022-09-27 Tue 09:48:48] => 00:00:01
+ :END:
+ - TODO CT213 Lab 4
+ - ## CT230
+ - DONE `SELECT`: Working with strings & subqueries slides
+ - DOING CT230 Lab Week 4 - Problem Sheet 2
+ :LOGBOOK:
+ CLOCK: [2022-09-27 Tue 12:56:14]
+ :END:
+ - DONE Sample Test 1
+ -
+ - ## CT255
+ - TODO Reflective Assignment 1
+ - TODO Next Week's lecture notes - optional
+ - ## MA284
+ - TODO Assignment 2 - optional for now
+ - TODO Combinatorial Proofs Lecture Slides - optional
+ - ## ST2001
+ - TODO Lab Assignment Week 4
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_10_18/2022-10-20T14_17_45.688Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_10_18/2022-10-20T14_17_45.688Z.Desktop.md
new file mode 100644
index 00000000..aeff724e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_10_18/2022-10-20T14_17_45.688Z.Desktop.md
@@ -0,0 +1,5 @@
+-
+ -
+- https://www.earthcam.com/world/ireland/dublin/?cam=templebar
+- https://yewtu.be/watch?v=i3Lzj3sS-wg
+- https://www.tepco.co.jp/decommission/progress/about/livecamera/index-j.html
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_10_24/2022-10-26T11_13_38.115Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_10_24/2022-10-26T11_13_38.115Z.Desktop.md
new file mode 100644
index 00000000..aeb0795b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_10_24/2022-10-26T11_13_38.115Z.Desktop.md
@@ -0,0 +1,19 @@
+- TODO CT213 Last week's slides
+ - TODO Download
+ - TODO take notes
+-
+- # Tasks (In Order of Importance)
+ - DONE CT255 Assignment 1 - Breaking Hash Functions. Due: 2022年10月23日 23:59。
+ - TODO ST2001 Assignment 4. Due: 2022年10月27日 15:00。
+ :LOGBOOK:
+ CLOCK: [2022-10-20 Thu 16:18:09]--[2022-10-20 Thu 16:18:10] => 00:00:01
+ :END:
+ - got 85% last attempt. cunts.
+ - TODO CT2106 Assignment 3. Due: 2022年10月28日 23:59。
+ - TODO CT255 Assignment 2 - Rainbow Tables. Due: 2022年10月30日 23:59。
+ - TODO CT213 Assignment 1. Due 2022年11月04日 17:00。
+ - TODO MA284 Assignment 3. Due: 2022年11月04日 23:00。
+-
+- **CT213 Idea:** store the count of late trains etc. and visualize em using grafana
+ background-color:: pink
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_10_24/2022-10-31T20_30_15.889Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_10_24/2022-10-31T20_30_15.889Z.Desktop.md
new file mode 100644
index 00000000..76a937e9
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_10_24/2022-10-31T20_30_15.889Z.Desktop.md
@@ -0,0 +1,22 @@
+- TODO CT213 Last week's slides
+ - TODO Download
+ - TODO take notes
+-
+- # Tasks (In Order of Importance)
+ - DONE CT255 Assignment 1 - Breaking Hash Functions. Due: 2022年10月23日 23:59。
+ - DONE ST2001 Assignment 4. Due: 2022年10月27日 15:00。
+ :LOGBOOK:
+ CLOCK: [2022-10-20 Thu 16:18:09]--[2022-10-20 Thu 16:18:10] => 00:00:01
+ :END:
+ - got 95% last attempt.
+ - TODO CT2106 Assignment 3. Due: 2022年10月28日 23:59。
+ - TODO CT255 Assignment 2 - Rainbow Tables. Due: 2022年11月01日 23:59。
+ - TODO CT213 Assignment 1. Due 2022年11月04日 17:00。
+ - TODO MA284 Assignment 3. Due: 2022年11月04日 23:00。
+ :LOGBOOK:
+ CLOCK: [2022-10-26 Wed 10:09:57]--[2022-10-27 Thu 10:05:58] => 23:56:01
+ :END:
+-
+- **CT213 Idea:** store the count of late trains etc. and visualize em using grafana
+ background-color:: pink
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_08/2022-11-10T07_51_39.987Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_08/2022-11-10T07_51_39.987Z.Desktop.md
new file mode 100644
index 00000000..21159b26
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_08/2022-11-10T07_51_39.987Z.Desktop.md
@@ -0,0 +1,56 @@
+- # ストフ:
+ - TODO CT216 Lecture Notes. Due: 2022-11-10 13:00.
+ background-color:: yellow
+ - TODO Functions Slides.
+ background-color:: yellow
+ - TODO Objects Slides.
+ background-color:: yellow
+ - TODO Intro to node slides.
+ background-color:: yellow
+ - TODO deploying to firebase slides.
+ background-color:: yellow
+ - TODO CT213 Labs. Due: 2022-11-10 16:00.
+ background-color:: yellow
+ - TODO Week 8 Lab.
+ background-color:: yellow
+ - TODO Week 9 Lab.
+ background-color:: yellow
+ - TODO CT255 Assignment 3 - Steganography. Due: 2022-11-13 23:59.
+ background-color:: red
+ - TODO ST2001 Assignment 5. Due: 2022-11-14 15:00.
+ background-color:: red
+ - TODO ST2001 Lecture Notes. Due: 2022-11-14 16:00.
+ background-color:: green
+ - TODO Discrete Probability Distributions.
+ background-color:: green
+ - TODO Normal Distribution.
+ background-color:: green
+ - TODO Sampling Distribution & Confidence Intervals.
+ background-color:: green
+ - TODO Hypothesis Testing.
+ background-color:: green
+ - TODO ST2001 Labs. Due: 2022-11-14 17:00.
+ background-color:: gray
+ - TODO Lab 5.
+ background-color:: gray
+ - TODO Lab 6.
+ background-color:: gray
+ - TODO Lab 7.
+ background-color:: gray
+ :LOGBOOK:
+ CLOCK: [2022-11-05 Sat 16:17:40]--[2022-11-05 Sat 16:17:41] => 00:00:01
+ :END:
+ - TODO Lab 8.
+ background-color:: gray
+ - TODO Lab 9.
+ background-color:: gray
+ - TODO CT2106 Assignment 4. Due: 2022-11-18 23:59.
+ background-color:: red
+ - TODO MA284 Assignment 4. Due: 2022-11-21 17:00.
+ background-color:: red
+ - TODO CT213 Assignment 2. Due: 2022-11-25 17:00.
+ background-color:: red
+ - TODO CT255 Assignment 4. Due: 2022-11-25 23:59.
+ background-color:: red
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_10/2022-11-10T12_58_13.862Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_10/2022-11-10T12_58_13.862Z.Desktop.md
new file mode 100644
index 00000000..668e6166
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_10/2022-11-10T12_58_13.862Z.Desktop.md
@@ -0,0 +1,46 @@
+- # ストフ:
+ - TODO CT255 Assignment 3 - Steganography. Due: 2022-11-13 23:59.
+ background-color:: red
+ - TODO ST2001 Assignment 5. Due: 2022-11-14 15:00.
+ background-color:: red
+ - TODO ST2001 Lecture Notes. Due: 2022-11-14 16:00.
+ background-color:: green
+ - DONE [[Discrete Probability Distributions: Binomial & Poisson]] .
+ background-color:: green
+ - DONE [[The Normal Distribution]] .
+ background-color:: green
+ :LOGBOOK:
+ CLOCK: [2022-11-10 Thu 08:08:11]--[2022-11-10 Thu 08:16:35] => 00:08:24
+ :END:
+ - TODO [[Sampling Distributions & Confidence Intervals]] .
+ background-color:: green
+ :LOGBOOK:
+ CLOCK: [2022-11-10 Thu 07:52:48]--[2022-11-10 Thu 07:52:48] => 00:00:00
+ CLOCK: [2022-11-10 Thu 08:16:41]--[2022-11-10 Thu 08:37:03] => 00:20:22
+ :END:
+ - TODO [[Hypothesis Testing]] .
+ background-color:: green
+ - TODO ST2001 Labs. Due: 2022-11-14 17:00.
+ background-color:: gray
+ - TODO Lab 5.
+ background-color:: gray
+ - TODO Lab 6.
+ background-color:: gray
+ - TODO Lab 7.
+ background-color:: gray
+ :LOGBOOK:
+ CLOCK: [2022-11-05 Sat 16:17:40]--[2022-11-05 Sat 16:17:41] => 00:00:01
+ :END:
+ - TODO Lab 8.
+ background-color:: gray
+ - TODO Lab 9.
+ background-color:: gray
+ - TODO CT2106 Assignment 4. Due: 2022-11-18 23:59.
+ background-color:: red
+ - TODO MA284 Assignment 4. Due: 2022-11-21 17:00.
+ background-color:: red
+ - TODO CT213 Assignment 2. Due: 2022-11-25 17:00.
+ background-color:: red
+ - TODO CT255 Assignment 4. Due: 2022-11-25 23:59.
+ background-color:: red
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_10/2022-11-10T15_58_09.673Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_10/2022-11-10T15_58_09.673Z.Desktop.md
new file mode 100644
index 00000000..668e6166
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_10/2022-11-10T15_58_09.673Z.Desktop.md
@@ -0,0 +1,46 @@
+- # ストフ:
+ - TODO CT255 Assignment 3 - Steganography. Due: 2022-11-13 23:59.
+ background-color:: red
+ - TODO ST2001 Assignment 5. Due: 2022-11-14 15:00.
+ background-color:: red
+ - TODO ST2001 Lecture Notes. Due: 2022-11-14 16:00.
+ background-color:: green
+ - DONE [[Discrete Probability Distributions: Binomial & Poisson]] .
+ background-color:: green
+ - DONE [[The Normal Distribution]] .
+ background-color:: green
+ :LOGBOOK:
+ CLOCK: [2022-11-10 Thu 08:08:11]--[2022-11-10 Thu 08:16:35] => 00:08:24
+ :END:
+ - TODO [[Sampling Distributions & Confidence Intervals]] .
+ background-color:: green
+ :LOGBOOK:
+ CLOCK: [2022-11-10 Thu 07:52:48]--[2022-11-10 Thu 07:52:48] => 00:00:00
+ CLOCK: [2022-11-10 Thu 08:16:41]--[2022-11-10 Thu 08:37:03] => 00:20:22
+ :END:
+ - TODO [[Hypothesis Testing]] .
+ background-color:: green
+ - TODO ST2001 Labs. Due: 2022-11-14 17:00.
+ background-color:: gray
+ - TODO Lab 5.
+ background-color:: gray
+ - TODO Lab 6.
+ background-color:: gray
+ - TODO Lab 7.
+ background-color:: gray
+ :LOGBOOK:
+ CLOCK: [2022-11-05 Sat 16:17:40]--[2022-11-05 Sat 16:17:41] => 00:00:01
+ :END:
+ - TODO Lab 8.
+ background-color:: gray
+ - TODO Lab 9.
+ background-color:: gray
+ - TODO CT2106 Assignment 4. Due: 2022-11-18 23:59.
+ background-color:: red
+ - TODO MA284 Assignment 4. Due: 2022-11-21 17:00.
+ background-color:: red
+ - TODO CT213 Assignment 2. Due: 2022-11-25 17:00.
+ background-color:: red
+ - TODO CT255 Assignment 4. Due: 2022-11-25 23:59.
+ background-color:: red
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_10/2022-11-10T19_23_43.720Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_10/2022-11-10T19_23_43.720Z.Desktop.md
new file mode 100644
index 00000000..668e6166
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_10/2022-11-10T19_23_43.720Z.Desktop.md
@@ -0,0 +1,46 @@
+- # ストフ:
+ - TODO CT255 Assignment 3 - Steganography. Due: 2022-11-13 23:59.
+ background-color:: red
+ - TODO ST2001 Assignment 5. Due: 2022-11-14 15:00.
+ background-color:: red
+ - TODO ST2001 Lecture Notes. Due: 2022-11-14 16:00.
+ background-color:: green
+ - DONE [[Discrete Probability Distributions: Binomial & Poisson]] .
+ background-color:: green
+ - DONE [[The Normal Distribution]] .
+ background-color:: green
+ :LOGBOOK:
+ CLOCK: [2022-11-10 Thu 08:08:11]--[2022-11-10 Thu 08:16:35] => 00:08:24
+ :END:
+ - TODO [[Sampling Distributions & Confidence Intervals]] .
+ background-color:: green
+ :LOGBOOK:
+ CLOCK: [2022-11-10 Thu 07:52:48]--[2022-11-10 Thu 07:52:48] => 00:00:00
+ CLOCK: [2022-11-10 Thu 08:16:41]--[2022-11-10 Thu 08:37:03] => 00:20:22
+ :END:
+ - TODO [[Hypothesis Testing]] .
+ background-color:: green
+ - TODO ST2001 Labs. Due: 2022-11-14 17:00.
+ background-color:: gray
+ - TODO Lab 5.
+ background-color:: gray
+ - TODO Lab 6.
+ background-color:: gray
+ - TODO Lab 7.
+ background-color:: gray
+ :LOGBOOK:
+ CLOCK: [2022-11-05 Sat 16:17:40]--[2022-11-05 Sat 16:17:41] => 00:00:01
+ :END:
+ - TODO Lab 8.
+ background-color:: gray
+ - TODO Lab 9.
+ background-color:: gray
+ - TODO CT2106 Assignment 4. Due: 2022-11-18 23:59.
+ background-color:: red
+ - TODO MA284 Assignment 4. Due: 2022-11-21 17:00.
+ background-color:: red
+ - TODO CT213 Assignment 2. Due: 2022-11-25 17:00.
+ background-color:: red
+ - TODO CT255 Assignment 4. Due: 2022-11-25 23:59.
+ background-color:: red
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_17/2022-11-18T14_14_29.759Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_17/2022-11-18T14_14_29.759Z.Desktop.md
new file mode 100644
index 00000000..245c95c0
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/journals/2022_11_17/2022-11-18T14_14_29.759Z.Desktop.md
@@ -0,0 +1,28 @@
+- # ストフ:
+ - ## 今週
+ - TODO CT2106 Assignment 4. Due: 2022-11-18 23:59.
+ background-color:: red
+ :LOGBOOK:
+ CLOCK: [2022-11-17 Thu 14:37:25]--[2022-11-17 Thu 19:07:02] => 04:29:37
+ :END:
+ - TODO 日本語 Homework. Due: 2022-11-19 12:00.
+ - ## 次の週
+ - TODO MA284 Assignment 4. Due: 2022-11-21 17:00.
+ background-color:: red
+ - TODO CT213 Assignment 2. Due: 2022-11-25 17:00.
+ background-color:: yellow
+ - TODO Writeup.
+ - DONE CTRL + C Trapping.
+ - TODO MA284 Assignment 5. Due: 2022-11-25 17:00.
+ background-color:: red
+ - TODO CT255 Assignment 4. Due: 2022-11-25 23:59.
+ background-color:: red
+ :LOGBOOK:
+ CLOCK: [2022-11-16 Wed 18:55:47]--[2022-11-17 Thu 09:08:37] => 14:12:50
+ :END:
+ - ## Later
+ - TODO ST2001 Final Assignment. Due: 2022-11-28 15:00.
+ background-color:: red
+ - TODO ST2001 Sample Exam. Due: 2022-12-14 23:59.
+ background-color:: yellow
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T08_01_37.982Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T08_01_37.982Z.Desktop.edn
new file mode 100644
index 00000000..90ea7a4f
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T08_01_37.982Z.Desktop.edn
@@ -0,0 +1,374 @@
+[{:block/name "2022年10月20日",
+ :block/created-at 1666252964929,
+ :block/updated-at 1666260437195}
+ {:block/name "2022年11月08日",
+ :block/created-at 1667898589243,
+ :block/updated-at 1668009370498}
+ {:block/name "2022年11月09日",
+ :block/created-at 1667995284177,
+ :block/updated-at 1667995284177}
+ {:block/name ": https:",
+ :block/created-at 1667901092192,
+ :block/updated-at 1667901092192}
+ {:block/name ": https://dbis-uibk.github.io",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local/uibk",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name
+ ": https://dbis-uibk.github.io/relax/calc/local/uibk/local",
+ :block/created-at 1667901092195,
+ :block/updated-at 1667901092195}
+ {:block/name "a",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "abstraction & polymorphism",
+ :block/created-at 1666256757802,
+ :block/updated-at 1666857873332}
+ {:block/name "advanced pie, derangements, & counting functions",
+ :block/created-at 1665576126852,
+ :block/updated-at 1666784394067}
+ {:block/name "aggregate clauses, group by, & having clauses",
+ :block/created-at 1664362619357,
+ :block/updated-at 1665401573078}
+ {:block/name "agile methods - extreme programming",
+ :block/created-at 1664439358122,
+ :block/updated-at 1666267099375}
+ {:block/name "b",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "bidirectional",
+ :block/created-at 1667899472428,
+ :block/updated-at 1667899472428}
+ {:block/name "binomial coefficients",
+ :block/created-at 1663699875848,
+ :block/updated-at 1665269689188}
+ {:block/name "bootstrap css",
+ :block/created-at 1666267099374,
+ :block/updated-at 1668007630745}
+ {:block/name "c",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "canceled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "cancelled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card7",
+ :block/created-at 1665403674807,
+ :block/updated-at 1665403674807}
+ {:block/name "cloud computing",
+ :block/created-at 1662846706068,
+ :block/updated-at 1665049290982}
+ {:block/name "coding up inheritance",
+ :block/created-at 1665648103834,
+ :block/updated-at 1666253134753}
+ {:block/name "colouring graphs; eulerian & hamiltonian graphs",
+ :block/created-at 1667999555780,
+ :block/updated-at 1668001880951}
+ {:block/name "combinatorial proofs",
+ :block/created-at 1664365559513,
+ :block/updated-at 1665139028342}
+ {:block/name "contents",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "convex polyhedra",
+ :block/created-at 1667912443470,
+ :block/updated-at 1667999555782}
+ {:block/name "counting",
+ :block/created-at 1662844737516,
+ :block/updated-at 1665137815453}
+ {:block/name "cpu management - scheduling",
+ :block/created-at 1664802250958,
+ :block/updated-at 1667997827949}
+ {:block/name "ct2106 - object-oriented programming",
+ :block/created-at 1662812504035,
+ :block/updated-at 1662812504035}
+ {:block/name "ct213 - computer systems & organisation",
+ :block/created-at 1662812363300,
+ :block/updated-at 1662828172731}
+ {:block/name "ct216 - software engineering i",
+ :block/created-at 1662812477523,
+ :block/updated-at 1662846690423}
+ {:block/name "ct230 - database systems i",
+ :block/created-at 1662812383585,
+ :block/updated-at 1662846569759}
+ {:block/name "ct255 - next generation technologies ii",
+ :block/created-at 1662755524966,
+ :block/updated-at 1662843069874}
+ {:block/name "database system introduction",
+ :block/created-at 1662845439484,
+ :block/updated-at 1665139118861}
+ {:block/name "definitions & planar graphs",
+ :block/created-at 1666785671806,
+ :block/updated-at 1667912443471}
+ {:block/name "describing data in r",
+ :block/created-at 1663587324380,
+ :block/updated-at 1665269306101}
+ {:block/name "diffie-hellman key exchange",
+ :block/created-at 1667829411273,
+ :block/updated-at 1667997679213}
+ {:block/name "discrete probability distributions: binomial & poisson",
+ :block/created-at 1665414098028,
+ :block/updated-at 1667997598005}
+ {:block/name "doing",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "done",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "draws/2022-10-19-13-24-31.excalidraw",
+ :block/created-at 1666182420922,
+ :block/updated-at 1666182420922}
+ {:block/name "draws/2022-10-28-10-59-13.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-10-59-33.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-11-04-05.excalidraw",
+ :block/created-at 1666951586882,
+ :block/updated-at 1666951586882}
+ {:block/name "draws/2022-10-28-11-22-12.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-25-20.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-38-31.excalidraw",
+ :block/created-at 1666953986830,
+ :block/updated-at 1666953986830}
+ {:block/name "entity relationship models",
+ :block/created-at 1664888080307,
+ :block/updated-at 1666785065248}
+ {:block/name "exploratory data analysis",
+ :block/created-at 1662760881692,
+ :block/updated-at 1665402231847}
+ {:block/name "extra-curriculars",
+ :block/created-at 1662817977281,
+ :block/updated-at 1662818031268}
+ {:block/name "favorites",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "file",
+ :block/created-at 1663501516528,
+ :block/updated-at 1663501516528}
+ {:block/name "file-path",
+ :block/created-at 1663501516532,
+ :block/updated-at 1663501516532}
+ {:block/name "first java code",
+ :block/created-at 1663059929750,
+ :block/updated-at 1665402183209}
+ {:block/name "friedrich nietzsche",
+ :block/created-at 1663877719000,
+ :block/updated-at 1663877723364}
+ {:block/name "gdpr",
+ :block/created-at 1662755846087,
+ :block/updated-at 1666784905393}
+ {:block/name "hash cracking using rainbow tables",
+ :block/created-at 1666007838619,
+ :block/updated-at 1666615755027}
+ {:block/name "hls__2bct-1_1662890969894_0",
+ :block/created-at 1662891145360,
+ :block/updated-at 1662891145360}
+ {:block/name "human security & passwords",
+ :block/created-at 1664798283314,
+ :block/updated-at 1666785040082}
+ {:block/name "hypothesis testing",
+ :block/created-at 1667837632146,
+ :block/updated-at 1667997712703}
+ {:block/name "in-progress",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "interfaces",
+ :block/created-at 1666857873329,
+ :block/updated-at 1667997871737}
+ {:block/name "introduction to agile methods",
+ :block/created-at 1663848388175,
+ :block/updated-at 1665401551626}
+ {:block/name "introduction to cryptography",
+ :block/created-at 1663488291074,
+ :block/updated-at 1666168991848}
+ {:block/name "introduction to cybersecurity",
+ :block/created-at 1662755701938,
+ :block/updated-at 1664807302595}
+ {:block/name "introduction to graph theory",
+ :block/created-at 1666180750693,
+ :block/updated-at 1666785671809}
+ {:block/name "introduction to inheritance",
+ :block/created-at 1665047054902,
+ :block/updated-at 1665648103836}
+ {:block/name "introduction to java",
+ :block/created-at 1662850740877,
+ :block/updated-at 1664630972286}
+ {:block/name "introduction to nodejs",
+ :block/created-at 1668008830314,
+ :block/updated-at 1668009331431}
+ {:block/name "introduction to object-oriented programming",
+ :block/created-at 1662850183398,
+ :block/updated-at 1667997875101}
+ {:block/name "introduction to sql & ddl",
+ :block/created-at 1663153069230,
+ :block/updated-at 1665402192682}
+ {:block/name "irish sign language",
+ :block/created-at 1662818031268,
+ :block/updated-at 1662818031268}
+ {:block/name "javascript functions & events",
+ :block/created-at 1668007630742,
+ :block/updated-at 1668008830316}
+ {:block/name "joins & union queries",
+ :block/created-at 1665572518087,
+ :block/updated-at 1666176972120}
+ {:block/name "later",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "ma284 - discrete mathematics",
+ :block/created-at 1662812426466,
+ :block/updated-at 1662812426466}
+ {:block/name "ma284: homework",
+ :block/created-at 1663235842961,
+ :block/updated-at 1663241964273}
+ {:block/name "memory management",
+ :block/created-at 1666616373198,
+ :block/updated-at 1667835960860}
+ {:block/name "more java code",
+ :block/created-at 1663063793212,
+ :block/updated-at 1665138691304}
+ {:block/name "normalisation",
+ :block/created-at 1666176972119,
+ :block/updated-at 1667899093310}
+ {:block/name "notes",
+ :block/created-at 1662755380739,
+ :block/updated-at 1662755380739}
+ {:block/name "now",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "oop modelling",
+ :block/created-at 1663835834720,
+ :block/updated-at 1665269607467}
+ {:block/name "overview of computer systems",
+ :block/created-at 1662828172731,
+ :block/updated-at 1665402158751}
+ {:block/name "principle of inclusion-exclusion",
+ :block/created-at 1663097242134,
+ :block/updated-at 1665139547406}
+ {:block/name "probability",
+ :block/created-at 1664207767962,
+ :block/updated-at 1666100135523}
+ {:block/name "process management",
+ :block/created-at 1664207768394,
+ :block/updated-at 1666785058913}
+ {:block/name "process synchronisation",
+ :block/created-at 1665410544532,
+ :block/updated-at 1667997770687}
+ {:block/name "programming models",
+ :block/created-at 1662842663185,
+ :block/updated-at 1667997878539}
+ {:block/name "query processing & optimisation",
+ :block/created-at 1667916510155,
+ :block/updated-at 1667997814237}
+ {:block/name "query processing: relational algebra",
+ :block/created-at 1667899093310,
+ :block/updated-at 1668007527417}
+ {:block/name "random variables",
+ :block/created-at 1665050117811,
+ :block/updated-at 1666784919123}
+ {:block/name "sampling",
+ :block/created-at 1663604282449,
+ :block/updated-at 1665401847721}
+ {:block/name "sampling distributions & confidence intervals",
+ :block/created-at 1666624196792,
+ :block/updated-at 1667837632149}
+ {:block/name "scrum roles & ceremonies",
+ :block/created-at 1663849690600,
+ :block/updated-at 1665401531298}
+ {:block/name "second year university",
+ :block/created-at 1662812271350,
+ :block/updated-at 1662890970415}
+ {:block/name "social engineering",
+ :block/created-at 1665403220751,
+ :block/updated-at 1667826227683}
+ {:block/name "software processes",
+ :block/created-at 1663178663476,
+ :block/updated-at 1665401726538}
+ {:block/name "sql dml statement",
+ :block/created-at 1663680232157,
+ :block/updated-at 1665269794723}
+ {:block/name "sql dml: select",
+ :block/created-at 1664284172095,
+ :block/updated-at 1665269774258}
+ {:block/name "sql select: working with strings & subqueries",
+ :block/created-at 1664284172064,
+ :block/updated-at 1666169126193}
+ {:block/name "st2001 - statistics in data science i",
+ :block/created-at 1662760697673,
+ :block/updated-at 1664445709714}
+ {:block/name "st2001 labs",
+ :block/created-at 1663587251924,
+ :block/updated-at 1663587333173}
+ {:block/name "stars & bars",
+ :block/created-at 1664977220358,
+ :block/updated-at 1665576126854}
+ {:block/name "system software & operating systems",
+ :block/created-at 1663453161468,
+ :block/updated-at 1666784902239}
+ {:block/name "template",
+ :block/created-at 1665268399216,
+ :block/updated-at 1665268399216}
+ {:block/name "templates",
+ :block/created-at 1665268290093,
+ :block/updated-at 1665268429238}
+ {:block/name "the normal distribution",
+ :block/created-at 1665655379797,
+ :block/updated-at 1666624196795}
+ {:block/name "the relational model",
+ :block/created-at 1663056902320,
+ :block/updated-at 1665305483011}
+ {:block/name "todo",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name
+ "twilight of the idols (how to philosophise with the hammer)",
+ :block/created-at 1663877741591,
+ :block/updated-at 1663878217528}
+ {:block/name "using r as a calculator",
+ :block/created-at 1662885317609,
+ :block/updated-at 1667997842680}
+ {:block/name "variables & types",
+ :block/created-at 1663833671558,
+ :block/updated-at 1665401889542}
+ {:block/name "wait",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "waiting",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412633}
+ {:block/name "日本語",
+ :block/created-at 1662818014594,
+ :block/updated-at 1662818014594}
+ {:block/name "日本語かんたん",
+ :block/created-at 1664037986968,
+ :block/updated-at 1664037986968}
+ {:block/name "日本語チャレンジ",
+ :block/created-at 1664445429911,
+ :block/updated-at 1664445429911}
+ {:block/name "本",
+ :block/created-at 1663877674293,
+ :block/updated-at 1663877674293}
+ {:block/name "絵からできた漢字1",
+ :block/created-at 1664445430033,
+ :block/updated-at 1665076855455}]
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T13_08_11.640Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T13_08_11.640Z.Desktop.edn
new file mode 100644
index 00000000..90292bc7
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T13_08_11.640Z.Desktop.edn
@@ -0,0 +1,375 @@
+[{:block/name "2022年10月20日",
+ :block/created-at 1666252964929,
+ :block/updated-at 1666260437195}
+ {:block/name "2022年11月10日",
+ :block/created-at 1668066699767,
+ :block/updated-at 1668077670179}
+ {:block/name ": https:",
+ :block/created-at 1667901092192,
+ :block/updated-at 1667901092192}
+ {:block/name ": https://dbis-uibk.github.io",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local/uibk",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name
+ ": https://dbis-uibk.github.io/relax/calc/local/uibk/local",
+ :block/created-at 1667901092195,
+ :block/updated-at 1667901092195}
+ {:block/name
+ ": https://dbis-uibk.github.io/relax/calc/local/uibk/local/0",
+ :block/created-at 1667901092191,
+ :block/updated-at 1667901092191}
+ {:block/name "a",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "abstraction & polymorphism",
+ :block/created-at 1666256757802,
+ :block/updated-at 1666857873332}
+ {:block/name "advanced pie, derangements, & counting functions",
+ :block/created-at 1665576126852,
+ :block/updated-at 1666784394067}
+ {:block/name "aggregate clauses, group by, & having clauses",
+ :block/created-at 1664362619357,
+ :block/updated-at 1665401573078}
+ {:block/name "agile methods - extreme programming",
+ :block/created-at 1664439358122,
+ :block/updated-at 1666267099375}
+ {:block/name "b",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "bidirectional",
+ :block/created-at 1667899472428,
+ :block/updated-at 1667899472428}
+ {:block/name "binomial coefficients",
+ :block/created-at 1663699875848,
+ :block/updated-at 1665269689188}
+ {:block/name "bootstrap css",
+ :block/created-at 1666267099374,
+ :block/updated-at 1668007630745}
+ {:block/name "c",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "canceled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "cancelled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card7",
+ :block/created-at 1665403674807,
+ :block/updated-at 1665403674807}
+ {:block/name "cloud computing",
+ :block/created-at 1662846706068,
+ :block/updated-at 1665049290982}
+ {:block/name "coding up inheritance",
+ :block/created-at 1665648103834,
+ :block/updated-at 1666253134753}
+ {:block/name "colouring graphs; eulerian & hamiltonian graphs",
+ :block/created-at 1667999555780,
+ :block/updated-at 1668001880951}
+ {:block/name "combinatorial proofs",
+ :block/created-at 1664365559513,
+ :block/updated-at 1665139028342}
+ {:block/name "contents",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "convex polyhedra",
+ :block/created-at 1667912443470,
+ :block/updated-at 1667999555782}
+ {:block/name "counting",
+ :block/created-at 1662844737516,
+ :block/updated-at 1665137815453}
+ {:block/name "cpu management - scheduling",
+ :block/created-at 1664802250958,
+ :block/updated-at 1667997827949}
+ {:block/name "ct2106 - object-oriented programming",
+ :block/created-at 1662812504035,
+ :block/updated-at 1662812504035}
+ {:block/name "ct213 - computer systems & organisation",
+ :block/created-at 1662812363300,
+ :block/updated-at 1662828172731}
+ {:block/name "ct216 - software engineering i",
+ :block/created-at 1662812477523,
+ :block/updated-at 1662846690423}
+ {:block/name "ct230 - database systems i",
+ :block/created-at 1662812383585,
+ :block/updated-at 1662846569759}
+ {:block/name "ct255 - next generation technologies ii",
+ :block/created-at 1662755524966,
+ :block/updated-at 1662843069874}
+ {:block/name "database system introduction",
+ :block/created-at 1662845439484,
+ :block/updated-at 1665139118861}
+ {:block/name "definitions & planar graphs",
+ :block/created-at 1666785671806,
+ :block/updated-at 1667912443471}
+ {:block/name "describing data in r",
+ :block/created-at 1663587324380,
+ :block/updated-at 1665269306101}
+ {:block/name "diffie-hellman key exchange",
+ :block/created-at 1667829411273,
+ :block/updated-at 1667997679213}
+ {:block/name "discrete probability distributions: binomial & poisson",
+ :block/created-at 1665414098028,
+ :block/updated-at 1668067669851}
+ {:block/name "doing",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "done",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "draws/2022-10-19-13-24-31.excalidraw",
+ :block/created-at 1666182420922,
+ :block/updated-at 1666182420922}
+ {:block/name "draws/2022-10-28-10-59-13.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-10-59-33.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-11-04-05.excalidraw",
+ :block/created-at 1666951586882,
+ :block/updated-at 1666951586882}
+ {:block/name "draws/2022-10-28-11-22-12.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-25-20.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-38-31.excalidraw",
+ :block/created-at 1666953986830,
+ :block/updated-at 1666953986830}
+ {:block/name "entity relationship models",
+ :block/created-at 1664888080307,
+ :block/updated-at 1666785065248}
+ {:block/name "exploratory data analysis",
+ :block/created-at 1662760881692,
+ :block/updated-at 1665402231847}
+ {:block/name "extra-curriculars",
+ :block/created-at 1662817977281,
+ :block/updated-at 1662818031268}
+ {:block/name "favorites",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "file",
+ :block/created-at 1663501516528,
+ :block/updated-at 1663501516528}
+ {:block/name "file-path",
+ :block/created-at 1663501516532,
+ :block/updated-at 1663501516532}
+ {:block/name "first java code",
+ :block/created-at 1663059929750,
+ :block/updated-at 1665402183209}
+ {:block/name "friedrich nietzsche",
+ :block/created-at 1663877719000,
+ :block/updated-at 1663877723364}
+ {:block/name "gdpr",
+ :block/created-at 1662755846087,
+ :block/updated-at 1666784905393}
+ {:block/name "hash cracking using rainbow tables",
+ :block/created-at 1666007838619,
+ :block/updated-at 1666615755027}
+ {:block/name "hls__2bct-1_1662890969894_0",
+ :block/created-at 1662891145360,
+ :block/updated-at 1662891145360}
+ {:block/name "human security & passwords",
+ :block/created-at 1664798283314,
+ :block/updated-at 1666785040082}
+ {:block/name "hypothesis testing",
+ :block/created-at 1667837632146,
+ :block/updated-at 1667997712703}
+ {:block/name "in-progress",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "interfaces",
+ :block/created-at 1666857873329,
+ :block/updated-at 1667997871737}
+ {:block/name "introduction to agile methods",
+ :block/created-at 1663848388175,
+ :block/updated-at 1665401551626}
+ {:block/name "introduction to cryptography",
+ :block/created-at 1663488291074,
+ :block/updated-at 1666168991848}
+ {:block/name "introduction to cybersecurity",
+ :block/created-at 1662755701938,
+ :block/updated-at 1664807302595}
+ {:block/name "introduction to graph theory",
+ :block/created-at 1666180750693,
+ :block/updated-at 1666785671809}
+ {:block/name "introduction to inheritance",
+ :block/created-at 1665047054902,
+ :block/updated-at 1665648103836}
+ {:block/name "introduction to java",
+ :block/created-at 1662850740877,
+ :block/updated-at 1664630972286}
+ {:block/name "introduction to nodejs",
+ :block/created-at 1668066700245,
+ :block/updated-at 1668066700245}
+ {:block/name "introduction to object-oriented programming",
+ :block/created-at 1662850183398,
+ :block/updated-at 1667997875101}
+ {:block/name "introduction to sql & ddl",
+ :block/created-at 1663153069230,
+ :block/updated-at 1665402192682}
+ {:block/name "irish sign language",
+ :block/created-at 1662818031268,
+ :block/updated-at 1662818031268}
+ {:block/name "javascript functions & events",
+ :block/created-at 1668066700237,
+ :block/updated-at 1668066700237}
+ {:block/name "joins & union queries",
+ :block/created-at 1665572518087,
+ :block/updated-at 1666176972120}
+ {:block/name "later",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "ma284 - discrete mathematics",
+ :block/created-at 1662812426466,
+ :block/updated-at 1662812426466}
+ {:block/name "ma284: homework",
+ :block/created-at 1663235842961,
+ :block/updated-at 1663241964273}
+ {:block/name "memory management",
+ :block/created-at 1666616373198,
+ :block/updated-at 1667835960860}
+ {:block/name "more java code",
+ :block/created-at 1663063793212,
+ :block/updated-at 1665138691304}
+ {:block/name "normalisation",
+ :block/created-at 1666176972119,
+ :block/updated-at 1667899093310}
+ {:block/name "notes",
+ :block/created-at 1662755380739,
+ :block/updated-at 1662755380739}
+ {:block/name "now",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "oop modelling",
+ :block/created-at 1663835834720,
+ :block/updated-at 1665269607467}
+ {:block/name "overview of computer systems",
+ :block/created-at 1662828172731,
+ :block/updated-at 1665402158751}
+ {:block/name "principle of inclusion-exclusion",
+ :block/created-at 1663097242134,
+ :block/updated-at 1665139547406}
+ {:block/name "probability",
+ :block/created-at 1664207767962,
+ :block/updated-at 1666100135523}
+ {:block/name "process management",
+ :block/created-at 1664207768394,
+ :block/updated-at 1666785058913}
+ {:block/name "process synchronisation",
+ :block/created-at 1665410544532,
+ :block/updated-at 1668077904820}
+ {:block/name "programming models",
+ :block/created-at 1662842663185,
+ :block/updated-at 1667997878539}
+ {:block/name "query processing & optimisation",
+ :block/created-at 1667916510155,
+ :block/updated-at 1668077734146}
+ {:block/name "query processing: relational algebra",
+ :block/created-at 1667899093310,
+ :block/updated-at 1668077746581}
+ {:block/name "random variables",
+ :block/created-at 1665050117811,
+ :block/updated-at 1666784919123}
+ {:block/name "sampling",
+ :block/created-at 1663604282449,
+ :block/updated-at 1665401847721}
+ {:block/name "sampling distributions & confidence intervals",
+ :block/created-at 1666624196792,
+ :block/updated-at 1668069396138}
+ {:block/name "scrum roles & ceremonies",
+ :block/created-at 1663849690600,
+ :block/updated-at 1665401531298}
+ {:block/name "second year university",
+ :block/created-at 1662812271350,
+ :block/updated-at 1662890970415}
+ {:block/name "social engineering",
+ :block/created-at 1665403220751,
+ :block/updated-at 1667826227683}
+ {:block/name "software processes",
+ :block/created-at 1663178663476,
+ :block/updated-at 1665401726538}
+ {:block/name "sql dml statement",
+ :block/created-at 1663680232157,
+ :block/updated-at 1665269794723}
+ {:block/name "sql dml: select",
+ :block/created-at 1664284172095,
+ :block/updated-at 1665269774258}
+ {:block/name "sql select: working with strings & subqueries",
+ :block/created-at 1664284172064,
+ :block/updated-at 1666169126193}
+ {:block/name "st2001 - statistics in data science i",
+ :block/created-at 1662760697673,
+ :block/updated-at 1664445709714}
+ {:block/name "st2001 labs",
+ :block/created-at 1663587251924,
+ :block/updated-at 1663587333173}
+ {:block/name "stars & bars",
+ :block/created-at 1664977220358,
+ :block/updated-at 1665576126854}
+ {:block/name "system software & operating systems",
+ :block/created-at 1663453161468,
+ :block/updated-at 1666784902239}
+ {:block/name "template",
+ :block/created-at 1665268399216,
+ :block/updated-at 1665268399216}
+ {:block/name "templates",
+ :block/created-at 1665268290093,
+ :block/updated-at 1665268429238}
+ {:block/name "the normal distribution",
+ :block/created-at 1665655379797,
+ :block/updated-at 1668068172029}
+ {:block/name "the relational model",
+ :block/created-at 1663056902320,
+ :block/updated-at 1665305483011}
+ {:block/name "todo",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name
+ "twilight of the idols (how to philosophise with the hammer)",
+ :block/created-at 1663877741591,
+ :block/updated-at 1663878217528}
+ {:block/name "using r as a calculator",
+ :block/created-at 1662885317609,
+ :block/updated-at 1667997842680}
+ {:block/name "variables & types",
+ :block/created-at 1663833671558,
+ :block/updated-at 1665401889542}
+ {:block/name "wait",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "waiting",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412633}
+ {:block/name "日本語",
+ :block/created-at 1662818014594,
+ :block/updated-at 1662818014594}
+ {:block/name "日本語かんたん",
+ :block/created-at 1664037986968,
+ :block/updated-at 1664037986968}
+ {:block/name "日本語チャレンジ",
+ :block/created-at 1664445429911,
+ :block/updated-at 1664445429911}
+ {:block/name "本",
+ :block/created-at 1663877674293,
+ :block/updated-at 1663877674293}
+ {:block/name "絵からできた漢字1",
+ :block/created-at 1664445430033,
+ :block/updated-at 1665076855455}]
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T16_08_08.201Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T16_08_08.201Z.Desktop.edn
new file mode 100644
index 00000000..4251689a
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T16_08_08.201Z.Desktop.edn
@@ -0,0 +1,378 @@
+[{:block/name "2022年10月20日",
+ :block/created-at 1666252964929,
+ :block/updated-at 1666260437195}
+ {:block/name "2022年11月10日",
+ :block/created-at 1668066699767,
+ :block/updated-at 1668077670179}
+ {:block/name ": https:",
+ :block/created-at 1667901092192,
+ :block/updated-at 1667901092192}
+ {:block/name ": https://dbis-uibk.github.io",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local/uibk",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name
+ ": https://dbis-uibk.github.io/relax/calc/local/uibk/local",
+ :block/created-at 1667901092195,
+ :block/updated-at 1667901092195}
+ {:block/name
+ ": https://dbis-uibk.github.io/relax/calc/local/uibk/local/0",
+ :block/created-at 1667901092191,
+ :block/updated-at 1667901092191}
+ {:block/name "a",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "abstraction & polymorphism",
+ :block/created-at 1666256757802,
+ :block/updated-at 1666857873332}
+ {:block/name "advanced pie, derangements, & counting functions",
+ :block/created-at 1665576126852,
+ :block/updated-at 1666784394067}
+ {:block/name "aggregate clauses, group by, & having clauses",
+ :block/created-at 1664362619357,
+ :block/updated-at 1665401573078}
+ {:block/name "agile methods - extreme programming",
+ :block/created-at 1664439358122,
+ :block/updated-at 1666267099375}
+ {:block/name "b",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "bidirectional",
+ :block/created-at 1667899472428,
+ :block/updated-at 1667899472428}
+ {:block/name "binomial coefficients",
+ :block/created-at 1663699875848,
+ :block/updated-at 1665269689188}
+ {:block/name "bootstrap css",
+ :block/created-at 1666267099374,
+ :block/updated-at 1668007630745}
+ {:block/name "c",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "canceled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "cancelled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card7",
+ :block/created-at 1665403674807,
+ :block/updated-at 1665403674807}
+ {:block/name "cloud computing",
+ :block/created-at 1662846706068,
+ :block/updated-at 1665049290982}
+ {:block/name "coding up inheritance",
+ :block/created-at 1665648103834,
+ :block/updated-at 1666253134753}
+ {:block/name "colouring graphs; eulerian & hamiltonian graphs",
+ :block/created-at 1667999555780,
+ :block/updated-at 1668001880951}
+ {:block/name "combinatorial proofs",
+ :block/created-at 1664365559513,
+ :block/updated-at 1665139028342}
+ {:block/name "contents",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "convex polyhedra",
+ :block/created-at 1667912443470,
+ :block/updated-at 1667999555782}
+ {:block/name "counting",
+ :block/created-at 1662844737516,
+ :block/updated-at 1665137815453}
+ {:block/name "cpu management - scheduling",
+ :block/created-at 1664802250958,
+ :block/updated-at 1667997827949}
+ {:block/name "ct2106 - object-oriented programming",
+ :block/created-at 1662812504035,
+ :block/updated-at 1662812504035}
+ {:block/name "ct213 - computer systems & organisation",
+ :block/created-at 1662812363300,
+ :block/updated-at 1662828172731}
+ {:block/name "ct216 - software engineering i",
+ :block/created-at 1662812477523,
+ :block/updated-at 1662846690423}
+ {:block/name "ct230 - database systems i",
+ :block/created-at 1662812383585,
+ :block/updated-at 1662846569759}
+ {:block/name "ct255 - next generation technologies ii",
+ :block/created-at 1662755524966,
+ :block/updated-at 1662843069874}
+ {:block/name "database system introduction",
+ :block/created-at 1662845439484,
+ :block/updated-at 1665139118861}
+ {:block/name "definitions & planar graphs",
+ :block/created-at 1666785671806,
+ :block/updated-at 1667912443471}
+ {:block/name "describing data in r",
+ :block/created-at 1663587324380,
+ :block/updated-at 1665269306101}
+ {:block/name "diffie-hellman key exchange",
+ :block/created-at 1667829411273,
+ :block/updated-at 1667997679213}
+ {:block/name "discrete probability distributions: binomial & poisson",
+ :block/created-at 1665414098028,
+ :block/updated-at 1668067669851}
+ {:block/name "doing",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "done",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "draws/2022-10-19-13-24-31.excalidraw",
+ :block/created-at 1666182420922,
+ :block/updated-at 1666182420922}
+ {:block/name "draws/2022-10-28-10-59-13.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-10-59-33.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-11-04-05.excalidraw",
+ :block/created-at 1666951586882,
+ :block/updated-at 1666951586882}
+ {:block/name "draws/2022-10-28-11-22-12.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-25-20.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-38-31.excalidraw",
+ :block/created-at 1666953986830,
+ :block/updated-at 1666953986830}
+ {:block/name "entity relationship models",
+ :block/created-at 1664888080307,
+ :block/updated-at 1666785065248}
+ {:block/name "exploratory data analysis",
+ :block/created-at 1662760881692,
+ :block/updated-at 1665402231847}
+ {:block/name "extra-curriculars",
+ :block/created-at 1662817977281,
+ :block/updated-at 1662818031268}
+ {:block/name "favorites",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "file",
+ :block/created-at 1663501516528,
+ :block/updated-at 1663501516528}
+ {:block/name "file-path",
+ :block/created-at 1663501516532,
+ :block/updated-at 1663501516532}
+ {:block/name "firebase functions",
+ :block/created-at 1668085135352,
+ :block/updated-at 1668090936758}
+ {:block/name "first java code",
+ :block/created-at 1663059929750,
+ :block/updated-at 1665402183209}
+ {:block/name "friedrich nietzsche",
+ :block/created-at 1663877719000,
+ :block/updated-at 1663877723364}
+ {:block/name "gdpr",
+ :block/created-at 1662755846087,
+ :block/updated-at 1666784905393}
+ {:block/name "hash cracking using rainbow tables",
+ :block/created-at 1666007838619,
+ :block/updated-at 1666615755027}
+ {:block/name "hls__2bct-1_1662890969894_0",
+ :block/created-at 1662891145360,
+ :block/updated-at 1662891145360}
+ {:block/name "human security & passwords",
+ :block/created-at 1664798283314,
+ :block/updated-at 1666785040082}
+ {:block/name "hypothesis testing",
+ :block/created-at 1667837632146,
+ :block/updated-at 1667997712703}
+ {:block/name "in-progress",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "interfaces",
+ :block/created-at 1666857873329,
+ :block/updated-at 1667997871737}
+ {:block/name "introduction to agile methods",
+ :block/created-at 1663848388175,
+ :block/updated-at 1665401551626}
+ {:block/name "introduction to cryptography",
+ :block/created-at 1663488291074,
+ :block/updated-at 1666168991848}
+ {:block/name "introduction to cybersecurity",
+ :block/created-at 1662755701938,
+ :block/updated-at 1664807302595}
+ {:block/name "introduction to graph theory",
+ :block/created-at 1666180750693,
+ :block/updated-at 1666785671809}
+ {:block/name "introduction to inheritance",
+ :block/created-at 1665047054902,
+ :block/updated-at 1665648103836}
+ {:block/name "introduction to java",
+ :block/created-at 1662850740877,
+ :block/updated-at 1664630972286}
+ {:block/name "introduction to nodejs",
+ :block/created-at 1668066700245,
+ :block/updated-at 1668085135354}
+ {:block/name "introduction to object-oriented programming",
+ :block/created-at 1662850183398,
+ :block/updated-at 1667997875101}
+ {:block/name "introduction to sql & ddl",
+ :block/created-at 1663153069230,
+ :block/updated-at 1665402192682}
+ {:block/name "irish sign language",
+ :block/created-at 1662818031268,
+ :block/updated-at 1662818031268}
+ {:block/name "javascript functions & events",
+ :block/created-at 1668066700237,
+ :block/updated-at 1668066700237}
+ {:block/name "joins & union queries",
+ :block/created-at 1665572518087,
+ :block/updated-at 1666176972120}
+ {:block/name "later",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "ma284 - discrete mathematics",
+ :block/created-at 1662812426466,
+ :block/updated-at 1662812426466}
+ {:block/name "ma284: homework",
+ :block/created-at 1663235842961,
+ :block/updated-at 1663241964273}
+ {:block/name "memory management",
+ :block/created-at 1666616373198,
+ :block/updated-at 1667835960860}
+ {:block/name "more java code",
+ :block/created-at 1663063793212,
+ :block/updated-at 1665138691304}
+ {:block/name "normalisation",
+ :block/created-at 1666176972119,
+ :block/updated-at 1667899093310}
+ {:block/name "notes",
+ :block/created-at 1662755380739,
+ :block/updated-at 1662755380739}
+ {:block/name "now",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "oop modelling",
+ :block/created-at 1663835834720,
+ :block/updated-at 1665269607467}
+ {:block/name "overview of computer systems",
+ :block/created-at 1662828172731,
+ :block/updated-at 1665402158751}
+ {:block/name "principle of inclusion-exclusion",
+ :block/created-at 1663097242134,
+ :block/updated-at 1665139547406}
+ {:block/name "probability",
+ :block/created-at 1664207767962,
+ :block/updated-at 1666100135523}
+ {:block/name "process management",
+ :block/created-at 1664207768394,
+ :block/updated-at 1666785058913}
+ {:block/name "process synchronisation",
+ :block/created-at 1665410544532,
+ :block/updated-at 1668077904820}
+ {:block/name "programming models",
+ :block/created-at 1662842663185,
+ :block/updated-at 1667997878539}
+ {:block/name "query processing & optimisation",
+ :block/created-at 1667916510155,
+ :block/updated-at 1668077734146}
+ {:block/name "query processing: relational algebra",
+ :block/created-at 1667899093310,
+ :block/updated-at 1668077746581}
+ {:block/name "random variables",
+ :block/created-at 1665050117811,
+ :block/updated-at 1666784919123}
+ {:block/name "sampling",
+ :block/created-at 1663604282449,
+ :block/updated-at 1665401847721}
+ {:block/name "sampling distributions & confidence intervals",
+ :block/created-at 1666624196792,
+ :block/updated-at 1668069396138}
+ {:block/name "scrum roles & ceremonies",
+ :block/created-at 1663849690600,
+ :block/updated-at 1665401531298}
+ {:block/name "second year university",
+ :block/created-at 1662812271350,
+ :block/updated-at 1662890970415}
+ {:block/name "social engineering",
+ :block/created-at 1665403220751,
+ :block/updated-at 1667826227683}
+ {:block/name "software processes",
+ :block/created-at 1663178663476,
+ :block/updated-at 1665401726538}
+ {:block/name "sql dml statement",
+ :block/created-at 1663680232157,
+ :block/updated-at 1665269794723}
+ {:block/name "sql dml: select",
+ :block/created-at 1664284172095,
+ :block/updated-at 1665269774258}
+ {:block/name "sql select: working with strings & subqueries",
+ :block/created-at 1664284172064,
+ :block/updated-at 1666169126193}
+ {:block/name "st2001 - statistics in data science i",
+ :block/created-at 1662760697673,
+ :block/updated-at 1664445709714}
+ {:block/name "st2001 labs",
+ :block/created-at 1663587251924,
+ :block/updated-at 1663587333173}
+ {:block/name "stars & bars",
+ :block/created-at 1664977220358,
+ :block/updated-at 1665576126854}
+ {:block/name "system software & operating systems",
+ :block/created-at 1663453161468,
+ :block/updated-at 1666784902239}
+ {:block/name "template",
+ :block/created-at 1665268399216,
+ :block/updated-at 1665268399216}
+ {:block/name "templates",
+ :block/created-at 1665268290093,
+ :block/updated-at 1665268429238}
+ {:block/name "the normal distribution",
+ :block/created-at 1665655379797,
+ :block/updated-at 1668068172029}
+ {:block/name "the relational model",
+ :block/created-at 1663056902320,
+ :block/updated-at 1665305483011}
+ {:block/name "todo",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name
+ "twilight of the idols (how to philosophise with the hammer)",
+ :block/created-at 1663877741591,
+ :block/updated-at 1663878217528}
+ {:block/name "using r as a calculator",
+ :block/created-at 1662885317609,
+ :block/updated-at 1667997842680}
+ {:block/name "variables & types",
+ :block/created-at 1663833671558,
+ :block/updated-at 1665401889542}
+ {:block/name "wait",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "waiting",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412633}
+ {:block/name "日本語",
+ :block/created-at 1662818014594,
+ :block/updated-at 1662818014594}
+ {:block/name "日本語かんたん",
+ :block/created-at 1664037986968,
+ :block/updated-at 1664037986968}
+ {:block/name "日本語チャレンジ",
+ :block/created-at 1664445429911,
+ :block/updated-at 1664445429911}
+ {:block/name "本",
+ :block/created-at 1663877674293,
+ :block/updated-at 1663877674293}
+ {:block/name "絵からできた漢字1",
+ :block/created-at 1664445430033,
+ :block/updated-at 1665076855455}]
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T19_33_41.955Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T19_33_41.955Z.Desktop.edn
new file mode 100644
index 00000000..4d99eee8
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-10T19_33_41.955Z.Desktop.edn
@@ -0,0 +1,378 @@
+[{:block/name "2022年10月20日",
+ :block/created-at 1666252964929,
+ :block/updated-at 1666260437195}
+ {:block/name "2022年11月10日",
+ :block/created-at 1668066699767,
+ :block/updated-at 1668096381810}
+ {:block/name ": https:",
+ :block/created-at 1667901092192,
+ :block/updated-at 1667901092192}
+ {:block/name ": https://dbis-uibk.github.io",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local/uibk",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name
+ ": https://dbis-uibk.github.io/relax/calc/local/uibk/local",
+ :block/created-at 1667901092195,
+ :block/updated-at 1667901092195}
+ {:block/name
+ ": https://dbis-uibk.github.io/relax/calc/local/uibk/local/0",
+ :block/created-at 1667901092191,
+ :block/updated-at 1667901092191}
+ {:block/name "a",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "abstraction & polymorphism",
+ :block/created-at 1666256757802,
+ :block/updated-at 1666857873332}
+ {:block/name "advanced pie, derangements, & counting functions",
+ :block/created-at 1665576126852,
+ :block/updated-at 1666784394067}
+ {:block/name "aggregate clauses, group by, & having clauses",
+ :block/created-at 1664362619357,
+ :block/updated-at 1665401573078}
+ {:block/name "agile methods - extreme programming",
+ :block/created-at 1664439358122,
+ :block/updated-at 1666267099375}
+ {:block/name "b",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "bidirectional",
+ :block/created-at 1667899472428,
+ :block/updated-at 1667899472428}
+ {:block/name "binomial coefficients",
+ :block/created-at 1663699875848,
+ :block/updated-at 1665269689188}
+ {:block/name "bootstrap css",
+ :block/created-at 1666267099374,
+ :block/updated-at 1668007630745}
+ {:block/name "c",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "canceled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "cancelled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card7",
+ :block/created-at 1665403674807,
+ :block/updated-at 1665403674807}
+ {:block/name "cloud computing",
+ :block/created-at 1662846706068,
+ :block/updated-at 1665049290982}
+ {:block/name "coding up inheritance",
+ :block/created-at 1665648103834,
+ :block/updated-at 1666253134753}
+ {:block/name "colouring graphs; eulerian & hamiltonian graphs",
+ :block/created-at 1667999555780,
+ :block/updated-at 1668001880951}
+ {:block/name "combinatorial proofs",
+ :block/created-at 1664365559513,
+ :block/updated-at 1665139028342}
+ {:block/name "contents",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "convex polyhedra",
+ :block/created-at 1667912443470,
+ :block/updated-at 1667999555782}
+ {:block/name "counting",
+ :block/created-at 1662844737516,
+ :block/updated-at 1665137815453}
+ {:block/name "cpu management - scheduling",
+ :block/created-at 1664802250958,
+ :block/updated-at 1667997827949}
+ {:block/name "ct2106 - object-oriented programming",
+ :block/created-at 1662812504035,
+ :block/updated-at 1662812504035}
+ {:block/name "ct213 - computer systems & organisation",
+ :block/created-at 1662812363300,
+ :block/updated-at 1662828172731}
+ {:block/name "ct216 - software engineering i",
+ :block/created-at 1662812477523,
+ :block/updated-at 1662846690423}
+ {:block/name "ct230 - database systems i",
+ :block/created-at 1662812383585,
+ :block/updated-at 1662846569759}
+ {:block/name "ct255 - next generation technologies ii",
+ :block/created-at 1662755524966,
+ :block/updated-at 1662843069874}
+ {:block/name "database system introduction",
+ :block/created-at 1662845439484,
+ :block/updated-at 1665139118861}
+ {:block/name "definitions & planar graphs",
+ :block/created-at 1666785671806,
+ :block/updated-at 1667912443471}
+ {:block/name "describing data in r",
+ :block/created-at 1663587324380,
+ :block/updated-at 1665269306101}
+ {:block/name "diffie-hellman key exchange",
+ :block/created-at 1667829411273,
+ :block/updated-at 1667997679213}
+ {:block/name "discrete probability distributions: binomial & poisson",
+ :block/created-at 1665414098028,
+ :block/updated-at 1668067669851}
+ {:block/name "doing",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "done",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "draws/2022-10-19-13-24-31.excalidraw",
+ :block/created-at 1666182420922,
+ :block/updated-at 1666182420922}
+ {:block/name "draws/2022-10-28-10-59-13.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-10-59-33.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-11-04-05.excalidraw",
+ :block/created-at 1666951586882,
+ :block/updated-at 1666951586882}
+ {:block/name "draws/2022-10-28-11-22-12.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-25-20.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-38-31.excalidraw",
+ :block/created-at 1666953986830,
+ :block/updated-at 1666953986830}
+ {:block/name "entity relationship models",
+ :block/created-at 1664888080307,
+ :block/updated-at 1666785065248}
+ {:block/name "exploratory data analysis",
+ :block/created-at 1662760881692,
+ :block/updated-at 1665402231847}
+ {:block/name "extra-curriculars",
+ :block/created-at 1662817977281,
+ :block/updated-at 1662818031268}
+ {:block/name "favorites",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "file",
+ :block/created-at 1663501516528,
+ :block/updated-at 1663501516528}
+ {:block/name "file-path",
+ :block/created-at 1663501516532,
+ :block/updated-at 1663501516532}
+ {:block/name "firebase functions",
+ :block/created-at 1668095889782,
+ :block/updated-at 1668095889782}
+ {:block/name "first java code",
+ :block/created-at 1663059929750,
+ :block/updated-at 1665402183209}
+ {:block/name "friedrich nietzsche",
+ :block/created-at 1663877719000,
+ :block/updated-at 1663877723364}
+ {:block/name "gdpr",
+ :block/created-at 1662755846087,
+ :block/updated-at 1666784905393}
+ {:block/name "hash cracking using rainbow tables",
+ :block/created-at 1666007838619,
+ :block/updated-at 1666615755027}
+ {:block/name "hls__2bct-1_1662890969894_0",
+ :block/created-at 1662891145360,
+ :block/updated-at 1662891145360}
+ {:block/name "human security & passwords",
+ :block/created-at 1664798283314,
+ :block/updated-at 1666785040082}
+ {:block/name "hypothesis testing",
+ :block/created-at 1667837632146,
+ :block/updated-at 1667997712703}
+ {:block/name "in-progress",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "interfaces",
+ :block/created-at 1666857873329,
+ :block/updated-at 1667997871737}
+ {:block/name "introduction to agile methods",
+ :block/created-at 1663848388175,
+ :block/updated-at 1665401551626}
+ {:block/name "introduction to cryptography",
+ :block/created-at 1663488291074,
+ :block/updated-at 1666168991848}
+ {:block/name "introduction to cybersecurity",
+ :block/created-at 1662755701938,
+ :block/updated-at 1664807302595}
+ {:block/name "introduction to graph theory",
+ :block/created-at 1666180750693,
+ :block/updated-at 1666785671809}
+ {:block/name "introduction to inheritance",
+ :block/created-at 1665047054902,
+ :block/updated-at 1665648103836}
+ {:block/name "introduction to java",
+ :block/created-at 1662850740877,
+ :block/updated-at 1664630972286}
+ {:block/name "introduction to nodejs",
+ :block/created-at 1668066700245,
+ :block/updated-at 1668085135354}
+ {:block/name "introduction to object-oriented programming",
+ :block/created-at 1662850183398,
+ :block/updated-at 1667997875101}
+ {:block/name "introduction to sql & ddl",
+ :block/created-at 1663153069230,
+ :block/updated-at 1665402192682}
+ {:block/name "irish sign language",
+ :block/created-at 1662818031268,
+ :block/updated-at 1662818031268}
+ {:block/name "javascript functions & events",
+ :block/created-at 1668066700237,
+ :block/updated-at 1668066700237}
+ {:block/name "joins & union queries",
+ :block/created-at 1665572518087,
+ :block/updated-at 1666176972120}
+ {:block/name "later",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "ma284 - discrete mathematics",
+ :block/created-at 1662812426466,
+ :block/updated-at 1662812426466}
+ {:block/name "ma284: homework",
+ :block/created-at 1663235842961,
+ :block/updated-at 1663241964273}
+ {:block/name "memory management",
+ :block/created-at 1666616373198,
+ :block/updated-at 1667835960860}
+ {:block/name "more java code",
+ :block/created-at 1663063793212,
+ :block/updated-at 1665138691304}
+ {:block/name "normalisation",
+ :block/created-at 1666176972119,
+ :block/updated-at 1667899093310}
+ {:block/name "notes",
+ :block/created-at 1662755380739,
+ :block/updated-at 1662755380739}
+ {:block/name "now",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "oop modelling",
+ :block/created-at 1663835834720,
+ :block/updated-at 1665269607467}
+ {:block/name "overview of computer systems",
+ :block/created-at 1662828172731,
+ :block/updated-at 1665402158751}
+ {:block/name "principle of inclusion-exclusion",
+ :block/created-at 1663097242134,
+ :block/updated-at 1665139547406}
+ {:block/name "probability",
+ :block/created-at 1664207767962,
+ :block/updated-at 1666100135523}
+ {:block/name "process management",
+ :block/created-at 1664207768394,
+ :block/updated-at 1666785058913}
+ {:block/name "process synchronisation",
+ :block/created-at 1665410544532,
+ :block/updated-at 1668077904820}
+ {:block/name "programming models",
+ :block/created-at 1662842663185,
+ :block/updated-at 1667997878539}
+ {:block/name "query processing & optimisation",
+ :block/created-at 1667916510155,
+ :block/updated-at 1668077734146}
+ {:block/name "query processing: relational algebra",
+ :block/created-at 1667899093310,
+ :block/updated-at 1668077746581}
+ {:block/name "random variables",
+ :block/created-at 1665050117811,
+ :block/updated-at 1666784919123}
+ {:block/name "sampling",
+ :block/created-at 1663604282449,
+ :block/updated-at 1665401847721}
+ {:block/name "sampling distributions & confidence intervals",
+ :block/created-at 1666624196792,
+ :block/updated-at 1668069396138}
+ {:block/name "scrum roles & ceremonies",
+ :block/created-at 1663849690600,
+ :block/updated-at 1665401531298}
+ {:block/name "second year university",
+ :block/created-at 1662812271350,
+ :block/updated-at 1662890970415}
+ {:block/name "social engineering",
+ :block/created-at 1665403220751,
+ :block/updated-at 1667826227683}
+ {:block/name "software processes",
+ :block/created-at 1663178663476,
+ :block/updated-at 1665401726538}
+ {:block/name "sql dml statement",
+ :block/created-at 1663680232157,
+ :block/updated-at 1665269794723}
+ {:block/name "sql dml: select",
+ :block/created-at 1664284172095,
+ :block/updated-at 1665269774258}
+ {:block/name "sql select: working with strings & subqueries",
+ :block/created-at 1664284172064,
+ :block/updated-at 1666169126193}
+ {:block/name "st2001 - statistics in data science i",
+ :block/created-at 1662760697673,
+ :block/updated-at 1664445709714}
+ {:block/name "st2001 labs",
+ :block/created-at 1663587251924,
+ :block/updated-at 1663587333173}
+ {:block/name "stars & bars",
+ :block/created-at 1664977220358,
+ :block/updated-at 1665576126854}
+ {:block/name "system software & operating systems",
+ :block/created-at 1663453161468,
+ :block/updated-at 1666784902239}
+ {:block/name "template",
+ :block/created-at 1665268399216,
+ :block/updated-at 1665268399216}
+ {:block/name "templates",
+ :block/created-at 1665268290093,
+ :block/updated-at 1665268429238}
+ {:block/name "the normal distribution",
+ :block/created-at 1665655379797,
+ :block/updated-at 1668068172029}
+ {:block/name "the relational model",
+ :block/created-at 1663056902320,
+ :block/updated-at 1665305483011}
+ {:block/name "todo",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name
+ "twilight of the idols (how to philosophise with the hammer)",
+ :block/created-at 1663877741591,
+ :block/updated-at 1663878217528}
+ {:block/name "using r as a calculator",
+ :block/created-at 1662885317609,
+ :block/updated-at 1667997842680}
+ {:block/name "variables & types",
+ :block/created-at 1663833671558,
+ :block/updated-at 1665401889542}
+ {:block/name "wait",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "waiting",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412633}
+ {:block/name "日本語",
+ :block/created-at 1662818014594,
+ :block/updated-at 1662818014594}
+ {:block/name "日本語かんたん",
+ :block/created-at 1664037986968,
+ :block/updated-at 1664037986968}
+ {:block/name "日本語チャレンジ",
+ :block/created-at 1664445429911,
+ :block/updated-at 1664445429911}
+ {:block/name "本",
+ :block/created-at 1663877674293,
+ :block/updated-at 1663877674293}
+ {:block/name "絵からできた漢字1",
+ :block/created-at 1664445430033,
+ :block/updated-at 1665076855455}]
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-11T11_24_42.214Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-11T11_24_42.214Z.Desktop.edn
new file mode 100644
index 00000000..7b1b80a1
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-11T11_24_42.214Z.Desktop.edn
@@ -0,0 +1,378 @@
+[{:block/name "2022年10月20日",
+ :block/created-at 1666252964929,
+ :block/updated-at 1666260437195}
+ {:block/name "2022年11月11日",
+ :block/created-at 1668152523918,
+ :block/updated-at 1668162605985}
+ {:block/name ": https:",
+ :block/created-at 1667901092192,
+ :block/updated-at 1667901092192}
+ {:block/name ": https://dbis-uibk.github.io",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc",
+ :block/created-at 1667901092193,
+ :block/updated-at 1667901092193}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name ": https://dbis-uibk.github.io/relax/calc/local/uibk",
+ :block/created-at 1667901092194,
+ :block/updated-at 1667901092194}
+ {:block/name
+ ": https://dbis-uibk.github.io/relax/calc/local/uibk/local",
+ :block/created-at 1667901092195,
+ :block/updated-at 1667901092195}
+ {:block/name
+ ": https://dbis-uibk.github.io/relax/calc/local/uibk/local/0",
+ :block/created-at 1667901092191,
+ :block/updated-at 1667901092191}
+ {:block/name "a",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "abstraction & polymorphism",
+ :block/created-at 1666256757802,
+ :block/updated-at 1666857873332}
+ {:block/name "advanced pie, derangements, & counting functions",
+ :block/created-at 1665576126852,
+ :block/updated-at 1666784394067}
+ {:block/name "aggregate clauses, group by, & having clauses",
+ :block/created-at 1664362619357,
+ :block/updated-at 1665401573078}
+ {:block/name "agile methods - extreme programming",
+ :block/created-at 1664439358122,
+ :block/updated-at 1666267099375}
+ {:block/name "b",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "bidirectional",
+ :block/created-at 1667899472428,
+ :block/updated-at 1667899472428}
+ {:block/name "binomial coefficients",
+ :block/created-at 1663699875848,
+ :block/updated-at 1665269689188}
+ {:block/name "bootstrap css",
+ :block/created-at 1666267099374,
+ :block/updated-at 1668007630745}
+ {:block/name "c",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "canceled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "cancelled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card7",
+ :block/created-at 1665403674807,
+ :block/updated-at 1665403674807}
+ {:block/name "cloud computing",
+ :block/created-at 1662846706068,
+ :block/updated-at 1665049290982}
+ {:block/name "coding up inheritance",
+ :block/created-at 1665648103834,
+ :block/updated-at 1666253134753}
+ {:block/name "colouring graphs; eulerian & hamiltonian graphs",
+ :block/created-at 1667999555780,
+ :block/updated-at 1668001880951}
+ {:block/name "combinatorial proofs",
+ :block/created-at 1664365559513,
+ :block/updated-at 1665139028342}
+ {:block/name "contents",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "convex polyhedra",
+ :block/created-at 1667912443470,
+ :block/updated-at 1667999555782}
+ {:block/name "counting",
+ :block/created-at 1662844737516,
+ :block/updated-at 1665137815453}
+ {:block/name "cpu management - scheduling",
+ :block/created-at 1664802250958,
+ :block/updated-at 1667997827949}
+ {:block/name "ct2106 - object-oriented programming",
+ :block/created-at 1662812504035,
+ :block/updated-at 1662812504035}
+ {:block/name "ct213 - computer systems & organisation",
+ :block/created-at 1662812363300,
+ :block/updated-at 1662828172731}
+ {:block/name "ct216 - software engineering i",
+ :block/created-at 1662812477523,
+ :block/updated-at 1662846690423}
+ {:block/name "ct230 - database systems i",
+ :block/created-at 1662812383585,
+ :block/updated-at 1662846569759}
+ {:block/name "ct255 - next generation technologies ii",
+ :block/created-at 1662755524966,
+ :block/updated-at 1662843069874}
+ {:block/name "database system introduction",
+ :block/created-at 1662845439484,
+ :block/updated-at 1665139118861}
+ {:block/name "definitions & planar graphs",
+ :block/created-at 1666785671806,
+ :block/updated-at 1667912443471}
+ {:block/name "describing data in r",
+ :block/created-at 1663587324380,
+ :block/updated-at 1665269306101}
+ {:block/name "diffie-hellman key exchange",
+ :block/created-at 1667829411273,
+ :block/updated-at 1667997679213}
+ {:block/name "discrete probability distributions: binomial & poisson",
+ :block/created-at 1665414098028,
+ :block/updated-at 1668067669851}
+ {:block/name "doing",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "done",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "draws/2022-10-19-13-24-31.excalidraw",
+ :block/created-at 1666182420922,
+ :block/updated-at 1666182420922}
+ {:block/name "draws/2022-10-28-10-59-13.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-10-59-33.excalidraw",
+ :block/created-at 1666951586883,
+ :block/updated-at 1666951586883}
+ {:block/name "draws/2022-10-28-11-04-05.excalidraw",
+ :block/created-at 1666951586882,
+ :block/updated-at 1666951586882}
+ {:block/name "draws/2022-10-28-11-22-12.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-25-20.excalidraw",
+ :block/created-at 1666952786830,
+ :block/updated-at 1666952786830}
+ {:block/name "draws/2022-10-28-11-38-31.excalidraw",
+ :block/created-at 1666953986830,
+ :block/updated-at 1666953986830}
+ {:block/name "entity relationship models",
+ :block/created-at 1664888080307,
+ :block/updated-at 1666785065248}
+ {:block/name "exploratory data analysis",
+ :block/created-at 1662760881692,
+ :block/updated-at 1665402231847}
+ {:block/name "extra-curriculars",
+ :block/created-at 1662817977281,
+ :block/updated-at 1662818031268}
+ {:block/name "favorites",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "file",
+ :block/created-at 1663501516528,
+ :block/updated-at 1663501516528}
+ {:block/name "file-path",
+ :block/created-at 1663501516532,
+ :block/updated-at 1663501516532}
+ {:block/name "firebase functions",
+ :block/created-at 1668108223936,
+ :block/updated-at 1668152888697}
+ {:block/name "first java code",
+ :block/created-at 1663059929750,
+ :block/updated-at 1665402183209}
+ {:block/name "friedrich nietzsche",
+ :block/created-at 1663877719000,
+ :block/updated-at 1663877723364}
+ {:block/name "gdpr",
+ :block/created-at 1662755846087,
+ :block/updated-at 1666784905393}
+ {:block/name "hash cracking using rainbow tables",
+ :block/created-at 1666007838619,
+ :block/updated-at 1666615755027}
+ {:block/name "hls__2bct-1_1662890969894_0",
+ :block/created-at 1662891145360,
+ :block/updated-at 1662891145360}
+ {:block/name "human security & passwords",
+ :block/created-at 1664798283314,
+ :block/updated-at 1666785040082}
+ {:block/name "hypothesis testing",
+ :block/created-at 1667837632146,
+ :block/updated-at 1668155180196}
+ {:block/name "in-progress",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "interfaces",
+ :block/created-at 1666857873329,
+ :block/updated-at 1667997871737}
+ {:block/name "introduction to agile methods",
+ :block/created-at 1663848388175,
+ :block/updated-at 1665401551626}
+ {:block/name "introduction to cryptography",
+ :block/created-at 1663488291074,
+ :block/updated-at 1666168991848}
+ {:block/name "introduction to cybersecurity",
+ :block/created-at 1662755701938,
+ :block/updated-at 1664807302595}
+ {:block/name "introduction to graph theory",
+ :block/created-at 1666180750693,
+ :block/updated-at 1666785671809}
+ {:block/name "introduction to inheritance",
+ :block/created-at 1665047054902,
+ :block/updated-at 1665648103836}
+ {:block/name "introduction to java",
+ :block/created-at 1662850740877,
+ :block/updated-at 1664630972286}
+ {:block/name "introduction to nodejs",
+ :block/created-at 1668066700245,
+ :block/updated-at 1668085135354}
+ {:block/name "introduction to object-oriented programming",
+ :block/created-at 1662850183398,
+ :block/updated-at 1667997875101}
+ {:block/name "introduction to sql & ddl",
+ :block/created-at 1663153069230,
+ :block/updated-at 1665402192682}
+ {:block/name "irish sign language",
+ :block/created-at 1662818031268,
+ :block/updated-at 1662818031268}
+ {:block/name "javascript functions & events",
+ :block/created-at 1668066700237,
+ :block/updated-at 1668066700237}
+ {:block/name "joins & union queries",
+ :block/created-at 1665572518087,
+ :block/updated-at 1666176972120}
+ {:block/name "later",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "ma284 - discrete mathematics",
+ :block/created-at 1662812426466,
+ :block/updated-at 1662812426466}
+ {:block/name "ma284: homework",
+ :block/created-at 1663235842961,
+ :block/updated-at 1663241964273}
+ {:block/name "memory management",
+ :block/created-at 1666616373198,
+ :block/updated-at 1667835960860}
+ {:block/name "more java code",
+ :block/created-at 1663063793212,
+ :block/updated-at 1665138691304}
+ {:block/name "normalisation",
+ :block/created-at 1666176972119,
+ :block/updated-at 1667899093310}
+ {:block/name "notes",
+ :block/created-at 1662755380739,
+ :block/updated-at 1662755380739}
+ {:block/name "now",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "oop modelling",
+ :block/created-at 1663835834720,
+ :block/updated-at 1665269607467}
+ {:block/name "overview of computer systems",
+ :block/created-at 1662828172731,
+ :block/updated-at 1665402158751}
+ {:block/name "principle of inclusion-exclusion",
+ :block/created-at 1663097242134,
+ :block/updated-at 1665139547406}
+ {:block/name "probability",
+ :block/created-at 1664207767962,
+ :block/updated-at 1666100135523}
+ {:block/name "process management",
+ :block/created-at 1664207768394,
+ :block/updated-at 1666785058913}
+ {:block/name "process synchronisation",
+ :block/created-at 1665410544532,
+ :block/updated-at 1668077904820}
+ {:block/name "programming models",
+ :block/created-at 1662842663185,
+ :block/updated-at 1667997878539}
+ {:block/name "query processing & optimisation",
+ :block/created-at 1667916510155,
+ :block/updated-at 1668077734146}
+ {:block/name "query processing: relational algebra",
+ :block/created-at 1667899093310,
+ :block/updated-at 1668077746581}
+ {:block/name "random variables",
+ :block/created-at 1665050117811,
+ :block/updated-at 1666784919123}
+ {:block/name "sampling",
+ :block/created-at 1663604282449,
+ :block/updated-at 1665401847721}
+ {:block/name "sampling distributions & confidence intervals",
+ :block/created-at 1666624196792,
+ :block/updated-at 1668111801926}
+ {:block/name "scrum roles & ceremonies",
+ :block/created-at 1663849690600,
+ :block/updated-at 1665401531298}
+ {:block/name "second year university",
+ :block/created-at 1662812271350,
+ :block/updated-at 1662890970415}
+ {:block/name "social engineering",
+ :block/created-at 1665403220751,
+ :block/updated-at 1667826227683}
+ {:block/name "software processes",
+ :block/created-at 1663178663476,
+ :block/updated-at 1665401726538}
+ {:block/name "sql dml statement",
+ :block/created-at 1663680232157,
+ :block/updated-at 1665269794723}
+ {:block/name "sql dml: select",
+ :block/created-at 1664284172095,
+ :block/updated-at 1665269774258}
+ {:block/name "sql select: working with strings & subqueries",
+ :block/created-at 1664284172064,
+ :block/updated-at 1666169126193}
+ {:block/name "st2001 - statistics in data science i",
+ :block/created-at 1662760697673,
+ :block/updated-at 1664445709714}
+ {:block/name "st2001 labs",
+ :block/created-at 1663587251924,
+ :block/updated-at 1663587333173}
+ {:block/name "stars & bars",
+ :block/created-at 1664977220358,
+ :block/updated-at 1665576126854}
+ {:block/name "system software & operating systems",
+ :block/created-at 1663453161468,
+ :block/updated-at 1666784902239}
+ {:block/name "template",
+ :block/created-at 1665268399216,
+ :block/updated-at 1665268399216}
+ {:block/name "templates",
+ :block/created-at 1665268290093,
+ :block/updated-at 1665268429238}
+ {:block/name "the normal distribution",
+ :block/created-at 1665655379797,
+ :block/updated-at 1668068172029}
+ {:block/name "the relational model",
+ :block/created-at 1663056902320,
+ :block/updated-at 1665305483011}
+ {:block/name "todo",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name
+ "twilight of the idols (how to philosophise with the hammer)",
+ :block/created-at 1663877741591,
+ :block/updated-at 1663878217528}
+ {:block/name "using r as a calculator",
+ :block/created-at 1662885317609,
+ :block/updated-at 1667997842680}
+ {:block/name "variables & types",
+ :block/created-at 1663833671558,
+ :block/updated-at 1665401889542}
+ {:block/name "wait",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "waiting",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412633}
+ {:block/name "日本語",
+ :block/created-at 1662818014594,
+ :block/updated-at 1662818014594}
+ {:block/name "日本語かんたん",
+ :block/created-at 1664037986968,
+ :block/updated-at 1664037986968}
+ {:block/name "日本語チャレンジ",
+ :block/created-at 1664445429911,
+ :block/updated-at 1664445429911}
+ {:block/name "本",
+ :block/created-at 1663877674293,
+ :block/updated-at 1663877674293}
+ {:block/name "絵からできた漢字1",
+ :block/created-at 1664445430033,
+ :block/updated-at 1665076855455}]
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-16T12_12_09.168Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-16T12_12_09.168Z.Desktop.edn
new file mode 100644
index 00000000..ca1c62d3
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/pages-metadata/2022-11-16T12_12_09.168Z.Desktop.edn
@@ -0,0 +1,325 @@
+[{:block/name " ct230 - database systems i",
+ :block/created-at 1668532532902,
+ :block/updated-at 1668532532902}
+ {:block/name "2022年10月19日",
+ :block/created-at 1668532527742,
+ :block/updated-at 1668532527742}
+ {:block/name "2022年10月20日",
+ :block/created-at 1666252964929,
+ :block/updated-at 1666260437195}
+ {:block/name "2022年11月15日",
+ :block/created-at 1668503238442,
+ :block/updated-at 1668505422496}
+ {:block/name "a",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "abstraction & polymorphism",
+ :block/created-at 1666256757802,
+ :block/updated-at 1668456571876}
+ {:block/name "advanced pie, derangements, & counting functions",
+ :block/created-at 1665576126852,
+ :block/updated-at 1668457072250}
+ {:block/name "aggregate clauses, group by, & having clauses",
+ :block/created-at 1664362619357,
+ :block/updated-at 1668444522474}
+ {:block/name "agile methods - extreme programming",
+ :block/created-at 1664439358122,
+ :block/updated-at 1666267099375}
+ {:block/name "b",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "binomial coefficients",
+ :block/created-at 1663699875848,
+ :block/updated-at 1668457314989}
+ {:block/name "block ciphers & stream ciphers",
+ :block/created-at 1668429053525,
+ :block/updated-at 1668433368318}
+ {:block/name "bootstrap css",
+ :block/created-at 1666267099374,
+ :block/updated-at 1668457081710}
+ {:block/name "c",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "canceled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "cancelled",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "card",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "cloud computing",
+ :block/created-at 1662846706068,
+ :block/updated-at 1668456169227}
+ {:block/name "coding up inheritance",
+ :block/created-at 1665648103834,
+ :block/updated-at 1668456629856}
+ {:block/name "colouring graphs; eulerian & hamiltonian graphs",
+ :block/created-at 1667999555780,
+ :block/updated-at 1668443001705}
+ {:block/name "combinatorial proofs",
+ :block/created-at 1664365559513,
+ :block/updated-at 1668443776447}
+ {:block/name "contents",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "convex polyhedra",
+ :block/created-at 1667912443470,
+ :block/updated-at 1668457578790}
+ {:block/name "counting",
+ :block/created-at 1662844737516,
+ :block/updated-at 1668457323496}
+ {:block/name "cpu management - scheduling",
+ :block/created-at 1664802250958,
+ :block/updated-at 1668457596527}
+ {:block/name "ct2106 - object-oriented programming",
+ :block/created-at 1662812504035,
+ :block/updated-at 1662812504035}
+ {:block/name "ct213 - computer systems & organisation",
+ :block/created-at 1662812363300,
+ :block/updated-at 1662828172731}
+ {:block/name "ct216 - software engineering i",
+ :block/created-at 1662812477523,
+ :block/updated-at 1662846690423}
+ {:block/name "ct230 - database systems i",
+ :block/created-at 1662812383585,
+ :block/updated-at 1662846569759}
+ {:block/name "ct255 - next generation technologies ii",
+ :block/created-at 1662755524966,
+ :block/updated-at 1662843069874}
+ {:block/name "database system introduction",
+ :block/created-at 1662845439484,
+ :block/updated-at 1668457486076}
+ {:block/name "definitions & planar graphs",
+ :block/created-at 1666785671806,
+ :block/updated-at 1668457387541}
+ {:block/name "describing data in r",
+ :block/created-at 1663587324380,
+ :block/updated-at 1668456293726}
+ {:block/name "device management",
+ :block/created-at 1668429122913,
+ :block/updated-at 1668442925318}
+ {:block/name "diffie-hellman key exchange",
+ :block/created-at 1667829411273,
+ :block/updated-at 1668429053526}
+ {:block/name "discrete probability distributions: binomial & poisson",
+ :block/created-at 1665414098028,
+ :block/updated-at 1668457545150}
+ {:block/name "doing",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "done",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "entity relationship models",
+ :block/created-at 1664888080307,
+ :block/updated-at 1668457564149}
+ {:block/name "exploratory data analysis",
+ :block/created-at 1662760881692,
+ :block/updated-at 1668457282633}
+ {:block/name "extra-curriculars",
+ :block/created-at 1662817977281,
+ :block/updated-at 1662818031268}
+ {:block/name "favorites",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412632}
+ {:block/name "file organsiation",
+ :block/created-at 1668520994607,
+ :block/updated-at 1668537752901}
+ {:block/name "firebase functions",
+ :block/created-at 1668108223936,
+ :block/updated-at 1668443032599}
+ {:block/name "first java code",
+ :block/created-at 1663059929750,
+ :block/updated-at 1668457328740}
+ {:block/name "friedrich nietzsche",
+ :block/created-at 1663877719000,
+ :block/updated-at 1663877723364}
+ {:block/name "gdpr",
+ :block/created-at 1662755846087,
+ :block/updated-at 1668457284175}
+ {:block/name "hash cracking using rainbow tables",
+ :block/created-at 1666007838619,
+ :block/updated-at 1668456573508}
+ {:block/name "human security & passwords",
+ :block/created-at 1664798283314,
+ :block/updated-at 1668457059482}
+ {:block/name "hypothesis testing",
+ :block/created-at 1667837632146,
+ :block/updated-at 1668442989785}
+ {:block/name "in-progress",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "interfaces",
+ :block/created-at 1666857873329,
+ :block/updated-at 1668457549757}
+ {:block/name "introduction to agile methods",
+ :block/created-at 1663848388175,
+ :block/updated-at 1668457178386}
+ {:block/name "introduction to cryptography",
+ :block/created-at 1663488291074,
+ :block/updated-at 1668457287846}
+ {:block/name "introduction to cybersecurity",
+ :block/created-at 1662755701938,
+ :block/updated-at 1664807302595}
+ {:block/name "introduction to graph theory",
+ :block/created-at 1666180750693,
+ :block/updated-at 1668457223173}
+ {:block/name "introduction to inheritance",
+ :block/created-at 1665047054902,
+ :block/updated-at 1668456696366}
+ {:block/name "introduction to java",
+ :block/created-at 1662850740877,
+ :block/updated-at 1668444248410}
+ {:block/name "introduction to nodejs",
+ :block/created-at 1668066700245,
+ :block/updated-at 1668443072036}
+ {:block/name "introduction to object-oriented programming",
+ :block/created-at 1662850183398,
+ :block/updated-at 1668456056483}
+ {:block/name "introduction to sql & ddl",
+ :block/created-at 1663153069230,
+ :block/updated-at 1668457327025}
+ {:block/name "irish sign language",
+ :block/created-at 1662818031268,
+ :block/updated-at 1662818031268}
+ {:block/name "javascript functions & events",
+ :block/created-at 1668066700237,
+ :block/updated-at 1668066700237}
+ {:block/name "joins & union queries",
+ :block/created-at 1665572518087,
+ :block/updated-at 1668457472947}
+ {:block/name "later",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "ma284 - discrete mathematics",
+ :block/created-at 1662812426466,
+ :block/updated-at 1662812426466}
+ {:block/name "ma284: homework",
+ :block/created-at 1663235842961,
+ :block/updated-at 1663241964273}
+ {:block/name "memory management",
+ :block/created-at 1666616373198,
+ :block/updated-at 1668457064173}
+ {:block/name "more java code",
+ :block/created-at 1663063793212,
+ :block/updated-at 1668456059651}
+ {:block/name "normalisation",
+ :block/created-at 1666176972119,
+ :block/updated-at 1668457202855}
+ {:block/name "now",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "oop modelling",
+ :block/created-at 1663835834720,
+ :block/updated-at 1668166658338}
+ {:block/name "overview of computer systems",
+ :block/created-at 1662828172731,
+ :block/updated-at 1668457333415}
+ {:block/name "principle of inclusion-exclusion",
+ :block/created-at 1663097242134,
+ :block/updated-at 1668456128731}
+ {:block/name "probability",
+ :block/created-at 1664207767962,
+ :block/updated-at 1668456508417}
+ {:block/name "process management",
+ :block/created-at 1664207768394,
+ :block/updated-at 1668457185300}
+ {:block/name "process synchronisation",
+ :block/created-at 1665410544532,
+ :block/updated-at 1668537757603}
+ {:block/name "programming models",
+ :block/created-at 1662842663185,
+ :block/updated-at 1668457488770}
+ {:block/name "query processing & optimisation",
+ :block/created-at 1667916510155,
+ :block/updated-at 1668520994610}
+ {:block/name "query processing: relational algebra",
+ :block/created-at 1667899093310,
+ :block/updated-at 1668457585546}
+ {:block/name "random variables",
+ :block/created-at 1665050117811,
+ :block/updated-at 1668457255153}
+ {:block/name "sampling",
+ :block/created-at 1663604282449,
+ :block/updated-at 1668456164151}
+ {:block/name "sampling distributions & confidence intervals",
+ :block/created-at 1666624196792,
+ :block/updated-at 1668456842624}
+ {:block/name "scrum roles & ceremonies",
+ :block/created-at 1663849690600,
+ :block/updated-at 1668456665364}
+ {:block/name "second year university",
+ :block/created-at 1662812271350,
+ :block/updated-at 1662890970415}
+ {:block/name "social engineering",
+ :block/created-at 1665403220751,
+ :block/updated-at 1668456638307}
+ {:block/name "software processes",
+ :block/created-at 1663178663476,
+ :block/updated-at 1668443270879}
+ {:block/name "sql dml statement",
+ :block/created-at 1663680232157,
+ :block/updated-at 1668456577285}
+ {:block/name "sql dml: select",
+ :block/created-at 1664284172095,
+ :block/updated-at 1668456440301}
+ {:block/name "sql select: working with strings & subqueries",
+ :block/created-at 1664284172064,
+ :block/updated-at 1668457270722}
+ {:block/name "st2001 - statistics in data science i",
+ :block/created-at 1662760697673,
+ :block/updated-at 1664445709714}
+ {:block/name "st2001 labs",
+ :block/created-at 1663587251924,
+ :block/updated-at 1663587333173}
+ {:block/name "stars & bars",
+ :block/created-at 1664977220358,
+ :block/updated-at 1668456692917}
+ {:block/name "system software & operating systems",
+ :block/created-at 1663453161468,
+ :block/updated-at 1668457405956}
+ {:block/name "templates",
+ :block/created-at 1665268290093,
+ :block/updated-at 1665268429238}
+ {:block/name "the normal distribution",
+ :block/created-at 1665655379797,
+ :block/updated-at 1668537763176}
+ {:block/name "the relational model",
+ :block/created-at 1663056902320,
+ :block/updated-at 1668457343256}
+ {:block/name "todo",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name
+ "twilight of the idols (how to philosophise with the hammer)",
+ :block/created-at 1663877741591,
+ :block/updated-at 1663878217528}
+ {:block/name "using r as a calculator",
+ :block/created-at 1662885317609,
+ :block/updated-at 1668444699044}
+ {:block/name "variables & types",
+ :block/created-at 1663833671558,
+ :block/updated-at 1668456380990}
+ {:block/name "wait",
+ :block/created-at 1662755412633,
+ :block/updated-at 1662755412633}
+ {:block/name "waiting",
+ :block/created-at 1662755412632,
+ :block/updated-at 1662755412633}
+ {:block/name "日本語",
+ :block/created-at 1662818014594,
+ :block/updated-at 1662818014594}
+ {:block/name "日本語かんたん",
+ :block/created-at 1664037986968,
+ :block/updated-at 1664037986968}
+ {:block/name "日本語チャレンジ",
+ :block/created-at 1664445429911,
+ :block/updated-at 1664445429911}
+ {:block/name "本",
+ :block/created-at 1663877674293,
+ :block/updated-at 1663877674293}
+ {:block/name "絵からできた漢字1",
+ :block/created-at 1664445430033,
+ :block/updated-at 1665076855455}]
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T10_50_35.133Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T10_50_35.133Z.Desktop.edn
new file mode 100644
index 00000000..e9e6500e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T10_50_35.133Z.Desktop.edn
@@ -0,0 +1 @@
+{0 {2.5 0.18}, 1 {2.5 1.06}}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T15_20_35.688Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T15_20_35.688Z.Desktop.edn
new file mode 100644
index 00000000..c425b326
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T15_20_35.688Z.Desktop.edn
@@ -0,0 +1 @@
+{0 {2.5 0.04}, 1 {2.5 0.04, 2.36 0.98, 2.6 2.9, 2.22 3.08, 2.46 3.45, 2.56 4.14}, 2 {2.46 2.34, 2.6 2.58, 2.7 3.09, 2.36 1.26, 2.22 1.77}, 3 {2.8 3, 2.46 2.2, 2.7 2.79}}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T18_06_59.994Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T18_06_59.994Z.Desktop.edn
new file mode 100644
index 00000000..c425b326
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T18_06_59.994Z.Desktop.edn
@@ -0,0 +1 @@
+{0 {2.5 0.04}, 1 {2.5 0.04, 2.36 0.98, 2.6 2.9, 2.22 3.08, 2.46 3.45, 2.56 4.14}, 2 {2.46 2.34, 2.6 2.58, 2.7 3.09, 2.36 1.26, 2.22 1.77}, 3 {2.8 3, 2.46 2.2, 2.7 2.79}}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T18_18_31.281Z.Desktop.edn b/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T18_18_31.281Z.Desktop.edn
new file mode 100644
index 00000000..b65a1b23
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/logseq/srs-of-matrix/2022-10-07T18_18_31.281Z.Desktop.edn
@@ -0,0 +1 @@
+{0 {2.5 0.04}, 1 {2.5 0.04, 2.36 0.98, 2.6 2.8, 2.22 3.08, 2.46 3.45, 2.56 4.14}, 2 {2.46 2.42, 2.6 2.31, 2.7 3.55, 2.36 1.26, 2.22 1.77}, 3 {2.8 3, 2.46 2.2, 2.7 2.79}}
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Advanced PIE, Derangements, & Counting Functions/2022-11-23T09_22_44.493Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Advanced PIE, Derangements, & Counting Functions/2022-11-23T09_22_44.493Z.Desktop.md
new file mode 100644
index 00000000..55d2785b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Advanced PIE, Derangements, & Counting Functions/2022-11-23T09_22_44.493Z.Desktop.md
@@ -0,0 +1,142 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Stars & Bars]]
+- **Next Topic:** [[Introduction to Graph Theory]]
+- **Relevant Slides:** 
+-
+- # Advanced Counting Using PIE
+ collapsed:: true
+ - The PIE works for larger number of sets than 2 and 3, although it gets a little messy to write down.
+ - For 4 sets, we can think of it as:
+ - $|A \cup B \cup C \cup D| =$ (the sum of the sizes of each single set) $-$ (the sum of the sizes of each **intersection** of 2 sets) $+$ (the sum of the sizes of each **intersection** of 3 sets) $-$ (the sum of the sizes of the **intersection** of all 4 sets).
+ - ## Example
+ - How many ways can we distribute 10 slices of pie to 4 kids that such that no kid gets more than 2 slices (and each slice is distributed)? [See [the textbook](https://discrete.openmathbooks.org/dmoi3/sec_advPIE.html) for a more detailed solution.]
+ - The answer is obviously 0 - there will be 2 slices leftover after each kid gets the maximum of 2 slices.
+ - Without the restriction that nobody gets more than 2 slices, there would be $\binom{13}{3} = 286$ ways of sharing distributing the slices ($10+4-1$ stars & $4-1$ bars).
+ - Now, count the number of ways where a child gets more than 2 slices, i.e. some child gets $\geq 3$ slices.
+ - $$\binom{4}{1} \binom{7+3}{3} = 4(120) = 480$$
+ - (choose one of 4 kids)(number of ways of distributing).
+ - Add back in the doubly counted ones, subtracted the triply counted,
+ -
+ - $$\binom{13}{3} - \binom{4}{1} \binom{10}{3} + \binom{4}{2} \binom{7}{3} - \binom{4}{3} \binom{4}{3} + \binom{4}{4} \binom{1}{3} \\ = 286 - 480 +210 -16 = 0$$
+ - ## Example
+ - Not all problems have such easy solutions.
+ - How many non-negative integer solutions are there to $x_1 + x_2 + x_3 +x_4 +x_5 = 13$ if:
+ - 1. There are no restrictions (other than $x_i$ being an **nni**).
+ 2. $0\leq x_i \leq 3$ for each $i$.
+ - 1. $$\displaystyle \binom{13+4}{4} = \binom{17}{4}$$
+ - 2. Idea: All possibilities $-$ "the wrong ones", i.e., count the possibilities where at least one of the $x_i \geq 4$.
+ - $\binom{5}{1}$ ways pf choosing the $x_i$ and then number of solutions to $x_1+x_2+x_3+x_4+x_5 = 9$ is $\binom{9+4}{4} = \binom{13}{4}$, i.e. $\binom{5}{1} \binom{13}{4}$.
+ - But we have double counted, so number of solutions with two $x_i \ geq 4$ is $\binom{5}{2}$ choices and $x_1+x_2+x_3+x_4+x_5 = 5$ has $\binom{5+4}{4} = \binom{9}{4}$ solutions.
+ - Answer: $\displaystyle \binom{17}{4} - \binom{5}{1} \binom{13}{4} + \binom{5}{2}\binom{9}{4} - \binom{5}{3}\binom{5}{4} +0$.
+ -
+- # Derangements
+ - What is a **derangement**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-20T19:47:44.301Z
+ card-last-reviewed:: 2022-11-17T09:47:44.301Z
+ card-last-score:: 5
+ - A **derangement** is a permutation where no element is left in its original place, everything is moved.
+ - ## Example - Derangements of 4 Letters $\text{STARS}$.
+ - Let $D_n$ be the number of *derangements* of $n$ objects.
+ - First, we will work out the formulae for $D_1$, $D_2$, $D_3$, & $D_4$.
+ - $$D_1 = 0,\ D_2 = 1,\ D_3 = 2,\ D_4 = 9$$
+ - We derive a formula using PIE.
+ - We know that there are $4!$ permutations. Which ones are **not** derangements?
+ - Suppose that one item (at least) is left in place.
+ - There are $$\displaystyle \binom{4}{1} \cdot 3!$$ such permutations.
+ - (choose one item to not change from four)(number of ways of permutating the other items).
+ - However, some of these will be counted twice.
+ - So, by PIE, the answer is
+ - $$D_4 = 4! - \binom{4}{1}3! + \binom{4}{2}2!-\binom{4}{3}1!+\binom{4}{4}0!$$
+ - $$D_4 = 4! - \frac{4!3!}{1!3!} +\frac{4!2!}{2!2!}-\frac{4!1!}{3!1!} + \frac{4!0!}{4!0!}$$
+ - $$D_4 = 4![1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}] = 9$$
+ - In general, the formula for $D_n$, the number of derangements of $n$ objects is
+ - $$D_n = n!(1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+ \dots + (-1)^n \frac{1}{n!})$$
+ - Note that the series expansion for e^x is
+ - $$e^x = 1 + \frac{x}{1!} +\frac{x^2}{2!}+\frac{x^3}{3!} + \dots$$
+ - So $$\displaystyle e^{-1} = 1 - \frac{1}{1!} + \frac{1}{2!}-\frac{1}{3!}+ \dots$$
+ - So $$\displaystyle \lim_{n \to \infty} \frac{D_n}{n!} = e^{-1} \approx 0.36787$$
+- # Counting with Repetitions
+ - What is a **Multinomial Coefficient**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:07:58.830Z
+ card-last-score:: 1
+ - The number of different permutations of $n$ objects, where there are $n_1$ indistinguishable objects of Type 1, $n_2$ indistinguishable objects of Type 2, ..., and $n_k$ indistinguishable objects of Type $k$, is
+ - $$\frac{n!}{(n_1!)(n_2!) \dots (n_k!)}$$
+ - ## Example
+ - How many "words" can we make from the letters in the set $\{R,O,S,C,O,M,M,O,N\}$.
+ - If somehow the three $O$s were all distinguishable, and the two $M$s were distinguishable, the answer would be $9!$.
+ - But, since we can't distinguish the identical letters,
+ - Let's choose which of the 9 positions in which we place the three $O$s.
+ - This can be done in $$\displaystyle \binom{9}{3}$$ ways.
+ - Now, let's choose which of the remaining 6 positions in which we place the two $M$s.
+ - This can be done in $$\displaystyle \binom{6}{2}$$ ways.
+ - Finally, let's choose where to replace the remaining 4 letters.
+ - This can be done in $$4!$$ ways.
+ - By the Multiplicative Principle, the answer is
+ - $$\binom{9}{3}\binom{6}{2}4! = \frac{9!}{3!6!} \frac{6!}{2!}{4!} 4! = \frac{9!}{3!2!}$$
+- # Example (MA284 Semester 1 Exam, 2014/2015)
+ - **(i) Find the number of different arrangements of the letters in the place name `WOLLONGONG`.**
+ - `OOOLLNNGGW`
+ - $$\frac{10!}{3!2!2!2!1!} = 75600$$
+ - **(ii) How many of these arrangements start with three `O`s?**
+ - `OOO` (one way) and 7 others.
+ - $$\frac{7!}{2!2!2!} = 630$$
+ - **(ii) How many contain the two `G`s consecutively?**
+ - Treat `GG` as a single letter and permute 9 letters.
+ - $$\frac{9!}{3!2!2!1!} = 15120$$
+ - **(iv) How many *do not* contain the two `G`s consecutively?**
+ - Use **(i)** - **(iv)**.
+ - $$75600 - 15120 = 60480$$
+- # Counting Functions
+ - Recall that $f: A \rightarrow B$ is a **function** that maps every element of the set $A$ onto some element of set $B$.
+ - We call $A$ the **domain** & $B$ the **codomain**.
+ - Each element of $A$ gets mapped to exactly one element of $B$.
+ - What does it mean if $a$ is the **image** of $b$? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:17:52.154Z
+ card-last-score:: 1
+ - If $f(a) = b$ where $a \in A$ and $b \in B$, we say that "the **image** of $a$ is $b$", or, equivalently, "$b$ is the **image** of $a$".
+ - What is a **surjective** function (surjection)? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:13:44.812Z
+ card-last-score:: 1
+ - For some function $f: A \rightarrow B$, if every element of $B$ is the image of some element $A$, we say that the function is **surjective** (also called "**onto**").
+ - What is an **injective** function (injection)? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:16:06.397Z
+ card-last-score:: 1
+ - For some function $f: A \rightarrow B$, if no two elements of $A$ have the same image in $B$, we say that the function is **injective** (also called "one-to-one").
+ - What is a **bijective** function (bijection)? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-18T20:09:58.766Z
+ card-last-reviewed:: 2022-11-14T20:09:58.766Z
+ card-last-score:: 5
+ - The function $f: A \rightarrow B$ is a **bijection** if it is both **surjective** & **injective**.
+ - Then $f$ defines a **one-to-one correspondence** between $A$ & $B$
+ - ## Examples
+ - **Let** $A$ **&** $B$ **be finite sets. How many functions** $f: A \rightarrow B$ **are there?**
+ - We can use ((6336be87-7dea-4ba3-b7d0-c77a73bae948)) to deduce that there are in total $|B|^{|A|}$ functions from $A$ to $B$.
+ - **How many functions** $f: A\{1,2,3,4,5,6,7,8\} \rightarrow \{1,2,3,4,5,6,7,8\}$ **are bijective**?
+ - Remember what it means for a function to be **bijective:** ^^each element in the codomain must be the image of **exactly one** element of the domain.^^
+ - What we are really doing is just rearranging the elements of the codomain, so we are defining a **permutation** of 8 elements.
+ - Therefore, the answer to our question is 8!.
+ - More generally, there are $n!$ bijections of the set $\{1,2,\cdots, n\}$ onto itself.
+ - [[2022年10月19日]]
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Advanced PIE, Derangements, & Counting Functions/2022-11-23T12_15_36.855Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Advanced PIE, Derangements, & Counting Functions/2022-11-23T12_15_36.855Z.Desktop.md
new file mode 100644
index 00000000..55d2785b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Advanced PIE, Derangements, & Counting Functions/2022-11-23T12_15_36.855Z.Desktop.md
@@ -0,0 +1,142 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Stars & Bars]]
+- **Next Topic:** [[Introduction to Graph Theory]]
+- **Relevant Slides:** 
+-
+- # Advanced Counting Using PIE
+ collapsed:: true
+ - The PIE works for larger number of sets than 2 and 3, although it gets a little messy to write down.
+ - For 4 sets, we can think of it as:
+ - $|A \cup B \cup C \cup D| =$ (the sum of the sizes of each single set) $-$ (the sum of the sizes of each **intersection** of 2 sets) $+$ (the sum of the sizes of each **intersection** of 3 sets) $-$ (the sum of the sizes of the **intersection** of all 4 sets).
+ - ## Example
+ - How many ways can we distribute 10 slices of pie to 4 kids that such that no kid gets more than 2 slices (and each slice is distributed)? [See [the textbook](https://discrete.openmathbooks.org/dmoi3/sec_advPIE.html) for a more detailed solution.]
+ - The answer is obviously 0 - there will be 2 slices leftover after each kid gets the maximum of 2 slices.
+ - Without the restriction that nobody gets more than 2 slices, there would be $\binom{13}{3} = 286$ ways of sharing distributing the slices ($10+4-1$ stars & $4-1$ bars).
+ - Now, count the number of ways where a child gets more than 2 slices, i.e. some child gets $\geq 3$ slices.
+ - $$\binom{4}{1} \binom{7+3}{3} = 4(120) = 480$$
+ - (choose one of 4 kids)(number of ways of distributing).
+ - Add back in the doubly counted ones, subtracted the triply counted,
+ -
+ - $$\binom{13}{3} - \binom{4}{1} \binom{10}{3} + \binom{4}{2} \binom{7}{3} - \binom{4}{3} \binom{4}{3} + \binom{4}{4} \binom{1}{3} \\ = 286 - 480 +210 -16 = 0$$
+ - ## Example
+ - Not all problems have such easy solutions.
+ - How many non-negative integer solutions are there to $x_1 + x_2 + x_3 +x_4 +x_5 = 13$ if:
+ - 1. There are no restrictions (other than $x_i$ being an **nni**).
+ 2. $0\leq x_i \leq 3$ for each $i$.
+ - 1. $$\displaystyle \binom{13+4}{4} = \binom{17}{4}$$
+ - 2. Idea: All possibilities $-$ "the wrong ones", i.e., count the possibilities where at least one of the $x_i \geq 4$.
+ - $\binom{5}{1}$ ways pf choosing the $x_i$ and then number of solutions to $x_1+x_2+x_3+x_4+x_5 = 9$ is $\binom{9+4}{4} = \binom{13}{4}$, i.e. $\binom{5}{1} \binom{13}{4}$.
+ - But we have double counted, so number of solutions with two $x_i \ geq 4$ is $\binom{5}{2}$ choices and $x_1+x_2+x_3+x_4+x_5 = 5$ has $\binom{5+4}{4} = \binom{9}{4}$ solutions.
+ - Answer: $\displaystyle \binom{17}{4} - \binom{5}{1} \binom{13}{4} + \binom{5}{2}\binom{9}{4} - \binom{5}{3}\binom{5}{4} +0$.
+ -
+- # Derangements
+ - What is a **derangement**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-20T19:47:44.301Z
+ card-last-reviewed:: 2022-11-17T09:47:44.301Z
+ card-last-score:: 5
+ - A **derangement** is a permutation where no element is left in its original place, everything is moved.
+ - ## Example - Derangements of 4 Letters $\text{STARS}$.
+ - Let $D_n$ be the number of *derangements* of $n$ objects.
+ - First, we will work out the formulae for $D_1$, $D_2$, $D_3$, & $D_4$.
+ - $$D_1 = 0,\ D_2 = 1,\ D_3 = 2,\ D_4 = 9$$
+ - We derive a formula using PIE.
+ - We know that there are $4!$ permutations. Which ones are **not** derangements?
+ - Suppose that one item (at least) is left in place.
+ - There are $$\displaystyle \binom{4}{1} \cdot 3!$$ such permutations.
+ - (choose one item to not change from four)(number of ways of permutating the other items).
+ - However, some of these will be counted twice.
+ - So, by PIE, the answer is
+ - $$D_4 = 4! - \binom{4}{1}3! + \binom{4}{2}2!-\binom{4}{3}1!+\binom{4}{4}0!$$
+ - $$D_4 = 4! - \frac{4!3!}{1!3!} +\frac{4!2!}{2!2!}-\frac{4!1!}{3!1!} + \frac{4!0!}{4!0!}$$
+ - $$D_4 = 4![1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}] = 9$$
+ - In general, the formula for $D_n$, the number of derangements of $n$ objects is
+ - $$D_n = n!(1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+ \dots + (-1)^n \frac{1}{n!})$$
+ - Note that the series expansion for e^x is
+ - $$e^x = 1 + \frac{x}{1!} +\frac{x^2}{2!}+\frac{x^3}{3!} + \dots$$
+ - So $$\displaystyle e^{-1} = 1 - \frac{1}{1!} + \frac{1}{2!}-\frac{1}{3!}+ \dots$$
+ - So $$\displaystyle \lim_{n \to \infty} \frac{D_n}{n!} = e^{-1} \approx 0.36787$$
+- # Counting with Repetitions
+ - What is a **Multinomial Coefficient**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:07:58.830Z
+ card-last-score:: 1
+ - The number of different permutations of $n$ objects, where there are $n_1$ indistinguishable objects of Type 1, $n_2$ indistinguishable objects of Type 2, ..., and $n_k$ indistinguishable objects of Type $k$, is
+ - $$\frac{n!}{(n_1!)(n_2!) \dots (n_k!)}$$
+ - ## Example
+ - How many "words" can we make from the letters in the set $\{R,O,S,C,O,M,M,O,N\}$.
+ - If somehow the three $O$s were all distinguishable, and the two $M$s were distinguishable, the answer would be $9!$.
+ - But, since we can't distinguish the identical letters,
+ - Let's choose which of the 9 positions in which we place the three $O$s.
+ - This can be done in $$\displaystyle \binom{9}{3}$$ ways.
+ - Now, let's choose which of the remaining 6 positions in which we place the two $M$s.
+ - This can be done in $$\displaystyle \binom{6}{2}$$ ways.
+ - Finally, let's choose where to replace the remaining 4 letters.
+ - This can be done in $$4!$$ ways.
+ - By the Multiplicative Principle, the answer is
+ - $$\binom{9}{3}\binom{6}{2}4! = \frac{9!}{3!6!} \frac{6!}{2!}{4!} 4! = \frac{9!}{3!2!}$$
+- # Example (MA284 Semester 1 Exam, 2014/2015)
+ - **(i) Find the number of different arrangements of the letters in the place name `WOLLONGONG`.**
+ - `OOOLLNNGGW`
+ - $$\frac{10!}{3!2!2!2!1!} = 75600$$
+ - **(ii) How many of these arrangements start with three `O`s?**
+ - `OOO` (one way) and 7 others.
+ - $$\frac{7!}{2!2!2!} = 630$$
+ - **(ii) How many contain the two `G`s consecutively?**
+ - Treat `GG` as a single letter and permute 9 letters.
+ - $$\frac{9!}{3!2!2!1!} = 15120$$
+ - **(iv) How many *do not* contain the two `G`s consecutively?**
+ - Use **(i)** - **(iv)**.
+ - $$75600 - 15120 = 60480$$
+- # Counting Functions
+ - Recall that $f: A \rightarrow B$ is a **function** that maps every element of the set $A$ onto some element of set $B$.
+ - We call $A$ the **domain** & $B$ the **codomain**.
+ - Each element of $A$ gets mapped to exactly one element of $B$.
+ - What does it mean if $a$ is the **image** of $b$? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:17:52.154Z
+ card-last-score:: 1
+ - If $f(a) = b$ where $a \in A$ and $b \in B$, we say that "the **image** of $a$ is $b$", or, equivalently, "$b$ is the **image** of $a$".
+ - What is a **surjective** function (surjection)? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:13:44.812Z
+ card-last-score:: 1
+ - For some function $f: A \rightarrow B$, if every element of $B$ is the image of some element $A$, we say that the function is **surjective** (also called "**onto**").
+ - What is an **injective** function (injection)? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:16:06.397Z
+ card-last-score:: 1
+ - For some function $f: A \rightarrow B$, if no two elements of $A$ have the same image in $B$, we say that the function is **injective** (also called "one-to-one").
+ - What is a **bijective** function (bijection)? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-18T20:09:58.766Z
+ card-last-reviewed:: 2022-11-14T20:09:58.766Z
+ card-last-score:: 5
+ - The function $f: A \rightarrow B$ is a **bijection** if it is both **surjective** & **injective**.
+ - Then $f$ defines a **one-to-one correspondence** between $A$ & $B$
+ - ## Examples
+ - **Let** $A$ **&** $B$ **be finite sets. How many functions** $f: A \rightarrow B$ **are there?**
+ - We can use ((6336be87-7dea-4ba3-b7d0-c77a73bae948)) to deduce that there are in total $|B|^{|A|}$ functions from $A$ to $B$.
+ - **How many functions** $f: A\{1,2,3,4,5,6,7,8\} \rightarrow \{1,2,3,4,5,6,7,8\}$ **are bijective**?
+ - Remember what it means for a function to be **bijective:** ^^each element in the codomain must be the image of **exactly one** element of the domain.^^
+ - What we are really doing is just rearranging the elements of the codomain, so we are defining a **permutation** of 8 elements.
+ - Therefore, the answer to our question is 8!.
+ - More generally, there are $n!$ bijections of the set $\{1,2,\cdots, n\}$ onto itself.
+ - [[2022年10月19日]]
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Aggregate Clauses, Group By, & Having Clauses/2022-10-07T08_33_33.289Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Aggregate Clauses, Group By, & Having Clauses/2022-10-07T08_33_33.289Z.Desktop.md
new file mode 100644
index 00000000..df1d412f
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Aggregate Clauses, Group By, & Having Clauses/2022-10-07T08_33_33.289Z.Desktop.md
@@ -0,0 +1,55 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[SQL SELECT: Working with Strings & Subqueries]]
+- **Next Topic:** [[Entity Relationship Models]]
+- **Relevant Slides:** 
+-
+- # Aggregate Functions #card
+ card-last-interval:: 3.58
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-03T21:34:29.060Z
+ card-last-reviewed:: 2022-09-30T08:34:29.061Z
+ card-last-score:: 3
+ - **Aggregate Functions** are only supported in `SELECT` clauses & `HAVING` clauses.
+ - Keywords `SUM`, `AVG`, `MIN`, `MAX` work as expected and can only be applied to **numeric** data.
+ - Keyword `COUNT` can be used to count the number of tuples / values / rows specified in a query.
+ - We can also use mathematical operations as part of an aggregate function on **numeric** data, e.g., `+`, `-`, `*`, `/`.
+- # `GROUP BY` #card
+ card-last-interval:: 3.58
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-03T21:36:41.416Z
+ card-last-reviewed:: 2022-09-30T08:36:41.416Z
+ card-last-score:: 3
+ - `GROUP BY `
+ - The `GROUP BY` clause allows the grouping of rows of a table together so that all occurrences within a specified group are collected together.
+ - Aggregate clauses can then be applied to groups.
+ - ## Using Aggregate Functions with `GROUP BY` #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-06T23:00:00.000Z
+ card-last-reviewed:: 2022-10-06T09:42:27.555Z
+ card-last-score:: 1
+ - The `GROUP BY` clause specifies the group and the aggregate function is applied to the group.
+ - `COUNT(*)` can be used to *count* the number of rows (tuples) in the specified groups.
+ - `SUM`, `AVG`, `MIN`, `MAX` can be used to find the sum, average, min, & max of a *numerical value* in a specified group.
+ - ^^**Important:** You must `GROUP BY` **all** attributes in the `SELECT` clause *unless* they are involved in an aggregation.^^
+ - This **^^wouldn't work^^** as we do not `GROUP BY` all the attributes in the `SELECT` clause - `salary` remains ungrouped.
+ - ```SQL
+ SELECT dno, salary
+ FROM employee
+ GROUP BY dno -- THIS IS WRONG
+ ```
+ -
+- # `HAVING` #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T08:32:55.188Z
+ card-last-score:: 1
+ - `HAVING `
+ - The `HAVING` clause is used in conjunction with `GROUP BY` and allows the specification of **conditions on groups**.
+ - The column names in the `HAVING` clause must also appear in the `GROUP BY` list or be contained within an aggregate function, i.e., you cannot apply a `HAVING` condition to something that has not been calculated already.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Aggregate Clauses, Group By, & Having Clauses/2022-10-10T11_59_52.361Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Aggregate Clauses, Group By, & Having Clauses/2022-10-10T11_59_52.361Z.Desktop.md
new file mode 100644
index 00000000..7c45ee59
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Aggregate Clauses, Group By, & Having Clauses/2022-10-10T11_59_52.361Z.Desktop.md
@@ -0,0 +1,55 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[SQL SELECT: Working with Strings & Subqueries]]
+- **Next Topic:** [[Entity Relationship Models]]
+- **Relevant Slides:** 
+-
+- # Aggregate Functions #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:37:18.526Z
+ card-last-reviewed:: 2022-10-07T10:37:18.527Z
+ card-last-score:: 5
+ - **Aggregate Functions** are only supported in `SELECT` clauses & `HAVING` clauses.
+ - Keywords `SUM`, `AVG`, `MIN`, `MAX` work as expected and can only be applied to **numeric** data.
+ - Keyword `COUNT` can be used to count the number of tuples / values / rows specified in a query.
+ - We can also use mathematical operations as part of an aggregate function on **numeric** data, e.g., `+`, `-`, `*`, `/`.
+- # `GROUP BY` #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:37:37.905Z
+ card-last-reviewed:: 2022-10-07T10:37:37.905Z
+ card-last-score:: 5
+ - `GROUP BY `
+ - The `GROUP BY` clause allows the grouping of rows of a table together so that all occurrences within a specified group are collected together.
+ - Aggregate clauses can then be applied to groups.
+ - ## Using Aggregate Functions with `GROUP BY` #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:01:12.709Z
+ card-last-score:: 1
+ - The `GROUP BY` clause specifies the group and the aggregate function is applied to the group.
+ - `COUNT(*)` can be used to *count* the number of rows (tuples) in the specified groups.
+ - `SUM`, `AVG`, `MIN`, `MAX` can be used to find the sum, average, min, & max of a *numerical value* in a specified group.
+ - ^^**Important:** You must `GROUP BY` **all** attributes in the `SELECT` clause *unless* they are involved in an aggregation.^^
+ - This **^^wouldn't work^^** as we do not `GROUP BY` all the attributes in the `SELECT` clause - `salary` remains ungrouped.
+ - ```SQL
+ SELECT dno, salary
+ FROM employee
+ GROUP BY dno -- THIS IS WRONG
+ ```
+ -
+- # `HAVING` #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T10:16:13.976Z
+ card-last-reviewed:: 2022-10-06T17:16:13.977Z
+ card-last-score:: 3
+ - `HAVING `
+ - The `HAVING` clause is used in conjunction with `GROUP BY` and allows the specification of **conditions on groups**.
+ - The column names in the `HAVING` clause must also appear in the `GROUP BY` list or be contained within an aggregate function, i.e., you cannot apply a `HAVING` condition to something that has not been calculated already.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Aggregate Clauses, Group By, & Having Clauses/2022-10-20T09_05_57.918Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Aggregate Clauses, Group By, & Having Clauses/2022-10-20T09_05_57.918Z.Desktop.md
new file mode 100644
index 00000000..5ce03b64
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Aggregate Clauses, Group By, & Having Clauses/2022-10-20T09_05_57.918Z.Desktop.md
@@ -0,0 +1,55 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[SQL SELECT: Working with Strings & Subqueries]]
+- **Next Topic:** [[Entity Relationship Models]]
+- **Relevant Slides:** 
+-
+- # Aggregate Functions #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:37:18.526Z
+ card-last-reviewed:: 2022-10-07T10:37:18.527Z
+ card-last-score:: 5
+ - **Aggregate Functions** are only supported in `SELECT` clauses & `HAVING` clauses.
+ - Keywords `SUM`, `AVG`, `MIN`, `MAX` work as expected and can only be applied to **numeric** data.
+ - Keyword `COUNT` can be used to count the number of tuples / values / rows specified in a query.
+ - We can also use mathematical operations as part of an aggregate function on **numeric** data, e.g., `+`, `-`, `*`, `/`.
+- # `GROUP BY` #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:37:37.905Z
+ card-last-reviewed:: 2022-10-07T10:37:37.905Z
+ card-last-score:: 5
+ - `GROUP BY `
+ - The `GROUP BY` clause allows the grouping of rows of a table together so that all occurrences within a specified group are collected together.
+ - Aggregate clauses can then be applied to groups.
+ - ## Using Aggregate Functions with `GROUP BY` #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T21:32:53.059Z
+ card-last-reviewed:: 2022-10-10T11:32:53.059Z
+ card-last-score:: 5
+ - The `GROUP BY` clause specifies the group and the aggregate function is applied to the group.
+ - `COUNT(*)` can be used to *count* the number of rows (tuples) in the specified groups.
+ - `SUM`, `AVG`, `MIN`, `MAX` can be used to find the sum, average, min, & max of a *numerical value* in a specified group.
+ - ^^**Important:** You must `GROUP BY` **all** attributes in the `SELECT` clause *unless* they are involved in an aggregation.^^
+ - This **^^wouldn't work^^** as we do not `GROUP BY` all the attributes in the `SELECT` clause - `salary` remains ungrouped.
+ - ```SQL
+ SELECT dno, salary
+ FROM employee
+ GROUP BY dno -- THIS IS WRONG
+ ```
+ -
+- # `HAVING` #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T10:16:13.976Z
+ card-last-reviewed:: 2022-10-06T17:16:13.977Z
+ card-last-score:: 3
+ - `HAVING `
+ - The `HAVING` clause is used in conjunction with `GROUP BY` and allows the specification of **conditions on groups**.
+ - The column names in the `HAVING` clause must also appear in the `GROUP BY` list or be contained within an aggregate function, i.e., you cannot apply a `HAVING` condition to something that has not been calculated already.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Agile Methods - Extreme Programming/2022-10-07T08_33_33.292Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Agile Methods - Extreme Programming/2022-10-07T08_33_33.292Z.Desktop.md
new file mode 100644
index 00000000..50c603c5
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Agile Methods - Extreme Programming/2022-10-07T08_33_33.292Z.Desktop.md
@@ -0,0 +1,43 @@
+- #[[CT216 - Software Engineering I]]
+- **Previous Topic:** [[Introduction to Agile Methods]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # XP
+ - **eXtreme Programming (XP)** is one of the most popular agile software development methods.
+ - Some characteristics of XP include:
+ - Pair programming.
+ - Refactoring.
+ - Test-Driven Development (TDD).
+ - Continuous Integration.
+ - Metaphor.
+ - Small releases.
+ - Simple design.
+ - Customer tests.
+ - ## Principles of XP #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:11:14.853Z
+ card-last-score:: 1
+ - Communication.
+ - Simplicity.
+ - Feedback.
+ - Courage.
+ - Respect.
+ - All the contributors to an XP project (members of one team) sit together. This team must include a business representative (Product Owner) - the "Customer" - who provides the requirements, sets the priorities, and steers the project.
+ - ## Planning
+ - XP planning addresses two key questions in software development: predicting what will be accomplished by the due date, and determining what to do next.
+ - **Release Planning** is a practice where the Customer presents the desired features to the programmers, and the programmers estimate their difficulty.
+ - **Iteration Planning** is the practice whereby the team is given direction every few weeks (Sprints).
+ - ## Customer Tests
+ - As part of presenting each desired feature, the XP Customer defines one or more automated acceptance tests to show that the feature is working.
+ - The team builds these tests and uses them to prove to themselves, and to the customer, that the feature is implemented correctly.
+ - ## Small Releases
+ - XP teams practice small releases in two important ways:
+ - First, the team releases running, tested software, delivering business value chosen by the Customer, every iteration.
+ - Second, XP teams release to their end users frequently as well.
+ - ## Coding Standards
+ - XP teams follow a common coding standard, so that all the code
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Agile Methods - Extreme Programming/2022-10-10T11_59_52.367Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Agile Methods - Extreme Programming/2022-10-10T11_59_52.367Z.Desktop.md
new file mode 100644
index 00000000..02e16491
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Agile Methods - Extreme Programming/2022-10-10T11_59_52.367Z.Desktop.md
@@ -0,0 +1,43 @@
+- #[[CT216 - Software Engineering I]]
+- **Previous Topic:** [[Introduction to Agile Methods]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # XP
+ - **eXtreme Programming (XP)** is one of the most popular agile software development methods.
+ - Some characteristics of XP include:
+ - Pair programming.
+ - Refactoring.
+ - Test-Driven Development (TDD).
+ - Continuous Integration.
+ - Metaphor.
+ - Small releases.
+ - Simple design.
+ - Customer tests.
+ - ## Principles of XP #card
+ card-last-interval:: 3.18
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T21:25:51.008Z
+ card-last-reviewed:: 2022-10-06T17:25:51.008Z
+ card-last-score:: 3
+ - Communication.
+ - Simplicity.
+ - Feedback.
+ - Courage.
+ - Respect.
+ - All the contributors to an XP project (members of one team) sit together. This team must include a business representative (Product Owner) - the "Customer" - who provides the requirements, sets the priorities, and steers the project.
+ - ## Planning
+ - XP planning addresses two key questions in software development: predicting what will be accomplished by the due date, and determining what to do next.
+ - **Release Planning** is a practice where the Customer presents the desired features to the programmers, and the programmers estimate their difficulty.
+ - **Iteration Planning** is the practice whereby the team is given direction every few weeks (Sprints).
+ - ## Customer Tests
+ - As part of presenting each desired feature, the XP Customer defines one or more automated acceptance tests to show that the feature is working.
+ - The team builds these tests and uses them to prove to themselves, and to the customer, that the feature is implemented correctly.
+ - ## Small Releases
+ - XP teams practice small releases in two important ways:
+ - First, the team releases running, tested software, delivering business value chosen by the Customer, every iteration.
+ - Second, XP teams release to their end users frequently as well.
+ - ## Coding Standards
+ - XP teams follow a common coding standard, so that all the code
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-09-30T08_54_51.791Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-09-30T08_54_51.791Z.Desktop.md
new file mode 100644
index 00000000..12c98208
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-09-30T08_54_51.791Z.Desktop.md
@@ -0,0 +1,156 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Principle of Inclusion-Exclusion]]
+- **Next Topic:** [[Combinatorial Proofs]]
+- **Relevant Slides:** 
+-
+- # Binary Strings & Lattice Paths
+ collapsed:: true
+ - ## Binary Strings
+ - A **bit** is a "binary digit", e.g., 1 or 0.
+ - A **bit string** is a string (list) of bits, e.g., 1011010.
+ - What is the **length** of a string? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-26T23:00:00.000Z
+ card-last-reviewed:: 2022-09-26T12:13:43.295Z
+ card-last-score:: 1
+ - The **length** of the string is the number of bits.
+ - An $n$-bit string has length $n$.
+ - The set of all $n$-bit strings (for given $n$) is denoted $B^n$.
+ - What is the **weight** of a string? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:12:45.309Z
+ card-last-reviewed:: 2022-09-26T12:12:45.310Z
+ card-last-score:: 5
+ - The **weight** of the string is the number of 1s.
+ - The set of all $n$-bit strings of weight $k$ is denoted $B^n_k$.
+ - ## Lattice Paths
+ - What is a **lattice**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:15:21.865Z
+ card-last-reviewed:: 2022-09-26T12:15:21.865Z
+ card-last-score:: 3
+ - The (integer) **lattice** is the set of all points in the Cartesian plane for which both the $x$ & $y$ coordinates are integers.
+ - What is a **lattice path**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-26T23:00:00.000Z
+ card-last-reviewed:: 2022-09-26T12:15:00.437Z
+ card-last-score:: 1
+ - A **lattice path** is the ^^shortest possible path^^ connecting two points on the lattice, moving only horizontally & vertically.
+ - There can be multiple lattice paths, so long as they are of equally short length.
+ - 
+ - The number of lattice paths from $(0,0)$ to $(3,2)$ is the same as $|B_3^5|$.
+ - The number of lattice paths from $(0,0)$ to $(3,2)$ is the same as the number from $(0,0)$ to $(2,2)$, plus the number from $(0,0)$ to $(3,1)$.
+-
+- # Binomial Coefficients
+ - What is the coefficient of say, $x^3y^2$ in $(x+y)^5$?
+ - $$(x+y)^0=1
+ \newline
+ (x+y)^1=x+y
+ \newline
+ (x+y)^2=x^2+2xy+y^2
+ \newline
+ (x+y)^3=x^3+3x^2y+3xy^2+y^3
+ \newline
+ (x+y)^4=x^4+4x^3y+6x^2y^2+4xy^3+y^4
+ \newline
+ (x+y)^5=x^5+5x^4y+10x^3y^2+10x^2y^3+5xy^4+y^5
+ $$
+ - So, by doing a lot of multiplication, we have worked out that the coefficient of $x^3y^2$ is $10$.
+ - But, there is a more systematic way of answering this problem.
+ -
+ - $$(x+y)^5=(x+y)(x+y)(x+y)(x+y)(x+y)$$
+ - We can work out the coefficient of $x^3y^2$ in the expansion of $(x+y)^5$ by counting the number of ways we can **choose** $3$ $x$s & $2$ $y$s in
+ - $$(x+y)(x+y)(x+y)(x+y)(x+y)$$
+ -
+ - The numbers that occurred in all of our examples are called **binomial coefficients**, and are denoted
+ - $$\binom{n}{k}$$
+ - What are **Binomial Coefficients**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:13:19.107Z
+ card-last-reviewed:: 2022-09-26T12:13:19.108Z
+ card-last-score:: 3
+ - For each integer $n \geq 0$, and integer $k$ such that $0 \leq k \leq n$, there is a number $\binom{n}{k}$, read as "$n$ *choose* $k$".
+ - $\binom{n}{k} = |B^n_k|$, the number of $n$-bit strings of weight $k$.
+ - $\binom{n}{k}$ is the number of subsets of a set of size $n$, each with cardinality $k$.
+ - $\binom{n}{k}$ is the number of lattice paths of length $n$ containing $k$ steps to the right.
+ - $\binom{n}{k}$ is the coefficient of $x^k y^{n-k}$ in the expansion of $(x+y)^n$.
+ - $\binom{n}{k}$ is the number of ways to select $k$ objects from a total of $n$ objects.
+ - If we were to skip ahead, we would learn that there is a formula for $\binom{n}{k}$ (that is, "$n$ choose $k$") that is expressed in terms of **factorials**.
+ - Recall that the **factorial** of a natural number $n$ is:
+ - $$n! = n \times (n-1) \times (n-2) \times (n-4) \times ... \times 2 \times 1$$
+ - We will eventually learn that
+ - $$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$
+ - However, the formula $\binom{n}{k} = \frac{n!}{k!(n-k)!}$ is not very useful in practice.
+ -
+-
+- # Pascal's Triangle
+ collapsed:: true
+ - 
+ - Earlier, we learned that if the set of all $n$-bit strings with weight $k$ is written $B^n_k$, then
+ - $$|b^n_k| = |B^{n-1}_{k-1}| + |B^{n-1}_k$$
+ - Similarly, we find that:
+ - #### Pascal's Identity: A recurrence relation for $\binom{n}{k}$ #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-26T23:00:00.000Z
+ card-last-reviewed:: 2022-09-26T12:14:13.327Z
+ card-last-score:: 1
+ - $$\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}$$
+ - This is often presented as **Pascal's Triangle**
+ - 
+ -
+-
+- # Permutations
+ - What is a **permutation**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:14:28.732Z
+ card-last-reviewed:: 2022-09-26T12:14:28.732Z
+ card-last-score:: 5
+ - A **permutation** is an arrangement of objects. Changing the order of the objects gives a different permutation.
+ - Important: order matters!
+ - ### Number of Permutations
+ - How many **permutations** are there of $n$ objects? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-22T23:00:00.000Z
+ card-last-reviewed:: 2022-09-22T20:27:24.238Z
+ card-last-score:: 1
+ - There are $n!$ (i.e., $n$ *factorial*) permutations of $n$ (distinct) objects.
+ - How many permutations are there of $k$ objects from $n$? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-26T23:00:00.000Z
+ card-last-reviewed:: 2022-09-26T12:13:06.669Z
+ card-last-score:: 1
+ - The number of permutations of $k$ objects out of $n$, $P(n,k)$ is
+ - $$P(n,k) = n \times (n-1) \times ... \times (n - k + 1) = \frac{n!}{(n-k)!}$$
+ -
+ - ## The Binomial Coefficient Formula
+ - (1) We know that there are $P(n,k)$ permutations of $k$ objects out of $n$.
+ - (2) We know that
+ - $$P(n,k) = \frac{n!}{(n-k)!}$$
+ - (3) Another way of making a permutation of $k$ objects out of $n$ is to
+ - (a) Choose $k$ from $n$ without order. There $\binom{n}{k}$ ways of doing this.
+ - (b) Then count all the ways of ordering these $k$ objects. There are $k!$ ways of doing this.
+ - (c) By the Multiplicative Principle,
+ - $$P(n,k) = \binom{n}{k}k!$$
+ - (4) So now we know that
+ - $$\frac{n!}{(n-k)!} = \binom{n}{k}k!$$
+ - (5) This gives the formula
+ - $$\binom{n}{k} = \frac{n!}{(n-k)!k!}$$
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-09-30T10_01_42.250Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-09-30T10_01_42.250Z.Desktop.md
new file mode 100644
index 00000000..12c98208
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-09-30T10_01_42.250Z.Desktop.md
@@ -0,0 +1,156 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Principle of Inclusion-Exclusion]]
+- **Next Topic:** [[Combinatorial Proofs]]
+- **Relevant Slides:** 
+-
+- # Binary Strings & Lattice Paths
+ collapsed:: true
+ - ## Binary Strings
+ - A **bit** is a "binary digit", e.g., 1 or 0.
+ - A **bit string** is a string (list) of bits, e.g., 1011010.
+ - What is the **length** of a string? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-26T23:00:00.000Z
+ card-last-reviewed:: 2022-09-26T12:13:43.295Z
+ card-last-score:: 1
+ - The **length** of the string is the number of bits.
+ - An $n$-bit string has length $n$.
+ - The set of all $n$-bit strings (for given $n$) is denoted $B^n$.
+ - What is the **weight** of a string? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:12:45.309Z
+ card-last-reviewed:: 2022-09-26T12:12:45.310Z
+ card-last-score:: 5
+ - The **weight** of the string is the number of 1s.
+ - The set of all $n$-bit strings of weight $k$ is denoted $B^n_k$.
+ - ## Lattice Paths
+ - What is a **lattice**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:15:21.865Z
+ card-last-reviewed:: 2022-09-26T12:15:21.865Z
+ card-last-score:: 3
+ - The (integer) **lattice** is the set of all points in the Cartesian plane for which both the $x$ & $y$ coordinates are integers.
+ - What is a **lattice path**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-26T23:00:00.000Z
+ card-last-reviewed:: 2022-09-26T12:15:00.437Z
+ card-last-score:: 1
+ - A **lattice path** is the ^^shortest possible path^^ connecting two points on the lattice, moving only horizontally & vertically.
+ - There can be multiple lattice paths, so long as they are of equally short length.
+ - 
+ - The number of lattice paths from $(0,0)$ to $(3,2)$ is the same as $|B_3^5|$.
+ - The number of lattice paths from $(0,0)$ to $(3,2)$ is the same as the number from $(0,0)$ to $(2,2)$, plus the number from $(0,0)$ to $(3,1)$.
+-
+- # Binomial Coefficients
+ - What is the coefficient of say, $x^3y^2$ in $(x+y)^5$?
+ - $$(x+y)^0=1
+ \newline
+ (x+y)^1=x+y
+ \newline
+ (x+y)^2=x^2+2xy+y^2
+ \newline
+ (x+y)^3=x^3+3x^2y+3xy^2+y^3
+ \newline
+ (x+y)^4=x^4+4x^3y+6x^2y^2+4xy^3+y^4
+ \newline
+ (x+y)^5=x^5+5x^4y+10x^3y^2+10x^2y^3+5xy^4+y^5
+ $$
+ - So, by doing a lot of multiplication, we have worked out that the coefficient of $x^3y^2$ is $10$.
+ - But, there is a more systematic way of answering this problem.
+ -
+ - $$(x+y)^5=(x+y)(x+y)(x+y)(x+y)(x+y)$$
+ - We can work out the coefficient of $x^3y^2$ in the expansion of $(x+y)^5$ by counting the number of ways we can **choose** $3$ $x$s & $2$ $y$s in
+ - $$(x+y)(x+y)(x+y)(x+y)(x+y)$$
+ -
+ - The numbers that occurred in all of our examples are called **binomial coefficients**, and are denoted
+ - $$\binom{n}{k}$$
+ - What are **Binomial Coefficients**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:13:19.107Z
+ card-last-reviewed:: 2022-09-26T12:13:19.108Z
+ card-last-score:: 3
+ - For each integer $n \geq 0$, and integer $k$ such that $0 \leq k \leq n$, there is a number $\binom{n}{k}$, read as "$n$ *choose* $k$".
+ - $\binom{n}{k} = |B^n_k|$, the number of $n$-bit strings of weight $k$.
+ - $\binom{n}{k}$ is the number of subsets of a set of size $n$, each with cardinality $k$.
+ - $\binom{n}{k}$ is the number of lattice paths of length $n$ containing $k$ steps to the right.
+ - $\binom{n}{k}$ is the coefficient of $x^k y^{n-k}$ in the expansion of $(x+y)^n$.
+ - $\binom{n}{k}$ is the number of ways to select $k$ objects from a total of $n$ objects.
+ - If we were to skip ahead, we would learn that there is a formula for $\binom{n}{k}$ (that is, "$n$ choose $k$") that is expressed in terms of **factorials**.
+ - Recall that the **factorial** of a natural number $n$ is:
+ - $$n! = n \times (n-1) \times (n-2) \times (n-4) \times ... \times 2 \times 1$$
+ - We will eventually learn that
+ - $$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$
+ - However, the formula $\binom{n}{k} = \frac{n!}{k!(n-k)!}$ is not very useful in practice.
+ -
+-
+- # Pascal's Triangle
+ collapsed:: true
+ - 
+ - Earlier, we learned that if the set of all $n$-bit strings with weight $k$ is written $B^n_k$, then
+ - $$|b^n_k| = |B^{n-1}_{k-1}| + |B^{n-1}_k$$
+ - Similarly, we find that:
+ - #### Pascal's Identity: A recurrence relation for $\binom{n}{k}$ #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-26T23:00:00.000Z
+ card-last-reviewed:: 2022-09-26T12:14:13.327Z
+ card-last-score:: 1
+ - $$\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}$$
+ - This is often presented as **Pascal's Triangle**
+ - 
+ -
+-
+- # Permutations
+ - What is a **permutation**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:14:28.732Z
+ card-last-reviewed:: 2022-09-26T12:14:28.732Z
+ card-last-score:: 5
+ - A **permutation** is an arrangement of objects. Changing the order of the objects gives a different permutation.
+ - Important: order matters!
+ - ### Number of Permutations
+ - How many **permutations** are there of $n$ objects? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-22T23:00:00.000Z
+ card-last-reviewed:: 2022-09-22T20:27:24.238Z
+ card-last-score:: 1
+ - There are $n!$ (i.e., $n$ *factorial*) permutations of $n$ (distinct) objects.
+ - How many permutations are there of $k$ objects from $n$? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-26T23:00:00.000Z
+ card-last-reviewed:: 2022-09-26T12:13:06.669Z
+ card-last-score:: 1
+ - The number of permutations of $k$ objects out of $n$, $P(n,k)$ is
+ - $$P(n,k) = n \times (n-1) \times ... \times (n - k + 1) = \frac{n!}{(n-k)!}$$
+ -
+ - ## The Binomial Coefficient Formula
+ - (1) We know that there are $P(n,k)$ permutations of $k$ objects out of $n$.
+ - (2) We know that
+ - $$P(n,k) = \frac{n!}{(n-k)!}$$
+ - (3) Another way of making a permutation of $k$ objects out of $n$ is to
+ - (a) Choose $k$ from $n$ without order. There $\binom{n}{k}$ ways of doing this.
+ - (b) Then count all the ways of ordering these $k$ objects. There are $k!$ ways of doing this.
+ - (c) By the Multiplicative Principle,
+ - $$P(n,k) = \binom{n}{k}k!$$
+ - (4) So now we know that
+ - $$\frac{n!}{(n-k)!} = \binom{n}{k}k!$$
+ - (5) This gives the formula
+ - $$\binom{n}{k} = \frac{n!}{(n-k)!k!}$$
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-10-07T08_33_33.296Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-10-07T08_33_33.296Z.Desktop.md
new file mode 100644
index 00000000..901f3b75
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-10-07T08_33_33.296Z.Desktop.md
@@ -0,0 +1,154 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Principle of Inclusion-Exclusion]]
+- **Next Topic:** [[Combinatorial Proofs]]
+- **Relevant Slides:** 
+-
+- # Binary Strings & Lattice Paths
+ - ## Binary Strings
+ - A **bit** is a "binary digit", e.g., 1 or 0.
+ - A **bit string** is a string (list) of bits, e.g., 1011010.
+ - What is the **length** of a string? #card
+ card-last-interval:: 3.58
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-03T21:29:15.109Z
+ card-last-reviewed:: 2022-09-30T08:29:15.109Z
+ card-last-score:: 5
+ - The **length** of the string is the number of bits.
+ - An $n$-bit string has length $n$.
+ - The set of all $n$-bit strings (for given $n$) is denoted $B^n$.
+ - What is the **weight** of a string? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-08T12:11:29.792Z
+ card-last-reviewed:: 2022-10-04T12:11:29.793Z
+ card-last-score:: 5
+ - The **weight** of the string is the number of 1s.
+ - The set of all $n$-bit strings of weight $k$ is denoted $B^n_k$.
+ - ## Lattice Paths
+ - What is a **lattice**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-08T12:15:35.955Z
+ card-last-reviewed:: 2022-10-04T12:15:35.956Z
+ card-last-score:: 3
+ - The (integer) **lattice** is the set of all points in the Cartesian plane for which both the $x$ & $y$ coordinates are integers.
+ - What is a **lattice path**? #card
+ card-last-interval:: 4.43
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T00:33:48.083Z
+ card-last-reviewed:: 2022-10-03T14:33:48.083Z
+ card-last-score:: 5
+ - A **lattice path** is the ^^shortest possible path^^ connecting two points on the lattice, moving only horizontally & vertically.
+ - There can be multiple lattice paths, so long as they are of equally short length.
+ - 
+ - The number of lattice paths from $(0,0)$ to $(3,2)$ is the same as $|B_3^5|$.
+ - The number of lattice paths from $(0,0)$ to $(3,2)$ is the same as the number from $(0,0)$ to $(2,2)$, plus the number from $(0,0)$ to $(3,1)$.
+-
+- # Binomial Coefficients
+ - What is the coefficient of say, $x^3y^2$ in $(x+y)^5$?
+ - $$(x+y)^0=1
+ \newline
+ (x+y)^1=x+y
+ \newline
+ (x+y)^2=x^2+2xy+y^2
+ \newline
+ (x+y)^3=x^3+3x^2y+3xy^2+y^3
+ \newline
+ (x+y)^4=x^4+4x^3y+6x^2y^2+4xy^3+y^4
+ \newline
+ (x+y)^5=x^5+5x^4y+10x^3y^2+10x^2y^3+5xy^4+y^5
+ $$
+ - So, by doing a lot of multiplication, we have worked out that the coefficient of $x^3y^2$ is $10$.
+ - But, there is a more systematic way of answering this problem.
+ -
+ - $$(x+y)^5=(x+y)(x+y)(x+y)(x+y)(x+y)$$
+ - We can work out the coefficient of $x^3y^2$ in the expansion of $(x+y)^5$ by counting the number of ways we can **choose** $3$ $x$s & $2$ $y$s in
+ - $$(x+y)(x+y)(x+y)(x+y)(x+y)$$
+ -
+ - The numbers that occurred in all of our examples are called **binomial coefficients**, and are denoted
+ - $$\binom{n}{k}$$
+ - What are **Binomial Coefficients**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:13:14.754Z
+ card-last-score:: 1
+ - For each integer $n \geq 0$, and integer $k$ such that $0 \leq k \leq n$, there is a number $\binom{n}{k}$, read as "$n$ *choose* $k$".
+ - $\binom{n}{k} = |B^n_k|$, the number of $n$-bit strings of weight $k$.
+ - $\binom{n}{k}$ is the number of subsets of a set of size $n$, each with cardinality $k$.
+ - $\binom{n}{k}$ is the number of lattice paths of length $n$ containing $k$ steps to the right.
+ - $\binom{n}{k}$ is the coefficient of $x^k y^{n-k}$ in the expansion of $(x+y)^n$.
+ - $\binom{n}{k}$ is the number of ways to select $k$ objects from a total of $n$ objects.
+ - If we were to skip ahead, we would learn that there is a formula for $\binom{n}{k}$ (that is, "$n$ choose $k$") that is expressed in terms of **factorials**.
+ - Recall that the **factorial** of a natural number $n$ is:
+ - $$n! = n \times (n-1) \times (n-2) \times (n-4) \times ... \times 2 \times 1$$
+ - We will eventually learn that
+ - $$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$
+ - However, the formula $\binom{n}{k} = \frac{n!}{k!(n-k)!}$ is not very useful in practice.
+ -
+-
+- # Pascal's Triangle
+ - 
+ - Earlier, we learned that if the set of all $n$-bit strings with weight $k$ is written $B^n_k$, then
+ - $$|b^n_k| = |B^{n-1}_{k-1}| + |B^{n-1}_k$$
+ - Similarly, we find that:
+ - #### Pascal's Identity: A recurrence relation for $\binom{n}{k}$ #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:33:47.256Z
+ card-last-score:: 1
+ - $$\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}$$
+ - This is often presented as **Pascal's Triangle**
+ - 
+ -
+-
+- # Permutations
+ - What is a **permutation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-08T12:14:42.530Z
+ card-last-reviewed:: 2022-10-04T12:14:42.530Z
+ card-last-score:: 5
+ - A **permutation** is an arrangement of objects. Changing the order of the objects gives a different permutation.
+ - A permutation of a set must have the same cardinality as that set.
+ - Important: order matters!
+ - ### Number of Permutations
+ - How many **permutations** are there of $n$ objects? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T11:41:35.217Z
+ card-last-score:: 1
+ - There are $n!$ (i.e., $n$ *factorial*) permutations of $n$ (distinct) objects.
+ - How many permutations are there of $k$ objects from $n$? #card
+ card-last-interval:: 4.43
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T00:33:41.297Z
+ card-last-reviewed:: 2022-10-03T14:33:41.298Z
+ card-last-score:: 5
+ - The number of permutations of $k$ objects out of $n$, $P(n,k)$ is
+ - $$P(n,k) = \binom{n}{k} = n \times (n-1) \times ... \times (n - k + 1) = \frac{n!}{(n-k)!}$$
+ - ## The Binomial Coefficient Formula
+ - (1) We know that there are $P(n,k)$ permutations of $k$ objects out of $n$.
+ - (2) We know that
+ - $$P(n,k) = \frac{n!}{(n-k)!}$$
+ - (3) Another way of making a permutation of $k$ objects out of $n$ is to
+ - (a) Choose $k$ from $n$ without order. There $\binom{n}{k}$ ways of doing this.
+ - (b) Then count all the ways of ordering these $k$ objects. There are $k!$ ways of doing this.
+ - (c) By the Multiplicative Principle,
+ - $$P(n,k) = \binom{n}{k}k!$$
+ - (4) So now we know that
+ - $$\frac{n!}{(n-k)!} = \binom{n}{k}k!$$
+ - (5) This gives the formula
+ - $$\binom{n}{k} = \frac{n!}{(n-k)!k!}$$
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-10-20T09_05_57.923Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-10-20T09_05_57.923Z.Desktop.md
new file mode 100644
index 00000000..5bfe7665
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Binomial Coefficients/2022-10-20T09_05_57.923Z.Desktop.md
@@ -0,0 +1,154 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Principle of Inclusion-Exclusion]]
+- **Next Topic:** [[Combinatorial Proofs]]
+- **Relevant Slides:** 
+-
+- # Binary Strings & Lattice Paths
+ - ## Binary Strings
+ - A **bit** is a "binary digit", e.g., 1 or 0.
+ - A **bit string** is a string (list) of bits, e.g., 1011010.
+ - What is the **length** of a string? #card
+ card-last-interval:: 11.55
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-18T06:19:03.162Z
+ card-last-reviewed:: 2022-10-06T17:19:03.163Z
+ card-last-score:: 5
+ - The **length** of the string is the number of bits.
+ - An $n$-bit string has length $n$.
+ - The set of all $n$-bit strings (for given $n$) is denoted $B^n$.
+ - What is the **weight** of a string? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-20T02:52:44.155Z
+ card-last-reviewed:: 2022-10-08T22:52:44.155Z
+ card-last-score:: 5
+ - The **weight** of the string is the number of 1s.
+ - The set of all $n$-bit strings of weight $k$ is denoted $B^n_k$.
+ - ## Lattice Paths
+ - What is a **lattice**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T04:54:49.128Z
+ card-last-reviewed:: 2022-10-08T22:54:49.129Z
+ card-last-score:: 5
+ - The (integer) **lattice** is the set of all points in the Cartesian plane for which both the $x$ & $y$ coordinates are integers.
+ - What is a **lattice path**? #card
+ card-last-interval:: 14.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-23T02:49:59.194Z
+ card-last-reviewed:: 2022-10-08T22:49:59.194Z
+ card-last-score:: 5
+ - A **lattice path** is the ^^shortest possible path^^ connecting two points on the lattice, moving only horizontally & vertically.
+ - There can be multiple lattice paths, so long as they are of equally short length.
+ - 
+ - The number of lattice paths from $(0,0)$ to $(3,2)$ is the same as $|B_3^5|$.
+ - The number of lattice paths from $(0,0)$ to $(3,2)$ is the same as the number from $(0,0)$ to $(2,2)$, plus the number from $(0,0)$ to $(3,1)$.
+-
+- # Binomial Coefficients
+ - What is the coefficient of say, $x^3y^2$ in $(x+y)^5$?
+ - $$(x+y)^0=1
+ \newline
+ (x+y)^1=x+y
+ \newline
+ (x+y)^2=x^2+2xy+y^2
+ \newline
+ (x+y)^3=x^3+3x^2y+3xy^2+y^3
+ \newline
+ (x+y)^4=x^4+4x^3y+6x^2y^2+4xy^3+y^4
+ \newline
+ (x+y)^5=x^5+5x^4y+10x^3y^2+10x^2y^3+5xy^4+y^5
+ $$
+ - So, by doing a lot of multiplication, we have worked out that the coefficient of $x^3y^2$ is $10$.
+ - But, there is a more systematic way of answering this problem.
+ -
+ - $$(x+y)^5=(x+y)(x+y)(x+y)(x+y)(x+y)$$
+ - We can work out the coefficient of $x^3y^2$ in the expansion of $(x+y)^5$ by counting the number of ways we can **choose** $3$ $x$s & $2$ $y$s in
+ - $$(x+y)(x+y)(x+y)(x+y)(x+y)$$
+ -
+ - The numbers that occurred in all of our examples are called **binomial coefficients**, and are denoted
+ - $$\binom{n}{k}$$
+ - What are **Binomial Coefficients**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-12T08:41:44.758Z
+ card-last-reviewed:: 2022-10-08T22:41:44.758Z
+ card-last-score:: 5
+ - For each integer $n \geq 0$, and integer $k$ such that $0 \leq k \leq n$, there is a number $\binom{n}{k}$, read as "$n$ *choose* $k$".
+ - $\binom{n}{k} = |B^n_k|$, the number of $n$-bit strings of weight $k$.
+ - $\binom{n}{k}$ is the number of subsets of a set of size $n$, each with cardinality $k$.
+ - $\binom{n}{k}$ is the number of lattice paths of length $n$ containing $k$ steps to the right.
+ - $\binom{n}{k}$ is the coefficient of $x^k y^{n-k}$ in the expansion of $(x+y)^n$.
+ - $\binom{n}{k}$ is the number of ways to select $k$ objects from a total of $n$ objects.
+ - If we were to skip ahead, we would learn that there is a formula for $\binom{n}{k}$ (that is, "$n$ choose $k$") that is expressed in terms of **factorials**.
+ - Recall that the **factorial** of a natural number $n$ is:
+ - $$n! = n \times (n-1) \times (n-2) \times (n-4) \times ... \times 2 \times 1$$
+ - We will eventually learn that
+ - $$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$
+ - However, the formula $\displaystyle \binom{n}{k} = \frac{n!}{k!(n-k)!}$ is not very useful in practice.
+ -
+-
+- # Pascal's Triangle
+ - 
+ - Earlier, we learned that if the set of all $n$-bit strings with weight $k$ is written $B^n_k$, then
+ - $$|b^n_k| = |B^{n-1}_{k-1}| + |B^{n-1}_k$$
+ - Similarly, we find that:
+ - #### Pascal's Identity: A recurrence relation for $\binom{n}{k}$ #card
+ card-last-interval:: 11.56
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-18T23:22:56.816Z
+ card-last-reviewed:: 2022-10-07T10:22:56.817Z
+ card-last-score:: 5
+ - $$\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}$$
+ - This is often presented as **Pascal's Triangle**
+ - 
+ -
+-
+- # Permutations
+ - What is a **permutation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-20T02:53:38.455Z
+ card-last-reviewed:: 2022-10-08T22:53:38.455Z
+ card-last-score:: 5
+ - A **permutation** is an arrangement of objects. Changing the order of the objects gives a different permutation.
+ - A permutation of a set must have the same cardinality as that set.
+ - Important: order matters!
+ - ### Number of Permutations
+ - How many **permutations** are there of $n$ objects? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T17:14:28.391Z
+ card-last-reviewed:: 2022-10-06T17:14:28.392Z
+ card-last-score:: 5
+ - There are $n!$ (i.e., $n$ *factorial*) permutations of $n$ (distinct) objects.
+ - How many permutations are there of $k$ objects from $n$? #card
+ card-last-interval:: 14.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-23T02:49:51.823Z
+ card-last-reviewed:: 2022-10-08T22:49:51.823Z
+ card-last-score:: 5
+ - The number of permutations of $k$ objects out of $n$, $P(n,k)$ is
+ - $$P(n,k) = \binom{n}{k} = n \times (n-1) \times ... \times (n - k + 1) = \frac{n!}{(n-k)!}$$
+ - ## The Binomial Coefficient Formula
+ - (1) We know that there are $P(n,k)$ permutations of $k$ objects out of $n$.
+ - (2) We know that
+ - $$P(n,k) = \frac{n!}{(n-k)!}$$
+ - (3) Another way of making a permutation of $k$ objects out of $n$ is to
+ - (a) Choose $k$ from $n$ without order. There $\binom{n}{k}$ ways of doing this.
+ - (b) Then count all the ways of ordering these $k$ objects. There are $k!$ ways of doing this.
+ - (c) By the Multiplicative Principle,
+ - $$P(n,k) = \binom{n}{k}k!$$
+ - (4) So now we know that
+ - $$\frac{n!}{(n-k)!} = \binom{n}{k}k!$$
+ - (5) This gives the formula
+ - $$\binom{n}{k} = \frac{n!}{(n-k)!k!}$$
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-07T08_33_33.306Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-07T08_33_33.306Z.Desktop.md
new file mode 100644
index 00000000..427e92d7
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-07T08_33_33.306Z.Desktop.md
@@ -0,0 +1,136 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Process Management]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Scheduling
+ - What is **scheduling**? #card
+ - **Scheduling** allows one process to use the CPU while the execution of another process is on hold (i.e., in the waiting state) due to unavailability of any resource like I/O etc.
+ - It aims to make the system efficient, fast, & fair.
+ - It is part of the **process manager**.
+ - Scheduling is the mechanism that handles the ^^**removal** of the running processes from the CPU and the **selection** of another process.^^
+ - It is responsible for **multiplexing** processes in the CPU.
+ - When it is time for the **running** process to be removed from the CPU (into a *ready* or *suspended* state), a different process is selected from the set of processes in the ready state.
+ - The selection of another process is based on a particular strategy - the **scheduling algorithm** will determine the order in which the OS will execute the processes.
+ -
+ - ## Scheduler Organisation #card
+ - When a process is changed to the *ready* state. the **enqueuer** places a pointer to the process descriptor into a **ready list**.
+ - Whenever the scheduler switches the CPU from executing one process to another, the **context switcher** saves the contents of all the processor registers of the process being removed into the **process' descriptor**.
+ - There are two types of context switch: **Voluntary** & **Involuntary**.
+ - The **dispatcher** is invoked after the current process has been from the CPU.
+ - The dispatcher chooses one of the processes enqueued in the ready list and then allocates CPU to that process by performing another context switch from *itself* to the selected process.
+ - 
+ - ## Scheduler Types
+ - What are the two main types of scheduler? #card
+ - **Cooperative** Scheduler (Voluntary CPU Sharing).
+ - **Preemptive** Scheduler (Involuntary CPU Sharing).
+ - ### Cooperative Scheduler (Voluntary CPU Sharing) #card
+ - Each process will **periodically invoke** the process scheduler, voluntarily sharing the CPU.
+ - Each process should call a function that will implement the process scheduling.
+ - yield(P_{current}, P_{next}) (sometimes implemented as instruction in hardware), where P_{current} is an identifier of the current process and P_{next} is an identifier of the next process.
+ - Cooperative multitasking allows much simpler implementation of applications, because their ^^execution is never unexpectedly interrupted by the process scheduler.^^
+ - Possible problem: If the process does not voluntarily cooperate with the others, one process could keep the CPU forever.
+ - ### Preemptive Scheduler (Involuntary CPU Sharing) #card
+ - The interrupt system **enforces periodic involuntary interruption** of any process's execution; it can force a process to involuntarily execute a yield type function (or instruction).
+ - This is done by incorporating an **interval timer** device that produces an interrupt whenever the time expires.
+ - The programmable interval timer will cause an **interrupt** to run every $K$ clock ticks of a time interval, thus causing the hardware to execute the logical equivalent of a yield instruction to invoke the **interruption handler**.
+ - The **interrupt handler** for the timer interrupt will call the scheduler to reschedule the processor **without** any action on the part of the running process.
+ - The scheduler decides which process is run next.
+ - The scheduler is guaranteed to be invoked once every $K$ clock ticks.
+ - Even if a certain process executes in an infinite loop, it will **not** block the execution of the other processes.
+ -
+ - ## Performance Elements
+ - Having a set of processes $P = \{p_i, 0 \leq i \leq n\}$.
+ - **Service Time -** $\tau(p_i)$: The amount of time that a process needs to spend in the active/running state before it completes.
+ - **Wait Time -** $W(p_i)$: The time that the process spends waiting in the ready state before its first transition to the active state.
+ - **Turn-around Time -** $T_{TRnd}(p_i)$: The amount of time between the moment that a process enters the ready state and the moment that the process exits the running state for the last time.
+ - These elements are used to measure the performance of each scheduling algorithm.
+ -
+ - ## Selection Strategies #card
+ - ### Non-Preemptive Strategies #card
+ - Allow any process to run to completion once it has been allocated control of the CPU.
+ - A process that gets the control of the CPU releases the CPU whenever it ends or when it voluntarily gives up control of the CPU.
+ - ### Preemptive Strategies #card
+ - The process with the highest priority among all the *ready* process is allocated the CPU.
+ - All lower priority processes are made to yield to the highest priority process whenever it requests the CPU.
+ - The scheduler is called every time a process enters the *ready* queue as well as when an interval timer expires.
+ - Preemptive strategies allow for equitable resource sharing among processes, at the expense of overloading the system.
+ -
+ - ## Scheduling Algorithms
+ - ### First Come, First Served (FCFS) #card
+ - **Non-preemptive** algorithm.
+ - This scheduling strategy assigns priority to processes by the order in which they request the processor.
+ - The priority of a process is computed by the enqueuer by **time stamping** all incoming processes and then having the dispatcher select the process that has the ^^oidest time stamp.^^
+ - Possible implementation: Using a FIFO data structure (where each entry points to a process descriptor). The enqueuer adds processes to the tail of the queue and the dispatcher removes processes from the head of the queue.
+ - Easy to implement.
+ - Not widely used because of ^^unpredictable **turn-around time** & **waiting time**.^^
+ - ### Shortest Job First (SJF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-06T23:00:00.000Z
+ card-last-reviewed:: 2022-10-06T09:46:22.373Z
+ card-last-score:: 1
+ - **Non-preemptive** algorithm.
+ - SJF is an optimal algorithm from the perspective of **average turn-around time** - it minimises the average turn-around time.
+ - Preferential service of small jobs.
+ - Requires the ^^knowledge of the **service time**^^ for each process.
+ - In extreme cases where the system has little idle time, processes with large service time will never be served.
+ - In the case where it is not possible to know the service time for each process, the service time is estimated using predictors.
+ - ### Shortest Remaining Time Next (SRTN) #card
+ - Similar to SJF, but **preemptive**.
+ - If a long job is mostly complete, it might have a very short time remaining, and therefore would be prioritised.
+ - ### Time Slice (Round Robin) #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T09:39:03.608Z
+ card-last-reviewed:: 2022-10-06T09:39:03.608Z
+ card-last-score:: 3
+ - **Preemptive** algorithm.
+ - Each process gets a time slice of CPU time, distributing the processing time equitably among all processes that are requesting the processor.
+ - Whenever the time slice expires, control of the CPU is given to the next process in the ready list, and the process being switched from is placed back into the ready process list.
+ - Time Slice implies the existence of a **specialised timer** that measures the processor time for each process.
+ - Every time a process becomes active, the timer is intitialised.
+ - Not very well suited for long jobs, as the scheduler will be called multiple times until the job is done.
+ - Very sensitive to the size of the time slice.
+ - Too big -> large delays in the response time for interactive processes.
+ - Too small -> too much time spent running the scheduler.
+ - Very big -> turns into FCFS.
+ - The time slice is determined by analysing the number of instructions that the processor can execute in a given time slice.
+ -
+ - ### Priority-Based Preemptive Scheduling (Event Driven) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-06T23:00:00.000Z
+ card-last-reviewed:: 2022-10-06T09:43:34.034Z
+ card-last-score:: 1
+ - Both **preemptive** & **non-preemptive** variants exist.
+ - Each process has an ^^externally assigned priority.^^
+ - Every time an event occurs that generates a process switch, the ^^process with the highest priority^^ is chosen from the ready process list.
+ - There is a possibility that processes with low priority will never gain CPU time.
+ - There are variants with **static** & **dynamic** priorities.
+ - The **dynamic priority** computation solves the problem that some processes may never gain CPU time - the longer a process waits, the higher its priority becomes.
+ - Used for real-time systems.
+ - ### Multiple Level Queue Scheduling #card
+ card-last-interval:: 3.57
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-09T22:43:53.128Z
+ card-last-reviewed:: 2022-10-06T09:43:53.128Z
+ card-last-score:: 5
+ - Complex systems have requirements for real-time, interactive users and batch jobs - Therefore, a **combined scheduling mechanism** should be used.
+ - The processes are divided into **classes**.
+ - Each class has a process queue, and has been assigned a specific scheduling algorithm.
+ - Each process queue is treated according to its queue scheduling algorithm.
+ - Each queue is assigned a priority.
+ - As long as there are processes in a higher priority queue, those will be serviced.
+ - #### Multiple Level Queue (with Feedback) #card
+ - Same as MLQ, but the ^^processes can migrate from class to class^^ in a dynamic fashion.
+ - Different strategies to modify the priority.
+ - Increase the priority for a given process. (E.g., the user needs a larger share of the CPU to sustain acceptable service).
+ - Decrease the priority for a given process. (E.g., the user process is trying to get more CPU share, which may impact on the other users).
+ - If a process is giving up the CPU before its time slice expires, then the process is assigned to a higher priority queue.
+ - During the evolution to completion, a process may go through a number of different classes.
+ - Any of the previous algorithms covered may be used for treating a specific process class.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-10T11_59_52.372Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-10T11_59_52.372Z.Desktop.md
new file mode 100644
index 00000000..aebda3dd
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-10T11_59_52.372Z.Desktop.md
@@ -0,0 +1,203 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Process Management]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Scheduling
+ - What is **scheduling**? #card
+ card-last-interval:: 0.91
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T19:43:11.047Z
+ card-last-reviewed:: 2022-10-08T22:43:11.048Z
+ card-last-score:: 3
+ - **Scheduling** allows one process to use the CPU while the execution of another process is on hold (i.e., in the waiting state) due to unavailability of any resource like I/O etc.
+ - It aims to make the system efficient, fast, & fair.
+ - It is part of the **process manager**.
+ - Scheduling is the mechanism that handles the ^^**removal** of the running processes from the CPU and the **selection** of another process.^^
+ - It is responsible for **multiplexing** processes in the CPU.
+ - When it is time for the **running** process to be removed from the CPU (into a *ready* or *suspended* state), a different process is selected from the set of processes in the ready state.
+ - The selection of another process is based on a particular strategy - the **scheduling algorithm** will determine the order in which the OS will execute the processes.
+ -
+ - ## Scheduler Organisation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:09:47.382Z
+ card-last-score:: 1
+ - When a process is changed to the *ready* state. the **enqueuer** places a pointer to the process descriptor into a **ready list**.
+ - Whenever the scheduler switches the CPU from executing one process to another, the **context switcher** saves the contents of all the processor registers of the process being removed into the **process' descriptor**.
+ - There are two types of context switch: **Voluntary** & **Involuntary**.
+ - The **dispatcher** is invoked after the current process has been from the CPU.
+ - The dispatcher chooses one of the processes enqueued in the ready list and then allocates CPU to that process by performing another context switch from *itself* to the selected process.
+ - 
+ - ## Scheduler Types
+ collapsed:: true
+ - What are the two main types of scheduler? #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T17:41:55.585Z
+ card-last-reviewed:: 2022-10-08T22:41:55.587Z
+ card-last-score:: 5
+ - **Cooperative** Scheduler (Voluntary CPU Sharing).
+ - **Preemptive** Scheduler (Involuntary CPU Sharing).
+ - ### Cooperative Scheduler (Voluntary CPU Sharing) #card
+ card-last-interval:: 3.71
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T10:14:20.540Z
+ card-last-reviewed:: 2022-10-06T17:14:20.542Z
+ card-last-score:: 3
+ - Each process will **periodically invoke** the process scheduler, voluntarily sharing the CPU.
+ - Each process should call a function that will implement the process scheduling.
+ - $\text{yield}(P_{current}, P_{next})$ (sometimes implemented as instruction in hardware), where $P_{current}$ is an identifier of the current process and $P_{next}$ is an identifier of the next process.
+ - Cooperative multitasking allows much simpler implementation of applications, because their ^^execution is never unexpectedly interrupted by the process scheduler.^^
+ - Possible problem: If the process does not voluntarily cooperate with the others, one process could keep the CPU forever.
+ - ### Preemptive Scheduler (Involuntary CPU Sharing) #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-17T19:51:16.969Z
+ card-last-reviewed:: 2022-10-08T22:51:16.969Z
+ card-last-score:: 3
+ - The interrupt system **enforces periodic involuntary interruption** of any process's execution; it can force a process to involuntarily execute a yield type function (or instruction).
+ - This is done by incorporating an **interval timer** device that produces an interrupt whenever the time expires.
+ - The programmable interval timer will cause an **interrupt** to run every $K$ clock ticks of a time interval, thus causing the hardware to execute the logical equivalent of a yield instruction to invoke the **interruption handler**.
+ - The **interrupt handler** for the timer interrupt will call the scheduler to reschedule the processor **without** any action on the part of the running process.
+ - The scheduler decides which process is run next.
+ - The scheduler is guaranteed to be invoked once every $K$ clock ticks.
+ - Even if a certain process executes in an infinite loop, it will **not** block the execution of the other processes.
+ -
+ - ## Performance Elements
+ - Having a set of processes $P = \{p_i, 0 \leq i \leq n\}$.
+ - **Service Time -** $\tau(p_i)$: The amount of time that a process needs to spend in the active/running state before it completes.
+ - **Wait Time -** $W(p_i)$: The time that the process spends waiting in the ready state before its first transition to the active state.
+ - **Turn-around Time -** $T_{TRnd}(p_i)$: The amount of time between the moment that a process enters the ready state and the moment that the process exits the running state for the last time.
+ - These elements are used to measure the performance of each scheduling algorithm.
+ -
+ - ## Selection Strategies #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:16:52.341Z
+ card-last-score:: 1
+ - ### Non-Preemptive Strategies #card
+ card-last-interval:: 3.09
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-09T19:27:02.886Z
+ card-last-reviewed:: 2022-10-06T17:27:02.886Z
+ card-last-score:: 5
+ - Allow any process to run to completion once it has been allocated control of the CPU.
+ - A process that gets the control of the CPU releases the CPU whenever it ends or when it voluntarily gives up control of the CPU.
+ - ### Preemptive Strategies #card
+ card-last-interval:: 3.1
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T12:22:34.748Z
+ card-last-reviewed:: 2022-10-07T10:22:34.748Z
+ card-last-score:: 3
+ - The process with the highest priority among all the *ready* process is allocated the CPU.
+ - All lower priority processes are made to yield to the highest priority process whenever it requests the CPU.
+ - The **scheduler** is called every time a process enters the *ready* queue as well as when an interval timer expires.
+ - Preemptive strategies allow for equitable resource sharing among processes, at the expense of overloading the system.
+ -
+ - ## Scheduling Algorithms
+ - ### First Come, First Served (FCFS) #card
+ card-last-interval:: 2.14
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T13:31:14.568Z
+ card-last-reviewed:: 2022-10-07T10:31:14.569Z
+ card-last-score:: 3
+ - **Non-preemptive** algorithm.
+ - This scheduling strategy assigns priority to processes by the order in which they request the processor.
+ - The priority of a process is computed by the enqueuer by **time stamping** all incoming processes and then having the dispatcher select the process that has the ^^oidest time stamp.^^
+ - Possible implementation: Using a FIFO data structure (where each entry points to a process descriptor). The enqueuer adds processes to the tail of the queue and the dispatcher removes processes from the head of the queue.
+ - Easy to implement.
+ - Not widely used because of ^^unpredictable **turn-around time** & **waiting time**.^^
+ - ### Shortest Job First (SJF) #card
+ card-last-interval:: 2.77
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T04:23:33.101Z
+ card-last-reviewed:: 2022-10-07T10:23:33.101Z
+ card-last-score:: 3
+ - **Non-preemptive** algorithm.
+ - SJF is an optimal algorithm from the perspective of **average turn-around time** - it minimises the average turn-around time.
+ - Preferential service of small jobs.
+ - Requires the ^^knowledge of the **service time**^^ for each process.
+ - In extreme cases where the system has little idle time, processes with large service time will never be served.
+ - In the case where it is not possible to know the service time for each process, the service time is estimated using predictors.
+ - ### Shortest Remaining Time Next (SRTN) #card
+ card-last-interval:: 3.45
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:22:34.266Z
+ card-last-reviewed:: 2022-10-06T17:22:34.267Z
+ card-last-score:: 5
+ - Similar to SJF, but **preemptive**.
+ - If a long job is mostly complete, it might have a very short time remaining, and therefore would be prioritised.
+ - ### Time Slice (Round Robin) #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T09:39:03.608Z
+ card-last-reviewed:: 2022-10-06T09:39:03.608Z
+ card-last-score:: 3
+ - **Preemptive** algorithm.
+ - Each process gets a time slice of CPU time, distributing the processing time equitably among all processes that are requesting the processor.
+ - Whenever the time slice expires, control of the CPU is given to the next process in the ready list, and the process being switched from is placed back into the ready process list.
+ - Time Slice implies the existence of a **specialised timer** that measures the processor time for each process.
+ - Every time a process becomes active, the timer is intitialised.
+ - Not very well suited for long jobs, as the scheduler will be called multiple times until the job is done.
+ - Very sensitive to the size of the time slice.
+ - Too big -> large delays in the response time for interactive processes.
+ - Too small -> too much time spent running the scheduler.
+ - Very big -> turns into FCFS.
+ - The time slice is determined by analysing the number of instructions that the processor can execute in a given time slice.
+ -
+ - ### Priority-Based Preemptive Scheduling (Event Driven) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:19:24.014Z
+ card-last-score:: 1
+ - Both **preemptive** & **non-preemptive** variants exist.
+ - Each process has an ^^externally assigned priority.^^
+ - Every time an event occurs that generates a process switch, the ^^process with the highest priority^^ is chosen from the ready process list.
+ - There is a possibility that processes with low priority will never gain CPU time.
+ - There are variants with **static** & **dynamic** priorities.
+ - The **dynamic priority** computation solves the problem that some processes may never gain CPU time - the longer a process waits, the higher its priority becomes.
+ - Used for real-time systems.
+ - ### Multiple Level Queue Scheduling #card
+ card-last-interval:: 3.57
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-09T22:43:53.128Z
+ card-last-reviewed:: 2022-10-06T09:43:53.128Z
+ card-last-score:: 5
+ - Complex systems have requirements for real-time, interactive users and batch jobs - Therefore, a **combined scheduling mechanism** should be used.
+ - The processes are divided into **classes**.
+ - Each class has a process queue, and has been assigned a specific scheduling algorithm.
+ - Each process queue is treated according to its queue scheduling algorithm.
+ - Each queue is assigned a priority.
+ - As long as there are processes in a higher priority queue, those will be serviced.
+ - #### Multiple Level Queue (with Feedback) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:32:43.331Z
+ card-last-score:: 1
+ - Same as MLQ, but the ^^processes can migrate from class to class^^ in a dynamic fashion.
+ - Different strategies exist to modify the priority of a process.
+ - Increase the priority for a given process. (E.g., the user needs a larger share of the CPU to sustain acceptable service).
+ - Decrease the priority for a given process. (E.g., the user process is trying to get more CPU share, which may impact on the other users).
+ - If a process is giving up the CPU before its time slice expires, then the process is assigned to a higher priority queue.
+ - During the evolution to completion, a process may go through a number of different classes.
+ - Any of the previous algorithms covered may be used for treating a specific process class.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-10T14_02_24.335Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-10T14_02_24.335Z.Desktop.md
new file mode 100644
index 00000000..d5a6af76
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-10T14_02_24.335Z.Desktop.md
@@ -0,0 +1,203 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Process Management]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Scheduling
+ - What is **scheduling**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-19T08:45:36.066Z
+ card-last-reviewed:: 2022-10-10T11:45:36.066Z
+ card-last-score:: 3
+ - **Scheduling** allows one process to use the CPU while the execution of another process is on hold (i.e., in the waiting state) due to unavailability of any resource like I/O etc.
+ - It aims to make the system efficient, fast, & fair.
+ - It is part of the **process manager**.
+ - Scheduling is the mechanism that handles the ^^**removal** of the running processes from the CPU and the **selection** of another process.^^
+ - It is responsible for **multiplexing** processes in the CPU.
+ - When it is time for the **running** process to be removed from the CPU (into a *ready* or *suspended* state), a different process is selected from the set of processes in the ready state.
+ - The selection of another process is based on a particular strategy - the **scheduling algorithm** will determine the order in which the OS will execute the processes.
+ -
+ - ## Scheduler Organisation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:34:18.238Z
+ card-last-score:: 1
+ - When a process is changed to the *ready* state. the **enqueuer** places a pointer to the process descriptor into a **ready list**.
+ - Whenever the scheduler switches the CPU from executing one process to another, the **context switcher** saves the contents of all the processor registers of the process being removed into the **process' descriptor**.
+ - There are two types of context switch: **Voluntary** & **Involuntary**.
+ - The **dispatcher** is invoked after the current process has been from the CPU.
+ - The dispatcher chooses one of the processes enqueued in the ready list and then allocates CPU to that process by performing another context switch from *itself* to the selected process.
+ - 
+ - ## Scheduler Types
+ collapsed:: true
+ - What are the two main types of scheduler? #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T17:41:55.585Z
+ card-last-reviewed:: 2022-10-08T22:41:55.587Z
+ card-last-score:: 5
+ - **Cooperative** Scheduler (Voluntary CPU Sharing).
+ - **Preemptive** Scheduler (Involuntary CPU Sharing).
+ - ### Cooperative Scheduler (Voluntary CPU Sharing) #card
+ card-last-interval:: 3.71
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T10:14:20.540Z
+ card-last-reviewed:: 2022-10-06T17:14:20.542Z
+ card-last-score:: 3
+ - Each process will **periodically invoke** the process scheduler, voluntarily sharing the CPU.
+ - Each process should call a function that will implement the process scheduling.
+ - $\text{yield}(P_{current}, P_{next})$ (sometimes implemented as instruction in hardware), where $P_{current}$ is an identifier of the current process and $P_{next}$ is an identifier of the next process.
+ - Cooperative multitasking allows much simpler implementation of applications, because their ^^execution is never unexpectedly interrupted by the process scheduler.^^
+ - Possible problem: If the process does not voluntarily cooperate with the others, one process could keep the CPU forever.
+ - ### Preemptive Scheduler (Involuntary CPU Sharing) #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-17T19:51:16.969Z
+ card-last-reviewed:: 2022-10-08T22:51:16.969Z
+ card-last-score:: 3
+ - The interrupt system **enforces periodic involuntary interruption** of any process's execution; it can force a process to involuntarily execute a yield type function (or instruction).
+ - This is done by incorporating an **interval timer** device that produces an interrupt whenever the time expires.
+ - The programmable interval timer will cause an **interrupt** to run every $K$ clock ticks of a time interval, thus causing the hardware to execute the logical equivalent of a yield instruction to invoke the **interruption handler**.
+ - The **interrupt handler** for the timer interrupt will call the scheduler to reschedule the processor **without** any action on the part of the running process.
+ - The scheduler decides which process is run next.
+ - The scheduler is guaranteed to be invoked once every $K$ clock ticks.
+ - Even if a certain process executes in an infinite loop, it will **not** block the execution of the other processes.
+ -
+ - ## Performance Elements
+ - Having a set of processes $P = \{p_i, 0 \leq i \leq n\}$.
+ - **Service Time -** $\tau(p_i)$: The amount of time that a process needs to spend in the active/running state before it completes.
+ - **Wait Time -** $W(p_i)$: The time that the process spends waiting in the ready state before its first transition to the active state.
+ - **Turn-around Time -** $T_{TRnd}(p_i)$: The amount of time between the moment that a process enters the ready state and the moment that the process exits the running state for the last time.
+ - These elements are used to measure the performance of each scheduling algorithm.
+ -
+ - ## Selection Strategies #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:34:49.280Z
+ card-last-score:: 1
+ - ### Non-Preemptive Strategies #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-14T11:45:13.446Z
+ card-last-reviewed:: 2022-10-10T11:45:13.446Z
+ card-last-score:: 5
+ - Allow any process to run to completion once it has been allocated control of the CPU.
+ - A process that gets the control of the CPU releases the CPU whenever it ends or when it voluntarily gives up control of the CPU.
+ - ### Preemptive Strategies #card
+ card-last-interval:: 3.1
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T12:22:34.748Z
+ card-last-reviewed:: 2022-10-07T10:22:34.748Z
+ card-last-score:: 3
+ - The process with the highest priority among all the *ready* process is allocated the CPU.
+ - All lower priority processes are made to yield to the highest priority process whenever it requests the CPU.
+ - The **scheduler** is called every time a process enters the *ready* queue as well as when an interval timer expires.
+ - Preemptive strategies allow for equitable resource sharing among processes, at the expense of overloading the system.
+ -
+ - ## Scheduling Algorithms
+ - ### First Come, First Served (FCFS) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:44:24.451Z
+ card-last-score:: 1
+ - **Non-preemptive** algorithm.
+ - This scheduling strategy assigns priority to processes by the order in which they request the processor.
+ - The priority of a process is computed by the enqueuer by **time stamping** all incoming processes and then having the dispatcher select the process that has the ^^oidest time stamp.^^
+ - Possible implementation: Using a FIFO data structure (where each entry points to a process descriptor). The enqueuer adds processes to the tail of the queue and the dispatcher removes processes from the head of the queue.
+ - Easy to implement.
+ - Not widely used because of ^^unpredictable **turn-around time** & **waiting time**.^^
+ - ### Shortest Job First (SJF) #card
+ card-last-interval:: 2.77
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T04:23:33.101Z
+ card-last-reviewed:: 2022-10-07T10:23:33.101Z
+ card-last-score:: 3
+ - **Non-preemptive** algorithm.
+ - SJF is an optimal algorithm from the perspective of **average turn-around time** - it minimises the average turn-around time.
+ - Preferential service of small jobs.
+ - Requires the ^^knowledge of the **service time**^^ for each process.
+ - In extreme cases where the system has little idle time, processes with large service time will never be served.
+ - In the case where it is not possible to know the service time for each process, the service time is estimated using predictors.
+ - ### Shortest Remaining Time Next (SRTN) #card
+ card-last-interval:: 3.45
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:22:34.266Z
+ card-last-reviewed:: 2022-10-06T17:22:34.267Z
+ card-last-score:: 5
+ - Similar to SJF, but **preemptive**.
+ - If a long job is mostly complete, it might have a very short time remaining, and therefore would be prioritised.
+ - ### Time Slice (Round Robin) #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T09:39:03.608Z
+ card-last-reviewed:: 2022-10-06T09:39:03.608Z
+ card-last-score:: 3
+ - **Preemptive** algorithm.
+ - Each process gets a time slice of CPU time, distributing the processing time equitably among all processes that are requesting the processor.
+ - Whenever the time slice expires, control of the CPU is given to the next process in the ready list, and the process being switched from is placed back into the ready process list.
+ - Time Slice implies the existence of a **specialised timer** that measures the processor time for each process.
+ - Every time a process becomes active, the timer is intitialised.
+ - Not very well suited for long jobs, as the scheduler will be called multiple times until the job is done.
+ - Very sensitive to the size of the time slice.
+ - Too big -> large delays in the response time for interactive processes.
+ - Too small -> too much time spent running the scheduler.
+ - Very big -> turns into FCFS.
+ - The time slice is determined by analysing the number of instructions that the processor can execute in a given time slice.
+ -
+ - ### Priority-Based Preemptive Scheduling (Event Driven) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:39.065Z
+ card-last-score:: 1
+ - Both **preemptive** & **non-preemptive** variants exist.
+ - Each process has an ^^externally assigned priority.^^
+ - Every time an event occurs that generates a process switch, the ^^process with the highest priority^^ is chosen from the ready process list.
+ - There is a possibility that processes with low priority will never gain CPU time.
+ - There are variants with **static** & **dynamic** priorities.
+ - The **dynamic priority** computation solves the problem that some processes may never gain CPU time - the longer a process waits, the higher its priority becomes.
+ - Used for real-time systems.
+ - ### Multiple Level Queue Scheduling #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:46:27.395Z
+ card-last-score:: 1
+ - Complex systems have requirements for real-time, interactive users and batch jobs - Therefore, a **combined scheduling mechanism** should be used.
+ - The processes are divided into **classes**.
+ - Each class has a process queue, and has been assigned a specific scheduling algorithm.
+ - Each process queue is treated according to its queue scheduling algorithm.
+ - Each queue is assigned a priority.
+ - As long as there are processes in a higher priority queue, those will be serviced.
+ - #### Multiple Level Queue (with Feedback) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:40:03.804Z
+ card-last-score:: 1
+ - Same as MLQ, but the ^^processes can migrate from class to class^^ in a dynamic fashion.
+ - Different strategies exist to modify the priority of a process.
+ - Increase the priority for a given process. (E.g., the user needs a larger share of the CPU to sustain acceptable service).
+ - Decrease the priority for a given process. (E.g., the user process is trying to get more CPU share, which may impact on the other users).
+ - If a process is giving up the CPU before its time slice expires, then the process is assigned to a higher priority queue.
+ - During the evolution to completion, a process may go through a number of different classes.
+ - Any of the previous algorithms covered may be used for treating a specific process class.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-20T09_05_57.927Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-20T09_05_57.927Z.Desktop.md
new file mode 100644
index 00000000..96c98237
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-10-20T09_05_57.927Z.Desktop.md
@@ -0,0 +1,203 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Process Management]]
+- **Next Topic:** [[Process Synchronisation]]
+- **Relevant Slides:** 
+-
+- # Scheduling
+ - What is **scheduling**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-19T08:45:36.066Z
+ card-last-reviewed:: 2022-10-10T11:45:36.066Z
+ card-last-score:: 3
+ - **Scheduling** allows one process to use the CPU while the execution of another process is on hold (i.e., in the waiting state) due to unavailability of any resource like I/O etc.
+ - It aims to make the system efficient, fast, & fair.
+ - It is part of the **process manager**.
+ - Scheduling is the mechanism that handles the ^^**removal** of the running processes from the CPU and the **selection** of another process.^^
+ - It is responsible for **multiplexing** processes in the CPU.
+ - When it is time for the **running** process to be removed from the CPU (into a *ready* or *suspended* state), a different process is selected from the set of processes in the ready state.
+ - The selection of another process is based on a particular strategy - the **scheduling algorithm** will determine the order in which the OS will execute the processes.
+ -
+ - ## Scheduler Organisation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:34:18.238Z
+ card-last-score:: 1
+ - When a process is changed to the *ready* state. the **enqueuer** places a pointer to the process descriptor into a **ready list**.
+ - Whenever the scheduler switches the CPU from executing one process to another, the **context switcher** saves the contents of all the processor registers of the process being removed into the **process' descriptor**.
+ - There are two types of context switch: **Voluntary** & **Involuntary**.
+ - The **dispatcher** is invoked after the current process has been from the CPU.
+ - The dispatcher chooses one of the processes enqueued in the ready list and then allocates CPU to that process by performing another context switch from *itself* to the selected process.
+ - 
+ - ## Scheduler Types
+ collapsed:: true
+ - What are the two main types of scheduler? #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T17:41:55.585Z
+ card-last-reviewed:: 2022-10-08T22:41:55.587Z
+ card-last-score:: 5
+ - **Cooperative** Scheduler (Voluntary CPU Sharing).
+ - **Preemptive** Scheduler (Involuntary CPU Sharing).
+ - ### Cooperative Scheduler (Voluntary CPU Sharing) #card
+ card-last-interval:: 3.71
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T10:14:20.540Z
+ card-last-reviewed:: 2022-10-06T17:14:20.542Z
+ card-last-score:: 3
+ - Each process will **periodically invoke** the process scheduler, voluntarily sharing the CPU.
+ - Each process should call a function that will implement the process scheduling.
+ - $\text{yield}(P_{current}, P_{next})$ (sometimes implemented as instruction in hardware), where $P_{current}$ is an identifier of the current process and $P_{next}$ is an identifier of the next process.
+ - Cooperative multitasking allows much simpler implementation of applications, because their ^^execution is never unexpectedly interrupted by the process scheduler.^^
+ - Possible problem: If the process does not voluntarily cooperate with the others, one process could keep the CPU forever.
+ - ### Preemptive Scheduler (Involuntary CPU Sharing) #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-17T19:51:16.969Z
+ card-last-reviewed:: 2022-10-08T22:51:16.969Z
+ card-last-score:: 3
+ - The interrupt system **enforces periodic involuntary interruption** of any process's execution; it can force a process to involuntarily execute a yield type function (or instruction).
+ - This is done by incorporating an **interval timer** device that produces an interrupt whenever the time expires.
+ - The programmable interval timer will cause an **interrupt** to run every $K$ clock ticks of a time interval, thus causing the hardware to execute the logical equivalent of a yield instruction to invoke the **interruption handler**.
+ - The **interrupt handler** for the timer interrupt will call the scheduler to reschedule the processor **without** any action on the part of the running process.
+ - The scheduler decides which process is run next.
+ - The scheduler is guaranteed to be invoked once every $K$ clock ticks.
+ - Even if a certain process executes in an infinite loop, it will **not** block the execution of the other processes.
+ -
+ - ## Performance Elements
+ - Having a set of processes $P = \{p_i, 0 \leq i \leq n\}$.
+ - **Service Time -** $\tau(p_i)$: The amount of time that a process needs to spend in the active/running state before it completes.
+ - **Wait Time -** $W(p_i)$: The time that the process spends waiting in the ready state before its first transition to the active state.
+ - **Turn-around Time -** $T_{TRnd}(p_i)$: The amount of time between the moment that a process enters the ready state and the moment that the process exits the running state for the last time.
+ - These elements are used to measure the performance of each scheduling algorithm.
+ -
+ - ## Selection Strategies #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:34:49.280Z
+ card-last-score:: 1
+ - ### Non-Preemptive Strategies #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-14T11:45:13.446Z
+ card-last-reviewed:: 2022-10-10T11:45:13.446Z
+ card-last-score:: 5
+ - Allow any process to run to completion once it has been allocated control of the CPU.
+ - A process that gets the control of the CPU releases the CPU whenever it ends or when it voluntarily gives up control of the CPU.
+ - ### Preemptive Strategies #card
+ card-last-interval:: 3.1
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T12:22:34.748Z
+ card-last-reviewed:: 2022-10-07T10:22:34.748Z
+ card-last-score:: 3
+ - The process with the highest priority among all the *ready* process is allocated the CPU.
+ - All lower priority processes are made to yield to the highest priority process whenever it requests the CPU.
+ - The **scheduler** is called every time a process enters the *ready* queue as well as when an interval timer expires.
+ - Preemptive strategies allow for equitable resource sharing among processes, at the expense of overloading the system.
+ -
+ - ## Scheduling Algorithms
+ - ### First Come, First Served (FCFS) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:44:24.451Z
+ card-last-score:: 1
+ - **Non-preemptive** algorithm.
+ - This scheduling strategy assigns priority to processes by the order in which they request the processor.
+ - The priority of a process is computed by the enqueuer by **time stamping** all incoming processes and then having the dispatcher select the process that has the ^^oidest time stamp.^^
+ - Possible implementation: Using a FIFO data structure (where each entry points to a process descriptor). The enqueuer adds processes to the tail of the queue and the dispatcher removes processes from the head of the queue.
+ - Easy to implement.
+ - Not widely used because of ^^unpredictable **turn-around time** & **waiting time**.^^
+ - ### Shortest Job First (SJF) #card
+ card-last-interval:: 2.77
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T04:23:33.101Z
+ card-last-reviewed:: 2022-10-07T10:23:33.101Z
+ card-last-score:: 3
+ - **Non-preemptive** algorithm.
+ - SJF is an optimal algorithm from the perspective of **average turn-around time** - it minimises the average turn-around time.
+ - Preferential service of small jobs.
+ - Requires the ^^knowledge of the **service time**^^ for each process.
+ - In extreme cases where the system has little idle time, processes with large service time will never be served.
+ - In the case where it is not possible to know the service time for each process, the service time is estimated using predictors.
+ - ### Shortest Remaining Time Next (SRTN) #card
+ card-last-interval:: 3.45
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:22:34.266Z
+ card-last-reviewed:: 2022-10-06T17:22:34.267Z
+ card-last-score:: 5
+ - Similar to SJF, but **preemptive**.
+ - If a long job is mostly complete, it might have a very short time remaining, and therefore would be prioritised.
+ - ### Time Slice (Round Robin) #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T09:39:03.608Z
+ card-last-reviewed:: 2022-10-06T09:39:03.608Z
+ card-last-score:: 3
+ - **Preemptive** algorithm.
+ - Each process gets a time slice of CPU time, distributing the processing time equitably among all processes that are requesting the processor.
+ - Whenever the time slice expires, control of the CPU is given to the next process in the ready list, and the process being switched from is placed back into the ready process list.
+ - Time Slice implies the existence of a **specialised timer** that measures the processor time for each process.
+ - Every time a process becomes active, the timer is intitialised.
+ - Not very well suited for long jobs, as the scheduler will be called multiple times until the job is done.
+ - Very sensitive to the size of the time slice.
+ - Too big -> large delays in the response time for interactive processes.
+ - Too small -> too much time spent running the scheduler.
+ - Very big -> turns into FCFS.
+ - The time slice is determined by analysing the number of instructions that the processor can execute in a given time slice.
+ -
+ - ### Priority-Based Preemptive Scheduling (Event Driven) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:39.065Z
+ card-last-score:: 1
+ - Both **preemptive** & **non-preemptive** variants exist.
+ - Each process has an ^^externally assigned priority.^^
+ - Every time an event occurs that generates a process switch, the ^^process with the highest priority^^ is chosen from the ready process list.
+ - There is a possibility that processes with low priority will never gain CPU time.
+ - There are variants with **static** & **dynamic** priorities.
+ - The **dynamic priority** computation solves the problem that some processes may never gain CPU time - the longer a process waits, the higher its priority becomes.
+ - Used for real-time systems.
+ - ### Multiple Level Queue Scheduling #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:46:27.395Z
+ card-last-score:: 1
+ - Complex systems have requirements for real-time, interactive users and batch jobs - Therefore, a **combined scheduling mechanism** should be used.
+ - The processes are divided into **classes**.
+ - Each class has a process queue, and has been assigned a specific scheduling algorithm.
+ - Each process queue is treated according to its queue scheduling algorithm.
+ - Each queue is assigned a priority.
+ - As long as there are processes in a higher priority queue, those will be serviced.
+ - #### Multiple Level Queue (with Feedback) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:40:03.804Z
+ card-last-score:: 1
+ - Same as MLQ, but the ^^processes can migrate from class to class^^ in a dynamic fashion.
+ - Different strategies exist to modify the priority of a process.
+ - Increase the priority for a given process. (E.g., the user needs a larger share of the CPU to sustain acceptable service).
+ - Decrease the priority for a given process. (E.g., the user process is trying to get more CPU share, which may impact on the other users).
+ - If a process is giving up the CPU before its time slice expires, then the process is assigned to a higher priority queue.
+ - During the evolution to completion, a process may go through a number of different classes.
+ - Any of the previous algorithms covered may be used for treating a specific process class.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-11-09T13_03_58.043Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-11-09T13_03_58.043Z.Desktop.md
new file mode 100644
index 00000000..5d3f92da
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-11-09T13_03_58.043Z.Desktop.md
@@ -0,0 +1,203 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Process Management]]
+- **Next Topic:** [[Process Synchronisation]]
+- **Relevant Slides:** 
+-
+- # Scheduling
+ - What is **scheduling**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-19T08:45:36.066Z
+ card-last-reviewed:: 2022-10-10T11:45:36.066Z
+ card-last-score:: 3
+ - **Scheduling** allows one process to use the CPU while the execution of another process is on hold (i.e., in the waiting state) due to unavailability of any resource like I/O etc.
+ - It aims to make the system efficient, fast, & fair.
+ - It is part of the **process manager**.
+ - Scheduling is the mechanism that handles the ^^**removal** of the running processes from the CPU and the **selection** of another process.^^
+ - It is responsible for **multiplexing** processes in the CPU.
+ - When it is time for the **running** process to be removed from the CPU (into a *ready* or *suspended* state), a different process is selected from the set of processes in the ready state.
+ - The selection of another process is based on a particular strategy - the **scheduling algorithm** will determine the order in which the OS will execute the processes.
+ -
+ - ## Scheduler Organisation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:34:18.238Z
+ card-last-score:: 1
+ - When a process is changed to the *ready* state. the **enqueuer** places a pointer to the process descriptor into a **ready list**.
+ - Whenever the scheduler switches the CPU from executing one process to another, the **context switcher** saves the contents of all the processor registers of the process being removed into the **process' descriptor**.
+ - There are two types of context switch: **Voluntary** & **Involuntary**.
+ - The **dispatcher** is invoked after the current process has been from the CPU.
+ - The dispatcher chooses one of the processes enqueued in the ready list and then allocates CPU to that process by performing another context switch from *itself* to the selected process.
+ - 
+ - ## Scheduler Types
+ collapsed:: true
+ - What are the two main types of scheduler? #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T17:41:55.585Z
+ card-last-reviewed:: 2022-10-08T22:41:55.587Z
+ card-last-score:: 5
+ - **Cooperative** Scheduler (Voluntary CPU Sharing).
+ - **Preemptive** Scheduler (Involuntary CPU Sharing).
+ - ### Cooperative Scheduler (Voluntary CPU Sharing) #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-23T18:31:15.409Z
+ card-last-reviewed:: 2022-10-20T08:31:15.409Z
+ card-last-score:: 5
+ - Each process will **periodically invoke** the process scheduler, voluntarily sharing the CPU.
+ - Each process should call a function that will implement the process scheduling.
+ - $\text{yield}(P_{current}, P_{next})$ (sometimes implemented as instruction in hardware), where $P_{current}$ is an identifier of the current process and $P_{next}$ is an identifier of the next process.
+ - Cooperative multitasking allows much simpler implementation of applications, because their ^^execution is never unexpectedly interrupted by the process scheduler.^^
+ - Possible problem: If the process does not voluntarily cooperate with the others, one process could keep the CPU forever.
+ - ### Preemptive Scheduler (Involuntary CPU Sharing) #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-17T19:51:16.969Z
+ card-last-reviewed:: 2022-10-08T22:51:16.969Z
+ card-last-score:: 3
+ - The interrupt system **enforces periodic involuntary interruption** of any process's execution; it can force a process to involuntarily execute a yield type function (or instruction).
+ - This is done by incorporating an **interval timer** device that produces an interrupt whenever the time expires.
+ - The programmable interval timer will cause an **interrupt** to run every $K$ clock ticks of a time interval, thus causing the hardware to execute the logical equivalent of a yield instruction to invoke the **interruption handler**.
+ - The **interrupt handler** for the timer interrupt will call the scheduler to reschedule the processor **without** any action on the part of the running process.
+ - The scheduler decides which process is run next.
+ - The scheduler is guaranteed to be invoked once every $K$ clock ticks.
+ - Even if a certain process executes in an infinite loop, it will **not** block the execution of the other processes.
+ -
+ - ## Performance Elements
+ - Having a set of processes $P = \{p_i, 0 \leq i \leq n\}$.
+ - **Service Time -** $\tau(p_i)$: The amount of time that a process needs to spend in the active/running state before it completes.
+ - **Wait Time -** $W(p_i)$: The time that the process spends waiting in the ready state before its first transition to the active state.
+ - **Turn-around Time -** $T_{TRnd}(p_i)$: The amount of time between the moment that a process enters the ready state and the moment that the process exits the running state for the last time.
+ - These elements are used to measure the performance of each scheduling algorithm.
+ -
+ - ## Selection Strategies #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:50:48.551Z
+ card-last-score:: 1
+ - ### Non-Preemptive Strategies #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-14T11:45:13.446Z
+ card-last-reviewed:: 2022-10-10T11:45:13.446Z
+ card-last-score:: 5
+ - Allow any process to run to completion once it has been allocated control of the CPU.
+ - A process that gets the control of the CPU releases the CPU whenever it ends or when it voluntarily gives up control of the CPU.
+ - ### Preemptive Strategies #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:31:38.171Z
+ card-last-score:: 1
+ - The process with the highest priority among all the *ready* process is allocated the CPU.
+ - All lower priority processes are made to yield to the highest priority process whenever it requests the CPU.
+ - The **scheduler** is called every time a process enters the *ready* queue as well as when an interval timer expires.
+ - Preemptive strategies allow for equitable resource sharing among processes, at the expense of overloading the system.
+ -
+ - ## Scheduling Algorithms
+ - ### First Come, First Served (FCFS) #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-24T08:38:33.286Z
+ card-last-reviewed:: 2022-10-20T08:38:33.286Z
+ card-last-score:: 3
+ - **Non-preemptive** algorithm.
+ - This scheduling strategy assigns priority to processes by the order in which they request the processor.
+ - The priority of a process is computed by the enqueuer by **time stamping** all incoming processes and then having the dispatcher select the process that has the ^^oidest time stamp.^^
+ - Possible implementation: Using a FIFO data structure (where each entry points to a process descriptor). The enqueuer adds processes to the tail of the queue and the dispatcher removes processes from the head of the queue.
+ - Easy to implement.
+ - Not widely used because of ^^unpredictable **turn-around time** & **waiting time**.^^
+ - ### Shortest Job First (SJF) #card
+ card-last-interval:: 8.63
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-28T23:29:59.692Z
+ card-last-reviewed:: 2022-10-20T08:29:59.692Z
+ card-last-score:: 5
+ - **Non-preemptive** algorithm.
+ - SJF is an optimal algorithm from the perspective of **average turn-around time** - it minimises the average turn-around time.
+ - Preferential service of small jobs.
+ - Requires the ^^knowledge of the **service time**^^ for each process.
+ - In extreme cases where the system has little idle time, processes with large service time will never be served.
+ - In the case where it is not possible to know the service time for each process, the service time is estimated using predictors.
+ - ### Shortest Remaining Time Next (SRTN) #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-23T18:29:18.651Z
+ card-last-reviewed:: 2022-10-20T08:29:18.651Z
+ card-last-score:: 3
+ - Similar to SJF, but **preemptive**.
+ - If a long job is mostly complete, it might have a very short time remaining, and therefore would be prioritised.
+ - ### Time Slice (Round Robin) #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-24T08:30:13.805Z
+ card-last-reviewed:: 2022-10-20T08:30:13.806Z
+ card-last-score:: 3
+ - **Preemptive** algorithm.
+ - Each process gets a time slice of CPU time, distributing the processing time equitably among all processes that are requesting the processor.
+ - Whenever the time slice expires, control of the CPU is given to the next process in the ready list, and the process being switched from is placed back into the ready process list.
+ - Time Slice implies the existence of a **specialised timer** that measures the processor time for each process.
+ - Every time a process becomes active, the timer is intitialised.
+ - Not very well suited for long jobs, as the scheduler will be called multiple times until the job is done.
+ - Very sensitive to the size of the time slice.
+ - Too big -> large delays in the response time for interactive processes.
+ - Too small -> too much time spent running the scheduler.
+ - Very big -> turns into FCFS.
+ - The time slice is determined by analysing the number of instructions that the processor can execute in a given time slice.
+ -
+ - ### Priority-Based Preemptive Scheduling (Event Driven) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:39.065Z
+ card-last-score:: 1
+ - Both **preemptive** & **non-preemptive** variants exist.
+ - Each process has an ^^externally assigned priority.^^
+ - Every time an event occurs that generates a process switch, the ^^process with the highest priority^^ is chosen from the ready process list.
+ - There is a possibility that processes with low priority will never gain CPU time.
+ - There are variants with **static** & **dynamic** priorities.
+ - The **dynamic priority** computation solves the problem that some processes may never gain CPU time - the longer a process waits, the higher its priority becomes.
+ - Used for real-time systems.
+ - ### Multiple Level Queue Scheduling #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:43:05.332Z
+ card-last-score:: 1
+ - Complex systems have requirements for real-time, interactive users and batch jobs - Therefore, a **combined scheduling mechanism** should be used.
+ - The processes are divided into **classes**.
+ - Each class has a process queue, and has been assigned a specific scheduling algorithm.
+ - Each process queue is treated according to its queue scheduling algorithm.
+ - Each queue is assigned a priority.
+ - As long as there are processes in a higher priority queue, those will be serviced.
+ - #### Multiple Level Queue (with Feedback) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:40:03.804Z
+ card-last-score:: 1
+ - Same as MLQ, but the ^^processes can migrate from class to class^^ in a dynamic fashion.
+ - Different strategies exist to modify the priority of a process.
+ - Increase the priority for a given process. (E.g., the user needs a larger share of the CPU to sustain acceptable service).
+ - Decrease the priority for a given process. (E.g., the user process is trying to get more CPU share, which may impact on the other users).
+ - If a process is giving up the CPU before its time slice expires, then the process is assigned to a higher priority queue.
+ - During the evolution to completion, a process may go through a number of different classes.
+ - Any of the previous algorithms covered may be used for treating a specific process class.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-11-11T12_04_45.315Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-11-11T12_04_45.315Z.Desktop.md
new file mode 100644
index 00000000..efba3554
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/CPU Management - Scheduling/2022-11-11T12_04_45.315Z.Desktop.md
@@ -0,0 +1,203 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Process Management]]
+- **Next Topic:** [[Process Synchronisation]]
+- **Relevant Slides:** 
+-
+- # Scheduling
+ - What is **scheduling**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-19T08:45:36.066Z
+ card-last-reviewed:: 2022-10-10T11:45:36.066Z
+ card-last-score:: 3
+ - **Scheduling** allows one process to use the CPU while the execution of another process is on hold (i.e., in the waiting state) due to unavailability of any resource like I/O etc.
+ - It aims to make the system efficient, fast, & fair.
+ - It is part of the **process manager**.
+ - Scheduling is the mechanism that handles the ^^**removal** of the running processes from the CPU and the **selection** of another process.^^
+ - It is responsible for **multiplexing** processes in the CPU.
+ - When it is time for the **running** process to be removed from the CPU (into a *ready* or *suspended* state), a different process is selected from the set of processes in the ready state.
+ - The selection of another process is based on a particular strategy - the **scheduling algorithm** will determine the order in which the OS will execute the processes.
+ -
+ - ## Scheduler Organisation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:34:18.238Z
+ card-last-score:: 1
+ - When a process is changed to the *ready* state. the **enqueuer** places a pointer to the process descriptor into a **ready list**.
+ - Whenever the scheduler switches the CPU from executing one process to another, the **context switcher** saves the contents of all the processor registers of the process being removed into the **process' descriptor**.
+ - There are two types of context switch: **Voluntary** & **Involuntary**.
+ - The **dispatcher** is invoked after the current process has been from the CPU.
+ - The dispatcher chooses one of the processes enqueued in the ready list and then allocates CPU to that process by performing another context switch from *itself* to the selected process.
+ - 
+ - ## Scheduler Types
+ collapsed:: true
+ - What are the two main types of scheduler? #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T17:41:55.585Z
+ card-last-reviewed:: 2022-10-08T22:41:55.587Z
+ card-last-score:: 5
+ - **Cooperative** Scheduler (Voluntary CPU Sharing).
+ - **Preemptive** Scheduler (Involuntary CPU Sharing).
+ - ### Cooperative Scheduler (Voluntary CPU Sharing) #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-23T18:31:15.409Z
+ card-last-reviewed:: 2022-10-20T08:31:15.409Z
+ card-last-score:: 5
+ - Each process will **periodically invoke** the process scheduler, voluntarily sharing the CPU.
+ - Each process should call a function that will implement the process scheduling.
+ - $\text{yield}(P_{current}, P_{next})$ (sometimes implemented as instruction in hardware), where $P_{current}$ is an identifier of the current process and $P_{next}$ is an identifier of the next process.
+ - Cooperative multitasking allows much simpler implementation of applications, because their ^^execution is never unexpectedly interrupted by the process scheduler.^^
+ - Possible problem: If the process does not voluntarily cooperate with the others, one process could keep the CPU forever.
+ - ### Preemptive Scheduler (Involuntary CPU Sharing) #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-17T19:51:16.969Z
+ card-last-reviewed:: 2022-10-08T22:51:16.969Z
+ card-last-score:: 3
+ - The interrupt system **enforces periodic involuntary interruption** of any process's execution; it can force a process to involuntarily execute a yield type function (or instruction).
+ - This is done by incorporating an **interval timer** device that produces an interrupt whenever the time expires.
+ - The programmable interval timer will cause an **interrupt** to run every $K$ clock ticks of a time interval, thus causing the hardware to execute the logical equivalent of a yield instruction to invoke the **interruption handler**.
+ - The **interrupt handler** for the timer interrupt will call the scheduler to reschedule the processor **without** any action on the part of the running process.
+ - The scheduler decides which process is run next.
+ - The scheduler is guaranteed to be invoked once every $K$ clock ticks.
+ - Even if a certain process executes in an infinite loop, it will **not** block the execution of the other processes.
+ -
+ - ## Performance Elements
+ - Having a set of processes $P = \{p_i, 0 \leq i \leq n\}$.
+ - **Service Time -** $\tau(p_i)$: The amount of time that a process needs to spend in the active/running state before it completes.
+ - **Wait Time -** $W(p_i)$: The time that the process spends waiting in the ready state before its first transition to the active state.
+ - **Turn-around Time -** $T_{TRnd}(p_i)$: The amount of time between the moment that a process enters the ready state and the moment that the process exits the running state for the last time.
+ - These elements are used to measure the performance of each scheduling algorithm.
+ -
+ - ## Selection Strategies #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:50:48.551Z
+ card-last-score:: 1
+ - ### Non-Preemptive Strategies #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-14T11:45:13.446Z
+ card-last-reviewed:: 2022-10-10T11:45:13.446Z
+ card-last-score:: 5
+ - Allow any process to run to completion once it has been allocated control of the CPU.
+ - A process that gets the control of the CPU releases the CPU whenever it ends or when it voluntarily gives up control of the CPU.
+ - ### Preemptive Strategies #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:31:38.171Z
+ card-last-score:: 1
+ - The process with the highest priority among all the *ready* process is allocated the CPU.
+ - All lower priority processes are made to yield to the highest priority process whenever it requests the CPU.
+ - The **scheduler** is called every time a process enters the *ready* queue as well as when an interval timer expires.
+ - Preemptive strategies allow for equitable resource sharing among processes, at the expense of overloading the system.
+ -
+ - ## Scheduling Algorithms
+ - ### First Come, First Served (FCFS) #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-24T08:38:33.286Z
+ card-last-reviewed:: 2022-10-20T08:38:33.286Z
+ card-last-score:: 3
+ - **Non-preemptive** algorithm.
+ - This scheduling strategy assigns priority to processes by the order in which they request the processor.
+ - The priority of a process is computed by the enqueuer by **time stamping** all incoming processes and then having the dispatcher select the process that has the ^^oidest time stamp.^^
+ - Possible implementation: Using a FIFO data structure (where each entry points to a process descriptor). The enqueuer adds processes to the tail of the queue and the dispatcher removes processes from the head of the queue.
+ - Easy to implement.
+ - Not widely used because of ^^unpredictable **turn-around time** & **waiting time**.^^
+ - ### Shortest Job First (SJF) #card
+ card-last-interval:: 8.63
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-28T23:29:59.692Z
+ card-last-reviewed:: 2022-10-20T08:29:59.692Z
+ card-last-score:: 5
+ - **Non-preemptive** algorithm.
+ - SJF is an optimal algorithm from the perspective of **average turn-around time** - it minimises the average turn-around time.
+ - Preferential service of small jobs.
+ - Requires the ^^knowledge of the **service time**^^ for each process.
+ - In extreme cases where the system has little idle time, processes with large service time will never be served.
+ - In the case where it is not possible to know the service time for each process, the service time is estimated using predictors.
+ - ### Shortest Remaining Time Next (SRTN) #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-23T18:29:18.651Z
+ card-last-reviewed:: 2022-10-20T08:29:18.651Z
+ card-last-score:: 3
+ - Similar to SJF, but **preemptive**.
+ - If a long job is mostly complete, it might have a very short time remaining, and therefore would be prioritised.
+ - ### Time Slice (Round Robin) #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-24T08:30:13.805Z
+ card-last-reviewed:: 2022-10-20T08:30:13.806Z
+ card-last-score:: 3
+ - **Preemptive** algorithm.
+ - Each process gets a time slice of CPU time, distributing the processing time equitably among all processes that are requesting the processor.
+ - Whenever the time slice expires, control of the CPU is given to the next process in the ready list, and the process being switched from is placed back into the ready process list.
+ - Time Slice implies the existence of a **specialised timer** that measures the processor time for each process.
+ - Every time a process becomes active, the timer is intitialised.
+ - Not very well suited for long jobs, as the scheduler will be called multiple times until the job is done.
+ - Very sensitive to the size of the time slice.
+ - Too big -> large delays in the response time for interactive processes.
+ - Too small -> too much time spent running the scheduler.
+ - Very big -> turns into FCFS.
+ - The time slice is determined by analysing the number of instructions that the processor can execute in a given time slice.
+ -
+ - ### Priority-Based Preemptive Scheduling (Event Driven) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:39.065Z
+ card-last-score:: 1
+ - Both **preemptive** & **non-preemptive** variants exist.
+ - Each process has an ^^externally assigned priority.^^
+ - Every time an event occurs that generates a process switch, the ^^process with the highest priority^^ is chosen from the ready process list.
+ - There is a possibility that processes with low priority will never gain CPU time.
+ - There are variants with **static** & **dynamic** priorities.
+ - The **dynamic priority** computation solves the problem that some processes may never gain CPU time - the longer a process waits, the higher its priority becomes.
+ - Used for real-time systems.
+ - ### Multiple Level Queue Scheduling #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:43:47.911Z
+ card-last-score:: 1
+ - Complex systems have requirements for real-time, interactive users and batch jobs - Therefore, a **combined scheduling mechanism** should be used.
+ - The processes are divided into **classes**.
+ - Each class has a process queue, and has been assigned a specific scheduling algorithm.
+ - Each process queue is treated according to its queue scheduling algorithm.
+ - Each queue is assigned a priority.
+ - As long as there are processes in a higher priority queue, those will be serviced.
+ - #### Multiple Level Queue (with Feedback) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:40:03.804Z
+ card-last-score:: 1
+ - Same as MLQ, but the ^^processes can migrate from class to class^^ in a dynamic fashion.
+ - Different strategies exist to modify the priority of a process.
+ - Increase the priority for a given process. (E.g., the user needs a larger share of the CPU to sustain acceptable service).
+ - Decrease the priority for a given process. (E.g., the user process is trying to get more CPU share, which may impact on the other users).
+ - If a process is giving up the CPU before its time slice expires, then the process is assigned to a higher priority queue.
+ - During the evolution to completion, a process may go through a number of different classes.
+ - Any of the previous algorithms covered may be used for treating a specific process class.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Cloud Computing/2022-09-30T10_01_42.255Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Cloud Computing/2022-09-30T10_01_42.255Z.Desktop.md
new file mode 100644
index 00000000..9fad7885
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Cloud Computing/2022-09-30T10_01_42.255Z.Desktop.md
@@ -0,0 +1,80 @@
+- #[[CT216 - Software Engineering I]]
+- No previous topic
+- **Next Topic:** [[Software Processes]]
+- **Relevant Slides:** 
+-
+- What is **Cloud Computing**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-22T15:15:54.781Z
+ card-last-reviewed:: 2022-09-18T15:15:54.782Z
+ card-last-score:: 3
+ - **Cloud Computing** is a model for enabling convenient, on-demand network access to a ^^shared pool of configurable computing resources^^ (e.g., networks, servers, storage, applications, & services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.
+- What is a **Public Cloud**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T14:58:45.902Z
+ card-last-reviewed:: 2022-09-18T14:58:45.902Z
+ card-last-score:: 5
+ - Amazon, MS Azure, & Google Cloud are examples of **public clouds**.
+ - Any member of the public can sign up and start provisioning computing resources within minutes.
+ - They are **highly scalable** and allow an organisation to grow its infrastructure rapidly.
+- What is a **Private Cloud**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:09:14.946Z
+ card-last-reviewed:: 2022-09-18T15:09:14.947Z
+ card-last-score:: 5
+ - Computing resources are dedicated to a single customer and not shared with other customers.
+ - Considered to be more **secure**.
+- What is a **Hybrid Cloud**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T14:57:26.074Z
+ card-last-reviewed:: 2022-09-18T14:57:26.075Z
+ card-last-score:: 5
+ - A **hybrid cloud** is simply a mix of public & private cloud resources.
+ - An organisation may choose this option if there is a mixture in the criticality of their data or computational requirements.
+ - Data that doesn't require heightened security can be pushed onto the **public cloud**, while data which does can be hosted on the **private cloud**.
+- ## Cloud Services
+ - What is **SaaS**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:27:14.210Z
+ card-last-reviewed:: 2022-09-19T18:27:14.211Z
+ card-last-score:: 3
+ - **Software as a Service (SaaS)** provides users with (essentially) ^^a **cloud application**, the platform on which it runs, & the platform's underlying infrastructure.^^
+ - What is **PaaS**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:29:40.779Z
+ card-last-score:: 1
+ - **Platform as a Service (PaaS)** provides users with ^^compute, networking, & storage resources.^^
+-
+- What are the advantages of cloud computing? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:24:40.121Z
+ card-last-reviewed:: 2022-09-19T18:24:40.122Z
+ card-last-score:: 5
+ - **Elasticity** - if your application becomes very popular, you can procure new resources within minutes.
+ - Reduced capital expenditure.
+ - Economies of scale.
+- What are the disadvantages of cloud computing? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:05:53.952Z
+ card-last-reviewed:: 2022-09-19T18:05:53.952Z
+ card-last-score:: 5
+ - Security / privacy
+ - Cost
+ - Migration issues
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Cloud Computing/2022-10-20T09_05_57.928Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Cloud Computing/2022-10-20T09_05_57.928Z.Desktop.md
new file mode 100644
index 00000000..5a475883
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Cloud Computing/2022-10-20T09_05_57.928Z.Desktop.md
@@ -0,0 +1,80 @@
+- #[[CT216 - Software Engineering I]]
+- No previous topic
+- **Next Topic:** [[Software Processes]]
+- **Relevant Slides:** 
+-
+- What is **Cloud Computing**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-10T19:29:53.364Z
+ card-last-reviewed:: 2022-10-01T13:29:53.365Z
+ card-last-score:: 5
+ - **Cloud Computing** is a model for enabling convenient, on-demand network access to a ^^shared pool of configurable computing resources^^ (e.g., networks, servers, storage, applications, & services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.
+- What is a **Public Cloud**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:16:02.512Z
+ card-last-reviewed:: 2022-09-30T12:16:02.512Z
+ card-last-score:: 5
+ - Amazon, MS Azure, & Google Cloud are examples of **public clouds**.
+ - Any member of the public can sign up and start provisioning computing resources within minutes.
+ - They are **highly scalable** and allow an organisation to grow its infrastructure rapidly.
+- What is a **Private Cloud**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:17:34.107Z
+ card-last-reviewed:: 2022-10-01T13:17:34.107Z
+ card-last-score:: 5
+ - Computing resources are dedicated to a single customer and not shared with other customers.
+ - Considered to be more **secure**.
+- What is a **Hybrid Cloud**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:15:46.810Z
+ card-last-reviewed:: 2022-09-30T12:15:46.810Z
+ card-last-score:: 5
+ - A **hybrid cloud** is simply a mix of public & private cloud resources.
+ - An organisation may choose this option if there is a mixture in the criticality of their data or computational requirements.
+ - Data that doesn't require heightened security can be pushed onto the **public cloud**, while data which does can be hosted on the **private cloud**.
+- ## Cloud Services
+ - What is **SaaS**? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T21:29:20.765Z
+ card-last-reviewed:: 2022-10-03T14:29:20.766Z
+ card-last-score:: 3
+ - **Software as a Service (SaaS)** provides users with (essentially) ^^a **cloud application**, the platform on which it runs, & the platform's underlying infrastructure.^^
+ - What is **PaaS**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-17T13:41:30.969Z
+ card-last-reviewed:: 2022-10-06T09:41:30.970Z
+ card-last-score:: 5
+ - **Platform as a Service (PaaS)** provides users with ^^compute, networking, & storage resources.^^
+-
+- What are the advantages of cloud computing? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:27:49.635Z
+ card-last-reviewed:: 2022-10-03T14:27:49.635Z
+ card-last-score:: 3
+ - **Elasticity** - if your application becomes very popular, you can procure new resources within minutes.
+ - Reduced capital expenditure.
+ - Economies of scale.
+- What are the disadvantages of cloud computing? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:27.437Z
+ card-last-reviewed:: 2022-10-03T11:43:27.437Z
+ card-last-score:: 5
+ - Security / privacy
+ - Cost
+ - Migration issues
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Colouring Graphs; Eulerian & Hamiltonian Graphs/2022-11-23T09_22_44.495Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Colouring Graphs; Eulerian & Hamiltonian Graphs/2022-11-23T09_22_44.495Z.Desktop.md
new file mode 100644
index 00000000..2da122ae
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Colouring Graphs; Eulerian & Hamiltonian Graphs/2022-11-23T09_22_44.495Z.Desktop.md
@@ -0,0 +1,156 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Convex Polyhedra]]
+- **Next Topic:** [[Trees]]
+- **Relevant Slides:** 
+-
+- # Vertex Colouring
+ - There are maps that can be coloured with a single colour, two colours, three colours, or four colours.
+ - For all maps, no matter how complicated, at most four colours is sufficient.
+- # Colouring Graphs
+ - If we think of a map as a way of showing which regions share borders, then we can represent it as a **graph**, where:
+ - A vertex in the graph corresponds to a region in the map.
+ - There is an edge between two vertices in the graph if the corresponding regions share a border.
+ - Colouring regions of a map corresponds to colouring vertices of the graph. Since neighbouring regions in the map must have different colours, so too must adjacent vertices.
+ - More precisely:
+ - **Vertex Colouring:** An assignment of colours to the vertices of a graph.
+ - **Proper Colouring:** If the vertex colouring has the property that adjacent vertices are coloured differently, then the colouring is called **proper**.
+ - **Minimal Colouring:** A proper colouring that is done with the fewest possible number of colours.
+ - Lots of different proper colourings are possible. If the graph has $v$ vertices, then clearly at most $v$ colours are needed. However, usually, we need far fewer.
+ - ## Chromatic Numbers
+ - What is the **chromatic number** of a graph? #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T10:50:36.778Z
+ card-last-reviewed:: 2022-11-14T15:50:36.779Z
+ card-last-score:: 5
+ - The **chromatic number** of the graph, written $\chi(G)$ is the smallest number of colours needed to get a proper vertex colouring of a graph $G$.
+ - ### Example
+ - Determine the **chromatic number** of the graphs $C_2$, $C_3$, $C_4$, & $C_5$.
+ background-color:: green
+ - $$\chi(C_2) = 2$$
+ - $$\chi(C_3) = 3$$
+ - $$\chi(C_4) = 2$$
+ - $$\chi(C_3) = 5$$
+ - Determine the **chromatic number** of the $K_n$ & $K_{p,q}$ for any $n$, $p$, $q$.
+ background-color:: green
+ - $$\chi(K_4) = 4$$
+ - $$\chi(K_n) = n$$
+ - $$\chi(K_{3,3}) = 2$$
+ - $$\chi(K_{p,q}) = 2$$
+ - In general, calculating $\chi(G)$ is not easy, but there are some ideas that can help. For example, it is clearly true that if a graph has $v$ vertices, then
+ - $$1 \leq \chi(G) \leq v$$
+ - ### Cliques
+ - If the graph happens to be **complete**, then $\chi(G) = v$. If it is **not** complete, then we can look at ***cliques*** in the graph.
+ - What is a **clique** of a graph? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:14:53.505Z
+ card-last-score:: 1
+ - A **clique** is a subgraph of a graph, all of whose vertices are connected to each other.
+ - (Clique numbers will not be on the exam).
+ - What is the **clique number** of a graph? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:21:22.385Z
+ card-last-score:: 1
+ - The **clique number** of a graph, $G$, is the number of vertices in the largest clique in $G$.
+ - **Lower Bound:** The chromatic number of a graph is *at least* its clique number.
+ - **Upper Bound:** $\chi(G) \leq \Delta(G) + 1$, where $\Delta(G)$ denotes the largest degree of any vertex in the graph $G$.
+- # Algorithms for $\chi(G)$
+ - In general, finding a proper colouring for a graph is hard. There are some algorithms that are efficient, but not optimal. We'll look at two:
+ - The **Greedy Algorithm**.
+ - The **Welsh-Powell Algorithm**.
+ - The **Greedy Algorithm** is simple & efficient, but the result can depend on the ordering of the vertices.
+ - The **Welsh-Powell Algorithm** is slightly more complicated, but can give better colourings.
+ - ## Greedy Algorithm #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:22:55.701Z
+ card-last-score:: 1
+ - 1. Number all the vertices. Number your colours.
+ 2. Give a colour to vertex 1.
+ 3. Take the remaining vertices in order. Assign each one the lowest numbered colours that is different from the colours of its neighbours.
+ - ## Welsh-Powell Algorithm #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:51:29.529Z
+ card-last-score:: 1
+ - 1. List all vertices in decreasing order of their degree (i.e., largest degree first). If two or more share the same degree, list them in any way you want.
+ 2. Colour the first listed vertex (with the first unused colour).
+ 3. Work down the list, giving that colour to all vertices **not** conencted to one previously coloured.
+ 4. Cross (verb.) coloured vertices of the list, and return to the start of the list.
+- # Eulerian Paths & Circuits
+ - Recall that a **path** is a sequence of adjacent vertices in a graph.
+ - What is a **Eulerian Path**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:18:26.028Z
+ card-last-score:: 1
+ - A **Eulerian Path** (also called an *Euler Path* and an *Eulerian trail*) in a graph is path which uses every edge exactly once.
+ - 
+ - Recall that a **circuit** is a path that begins & ends at that same vertex, and no edge is repeated.
+ - What is an **Eulerian Circuit**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:21:29.522Z
+ card-last-score:: 1
+ - An **Eulerian Circuit** (also called an *Eulerian Cycle*) is an *Eulerian path* that that starts & finishes on at the same vertex.
+ - If a graph has such a circuit, we say that it is *Eulerian*.
+ - It is possible to come up with a condition that guarantees that a graph has an Eulerian Path, and, additionally, one that ensures that ensures that it has an Eulerian Circuit.
+ - To begin with, we'll reason that the following graph could *not* have an Eulerian circuit, although it *does* have an Eulerian path.
+ - 
+ - Suppose, first, that we have a graph that ==**does** have an Eulerian circuit.== Then, for every edge in the circuit that "exits" a vertex, there is another that "enters" that vertex. So, every vertex must have even degree.
+ - A graph has an **Eulerian Circuit** if and only if every vertex has even degree.
+ - Next, suppose that a graph==does **not** have an Eulerian circuit==, but does have an **Eulerian path**. Then, the degree at the "start" & "end" verticwes must be odd, and every other vertex has even degree.
+ - A graph has an **Eulerian Path** if and only if it has either **zero** or **two** vertices with odd degree.
+- # Hamiltonian Paths & Cycles
+ - What is a **Hamiltonian Path**? #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-24T08:06:13.770Z
+ card-last-reviewed:: 2022-11-21T13:06:13.770Z
+ card-last-score:: 5
+ - A **Hamiltonian Path** is a graph that visits every vertex exactly once.
+ - What is a **Hamiltonian Cycle**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:23:21.600Z
+ card-last-score:: 1
+ - A **Hamiltonian Cycle** is a cycle which visits the start / end vertex twice, and every other vertex exactly once.
+ - A graph that has a Hamiltonian Cycle is called a **Hamiltonian Graph**.
+ - Important examples of Hamiltonian Graphs include cycle graphs, complete graphs, & graphs of the platonic solids.
+ - In general, the problem of finding a Hamiltonian path or cycle in a large graph is hard - it is known to be NP-complete. However, there are two relatively simple *sufficient conditions* to testing if a graph is Hamiltonian:
+ - ## Ore's Theorem #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:50:30.834Z
+ card-last-score:: 1
+ - A graph with $v$ vertices, where $v \geq 3$, is **Hamiltonian** if, for every pair of non-adjacent vertices, the sum of their degrees is $\geq v$.
+ - ## Dirac's Theorem #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:15:37.739Z
+ card-last-score:: 1
+ - A simple graph with $v$ vertices, where $v \geq 3$, is **Hamiltonian** if every vertex has degree $\geq v / 2$.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Colouring Graphs; Eulerian & Hamiltonian Graphs/2022-11-23T12_15_36.857Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Colouring Graphs; Eulerian & Hamiltonian Graphs/2022-11-23T12_15_36.857Z.Desktop.md
new file mode 100644
index 00000000..2da122ae
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Colouring Graphs; Eulerian & Hamiltonian Graphs/2022-11-23T12_15_36.857Z.Desktop.md
@@ -0,0 +1,156 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Convex Polyhedra]]
+- **Next Topic:** [[Trees]]
+- **Relevant Slides:** 
+-
+- # Vertex Colouring
+ - There are maps that can be coloured with a single colour, two colours, three colours, or four colours.
+ - For all maps, no matter how complicated, at most four colours is sufficient.
+- # Colouring Graphs
+ - If we think of a map as a way of showing which regions share borders, then we can represent it as a **graph**, where:
+ - A vertex in the graph corresponds to a region in the map.
+ - There is an edge between two vertices in the graph if the corresponding regions share a border.
+ - Colouring regions of a map corresponds to colouring vertices of the graph. Since neighbouring regions in the map must have different colours, so too must adjacent vertices.
+ - More precisely:
+ - **Vertex Colouring:** An assignment of colours to the vertices of a graph.
+ - **Proper Colouring:** If the vertex colouring has the property that adjacent vertices are coloured differently, then the colouring is called **proper**.
+ - **Minimal Colouring:** A proper colouring that is done with the fewest possible number of colours.
+ - Lots of different proper colourings are possible. If the graph has $v$ vertices, then clearly at most $v$ colours are needed. However, usually, we need far fewer.
+ - ## Chromatic Numbers
+ - What is the **chromatic number** of a graph? #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T10:50:36.778Z
+ card-last-reviewed:: 2022-11-14T15:50:36.779Z
+ card-last-score:: 5
+ - The **chromatic number** of the graph, written $\chi(G)$ is the smallest number of colours needed to get a proper vertex colouring of a graph $G$.
+ - ### Example
+ - Determine the **chromatic number** of the graphs $C_2$, $C_3$, $C_4$, & $C_5$.
+ background-color:: green
+ - $$\chi(C_2) = 2$$
+ - $$\chi(C_3) = 3$$
+ - $$\chi(C_4) = 2$$
+ - $$\chi(C_3) = 5$$
+ - Determine the **chromatic number** of the $K_n$ & $K_{p,q}$ for any $n$, $p$, $q$.
+ background-color:: green
+ - $$\chi(K_4) = 4$$
+ - $$\chi(K_n) = n$$
+ - $$\chi(K_{3,3}) = 2$$
+ - $$\chi(K_{p,q}) = 2$$
+ - In general, calculating $\chi(G)$ is not easy, but there are some ideas that can help. For example, it is clearly true that if a graph has $v$ vertices, then
+ - $$1 \leq \chi(G) \leq v$$
+ - ### Cliques
+ - If the graph happens to be **complete**, then $\chi(G) = v$. If it is **not** complete, then we can look at ***cliques*** in the graph.
+ - What is a **clique** of a graph? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:14:53.505Z
+ card-last-score:: 1
+ - A **clique** is a subgraph of a graph, all of whose vertices are connected to each other.
+ - (Clique numbers will not be on the exam).
+ - What is the **clique number** of a graph? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:21:22.385Z
+ card-last-score:: 1
+ - The **clique number** of a graph, $G$, is the number of vertices in the largest clique in $G$.
+ - **Lower Bound:** The chromatic number of a graph is *at least* its clique number.
+ - **Upper Bound:** $\chi(G) \leq \Delta(G) + 1$, where $\Delta(G)$ denotes the largest degree of any vertex in the graph $G$.
+- # Algorithms for $\chi(G)$
+ - In general, finding a proper colouring for a graph is hard. There are some algorithms that are efficient, but not optimal. We'll look at two:
+ - The **Greedy Algorithm**.
+ - The **Welsh-Powell Algorithm**.
+ - The **Greedy Algorithm** is simple & efficient, but the result can depend on the ordering of the vertices.
+ - The **Welsh-Powell Algorithm** is slightly more complicated, but can give better colourings.
+ - ## Greedy Algorithm #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:22:55.701Z
+ card-last-score:: 1
+ - 1. Number all the vertices. Number your colours.
+ 2. Give a colour to vertex 1.
+ 3. Take the remaining vertices in order. Assign each one the lowest numbered colours that is different from the colours of its neighbours.
+ - ## Welsh-Powell Algorithm #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:51:29.529Z
+ card-last-score:: 1
+ - 1. List all vertices in decreasing order of their degree (i.e., largest degree first). If two or more share the same degree, list them in any way you want.
+ 2. Colour the first listed vertex (with the first unused colour).
+ 3. Work down the list, giving that colour to all vertices **not** conencted to one previously coloured.
+ 4. Cross (verb.) coloured vertices of the list, and return to the start of the list.
+- # Eulerian Paths & Circuits
+ - Recall that a **path** is a sequence of adjacent vertices in a graph.
+ - What is a **Eulerian Path**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:18:26.028Z
+ card-last-score:: 1
+ - A **Eulerian Path** (also called an *Euler Path* and an *Eulerian trail*) in a graph is path which uses every edge exactly once.
+ - 
+ - Recall that a **circuit** is a path that begins & ends at that same vertex, and no edge is repeated.
+ - What is an **Eulerian Circuit**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:21:29.522Z
+ card-last-score:: 1
+ - An **Eulerian Circuit** (also called an *Eulerian Cycle*) is an *Eulerian path* that that starts & finishes on at the same vertex.
+ - If a graph has such a circuit, we say that it is *Eulerian*.
+ - It is possible to come up with a condition that guarantees that a graph has an Eulerian Path, and, additionally, one that ensures that ensures that it has an Eulerian Circuit.
+ - To begin with, we'll reason that the following graph could *not* have an Eulerian circuit, although it *does* have an Eulerian path.
+ - 
+ - Suppose, first, that we have a graph that ==**does** have an Eulerian circuit.== Then, for every edge in the circuit that "exits" a vertex, there is another that "enters" that vertex. So, every vertex must have even degree.
+ - A graph has an **Eulerian Circuit** if and only if every vertex has even degree.
+ - Next, suppose that a graph==does **not** have an Eulerian circuit==, but does have an **Eulerian path**. Then, the degree at the "start" & "end" verticwes must be odd, and every other vertex has even degree.
+ - A graph has an **Eulerian Path** if and only if it has either **zero** or **two** vertices with odd degree.
+- # Hamiltonian Paths & Cycles
+ - What is a **Hamiltonian Path**? #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-24T08:06:13.770Z
+ card-last-reviewed:: 2022-11-21T13:06:13.770Z
+ card-last-score:: 5
+ - A **Hamiltonian Path** is a graph that visits every vertex exactly once.
+ - What is a **Hamiltonian Cycle**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:23:21.600Z
+ card-last-score:: 1
+ - A **Hamiltonian Cycle** is a cycle which visits the start / end vertex twice, and every other vertex exactly once.
+ - A graph that has a Hamiltonian Cycle is called a **Hamiltonian Graph**.
+ - Important examples of Hamiltonian Graphs include cycle graphs, complete graphs, & graphs of the platonic solids.
+ - In general, the problem of finding a Hamiltonian path or cycle in a large graph is hard - it is known to be NP-complete. However, there are two relatively simple *sufficient conditions* to testing if a graph is Hamiltonian:
+ - ## Ore's Theorem #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:50:30.834Z
+ card-last-score:: 1
+ - A graph with $v$ vertices, where $v \geq 3$, is **Hamiltonian** if, for every pair of non-adjacent vertices, the sum of their degrees is $\geq v$.
+ - ## Dirac's Theorem #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:15:37.739Z
+ card-last-score:: 1
+ - A simple graph with $v$ vertices, where $v \geq 3$, is **Hamiltonian** if every vertex has degree $\geq v / 2$.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Combinatorial Proofs/2022-10-07T18_07_00.013Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Combinatorial Proofs/2022-10-07T18_07_00.013Z.Desktop.md
new file mode 100644
index 00000000..707979b9
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Combinatorial Proofs/2022-10-07T18_07_00.013Z.Desktop.md
@@ -0,0 +1,87 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Binomial Coefficients]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Pascal's Triangle
+ - **Pascal's Identity:** A recurrence relation for $\binom{n}{k}$:
+ - $$\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}$$
+ - In the previous topic, we "proved" that $\binom{n}{k} = \frac{n!}{(n-k)!k!}$ by counting $P(n,k)$ in two different ways.
+ - This is a classic example of a **Combinatorial Proof**, where we establish a formula by counting something in 2 different ways.
+ - 
+ - Binomial coefficients have many important properties. Looking at their arrangement in Pascal's Triangle, we can spot some:
+ - (i) For all $n$, $\binom{n}{0} = \binom{n}{n} = 1$.
+ - (ii) $\displaystyle\sum^{n}_{i=0} \binom{n}{i}= 2^n$
+ - (iii) $\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}$ (Pascal's Identity).
+ - (iv) $\binom{n}{k} = \binom{n}{n-k}$
+ -
+- # Algebraic & Combinatorial Proofs
+ - Proofs of identities involving **Binomial Coefficients** can be classified as:
+ - **Algebraic:** If they rely mainly on the formula for binomial coefficients.
+ - $$
+ \binom{n}{k} = \frac{n!}{k!(n-k)!}
+ \newline
+ \therefore \binom{n}{k} = \frac{n!}{(n-k)!(n-(n-k))!} = \frac{n!}{(n-k)!k!} = \binom{n}{k}
+ $$
+ - **Combinatorial:** If they involve counting a set in two different ways.
+ - Let $A$ be a set of size $n$.
+ - $\binom{n}{k} =$ number of subsets of $A$ of cardinality $k$, but for each such subset there is a one-to-one correspondence with a subset of size $n-k$.
+ - i.e., $\binom{n}{n-k} = \binom{n}{k}$,
+ - ## Algebraic Proof of Pascal's Triangle Recurrence Relation
+ - $$\binom{n}{k} = \frac{n!}{k!(n-k)!} \newline \newline$$
+ - $$\binom{n-1}{k-1} + \binom{n-1}{k} = \frac{(n-1)!}{(k-1)!(n-k)!} + \frac{(n-1)!}{k!(n-k-1)!}$$
+ - $$ = \frac{k(n-1)!}{k(k-1)!(n-k)!} + \frac{(n-1)!(n-k)}{k!(n-k-1)!(n-k)} $$
+ - $$= \frac{k(n-1)!+(n-k)(n-1)!}{k!(n-k)!}$$
+ - $$= \frac{(n-1)!(k+n-k)}{k!(n-k)!} = \frac{n!}{k!(n-k)!} = \binom{n}{k}$$
+-
+-
+- ## Example:
+ - Let $A$ be a set with $n$ elements.
+ - Then, the total number of subsets of $A$ can be counted as follows:
+ - Generic subset: An element is either in it or not
+ - For each of $n$ elements, there are 2 choices: in or not in.
+ - By Multiplicative principle, 2 \times 2 \times ... \times 2 such subsets [2^n = |P(n)|].
+ - Number of subsets with:
+ - 0
+-
+-
+-
+- # How Combinatorial Proofs Work
+ - ## Which are better: Algebraic or Combinatorial proofs?
+ - When we first study discrete mathematics, **algebraic** proofs may seem to be the easiest: they rely only using some standard formulae, and don't require any deeper insight. They are also more "familiar".
+ - However:
+ - Often, algebraic proofs are quite tricky.
+ - Usually, algebraic proofs give no insight as to why a fact is true.
+ - ## Example
+ - We wish to show that:
+ - $${\binom{n}{0}}^2 + {\binom{n}{1}}^2 + {\binom{n}{2}}^2 + ... + {\binom{n}{n}}^2 = \binom{2n}{n}$$
+ - We note that $\binom{2n}{n}$ is the total number of subsets of size $n$ in a set with $2n$ elements.
+ - Let $A$ be a set with $2n$ elements, and label them $A = \{a_1, a_2, ..., a_n, a_{n+1}, ..., a_{2n}\}$.
+ - Any subset of $A$ with $n$ elements has $k$ elements from $\{a_1 a_2, ..., a_n\}$ and $n-k$ elements from t $\{a_{n+1}, ..., a_{2n}\}$ where $k$ ranges from $0$ to $n$.
+ - There are $\displaystyle \binom{n}{k} \cdot \binom{n}{n-k}$ ways of choosing these $n$ elements by the Multiplicative Principle.
+ - So the total number of subsets with $n$ elements is $\displaystyle\sum^n_{k=0} \binom{n}{k} \binom{n}{n-k}$ and noting that $\displaystyle \binom{n}{n-k} = \binom{n}{k}$ and the results follows.
+ - ## Example
+ - Using a combinatorial argument, or otherwise, prove that
+ - $$k\binom{n}{k} = n\binom{n-1}{k-1}$$
+ - **Combinatorial Proof**:
+ - Suppose we have a panel of $n$ players and we need to choose a team of $k$ player with a distinguished player (e.g., the goalkeeper).
+ - We count how many ways we can do this.
+ - [A] Pick the team, then pick the goalie.
+ - By the Multiplicative Principle, we can pick a team of $k$ from $n$ in $\binom{n}{k}$ ways and have $k$ ways then of choosing a keeper from this.
+ - $$= k\binom{n}{k}$$
+ - [B] Pick the goalie, then pick the remainder of the team.
+ - We have $n$ choices for the goalie. then choose $k-1$ from the $n-1$ remaining players.
+ - By the Multiplicative Principle we have $\displaystyle n\binom{n-1}{k-1}$ ways.
+ - Result follows.
+ - ## What is a "Combinatorial Proof" really? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:37:08.312Z
+ card-last-reviewed:: 2022-10-07T10:37:08.313Z
+ card-last-score:: 3
+ - [1] These proofs involve finding two different ways to answer the same counting question.
+ - [2] Then, we explain why the answer to the problem posed one way is $A$.
+ - [3] Next, we explain why the answer to the problem posed the other way is $B$.
+ - [4] Since $A$ and $B$ are answers to the same question, we have shown that it must be that $A = B$.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Counting/2022-09-15T06_32_33.698Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Counting/2022-09-15T06_32_33.698Z.Desktop.md
new file mode 100644
index 00000000..b168661c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Counting/2022-09-15T06_32_33.698Z.Desktop.md
@@ -0,0 +1,39 @@
+- #[[MA284 - Discrete Mathematics]]
+- No previous topic
+- **Next topic:** [[Principle of Inclusion-Exclusion]]
+- **Relevant Slides:** 
+-
+- What is **Combinatorics**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-17T10:51:03.296Z
+ card-last-reviewed:: 2022-09-13T10:51:03.297Z
+ card-last-score:: 5
+ - **Combinatorics** is the mathematics of *counting*.
+-
+- ## The Additive & Multiplicative Principles
+ - ### The Additive Principle
+ - What is the **Additive Principle**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-13T23:00:00.000Z
+ card-last-reviewed:: 2022-09-13T10:46:53.779Z
+ card-last-score:: 1
+ - If an event $A$ can occur $m$ ways, and event $B$ can occur $n$ (disjoint) ways, then event "$A$ **or** $B$" can occur $m + n$ ways.
+ - ### The Multiplicative Principle
+ - What is the **Multiplicative Principle**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-16T11:37:21.246Z
+ card-last-reviewed:: 2022-09-12T11:37:21.246Z
+ card-last-score:: 5
+ - If event $A$ can occur $m$ ways, and each possibility allows for event $B$ to occur in $n$ (disjoint) ways, then the event "$A$ **and** $B$" can occur in $m \times n$ ways.
+-
+- ## Counting with Sets
+ - What is a **set**?
+ - A **set** is a collection of things.
+ - The items in a set are called *elements*.
+ - A set is **unordered**.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Counting/2022-09-30T10_01_42.258Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Counting/2022-09-30T10_01_42.258Z.Desktop.md
new file mode 100644
index 00000000..3d7116aa
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Counting/2022-09-30T10_01_42.258Z.Desktop.md
@@ -0,0 +1,45 @@
+- #[[MA284 - Discrete Mathematics]]
+- No previous topic
+- **Next topic:** [[Principle of Inclusion-Exclusion]]
+- **Relevant Slides:** 
+-
+- What is **Combinatorics**? #card
+ card-last-interval:: 11.16
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-30T21:29:52.224Z
+ card-last-reviewed:: 2022-09-19T18:29:52.225Z
+ card-last-score:: 5
+ - **Combinatorics** is the mathematics of *counting*.
+-
+- ## The Additive & Multiplicative Principles
+ - ### The Additive Principle
+ - What is the **Additive Principle**? #card
+ card-last-interval:: 9.84
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-29T13:43:04.372Z
+ card-last-reviewed:: 2022-09-19T17:43:04.373Z
+ card-last-score:: 5
+ - If an event $A$ can occur $m$ ways, and event $B$ can occur $n$ (disjoint) ways, then event "$A$ **or** $B$" can occur $m + n$ ways.
+ - ### The Multiplicative Principle
+ - What is the **Multiplicative Principle**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:18:14.874Z
+ card-last-reviewed:: 2022-09-18T15:18:14.874Z
+ card-last-score:: 3
+ - If event $A$ can occur $m$ ways, and each possibility allows for event $B$ to occur in $n$ (disjoint) ways, then the event "$A$ **and** $B$" can occur in $m \times n$ ways.
+-
+- ## Counting with Sets
+ - What is a **set**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-21T20:51:01.873Z
+ card-last-reviewed:: 2022-09-17T20:51:01.875Z
+ card-last-score:: 5
+ - A **set** is a collection of things.
+ - The items in a set are called *elements*.
+ - A set is **unordered**.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/DIffie-Hellman Key Exchange/2022-11-11T12_04_45.318Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/DIffie-Hellman Key Exchange/2022-11-11T12_04_45.318Z.Desktop.md
new file mode 100644
index 00000000..0a93c418
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/DIffie-Hellman Key Exchange/2022-11-11T12_04_45.318Z.Desktop.md
@@ -0,0 +1,67 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[Social Engineering]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Groups, Rings, & Fields
+ - In mathematics,
+ - a **group** is a set equipped with a binary operation that is associative, has an identity element, and is such that every element has an inverse, e.g., $(\mathbb{Z}, +)$.
+ - a **ring** is a set equipped with two binary operations satisfying properties analogous to those of addition & multiplication of integers, e.g. $(\mathbb{Z}, +, *)$.
+ - a **field** is a set on which addition, subtraction, multiplication, & division are defined and behave as the corresponding operations on rational & real numbers do.
+-
+- # Diffie-Hellman Key Exchange
+ - What is the **Diffie-Hellman Key Exchange**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-10T11:39:05.685Z
+ card-last-reviewed:: 2022-11-09T12:39:05.686Z
+ card-last-score:: 3
+ - **Diffie-Hellman** provides **secure key exchange** between two partners.
+ - The negotiated key is subsequently used for private key encryption / authentication.
+ - It uses the multiplicative group of integers modulo $n$ $(\mathbb{Z} / n \mathbb{Z})^x$.
+ - It is based on the difficulty of computing discrete logarithms over such groups, e.g.:
+ - $$6^3 \text{ mod } 17 = 216 \text{ mod } 17 =12 \text{ (easy) }$$
+ - $$12 = 6 ^y \text{ mod } 17 ? \text{ hard }$$
+ - The core equation for the key exchange is
+ - $$K = (A)^B \text{ mod } q$$
+ - ## Diffie-Hellman: Global Public Elements
+ - Select a prime number $q$ and positive and a positive integer $a$, where $a < q$ and $a$ is a **primitive root** of $q$.
+ - What is a **primitive root**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:41:19.113Z
+ card-last-score:: 1
+ - $a$ is a **primitive root** of $q$, if numbers $a \text{ mod } q, a^2 \text{ mod } q, \cdots , a^{q-1} \text{ mod } q$ are distinct integer values between $1$ and $(q-1)$ in some permutation, i.e., elements of $(\mathbb{Z} / q \mathbb{Z})^x$.
+ - **Example:** $a = 3$ is a primitive root of $(\mathbb{Z} / 5\mathbb{Z})^x$, $a=4$ is not:
+ background-color:: green
+ - ## Generation of Secret-Key
+ - Both users share a public prime number $q$ and primitive root $a$.
+ - User A:
+ - 1. Select secret number $XA$ with $XA < q$.
+ 2. Calculate public value $YA = a^{XA} \text{ mod } q$ (difficult to reverse).
+ 3. $YA$ is sent to User B.
+ - User B:
+ - 1. Select secret number $XB$ with $XB < q$.
+ 2. Calculate public value $YB = a^{XB} \text{ mod } q$ (difficult to reverse).
+ 3. $YB$ is sent to User A.
+ - User A:
+ - User A owns $XA$ and receives $YB$.
+ - Generate secret key: $K = (YB)^{XA} \text{ mod } q$.
+ - User B:
+ - User B owns $XB$ and receives $YA$.
+ - Generate secret key: $K = (YA)^{XB} \text{ mod } q$.
+ - Both keys are identical.
+ - ## Diffie-Hellman in Practice
+ - The algorithm is used in tandem with a variety of secure network protocols.
+ - Provision of secure end-to-end connection.
+ - No endpoint authentication - you can't validate who you are talking to.
+ - Modulus $p$ typically has a minimum length of 1024 bits.
+ - ## DH & Man-in-the-Middle (MitM) Attacks
+ - 
+ - Mallory is a MitM attacker and performs message interception & message fabrication.
+ - Mallory establishes two individual (secure) connections with Alice & Bob.
+ - Neither Alice nor Bob are aware of Mallory's existence (as there is no authentication).
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Database System Introduction/2022-10-10T11_59_52.373Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Database System Introduction/2022-10-10T11_59_52.373Z.Desktop.md
new file mode 100644
index 00000000..3a43e840
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Database System Introduction/2022-10-10T11_59_52.373Z.Desktop.md
@@ -0,0 +1,108 @@
+- #[[CT230 - Database Systems I]]
+- No previous topic
+- **Next Topic:** [[The Relational Model]]
+- **Relevant Slides:** 
+-
+- What is a **database**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:12:15.766Z
+ card-last-reviewed:: 2022-09-30T12:12:15.767Z
+ card-last-score:: 3
+ - A **database** is ^^a collection of related data.^^
+-
+- What is the **Database Approach**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T10:35:42.411Z
+ card-last-reviewed:: 2022-10-07T10:35:42.412Z
+ card-last-score:: 3
+ - A **single repository** of data (which may be distributed) is maintained that is **defined once** and then accessed by various users via a **DBMS**.
+- ## Database Management Systems
+ - What is a **DBMS**? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:02.196Z
+ card-last-reviewed:: 2022-10-03T11:42:02.196Z
+ card-last-score:: 3
+ - The **DataBase Management System (DBMS)** is a collection of programs that facilitates the process of ^^defining, constructing, & manipulating^^ databases for various applications.
+ - ### DBMS Capabilities #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T20:27:57.126Z
+ card-last-reviewed:: 2022-10-03T14:27:57.127Z
+ card-last-score:: 3
+ - 1. **Define** database (DDL)
+ 2. **Manipulate** database (SQL)
+ 3. **Control** redundancy
+ 4. **Restrict** unauthorised access
+ 5. **Enforce** integrity constraints
+ 6. Provide multiple user interfaces / **views**
+ 7. Provide **concurrent access**
+ 8. Provide mechanism for **recovery**
+ 9. Provide **back-up**
+ 10. Allows representation of complex relationships between data (For efficiency & optimisation reasons)
+ -
+ - ### Disadvantages of DBMS approach #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:17:45.706Z
+ card-last-reviewed:: 2022-10-01T13:17:45.707Z
+ card-last-score:: 5
+ - Strict schema & multiple tables / relations
+ - Complexity
+ - Size
+ - Cost of DBMS
+ - Additional hardware costs
+ - Cost of conversion
+ - Performance
+ - Higher impact of failure
+ - ### DBMS Users #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T10:38:38.838Z
+ card-last-reviewed:: 2022-10-07T10:38:38.839Z
+ card-last-score:: 3
+ - **Administrators (DBA)** - accounts, passwords, privileges. Requiring constant vigilance
+ - **System Analysts** - "What's required to solve a problem? What does the business need?"
+ - **Designers** - ER diagrams, mapping ER diagrams to tables
+ - **Application Programmers** - creating tables, adding data, creating queries
+ - **End users**
+-
+- What is **Database Abstraction**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-10T19:18:04.573Z
+ card-last-reviewed:: 2022-10-01T13:18:04.573Z
+ card-last-score:: 3
+ - **Database Abstraction** refers to the hiding of the details of data storage that are not needed by most database users.
+ - The aim is to separate user's views of the database from the way that it is "physically" represented.
+ - 3 ways in which data can be described:
+ - **External:** user's view
+ - **Conceptual:** logical structure as seen by DBA
+ - **Internal:** DBMS and OS view of data
+- What is the database **schema**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:10:33.547Z
+ card-last-reviewed:: 2022-09-30T12:10:33.548Z
+ card-last-score:: 3
+ - The database **schema** is the ^^logical structure of the database.^^
+- What is the database **instance**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:01.333Z
+ card-last-reviewed:: 2022-10-03T14:29:01.333Z
+ card-last-score:: 5
+ - The database **instance** is ^^the actual content of the database at some point in time.^^
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Database System Introduction/2022-10-20T09_05_57.932Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Database System Introduction/2022-10-20T09_05_57.932Z.Desktop.md
new file mode 100644
index 00000000..2d100cd1
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Database System Introduction/2022-10-20T09_05_57.932Z.Desktop.md
@@ -0,0 +1,108 @@
+- #[[CT230 - Database Systems I]]
+- No previous topic
+- **Next Topic:** [[The Relational Model]]
+- **Relevant Slides:** 
+-
+- What is a **database**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:12:15.766Z
+ card-last-reviewed:: 2022-09-30T12:12:15.767Z
+ card-last-score:: 3
+ - A **database** is ^^a collection of related data.^^
+-
+- What is the **Database Approach**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T10:35:42.411Z
+ card-last-reviewed:: 2022-10-07T10:35:42.412Z
+ card-last-score:: 3
+ - A **single repository** of data (which may be distributed) is maintained that is **defined once** and then accessed by various users via a **DBMS**.
+- ## Database Management Systems
+ - What is a **DBMS**? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:02.196Z
+ card-last-reviewed:: 2022-10-03T11:42:02.196Z
+ card-last-score:: 3
+ - The **DataBase Management System (DBMS)** is a collection of programs that facilitates the process of ^^defining, constructing, & manipulating^^ databases for various applications.
+ - ### DBMS Capabilities #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T20:27:57.126Z
+ card-last-reviewed:: 2022-10-03T14:27:57.127Z
+ card-last-score:: 3
+ - 1. **Define** database (DDL)
+ 2. **Manipulate** database (SQL)
+ 3. **Control** redundancy
+ 4. **Restrict** unauthorised access
+ 5. **Enforce** integrity constraints
+ 6. Provide multiple user interfaces / **views**
+ 7. Provide **concurrent access**
+ 8. Provide mechanism for **recovery**
+ 9. Provide **back-up**
+ 10. Allows representation of complex relationships between data (For efficiency & optimisation reasons)
+ -
+ - ### Disadvantages of DBMS approach #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:17:45.706Z
+ card-last-reviewed:: 2022-10-01T13:17:45.707Z
+ card-last-score:: 5
+ - Strict schema & multiple tables / relations
+ - Complexity
+ - Size
+ - Cost of DBMS
+ - Additional hardware costs
+ - Cost of conversion
+ - Performance
+ - Higher impact of failure
+ - ### DBMS Users #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T10:38:38.838Z
+ card-last-reviewed:: 2022-10-07T10:38:38.839Z
+ card-last-score:: 3
+ - **Administrators (DBA)** - accounts, passwords, privileges. Requiring constant vigilance
+ - **System Analysts** - "What's required to solve a problem? What does the business need?"
+ - **Designers** - ER diagrams, mapping ER diagrams to tables
+ - **Application Programmers** - creating tables, adding data, creating queries
+ - **End users**
+-
+- What is **Database Abstraction**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-10T19:18:04.573Z
+ card-last-reviewed:: 2022-10-01T13:18:04.573Z
+ card-last-score:: 3
+ - **Database Abstraction** refers to the hiding of the details of data storage that are not needed by most database users.
+ - The aim is to separate user's views of the database from the way that it is "physically" represented.
+ - 3 ways in which data can be described:
+ - **External:** user's view
+ - **Conceptual:** logical structure as seen by DBA
+ - **Internal:** DBMS and OS view of data
+- What is the database **schema**? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-02T21:44:54.610Z
+ card-last-reviewed:: 2022-10-10T11:44:54.610Z
+ card-last-score:: 5
+ - The database **schema** is the ^^logical structure of the database.^^
+- What is the database **instance**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:01.333Z
+ card-last-reviewed:: 2022-10-03T14:29:01.333Z
+ card-last-score:: 5
+ - The database **instance** is ^^the actual content of the database at some point in time.^^
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Database System Introduction/2022-11-09T13_03_58.102Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Database System Introduction/2022-11-09T13_03_58.102Z.Desktop.md
new file mode 100644
index 00000000..2ba9f10c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Database System Introduction/2022-11-09T13_03_58.102Z.Desktop.md
@@ -0,0 +1,108 @@
+- #[[CT230 - Database Systems I]]
+- No previous topic
+- **Next Topic:** [[The Relational Model]]
+- **Relevant Slides:** 
+-
+- What is a **database**? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-12T18:33:52.240Z
+ card-last-reviewed:: 2022-10-20T08:33:52.241Z
+ card-last-score:: 3
+ - A **database** is ^^a collection of related data.^^
+-
+- What is the **Database Approach**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T10:35:42.411Z
+ card-last-reviewed:: 2022-10-07T10:35:42.412Z
+ card-last-score:: 3
+ - A **single repository** of data (which may be distributed) is maintained that is **defined once** and then accessed by various users via a **DBMS**.
+- ## Database Management Systems
+ - What is a **DBMS**? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:02.196Z
+ card-last-reviewed:: 2022-10-03T11:42:02.196Z
+ card-last-score:: 3
+ - The **DataBase Management System (DBMS)** is a collection of programs that facilitates the process of ^^defining, constructing, & manipulating^^ databases for various applications.
+ - ### DBMS Capabilities #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T20:27:57.126Z
+ card-last-reviewed:: 2022-10-03T14:27:57.127Z
+ card-last-score:: 3
+ - 1. **Define** database (DDL)
+ 2. **Manipulate** database (SQL)
+ 3. **Control** redundancy
+ 4. **Restrict** unauthorised access
+ 5. **Enforce** integrity constraints
+ 6. Provide multiple user interfaces / **views**
+ 7. Provide **concurrent access**
+ 8. Provide mechanism for **recovery**
+ 9. Provide **back-up**
+ 10. Allows representation of complex relationships between data (For efficiency & optimisation reasons)
+ -
+ - ### Disadvantages of DBMS approach #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:17:45.706Z
+ card-last-reviewed:: 2022-10-01T13:17:45.707Z
+ card-last-score:: 5
+ - Strict schema & multiple tables / relations
+ - Complexity
+ - Size
+ - Cost of DBMS
+ - Additional hardware costs
+ - Cost of conversion
+ - Performance
+ - Higher impact of failure
+ - ### DBMS Users #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T10:38:38.838Z
+ card-last-reviewed:: 2022-10-07T10:38:38.839Z
+ card-last-score:: 3
+ - **Administrators (DBA)** - accounts, passwords, privileges. Requiring constant vigilance
+ - **System Analysts** - "What's required to solve a problem? What does the business need?"
+ - **Designers** - ER diagrams, mapping ER diagrams to tables
+ - **Application Programmers** - creating tables, adding data, creating queries
+ - **End users**
+-
+- What is **Database Abstraction**? #card
+ card-last-interval:: 19.01
+ card-repeats:: 4
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-11-08T08:37:10.629Z
+ card-last-reviewed:: 2022-10-20T08:37:10.629Z
+ card-last-score:: 3
+ - **Database Abstraction** refers to the hiding of the details of data storage that are not needed by most database users.
+ - The aim is to separate user's views of the database from the way that it is "physically" represented.
+ - 3 ways in which data can be described:
+ - **External:** user's view
+ - **Conceptual:** logical structure as seen by DBA
+ - **Internal:** DBMS and OS view of data
+- What is the database **schema**? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-02T21:44:54.610Z
+ card-last-reviewed:: 2022-10-10T11:44:54.610Z
+ card-last-score:: 5
+ - The database **schema** is the ^^logical structure of the database.^^
+- What is the database **instance**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:01.333Z
+ card-last-reviewed:: 2022-10-03T14:29:01.333Z
+ card-last-score:: 5
+ - The database **instance** is ^^the actual content of the database at some point in time.^^
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Definitions & Planar Graphs/2022-11-11T12_04_45.324Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Definitions & Planar Graphs/2022-11-11T12_04_45.324Z.Desktop.md
new file mode 100644
index 00000000..c3f69bda
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Definitions & Planar Graphs/2022-11-11T12_04_45.324Z.Desktop.md
@@ -0,0 +1,128 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Introduction to Graph Theory]]
+- **Next Topic:** [[Convex Polyhedra]]
+- **Relevant Slides:** 
+-
+- # Definitions
+ - What is a **walk**? #card
+ - A **walk** is a sequence of vertices such that consecutive vertices are adjacent.
+ - What is a **trail**? #card
+ - A **trail** is a walk in which no edge is repeated.
+ - What is a **path**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-08T00:00:00.000Z
+ card-last-reviewed:: 2022-11-07T08:29:15.009Z
+ card-last-score:: 1
+ - A **path** is a trail in which no vertex is repeated, except possibly the first & last.
+ - The path on $n$ vertices is denoted $P_n$.
+ - ## Example
+ -
+ {{renderer :mermaid_uiukfrr}}
+ - ```mermaid
+ flowchart LR
+ B((B)) --- A((A))
+ B --- C((C))
+ C --- E((E))
+ E --- D((D))
+ B --- E --- A
+
+ ```
+ - $(a,b,c,e,d)$ is a **walk**.
+ - So too is $(a,b,e,a,b,c)$ (not a trail or a path).
+ -
+ - What is the **length** of a path? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-08T00:00:00.000Z
+ card-last-reviewed:: 2022-11-07T08:29:37.150Z
+ card-last-score:: 1
+ - The **length** of a path is the number of edges in the sequence.
+ - ## Cycles & Circuits
+ - What is a **cycle**? #card
+ - A **cycle** is a path that begins & ends at the same vertex, but no other vertex is repeated.
+ - A cycle on $n$ vertices is denoted $C_n$.
+ - What is a **circuit**? #card
+ - A **circuit** is a path that begins & ends at the same vertex, and no edge is repeated.
+ - What does it mean if a graph is **connected**? #card
+ - A graph is **connected** if there is a path between every pair of vertices.
+ - What is the **degree** of a vertex? #card
+ - The **degree** of a vertex is the number of edges emanating from it.
+ - If $v$ is a vertex, we denote its degree as $d(v)$.
+ - ## Handshaking Lemma
+ - If we know the degree of every vertex in the graph, then we know the number of edges. This is the **Handshaking Lemma**.
+ - What is the **Handshaking Lemma**? #card
+ - In any graph, the sum of the degrees of vertices in the graph, is always twice the number of edges.
+ - $$\sum_{v \in V} d(v) = 2|E|$$
+- # Types of Graphs
+ - What is a **Complete** Graph? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-08T00:00:00.000Z
+ card-last-reviewed:: 2022-11-07T08:29:22.503Z
+ card-last-score:: 1
+ - A graph is **complete** if every pair of vertices is adjacent.
+ - This family of graphs is very important.
+ - Complete graphs are denoted $K_n$ - the complete graph on $n$ vertices.
+ - What is a **Bipartite Graph**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-08T00:00:00.000Z
+ card-last-reviewed:: 2022-11-07T08:30:00.319Z
+ card-last-score:: 1
+ - A graph is **bipartite** if it is possible to partition the vertex set, $V$, into two disjoint sets, $V_1$ & $V_2$, such that there are no edges between any two vertices in the same set.
+ - What is a **Complete Bipartite** graph? #card
+ - If a bipartite graph is such that *every* vertex in $V_1$ is connected to *every* vertex in $V_2$ (and vice versa), the graph is a **complete bipartite graph**.
+ - If $|V_1| = m$ and $|V_2| = n$, we denote it $K_{m,n}$.
+ - What is a **subgraph**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-08T00:00:00.000Z
+ card-last-reviewed:: 2022-11-07T08:30:55.795Z
+ card-last-score:: 1
+ - We say that $G_1 = (V_1, E_1)$ is a **subgraph** of $G_2 = (V_2, E_2)$ provided $V_1 \subset V_2$ and $E_1 \subset E_2$.
+ - What is an **induced subgraph**? #card
+ - We say that $G_1(V_1, E_1)$ is an **induced subgraph** of $G_2 = (V_2, E_2)$ provided that $V_1 \subset V_2$ and $E_2$ contains **all** edges of $E_1$ which join edges in $V_1$.
+-
+- # Planar Graphs
+ - What is a **planar graph**? #card
+ - If you can sketch a graph such that none of its edges cross, it is a **planar graph**.
+ - What is a **face**? #card
+ - When a planar graph is drawn without edges crossing, the edges & vertices of the graph divide the plane into regions called **faces**.
+ - The number of faces does not change no matter how you draw the graph, as long as no edges cross.
+ -
+ - ## Example
+ - The graph $K_{2,3}$ is **planar**.
+ background-color:: red
+ - 
+ - [[draws/2022-10-28-11-04-05.excalidraw]]
+ - The planar representation $K_{2,3}$ has **3 faces** (the "outside" region counts as a face).
+ - Give a planar representation of $K_4$, and count how many faces it has.
+ background-color:: red
+ - [[draws/2022-10-28-11-22-12.excalidraw]]
+ - Why "face"?
+ background-color:: red
+ - [[draws/2022-10-28-11-25-20.excalidraw]]
+- # Euler's Formula for Planar Graphs #card
+ - For any ^^(connected) planar graph^^ with $v$ vertices, $e$ edges, and $f$ faces, we have:
+ - $$v - e + f = 2$$
+ - ## Outline of Proof
+ - Start with $P_2$.
+ - Here, $v=2$, $e = 1$, $f=1$. So $v-e+f=2$.
+ - Any other graph can be made by adding vertices & edges (or just edges) to $P_2$.
+ - Suppose $v-e+f=2$ for a graph.
+ - If we add a new edge *with* a new vertex, then no new face is created, so $v-e+f$ does not change.
+ - If we add a new edge *without* a new vertex, then $f$ will increase by 1, so again, $v-e+f$ does not change.
+ - ## Example
+ - Is it possible for a connected planar graph to have 5 vertices, 7 edges, and 3 faces? Explain.
+ background-color:: red
+ - No. Euler's formula tells us that $v-e+f=2$.
+ - Here, $v=5$, $e=7$, $f=3$, so $v-e+f=1$.
+ - Any such graph is **not planar**.
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Definitions & Planar Graphs/2022-11-23T09_22_44.496Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Definitions & Planar Graphs/2022-11-23T09_22_44.496Z.Desktop.md
new file mode 100644
index 00000000..667a70dc
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Definitions & Planar Graphs/2022-11-23T09_22_44.496Z.Desktop.md
@@ -0,0 +1,200 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Introduction to Graph Theory]]
+- **Next Topic:** [[Convex Polyhedra]]
+- **Relevant Slides:** 
+-
+- # Definitions
+ - What is a **walk**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:23:27.284Z
+ card-last-score:: 1
+ - A **walk** is a sequence of vertices such that consecutive vertices are adjacent.
+ - What is a **trail**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:14:59.935Z
+ card-last-score:: 1
+ - A **trail** is a walk in which no edge is repeated.
+ - What is a **path**? #card
+ card-last-interval:: 0.9
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T17:22:40.523Z
+ card-last-reviewed:: 2022-11-14T20:22:40.524Z
+ card-last-score:: 3
+ - A **path** is a trail in which no vertex is repeated, except possibly the first & last.
+ - The path on $n$ vertices is denoted $P_n$.
+ - ## Example
+ -
+ {{renderer :mermaid_uiukfrr}}
+ - ```mermaid
+ flowchart LR
+ B((B)) --- A((A))
+ B --- C((C))
+ C --- E((E))
+ E --- D((D))
+ B --- E --- A
+
+ ```
+ - $(a,b,c,e,d)$ is a **walk**.
+ - So too is $(a,b,e,a,b,c)$ (not a trail or a path).
+ -
+ - What is the **length** of a path? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:22:48.413Z
+ card-last-score:: 1
+ - The **length** of a path is the number of edges in the sequence.
+ - ## Cycles & Circuits
+ - What is a **cycle**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:50:16.908Z
+ card-last-score:: 1
+ - A **cycle** is a path that begins & ends at the same vertex, but no other vertex is repeated.
+ - A cycle on $n$ vertices is denoted $C_n$.
+ - What is a **circuit**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-22T00:00:00.000Z
+ card-last-reviewed:: 2022-11-21T13:05:28.290Z
+ card-last-score:: 1
+ - A **circuit** is a path that begins & ends at the same vertex, and no edge is repeated.
+ - What does it mean if a graph is **connected**? #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T11:16:09.571Z
+ card-last-reviewed:: 2022-11-14T16:16:09.572Z
+ card-last-score:: 5
+ - A graph is **connected** if there is a path between every pair of vertices.
+ - What is the **degree** of a vertex? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-25T13:10:12.122Z
+ card-last-reviewed:: 2022-11-21T13:10:12.123Z
+ card-last-score:: 5
+ - The **degree** of a vertex is the number of edges emanating from it.
+ - If $v$ is a vertex, we denote its degree as $d(v)$.
+ - ## Handshaking Lemma
+ - If we know the degree of every vertex in the graph, then we know the number of edges. This is the **Handshaking Lemma**.
+ - What is the **Handshaking Lemma**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:54:11.744Z
+ card-last-score:: 1
+ - In any graph, the sum of the degrees of vertices in the graph, is always twice the number of edges.
+ - $$\sum_{v \in V} d(v) = 2|E|$$
+- # Types of Graphs
+ - What is a **Complete** Graph? #card
+ card-last-interval:: 0.9
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T17:23:00.989Z
+ card-last-reviewed:: 2022-11-14T20:23:00.990Z
+ card-last-score:: 3
+ - A graph is **complete** if every pair of vertices is adjacent.
+ - This family of graphs is very important.
+ - Complete graphs are denoted $K_n$ - the complete graph on $n$ vertices.
+ - What is a **Bipartite Graph**? #card
+ card-last-interval:: 8.35
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-29T21:09:36.899Z
+ card-last-reviewed:: 2022-11-21T13:09:36.899Z
+ card-last-score:: 5
+ - A graph is **bipartite** if it is possible to partition the vertex set, $V$, into two disjoint sets, $V_1$ & $V_2$, such that there are no edges between any two vertices in the same set.
+ - What is a **Complete Bipartite** graph? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:51:45.394Z
+ card-last-score:: 1
+ - If a bipartite graph is such that *every* vertex in $V_1$ is connected to *every* vertex in $V_2$ (and vice versa), the graph is a **complete bipartite graph**.
+ - If $|V_1| = m$ and $|V_2| = n$, we denote it $K_{m,n}$.
+ - What is a **subgraph**? #card
+ card-last-interval:: 3.05
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T21:23:07.436Z
+ card-last-reviewed:: 2022-11-14T20:23:07.436Z
+ card-last-score:: 5
+ - We say that $G_1 = (V_1, E_1)$ is a **subgraph** of $G_2 = (V_2, E_2)$ provided $V_1 \subset V_2$ and $E_1 \subset E_2$.
+ - What is an **induced subgraph**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:49:58.981Z
+ card-last-score:: 1
+ - We say that $G_1(V_1, E_1)$ is an **induced subgraph** of $G_2 = (V_2, E_2)$ provided that $V_1 \subset V_2$ and $E_2$ contains **all** edges of $E_1$ which join edges in $V_1$.
+-
+- # Planar Graphs
+ - What is a **planar graph**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:19:45.615Z
+ card-last-score:: 1
+ - If you can sketch a graph such that none of its edges cross, it is a **planar graph**.
+ - What is a **face**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T15:22:52.013Z
+ card-last-reviewed:: 2022-11-14T16:22:52.013Z
+ card-last-score:: 3
+ - When a planar graph is drawn without edges crossing, the edges & vertices of the graph divide the plane into regions called **faces**.
+ - The number of faces does not change no matter how you draw the graph, as long as no edges cross.
+ -
+ - ## Example
+ - The graph $K_{2,3}$ is **planar**.
+ background-color:: red
+ - 
+ - [[draws/2022-10-28-11-04-05.excalidraw]]
+ - The planar representation $K_{2,3}$ has **3 faces** (the "outside" region counts as a face).
+ - Give a planar representation of $K_4$, and count how many faces it has.
+ background-color:: red
+ - [[draws/2022-10-28-11-22-12.excalidraw]]
+ - Why "face"?
+ background-color:: red
+ - [[draws/2022-10-28-11-25-20.excalidraw]]
+- # Euler's Formula for Planar Graphs #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:18:07.821Z
+ card-last-score:: 1
+ - For any ^^(connected) planar graph^^ with $v$ vertices, $e$ edges, and $f$ faces, we have:
+ - $$v - e + f = 2$$
+ - ## Outline of Proof
+ - Start with $P_2$.
+ - Here, $v=2$, $e = 1$, $f=1$. So $v-e+f=2$.
+ - Any other graph can be made by adding vertices & edges (or just edges) to $P_2$.
+ - Suppose $v-e+f=2$ for a graph.
+ - If we add a new edge *with* a new vertex, then no new face is created, so $v-e+f$ does not change.
+ - If we add a new edge *without* a new vertex, then $f$ will increase by 1, so again, $v-e+f$ does not change.
+ - ## Example
+ - Is it possible for a connected planar graph to have 5 vertices, 7 edges, and 3 faces? Explain.
+ background-color:: red
+ - No. Euler's formula tells us that $v-e+f=2$.
+ - Here, $v=5$, $e=7$, $f=3$, so $v-e+f=1$.
+ - Any such graph is **not planar**.
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Definitions & Planar Graphs/2022-11-23T12_15_36.859Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Definitions & Planar Graphs/2022-11-23T12_15_36.859Z.Desktop.md
new file mode 100644
index 00000000..667a70dc
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Definitions & Planar Graphs/2022-11-23T12_15_36.859Z.Desktop.md
@@ -0,0 +1,200 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Introduction to Graph Theory]]
+- **Next Topic:** [[Convex Polyhedra]]
+- **Relevant Slides:** 
+-
+- # Definitions
+ - What is a **walk**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:23:27.284Z
+ card-last-score:: 1
+ - A **walk** is a sequence of vertices such that consecutive vertices are adjacent.
+ - What is a **trail**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:14:59.935Z
+ card-last-score:: 1
+ - A **trail** is a walk in which no edge is repeated.
+ - What is a **path**? #card
+ card-last-interval:: 0.9
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T17:22:40.523Z
+ card-last-reviewed:: 2022-11-14T20:22:40.524Z
+ card-last-score:: 3
+ - A **path** is a trail in which no vertex is repeated, except possibly the first & last.
+ - The path on $n$ vertices is denoted $P_n$.
+ - ## Example
+ -
+ {{renderer :mermaid_uiukfrr}}
+ - ```mermaid
+ flowchart LR
+ B((B)) --- A((A))
+ B --- C((C))
+ C --- E((E))
+ E --- D((D))
+ B --- E --- A
+
+ ```
+ - $(a,b,c,e,d)$ is a **walk**.
+ - So too is $(a,b,e,a,b,c)$ (not a trail or a path).
+ -
+ - What is the **length** of a path? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:22:48.413Z
+ card-last-score:: 1
+ - The **length** of a path is the number of edges in the sequence.
+ - ## Cycles & Circuits
+ - What is a **cycle**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:50:16.908Z
+ card-last-score:: 1
+ - A **cycle** is a path that begins & ends at the same vertex, but no other vertex is repeated.
+ - A cycle on $n$ vertices is denoted $C_n$.
+ - What is a **circuit**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-22T00:00:00.000Z
+ card-last-reviewed:: 2022-11-21T13:05:28.290Z
+ card-last-score:: 1
+ - A **circuit** is a path that begins & ends at the same vertex, and no edge is repeated.
+ - What does it mean if a graph is **connected**? #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T11:16:09.571Z
+ card-last-reviewed:: 2022-11-14T16:16:09.572Z
+ card-last-score:: 5
+ - A graph is **connected** if there is a path between every pair of vertices.
+ - What is the **degree** of a vertex? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-25T13:10:12.122Z
+ card-last-reviewed:: 2022-11-21T13:10:12.123Z
+ card-last-score:: 5
+ - The **degree** of a vertex is the number of edges emanating from it.
+ - If $v$ is a vertex, we denote its degree as $d(v)$.
+ - ## Handshaking Lemma
+ - If we know the degree of every vertex in the graph, then we know the number of edges. This is the **Handshaking Lemma**.
+ - What is the **Handshaking Lemma**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:54:11.744Z
+ card-last-score:: 1
+ - In any graph, the sum of the degrees of vertices in the graph, is always twice the number of edges.
+ - $$\sum_{v \in V} d(v) = 2|E|$$
+- # Types of Graphs
+ - What is a **Complete** Graph? #card
+ card-last-interval:: 0.9
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T17:23:00.989Z
+ card-last-reviewed:: 2022-11-14T20:23:00.990Z
+ card-last-score:: 3
+ - A graph is **complete** if every pair of vertices is adjacent.
+ - This family of graphs is very important.
+ - Complete graphs are denoted $K_n$ - the complete graph on $n$ vertices.
+ - What is a **Bipartite Graph**? #card
+ card-last-interval:: 8.35
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-29T21:09:36.899Z
+ card-last-reviewed:: 2022-11-21T13:09:36.899Z
+ card-last-score:: 5
+ - A graph is **bipartite** if it is possible to partition the vertex set, $V$, into two disjoint sets, $V_1$ & $V_2$, such that there are no edges between any two vertices in the same set.
+ - What is a **Complete Bipartite** graph? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:51:45.394Z
+ card-last-score:: 1
+ - If a bipartite graph is such that *every* vertex in $V_1$ is connected to *every* vertex in $V_2$ (and vice versa), the graph is a **complete bipartite graph**.
+ - If $|V_1| = m$ and $|V_2| = n$, we denote it $K_{m,n}$.
+ - What is a **subgraph**? #card
+ card-last-interval:: 3.05
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T21:23:07.436Z
+ card-last-reviewed:: 2022-11-14T20:23:07.436Z
+ card-last-score:: 5
+ - We say that $G_1 = (V_1, E_1)$ is a **subgraph** of $G_2 = (V_2, E_2)$ provided $V_1 \subset V_2$ and $E_1 \subset E_2$.
+ - What is an **induced subgraph**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:49:58.981Z
+ card-last-score:: 1
+ - We say that $G_1(V_1, E_1)$ is an **induced subgraph** of $G_2 = (V_2, E_2)$ provided that $V_1 \subset V_2$ and $E_2$ contains **all** edges of $E_1$ which join edges in $V_1$.
+-
+- # Planar Graphs
+ - What is a **planar graph**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:19:45.615Z
+ card-last-score:: 1
+ - If you can sketch a graph such that none of its edges cross, it is a **planar graph**.
+ - What is a **face**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T15:22:52.013Z
+ card-last-reviewed:: 2022-11-14T16:22:52.013Z
+ card-last-score:: 3
+ - When a planar graph is drawn without edges crossing, the edges & vertices of the graph divide the plane into regions called **faces**.
+ - The number of faces does not change no matter how you draw the graph, as long as no edges cross.
+ -
+ - ## Example
+ - The graph $K_{2,3}$ is **planar**.
+ background-color:: red
+ - 
+ - [[draws/2022-10-28-11-04-05.excalidraw]]
+ - The planar representation $K_{2,3}$ has **3 faces** (the "outside" region counts as a face).
+ - Give a planar representation of $K_4$, and count how many faces it has.
+ background-color:: red
+ - [[draws/2022-10-28-11-22-12.excalidraw]]
+ - Why "face"?
+ background-color:: red
+ - [[draws/2022-10-28-11-25-20.excalidraw]]
+- # Euler's Formula for Planar Graphs #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:18:07.821Z
+ card-last-score:: 1
+ - For any ^^(connected) planar graph^^ with $v$ vertices, $e$ edges, and $f$ faces, we have:
+ - $$v - e + f = 2$$
+ - ## Outline of Proof
+ - Start with $P_2$.
+ - Here, $v=2$, $e = 1$, $f=1$. So $v-e+f=2$.
+ - Any other graph can be made by adding vertices & edges (or just edges) to $P_2$.
+ - Suppose $v-e+f=2$ for a graph.
+ - If we add a new edge *with* a new vertex, then no new face is created, so $v-e+f$ does not change.
+ - If we add a new edge *without* a new vertex, then $f$ will increase by 1, so again, $v-e+f$ does not change.
+ - ## Example
+ - Is it possible for a connected planar graph to have 5 vertices, 7 edges, and 3 faces? Explain.
+ background-color:: red
+ - No. Euler's formula tells us that $v-e+f=2$.
+ - Here, $v=5$, $e=7$, $f=3$, so $v-e+f=1$.
+ - Any such graph is **not planar**.
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-09-30T10_01_42.259Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-09-30T10_01_42.259Z.Desktop.md
new file mode 100644
index 00000000..3f7e220b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-09-30T10_01_42.259Z.Desktop.md
@@ -0,0 +1,24 @@
+- #[[ST2001 Labs]]
+- **Previous Topic:** [[Using R as a Calculator]]
+- **Next Topic:** null
+-
+- Most of our computation in R will be using data in table form, with rows & columns, which are often stored as a `data.frame` object.
+ - The rows usually represent different *observations*, (e.g., humans, cars, etc.) and the columns represent different *variables* (features of the observation), (e.g., height, weight, etc.).
+-
+- What does `glimpse()` do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T17:43:30.690Z
+ card-last-score:: 1
+ - The `glimpse()` function gives us an overview of the dataset on each experimental unit.
+- What does `dim()` do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:03:27.442Z
+ card-last-score:: 1
+ - The `dim()` function returns the number of rows & columns in a dataframe.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-10-07T08_33_33.308Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-10-07T08_33_33.308Z.Desktop.md
new file mode 100644
index 00000000..8c1a1c61
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-10-07T08_33_33.308Z.Desktop.md
@@ -0,0 +1,24 @@
+- #[[ST2001 Labs]]
+- **Previous Topic:** [[Using R as a Calculator]]
+- **Next Topic:** null
+-
+- Most of our computation in R will be using data in table form, with rows & columns, which are often stored as a `data.frame` object.
+ - The rows usually represent different *observations*, (e.g., humans, cars, etc.) and the columns represent different *variables* (features of the observation), (e.g., height, weight, etc.).
+-
+- What does `glimpse()` do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T09:23:35.496Z
+ card-last-score:: 1
+ - The `glimpse()` function gives us an overview of the dataset on each experimental unit.
+- What does `dim()` do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T09:23:32.281Z
+ card-last-score:: 1
+ - The `dim()` function returns the number of rows & columns in a dataframe.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-10-10T11_59_52.375Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-10-10T11_59_52.375Z.Desktop.md
new file mode 100644
index 00000000..947ed490
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-10-10T11_59_52.375Z.Desktop.md
@@ -0,0 +1,24 @@
+- #[[ST2001 Labs]]
+- **Previous Topic:** [[Using R as a Calculator]]
+- **Next Topic:** null
+-
+- Most of our computation in R will be using data in table form, with rows & columns, which are often stored as a `data.frame` object.
+ - The rows usually represent different *observations*, (e.g., humans, cars, etc.) and the columns represent different *variables* (features of the observation), (e.g., height, weight, etc.).
+-
+- What does `glimpse()` do? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:21:42.690Z
+ card-last-reviewed:: 2022-10-06T17:21:42.691Z
+ card-last-score:: 5
+ - The `glimpse()` function gives us an overview of the dataset on each experimental unit.
+- What does `dim()` do? #card
+ card-last-interval:: 0.81
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T17:48:26.089Z
+ card-last-reviewed:: 2022-10-08T22:48:26.089Z
+ card-last-score:: 3
+ - The `dim()` function returns the number of rows & columns in a dataframe.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-10-20T09_05_57.937Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-10-20T09_05_57.937Z.Desktop.md
new file mode 100644
index 00000000..f2247bd7
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Describing Data in R/2022-10-20T09_05_57.937Z.Desktop.md
@@ -0,0 +1,24 @@
+- #[[ST2001 Labs]]
+- **Previous Topic:** [[Using R as a Calculator]]
+- **Next Topic:** null
+-
+- Most of our computation in R will be using data in table form, with rows & columns, which are often stored as a `data.frame` object.
+ - The rows usually represent different *observations*, (e.g., humans, cars, etc.) and the columns represent different *variables* (features of the observation), (e.g., height, weight, etc.).
+-
+- What does `glimpse()` do? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:21:42.690Z
+ card-last-reviewed:: 2022-10-06T17:21:42.691Z
+ card-last-score:: 5
+ - The `glimpse()` function gives us an overview of the dataset on each experimental unit.
+- What does `dim()` do? #card
+ card-last-interval:: 7.48
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-17T22:44:50.782Z
+ card-last-reviewed:: 2022-10-10T11:44:50.783Z
+ card-last-score:: 5
+ - The `dim()` function returns the number of rows & columns in a dataframe.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Discrete Probability Distributions%3A Binomial & Poisson/2022-10-18T11_54_19.981Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Discrete Probability Distributions%3A Binomial & Poisson/2022-10-18T11_54_19.981Z.Desktop.md
new file mode 100644
index 00000000..e4fcb529
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Discrete Probability Distributions%3A Binomial & Poisson/2022-10-18T11_54_19.981Z.Desktop.md
@@ -0,0 +1,11 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Random Variables]]
+- **Next Topic:** [[The Normal Distribution]]
+- **Relevant Slides:** 
+-
+- What is a **Bernouli Trial**? #card
+ - A **Bernouli Trial** is a random experiment with just two outcomes - success / failure.
+ - For a single trial, random variable:
+ - $$X = \Bigl\{{1 \text{ sucess}}\\{0 \text{ failure}}$$
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Discrete Probability Distributions%3A Binomial & Poisson/2022-11-09T13_03_58.105Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Discrete Probability Distributions%3A Binomial & Poisson/2022-11-09T13_03_58.105Z.Desktop.md
new file mode 100644
index 00000000..da6ae5e7
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Discrete Probability Distributions%3A Binomial & Poisson/2022-11-09T13_03_58.105Z.Desktop.md
@@ -0,0 +1,125 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Random Variables]]
+- **Next Topic:** [[The Normal Distribution]]
+- **Relevant Slides:** 
+-
+- Often, the observations generated by different statistical experiments have the same type of behaviour.
+ - In general, only a handful of important probability distributions are needed to describe many of the discrete random variables encountered in practice.
+ -
+- # Bernoulli Trials
+ collapsed:: true
+ - What is a **Bernoulli Trial**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:48:37.965Z
+ card-last-score:: 1
+ - A **Bernoulli Trial** is a random experiment with just two outcomes - success / failure.
+ - For a single trial, random variable:
+ - $$X = \begin{cases}1, & \text{success,} \\0, & \text{failure.}\end{cases}$$
+ - $P(X = 1) = p$ and $P(X=0) = 1 -p$, where $p$ is the success probability, or more compactly:
+ - $$P(X = x) = p^x{(1-p)^{1-x}} \ \ \ \ \ x = 0,1$$
+ - What is the **expected value** of a Bernoulli Trial? #card
+ - $$E[X] = (0)(1-p)+(1)p = p$$
+ - What is the **variance** of a Bernoulli Trial? #card
+ - $$Var(X) = p(1-p)$$
+ - ## Bernoulli Trial Assumptions #card
+ - The outcomes of the trials are mutually **independent**.
+ - The probability of success $p$ is **constant** over trials.
+ - Note that these assumptions may not always be appropriate assumptions.
+ - ## Example: Camera Flash Tests
+ id:: 6368f276-bc7e-4d91-b7fb-c5b34c4c6feb
+ - The time to recharge the flash is tested in three mobile phone cameras. The probability that a camera passes the test is 0.8, and the cameras perform independently.
+ background-color:: green
+ - The random variable $X$ denotes the number of cameras that pass the test. The last column of the tables shows the values of $X$ assigned to each outcome of the experiment.
+ background-color:: green
+ - What is the probability that the first & second cameras pass the test, and the third one fails?
+ background-color:: green
+ - 
+ - Each camera test can be treated as a **Bernoulli Trial**.
+ - $$P(PPF) = (0.8)(0.8)(0.2) = 0.128$$
+ - What is the probability that two cameras pass the test in three trials?
+ background-color:: green
+ - How many ways can this event happen?
+ - $$\binom{n}{r} = \frac{n!}{r!(n-r)!} = \frac{3!}{2!(3-2)!} = 3$$
+ - What is the probability of this event?
+ - 0.128 for each of the three ways.
+ - Probability = $3(0.128) = 0.383$.
+ - This is an example of the **Binomial Distribution**.
+ -
+- # The Binomial Distribution
+ collapsed:: true
+ - What is the **binomial random variable**? #card
+ - A random experiment consists of $n$ Bernoulli trials such that:
+ - 1. The trials are independent.
+ 2. Each trial results in only two possible outcomes, labelled as "success" & "failure".
+ 3. The probability of a success in each trial, denotes as $p$, remains constant.
+ - The random variable $X$ that equals the number of trials that result in a success has a **binomial random variable** with parameters $0 < p < 1$ and $n = 1, 2, \cdots$.
+ - The **probability mass function** of $X$ is
+ - $$f(x) = \binom{n}{x}p^x (1-p)^{n-x} \ \ \ \ \ x = 0,1,\cdots, n$$
+ - ## Example: Camera Flash Tests
+ - See ((6368f276-bc7e-4d91-b7fb-c5b34c4c6feb)) for whole question.
+ background-color:: green
+ - Calculate the probability of 2 passes in 3 tests.
+ background-color:: green
+ - We are given that $n = 3$ and $p = 0.8$.
+ - Use the Binomial Distribution formula where $X$ is the number of passes:
+ - $$P(X = 2) = \binom{3}{2}(o.8)^2(0.2)^1 = 3(0.128) = 0.384$$
+ - ## Example: Organic Pollution
+ id:: 6368f570-83e7-4642-a881-7ccd40bb0399
+ - Each sample of water has a 10% chance of containing a particular organic pollutant. Assume that the sample are independent with regard to the presence of the pollutant.
+ background-color:: green
+ - Find the probability that, in the next 18 samples, exactly 2 contain the pollutant.
+ background-color:: green
+ - Let $X$ denote the number of samples that contain the pollutant in the next 18 samples analysed. Then $X$ is a binomial random variable with $p = 0.1$ and $n = 18$.
+ - $$P(X = 2) = \binom{18}{2}(0.1)^2(0.9)^{18-2} = 153(0.1)^2(0.9)^16 = 0.2835$$
+ - Determine the probability that $3 \leq X < 7$.
+ background-color:: green
+ - $$X = 3,4,5,6$$
+ - $$P(3 \leq X < 7) = P(X=3) + P(X=4) + P(X=5) + P(X=6)$$
+ - $$ \text{or}$$
+ - $$P(3 \leq X < 7) = \sum^6_{x=3} \binom{18}{x}(0.1)^x(0.9)^{18-x}$$
+ - $$ = 0.168 + 0.070 + 0.022 + 0.005 = 0.265$$
+ - ## Binomial Distributions in R #card
+ - `dbinom(x, size, prob)`, where `x` is the number of events required, `size` is the total number of trials, & `prob` is the probability of the event occurring.
+ - ### Example: Organic Pollution
+ - In ((6368f570-83e7-4642-a881-7ccd40bb0399)), `x=2`, `size=18`, & `p=0.10`.
+ background-color:: green
+ - ```R
+ dbinom(x=2, size=18, prob=0.1)
+ [1] 0.2835121
+ ```
+ - ## Binomial Mean & Variance #card
+ - If $X$ is a **binomial random variable** with parameters $p$ & $n$:
+ - The **mean** & **variance** of the binomial distribution $b(x; n,p)$ are
+ - $$\mu = np \text{ and } \sigma^2 = npq \text{, where } q = 1-p$$
+ - ## Chebyshev's Inequality
+ - What is **Chebyshev's Inequality**? #card
+ - **Chebyshev's Inequality** provides an estimate as to where a certain percentage of observations will lie relative to the mean once the **standard deviation** is known.
+ - For example, at least 75% of values will lie within two standard deviations of the mean.
+ -
+- # Poisson Distribution
+ - What are **Poisson Experiments**? #card
+ - Experiments yielding numerical values of a random variable $X$, the number of outcomes occurring during a given time interval or in a specified region, are called **Poisson Experiments**.
+ - The given time interval may be of any length, such as a minute, a day, a week, a month, or even a year.
+ - A Poisson Experiment is derived from the **Poisson Process** and possesses the following properties:
+ - The number of outcomes occurring one time interval or specified region of space is **independent** of the number that occur in any other disjoint time interval or region. In this sense, we say that the Poisson Process "has no memory".
+ - The probability that a single outcome will occur during a very short time interval or in a small region is **proportional** to the **length** of the time interval or the size of the region, and does not depend on the number of outcomes occurring outside this time interval or region.
+ - The probability that more than one outcome will occur in such a short time interval or fall in such a small region is **negligible**.
+ - What is the **Poisson Distribution**? #card
+ - The random variable $X$ that equals the number of events in a Poisson Process is a **Poisson Random Variable** with parameter $\lambda > 0 $, and the probability density function is
+ - $$f(x) = \frac{e^{-\lambda}\lambda^x}{x!} \text{ for } x = 0,1,2,3,\cdots$$
+ - ## Mean & Variance of Poisson Distribution
+ - If $\lambda$ is the average number of successes occurring in a given time interval or region in the Poisson Distribution, then the **mean** & the **variance** of the Poisson distribution are both equal to $\lambda$.
+ - Mean = $\lambda$, variance = $\lambda$.
+ - A one parameter distribution.
+ - ## Poisson Density Functions for Different Means
+ - 
+ - If the variance is much greater than the mean, then the Poisson Distribution would not be a good model for the distribution of the random variable.
+ - ## Poisson Example: Calculations for Wire Flaws
+ - Suppose that the number of flaws on a thin copper wire follows a Poisson Distribution with a mean of 2.3 flaws per millimetre.
+ background-color:: green
+ - Find the probability of exactly 2 flaws in 1mm of wire.
+ background-color:: green
+ - $$P(X = 2) = \frac{e^{-2.3}2.3{2}}{2!} = 0.265$$
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Discrete Probability Distributions%3A Binomial & Poisson/2022-11-11T12_04_45.325Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Discrete Probability Distributions%3A Binomial & Poisson/2022-11-11T12_04_45.325Z.Desktop.md
new file mode 100644
index 00000000..4ebbfd95
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Discrete Probability Distributions%3A Binomial & Poisson/2022-11-11T12_04_45.325Z.Desktop.md
@@ -0,0 +1,151 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Random Variables]]
+- **Next Topic:** [[The Normal Distribution]]
+- **Relevant Slides:** 
+-
+- Often, the observations generated by different statistical experiments have the same type of behaviour.
+ - In general, only a handful of important probability distributions are needed to describe many of the discrete random variables encountered in practice.
+ -
+- # Bernoulli Trials
+ collapsed:: true
+ - What is a **Bernoulli Trial**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:48:37.965Z
+ card-last-score:: 1
+ - A **Bernoulli Trial** is a random experiment with just two outcomes - success / failure.
+ - For a single trial, random variable:
+ - $$X = \begin{cases}1, & \text{success,} \\0, & \text{failure.}\end{cases}$$
+ - $P(X = 1) = p$ and $P(X=0) = 1 -p$, where $p$ is the success probability, or more compactly:
+ - $$P(X = x) = p^x{(1-p)^{1-x}} \ \ \ \ \ x = 0,1$$
+ - What is the **expected value** of a Bernoulli Trial? #card
+ - $$E[X] = (0)(1-p)+(1)p = p$$
+ - What is the **variance** of a Bernoulli Trial? #card
+ - $$Var(X) = p(1-p)$$
+ - ## Bernoulli Trial Assumptions #card
+ - The outcomes of the trials are mutually **independent**.
+ - The probability of success $p$ is **constant** over trials.
+ - Note that these assumptions may not always be appropriate assumptions.
+ - ## Example: Camera Flash Tests
+ id:: 6368f276-bc7e-4d91-b7fb-c5b34c4c6feb
+ - The time to recharge the flash is tested in three mobile phone cameras. The probability that a camera passes the test is 0.8, and the cameras perform independently.
+ background-color:: green
+ - The random variable $X$ denotes the number of cameras that pass the test. The last column of the tables shows the values of $X$ assigned to each outcome of the experiment.
+ background-color:: green
+ - What is the probability that the first & second cameras pass the test, and the third one fails?
+ background-color:: green
+ - 
+ - Each camera test can be treated as a **Bernoulli Trial**.
+ - $$P(PPF) = (0.8)(0.8)(0.2) = 0.128$$
+ - What is the probability that two cameras pass the test in three trials?
+ background-color:: green
+ - How many ways can this event happen?
+ - $$\binom{n}{r} = \frac{n!}{r!(n-r)!} = \frac{3!}{2!(3-2)!} = 3$$
+ - What is the probability of this event?
+ - 0.128 for each of the three ways.
+ - Probability = $3(0.128) = 0.383$.
+ - This is an example of the **Binomial Distribution**.
+ -
+- # The Binomial Distribution
+ collapsed:: true
+ - What is a **binomial random variable**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:39:57.976Z
+ card-last-score:: 1
+ - A random experiment consists of $n$ Bernoulli trials such that:
+ - 1. The trials are independent.
+ 2. Each trial results in only two possible outcomes, labelled as "success" & "failure".
+ 3. The probability of a success in each trial, denotes as $p$, remains constant.
+ - The random variable $X$ that equals the number of trials that result in a success has a **binomial random variable** with parameters $0 < p < 1$ and $n = 1, 2, \cdots$.
+ - The **probability mass function** of $X$ is
+ - $$f(x) = \binom{n}{x}p^x (1-p)^{n-x} \ \ \ \ \ x = 0,1,\cdots, n$$
+ - ## Example: Camera Flash Tests
+ - See ((6368f276-bc7e-4d91-b7fb-c5b34c4c6feb)) for whole question.
+ background-color:: green
+ - Calculate the probability of 2 passes in 3 tests.
+ background-color:: green
+ - We are given that $n = 3$ and $p = 0.8$.
+ - Use the Binomial Distribution formula where $X$ is the number of passes:
+ - $$P(X = 2) = \binom{3}{2}(o.8)^2(0.2)^1 = 3(0.128) = 0.384$$
+ - ## Example: Organic Pollution
+ id:: 6368f570-83e7-4642-a881-7ccd40bb0399
+ - Each sample of water has a 10% chance of containing a particular organic pollutant. Assume that the sample are independent with regard to the presence of the pollutant.
+ background-color:: green
+ - Find the probability that, in the next 18 samples, exactly 2 contain the pollutant.
+ background-color:: green
+ - Let $X$ denote the number of samples that contain the pollutant in the next 18 samples analysed. Then $X$ is a binomial random variable with $p = 0.1$ and $n = 18$.
+ - $$P(X = 2) = \binom{18}{2}(0.1)^2(0.9)^{18-2} = 153(0.1)^2(0.9)^16 = 0.2835$$
+ - Determine the probability that $3 \leq X < 7$.
+ background-color:: green
+ - $$X = 3,4,5,6$$
+ - $$P(3 \leq X < 7) = P(X=3) + P(X=4) + P(X=5) + P(X=6)$$
+ - $$ \text{or}$$
+ - $$P(3 \leq X < 7) = \sum^6_{x=3} \binom{18}{x}(0.1)^x(0.9)^{18-x}$$
+ - $$ = 0.168 + 0.070 + 0.022 + 0.005 = 0.265$$
+ - ## Binomial Distributions in R #card
+ - `dbinom(x, size, prob)`, where `x` is the number of events required, `size` is the total number of trials, & `prob` is the probability of the event occurring.
+ - ### Example: Organic Pollution
+ - In ((6368f570-83e7-4642-a881-7ccd40bb0399)), `x=2`, `size=18`, & `p=0.10`.
+ background-color:: green
+ - ```R
+ dbinom(x=2, size=18, prob=0.1)
+ [1] 0.2835121
+ ```
+ - ## Binomial Mean & Variance #card
+ - If $X$ is a **binomial random variable** with parameters $p$ & $n$:
+ - The **mean** & **variance** of the binomial distribution $b(x; n,p)$ are
+ - $$\mu = np \text{ and } \sigma^2 = npq \text{, where } q = 1-p$$
+ - ## Chebyshev's Inequality
+ - What is **Chebyshev's Inequality**? #card
+ - **Chebyshev's Inequality** provides an estimate as to where a certain percentage of observations will lie relative to the mean once the **standard deviation** is known.
+ - For example, at least 75% of values will lie within two standard deviations of the mean.
+ -
+- # Poisson Distribution
+ - What are **Poisson Experiments**? #card
+ - Experiments yielding numerical values of a random variable $X$, the number of outcomes occurring during a given time interval or in a specified region, are called **Poisson Experiments**.
+ - The given time interval may be of any length, such as a minute, a day, a week, a month, or even a year.
+ - A Poisson Experiment is derived from the **Poisson Process** and possesses the following properties:
+ - The number of outcomes occurring one time interval or specified region of space is **independent** of the number that occur in any other disjoint time interval or region. In this sense, we say that the Poisson Process "has no memory".
+ - The probability that a single outcome will occur during a very short time interval or in a small region is **proportional** to the **length** of the time interval or the size of the region, and does not depend on the number of outcomes occurring outside this time interval or region.
+ - The probability that more than one outcome will occur in such a short time interval or fall in such a small region is **negligible**.
+ - What is the **Poisson Distribution**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:38:39.167Z
+ card-last-score:: 1
+ - The random variable $X$ that equals the number of events in a Poisson Process is a **Poisson Random Variable** with parameter $\lambda > 0$, and the probability density function is
+ - $$f(x) = \frac{e^{-\lambda}\lambda^x}{x!} \text{ for } x = 0,1,2,3,\cdots$$
+ - ## Mean & Variance of Poisson Distribution
+ - If $\lambda$ is the average number of successes occurring in a given time interval or region in the Poisson Distribution, then the **mean** & the **variance** of the Poisson distribution are both equal to $\lambda$.
+ - Mean = $\lambda$, variance = $\lambda$.
+ - A one parameter distribution.
+ - ## Poisson Density Functions for Different Means
+ - 
+ - If the variance is much greater than the mean, then the Poisson Distribution would not be a good model for the distribution of the random variable.
+ - ## Poisson Example: Calculations for Wire Flaws
+ - Suppose that the number of flaws on a thin copper wire follows a Poisson Distribution with a mean of 2.3 flaws per millimetre.
+ background-color:: green
+ - Find the probability of exactly 2 flaws in 1mm of wire.
+ background-color:: green
+ - $$P(X = 2) = \frac{e^{-2.3}2.3{2}}{2!} = 0.265$$
+ - ## Poisson Example: Car Park
+ - A car park has 3 entrances, $A$, $B$, & $C$. The number of cars per hour entering through each of these is Poisson-distributed with mean $\lambda_A = 1.5$, $\lambda_B = 1.0$, and $\lambda_C = 2.5$. Arrivals at each entrance are **independent**.
+ background-color:: green
+ - $T$ is the total number of cars entering in an hour.
+ - $$T \sim \text{ Poisson}(\lambda_A + \lambda_B + \lambda_C) \equiv \text{Poisson}(1.5 + 1.0 + 2.5) \equiv \text{Poisson}(5)$$
+ - $$P(T = 4) = \frac{e^{-5} 5^4}{4!} = 0.1755$$
+ - ## Sum of Independent Poisson Random Variables #card
+ - If $X_1, X_2, \cdots, X_n$ are independently Poisson distributed with parameters $\lambda_1, \lambda_2, \cdots, \lambda_n$ then
+ - $$T = X_1 + X_2 + \cdots + X_n \text{ is Poisson}(\lambda_1 + \lambda_2 + \cdots + \lambda_n)$$
+ - and
+ - $$E[T] = \lambda_1 + \lambda_2 + \cdots + \lambda_n$$
+ - and
+ - $$\text{Var}(T) = \lambda_1 + \lambda_2 + \cdots + \lambda_n$$
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-10-10T11_59_52.384Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-10-10T11_59_52.384Z.Desktop.md
new file mode 100644
index 00000000..d060a711
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-10-10T11_59_52.384Z.Desktop.md
@@ -0,0 +1,313 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Aggregate Clauses, Group By, & Having Clauses]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- What are **Data Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-09T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T23:00:14.804Z
+ card-last-score:: 1
+ - **Data models** are concepts to describe the structure of a database.
+ - They comprise:
+ - High level or logical models;
+ - Representational / Implementational data models;
+ - Physical data models.
+ - Data models allow for database abstraction.
+- What are **ER Models**? #card
+ card-last-interval:: 3.21
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T15:21:53.036Z
+ card-last-reviewed:: 2022-10-07T10:21:53.036Z
+ card-last-score:: 3
+ - **Entity Relationship Models** are a top-down approach to database design that provide a way to *model the data* that will be stored in a system. The models are then used to *create tables* in the relational model.
+ - ER Models are used to identify:
+ - [1] The important data to be stored in a database called **entities**.
+ - [2] The **relationships** between the entities.
+ - [3] The **attributes** of entities.
+ - [4] The **constraints&& of relationships & entities.
+-
+- # ER Model Notation
+ - A number of different notations can be used to represent the same model.
+ - Chen Notation.
+ - IE Crow's Foot Notation.
+ - UML.
+ - Integrated Definition 1. Extended (IDEF1X).
+ -
+ - The original (Chen) notation uses diamonds, rectangles, and elipses.
+ - This is easier to hand-draw, so it is useful in an exam situation.
+ - It is less implementation-oriented than other notations.
+-
+- # Some Definitions
+ collapsed:: true
+ - ## Entities
+ collapsed:: true
+ - What is an **entity type**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:23:11.260Z
+ card-last-score:: 1
+ - An **entity type** is a collection of *entity instances* that share common properties or charcteristics.
+ - It is a group of objects, with the same properties, which are identified as having an independent existence.
+ - 
+ - What is an **entity instance**? #card
+ card-last-interval:: 3.18
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T21:24:28.725Z
+ card-last-reviewed:: 2022-10-06T17:24:28.726Z
+ card-last-score:: 3
+ - An **entity instance** or **entity occurrence** is a single, uniquely identifiable occurrence of an entity type (e.g., row in a table).
+ - 
+ - ## Relationships
+ - What is a **relationship type**? #card
+ card-last-interval:: 2.6
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T05:10:30.449Z
+ card-last-reviewed:: 2022-10-08T15:10:30.450Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **relationship type** is a set of meaningful relationships among entity types.
+ - **Chen's Notation:** A diamond shape is used to name the relationship. 1 and M/N are used for the "1" and "many" sides respectively.
+ - **Crow's Foot Notation:** The titular "crow's foot" is used as the representation of "many", and one line is used for the representation of "1".
+ - 
+ - **Example:** employee "works for" department. department "has" employee.
+ - 
+ - What is a **relationship instance**? #card
+ collapsed:: true
+ card-last-interval:: 2.33
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T22:25:34.684Z
+ card-last-reviewed:: 2022-10-08T15:25:34.685Z
+ card-last-score:: 5
+ - A **relationship instance** or **relationship occurrence** is a uniquely identifiable association which includes one occurrence from each participating entity type; reading left to right and right to left.
+ - **Example:**
+ - Left-to-Right: John Smith "works for" Research department.
+ - Right-to-Left: Research department "has" John Smith.
+ - What is the **degree** of a relationship type? #card
+ card-last-interval:: 3.57
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-09T22:44:53.027Z
+ card-last-reviewed:: 2022-10-06T09:44:53.027Z
+ card-last-score:: 5
+ collapsed:: true
+ - Whenever an attribute of one entity type refers to another entity type, some relationship exists.
+ - The **degree** of a relationship type is the number of participating entity types.
+ - Relationship types may have certain constraints.
+ - What is the **Cardinality Ratio**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:45:27.674Z
+ card-last-score:: 1
+ - The **cardinality ratio** specifies ^^the number of relationship instances that an entity can participate in.^^
+ - The possible cardinality ratios for binary relationship types are:
+ - $1:1$, "one to one" - at most one instance of entity $A$ is associated with one instance of entity $B$.
+ - $1:N$, "one to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$.
+ - $M:N$, "many to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$, and for one instance of entity $B$, there are 0 or more instances of entity $A$.
+ -
+ - ### Structural Constraints on Relationships
+ - Often, we may know the min & max of the cardinalities.
+ - Example: limit on the number of books that can be borrowed from a library.
+ - What are **Structural Constraints**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:17:03.860Z
+ card-last-score:: 1
+ - **Structural constraints** specify a pair of integer numbers *(min, max)* for each entity participating in a relationship.
+ - Examples: (0, 1), (1, 1), (1, N)., (1, 7).
+ -
+ - ## Attributes
+ collapsed:: true
+ - What are **Attributes**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:21:54.114Z
+ card-last-reviewed:: 2022-10-06T17:21:54.115Z
+ card-last-score:: 5
+ collapsed:: true
+ - **Attributes** are ^^named property^^ or characteristic of an entity.
+ - Each entity has a set of attributes associated with it.
+ - Several types of attributes exist:
+ - Key.
+ - Composite.
+ - Derived.
+ - Multi-valued.
+ - **Notation:**
+ - **Chen:** An oval enclosing the name of the attribute.
+ - 
+ - **Crow:** Listed in the entity box.
+ - 
+ - What are **key attributes**? #card
+ card-last-interval:: 4.04
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T10:47:07.833Z
+ card-last-reviewed:: 2022-10-07T10:47:07.833Z
+ card-last-score:: 5
+ collapsed:: true
+ - Each entity type must have an attribute or set of attributes that ^^uniquely identifies^^ each instance from other instances of the same type.
+ - A **candidate key** is an attribute (or combination of attributes) that uniquely identifies each instance of an entity type.
+ - A **primary key (PK)** is a candidate key that has been selected as the identifier for an entity type.
+ - What is a **composite attribute**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T19:44:43.280Z
+ card-last-reviewed:: 2022-10-06T09:44:43.280Z
+ card-last-score:: 3
+ collapsed:: true
+ - A **composite attribute** is an attribute that is composed of several atomic (simple) attributes.
+ - If the composite attribute is referenced as a whole only, then there is no need to subdivide it into component attributes, otherwise you should divide it:
+ - 
+ - What is a **derived attribute**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T20:18:30.906Z
+ card-last-reviewed:: 2022-10-07T10:18:30.906Z
+ card-last-score:: 3
+ collapsed:: true
+ - A **derived attribute** is an attribute whose values can be determined from another attribute.
+ - For Chen's notation, the notation is a *dotted oval*.
+ - 
+ - For Crow's Foot notation, derived attributes can be represented by enclosing the attribute in [square brackets], e.g., [age].
+ - What is a **multi-valued attribute**? #card
+ collapsed:: true
+ card-last-interval:: 0.47
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T02:33:42.655Z
+ card-last-reviewed:: 2022-10-08T15:33:42.655Z
+ card-last-score:: 3
+ - A **multi-valued attribute** is an attribute which has lower & upper bounds on the number of values for an individual entry.
+ - For Chen's notation, multi-valued attributes can be represented by one oval inside another.
+ - 
+ - For Crow's Foot notation, multi-valued attributes can be represented by enclosing the attribute in {curly brackets}.
+ - E.g., {skills}.
+ -
+-
+- # Total & Partial Participation
+ collapsed:: true
+ - What is **Total Participation**? #card
+ card-last-interval:: 3.84
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T13:20:26.940Z
+ card-last-reviewed:: 2022-10-06T17:20:26.941Z
+ card-last-score:: 3
+ - **Total Participation** (Mandatory Participation): All instances of an entity must participate in the relationship, i.e., *every* entity instance in one set *must* be related to an entity instance in the second via the relationship.
+ - For example, the entity "Student" must have **total participation** in the relationship "enrolled" with the entity "Course" - each student *must* be enrolled in a course.
+ - What is **Partial Participation**? #card
+ card-last-interval:: 2.51
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T03:07:33.950Z
+ card-last-reviewed:: 2022-10-08T15:07:33.952Z
+ card-last-score:: 5
+ - **Partial Participation** (Optional Participation): Some subset of instances of an entity will participate in the relationship, but not all, i.e., *some* entity instances in one set are related to an entity instance in the second via the relationship.
+ - For example, the entity "Course" would have a **partial participation** in the relationship "enrolled" with the entity "Student" - a course might not have any students enrolled in it.
+ - ## Chen's Notation for Participation #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-18T05:50:33.140Z
+ card-last-reviewed:: 2022-10-09T08:50:33.141Z
+ card-last-score:: 3
+ - In both total & partial participation, the line(s) are drawn from the participating entity to the relationship (the diamond) to indicate the participation of that instance from that entity in the relationship,
+ - **Total Participation:** Double parallel lines.
+ - 
+ - **Partial Participation:** Single line.
+ - 
+ - Examples:
+ - 
+ -
+ - ## Crow's Foot Notation for Participation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:33:14.077Z
+ card-last-score:: 1
+ collapsed:: true
+ - Use the idea of **Ordinality / Optionality**.
+ - **Optionality of 0:** If an entity $A$ has partial participation in a relationship to entity $B$, then $A$ is associated with 0 or more instances of entity $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 0** is a **bar**: $|$
+ - **Optionality of 1:** If an entity $A$ has full participation in a relationship to entity $B$, then $A$ is associated with at least 1 or more of $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 1** is a **circle** or "o": $\bigcirc$
+ - [And vice-versa.]
+ - In Crow's Foot notation, there is no diamond, so there is always a direct relationship line between the entities.
+ - The **optionality sign** is drawn on this line.
+ - The optionality drawn beside some entity $A$ refers to how an instance of entity $B$ is related to entity $A$.
+ - That is, whether $B$ can be involved partially (0) or not (1).
+ - Example in *Right to Left* Relationships:
+ - 
+ -
+ - ## Note on Weak Entities
+ - **Note:** ^^A **weak entity type** always has a total participation constraint.^^
+ - We need to show the "identifying relationship".
+ - 
+ - ### Chen's Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:31:46.745Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Entity:** Double rectangle.
+ - **Relationship:** Double diamond.
+ - The weak entity has full participation in the relationship.
+ - 
+ -
+ - ### Crow's Foot Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:25:11.281Z
+ card-last-score:: 1
+ collapsed:: true
+ - In Crow's Foot Notation, we can represent the **weak entity** as a normal entity, but do not choose any attributes as the primary key.
+ - For an attribute that partially determines the entity instances, we choose the "required" option.
+ - We usually represent the relationship between entities using a **solid line**.
+ - This indicates that it is an "identifying" relationship.
+ - 
+ -
+ -
+ - In general, with entities, there may be two valid solutions, one with a weak entity, and one without.
+ - There is not a huge difficulty if you do not identify weak entities in a solution so long as all the entities have **primary attributes**.
+ - It may be slightly non-optimal in terms of introducing an additional primary key that is not needed, but this is not a huge problem for us at this level.
+-
+- # Entities or Multi-Valued Attributes?
+ collapsed:: true
+ - Sometimes, it may not be clear whether something should be modelled as a multi-valued attribute or an entity.
+ - Both may be equally correct, as long as you represent all the information that you are asked to.
+ - You may see (very little) difference between the two approaches if you map either approach to tables in a database.
+-
+- # Steps to Create an ER Model
+ - 1. Identify entities.
+ 2. Identify relationships between entities.
+ 3. Draw entities & relationships.
+ 4. Add attributes to entities (& relationships, if appropriate).
+ 5. Add cardinalities to relationships.
+ 6. Add participation constraints (total or partial) to relationships.
+ 7. Check that all entities have primary keys identified.
+-
+- # Mapping ER Models to Tables in the Relational Model
+ - Once you have you ER diagram, you now need to convert it into a set of tables so that you can implement it in a relational mode.
+ - Example: As MySQL tables using
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-10-20T09_05_57.946Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-10-20T09_05_57.946Z.Desktop.md
new file mode 100644
index 00000000..1a0d3a8a
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-10-20T09_05_57.946Z.Desktop.md
@@ -0,0 +1,340 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Aggregate Clauses, Group By, & Having Clauses]]
+- **Next Topic:** [[Joins & Union Queries]]
+- **Relevant Slides:** 
+-
+- What are **Data Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-09T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T23:00:14.804Z
+ card-last-score:: 1
+ - **Data models** are concepts to describe the structure of a database.
+ - They comprise:
+ - High level or logical models;
+ - Representational / Implementational data models;
+ - Physical data models.
+ - Data models allow for database abstraction.
+- What are **ER Models**? #card
+ card-last-interval:: 3.21
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T15:21:53.036Z
+ card-last-reviewed:: 2022-10-07T10:21:53.036Z
+ card-last-score:: 3
+ - **Entity Relationship Models** are a top-down approach to database design that provide a way to *model the data* that will be stored in a system. The models are then used to *create tables* in the relational model.
+ - ER Models are used to identify:
+ - [1] The important data to be stored in a database called **entities**.
+ - [2] The **relationships** between the entities.
+ - [3] The **attributes** of entities.
+ - [4] The **constraints&& of relationships & entities.
+-
+- # ER Model Notation
+ - A number of different notations can be used to represent the same model.
+ - Chen Notation.
+ - IE Crow's Foot Notation.
+ - UML.
+ - Integrated Definition 1. Extended (IDEF1X).
+ -
+ - The original (Chen) notation uses diamonds, rectangles, and elipses.
+ - This is easier to hand-draw, so it is useful in an exam situation.
+ - It is less implementation-oriented than other notations.
+-
+- # Some Definitions
+ collapsed:: true
+ - ## Entities
+ collapsed:: true
+ - What is an **entity type**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:37:15.394Z
+ card-last-score:: 1
+ - An **entity type** is a collection of *entity instances* that share common properties or charcteristics.
+ - It is a group of objects, with the same properties, which are identified as having an independent existence.
+ - 
+ - What is an **entity instance**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:45:57.663Z
+ card-last-reviewed:: 2022-10-10T11:45:57.664Z
+ card-last-score:: 5
+ - An **entity instance** or **entity occurrence** is a single, uniquely identifiable occurrence of an entity type (e.g., row in a table).
+ - 
+ - ## Relationships
+ - What is a **relationship type**? #card
+ card-last-interval:: 2.6
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T05:10:30.449Z
+ card-last-reviewed:: 2022-10-08T15:10:30.450Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **relationship type** is a set of meaningful relationships among entity types.
+ - **Chen's Notation:** A diamond shape is used to name the relationship. 1 and M/N are used for the "1" and "many" sides respectively.
+ - **Crow's Foot Notation:** The titular "crow's foot" is used as the representation of "many", and one line is used for the representation of "1".
+ - 
+ - **Example:** employee "works for" department. department "has" employee.
+ - 
+ - What is a **relationship instance**? #card
+ collapsed:: true
+ card-last-interval:: 2.33
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T22:25:34.684Z
+ card-last-reviewed:: 2022-10-08T15:25:34.685Z
+ card-last-score:: 5
+ - A **relationship instance** or **relationship occurrence** is a uniquely identifiable association which includes one occurrence from each participating entity type; reading left to right and right to left.
+ - **Example:**
+ - Left-to-Right: John Smith "works for" Research department.
+ - Right-to-Left: Research department "has" John Smith.
+ - What is the **degree** of a relationship type? #card
+ card-last-interval:: 3.57
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-09T22:44:53.027Z
+ card-last-reviewed:: 2022-10-06T09:44:53.027Z
+ card-last-score:: 5
+ collapsed:: true
+ - Whenever an attribute of one entity type refers to another entity type, some relationship exists.
+ - The **degree** of a relationship type is the number of participating entity types.
+ - Relationship types may have certain constraints.
+ - What is the **Cardinality Ratio**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:41:32.658Z
+ card-last-score:: 1
+ - The **cardinality ratio** specifies ^^the number of relationship instances that an entity can participate in.^^
+ - The possible cardinality ratios for binary relationship types are:
+ - $1:1$, "one to one" - at most one instance of entity $A$ is associated with one instance of entity $B$.
+ - $1:N$, "one to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$.
+ - $M:N$, "many to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$, and for one instance of entity $B$, there are 0 or more instances of entity $A$.
+ -
+ - ### Structural Constraints on Relationships
+ - Often, we may know the min & max of the cardinalities.
+ - Example: limit on the number of books that can be borrowed from a library.
+ - What are **Structural Constraints**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:34:55.501Z
+ card-last-score:: 1
+ - **Structural constraints** specify a pair of integer numbers *(min, max)* for each entity participating in a relationship.
+ - Examples: (0, 1), (1, 1), (1, N)., (1, 7).
+ -
+ - ## Attributes
+ collapsed:: true
+ - What are **Attributes**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:21:54.114Z
+ card-last-reviewed:: 2022-10-06T17:21:54.115Z
+ card-last-score:: 5
+ collapsed:: true
+ - **Attributes** are ^^named property^^ or characteristic of an entity.
+ - Each entity has a set of attributes associated with it.
+ - Several types of attributes exist:
+ - Key.
+ - Composite.
+ - Derived.
+ - Multi-valued.
+ - **Notation:**
+ - **Chen:** An oval enclosing the name of the attribute.
+ - 
+ - **Crow:** Listed in the entity box.
+ - 
+ - What are **key attributes**? #card
+ card-last-interval:: 4.04
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T10:47:07.833Z
+ card-last-reviewed:: 2022-10-07T10:47:07.833Z
+ card-last-score:: 5
+ collapsed:: true
+ - Each entity type must have an attribute or set of attributes that ^^uniquely identifies^^ each instance from other instances of the same type.
+ - A **candidate key** is an attribute (or combination of attributes) that uniquely identifies each instance of an entity type.
+ - A **primary key (PK)** is a candidate key that has been selected as the identifier for an entity type.
+ - What is a **composite attribute**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:45:42.013Z
+ card-last-reviewed:: 2022-10-10T11:45:42.014Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **composite attribute** is an attribute that is composed of several atomic (simple) attributes.
+ - If the composite attribute is referenced as a whole only, then there is no need to subdivide it into component attributes, otherwise you should divide it:
+ - 
+ - What is a **derived attribute**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T20:18:30.906Z
+ card-last-reviewed:: 2022-10-07T10:18:30.906Z
+ card-last-score:: 3
+ collapsed:: true
+ - A **derived attribute** is an attribute whose values can be determined from another attribute.
+ - For Chen's notation, the notation is a *dotted oval*.
+ - 
+ - For Crow's Foot notation, derived attributes can be represented by enclosing the attribute in [square brackets], e.g., [age].
+ - What is a **multi-valued attribute**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:42:23.846Z
+ card-last-score:: 1
+ - A **multi-valued attribute** is an attribute which has lower & upper bounds on the number of values for an individual entry.
+ - For Chen's notation, multi-valued attributes can be represented by one oval inside another.
+ - 
+ - For Crow's Foot notation, multi-valued attributes can be represented by enclosing the attribute in {curly brackets}.
+ - E.g., {skills}.
+ -
+-
+- # Total & Partial Participation
+ collapsed:: true
+ - What is **Total Participation**? #card
+ card-last-interval:: 3.84
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T13:20:26.940Z
+ card-last-reviewed:: 2022-10-06T17:20:26.941Z
+ card-last-score:: 3
+ - **Total Participation** (Mandatory Participation): All instances of an entity must participate in the relationship, i.e., *every* entity instance in one set *must* be related to an entity instance in the second via the relationship.
+ - For example, the entity "Student" must have **total participation** in the relationship "enrolled" with the entity "Course" - each student *must* be enrolled in a course.
+ - What is **Partial Participation**? #card
+ card-last-interval:: 2.51
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T03:07:33.950Z
+ card-last-reviewed:: 2022-10-08T15:07:33.952Z
+ card-last-score:: 5
+ - **Partial Participation** (Optional Participation): Some subset of instances of an entity will participate in the relationship, but not all, i.e., *some* entity instances in one set are related to an entity instance in the second via the relationship.
+ - For example, the entity "Course" would have a **partial participation** in the relationship "enrolled" with the entity "Student" - a course might not have any students enrolled in it.
+ - ## Chen's Notation for Participation #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-18T05:50:33.140Z
+ card-last-reviewed:: 2022-10-09T08:50:33.141Z
+ card-last-score:: 3
+ - In both total & partial participation, the line(s) are drawn from the participating entity to the relationship (the diamond) to indicate the participation of that instance from that entity in the relationship,
+ - **Total Participation:** Double parallel lines.
+ - 
+ - **Partial Participation:** Single line.
+ - 
+ - Examples:
+ - 
+ -
+ - ## Crow's Foot Notation for Participation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:40:09.417Z
+ card-last-score:: 1
+ collapsed:: true
+ - Use the idea of **Ordinality / Optionality**.
+ - **Optionality of 0:** If an entity $A$ has partial participation in a relationship to entity $B$, then $A$ is associated with 0 or more instances of entity $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 0** is a **bar**: $|$
+ - **Optionality of 1:** If an entity $A$ has full participation in a relationship to entity $B$, then $A$ is associated with at least 1 or more of $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 1** is a **circle** or "o": $\bigcirc$
+ - [And vice-versa.]
+ - In Crow's Foot notation, there is no diamond, so there is always a direct relationship line between the entities.
+ - The **optionality sign** is drawn on this line.
+ - The optionality drawn beside some entity $A$ refers to how an instance of entity $B$ is related to entity $A$.
+ - That is, whether $B$ can be involved partially (0) or not (1).
+ - Example in *Right to Left* Relationships:
+ - 
+ -
+ - ## Note on Weak Entities
+ - **Note:** ^^A **weak entity type** always has a total participation constraint.^^
+ - We need to show the "identifying relationship".
+ - 
+ - ### Chen's Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:39:33.993Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Entity:** Double rectangle.
+ - **Relationship:** Double diamond.
+ - The weak entity has full participation in the relationship.
+ - 
+ -
+ - ### Crow's Foot Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:37:34.222Z
+ card-last-score:: 1
+ collapsed:: true
+ - In Crow's Foot Notation, we can represent the **weak entity** as a normal entity, but do not choose any attributes as the primary key.
+ - For an attribute that partially determines the entity instances, we choose the "required" option.
+ - We usually represent the relationship between entities using a **solid line**.
+ - This indicates that it is an "identifying" relationship.
+ - 
+ -
+ -
+ - In general, with entities, there may be two valid solutions, one with a weak entity, and one without.
+ - There is not a huge difficulty if you do not identify weak entities in a solution so long as all the entities have **primary attributes**.
+ - It may be slightly non-optimal in terms of introducing an additional primary key that is not needed, but this is not a huge problem for us at this level.
+-
+- # Entities or Multi-Valued Attributes?
+ collapsed:: true
+ - Sometimes, it may not be clear whether something should be modelled as a multi-valued attribute or an entity.
+ - Both may be equally correct, as long as you represent all the information that you are asked to.
+ - You may see (very little) difference between the two approaches if you map either approach to tables in a database.
+-
+- # Steps to Create an ER Model
+ - 1. Identify entities.
+ 2. Identify relationships between entities.
+ 3. Draw entities & relationships.
+ 4. Add attributes to entities (& relationships, if appropriate).
+ 5. Add cardinalities to relationships.
+ 6. Add participation constraints (total or partial) to relationships.
+ 7. Check that all entities have primary keys identified.
+-
+- # Mapping ER Models to Tables in the Relational Model
+ - Once you have you ER diagram, you now need to convert it into a set of tables so that you can implement it in a relational mode.
+ - Example: As MySQL tables using `CREATE TABLES` commands.
+ - This stage is called **Mapping ER Models to Tables in the Relational Model**, and it specifies a set of rules that must be followed in a certain order.
+ - The rules specified here are based on **Chen's Notation**.
+ - ## Steps
+ - [1] For each entity, create a table $R$ that includes all the **simple** attributes of the entity.
+ - [2] For strong entities, choose a key attribute as the primary key of the table.
+ - [3] For weak entities $R$, include the primary key attributes of the table that corresponds to the owner as foreign key attributes of $R$.
+ - The primary key of $R$ is a combination of the primary key of the owner and the partial key of the weak entity type.
+ - The relationship of the weak & strong entity is generally taken care of by this step.
+ - [4] For each **binary** $1:1$ relationship, identify entites $S$ & $T$ that participate in the relation.
+ - If applicable, choose the entity that has **total participation** in the relation.
+ - Include the primary key of the other relation as the foreign key in this table.
+ - Include any attributes of the relationship as attributes of the chosen table.
+ - If both entities have total participation in the relationship, you can choose either one for the foreign key and proceed as above, or you can map two entities & their associated attributes & relationship attributes into one table.
+ - [5] For each **binary** $1:N$ relationship, identify the table $S$ that represents the $N$ side and the table $T$ that represents the $1$ side.
+ - Include the primary key of table $T$ as a foreign key in $S$ such that each entity on the $N$ side is related to at most one entity instance on the $1$ side.
+ - Include any attributes of the relationship as attributes of $S$.
+ - For recursive $1:N$ relationships, choose the primary key of the table and include it as a foreign key in the same table with a different name.
+ - [6] For each $M:N$ relationship, create a new table $S$ to represent the relationship.
+ - Include the primary keys of the tables that represent the participating entity types as foreign keys in $S$ - their combination will form the primary key of $S$.
+ - Also include in $S$ any attributes of the relationship.
+ - For a recursive $M:N$ relationship, both foreign keys come from the same table (give different names to each) and become the new primary key.
+ - [7] For each **multi-valued attribute** $A$ of an entity $S$, create a new table $R$.
+ - $R$ will include:
+ - An attribute corresponding to $A$.
+ - The primary key of $S$, which will be a foreign key in $R$. Call this $K$.
+ - The primary key of $R$ is a combination of $A$ & $K$.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-09T13_03_58.107Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-09T13_03_58.107Z.Desktop.md
new file mode 100644
index 00000000..0d9b360b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-09T13_03_58.107Z.Desktop.md
@@ -0,0 +1,340 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Aggregate Clauses, Group By, & Having Clauses]]
+- **Next Topic:** [[Joins & Union Queries]]
+- **Relevant Slides:** 
+-
+- What are **Data Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:28:27.254Z
+ card-last-score:: 1
+ - **Data models** are concepts to describe the structure of a database.
+ - They comprise:
+ - High level or logical models;
+ - Representational / Implementational data models;
+ - Physical data models.
+ - Data models allow for database abstraction.
+- What are **ER Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:33:37.565Z
+ card-last-score:: 1
+ - **Entity Relationship Models** are a top-down approach to database design that provide a way to *model the data* that will be stored in a system. The models are then used to *create tables* in the relational model.
+ - ER Models are used to identify:
+ - [1] The important data to be stored in a database called **entities**.
+ - [2] The **relationships** between the entities.
+ - [3] The **attributes** of entities.
+ - [4] The **constraints** of relationships & entities.
+-
+- # ER Model Notation
+ - A number of different notations can be used to represent the same model.
+ - Chen Notation.
+ - IE Crow's Foot Notation.
+ - UML.
+ - Integrated Definition 1. Extended (IDEF1X).
+ -
+ - The original (Chen) notation uses diamonds, rectangles, and elipses.
+ - This is easier to hand-draw, so it is useful in an exam situation.
+ - It is less implementation-oriented than other notations.
+-
+- # Some Definitions
+ collapsed:: true
+ - ## Entities
+ collapsed:: true
+ - What is an **entity type**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:42:58.469Z
+ card-last-score:: 1
+ - An **entity type** is a collection of *entity instances* that share common properties or charcteristics.
+ - It is a group of objects, with the same properties, which are identified as having an independent existence.
+ - 
+ - What is an **entity instance**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:45:57.663Z
+ card-last-reviewed:: 2022-10-10T11:45:57.664Z
+ card-last-score:: 5
+ - An **entity instance** or **entity occurrence** is a single, uniquely identifiable occurrence of an entity type (e.g., row in a table).
+ - 
+ - ## Relationships
+ - What is a **relationship type**? #card
+ card-last-interval:: 2.6
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T05:10:30.449Z
+ card-last-reviewed:: 2022-10-08T15:10:30.450Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **relationship type** is a set of meaningful relationships among entity types.
+ - **Chen's Notation:** A diamond shape is used to name the relationship. 1 and M/N are used for the "1" and "many" sides respectively.
+ - **Crow's Foot Notation:** The titular "crow's foot" is used as the representation of "many", and one line is used for the representation of "1".
+ - 
+ - **Example:** employee "works for" department. department "has" employee.
+ - 
+ - What is a **relationship instance**? #card
+ collapsed:: true
+ card-last-interval:: 15.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-04T12:37:54.349Z
+ card-last-reviewed:: 2022-10-20T08:37:54.349Z
+ card-last-score:: 5
+ - A **relationship instance** or **relationship occurrence** is a uniquely identifiable association which includes one occurrence from each participating entity type; reading left to right and right to left.
+ - **Example:**
+ - Left-to-Right: John Smith "works for" Research department.
+ - Right-to-Left: Research department "has" John Smith.
+ - What is the **degree** of a relationship type? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-23T18:28:15.095Z
+ card-last-reviewed:: 2022-10-20T08:28:15.096Z
+ card-last-score:: 3
+ collapsed:: true
+ - Whenever an attribute of one entity type refers to another entity type, some relationship exists.
+ - The **degree** of a relationship type is ^^the number of participating entity types.^^
+ - Relationship types may have certain constraints.
+ - What is the **Cardinality Ratio**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:25:13.663Z
+ card-last-score:: 1
+ - The **cardinality ratio** specifies ^^the number of relationship instances that an entity can participate in.^^
+ - The possible cardinality ratios for binary relationship types are:
+ - $1:1$, "one to one" - at most one instance of entity $A$ is associated with one instance of entity $B$.
+ - $1:N$, "one to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$.
+ - $M:N$, "many to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$, and for one instance of entity $B$, there are 0 or more instances of entity $A$.
+ -
+ - ### Structural Constraints on Relationships
+ - Often, we may know the min & max of the cardinalities.
+ - Example: limit on the number of books that can be borrowed from a library.
+ - What are **Structural Constraints**? #card
+ card-last-interval:: 0.85
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-27T07:51:05.213Z
+ card-last-reviewed:: 2022-10-26T11:51:05.213Z
+ card-last-score:: 3
+ - **Structural constraints** specify a pair of integer numbers *(min, max)* for each entity participating in a relationship.
+ - Examples: (0, 1), (1, 1), (1, N)., (1, 7).
+ -
+ - ## Attributes
+ collapsed:: true
+ - What are **Attributes**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:29:04.692Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Attributes** are ^^named property^^ or characteristic of an entity.
+ - Each entity has a set of attributes associated with it.
+ - Several types of attributes exist:
+ - Key.
+ - Composite.
+ - Derived.
+ - Multi-valued.
+ - **Notation:**
+ - **Chen:** An oval enclosing the name of the attribute.
+ - 
+ - **Crow:** Listed in the entity box.
+ - 
+ - What are **key attributes**? #card
+ card-last-interval:: 4.04
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T10:47:07.833Z
+ card-last-reviewed:: 2022-10-07T10:47:07.833Z
+ card-last-score:: 5
+ collapsed:: true
+ - Each entity type must have an attribute or set of attributes that ^^uniquely identifies^^ each instance from other instances of the same type.
+ - A **candidate key** is an attribute (or combination of attributes) that uniquely identifies each instance of an entity type.
+ - A **primary key (PK)** is a candidate key that has been selected as the identifier for an entity type.
+ - What is a **composite attribute**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:45:42.013Z
+ card-last-reviewed:: 2022-10-10T11:45:42.014Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **composite attribute** is an attribute that is composed of several atomic (simple) attributes.
+ - If the composite attribute is referenced as a whole only, then there is no need to subdivide it into component attributes, otherwise you should divide it:
+ - 
+ - What is a **derived attribute**? #card
+ card-last-interval:: 5.14
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-25T11:37:32.828Z
+ card-last-reviewed:: 2022-10-20T08:37:32.828Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **derived attribute** is an attribute whose values can be determined from another attribute.
+ - For Chen's notation, the notation is a *dotted oval*.
+ - 
+ - For Crow's Foot notation, derived attributes can be represented by enclosing the attribute in [square brackets], e.g., [age].
+ - What is a **multi-valued attribute**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:39:12.380Z
+ card-last-score:: 1
+ - A **multi-valued attribute** is an attribute which has lower & upper bounds on the number of values for an individual entry.
+ - For Chen's notation, multi-valued attributes can be represented by one oval inside another.
+ - 
+ - For Crow's Foot notation, multi-valued attributes can be represented by enclosing the attribute in {curly brackets}.
+ - E.g., {skills}.
+ -
+-
+- # Total & Partial Participation
+ collapsed:: true
+ - What is **Total Participation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:31:55.731Z
+ card-last-score:: 1
+ - **Total Participation** (Mandatory Participation): All instances of an entity must participate in the relationship, i.e., *every* entity instance in one set *must* be related to an entity instance in the second via the relationship.
+ - For example, the entity "Student" must have **total participation** in the relationship "enrolled" with the entity "Course" - each student *must* be enrolled in a course.
+ - What is **Partial Participation**? #card
+ card-last-interval:: 2.51
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T03:07:33.950Z
+ card-last-reviewed:: 2022-10-08T15:07:33.952Z
+ card-last-score:: 5
+ - **Partial Participation** (Optional Participation): Some subset of instances of an entity will participate in the relationship, but not all, i.e., *some* entity instances in one set are related to an entity instance in the second via the relationship.
+ - For example, the entity "Course" would have a **partial participation** in the relationship "enrolled" with the entity "Student" - a course might not have any students enrolled in it.
+ - ## Chen's Notation for Participation #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-18T05:50:33.140Z
+ card-last-reviewed:: 2022-10-09T08:50:33.141Z
+ card-last-score:: 3
+ - In both total & partial participation, the line(s) are drawn from the participating entity to the relationship (the diamond) to indicate the participation of that instance from that entity in the relationship,
+ - **Total Participation:** Double parallel lines.
+ - 
+ - **Partial Participation:** Single line.
+ - 
+ - Examples:
+ - 
+ -
+ - ## Crow's Foot Notation for Participation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:42:23.258Z
+ card-last-score:: 1
+ collapsed:: true
+ - Use the idea of **Ordinality / Optionality**.
+ - **Optionality of 0:** If an entity $A$ has partial participation in a relationship to entity $B$, then $A$ is associated with 0 or more instances of entity $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 0** is a **bar**: $|$
+ - **Optionality of 1:** If an entity $A$ has full participation in a relationship to entity $B$, then $A$ is associated with at least 1 or more of $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 1** is a **circle** or "o": $\bigcirc$
+ - [And vice-versa.]
+ - In Crow's Foot notation, there is no diamond, so there is always a direct relationship line between the entities.
+ - The **optionality sign** is drawn on this line.
+ - The optionality drawn beside some entity $A$ refers to how an instance of entity $B$ is related to entity $A$.
+ - That is, whether $B$ can be involved partially (0) or not (1).
+ - Example in *Right to Left* Relationships:
+ - 
+ -
+ - ## Note on Weak Entities
+ - **Note:** ^^A **weak entity type** always has a total participation constraint.^^
+ - We need to show the "identifying relationship".
+ - 
+ - ### Chen's Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:38:00.499Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Entity:** Double rectangle.
+ - **Relationship:** Double diamond.
+ - The weak entity has full participation in the relationship.
+ - 
+ -
+ - ### Crow's Foot Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:41:13.705Z
+ card-last-score:: 1
+ collapsed:: true
+ - In Crow's Foot Notation, we can represent the **weak entity** as a normal entity, but do not choose any attributes as the primary key.
+ - For an attribute that partially determines the entity instances, we choose the "required" option.
+ - We usually represent the relationship between entities using a **solid line**.
+ - This indicates that it is an "identifying" relationship.
+ - 
+ -
+ -
+ - In general, with entities, there may be two valid solutions, one with a weak entity, and one without.
+ - There is not a huge difficulty if you do not identify weak entities in a solution so long as all the entities have **primary attributes**.
+ - It may be slightly non-optimal in terms of introducing an additional primary key that is not needed, but this is not a huge problem for us at this level.
+-
+- # Entities or Multi-Valued Attributes?
+ collapsed:: true
+ - Sometimes, it may not be clear whether something should be modelled as a multi-valued attribute or an entity.
+ - Both may be equally correct, as long as you represent all the information that you are asked to.
+ - You may see (very little) difference between the two approaches if you map either approach to tables in a database.
+-
+- # Steps to Create an ER Model
+ - 1. Identify entities.
+ 2. Identify relationships between entities.
+ 3. Draw entities & relationships.
+ 4. Add attributes to entities (& relationships, if appropriate).
+ 5. Add cardinalities to relationships.
+ 6. Add participation constraints (total or partial) to relationships.
+ 7. Check that all entities have primary keys identified.
+-
+- # Mapping ER Models to Tables in the Relational Model
+ - Once you have you ER diagram, you now need to convert it into a set of tables so that you can implement it in a relational mode.
+ - Example: As MySQL tables using `CREATE TABLES` commands.
+ - This stage is called **Mapping ER Models to Tables in the Relational Model**, and it specifies a set of rules that must be followed in a certain order.
+ - The rules specified here are based on **Chen's Notation**.
+ - ## Steps
+ - [1] For each entity, create a table $R$ that includes all the **simple** attributes of the entity.
+ - [2] For strong entities, choose a key attribute as the primary key of the table.
+ - [3] For weak entities $R$, include the primary key attributes of the table that corresponds to the owner as foreign key attributes of $R$.
+ - The primary key of $R$ is a combination of the primary key of the owner and the partial key of the weak entity type.
+ - The relationship of the weak & strong entity is generally taken care of by this step.
+ - [4] For each **binary** $1:1$ relationship, identify entites $S$ & $T$ that participate in the relation.
+ - If applicable, choose the entity that has **total participation** in the relation.
+ - Include the primary key of the other relation as the foreign key in this table.
+ - Include any attributes of the relationship as attributes of the chosen table.
+ - If both entities have total participation in the relationship, you can choose either one for the foreign key and proceed as above, or you can map two entities & their associated attributes & relationship attributes into one table.
+ - [5] For each **binary** $1:N$ relationship, identify the table $S$ that represents the $N$ side and the table $T$ that represents the $1$ side.
+ - Include the primary key of table $T$ as a foreign key in $S$ such that each entity on the $N$ side is related to at most one entity instance on the $1$ side.
+ - Include any attributes of the relationship as attributes of $S$.
+ - For recursive $1:N$ relationships, choose the primary key of the table and include it as a foreign key in the same table with a different name.
+ - [6] For each $M:N$ relationship, create a new table $S$ to represent the relationship.
+ - Include the primary keys of the tables that represent the participating entity types as foreign keys in $S$ - their combination will form the primary key of $S$.
+ - Also include in $S$ any attributes of the relationship.
+ - For a recursive $M:N$ relationship, both foreign keys come from the same table (give different names to each) and become the new primary key.
+ - [7] For each **multi-valued attribute** $A$ of an entity $S$, create a new table $R$.
+ - $R$ will include:
+ - An attribute corresponding to $A$.
+ - The primary key of $S$, which will be a foreign key in $R$. Call this $K$.
+ - The primary key of $R$ is a combination of $A$ & $K$.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-11T12_04_45.329Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-11T12_04_45.329Z.Desktop.md
new file mode 100644
index 00000000..5a508df0
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-11T12_04_45.329Z.Desktop.md
@@ -0,0 +1,340 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Aggregate Clauses, Group By, & Having Clauses]]
+- **Next Topic:** [[Joins & Union Queries]]
+- **Relevant Slides:** 
+-
+- What are **Data Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:28:27.254Z
+ card-last-score:: 1
+ - **Data models** are concepts to describe the structure of a database.
+ - They comprise:
+ - High level or logical models;
+ - Representational / Implementational data models;
+ - Physical data models.
+ - Data models allow for database abstraction.
+- What are **ER Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:33:37.565Z
+ card-last-score:: 1
+ - **Entity Relationship Models** are a top-down approach to database design that provide a way to *model the data* that will be stored in a system. The models are then used to *create tables* in the relational model.
+ - ER Models are used to identify:
+ - [1] The important data to be stored in a database called **entities**.
+ - [2] The **relationships** between the entities.
+ - [3] The **attributes** of entities.
+ - [4] The **constraints** of relationships & entities.
+-
+- # ER Model Notation
+ - A number of different notations can be used to represent the same model.
+ - Chen Notation.
+ - IE Crow's Foot Notation.
+ - UML.
+ - Integrated Definition 1. Extended (IDEF1X).
+ -
+ - The original (Chen) notation uses diamonds, rectangles, and elipses.
+ - This is easier to hand-draw, so it is useful in an exam situation.
+ - It is less implementation-oriented than other notations.
+-
+- # Some Definitions
+ collapsed:: true
+ - ## Entities
+ collapsed:: true
+ - What is an **entity type**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:46:10.209Z
+ card-last-score:: 1
+ - An **entity type** is a collection of *entity instances* that share common properties or charcteristics.
+ - It is a group of objects, with the same properties, which are identified as having an independent existence.
+ - 
+ - What is an **entity instance**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:45:57.663Z
+ card-last-reviewed:: 2022-10-10T11:45:57.664Z
+ card-last-score:: 5
+ - An **entity instance** or **entity occurrence** is a single, uniquely identifiable occurrence of an entity type (e.g., row in a table).
+ - 
+ - ## Relationships
+ - What is a **relationship type**? #card
+ card-last-interval:: 2.6
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T05:10:30.449Z
+ card-last-reviewed:: 2022-10-08T15:10:30.450Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **relationship type** is a set of meaningful relationships among entity types.
+ - **Chen's Notation:** A diamond shape is used to name the relationship. 1 and M/N are used for the "1" and "many" sides respectively.
+ - **Crow's Foot Notation:** The titular "crow's foot" is used as the representation of "many", and one line is used for the representation of "1".
+ - 
+ - **Example:** employee "works for" department. department "has" employee.
+ - 
+ - What is a **relationship instance**? #card
+ collapsed:: true
+ card-last-interval:: 15.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-04T12:37:54.349Z
+ card-last-reviewed:: 2022-10-20T08:37:54.349Z
+ card-last-score:: 5
+ - A **relationship instance** or **relationship occurrence** is a uniquely identifiable association which includes one occurrence from each participating entity type; reading left to right and right to left.
+ - **Example:**
+ - Left-to-Right: John Smith "works for" Research department.
+ - Right-to-Left: Research department "has" John Smith.
+ - What is the **degree** of a relationship type? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-23T18:28:15.095Z
+ card-last-reviewed:: 2022-10-20T08:28:15.096Z
+ card-last-score:: 3
+ collapsed:: true
+ - Whenever an attribute of one entity type refers to another entity type, some relationship exists.
+ - The **degree** of a relationship type is ^^the number of participating entity types.^^
+ - Relationship types may have certain constraints.
+ - What is the **Cardinality Ratio**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:25:13.663Z
+ card-last-score:: 1
+ - The **cardinality ratio** specifies ^^the number of relationship instances that an entity can participate in.^^
+ - The possible cardinality ratios for binary relationship types are:
+ - $1:1$, "one to one" - at most one instance of entity $A$ is associated with one instance of entity $B$.
+ - $1:N$, "one to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$.
+ - $M:N$, "many to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$, and for one instance of entity $B$, there are 0 or more instances of entity $A$.
+ -
+ - ### Structural Constraints on Relationships
+ - Often, we may know the min & max of the cardinalities.
+ - Example: limit on the number of books that can be borrowed from a library.
+ - What are **Structural Constraints**? #card
+ card-last-interval:: 0.85
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-27T07:51:05.213Z
+ card-last-reviewed:: 2022-10-26T11:51:05.213Z
+ card-last-score:: 3
+ - **Structural constraints** specify a pair of integer numbers *(min, max)* for each entity participating in a relationship.
+ - Examples: (0, 1), (1, 1), (1, N)., (1, 7).
+ -
+ - ## Attributes
+ collapsed:: true
+ - What are **Attributes**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:29:04.692Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Attributes** are ^^named property^^ or characteristic of an entity.
+ - Each entity has a set of attributes associated with it.
+ - Several types of attributes exist:
+ - Key.
+ - Composite.
+ - Derived.
+ - Multi-valued.
+ - **Notation:**
+ - **Chen:** An oval enclosing the name of the attribute.
+ - 
+ - **Crow:** Listed in the entity box.
+ - 
+ - What are **key attributes**? #card
+ card-last-interval:: 4.04
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T10:47:07.833Z
+ card-last-reviewed:: 2022-10-07T10:47:07.833Z
+ card-last-score:: 5
+ collapsed:: true
+ - Each entity type must have an attribute or set of attributes that ^^uniquely identifies^^ each instance from other instances of the same type.
+ - A **candidate key** is an attribute (or combination of attributes) that uniquely identifies each instance of an entity type.
+ - A **primary key (PK)** is a candidate key that has been selected as the identifier for an entity type.
+ - What is a **composite attribute**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:45:42.013Z
+ card-last-reviewed:: 2022-10-10T11:45:42.014Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **composite attribute** is an attribute that is composed of several atomic (simple) attributes.
+ - If the composite attribute is referenced as a whole only, then there is no need to subdivide it into component attributes, otherwise you should divide it:
+ - 
+ - What is a **derived attribute**? #card
+ card-last-interval:: 5.14
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-25T11:37:32.828Z
+ card-last-reviewed:: 2022-10-20T08:37:32.828Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **derived attribute** is an attribute whose values can be determined from another attribute.
+ - For Chen's notation, the notation is a *dotted oval*.
+ - 
+ - For Crow's Foot notation, derived attributes can be represented by enclosing the attribute in [square brackets], e.g., [age].
+ - What is a **multi-valued attribute**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:39:12.380Z
+ card-last-score:: 1
+ - A **multi-valued attribute** is an attribute which has lower & upper bounds on the number of values for an individual entry.
+ - For Chen's notation, multi-valued attributes can be represented by one oval inside another.
+ - 
+ - For Crow's Foot notation, multi-valued attributes can be represented by enclosing the attribute in {curly brackets}.
+ - E.g., {skills}.
+ -
+-
+- # Total & Partial Participation
+ collapsed:: true
+ - What is **Total Participation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:45:13.796Z
+ card-last-score:: 1
+ - **Total Participation** (Mandatory Participation): ==All instances of an entity must participate in the relationship==, i.e., *every* entity instance in one set *must* be related to an entity instance in the second via the relationship.
+ - For example, the entity "Student" must have **total participation** in the relationship "enrolled" with the entity "Course" - each student *must* be enrolled in a course.
+ - What is **Partial Participation**? #card
+ card-last-interval:: 2.51
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T03:07:33.950Z
+ card-last-reviewed:: 2022-10-08T15:07:33.952Z
+ card-last-score:: 5
+ - **Partial Participation** (Optional Participation): Some subset of instances of an entity will participate in the relationship, but not all, i.e., *some* entity instances in one set are related to an entity instance in the second via the relationship.
+ - For example, the entity "Course" would have a **partial participation** in the relationship "enrolled" with the entity "Student" - a course might not have any students enrolled in it.
+ - ## Chen's Notation for Participation #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-18T05:50:33.140Z
+ card-last-reviewed:: 2022-10-09T08:50:33.141Z
+ card-last-score:: 3
+ - In both total & partial participation, the line(s) are drawn from the participating entity to the relationship (the diamond) to indicate the participation of that instance from that entity in the relationship,
+ - **Total Participation:** Double parallel lines.
+ - 
+ - **Partial Participation:** Single line.
+ - 
+ - Examples:
+ - 
+ -
+ - ## Crow's Foot Notation for Participation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:42:23.258Z
+ card-last-score:: 1
+ collapsed:: true
+ - Use the idea of **Ordinality / Optionality**.
+ - **Optionality of 0:** If an entity $A$ has partial participation in a relationship to entity $B$, then $A$ is associated with 0 or more instances of entity $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 0** is a **bar**: $|$
+ - **Optionality of 1:** If an entity $A$ has full participation in a relationship to entity $B$, then $A$ is associated with at least 1 or more of $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 1** is a **circle** or "o": $\bigcirc$
+ - [And vice-versa.]
+ - In Crow's Foot notation, there is no diamond, so there is always a direct relationship line between the entities.
+ - The **optionality sign** is drawn on this line.
+ - The optionality drawn beside some entity $A$ refers to how an instance of entity $B$ is related to entity $A$.
+ - That is, whether $B$ can be involved partially (0) or not (1).
+ - Example in *Right to Left* Relationships:
+ - 
+ -
+ - ## Note on Weak Entities
+ - **Note:** ^^A **weak entity type** always has a total participation constraint.^^
+ - We need to show the "identifying relationship".
+ - 
+ - ### Chen's Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:38:00.499Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Entity:** Double rectangle.
+ - **Relationship:** Double diamond.
+ - The weak entity has full participation in the relationship.
+ - 
+ -
+ - ### Crow's Foot Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:41:13.705Z
+ card-last-score:: 1
+ collapsed:: true
+ - In Crow's Foot Notation, we can represent the **weak entity** as a normal entity, but do not choose any attributes as the primary key.
+ - For an attribute that partially determines the entity instances, we choose the "required" option.
+ - We usually represent the relationship between entities using a **solid line**.
+ - This indicates that it is an "identifying" relationship.
+ - 
+ -
+ -
+ - In general, with entities, there may be two valid solutions, one with a weak entity, and one without.
+ - There is not a huge difficulty if you do not identify weak entities in a solution so long as all the entities have **primary attributes**.
+ - It may be slightly non-optimal in terms of introducing an additional primary key that is not needed, but this is not a huge problem for us at this level.
+-
+- # Entities or Multi-Valued Attributes?
+ collapsed:: true
+ - Sometimes, it may not be clear whether something should be modelled as a multi-valued attribute or an entity.
+ - Both may be equally correct, as long as you represent all the information that you are asked to.
+ - You may see (very little) difference between the two approaches if you map either approach to tables in a database.
+-
+- # Steps to Create an ER Model
+ - 1. Identify entities.
+ 2. Identify relationships between entities.
+ 3. Draw entities & relationships.
+ 4. Add attributes to entities (& relationships, if appropriate).
+ 5. Add cardinalities to relationships.
+ 6. Add participation constraints (total or partial) to relationships.
+ 7. Check that all entities have primary keys identified.
+-
+- # Mapping ER Models to Tables in the Relational Model
+ - Once you have you ER diagram, you now need to convert it into a set of tables so that you can implement it in a relational mode.
+ - Example: As MySQL tables using `CREATE TABLES` commands.
+ - This stage is called **Mapping ER Models to Tables in the Relational Model**, and it specifies a set of rules that must be followed in a certain order.
+ - The rules specified here are based on **Chen's Notation**.
+ - ## Steps
+ - [1] For each entity, create a table $R$ that includes all the **simple** attributes of the entity.
+ - [2] For strong entities, choose a key attribute as the primary key of the table.
+ - [3] For weak entities $R$, include the primary key attributes of the table that corresponds to the owner as foreign key attributes of $R$.
+ - The primary key of $R$ is a combination of the primary key of the owner and the partial key of the weak entity type.
+ - The relationship of the weak & strong entity is generally taken care of by this step.
+ - [4] For each **binary** $1:1$ relationship, identify entites $S$ & $T$ that participate in the relation.
+ - If applicable, choose the entity that has **total participation** in the relation.
+ - Include the primary key of the other relation as the foreign key in this table.
+ - Include any attributes of the relationship as attributes of the chosen table.
+ - If both entities have total participation in the relationship, you can choose either one for the foreign key and proceed as above, or you can map two entities & their associated attributes & relationship attributes into one table.
+ - [5] For each **binary** $1:N$ relationship, identify the table $S$ that represents the $N$ side and the table $T$ that represents the $1$ side.
+ - Include the primary key of table $T$ as a foreign key in $S$ such that each entity on the $N$ side is related to at most one entity instance on the $1$ side.
+ - Include any attributes of the relationship as attributes of $S$.
+ - For recursive $1:N$ relationships, choose the primary key of the table and include it as a foreign key in the same table with a different name.
+ - [6] For each $M:N$ relationship, create a new table $S$ to represent the relationship.
+ - Include the primary keys of the tables that represent the participating entity types as foreign keys in $S$ - their combination will form the primary key of $S$.
+ - Also include in $S$ any attributes of the relationship.
+ - For a recursive $M:N$ relationship, both foreign keys come from the same table (give different names to each) and become the new primary key.
+ - [7] For each **multi-valued attribute** $A$ of an entity $S$, create a new table $R$.
+ - $R$ will include:
+ - An attribute corresponding to $A$.
+ - The primary key of $S$, which will be a foreign key in $R$. Call this $K$.
+ - The primary key of $R$ is a combination of $A$ & $K$.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-23T09_22_44.497Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-23T09_22_44.497Z.Desktop.md
new file mode 100644
index 00000000..9d94082e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-23T09_22_44.497Z.Desktop.md
@@ -0,0 +1,340 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Aggregate Clauses, Group By, & Having Clauses]]
+- **Next Topic:** [[Joins & Union Queries]]
+- **Relevant Slides:** 
+-
+- What are **Data Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:34:07.942Z
+ card-last-score:: 1
+ - **Data models** are concepts to describe the structure of a database.
+ - They comprise:
+ - High level or logical models;
+ - Representational / Implementational data models;
+ - Physical data models.
+ - Data models allow for database abstraction.
+- What are **ER Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:34:30.174Z
+ card-last-score:: 1
+ - **Entity Relationship Models** are a top-down approach to database design that provide a way to *model the data* that will be stored in a system. The models are then used to *create tables* in the relational model.
+ - ER Models are used to identify:
+ - [1] The important data to be stored in a database called **entities**.
+ - [2] The **relationships** between the entities.
+ - [3] The **attributes** of entities.
+ - [4] The **constraints** of relationships & entities.
+-
+- # ER Model Notation
+ - A number of different notations can be used to represent the same model.
+ - Chen Notation.
+ - IE Crow's Foot Notation.
+ - UML.
+ - Integrated Definition 1. Extended (IDEF1X).
+ -
+ - The original (Chen) notation uses diamonds, rectangles, and elipses.
+ - This is easier to hand-draw, so it is useful in an exam situation.
+ - It is less implementation-oriented than other notations.
+-
+- # Some Definitions
+ collapsed:: true
+ - ## Entities
+ collapsed:: true
+ - What is an **entity type**? #card
+ card-last-interval:: 3.05
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T21:24:38.127Z
+ card-last-reviewed:: 2022-11-14T20:24:38.127Z
+ card-last-score:: 5
+ - An **entity type** is a collection of *entity instances* that share common properties or charcteristics.
+ - It is a group of objects, with the same properties, which are identified as having an independent existence.
+ - 
+ - What is an **entity instance**? #card
+ card-last-interval:: 11.34
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-26T00:47:05.851Z
+ card-last-reviewed:: 2022-11-14T16:47:05.851Z
+ card-last-score:: 5
+ - An **entity instance** or **entity occurrence** is a single, uniquely identifiable occurrence of an entity type (e.g., row in a table).
+ - 
+ - ## Relationships
+ - What is a **relationship type**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:30:24.202Z
+ card-last-score:: 1
+ collapsed:: true
+ - A **relationship type** is a set of meaningful relationships among entity types.
+ - **Chen's Notation:** A diamond shape is used to name the relationship. 1 and M/N are used for the "1" and "many" sides respectively.
+ - **Crow's Foot Notation:** The titular "crow's foot" is used as the representation of "many", and one line is used for the representation of "1".
+ - 
+ - **Example:** employee "works for" department. department "has" employee.
+ - 
+ - What is a **relationship instance**? #card
+ collapsed:: true
+ card-last-interval:: 29.04
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-12-10T11:35:42.874Z
+ card-last-reviewed:: 2022-11-11T11:35:42.874Z
+ card-last-score:: 3
+ - A **relationship instance** or **relationship occurrence** is ==a uniquely identifiable association which includes one occurrence from each participating entity type==; reading left to right and right to left.
+ - **Example:**
+ - Left-to-Right: John Smith "works for" Research department.
+ - Right-to-Left: Research department "has" John Smith.
+ - What is the **degree** of a relationship type? #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-22T01:30:24.968Z
+ card-last-reviewed:: 2022-11-11T11:30:24.969Z
+ card-last-score:: 5
+ collapsed:: true
+ - Whenever an attribute of one entity type refers to another entity type, some relationship exists.
+ - The **degree** of a relationship type is ^^the number of participating entity types.^^
+ - Relationship types may have certain constraints.
+ - What is the **Cardinality Ratio**? #card
+ collapsed:: true
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-20T15:15:43.390Z
+ card-last-reviewed:: 2022-11-17T20:15:43.391Z
+ card-last-score:: 5
+ - The **cardinality ratio** specifies ^^the number of relationship instances that an entity can participate in.^^
+ - The possible cardinality ratios for binary relationship types are:
+ - $1:1$, "one to one" - at most one instance of entity $A$ is associated with one instance of entity $B$.
+ - $1:N$, "one to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$.
+ - $M:N$, "many to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$, and for one instance of entity $B$, there are 0 or more instances of entity $A$.
+ -
+ - ### Structural Constraints on Relationships
+ - Often, we may know the min & max of the cardinalities.
+ - Example: limit on the number of books that can be borrowed from a library.
+ - What are **Structural Constraints**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-25T13:06:19.301Z
+ card-last-reviewed:: 2022-11-21T13:06:19.301Z
+ card-last-score:: 3
+ - **Structural constraints** specify a pair of integer numbers *(min, max)* for each entity participating in a relationship.
+ - Examples: (0, 1), (1, 1), (1, N)., (1, 7).
+ -
+ - ## Attributes
+ collapsed:: true
+ - What are **Attributes**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:19:08.122Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Attributes** are ^^named property^^ or characteristic of an entity.
+ - Each entity has a set of attributes associated with it.
+ - Several types of attributes exist:
+ - Key.
+ - Composite.
+ - Derived.
+ - Multi-valued.
+ - **Notation:**
+ - **Chen:** An oval enclosing the name of the attribute.
+ - 
+ - **Crow:** Listed in the entity box.
+ - 
+ - What are **key attributes**? #card
+ card-last-interval:: 5.52
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-20T04:37:24.678Z
+ card-last-reviewed:: 2022-11-14T16:37:24.678Z
+ card-last-score:: 3
+ collapsed:: true
+ - Each entity type must have an attribute or set of attributes that ^^uniquely identifies^^ each instance from other instances of the same type.
+ - A **candidate key** is an attribute (or combination of attributes) that uniquely identifies each instance of an entity type.
+ - A **primary key (PK)** is a candidate key that has been selected as the identifier for an entity type.
+ - What is a **composite attribute**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:46:49.892Z
+ card-last-score:: 1
+ collapsed:: true
+ - A **composite attribute** is an attribute that is composed of several atomic (simple) attributes.
+ - If the composite attribute is referenced as a whole only, then there is no need to subdivide it into component attributes, otherwise you should divide it:
+ - 
+ - What is a **derived attribute**? #card
+ card-last-interval:: 31.05
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-12-15T21:12:18.376Z
+ card-last-reviewed:: 2022-11-14T20:12:18.376Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **derived attribute** is an attribute whose values can be determined from another attribute.
+ - For Chen's notation, the notation is a *dotted oval*.
+ - 
+ - For Crow's Foot notation, derived attributes can be represented by enclosing the attribute in [square brackets], e.g., [age].
+ - What is a **multi-valued attribute**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:18:04.379Z
+ card-last-score:: 1
+ - A **multi-valued attribute** is an attribute which has lower & upper bounds on the number of values for an individual entry.
+ - For Chen's notation, multi-valued attributes can be represented by one oval inside another.
+ - 
+ - For Crow's Foot notation, multi-valued attributes can be represented by enclosing the attribute in {curly brackets}.
+ - E.g., {skills}.
+ -
+-
+- # Total & Partial Participation
+ collapsed:: true
+ - What is **Total Participation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-18T20:26:04.052Z
+ card-last-reviewed:: 2022-11-14T20:26:04.052Z
+ card-last-score:: 3
+ - **Total Participation** (Mandatory Participation): ==All instances of an entity must participate in the relationship==, i.e., *every* entity instance in one set *must* be related to an entity instance in the second via the relationship.
+ - For example, the entity "Student" must have **total participation** in the relationship "enrolled" with the entity "Course" - each student *must* be enrolled in a course.
+ - What is **Partial Participation**? #card
+ card-last-interval:: 7.45
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-22T02:28:50.125Z
+ card-last-reviewed:: 2022-11-14T16:28:50.125Z
+ card-last-score:: 3
+ - **Partial Participation** (Optional Participation): Some subset of instances of an entity will participate in the relationship, but not all, i.e., *some* entity instances in one set are related to an entity instance in the second via the relationship.
+ - For example, the entity "Course" would have a **partial participation** in the relationship "enrolled" with the entity "Student" - a course might not have any students enrolled in it.
+ - ## Chen's Notation for Participation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:06:29.661Z
+ card-last-score:: 1
+ - In both total & partial participation, the line(s) are drawn from the participating entity to the relationship (the diamond) to indicate the participation of that instance from that entity in the relationship,
+ - **Total Participation:** Double parallel lines.
+ - 
+ - **Partial Participation:** Single line.
+ - 
+ - Examples:
+ - 
+ -
+ - ## Crow's Foot Notation for Participation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:19:01.789Z
+ card-last-score:: 1
+ collapsed:: true
+ - Use the idea of **Ordinality / Optionality**.
+ - **Optionality of 0:** If an entity $A$ has partial participation in a relationship to entity $B$, then $A$ is associated with 0 or more instances of entity $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 0** is a **bar**: $|$
+ - **Optionality of 1:** If an entity $A$ has full participation in a relationship to entity $B$, then $A$ is associated with at least 1 or more of $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 1** is a **circle** or "o": $\bigcirc$
+ - [And vice-versa.]
+ - In Crow's Foot notation, there is no diamond, so there is always a direct relationship line between the entities.
+ - The **optionality sign** is drawn on this line.
+ - The optionality drawn beside some entity $A$ refers to how an instance of entity $B$ is related to entity $A$.
+ - That is, whether $B$ can be involved partially (0) or not (1).
+ - Example in *Right to Left* Relationships:
+ - 
+ -
+ - ## Note on Weak Entities
+ - **Note:** ^^A **weak entity type** always has a total participation constraint.^^
+ - We need to show the "identifying relationship".
+ - 
+ - ### Chen's Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:34:03.316Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Entity:** Double rectangle.
+ - **Relationship:** Double diamond.
+ - The weak entity has full participation in the relationship.
+ - 
+ -
+ - ### Crow's Foot Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T19:36:10.883Z
+ card-last-score:: 1
+ collapsed:: true
+ - In Crow's Foot Notation, we can represent the **weak entity** as a normal entity, but do not choose any attributes as the primary key.
+ - For an attribute that partially determines the entity instances, we choose the "required" option.
+ - We usually represent the relationship between entities using a **solid line**.
+ - This indicates that it is an "identifying" relationship.
+ - 
+ -
+ -
+ - In general, with entities, there may be two valid solutions, one with a weak entity, and one without.
+ - There is not a huge difficulty if you do not identify weak entities in a solution so long as all the entities have **primary attributes**.
+ - It may be slightly non-optimal in terms of introducing an additional primary key that is not needed, but this is not a huge problem for us at this level.
+-
+- # Entities or Multi-Valued Attributes?
+ collapsed:: true
+ - Sometimes, it may not be clear whether something should be modelled as a multi-valued attribute or an entity.
+ - Both may be equally correct, as long as you represent all the information that you are asked to.
+ - You may see (very little) difference between the two approaches if you map either approach to tables in a database.
+-
+- # Steps to Create an ER Model
+ - 1. Identify entities.
+ 2. Identify relationships between entities.
+ 3. Draw entities & relationships.
+ 4. Add attributes to entities (& relationships, if appropriate).
+ 5. Add cardinalities to relationships.
+ 6. Add participation constraints (total or partial) to relationships.
+ 7. Check that all entities have primary keys identified.
+-
+- # Mapping ER Models to Tables in the Relational Model
+ - Once you have you ER diagram, you now need to convert it into a set of tables so that you can implement it in a relational mode.
+ - Example: As MySQL tables using `CREATE TABLES` commands.
+ - This stage is called **Mapping ER Models to Tables in the Relational Model**, and it specifies a set of rules that must be followed in a certain order.
+ - The rules specified here are based on **Chen's Notation**.
+ - ## Steps
+ - [1] For each entity, create a table $R$ that includes all the **simple** attributes of the entity.
+ - [2] For strong entities, choose a key attribute as the primary key of the table.
+ - [3] For weak entities $R$, include the primary key attributes of the table that corresponds to the owner as foreign key attributes of $R$.
+ - The primary key of $R$ is a combination of the primary key of the owner and the partial key of the weak entity type.
+ - The relationship of the weak & strong entity is generally taken care of by this step.
+ - [4] For each **binary** $1:1$ relationship, identify entites $S$ & $T$ that participate in the relation.
+ - If applicable, choose the entity that has **total participation** in the relation.
+ - Include the primary key of the other relation as the foreign key in this table.
+ - Include any attributes of the relationship as attributes of the chosen table.
+ - If both entities have total participation in the relationship, you can choose either one for the foreign key and proceed as above, or you can map two entities & their associated attributes & relationship attributes into one table.
+ - [5] For each **binary** $1:N$ relationship, identify the table $S$ that represents the $N$ side and the table $T$ that represents the $1$ side.
+ - Include the primary key of table $T$ as a foreign key in $S$ such that each entity on the $N$ side is related to at most one entity instance on the $1$ side.
+ - Include any attributes of the relationship as attributes of $S$.
+ - For recursive $1:N$ relationships, choose the primary key of the table and include it as a foreign key in the same table with a different name.
+ - [6] For each $M:N$ relationship, create a new table $S$ to represent the relationship.
+ - Include the primary keys of the tables that represent the participating entity types as foreign keys in $S$ - their combination will form the primary key of $S$.
+ - Also include in $S$ any attributes of the relationship.
+ - For a recursive $M:N$ relationship, both foreign keys come from the same table (give different names to each) and become the new primary key.
+ - [7] For each **multi-valued attribute** $A$ of an entity $S$, create a new table $R$.
+ - $R$ will include:
+ - An attribute corresponding to $A$.
+ - The primary key of $S$, which will be a foreign key in $R$. Call this $K$.
+ - The primary key of $R$ is a combination of $A$ & $K$.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-23T12_15_36.860Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-23T12_15_36.860Z.Desktop.md
new file mode 100644
index 00000000..9d94082e
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Entity Relationship Models/2022-11-23T12_15_36.860Z.Desktop.md
@@ -0,0 +1,340 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Aggregate Clauses, Group By, & Having Clauses]]
+- **Next Topic:** [[Joins & Union Queries]]
+- **Relevant Slides:** 
+-
+- What are **Data Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:34:07.942Z
+ card-last-score:: 1
+ - **Data models** are concepts to describe the structure of a database.
+ - They comprise:
+ - High level or logical models;
+ - Representational / Implementational data models;
+ - Physical data models.
+ - Data models allow for database abstraction.
+- What are **ER Models**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:34:30.174Z
+ card-last-score:: 1
+ - **Entity Relationship Models** are a top-down approach to database design that provide a way to *model the data* that will be stored in a system. The models are then used to *create tables* in the relational model.
+ - ER Models are used to identify:
+ - [1] The important data to be stored in a database called **entities**.
+ - [2] The **relationships** between the entities.
+ - [3] The **attributes** of entities.
+ - [4] The **constraints** of relationships & entities.
+-
+- # ER Model Notation
+ - A number of different notations can be used to represent the same model.
+ - Chen Notation.
+ - IE Crow's Foot Notation.
+ - UML.
+ - Integrated Definition 1. Extended (IDEF1X).
+ -
+ - The original (Chen) notation uses diamonds, rectangles, and elipses.
+ - This is easier to hand-draw, so it is useful in an exam situation.
+ - It is less implementation-oriented than other notations.
+-
+- # Some Definitions
+ collapsed:: true
+ - ## Entities
+ collapsed:: true
+ - What is an **entity type**? #card
+ card-last-interval:: 3.05
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T21:24:38.127Z
+ card-last-reviewed:: 2022-11-14T20:24:38.127Z
+ card-last-score:: 5
+ - An **entity type** is a collection of *entity instances* that share common properties or charcteristics.
+ - It is a group of objects, with the same properties, which are identified as having an independent existence.
+ - 
+ - What is an **entity instance**? #card
+ card-last-interval:: 11.34
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-26T00:47:05.851Z
+ card-last-reviewed:: 2022-11-14T16:47:05.851Z
+ card-last-score:: 5
+ - An **entity instance** or **entity occurrence** is a single, uniquely identifiable occurrence of an entity type (e.g., row in a table).
+ - 
+ - ## Relationships
+ - What is a **relationship type**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:30:24.202Z
+ card-last-score:: 1
+ collapsed:: true
+ - A **relationship type** is a set of meaningful relationships among entity types.
+ - **Chen's Notation:** A diamond shape is used to name the relationship. 1 and M/N are used for the "1" and "many" sides respectively.
+ - **Crow's Foot Notation:** The titular "crow's foot" is used as the representation of "many", and one line is used for the representation of "1".
+ - 
+ - **Example:** employee "works for" department. department "has" employee.
+ - 
+ - What is a **relationship instance**? #card
+ collapsed:: true
+ card-last-interval:: 29.04
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-12-10T11:35:42.874Z
+ card-last-reviewed:: 2022-11-11T11:35:42.874Z
+ card-last-score:: 3
+ - A **relationship instance** or **relationship occurrence** is ==a uniquely identifiable association which includes one occurrence from each participating entity type==; reading left to right and right to left.
+ - **Example:**
+ - Left-to-Right: John Smith "works for" Research department.
+ - Right-to-Left: Research department "has" John Smith.
+ - What is the **degree** of a relationship type? #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-22T01:30:24.968Z
+ card-last-reviewed:: 2022-11-11T11:30:24.969Z
+ card-last-score:: 5
+ collapsed:: true
+ - Whenever an attribute of one entity type refers to another entity type, some relationship exists.
+ - The **degree** of a relationship type is ^^the number of participating entity types.^^
+ - Relationship types may have certain constraints.
+ - What is the **Cardinality Ratio**? #card
+ collapsed:: true
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-20T15:15:43.390Z
+ card-last-reviewed:: 2022-11-17T20:15:43.391Z
+ card-last-score:: 5
+ - The **cardinality ratio** specifies ^^the number of relationship instances that an entity can participate in.^^
+ - The possible cardinality ratios for binary relationship types are:
+ - $1:1$, "one to one" - at most one instance of entity $A$ is associated with one instance of entity $B$.
+ - $1:N$, "one to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$.
+ - $M:N$, "many to many" - for one instance of entity $A$, there are 0 or more instances of entity $B$, and for one instance of entity $B$, there are 0 or more instances of entity $A$.
+ -
+ - ### Structural Constraints on Relationships
+ - Often, we may know the min & max of the cardinalities.
+ - Example: limit on the number of books that can be borrowed from a library.
+ - What are **Structural Constraints**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-25T13:06:19.301Z
+ card-last-reviewed:: 2022-11-21T13:06:19.301Z
+ card-last-score:: 3
+ - **Structural constraints** specify a pair of integer numbers *(min, max)* for each entity participating in a relationship.
+ - Examples: (0, 1), (1, 1), (1, N)., (1, 7).
+ -
+ - ## Attributes
+ collapsed:: true
+ - What are **Attributes**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:19:08.122Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Attributes** are ^^named property^^ or characteristic of an entity.
+ - Each entity has a set of attributes associated with it.
+ - Several types of attributes exist:
+ - Key.
+ - Composite.
+ - Derived.
+ - Multi-valued.
+ - **Notation:**
+ - **Chen:** An oval enclosing the name of the attribute.
+ - 
+ - **Crow:** Listed in the entity box.
+ - 
+ - What are **key attributes**? #card
+ card-last-interval:: 5.52
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-20T04:37:24.678Z
+ card-last-reviewed:: 2022-11-14T16:37:24.678Z
+ card-last-score:: 3
+ collapsed:: true
+ - Each entity type must have an attribute or set of attributes that ^^uniquely identifies^^ each instance from other instances of the same type.
+ - A **candidate key** is an attribute (or combination of attributes) that uniquely identifies each instance of an entity type.
+ - A **primary key (PK)** is a candidate key that has been selected as the identifier for an entity type.
+ - What is a **composite attribute**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:46:49.892Z
+ card-last-score:: 1
+ collapsed:: true
+ - A **composite attribute** is an attribute that is composed of several atomic (simple) attributes.
+ - If the composite attribute is referenced as a whole only, then there is no need to subdivide it into component attributes, otherwise you should divide it:
+ - 
+ - What is a **derived attribute**? #card
+ card-last-interval:: 31.05
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-12-15T21:12:18.376Z
+ card-last-reviewed:: 2022-11-14T20:12:18.376Z
+ card-last-score:: 5
+ collapsed:: true
+ - A **derived attribute** is an attribute whose values can be determined from another attribute.
+ - For Chen's notation, the notation is a *dotted oval*.
+ - 
+ - For Crow's Foot notation, derived attributes can be represented by enclosing the attribute in [square brackets], e.g., [age].
+ - What is a **multi-valued attribute**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:18:04.379Z
+ card-last-score:: 1
+ - A **multi-valued attribute** is an attribute which has lower & upper bounds on the number of values for an individual entry.
+ - For Chen's notation, multi-valued attributes can be represented by one oval inside another.
+ - 
+ - For Crow's Foot notation, multi-valued attributes can be represented by enclosing the attribute in {curly brackets}.
+ - E.g., {skills}.
+ -
+-
+- # Total & Partial Participation
+ collapsed:: true
+ - What is **Total Participation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-18T20:26:04.052Z
+ card-last-reviewed:: 2022-11-14T20:26:04.052Z
+ card-last-score:: 3
+ - **Total Participation** (Mandatory Participation): ==All instances of an entity must participate in the relationship==, i.e., *every* entity instance in one set *must* be related to an entity instance in the second via the relationship.
+ - For example, the entity "Student" must have **total participation** in the relationship "enrolled" with the entity "Course" - each student *must* be enrolled in a course.
+ - What is **Partial Participation**? #card
+ card-last-interval:: 7.45
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-22T02:28:50.125Z
+ card-last-reviewed:: 2022-11-14T16:28:50.125Z
+ card-last-score:: 3
+ - **Partial Participation** (Optional Participation): Some subset of instances of an entity will participate in the relationship, but not all, i.e., *some* entity instances in one set are related to an entity instance in the second via the relationship.
+ - For example, the entity "Course" would have a **partial participation** in the relationship "enrolled" with the entity "Student" - a course might not have any students enrolled in it.
+ - ## Chen's Notation for Participation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:06:29.661Z
+ card-last-score:: 1
+ - In both total & partial participation, the line(s) are drawn from the participating entity to the relationship (the diamond) to indicate the participation of that instance from that entity in the relationship,
+ - **Total Participation:** Double parallel lines.
+ - 
+ - **Partial Participation:** Single line.
+ - 
+ - Examples:
+ - 
+ -
+ - ## Crow's Foot Notation for Participation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:19:01.789Z
+ card-last-score:: 1
+ collapsed:: true
+ - Use the idea of **Ordinality / Optionality**.
+ - **Optionality of 0:** If an entity $A$ has partial participation in a relationship to entity $B$, then $A$ is associated with 0 or more instances of entity $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 0** is a **bar**: $|$
+ - **Optionality of 1:** If an entity $A$ has full participation in a relationship to entity $B$, then $A$ is associated with at least 1 or more of $B$, so the **optionality sign** goes beside $B$.
+ - The optionality sign for an **Optionality of 1** is a **circle** or "o": $\bigcirc$
+ - [And vice-versa.]
+ - In Crow's Foot notation, there is no diamond, so there is always a direct relationship line between the entities.
+ - The **optionality sign** is drawn on this line.
+ - The optionality drawn beside some entity $A$ refers to how an instance of entity $B$ is related to entity $A$.
+ - That is, whether $B$ can be involved partially (0) or not (1).
+ - Example in *Right to Left* Relationships:
+ - 
+ -
+ - ## Note on Weak Entities
+ - **Note:** ^^A **weak entity type** always has a total participation constraint.^^
+ - We need to show the "identifying relationship".
+ - 
+ - ### Chen's Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:34:03.316Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Entity:** Double rectangle.
+ - **Relationship:** Double diamond.
+ - The weak entity has full participation in the relationship.
+ - 
+ -
+ - ### Crow's Foot Notation for Weak Entities #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T19:36:10.883Z
+ card-last-score:: 1
+ collapsed:: true
+ - In Crow's Foot Notation, we can represent the **weak entity** as a normal entity, but do not choose any attributes as the primary key.
+ - For an attribute that partially determines the entity instances, we choose the "required" option.
+ - We usually represent the relationship between entities using a **solid line**.
+ - This indicates that it is an "identifying" relationship.
+ - 
+ -
+ -
+ - In general, with entities, there may be two valid solutions, one with a weak entity, and one without.
+ - There is not a huge difficulty if you do not identify weak entities in a solution so long as all the entities have **primary attributes**.
+ - It may be slightly non-optimal in terms of introducing an additional primary key that is not needed, but this is not a huge problem for us at this level.
+-
+- # Entities or Multi-Valued Attributes?
+ collapsed:: true
+ - Sometimes, it may not be clear whether something should be modelled as a multi-valued attribute or an entity.
+ - Both may be equally correct, as long as you represent all the information that you are asked to.
+ - You may see (very little) difference between the two approaches if you map either approach to tables in a database.
+-
+- # Steps to Create an ER Model
+ - 1. Identify entities.
+ 2. Identify relationships between entities.
+ 3. Draw entities & relationships.
+ 4. Add attributes to entities (& relationships, if appropriate).
+ 5. Add cardinalities to relationships.
+ 6. Add participation constraints (total or partial) to relationships.
+ 7. Check that all entities have primary keys identified.
+-
+- # Mapping ER Models to Tables in the Relational Model
+ - Once you have you ER diagram, you now need to convert it into a set of tables so that you can implement it in a relational mode.
+ - Example: As MySQL tables using `CREATE TABLES` commands.
+ - This stage is called **Mapping ER Models to Tables in the Relational Model**, and it specifies a set of rules that must be followed in a certain order.
+ - The rules specified here are based on **Chen's Notation**.
+ - ## Steps
+ - [1] For each entity, create a table $R$ that includes all the **simple** attributes of the entity.
+ - [2] For strong entities, choose a key attribute as the primary key of the table.
+ - [3] For weak entities $R$, include the primary key attributes of the table that corresponds to the owner as foreign key attributes of $R$.
+ - The primary key of $R$ is a combination of the primary key of the owner and the partial key of the weak entity type.
+ - The relationship of the weak & strong entity is generally taken care of by this step.
+ - [4] For each **binary** $1:1$ relationship, identify entites $S$ & $T$ that participate in the relation.
+ - If applicable, choose the entity that has **total participation** in the relation.
+ - Include the primary key of the other relation as the foreign key in this table.
+ - Include any attributes of the relationship as attributes of the chosen table.
+ - If both entities have total participation in the relationship, you can choose either one for the foreign key and proceed as above, or you can map two entities & their associated attributes & relationship attributes into one table.
+ - [5] For each **binary** $1:N$ relationship, identify the table $S$ that represents the $N$ side and the table $T$ that represents the $1$ side.
+ - Include the primary key of table $T$ as a foreign key in $S$ such that each entity on the $N$ side is related to at most one entity instance on the $1$ side.
+ - Include any attributes of the relationship as attributes of $S$.
+ - For recursive $1:N$ relationships, choose the primary key of the table and include it as a foreign key in the same table with a different name.
+ - [6] For each $M:N$ relationship, create a new table $S$ to represent the relationship.
+ - Include the primary keys of the tables that represent the participating entity types as foreign keys in $S$ - their combination will form the primary key of $S$.
+ - Also include in $S$ any attributes of the relationship.
+ - For a recursive $M:N$ relationship, both foreign keys come from the same table (give different names to each) and become the new primary key.
+ - [7] For each **multi-valued attribute** $A$ of an entity $S$, create a new table $R$.
+ - $R$ will include:
+ - An attribute corresponding to $A$.
+ - The primary key of $S$, which will be a foreign key in $R$. Call this $K$.
+ - The primary key of $R$ is a combination of $A$ & $K$.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-09-30T10_01_42.260Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-09-30T10_01_42.260Z.Desktop.md
new file mode 100644
index 00000000..166e2cbd
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-09-30T10_01_42.260Z.Desktop.md
@@ -0,0 +1,282 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** null
+- **Next Topic:** [[Sampling]]
+- **Relevant Slides:** 
+-
+- ## What is / are Statistics?
+ collapsed:: true
+ - What is a **statistic**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:13:39.783Z
+ card-last-reviewed:: 2022-09-18T15:13:39.783Z
+ card-last-score:: 5
+ - A **statistic** is any quantity computed from sample data.
+ - What is the **Science of Statistics**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:19:14.009Z
+ card-last-reviewed:: 2022-09-18T15:19:14.009Z
+ card-last-score:: 5
+ - The collecting, classifying, summarising, organising, analysing, estimation, and interpretation of information.
+ - What is the **role of statistics**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-22T15:13:48.388Z
+ card-last-reviewed:: 2022-09-18T15:13:48.389Z
+ card-last-score:: 3
+ - The field of statistics deals with the collection, presentation, analysis, and use of data to:
+ - make decisions
+ - solve problems
+ - design products & processes
+ - Statistics is the ^^science of uncertainty.^^
+ - What is the **role of probability** in statistics?
+ - **Probability** provides the framework for the study & application of statistics.
+-
+- ## Types of Statistics
+ collapsed:: true
+ - What is **Descriptive Statistics**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:50:07.222Z
+ card-last-score:: 1
+ - **Descriptive Statistics** is the science of summarising data, both numerically & graphically.
+ - The analysis methods applicable depends on the variable being measured and the research questions that you are trying to answer.
+ - What is **Inferential Statistics**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:22:10.041Z
+ card-last-reviewed:: 2022-09-18T15:22:10.041Z
+ card-last-score:: 5
+ - **Inferential Statistics** is the science of using the ^^information in your sample^^ to ^^infer^^ something about the population of statistics.
+-
+- ## Important Terms
+ collapsed:: true
+ - What is an **experimental unit**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:17:06.471Z
+ card-last-reviewed:: 2022-09-18T15:17:06.471Z
+ card-last-score:: 5
+ - An **experimental unit** / individual is a single object upon which we collect data. e.g., a person, thing, transaction, or event.
+ - What is a **population**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:19:17.126Z
+ card-last-reviewed:: 2022-09-18T15:19:17.126Z
+ card-last-score:: 5
+ - A **population** is a ^^collection of experimental units^^ / individuals that we are interested in studying.
+ - What is a **sample**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:22:15.918Z
+ card-last-reviewed:: 2022-09-18T15:22:15.919Z
+ card-last-score:: 5
+ - A **sample** is a subset of experimental units from the population.
+ - What is a **variable**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:19:22.661Z
+ card-last-reviewed:: 2022-09-18T15:19:22.662Z
+ card-last-score:: 5
+ - A **variable** is a ^^characteristic or property of an individual experimental unit^^.
+ - A variable may be measured, or more generally "observed" on each individual.
+ - What is **Qualitative Data**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-28T15:29:26.142Z
+ card-last-reviewed:: 2022-09-19T18:29:26.143Z
+ card-last-score:: 3
+ - **Qualitative Data** is data which can be classified into categories.
+ - Two types of Qualitative Data:
+ - **Ordinal:** ordered qualitative data - e.g., a grade,
+ - **Nominal:** unordered qualitative data - e.g., a gender, a method of payment
+ - What is **Quantitative Data**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:18:00.114Z
+ card-last-reviewed:: 2022-09-18T15:18:00.114Z
+ card-last-score:: 5
+ - **Quantitative Data** is data in the form of counts or numbers - it cannot be classified into categories.
+ - Two types of Quantitative Data:
+ - **Discrete:** non-divisible, single points of data, **counts** - e.g., number of texts sent
+ - **Continuous:** measurements that, if placed on a number scale, can be placed in an infinite number of spaces between two whole numbers - e.g., age, rent, temperature
+-
+- Pie charts make data very difficult to interpret & read - **don't use them**.
+-
+- ## Numerical Summaries
+ - ### Central Tendency
+ - What is a **numerical summary**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-09-29T22:46:04.368Z
+ card-last-reviewed:: 2022-09-19T17:46:04.368Z
+ card-last-score:: 5
+ - A **numerical summary** is a way of summarising categorical data using a frequency count or percentage.
+ - How do you calculate the **sample mean**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:23:34.273Z
+ card-last-reviewed:: 2022-09-18T15:23:34.273Z
+ card-last-score:: 5
+ - Suppose that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$. The **sample mean**, denoted by $\bar{x}$, is:
+ - $$\bar{x} = \sum_{i=1}^{n}=\frac{x_i}{n}=\frac{x_1+x_2+...+x_n}{n}$$
+ :LOGBOOK:
+ CLOCK: [2022-09-12 Mon 18:35:39]
+ :END:
+ - ^^The sample mean is **sensitive** to extreme values^^
+ - How do you calculate the **sample median**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:21:34.890Z
+ card-last-reviewed:: 2022-09-19T18:21:34.891Z
+ card-last-score:: 3
+ - Given that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$, arranged in **increasing order** of magnitude, the **sample median** is:
+ - $$\bar{x} = \begin{cases}x_{(n+1)/2}, & \text{if $n$ is odd},\\ \frac{1}{2}(x_{n/2} + x_{n/2+1}), &\text{if $n$ is even.} \\ \end{cases}$$
+ - ^^The sample median is **not** sensitive to extreme values.^^
+ - What is the **mode**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:43:51.718Z
+ card-last-reviewed:: 2022-09-19T17:43:51.719Z
+ card-last-score:: 5
+ - The **mode** is the most frequent observation in a dataset.
+ - ### Variation
+ collapsed:: true
+ - What is the **range** of a sample? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:45:55.511Z
+ card-last-reviewed:: 2022-09-19T17:45:55.512Z
+ card-last-score:: 5
+ - The **range** of a sample is the **maximum** - **minimum**.
+ - The range is a ^^poor measure of spread and is badly affected by outliers.^^
+ - The range is also ^^badly affected by outliers.^^
+ - #### Interquartile Range
+ - What is the **interquartile range** of a sample? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:50:39.855Z
+ card-last-reviewed:: 2022-09-18T14:50:39.855Z
+ card-last-score:: 3
+ - The **interquartile range** is the middle 50% of the data.
+ - Therefore, it is ^^robust to outliers.^^
+ - To calculate the **IQR**, first split the data in 4 quarters and subtract the value at $Q_3$ from the value at $Q_1$.
+ - $$IQR=Q_3-Q_1$$
+ - 
+ - #### Tukey's Method for IQR
+ - There are also many other methods for calculating IQR.
+ - 1. Put data in **ascending** order.
+ 2. The **lower quartile** ($Q_1$)is the **median** of the **lower** 50% of the data, including the median.
+ 3. The **upper quartile** ($Q_3$) is the **median** of the **upper** 50% of the data, including the median.
+ - #### Standard Deviation #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:52:05.581Z
+ card-last-reviewed:: 2022-09-18T14:52:05.582Z
+ card-last-score:: 3
+ - A common measure of spread is the **standard deviation**, which takes into account how far *each* data value is from the mean.
+ - A **deviation** is the distance of a datapoint from the mean.
+ - Since the sum of all the deviations would be zero, we square each deviation and find an average of the deviations called the **variance**.
+ - We then get the positive square root of the **sample variance** to get the the **sample standard deviation**, which is preferable to the sample variance, as the sample variance is in squared units.
+ - The **standard deviation** is ^^sensitive to outliers.^^
+ - How do you calculate the **sample variance**, and hence, the **sample standard deviation**? #card
+ card-last-interval:: 4.55
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-24T06:47:06.630Z
+ card-last-reviewed:: 2022-09-19T17:47:06.630Z
+ card-last-score:: 5
+ - The **sample variance**, denoted by $s^2$, is given by:
+ - $$s^2=\sum_{i=1}^{n} \frac{(x_i - \bar{x})^2}{n-1}$$
+ - The **sample standard deviation**, denoted by $s$, is the **positive square root** of $s^2$, that is:
+ - $$s=\sqrt{s^2}$$
+ - ### Shape
+ - #### Graphical Summaries of Data
+ - Depends on the variable of interest.
+ - **Categorical** response variable -> bar chart or pie chart.
+ - **Categorical** response variable ^^with an explanatory variable^^ -> grouped bar chart.
+ - **Continuous** response variable -> histogram, boxplot, densit plot.
+ - **Continuous** response variable ^^with an explanatory variable^^ -> grouped boxplot.
+ -
+ - What is a **boxplot**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:30:23.072Z
+ card-last-score:: 1
+ - A **boxplot** is a graphical display showing centre, spread, shape, & outliers.
+ - It displays the **5-number summary**:
+ - *min, Q1, median, Q3, max*
+ - 
+ - What is a **histogram**? #card
+ card-last-interval:: 9.55
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-29T07:30:03.396Z
+ card-last-reviewed:: 2022-09-19T18:30:03.397Z
+ card-last-score:: 5
+ - **Histograms** are useful to show the general shape, location, and spread of data values.
+ - Representation by *area*.
+ - **Construction**
+ - Determine range of data *minimum, maximum*.
+ - Split into convenient intervals or *bins*.
+ - Usually use 5 to 15 intervals.
+ - Count number of observations in each interval - *frequency*.
+ - When talking about the shape of the data, make sure to address the following 3 questions:
+ - 1. Does the histogram have a single, central hump or several well-separated bumps?
+ 2. Is the histogram or boxplot **symmetric**, or more spread out in one direction (skewed)?
+ 3. Any unusual features? e.g.., outliers, spikes.
+ - 
+ - 
+ -
+ - #### Explanatory & Response Variables
+ collapsed:: true
+ - To identify the **explanatory** variable in a pair of variables, identify which of the two is suspected of affecting the other and plan an appropriate analysis
+ - explanatory variable -might effect-> response variable
+ - continent -might effect-> life expectancy.
+-
+- ## R Markdown
+ - What is **R Markdown**? #card
+ card-last-interval:: 3.02
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T18:30:58.574Z
+ card-last-reviewed:: 2022-09-19T18:30:58.574Z
+ card-last-score:: 3
+ - **R Markdown** is a file format for making ^^dynamic documents in R.^^
+ - R Markdown is written in Markdown and contains chunks of embedded R code (data management, summaries, graphics, analysis & interpretation) all in one document.
+ - Documents can be **knitted** to HTML, PDF, Word, and many other formats.
+ - ### Key Benefits of R Markdown
+ - Makes it easy to produce statistical reports with code, analysis, outputs, and write-up all in one place.
+ - Perfect for reproducible research.
+ - Easy to convert to different document types.
+ - ### Structure
+ - R Markdown contains **three** types of content:
+ - A **YAML Header**.
+ - Text, formatted with Markdown.
+ - Code chunks.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-10-07T08_33_33.315Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-10-07T08_33_33.315Z.Desktop.md
new file mode 100644
index 00000000..14a0fc5f
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-10-07T08_33_33.315Z.Desktop.md
@@ -0,0 +1,282 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** null
+- **Next Topic:** [[Sampling]]
+- **Relevant Slides:** 
+-
+- ## What is / are Statistics?
+ collapsed:: true
+ - What is a **statistic**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:29:35.052Z
+ card-last-reviewed:: 2022-10-01T13:29:35.052Z
+ card-last-score:: 5
+ - A **statistic** is any quantity computed from sample data.
+ - What is the **Science of Statistics**?
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:37:15.281Z
+ card-last-reviewed:: 2022-10-03T11:37:15.284Z
+ card-last-score:: 5
+ - The collecting, classifying, summarising, organising, analysing, estimation, and interpretation of information.
+ - What is the **role of statistics**?
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:10:56.000Z
+ card-last-reviewed:: 2022-09-30T12:10:56.000Z
+ card-last-score:: 5
+ - The field of statistics deals with the collection, presentation, analysis, and use of data to:
+ - make decisions
+ - solve problems
+ - design products & processes
+ - Statistics is the ^^science of uncertainty.^^
+ - What is the **role of probability** in statistics?
+ - **Probability** provides the framework for the study & application of statistics.
+-
+- ## Types of Statistics
+ collapsed:: true
+ - What is **Descriptive Statistics**? #card
+ card-last-interval:: 3.57
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-09T22:41:41.392Z
+ card-last-reviewed:: 2022-10-06T09:41:41.392Z
+ card-last-score:: 5
+ - **Descriptive Statistics** is the science of summarising data, both numerically & graphically.
+ - The analysis methods applicable depends on the variable being measured and the research questions that you are trying to answer.
+ - What is **Inferential Statistics**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:04.081Z
+ card-last-reviewed:: 2022-10-03T11:40:04.082Z
+ card-last-score:: 5
+ - **Inferential Statistics** is the science of using the ^^information in your sample^^ to ^^infer^^ something about the population of statistics.
+-
+- ## Important Terms
+ collapsed:: true
+ - What is an **experimental unit**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:26.549Z
+ card-last-reviewed:: 2022-10-01T17:30:26.549Z
+ card-last-score:: 5
+ - An **experimental unit** / individual is a single object upon which we collect data. e.g., a person, thing, transaction, or event.
+ - What is a **population**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:17.248Z
+ card-last-reviewed:: 2022-10-03T11:37:17.248Z
+ card-last-score:: 5
+ - A **population** is a ^^collection of experimental units^^ / individuals that we are interested in studying.
+ - What is a **sample**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:07.495Z
+ card-last-reviewed:: 2022-10-03T11:40:07.496Z
+ card-last-score:: 5
+ - A **sample** is a subset of experimental units from the population.
+ - What is a **variable**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T12:12:49.015Z
+ card-last-score:: 1
+ - A **variable** is a ^^characteristic or property of an individual experimental unit^^.
+ - A variable may be measured, or more generally "observed" on each individual.
+ - What is **Qualitative Data**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:02:29.057Z
+ card-last-score:: 1
+ - **Qualitative Data** is data which can be classified into categories.
+ - Two types of Qualitative Data:
+ - **Ordinal:** ordered qualitative data - e.g., a grade,
+ - **Nominal:** unordered qualitative data - e.g., a gender, a method of payment
+ - What is **Quantitative Data**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-01T23:00:00.000Z
+ card-last-reviewed:: 2022-10-01T17:34:22.458Z
+ card-last-score:: 1
+ - **Quantitative Data** is data in the form of counts or numbers - it cannot be classified into categories.
+ - Two types of Quantitative Data:
+ - **Discrete:** non-divisible, single points of data, **counts** - e.g., number of texts sent
+ - **Continuous:** measurements that, if placed on a number scale, can be placed in an infinite number of spaces between two whole numbers - e.g., age, rent, temperature
+-
+- Pie charts make data very difficult to interpret & read - **don't use them**.
+-
+- ## Numerical Summaries
+ - ### Central Tendency
+ - What is a **numerical summary**? #card
+ card-last-score:: 5
+ card-repeats:: 4
+ card-next-schedule:: 2022-11-01T19:10:35.516Z
+ card-last-interval:: 28.3
+ card-ease-factor:: 2.66
+ card-last-reviewed:: 2022-10-04T12:10:35.517Z
+ - A **numerical summary** is a way of summarising categorical data using a frequency count or percentage.
+ - How do you calculate the **sample mean**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:40:44.143Z
+ card-last-reviewed:: 2022-10-03T11:40:44.143Z
+ card-last-score:: 5
+ - Suppose that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$. The **sample mean**, denoted by $\bar{x}$, is:
+ - $$\bar{x} = \sum_{i=1}^{n}=\frac{x_i}{n}=\frac{x_1+x_2+...+x_n}{n}$$
+ :LOGBOOK:
+ CLOCK: [2022-09-12 Mon 18:35:39]
+ :END:
+ - ^^The sample mean is **sensitive** to extreme values^^
+ - How do you calculate the **sample median**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T11:44:18.197Z
+ card-last-score:: 1
+ - Given that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$, arranged in **increasing order** of magnitude, the **sample median** is:
+ - $$\bar{x} = \begin{cases}x_{(n+1)/2}, & \text{if $n$ is odd},\\ \frac{1}{2}(x_{n/2} + x_{n/2+1}), &\text{if $n$ is even.} \\ \end{cases}$$
+ - ^^The sample median is **not** sensitive to extreme values.^^
+ - What is the **mode**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:24.167Z
+ card-last-reviewed:: 2022-10-03T11:42:24.168Z
+ card-last-score:: 5
+ - The **mode** is the most frequent observation in a dataset.
+ - ### Variation
+ collapsed:: true
+ - What is the **range** of a sample? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:37.291Z
+ card-last-reviewed:: 2022-10-03T11:42:37.291Z
+ card-last-score:: 5
+ - The **range** of a sample is the **maximum** - **minimum**.
+ - The range is a ^^poor measure of spread and is badly affected by outliers.^^
+ - The range is also ^^badly affected by outliers.^^
+ - #### Interquartile Range
+ - What is the **interquartile range** of a sample? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:13:50.901Z
+ card-last-reviewed:: 2022-09-30T12:13:50.901Z
+ card-last-score:: 3
+ - The **interquartile range** is the middle 50% of the data.
+ - Therefore, it is ^^robust to outliers.^^
+ - To calculate the **IQR**, first split the data in 4 quarters and subtract the value at $Q_3$ from the value at $Q_1$.
+ - $$IQR=Q_3-Q_1$$
+ - 
+ - #### Tukey's Method for IQR
+ - There are also many other methods for calculating IQR.
+ - 1. Put data in **ascending** order.
+ 2. The **lower quartile** ($Q_1$)is the **median** of the **lower** 50% of the data, including the median.
+ 3. The **upper quartile** ($Q_3$) is the **median** of the **upper** 50% of the data, including the median.
+ - #### Standard Deviation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:28:57.649Z
+ card-last-score:: 1
+ - A common measure of spread is the **standard deviation**, which takes into account how far *each* data value is from the mean.
+ - A **deviation** is the distance of a datapoint from the mean.
+ - Since the sum of all the deviations would be zero, we square each deviation and find an average of the deviations called the **variance**.
+ - We then get the positive square root of the **sample variance** to get the the **sample standard deviation**, which is preferable to the sample variance, as the sample variance is in squared units.
+ - The **standard deviation** is ^^sensitive to outliers.^^
+ - How do you calculate the **sample variance**, and hence, the **sample standard deviation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T14:31:20.377Z
+ card-last-score:: 1
+ - The **sample variance**, denoted by $s^2$, is given by:
+ - $$s^2=\sum_{i=1}^{n} \frac{(x_i - \bar{x})^2}{n-1}$$
+ - The **sample standard deviation**, denoted by $s$, is the **positive square root** of $s^2$, that is:
+ - $$s=\sqrt{s^2}$$
+ - ### Shape
+ - #### Graphical Summaries of Data
+ - Depends on the variable of interest.
+ - **Categorical** response variable -> bar chart or pie chart.
+ - **Categorical** response variable ^^with an explanatory variable^^ -> grouped bar chart.
+ - **Continuous** response variable -> histogram, boxplot, densit plot.
+ - **Continuous** response variable ^^with an explanatory variable^^ -> grouped boxplot.
+ -
+ - What is a **boxplot**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T09:21:43.026Z
+ card-last-score:: 1
+ - A **boxplot** is a graphical display showing centre, spread, shape, & outliers.
+ - It displays the **5-number summary**:
+ - *min, Q1, median, Q3, max*
+ - 
+ - What is a **histogram**? #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-15T07:07:49.634Z
+ card-last-reviewed:: 2022-10-04T12:07:49.636Z
+ card-last-score:: 5
+ - **Histograms** are useful to show the general shape, location, and spread of data values.
+ - Representation by *area*.
+ - **Construction**
+ - Determine range of data *minimum, maximum*.
+ - Split into convenient intervals or *bins*.
+ - Usually use 5 to 15 intervals.
+ - Count number of observations in each interval - *frequency*.
+ - When talking about the shape of the data, make sure to address the following 3 questions:
+ - 1. Does the histogram have a single, central hump or several well-separated bumps?
+ 2. Is the histogram or boxplot **symmetric**, or more spread out in one direction (skewed)?
+ 3. Any unusual features? e.g.., outliers, spikes.
+ - 
+ - 
+ -
+ - #### Explanatory & Response Variables
+ collapsed:: true
+ - To identify the **explanatory** variable in a pair of variables, identify which of the two is suspected of affecting the other and plan an appropriate analysis
+ - explanatory variable -might effect-> response variable
+ - continent -might effect-> life expectancy.
+-
+- ## R Markdown
+ - What is **R Markdown**? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:41:15.771Z
+ card-last-reviewed:: 2022-10-03T11:41:15.771Z
+ card-last-score:: 5
+ - **R Markdown** is a file format for making ^^dynamic documents in R.^^
+ - R Markdown is written in Markdown and contains chunks of embedded R code (data management, summaries, graphics, analysis & interpretation) all in one document.
+ - Documents can be **knitted** to HTML, PDF, Word, and many other formats.
+ - ### Key Benefits of R Markdown
+ - Makes it easy to produce statistical reports with code, analysis, outputs, and write-up all in one place.
+ - Perfect for reproducible research.
+ - Easy to convert to different document types.
+ - ### Structure
+ - R Markdown contains **three** types of content:
+ - A **YAML Header**.
+ - Text, formatted with Markdown.
+ - Code chunks.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-10-10T11_59_52.387Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-10-10T11_59_52.387Z.Desktop.md
new file mode 100644
index 00000000..ad60fadb
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-10-10T11_59_52.387Z.Desktop.md
@@ -0,0 +1,282 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** null
+- **Next Topic:** [[Sampling]]
+- **Relevant Slides:** 
+-
+- ## What is / are Statistics?
+ collapsed:: true
+ - What is a **statistic**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:29:35.052Z
+ card-last-reviewed:: 2022-10-01T13:29:35.052Z
+ card-last-score:: 5
+ - A **statistic** is any quantity computed from sample data.
+ - What is the **Science of Statistics**?
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:37:15.281Z
+ card-last-reviewed:: 2022-10-03T11:37:15.284Z
+ card-last-score:: 5
+ - The collecting, classifying, summarising, organising, analysing, estimation, and interpretation of information.
+ - What is the **role of statistics**?
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:10:56.000Z
+ card-last-reviewed:: 2022-09-30T12:10:56.000Z
+ card-last-score:: 5
+ - The field of statistics deals with the collection, presentation, analysis, and use of data to:
+ - make decisions
+ - solve problems
+ - design products & processes
+ - Statistics is the ^^science of uncertainty.^^
+ - What is the **role of probability** in statistics?
+ - **Probability** provides the framework for the study & application of statistics.
+-
+- ## Types of Statistics
+ collapsed:: true
+ - What is **Descriptive Statistics**? #card
+ card-last-interval:: 3.57
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-09T22:41:41.392Z
+ card-last-reviewed:: 2022-10-06T09:41:41.392Z
+ card-last-score:: 5
+ - **Descriptive Statistics** is the science of summarising data, both numerically & graphically.
+ - The analysis methods applicable depends on the variable being measured and the research questions that you are trying to answer.
+ - What is **Inferential Statistics**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:04.081Z
+ card-last-reviewed:: 2022-10-03T11:40:04.082Z
+ card-last-score:: 5
+ - **Inferential Statistics** is the science of using the ^^information in your sample^^ to ^^infer^^ something about the population of statistics.
+-
+- ## Important Terms
+ collapsed:: true
+ - What is an **experimental unit**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:26.549Z
+ card-last-reviewed:: 2022-10-01T17:30:26.549Z
+ card-last-score:: 5
+ - An **experimental unit** / individual is a single object upon which we collect data. e.g., a person, thing, transaction, or event.
+ - What is a **population**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:17.248Z
+ card-last-reviewed:: 2022-10-03T11:37:17.248Z
+ card-last-score:: 5
+ - A **population** is a ^^collection of experimental units^^ / individuals that we are interested in studying.
+ - What is a **sample**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:07.495Z
+ card-last-reviewed:: 2022-10-03T11:40:07.496Z
+ card-last-score:: 5
+ - A **sample** is a subset of experimental units from the population.
+ - What is a **variable**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T10:31:37.141Z
+ card-last-reviewed:: 2022-10-07T10:31:37.142Z
+ card-last-score:: 5
+ - A **variable** is a ^^characteristic or property of an individual experimental unit^^.
+ - A variable may be measured, or more generally "observed" on each individual.
+ - What is **Qualitative Data**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:46:08.943Z
+ card-last-reviewed:: 2022-10-07T10:46:08.944Z
+ card-last-score:: 5
+ - **Qualitative Data** is data which can be classified into categories.
+ - Two types of Qualitative Data:
+ - **Ordinal:** ordered qualitative data - e.g., a grade,
+ - **Nominal:** unordered qualitative data - e.g., a gender, a method of payment
+ - What is **Quantitative Data**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:29:23.069Z
+ card-last-reviewed:: 2022-10-06T17:29:23.069Z
+ card-last-score:: 5
+ - **Quantitative Data** is data in the form of counts or numbers - it cannot be classified into categories.
+ - Two types of Quantitative Data:
+ - **Discrete:** non-divisible, single points of data, **counts** - e.g., number of texts sent
+ - **Continuous:** measurements that, if placed on a number scale, can be placed in an infinite number of spaces between two whole numbers - e.g., age, rent, temperature
+-
+- Pie charts make data very difficult to interpret & read - **don't use them**.
+-
+- ## Numerical Summaries
+ - ### Central Tendency
+ - What is a **numerical summary**? #card
+ card-last-score:: 5
+ card-repeats:: 4
+ card-next-schedule:: 2022-11-01T19:10:35.516Z
+ card-last-interval:: 28.3
+ card-ease-factor:: 2.66
+ card-last-reviewed:: 2022-10-04T12:10:35.517Z
+ - A **numerical summary** is a way of summarising categorical data using a frequency count or percentage.
+ - How do you calculate the **sample mean**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:40:44.143Z
+ card-last-reviewed:: 2022-10-03T11:40:44.143Z
+ card-last-score:: 5
+ - Suppose that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$. The **sample mean**, denoted by $\bar{x}$, is:
+ - $$\bar{x} = \sum_{i=1}^{n}=\frac{x_i}{n}=\frac{x_1+x_2+...+x_n}{n}$$
+ :LOGBOOK:
+ CLOCK: [2022-09-12 Mon 18:35:39]
+ :END:
+ - ^^The sample mean is **sensitive** to extreme values^^
+ - How do you calculate the **sample median**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:40:49.278Z
+ card-last-score:: 1
+ - Given that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$, arranged in **increasing order** of magnitude, the **sample median** is:
+ - $$\bar{x} = \begin{cases}x_{(n+1)/2}, & \text{if $n$ is odd},\\ \frac{1}{2}(x_{n/2} + x_{n/2+1}), &\text{if $n$ is even.} \\ \end{cases}$$
+ - ^^The sample median is **not** sensitive to extreme values.^^
+ - What is the **mode**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:24.167Z
+ card-last-reviewed:: 2022-10-03T11:42:24.168Z
+ card-last-score:: 5
+ - The **mode** is the most frequent observation in a dataset.
+ - ### Variation
+ collapsed:: true
+ - What is the **range** of a sample? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:37.291Z
+ card-last-reviewed:: 2022-10-03T11:42:37.291Z
+ card-last-score:: 5
+ - The **range** of a sample is the **maximum** - **minimum**.
+ - The range is a ^^poor measure of spread and is badly affected by outliers.^^
+ - The range is also ^^badly affected by outliers.^^
+ - #### Interquartile Range
+ - What is the **interquartile range** of a sample? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:13:50.901Z
+ card-last-reviewed:: 2022-09-30T12:13:50.901Z
+ card-last-score:: 3
+ - The **interquartile range** is the middle 50% of the data.
+ - Therefore, it is ^^robust to outliers.^^
+ - To calculate the **IQR**, first split the data in 4 quarters and subtract the value at $Q_3$ from the value at $Q_1$.
+ - $$IQR=Q_3-Q_1$$
+ - 
+ - #### Tukey's Method for IQR
+ - There are also many other methods for calculating IQR.
+ - 1. Put data in **ascending** order.
+ 2. The **lower quartile** ($Q_1$)is the **median** of the **lower** 50% of the data, including the median.
+ 3. The **upper quartile** ($Q_3$) is the **median** of the **upper** 50% of the data, including the median.
+ - #### Standard Deviation #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T22:24:00.798Z
+ card-last-reviewed:: 2022-10-08T15:24:00.798Z
+ card-last-score:: 5
+ - A common measure of spread is the **standard deviation**, which takes into account how far *each* data value is from the mean.
+ - A **deviation** is the distance of a datapoint from the mean.
+ - Since the sum of all the deviations would be zero, we square each deviation and find an average of the deviations called the **variance**.
+ - We then get the positive square root of the **sample variance** to get the the **sample standard deviation**, which is preferable to the sample variance, as the sample variance is in squared units.
+ - The **standard deviation** is ^^sensitive to outliers.^^
+ - How do you calculate the **sample variance**, and hence, the **sample standard deviation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:46:54.597Z
+ card-last-reviewed:: 2022-10-07T10:46:54.597Z
+ card-last-score:: 5
+ - The **sample variance**, denoted by $s^2$, is given by:
+ - $$s^2=\sum_{i=1}^{n} \frac{(x_i - \bar{x})^2}{n-1}$$
+ - The **sample standard deviation**, denoted by $s$, is the **positive square root** of $s^2$, that is:
+ - $$s=\sqrt{s^2}$$
+ - ### Shape
+ - #### Graphical Summaries of Data
+ - Depends on the variable of interest.
+ - **Categorical** response variable -> bar chart or pie chart.
+ - **Categorical** response variable ^^with an explanatory variable^^ -> grouped bar chart.
+ - **Continuous** response variable -> histogram, boxplot, densit plot.
+ - **Continuous** response variable ^^with an explanatory variable^^ -> grouped boxplot.
+ -
+ - What is a **boxplot**? #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T10:00:03.971Z
+ card-last-reviewed:: 2022-10-08T15:00:03.971Z
+ card-last-score:: 5
+ - A **boxplot** is a graphical display showing centre, spread, shape, & outliers.
+ - It displays the **5-number summary**:
+ - *min, Q1, median, Q3, max*
+ - 
+ - What is a **histogram**? #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-15T07:07:49.634Z
+ card-last-reviewed:: 2022-10-04T12:07:49.636Z
+ card-last-score:: 5
+ - **Histograms** are useful to show the general shape, location, and spread of data values.
+ - Representation by *area*.
+ - **Construction**
+ - Determine range of data *minimum, maximum*.
+ - Split into convenient intervals or *bins*.
+ - Usually use 5 to 15 intervals.
+ - Count number of observations in each interval - *frequency*.
+ - When talking about the shape of the data, make sure to address the following 3 questions:
+ - 1. Does the histogram have a single, central hump or several well-separated bumps?
+ 2. Is the histogram or boxplot **symmetric**, or more spread out in one direction (skewed)?
+ 3. Any unusual features? e.g.., outliers, spikes.
+ - 
+ - 
+ -
+ - #### Explanatory & Response Variables
+ collapsed:: true
+ - To identify the **explanatory** variable in a pair of variables, identify which of the two is suspected of affecting the other and plan an appropriate analysis
+ - explanatory variable -might effect-> response variable
+ - continent -might effect-> life expectancy.
+-
+- ## R Markdown
+ - What is **R Markdown**? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:41:15.771Z
+ card-last-reviewed:: 2022-10-03T11:41:15.771Z
+ card-last-score:: 5
+ - **R Markdown** is a file format for making ^^dynamic documents in R.^^
+ - R Markdown is written in Markdown and contains chunks of embedded R code (data management, summaries, graphics, analysis & interpretation) all in one document.
+ - Documents can be **knitted** to HTML, PDF, Word, and many other formats.
+ - ### Key Benefits of R Markdown
+ - Makes it easy to produce statistical reports with code, analysis, outputs, and write-up all in one place.
+ - Perfect for reproducible research.
+ - Easy to convert to different document types.
+ - ### Structure
+ - R Markdown contains **three** types of content:
+ - A **YAML Header**.
+ - Text, formatted with Markdown.
+ - Code chunks.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-10-20T09_05_57.950Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-10-20T09_05_57.950Z.Desktop.md
new file mode 100644
index 00000000..80102c96
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-10-20T09_05_57.950Z.Desktop.md
@@ -0,0 +1,282 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** null
+- **Next Topic:** [[Sampling]]
+- **Relevant Slides:** 
+-
+- ## What is / are Statistics?
+ collapsed:: true
+ - What is a **statistic**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:29:35.052Z
+ card-last-reviewed:: 2022-10-01T13:29:35.052Z
+ card-last-score:: 5
+ - A **statistic** is any quantity computed from sample data.
+ - What is the **Science of Statistics**?
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:37:15.281Z
+ card-last-reviewed:: 2022-10-03T11:37:15.284Z
+ card-last-score:: 5
+ - The collecting, classifying, summarising, organising, analysing, estimation, and interpretation of information.
+ - What is the **role of statistics**?
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:10:56.000Z
+ card-last-reviewed:: 2022-09-30T12:10:56.000Z
+ card-last-score:: 5
+ - The field of statistics deals with the collection, presentation, analysis, and use of data to:
+ - make decisions
+ - solve problems
+ - design products & processes
+ - Statistics is the ^^science of uncertainty.^^
+ - What is the **role of probability** in statistics?
+ - **Probability** provides the framework for the study & application of statistics.
+-
+- ## Types of Statistics
+ collapsed:: true
+ - What is **Descriptive Statistics**? #card
+ card-last-interval:: 7.48
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-17T22:46:14.707Z
+ card-last-reviewed:: 2022-10-10T11:46:14.707Z
+ card-last-score:: 3
+ - **Descriptive Statistics** is the science of summarising data, both numerically & graphically.
+ - The analysis methods applicable depends on the variable being measured and the research questions that you are trying to answer.
+ - What is **Inferential Statistics**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:04.081Z
+ card-last-reviewed:: 2022-10-03T11:40:04.082Z
+ card-last-score:: 5
+ - **Inferential Statistics** is the science of using the ^^information in your sample^^ to ^^infer^^ something about the population of statistics.
+-
+- ## Important Terms
+ collapsed:: true
+ - What is an **experimental unit**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:26.549Z
+ card-last-reviewed:: 2022-10-01T17:30:26.549Z
+ card-last-score:: 5
+ - An **experimental unit** / individual is a single object upon which we collect data. e.g., a person, thing, transaction, or event.
+ - What is a **population**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:17.248Z
+ card-last-reviewed:: 2022-10-03T11:37:17.248Z
+ card-last-score:: 5
+ - A **population** is a ^^collection of experimental units^^ / individuals that we are interested in studying.
+ - What is a **sample**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:07.495Z
+ card-last-reviewed:: 2022-10-03T11:40:07.496Z
+ card-last-score:: 5
+ - A **sample** is a subset of experimental units from the population.
+ - What is a **variable**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T10:31:37.141Z
+ card-last-reviewed:: 2022-10-07T10:31:37.142Z
+ card-last-score:: 5
+ - A **variable** is a ^^characteristic or property of an individual experimental unit^^.
+ - A variable may be measured, or more generally "observed" on each individual.
+ - What is **Qualitative Data**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:46:08.943Z
+ card-last-reviewed:: 2022-10-07T10:46:08.944Z
+ card-last-score:: 5
+ - **Qualitative Data** is data which can be classified into categories.
+ - Two types of Qualitative Data:
+ - **Ordinal:** ordered qualitative data - e.g., a grade,
+ - **Nominal:** unordered qualitative data - e.g., a gender, a method of payment
+ - What is **Quantitative Data**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:29:23.069Z
+ card-last-reviewed:: 2022-10-06T17:29:23.069Z
+ card-last-score:: 5
+ - **Quantitative Data** is data in the form of counts or numbers - it cannot be classified into categories.
+ - Two types of Quantitative Data:
+ - **Discrete:** non-divisible, single points of data, **counts** - e.g., number of texts sent
+ - **Continuous:** measurements that, if placed on a number scale, can be placed in an infinite number of spaces between two whole numbers - e.g., age, rent, temperature
+-
+- Pie charts make data very difficult to interpret & read - **don't use them**.
+-
+- ## Numerical Summaries
+ - ### Central Tendency
+ - What is a **numerical summary**? #card
+ card-last-score:: 5
+ card-repeats:: 4
+ card-next-schedule:: 2022-11-01T19:10:35.516Z
+ card-last-interval:: 28.3
+ card-ease-factor:: 2.66
+ card-last-reviewed:: 2022-10-04T12:10:35.517Z
+ - A **numerical summary** is a way of summarising categorical data using a frequency count or percentage.
+ - How do you calculate the **sample mean**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:40:44.143Z
+ card-last-reviewed:: 2022-10-03T11:40:44.143Z
+ card-last-score:: 5
+ - Suppose that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$. The **sample mean**, denoted by $\bar{x}$, is:
+ - $$\bar{x} = \sum_{i=1}^{n}=\frac{x_i}{n}=\frac{x_1+x_2+...+x_n}{n}$$
+ :LOGBOOK:
+ CLOCK: [2022-09-12 Mon 18:35:39]
+ :END:
+ - ^^The sample mean is **sensitive** to extreme values^^
+ - How do you calculate the **sample median**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-14T11:40:32.583Z
+ card-last-reviewed:: 2022-10-10T11:40:32.584Z
+ card-last-score:: 3
+ - Given that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$, arranged in **increasing order** of magnitude, the **sample median** is:
+ - $$\bar{x} = \begin{cases}x_{(n+1)/2}, & \text{if $n$ is odd},\\ \frac{1}{2}(x_{n/2} + x_{n/2+1}), &\text{if $n$ is even.} \\ \end{cases}$$
+ - ^^The sample median is **not** sensitive to extreme values.^^
+ - What is the **mode**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:24.167Z
+ card-last-reviewed:: 2022-10-03T11:42:24.168Z
+ card-last-score:: 5
+ - The **mode** is the most frequent observation in a dataset.
+ - ### Variation
+ collapsed:: true
+ - What is the **range** of a sample? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:37.291Z
+ card-last-reviewed:: 2022-10-03T11:42:37.291Z
+ card-last-score:: 5
+ - The **range** of a sample is the **maximum** - **minimum**.
+ - The range is a ^^poor measure of spread and is badly affected by outliers.^^
+ - The range is also ^^badly affected by outliers.^^
+ - #### Interquartile Range
+ - What is the **interquartile range** of a sample? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:43:51.820Z
+ card-last-reviewed:: 2022-10-10T11:43:51.821Z
+ card-last-score:: 3
+ - The **interquartile range** is the middle 50% of the data.
+ - Therefore, it is ^^robust to outliers.^^
+ - To calculate the **IQR**, first split the data in 4 quarters and subtract the value at $Q_3$ from the value at $Q_1$.
+ - $$IQR=Q_3-Q_1$$
+ - 
+ - #### Tukey's Method for IQR
+ - There are also many other methods for calculating IQR.
+ - 1. Put data in **ascending** order.
+ 2. The **lower quartile** ($Q_1$)is the **median** of the **lower** 50% of the data, including the median.
+ 3. The **upper quartile** ($Q_3$) is the **median** of the **upper** 50% of the data, including the median.
+ - #### Standard Deviation #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T22:24:00.798Z
+ card-last-reviewed:: 2022-10-08T15:24:00.798Z
+ card-last-score:: 5
+ - A common measure of spread is the **standard deviation**, which takes into account how far *each* data value is from the mean.
+ - A **deviation** is the distance of a datapoint from the mean.
+ - Since the sum of all the deviations would be zero, we square each deviation and find an average of the deviations called the **variance**.
+ - We then get the positive square root of the **sample variance** to get the the **sample standard deviation**, which is preferable to the sample variance, as the sample variance is in squared units.
+ - The **standard deviation** is ^^sensitive to outliers.^^
+ - How do you calculate the **sample variance**, and hence, the **sample standard deviation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:46:54.597Z
+ card-last-reviewed:: 2022-10-07T10:46:54.597Z
+ card-last-score:: 5
+ - The **sample variance**, denoted by $s^2$, is given by:
+ - $$s^2=\sum_{i=1}^{n} \frac{(x_i - \bar{x})^2}{n-1}$$
+ - The **sample standard deviation**, denoted by $s$, is the **positive square root** of $s^2$, that is:
+ - $$s=\sqrt{s^2}$$
+ - ### Shape
+ - #### Graphical Summaries of Data
+ - Depends on the variable of interest.
+ - **Categorical** response variable -> bar chart or pie chart.
+ - **Categorical** response variable ^^with an explanatory variable^^ -> grouped bar chart.
+ - **Continuous** response variable -> histogram, boxplot, densit plot.
+ - **Continuous** response variable ^^with an explanatory variable^^ -> grouped boxplot.
+ -
+ - What is a **boxplot**? #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T10:00:03.971Z
+ card-last-reviewed:: 2022-10-08T15:00:03.971Z
+ card-last-score:: 5
+ - A **boxplot** is a graphical display showing centre, spread, shape, & outliers.
+ - It displays the **5-number summary**:
+ - *min, Q1, median, Q3, max*
+ - 
+ - What is a **histogram**? #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-15T07:07:49.634Z
+ card-last-reviewed:: 2022-10-04T12:07:49.636Z
+ card-last-score:: 5
+ - **Histograms** are useful to show the general shape, location, and spread of data values.
+ - Representation by *area*.
+ - **Construction**
+ - Determine range of data *minimum, maximum*.
+ - Split into convenient intervals or *bins*.
+ - Usually use 5 to 15 intervals.
+ - Count number of observations in each interval - *frequency*.
+ - When talking about the shape of the data, make sure to address the following 3 questions:
+ - 1. Does the histogram have a single, central hump or several well-separated bumps?
+ 2. Is the histogram or boxplot **symmetric**, or more spread out in one direction (skewed)?
+ 3. Any unusual features? e.g.., outliers, spikes.
+ - 
+ - 
+ -
+ - #### Explanatory & Response Variables
+ collapsed:: true
+ - To identify the **explanatory** variable in a pair of variables, identify which of the two is suspected of affecting the other and plan an appropriate analysis
+ - explanatory variable -might effect-> response variable
+ - continent -might effect-> life expectancy.
+-
+- ## R Markdown
+ - What is **R Markdown**? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:41:15.771Z
+ card-last-reviewed:: 2022-10-03T11:41:15.771Z
+ card-last-score:: 5
+ - **R Markdown** is a file format for making ^^dynamic documents in R.^^
+ - R Markdown is written in Markdown and contains chunks of embedded R code (data management, summaries, graphics, analysis & interpretation) all in one document.
+ - Documents can be **knitted** to HTML, PDF, Word, and many other formats.
+ - ### Key Benefits of R Markdown
+ - Makes it easy to produce statistical reports with code, analysis, outputs, and write-up all in one place.
+ - Perfect for reproducible research.
+ - Easy to convert to different document types.
+ - ### Structure
+ - R Markdown contains **three** types of content:
+ - A **YAML Header**.
+ - Text, formatted with Markdown.
+ - Code chunks.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-11-23T09_22_44.500Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-11-23T09_22_44.500Z.Desktop.md
new file mode 100644
index 00000000..0bf61872
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-11-23T09_22_44.500Z.Desktop.md
@@ -0,0 +1,282 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** null
+- **Next Topic:** [[Sampling]]
+- **Relevant Slides:** 
+-
+- ## What is / are Statistics?
+ collapsed:: true
+ - What is a **statistic**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:39:44.342Z
+ card-last-score:: 1
+ - A **statistic** is any quantity computed from sample data.
+ - What is the **Science of Statistics**?
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:37:15.281Z
+ card-last-reviewed:: 2022-10-03T11:37:15.284Z
+ card-last-score:: 5
+ - The collecting, classifying, summarising, organising, analysing, estimation, and interpretation of information.
+ - What is the **role of statistics**?
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:10:56.000Z
+ card-last-reviewed:: 2022-09-30T12:10:56.000Z
+ card-last-score:: 5
+ - The field of statistics deals with the collection, presentation, analysis, and use of data to:
+ - make decisions
+ - solve problems
+ - design products & processes
+ - Statistics is the ^^science of uncertainty.^^
+ - What is the **role of probability** in statistics?
+ - **Probability** provides the framework for the study & application of statistics.
+-
+- ## Types of Statistics
+ collapsed:: true
+ - What is **Descriptive Statistics**? #card
+ card-last-interval:: 41.44
+ card-repeats:: 5
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-30T04:36:51.695Z
+ card-last-reviewed:: 2022-11-18T18:36:51.696Z
+ card-last-score:: 3
+ - **Descriptive Statistics** is the science of summarising data, both numerically & graphically.
+ - The analysis methods applicable depends on the variable being measured and the research questions that you are trying to answer.
+ - What is **Inferential Statistics**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:51:33.945Z
+ card-last-score:: 1
+ - **Inferential Statistics** is the science of using the ^^information in your sample^^ to ^^infer^^ something about the population of statistics.
+-
+- ## Important Terms
+ collapsed:: true
+ - What is an **experimental unit**? #card
+ collapsed:: true
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:44:53.701Z
+ card-last-reviewed:: 2022-11-14T16:44:53.701Z
+ card-last-score:: 5
+ - An **experimental unit** / individual is a single object upon which we collect data. e.g., a person, thing, transaction, or event.
+ - What is a **population**? #card
+ collapsed:: true
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:49:52.921Z
+ card-last-reviewed:: 2022-11-14T16:49:52.922Z
+ card-last-score:: 5
+ - A **population** is a ^^collection of experimental units^^ / individuals that we are interested in studying.
+ - What is a **sample**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:51:36.002Z
+ card-last-reviewed:: 2022-11-14T16:51:36.002Z
+ card-last-score:: 5
+ - A **sample** is a subset of experimental units from the population.
+ - What is a **variable**? #card
+ collapsed:: true
+ card-last-interval:: 10.64
+ card-repeats:: 3
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-25T07:35:49.776Z
+ card-last-reviewed:: 2022-11-14T16:35:49.776Z
+ card-last-score:: 5
+ - A **variable** is a ^^characteristic or property of an individual experimental unit^^.
+ - A variable may be measured, or more generally "observed" on each individual.
+ - What is **Qualitative Data**? #card
+ card-last-interval:: 8.72
+ card-repeats:: 3
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-11-23T09:37:05.082Z
+ card-last-reviewed:: 2022-11-14T16:37:05.082Z
+ card-last-score:: 3
+ - **Qualitative Data** is data which can be classified into categories.
+ - Two types of Qualitative Data:
+ - **Ordinal:** ordered qualitative data - e.g., a grade,
+ - **Nominal:** unordered qualitative data - e.g., a gender, a method of payment
+ - What is **Quantitative Data**? #card
+ card-last-interval:: 30.47
+ card-repeats:: 4
+ card-ease-factor:: 2.76
+ card-next-schedule:: 2022-12-15T07:21:06.252Z
+ card-last-reviewed:: 2022-11-14T20:21:06.252Z
+ card-last-score:: 5
+ - **Quantitative Data** is data in the form of counts or numbers - it cannot be classified into categories.
+ - Two types of Quantitative Data:
+ - **Discrete:** non-divisible, single points of data, **counts** - e.g., number of texts sent
+ - **Continuous:** measurements that, if placed on a number scale, can be placed in an infinite number of spaces between two whole numbers - e.g., age, rent, temperature
+-
+- Pie charts make data very difficult to interpret & read - **don't use them**.
+-
+- ## Numerical Summaries
+ - ### Central Tendency
+ - What is a **numerical summary**? #card
+ card-last-score:: 5
+ card-repeats:: 5
+ card-next-schedule:: 2023-02-06T22:21:22.599Z
+ card-last-interval:: 84.1
+ card-ease-factor:: 2.76
+ card-last-reviewed:: 2022-11-14T20:21:22.599Z
+ - A **numerical summary** is a way of summarising categorical data using a frequency count or percentage.
+ - How do you calculate the **sample mean**? #card
+ card-last-interval:: 29.26
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-12-13T22:47:38.996Z
+ card-last-reviewed:: 2022-11-14T16:47:38.997Z
+ card-last-score:: 5
+ - Suppose that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$. The **sample mean**, denoted by $\bar{x}$, is:
+ - $$\bar{x} = \sum_{i=1}^{n}\frac{x_i}{n}=\frac{x_1+x_2+...+x_n}{n}$$
+ :LOGBOOK:
+ CLOCK: [2022-09-12 Mon 18:35:39]
+ :END:
+ - ^^The sample mean is **sensitive** to extreme values^^
+ - How do you calculate the **sample median**? #card
+ card-last-interval:: 8.72
+ card-repeats:: 3
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-11-23T09:49:27.636Z
+ card-last-reviewed:: 2022-11-14T16:49:27.637Z
+ card-last-score:: 5
+ - Given that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$, arranged in **increasing order** of magnitude, the **sample median** is:
+ - $$\bar{x} = \begin{cases}x_{(n+1)/2}, & \text{if $n$ is odd},\\ \frac{1}{2}(x_{n/2} + x_{n/2+1}), &\text{if $n$ is even.} \\ \end{cases}$$
+ - ^^The sample median is **not** sensitive to extreme values.^^
+ - What is the **mode**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:51:42.814Z
+ card-last-reviewed:: 2022-11-14T16:51:42.815Z
+ card-last-score:: 5
+ - The **mode** is the most frequent observation in a dataset.
+ - ### Variation
+ collapsed:: true
+ - What is the **range** of a sample? #card
+ collapsed:: true
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:51:53.283Z
+ card-last-reviewed:: 2022-11-14T16:51:53.283Z
+ card-last-score:: 5
+ - The **range** of a sample is the **maximum** - **minimum**.
+ - The range is a ^^poor measure of spread and is badly affected by outliers.^^
+ - The range is also ^^badly affected by outliers.^^
+ - #### Interquartile Range
+ - What is the **interquartile range** of a sample? #card
+ card-last-interval:: 41.44
+ card-repeats:: 5
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-26T06:18:35.901Z
+ card-last-reviewed:: 2022-11-14T20:18:35.901Z
+ card-last-score:: 5
+ - The **interquartile range** is the middle 50% of the data.
+ - Therefore, it is ^^robust to outliers.^^
+ - To calculate the **IQR**, first split the data in 4 quarters and subtract the value at $Q_3$ from the value at $Q_1$.
+ - $$IQR=Q_3-Q_1$$
+ - 
+ - #### Tukey's Method for IQR
+ - There are also many other methods for calculating IQR.
+ - 1. Put data in **ascending** order.
+ 2. The **lower quartile** ($Q_1$)is the **median** of the **lower** 50% of the data, including the median.
+ 3. The **upper quartile** ($Q_3$) is the **median** of the **upper** 50% of the data, including the median.
+ - #### Standard Deviation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:40:52.313Z
+ card-last-score:: 1
+ - A common measure of spread is the **standard deviation**, which takes into account how far *each* data value is from the mean.
+ - A **deviation** is the distance of a datapoint from the mean.
+ - Since the sum of all the deviations would be zero, we square each deviation and find an average of the deviations called the **variance**.
+ - We then get the positive square root of the **sample variance** to get the the **sample standard deviation**, which is preferable to the sample variance, as the sample variance is in squared units.
+ - The **standard deviation** is ^^sensitive to outliers.^^
+ - How do you calculate the **sample variance**, and hence, the **sample standard deviation**? #card
+ card-last-interval:: 10.97
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-25T15:37:19.443Z
+ card-last-reviewed:: 2022-11-14T16:37:19.444Z
+ card-last-score:: 3
+ - The **sample variance**, denoted by $s^2$, is given by:
+ - $$s^2=\sum_{i=1}^{n} \frac{(x_i - \bar{x})^2}{n-1}$$
+ - The **sample standard deviation**, denoted by $s$, is the **positive square root** of $s^2$, that is:
+ - $$s=\sqrt{s^2}$$
+ - ### Shape
+ - #### Graphical Summaries of Data
+ - Depends on the variable of interest.
+ - **Categorical** response variable -> bar chart or pie chart.
+ - **Categorical** response variable ^^with an explanatory variable^^ -> grouped bar chart.
+ - **Continuous** response variable -> histogram, boxplot, densit plot.
+ - **Continuous** response variable ^^with an explanatory variable^^ -> grouped boxplot.
+ -
+ - What is a **boxplot**? #card
+ card-last-interval:: 5.52
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-20T04:34:53.491Z
+ card-last-reviewed:: 2022-11-14T16:34:53.492Z
+ card-last-score:: 3
+ - A **boxplot** is a graphical display showing centre, spread, shape, & outliers.
+ - It displays the **5-number summary**:
+ - *min, Q1, median, Q3, max*
+ - 
+ - What is a **histogram**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:00:35.072Z
+ card-last-score:: 1
+ - **Histograms** are useful to show the general shape, location, and spread of data values.
+ - Representation by *area*.
+ - **Construction**
+ - Determine range of data *minimum, maximum*.
+ - Split into convenient intervals or *bins*.
+ - Usually use 5 to 15 intervals.
+ - Count number of observations in each interval - *frequency*.
+ - When talking about the shape of the data, make sure to address the following 3 questions:
+ - 1. Does the histogram have a single, central hump or several well-separated bumps?
+ 2. Is the histogram or boxplot **symmetric**, or more spread out in one direction (skewed)?
+ 3. Any unusual features? e.g.., outliers, spikes.
+ - 
+ - 
+ -
+ - #### Explanatory & Response Variables
+ collapsed:: true
+ - To identify the **explanatory** variable in a pair of variables, identify which of the two is suspected of affecting the other and plan an appropriate analysis
+ - explanatory variable -might effect-> response variable
+ - continent -might effect-> life expectancy.
+-
+- ## R Markdown
+ - What is **R Markdown**? #card
+ card-last-interval:: 28.93
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-12-13T14:49:15.636Z
+ card-last-reviewed:: 2022-11-14T16:49:15.637Z
+ card-last-score:: 5
+ - **R Markdown** is a file format for making ^^dynamic documents in R.^^
+ - R Markdown is written in Markdown and contains chunks of embedded R code (data management, summaries, graphics, analysis & interpretation) all in one document.
+ - Documents can be **knitted** to HTML, PDF, Word, and many other formats.
+ - ### Key Benefits of R Markdown
+ - Makes it easy to produce statistical reports with code, analysis, outputs, and write-up all in one place.
+ - Perfect for reproducible research.
+ - Easy to convert to different document types.
+ - ### Structure
+ - R Markdown contains **three** types of content:
+ - A **YAML Header**.
+ - Text, formatted with Markdown.
+ - Code chunks.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-11-23T12_15_36.863Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-11-23T12_15_36.863Z.Desktop.md
new file mode 100644
index 00000000..0bf61872
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Exploratory Data Analysis/2022-11-23T12_15_36.863Z.Desktop.md
@@ -0,0 +1,282 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** null
+- **Next Topic:** [[Sampling]]
+- **Relevant Slides:** 
+-
+- ## What is / are Statistics?
+ collapsed:: true
+ - What is a **statistic**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:39:44.342Z
+ card-last-score:: 1
+ - A **statistic** is any quantity computed from sample data.
+ - What is the **Science of Statistics**?
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:37:15.281Z
+ card-last-reviewed:: 2022-10-03T11:37:15.284Z
+ card-last-score:: 5
+ - The collecting, classifying, summarising, organising, analysing, estimation, and interpretation of information.
+ - What is the **role of statistics**?
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:10:56.000Z
+ card-last-reviewed:: 2022-09-30T12:10:56.000Z
+ card-last-score:: 5
+ - The field of statistics deals with the collection, presentation, analysis, and use of data to:
+ - make decisions
+ - solve problems
+ - design products & processes
+ - Statistics is the ^^science of uncertainty.^^
+ - What is the **role of probability** in statistics?
+ - **Probability** provides the framework for the study & application of statistics.
+-
+- ## Types of Statistics
+ collapsed:: true
+ - What is **Descriptive Statistics**? #card
+ card-last-interval:: 41.44
+ card-repeats:: 5
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-30T04:36:51.695Z
+ card-last-reviewed:: 2022-11-18T18:36:51.696Z
+ card-last-score:: 3
+ - **Descriptive Statistics** is the science of summarising data, both numerically & graphically.
+ - The analysis methods applicable depends on the variable being measured and the research questions that you are trying to answer.
+ - What is **Inferential Statistics**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:51:33.945Z
+ card-last-score:: 1
+ - **Inferential Statistics** is the science of using the ^^information in your sample^^ to ^^infer^^ something about the population of statistics.
+-
+- ## Important Terms
+ collapsed:: true
+ - What is an **experimental unit**? #card
+ collapsed:: true
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:44:53.701Z
+ card-last-reviewed:: 2022-11-14T16:44:53.701Z
+ card-last-score:: 5
+ - An **experimental unit** / individual is a single object upon which we collect data. e.g., a person, thing, transaction, or event.
+ - What is a **population**? #card
+ collapsed:: true
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:49:52.921Z
+ card-last-reviewed:: 2022-11-14T16:49:52.922Z
+ card-last-score:: 5
+ - A **population** is a ^^collection of experimental units^^ / individuals that we are interested in studying.
+ - What is a **sample**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:51:36.002Z
+ card-last-reviewed:: 2022-11-14T16:51:36.002Z
+ card-last-score:: 5
+ - A **sample** is a subset of experimental units from the population.
+ - What is a **variable**? #card
+ collapsed:: true
+ card-last-interval:: 10.64
+ card-repeats:: 3
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-25T07:35:49.776Z
+ card-last-reviewed:: 2022-11-14T16:35:49.776Z
+ card-last-score:: 5
+ - A **variable** is a ^^characteristic or property of an individual experimental unit^^.
+ - A variable may be measured, or more generally "observed" on each individual.
+ - What is **Qualitative Data**? #card
+ card-last-interval:: 8.72
+ card-repeats:: 3
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-11-23T09:37:05.082Z
+ card-last-reviewed:: 2022-11-14T16:37:05.082Z
+ card-last-score:: 3
+ - **Qualitative Data** is data which can be classified into categories.
+ - Two types of Qualitative Data:
+ - **Ordinal:** ordered qualitative data - e.g., a grade,
+ - **Nominal:** unordered qualitative data - e.g., a gender, a method of payment
+ - What is **Quantitative Data**? #card
+ card-last-interval:: 30.47
+ card-repeats:: 4
+ card-ease-factor:: 2.76
+ card-next-schedule:: 2022-12-15T07:21:06.252Z
+ card-last-reviewed:: 2022-11-14T20:21:06.252Z
+ card-last-score:: 5
+ - **Quantitative Data** is data in the form of counts or numbers - it cannot be classified into categories.
+ - Two types of Quantitative Data:
+ - **Discrete:** non-divisible, single points of data, **counts** - e.g., number of texts sent
+ - **Continuous:** measurements that, if placed on a number scale, can be placed in an infinite number of spaces between two whole numbers - e.g., age, rent, temperature
+-
+- Pie charts make data very difficult to interpret & read - **don't use them**.
+-
+- ## Numerical Summaries
+ - ### Central Tendency
+ - What is a **numerical summary**? #card
+ card-last-score:: 5
+ card-repeats:: 5
+ card-next-schedule:: 2023-02-06T22:21:22.599Z
+ card-last-interval:: 84.1
+ card-ease-factor:: 2.76
+ card-last-reviewed:: 2022-11-14T20:21:22.599Z
+ - A **numerical summary** is a way of summarising categorical data using a frequency count or percentage.
+ - How do you calculate the **sample mean**? #card
+ card-last-interval:: 29.26
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-12-13T22:47:38.996Z
+ card-last-reviewed:: 2022-11-14T16:47:38.997Z
+ card-last-score:: 5
+ - Suppose that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$. The **sample mean**, denoted by $\bar{x}$, is:
+ - $$\bar{x} = \sum_{i=1}^{n}\frac{x_i}{n}=\frac{x_1+x_2+...+x_n}{n}$$
+ :LOGBOOK:
+ CLOCK: [2022-09-12 Mon 18:35:39]
+ :END:
+ - ^^The sample mean is **sensitive** to extreme values^^
+ - How do you calculate the **sample median**? #card
+ card-last-interval:: 8.72
+ card-repeats:: 3
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-11-23T09:49:27.636Z
+ card-last-reviewed:: 2022-11-14T16:49:27.637Z
+ card-last-score:: 5
+ - Given that the observations in a sample are $x_1,\ x_2,\ ...\ ,\ x_n$, arranged in **increasing order** of magnitude, the **sample median** is:
+ - $$\bar{x} = \begin{cases}x_{(n+1)/2}, & \text{if $n$ is odd},\\ \frac{1}{2}(x_{n/2} + x_{n/2+1}), &\text{if $n$ is even.} \\ \end{cases}$$
+ - ^^The sample median is **not** sensitive to extreme values.^^
+ - What is the **mode**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:51:42.814Z
+ card-last-reviewed:: 2022-11-14T16:51:42.815Z
+ card-last-score:: 5
+ - The **mode** is the most frequent observation in a dataset.
+ - ### Variation
+ collapsed:: true
+ - What is the **range** of a sample? #card
+ collapsed:: true
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:51:53.283Z
+ card-last-reviewed:: 2022-11-14T16:51:53.283Z
+ card-last-score:: 5
+ - The **range** of a sample is the **maximum** - **minimum**.
+ - The range is a ^^poor measure of spread and is badly affected by outliers.^^
+ - The range is also ^^badly affected by outliers.^^
+ - #### Interquartile Range
+ - What is the **interquartile range** of a sample? #card
+ card-last-interval:: 41.44
+ card-repeats:: 5
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-26T06:18:35.901Z
+ card-last-reviewed:: 2022-11-14T20:18:35.901Z
+ card-last-score:: 5
+ - The **interquartile range** is the middle 50% of the data.
+ - Therefore, it is ^^robust to outliers.^^
+ - To calculate the **IQR**, first split the data in 4 quarters and subtract the value at $Q_3$ from the value at $Q_1$.
+ - $$IQR=Q_3-Q_1$$
+ - 
+ - #### Tukey's Method for IQR
+ - There are also many other methods for calculating IQR.
+ - 1. Put data in **ascending** order.
+ 2. The **lower quartile** ($Q_1$)is the **median** of the **lower** 50% of the data, including the median.
+ 3. The **upper quartile** ($Q_3$) is the **median** of the **upper** 50% of the data, including the median.
+ - #### Standard Deviation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:40:52.313Z
+ card-last-score:: 1
+ - A common measure of spread is the **standard deviation**, which takes into account how far *each* data value is from the mean.
+ - A **deviation** is the distance of a datapoint from the mean.
+ - Since the sum of all the deviations would be zero, we square each deviation and find an average of the deviations called the **variance**.
+ - We then get the positive square root of the **sample variance** to get the the **sample standard deviation**, which is preferable to the sample variance, as the sample variance is in squared units.
+ - The **standard deviation** is ^^sensitive to outliers.^^
+ - How do you calculate the **sample variance**, and hence, the **sample standard deviation**? #card
+ card-last-interval:: 10.97
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-25T15:37:19.443Z
+ card-last-reviewed:: 2022-11-14T16:37:19.444Z
+ card-last-score:: 3
+ - The **sample variance**, denoted by $s^2$, is given by:
+ - $$s^2=\sum_{i=1}^{n} \frac{(x_i - \bar{x})^2}{n-1}$$
+ - The **sample standard deviation**, denoted by $s$, is the **positive square root** of $s^2$, that is:
+ - $$s=\sqrt{s^2}$$
+ - ### Shape
+ - #### Graphical Summaries of Data
+ - Depends on the variable of interest.
+ - **Categorical** response variable -> bar chart or pie chart.
+ - **Categorical** response variable ^^with an explanatory variable^^ -> grouped bar chart.
+ - **Continuous** response variable -> histogram, boxplot, densit plot.
+ - **Continuous** response variable ^^with an explanatory variable^^ -> grouped boxplot.
+ -
+ - What is a **boxplot**? #card
+ card-last-interval:: 5.52
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-20T04:34:53.491Z
+ card-last-reviewed:: 2022-11-14T16:34:53.492Z
+ card-last-score:: 3
+ - A **boxplot** is a graphical display showing centre, spread, shape, & outliers.
+ - It displays the **5-number summary**:
+ - *min, Q1, median, Q3, max*
+ - 
+ - What is a **histogram**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:00:35.072Z
+ card-last-score:: 1
+ - **Histograms** are useful to show the general shape, location, and spread of data values.
+ - Representation by *area*.
+ - **Construction**
+ - Determine range of data *minimum, maximum*.
+ - Split into convenient intervals or *bins*.
+ - Usually use 5 to 15 intervals.
+ - Count number of observations in each interval - *frequency*.
+ - When talking about the shape of the data, make sure to address the following 3 questions:
+ - 1. Does the histogram have a single, central hump or several well-separated bumps?
+ 2. Is the histogram or boxplot **symmetric**, or more spread out in one direction (skewed)?
+ 3. Any unusual features? e.g.., outliers, spikes.
+ - 
+ - 
+ -
+ - #### Explanatory & Response Variables
+ collapsed:: true
+ - To identify the **explanatory** variable in a pair of variables, identify which of the two is suspected of affecting the other and plan an appropriate analysis
+ - explanatory variable -might effect-> response variable
+ - continent -might effect-> life expectancy.
+-
+- ## R Markdown
+ - What is **R Markdown**? #card
+ card-last-interval:: 28.93
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-12-13T14:49:15.636Z
+ card-last-reviewed:: 2022-11-14T16:49:15.637Z
+ card-last-score:: 5
+ - **R Markdown** is a file format for making ^^dynamic documents in R.^^
+ - R Markdown is written in Markdown and contains chunks of embedded R code (data management, summaries, graphics, analysis & interpretation) all in one document.
+ - Documents can be **knitted** to HTML, PDF, Word, and many other formats.
+ - ### Key Benefits of R Markdown
+ - Makes it easy to produce statistical reports with code, analysis, outputs, and write-up all in one place.
+ - Perfect for reproducible research.
+ - Easy to convert to different document types.
+ - ### Structure
+ - R Markdown contains **three** types of content:
+ - A **YAML Header**.
+ - Text, formatted with Markdown.
+ - Code chunks.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-09-30T10_01_42.265Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-09-30T10_01_42.265Z.Desktop.md
new file mode 100644
index 00000000..7d655e5b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-09-30T10_01_42.265Z.Desktop.md
@@ -0,0 +1,194 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[Introduction to Java]]
+- **Next Topic:** [[More Java Code]]
+- **Relevant Slides:** 
+-
+- What is the **structure of a class**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:29:57.359Z
+ card-last-score:: 1
+ - Every class has the following structure:
+ - ```java
+ public class ClassName
+ {
+ Fields
+ Constructors
+ Methods
+ }
+ ```
+- ## Fields
+ - What are **Fields**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:55:21.827Z
+ card-last-reviewed:: 2022-09-18T14:55:21.828Z
+ card-last-score:: 3
+ - **Fields**, also known as **instance variables**, store values for an object.
+ - Fields define the state of an object.
+ - In BlueJ, use *Inspect* to view the state.
+ - Some values change frequently, others rarely, or not at all.
+- ## Encapsulation
+ - What is **Encapsulation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:22:08.303Z
+ card-last-reviewed:: 2022-09-19T18:22:08.303Z
+ card-last-score:: 3
+ - In **encapsulation**, the ^^variables of a class will be hidden from other classes^^ and can only be accessed through the methods of their current class.
+ - This is also known as **data hiding**.
+ - Why use encapsulation? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:23:15.213Z
+ card-last-reviewed:: 2022-09-19T18:23:15.213Z
+ card-last-score:: 3
+ - In OOP, ^^each object is responsible for its own data.^^
+ - This allows an object to have greater control over which data is available to be viewed externally, and how external objects can mutate the object's state.
+ - ### Encapsulation Type: Private
+ - What is the effect of making a field **private**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:25:31.450Z
+ card-last-reviewed:: 2022-09-19T18:25:31.450Z
+ card-last-score:: 5
+ - Making a field **private** encapsulates their values inside their object.
+ - No external class or object can access a private field.
+-
+- ## Constructors
+ - What are **constructors**? #card
+ card-last-interval:: 3.02
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T18:30:51.722Z
+ card-last-reviewed:: 2022-09-19T18:30:51.722Z
+ card-last-score:: 3
+ - Constructors:
+ - Initialise an object.
+ - Have the same name as their class.
+ - Have a close association with the fields:
+ - They contain the initial values stored in the fields.
+ - They contain the parameter values often used for these.
+ - What is the point of the keyword `this`? #card
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-09-22T15:21:45.332Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.7
+ card-last-reviewed:: 2022-09-18T15:21:45.332Z
+ - If the input parameter variables in your constructor have the **same name** as your fields, you must use the `this` keyword to distinguish between the two.
+ - `this` = "belonging to this object".
+ - E.g.,
+ - ```java
+ public Bicycle(int speed, int gear, int cadence)
+ {
+ this.speed = speed;
+ this.gear = gear;
+ this.cadence = cadence;
+ }
+ ```
+-
+- ## Methods
+- What are **methods**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:06:15.300Z
+ card-last-reviewed:: 2022-09-19T18:06:15.300Z
+ card-last-score:: 3
+ - **Methods** implement the *behaviour* of an object.
+ - They have a consistent structure comprised of a *header* and a *body*.
+- ### Accessor Methods
+ - What are **accessor** methods? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:22:14.771Z
+ card-last-score:: 1
+ - **Accessor** methods provide information about the state of an object.
+ - An accessor method always returns a type that is **not** `void`.
+ - An accessor method returns a value (*result*) of the type given in the **header**.
+ - The method will contain a **return** statement to return the value.
+- ### Mutator Methods
+ - What are **mutator** methods? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:23:53.666Z
+ card-last-reviewed:: 2022-09-19T18:23:53.666Z
+ card-last-score:: 3
+ - **Mutator** methods alter (*mutate*) the state of an object.
+ - Achieved through changing the value of one or more fields.
+ - They typically contain one or more *assignment* statements.
+ - Often receive parameters.
+ - 
+ - ### Mutator Methods: Set
+ - Each field may have a dedicated **set** mutator method.
+ - These have a simple, distinctive form:
+ - **void** return type
+ - method name related to the field name
+ - a single formal parameter, with the same type as the type of the field
+ - a single assignment statement
+ - A typical "set" method:
+ - ```java
+ public void setGear (int number)
+ {
+ gear = number;
+ }
+ ```
+ - ### Protector Mutators
+ - A set method does not always have to assign unconditionally to the field.
+ - The parameter may be checked for validity and rejected if innappropriate.
+ - Mutators thereby protect fields.
+ - Mutators also support *encapsulation*.
+ - #### Protecting a Field
+ - ```java
+ public void setGear (int gearing)
+ {
+ // this conditional statement prevents innapropriate action.
+ // if protects the "gear" field from values that are too large or too small.
+ if (gearing >= 1 && gearing <= 18)
+ {
+ gear = gearing;
+ }
+ else
+ {
+ System.out.println("Exceeds maximum gear ratio. Gear not set");
+ }
+ }
+ ```
+- ### Method Structure
+ - The **header**:
+ - The head tells us:
+ - the *visibility* of the method to objects of other class.
+ - whether or not the method *returns a result*.
+ - the *name* of the method.
+ - whether or not the method takes *parameters*.
+ - E.g.,
+ - ```java
+ public int getSpeed()
+ ```
+ - The **body** encloses the method's *statements*.
+-
+- ## C vs Java
+ - Unlike C, an OOP program will **not** have a pool of global variables that each method can access.
+ - Instead, ^^each object has its own data^^, and other objects rely on the *accessor* methods of the object to access the data.
+-
+- ## Conditional Statements
+ - Conditional statements in Java have the same format as in C.
+ - ```java
+ if (condition) {
+ do something;
+ }
+ else {
+ do somethingElse;
+ }
+ ```
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-10-07T08_33_33.319Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-10-07T08_33_33.319Z.Desktop.md
new file mode 100644
index 00000000..ba47cbdd
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-10-07T08_33_33.319Z.Desktop.md
@@ -0,0 +1,196 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[Introduction to Java]]
+- **Next Topic:** [[More Java Code]]
+- **Relevant Slides:** 
+-
+- What is the **structure of a class**? #card
+ card-last-interval:: 2.3
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-02T16:26:57.406Z
+ card-last-reviewed:: 2022-09-30T09:26:57.407Z
+ card-last-score:: 3
+ - Every class has the following structure:
+ - ```java
+ public class ClassName
+ {
+ Fields
+ Constructors
+ Methods
+ }
+ ```
+- ## Fields
+ - What are **Fields**? #card
+ card-last-interval:: 8.76
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-09T06:15:08.025Z
+ card-last-reviewed:: 2022-09-30T12:15:08.025Z
+ card-last-score:: 5
+ - **Fields**, also known as **instance variables**, store values for an object.
+ - Fields define the state of an object.
+ - In BlueJ, use *Inspect* to view the state.
+ - Some values change frequently, others rarely, or not at all.
+- ## Encapsulation
+ - What is **Encapsulation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T11:44:39.961Z
+ card-last-score:: 1
+ - In **encapsulation**, the ^^variables of a class will be hidden from other classes^^ and can only be accessed through the methods of their current class.
+ - This is also known as **data hiding**.
+ - Why use encapsulation? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-08T15:30:57.356Z
+ card-last-reviewed:: 2022-09-30T08:30:57.357Z
+ card-last-score:: 3
+ - In OOP, ^^each object is responsible for its own data.^^
+ - This allows an object to have greater control over which data is available to be viewed externally, and how external objects can mutate the object's state.
+ - ### Encapsulation Type: Private
+ - What is the effect of making a field **private**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:30:49.649Z
+ card-last-reviewed:: 2022-09-30T08:30:49.650Z
+ card-last-score:: 5
+ - Making a field **private** encapsulates their values inside their object.
+ - No external class or object can access a private field.
+-
+- ## Constructors
+ - What are **constructors**? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:41:02.783Z
+ card-last-reviewed:: 2022-10-03T11:41:02.784Z
+ card-last-score:: 5
+ - Constructors:
+ - Initialise an object.
+ - Have the same name as their class.
+ - Have a close association with the fields:
+ - They contain the initial values stored in the fields.
+ - They contain the parameter values often used for these.
+ - What is the point of the keyword `this`? #card
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-14T15:39:43.016Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-03T11:39:43.018Z
+ - The `this` keyword refers to the current object in a method or constructor.
+ - The most common use of `this` is to distinguish between class attributes & parameters of the same name.
+ - If the input parameter variables in your constructor have the **same name** as your fields, you must use the `this` keyword to distinguish between the two.
+ - `this` = "belonging to this object".
+ - E.g.,
+ - ```java
+ public Bicycle(int speed, int gear, int cadence)
+ {
+ this.speed = speed;
+ this.gear = gear;
+ this.cadence = cadence;
+ }
+ ```
+-
+- ## Methods
+ - What are **qmethods**? #card
+ card-last-score:: 3
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-08T19:10:46.142Z
+ card-last-interval:: 8.32
+ card-ease-factor:: 2.08
+ card-last-reviewed:: 2022-09-30T12:10:46.142Z
+ - **Methods** implement the *behaviour* of an object.
+ - They have a consistent structure comprised of a *header* and a *body*.
+ - ### Accessor Methods
+ - What are **accessor** methods? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-04T09:21:53.359Z
+ card-last-reviewed:: 2022-09-30T09:21:53.359Z
+ card-last-score:: 5
+ - **Accessor** methods provide information about the state of an object.
+ - An accessor method always returns a type that is **not** `void`.
+ - An accessor method returns a value (*result*) of the type given in the **header**.
+ - The method will contain a **return** statement to return the value.
+ - ### Mutator Methods
+ - What are **mutator** methods? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:27:22.160Z
+ card-last-reviewed:: 2022-10-03T14:27:22.161Z
+ card-last-score:: 5
+ - **Mutator** methods alter (*mutate*) the state of an object.
+ - Achieved through changing the value of one or more fields.
+ - They typically contain one or more *assignment* statements.
+ - Often receive parameters.
+ - 
+ - ### Mutator Methods: Set
+ - Each field may have a dedicated **set** mutator method.
+ - These have a simple, distinctive form:
+ - **void** return type
+ - method name related to the field name
+ - a single formal parameter, with the same type as the type of the field
+ - a single assignment statement
+ - A typical "set" method:
+ - ```java
+ public void setGear (int number)
+ {
+ gear = number;
+ }
+ ```
+ - ### Protector Mutators
+ - A set method does not always have to assign unconditionally to the field.
+ - The parameter may be checked for validity and rejected if innappropriate.
+ - Mutators thereby protect fields.
+ - Mutators also support *encapsulation*.
+ - #### Protecting a Field
+ - ```java
+ public void setGear (int gearing)
+ {
+ // this conditional statement prevents innapropriate action.
+ // if protects the "gear" field from values that are too large or too small.
+ if (gearing >= 1 && gearing <= 18)
+ {
+ gear = gearing;
+ }
+ else
+ {
+ System.out.println("Exceeds maximum gear ratio. Gear not set");
+ }
+ }
+ ```
+ - ### Method Structure
+ - The **header**:
+ - The head tells us:
+ - the *visibility* of the method to objects of other class.
+ - whether or not the method *returns a result*.
+ - the *name* of the method.
+ - whether or not the method takes *parameters*.
+ - E.g.,
+ - ```java
+ public int getSpeed()
+ ```
+ - The **body** encloses the method's *statements*.
+-
+- ## C vs Java
+ - Unlike C, an OOP program will **not** have a pool of global variables that each method can access.
+ - Instead, ^^each object has its own data^^, and other objects rely on the *accessor* methods of the object to access the data.
+-
+- ## Conditional Statements
+ - Conditional statements in Java have the same format as in C.
+ - ```java
+ if (condition) {
+ do something;
+ }
+ else {
+ do somethingElse;
+ }
+ ```
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-10-10T11_59_52.389Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-10-10T11_59_52.389Z.Desktop.md
new file mode 100644
index 00000000..0f5220db
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-10-10T11_59_52.389Z.Desktop.md
@@ -0,0 +1,196 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[Introduction to Java]]
+- **Next Topic:** [[More Java Code]]
+- **Relevant Slides:** 
+-
+- What is the **structure of a class**? #card
+ card-last-interval:: 9.84
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-16T13:11:17.984Z
+ card-last-reviewed:: 2022-10-06T17:11:17.985Z
+ card-last-score:: 5
+ - Every class has the following structure:
+ - ```java
+ public class ClassName
+ {
+ Fields
+ Constructors
+ Methods
+ }
+ ```
+- ## Fields
+ - What are **Fields**? #card
+ card-last-interval:: 8.76
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-09T06:15:08.025Z
+ card-last-reviewed:: 2022-09-30T12:15:08.025Z
+ card-last-score:: 5
+ - **Fields**, also known as **instance variables**, store values for an object.
+ - Fields define the state of an object.
+ - In BlueJ, use *Inspect* to view the state.
+ - Some values change frequently, others rarely, or not at all.
+- ## Encapsulation
+ - What is **Encapsulation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:23:51.445Z
+ card-last-reviewed:: 2022-10-07T10:23:51.446Z
+ card-last-score:: 5
+ - In **encapsulation**, the ^^variables of a class will be hidden from other classes^^ and can only be accessed through the methods of their current class.
+ - This is also known as **data hiding**.
+ - Why use encapsulation? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-09T23:00:00.000Z
+ card-last-reviewed:: 2022-10-09T08:51:16.259Z
+ card-last-score:: 1
+ - In OOP, ^^each object is responsible for its own data.^^
+ - This allows an object to have greater control over which data is available to be viewed externally, and how external objects can mutate the object's state.
+ - ### Encapsulation Type: Private
+ - What is the effect of making a field **private**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:30:49.649Z
+ card-last-reviewed:: 2022-09-30T08:30:49.650Z
+ card-last-score:: 5
+ - Making a field **private** encapsulates their values inside their object.
+ - No external class or object can access a private field.
+-
+- ## Constructors
+ - What are **constructors**? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:41:02.783Z
+ card-last-reviewed:: 2022-10-03T11:41:02.784Z
+ card-last-score:: 5
+ - Constructors:
+ - Initialise an object.
+ - Have the same name as their class.
+ - Have a close association with the fields:
+ - They contain the initial values stored in the fields.
+ - They contain the parameter values often used for these.
+ - What is the point of the keyword `this`? #card
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-14T15:39:43.016Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-03T11:39:43.018Z
+ - The `this` keyword refers to the current object in a method or constructor.
+ - The most common use of `this` is to distinguish between class attributes & parameters of the same name.
+ - If the input parameter variables in your constructor have the **same name** as your fields, you must use the `this` keyword to distinguish between the two.
+ - `this` = "belonging to this object".
+ - E.g.,
+ - ```java
+ public Bicycle(int speed, int gear, int cadence)
+ {
+ this.speed = speed;
+ this.gear = gear;
+ this.cadence = cadence;
+ }
+ ```
+-
+- ## Methods
+ - What are **methods**? #card
+ card-last-score:: 3
+ card-repeats:: 4
+ card-next-schedule:: 2022-10-24T09:51:35.296Z
+ card-last-interval:: 15.05
+ card-ease-factor:: 1.94
+ card-last-reviewed:: 2022-10-09T08:51:35.296Z
+ - **Methods** implement the *behaviour* of an object.
+ - They have a consistent structure comprised of a *header* and a *body*.
+ - ### Accessor Methods
+ - What are **accessor** methods? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:19:14.037Z
+ card-last-reviewed:: 2022-10-07T10:19:14.038Z
+ card-last-score:: 5
+ - **Accessor** methods provide information about the state of an object.
+ - An accessor method always returns a type that is **not** `void`.
+ - An accessor method returns a value (*result*) of the type given in the **header**.
+ - The method will contain a **return** statement to return the value.
+ - ### Mutator Methods
+ - What are **mutator** methods? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:27:22.160Z
+ card-last-reviewed:: 2022-10-03T14:27:22.161Z
+ card-last-score:: 5
+ - **Mutator** methods alter (*mutate*) the state of an object.
+ - Achieved through changing the value of one or more fields.
+ - They typically contain one or more *assignment* statements.
+ - Often receive parameters.
+ - 
+ - ### Mutator Methods: Set
+ - Each field may have a dedicated **set** mutator method.
+ - These have a simple, distinctive form:
+ - **void** return type
+ - method name related to the field name
+ - a single formal parameter, with the same type as the type of the field
+ - a single assignment statement
+ - A typical "set" method:
+ - ```java
+ public void setGear (int number)
+ {
+ gear = number;
+ }
+ ```
+ - ### Protector Mutators
+ - A set method does not always have to assign unconditionally to the field.
+ - The parameter may be checked for validity and rejected if innappropriate.
+ - Mutators thereby protect fields.
+ - Mutators also support *encapsulation*.
+ - #### Protecting a Field
+ - ```java
+ public void setGear (int gearing)
+ {
+ // this conditional statement prevents innapropriate action.
+ // if protects the "gear" field from values that are too large or too small.
+ if (gearing >= 1 && gearing <= 18)
+ {
+ gear = gearing;
+ }
+ else
+ {
+ System.out.println("Exceeds maximum gear ratio. Gear not set");
+ }
+ }
+ ```
+ - ### Method Structure
+ - The **header**:
+ - The head tells us:
+ - the *visibility* of the method to objects of other class.
+ - whether or not the method *returns a result*.
+ - the *name* of the method.
+ - whether or not the method takes *parameters*.
+ - E.g.,
+ - ```java
+ public int getSpeed()
+ ```
+ - The **body** encloses the method's *statements*.
+-
+- ## C vs Java
+ - Unlike C, an OOP program will **not** have a pool of global variables that each method can access.
+ - Instead, ^^each object has its own data^^, and other objects rely on the *accessor* methods of the object to access the data.
+-
+- ## Conditional Statements
+ - Conditional statements in Java have the same format as in C.
+ - ```java
+ if (condition) {
+ do something;
+ }
+ else {
+ do somethingElse;
+ }
+ ```
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-10-20T09_05_57.955Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-10-20T09_05_57.955Z.Desktop.md
new file mode 100644
index 00000000..b1441a52
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-10-20T09_05_57.955Z.Desktop.md
@@ -0,0 +1,196 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[Introduction to Java]]
+- **Next Topic:** [[More Java Code]]
+- **Relevant Slides:** 
+-
+- What is the **structure of a class**? #card
+ card-last-interval:: 9.84
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-16T13:11:17.984Z
+ card-last-reviewed:: 2022-10-06T17:11:17.985Z
+ card-last-score:: 5
+ - Every class has the following structure:
+ - ```java
+ public class ClassName
+ {
+ Fields
+ Constructors
+ Methods
+ }
+ ```
+- ## Fields
+ - What are **Fields**? #card
+ card-last-interval:: 27.13
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-06T14:43:03.193Z
+ card-last-reviewed:: 2022-10-10T11:43:03.194Z
+ card-last-score:: 5
+ - **Fields**, also known as **instance variables**, store values for an object.
+ - Fields define the state of an object.
+ - In BlueJ, use *Inspect* to view the state.
+ - Some values change frequently, others rarely, or not at all.
+- ## Encapsulation
+ - What is **Encapsulation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:23:51.445Z
+ card-last-reviewed:: 2022-10-07T10:23:51.446Z
+ card-last-score:: 5
+ - In **encapsulation**, the ^^variables of a class will be hidden from other classes^^ and can only be accessed through the methods of their current class.
+ - This is also known as **data hiding**.
+ - Why use encapsulation? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-09T23:00:00.000Z
+ card-last-reviewed:: 2022-10-09T08:51:16.259Z
+ card-last-score:: 1
+ - In OOP, ^^each object is responsible for its own data.^^
+ - This allows an object to have greater control over which data is available to be viewed externally, and how external objects can mutate the object's state.
+ - ### Encapsulation Type: Private
+ - What is the effect of making a field **private**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:30:49.649Z
+ card-last-reviewed:: 2022-09-30T08:30:49.650Z
+ card-last-score:: 5
+ - Making a field **private** encapsulates their values inside their object.
+ - No external class or object can access a private field.
+-
+- ## Constructors
+ - What are **constructors**? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:41:02.783Z
+ card-last-reviewed:: 2022-10-03T11:41:02.784Z
+ card-last-score:: 5
+ - Constructors:
+ - Initialise an object.
+ - Have the same name as their class.
+ - Have a close association with the fields:
+ - They contain the initial values stored in the fields.
+ - They contain the parameter values often used for these.
+ - What is the point of the keyword `this`? #card
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-14T15:39:43.016Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-03T11:39:43.018Z
+ - The `this` keyword refers to the current object in a method or constructor.
+ - The most common use of `this` is to distinguish between class attributes & parameters of the same name.
+ - If the input parameter variables in your constructor have the **same name** as your fields, you must use the `this` keyword to distinguish between the two.
+ - `this` = "belonging to this object".
+ - E.g.,
+ - ```java
+ public Bicycle(int speed, int gear, int cadence)
+ {
+ this.speed = speed;
+ this.gear = gear;
+ this.cadence = cadence;
+ }
+ ```
+-
+- ## Methods
+ - What are **methods**? #card
+ card-last-score:: 3
+ card-repeats:: 4
+ card-next-schedule:: 2022-10-24T09:51:35.296Z
+ card-last-interval:: 15.05
+ card-ease-factor:: 1.94
+ card-last-reviewed:: 2022-10-09T08:51:35.296Z
+ - **Methods** implement the *behaviour* of an object.
+ - They have a consistent structure comprised of a *header* and a *body*.
+ - ### Accessor Methods
+ - What are **accessor** methods? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:19:14.037Z
+ card-last-reviewed:: 2022-10-07T10:19:14.038Z
+ card-last-score:: 5
+ - **Accessor** methods provide information about the state of an object.
+ - An accessor method always returns a type that is **not** `void`.
+ - An accessor method returns a value (*result*) of the type given in the **header**.
+ - The method will contain a **return** statement to return the value.
+ - ### Mutator Methods
+ - What are **mutator** methods? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:27:22.160Z
+ card-last-reviewed:: 2022-10-03T14:27:22.161Z
+ card-last-score:: 5
+ - **Mutator** methods alter (*mutate*) the state of an object.
+ - Achieved through changing the value of one or more fields.
+ - They typically contain one or more *assignment* statements.
+ - Often receive parameters.
+ - 
+ - ### Mutator Methods: Set
+ - Each field may have a dedicated **set** mutator method.
+ - These have a simple, distinctive form:
+ - **void** return type
+ - method name related to the field name
+ - a single formal parameter, with the same type as the type of the field
+ - a single assignment statement
+ - A typical "set" method:
+ - ```java
+ public void setGear (int number)
+ {
+ gear = number;
+ }
+ ```
+ - ### Protector Mutators
+ - A set method does not always have to assign unconditionally to the field.
+ - The parameter may be checked for validity and rejected if innappropriate.
+ - Mutators thereby protect fields.
+ - Mutators also support *encapsulation*.
+ - #### Protecting a Field
+ - ```java
+ public void setGear (int gearing)
+ {
+ // this conditional statement prevents innapropriate action.
+ // if protects the "gear" field from values that are too large or too small.
+ if (gearing >= 1 && gearing <= 18)
+ {
+ gear = gearing;
+ }
+ else
+ {
+ System.out.println("Exceeds maximum gear ratio. Gear not set");
+ }
+ }
+ ```
+ - ### Method Structure
+ - The **header**:
+ - The head tells us:
+ - the *visibility* of the method to objects of other class.
+ - whether or not the method *returns a result*.
+ - the *name* of the method.
+ - whether or not the method takes *parameters*.
+ - E.g.,
+ - ```java
+ public int getSpeed()
+ ```
+ - The **body** encloses the method's *statements*.
+-
+- ## C vs Java
+ - Unlike C, an OOP program will **not** have a pool of global variables that each method can access.
+ - Instead, ^^each object has its own data^^, and other objects rely on the *accessor* methods of the object to access the data.
+-
+- ## Conditional Statements
+ - Conditional statements in Java have the same format as in C.
+ - ```java
+ if (condition) {
+ do something;
+ }
+ else {
+ do somethingElse;
+ }
+ ```
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-11-09T13_03_58.109Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-11-09T13_03_58.109Z.Desktop.md
new file mode 100644
index 00000000..1588092b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-11-09T13_03_58.109Z.Desktop.md
@@ -0,0 +1,196 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[Introduction to Java]]
+- **Next Topic:** [[More Java Code]]
+- **Relevant Slides:** 
+-
+- What is the **structure of a class**? #card
+ card-last-interval:: 9.84
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-16T13:11:17.984Z
+ card-last-reviewed:: 2022-10-06T17:11:17.985Z
+ card-last-score:: 5
+ - Every class has the following structure:
+ - ```java
+ public class ClassName
+ {
+ Fields
+ Constructors
+ Methods
+ }
+ ```
+- ## Fields
+ - What are **Fields**? #card
+ card-last-interval:: 27.13
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-06T14:43:03.193Z
+ card-last-reviewed:: 2022-10-10T11:43:03.194Z
+ card-last-score:: 5
+ - **Fields**, also known as **instance variables**, store values for an object.
+ - Fields define the state of an object.
+ - In BlueJ, use *Inspect* to view the state.
+ - Some values change frequently, others rarely, or not at all.
+- ## Encapsulation
+ - What is **Encapsulation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:23:51.445Z
+ card-last-reviewed:: 2022-10-07T10:23:51.446Z
+ card-last-score:: 5
+ - In **encapsulation**, the ^^variables of a class will be hidden from other classes^^ and can only be accessed through the methods of their current class.
+ - This is also known as **data hiding**.
+ - Why use encapsulation? #card
+ card-last-interval:: 9.12
+ card-repeats:: 3
+ card-ease-factor:: 2.28
+ card-next-schedule:: 2022-10-29T10:28:34.075Z
+ card-last-reviewed:: 2022-10-20T08:28:34.075Z
+ card-last-score:: 5
+ - In OOP, ^^each object is responsible for its own data.^^
+ - This allows an object to have greater control over which data is available to be viewed externally, and how external objects can mutate the object's state.
+ - ### Encapsulation Type: Private
+ - What is the effect of making a field **private**? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:33:20.443Z
+ card-last-reviewed:: 2022-10-20T08:33:20.443Z
+ card-last-score:: 5
+ - Making a field **private** encapsulates their values inside their object.
+ - No external class or object can access a private field.
+-
+- ## Constructors
+ - What are **constructors**? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:41:02.783Z
+ card-last-reviewed:: 2022-10-03T11:41:02.784Z
+ card-last-score:: 5
+ - Constructors:
+ - Initialise an object.
+ - Have the same name as their class.
+ - Have a close association with the fields:
+ - They contain the initial values stored in the fields.
+ - They contain the parameter values often used for these.
+ - What is the point of the keyword `this`? #card
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-14T15:39:43.016Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-03T11:39:43.018Z
+ - The `this` keyword refers to the current object in a method or constructor.
+ - The most common use of `this` is to distinguish between class attributes & parameters of the same name.
+ - If the input parameter variables in your constructor have the **same name** as your fields, you must use the `this` keyword to distinguish between the two.
+ - `this` = "belonging to this object".
+ - E.g.,
+ - ```java
+ public Bicycle(int speed, int gear, int cadence)
+ {
+ this.speed = speed;
+ this.gear = gear;
+ this.cadence = cadence;
+ }
+ ```
+-
+- ## Methods
+ - What are **methods**? #card
+ card-last-score:: 3
+ card-repeats:: 4
+ card-next-schedule:: 2022-10-24T09:51:35.296Z
+ card-last-interval:: 15.05
+ card-ease-factor:: 1.94
+ card-last-reviewed:: 2022-10-09T08:51:35.296Z
+ - **Methods** implement the *behaviour* of an object.
+ - They have a consistent structure comprised of a *header* and a *body*.
+ - ### Accessor Methods
+ - What are **accessor** methods? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:19:14.037Z
+ card-last-reviewed:: 2022-10-07T10:19:14.038Z
+ card-last-score:: 5
+ - **Accessor** methods provide information about the state of an object.
+ - An accessor method always returns a type that is **not** `void`.
+ - An accessor method returns a value (*result*) of the type given in the **header**.
+ - The method will contain a **return** statement to return the value.
+ - ### Mutator Methods
+ - What are **mutator** methods? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:27:22.160Z
+ card-last-reviewed:: 2022-10-03T14:27:22.161Z
+ card-last-score:: 5
+ - **Mutator** methods alter (*mutate*) the state of an object.
+ - Achieved through changing the value of one or more fields.
+ - They typically contain one or more *assignment* statements.
+ - Often receive parameters.
+ - 
+ - ### Mutator Methods: Set
+ - Each field may have a dedicated **set** mutator method.
+ - These have a simple, distinctive form:
+ - **void** return type
+ - method name related to the field name
+ - a single formal parameter, with the same type as the type of the field
+ - a single assignment statement
+ - A typical "set" method:
+ - ```java
+ public void setGear (int number)
+ {
+ gear = number;
+ }
+ ```
+ - ### Protector Mutators
+ - A set method does not always have to assign unconditionally to the field.
+ - The parameter may be checked for validity and rejected if innappropriate.
+ - Mutators thereby protect fields.
+ - Mutators also support *encapsulation*.
+ - #### Protecting a Field
+ - ```java
+ public void setGear (int gearing)
+ {
+ // this conditional statement prevents innapropriate action.
+ // if protects the "gear" field from values that are too large or too small.
+ if (gearing >= 1 && gearing <= 18)
+ {
+ gear = gearing;
+ }
+ else
+ {
+ System.out.println("Exceeds maximum gear ratio. Gear not set");
+ }
+ }
+ ```
+ - ### Method Structure
+ - The **header**:
+ - The head tells us:
+ - the *visibility* of the method to objects of other class.
+ - whether or not the method *returns a result*.
+ - the *name* of the method.
+ - whether or not the method takes *parameters*.
+ - E.g.,
+ - ```java
+ public int getSpeed()
+ ```
+ - The **body** encloses the method's *statements*.
+-
+- ## C vs Java
+ - Unlike C, an OOP program will **not** have a pool of global variables that each method can access.
+ - Instead, ^^each object has its own data^^, and other objects rely on the *accessor* methods of the object to access the data.
+-
+- ## Conditional Statements
+ - Conditional statements in Java have the same format as in C.
+ - ```java
+ if (condition) {
+ do something;
+ }
+ else {
+ do somethingElse;
+ }
+ ```
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-11-11T12_04_45.330Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-11-11T12_04_45.330Z.Desktop.md
new file mode 100644
index 00000000..0b010027
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/First Java Code/2022-11-11T12_04_45.330Z.Desktop.md
@@ -0,0 +1,196 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[Introduction to Java]]
+- **Next Topic:** [[More Java Code]]
+- **Relevant Slides:** 
+-
+- What is the **structure of a class**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-12-01T00:46:31.046Z
+ card-last-reviewed:: 2022-11-09T12:46:31.046Z
+ card-last-score:: 3
+ - Every class has the following structure:
+ - ```java
+ public class ClassName
+ {
+ Fields
+ Constructors
+ Methods
+ }
+ ```
+- ## Fields
+ - What are **Fields**? #card
+ card-last-interval:: 27.13
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-06T14:43:03.193Z
+ card-last-reviewed:: 2022-10-10T11:43:03.194Z
+ card-last-score:: 5
+ - **Fields**, also known as **instance variables**, store values for an object.
+ - Fields define the state of an object.
+ - In BlueJ, use *Inspect* to view the state.
+ - Some values change frequently, others rarely, or not at all.
+- ## Encapsulation
+ - What is **Encapsulation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:23:51.445Z
+ card-last-reviewed:: 2022-10-07T10:23:51.446Z
+ card-last-score:: 5
+ - In **encapsulation**, the ^^variables of a class will be hidden from other classes^^ and can only be accessed through the methods of their current class.
+ - This is also known as **data hiding**.
+ - Why use encapsulation? #card
+ card-last-interval:: 9.12
+ card-repeats:: 3
+ card-ease-factor:: 2.28
+ card-next-schedule:: 2022-10-29T10:28:34.075Z
+ card-last-reviewed:: 2022-10-20T08:28:34.075Z
+ card-last-score:: 5
+ - In OOP, ^^each object is responsible for its own data.^^
+ - This allows an object to have greater control over which data is available to be viewed externally, and how external objects can mutate the object's state.
+ - ### Encapsulation Type: Private
+ - What is the effect of making a field **private**? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:33:20.443Z
+ card-last-reviewed:: 2022-10-20T08:33:20.443Z
+ card-last-score:: 5
+ - Making a field **private** encapsulates their values inside their object.
+ - No external class or object can access a private field.
+-
+- ## Constructors
+ - What are **constructors**? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:41:02.783Z
+ card-last-reviewed:: 2022-10-03T11:41:02.784Z
+ card-last-score:: 5
+ - Constructors:
+ - Initialise an object.
+ - Have the same name as their class.
+ - Have a close association with the fields:
+ - They contain the initial values stored in the fields.
+ - They contain the parameter values often used for these.
+ - What is the point of the keyword `this`? #card
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-14T15:39:43.016Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-03T11:39:43.018Z
+ - The `this` keyword refers to the current object in a method or constructor.
+ - The most common use of `this` is to distinguish between class attributes & parameters of the same name.
+ - If the input parameter variables in your constructor have the **same name** as your fields, you must use the `this` keyword to distinguish between the two.
+ - `this` = "belonging to this object".
+ - E.g.,
+ - ```java
+ public Bicycle(int speed, int gear, int cadence)
+ {
+ this.speed = speed;
+ this.gear = gear;
+ this.cadence = cadence;
+ }
+ ```
+-
+- ## Methods
+ - What are **methods**? #card
+ card-last-score:: 3
+ card-repeats:: 4
+ card-next-schedule:: 2022-10-24T09:51:35.296Z
+ card-last-interval:: 15.05
+ card-ease-factor:: 1.94
+ card-last-reviewed:: 2022-10-09T08:51:35.296Z
+ - **Methods** implement the *behaviour* of an object.
+ - They have a consistent structure comprised of a *header* and a *body*.
+ - ### Accessor Methods
+ - What are **accessor** methods? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:19:14.037Z
+ card-last-reviewed:: 2022-10-07T10:19:14.038Z
+ card-last-score:: 5
+ - **Accessor** methods provide information about the state of an object.
+ - An accessor method always returns a type that is **not** `void`.
+ - An accessor method returns a value (*result*) of the type given in the **header**.
+ - The method will contain a **return** statement to return the value.
+ - ### Mutator Methods
+ - What are **mutator** methods? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:27:22.160Z
+ card-last-reviewed:: 2022-10-03T14:27:22.161Z
+ card-last-score:: 5
+ - **Mutator** methods alter (*mutate*) the state of an object.
+ - Achieved through changing the value of one or more fields.
+ - They typically contain one or more *assignment* statements.
+ - Often receive parameters.
+ - 
+ - ### Mutator Methods: Set
+ - Each field may have a dedicated **set** mutator method.
+ - These have a simple, distinctive form:
+ - **void** return type
+ - method name related to the field name
+ - a single formal parameter, with the same type as the type of the field
+ - a single assignment statement
+ - A typical "set" method:
+ - ```java
+ public void setGear (int number)
+ {
+ gear = number;
+ }
+ ```
+ - ### Protector Mutators
+ - A set method does not always have to assign unconditionally to the field.
+ - The parameter may be checked for validity and rejected if innappropriate.
+ - Mutators thereby protect fields.
+ - Mutators also support *encapsulation*.
+ - #### Protecting a Field
+ - ```java
+ public void setGear (int gearing)
+ {
+ // this conditional statement prevents innapropriate action.
+ // if protects the "gear" field from values that are too large or too small.
+ if (gearing >= 1 && gearing <= 18)
+ {
+ gear = gearing;
+ }
+ else
+ {
+ System.out.println("Exceeds maximum gear ratio. Gear not set");
+ }
+ }
+ ```
+ - ### Method Structure
+ - The **header**:
+ - The head tells us:
+ - the *visibility* of the method to objects of other class.
+ - whether or not the method *returns a result*.
+ - the *name* of the method.
+ - whether or not the method takes *parameters*.
+ - E.g.,
+ - ```java
+ public int getSpeed()
+ ```
+ - The **body** encloses the method's *statements*.
+-
+- ## C vs Java
+ - Unlike C, an OOP program will **not** have a pool of global variables that each method can access.
+ - Instead, ^^each object has its own data^^, and other objects rely on the *accessor* methods of the object to access the data.
+-
+- ## Conditional Statements
+ - Conditional statements in Java have the same format as in C.
+ - ```java
+ if (condition) {
+ do something;
+ }
+ else {
+ do somethingElse;
+ }
+ ```
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-09-30T10_01_42.283Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-09-30T10_01_42.283Z.Desktop.md
new file mode 100644
index 00000000..cfc2cd30
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-09-30T10_01_42.283Z.Desktop.md
@@ -0,0 +1,455 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous topic:** [[Introduction to Cybersecurity]]
+- **Next Topic:** [[Introduction to Cryptography]]
+- **Relevant lecture slides:** 
+-
+- ## Motivation
+ - What are **Cyberattacks**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:12:09.399Z
+ card-last-reviewed:: 2022-09-18T15:12:09.400Z
+ card-last-score:: 5
+ - Cyberattacks are aimed at **accessing, changing, or destroying sensitive information**, extorting money, or interrupting normal business processes.
+ - Managing sensitive data may reduce the attack probability, or at least its impact.
+ - **GDPR** provides such a regulatory framework
+-
+- ## General Data Protection Regulation
+ - What is **GDPR**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-28T15:29:17.338Z
+ card-last-reviewed:: 2022-09-19T18:29:17.338Z
+ card-last-score:: 3
+ - The **General Data Protection Regulation** is a binding regulation in EU law on data protection in the European Union and the European Economic Area (EEA).
+ - The primary aim of GDPR is to ^^enhance individuals' control & rights over their personal data and to simplify the regulatory environment for international business.^^
+ - The regulation contains ^^provisions & requirements related to the processing of personal data of individuals^^ who are located in the EEA, and applies to any enterprise that is processing the personal data of individuals inside the EEA - ^^regardless of its location and the data subjects' citizenship or residence.^^
+ - ### GDPR Overview
+ - The GDPR sets out several key principles: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:47:35.615Z
+ card-last-score:: 1
+ - Lawfulness
+ - Fairness & Transparency
+ - Purpose Limitation
+ - Data Minimsation
+ - Accuracy
+ - Storage Limitation
+ - Integrity & Confidentiality (Security)
+ - Accountability
+ - What is **Lawfulness** in GDPR? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:07:45.168Z
+ card-last-reviewed:: 2022-09-18T15:07:45.169Z
+ card-last-score:: 5
+ - You must identify ^^**valid grounds** under the GDPR (known as a "**lawful basis**")^^ for collecting & using personal data.
+ - Processing shall be lawful if and to the extent that at least one of the following applies:
+ - Consensual
+ - Necessary for the performance of a contract
+ - Necessary for compliance with a legal obligation
+ - Necessary to protect the vital interests of the data subject or another person
+ - Necessary for the performance of a task carried out in public interest
+ - Necessary for the purpose of legitimate interests
+ - What is **Fairness & Transparency** in GDPR? #card
+ card-last-interval:: 11.32
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-01T01:28:42.062Z
+ card-last-reviewed:: 2022-09-19T18:28:42.063Z
+ card-last-score:: 3
+ - You must ^^use personal data in a way that is fair.^^ This means that you must not process the data in a way that is unduly detrimental, unexpected, or misleading to the individuals concerned.
+ - You must be ^^clear, open, & honest^^ with data subjects from the start about how you will use their personal data.
+ - At the time personal data is being collected from data subjects, they must be informed via a "**Data Protection Notice**".
+ - What is a **Data Protection Notice**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:31:34.947Z
+ card-last-score:: 1
+ - A **Data Protection Notice** entails:
+ - The identity & contact details of the **data controller**
+ - The contact details of the **data protection officer**
+ - The **purpose of the processing** & the legal basis for the processing
+ - The recipients or categories of **recipients of the data**
+ - Details of any transfers out of the EEA, the safeguards in place, and the means by which to obtain a copy of them
+ - The **data retention** period or the criteria to determine the data retention period
+ - The **individual's rights** (access, rectification & erasure, restriction, complaint)
+ - What is **Purpose Limitation** in GDPR? #card
+ card-last-interval:: 11.32
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-01T01:29:49.066Z
+ card-last-reviewed:: 2022-09-19T18:29:49.066Z
+ card-last-score:: 5
+ - You must be ^^clear about what your purposes for processing^^ are from the start.
+ - You must ^^record your purposes^^ as part of your documentation obligations and specify them in your privacy information for individuals.
+ - You ^^can only use the personal data for a new purpose^^ if it is either compatible with your original purpose, you get **consent**, or you have a **clear basis in law**.
+ - What is **Data Minimisation** in GDPR? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:18:53.347Z
+ card-last-reviewed:: 2022-09-18T15:18:53.348Z
+ card-last-score:: 5
+ - You must ensure that the personal data that you are processing is:
+ - **adequate** - sufficient to properly fulfil your stated purpose
+ - **relevant** - has a rational link to that purpose
+ - **limited** to what is necessary - you do not hold more than what you need for your stated purpose
+ - What is **Accuracy** in GDPR? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:00:01.564Z
+ card-last-reviewed:: 2022-09-18T15:00:01.564Z
+ card-last-score:: 5
+ - You should take all reasonable steps to ensure that the personal data you hold is ^^not incorrect or misleading^^ as to any matter of fact.
+ - You may need to ^^keep the personal data updated^^, although this will depend on what you are using it for.
+ - If you ^^discover that personal data is incorrect or misleading^^, you must take reasonable steps to correct or erase it as soon as possible.
+ - You must ^^carefully consider any challenges to the accuracy^^ of personal data.
+ - What is **Storage Limitation** in GDPR? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T14:59:31.645Z
+ card-last-reviewed:: 2022-09-18T14:59:31.645Z
+ card-last-score:: 5
+ - You must not keep personal data for ^^longer than you need it^^.
+ - You need to think about - and be able to justify - ^^how long you keep personal data^^. This will depend on your purposes for holding the data.
+ - You need a policy ^^setting standard retention periods^^ wherever possible, to comply with documentation requirements.
+ - You should also ^^periodically review the data you hold^^, and erase or anonymise it when you no longer need it.
+ - You must ^^carefully consider any challenges to your retention of data^^.
+ - Individuals have a **right to erasure** if you no longer need the data.
+ - You can ^^keep personal data for longer^^ if you are only keeping it for ^^personal interest archiving, scientific or historical research, or statistical purposes.^^
+ - What is **Accountability & Governance** in GDPR? #card
+ card-last-interval:: 3.02
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T18:30:45.595Z
+ card-last-reviewed:: 2022-09-19T18:30:45.595Z
+ card-last-score:: 3
+ - **Accountability** is one of the **data protection principles** - it makes you responsible for complying with the GDPR and says that ^^you must be able to demonstrate your compliance.^^
+ - You need to put in place appropriate technical & organisational measures to meet the requirements of accountability.
+ - Accountability requires controllers to maintain records of processing activities in order to demonstrate how they comply with the data protection principles, i.e.:
+ - Inventory of personal data
+ - Providing assurance of compliance
+ - Need to document
+ - Why it is held
+ - How it is collected
+ - When it will be deleted
+ - Who may gain access to it
+ - What is **Integrity & Confidentiality** in GDPR? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:48:22.142Z
+ card-last-score:: 1
+ - A key principle of GDPR is that you process personal data ^^securely by means of "appropriate technical & organisational measures"^^ - this is the "**security principle**".
+ - Doing this requires you to consider things like ^^risk analysis, organisational policies, and physical + technical measures.^^
+ - Where appropriate, you should look to use measures such as **pseudoanonymisation** and **encryption**.
+ - Your measures must ensure the ^^"confidentiality, integrity, & availability"^^ of your systems & services and the personal data you process with them.
+ - The measures must also enable you to ^^restore access & availability^^ to personal data in a timely manner in the event of a physical or technical incident.
+ - What is **Data Protection**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T17:43:35.395Z
+ card-last-score:: 1
+ - **Data Protection** is about an ^^individual's fundamental right to privacy.^^
+ - When an individual gives their personal data to any organisation, the recipient has the duty to keep the data both safe & private. This applies to both printed & electronic data.
+ - What does Data Protection Legislation do? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T17:42:08.681Z
+ card-last-reviewed:: 2022-09-19T17:42:08.682Z
+ card-last-score:: 3
+ - Data Protection Legislation:
+ - governs the way we deal with personal data / information
+ - provides a mechanism for safeguarding the privacy rights of individuals in relation to the processing of their data
+ - upholds rights and enforces obligations
+ - What is **Personal Data**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:21:56.198Z
+ card-last-reviewed:: 2022-09-19T18:21:56.199Z
+ card-last-score:: 5
+ - **Personal Data** is any information relating to an identified or ^^identifiable natural person^^ ("data subject").
+ - What is an **identifiable natural person**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:21:42.644Z
+ card-last-reviewed:: 2022-09-19T18:21:42.644Z
+ card-last-score:: 3
+ - An **identifiable natural person** is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier to one or more factors specific to the ^^physical, physiological, genetic, mental, economic, cultural, or social identity^^ of that natural person.
+ - What is **Data Processing**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:50:21.132Z
+ card-last-reviewed:: 2022-09-18T14:50:21.132Z
+ card-last-score:: 3
+ - **Data Processing** is ^^performing any operation on personal data^^, either manually or by automated means, including:
+ - Obtaining
+ - Storing
+ - Transmitting
+ - Recording
+ - Organising
+ - Altering
+ - Disclosing
+ - Erasing
+ - ### Entities in GDPR
+ - GDPR distinguishes between:
+ - The **Data Subject**
+ - The **Data Protection Officer (DPO)**
+ - The **Data Controller**
+ - The **Data Processor**
+ -
+ - What is the **Data Subject**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:24:52.976Z
+ card-last-reviewed:: 2022-09-19T18:24:52.976Z
+ card-last-score:: 5
+ - The **Data Subject** is the person to whom the data relates.
+ - GDPR only applies to living individuals, but any duty of confidence in place prior to the death extends beyond that point.
+ - In Ireland, the next of kin of the deceased are entitled to a Freedom of Information request to the deceased's personal data.
+ - What is the **DPO**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:31:23.177Z
+ card-last-score:: 1
+ - The primary role of the **Data Protection Officer** is to ^^ensure that their organisation processes the personal data of its staff, customers, and other data subjects in compliance with the applicable data protection rules.^^
+ - The Data Protection officer is required to be an expert within this field, along with the requirement for them to report to the highest management level.
+ - With this being a challenging aspect of GDPR compliance for smaller organisations, there is the option to make an external appointment of a third-part DPO.
+ -
+ - When is the DPO a mandatory role? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:50:53.979Z
+ card-last-reviewed:: 2022-09-18T14:50:53.980Z
+ card-last-score:: 3
+ - The DPO is a mandatory role within 3 different scenarios:
+ - 1. When the processing is undertaken by a public authority or body.
+ - 2. When an organisation's main activities require the frequent & large-scale monitoring of individual people.
+ - 3. Where large-scale processing of special categories of data or data relating to criminal records forms the core activities.
+ - What is the **Data Controller**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-28T14:47:48.190Z
+ card-last-reviewed:: 2022-09-19T17:47:48.191Z
+ card-last-score:: 3
+ - The **Data Controller** is the company or an individual who ^^has overall control over the processing of personal data.^^
+ - The Data Controller takes on the responsibility for GDPR compliance.
+ - A Data Controller needs to have had sufficient training and to be able to competently ensure the security & protection of data held within the organisation.
+ - What is the **Data Processor**? #card
+ card-last-interval:: 11.32
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-01T01:29:33.325Z
+ card-last-reviewed:: 2022-09-19T18:29:33.326Z
+ card-last-score:: 5
+ - The **Data Processor** is the person who is ^^responsible for the processing of personal information.^^
+ - Generally, this role is undertaken under the instruction of the **data controller**.
+ - This might mean obtaining or recording the data, its adaption, and use. It may also include the disclosure of the data or making it available to others.
+ - Generally, the Data Processor is involved in the more technical elements of the operation, while the interpretation & main decision-making is the role of the Data Controller.
+ -
+ - ### Cloud Services & GDPR
+ - What makes a **Cloud Service Provider** a **Data Processor**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T17:49:31.101Z
+ card-last-score:: 1
+ - A **Cloud Service Provider** will be considered a **Data Processor** under GDPR if it provides data processing services (e.g., storage) on behalf of the Data Controller even without determining the purposes & means of processing.
+ - A Cloud Service Provider that offers personal data processing services directly to Data Subjects will be considered a **Data Controller**.
+ - What are some key benefits of GDPR for Data Subjects? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:22:42.639Z
+ card-last-reviewed:: 2022-09-19T18:22:42.640Z
+ card-last-score:: 3
+ - More information must be given to data subjects (e.g., how long the data will be kept, right to lodge a complaint).
+ - The Data Controller must explain & document the legal basis for processing the personal data.
+ - GDPR tightens the rules on how consent can be obtained.
+ - Must be distinguishable from other matters and in clear, plain language.
+ - It must be as easy to withdraw consent as it is to give it.
+ - Mandatory notification of security breaches without "undue delay" to the Data Protection Commissioner (within 72 hours).
+ - What are some key rights of Data Subjects? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T20:03:27.743Z
+ card-last-reviewed:: 2022-09-14T20:03:27.743Z
+ card-last-score:: 3
+ - Right of Access (copy to be provided within one month)
+ - Right to Erasure (the right to be forgotten)
+ - Right to Restriction of Processing
+ - Right to Object to Processing
+ - Right not to be subject to a decision based solely upon automated processing
+ - What are **Personal Data Security Breaches**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:24:23.550Z
+ card-last-reviewed:: 2022-09-19T18:24:23.551Z
+ card-last-score:: 5
+ - **Personal Data Security Breaches** include:
+ - Disclosure of confidential data to unauthorised individuals.
+ - Loss or theft of data or equipment upon which data is stored.
+ - Hacking, viruses, or other security attacks on IT equipment / systems / networks.
+ - Inappropriate access controls allowing unauthorised use of information.
+ - Emails containing personal data sent in error to the wrong recipient.
+ - Personal Data Security Breaches apply to both paper & electronic records.
+-
+- ## HTTP Cookies
+ - What is a **(HTTP) Cookie**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T15:12:42.615Z
+ card-last-score:: 1
+ - A **(HTTP) Cookie** is a small piece of data stored on the user's computer by the web browser while browsing a website.
+ - Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items in the shopping cart in an online store) or to record the user's browsing activity.
+ - They can be also be used to remember pieces of information that the user previously entered into form fields.
+ - **Authentication Cookies** are the most common method used by web servers to know whether the user is logged in or not, and which account they are logged into.
+ -
+ - #### Cookie Implementation
+ - How are cookies implemented? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:48:34.015Z
+ card-last-score:: 1
+ - Cookies are ^^arbitrary pieces of data^^ (i.e., large, random strings), usually chosen and first sent by the web server, and stored on the client computer by the web browser.
+ - The browser then send them back to the server with every request.
+ - Browser are required to:
+ - support cookies as large as 4,906 bytes in size
+ - support at least 50 cookies per domain
+ - support at least 3,000 cookies in total
+ -
+ - #### Cookie Structure
+ - What are the components of a cookie? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T17:43:45.262Z
+ card-last-score:: 1
+ - A cookie consists of the following components:
+ - Name
+ - Value
+ - Zero or more attributes (name - value pairs). These attributes store information such as the cookie's expiration, domain, and flags (such as *Secure* and *HttpOnly*)
+ -
+ - ### Session Cookies
+ - What is a **session cookie**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:22:21.715Z
+ card-last-reviewed:: 2022-09-19T18:22:21.716Z
+ card-last-score:: 3
+ - A **session cookie** (aka in-memory cookie, transient cookie, or non-persistent cookie) is a cookie that ^^exists only in temporary memory while the user navigates its website.^^
+ - Web browsers normally delete session cookies when the user closes the browser.
+ - Session cookies do not have an expiration date assigned to them, which is how the browser know to treat them as session cookies.
+ -
+ -
+ - ### Persistent Cookies
+ - What is a **persistent cookie**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:27:39.082Z
+ card-last-reviewed:: 2022-09-19T18:27:39.082Z
+ card-last-score:: 3
+ - A **persistent cookie** is a cookie which ^^expires at a specific data or after a specific length of time.^^
+ - A persistent cookie's information will be transmitted to the server every time the user visits the website that the cookie belongs to, for the lifespan of the persistent cookie (as set by its creator), or every time that the user views a resource belonging to that website from another website (such as an advertisement).
+ -
+ - Persistent cookies are sometimes referred to as **tracking cookies** because they can be used by advertisers to record information about a user's web browsing habits.
+ - However, tracking cookies are mainly used for legitimate reasons, such as keeping users logged into their accounts on website to avoid re-entering login credentials at every visit.
+ -
+ - ### Cookie Attributes
+ - Consider the following response header sent by a webserver that contains 3 persistent cookies:
+ - 
+ - What do the *Domain* and *Path* attributes do? #card
+ card-last-interval:: 9.55
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-29T07:30:31.159Z
+ card-last-reviewed:: 2022-09-19T18:30:31.160Z
+ card-last-score:: 5
+ - The *Domain* and *Path* attributes define the cookie's scope.
+ - What does the *Secure* attribute do? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-09-29T22:47:37.954Z
+ card-last-reviewed:: 2022-09-19T17:47:37.955Z
+ card-last-score:: 5
+ - The *Secure* attribute ensures that the cookie can only be transmitted over an **encrypted connection**, making it a "**secure cookie**".
+ - What does the *HttpOnly* attribute do? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:10:53.386Z
+ card-last-reviewed:: 2022-09-18T15:10:53.387Z
+ card-last-score:: 5
+ - The *HttpOnly* attribute ^^directs cookies not to expose cookies through channels other than HTTP / HTTPS.^^
+ - This means that this HttpOnly cookie cannot be accessed via client-side scripting languages (notably JavaScript).
+-
+- ## GDPR & Cookies
+ - Generally, a user's consent must be sought before a cookie is installed in a web browser.
+ - There are **two** expemptions:
+ - The **Communications Exemption**
+ - The **Strictly Necessary Exemption**
+ -
+ - What is the **Communications Exemption**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:48:01.065Z
+ card-last-reviewed:: 2022-09-18T14:48:01.066Z
+ card-last-score:: 3
+ - The **Communications Exemption** applies to cookies ^^whose sole purpose is for carrying out the transmission of a communication over a network^^, for example, to identify the communication endpoints.
+ - Cookies that meet these criteria are exempted from being required to ask for the user's consent prior to installation.
+ - **Example:** load-balancing cookies that distribute network traffic across different backend servers, also known as **session stickiness**.
+ - Here, a **load-balancer** creates an affinity between a client and a specific network server for the duration of a session using a cookie with a random & unique tracking ID.
+ - Subsequently, the load-balancer routes all the of the requests from this client to a specific backend server using the tracking ID, for the duration of the session.
+ - {:height 426, :width 529}
+ -
+ -
+ - What is the **Strictly Necessary** exemption? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T14:58:17.880Z
+ card-last-reviewed:: 2022-09-18T14:58:17.881Z
+ card-last-score:: 5
+ - The **Strictly Necessary** exemption exempts cookies that are strictly necessary to provide the service of delivered over the internet, i.e., a website or app from being required to ask the user's consent prior to installation.
+ - ^^This service must have been explicitly requested by the user (i.e., typing in the URL), and the use of the cookie must be restricted to what is strictly necessary to provide that service.^^
+ - Cookies related to advertising are **not** strictly necessary, and must be consented to.
+ - Examples:
+ - A website uses session cookies to keep track of items that a user places in an online shopping basket (assuming that this cookie will be deleted once the session is over).
+ - Cookies that a record a user's language or country preference.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-10-07T08_33_33.321Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-10-07T08_33_33.321Z.Desktop.md
new file mode 100644
index 00000000..deac0986
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-10-07T08_33_33.321Z.Desktop.md
@@ -0,0 +1,454 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous topic:** [[Introduction to Cybersecurity]]
+- **Next Topic:** [[Introduction to Cryptography]]
+- **Relevant lecture slides:** 
+-
+- ## Motivation
+ - What are **Cyberattacks**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:25:05.425Z
+ card-last-reviewed:: 2022-10-01T13:25:05.425Z
+ card-last-score:: 5
+ - Cyberattacks are aimed at **accessing, changing, or destroying sensitive information**, extorting money, or interrupting normal business processes.
+ - Managing sensitive data may reduce the attack probability, or at least its impact.
+ - **GDPR** provides such a regulatory framework
+-
+- ## General Data Protection Regulation
+ - What is **GDPR**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-25T02:35:29.600Z
+ card-last-reviewed:: 2022-10-03T14:35:29.600Z
+ card-last-score:: 5
+ - The **General Data Protection Regulation** is a binding regulation in EU law on data protection in the European Union and the European Economic Area (EEA).
+ - The primary aim of GDPR is to ^^enhance individuals' control & rights over their personal data and to simplify the regulatory environment for international business.^^
+ - The regulation contains ^^provisions & requirements related to the processing of personal data of individuals^^ who are located in the EEA, and applies to any enterprise that is processing the personal data of individuals inside the EEA - ^^regardless of its location and the data subjects' citizenship or residence.^^
+ - ### GDPR Overview
+ - The GDPR sets out several key principles: #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-03T16:20:39.425Z
+ card-last-reviewed:: 2022-09-30T09:20:39.425Z
+ card-last-score:: 3
+ - Lawfulness
+ - Fairness & Transparency
+ - Purpose Limitation
+ - Data Minimsation
+ - Accuracy
+ - Storage Limitation
+ - Integrity & Confidentiality (Security)
+ - Accountability
+ - What is **Lawfulness** in GDPR? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:30:40.152Z
+ card-last-reviewed:: 2022-09-30T08:30:40.153Z
+ card-last-score:: 5
+ - You must identify ^^**valid grounds** under the GDPR (known as a "**lawful basis**")^^ for collecting & using personal data.
+ - Processing shall be lawful if and to the extent that at least one of the following applies:
+ - Consensual
+ - Necessary for the performance of a contract
+ - Necessary for compliance with a legal obligation
+ - Necessary to protect the vital interests of the data subject or another person
+ - Necessary for the performance of a task carried out in public interest
+ - Necessary for the purpose of legitimate interests
+ - What is **Fairness & Transparency** in GDPR? #card
+ card-last-interval:: 11.32
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-01T01:28:42.062Z
+ card-last-reviewed:: 2022-09-19T18:28:42.063Z
+ card-last-score:: 3
+ - You must ^^use personal data in a way that is fair.^^ This means that you must not process the data in a way that is unduly detrimental, unexpected, or misleading to the individuals concerned.
+ - You must be ^^clear, open, & honest^^ with data subjects from the start about how you will use their personal data.
+ - At the time personal data is being collected from data subjects, they must be informed via a "**Data Protection Notice**".
+ - What is a **Data Protection Notice**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-03T11:22:24.235Z
+ card-last-reviewed:: 2022-09-30T09:22:24.235Z
+ card-last-score:: 3
+ - A **Data Protection Notice** entails:
+ - The identity & contact details of the **data controller**
+ - The contact details of the **data protection officer**
+ - The **purpose of the processing** & the legal basis for the processing
+ - The recipients or categories of **recipients of the data**
+ - Details of any transfers out of the EEA, the safeguards in place, and the means by which to obtain a copy of them
+ - The **data retention** period or the criteria to determine the data retention period
+ - The **individual's rights** (access, rectification & erasure, restriction, complaint)
+ - What is **Purpose Limitation** in GDPR? #card
+ card-last-interval:: 11.32
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-01T01:29:49.066Z
+ card-last-reviewed:: 2022-09-19T18:29:49.066Z
+ card-last-score:: 5
+ - You must be ^^clear about what your purposes for processing^^ are from the start.
+ - You must ^^record your purposes^^ as part of your documentation obligations and specify them in your privacy information for individuals.
+ - You ^^can only use the personal data for a new purpose^^ if it is either compatible with your original purpose, you get **consent**, or you have a **clear basis in law**.
+ - What is **Data Minimisation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:35:23.953Z
+ card-last-reviewed:: 2022-10-01T17:35:23.953Z
+ card-last-score:: 5
+ - You must ensure that the personal data that you are processing is:
+ - **adequate** - sufficient to properly fulfil your stated purpose
+ - **relevant** - has a rational link to that purpose
+ - **limited** to what is necessary - you do not hold more than what you need for your stated purpose
+ - What is **Accuracy** in GDPR? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:16:08.483Z
+ card-last-reviewed:: 2022-09-30T12:16:08.484Z
+ card-last-score:: 5
+ - You should take all reasonable steps to ensure that the personal data you hold is ^^not incorrect or misleading^^ as to any matter of fact.
+ - You may need to ^^keep the personal data updated^^, although this will depend on what you are using it for.
+ - If you ^^discover that personal data is incorrect or misleading^^, you must take reasonable steps to correct or erase it as soon as possible.
+ - You must ^^carefully consider any challenges to the accuracy^^ of personal data.
+ - What is **Storage Limitation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T12:26:30.278Z
+ card-last-reviewed:: 2022-09-30T08:26:30.278Z
+ card-last-score:: 5
+ - You must not keep personal data for ^^longer than you need it^^.
+ - You need to think about - and be able to justify - ^^how long you keep personal data^^. This will depend on your purposes for holding the data.
+ - You need a policy ^^setting standard retention periods^^ wherever possible, to comply with documentation requirements.
+ - You should also ^^periodically review the data you hold^^, and erase or anonymise it when you no longer need it.
+ - You must ^^carefully consider any challenges to your retention of data^^.
+ - Individuals have a **right to erasure** if you no longer need the data.
+ - You can ^^keep personal data for longer^^ if you are only keeping it for ^^personal interest archiving, scientific or historical research, or statistical purposes.^^
+ - What is **Accountability & Governance** in GDPR? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:40:56.633Z
+ card-last-reviewed:: 2022-10-03T11:40:56.633Z
+ card-last-score:: 5
+ - **Accountability** is one of the **data protection principles** - it makes you responsible for complying with the GDPR and says that ^^you must be able to demonstrate your compliance.^^
+ - You need to put in place appropriate technical & organisational measures to meet the requirements of accountability.
+ - Accountability requires controllers to maintain records of processing activities in order to demonstrate how they comply with the data protection principles, i.e.:
+ - Inventory of personal data
+ - Providing assurance of compliance
+ - Need to document
+ - Why it is held
+ - How it is collected
+ - When it will be deleted
+ - Who may gain access to it
+ - What is **Integrity & Confidentiality** in GDPR? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-04T09:08:33.941Z
+ card-last-reviewed:: 2022-09-30T09:08:33.941Z
+ card-last-score:: 3
+ - A key principle of GDPR is that you process personal data ^^securely by means of "appropriate technical & organisational measures"^^ - this is the "**security principle**".
+ - Doing this requires you to consider things like ^^risk analysis, organisational policies, and physical + technical measures.^^
+ - Where appropriate, you should look to use measures such as **pseudoanonymisation** and **encryption**.
+ - Your measures must ensure the ^^"confidentiality, integrity, & availability"^^ of your systems & services and the personal data you process with them.
+ - The measures must also enable you to ^^restore access & availability^^ to personal data in a timely manner in the event of a physical or technical incident.
+ - What is **Data Protection**? #card
+ card-last-interval:: 4.14
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-04T12:23:04.068Z
+ card-last-reviewed:: 2022-09-30T09:23:04.069Z
+ card-last-score:: 5
+ - **Data Protection** is about an ^^individual's fundamental right to privacy.^^
+ - When an individual gives their personal data to any organisation, the recipient has the duty to keep the data both safe & private. This applies to both printed & electronic data.
+ - What does Data Protection Legislation do? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:07.775Z
+ card-last-reviewed:: 2022-10-03T11:42:07.775Z
+ card-last-score:: 3
+ - Data Protection Legislation:
+ - governs the way we deal with personal data / information
+ - provides a mechanism for safeguarding the privacy rights of individuals in relation to the processing of their data
+ - upholds rights and enforces obligations
+ - What is **Personal Data**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:44:35.417Z
+ card-last-reviewed:: 2022-10-03T11:44:35.417Z
+ card-last-score:: 5
+ - **Personal Data** is any information relating to an identified or ^^identifiable natural person^^ ("data subject").
+ - What is an **identifiable natural person**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:44:29.504Z
+ card-last-reviewed:: 2022-10-03T11:44:29.504Z
+ card-last-score:: 5
+ - An **identifiable natural person** is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier to one or more factors specific to the ^^physical, physiological, genetic, mental, economic, cultural, or social identity^^ of that natural person.
+ - What is **Data Processing**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:13:46.167Z
+ card-last-reviewed:: 2022-09-30T12:13:46.167Z
+ card-last-score:: 3
+ - **Data Processing** is ^^performing any operation on personal data^^, either manually or by automated means, including:
+ - Obtaining
+ - Storing
+ - Transmitting
+ - Recording
+ - Organising
+ - Altering
+ - Disclosing
+ - Erasing
+ - ### Entities in GDPR
+ - GDPR distinguishes between:
+ - The **Data Subject**
+ - The **Data Protection Officer (DPO)**
+ - The **Data Controller**
+ - The **Data Processor**
+ -
+ - What is the **Data Subject**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:03.265Z
+ card-last-reviewed:: 2022-10-03T14:28:03.266Z
+ card-last-score:: 5
+ - The **Data Subject** is the person to whom the data relates.
+ - GDPR only applies to living individuals, but any duty of confidence in place prior to the death extends beyond that point.
+ - In Ireland, the next of kin of the deceased are entitled to a Freedom of Information request to the deceased's personal data.
+ - What is the **DPO**? #card
+ card-last-interval:: 3.51
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T00:26:04.053Z
+ card-last-reviewed:: 2022-10-04T12:26:04.054Z
+ card-last-score:: 5
+ - The primary role of the **Data Protection Officer** is to ^^ensure that their organisation processes the personal data of its staff, customers, and other data subjects in compliance with the applicable data protection rules.^^
+ - The Data Protection officer is required to be an expert within this field, along with the requirement for them to report to the highest management level.
+ - With this being a challenging aspect of GDPR compliance for smaller organisations, there is the option to make an external appointment of a third-part DPO.
+ -
+ - When is the DPO a mandatory role? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:34:15.483Z
+ card-last-score:: 1
+ - The DPO is a mandatory role within 3 different scenarios:
+ - 1. When the processing is undertaken by a public authority or body.
+ - 2. When an organisation's main activities require the frequent & large-scale monitoring of individual people.
+ - 3. Where large-scale processing of special categories of data or data relating to criminal records forms the core activities.
+ - What is the **Data Controller**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T14:34:50.476Z
+ card-last-score:: 1
+ - The **Data Controller** is the company or an individual who ^^has overall control over the processing of personal data.^^
+ - The Data Controller takes on the responsibility for GDPR compliance.
+ - A Data Controller needs to have had sufficient training and to be able to competently ensure the security & protection of data held within the organisation.
+ - What is the **Data Processor**? #card
+ card-last-interval:: 11.32
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-01T01:29:33.325Z
+ card-last-reviewed:: 2022-09-19T18:29:33.326Z
+ card-last-score:: 5
+ - The **Data Processor** is the person who is ^^responsible for the processing of personal information.^^
+ - Generally, this role is undertaken under the instruction of the **data controller**.
+ - This might mean obtaining or recording the data, its adaption, and use. It may also include the disclosure of the data or making it available to others.
+ - Generally, the Data Processor is involved in the more technical elements of the operation, while the interpretation & main decision-making is the role of the Data Controller.
+ -
+ - ### Cloud Services & GDPR
+ - What makes a **Cloud Service Provider** a **Data Processor**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-08T12:32:03.127Z
+ card-last-reviewed:: 2022-10-04T12:32:03.127Z
+ card-last-score:: 3
+ - A **Cloud Service Provider** will be considered a **Data Processor** under GDPR if it provides data processing services (e.g., storage) on behalf of the Data Controller even without determining the purposes & means of processing.
+ - A Cloud Service Provider that offers personal data processing services directly to Data Subjects will be considered a **Data Controller**.
+ - What are some key benefits of GDPR for Data Subjects? #card
+ collapsed:: true
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:45:06.983Z
+ card-last-reviewed:: 2022-10-03T11:45:06.983Z
+ card-last-score:: 3
+ - More information must be given to data subjects (e.g., how long the data will be kept, right to lodge a complaint).
+ - The Data Controller must explain & document the legal basis for processing the personal data.
+ - GDPR tightens the rules on how consent can be obtained.
+ - Must be distinguishable from other matters and in clear, plain language.
+ - It must be as easy to withdraw consent as it is to give it.
+ - Mandatory notification of security breaches without "undue delay" to the Data Protection Commissioner (within 72 hours).
+ - What are some key rights of Data Subjects? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T05:45:53.547Z
+ card-last-reviewed:: 2022-09-30T08:45:53.547Z
+ card-last-score:: 3
+ - Right of Access (copy to be provided within one month)
+ - Right to Erasure (the right to be forgotten)
+ - Right to Restriction of Processing
+ - Right to Object to Processing
+ - Right not to be subject to a decision based solely upon automated processing
+ - What are **Personal Data Security Breaches**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:28:54.471Z
+ card-last-reviewed:: 2022-09-30T08:28:54.471Z
+ card-last-score:: 5
+ - **Personal Data Security Breaches** include:
+ - Disclosure of confidential data to unauthorised individuals.
+ - Loss or theft of data or equipment upon which data is stored.
+ - Hacking, viruses, or other security attacks on IT equipment / systems / networks.
+ - Inappropriate access controls allowing unauthorised use of information.
+ - Emails containing personal data sent in error to the wrong recipient.
+ - Personal Data Security Breaches apply to both paper & electronic records.
+-
+- ## HTTP Cookies
+ - What is a **(HTTP) Cookie**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T09:09:15.904Z
+ card-last-score:: 1
+ - A **(HTTP) Cookie** is a small piece of data stored on the user's computer by the web browser while browsing a website.
+ - Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items in the shopping cart in an online store) or to record the user's browsing activity.
+ - They can be also be used to remember pieces of information that the user previously entered into form fields.
+ - **Authentication Cookies** are the most common method used by web servers to know whether the user is logged in or not, and which account they are logged into.
+ -
+ - #### Cookie Implementation
+ - How are cookies implemented? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:28:04.276Z
+ card-last-score:: 1
+ - Cookies are ^^arbitrary pieces of data^^ (i.e., large, random strings), usually chosen and first sent by the web server, and stored on the client computer by the web browser.
+ - The browser then send them back to the server with every request.
+ - Browser are required to:
+ - support cookies as large as 4,906 bytes in size
+ - support at least 50 cookies per domain
+ - support at least 3,000 cookies in total
+ -
+ - #### Cookie Structure
+ - What are the components of a cookie? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:27:31.803Z
+ card-last-score:: 1
+ - A cookie consists of the following components:
+ - Name
+ - Value
+ - Zero or more attributes (name - value pairs). These attributes store information such as the cookie's expiration, domain, and flags (such as *Secure* and *HttpOnly*)
+ -
+ - ### Session Cookies
+ - What is a **session cookie**? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:44:48.596Z
+ card-last-reviewed:: 2022-10-03T11:44:48.597Z
+ card-last-score:: 3
+ - A **session cookie** (aka in-memory cookie, transient cookie, or non-persistent cookie) is a cookie that ^^exists only in temporary memory while the user navigates its website.^^
+ - Web browsers normally delete session cookies when the user closes the browser.
+ - Session cookies do not have an expiration date assigned to them, which is how the browser know to treat them as session cookies.
+ -
+ -
+ - ### Persistent Cookies
+ - What is a **persistent cookie**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T20:29:49.936Z
+ card-last-reviewed:: 2022-10-03T14:29:49.936Z
+ card-last-score:: 5
+ - A **persistent cookie** is a cookie which ^^expires at a specific data or after a specific length of time.^^
+ - A persistent cookie's information will be transmitted to the server every time the user visits the website that the cookie belongs to, for the lifespan of the persistent cookie (as set by its creator), or every time that the user views a resource belonging to that website from another website (such as an advertisement).
+ -
+ - Persistent cookies are sometimes referred to as **tracking cookies** because they can be used by advertisers to record information about a user's web browsing habits.
+ - However, tracking cookies are mainly used for legitimate reasons, such as keeping users logged into their accounts on website to avoid re-entering login credentials at every visit.
+ -
+ - ### Cookie Attributes
+ - Consider the following response header sent by a webserver that contains 3 persistent cookies:
+ - 
+ - What do the *Domain* and *Path* attributes do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:07:55.485Z
+ card-last-score:: 1
+ - The *Domain* and *Path* attributes define the cookie's scope.
+ - What does the *Secure* attribute do? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-01T19:10:41.850Z
+ card-last-reviewed:: 2022-10-04T12:10:41.851Z
+ card-last-score:: 5
+ - The *Secure* attribute ensures that the cookie can only be transmitted over an **encrypted connection**, making it a "**secure cookie**".
+ - What does the *HttpOnly* attribute do? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-10T19:21:36.210Z
+ card-last-reviewed:: 2022-10-01T13:21:36.211Z
+ card-last-score:: 3
+ - The *HttpOnly* attribute ^^directs cookies not to expose cookies through channels other than HTTP / HTTPS.^^
+ - This means that this HttpOnly cookie cannot be accessed via client-side scripting languages (notably JavaScript).
+-
+- ## GDPR & Cookies
+ - Generally, a user's consent must be sought before a cookie is installed in a web browser.
+ - There are **two** expemptions:
+ - The **Communications Exemption**
+ - The **Strictly Necessary Exemption**
+ -
+ - What is the **Communications Exemption**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:13:34.042Z
+ card-last-reviewed:: 2022-09-30T12:13:34.042Z
+ card-last-score:: 3
+ - The **Communications Exemption** applies to cookies ^^whose sole purpose is for carrying out the transmission of a communication over a network^^, for example, to identify the communication endpoints.
+ - Cookies that meet these criteria are exempted from being required to ask for the user's consent prior to installation.
+ - **Example:** load-balancing cookies that distribute network traffic across different backend servers, also known as **session stickiness**.
+ - Here, a **load-balancer** creates an affinity between a client and a specific network server for the duration of a session using a cookie with a random & unique tracking ID.
+ - Subsequently, the load-balancer routes all the of the requests from this client to a specific backend server using the tracking ID, for the duration of the session.
+ - {:height 426, :width 529}
+ -
+ -
+ - What is the **Strictly Necessary** exemption? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:15:51.772Z
+ card-last-reviewed:: 2022-09-30T12:15:51.773Z
+ card-last-score:: 5
+ - The **Strictly Necessary** exemption exempts cookies that are strictly necessary to provide the service of delivered over the internet, i.e., a website or app from being required to ask the user's consent prior to installation.
+ - ^^This service must have been explicitly requested by the user (i.e., typing in the URL), and the use of the cookie must be restricted to what is strictly necessary to provide that service.^^
+ - Cookies related to advertising are **not** strictly necessary, and must be consented to.
+ - Examples:
+ - A website uses session cookies to keep track of items that a user places in an online shopping basket (assuming that this cookie will be deleted once the session is over).
+ - Cookies that a record a user's language or country preference.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-10-10T11_59_52.403Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-10-10T11_59_52.403Z.Desktop.md
new file mode 100644
index 00000000..d60ee391
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-10-10T11_59_52.403Z.Desktop.md
@@ -0,0 +1,459 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous topic:** [[Introduction to Cybersecurity]]
+- **Next Topic:** [[Introduction to Cryptography]]
+- **Relevant lecture slides:** 
+-
+- ## Motivation
+ - What are **Cyberattacks**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:25:05.425Z
+ card-last-reviewed:: 2022-10-01T13:25:05.425Z
+ card-last-score:: 5
+ - Cyberattacks are aimed at **accessing, changing, or destroying sensitive information**, extorting money, or interrupting normal business processes.
+ - Managing sensitive data may reduce the attack probability, or at least its impact.
+ - **GDPR** provides such a regulatory framework
+-
+- ## General Data Protection Regulation
+ - What is **GDPR**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-25T02:35:29.600Z
+ card-last-reviewed:: 2022-10-03T14:35:29.600Z
+ card-last-score:: 5
+ - The **General Data Protection Regulation** is a binding regulation in EU law on data protection in the European Union and the European Economic Area (EEA).
+ - The primary aim of GDPR is to ^^enhance individuals' control & rights over their personal data and to simplify the regulatory environment for international business.^^
+ - The regulation contains ^^provisions & requirements related to the processing of personal data of individuals^^ who are located in the EEA, and applies to any enterprise that is processing the personal data of individuals inside the EEA - ^^regardless of its location and the data subjects' citizenship or residence.^^
+ - ### GDPR Overview
+ - The GDPR sets out several key principles: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:20:12.573Z
+ card-last-score:: 1
+ - Lawfulness
+ - Fairness & Transparency
+ - Purpose Limitation
+ - Data Minimsation
+ - Accuracy
+ - Storage Limitation
+ - Integrity & Confidentiality (Security)
+ - Accountability
+ - What is **Lawfulness** in GDPR? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:30:40.152Z
+ card-last-reviewed:: 2022-09-30T08:30:40.153Z
+ card-last-score:: 5
+ - You must identify ^^**valid grounds** under the GDPR (known as a "**lawful basis**")^^ for collecting & using personal data.
+ - Processing shall be lawful if and to the extent that at least one of the following applies:
+ - Consensual
+ - Necessary for the performance of a contract
+ - Necessary for compliance with a legal obligation
+ - Necessary to protect the vital interests of the data subject or another person
+ - Necessary for the performance of a task carried out in public interest
+ - Necessary for the purpose of legitimate interests
+ - What is **Fairness & Transparency** in GDPR? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-28T22:35:32.027Z
+ card-last-reviewed:: 2022-10-07T10:35:32.027Z
+ card-last-score:: 3
+ - You must ^^use personal data in a way that is fair.^^ This means that you must not process the data in a way that is unduly detrimental, unexpected, or misleading to the individuals concerned.
+ - You must be ^^clear, open, & honest^^ with data subjects from the start about how you will use their personal data.
+ - At the time personal data is being collected from data subjects, they must be informed via a "**Data Protection Notice**".
+ - What is a **Data Protection Notice**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-16T07:36:37.829Z
+ card-last-reviewed:: 2022-10-07T10:36:37.829Z
+ card-last-score:: 3
+ - A **Data Protection Notice** entails:
+ - The identity & contact details of the **data controller**
+ - The contact details of the **data protection officer**
+ - The **purpose of the processing** & the legal basis for the processing
+ - The recipients or categories of **recipients of the data**
+ - Details of any transfers out of the EEA, the safeguards in place, and the means by which to obtain a copy of them
+ - The **data retention** period or the criteria to determine the data retention period
+ - The **individual's rights** (access, rectification & erasure, restriction, complaint)
+ - What is **Purpose Limitation** in GDPR? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-02T15:18:23.577Z
+ card-last-reviewed:: 2022-10-07T10:18:23.578Z
+ card-last-score:: 5
+ - You must be ^^clear about what your purposes for processing^^ are from the start.
+ - You must ^^record your purposes^^ as part of your documentation obligations and specify them in your privacy information for individuals.
+ - You ^^can only use the personal data for a new purpose^^ if it is either compatible with your original purpose, you get **consent**, or you have a **clear basis in law**.
+ - What is **Data Minimisation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:35:23.953Z
+ card-last-reviewed:: 2022-10-01T17:35:23.953Z
+ card-last-score:: 5
+ - You must ensure that the personal data that you are processing is:
+ - **adequate** - sufficient to properly fulfil your stated purpose
+ - **relevant** - has a rational link to that purpose
+ - **limited** to what is necessary - you do not hold more than what you need for your stated purpose
+ - What is **Accuracy** in GDPR? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:16:08.483Z
+ card-last-reviewed:: 2022-09-30T12:16:08.484Z
+ card-last-score:: 5
+ - You should take all reasonable steps to ensure that the personal data you hold is ^^not incorrect or misleading^^ as to any matter of fact.
+ - You may need to ^^keep the personal data updated^^, although this will depend on what you are using it for.
+ - If you ^^discover that personal data is incorrect or misleading^^, you must take reasonable steps to correct or erase it as soon as possible.
+ - You must ^^carefully consider any challenges to the accuracy^^ of personal data.
+ - What is **Storage Limitation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T12:26:30.278Z
+ card-last-reviewed:: 2022-09-30T08:26:30.278Z
+ card-last-score:: 5
+ - You must not keep personal data for ^^longer than you need it^^.
+ - You need to think about - and be able to justify - ^^how long you keep personal data^^. This will depend on your purposes for holding the data.
+ - You need a policy ^^setting standard retention periods^^ wherever possible, to comply with documentation requirements.
+ - You should also ^^periodically review the data you hold^^, and erase or anonymise it when you no longer need it.
+ - You must ^^carefully consider any challenges to your retention of data^^.
+ - Individuals have a **right to erasure** if you no longer need the data.
+ - You can ^^keep personal data for longer^^ if you are only keeping it for ^^personal interest archiving, scientific or historical research, or statistical purposes.^^
+ - What is **Accountability & Governance** in GDPR? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:40:56.633Z
+ card-last-reviewed:: 2022-10-03T11:40:56.633Z
+ card-last-score:: 5
+ - **Accountability** is one of the **data protection principles** - it makes you responsible for complying with the GDPR and says that ^^you must be able to demonstrate your compliance.^^
+ - You need to put in place appropriate technical & organisational measures to meet the requirements of accountability.
+ - Accountability requires controllers to maintain records of processing activities in order to demonstrate how they comply with the data protection principles, i.e.:
+ - Inventory of personal data
+ - Providing assurance of compliance
+ - Need to document
+ - Why it is held
+ - How it is collected
+ - When it will be deleted
+ - Who may gain access to it
+ - What is **Integrity & Confidentiality** in GDPR? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:19:04.604Z
+ card-last-reviewed:: 2022-10-07T10:19:04.605Z
+ card-last-score:: 5
+ - A key principle of GDPR is that you process personal data ^^securely by means of "appropriate technical & organisational measures"^^ - this is the "**security principle**".
+ - Doing this requires you to consider things like ^^risk analysis, organisational policies, and physical + technical measures.^^
+ - Where appropriate, you should look to use measures such as **pseudoanonymisation** and **encryption**.
+ - Your measures must ensure the ^^"confidentiality, integrity, & availability"^^ of your systems & services and the personal data you process with them.
+ - The measures must also enable you to ^^restore access & availability^^ to personal data in a timely manner in the event of a physical or technical incident.
+ - What is **Data Protection**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:27:56.517Z
+ card-last-score:: 1
+ - **Data Protection** is about an ^^individual's fundamental right to privacy.^^
+ - When an individual gives their personal data to any organisation, the recipient has the duty to keep the data both safe & private. This applies to both printed & electronic data.
+ - What does Data Protection Legislation do? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:07.775Z
+ card-last-reviewed:: 2022-10-03T11:42:07.775Z
+ card-last-score:: 3
+ - Data Protection Legislation:
+ - governs the way we deal with personal data / information
+ - provides a mechanism for safeguarding the privacy rights of individuals in relation to the processing of their data
+ - upholds rights and enforces obligations
+ - What is **Personal Data**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:44:35.417Z
+ card-last-reviewed:: 2022-10-03T11:44:35.417Z
+ card-last-score:: 5
+ - **Personal Data** is any information relating to an identified or ^^identifiable natural person^^ ("data subject").
+ - What is an **identifiable natural person**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:44:29.504Z
+ card-last-reviewed:: 2022-10-03T11:44:29.504Z
+ card-last-score:: 5
+ - An **identifiable natural person** is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier to one or more factors specific to the ^^physical, physiological, genetic, mental, economic, cultural, or social identity^^ of that natural person.
+ - What is **Data Processing**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:13:46.167Z
+ card-last-reviewed:: 2022-09-30T12:13:46.167Z
+ card-last-score:: 3
+ - **Data Processing** is ^^performing any operation on personal data^^, either manually or by automated means, including:
+ - Obtaining
+ - Storing
+ - Transmitting
+ - Recording
+ - Organising
+ - Altering
+ - Disclosing
+ - Erasing
+ - ### Entities in GDPR
+ - GDPR distinguishes between:
+ - The **Data Subject**
+ - The **Data Protection Officer (DPO)**
+ - The **Data Controller**
+ - The **Data Processor**
+ -
+ - What is the **Data Subject**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:03.265Z
+ card-last-reviewed:: 2022-10-03T14:28:03.266Z
+ card-last-score:: 5
+ - The **Data Subject** is the person to whom the data relates.
+ - GDPR only applies to living individuals, but any duty of confidence in place prior to the death extends beyond that point.
+ - In Ireland, the next of kin of the deceased are entitled to a Freedom of Information request to the deceased's personal data.
+ - What is the **DPO**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:48:55.229Z
+ card-last-score:: 1
+ - The primary role of the **Data Protection Officer (DPO)** is to ^^ensure that their organisation processes the personal data of its staff, customers, and other data subjects in compliance with the applicable data protection rules.^^
+ - The Data Protection officer is required to be an expert within this field, along with the requirement for them to report to the highest management level.
+ - With this being a challenging aspect of GDPR compliance for smaller organisations, there is the option to make an external appointment of a third-part DPO.
+ - When is the DPO a mandatory role? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:15:05.911Z
+ card-last-reviewed:: 2022-10-07T10:15:05.911Z
+ card-last-score:: 3
+ - The DPO is a mandatory role within 3 different scenarios:
+ - 1. When the processing is undertaken by a public authority or body.
+ - 2. When an organisation's main activities require the frequent & large-scale monitoring of individual people.
+ - 3. Where large-scale processing of special categories of data or data relating to criminal records forms the core activities.
+ - What is the **Data Controller**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T15:33:20.988Z
+ card-last-reviewed:: 2022-10-08T15:33:20.988Z
+ card-last-score:: 5
+ - The **Data Controller** is the company or an individual who ^^has overall control over the processing of personal data.^^
+ - The Data Controller takes on the responsibility for GDPR compliance.
+ - A Data Controller needs to have had sufficient training and to be able to competently ensure the security & protection of data held within the organisation.
+ - What is the **Data Processor**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:26:05.237Z
+ card-last-score:: 1
+ - The **Data Processor** is the person who is ^^responsible for the processing of personal information.^^
+ - Generally, this role is undertaken under the instruction of the **data controller**.
+ - This might mean obtaining or recording the data, its adaption, and use. It may also include the disclosure of the data or making it available to others.
+ - Generally, the Data Processor is involved in the more technical elements of the operation, while the interpretation & main decision-making is the role of the Data Controller.
+ -
+ - ### Cloud Services & GDPR
+ - What makes a **Cloud Service Provider** a **Data Processor**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T05:00:00.250Z
+ card-last-reviewed:: 2022-10-08T23:00:00.251Z
+ card-last-score:: 5
+ - A **Cloud Service Provider** will be considered a **Data Processor** under GDPR if it provides **data processing services** (e.g., storage) on behalf of the **Data Controller** ^^even without determining the purposes & means of processing.^^
+ - A Cloud Service Provider that offers personal data processing services directly to Data Subjects will be considered a **Data Controller**.
+ - What are some key benefits of GDPR for Data Subjects? #card
+ collapsed:: true
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:45:06.983Z
+ card-last-reviewed:: 2022-10-03T11:45:06.983Z
+ card-last-score:: 3
+ - More information must be given to data subjects (e.g., how long the data will be kept, right to lodge a complaint).
+ - The Data Controller must explain & document the legal basis for processing the personal data.
+ - GDPR tightens the rules on how consent can be obtained.
+ - Must be distinguishable from other matters and in clear, plain language.
+ - It must be as easy to withdraw consent as it is to give it.
+ - Mandatory notification of security breaches without "undue delay" to the Data Protection Commissioner (within 72 hours).
+ - What are some key rights of Data Subjects? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T05:45:53.547Z
+ card-last-reviewed:: 2022-09-30T08:45:53.547Z
+ card-last-score:: 3
+ - Right of Access (copy to be provided within one month)
+ - Right to Erasure (the right to be forgotten)
+ - Right to Restriction of Processing
+ - Right to Object to Processing
+ - Right not to be subject to a decision based solely upon automated processing
+ - What are **Personal Data Security Breaches**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:28:54.471Z
+ card-last-reviewed:: 2022-09-30T08:28:54.471Z
+ card-last-score:: 5
+ - **Personal Data Security Breaches** include:
+ - Disclosure of confidential data to unauthorised individuals.
+ - Loss or theft of data or equipment upon which data is stored.
+ - Hacking, viruses, or other security attacks on IT equipment / systems / networks.
+ - Inappropriate access controls allowing unauthorised use of information.
+ - Emails containing personal data sent in error to the wrong recipient.
+ - Personal Data Security Breaches apply to both paper & electronic records.
+-
+- ## HTTP Cookies
+ - What is a **(HTTP) Cookie**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:31:55.799Z
+ card-last-reviewed:: 2022-10-07T10:31:55.800Z
+ card-last-score:: 3
+ - A **(HTTP) Cookie** is a small piece of data stored on the user's computer by the web browser while browsing a website.
+ - Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items in the shopping cart in an online store) or to record the user's browsing activity.
+ - They can be also be used to remember pieces of information that the user previously entered into form fields.
+ - **Authentication Cookies** are the most common method used by web servers to know whether the user is logged in or not, and which account they are logged into.
+ -
+ - #### Cookie Implementation
+ - How are cookies implemented? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:26:56.144Z
+ card-last-score:: 1
+ - Cookies are ^^arbitrary pieces of data^^ (i.e., large, random strings), usually chosen & first sent by the web server, and stored on the client computer by the web browser.
+ - The browser then sends them back to the server with every request.
+ - Browsers are required to: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:27:06.498Z
+ card-last-score:: 1
+ - support cookies as large as 4,906 bytes in size
+ - support at least 50 cookies per domain
+ - support at least 3,000 cookies in total
+ -
+ - #### Cookie Structure
+ - What are the components of a cookie? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:19:47.270Z
+ card-last-score:: 1
+ - A cookie consists of the following components:
+ - Name
+ - Value
+ - Zero or more attributes (name - value pairs). These attributes store information such as the cookie's expiration, domain, and flags (such as *Secure* and *HttpOnly*)
+ -
+ - ### Session Cookies
+ - What is a **session cookie**? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:44:48.596Z
+ card-last-reviewed:: 2022-10-03T11:44:48.597Z
+ card-last-score:: 3
+ - A **session cookie** (aka in-memory cookie, transient cookie, or non-persistent cookie) is a cookie that ^^exists only in temporary memory while the user navigates its website.^^
+ - Web browsers normally delete session cookies when the user closes the browser.
+ - Session cookies do not have an expiration date assigned to them, which is how the browser know to treat them as session cookies.
+ -
+ -
+ - ### Persistent Cookies
+ - What is a **persistent cookie**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T20:29:49.936Z
+ card-last-reviewed:: 2022-10-03T14:29:49.936Z
+ card-last-score:: 5
+ - A **persistent cookie** is a cookie which ^^expires at a specific data or after a specific length of time.^^
+ - A persistent cookie's information will be transmitted to the server every time the user visits the website that the cookie belongs to, for the lifespan of the persistent cookie (as set by its creator), or every time that the user views a resource belonging to that website from another website (such as an advertisement).
+ -
+ - Persistent cookies are sometimes referred to as **tracking cookies** because they can be used by advertisers to record information about a user's web browsing habits.
+ - However, tracking cookies are mainly used for legitimate reasons, such as keeping users logged into their accounts on website to avoid re-entering login credentials at every visit.
+ -
+ - ### Cookie Attributes
+ - Consider the following response header sent by a webserver that contains 3 persistent cookies:
+ - 
+ - What do the *Domain* and *Path* attributes do? #card
+ card-last-interval:: 2.98
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T14:29:23.228Z
+ card-last-reviewed:: 2022-10-08T15:29:23.228Z
+ card-last-score:: 3
+ - The *Domain* and *Path* attributes define the cookie's scope.
+ - What does the *Secure* attribute do? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-01T19:10:41.850Z
+ card-last-reviewed:: 2022-10-04T12:10:41.851Z
+ card-last-score:: 5
+ - The *Secure* attribute ensures that the cookie can only be transmitted over an **encrypted connection**, making it a "**secure cookie**".
+ - What does the *HttpOnly* attribute do? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-10T19:21:36.210Z
+ card-last-reviewed:: 2022-10-01T13:21:36.211Z
+ card-last-score:: 3
+ - The *HttpOnly* attribute ^^directs cookies not to expose cookies through channels other than HTTP / HTTPS.^^
+ - This means that this HttpOnly cookie cannot be accessed via client-side scripting languages (notably JavaScript).
+-
+- ## GDPR & Cookies
+ - Generally, a user's consent must be sought before a cookie is installed in a web browser.
+ - There are **two** expemptions:
+ - The **Communications Exemption**
+ - The **Strictly Necessary Exemption**
+ -
+ - What is the **Communications Exemption**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:13:34.042Z
+ card-last-reviewed:: 2022-09-30T12:13:34.042Z
+ card-last-score:: 3
+ - The **Communications Exemption** applies to cookies ^^whose sole purpose is for carrying out the transmission of a communication over a network^^, for example, to identify the communication endpoints.
+ - Cookies that meet these criteria are exempted from being required to ask for the user's consent prior to installation.
+ - **Example:** load-balancing cookies that distribute network traffic across different backend servers, also known as **session stickiness**.
+ - Here, a **load-balancer** creates an affinity between a client and a specific network server for the duration of a session using a cookie with a random & unique tracking ID.
+ - Subsequently, the load-balancer routes all the of the requests from this client to a specific backend server using the tracking ID, for the duration of the session.
+ - {:height 426, :width 529}
+ -
+ -
+ - What is the **Strictly Necessary** exemption? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:15:51.772Z
+ card-last-reviewed:: 2022-09-30T12:15:51.773Z
+ card-last-score:: 5
+ - The **Strictly Necessary** exemption exempts cookies that are strictly necessary to provide the service of delivered over the internet, i.e., a website or app from being required to ask the user's consent prior to installation.
+ - ^^This service must have been explicitly requested by the user (i.e., typing in the URL), and the use of the cookie must be restricted to what is strictly necessary to provide that service.^^
+ - Cookies related to advertising are **not** strictly necessary, and must be consented to.
+ - Examples:
+ - A website uses session cookies to keep track of items that a user places in an online shopping basket (assuming that this cookie will be deleted once the session is over).
+ - Cookies that a record a user's language or country preference.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-10-20T09_05_57.961Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-10-20T09_05_57.961Z.Desktop.md
new file mode 100644
index 00000000..6414a013
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-10-20T09_05_57.961Z.Desktop.md
@@ -0,0 +1,459 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous topic:** [[Introduction to Cybersecurity]]
+- **Next Topic:** [[Introduction to Cryptography]]
+- **Relevant lecture slides:** 
+-
+- ## Motivation
+ - What are **Cyberattacks**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:25:05.425Z
+ card-last-reviewed:: 2022-10-01T13:25:05.425Z
+ card-last-score:: 5
+ - Cyberattacks are aimed at **accessing, changing, or destroying sensitive information**, extorting money, or interrupting normal business processes.
+ - Managing sensitive data may reduce the attack probability, or at least its impact.
+ - **GDPR** provides such a regulatory framework
+-
+- ## General Data Protection Regulation
+ - What is **GDPR**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-25T02:35:29.600Z
+ card-last-reviewed:: 2022-10-03T14:35:29.600Z
+ card-last-score:: 5
+ - The **General Data Protection Regulation** is a binding regulation in EU law on data protection in the European Union and the European Economic Area (EEA).
+ - The primary aim of GDPR is to ^^enhance individuals' control & rights over their personal data and to simplify the regulatory environment for international business.^^
+ - The regulation contains ^^provisions & requirements related to the processing of personal data of individuals^^ who are located in the EEA, and applies to any enterprise that is processing the personal data of individuals inside the EEA - ^^regardless of its location and the data subjects' citizenship or residence.^^
+ - ### GDPR Overview
+ - The GDPR sets out several key principles: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:36:09.651Z
+ card-last-score:: 1
+ - Lawfulness
+ - Fairness & Transparency
+ - Purpose Limitation
+ - Data Minimsation
+ - Accuracy
+ - Storage Limitation
+ - Integrity & Confidentiality (Security)
+ - Accountability
+ - What is **Lawfulness** in GDPR? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:30:40.152Z
+ card-last-reviewed:: 2022-09-30T08:30:40.153Z
+ card-last-score:: 5
+ - You must identify ^^**valid grounds** under the GDPR (known as a "**lawful basis**")^^ for collecting & using personal data.
+ - Processing shall be lawful if and to the extent that at least one of the following applies:
+ - Consensual
+ - Necessary for the performance of a contract
+ - Necessary for compliance with a legal obligation
+ - Necessary to protect the vital interests of the data subject or another person
+ - Necessary for the performance of a task carried out in public interest
+ - Necessary for the purpose of legitimate interests
+ - What is **Fairness & Transparency** in GDPR? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-28T22:35:32.027Z
+ card-last-reviewed:: 2022-10-07T10:35:32.027Z
+ card-last-score:: 3
+ - You must ^^use personal data in a way that is fair.^^ This means that you must not process the data in a way that is unduly detrimental, unexpected, or misleading to the individuals concerned.
+ - You must be ^^clear, open, & honest^^ with data subjects from the start about how you will use their personal data.
+ - At the time personal data is being collected from data subjects, they must be informed via a "**Data Protection Notice**".
+ - What is a **Data Protection Notice**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-16T07:36:37.829Z
+ card-last-reviewed:: 2022-10-07T10:36:37.829Z
+ card-last-score:: 3
+ - A **Data Protection Notice** entails:
+ - The identity & contact details of the **data controller**
+ - The contact details of the **data protection officer**
+ - The **purpose of the processing** & the legal basis for the processing
+ - The recipients or categories of **recipients of the data**
+ - Details of any transfers out of the EEA, the safeguards in place, and the means by which to obtain a copy of them
+ - The **data retention** period or the criteria to determine the data retention period
+ - The **individual's rights** (access, rectification & erasure, restriction, complaint)
+ - What is **Purpose Limitation** in GDPR? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-02T15:18:23.577Z
+ card-last-reviewed:: 2022-10-07T10:18:23.578Z
+ card-last-score:: 5
+ - You must be ^^clear about what your purposes for processing^^ are from the start.
+ - You must ^^record your purposes^^ as part of your documentation obligations and specify them in your privacy information for individuals.
+ - You ^^can only use the personal data for a new purpose^^ if it is either compatible with your original purpose, you get **consent**, or you have a **clear basis in law**.
+ - What is **Data Minimisation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:35:23.953Z
+ card-last-reviewed:: 2022-10-01T17:35:23.953Z
+ card-last-score:: 5
+ - You must ensure that the personal data that you are processing is:
+ - **adequate** - sufficient to properly fulfil your stated purpose
+ - **relevant** - has a rational link to that purpose
+ - **limited** to what is necessary - you do not hold more than what you need for your stated purpose
+ - What is **Accuracy** in GDPR? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:16:08.483Z
+ card-last-reviewed:: 2022-09-30T12:16:08.484Z
+ card-last-score:: 5
+ - You should take all reasonable steps to ensure that the personal data you hold is ^^not incorrect or misleading^^ as to any matter of fact.
+ - You may need to ^^keep the personal data updated^^, although this will depend on what you are using it for.
+ - If you ^^discover that personal data is incorrect or misleading^^, you must take reasonable steps to correct or erase it as soon as possible.
+ - You must ^^carefully consider any challenges to the accuracy^^ of personal data.
+ - What is **Storage Limitation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T12:26:30.278Z
+ card-last-reviewed:: 2022-09-30T08:26:30.278Z
+ card-last-score:: 5
+ - You must not keep personal data for ^^longer than you need it^^.
+ - You need to think about - and be able to justify - ^^how long you keep personal data^^. This will depend on your purposes for holding the data.
+ - You need a policy ^^setting standard retention periods^^ wherever possible, to comply with documentation requirements.
+ - You should also ^^periodically review the data you hold^^, and erase or anonymise it when you no longer need it.
+ - You must ^^carefully consider any challenges to your retention of data^^.
+ - Individuals have a **right to erasure** if you no longer need the data.
+ - You can ^^keep personal data for longer^^ if you are only keeping it for ^^personal interest archiving, scientific or historical research, or statistical purposes.^^
+ - What is **Accountability & Governance** in GDPR? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:40:56.633Z
+ card-last-reviewed:: 2022-10-03T11:40:56.633Z
+ card-last-score:: 5
+ - **Accountability** is one of the **data protection principles** - it makes you responsible for complying with the GDPR and says that ^^you must be able to demonstrate your compliance.^^
+ - You need to put in place appropriate technical & organisational measures to meet the requirements of accountability.
+ - Accountability requires controllers to maintain records of processing activities in order to demonstrate how they comply with the data protection principles, i.e.:
+ - Inventory of personal data
+ - Providing assurance of compliance
+ - Need to document
+ - Why it is held
+ - How it is collected
+ - When it will be deleted
+ - Who may gain access to it
+ - What is **Integrity & Confidentiality** in GDPR? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-16T15:43:04.896Z
+ card-last-reviewed:: 2022-10-19T08:43:04.897Z
+ card-last-score:: 5
+ - A key principle of GDPR is that you process personal data ^^securely by means of "appropriate technical & organisational measures"^^ - this is the "**security principle**".
+ - Doing this requires you to consider things like ^^risk analysis, organisational policies, and physical + technical measures.^^
+ - Where appropriate, you should look to use measures such as **pseudoanonymisation** and **encryption**.
+ - Your measures must ensure the ^^"confidentiality, integrity, & availability"^^ of your systems & services and the personal data you process with them.
+ - The measures must also enable you to ^^restore access & availability^^ to personal data in a timely manner in the event of a physical or technical incident.
+ - What is **Data Protection**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:38:02.257Z
+ card-last-reviewed:: 2022-10-10T11:38:02.257Z
+ card-last-score:: 3
+ - **Data Protection** is about an ^^individual's fundamental right to privacy.^^
+ - When an individual gives their personal data to any organisation, the recipient has the duty to keep the data both safe & private. This applies to both printed & electronic data.
+ - What does Data Protection Legislation do? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:07.775Z
+ card-last-reviewed:: 2022-10-03T11:42:07.775Z
+ card-last-score:: 3
+ - Data Protection Legislation:
+ - governs the way we deal with personal data / information
+ - provides a mechanism for safeguarding the privacy rights of individuals in relation to the processing of their data
+ - upholds rights and enforces obligations
+ - What is **Personal Data**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:44:35.417Z
+ card-last-reviewed:: 2022-10-03T11:44:35.417Z
+ card-last-score:: 5
+ - **Personal Data** is any information relating to an identified or ^^identifiable natural person^^ ("data subject").
+ - What is an **identifiable natural person**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:44:29.504Z
+ card-last-reviewed:: 2022-10-03T11:44:29.504Z
+ card-last-score:: 5
+ - An **identifiable natural person** is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier to one or more factors specific to the ^^physical, physiological, genetic, mental, economic, cultural, or social identity^^ of that natural person.
+ - What is **Data Processing**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-31T23:43:37.835Z
+ card-last-reviewed:: 2022-10-10T11:43:37.836Z
+ card-last-score:: 5
+ - **Data Processing** is ^^performing any operation on personal data^^, either manually or by automated means, including:
+ - Obtaining
+ - Storing
+ - Transmitting
+ - Recording
+ - Organising
+ - Altering
+ - Disclosing
+ - Erasing
+ - ### Entities in GDPR
+ - GDPR distinguishes between:
+ - The **Data Subject**
+ - The **Data Protection Officer (DPO)**
+ - The **Data Controller**
+ - The **Data Processor**
+ -
+ - What is the **Data Subject**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:03.265Z
+ card-last-reviewed:: 2022-10-03T14:28:03.266Z
+ card-last-score:: 5
+ - The **Data Subject** is the person to whom the data relates.
+ - GDPR only applies to living individuals, but any duty of confidence in place prior to the death extends beyond that point.
+ - In Ireland, the next of kin of the deceased are entitled to a Freedom of Information request to the deceased's personal data.
+ - What is the **DPO**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:39:55.084Z
+ card-last-reviewed:: 2022-10-10T11:39:55.085Z
+ card-last-score:: 3
+ - The primary role of the **Data Protection Officer (DPO)** is to ^^ensure that their organisation processes the personal data of its staff, customers, and other data subjects in compliance with the applicable data protection rules.^^
+ - The Data Protection officer is required to be an expert within this field, along with the requirement for them to report to the highest management level.
+ - With this being a challenging aspect of GDPR compliance for smaller organisations, there is the option to make an external appointment of a third-part DPO.
+ - When is the DPO a mandatory role? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:15:05.911Z
+ card-last-reviewed:: 2022-10-07T10:15:05.911Z
+ card-last-score:: 3
+ - The DPO is a mandatory role within 3 different scenarios:
+ - 1. When the processing is undertaken by a public authority or body.
+ - 2. When an organisation's main activities require the frequent & large-scale monitoring of individual people.
+ - 3. Where large-scale processing of special categories of data or data relating to criminal records forms the core activities.
+ - What is the **Data Controller**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T15:33:20.988Z
+ card-last-reviewed:: 2022-10-08T15:33:20.988Z
+ card-last-score:: 5
+ - The **Data Controller** is the company or an individual who ^^has overall control over the processing of personal data.^^
+ - The Data Controller takes on the responsibility for GDPR compliance.
+ - A Data Controller needs to have had sufficient training and to be able to competently ensure the security & protection of data held within the organisation.
+ - What is the **Data Processor**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:37:43.256Z
+ card-last-score:: 1
+ - The **Data Processor** is the person who is ^^responsible for the processing of personal information.^^
+ - Generally, this role is undertaken under the instruction of the **data controller**.
+ - This might mean obtaining or recording the data, its adaption, and use. It may also include the disclosure of the data or making it available to others.
+ - Generally, the Data Processor is involved in the more technical elements of the operation, while the interpretation & main decision-making is the role of the Data Controller.
+ -
+ - ### Cloud Services & GDPR
+ - What makes a **Cloud Service Provider** a **Data Processor**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T05:00:00.250Z
+ card-last-reviewed:: 2022-10-08T23:00:00.251Z
+ card-last-score:: 5
+ - A **Cloud Service Provider** will be considered a **Data Processor** under GDPR if it provides **data processing services** (e.g., storage) on behalf of the **Data Controller** ^^even without determining the purposes & means of processing.^^
+ - A Cloud Service Provider that offers personal data processing services directly to Data Subjects will be considered a **Data Controller**.
+ - What are some key benefits of GDPR for Data Subjects? #card
+ collapsed:: true
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:45:06.983Z
+ card-last-reviewed:: 2022-10-03T11:45:06.983Z
+ card-last-score:: 3
+ - More information must be given to data subjects (e.g., how long the data will be kept, right to lodge a complaint).
+ - The Data Controller must explain & document the legal basis for processing the personal data.
+ - GDPR tightens the rules on how consent can be obtained.
+ - Must be distinguishable from other matters and in clear, plain language.
+ - It must be as easy to withdraw consent as it is to give it.
+ - Mandatory notification of security breaches without "undue delay" to the Data Protection Commissioner (within 72 hours).
+ - What are some key rights of Data Subjects? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:42:55.024Z
+ card-last-reviewed:: 2022-10-10T11:42:55.025Z
+ card-last-score:: 3
+ - Right of Access (copy to be provided within one month)
+ - Right to Erasure (the right to be forgotten)
+ - Right to Restriction of Processing
+ - Right to Object to Processing
+ - Right not to be subject to a decision based solely upon automated processing
+ - What are **Personal Data Security Breaches**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:28:54.471Z
+ card-last-reviewed:: 2022-09-30T08:28:54.471Z
+ card-last-score:: 5
+ - **Personal Data Security Breaches** include:
+ - Disclosure of confidential data to unauthorised individuals.
+ - Loss or theft of data or equipment upon which data is stored.
+ - Hacking, viruses, or other security attacks on IT equipment / systems / networks.
+ - Inappropriate access controls allowing unauthorised use of information.
+ - Emails containing personal data sent in error to the wrong recipient.
+ - Personal Data Security Breaches apply to both paper & electronic records.
+-
+- ## HTTP Cookies
+ - What is a **(HTTP) Cookie**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:31:55.799Z
+ card-last-reviewed:: 2022-10-07T10:31:55.800Z
+ card-last-score:: 3
+ - A **(HTTP) Cookie** is a small piece of data stored on the user's computer by the web browser while browsing a website.
+ - Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items in the shopping cart in an online store) or to record the user's browsing activity.
+ - They can be also be used to remember pieces of information that the user previously entered into form fields.
+ - **Authentication Cookies** are the most common method used by web servers to know whether the user is logged in or not, and which account they are logged into.
+ -
+ - #### Cookie Implementation
+ - How are cookies implemented? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:37:51.259Z
+ card-last-score:: 1
+ - Cookies are ^^arbitrary pieces of data^^ (i.e., large, random strings), usually chosen & first sent by the web server, and stored on the client computer by the web browser.
+ - The browser then sends them back to the server with every request.
+ - Browsers are required to: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:33:35.161Z
+ card-last-score:: 1
+ - support cookies as large as 4,906 bytes in size
+ - support at least 50 cookies per domain
+ - support at least 3,000 cookies in total
+ -
+ - #### Cookie Structure
+ - What are the components of a cookie? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:57.374Z
+ card-last-score:: 1
+ - A cookie consists of the following components:
+ - Name
+ - Value
+ - Zero or more attributes (name - value pairs). These attributes store information such as the cookie's expiration, domain, and flags (such as *Secure* and *HttpOnly*)
+ -
+ - ### Session Cookies
+ - What is a **session cookie**? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:44:48.596Z
+ card-last-reviewed:: 2022-10-03T11:44:48.597Z
+ card-last-score:: 3
+ - A **session cookie** (aka in-memory cookie, transient cookie, or non-persistent cookie) is a cookie that ^^exists only in temporary memory while the user navigates its website.^^
+ - Web browsers normally delete session cookies when the user closes the browser.
+ - Session cookies do not have an expiration date assigned to them, which is how the browser know to treat them as session cookies.
+ -
+ -
+ - ### Persistent Cookies
+ - What is a **persistent cookie**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T20:29:49.936Z
+ card-last-reviewed:: 2022-10-03T14:29:49.936Z
+ card-last-score:: 5
+ - A **persistent cookie** is a cookie which ^^expires at a specific data or after a specific length of time.^^
+ - A persistent cookie's information will be transmitted to the server every time the user visits the website that the cookie belongs to, for the lifespan of the persistent cookie (as set by its creator), or every time that the user views a resource belonging to that website from another website (such as an advertisement).
+ -
+ - Persistent cookies are sometimes referred to as **tracking cookies** because they can be used by advertisers to record information about a user's web browsing habits.
+ - However, tracking cookies are mainly used for legitimate reasons, such as keeping users logged into their accounts on website to avoid re-entering login credentials at every visit.
+ -
+ - ### Cookie Attributes
+ - Consider the following response header sent by a webserver that contains 3 persistent cookies:
+ - 
+ - What do the *Domain* and *Path* attributes do? #card
+ card-last-interval:: 2.98
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T14:29:23.228Z
+ card-last-reviewed:: 2022-10-08T15:29:23.228Z
+ card-last-score:: 3
+ - The *Domain* and *Path* attributes define the cookie's scope.
+ - What does the *Secure* attribute do? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-01T19:10:41.850Z
+ card-last-reviewed:: 2022-10-04T12:10:41.851Z
+ card-last-score:: 5
+ - The *Secure* attribute ensures that the cookie can only be transmitted over an **encrypted connection**, making it a "**secure cookie**".
+ - What does the *HttpOnly* attribute do? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-10T19:21:36.210Z
+ card-last-reviewed:: 2022-10-01T13:21:36.211Z
+ card-last-score:: 3
+ - The *HttpOnly* attribute ^^directs cookies not to expose cookies through channels other than HTTP / HTTPS.^^
+ - This means that this HttpOnly cookie cannot be accessed via client-side scripting languages (notably JavaScript).
+-
+- ## GDPR & Cookies
+ - Generally, a user's consent must be sought before a cookie is installed in a web browser.
+ - There are **two** expemptions:
+ - The **Communications Exemption**
+ - The **Strictly Necessary Exemption**
+ -
+ - What is the **Communications Exemption**? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:43:32.762Z
+ card-last-reviewed:: 2022-10-10T11:43:32.763Z
+ card-last-score:: 3
+ - The **Communications Exemption** applies to cookies ^^whose sole purpose is for carrying out the transmission of a communication over a network^^, for example, to identify the communication endpoints.
+ - Cookies that meet these criteria are exempted from being required to ask for the user's consent prior to installation.
+ - **Example:** load-balancing cookies that distribute network traffic across different backend servers, also known as **session stickiness**.
+ - Here, a **load-balancer** creates an affinity between a client and a specific network server for the duration of a session using a cookie with a random & unique tracking ID.
+ - Subsequently, the load-balancer routes all the of the requests from this client to a specific backend server using the tracking ID, for the duration of the session.
+ - {:height 426, :width 529}
+ -
+ -
+ - What is the **Strictly Necessary** exemption? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:15:51.772Z
+ card-last-reviewed:: 2022-09-30T12:15:51.773Z
+ card-last-score:: 5
+ - The **Strictly Necessary** exemption exempts cookies that are strictly necessary to provide the service of delivered over the internet, i.e., a website or app from being required to ask the user's consent prior to installation.
+ - ^^This service must have been explicitly requested by the user (i.e., typing in the URL), and the use of the cookie must be restricted to what is strictly necessary to provide that service.^^
+ - Cookies related to advertising are **not** strictly necessary, and must be consented to.
+ - Examples:
+ - A website uses session cookies to keep track of items that a user places in an online shopping basket (assuming that this cookie will be deleted once the session is over).
+ - Cookies that a record a user's language or country preference.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-11-09T13_03_58.116Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-11-09T13_03_58.116Z.Desktop.md
new file mode 100644
index 00000000..5c51f8a1
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-11-09T13_03_58.116Z.Desktop.md
@@ -0,0 +1,459 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous topic:** [[Introduction to Cybersecurity]]
+- **Next Topic:** [[Introduction to Cryptography]]
+- **Relevant lecture slides:** 
+-
+- ## Motivation
+ - What are **Cyberattacks**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:25:05.425Z
+ card-last-reviewed:: 2022-10-01T13:25:05.425Z
+ card-last-score:: 5
+ - Cyberattacks are aimed at **accessing, changing, or destroying sensitive information**, extorting money, or interrupting normal business processes.
+ - Managing sensitive data may reduce the attack probability, or at least its impact.
+ - **GDPR** provides such a regulatory framework
+-
+- ## General Data Protection Regulation
+ - What is **GDPR**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-25T02:35:29.600Z
+ card-last-reviewed:: 2022-10-03T14:35:29.600Z
+ card-last-score:: 5
+ - The **General Data Protection Regulation** is a binding regulation in EU law on data protection in the European Union and the European Economic Area (EEA).
+ - The primary aim of GDPR is to ^^enhance individuals' control & rights over their personal data and to simplify the regulatory environment for international business.^^
+ - The regulation contains ^^provisions & requirements related to the processing of personal data of individuals^^ who are located in the EEA, and applies to any enterprise that is processing the personal data of individuals inside the EEA - ^^regardless of its location and the data subjects' citizenship or residence.^^
+ - ### GDPR Overview
+ - The GDPR sets out several key principles: #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-30T11:48:25.295Z
+ card-last-reviewed:: 2022-10-26T11:48:25.296Z
+ card-last-score:: 3
+ - Lawfulness
+ - Fairness & Transparency
+ - Purpose Limitation
+ - Data Minimsation
+ - Accuracy
+ - Storage Limitation
+ - Integrity & Confidentiality (Security)
+ - Accountability
+ - What is **Lawfulness** in GDPR? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:33:16.784Z
+ card-last-reviewed:: 2022-10-20T08:33:16.785Z
+ card-last-score:: 5
+ - You must identify ^^**valid grounds** under the GDPR (known as a "**lawful basis**")^^ for collecting & using personal data.
+ - Processing shall be lawful if and to the extent that at least one of the following applies:
+ - Consensual
+ - Necessary for the performance of a contract
+ - Necessary for compliance with a legal obligation
+ - Necessary to protect the vital interests of the data subject or another person
+ - Necessary for the performance of a task carried out in public interest
+ - Necessary for the purpose of legitimate interests
+ - What is **Fairness & Transparency** in GDPR? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-28T22:35:32.027Z
+ card-last-reviewed:: 2022-10-07T10:35:32.027Z
+ card-last-score:: 3
+ - You must ^^use personal data in a way that is fair.^^ This means that you must not process the data in a way that is unduly detrimental, unexpected, or misleading to the individuals concerned.
+ - You must be ^^clear, open, & honest^^ with data subjects from the start about how you will use their personal data.
+ - At the time personal data is being collected from data subjects, they must be informed via a "**Data Protection Notice**".
+ - What is a **Data Protection Notice**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-16T07:36:37.829Z
+ card-last-reviewed:: 2022-10-07T10:36:37.829Z
+ card-last-score:: 3
+ - A **Data Protection Notice** entails:
+ - The identity & contact details of the **data controller**
+ - The contact details of the **data protection officer**
+ - The **purpose of the processing** & the legal basis for the processing
+ - The recipients or categories of **recipients of the data**
+ - Details of any transfers out of the EEA, the safeguards in place, and the means by which to obtain a copy of them
+ - The **data retention** period or the criteria to determine the data retention period
+ - The **individual's rights** (access, rectification & erasure, restriction, complaint)
+ - What is **Purpose Limitation** in GDPR? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-02T15:18:23.577Z
+ card-last-reviewed:: 2022-10-07T10:18:23.578Z
+ card-last-score:: 5
+ - You must be ^^clear about what your purposes for processing^^ are from the start.
+ - You must ^^record your purposes^^ as part of your documentation obligations and specify them in your privacy information for individuals.
+ - You ^^can only use the personal data for a new purpose^^ if it is either compatible with your original purpose, you get **consent**, or you have a **clear basis in law**.
+ - What is **Data Minimisation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:35:23.953Z
+ card-last-reviewed:: 2022-10-01T17:35:23.953Z
+ card-last-score:: 5
+ - You must ensure that the personal data that you are processing is:
+ - **adequate** - sufficient to properly fulfil your stated purpose
+ - **relevant** - has a rational link to that purpose
+ - **limited** to what is necessary - you do not hold more than what you need for your stated purpose
+ - What is **Accuracy** in GDPR? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:35:02.681Z
+ card-last-reviewed:: 2022-10-20T08:35:02.682Z
+ card-last-score:: 5
+ - You should take all reasonable steps to ensure that the personal data you hold is ^^not incorrect or misleading^^ as to any matter of fact.
+ - You may need to ^^keep the personal data updated^^, although this will depend on what you are using it for.
+ - If you ^^discover that personal data is incorrect or misleading^^, you must take reasonable steps to correct or erase it as soon as possible.
+ - You must ^^carefully consider any challenges to the accuracy^^ of personal data.
+ - What is **Storage Limitation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T12:26:30.278Z
+ card-last-reviewed:: 2022-09-30T08:26:30.278Z
+ card-last-score:: 5
+ - You must not keep personal data for ^^longer than you need it^^.
+ - You need to think about - and be able to justify - ^^how long you keep personal data^^. This will depend on your purposes for holding the data.
+ - You need a policy ^^setting standard retention periods^^ wherever possible, to comply with documentation requirements.
+ - You should also ^^periodically review the data you hold^^, and erase or anonymise it when you no longer need it.
+ - You must ^^carefully consider any challenges to your retention of data^^.
+ - Individuals have a **right to erasure** if you no longer need the data.
+ - You can ^^keep personal data for longer^^ if you are only keeping it for ^^personal interest archiving, scientific or historical research, or statistical purposes.^^
+ - What is **Accountability & Governance** in GDPR? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:40:56.633Z
+ card-last-reviewed:: 2022-10-03T11:40:56.633Z
+ card-last-score:: 5
+ - **Accountability** is one of the **data protection principles** - it makes you responsible for complying with the GDPR and says that ^^you must be able to demonstrate your compliance.^^
+ - You need to put in place appropriate technical & organisational measures to meet the requirements of accountability.
+ - Accountability requires controllers to maintain records of processing activities in order to demonstrate how they comply with the data protection principles, i.e.:
+ - Inventory of personal data
+ - Providing assurance of compliance
+ - Need to document
+ - Why it is held
+ - How it is collected
+ - When it will be deleted
+ - Who may gain access to it
+ - What is **Integrity & Confidentiality** in GDPR? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-16T15:43:04.896Z
+ card-last-reviewed:: 2022-10-19T08:43:04.897Z
+ card-last-score:: 5
+ - A key principle of GDPR is that you process personal data ^^securely by means of "appropriate technical & organisational measures"^^ - this is the "**security principle**".
+ - Doing this requires you to consider things like ^^risk analysis, organisational policies, and physical + technical measures.^^
+ - Where appropriate, you should look to use measures such as **pseudoanonymisation** and **encryption**.
+ - Your measures must ensure the ^^"confidentiality, integrity, & availability"^^ of your systems & services and the personal data you process with them.
+ - The measures must also enable you to ^^restore access & availability^^ to personal data in a timely manner in the event of a physical or technical incident.
+ - What is **Data Protection**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:38:02.257Z
+ card-last-reviewed:: 2022-10-10T11:38:02.257Z
+ card-last-score:: 3
+ - **Data Protection** is about an ^^individual's fundamental right to privacy.^^
+ - When an individual gives their personal data to any organisation, the recipient has the duty to keep the data both safe & private. This applies to both printed & electronic data.
+ - What does Data Protection Legislation do? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:07.775Z
+ card-last-reviewed:: 2022-10-03T11:42:07.775Z
+ card-last-score:: 3
+ - Data Protection Legislation:
+ - governs the way we deal with personal data / information
+ - provides a mechanism for safeguarding the privacy rights of individuals in relation to the processing of their data
+ - upholds rights and enforces obligations
+ - What is **Personal Data**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:44:35.417Z
+ card-last-reviewed:: 2022-10-03T11:44:35.417Z
+ card-last-score:: 5
+ - **Personal Data** is any information relating to an identified or ^^identifiable natural person^^ ("data subject").
+ - What is an **identifiable natural person**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:44:29.504Z
+ card-last-reviewed:: 2022-10-03T11:44:29.504Z
+ card-last-score:: 5
+ - An **identifiable natural person** is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier to one or more factors specific to the ^^physical, physiological, genetic, mental, economic, cultural, or social identity^^ of that natural person.
+ - What is **Data Processing**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-31T23:43:37.835Z
+ card-last-reviewed:: 2022-10-10T11:43:37.836Z
+ card-last-score:: 5
+ - **Data Processing** is ^^performing any operation on personal data^^, either manually or by automated means, including:
+ - Obtaining
+ - Storing
+ - Transmitting
+ - Recording
+ - Organising
+ - Altering
+ - Disclosing
+ - Erasing
+ - ### Entities in GDPR
+ - GDPR distinguishes between:
+ - The **Data Subject**
+ - The **Data Protection Officer (DPO)**
+ - The **Data Controller**
+ - The **Data Processor**
+ -
+ - What is the **Data Subject**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:03.265Z
+ card-last-reviewed:: 2022-10-03T14:28:03.266Z
+ card-last-score:: 5
+ - The **Data Subject** is the person to whom the data relates.
+ - GDPR only applies to living individuals, but any duty of confidence in place prior to the death extends beyond that point.
+ - In Ireland, the next of kin of the deceased are entitled to a Freedom of Information request to the deceased's personal data.
+ - What is the **DPO**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:39:55.084Z
+ card-last-reviewed:: 2022-10-10T11:39:55.085Z
+ card-last-score:: 3
+ - The primary role of the **Data Protection Officer (DPO)** is to ^^ensure that their organisation processes the personal data of its staff, customers, and other data subjects in compliance with the applicable data protection rules.^^
+ - The Data Protection officer is required to be an expert within this field, along with the requirement for them to report to the highest management level.
+ - With this being a challenging aspect of GDPR compliance for smaller organisations, there is the option to make an external appointment of a third-part DPO.
+ - When is the DPO a mandatory role? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:15:05.911Z
+ card-last-reviewed:: 2022-10-07T10:15:05.911Z
+ card-last-score:: 3
+ - The DPO is a mandatory role within 3 different scenarios:
+ - 1. When the processing is undertaken by a public authority or body.
+ - 2. When an organisation's main activities require the frequent & large-scale monitoring of individual people.
+ - 3. Where large-scale processing of special categories of data or data relating to criminal records forms the core activities.
+ - What is the **Data Controller**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T15:33:20.988Z
+ card-last-reviewed:: 2022-10-08T15:33:20.988Z
+ card-last-score:: 5
+ - The **Data Controller** is the company or an individual who ^^has overall control over the processing of personal data.^^
+ - The Data Controller takes on the responsibility for GDPR compliance.
+ - A Data Controller needs to have had sufficient training and to be able to competently ensure the security & protection of data held within the organisation.
+ - What is the **Data Processor**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:38:22.885Z
+ card-last-score:: 1
+ - The **Data Processor** is the person who is ^^responsible for the processing of personal information.^^
+ - Generally, this role is undertaken under the instruction of the **data controller**.
+ - This might mean obtaining or recording the data, its adaption, and use. It may also include the disclosure of the data or making it available to others.
+ - Generally, the Data Processor is involved in the more technical elements of the operation, while the interpretation & main decision-making is the role of the Data Controller.
+ -
+ - ### Cloud Services & GDPR
+ - What makes a **Cloud Service Provider** a **Data Processor**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T05:00:00.250Z
+ card-last-reviewed:: 2022-10-08T23:00:00.251Z
+ card-last-score:: 5
+ - A **Cloud Service Provider** will be considered a **Data Processor** under GDPR if it provides **data processing services** (e.g., storage) on behalf of the **Data Controller** ^^even without determining the purposes & means of processing.^^
+ - A Cloud Service Provider that offers personal data processing services directly to Data Subjects will be considered a **Data Controller**.
+ - What are some key benefits of GDPR for Data Subjects? #card
+ collapsed:: true
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:45:06.983Z
+ card-last-reviewed:: 2022-10-03T11:45:06.983Z
+ card-last-score:: 3
+ - More information must be given to data subjects (e.g., how long the data will be kept, right to lodge a complaint).
+ - The Data Controller must explain & document the legal basis for processing the personal data.
+ - GDPR tightens the rules on how consent can be obtained.
+ - Must be distinguishable from other matters and in clear, plain language.
+ - It must be as easy to withdraw consent as it is to give it.
+ - Mandatory notification of security breaches without "undue delay" to the Data Protection Commissioner (within 72 hours).
+ - What are some key rights of Data Subjects? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:42:55.024Z
+ card-last-reviewed:: 2022-10-10T11:42:55.025Z
+ card-last-score:: 3
+ - Right of Access (copy to be provided within one month)
+ - Right to Erasure (the right to be forgotten)
+ - Right to Restriction of Processing
+ - Right to Object to Processing
+ - Right not to be subject to a decision based solely upon automated processing
+ - What are **Personal Data Security Breaches**? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:32:03.843Z
+ card-last-reviewed:: 2022-10-20T08:32:03.844Z
+ card-last-score:: 5
+ - **Personal Data Security Breaches** include:
+ - Disclosure of confidential data to unauthorised individuals.
+ - Loss or theft of data or equipment upon which data is stored.
+ - Hacking, viruses, or other security attacks on IT equipment / systems / networks.
+ - Inappropriate access controls allowing unauthorised use of information.
+ - Emails containing personal data sent in error to the wrong recipient.
+ - Personal Data Security Breaches apply to both paper & electronic records.
+-
+- ## HTTP Cookies
+ - What is a **(HTTP) Cookie**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:31:55.799Z
+ card-last-reviewed:: 2022-10-07T10:31:55.800Z
+ card-last-score:: 3
+ - A **(HTTP) Cookie** is a small piece of data stored on the user's computer by the web browser while browsing a website.
+ - Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items in the shopping cart in an online store) or to record the user's browsing activity.
+ - They can be also be used to remember pieces of information that the user previously entered into form fields.
+ - **Authentication Cookies** are the most common method used by web servers to know whether the user is logged in or not, and which account they are logged into.
+ -
+ - #### Cookie Implementation
+ - How are cookies implemented? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:37:51.259Z
+ card-last-score:: 1
+ - Cookies are ^^arbitrary pieces of data^^ (i.e., large, random strings), usually chosen & first sent by the web server, and stored on the client computer by the web browser.
+ - The browser then sends them back to the server with every request.
+ - Browsers are required to: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:33:35.161Z
+ card-last-score:: 1
+ - support cookies as large as 4,906 bytes in size
+ - support at least 50 cookies per domain
+ - support at least 3,000 cookies in total
+ -
+ - #### Cookie Structure
+ - What are the components of a cookie? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:57.374Z
+ card-last-score:: 1
+ - A cookie consists of the following components:
+ - Name
+ - Value
+ - Zero or more attributes (name - value pairs). These attributes store information such as the cookie's expiration, domain, and flags (such as *Secure* and *HttpOnly*)
+ -
+ - ### Session Cookies
+ - What is a **session cookie**? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:44:48.596Z
+ card-last-reviewed:: 2022-10-03T11:44:48.597Z
+ card-last-score:: 3
+ - A **session cookie** (aka in-memory cookie, transient cookie, or non-persistent cookie) is a cookie that ^^exists only in temporary memory while the user navigates its website.^^
+ - Web browsers normally delete session cookies when the user closes the browser.
+ - Session cookies do not have an expiration date assigned to them, which is how the browser know to treat them as session cookies.
+ -
+ -
+ - ### Persistent Cookies
+ - What is a **persistent cookie**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T20:29:49.936Z
+ card-last-reviewed:: 2022-10-03T14:29:49.936Z
+ card-last-score:: 5
+ - A **persistent cookie** is a cookie which ^^expires at a specific data or after a specific length of time.^^
+ - A persistent cookie's information will be transmitted to the server every time the user visits the website that the cookie belongs to, for the lifespan of the persistent cookie (as set by its creator), or every time that the user views a resource belonging to that website from another website (such as an advertisement).
+ -
+ - Persistent cookies are sometimes referred to as **tracking cookies** because they can be used by advertisers to record information about a user's web browsing habits.
+ - However, tracking cookies are mainly used for legitimate reasons, such as keeping users logged into their accounts on website to avoid re-entering login credentials at every visit.
+ -
+ - ### Cookie Attributes
+ - Consider the following response header sent by a webserver that contains 3 persistent cookies:
+ - 
+ - What do the *Domain* and *Path* attributes do? #card
+ card-last-interval:: 2.98
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T14:29:23.228Z
+ card-last-reviewed:: 2022-10-08T15:29:23.228Z
+ card-last-score:: 3
+ - The *Domain* and *Path* attributes define the cookie's scope.
+ - What does the *Secure* attribute do? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-01T19:10:41.850Z
+ card-last-reviewed:: 2022-10-04T12:10:41.851Z
+ card-last-score:: 5
+ - The *Secure* attribute ensures that the cookie can only be transmitted over an **encrypted connection**, making it a "**secure cookie**".
+ - What does the *HttpOnly* attribute do? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-12T18:37:21.841Z
+ card-last-reviewed:: 2022-10-20T08:37:21.841Z
+ card-last-score:: 5
+ - The *HttpOnly* attribute ^^directs cookies not to expose cookies through channels other than HTTP / HTTPS.^^
+ - This means that this HttpOnly cookie cannot be accessed via client-side scripting languages (notably JavaScript).
+-
+- ## GDPR & Cookies
+ - Generally, a user's consent must be sought before a cookie is installed in a web browser.
+ - There are **two** expemptions:
+ - The **Communications Exemption**
+ - The **Strictly Necessary Exemption**
+ -
+ - What is the **Communications Exemption**? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:43:32.762Z
+ card-last-reviewed:: 2022-10-10T11:43:32.763Z
+ card-last-score:: 3
+ - The **Communications Exemption** applies to cookies ^^whose sole purpose is for carrying out the transmission of a communication over a network^^, for example, to identify the communication endpoints.
+ - Cookies that meet these criteria are exempted from being required to ask for the user's consent prior to installation.
+ - **Example:** load-balancing cookies that distribute network traffic across different backend servers, also known as **session stickiness**.
+ - Here, a **load-balancer** creates an affinity between a client and a specific network server for the duration of a session using a cookie with a random & unique tracking ID.
+ - Subsequently, the load-balancer routes all the of the requests from this client to a specific backend server using the tracking ID, for the duration of the session.
+ - {:height 426, :width 529}
+ -
+ -
+ - What is the **Strictly Necessary** exemption? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:34:39.740Z
+ card-last-reviewed:: 2022-10-20T08:34:39.740Z
+ card-last-score:: 5
+ - The **Strictly Necessary** exemption exempts cookies that are strictly necessary to provide the service of delivered over the internet, i.e., a website or app from being required to ask the user's consent prior to installation.
+ - ^^This service must have been explicitly requested by the user (i.e., typing in the URL), and the use of the cookie must be restricted to what is strictly necessary to provide that service.^^
+ - Cookies related to advertising are **not** strictly necessary, and must be consented to.
+ - Examples:
+ - A website uses session cookies to keep track of items that a user places in an online shopping basket (assuming that this cookie will be deleted once the session is over).
+ - Cookies that a record a user's language or country preference.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-11-11T12_04_45.335Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-11-11T12_04_45.335Z.Desktop.md
new file mode 100644
index 00000000..ce25aa0b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/GDPR/2022-11-11T12_04_45.335Z.Desktop.md
@@ -0,0 +1,459 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous topic:** [[Introduction to Cybersecurity]]
+- **Next Topic:** [[Introduction to Cryptography]]
+- **Relevant lecture slides:** 
+-
+- ## Motivation
+ - What are **Cyberattacks**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:25:05.425Z
+ card-last-reviewed:: 2022-10-01T13:25:05.425Z
+ card-last-score:: 5
+ - Cyberattacks are aimed at **accessing, changing, or destroying sensitive information**, extorting money, or interrupting normal business processes.
+ - Managing sensitive data may reduce the attack probability, or at least its impact.
+ - **GDPR** provides such a regulatory framework
+-
+- ## General Data Protection Regulation
+ - What is **GDPR**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-25T02:35:29.600Z
+ card-last-reviewed:: 2022-10-03T14:35:29.600Z
+ card-last-score:: 5
+ - The **General Data Protection Regulation** is a binding regulation in EU law on data protection in the European Union and the European Economic Area (EEA).
+ - The primary aim of GDPR is to ^^enhance individuals' control & rights over their personal data and to simplify the regulatory environment for international business.^^
+ - The regulation contains ^^provisions & requirements related to the processing of personal data of individuals^^ who are located in the EEA, and applies to any enterprise that is processing the personal data of individuals inside the EEA - ^^regardless of its location and the data subjects' citizenship or residence.^^
+ - ### GDPR Overview
+ - The GDPR sets out several key principles: #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-30T11:48:25.295Z
+ card-last-reviewed:: 2022-10-26T11:48:25.296Z
+ card-last-score:: 3
+ - Lawfulness
+ - Fairness & Transparency
+ - Purpose Limitation
+ - Data Minimsation
+ - Accuracy
+ - Storage Limitation
+ - Integrity & Confidentiality (Security)
+ - Accountability
+ - What is **Lawfulness** in GDPR? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:33:16.784Z
+ card-last-reviewed:: 2022-10-20T08:33:16.785Z
+ card-last-score:: 5
+ - You must identify ^^**valid grounds** under the GDPR (known as a "**lawful basis**")^^ for collecting & using personal data.
+ - Processing shall be lawful if and to the extent that at least one of the following applies:
+ - Consensual
+ - Necessary for the performance of a contract
+ - Necessary for compliance with a legal obligation
+ - Necessary to protect the vital interests of the data subject or another person
+ - Necessary for the performance of a task carried out in public interest
+ - Necessary for the purpose of legitimate interests
+ - What is **Fairness & Transparency** in GDPR? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-28T22:35:32.027Z
+ card-last-reviewed:: 2022-10-07T10:35:32.027Z
+ card-last-score:: 3
+ - You must ^^use personal data in a way that is fair.^^ This means that you must not process the data in a way that is unduly detrimental, unexpected, or misleading to the individuals concerned.
+ - You must be ^^clear, open, & honest^^ with data subjects from the start about how you will use their personal data.
+ - At the time personal data is being collected from data subjects, they must be informed via a "**Data Protection Notice**".
+ - What is a **Data Protection Notice**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-16T07:36:37.829Z
+ card-last-reviewed:: 2022-10-07T10:36:37.829Z
+ card-last-score:: 3
+ - A **Data Protection Notice** entails:
+ - The identity & contact details of the **data controller**
+ - The contact details of the **data protection officer**
+ - The **purpose of the processing** & the legal basis for the processing
+ - The recipients or categories of **recipients of the data**
+ - Details of any transfers out of the EEA, the safeguards in place, and the means by which to obtain a copy of them
+ - The **data retention** period or the criteria to determine the data retention period
+ - The **individual's rights** (access, rectification & erasure, restriction, complaint)
+ - What is **Purpose Limitation** in GDPR? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-02T15:18:23.577Z
+ card-last-reviewed:: 2022-10-07T10:18:23.578Z
+ card-last-score:: 5
+ - You must be ^^clear about what your purposes for processing^^ are from the start.
+ - You must ^^record your purposes^^ as part of your documentation obligations and specify them in your privacy information for individuals.
+ - You ^^can only use the personal data for a new purpose^^ if it is either compatible with your original purpose, you get **consent**, or you have a **clear basis in law**.
+ - What is **Data Minimisation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:35:23.953Z
+ card-last-reviewed:: 2022-10-01T17:35:23.953Z
+ card-last-score:: 5
+ - You must ensure that the personal data that you are processing is:
+ - **adequate** - sufficient to properly fulfil your stated purpose
+ - **relevant** - has a rational link to that purpose
+ - **limited** to what is necessary - you do not hold more than what you need for your stated purpose
+ - What is **Accuracy** in GDPR? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:35:02.681Z
+ card-last-reviewed:: 2022-10-20T08:35:02.682Z
+ card-last-score:: 5
+ - You should take all reasonable steps to ensure that the personal data you hold is ^^not incorrect or misleading^^ as to any matter of fact.
+ - You may need to ^^keep the personal data updated^^, although this will depend on what you are using it for.
+ - If you ^^discover that personal data is incorrect or misleading^^, you must take reasonable steps to correct or erase it as soon as possible.
+ - You must ^^carefully consider any challenges to the accuracy^^ of personal data.
+ - What is **Storage Limitation** in GDPR? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T12:26:30.278Z
+ card-last-reviewed:: 2022-09-30T08:26:30.278Z
+ card-last-score:: 5
+ - You must not keep personal data for ^^longer than you need it^^.
+ - You need to think about - and be able to justify - ^^how long you keep personal data^^. This will depend on your purposes for holding the data.
+ - You need a policy ^^setting standard retention periods^^ wherever possible, to comply with documentation requirements.
+ - You should also ^^periodically review the data you hold^^, and erase or anonymise it when you no longer need it.
+ - You must ^^carefully consider any challenges to your retention of data^^.
+ - Individuals have a **right to erasure** if you no longer need the data.
+ - You can ^^keep personal data for longer^^ if you are only keeping it for ^^personal interest archiving, scientific or historical research, or statistical purposes.^^
+ - What is **Accountability & Governance** in GDPR? #card
+ card-last-interval:: 10.56
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-14T00:40:56.633Z
+ card-last-reviewed:: 2022-10-03T11:40:56.633Z
+ card-last-score:: 5
+ - **Accountability** is one of the **data protection principles** - it makes you responsible for complying with the GDPR and says that ^^you must be able to demonstrate your compliance.^^
+ - You need to put in place appropriate technical & organisational measures to meet the requirements of accountability.
+ - Accountability requires controllers to maintain records of processing activities in order to demonstrate how they comply with the data protection principles, i.e.:
+ - Inventory of personal data
+ - Providing assurance of compliance
+ - Need to document
+ - Why it is held
+ - How it is collected
+ - When it will be deleted
+ - Who may gain access to it
+ - What is **Integrity & Confidentiality** in GDPR? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-16T15:43:04.896Z
+ card-last-reviewed:: 2022-10-19T08:43:04.897Z
+ card-last-score:: 5
+ - A key principle of GDPR is that you process personal data ^^securely by means of "appropriate technical & organisational measures"^^ - this is the "**security principle**".
+ - Doing this requires you to consider things like ^^risk analysis, organisational policies, and physical + technical measures.^^
+ - Where appropriate, you should look to use measures such as **pseudoanonymisation** and **encryption**.
+ - Your measures must ensure the ^^"confidentiality, integrity, & availability"^^ of your systems & services and the personal data you process with them.
+ - The measures must also enable you to ^^restore access & availability^^ to personal data in a timely manner in the event of a physical or technical incident.
+ - What is **Data Protection**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:38:02.257Z
+ card-last-reviewed:: 2022-10-10T11:38:02.257Z
+ card-last-score:: 3
+ - **Data Protection** is about an ^^individual's fundamental right to privacy.^^
+ - When an individual gives their personal data to any organisation, the recipient has the duty to keep the data both safe & private. This applies to both printed & electronic data.
+ - What does Data Protection Legislation do? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:07.775Z
+ card-last-reviewed:: 2022-10-03T11:42:07.775Z
+ card-last-score:: 3
+ - Data Protection Legislation:
+ - governs the way we deal with personal data / information
+ - provides a mechanism for safeguarding the privacy rights of individuals in relation to the processing of their data
+ - upholds rights and enforces obligations
+ - What is **Personal Data**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:44:35.417Z
+ card-last-reviewed:: 2022-10-03T11:44:35.417Z
+ card-last-score:: 5
+ - **Personal Data** is any information relating to an identified or ^^identifiable natural person^^ ("data subject").
+ - What is an **identifiable natural person**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:44:29.504Z
+ card-last-reviewed:: 2022-10-03T11:44:29.504Z
+ card-last-score:: 5
+ - An **identifiable natural person** is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier to one or more factors specific to the ^^physical, physiological, genetic, mental, economic, cultural, or social identity^^ of that natural person.
+ - What is **Data Processing**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-31T23:43:37.835Z
+ card-last-reviewed:: 2022-10-10T11:43:37.836Z
+ card-last-score:: 5
+ - **Data Processing** is ^^performing any operation on personal data^^, either manually or by automated means, including:
+ - Obtaining
+ - Storing
+ - Transmitting
+ - Recording
+ - Organising
+ - Altering
+ - Disclosing
+ - Erasing
+ - ### Entities in GDPR
+ - GDPR distinguishes between:
+ - The **Data Subject**
+ - The **Data Protection Officer (DPO)**
+ - The **Data Controller**
+ - The **Data Processor**
+ -
+ - What is the **Data Subject**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:03.265Z
+ card-last-reviewed:: 2022-10-03T14:28:03.266Z
+ card-last-score:: 5
+ - The **Data Subject** is the person to whom the data relates.
+ - GDPR only applies to living individuals, but any duty of confidence in place prior to the death extends beyond that point.
+ - In Ireland, the next of kin of the deceased are entitled to a Freedom of Information request to the deceased's personal data.
+ - What is the **DPO**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:39:55.084Z
+ card-last-reviewed:: 2022-10-10T11:39:55.085Z
+ card-last-score:: 3
+ - The primary role of the **Data Protection Officer (DPO)** is to ^^ensure that their organisation processes the personal data of its staff, customers, and other data subjects in compliance with the applicable data protection rules.^^
+ - The Data Protection officer is required to be an expert within this field, along with the requirement for them to report to the highest management level.
+ - With this being a challenging aspect of GDPR compliance for smaller organisations, there is the option to make an external appointment of a third-part DPO.
+ - When is the DPO a mandatory role? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:15:05.911Z
+ card-last-reviewed:: 2022-10-07T10:15:05.911Z
+ card-last-score:: 3
+ - The DPO is a mandatory role within 3 different scenarios:
+ - 1. When the processing is undertaken by a public authority or body.
+ - 2. When an organisation's main activities require the frequent & large-scale monitoring of individual people.
+ - 3. Where large-scale processing of special categories of data or data relating to criminal records forms the core activities.
+ - What is the **Data Controller**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T15:33:20.988Z
+ card-last-reviewed:: 2022-10-08T15:33:20.988Z
+ card-last-score:: 5
+ - The **Data Controller** is the company or an individual who ^^has overall control over the processing of personal data.^^
+ - The Data Controller takes on the responsibility for GDPR compliance.
+ - A Data Controller needs to have had sufficient training and to be able to competently ensure the security & protection of data held within the organisation.
+ - What is the **Data Processor**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:38:22.885Z
+ card-last-score:: 1
+ - The **Data Processor** is the person who is ^^responsible for the processing of personal information.^^
+ - Generally, this role is undertaken under the instruction of the **data controller**.
+ - This might mean obtaining or recording the data, its adaption, and use. It may also include the disclosure of the data or making it available to others.
+ - Generally, the Data Processor is involved in the more technical elements of the operation, while the interpretation & main decision-making is the role of the Data Controller.
+ -
+ - ### Cloud Services & GDPR
+ - What makes a **Cloud Service Provider** a **Data Processor**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T05:00:00.250Z
+ card-last-reviewed:: 2022-10-08T23:00:00.251Z
+ card-last-score:: 5
+ - A **Cloud Service Provider** will be considered a **Data Processor** under GDPR if it provides **data processing services** (e.g., storage) on behalf of the **Data Controller** ^^even without determining the purposes & means of processing.^^
+ - A Cloud Service Provider that offers personal data processing services directly to Data Subjects will be considered a **Data Controller**.
+ - What are some key benefits of GDPR for Data Subjects? #card
+ collapsed:: true
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:45:06.983Z
+ card-last-reviewed:: 2022-10-03T11:45:06.983Z
+ card-last-score:: 3
+ - More information must be given to data subjects (e.g., how long the data will be kept, right to lodge a complaint).
+ - The Data Controller must explain & document the legal basis for processing the personal data.
+ - GDPR tightens the rules on how consent can be obtained.
+ - Must be distinguishable from other matters and in clear, plain language.
+ - It must be as easy to withdraw consent as it is to give it.
+ - Mandatory notification of security breaches without "undue delay" to the Data Protection Commissioner (within 72 hours).
+ - What are some key rights of Data Subjects? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:42:55.024Z
+ card-last-reviewed:: 2022-10-10T11:42:55.025Z
+ card-last-score:: 3
+ - Right of Access (copy to be provided within one month)
+ - Right to Erasure (the right to be forgotten)
+ - Right to Restriction of Processing
+ - Right to Object to Processing
+ - Right not to be subject to a decision based solely upon automated processing
+ - What are **Personal Data Security Breaches**? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:32:03.843Z
+ card-last-reviewed:: 2022-10-20T08:32:03.844Z
+ card-last-score:: 5
+ - **Personal Data Security Breaches** include:
+ - Disclosure of confidential data to unauthorised individuals.
+ - Loss or theft of data or equipment upon which data is stored.
+ - Hacking, viruses, or other security attacks on IT equipment / systems / networks.
+ - Inappropriate access controls allowing unauthorised use of information.
+ - Emails containing personal data sent in error to the wrong recipient.
+ - Personal Data Security Breaches apply to both paper & electronic records.
+-
+- ## HTTP Cookies
+ - What is a **(HTTP) Cookie**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:31:55.799Z
+ card-last-reviewed:: 2022-10-07T10:31:55.800Z
+ card-last-score:: 3
+ - A **(HTTP) Cookie** is a small piece of data stored on the user's computer by the web browser while browsing a website.
+ - Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items in the shopping cart in an online store) or to record the user's browsing activity.
+ - They can be also be used to remember pieces of information that the user previously entered into form fields.
+ - **Authentication Cookies** are the most common method used by web servers to know whether the user is logged in or not, and which account they are logged into.
+ -
+ - #### Cookie Implementation
+ - How are cookies implemented? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:37:51.259Z
+ card-last-score:: 1
+ - Cookies are ^^arbitrary pieces of data^^ (i.e., large, random strings), usually chosen & first sent by the web server, and stored on the client computer by the web browser.
+ - The browser then sends them back to the server with every request.
+ - Browsers are required to: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:33:35.161Z
+ card-last-score:: 1
+ - support cookies as large as 4,906 bytes in size
+ - support at least 50 cookies per domain
+ - support at least 3,000 cookies in total
+ -
+ - #### Cookie Structure
+ - What are the components of a cookie? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:57.374Z
+ card-last-score:: 1
+ - A cookie consists of the following components:
+ - Name
+ - Value
+ - Zero or more attributes (name - value pairs). These attributes store information such as the cookie's expiration, domain, and flags (such as *Secure* and *HttpOnly*)
+ -
+ - ### Session Cookies
+ - What is a **session cookie**? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:44:48.596Z
+ card-last-reviewed:: 2022-10-03T11:44:48.597Z
+ card-last-score:: 3
+ - A **session cookie** (aka in-memory cookie, transient cookie, or non-persistent cookie) is a cookie that ^^exists only in temporary memory while the user navigates its website.^^
+ - Web browsers normally delete session cookies when the user closes the browser.
+ - Session cookies do not have an expiration date assigned to them, which is how the browser know to treat them as session cookies.
+ -
+ -
+ - ### Persistent Cookies
+ - What is a **persistent cookie**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T20:29:49.936Z
+ card-last-reviewed:: 2022-10-03T14:29:49.936Z
+ card-last-score:: 5
+ - A **persistent cookie** is a cookie which ^^expires at a specific data or after a specific length of time.^^
+ - A persistent cookie's information will be transmitted to the server every time the user visits the website that the cookie belongs to, for the lifespan of the persistent cookie (as set by its creator), or every time that the user views a resource belonging to that website from another website (such as an advertisement).
+ -
+ - Persistent cookies are sometimes referred to as **tracking cookies** because they can be used by advertisers to record information about a user's web browsing habits.
+ - However, tracking cookies are mainly used for legitimate reasons, such as keeping users logged into their accounts on website to avoid re-entering login credentials at every visit.
+ -
+ - ### Cookie Attributes
+ - Consider the following response header sent by a webserver that contains 3 persistent cookies:
+ - 
+ - What do the *Domain* and *Path* attributes do? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-11-18T18:45:59.521Z
+ card-last-reviewed:: 2022-11-09T12:45:59.521Z
+ card-last-score:: 3
+ - The *Domain* and *Path* attributes define the cookie's scope.
+ - What does the *Secure* attribute do? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-01T19:10:41.850Z
+ card-last-reviewed:: 2022-10-04T12:10:41.851Z
+ card-last-score:: 5
+ - The *Secure* attribute ensures that the cookie can only be transmitted over an **encrypted connection**, making it a "**secure cookie**".
+ - What does the *HttpOnly* attribute do? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-12T18:37:21.841Z
+ card-last-reviewed:: 2022-10-20T08:37:21.841Z
+ card-last-score:: 5
+ - The *HttpOnly* attribute ^^directs cookies not to expose cookies through channels other than HTTP / HTTPS.^^
+ - This means that this HttpOnly cookie cannot be accessed via client-side scripting languages (notably JavaScript).
+-
+- ## GDPR & Cookies
+ - Generally, a user's consent must be sought before a cookie is installed in a web browser.
+ - There are **two** expemptions:
+ - The **Communications Exemption**
+ - The **Strictly Necessary Exemption**
+ -
+ - What is the **Communications Exemption**? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:43:32.762Z
+ card-last-reviewed:: 2022-10-10T11:43:32.763Z
+ card-last-score:: 3
+ - The **Communications Exemption** applies to cookies ^^whose sole purpose is for carrying out the transmission of a communication over a network^^, for example, to identify the communication endpoints.
+ - Cookies that meet these criteria are exempted from being required to ask for the user's consent prior to installation.
+ - **Example:** load-balancing cookies that distribute network traffic across different backend servers, also known as **session stickiness**.
+ - Here, a **load-balancer** creates an affinity between a client and a specific network server for the duration of a session using a cookie with a random & unique tracking ID.
+ - Subsequently, the load-balancer routes all the of the requests from this client to a specific backend server using the tracking ID, for the duration of the session.
+ - {:height 426, :width 529}
+ -
+ -
+ - What is the **Strictly Necessary** exemption? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:34:39.740Z
+ card-last-reviewed:: 2022-10-20T08:34:39.740Z
+ card-last-score:: 5
+ - The **Strictly Necessary** exemption exempts cookies that are strictly necessary to provide the service of delivered over the internet, i.e., a website or app from being required to ask the user's consent prior to installation.
+ - ^^This service must have been explicitly requested by the user (i.e., typing in the URL), and the use of the cookie must be restricted to what is strictly necessary to provide that service.^^
+ - Cookies related to advertising are **not** strictly necessary, and must be consented to.
+ - Examples:
+ - A website uses session cookies to keep track of items that a user places in an online shopping basket (assuming that this cookie will be deleted once the session is over).
+ - Cookies that a record a user's language or country preference.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-10-07T08_33_33.322Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-10-07T08_33_33.322Z.Desktop.md
new file mode 100644
index 00000000..3402e99c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-10-07T08_33_33.322Z.Desktop.md
@@ -0,0 +1,87 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[Introduction to Cryptography]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- What is a **password**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-07T14:27:05.787Z
+ card-last-reviewed:: 2022-10-03T14:27:05.787Z
+ card-last-score:: 5
+ - A **password** is a memorised secret used to confirm the identity of a user.
+ - Typically, an arbitrary string of characters including letters, digits, or other symbols.
+ - A purely numeric secret is called a **Personal Identification Number (PIN)**.
+ - The secret is memorised by a party called the **claimant** while the party verifying the identity of the claimant is called the **verifier**.
+ - The claimant & the verifier communicate via an **authentication protocol**.
+- # Some Password Alternatives
+ - One-Time Password (OTP).
+ - Transaction Authentication Number (TAN) list used for online banking - they can only be used once.
+ - Time-synchronised one-time passwords.
+ - Biometric methods.
+ - Fingerprints, irises, voice, face.
+ - Cognitive passwords.
+ - Use question & answer cue/response pairs to verify identity.
+-
+- # Algorithmic Generation of OTP
+ - Paper-based TANs are hard to manage -> both the claimant and the verifier need to have a copy of every OTP (possibly hundreds of them).
+ - Idea: each OTP may be created from the passt OTPs used.
+ - An example of this type of algorithm, credited to Leslie Lamport, uses a **one-way function** (hash function).
+ - ## One-Way Functions
+ - What is a **hash function**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T14:27:00.494Z
+ card-last-score:: 1
+ - A **one-way function** $H$ produces a fixed-size output $h$ based on a variable size input $s$.
+ - $$H(s) = h$$
+ - $H$ is also called a **hash function**, $h$ is called a **hash** (value).
+ - Important: *one-way property*:
+ - For a given hash code $h$, it is infeasible to find $s$ that $H(s) = h$.
+ - ### Leslie Lamport's Algorithm #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T14:26:52.424Z
+ card-last-score:: 1
+ - For every claimant, a random seed (starting value) $s$ is chosen.
+ - A hash function $H(s)$ is applied repeatedly (e.g., 1,000 times) to the seed, giving a value of:
+ - $$H(H(H(...(H(s)....))))$$
+ - The user's first login uses an OTP $p$ derived by applying $H$ 999 times to the seed, i.e., $H^{999}(s)$.
+ - The verifier can authenticate that this is the correct OTP, because $H(p) = H^{1000}(s)$, the value stored.
+ - The value stored is then replaced by $p$ and the user is allowed to log in.
+ - The next login must be accompanied by $H^{998}(s)$.
+ - Again, this can be validated because hashing gives $H^{999}(s)$ which is $p$, the value stored after the previous login.
+ - The new value replaces $p$ and the user is authenticated.
+ - This process can be repeated another 997 times, each time the password will be $H$ applied one fewer times.
+ - ### Time-Synchronised OTP #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T14:26:07.581Z
+ card-last-score:: 1
+ - Each user has a unique piece of hardware called a **security token** that generates an OTP (e.g., mobile phone).
+ - Inside the token is an accurate clock that has been synchronised with the clock of the verifer.
+ - Both claimant token and verifier server calculate identical OTPs that are based on time.
+ - 
+-
+- # Some New Biometric Methods
+ - **Hand geometry:** Measurement & comparison of the (unique) different physical characteristics of the hand.
+ - **Palm vein authentication:** Uses an infrared beam to penetrate the user's hand as it is waved over the system; the veins within the palm are returned as black lines.
+ - **Retina scan:** Provides an analysis of the capillary blood vessels located in the back of the eye.
+ - **Iris scan:** Provides an analysis of the rings, furrows, & freckles in the coloured ring that surrounds the pupil of the eye.
+ - Face recognition, signature, & voice analysis.
+ - **Behavioural biometrics:**
+ - 
+-
+- # Multi-Factor Authentication
+ - This may include a combination of the following:
+ - Some physical object in the possession of the user, e.g., a USB stick with a secret token, a bank card, a key, etc.
+ - Some secret known only to the user, such as a password, PIN, TAN, etc.
+ - Some physical characteristic of the user (biometrics), such as a fingerprint, eye iris, voice, typing speed, pattern in key press intervals, etc.
+ - Somewhere you are, such as connection to a specific computing network or utilising a GPS signal to identify the location.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-10-07T18_07_00.016Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-10-07T18_07_00.016Z.Desktop.md
new file mode 100644
index 00000000..eef9a8b5
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-10-07T18_07_00.016Z.Desktop.md
@@ -0,0 +1,87 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[Introduction to Cryptography]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- What is a **password**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-07T14:27:05.787Z
+ card-last-reviewed:: 2022-10-03T14:27:05.787Z
+ card-last-score:: 5
+ - A **password** is a memorised secret used to confirm the identity of a user.
+ - Typically, an arbitrary string of characters including letters, digits, or other symbols.
+ - A purely numeric secret is called a **Personal Identification Number (PIN)**.
+ - The secret is memorised by a party called the **claimant** while the party verifying the identity of the claimant is called the **verifier**.
+ - The claimant & the verifier communicate via an **authentication protocol**.
+- # Some Password Alternatives
+ - One-Time Password (OTP).
+ - Transaction Authentication Number (TAN) list used for online banking - they can only be used once.
+ - Time-synchronised one-time passwords.
+ - Biometric methods.
+ - Fingerprints, irises, voice, face.
+ - Cognitive passwords.
+ - Use question & answer cue/response pairs to verify identity.
+-
+- # Algorithmic Generation of OTP
+ - Paper-based TANs are hard to manage -> both the claimant and the verifier need to have a copy of every OTP (possibly hundreds of them).
+ - Idea: each OTP may be created from the passt OTPs used.
+ - An example of this type of algorithm, credited to Leslie Lamport, uses a **one-way function** (hash function).
+ - ## One-Way Functions
+ - What is a **hash function**? #card
+ card-last-interval:: 1.47
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-08T21:37:51.695Z
+ card-last-reviewed:: 2022-10-07T10:37:51.696Z
+ card-last-score:: 3
+ - A **one-way function** $H$ produces a fixed-size output $h$ based on a variable size input $s$.
+ - $$H(s) = h$$
+ - $H$ is also called a **hash function**, $h$ is called a **hash** (value).
+ - Important: *one-way property*:
+ - For a given hash code $h$, it is infeasible to find $s$ that $H(s) = h$.
+ - ### Leslie Lamport's Algorithm #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-reviewed:: 2022-10-07T10:48:57.261Z
+ card-last-score:: 1
+ - For every claimant, a random seed (starting value) $s$ is chosen.
+ - A hash function $H(s)$ is applied repeatedly (e.g., 1,000 times) to the seed, giving a value of:
+ - $$H(H(H(...(H(s)....))))$$
+ - The user's first login uses an OTP $p$ derived by applying $H$ 999 times to the seed, i.e., $H^{999}(s)$.
+ - The verifier can authenticate that this is the correct OTP, because $H(p) = H^{1000}(s)$, the value stored.
+ - The value stored is then replaced by $p$ and the user is allowed to log in.
+ - The next login must be accompanied by $H^{998}(s)$.
+ - Again, this can be validated because hashing gives $H^{999}(s)$ which is $p$, the value stored after the previous login.
+ - The new value replaces $p$ and the user is authenticated.
+ - This process can be repeated another 997 times, each time the password will be $H$ applied one fewer times.
+ - ### Time-Synchronised OTP #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-reviewed:: 2022-10-07T10:17:02.675Z
+ card-last-score:: 1
+ - Each user has a unique piece of hardware called a **security token** that generates an OTP (e.g., mobile phone).
+ - Inside the token is an accurate clock that has been synchronised with the clock of the verifer.
+ - Both claimant token and verifier server calculate identical OTPs that are based on time.
+ - 
+-
+- # Some New Biometric Methods
+ - **Hand geometry:** Measurement & comparison of the (unique) different physical characteristics of the hand.
+ - **Palm vein authentication:** Uses an infrared beam to penetrate the user's hand as it is waved over the system; the veins within the palm are returned as black lines.
+ - **Retina scan:** Provides an analysis of the capillary blood vessels located in the back of the eye.
+ - **Iris scan:** Provides an analysis of the rings, furrows, & freckles in the coloured ring that surrounds the pupil of the eye.
+ - Face recognition, signature, & voice analysis.
+ - **Behavioural biometrics:**
+ - 
+-
+- # Multi-Factor Authentication
+ - This may include a combination of the following:
+ - Some physical object in the possession of the user, e.g., a USB stick with a secret token, a bank card, a key, etc.
+ - Some secret known only to the user, such as a password, PIN, TAN, etc.
+ - Some physical characteristic of the user (biometrics), such as a fingerprint, eye iris, voice, typing speed, pattern in key press intervals, etc.
+ - Somewhere you are, such as connection to a specific computing network or utilising a GPS signal to identify the location.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-10-10T11_59_52.405Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-10-10T11_59_52.405Z.Desktop.md
new file mode 100644
index 00000000..f0b4c4db
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-10-10T11_59_52.405Z.Desktop.md
@@ -0,0 +1,87 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[Introduction to Cryptography]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- What is a **password**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T01:20:19.049Z
+ card-last-reviewed:: 2022-10-07T15:20:19.050Z
+ card-last-score:: 3
+ - A **password** is a memorised secret used to confirm the identity of a user.
+ - Typically, an arbitrary string of characters including letters, digits, or other symbols.
+ - A purely numeric secret is called a **Personal Identification Number (PIN)**.
+ - The secret is memorised by a party called the **claimant** while the party verifying the identity of the claimant is called the **verifier**.
+ - The claimant & the verifier communicate via an **authentication protocol**.
+- # Some Password Alternatives
+ - One-Time Password (OTP).
+ - Transaction Authentication Number (TAN) list used for online banking - they can only be used once.
+ - Time-synchronised one-time passwords.
+ - Biometric methods.
+ - Fingerprints, irises, voice, face.
+ - Cognitive passwords.
+ - Use question & answer cue/response pairs to verify identity.
+-
+- # Algorithmic Generation of OTP
+ - Paper-based TANs are hard to manage -> both the claimant and the verifier need to have a copy of every OTP (possibly hundreds of them).
+ - Idea: each OTP may be created from the passt OTPs used.
+ - An example of this type of algorithm, credited to Leslie Lamport, uses a **one-way function** (hash function).
+ - ## One-Way Functions
+ - What is a **hash function**? #card
+ card-last-interval:: 8.35
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-17T16:51:58.310Z
+ card-last-reviewed:: 2022-10-09T08:51:58.310Z
+ card-last-score:: 5
+ - A **one-way function** $H$ produces a fixed-size output $h$ based on a variable size input $s$.
+ - $$H(s) = h$$
+ - $H$ is also called a **hash function**, $h$ is called a **hash** (value).
+ - Important: *one-way property*:
+ - For a given hash code $h$, it is infeasible to find $s$ that $H(s) = h$.
+ - ### Leslie Lamport's Algorithm #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:02:53.292Z
+ card-last-score:: 1
+ - For every claimant, a random seed (starting value) $s$ is chosen.
+ - A hash function $H(s)$ is applied repeatedly (e.g., 1,000 times) to the seed, giving a value of:
+ - $$H(H(H(...(H(s)....))))$$
+ - The user's first login uses an OTP $p$ derived by applying $H$ 999 times to the seed, i.e., $H^{999}(s)$.
+ - The verifier can authenticate that this is the correct OTP, because $H(p) = H^{1000}(s)$, the value stored.
+ - The value stored is then replaced by $p$ and the user is allowed to log in.
+ - The next login must be accompanied by $H^{998}(s)$.
+ - Again, this can be validated because hashing gives $H^{999}(s)$ which is $p$, the value stored after the previous login.
+ - The new value replaces $p$ and the user is authenticated.
+ - This process can be repeated another 997 times, each time the password will be $H$ applied one fewer times.
+ - ### Time-Synchronised OTP #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:19:40.334Z
+ card-last-score:: 1
+ - Each user has a unique piece of hardware called a **security token** that generates an OTP (e.g., mobile phone).
+ - Inside the token is an accurate clock that has been synchronised with the clock of the verifer.
+ - Both claimant token and verifier server calculate identical OTPs that are based on time.
+ - 
+-
+- # Some New Biometric Methods
+ - **Hand geometry:** Measurement & comparison of the (unique) different physical characteristics of the hand.
+ - **Palm vein authentication:** Uses an infrared beam to penetrate the user's hand as it is waved over the system; the veins within the palm are returned as black lines.
+ - **Retina scan:** Provides an analysis of the capillary blood vessels located in the back of the eye.
+ - **Iris scan:** Provides an analysis of the rings, furrows, & freckles in the coloured ring that surrounds the pupil of the eye.
+ - Face recognition, signature, & voice analysis.
+ - **Behavioural biometrics:**
+ - 
+-
+- # Multi-Factor Authentication
+ - This may include a combination of the following:
+ - Some physical object in the possession of the user, e.g., a USB stick with a secret token, a bank card, a key, etc.
+ - Some secret known only to the user, such as a password, PIN, TAN, etc.
+ - Some physical characteristic of the user (biometrics), such as a fingerprint, eye iris, voice, typing speed, pattern in key press intervals, etc.
+ - Somewhere you are, such as connection to a specific computing network or utilising a GPS signal to identify the location.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-11-11T12_04_45.342Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-11-11T12_04_45.342Z.Desktop.md
new file mode 100644
index 00000000..bb4e38e2
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Human Security & Passwords/2022-11-11T12_04_45.342Z.Desktop.md
@@ -0,0 +1,87 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[Introduction to Cryptography]]
+- **Next Topic:** [[Hash Cracking Using Rainbow Tables]]
+- **Relevant Slides:** 
+-
+- What is a **password**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T01:20:19.049Z
+ card-last-reviewed:: 2022-10-07T15:20:19.050Z
+ card-last-score:: 3
+ - A **password** is a memorised secret used to confirm the identity of a user.
+ - Typically, an arbitrary string of characters including letters, digits, or other symbols.
+ - A purely numeric secret is called a **Personal Identification Number (PIN)**.
+ - The secret is memorised by a party called the **claimant** while the party verifying the identity of the claimant is called the **verifier**.
+ - The claimant & the verifier communicate via an **authentication protocol**.
+- # Some Password Alternatives
+ - One-Time Password (OTP).
+ - Transaction Authentication Number (TAN) list used for online banking - they can only be used once.
+ - Time-synchronised one-time passwords.
+ - Biometric methods.
+ - Fingerprints, irises, voice, face.
+ - Cognitive passwords.
+ - Use question & answer cue/response pairs to verify identity.
+-
+- # Algorithmic Generation of OTP
+ - Paper-based TANs are hard to manage -> both the claimant and the verifier need to have a copy of every OTP (possibly hundreds of them).
+ - Idea: each OTP may be created from the passt OTPs used.
+ - An example of this type of algorithm, credited to Leslie Lamport, uses a **one-way function** (hash function).
+ - ## One-Way Functions
+ - What is a **hash function**? #card
+ card-last-interval:: 8.35
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-17T16:51:58.310Z
+ card-last-reviewed:: 2022-10-09T08:51:58.310Z
+ card-last-score:: 5
+ - A **one-way function** $H$ produces a fixed-size output $h$ based on a variable size input $s$.
+ - $$H(s) = h$$
+ - $H$ is also called a **hash function**, $h$ is called a **hash** (value).
+ - Important: *one-way property*:
+ - For a given hash code $h$, it is infeasible to find $s$ that $H(s) = h$.
+ - ### Leslie Lamport's Algorithm #card
+ card-last-interval:: 0.85
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-27T07:50:40.061Z
+ card-last-reviewed:: 2022-10-26T11:50:40.061Z
+ card-last-score:: 3
+ - For every claimant, a random seed (starting value) $s$ is chosen.
+ - A hash function $H(s)$ is applied repeatedly (e.g., 1,000 times) to the seed, giving a value of:
+ - $$H(H(H(...(H(s)....))))$$
+ - The user's first login uses an OTP $p$ derived by applying $H$ 999 times to the seed, i.e., $H^{999}(s)$.
+ - The verifier can authenticate that this is the correct OTP, because $H(p) = H^{1000}(s)$, the value stored.
+ - The value stored is then replaced by $p$ and the user is allowed to log in.
+ - The next login must be accompanied by $H^{998}(s)$.
+ - Again, this can be validated because hashing gives $H^{999}(s)$ which is $p$, the value stored after the previous login.
+ - The new value replaces $p$ and the user is authenticated.
+ - This process can be repeated another 997 times, each time the password will be $H$ applied one fewer times.
+ - ### Time-Synchronised OTP #card
+ card-last-interval:: 0.84
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-11T07:35:51.251Z
+ card-last-reviewed:: 2022-10-10T11:35:51.251Z
+ card-last-score:: 3
+ - Each user has a unique piece of hardware called a **security token** that generates an OTP (e.g., mobile phone).
+ - Inside the token is an accurate clock that has been synchronised with the clock of the verifer.
+ - Both claimant token and verifier server calculate identical OTPs that are based on time.
+ - 
+-
+- # Some New Biometric Methods
+ - **Hand geometry:** Measurement & comparison of the (unique) different physical characteristics of the hand.
+ - **Palm vein authentication:** Uses an infrared beam to penetrate the user's hand as it is waved over the system; the veins within the palm are returned as black lines.
+ - **Retina scan:** Provides an analysis of the capillary blood vessels located in the back of the eye.
+ - **Iris scan:** Provides an analysis of the rings, furrows, & freckles in the coloured ring that surrounds the pupil of the eye.
+ - Face recognition, signature, & voice analysis.
+ - **Behavioural biometrics:**
+ - 
+-
+- # Multi-Factor Authentication
+ - This may include a combination of the following:
+ - Some physical object in the possession of the user, e.g., a USB stick with a secret token, a bank card, a key, etc.
+ - Some secret known only to the user, such as a password, PIN, TAN, etc.
+ - Some physical characteristic of the user (biometrics), such as a fingerprint, eye iris, voice, typing speed, pattern in key press intervals, etc.
+ - Somewhere you are, such as connection to a specific computing network or utilising a GPS signal to identify the location.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-09-30T10_01_42.288Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-09-30T10_01_42.288Z.Desktop.md
new file mode 100644
index 00000000..ec396bac
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-09-30T10_01_42.288Z.Desktop.md
@@ -0,0 +1,101 @@
+- #[[CT216 - Software Engineering I]]
+- **Previous Topic:** [[Software Processes]]
+- **Next Topic:** [[SCRUM Roles & Ceremonies]]
+- **Relevant Slides:** _1663848442133_0.pdf)
+-
+- # Software Development Lifecycle
+ - What is the **Software Lifecycle**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-22T23:00:00.000Z
+ card-last-reviewed:: 2022-09-22T20:28:27.102Z
+ card-last-score:: 1
+ - The **software lifecycle** is an abstract representation of a software process. It defines the steps, methods, tools, activities, and deliverables of a software development project.
+ - The following **lifecycle phases** are considered:
+ - 1. Requirement Analysis
+ 2. System Design
+ 3. Implementation
+ 4. Integration & Deployment
+ 5. Operation & Maintenance
+ - ## SDLC Limitations
+ - Classical project planning methods have a lot of disadvantages:
+ - Huge efforts during the planning phase (requirements + design).
+ - Poor requirements conversion in a rapidly changing environment.
+ - Treatment of staff as a factor of production.
+-
+- # Agile
+ - What is **Agile**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:14:38.542Z
+ card-last-reviewed:: 2022-09-26T12:14:38.542Z
+ card-last-score:: 3
+ - There is no single definition of Agile, but the Agile Manifesto is the closest to a defintion.
+ - Set of principles.
+ - Developed by Agile Alliance.
+ - Agile methods focus on:
+ - Individuals & interactions over processes & tools.
+ - Working software over comprehensive documentation.
+ - Customer collaboration over contract negotiation.
+ - Responding to change over following a plan.
+ - The [Agile Alliance](www.agilealliance.org) is a non-profit organisation promotes agile development.
+ - ## Agile Motivation
+ - Agile proponents argue:
+ - Software development processes relying on lifecycle models are too heavyweight or cumbersome.
+ - Too many things are done that are not directly related to the software product being produced, i.e., design, models, requirements docs, documentation that isn't shipped as part of the product.
+ - Difficulty with incomplete or changing requirements.
+ - Short development cycles (Mobile Apps).
+ - More active customer involvement needed.
+ - There are several Agile methods, including **Scrum** and **Extreme Programming (XP)**.
+ - ## SCRUM
+ - What is **SCRUM**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-22T23:00:00.000Z
+ card-last-reviewed:: 2022-09-22T20:41:57.926Z
+ card-last-score:: 1
+ - **Software Project Management Methodology (SCRUM)** is an agile project management methodology for managing product development.
+ - It allows us to rapidly and repeatedly inspect actual working software (every two weeks to one month).
+ - The business sets the priorities. The teams **self-manage** to determine the best way to deliver the highest priority features.
+ - Every two weeks to a month, anyone can see real, working software and decide to release it as is or continue to enhance it for another iteration.
+ - ### Characteristics of SCRUM #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:13:39.492Z
+ card-last-reviewed:: 2022-09-26T12:13:39.493Z
+ card-last-score:: 3
+ - Self-organising teams.
+ - No need for project manager (in theory).
+ - Product progresses in a series of month-long or biweekly **sprints**.
+ - Assumes that the software cannot be well defined and requirements will change frequently.
+ - Requirements are captured as items in a list of **product backlog**.
+ - No specific engineering practices prescribed.
+ - XP, TDD, FDD.
+ - Best approach is to start with Scrum and then invent your own version using XP, TDD< FDD, etc.
+ - ### Daily SCRUM / Standup #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:14:54.429Z
+ card-last-reviewed:: 2022-09-26T12:14:54.429Z
+ card-last-score:: 5
+ - Parameters:
+ - Daily.
+ - 15-minutes.
+ - Stand-up.
+ - Not for problem solving.
+ - Only team members, ScrumMaster, & Product Owners should talk.
+ - Should help to avoid additional unnecessary meetings.
+ - Commitment in front of peers to complete tasks.
+ - Answer 3 questions:
+ - What did you do yesterday?
+ - What will you do today?
+ - Is anything in your way?
+ - The Daily SCRUM is **not** a problem-solving session and is **not** a way to collect information about who is behind the schedule.
+ - It is a meeting in which members make commitments to each other and to the SCRUM Master.
+ - It is a good way for a SCRUM Master to track the progress of the team.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-07T08_33_33.325Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-07T08_33_33.325Z.Desktop.md
new file mode 100644
index 00000000..0392369c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-07T08_33_33.325Z.Desktop.md
@@ -0,0 +1,101 @@
+- #[[CT216 - Software Engineering I]]
+- **Previous Topic:** [[Software Processes]]
+- **Next Topic:** [[SCRUM Roles & Ceremonies]]
+- **Relevant Slides:** _1663848442133_0.pdf)
+-
+- # Software Development Lifecycle
+ - What is the **Software Lifecycle**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-07T11:41:44.734Z
+ card-last-reviewed:: 2022-10-03T11:41:44.735Z
+ card-last-score:: 5
+ - The **software lifecycle** is an abstract representation of a software process. It defines the steps, methods, tools, activities, and deliverables of a software development project.
+ - The following **lifecycle phases** are considered:
+ - 1. Requirement Analysis
+ 2. System Design
+ 3. Implementation
+ 4. Integration & Deployment
+ 5. Operation & Maintenance
+ - ## SDLC Limitations
+ - Classical project planning methods have a lot of disadvantages:
+ - Huge efforts during the planning phase (requirements + design).
+ - Poor requirements conversion in a rapidly changing environment.
+ - Treatment of staff as a factor of production.
+-
+- # Agile
+ - What is **Agile**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:14:50.132Z
+ card-last-score:: 1
+ - There is no single definition of Agile, but the Agile Manifesto is the closest to a defintion.
+ - Set of principles.
+ - Developed by Agile Alliance.
+ - Agile methods focus on:
+ - Individuals & interactions over processes & tools.
+ - Working software over comprehensive documentation.
+ - Customer collaboration over contract negotiation.
+ - Responding to change over following a plan.
+ - The [Agile Alliance](www.agilealliance.org) is a non-profit organisation promotes agile development.
+ - ## Agile Motivation
+ - Agile proponents argue:
+ - Software development processes relying on lifecycle models are too heavyweight or cumbersome.
+ - Too many things are done that are not directly related to the software product being produced, i.e., design, models, requirements docs, documentation that isn't shipped as part of the product.
+ - Difficulty with incomplete or changing requirements.
+ - Short development cycles (Mobile Apps).
+ - More active customer involvement needed.
+ - There are several Agile methods, including **Scrum** and **Extreme Programming (XP)**.
+ - ## SCRUM
+ - What is **Scrum**? #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-04T12:33:02.463Z
+ - **Scrum** is an agile project management methodology for managing product development.
+ - It allows us to rapidly and repeatedly inspect actual working software (every two weeks to one month).
+ - The business sets the priorities. The teams **self-manage** to determine the best way to deliver the highest priority features.
+ - Every two weeks to a month, anyone can see real, working software and decide to release it as is or continue to enhance it for another iteration.
+ - ### Characteristics of SCRUM #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:13:22.626Z
+ card-last-score:: 1
+ - Self-organising teams.
+ - No need for project manager (in theory).
+ - Product progresses in a series of month-long or biweekly **sprints**.
+ - Assumes that the software cannot be well defined and requirements will change frequently.
+ - Requirements are captured as items in a list of **product backlog**.
+ - No specific engineering practices prescribed.
+ - XP, TDD, FDD.
+ - Best approach is to start with Scrum and then invent your own version using XP, TDD< FDD, etc.
+ - ### Daily SCRUM / Standup #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-08T12:15:05.415Z
+ card-last-reviewed:: 2022-10-04T12:15:05.415Z
+ card-last-score:: 5
+ - Parameters:
+ - Daily.
+ - 15-minutes.
+ - Stand-up.
+ - Not for problem solving.
+ - Only team members, ScrumMaster, & Product Owners should talk.
+ - Should help to avoid additional unnecessary meetings.
+ - Commitment in front of peers to complete tasks.
+ - Answer 3 questions:
+ - What did you do yesterday?
+ - What will you do today?
+ - Is anything in your way?
+ - The Daily SCRUM is **not** a problem-solving session and is **not** a way to collect information about who is behind the schedule.
+ - It is a meeting in which members make commitments to each other and to the SCRUM Master.
+ - It is a good way for a SCRUM Master to track the progress of the team.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-07T18_07_00.019Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-07T18_07_00.019Z.Desktop.md
new file mode 100644
index 00000000..7f7b06ba
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-07T18_07_00.019Z.Desktop.md
@@ -0,0 +1,101 @@
+- #[[CT216 - Software Engineering I]]
+- **Previous Topic:** [[Software Processes]]
+- **Next Topic:** [[SCRUM Roles & Ceremonies]]
+- **Relevant Slides:** _1663848442133_0.pdf)
+-
+- # Software Development Lifecycle
+ - What is the **Software Lifecycle**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-07T11:41:44.734Z
+ card-last-reviewed:: 2022-10-03T11:41:44.735Z
+ card-last-score:: 5
+ - The **software lifecycle** is an abstract representation of a software process. It defines the steps, methods, tools, activities, and deliverables of a software development project.
+ - The following **lifecycle phases** are considered:
+ - 1. Requirement Analysis
+ 2. System Design
+ 3. Implementation
+ 4. Integration & Deployment
+ 5. Operation & Maintenance
+ - ## SDLC Limitations
+ - Classical project planning methods have a lot of disadvantages:
+ - Huge efforts during the planning phase (requirements + design).
+ - Poor requirements conversion in a rapidly changing environment.
+ - Treatment of staff as a factor of production.
+-
+- # Agile
+ - What is **Agile**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:14:18.767Z
+ card-last-reviewed:: 2022-10-07T10:14:18.769Z
+ card-last-score:: 3
+ - There is no single definition of Agile, but the Agile Manifesto is the closest to a defintion.
+ - Set of principles.
+ - Developed by Agile Alliance.
+ - Agile methods focus on:
+ - Individuals & interactions over processes & tools.
+ - Working software over comprehensive documentation.
+ - Customer collaboration over contract negotiation.
+ - Responding to change over following a plan.
+ - The [Agile Alliance](www.agilealliance.org) is a non-profit organisation promotes agile development.
+ - ## Agile Motivation
+ - Agile proponents argue:
+ - Software development processes relying on lifecycle models are too heavyweight or cumbersome.
+ - Too many things are done that are not directly related to the software product being produced, i.e., design, models, requirements docs, documentation that isn't shipped as part of the product.
+ - Difficulty with incomplete or changing requirements.
+ - Short development cycles (Mobile Apps).
+ - More active customer involvement needed.
+ - There are several Agile methods, including **Scrum** and **Extreme Programming (XP)**.
+ - ## SCRUM
+ - What is **Scrum**? #card
+ card-last-score:: 3
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-10T04:23:23.437Z
+ card-last-interval:: 2.77
+ card-ease-factor:: 2.36
+ card-last-reviewed:: 2022-10-07T10:23:23.438Z
+ - **Scrum** is an agile project management methodology for managing product development.
+ - It allows us to rapidly and repeatedly inspect actual working software (every two weeks to one month).
+ - The business sets the priorities. The teams **self-manage** to determine the best way to deliver the highest priority features.
+ - Every two weeks to a month, anyone can see real, working software and decide to release it as is or continue to enhance it for another iteration.
+ - ### Characteristics of Scrum #card
+ card-last-score:: 3
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-11T10:49:04.551Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.22
+ card-last-reviewed:: 2022-10-07T10:49:04.552Z
+ - Self-organising teams.
+ - No need for project manager (in theory).
+ - Product progresses in a series of month-long or biweekly **sprints**.
+ - Assumes that the software cannot be well defined and requirements will change frequently.
+ - Requirements are captured as items in a list of **product backlog**.
+ - No specific engineering practices prescribed.
+ - XP, TDD, FDD.
+ - Best approach is to start with Scrum and then invent your own version using XP, TDD< FDD, etc.
+ - ### Daily SCRUM / Standup #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-08T12:15:05.415Z
+ card-last-reviewed:: 2022-10-04T12:15:05.415Z
+ card-last-score:: 5
+ - Parameters:
+ - Daily.
+ - 15-minutes.
+ - Stand-up.
+ - Not for problem solving.
+ - Only team members, ScrumMaster, & Product Owners should talk.
+ - Should help to avoid additional unnecessary meetings.
+ - Commitment in front of peers to complete tasks.
+ - Answer 3 questions:
+ - What did you do yesterday?
+ - What will you do today?
+ - Is anything in your way?
+ - The Daily SCRUM is **not** a problem-solving session and is **not** a way to collect information about who is behind the schedule.
+ - It is a meeting in which members make commitments to each other and to the SCRUM Master.
+ - It is a good way for a SCRUM Master to track the progress of the team.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-10T11_59_52.406Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-10T11_59_52.406Z.Desktop.md
new file mode 100644
index 00000000..fc4d347b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-10T11_59_52.406Z.Desktop.md
@@ -0,0 +1,101 @@
+- #[[CT216 - Software Engineering I]]
+- **Previous Topic:** [[Software Processes]]
+- **Next Topic:** [[SCRUM Roles & Ceremonies]]
+- **Relevant Slides:** _1663848442133_0.pdf)
+-
+- # Software Development Lifecycle
+ - What is the **Software Lifecycle**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:00:18.476Z
+ card-last-score:: 1
+ - The **software lifecycle** is an abstract representation of a software process. It defines the steps, methods, tools, activities, and deliverables of a software development project.
+ - The following **lifecycle phases** are considered:
+ - 1. Requirement Analysis
+ 2. System Design
+ 3. Implementation
+ 4. Integration & Deployment
+ 5. Operation & Maintenance
+ - ## SDLC Limitations
+ - Classical project planning methods have a lot of disadvantages:
+ - Huge efforts during the planning phase (requirements + design).
+ - Poor requirements conversion in a rapidly changing environment.
+ - Treatment of staff as a factor of production.
+-
+- # Agile
+ - What is **Agile**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:14:18.767Z
+ card-last-reviewed:: 2022-10-07T10:14:18.769Z
+ card-last-score:: 3
+ - There is no single definition of Agile, but the Agile Manifesto is the closest to a defintion.
+ - Set of principles.
+ - Developed by Agile Alliance.
+ - Agile methods focus on:
+ - Individuals & interactions over processes & tools.
+ - Working software over comprehensive documentation.
+ - Customer collaboration over contract negotiation.
+ - Responding to change over following a plan.
+ - The [Agile Alliance](www.agilealliance.org) is a non-profit organisation promotes agile development.
+ - ## Agile Motivation
+ - Agile proponents argue:
+ - Software development processes relying on lifecycle models are too heavyweight or cumbersome.
+ - Too many things are done that are not directly related to the software product being produced, i.e., design, models, requirements docs, documentation that isn't shipped as part of the product.
+ - Difficulty with incomplete or changing requirements.
+ - Short development cycles (Mobile Apps).
+ - More active customer involvement needed.
+ - There are several Agile methods, including **Scrum** and **Extreme Programming (XP)**.
+ - ## SCRUM
+ - What is **Scrum**? #card
+ card-last-score:: 3
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-10T04:23:23.437Z
+ card-last-interval:: 2.77
+ card-ease-factor:: 2.36
+ card-last-reviewed:: 2022-10-07T10:23:23.438Z
+ - **Scrum** is an agile project management methodology for managing product development.
+ - It allows us to rapidly and repeatedly inspect actual working software (every two weeks to one month).
+ - The business sets the priorities. The teams **self-manage** to determine the best way to deliver the highest priority features.
+ - Every two weeks to a month, anyone can see real, working software and decide to release it as is or continue to enhance it for another iteration.
+ - ### Characteristics of Scrum #card
+ card-last-score:: 3
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-11T10:49:04.551Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.22
+ card-last-reviewed:: 2022-10-07T10:49:04.552Z
+ - Self-organising teams.
+ - No need for project manager (in theory).
+ - Product progresses in a series of month-long or biweekly **sprints**.
+ - Assumes that the software cannot be well defined and requirements will change frequently.
+ - Requirements are captured as items in a list of **product backlog**.
+ - No specific engineering practices prescribed.
+ - XP, TDD, FDD.
+ - Best approach is to start with Scrum and then invent your own version using XP, TDD< FDD, etc.
+ - ### Daily SCRUM / Standup #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-20T02:54:31.522Z
+ card-last-reviewed:: 2022-10-08T22:54:31.568Z
+ card-last-score:: 5
+ - Parameters:
+ - Daily.
+ - 15-minutes.
+ - Stand-up.
+ - **Not** for problem solving.
+ - Only team members, Scrum Master, & Product Owners should talk.
+ - Should help to avoid additional unnecessary meetings.
+ - Commitment in front of peers to complete tasks.
+ - ^^Answer 3 questions:^^
+ - ^^What did you do yesterday?^^
+ - ^^What will you do today?^^
+ - ^^Is anything in your way?^^
+ - The Daily SCRUM is **not** a problem-solving session and is **not** a way to collect information about who is behind the schedule.
+ - It is a meeting in which members make commitments to each other and to the SCRUM Master.
+ - It is a good way for a SCRUM Master to track the progress of the team.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-20T09_05_57.963Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-20T09_05_57.963Z.Desktop.md
new file mode 100644
index 00000000..87ff0f74
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-10-20T09_05_57.963Z.Desktop.md
@@ -0,0 +1,101 @@
+- #[[CT216 - Software Engineering I]]
+- **Previous Topic:** [[Software Processes]]
+- **Next Topic:** [[SCRUM Roles & Ceremonies]]
+- **Relevant Slides:** _1663848442133_0.pdf)
+-
+- # Software Development Lifecycle
+ - What is the **Software Lifecycle**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:32:31.602Z
+ card-last-score:: 1
+ - The **software lifecycle** is an abstract representation of a software process. It defines the steps, methods, tools, activities, and deliverables of a software development project.
+ - The following **lifecycle phases** are considered:
+ - 1. Requirement Analysis
+ 2. System Design
+ 3. Implementation
+ 4. Integration & Deployment
+ 5. Operation & Maintenance
+ - ## SDLC Limitations
+ - Classical project planning methods have a lot of disadvantages:
+ - Huge efforts during the planning phase (requirements + design).
+ - Poor requirements conversion in a rapidly changing environment.
+ - Treatment of staff as a factor of production.
+-
+- # Agile
+ - What is **Agile**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:14:18.767Z
+ card-last-reviewed:: 2022-10-07T10:14:18.769Z
+ card-last-score:: 3
+ - There is no single definition of Agile, but the Agile Manifesto is the closest to a defintion.
+ - Set of principles.
+ - Developed by Agile Alliance.
+ - Agile methods focus on:
+ - Individuals & interactions over processes & tools.
+ - Working software over comprehensive documentation.
+ - Customer collaboration over contract negotiation.
+ - Responding to change over following a plan.
+ - The [Agile Alliance](www.agilealliance.org) is a non-profit organisation promotes agile development.
+ - ## Agile Motivation
+ - Agile proponents argue:
+ - Software development processes relying on lifecycle models are too heavyweight or cumbersome.
+ - Too many things are done that are not directly related to the software product being produced, i.e., design, models, requirements docs, documentation that isn't shipped as part of the product.
+ - Difficulty with incomplete or changing requirements.
+ - Short development cycles (Mobile Apps).
+ - More active customer involvement needed.
+ - There are several Agile methods, including **Scrum** and **Extreme Programming (XP)**.
+ - ## SCRUM
+ - What is **Scrum**? #card
+ card-last-score:: 3
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-10T04:23:23.437Z
+ card-last-interval:: 2.77
+ card-ease-factor:: 2.36
+ card-last-reviewed:: 2022-10-07T10:23:23.438Z
+ - **Scrum** is an agile project management methodology for managing product development.
+ - It allows us to rapidly and repeatedly inspect actual working software (every two weeks to one month).
+ - The business sets the priorities. The teams **self-manage** to determine the best way to deliver the highest priority features.
+ - Every two weeks to a month, anyone can see real, working software and decide to release it as is or continue to enhance it for another iteration.
+ - ### Characteristics of Scrum #card
+ card-last-score:: 3
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-11T10:49:04.551Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.22
+ card-last-reviewed:: 2022-10-07T10:49:04.552Z
+ - Self-organising teams.
+ - No need for project manager (in theory).
+ - Product progresses in a series of month-long or biweekly **sprints**.
+ - Assumes that the software cannot be well defined and requirements will change frequently.
+ - Requirements are captured as items in a list of **product backlog**.
+ - No specific engineering practices prescribed.
+ - XP, TDD, FDD.
+ - Best approach is to start with Scrum and then invent your own version using XP, TDD< FDD, etc.
+ - ### Daily SCRUM / Standup #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-20T02:54:31.522Z
+ card-last-reviewed:: 2022-10-08T22:54:31.568Z
+ card-last-score:: 5
+ - Parameters:
+ - Daily.
+ - 15-minutes.
+ - Stand-up.
+ - **Not** for problem solving.
+ - Only team members, Scrum Master, & Product Owners should talk.
+ - Should help to avoid additional unnecessary meetings.
+ - Commitment in front of peers to complete tasks.
+ - ^^Answer 3 questions:^^
+ - ^^What did you do yesterday?^^
+ - ^^What will you do today?^^
+ - ^^Is anything in your way?^^
+ - The Daily SCRUM is **not** a problem-solving session and is **not** a way to collect information about who is behind the schedule.
+ - It is a meeting in which members make commitments to each other and to the SCRUM Master.
+ - It is a good way for a SCRUM Master to track the progress of the team.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-11-11T12_04_45.344Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-11-11T12_04_45.344Z.Desktop.md
new file mode 100644
index 00000000..a43260d8
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Agile Methods/2022-11-11T12_04_45.344Z.Desktop.md
@@ -0,0 +1,101 @@
+- #[[CT216 - Software Engineering I]]
+- **Previous Topic:** [[Software Processes]]
+- **Next Topic:** [[SCRUM Roles & Ceremonies]]
+- **Relevant Slides:** _1663848442133_0.pdf)
+-
+- # Software Development Lifecycle
+ - What is the **Software Lifecycle**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:38:27.177Z
+ card-last-score:: 1
+ - The **software lifecycle** is an abstract representation of a software process. It defines the steps, methods, tools, activities, and deliverables of a software development project.
+ - The following **lifecycle phases** are considered:
+ - 1. Requirement Analysis
+ 2. System Design
+ 3. Implementation
+ 4. Integration & Deployment
+ 5. Operation & Maintenance
+ - ## SDLC Limitations
+ - Classical project planning methods have a lot of disadvantages:
+ - Huge efforts during the planning phase (requirements + design).
+ - Poor requirements conversion in a rapidly changing environment.
+ - Treatment of staff as a factor of production.
+-
+- # Agile
+ - What is **Agile**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:14:18.767Z
+ card-last-reviewed:: 2022-10-07T10:14:18.769Z
+ card-last-score:: 3
+ - There is no single definition of Agile, but the Agile Manifesto is the closest to a defintion.
+ - Set of principles.
+ - Developed by Agile Alliance.
+ - Agile methods focus on:
+ - Individuals & interactions over processes & tools.
+ - Working software over comprehensive documentation.
+ - Customer collaboration over contract negotiation.
+ - Responding to change over following a plan.
+ - The [Agile Alliance](www.agilealliance.org) is a non-profit organisation promotes agile development.
+ - ## Agile Motivation
+ - Agile proponents argue:
+ - Software development processes relying on lifecycle models are too heavyweight or cumbersome.
+ - Too many things are done that are not directly related to the software product being produced, i.e., design, models, requirements docs, documentation that isn't shipped as part of the product.
+ - Difficulty with incomplete or changing requirements.
+ - Short development cycles (Mobile Apps).
+ - More active customer involvement needed.
+ - There are several Agile methods, including **Scrum** and **Extreme Programming (XP)**.
+ - ## SCRUM
+ - What is **Scrum**? #card
+ card-last-score:: 3
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-29T05:29:46.102Z
+ card-last-interval:: 8.88
+ card-ease-factor:: 2.22
+ card-last-reviewed:: 2022-10-20T08:29:46.102Z
+ - **Scrum** is an agile project management methodology for managing product development.
+ - It allows us to rapidly and repeatedly inspect actual working software (every two weeks to one month).
+ - The business sets the priorities. The teams **self-manage** to determine the best way to deliver the highest priority features.
+ - Every two weeks to a month, anyone can see real, working software and decide to release it as is or continue to enhance it for another iteration.
+ - ### Characteristics of Scrum #card
+ card-last-score:: 3
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-11T10:49:04.551Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.22
+ card-last-reviewed:: 2022-10-07T10:49:04.552Z
+ - Self-organising teams.
+ - No need for project manager (in theory).
+ - Product progresses in a series of month-long or biweekly **sprints**.
+ - Assumes that the software cannot be well defined and requirements will change frequently.
+ - Requirements are captured as items in a list of **product backlog**.
+ - No specific engineering practices prescribed.
+ - XP, TDD, FDD.
+ - Best approach is to start with Scrum and then invent your own version using XP, TDD< FDD, etc.
+ - ### Daily SCRUM / Standup #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-20T02:54:31.522Z
+ card-last-reviewed:: 2022-10-08T22:54:31.568Z
+ card-last-score:: 5
+ - Parameters:
+ - Daily.
+ - 15-minutes.
+ - Stand-up.
+ - **Not** for problem solving.
+ - Only team members, Scrum Master, & Product Owners should talk.
+ - Should help to avoid additional unnecessary meetings.
+ - Commitment in front of peers to complete tasks.
+ - ^^Answer 3 questions:^^
+ - ^^What did you do yesterday?^^
+ - ^^What will you do today?^^
+ - ^^Is anything in your way?^^
+ - The Daily SCRUM is **not** a problem-solving session and is **not** a way to collect information about who is behind the schedule.
+ - It is a meeting in which members make commitments to each other and to the SCRUM Master.
+ - It is a good way for a SCRUM Master to track the progress of the team.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-09-30T08_54_51.814Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-09-30T08_54_51.814Z.Desktop.md
new file mode 100644
index 00000000..b91d47f1
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-09-30T08_54_51.814Z.Desktop.md
@@ -0,0 +1,315 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[GDPR]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+ id:: 63265db7-1d41-44f7-b4cf-0bab377a7c1c
+-
+- ## SQL Injections
+ - What is an **SQL Injection**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:46:36.580Z
+ card-last-reviewed:: 2022-09-18T14:46:36.581Z
+ card-last-score:: 3
+ - An **SQL Injection** is a ^^code injection technique^^ used to attack data-driven applications, in which malicious SQL statements are inserted for execution.
+ - It is a way of exploiting user input & SQL statements to compromise the database & retrieve sensitive data.
+-
+- ## Basic Terminology
+ - What is **Cryptography**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:46:04.518Z
+ card-last-reviewed:: 2022-09-18T14:46:04.518Z
+ card-last-score:: 5
+ - **Cryptography** is the art of encompassing the principles & methods of transforming an intelligible message into one that is unintelligible, and then retransforming that message back into its original form.
+ - What is **Plaintext**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:39:41.558Z
+ card-last-reviewed:: 2022-09-18T14:39:41.558Z
+ card-last-score:: 5
+ - **Plaintext** is the ^^original, intelligible message.^^
+ - What is **Ciphertext**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:39:52.620Z
+ card-last-reviewed:: 2022-09-18T14:39:52.621Z
+ card-last-score:: 5
+ - **Ciphertext** is the encrypted messsage.
+ - What is a **Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:44:53.575Z
+ card-last-reviewed:: 2022-09-18T14:44:53.575Z
+ card-last-score:: 5
+ - A **Cipher** is an algorithm for transforming an intelligible message into one that is unintelligible.
+ - What is a **Key**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:43:53.075Z
+ card-last-reviewed:: 2022-09-18T14:43:53.075Z
+ card-last-score:: 3
+ - A **Key** is some critical information used by the cipher, known only to the sender & receiver, selected from a **keyspace** (the set of all possible keys).
+ - What does **Encipher** mean? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:46:57.114Z
+ card-last-reviewed:: 2022-09-18T14:46:57.114Z
+ card-last-score:: 5
+ - **Enciphering** is the process of converting plaintext into ciphertext using a cipher & a key.
+ - What does **Decipher** mean? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:43:30.989Z
+ card-last-reviewed:: 2022-09-18T14:43:30.989Z
+ card-last-score:: 5
+ - **Deciphering** is the process of converting ciphertext back into plaintext using a cipher & a key.
+ - What is **Encryption**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:44:36.754Z
+ card-last-reviewed:: 2022-09-18T14:44:36.755Z
+ card-last-score:: 3
+ - **Encryption** is some mathematical function $E_K()$ mapping plaintext $P$ to ciphertext $C$ using the specified key $K$.
+ - $$C=E_K(P)$$
+ - What is **Decryption**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:45:19.915Z
+ card-last-reviewed:: 2022-09-18T14:45:19.915Z
+ card-last-score:: 3
+ - **Decryption** is some mathematical function ${E_K}^{-1}()$ mapping the ciphertext $C$ to plaintext $P$ using the specified key $K$.
+ - $$P={E_K}^{-1}(C)$$
+ - What is **Cryptanalysis**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:41:43.525Z
+ card-last-reviewed:: 2022-09-18T14:41:43.525Z
+ card-last-score:: 5
+ - **Cryptanalysis** is the study of principles & methods of transforming an unintelligible message into an intelligible message without knowledge of the key.
+ - What is **Cryptology**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:39:33.475Z
+ card-last-reviewed:: 2022-09-18T14:39:33.475Z
+ card-last-score:: 3
+ - **Cryptology** is the field encompassing both cryptography & cryptanalysis.
+ -
+-
+- ## Model of Conventional Cryptosystem
+ - {:height 304, :width 610}
+- ## Cryptanalysis via Letter Frequency Distribution
+ - Human languages are **redundant** - letters are not equally commonly used.
+ - In the **English** language:
+ - **E** is by far the most common letter followed by T, R, N, I, O, A, and S.
+ - Other letters like Z, J, K, Q, and X are fairly rare.
+ - Certain letter combinations like **TH** are quite common.
+ - 
+ -
+ - ### C Program for Frequency Analysis of single Characters
+ - ```c
+ #include
+ #include
+ #include
+
+ int main(int argc, char* argv[]) {
+ FILE* fp;
+ int data[26];
+ char c;
+
+ memset(data, 0, siezof(data));
+
+ if (argc != 2) {
+ return(-1);
+ }
+ if (fp = fopen(argv[1], "r" == NULL)) {
+ return(-2);
+ }
+
+ while(!feof(fp)) {
+ c = toupper(fgetc(fp));
+
+ if ((c >= 'A') && (c <= 'Z')) {
+ data[c-65]++;
+ }
+ }
+
+ for (int i = 0; i < 26; i++) {
+ printf("%c:%i\n", i+65, data[i]);
+ }
+
+ fclose(fp);
+ return(0);
+ }
+ ```
+- ## Known Plaintext Attacks (KPA)
+ - What is a **Known Plaintext Attack (KPA)**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:46:48.201Z
+ card-last-reviewed:: 2022-09-18T14:46:48.202Z
+ card-last-score:: 3
+ - The **Known Plaintext Attack (KPA)** is an attack model for cryptanalysis where the attacker has access to both:
+ - some of, or all of, the plaintext (called a **crib**)
+ - the ciphertext
+ -
+-
+- ## Caesar Cipher
+ - What is a **Caesar Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:44:47.075Z
+ card-last-reviewed:: 2022-09-18T14:44:47.075Z
+ card-last-score:: 5
+ - A **Caesar Cipher** involves using an offset alphabet to encrypt a message.
+ - We can use any shift from 1 to 25 to replace each plaintext letter with a letter a fixed distance away.
+ - The **key letter** represents the start of this offset alphabet.
+ - For example, a key letter of F means that A -> F, B -> G, and so on.
+- ## Playfair Cipher
+ - Not even the large number of keys in a monoalphabetic cipher provides security.
+ - What is a **monoalphabetic cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:40:09.236Z
+ card-last-reviewed:: 2022-09-18T14:40:09.237Z
+ card-last-score:: 5
+ - A **monoalphabetic cipher** is any cipher in which the letters of the plaintext are mapped to ciphertext letters based on a single alphabetic key.
+ - One approach to improving security over monoalphabetic ciphers is to to encrypt ^^multiple letters.^^
+ - The **Playfair Cipher** is one example of such an approach.
+ - The algorithm was invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair.
+ - ### How does the Playfair Cipher work? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:43:16.213Z
+ card-last-score:: 1
+ - 
+ - 1. Create a 5x5 grid of letters; insert the keyword as shown, with each letter only considered once; fill the grid with the remaining letters in alphabetic order.
+ - 2. The letters are then encrypted in pairs.
+ - 3. Repeats have an "X" inserted.
+ - BALLOON -> BA LX LO ON
+ - 4. Letters that fall in the same row are replaced with the letter on the right.
+ - OK -> GM
+ - 5. Letters in the same column are replaced with the letter below.
+ - FO -> OU
+ - 6. Otherwise, each letter gets replaced by the letter in its row but in the other letters column.
+ - QM -> TH
+ - ### Security of the Playfair Cipher
+ - The security is much improved over simple monoalphabetic ciphers, as the Playfair Cipher has $26^2 = 676$ combinations.
+ - This requires a 676 entry frequency table to analyse (as compared to a 26 entry frequency table for a monoalphabetic cipher) and correspondingly, more ciphertext.
+ - However, the Playfair Cipher *can* be cracked through frequency analysis of letter pairs, given a few hundred letters.
+ -
+- ## Vigenère Cipher
+ - [Blaise de Vigenère](https://en.wikipedia.org/wiki/Blaise_de_Vigen%C3%A8re) is generally credited as the inventor of the **Polyalphabetic Substitution Cipher**.
+ - What is a **Polyalphabetic Substitution Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:39:24.910Z
+ card-last-reviewed:: 2022-09-18T14:39:24.912Z
+ card-last-score:: 5
+ - A **Polyalphabetic Substitution Cipher** uses multiple substitution alphabets, as opposed to a monoalphabetic cipher which uses a single alphabetic key.
+ - The Vigenère Cipher improves security by using many monoalphabetic substitution alphabets, so each letter can be replaced by many others.
+ - You use a **key** to select which alphabet is used for each letter of the message.
+ - The $i^{th}$ letter of the key specifies the $i^{th}$ alphabet to use.
+ - Use each alphabet in turn.
+ - Repeat from the start after the end of the key is reached.
+ -
+ - ### Vigenère Steps
+ - 
+ - 1. Write the plaintext out, and write the keyword underneath it, repeated, for the length of the plaintext.
+ - 2. Use each key letter in turn as a Caesar cipher key.
+ - 3. Encrypt the corresponding plaintext letter.
+ - In this example, we use the keyword "CIPHER". Hence, we have the following translation alphabets:
+ - 
+ - ### How to crack the Vigenère Cipher
+ - 1. Search the ciphertext for repeated strings of letters - the longer the string, the better.
+ - 2. For each occurrence of a repeated string, count how many letters are between the first letters in the string, and add one.
+ - 3. Factorise that number.
+ - 4. Repeat this process with each repeated string you find and make a table of common factors. The most common factor, $n$ is most likely the length of the keyword used to encipher the ciphertext.
+ - 5. Do a frequency count on the ciphertext, on every $n^{th}$ letter. You should end up with $n$ different frequency counts.
+ - 6. Compare these counts to standard frequency tables to figure out how much each letter was shifted by.
+ - 7. Undo the shifts and read the message.
+- ## Enigma (Rotor Ciphers)
+ - ### Rotor Ciphers
+ - The mechanisation / automation of encryption.
+ - An $\text{N}$-stage polyalphabetic algorithm modulo 26.
+ - $26^N$ steps before a repetition, where $N$ is the number of cylinders.
+ - The Enigma machine had 5 cylinders, so:
+ - $$26^{N=5}=11,881,376 \text{ steps}$$
+ -
+ - ### Breaking Enigma using **Cribs**
+ - The starting point for breaking Enigma was based on the following:
+ - Plaintext messages were likely to contain certain phrases.
+ - Weather reports contained the term "WETTER VORHERSAGE".
+ - Military units often sent messages containing "KEINE BESONDEREN EREIGNISSE" ("nothing to report").
+ - A plaintext letter was never mapped onto the same ciphertext letter.
+ - While the cryptanalysts in Bletchely Park did not know exactly where these cribs were placed in an intercepted message, they could exclude certain positions.
+ - 
+ - From here, possible rotor start positions & rotor wiring would be systematically examined using the "bombe" - an electromechanical device designed by Turing that replicated the action of several Enigma machines wired together.
+ -
+- ## Transposition Ciphers
+ - What are **Transposition Ciphers**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:46:25.289Z
+ card-last-score:: 1
+ - **Transposition** or **Permutation Ciphers** hide the message by rearranging the letter order ^^without altering the actual letters used.^^
+ - This can be recognised since the ciphertext has the same frequency distribution as the original text.
+ - ### Rail Fence Cipher
+ - Write plaintext letters out diagonally over a number of rows, then read off the cipher row by row.
+ - 
+ - ### Row Transposition Cipher
+ - What are **Row Transposition Ciphers**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:41:09.367Z
+ card-last-score:: 1
+ - **Row Transposition Ciphers** are a more complex kind of transposition cipher than Rail Fence Ciphers.
+ - Plaintext letters are written out in rows over a specified number of columns.
+ - The columns are then re-ordered according to some key before reading off the columns
+ - 
+-
+- ## Product Ciphers
+ - Ciphers using just substitutions or transpositions are not secure because of language characteristics.
+ - Consider using several ciphers in succession to make it harder to crack:
+ - Two substitutions make a more complex substitution.
+ - Two transpositions make a more complex transposition.
+ - However, a substitution followed by a transposition makes a much harder cipher.
+ -
+-
+- # Steganography
+ - What is **Steganography**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:45:30.141Z
+ card-last-reviewed:: 2022-09-18T14:45:30.142Z
+ card-last-score:: 5
+ - **Steganography** is an alternative to encryption that hides the existence of the message.
+ - For example:
+ - Using only a subset of letters / words in a message marked in some way.
+ - Using invisible ink.
+ - Hiding in LSB in graphic image or sound file.
+ - The drawback of steganography is that it's not very economical in terms of overheads to hide a message.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-09-30T10_01_42.293Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-09-30T10_01_42.293Z.Desktop.md
new file mode 100644
index 00000000..b91d47f1
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-09-30T10_01_42.293Z.Desktop.md
@@ -0,0 +1,315 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[GDPR]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+ id:: 63265db7-1d41-44f7-b4cf-0bab377a7c1c
+-
+- ## SQL Injections
+ - What is an **SQL Injection**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:46:36.580Z
+ card-last-reviewed:: 2022-09-18T14:46:36.581Z
+ card-last-score:: 3
+ - An **SQL Injection** is a ^^code injection technique^^ used to attack data-driven applications, in which malicious SQL statements are inserted for execution.
+ - It is a way of exploiting user input & SQL statements to compromise the database & retrieve sensitive data.
+-
+- ## Basic Terminology
+ - What is **Cryptography**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:46:04.518Z
+ card-last-reviewed:: 2022-09-18T14:46:04.518Z
+ card-last-score:: 5
+ - **Cryptography** is the art of encompassing the principles & methods of transforming an intelligible message into one that is unintelligible, and then retransforming that message back into its original form.
+ - What is **Plaintext**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:39:41.558Z
+ card-last-reviewed:: 2022-09-18T14:39:41.558Z
+ card-last-score:: 5
+ - **Plaintext** is the ^^original, intelligible message.^^
+ - What is **Ciphertext**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:39:52.620Z
+ card-last-reviewed:: 2022-09-18T14:39:52.621Z
+ card-last-score:: 5
+ - **Ciphertext** is the encrypted messsage.
+ - What is a **Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:44:53.575Z
+ card-last-reviewed:: 2022-09-18T14:44:53.575Z
+ card-last-score:: 5
+ - A **Cipher** is an algorithm for transforming an intelligible message into one that is unintelligible.
+ - What is a **Key**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:43:53.075Z
+ card-last-reviewed:: 2022-09-18T14:43:53.075Z
+ card-last-score:: 3
+ - A **Key** is some critical information used by the cipher, known only to the sender & receiver, selected from a **keyspace** (the set of all possible keys).
+ - What does **Encipher** mean? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:46:57.114Z
+ card-last-reviewed:: 2022-09-18T14:46:57.114Z
+ card-last-score:: 5
+ - **Enciphering** is the process of converting plaintext into ciphertext using a cipher & a key.
+ - What does **Decipher** mean? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:43:30.989Z
+ card-last-reviewed:: 2022-09-18T14:43:30.989Z
+ card-last-score:: 5
+ - **Deciphering** is the process of converting ciphertext back into plaintext using a cipher & a key.
+ - What is **Encryption**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:44:36.754Z
+ card-last-reviewed:: 2022-09-18T14:44:36.755Z
+ card-last-score:: 3
+ - **Encryption** is some mathematical function $E_K()$ mapping plaintext $P$ to ciphertext $C$ using the specified key $K$.
+ - $$C=E_K(P)$$
+ - What is **Decryption**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:45:19.915Z
+ card-last-reviewed:: 2022-09-18T14:45:19.915Z
+ card-last-score:: 3
+ - **Decryption** is some mathematical function ${E_K}^{-1}()$ mapping the ciphertext $C$ to plaintext $P$ using the specified key $K$.
+ - $$P={E_K}^{-1}(C)$$
+ - What is **Cryptanalysis**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:41:43.525Z
+ card-last-reviewed:: 2022-09-18T14:41:43.525Z
+ card-last-score:: 5
+ - **Cryptanalysis** is the study of principles & methods of transforming an unintelligible message into an intelligible message without knowledge of the key.
+ - What is **Cryptology**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:39:33.475Z
+ card-last-reviewed:: 2022-09-18T14:39:33.475Z
+ card-last-score:: 3
+ - **Cryptology** is the field encompassing both cryptography & cryptanalysis.
+ -
+-
+- ## Model of Conventional Cryptosystem
+ - {:height 304, :width 610}
+- ## Cryptanalysis via Letter Frequency Distribution
+ - Human languages are **redundant** - letters are not equally commonly used.
+ - In the **English** language:
+ - **E** is by far the most common letter followed by T, R, N, I, O, A, and S.
+ - Other letters like Z, J, K, Q, and X are fairly rare.
+ - Certain letter combinations like **TH** are quite common.
+ - 
+ -
+ - ### C Program for Frequency Analysis of single Characters
+ - ```c
+ #include
+ #include
+ #include
+
+ int main(int argc, char* argv[]) {
+ FILE* fp;
+ int data[26];
+ char c;
+
+ memset(data, 0, siezof(data));
+
+ if (argc != 2) {
+ return(-1);
+ }
+ if (fp = fopen(argv[1], "r" == NULL)) {
+ return(-2);
+ }
+
+ while(!feof(fp)) {
+ c = toupper(fgetc(fp));
+
+ if ((c >= 'A') && (c <= 'Z')) {
+ data[c-65]++;
+ }
+ }
+
+ for (int i = 0; i < 26; i++) {
+ printf("%c:%i\n", i+65, data[i]);
+ }
+
+ fclose(fp);
+ return(0);
+ }
+ ```
+- ## Known Plaintext Attacks (KPA)
+ - What is a **Known Plaintext Attack (KPA)**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:46:48.201Z
+ card-last-reviewed:: 2022-09-18T14:46:48.202Z
+ card-last-score:: 3
+ - The **Known Plaintext Attack (KPA)** is an attack model for cryptanalysis where the attacker has access to both:
+ - some of, or all of, the plaintext (called a **crib**)
+ - the ciphertext
+ -
+-
+- ## Caesar Cipher
+ - What is a **Caesar Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:44:47.075Z
+ card-last-reviewed:: 2022-09-18T14:44:47.075Z
+ card-last-score:: 5
+ - A **Caesar Cipher** involves using an offset alphabet to encrypt a message.
+ - We can use any shift from 1 to 25 to replace each plaintext letter with a letter a fixed distance away.
+ - The **key letter** represents the start of this offset alphabet.
+ - For example, a key letter of F means that A -> F, B -> G, and so on.
+- ## Playfair Cipher
+ - Not even the large number of keys in a monoalphabetic cipher provides security.
+ - What is a **monoalphabetic cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:40:09.236Z
+ card-last-reviewed:: 2022-09-18T14:40:09.237Z
+ card-last-score:: 5
+ - A **monoalphabetic cipher** is any cipher in which the letters of the plaintext are mapped to ciphertext letters based on a single alphabetic key.
+ - One approach to improving security over monoalphabetic ciphers is to to encrypt ^^multiple letters.^^
+ - The **Playfair Cipher** is one example of such an approach.
+ - The algorithm was invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair.
+ - ### How does the Playfair Cipher work? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:43:16.213Z
+ card-last-score:: 1
+ - 
+ - 1. Create a 5x5 grid of letters; insert the keyword as shown, with each letter only considered once; fill the grid with the remaining letters in alphabetic order.
+ - 2. The letters are then encrypted in pairs.
+ - 3. Repeats have an "X" inserted.
+ - BALLOON -> BA LX LO ON
+ - 4. Letters that fall in the same row are replaced with the letter on the right.
+ - OK -> GM
+ - 5. Letters in the same column are replaced with the letter below.
+ - FO -> OU
+ - 6. Otherwise, each letter gets replaced by the letter in its row but in the other letters column.
+ - QM -> TH
+ - ### Security of the Playfair Cipher
+ - The security is much improved over simple monoalphabetic ciphers, as the Playfair Cipher has $26^2 = 676$ combinations.
+ - This requires a 676 entry frequency table to analyse (as compared to a 26 entry frequency table for a monoalphabetic cipher) and correspondingly, more ciphertext.
+ - However, the Playfair Cipher *can* be cracked through frequency analysis of letter pairs, given a few hundred letters.
+ -
+- ## Vigenère Cipher
+ - [Blaise de Vigenère](https://en.wikipedia.org/wiki/Blaise_de_Vigen%C3%A8re) is generally credited as the inventor of the **Polyalphabetic Substitution Cipher**.
+ - What is a **Polyalphabetic Substitution Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:39:24.910Z
+ card-last-reviewed:: 2022-09-18T14:39:24.912Z
+ card-last-score:: 5
+ - A **Polyalphabetic Substitution Cipher** uses multiple substitution alphabets, as opposed to a monoalphabetic cipher which uses a single alphabetic key.
+ - The Vigenère Cipher improves security by using many monoalphabetic substitution alphabets, so each letter can be replaced by many others.
+ - You use a **key** to select which alphabet is used for each letter of the message.
+ - The $i^{th}$ letter of the key specifies the $i^{th}$ alphabet to use.
+ - Use each alphabet in turn.
+ - Repeat from the start after the end of the key is reached.
+ -
+ - ### Vigenère Steps
+ - 
+ - 1. Write the plaintext out, and write the keyword underneath it, repeated, for the length of the plaintext.
+ - 2. Use each key letter in turn as a Caesar cipher key.
+ - 3. Encrypt the corresponding plaintext letter.
+ - In this example, we use the keyword "CIPHER". Hence, we have the following translation alphabets:
+ - 
+ - ### How to crack the Vigenère Cipher
+ - 1. Search the ciphertext for repeated strings of letters - the longer the string, the better.
+ - 2. For each occurrence of a repeated string, count how many letters are between the first letters in the string, and add one.
+ - 3. Factorise that number.
+ - 4. Repeat this process with each repeated string you find and make a table of common factors. The most common factor, $n$ is most likely the length of the keyword used to encipher the ciphertext.
+ - 5. Do a frequency count on the ciphertext, on every $n^{th}$ letter. You should end up with $n$ different frequency counts.
+ - 6. Compare these counts to standard frequency tables to figure out how much each letter was shifted by.
+ - 7. Undo the shifts and read the message.
+- ## Enigma (Rotor Ciphers)
+ - ### Rotor Ciphers
+ - The mechanisation / automation of encryption.
+ - An $\text{N}$-stage polyalphabetic algorithm modulo 26.
+ - $26^N$ steps before a repetition, where $N$ is the number of cylinders.
+ - The Enigma machine had 5 cylinders, so:
+ - $$26^{N=5}=11,881,376 \text{ steps}$$
+ -
+ - ### Breaking Enigma using **Cribs**
+ - The starting point for breaking Enigma was based on the following:
+ - Plaintext messages were likely to contain certain phrases.
+ - Weather reports contained the term "WETTER VORHERSAGE".
+ - Military units often sent messages containing "KEINE BESONDEREN EREIGNISSE" ("nothing to report").
+ - A plaintext letter was never mapped onto the same ciphertext letter.
+ - While the cryptanalysts in Bletchely Park did not know exactly where these cribs were placed in an intercepted message, they could exclude certain positions.
+ - 
+ - From here, possible rotor start positions & rotor wiring would be systematically examined using the "bombe" - an electromechanical device designed by Turing that replicated the action of several Enigma machines wired together.
+ -
+- ## Transposition Ciphers
+ - What are **Transposition Ciphers**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:46:25.289Z
+ card-last-score:: 1
+ - **Transposition** or **Permutation Ciphers** hide the message by rearranging the letter order ^^without altering the actual letters used.^^
+ - This can be recognised since the ciphertext has the same frequency distribution as the original text.
+ - ### Rail Fence Cipher
+ - Write plaintext letters out diagonally over a number of rows, then read off the cipher row by row.
+ - 
+ - ### Row Transposition Cipher
+ - What are **Row Transposition Ciphers**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:41:09.367Z
+ card-last-score:: 1
+ - **Row Transposition Ciphers** are a more complex kind of transposition cipher than Rail Fence Ciphers.
+ - Plaintext letters are written out in rows over a specified number of columns.
+ - The columns are then re-ordered according to some key before reading off the columns
+ - 
+-
+- ## Product Ciphers
+ - Ciphers using just substitutions or transpositions are not secure because of language characteristics.
+ - Consider using several ciphers in succession to make it harder to crack:
+ - Two substitutions make a more complex substitution.
+ - Two transpositions make a more complex transposition.
+ - However, a substitution followed by a transposition makes a much harder cipher.
+ -
+-
+- # Steganography
+ - What is **Steganography**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:45:30.141Z
+ card-last-reviewed:: 2022-09-18T14:45:30.142Z
+ card-last-score:: 5
+ - **Steganography** is an alternative to encryption that hides the existence of the message.
+ - For example:
+ - Using only a subset of letters / words in a message marked in some way.
+ - Using invisible ink.
+ - Hiding in LSB in graphic image or sound file.
+ - The drawback of steganography is that it's not very economical in terms of overheads to hide a message.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-10-07T08_33_33.339Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-10-07T08_33_33.339Z.Desktop.md
new file mode 100644
index 00000000..5b30a950
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-10-07T08_33_33.339Z.Desktop.md
@@ -0,0 +1,316 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[GDPR]]
+- **Next Topic:** [[Human Security & Passwords]]
+- **Relevant Slides:** 
+ id:: 63265db7-1d41-44f7-b4cf-0bab377a7c1c
+-
+- ## SQL Injections
+ - What is an **SQL Injection**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T12:29:41.822Z
+ card-last-reviewed:: 2022-10-04T12:29:41.822Z
+ card-last-score:: 5
+ -
+ - An **SQL Injection** is a ^^code injection technique^^ used to attack data-driven applications, in which malicious SQL statements are inserted for execution.
+ - It is a way of exploiting user input & SQL statements to compromise the database & retrieve sensitive data.
+-
+- ## Basic Terminology
+ - What is **Cryptography**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:13:18.768Z
+ card-last-reviewed:: 2022-09-30T12:13:18.768Z
+ card-last-score:: 5
+ - **Cryptography** is the art of encompassing the principles & methods of transforming an intelligible message into one that is unintelligible, and then retransforming that message back into its original form.
+ - What is **Plaintext**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:07:59.453Z
+ card-last-reviewed:: 2022-09-30T12:07:59.456Z
+ card-last-score:: 5
+ - **Plaintext** is the ^^original, intelligible message.^^
+ - What is **Ciphertext**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T08:29:48.663Z
+ card-last-reviewed:: 2022-09-30T08:29:48.663Z
+ card-last-score:: 5
+ - **Ciphertext** is the encrypted messsage.
+ - What is a **Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-04T12:11:06.873Z
+ card-last-reviewed:: 2022-09-30T12:11:06.874Z
+ card-last-score:: 3
+ - A **Cipher** is an algorithm for transforming an intelligible message into one that is unintelligible.
+ - What is a **Key**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-04T12:09:48.972Z
+ card-last-reviewed:: 2022-09-30T12:09:48.972Z
+ card-last-score:: 5
+ - A **Key** is some critical information used by the cipher, known only to the sender & receiver, selected from a **keyspace** (the set of all possible keys).
+ - What does **Encipher** mean? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:13:23.717Z
+ card-last-reviewed:: 2022-09-30T12:13:23.717Z
+ card-last-score:: 5
+ - **Enciphering** is the process of converting plaintext into ciphertext using a cipher & a key.
+ - What does **Decipher** mean?
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:09:14.829Z
+ card-last-reviewed:: 2022-09-30T12:09:14.829Z
+ card-last-score:: 5
+ - **Deciphering** is the process of converting ciphertext back into plaintext using a cipher & a key.
+ - What is **Encryption**? #card
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-04T12:09:55.038Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.46
+ card-last-reviewed:: 2022-09-30T12:09:55.039Z
+ - **Encryption** is some mathematical function $E_K()$ mapping plaintext $P$ to ciphertext $C$ using the specified key $K$.
+ - $$C=E_K(P)$$
+ - What is **Decryption**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-04T12:13:15.777Z
+ card-last-reviewed:: 2022-09-30T12:13:15.777Z
+ card-last-score:: 3
+ - **Decryption** is some mathematical function ${E_K}^{-1}()$ mapping the ciphertext $C$ to plaintext $P$ using the specified key $K$.
+ - $$P={E_K}^{-1}(C)$$
+ - What is **Cryptanalysis**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:08:29.141Z
+ card-last-reviewed:: 2022-09-30T12:08:29.141Z
+ card-last-score:: 5
+ - **Cryptanalysis** is the study of principles & methods of transforming an unintelligible message into an intelligible message without knowledge of the key.
+ - What is **Cryptology**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-04T09:29:41.789Z
+ card-last-reviewed:: 2022-09-30T09:29:41.789Z
+ card-last-score:: 3
+ - **Cryptology** is the field encompassing both cryptography & cryptanalysis.
+ -
+-
+- ## Model of Conventional Cryptosystem
+ - {:height 304, :width 610}
+- ## Cryptanalysis via Letter Frequency Distribution
+ - Human languages are **redundant** - letters are not equally commonly used.
+ - In the **English** language:
+ - **E** is by far the most common letter followed by T, R, N, I, O, A, and S.
+ - Other letters like Z, J, K, Q, and X are fairly rare.
+ - Certain letter combinations like **TH** are quite common.
+ - 
+ -
+ - ### C Program for Frequency Analysis of single Characters
+ - ```c
+ #include
+ #include
+ #include
+
+ int main(int argc, char* argv[]) {
+ FILE* fp;
+ int data[26];
+ char c;
+
+ memset(data, 0, siezof(data));
+
+ if (argc != 2) {
+ return(-1);
+ }
+ if (fp = fopen(argv[1], "r" == NULL)) {
+ return(-2);
+ }
+
+ while(!feof(fp)) {
+ c = toupper(fgetc(fp));
+
+ if ((c >= 'A') && (c <= 'Z')) {
+ data[c-65]++;
+ }
+ }
+
+ for (int i = 0; i < 26; i++) {
+ printf("%c:%i\n", i+65, data[i]);
+ }
+
+ fclose(fp);
+ return(0);
+ }
+ ```
+- ## Known Plaintext Attacks (KPA)
+ - What is a **Known Plaintext Attack (KPA)**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-16T14:39:41.014Z
+ card-last-reviewed:: 2022-10-06T09:39:41.014Z
+ card-last-score:: 5
+ - The **Known Plaintext Attack (KPA)** is an attack model for cryptanalysis where the attacker has access to both:
+ - some of, or all of, the plaintext (called a **crib**)
+ - the ciphertext
+ -
+-
+- ## Caesar Cipher
+ - What is a **Caesar Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:09:58.027Z
+ card-last-reviewed:: 2022-09-30T12:09:58.027Z
+ card-last-score:: 5
+ - A **Caesar Cipher** involves using an offset alphabet to encrypt a message.
+ - We can use any shift from 1 to 25 to replace each plaintext letter with a letter a fixed distance away.
+ - The **key letter** represents the start of this offset alphabet.
+ - For example, a key letter of F means that A -> F, B -> G, and so on.
+- ## Playfair Cipher
+ - Not even the large number of keys in a monoalphabetic cipher provides security.
+ - What is a **monoalphabetic cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:08:03.733Z
+ card-last-reviewed:: 2022-09-30T12:08:03.733Z
+ card-last-score:: 5
+ - A **monoalphabetic cipher** is any cipher in which the letters of the plaintext are mapped to ciphertext letters based on a single alphabetic key.
+ - One approach to improving security over monoalphabetic ciphers is to to encrypt ^^multiple letters.^^
+ - The **Playfair Cipher** is one example of such an approach.
+ - The algorithm was invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair.
+ - ### How does the Playfair Cipher work?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-08T00:33:19.557Z
+ card-last-interval:: 3.51
+ card-ease-factor:: 2.6
+ card-last-reviewed:: 2022-10-04T12:33:19.558Z
+ - 
+ - 1. Create a 5x5 grid of letters; insert the keyword as shown, with each letter only considered once; fill the grid with the remaining letters in alphabetic order.
+ - 2. The letters are then encrypted in pairs.
+ - 3. Repeats have an "X" inserted.
+ - BALLOON -> BA LX LO ON
+ - 4. Letters that fall in the same row are replaced with the letter on the right.
+ - OK -> GM
+ - 5. Letters in the same column are replaced with the letter below.
+ - FO -> OU
+ - 6. Otherwise, each letter gets replaced by the letter in its row but in the other letters column.
+ - QM -> TH
+ - ### Security of the Playfair Cipher
+ - The security is much improved over simple monoalphabetic ciphers, as the Playfair Cipher has $26^2 = 676$ combinations.
+ - This requires a 676 entry frequency table to analyse (as compared to a 26 entry frequency table for a monoalphabetic cipher) and correspondingly, more ciphertext.
+ - However, the Playfair Cipher *can* be cracked through frequency analysis of letter pairs, given a few hundred letters.
+ -
+- ## Vigenère Cipher
+ - [Blaise de Vigenère](https://en.wikipedia.org/wiki/Blaise_de_Vigen%C3%A8re) is generally credited as the inventor of the **Polyalphabetic Substitution Cipher**.
+ - What is a **Polyalphabetic Substitution Cipher**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T09:29:32.337Z
+ card-last-score:: 1
+ - A **Polyalphabetic Substitution Cipher** uses multiple substitution alphabets, as opposed to a monoalphabetic cipher which uses a single alphabetic key.
+ - The Vigenère Cipher improves security by using many monoalphabetic substitution alphabets, so each letter can be replaced by many others.
+ - You use a **key** to select which alphabet is used for each letter of the message.
+ - The $i^{th}$ letter of the key specifies the $i^{th}$ alphabet to use.
+ - Use each alphabet in turn.
+ - Repeat from the start after the end of the key is reached.
+ -
+ - ### Vigenère Steps
+ - 
+ - 1. Write the plaintext out, and write the keyword underneath it, repeated, for the length of the plaintext.
+ - 2. Use each key letter in turn as a Caesar cipher key.
+ - 3. Encrypt the corresponding plaintext letter.
+ - In this example, we use the keyword "CIPHER". Hence, we have the following translation alphabets:
+ - 
+ - ### How to crack the Vigenère Cipher
+ - 1. Search the ciphertext for repeated strings of letters - the longer the string, the better.
+ - 2. For each occurrence of a repeated string, count how many letters are between the first letters in the string, and add one.
+ - 3. Factorise that number.
+ - 4. Repeat this process with each repeated string you find and make a table of common factors. The most common factor, $n$ is most likely the length of the keyword used to encipher the ciphertext.
+ - 5. Do a frequency count on the ciphertext, on every $n^{th}$ letter. You should end up with $n$ different frequency counts.
+ - 6. Compare these counts to standard frequency tables to figure out how much each letter was shifted by.
+ - 7. Undo the shifts and read the message.
+- ## Enigma (Rotor Ciphers)
+ - ### Rotor Ciphers
+ - The mechanisation / automation of encryption.
+ - An $\text{N}$-stage polyalphabetic algorithm modulo 26.
+ - $26^N$ steps before a repetition, where $N$ is the number of cylinders.
+ - The Enigma machine had 5 cylinders, so:
+ - $$26^{N=5}=11,881,376 \text{ steps}$$
+ -
+ - ### Breaking Enigma using **Cribs**
+ - The starting point for breaking Enigma was based on the following:
+ - Plaintext messages were likely to contain certain phrases.
+ - Weather reports contained the term "WETTER VORHERSAGE".
+ - Military units often sent messages containing "KEINE BESONDEREN EREIGNISSE" ("nothing to report").
+ - A plaintext letter was never mapped onto the same ciphertext letter.
+ - While the cryptanalysts in Bletchely Park did not know exactly where these cribs were placed in an intercepted message, they could exclude certain positions.
+ - 
+ - From here, possible rotor start positions & rotor wiring would be systematically examined using the "bombe" - an electromechanical device designed by Turing that replicated the action of several Enigma machines wired together.
+ -
+- ## Transposition Ciphers
+ - What are **Transposition Ciphers**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-04T09:08:18.147Z
+ card-last-reviewed:: 2022-09-30T09:08:18.150Z
+ card-last-score:: 3
+ - **Transposition** or **Permutation Ciphers** hide the message by rearranging the letter order ^^without altering the actual letters used.^^
+ - This can be recognised since the ciphertext has the same frequency distribution as the original text.
+ - ### Rail Fence Cipher
+ - Write plaintext letters out diagonally over a number of rows, then read off the cipher row by row.
+ - 
+ - ### Row Transposition Cipher
+ - What are **Row Transposition Ciphers**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-03T19:11:23.311Z
+ card-last-reviewed:: 2022-09-30T09:11:23.312Z
+ card-last-score:: 3
+ - **Row Transposition Ciphers** are a more complex kind of transposition cipher than Rail Fence Ciphers.
+ - Plaintext letters are written out in rows over a specified number of columns.
+ - The columns are then re-ordered according to some key before reading off the columns
+ - 
+-
+- ## Product Ciphers
+ - Ciphers using just substitutions or transpositions are not secure because of language characteristics.
+ - Consider using several ciphers in succession to make it harder to crack:
+ - Two substitutions make a more complex substitution.
+ - Two transpositions make a more complex transposition.
+ - However, a substitution followed by a transposition makes a much harder cipher.
+ -
+-
+- # Steganography
+ - What is **Steganography**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-08T12:33:34.285Z
+ card-last-reviewed:: 2022-10-04T12:33:34.285Z
+ card-last-score:: 5
+ - **Steganography** is an alternative to encryption that hides the existence of the message.
+ - For example:
+ - Using only a subset of letters / words in a message marked in some way.
+ - Using invisible ink.
+ - Hiding in LSB in graphic image or sound file.
+ - The drawback of steganography is that it's not very economical in terms of overheads to hide a message.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-10-10T11_59_52.408Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-10-10T11_59_52.408Z.Desktop.md
new file mode 100644
index 00000000..e85833bf
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-10-10T11_59_52.408Z.Desktop.md
@@ -0,0 +1,316 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[GDPR]]
+- **Next Topic:** [[Human Security & Passwords]]
+- **Relevant Slides:** 
+ id:: 63265db7-1d41-44f7-b4cf-0bab377a7c1c
+-
+- ## SQL Injections
+ - What is an **SQL Injection**? #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:58:54.850Z
+ card-last-reviewed:: 2022-10-08T22:58:54.851Z
+ card-last-score:: 5
+ -
+ - An **SQL Injection** is a ***code injection technique*** used to attack data-driven applications, in which malicious SQL statements are inserted for execution.
+ - It is a way of exploiting user input & SQL statements to compromise the database & retrieve sensitive data.
+-
+- ## Basic Terminology
+ - What is **Cryptography**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-11-10T01:19:02.918Z
+ card-last-reviewed:: 2022-10-07T10:19:02.918Z
+ card-last-score:: 5
+ - **Cryptography** is the art of encompassing the principles & methods of transforming an intelligible message into one that is unintelligible, and then retransforming that message back into its original form.
+ - What is **Plaintext**?
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-17T21:24:55.999Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-06T17:24:55.999Z
+ - **Plaintext** is the ^^original, intelligible message.^^
+ - What is **Ciphertext**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-18T14:39:00.206Z
+ card-last-reviewed:: 2022-10-07T10:39:00.207Z
+ card-last-score:: 5
+ - **Ciphertext** is the encrypted messsage.
+ - What is a **Cipher**? #card
+ card-last-interval:: 4.14
+ card-repeats:: 2
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T01:43:58.055Z
+ card-last-reviewed:: 2022-10-08T22:43:58.056Z
+ card-last-score:: 5
+ - A **Cipher** is an algorithm for transforming an intelligible message into one that is unintelligible.
+ - What is a **Key**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:47:20.304Z
+ card-last-reviewed:: 2022-10-07T10:47:20.304Z
+ card-last-score:: 3
+ - A **Key** is some critical information used by the cipher, known only to the sender & receiver, selected from a **keyspace** (the set of all possible keys).
+ - What does **Encipher** mean?
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-17T21:14:43.789Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-06T17:14:43.790Z
+ - **Enciphering** is the process of converting plaintext into ciphertext using a cipher & a key.
+ - What does **Decipher** mean?
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:09:14.829Z
+ card-last-reviewed:: 2022-09-30T12:09:14.829Z
+ card-last-score:: 5
+ - **Deciphering** is the process of converting ciphertext back into plaintext using a cipher & a key.
+ - What is **Encryption**? #card
+ card-last-score:: 3
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-16T16:40:50.413Z
+ card-last-interval:: 9.28
+ card-ease-factor:: 2.32
+ card-last-reviewed:: 2022-10-07T10:40:50.414Z
+ - **Encryption** is some mathematical function $E_K()$ mapping plaintext $P$ to ciphertext $C$ using the specified key $K$.
+ - $$E_K(P) = C$$
+ - What is **Decryption**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:22:54.739Z
+ card-last-score:: 1
+ - **Decryption** is some mathematical function ${E_K}^{-1}()$ mapping the ciphertext $C$ to plaintext $P$ using the specified key $K$.
+ - $$P={E_K}^{-1}(C)$$
+ - What is **Cryptanalysis**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-17T21:28:14.325Z
+ card-last-reviewed:: 2022-10-06T17:28:14.325Z
+ card-last-score:: 5
+ - **Cryptanalysis** is the study of principles & methods of transforming an unintelligible message into an intelligible message without knowledge of the key.
+ - What is **Cryptology**?
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-16T16:40:03.776Z
+ card-last-reviewed:: 2022-10-07T10:40:03.777Z
+ card-last-score:: 5
+ - **Cryptology** is the field encompassing both cryptography & cryptanalysis.
+ -
+-
+- ## Model of Conventional Cryptosystem
+ - {:height 304, :width 610}
+- ## Cryptanalysis via Letter Frequency Distribution
+ - Human languages are **redundant** - letters are not equally commonly used.
+ - In the **English** language:
+ - **E** is by far the most common letter followed by T, R, N, I, O, A, and S.
+ - Other letters like Z, J, K, Q, and X are fairly rare.
+ - Certain letter combinations like **TH** are quite common.
+ - 
+ -
+ - ### C Program for Frequency Analysis of single Characters
+ - ```c
+ #include
+ #include
+ #include
+
+ int main(int argc, char* argv[]) {
+ FILE* fp;
+ int data[26];
+ char c;
+
+ memset(data, 0, siezof(data));
+
+ if (argc != 2) {
+ return(-1);
+ }
+ if (fp = fopen(argv[1], "r" == NULL)) {
+ return(-2);
+ }
+
+ while(!feof(fp)) {
+ c = toupper(fgetc(fp));
+
+ if ((c >= 'A') && (c <= 'Z')) {
+ data[c-65]++;
+ }
+ }
+
+ for (int i = 0; i < 26; i++) {
+ printf("%c:%i\n", i+65, data[i]);
+ }
+
+ fclose(fp);
+ return(0);
+ }
+ ```
+- ## Known Plaintext Attacks (KPA)
+ - What is a **Known Plaintext Attack (KPA)**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-16T14:39:41.014Z
+ card-last-reviewed:: 2022-10-06T09:39:41.014Z
+ card-last-score:: 5
+ - The **Known Plaintext Attack (KPA)** is an attack model for cryptanalysis where the attacker has access to both:
+ - some of, or all of, the plaintext (called a **crib**)
+ - the ciphertext
+ -
+-
+- ## Caesar Cipher
+ - What is a **Caesar Cipher**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-17T21:27:16.902Z
+ card-last-reviewed:: 2022-10-06T17:27:16.903Z
+ card-last-score:: 5
+ - A **Caesar Cipher** involves using an offset alphabet to encrypt a message.
+ - We can use any shift from 1 to 25 to replace each plaintext letter with a letter a fixed distance away.
+ - The **key letter** represents the start of this offset alphabet.
+ - For example, a key letter of F means that A -> F, B -> G, and so on.
+- ## Playfair Cipher
+ - Not even the large number of keys in a monoalphabetic cipher provides security.
+ - What is a **monoalphabetic cipher**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-16T22:27:13.914Z
+ card-last-reviewed:: 2022-10-06T17:27:13.915Z
+ card-last-score:: 3
+ - A **monoalphabetic cipher** is any cipher in which the letters of the plaintext are mapped to ciphertext letters based on a single alphabetic key.
+ - One approach to improving security over monoalphabetic ciphers is to to encrypt ^^multiple letters.^^
+ - The **Playfair Cipher** is one example of such an approach.
+ - The algorithm was invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair.
+ - ### How does the Playfair Cipher work?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-08T00:33:19.557Z
+ card-last-interval:: 3.51
+ card-ease-factor:: 2.6
+ card-last-reviewed:: 2022-10-04T12:33:19.558Z
+ - 
+ - 1. Create a 5x5 grid of letters; insert the keyword as shown, with each letter only considered once; fill the grid with the remaining letters in alphabetic order.
+ - 2. The letters are then encrypted in pairs.
+ - 3. Repeats have an "X" inserted.
+ - BALLOON -> BA LX LO ON
+ - 4. Letters that fall in the same row are replaced with the letter on the right.
+ - OK -> GM
+ - 5. Letters in the same column are replaced with the letter below.
+ - FO -> OU
+ - 6. Otherwise, each letter gets replaced by the letter in its row but in the other letters column.
+ - QM -> TH
+ - ### Security of the Playfair Cipher
+ - The security is much improved over simple monoalphabetic ciphers, as the Playfair Cipher has $26^2 = 676$ combinations.
+ - This requires a 676 entry frequency table to analyse (as compared to a 26 entry frequency table for a monoalphabetic cipher) and correspondingly, more ciphertext.
+ - However, the Playfair Cipher *can* be cracked through frequency analysis of letter pairs, given a few hundred letters.
+ -
+- ## Vigenère Cipher
+ - [Blaise de Vigenère](https://en.wikipedia.org/wiki/Blaise_de_Vigen%C3%A8re) is generally credited as the inventor of the **Polyalphabetic Substitution Cipher**.
+ - What is a **Polyalphabetic Substitution Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:31:42.282Z
+ card-last-reviewed:: 2022-10-07T10:31:42.283Z
+ card-last-score:: 5
+ - A **Polyalphabetic Substitution Cipher** uses multiple substitution alphabets, as opposed to a monoalphabetic cipher which uses a single alphabetic key.
+ - The Vigenère Cipher improves security by using many monoalphabetic substitution alphabets, so each letter can be replaced by many others.
+ - You use a **key** to select which alphabet is used for each letter of the message.
+ - The $i^{th}$ letter of the key specifies the $i^{th}$ alphabet to use.
+ - Use each alphabet in turn.
+ - Repeat from the start after the end of the key is reached.
+ -
+ - ### Vigenère Steps
+ - 
+ - 1. Write the plaintext out, and write the keyword underneath it, repeated, for the length of the plaintext.
+ - 2. Use each key letter in turn as a Caesar cipher key.
+ - 3. Encrypt the corresponding plaintext letter.
+ - In this example, we use the keyword "CIPHER". Hence, we have the following translation alphabets:
+ - 
+ - ### How to crack the Vigenère Cipher
+ - 1. Search the ciphertext for repeated strings of letters - the longer the string, the better.
+ - 2. For each occurrence of a repeated string, count how many letters are between the first letters in the string, and add one.
+ - 3. Factorise that number.
+ - 4. Repeat this process with each repeated string you find and make a table of common factors. The most common factor, $n$ is most likely the length of the keyword used to encipher the ciphertext.
+ - 5. Do a frequency count on the ciphertext, on every $n^{th}$ letter. You should end up with $n$ different frequency counts.
+ - 6. Compare these counts to standard frequency tables to figure out how much each letter was shifted by.
+ - 7. Undo the shifts and read the message.
+- ## Enigma (Rotor Ciphers)
+ - ### Rotor Ciphers
+ - The mechanisation / automation of encryption.
+ - An $\text{N}$-stage polyalphabetic algorithm modulo 26.
+ - $26^N$ steps before a repetition, where $N$ is the number of cylinders.
+ - The Enigma machine had 5 cylinders, so:
+ - $$26^{N=5}=11,881,376 \text{ steps}$$
+ -
+ - ### Breaking Enigma using **Cribs**
+ - The starting point for breaking Enigma was based on the following:
+ - Plaintext messages were likely to contain certain phrases.
+ - Weather reports contained the term "WETTER VORHERSAGE".
+ - Military units often sent messages containing "KEINE BESONDEREN EREIGNISSE" ("nothing to report").
+ - A plaintext letter was never mapped onto the same ciphertext letter.
+ - While the cryptanalysts in Bletchely Park did not know exactly where these cribs were placed in an intercepted message, they could exclude certain positions.
+ - 
+ - From here, possible rotor start positions & rotor wiring would be systematically examined using the "bombe" - an electromechanical device designed by Turing that replicated the action of several Enigma machines wired together.
+ -
+- ## Transposition Ciphers
+ - What are **Transposition Ciphers**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-16T07:39:25.895Z
+ card-last-reviewed:: 2022-10-07T10:39:25.895Z
+ card-last-score:: 3
+ - **Transposition** or **Permutation Ciphers** hide the message by rearranging the letter order ^^without altering the actual letters used.^^
+ - This can be recognised since the ciphertext has the same frequency distribution as the original text.
+ - ### Rail Fence Cipher
+ - Write plaintext letters out diagonally over a number of rows, then read off the cipher row by row.
+ - 
+ - ### Row Transposition Cipher
+ - What are **Row Transposition Ciphers**? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-01T22:18:29.590Z
+ card-last-reviewed:: 2022-10-06T17:18:29.591Z
+ card-last-score:: 5
+ - **Row Transposition Ciphers** are a more complex kind of transposition cipher than Rail Fence Ciphers.
+ - Plaintext letters are written out in rows over a specified number of columns.
+ - The columns are then re-ordered according to some key before reading off the columns
+ - 
+-
+- ## Product Ciphers
+ - Ciphers using just substitutions or transpositions are not secure because of language characteristics.
+ - Consider using several ciphers in succession to make it harder to crack:
+ - Two substitutions make a more complex substitution.
+ - Two transpositions make a more complex transposition.
+ - However, a substitution followed by a transposition makes a much harder cipher.
+ -
+-
+- # Steganography
+ - What is **Steganography**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-20T12:50:18.491Z
+ card-last-reviewed:: 2022-10-09T08:50:18.492Z
+ card-last-score:: 5
+ - **Steganography** is an alternative to encryption that hides the existence of the message.
+ - For example:
+ - Using only a subset of letters / words in a message marked in some way.
+ - Using invisible ink.
+ - Hiding in LSB in graphic image or sound file.
+ - The drawback of steganography is that it's not very economical in terms of overheads to hide a message.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-11-09T13_03_58.123Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-11-09T13_03_58.123Z.Desktop.md
new file mode 100644
index 00000000..4a236c01
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-11-09T13_03_58.123Z.Desktop.md
@@ -0,0 +1,316 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[GDPR]]
+- **Next Topic:** [[Human Security & Passwords]]
+- **Relevant Slides:** 
+ id:: 63265db7-1d41-44f7-b4cf-0bab377a7c1c
+-
+- ## SQL Injections
+ - What is an **SQL Injection**? #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:58:54.850Z
+ card-last-reviewed:: 2022-10-08T22:58:54.851Z
+ card-last-score:: 5
+ -
+ - An **SQL Injection** is a ***code injection technique*** used to attack data-driven applications, in which malicious SQL statements are inserted for execution.
+ - It is a way of exploiting user input & SQL statements to compromise the database & retrieve sensitive data.
+-
+- ## Basic Terminology
+ - What is **Cryptography**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-11-10T01:19:02.918Z
+ card-last-reviewed:: 2022-10-07T10:19:02.918Z
+ card-last-score:: 5
+ - **Cryptography** is the art of encompassing the principles & methods of transforming an intelligible message into one that is unintelligible, and then retransforming that message back into its original form.
+ - What is **Plaintext**?
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-17T21:24:55.999Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-06T17:24:55.999Z
+ - **Plaintext** is the ^^original, intelligible message.^^
+ - What is **Ciphertext**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-18T14:39:00.206Z
+ card-last-reviewed:: 2022-10-07T10:39:00.207Z
+ card-last-score:: 5
+ - **Ciphertext** is the encrypted messsage.
+ - What is a **Cipher**? #card
+ card-last-interval:: 4.14
+ card-repeats:: 2
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T01:43:58.055Z
+ card-last-reviewed:: 2022-10-08T22:43:58.056Z
+ card-last-score:: 5
+ - A **Cipher** is an algorithm for transforming an intelligible message into one that is unintelligible.
+ - What is a **Key**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:47:20.304Z
+ card-last-reviewed:: 2022-10-07T10:47:20.304Z
+ card-last-score:: 3
+ - A **Key** is some critical information used by the cipher, known only to the sender & receiver, selected from a **keyspace** (the set of all possible keys).
+ - What does **Encipher** mean?
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-17T21:14:43.789Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-06T17:14:43.790Z
+ - **Enciphering** is the process of converting plaintext into ciphertext using a cipher & a key.
+ - What does **Decipher** mean?
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:09:14.829Z
+ card-last-reviewed:: 2022-09-30T12:09:14.829Z
+ card-last-score:: 5
+ - **Deciphering** is the process of converting ciphertext back into plaintext using a cipher & a key.
+ - What is **Encryption**? #card
+ card-last-score:: 3
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-16T16:40:50.413Z
+ card-last-interval:: 9.28
+ card-ease-factor:: 2.32
+ card-last-reviewed:: 2022-10-07T10:40:50.414Z
+ - **Encryption** is some mathematical function $E_K()$ mapping plaintext $P$ to ciphertext $C$ using the specified key $K$.
+ - $$E_K(P) = C$$
+ - What is **Decryption**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-14T11:37:04.045Z
+ card-last-reviewed:: 2022-10-10T11:37:04.046Z
+ card-last-score:: 5
+ - **Decryption** is some mathematical function ${E_K}^{-1}()$ mapping the ciphertext $C$ to plaintext $P$ using the specified key $K$.
+ - $$P={E_K}^{-1}(C)$$
+ - What is **Cryptanalysis**? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-16T15:43:11.780Z
+ card-last-reviewed:: 2022-10-19T08:43:11.781Z
+ card-last-score:: 3
+ - **Cryptanalysis** is the study of principles & methods of transforming an unintelligible message into an intelligible message without knowledge of the key.
+ - What is **Cryptology**?
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-16T16:40:03.776Z
+ card-last-reviewed:: 2022-10-07T10:40:03.777Z
+ card-last-score:: 5
+ - **Cryptology** is the field encompassing both cryptography & cryptanalysis.
+ -
+-
+- ## Model of Conventional Cryptosystem
+ - {:height 304, :width 610}
+- ## Cryptanalysis via Letter Frequency Distribution
+ - Human languages are **redundant** - letters are not equally commonly used.
+ - In the **English** language:
+ - **E** is by far the most common letter followed by T, R, N, I, O, A, and S.
+ - Other letters like Z, J, K, Q, and X are fairly rare.
+ - Certain letter combinations like **TH** are quite common.
+ - 
+ -
+ - ### C Program for Frequency Analysis of single Characters
+ - ```c
+ #include
+ #include
+ #include
+
+ int main(int argc, char* argv[]) {
+ FILE* fp;
+ int data[26];
+ char c;
+
+ memset(data, 0, siezof(data));
+
+ if (argc != 2) {
+ return(-1);
+ }
+ if (fp = fopen(argv[1], "r" == NULL)) {
+ return(-2);
+ }
+
+ while(!feof(fp)) {
+ c = toupper(fgetc(fp));
+
+ if ((c >= 'A') && (c <= 'Z')) {
+ data[c-65]++;
+ }
+ }
+
+ for (int i = 0; i < 26; i++) {
+ printf("%c:%i\n", i+65, data[i]);
+ }
+
+ fclose(fp);
+ return(0);
+ }
+ ```
+- ## Known Plaintext Attacks (KPA)
+ - What is a **Known Plaintext Attack (KPA)**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-16T14:39:41.014Z
+ card-last-reviewed:: 2022-10-06T09:39:41.014Z
+ card-last-score:: 5
+ - The **Known Plaintext Attack (KPA)** is an attack model for cryptanalysis where the attacker has access to both:
+ - some of, or all of, the plaintext (called a **crib**)
+ - the ciphertext
+ -
+-
+- ## Caesar Cipher
+ - What is a **Caesar Cipher**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-17T21:27:16.902Z
+ card-last-reviewed:: 2022-10-06T17:27:16.903Z
+ card-last-score:: 5
+ - A **Caesar Cipher** involves using an offset alphabet to encrypt a message.
+ - We can use any shift from 1 to 25 to replace each plaintext letter with a letter a fixed distance away.
+ - The **key letter** represents the start of this offset alphabet.
+ - For example, a key letter of F means that A -> F, B -> G, and so on.
+- ## Playfair Cipher
+ - Not even the large number of keys in a monoalphabetic cipher provides security.
+ - What is a **monoalphabetic cipher**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-16T22:27:13.914Z
+ card-last-reviewed:: 2022-10-06T17:27:13.915Z
+ card-last-score:: 3
+ - A **monoalphabetic cipher** is any cipher in which the letters of the plaintext are mapped to ciphertext letters based on a single alphabetic key.
+ - One approach to improving security over monoalphabetic ciphers is to to encrypt ^^multiple letters.^^
+ - The **Playfair Cipher** is one example of such an approach.
+ - The algorithm was invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair.
+ - ### How does the Playfair Cipher work?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-08T00:33:19.557Z
+ card-last-interval:: 3.51
+ card-ease-factor:: 2.6
+ card-last-reviewed:: 2022-10-04T12:33:19.558Z
+ - 
+ - 1. Create a 5x5 grid of letters; insert the keyword as shown, with each letter only considered once; fill the grid with the remaining letters in alphabetic order.
+ - 2. The letters are then encrypted in pairs.
+ - 3. Repeats have an "X" inserted.
+ - BALLOON -> BA LX LO ON
+ - 4. Letters that fall in the same row are replaced with the letter on the right.
+ - OK -> GM
+ - 5. Letters in the same column are replaced with the letter below.
+ - FO -> OU
+ - 6. Otherwise, each letter gets replaced by the letter in its row but in the other letters column.
+ - QM -> TH
+ - ### Security of the Playfair Cipher
+ - The security is much improved over simple monoalphabetic ciphers, as the Playfair Cipher has $26^2 = 676$ combinations.
+ - This requires a 676 entry frequency table to analyse (as compared to a 26 entry frequency table for a monoalphabetic cipher) and correspondingly, more ciphertext.
+ - However, the Playfair Cipher *can* be cracked through frequency analysis of letter pairs, given a few hundred letters.
+ -
+- ## Vigenère Cipher
+ - [Blaise de Vigenère](https://en.wikipedia.org/wiki/Blaise_de_Vigen%C3%A8re) is generally credited as the inventor of the **Polyalphabetic Substitution Cipher**.
+ - What is a **Polyalphabetic Substitution Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:31:42.282Z
+ card-last-reviewed:: 2022-10-07T10:31:42.283Z
+ card-last-score:: 5
+ - A **Polyalphabetic Substitution Cipher** uses multiple substitution alphabets, as opposed to a monoalphabetic cipher which uses a single alphabetic key.
+ - The Vigenère Cipher improves security by using many monoalphabetic substitution alphabets, so each letter can be replaced by many others.
+ - You use a **key** to select which alphabet is used for each letter of the message.
+ - The $i^{th}$ letter of the key specifies the $i^{th}$ alphabet to use.
+ - Use each alphabet in turn.
+ - Repeat from the start after the end of the key is reached.
+ -
+ - ### Vigenère Steps
+ - 
+ - 1. Write the plaintext out, and write the keyword underneath it, repeated, for the length of the plaintext.
+ - 2. Use each key letter in turn as a Caesar cipher key.
+ - 3. Encrypt the corresponding plaintext letter.
+ - In this example, we use the keyword "CIPHER". Hence, we have the following translation alphabets:
+ - 
+ - ### How to crack the Vigenère Cipher
+ - 1. Search the ciphertext for repeated strings of letters - the longer the string, the better.
+ - 2. For each occurrence of a repeated string, count how many letters are between the first letters in the string, and add one.
+ - 3. Factorise that number.
+ - 4. Repeat this process with each repeated string you find and make a table of common factors. The most common factor, $n$ is most likely the length of the keyword used to encipher the ciphertext.
+ - 5. Do a frequency count on the ciphertext, on every $n^{th}$ letter. You should end up with $n$ different frequency counts.
+ - 6. Compare these counts to standard frequency tables to figure out how much each letter was shifted by.
+ - 7. Undo the shifts and read the message.
+- ## Enigma (Rotor Ciphers)
+ - ### Rotor Ciphers
+ - The mechanisation / automation of encryption.
+ - An $\text{N}$-stage polyalphabetic algorithm modulo 26.
+ - $26^N$ steps before a repetition, where $N$ is the number of cylinders.
+ - The Enigma machine had 5 cylinders, so:
+ - $$26^{N=5}=11,881,376 \text{ steps}$$
+ -
+ - ### Breaking Enigma using **Cribs**
+ - The starting point for breaking Enigma was based on the following:
+ - Plaintext messages were likely to contain certain phrases.
+ - Weather reports contained the term "WETTER VORHERSAGE".
+ - Military units often sent messages containing "KEINE BESONDEREN EREIGNISSE" ("nothing to report").
+ - A plaintext letter was never mapped onto the same ciphertext letter.
+ - While the cryptanalysts in Bletchely Park did not know exactly where these cribs were placed in an intercepted message, they could exclude certain positions.
+ - 
+ - From here, possible rotor start positions & rotor wiring would be systematically examined using the "bombe" - an electromechanical device designed by Turing that replicated the action of several Enigma machines wired together.
+ -
+- ## Transposition Ciphers
+ - What are **Transposition Ciphers**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-16T07:39:25.895Z
+ card-last-reviewed:: 2022-10-07T10:39:25.895Z
+ card-last-score:: 3
+ - **Transposition** or **Permutation Ciphers** hide the message by rearranging the letter order ^^without altering the actual letters used.^^
+ - This can be recognised since the ciphertext has the same frequency distribution as the original text.
+ - ### Rail Fence Cipher
+ - Write plaintext letters out diagonally over a number of rows, then read off the cipher row by row.
+ - 
+ - ### Row Transposition Cipher
+ - What are **Row Transposition Ciphers**? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-01T22:18:29.590Z
+ card-last-reviewed:: 2022-10-06T17:18:29.591Z
+ card-last-score:: 5
+ - **Row Transposition Ciphers** are a more complex kind of transposition cipher than Rail Fence Ciphers.
+ - Plaintext letters are written out in rows over a specified number of columns.
+ - The columns are then re-ordered according to some key before reading off the columns
+ - 
+-
+- ## Product Ciphers
+ - Ciphers using just substitutions or transpositions are not secure because of language characteristics.
+ - Consider using several ciphers in succession to make it harder to crack:
+ - Two substitutions make a more complex substitution.
+ - Two transpositions make a more complex transposition.
+ - However, a substitution followed by a transposition makes a much harder cipher.
+ -
+-
+- # Steganography
+ - What is **Steganography**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-20T12:50:18.491Z
+ card-last-reviewed:: 2022-10-09T08:50:18.492Z
+ card-last-score:: 5
+ - **Steganography** is an alternative to encryption that hides the existence of the message.
+ - For example:
+ - Using only a subset of letters / words in a message marked in some way.
+ - Using invisible ink.
+ - Hiding in LSB in graphic image or sound file.
+ - The drawback of steganography is that it's not very economical in terms of overheads to hide a message.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-11-11T12_04_45.345Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-11-11T12_04_45.345Z.Desktop.md
new file mode 100644
index 00000000..03788651
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Cryptography/2022-11-11T12_04_45.345Z.Desktop.md
@@ -0,0 +1,317 @@
+- #[[CT255 - Next Generation Technologies II]]
+- **Previous Topic:** [[GDPR]]
+- **Next Topic:** [[Human Security & Passwords]]
+- **Relevant Slides:** 
+ id:: 63265db7-1d41-44f7-b4cf-0bab377a7c1c
+-
+- ## SQL Injections
+ - What is an **SQL Injection**? #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:58:54.850Z
+ card-last-reviewed:: 2022-10-08T22:58:54.851Z
+ card-last-score:: 5
+ -
+ - An **SQL Injection** is a ***code injection technique*** used to attack data-driven applications, in which malicious SQL statements are inserted for execution.
+ - It is a way of exploiting user input & SQL statements to compromise the database & retrieve sensitive data.
+-
+- ## Basic Terminology
+ - What is **Cryptography**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-11-10T01:19:02.918Z
+ card-last-reviewed:: 2022-10-07T10:19:02.918Z
+ card-last-score:: 5
+ - **Cryptography** is the art of encompassing the principles & methods of transforming an intelligible message into one that is unintelligible, and then retransforming that message back into its original form.
+ - What is **Plaintext**?
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-17T21:24:55.999Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-06T17:24:55.999Z
+ - **Plaintext** is the ^^original, intelligible message.^^
+ - What is **Ciphertext**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-18T14:39:00.206Z
+ card-last-reviewed:: 2022-10-07T10:39:00.207Z
+ card-last-score:: 5
+ - **Ciphertext** is the encrypted messsage.
+ - What is a **Cipher**? #card
+ card-last-interval:: 4.14
+ card-repeats:: 2
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T01:43:58.055Z
+ card-last-reviewed:: 2022-10-08T22:43:58.056Z
+ card-last-score:: 5
+ - A **Cipher** is an algorithm for transforming an intelligible message into one that is unintelligible.
+ - What is a **Key**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:47:20.304Z
+ card-last-reviewed:: 2022-10-07T10:47:20.304Z
+ card-last-score:: 3
+ - A **Key** is some critical information used by the cipher, known only to the sender & receiver, selected from a **keyspace** (the set of all possible keys).
+ - What does **Encipher** mean?
+ card-last-score:: 5
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-17T21:14:43.789Z
+ card-last-interval:: 11.2
+ card-ease-factor:: 2.8
+ card-last-reviewed:: 2022-10-06T17:14:43.790Z
+ - **Enciphering** is the process of converting plaintext into ciphertext using a cipher & a key.
+ - What does **Decipher** mean?
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:09:14.829Z
+ card-last-reviewed:: 2022-09-30T12:09:14.829Z
+ card-last-score:: 5
+ - **Deciphering** is the process of converting ciphertext back into plaintext using a cipher & a key.
+ - What is **Encryption**? #card
+ card-last-score:: 3
+ card-repeats:: 3
+ card-next-schedule:: 2022-10-16T16:40:50.413Z
+ card-last-interval:: 9.28
+ card-ease-factor:: 2.32
+ card-last-reviewed:: 2022-10-07T10:40:50.414Z
+ - **Encryption** is some mathematical function $E_K()$ mapping plaintext $P$ to ciphertext $C$ using the specified key $K$.
+ - $$E_K(P) = C$$
+ - What is **Decryption**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-14T11:37:04.045Z
+ card-last-reviewed:: 2022-10-10T11:37:04.046Z
+ card-last-score:: 5
+ - **Decryption** is some mathematical function ${E_K}^{-1}()$ mapping the ciphertext $C$ to plaintext $P$ using the specified key $K$.
+ - $$P={E_K}^{-1}(C)$$
+ - What is **Cryptanalysis**? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-16T15:43:11.780Z
+ card-last-reviewed:: 2022-10-19T08:43:11.781Z
+ card-last-score:: 3
+ - **Cryptanalysis** is the study of principles & methods of transforming an unintelligible message into an intelligible message without knowledge of the key.
+ - What is **Cryptology**?
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-16T16:40:03.776Z
+ card-last-reviewed:: 2022-10-07T10:40:03.777Z
+ card-last-score:: 5
+ - **Cryptology** is the field encompassing both cryptography & cryptanalysis.
+ -
+-
+- ## Model of Conventional Cryptosystem
+ - {:height 304, :width 610}
+- ## Cryptanalysis via Letter Frequency Distribution
+ - Human languages are **redundant** - letters are not equally commonly used.
+ - In the **English** language:
+ - **E** is by far the most common letter followed by T, R, N, I, O, A, and S.
+ - Other letters like Z, J, K, Q, and X are fairly rare.
+ - Certain letter combinations like **TH** are quite common.
+ - 
+ -
+ - ### C Program for Frequency Analysis of single Characters
+ - ```c
+ #include
+ #include
+ #include
+
+ int main(int argc, char* argv[]) {
+ FILE* fp;
+ int data[26];
+ char c;
+
+ memset(data, 0, siezof(data));
+
+ if (argc != 2) {
+ return(-1);
+ }
+ if (fp = fopen(argv[1], "r" == NULL)) {
+ return(-2);
+ }
+
+ while(!feof(fp)) {
+ c = toupper(fgetc(fp));
+
+ if ((c >= 'A') && (c <= 'Z')) {
+ data[c-65]++;
+ }
+ }
+
+ for (int i = 0; i < 26; i++) {
+ printf("%c:%i\n", i+65, data[i]);
+ }
+
+ fclose(fp);
+ return(0);
+ }
+ ```
+- ## Known Plaintext Attacks (KPA)
+ - What is a **Known Plaintext Attack (KPA)**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-16T14:39:41.014Z
+ card-last-reviewed:: 2022-10-06T09:39:41.014Z
+ card-last-score:: 5
+ - The **Known Plaintext Attack (KPA)** is an attack model for cryptanalysis where the attacker has access to both:
+ - some of, or all of, the plaintext (called a **crib**)
+ - the ciphertext
+ -
+-
+- ## Caesar Cipher
+ - What is a **Caesar Cipher**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-17T21:27:16.902Z
+ card-last-reviewed:: 2022-10-06T17:27:16.903Z
+ card-last-score:: 5
+ - A **Caesar Cipher** involves using an offset alphabet to encrypt a message.
+ - We can use any shift from 1 to 25 to replace each plaintext letter with a letter a fixed distance away.
+ - The **key letter** represents the start of this offset alphabet.
+ - For example, a key letter of F means that A -> F, B -> G, and so on.
+- ## Playfair Cipher
+ - Not even the large number of keys in a monoalphabetic cipher provides security.
+ - What is a **monoalphabetic cipher**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-16T22:27:13.914Z
+ card-last-reviewed:: 2022-10-06T17:27:13.915Z
+ card-last-score:: 3
+ - A **monoalphabetic cipher** is any cipher in which the letters of the plaintext are mapped to ciphertext letters based on a single alphabetic key.
+ - One approach to improving security over monoalphabetic ciphers is to to encrypt ^^multiple letters.^^
+ - The **Playfair Cipher** is one example of such an approach.
+ - The algorithm was invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair.
+ - ### How does the Playfair Cipher work?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-10-08T00:33:19.557Z
+ card-last-interval:: 3.51
+ card-ease-factor:: 2.6
+ card-last-reviewed:: 2022-10-04T12:33:19.558Z
+ - 
+ - 1. Create a 5x5 grid of letters; insert the keyword as shown, with each letter only considered once; fill the grid with the remaining letters in alphabetic order.
+ - 2. The letters are then encrypted in pairs.
+ - 3. Repeats have an "X" inserted.
+ - BALLOON -> BA LX LO ON
+ - 4. Letters that fall in the same row are replaced with the letter on the right.
+ - OK -> GM
+ - 5. Letters in the same column are replaced with the letter below.
+ - FO -> OU
+ - 6. Otherwise, each letter gets replaced by the letter in its row but in the other letters column.
+ - QM -> TH
+ - ### Security of the Playfair Cipher
+ - The security is much improved over simple monoalphabetic ciphers, as the Playfair Cipher has $26^2 = 676$ combinations.
+ - This requires a 676 entry frequency table to analyse (as compared to a 26 entry frequency table for a monoalphabetic cipher) and correspondingly, more ciphertext.
+ - However, the Playfair Cipher *can* be cracked through frequency analysis of letter pairs, given a few hundred letters.
+ -
+- ## Vigenère Cipher
+ - [Blaise de Vigenère](https://en.wikipedia.org/wiki/Blaise_de_Vigen%C3%A8re) is generally credited as the inventor of the **Polyalphabetic Substitution Cipher**.
+ - What is a **Polyalphabetic Substitution Cipher**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:31:42.282Z
+ card-last-reviewed:: 2022-10-07T10:31:42.283Z
+ card-last-score:: 5
+ - A **Polyalphabetic Substitution Cipher** uses multiple substitution alphabets, as opposed to a monoalphabetic cipher which uses a single alphabetic key.
+ - The Vigenère Cipher improves security by using many monoalphabetic substitution alphabets, so each letter can be replaced by many others.
+ - You use a **key** to select which alphabet is used for each letter of the message.
+ - The $i^{th}$ letter of the key specifies the $i^{th}$ alphabet to use.
+ - Use each alphabet in turn.
+ - Repeat from the start after the end of the key is reached.
+ -
+ - ### Vigenère Steps
+ - 
+ - 1. Write the plaintext out, and write the keyword underneath it, repeated, for the length of the plaintext.
+ - 2. Use each key letter in turn as a Caesar cipher key.
+ - 3. Encrypt the corresponding plaintext letter.
+ - In this example, we use the keyword "CIPHER". Hence, we have the following translation alphabets:
+ - 
+ - ### How to crack the Vigenère Cipher
+ - 1. Search the ciphertext for repeated strings of letters - the longer the string, the better.
+ - 2. For each occurrence of a repeated string, count how many letters are between the first letters in the string, and add one.
+ - 3. Factorise that number.
+ - 4. Repeat this process with each repeated string you find and make a table of common factors. The most common factor, $n$ is most likely the length of the keyword used to encipher the ciphertext.
+ - 5. Do a frequency count on the ciphertext, on every $n^{th}$ letter. You should end up with $n$ different frequency counts.
+ - 6. Compare these counts to standard frequency tables to figure out how much each letter was shifted by.
+ - 7. Undo the shifts and read the message.
+- ## Enigma (Rotor Ciphers)
+ - ### Rotor Ciphers
+ - The mechanisation / automation of encryption.
+ - An $\text{N}$-stage polyalphabetic algorithm modulo 26.
+ - $26^N$ steps before a repetition, where $N$ is the number of cylinders.
+ - The Enigma machine had 5 cylinders, so:
+ - $$26^{N=5}=11,881,376 \text{ steps}$$
+ -
+ - ### Breaking Enigma using **Cribs**
+ - The starting point for breaking Enigma was based on the following:
+ - Plaintext messages were likely to contain certain phrases.
+ - Weather reports contained the term "WETTER VORHERSAGE".
+ - Military units often sent messages containing "KEINE BESONDEREN EREIGNISSE" ("nothing to report").
+ - A plaintext letter was never mapped onto the same ciphertext letter.
+ - While the cryptanalysts in Bletchely Park did not know exactly where these cribs were placed in an intercepted message, they could exclude certain positions.
+ - 
+ - From here, possible rotor start positions & rotor wiring would be systematically examined using the "bombe" - an electromechanical device designed by Turing that replicated the action of several Enigma machines wired together.
+ -
+- ## Transposition Ciphers
+ - What are **Transposition Ciphers**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-16T07:39:25.895Z
+ card-last-reviewed:: 2022-10-07T10:39:25.895Z
+ card-last-score:: 3
+ - **Transposition** or **Permutation Ciphers** hide the message by rearranging the letter order ^^without altering the actual letters used.^^
+ - This can be recognised since the ciphertext has the same frequency distribution as the original text.
+ - ### Rail Fence Cipher
+ id:: 6344093b-2f4f-4c58-95e4-39a8b30d16c3
+ - Write plaintext letters out diagonally over a number of rows, then read off the cipher row by row.
+ - 
+ - ### Row Transposition Cipher
+ - What are **Row Transposition Ciphers**? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-01T22:18:29.590Z
+ card-last-reviewed:: 2022-10-06T17:18:29.591Z
+ card-last-score:: 5
+ - **Row Transposition Ciphers** are a more complex kind of transposition cipher than ((6344093b-2f4f-4c58-95e4-39a8b30d16c3))s.
+ - Plaintext letters are written out in rows over a specified number of columns.
+ - The columns are then re-ordered according to some key before reading off the columns
+ - 
+-
+- ## Product Ciphers
+ - Ciphers using just substitutions or transpositions are not secure because of language characteristics.
+ - Consider using several ciphers in succession to make it harder to crack:
+ - Two substitutions make a more complex substitution.
+ - Two transpositions make a more complex transposition.
+ - However, a substitution followed by a transposition makes a much harder cipher.
+ -
+-
+- # Steganography
+ - What is **Steganography**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-20T12:50:18.491Z
+ card-last-reviewed:: 2022-10-09T08:50:18.492Z
+ card-last-score:: 5
+ - **Steganography** is an alternative to encryption that hides the existence of the message.
+ - For example:
+ - Using only a subset of letters / words in a message marked in some way.
+ - Using invisible ink.
+ - Hiding in LSB in graphic image or sound file.
+ - The drawback of steganography is that it's not very economical in terms of overheads to hide a message.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Inheritance/2022-10-10T11_59_52.415Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Inheritance/2022-10-10T11_59_52.415Z.Desktop.md
new file mode 100644
index 00000000..83001b2b
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Inheritance/2022-10-10T11_59_52.415Z.Desktop.md
@@ -0,0 +1,143 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[OOP Modelling]]
+- **Next Topic:**
+- **Relevant Slides:**  
+-
+- # Object Equality #card
+ card-last-interval:: 3.45
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:26:39.173Z
+ card-last-reviewed:: 2022-10-06T17:26:39.174Z
+ card-last-score:: 5
+ collapsed:: true
+ - When you use `==` with reference variables, you are checking if the variables **point** to the same object.
+ - So, using `==` on strings will only return true if the Strings are references to the same object. It will return to false even if the strings contain the same data.
+ - The value of a string variable is the **memory location** where its String object is stored.
+ - When checking for equality between objects, you must use the `equals` method.
+ - The `equals` method is an instance method that ^^all objects of built-in classes have.^^
+ - However, for any class that you define, you will have to write your own equals method.
+ - All equals methods must have the following method signature:
+ - ```java
+ public boolean equals(Object object)
+ ```
+ - Its specific purpose is to define equality between objects.
+ - It returns a **boolean** value.
+ - It is **commutative**.
+ - `str1.equals(str4)` returns the same value as `str4.equals(str1)`.
+ - Example:
+ - ```java
+ String str1 = "Java";
+ String str2 = "Ja";
+ String str3 = "va";
+ String str4 = str2 + str3;
+
+ str1.equals(str4) ? System.out.println("true") : System.out.println("false");
+
+ ```
+- # `instanceof` #card
+ card-last-interval:: 4.59
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-12T00:29:22.029Z
+ card-last-reviewed:: 2022-10-07T10:29:22.030Z
+ card-last-score:: 5
+ - `instanceof` is an operator that is used to determine if a variable is pointing to an object with a particular type.
+ - ```java
+ System.out.println(bike2 instanceof Bicycle ? "true" : "false");
+ ```
+- # Object
+ collapsed:: true
+ - What is the type of `Object obj`? #card
+ card-last-interval:: 4.59
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-12T00:29:39.466Z
+ card-last-reviewed:: 2022-10-07T10:29:39.466Z
+ card-last-score:: 5
+ - `obj` is a variable whose type is `java.lang.Object`.
+ - What is `java.lang.Object`? #card
+ card-last-interval:: 4.59
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-12T00:30:00.069Z
+ card-last-reviewed:: 2022-10-07T10:30:00.070Z
+ card-last-score:: 5
+ - `java.lang.Object` is a class that provides the ^^most generic definition^^ of an object in Java.
+ - It is the **parent class** of every class in Java.
+ - For example. A `Bicycle` object is a `Bicycle` object **and** a `java.lang.Object` object.
+ -
+- # Casting
+ - ```java
+ Bicycle bike1 = (Bicycle) myObject;
+ String str1 = (String) obj;
+ ```
+ - Here, we can **cast** (convert) a variable from a higher type (`Object`), to a lower type (`Bicycle`).
+ - This is allowed, as `anObject` point to a Bicycle object - we can check this using `instanceof`.
+ - `obj` points to a String object - we can check this using `instanceof`.
+ - Note that the variable type being converted is ^^not the object.^^
+- # Class Hierarchy
+ - ## Is-a Relationships
+ - Java organises all its classes in a class hierarchy.
+ - For example, a car is a type of vehicle, which is a type of object.
+ - These relationships can be described as "is-a" relationships.
+ - A car **is-a** vehicle; a vehicle **is-a**(n) object.
+ - We refer the higher-up types as **parents** and the lower types as **children**.
+ - Car *is-a child* of Vehicle.
+ - Vehicle *is-a parent* of Car.
+ - Object *is the parent* of Vehicle & Car.
+ - ## Key Ideas in Class Hierarchy
+ - The top of the hierarchy represents the ^^most **generic** attributes & behaviours.^^
+ - The bottom (sometimes referred to as "leaves") represent the ^^most **specific** attributes & behaviours.^^
+ - Each level inherits and customises the attributes & behaviours from the level above it.
+ - `java.lang.Object` is *the* **superclass**, the parent of all classes in Java.
+ - Every class in Java has the `java.lang.Object` as its superclass (parent).
+ - 
+ - All the classes shown above **inherit** (receive) methods from the superclass `java.lang.Object`.
+ - What is **OOP Inheritance**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:40:20.126Z
+ card-last-score:: 1
+ - **Inheritance** is the means by which objects automatically receive features (fields) & behaviours (methods) from their **superclass**.
+ - The methods of this superclass are available to all objects of this Class, even though these methods may not be shown in the Class code.
+ - For example: `.equals()`.
+ - ### Generic Methods
+ - All the methods provided by the `java.lang.Object` are *generic*.
+ - They only relate to `java.lang.Object` classes, not the subclasses.
+ - When a subclass inherits these methods, it needs to customise them.
+ - This is why we had to override `.equals()` with our own version for the example Bicycle class.
+ - ### Overriding
+ - What is **overriding**? #card
+ card-last-interval:: 0.81
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T17:46:07.249Z
+ card-last-reviewed:: 2022-10-08T22:46:07.249Z
+ card-last-score:: 3
+ - **Overriding** is when you write your own version of a method that you have inherited from a superclass.
+ - It is creating a specific version of a method inherited from a parent (superclass) class.
+ - When overriding a method, you must keep every part of the method signature the same - You can only change the code in the method body.
+ - Its name, its parameter types & order, its access level (e.g., public, protected), and its return type.
+ - #### Annotation
+ - It is good practice to **annotate** your overridden methods using `@Override`.
+ - You code will compile & run without it, but it is considered good practice to annotate the methods that are overridden inherited from the superclass.
+ - ```java
+ @Override
+ public boolean equals(Object obj)
+ {
+ obj == null ? return false;
+
+ if (obj instanceof Bicycle)
+ {
+ Bicycle bike = (Bicycle) obj;
+ if (this.speed == bike.getSpeed() && this.gear == bike.getGear())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Inheritance/2022-10-20T09_05_57.964Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Inheritance/2022-10-20T09_05_57.964Z.Desktop.md
new file mode 100644
index 00000000..1f9d79cc
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Inheritance/2022-10-20T09_05_57.964Z.Desktop.md
@@ -0,0 +1,143 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[OOP Modelling]]
+- **Next Topic:** [[Coding Up Inheritance]]
+- **Relevant Slides:**  
+-
+- # Object Equality #card
+ card-last-interval:: 3.45
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:26:39.173Z
+ card-last-reviewed:: 2022-10-06T17:26:39.174Z
+ card-last-score:: 5
+ collapsed:: true
+ - When you use `==` with reference variables, you are checking if the variables **point** to the same object.
+ - So, using `==` on strings will only return true if the Strings are references to the same object. It will return to false even if the strings contain the same data.
+ - The value of a string variable is the **memory location** where its String object is stored.
+ - When checking for equality between objects, you must use the `equals` method.
+ - The `equals` method is an instance method that ^^all objects of built-in classes have.^^
+ - However, for any class that you define, you will have to write your own equals method.
+ - All equals methods must have the following method signature:
+ - ```java
+ public boolean equals(Object object)
+ ```
+ - Its specific purpose is to define equality between objects.
+ - It returns a **boolean** value.
+ - It is **commutative**.
+ - `str1.equals(str4)` returns the same value as `str4.equals(str1)`.
+ - Example:
+ - ```java
+ String str1 = "Java";
+ String str2 = "Ja";
+ String str3 = "va";
+ String str4 = str2 + str3;
+
+ str1.equals(str4) ? System.out.println("true") : System.out.println("false");
+
+ ```
+- # `instanceof` #card
+ card-last-interval:: 4.59
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-12T00:29:22.029Z
+ card-last-reviewed:: 2022-10-07T10:29:22.030Z
+ card-last-score:: 5
+ - `instanceof` is an operator that is used to determine if a variable is pointing to an object with a particular type.
+ - ```java
+ System.out.println(bike2 instanceof Bicycle ? "true" : "false");
+ ```
+- # Object
+ collapsed:: true
+ - What is the type of `Object obj`? #card
+ card-last-interval:: 4.59
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-12T00:29:39.466Z
+ card-last-reviewed:: 2022-10-07T10:29:39.466Z
+ card-last-score:: 5
+ - `obj` is a variable whose type is `java.lang.Object`.
+ - What is `java.lang.Object`? #card
+ card-last-interval:: 4.59
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-12T00:30:00.069Z
+ card-last-reviewed:: 2022-10-07T10:30:00.070Z
+ card-last-score:: 5
+ - `java.lang.Object` is a class that provides the ^^most generic definition^^ of an object in Java.
+ - It is the **parent class** of every class in Java.
+ - For example. A `Bicycle` object is a `Bicycle` object **and** a `java.lang.Object` object.
+ -
+- # Casting
+ - ```java
+ Bicycle bike1 = (Bicycle) myObject;
+ String str1 = (String) obj;
+ ```
+ - Here, we can **cast** (convert) a variable from a higher type (`Object`), to a lower type (`Bicycle`).
+ - This is allowed, as `anObject` point to a Bicycle object - we can check this using `instanceof`.
+ - `obj` points to a String object - we can check this using `instanceof`.
+ - Note that the variable type being converted is ^^not the object.^^
+- # Class Hierarchy
+ - ## Is-a Relationships
+ - Java organises all its classes in a class hierarchy.
+ - For example, a car is a type of vehicle, which is a type of object.
+ - These relationships can be described as "is-a" relationships.
+ - A car **is-a** vehicle; a vehicle **is-a**(n) object.
+ - We refer the higher-up types as **parents** and the lower types as **children**.
+ - Car *is-a child* of Vehicle.
+ - Vehicle *is-a parent* of Car.
+ - Object *is the parent* of Vehicle & Car.
+ - ## Key Ideas in Class Hierarchy
+ - The top of the hierarchy represents the ^^most **generic** attributes & behaviours.^^
+ - The bottom (sometimes referred to as "leaves") represent the ^^most **specific** attributes & behaviours.^^
+ - Each level inherits and customises the attributes & behaviours from the level above it.
+ - `java.lang.Object` is *the* **superclass**, the parent of all classes in Java.
+ - Every class in Java has the `java.lang.Object` as its superclass (parent).
+ - 
+ - All the classes shown above **inherit** (receive) methods from the superclass `java.lang.Object`.
+ - What is **OOP Inheritance**? #card
+ card-last-interval:: 1.05
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-11T12:34:06.705Z
+ card-last-reviewed:: 2022-10-10T11:34:06.705Z
+ card-last-score:: 3
+ - **Inheritance** is the means by which objects automatically receive features (fields) & behaviours (methods) from their **superclass**.
+ - The methods of this superclass are available to all objects of this Class, even though these methods may not be shown in the Class code.
+ - For example: `.equals()`.
+ - ### Generic Methods
+ - All the methods provided by the `java.lang.Object` are *generic*.
+ - They only relate to `java.lang.Object` classes, not the subclasses.
+ - When a subclass inherits these methods, it needs to customise them.
+ - This is why we had to override `.equals()` with our own version for the example Bicycle class.
+ - ### Overriding
+ - What is **overriding**? #card
+ card-last-interval:: 7.48
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-17T22:44:46.299Z
+ card-last-reviewed:: 2022-10-10T11:44:46.300Z
+ card-last-score:: 5
+ - **Overriding** is when you write your own version of a method that you have inherited from a superclass.
+ - It is creating a specific version of a method inherited from a parent (superclass) class.
+ - When overriding a method, you must keep every part of the method signature the same - You can only change the code in the method body.
+ - Its name, its parameter types & order, its access level (e.g., public, protected), and its return type.
+ - #### Annotation
+ - It is good practice to **annotate** your overridden methods using `@Override`.
+ - You code will compile & run without it, but it is considered good practice to annotate the methods that are overridden inherited from the superclass.
+ - ```java
+ @Override
+ public boolean equals(Object obj)
+ {
+ obj == null ? return false;
+
+ if (obj instanceof Bicycle)
+ {
+ Bicycle bike = (Bicycle) obj;
+ if (this.speed == bike.getSpeed() && this.gear == bike.getGear())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Object-Oriented Programming/2022-09-30T10_01_42.296Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Object-Oriented Programming/2022-09-30T10_01_42.296Z.Desktop.md
new file mode 100644
index 00000000..2e28c7e5
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Object-Oriented Programming/2022-09-30T10_01_42.296Z.Desktop.md
@@ -0,0 +1,39 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- No previous topic
+- **Relevant Slides:** 
+-
+- ## Definitions
+ - What is a **class**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:27:33.091Z
+ card-last-reviewed:: 2022-09-19T18:27:33.091Z
+ card-last-score:: 5
+ - A **class** is a type of *blueprint* or *template* from which you make objects.
+ - What is an **object**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T14:51:10.520Z
+ card-last-score:: 1
+ - A (Java) **object** is a self-contained component which consists of *methods* and *properties*.
+ - It is a piece of code that has a **state** and has **behaviour**.
+ - Often, they represent a "real-life" object.
+ - An object is created by *instantiating* a **class**.
+ - What is **bytecode**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:11:44.761Z
+ card-last-reviewed:: 2022-09-18T15:11:44.762Z
+ card-last-score:: 5
+ - Unlike other high-level programming languages, Java code is **not** compiled into machine-specific code that can be executed by a microprocessor.
+ - Instead, Java programs are compiled into **bytecode**. The bytecode is input into a **Java Virtual Machine (JVM)**, which interprets & executes the code. The JVM is usually a program itself.
+ - Bytecode is **platform independent**.
+ - The JVM is specific for each platform, but the bytecode for the program remains the same across different platforms.
+ - The main trade-off is the effect it has on the execution speed.
+ -
+- **Next Topic:** [[Introduction to Java]]
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Object-Oriented Programming/2022-10-07T08_33_33.340Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Object-Oriented Programming/2022-10-07T08_33_33.340Z.Desktop.md
new file mode 100644
index 00000000..2e62b5c9
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Object-Oriented Programming/2022-10-07T08_33_33.340Z.Desktop.md
@@ -0,0 +1,39 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- No previous topic
+- **Relevant Slides:** 
+-
+- ## Definitions
+ - What is a **class**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:29:42.373Z
+ card-last-reviewed:: 2022-10-03T14:29:42.374Z
+ card-last-score:: 5
+ - A **class** is a type of *blueprint* or *template* from which you make objects.
+ - What is an **object**? #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-03T16:21:16.230Z
+ card-last-reviewed:: 2022-09-30T09:21:16.231Z
+ card-last-score:: 3
+ - A (Java) **object** is a self-contained component which consists of *methods* and *properties*.
+ - It is a piece of code that has a **state** and has **behaviour**.
+ - Often, they represent a "real-life" object.
+ - An object is created by *instantiating* a **class**.
+ - What is **bytecode**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:21:49.464Z
+ card-last-reviewed:: 2022-10-01T13:21:49.465Z
+ card-last-score:: 3
+ - Unlike other high-level programming languages, Java code is **not** compiled into machine-specific code that can be executed by a microprocessor.
+ - Instead, Java programs are compiled into **bytecode**. The bytecode is input into a **Java Virtual Machine (JVM)**, which interprets & executes the code. The JVM is usually a program itself.
+ - Bytecode is **platform independent**.
+ - The JVM is specific for each platform, but the bytecode for the program remains the same across different platforms.
+ - The main trade-off is the effect it has on the execution speed.
+ -
+- **Next Topic:** [[Introduction to Java]]
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Object-Oriented Programming/2022-11-09T13_03_58.125Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Object-Oriented Programming/2022-11-09T13_03_58.125Z.Desktop.md
new file mode 100644
index 00000000..9449f9a9
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to Object-Oriented Programming/2022-11-09T13_03_58.125Z.Desktop.md
@@ -0,0 +1,39 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- No previous topic
+- **Relevant Slides:** 
+-
+- ## Definitions
+ - What is a **class**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:29:42.373Z
+ card-last-reviewed:: 2022-10-03T14:29:42.374Z
+ card-last-score:: 5
+ - A **class** is a type of *blueprint* or *template* from which you make objects.
+ - What is an **object**? #card
+ card-last-interval:: 8.8
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-15T12:29:13.252Z
+ card-last-reviewed:: 2022-10-06T17:29:13.252Z
+ card-last-score:: 5
+ - A (Java) **object** is a self-contained component which consists of *methods* and *properties*.
+ - It is a piece of code that has a **state** and has **behaviour**.
+ - Often, they represent a "real-life" object.
+ - An object is created by *instantiating* a **class**.
+ - What is **bytecode**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:21:49.464Z
+ card-last-reviewed:: 2022-10-01T13:21:49.465Z
+ card-last-score:: 3
+ - Unlike other high-level programming languages, Java code is **not** compiled into machine-specific code that can be executed by a microprocessor.
+ - Instead, Java programs are compiled into **bytecode**. The bytecode is input into a **Java Virtual Machine (JVM)**, which interprets & executes the code. The JVM is usually a program itself.
+ - Bytecode is **platform independent**.
+ - The JVM is specific for each platform, but the bytecode for the program remains the same across different platforms.
+ - The main trade-off is the effect it has on the execution speed.
+ -
+- **Next Topic:** [[Introduction to Java]]
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-10-07T08_33_33.343Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-10-07T08_33_33.343Z.Desktop.md
new file mode 100644
index 00000000..54b94e82
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-10-07T08_33_33.343Z.Desktop.md
@@ -0,0 +1,357 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[The Relational Model]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # SQL
+ - What is **SQL**? #card
+ card-last-interval:: 15.72
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-19T04:41:54.766Z
+ card-last-reviewed:: 2022-10-03T11:41:54.767Z
+ card-last-score:: 5
+ - **Structured Query Language (SQL)** is a special-purpose **programming language** for relational database systems.
+ - ### Features of SQL
+ - SQL is based on *relational algebra*.
+ - All relational, set, and hybrid operators are supported.
+ - SQL also has additional operators to allow easier query development.
+ - SQL has been *standardised* since 1987.
+ - The American National Standards Institute (ANSI) and International Organization for Standardization (ISO) form SQL standard committees. Many vendors also take part.
+ - Recent standards include XML-related features in addition to many others, including JSON data types.
+ - ### ANSI/ISO SQL
+ - Despite standards, there can be a lack of portability between database systems due to:
+ - Complexity & size of standards (not all vendors will implement all of the standard).
+ - The vendor may want to keep the syntax consistent with their other software products / OS or develop features to support their user base.
+ - The vendor may want to maintain backward compatibility.
+ - The vendor may want to maintain "Vendor lock-in".
+ - What is the **standardised SQL syntax** comprised of? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T12:15:02.333Z
+ card-last-score:: 1
+ - The **standardised SQL syntax** comprises 3 components:
+ - **DDL -** Data Definition Language
+ - **DCL -** Data Control Language
+ - **DML -** Data Manipulation Language
+ - ### DCL: Data Control Language
+ - What is **DCL** used for? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:28:18.563Z
+ card-last-score:: 1
+ - **Data Control Language** is used to control access to the database & to database relations.
+ - It is the role of the **database administrator**.
+ - Very important in multi-user systems.
+ - What are the typical **DCL** commands? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:14:42.612Z
+ card-last-reviewed:: 2022-09-30T12:14:42.612Z
+ card-last-score:: 3
+ - ```sql
+ GRANT
+ REVOKE
+ ```
+ - These can be used to:
+ - grant / revoke access to the database.
+ - grant / revoke access to individual relations.
+ -
+ - ### DDL: Data Definition Language
+ - What is **DDL**? #card
+ card-last-interval:: 8.76
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-09T06:14:56.915Z
+ card-last-reviewed:: 2022-09-30T12:14:56.915Z
+ card-last-score:: 3
+ - **Data Definition Language** is a standardised language to ^^define the schema of a database.^^
+ - It's the back-end of "design" options on the Interface (e.g., Create options).
+ - What are the typical **DDL** commands? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T08:44:55.362Z
+ card-last-score:: 1
+ - The typical DDL tasks include creating, altering, and removing **database objects** such as tables & indexes.
+ - Common DDL keywords include:
+ - ```sql
+ CREATE
+ ALTER
+ DROP
+ ADD
+ CONSTRAINT
+ ```
+ - #### Create a table, its indexes, & constraints
+ - Steps:
+ - 1. Specify **table** (relation) name.
+ 2. For each attribute in the table, specify **Attribute Name**, **Data Type**, and any **constraints**.
+ 3. Specify the **Primary Key** of the table: choose one or more attributes.
+ 4. Specify **Foreign Keys** *if they exist* and assuming that the attributes & table you are referencing exist (you may have to return to this step).
+ - Steps 1-3 ^^must be completed for all tables.^^
+ - #### Data Types
+ - The main data types are **strings**, **numeric**, and **date/time**.
+ -
+ - **Strings**
+ - What can **strings** contain? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T12:26:33.849Z
+ card-last-reviewed:: 2022-09-30T08:26:33.849Z
+ card-last-score:: 5
+ - **Strings** can contain ^^letters, numbers, & special characters.^^
+ - Types of string: #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-04T09:26:44.930Z
+ card-last-reviewed:: 2022-09-30T09:26:44.930Z
+ card-last-score:: 5
+ - `CHAR(size)` is a string of **fixed length**. `size` can be from 0 to 255 - the default is 1.
+ - `VARCHAR(size)` is a string of **variable length**. `size` can be from 0 to 65,535.
+ - if `size` is not specified, it is unlimited
+ - `TEXT` is the same thing as `VARCHAR` except it is unlimited by default, and takes no argument `size`.
+ -
+ - **Date/Time**
+ - Types of date/time: #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-10-27T22:08:23.636Z
+ card-last-reviewed:: 2022-10-04T12:08:23.637Z
+ card-last-score:: 3
+ - `DATE` Format: YYYY-MM_DD
+ - `TIME` Format: hh:mm:ss
+ - `DATETIME` Format: YYYY-MM-DD hh:mm:ss
+ - `YEAR` A year in four-digit format
+ -
+ - **Numeric**
+ - The maximum `size` value is 255.
+ - MySQL supports **unsigned** numeric types but not all DBMS do.
+ - Types of numerics: #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-13T18:17:13.863Z
+ card-last-reviewed:: 2022-10-04T12:17:13.863Z
+ card-last-score:: 3
+ - `INTEGERS` - *See next block*.
+ - `BOOL / BOOLEAN` - 0 is False; non-zero is True.
+ - `FLOAT` - A floating-point number. 4 bytes, single precision.
+ - `DOUBLE` - A floating-point number. 8 bytes, double precision.
+ - `DECIMAL(size, d) / DEC(size,d)` - An exact, fixed-point number.
+ - `size` = total number of digits (max 65, default 10)
+ - `d` = number of digits after the decimal point (max 30, default 0)
+ -
+ - **Integers**
+ - Types of integers:
+ - | **Type** | **Bytes** | **Range** |
+ | `TINYINT` | 1 | -128 to 127 |
+ | `SMALLINT` | 2 | -32,768 to 32,767 |
+ | `MEDIUMINT` | 3 | -8,388,608 to 8,388,607 |
+ | `INT` | 4| -2,147,483,648 to 2,147,483,647 |
+ | `BIGINT` | 8 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
+ - ^^Note:^^ the number in brackets next to integers only refers to the number of digits to display, not size.
+ -
+ - **Others**
+ - Unicode char/string
+ - Binary
+ - Blob, Json, etc.
+ - ### DML: Data Manipulation Language
+ - What is **DML**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-08T12:35:13.598Z
+ card-last-reviewed:: 2022-10-04T12:35:13.598Z
+ card-last-score:: 5
+ - **Data Manipulation Language** is a standardised language used for ^^adding, deleting, & modifying data in a database.^^
+ - What are the typical **DML** commands? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:42.165Z
+ card-last-reviewed:: 2022-10-03T11:42:42.165Z
+ card-last-score:: 3
+ - ```sql
+ INSERT -- insert data
+ SELECT -- query (select) data
+ UPDATE -- update data
+ DELETE -- delete data
+ ```
+-
+- # Autonumber
+ - What does `AUTO_INCREMENT` do in MySQL? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-04T08:45:10.629Z
+ card-last-reviewed:: 2022-09-30T08:45:10.629Z
+ card-last-score:: 3
+ - Specifying an attribute to `AUTO_INCREMENT` tells the DBMS to ^^generate a number automatically when a new tuple is inserted into a table.^^
+ - Often, this is used for an "artificial" **primary key** value which is needed to ensure that we have a primary key, but has no meaning for the data being stored.
+ - Using `AUTO_INCREMENT` means that the DBMS takes care of inserting a unique value automatically every time a new tuple is inserted.
+ - By default, `AUTO_INCREMENT` is **1**, and is incremented by 1 for each new tuple inserted.
+-
+- # Constraints
+ - ## Types of Constraints
+ - ### Foreign Keys
+ - What is the syntax for specifying **Foreign Keys**? #card
+ card-last-interval:: 8.76
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-09T06:15:41.002Z
+ card-last-reviewed:: 2022-09-30T12:15:41.003Z
+ card-last-score:: 5
+ - ```sql
+ FOREIGN KEY (attributename) REFERENCES tablename(attributename)
+ ```
+ - You need to specify:
+ - The keyword `FOREIGN KEY` to indicate that it is a foreign key constraint.
+ - The attribute name(s) that will identify the foreign keys in the current table.
+ - If there is more than one attribute, they should be separated by commas.
+ - Attribute names should be enclosed in brackets.
+ - The keyword `REFERENCES` to specify the attribute that the foreign key references.
+ - The table name and the attribute name of the attribute being referenced by the foreign key.
+ - Again, the attribute name(s)should be in brackets.
+ - The table name should be **outside** the brackets.
+ - ^^You cannot create a foreign key link unless the attribute that it is referencing exists.^^
+ - ### Using `ALTER` to Modify Design
+ - **Remember:** You cannot create a foreign key link *unless* the attribute it's referencing already exists.
+ - If you want to create everything but the foreign keys initially, you can add a foreign key later using the `ALTER TABLE` command
+ -
+ - #### Syntax for `ALTER` Command
+ - To add a constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD CONSTRAINT constraintname FOREIGN KEY (attributename) REFERENCES tablename(attribute name);
+ ```
+ - To add an attribute (column) constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD attributename DATATYPE;
+ ```
+ - ### Domain Constraints
+ id:: 6321ba81-0b92-447e-9c6f-1953528d51a8
+ - What is the **Domain Constraint**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:34:07.625Z
+ card-last-score:: 1
+ - The value of each attribute A must be an **atomic** value from the **domain** dom(A).
+ - Essentially: ^^the data types & formats must match to that specified.^^
+ - ### Entity Integrity Constraints (Primary Key Constraints)
+ id:: 6321bafc-6bfc-42da-96a9-f05bcfdff9ba
+ - What is the **Primary Key / Entity Integrity Constraint**? #card
+ card-last-interval:: 13.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-13T16:14:37.382Z
+ card-last-reviewed:: 2022-09-30T12:14:37.382Z
+ card-last-score:: 5
+ - The **primary key** should uniquely identify each tuple in a relation.
+ - This means:
+ - No duplicate values allowed for the primary key
+ - No `NULL`values allowed for the primary key
+ - **Note:** `NULL` values may possibly also not be permitted for other attributes.
+ - We often see this constraint when filling out forms online ("*required") and the constraint is often necessary for non-key attributes.
+ - However, we should be careful to only add `NOT NULL` constraints in the databases when they are really necessary.
+ -
+ - ### Referential Integrity Constraints
+ - What are **Referential Integrity Constraints**? #card
+ card-last-score:: 5
+ card-repeats:: 4
+ card-next-schedule:: 2022-10-28T18:17:48.915Z
+ card-last-interval:: 24.27
+ card-ease-factor:: 2.56
+ card-last-reviewed:: 2022-10-04T12:17:48.915Z
+ - **Referential Integrity Constraints** are specified between two relations and require the concept of a **foreign key**. The constraint ensures that ^^the database must **not** contain any unmatched foreign keys.^^
+ - Therefore, a relationship involving foreign keys **must** be between attributes of the ^^same type & size.^^
+ - In addition, a value for a foreign key attribute **must** exist already as a candidate key value.
+ - Essentially: "no unmatched foreign keys".
+ -
+ - ### Semantic Integrity Constraints
+ - What are **Semantic Integrity Constraints**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:15:32.324Z
+ card-last-reviewed:: 2022-09-30T12:15:32.324Z
+ card-last-score:: 3
+ - **Semantic Integrity Constraints** ensure that the data entered into a row reflects an allowable value for that row. The value must be within the *domain*, or allowable set of values, for that column.
+ - How are **Semantic Integrity Constraints** specified? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:28:12.548Z
+ card-last-score:: 1
+ - **Semantic Integrity Constraints** are specified & enforced using a *constraint specification language*.
+ - What are the two types of **Semantic Integrity Constraints**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T11:43:05.343Z
+ card-last-score:: 1
+ - **State Constraints:** Constrain an entity to being in certain states.
+ - **Transition Constraints:** Constrain an entity to only being updated in certain ways.
+ - ## Setting Constraints
+ - **Domain Constraints** are set automatically once the data type is chosen.
+ - **Entity Constraints** are also set automatically once a primary key has been chosen.
+ - Usually default constraints are set for foreign keys, but these can be changed.
+ -
+ - ## Update Operations & Constraint Violations
+ - The DBMS must check that the constraints are not violated whenever **update operations** are applied.
+ -
+ - ### Insert Operation
+ - What does the **Insert Operation** do? #card
+ card-last-interval:: 13.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-13T16:15:27.475Z
+ card-last-reviewed:: 2022-09-30T12:15:27.476Z
+ card-last-score:: 5
+ - The **Insert Operation** provides a list of attribute values for a new tuple $t$ that is to be inserted into a relation $R$.
+ - This can happen directly via the interface or via the query.
+ - If a constraint is violated, the DBMS will reject the insertion - usually with an explanation.
+ - ### Delete Operation
+ - How can a **Delete Operation** violate constraints? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-04T08:44:42.623Z
+ card-last-reviewed:: 2022-09-30T08:44:42.623Z
+ card-last-score:: 3
+ - A **delete operation** can only violate **integrity constraints**, i.e., if the tuple being deleted is referenced by the foreign key from other tuples.
+ - The DBMS can:
+ - reject deletion, without explanation.
+ - attempt to *cascade* deletion.
+ - modify referencing attribute.
+ - #### Update Operation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T08:44:33.401Z
+ card-last-score:: 1
+ - An **update** operation is used to change the values of one or more attributes in a tuple of a table.
+ - Issues already discussed with insert & delete could arise with this operation, specifically:
+ - If a primary key is modified, that's essentially the same as deleting one tuple and inserting another tuple in its place.
+ - If a foreign key is modified, the DBMS must ensure that the new value refers to an existing tuple in the reference relation.
+ - ### Cascade Update & Delete
+ - Whenever tuples in the **referenced** (master) table are deleted or updated, the respective tuples of the **referencing** (child) table with a matching foreign key column will be deleted or updated as well.
+ - Note that if cascading `DELETE` is turned on, there could be many deletions performed with a single query such as:
+ - ```sql
+ DELETE FROM employee
+ WHERE ssn = 12345678;
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-10-10T11_59_52.426Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-10-10T11_59_52.426Z.Desktop.md
new file mode 100644
index 00000000..576a3cd2
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-10-10T11_59_52.426Z.Desktop.md
@@ -0,0 +1,364 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[The Relational Model]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # SQL
+ - What is **SQL**? #card
+ card-last-interval:: 15.72
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-19T04:41:54.766Z
+ card-last-reviewed:: 2022-10-03T11:41:54.767Z
+ card-last-score:: 5
+ - **Structured Query Language (SQL)** is a special-purpose **programming language** for relational database systems.
+ - ### Features of SQL
+ - SQL is based on *relational algebra*.
+ - All relational, set, and hybrid operators are supported.
+ - SQL also has additional operators to allow easier query development.
+ - SQL has been *standardised* since 1987.
+ - The American National Standards Institute (ANSI) and International Organization for Standardization (ISO) form SQL standard committees. Many vendors also take part.
+ - Recent standards include XML-related features in addition to many others, including JSON data types.
+ - ### ANSI/ISO SQL
+ - Despite standards, there can be a lack of portability between database systems due to:
+ - Complexity & size of standards (not all vendors will implement all of the standard).
+ - The vendor may want to keep the syntax consistent with their other software products / OS or develop features to support their user base.
+ - The vendor may want to maintain backward compatibility.
+ - The vendor may want to maintain "Vendor lock-in".
+ - What is the **standardised SQL syntax** comprised of? #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:32:46.591Z
+ card-last-reviewed:: 2022-10-07T10:32:46.591Z
+ card-last-score:: 3
+ - The **standardised SQL syntax** comprises 3 components:
+ - **DDL -** Data Definition Language
+ - **DCL -** Data Control Language
+ - **DML -** Data Manipulation Language
+ - ### DCL: Data Control Language
+ - What is **DCL** used for? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:24:46.993Z
+ card-last-reviewed:: 2022-10-06T17:24:46.993Z
+ card-last-score:: 5
+ - **Data Control Language** is used to control access to the database & to database relations.
+ - It is the role of the **database administrator**.
+ - Very important in multi-user systems.
+ - What are the typical **DCL** commands? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:14:42.612Z
+ card-last-reviewed:: 2022-09-30T12:14:42.612Z
+ card-last-score:: 3
+ - ```sql
+ GRANT
+ REVOKE
+ ```
+ - These can be used to:
+ - grant / revoke access to the database.
+ - grant / revoke access to individual relations.
+ -
+ - ### DDL: Data Definition Language
+ - What is **DDL**? #card
+ card-last-interval:: 8.76
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-09T06:14:56.915Z
+ card-last-reviewed:: 2022-09-30T12:14:56.915Z
+ card-last-score:: 3
+ - **Data Definition Language** is a standardised language to ^^define the schema of a database.^^
+ - It's the back-end of "design" options on the Interface (e.g., Create options).
+ - What are the typical **DDL** commands? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:33:30.852Z
+ card-last-reviewed:: 2022-10-07T10:33:30.852Z
+ card-last-score:: 3
+ - The typical DDL tasks include creating, altering, and removing **database objects** such as tables & indexes.
+ - Common DDL keywords include:
+ - ```sql
+ CREATE
+ ALTER
+ DROP
+ ADD
+ CONSTRAINT
+ ```
+ - #### Create a table, its indexes, & constraints
+ - Steps:
+ - 1. Specify **table** (relation) name.
+ 2. For each attribute in the table, specify **Attribute Name**, **Data Type**, and any **constraints**.
+ 3. Specify the **Primary Key** of the table: choose one or more attributes.
+ 4. Specify **Foreign Keys** *if they exist* and assuming that the attributes & table you are referencing exist (you may have to return to this step).
+ - Steps 1-3 ^^must be completed for all tables.^^
+ - #### Data Types
+ - The main data types are **strings**, **numeric**, and **date/time**.
+ -
+ - **Strings**
+ - What can **strings** contain? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T12:26:33.849Z
+ card-last-reviewed:: 2022-09-30T08:26:33.849Z
+ card-last-score:: 5
+ - **Strings** can contain ^^letters, numbers, & special characters.^^
+ - Types of string: #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:19:22.819Z
+ card-last-reviewed:: 2022-10-07T10:19:22.820Z
+ card-last-score:: 5
+ - `CHAR(size)` is a string of **fixed length**. `size` can be from 0 to 255 - the default is 1.
+ - `VARCHAR(size)` is a string of **variable length**. `size` can be from 0 to 65,535.
+ - if `size` is not specified, it is unlimited
+ - `TEXT` is the same thing as `VARCHAR` except it is unlimited by default, and takes no argument `size`.
+ -
+ - **Date/Time**
+ - Types of date/time: #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-10-27T22:08:23.636Z
+ card-last-reviewed:: 2022-10-04T12:08:23.637Z
+ card-last-score:: 3
+ - `DATE` Format: YYYY-MM_DD
+ - `TIME` Format: hh:mm:ss
+ - `DATETIME` Format: YYYY-MM-DD hh:mm:ss
+ - `YEAR` A year in four-digit format
+ -
+ - **Numeric**
+ - The maximum `size` value is 255.
+ - MySQL supports **unsigned** numeric types but not all DBMS do.
+ - Types of numerics: #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-13T18:17:13.863Z
+ card-last-reviewed:: 2022-10-04T12:17:13.863Z
+ card-last-score:: 3
+ - `INTEGERS` - *See next block*.
+ - `BOOL / BOOLEAN` - 0 is False; non-zero is True.
+ - `FLOAT` - A floating-point number. 4 bytes, single precision.
+ - `DOUBLE` - A floating-point number. 8 bytes, double precision.
+ - `DECIMAL(size, d) / DEC(size,d)` - An exact, fixed-point number.
+ - `size` = total number of digits (max 65, default 10)
+ - `d` = number of digits after the decimal point (max 30, default 0)
+ -
+ - **Integers**
+ - Types of integers:
+ - | **Type** | **Bytes** | **Range** |
+ | `TINYINT` | 1 | -128 to 127 |
+ | `SMALLINT` | 2 | -32,768 to 32,767 |
+ | `MEDIUMINT` | 3 | -8,388,608 to 8,388,607 |
+ | `INT` | 4| -2,147,483,648 to 2,147,483,647 |
+ | `BIGINT` | 8 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
+ - ^^Note:^^ the number in brackets next to integers only refers to the number of digits to display, not size.
+ -
+ - **Others**
+ - Unicode char/string
+ - Binary
+ - Blob, Json, etc.
+ - ### DML: Data Manipulation Language
+ - What is **DML**? #card
+ card-last-interval:: 9.68
+ card-repeats:: 3
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-10-19T00:50:25.340Z
+ card-last-reviewed:: 2022-10-09T08:50:25.341Z
+ card-last-score:: 5
+ - **Data Manipulation Language** is a standardised language used for ^^adding, deleting, & modifying data in a database.^^
+ - What are the typical **DML** commands? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:42.165Z
+ card-last-reviewed:: 2022-10-03T11:42:42.165Z
+ card-last-score:: 3
+ - ```sql
+ INSERT -- insert data
+ SELECT -- query (select) data
+ UPDATE -- update data
+ DELETE -- delete data
+ ```
+-
+- # Autonumber
+ - What does `AUTO_INCREMENT` do in MySQL? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:39:18.480Z
+ card-last-reviewed:: 2022-10-07T10:39:18.480Z
+ card-last-score:: 5
+ - Specifying an attribute to `AUTO_INCREMENT` tells the DBMS to ^^generate a number automatically when a new tuple is inserted into a table.^^
+ - Often, this is used for an "artificial" **primary key** value which is needed to ensure that we have a primary key, but has no meaning for the data being stored.
+ - Using `AUTO_INCREMENT` means that the DBMS takes care of inserting a unique value automatically every time a new tuple is inserted.
+ - By default, `AUTO_INCREMENT` is **1**, and is incremented by 1 for each new tuple inserted.
+-
+- # Constraints
+ - ## Types of Constraints
+ - ### Foreign Keys
+ - What is the syntax for specifying **Foreign Keys**? #card
+ card-last-interval:: 8.76
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-09T06:15:41.002Z
+ card-last-reviewed:: 2022-09-30T12:15:41.003Z
+ card-last-score:: 5
+ - ```sql
+ FOREIGN KEY (attributename) REFERENCES tablename(attributename)
+ ```
+ - You need to specify:
+ - The keyword `FOREIGN KEY` to indicate that it is a foreign key constraint.
+ - The attribute name(s) that will identify the foreign keys in the current table.
+ - If there is more than one attribute, they should be separated by commas.
+ - Attribute names should be enclosed in brackets.
+ - The keyword `REFERENCES` to specify the attribute that the foreign key references.
+ - The table name and the attribute name of the attribute being referenced by the foreign key.
+ - Again, the attribute name(s)should be in brackets.
+ - The table name should be **outside** the brackets.
+ - ^^You cannot create a foreign key link unless the attribute that it is referencing exists.^^
+ - ### Using `ALTER` to Modify Design
+ - **Remember:** You cannot create a foreign key link *unless* the attribute it's referencing already exists.
+ - If you want to create everything but the foreign keys initially, you can add a foreign key later using the `ALTER TABLE` command
+ -
+ - #### Syntax for `ALTER` Command
+ - To add a constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD CONSTRAINT constraintname FOREIGN KEY (attributename) REFERENCES tablename(attribute name);
+ ```
+ - To add an attribute (column) constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD attributename DATATYPE;
+ ```
+ - ### Domain Constraints
+ id:: 6321ba81-0b92-447e-9c6f-1953528d51a8
+ - What is the **Domain Constraint**? #card
+ card-last-interval:: 4.28
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T16:20:44.796Z
+ card-last-reviewed:: 2022-10-07T10:20:44.796Z
+ card-last-score:: 5
+ - The value of each attribute A must be an **atomic** value from the **domain** dom(A).
+ - Essentially: ^^the data types & formats must match to that specified.^^
+ - ### Entity Integrity Constraints (Primary Key Constraints)
+ id:: 6321bafc-6bfc-42da-96a9-f05bcfdff9ba
+ - What is the **Primary Key / Entity Integrity Constraint**? #card
+ card-last-interval:: 13.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-13T16:14:37.382Z
+ card-last-reviewed:: 2022-09-30T12:14:37.382Z
+ card-last-score:: 5
+ - The **primary key** should uniquely identify each tuple in a relation.
+ - This means:
+ - No duplicate values allowed for the primary key
+ - No `NULL`values allowed for the primary key
+ - **Note:** `NULL` values may possibly also not be permitted for other attributes.
+ - We often see this constraint when filling out forms online ("*required") and the constraint is often necessary for non-key attributes.
+ - However, we should be careful to only add `NOT NULL` constraints in the databases when they are really necessary.
+ -
+ - ### Referential Integrity Constraints
+ - What are **Referential Integrity Constraints**? #card
+ card-last-score:: 5
+ card-repeats:: 4
+ card-next-schedule:: 2022-10-28T18:17:48.915Z
+ card-last-interval:: 24.27
+ card-ease-factor:: 2.56
+ card-last-reviewed:: 2022-10-04T12:17:48.915Z
+ - **Referential Integrity Constraints** are specified between two relations and require the concept of a **foreign key**. The constraint ensures that ^^the database must **not** contain any unmatched foreign keys.^^
+ - Therefore, a relationship involving foreign keys **must** be between attributes of the ^^same type & size.^^
+ - In addition, a value for a foreign key attribute **must** exist already as a candidate key value.
+ - Essentially: "no unmatched foreign keys".
+ -
+ - ### Semantic Integrity Constraints
+ - What are **Semantic Integrity Constraints**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T09:15:32.324Z
+ card-last-reviewed:: 2022-09-30T12:15:32.324Z
+ card-last-score:: 3
+ - **Semantic Integrity Constraints** ensure that the data entered into a row reflects an allowable value for that row. The value must be within the *domain*, or allowable set of values, for that column.
+ - How are **Semantic Integrity Constraints** specified? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:32:01.681Z
+ card-last-score:: 1
+ - **Semantic Integrity Constraints** are specified & enforced using a *constraint specification language*.
+ - What are the two types of **Semantic Integrity Constraints**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T15:15:01.657Z
+ card-last-reviewed:: 2022-10-08T15:15:01.658Z
+ card-last-score:: 3
+ - **State Constraints:** Constrain an entity to being in certain states.
+ - **Transition Constraints:** Constrain an entity to only being updated in certain ways.
+ - ## Setting Constraints
+ - **Domain Constraints** are set automatically once the data type is chosen.
+ - **Entity Constraints** are also set automatically once a primary key has been chosen.
+ - Usually default constraints are set for foreign keys, but these can be changed.
+ -
+ - ## Update Operations & Constraint Violations
+ - The DBMS must check that the constraints are not violated whenever **update operations** are applied.
+ -
+ - ### Insert Operation
+ - What does the **Insert Operation** do? #card
+ card-last-interval:: 13.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-13T16:15:27.475Z
+ card-last-reviewed:: 2022-09-30T12:15:27.476Z
+ card-last-score:: 5
+ - The **Insert Operation** provides a list of attribute values for a new tuple $t$ that is to be inserted into a relation $R$.
+ - This can happen directly via the interface or via the query.
+ - If a constraint is violated, the DBMS will reject the insertion - usually with an explanation.
+ - ### Delete Operation
+ - How can a **Delete Operation** violate constraints? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:39:11.689Z
+ card-last-reviewed:: 2022-10-07T10:39:11.689Z
+ card-last-score:: 5
+ - A **delete operation** can only violate **integrity constraints**, i.e., if the tuple being deleted is referenced by the foreign key from other tuples.
+ - The DBMS can:
+ - reject deletion, without explanation.
+ - attempt to *cascade* deletion.
+ - modify referencing attribute.
+ - #### Update Operation
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:32:05.858Z
+ - What is an **Update** Operation? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:18:56.111Z
+ card-last-score:: 1
+ - An **update** operation is used to change the values of one or more attributes in a tuple of a table.
+ - Issues already discussed with insert & delete could arise with this operation, specifically:
+ - If a primary key is modified, that's essentially the same as deleting one tuple and inserting another tuple in its place.
+ - If a foreign key is modified, the DBMS must ensure that the new value refers to an existing tuple in the reference relation.
+ - ### Cascade Update & Delete
+ - Whenever tuples in the **referenced** (master) table are deleted or updated, the respective tuples of the **referencing** (child) table with a matching foreign key column will be deleted or updated as well.
+ - Note that if cascading `DELETE` is turned on, there could be many deletions performed with a single query such as:
+ - ```sql
+ DELETE FROM employee
+ WHERE ssn = 12345678;
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-10-20T09_05_57.967Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-10-20T09_05_57.967Z.Desktop.md
new file mode 100644
index 00000000..05a7194c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-10-20T09_05_57.967Z.Desktop.md
@@ -0,0 +1,364 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[The Relational Model]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # SQL
+ - What is **SQL**? #card
+ card-last-interval:: 15.72
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-19T04:41:54.766Z
+ card-last-reviewed:: 2022-10-03T11:41:54.767Z
+ card-last-score:: 5
+ - **Structured Query Language (SQL)** is a special-purpose **programming language** for relational database systems.
+ - ### Features of SQL
+ - SQL is based on *relational algebra*.
+ - All relational, set, and hybrid operators are supported.
+ - SQL also has additional operators to allow easier query development.
+ - SQL has been *standardised* since 1987.
+ - The American National Standards Institute (ANSI) and International Organization for Standardization (ISO) form SQL standard committees. Many vendors also take part.
+ - Recent standards include XML-related features in addition to many others, including JSON data types.
+ - ### ANSI/ISO SQL
+ - Despite standards, there can be a lack of portability between database systems due to:
+ - Complexity & size of standards (not all vendors will implement all of the standard).
+ - The vendor may want to keep the syntax consistent with their other software products / OS or develop features to support their user base.
+ - The vendor may want to maintain backward compatibility.
+ - The vendor may want to maintain "Vendor lock-in".
+ - What is the **standardised SQL syntax** comprised of? #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:32:46.591Z
+ card-last-reviewed:: 2022-10-07T10:32:46.591Z
+ card-last-score:: 3
+ - The **standardised SQL syntax** comprises 3 components:
+ - **DDL -** Data Definition Language
+ - **DCL -** Data Control Language
+ - **DML -** Data Manipulation Language
+ - ### DCL: Data Control Language
+ - What is **DCL** used for? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T03:24:46.993Z
+ card-last-reviewed:: 2022-10-06T17:24:46.993Z
+ card-last-score:: 5
+ - **Data Control Language** is used to control access to the database & to database relations.
+ - It is the role of the **database administrator**.
+ - Very important in multi-user systems.
+ - What are the typical **DCL** commands? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:44:02.090Z
+ card-last-reviewed:: 2022-10-10T11:44:02.091Z
+ card-last-score:: 3
+ - ```sql
+ GRANT
+ REVOKE
+ ```
+ - These can be used to:
+ - grant / revoke access to the database.
+ - grant / revoke access to individual relations.
+ -
+ - ### DDL: Data Definition Language
+ - What is **DDL**? #card
+ card-last-interval:: 27.13
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-06T14:42:59.239Z
+ card-last-reviewed:: 2022-10-10T11:42:59.239Z
+ card-last-score:: 5
+ - **Data Definition Language** is a standardised language to ^^define the schema of a database.^^
+ - It's the back-end of "design" options on the Interface (e.g., Create options).
+ - What are the typical **DDL** commands? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:33:30.852Z
+ card-last-reviewed:: 2022-10-07T10:33:30.852Z
+ card-last-score:: 3
+ - The typical DDL tasks include creating, altering, and removing **database objects** such as tables & indexes.
+ - Common DDL keywords include:
+ - ```sql
+ CREATE
+ ALTER
+ DROP
+ ADD
+ CONSTRAINT
+ ```
+ - #### Create a table, its indexes, & constraints
+ - Steps:
+ - 1. Specify **table** (relation) name.
+ 2. For each attribute in the table, specify **Attribute Name**, **Data Type**, and any **constraints**.
+ 3. Specify the **Primary Key** of the table: choose one or more attributes.
+ 4. Specify **Foreign Keys** *if they exist* and assuming that the attributes & table you are referencing exist (you may have to return to this step).
+ - Steps 1-3 ^^must be completed for all tables.^^
+ - #### Data Types
+ - The main data types are **strings**, **numeric**, and **date/time**.
+ -
+ - **Strings**
+ - What can **strings** contain? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T12:26:33.849Z
+ card-last-reviewed:: 2022-09-30T08:26:33.849Z
+ card-last-score:: 5
+ - **Strings** can contain ^^letters, numbers, & special characters.^^
+ - Types of string: #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:19:22.819Z
+ card-last-reviewed:: 2022-10-07T10:19:22.820Z
+ card-last-score:: 5
+ - `CHAR(size)` is a string of **fixed length**. `size` can be from 0 to 255 - the default is 1.
+ - `VARCHAR(size)` is a string of **variable length**. `size` can be from 0 to 65,535.
+ - if `size` is not specified, it is unlimited
+ - `TEXT` is the same thing as `VARCHAR` except it is unlimited by default, and takes no argument `size`.
+ -
+ - **Date/Time**
+ - Types of date/time: #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-10-27T22:08:23.636Z
+ card-last-reviewed:: 2022-10-04T12:08:23.637Z
+ card-last-score:: 3
+ - `DATE` Format: YYYY-MM_DD
+ - `TIME` Format: hh:mm:ss
+ - `DATETIME` Format: YYYY-MM-DD hh:mm:ss
+ - `YEAR` A year in four-digit format
+ -
+ - **Numeric**
+ - The maximum `size` value is 255.
+ - MySQL supports **unsigned** numeric types but not all DBMS do.
+ - Types of numerics: #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-13T18:17:13.863Z
+ card-last-reviewed:: 2022-10-04T12:17:13.863Z
+ card-last-score:: 3
+ - `INTEGERS` - *See next block*.
+ - `BOOL / BOOLEAN` - 0 is False; non-zero is True.
+ - `FLOAT` - A floating-point number. 4 bytes, single precision.
+ - `DOUBLE` - A floating-point number. 8 bytes, double precision.
+ - `DECIMAL(size, d) / DEC(size,d)` - An exact, fixed-point number.
+ - `size` = total number of digits (max 65, default 10)
+ - `d` = number of digits after the decimal point (max 30, default 0)
+ -
+ - **Integers**
+ - Types of integers:
+ - | **Type** | **Bytes** | **Range** |
+ | `TINYINT` | 1 | -128 to 127 |
+ | `SMALLINT` | 2 | -32,768 to 32,767 |
+ | `MEDIUMINT` | 3 | -8,388,608 to 8,388,607 |
+ | `INT` | 4| -2,147,483,648 to 2,147,483,647 |
+ | `BIGINT` | 8 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
+ - ^^Note:^^ the number in brackets next to integers only refers to the number of digits to display, not size.
+ -
+ - **Others**
+ - Unicode char/string
+ - Binary
+ - Blob, Json, etc.
+ - ### DML: Data Manipulation Language
+ - What is **DML**? #card
+ card-last-interval:: 9.68
+ card-repeats:: 3
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-10-19T00:50:25.340Z
+ card-last-reviewed:: 2022-10-09T08:50:25.341Z
+ card-last-score:: 5
+ - **Data Manipulation Language** is a standardised language used for ^^adding, deleting, & modifying data in a database.^^
+ - What are the typical **DML** commands? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:42.165Z
+ card-last-reviewed:: 2022-10-03T11:42:42.165Z
+ card-last-score:: 3
+ - ```sql
+ INSERT -- insert data
+ SELECT -- query (select) data
+ UPDATE -- update data
+ DELETE -- delete data
+ ```
+-
+- # Autonumber
+ - What does `AUTO_INCREMENT` do in MySQL? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:39:18.480Z
+ card-last-reviewed:: 2022-10-07T10:39:18.480Z
+ card-last-score:: 5
+ - Specifying an attribute to `AUTO_INCREMENT` tells the DBMS to ^^generate a number automatically when a new tuple is inserted into a table.^^
+ - Often, this is used for an "artificial" **primary key** value which is needed to ensure that we have a primary key, but has no meaning for the data being stored.
+ - Using `AUTO_INCREMENT` means that the DBMS takes care of inserting a unique value automatically every time a new tuple is inserted.
+ - By default, `AUTO_INCREMENT` is **1**, and is incremented by 1 for each new tuple inserted.
+-
+- # Constraints
+ - ## Types of Constraints
+ - ### Foreign Keys
+ - What is the syntax for specifying **Foreign Keys**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-31T23:43:12.658Z
+ card-last-reviewed:: 2022-10-10T11:43:12.658Z
+ card-last-score:: 3
+ - ```sql
+ FOREIGN KEY (attributename) REFERENCES tablename(attributename)
+ ```
+ - You need to specify:
+ - The keyword `FOREIGN KEY` to indicate that it is a foreign key constraint.
+ - The attribute name(s) that will identify the foreign keys in the current table.
+ - If there is more than one attribute, they should be separated by commas.
+ - Attribute names should be enclosed in brackets.
+ - The keyword `REFERENCES` to specify the attribute that the foreign key references.
+ - The table name and the attribute name of the attribute being referenced by the foreign key.
+ - Again, the attribute name(s)should be in brackets.
+ - The table name should be **outside** the brackets.
+ - ^^You cannot create a foreign key link unless the attribute that it is referencing exists.^^
+ - ### Using `ALTER` to Modify Design
+ - **Remember:** You cannot create a foreign key link *unless* the attribute it's referencing already exists.
+ - If you want to create everything but the foreign keys initially, you can add a foreign key later using the `ALTER TABLE` command
+ -
+ - #### Syntax for `ALTER` Command
+ - To add a constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD CONSTRAINT constraintname FOREIGN KEY (attributename) REFERENCES tablename(attribute name);
+ ```
+ - To add an attribute (column) constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD attributename DATATYPE;
+ ```
+ - ### Domain Constraints
+ id:: 6321ba81-0b92-447e-9c6f-1953528d51a8
+ - What is the **Domain Constraint**? #card
+ card-last-interval:: 4.28
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T16:20:44.796Z
+ card-last-reviewed:: 2022-10-07T10:20:44.796Z
+ card-last-score:: 5
+ - The value of each attribute A must be an **atomic** value from the **domain** dom(A).
+ - Essentially: ^^the data types & formats must match to that specified.^^
+ - ### Entity Integrity Constraints (Primary Key Constraints)
+ id:: 6321bafc-6bfc-42da-96a9-f05bcfdff9ba
+ - What is the **Primary Key / Entity Integrity Constraint**? #card
+ card-last-interval:: 13.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-13T16:14:37.382Z
+ card-last-reviewed:: 2022-09-30T12:14:37.382Z
+ card-last-score:: 5
+ - The **primary key** should uniquely identify each tuple in a relation.
+ - This means:
+ - No duplicate values allowed for the primary key
+ - No `NULL`values allowed for the primary key
+ - **Note:** `NULL` values may possibly also not be permitted for other attributes.
+ - We often see this constraint when filling out forms online ("*required") and the constraint is often necessary for non-key attributes.
+ - However, we should be careful to only add `NOT NULL` constraints in the databases when they are really necessary.
+ -
+ - ### Referential Integrity Constraints
+ - What are **Referential Integrity Constraints**? #card
+ card-last-score:: 5
+ card-repeats:: 4
+ card-next-schedule:: 2022-10-28T18:17:48.915Z
+ card-last-interval:: 24.27
+ card-ease-factor:: 2.56
+ card-last-reviewed:: 2022-10-04T12:17:48.915Z
+ - **Referential Integrity Constraints** are specified between two relations and require the concept of a **foreign key**. The constraint ensures that ^^the database must **not** contain any unmatched foreign keys.^^
+ - Therefore, a relationship involving foreign keys **must** be between attributes of the ^^same type & size.^^
+ - In addition, a value for a foreign key attribute **must** exist already as a candidate key value.
+ - Essentially: "no unmatched foreign keys".
+ -
+ - ### Semantic Integrity Constraints
+ - What are **Semantic Integrity Constraints**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-31T23:44:09.198Z
+ card-last-reviewed:: 2022-10-10T11:44:09.198Z
+ card-last-score:: 5
+ - **Semantic Integrity Constraints** ensure that the data entered into a row reflects an allowable value for that row. The value must be within the *domain*, or allowable set of values, for that column.
+ - How are **Semantic Integrity Constraints** specified? #card
+ card-last-interval:: 2.09
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-12T13:39:40.453Z
+ card-last-reviewed:: 2022-10-10T11:39:40.453Z
+ card-last-score:: 5
+ - **Semantic Integrity Constraints** are specified & enforced using a *constraint specification language*.
+ - What are the two types of **Semantic Integrity Constraints**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T15:15:01.657Z
+ card-last-reviewed:: 2022-10-08T15:15:01.658Z
+ card-last-score:: 3
+ - **State Constraints:** Constrain an entity to being in certain states.
+ - **Transition Constraints:** Constrain an entity to only being updated in certain ways.
+ - ## Setting Constraints
+ - **Domain Constraints** are set automatically once the data type is chosen.
+ - **Entity Constraints** are also set automatically once a primary key has been chosen.
+ - Usually default constraints are set for foreign keys, but these can be changed.
+ -
+ - ## Update Operations & Constraint Violations
+ - The DBMS must check that the constraints are not violated whenever **update operations** are applied.
+ -
+ - ### Insert Operation
+ - What does the **Insert Operation** do? #card
+ card-last-interval:: 13.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-13T16:15:27.475Z
+ card-last-reviewed:: 2022-09-30T12:15:27.476Z
+ card-last-score:: 5
+ - The **Insert Operation** provides a list of attribute values for a new tuple $t$ that is to be inserted into a relation $R$.
+ - This can happen directly via the interface or via the query.
+ - If a constraint is violated, the DBMS will reject the insertion - usually with an explanation.
+ - ### Delete Operation
+ - How can a **Delete Operation** violate constraints? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:39:11.689Z
+ card-last-reviewed:: 2022-10-07T10:39:11.689Z
+ card-last-score:: 5
+ - A **delete operation** can only violate **integrity constraints**, i.e., if the tuple being deleted is referenced by the foreign key from other tuples.
+ - The DBMS can:
+ - reject deletion, without explanation.
+ - attempt to *cascade* deletion.
+ - modify referencing attribute.
+ - #### Update Operation
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:32:05.858Z
+ - What is an **Update** Operation? #card
+ card-last-interval:: 0.75
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-11T05:41:10.864Z
+ card-last-reviewed:: 2022-10-10T11:41:10.864Z
+ card-last-score:: 3
+ - An **update** operation is used to change the values of one or more attributes in a tuple of a table.
+ - Issues already discussed with insert & delete could arise with this operation, specifically:
+ - If a primary key is modified, that's essentially the same as deleting one tuple and inserting another tuple in its place.
+ - If a foreign key is modified, the DBMS must ensure that the new value refers to an existing tuple in the reference relation.
+ - ### Cascade Update & Delete
+ - Whenever tuples in the **referenced** (master) table are deleted or updated, the respective tuples of the **referencing** (child) table with a matching foreign key column will be deleted or updated as well.
+ - Note that if cascading `DELETE` is turned on, there could be many deletions performed with a single query such as:
+ - ```sql
+ DELETE FROM employee
+ WHERE ssn = 12345678;
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-11-11T12_04_45.347Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-11-11T12_04_45.347Z.Desktop.md
new file mode 100644
index 00000000..018bc796
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-11-11T12_04_45.347Z.Desktop.md
@@ -0,0 +1,364 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[The Relational Model]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # SQL
+ - What is **SQL**? #card
+ card-last-interval:: 15.72
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-19T04:41:54.766Z
+ card-last-reviewed:: 2022-10-03T11:41:54.767Z
+ card-last-score:: 5
+ - **Structured Query Language (SQL)** is a special-purpose **programming language** for relational database systems.
+ - ### Features of SQL
+ - SQL is based on *relational algebra*.
+ - All relational, set, and hybrid operators are supported.
+ - SQL also has additional operators to allow easier query development.
+ - SQL has been *standardised* since 1987.
+ - The American National Standards Institute (ANSI) and International Organization for Standardization (ISO) form SQL standard committees. Many vendors also take part.
+ - Recent standards include XML-related features in addition to many others, including JSON data types.
+ - ### ANSI/ISO SQL
+ - Despite standards, there can be a lack of portability between database systems due to:
+ - Complexity & size of standards (not all vendors will implement all of the standard).
+ - The vendor may want to keep the syntax consistent with their other software products / OS or develop features to support their user base.
+ - The vendor may want to maintain backward compatibility.
+ - The vendor may want to maintain "Vendor lock-in".
+ - What is the **standardised SQL syntax** comprised of? #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:32:46.591Z
+ card-last-reviewed:: 2022-10-07T10:32:46.591Z
+ card-last-score:: 3
+ - The **standardised SQL syntax** comprises 3 components:
+ - **DDL -** Data Definition Language
+ - **DCL -** Data Control Language
+ - **DML -** Data Manipulation Language
+ - ### DCL: Data Control Language
+ - What is **DCL** used for? #card
+ card-last-interval:: 14.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-03T12:29:26.988Z
+ card-last-reviewed:: 2022-10-20T08:29:26.989Z
+ card-last-score:: 5
+ - **Data Control Language** is used to control access to the database & to database relations.
+ - It is the role of the **database administrator**.
+ - Very important in multi-user systems.
+ - What are the typical **DCL** commands? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:44:02.090Z
+ card-last-reviewed:: 2022-10-10T11:44:02.091Z
+ card-last-score:: 3
+ - ```sql
+ GRANT
+ REVOKE
+ ```
+ - These can be used to:
+ - grant / revoke access to the database.
+ - grant / revoke access to individual relations.
+ -
+ - ### DDL: Data Definition Language
+ - What is **DDL**? #card
+ card-last-interval:: 27.13
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-06T14:42:59.239Z
+ card-last-reviewed:: 2022-10-10T11:42:59.239Z
+ card-last-score:: 5
+ - **Data Definition Language** is a standardised language to ^^define the schema of a database.^^
+ - It's the back-end of "design" options on the Interface (e.g., Create options).
+ - What are the typical **DDL** commands? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:33:30.852Z
+ card-last-reviewed:: 2022-10-07T10:33:30.852Z
+ card-last-score:: 3
+ - The typical DDL tasks include creating, altering, and removing **database objects** such as tables & indexes.
+ - Common DDL keywords include:
+ - ```sql
+ CREATE
+ ALTER
+ DROP
+ ADD
+ CONSTRAINT
+ ```
+ - #### Create a table, its indexes, & constraints
+ - Steps:
+ - 1. Specify **table** (relation) name.
+ 2. For each attribute in the table, specify **Attribute Name**, **Data Type**, and any **constraints**.
+ 3. Specify the **Primary Key** of the table: choose one or more attributes.
+ 4. Specify **Foreign Keys** *if they exist* and assuming that the attributes & table you are referencing exist (you may have to return to this step).
+ - Steps 1-3 ^^must be completed for all tables.^^
+ - #### Data Types
+ - The main data types are **strings**, **numeric**, and **date/time**.
+ -
+ - **Strings**
+ - What can **strings** contain? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T12:26:33.849Z
+ card-last-reviewed:: 2022-09-30T08:26:33.849Z
+ card-last-score:: 5
+ - **Strings** can contain ^^letters, numbers, & special characters.^^
+ - Types of string: #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:19:22.819Z
+ card-last-reviewed:: 2022-10-07T10:19:22.820Z
+ card-last-score:: 5
+ - `CHAR(size)` is a string of **fixed length**. `size` can be from 0 to 255 - the default is 1.
+ - `VARCHAR(size)` is a string of **variable length**. `size` can be from 0 to 65,535.
+ - if `size` is not specified, it is unlimited
+ - `TEXT` is the same thing as `VARCHAR` except it is unlimited by default, and takes no argument `size`.
+ -
+ - **Date/Time**
+ - Types of date/time: #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-10-27T22:08:23.636Z
+ card-last-reviewed:: 2022-10-04T12:08:23.637Z
+ card-last-score:: 3
+ - `DATE` Format: YYYY-MM_DD
+ - `TIME` Format: hh:mm:ss
+ - `DATETIME` Format: YYYY-MM-DD hh:mm:ss
+ - `YEAR` A year in four-digit format
+ -
+ - **Numeric**
+ - The maximum `size` value is 255.
+ - MySQL supports **unsigned** numeric types but not all DBMS do.
+ - Types of numerics: #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-13T18:17:13.863Z
+ card-last-reviewed:: 2022-10-04T12:17:13.863Z
+ card-last-score:: 3
+ - `INTEGERS` - *See next block*.
+ - `BOOL / BOOLEAN` - 0 is False; non-zero is True.
+ - `FLOAT` - A floating-point number. 4 bytes, single precision.
+ - `DOUBLE` - A floating-point number. 8 bytes, double precision.
+ - `DECIMAL(size, d) / DEC(size,d)` - An exact, fixed-point number.
+ - `size` = total number of digits (max 65, default 10)
+ - `d` = number of digits after the decimal point (max 30, default 0)
+ -
+ - **Integers**
+ - Types of integers:
+ - | **Type** | **Bytes** | **Range** |
+ | `TINYINT` | 1 | -128 to 127 |
+ | `SMALLINT` | 2 | -32,768 to 32,767 |
+ | `MEDIUMINT` | 3 | -8,388,608 to 8,388,607 |
+ | `INT` | 4| -2,147,483,648 to 2,147,483,647 |
+ | `BIGINT` | 8 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
+ - ^^Note:^^ the number in brackets next to integers only refers to the number of digits to display, not size.
+ -
+ - **Others**
+ - Unicode char/string
+ - Binary
+ - Blob, Json, etc.
+ - ### DML: Data Manipulation Language
+ - What is **DML**? #card
+ card-last-interval:: 9.68
+ card-repeats:: 3
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-10-19T00:50:25.340Z
+ card-last-reviewed:: 2022-10-09T08:50:25.341Z
+ card-last-score:: 5
+ - **Data Manipulation Language** is a standardised language used for ^^adding, deleting, & modifying data in a database.^^
+ - What are the typical **DML** commands? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:42:42.165Z
+ card-last-reviewed:: 2022-10-03T11:42:42.165Z
+ card-last-score:: 3
+ - ```sql
+ INSERT -- insert data
+ SELECT -- query (select) data
+ UPDATE -- update data
+ DELETE -- delete data
+ ```
+-
+- # Autonumber
+ - What does `AUTO_INCREMENT` do in MySQL? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:39:18.480Z
+ card-last-reviewed:: 2022-10-07T10:39:18.480Z
+ card-last-score:: 5
+ - Specifying an attribute to `AUTO_INCREMENT` tells the DBMS to ^^generate a number automatically when a new tuple is inserted into a table.^^
+ - Often, this is used for an "artificial" **primary key** value which is needed to ensure that we have a primary key, but has no meaning for the data being stored.
+ - Using `AUTO_INCREMENT` means that the DBMS takes care of inserting a unique value automatically every time a new tuple is inserted.
+ - By default, `AUTO_INCREMENT` is **1**, and is incremented by 1 for each new tuple inserted.
+-
+- # Constraints
+ - ## Types of Constraints
+ - ### Foreign Keys
+ - What is the syntax for specifying **Foreign Keys**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-31T23:43:12.658Z
+ card-last-reviewed:: 2022-10-10T11:43:12.658Z
+ card-last-score:: 3
+ - ```sql
+ FOREIGN KEY (attributename) REFERENCES tablename(attributename)
+ ```
+ - You need to specify:
+ - The keyword `FOREIGN KEY` to indicate that it is a foreign key constraint.
+ - The attribute name(s) that will identify the foreign keys in the current table.
+ - If there is more than one attribute, they should be separated by commas.
+ - Attribute names should be enclosed in brackets.
+ - The keyword `REFERENCES` to specify the attribute that the foreign key references.
+ - The table name and the attribute name of the attribute being referenced by the foreign key.
+ - Again, the attribute name(s)should be in brackets.
+ - The table name should be **outside** the brackets.
+ - ^^You cannot create a foreign key link unless the attribute that it is referencing exists.^^
+ - ### Using `ALTER` to Modify Design
+ - **Remember:** You cannot create a foreign key link *unless* the attribute it's referencing already exists.
+ - If you want to create everything but the foreign keys initially, you can add a foreign key later using the `ALTER TABLE` command
+ -
+ - #### Syntax for `ALTER` Command
+ - To add a constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD CONSTRAINT constraintname FOREIGN KEY (attributename) REFERENCES tablename(attribute name);
+ ```
+ - To add an attribute (column) constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD attributename DATATYPE;
+ ```
+ - ### Domain Constraints
+ id:: 6321ba81-0b92-447e-9c6f-1953528d51a8
+ - What is the **Domain Constraint**? #card
+ card-last-interval:: 4.28
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T16:20:44.796Z
+ card-last-reviewed:: 2022-10-07T10:20:44.796Z
+ card-last-score:: 5
+ - The value of each attribute A must be an **atomic** value from the **domain** dom(A).
+ - Essentially: ^^the data types & formats must match to that specified.^^
+ - ### Entity Integrity Constraints (Primary Key Constraints)
+ id:: 6321bafc-6bfc-42da-96a9-f05bcfdff9ba
+ - What is the **Primary Key / Entity Integrity Constraint**? #card
+ card-last-interval:: 13.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-13T16:14:37.382Z
+ card-last-reviewed:: 2022-09-30T12:14:37.382Z
+ card-last-score:: 5
+ - The **primary key** should uniquely identify each tuple in a relation.
+ - This means:
+ - No duplicate values allowed for the primary key
+ - No `NULL`values allowed for the primary key
+ - **Note:** `NULL` values may possibly also not be permitted for other attributes.
+ - We often see this constraint when filling out forms online ("*required") and the constraint is often necessary for non-key attributes.
+ - However, we should be careful to only add `NOT NULL` constraints in the databases when they are really necessary.
+ -
+ - ### Referential Integrity Constraints
+ - What are **Referential Integrity Constraints**? #card
+ card-last-score:: 5
+ card-repeats:: 4
+ card-next-schedule:: 2022-10-28T18:17:48.915Z
+ card-last-interval:: 24.27
+ card-ease-factor:: 2.56
+ card-last-reviewed:: 2022-10-04T12:17:48.915Z
+ - **Referential Integrity Constraints** are specified between two relations and require the concept of a **foreign key**. The constraint ensures that ^^the database must **not** contain any unmatched foreign keys.^^
+ - Therefore, a relationship involving foreign keys **must** be between attributes of the ^^same type & size.^^
+ - In addition, a value for a foreign key attribute **must** exist already as a candidate key value.
+ - Essentially: "no unmatched foreign keys".
+ -
+ - ### Semantic Integrity Constraints
+ - What are **Semantic Integrity Constraints**? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-31T23:44:09.198Z
+ card-last-reviewed:: 2022-10-10T11:44:09.198Z
+ card-last-score:: 5
+ - **Semantic Integrity Constraints** ensure that the data entered into a row reflects an allowable value for that row. The value must be within the *domain*, or allowable set of values, for that column.
+ - How are **Semantic Integrity Constraints** specified? #card
+ card-last-interval:: 2.09
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-12T13:39:40.453Z
+ card-last-reviewed:: 2022-10-10T11:39:40.453Z
+ card-last-score:: 5
+ - **Semantic Integrity Constraints** are specified & enforced using a *constraint specification language*.
+ - What are the two types of **Semantic Integrity Constraints**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T15:15:01.657Z
+ card-last-reviewed:: 2022-10-08T15:15:01.658Z
+ card-last-score:: 3
+ - **State Constraints:** Constrain an entity to being in certain states.
+ - **Transition Constraints:** Constrain an entity to only being updated in certain ways.
+ - ## Setting Constraints
+ - **Domain Constraints** are set automatically once the data type is chosen.
+ - **Entity Constraints** are also set automatically once a primary key has been chosen.
+ - Usually default constraints are set for foreign keys, but these can be changed.
+ -
+ - ## Update Operations & Constraint Violations
+ - The DBMS must check that the constraints are not violated whenever **update operations** are applied.
+ -
+ - ### Insert Operation
+ - What does the **Insert Operation** do? #card
+ card-last-interval:: 13.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-13T16:15:27.475Z
+ card-last-reviewed:: 2022-09-30T12:15:27.476Z
+ card-last-score:: 5
+ - The **Insert Operation** provides a list of attribute values for a new tuple $t$ that is to be inserted into a relation $R$.
+ - This can happen directly via the interface or via the query.
+ - If a constraint is violated, the DBMS will reject the insertion - usually with an explanation.
+ - ### Delete Operation
+ - How can a **Delete Operation** violate constraints? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:39:11.689Z
+ card-last-reviewed:: 2022-10-07T10:39:11.689Z
+ card-last-score:: 5
+ - A **delete operation** can only violate **integrity constraints**, i.e., if the tuple being deleted is referenced by the foreign key from other tuples.
+ - The DBMS can:
+ - reject deletion, without explanation.
+ - attempt to *cascade* deletion.
+ - modify referencing attribute.
+ - #### Update Operation
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:32:05.858Z
+ - What is an **Update** Operation? #card
+ card-last-interval:: 0.75
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-11T05:41:10.864Z
+ card-last-reviewed:: 2022-10-10T11:41:10.864Z
+ card-last-score:: 3
+ - An **update** operation is used to change the values of one or more attributes in a tuple of a table.
+ - Issues already discussed with insert & delete could arise with this operation, specifically:
+ - If a primary key is modified, that's essentially the same as deleting one tuple and inserting another tuple in its place.
+ - If a foreign key is modified, the DBMS must ensure that the new value refers to an existing tuple in the reference relation.
+ - ### Cascade Update & Delete
+ - Whenever tuples in the **referenced** (master) table are deleted or updated, the respective tuples of the **referencing** (child) table with a matching foreign key column will be deleted or updated as well.
+ - Note that if cascading `DELETE` is turned on, there could be many deletions performed with a single query such as:
+ - ```sql
+ DELETE FROM employee
+ WHERE ssn = 12345678;
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-12-02T20_17_40.324Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-12-02T20_17_40.324Z.Desktop.md
new file mode 100644
index 00000000..3e5af493
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-12-02T20_17_40.324Z.Desktop.md
@@ -0,0 +1,364 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[The Relational Model]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # SQL
+ - What is **SQL**? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-12-18T17:47:35.469Z
+ card-last-reviewed:: 2022-11-17T09:47:35.470Z
+ card-last-score:: 5
+ - **Structured Query Language (SQL)** is a special-purpose **programming language** for relational database systems.
+ - ### Features of SQL
+ - SQL is based on *relational algebra*.
+ - All relational, set, and hybrid operators are supported.
+ - SQL also has additional operators to allow easier query development.
+ - SQL has been *standardised* since 1987.
+ - The American National Standards Institute (ANSI) and International Organization for Standardization (ISO) form SQL standard committees. Many vendors also take part.
+ - Recent standards include XML-related features in addition to many others, including JSON data types.
+ - ### ANSI/ISO SQL
+ - Despite standards, there can be a lack of portability between database systems due to:
+ - Complexity & size of standards (not all vendors will implement all of the standard).
+ - The vendor may want to keep the syntax consistent with their other software products / OS or develop features to support their user base.
+ - The vendor may want to maintain backward compatibility.
+ - The vendor may want to maintain "Vendor lock-in".
+ - What is the **standardised SQL syntax** comprised of? #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-25T06:29:02.836Z
+ card-last-reviewed:: 2022-11-14T16:29:02.836Z
+ card-last-score:: 5
+ - The **standardised SQL syntax** comprises 3 components:
+ - **DDL -** Data Definition Language
+ - **DCL -** Data Control Language
+ - **DML -** Data Manipulation Language
+ - ### DCL: Data Control Language
+ - What is **DCL** used for? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-12-16T04:21:50.434Z
+ card-last-reviewed:: 2022-11-14T20:21:50.434Z
+ card-last-score:: 5
+ - **Data Control Language** is used to control access to the database & to database relations.
+ - It is the role of the **database administrator**.
+ - Very important in multi-user systems.
+ - What are the typical **DCL** commands? #card
+ card-last-interval:: 41.44
+ card-repeats:: 5
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-26T06:18:39.799Z
+ card-last-reviewed:: 2022-11-14T20:18:39.800Z
+ card-last-score:: 5
+ - ```sql
+ GRANT
+ REVOKE
+ ```
+ - These can be used to:
+ - grant / revoke access to the database.
+ - grant / revoke access to individual relations.
+ -
+ - ### DDL: Data Definition Language
+ - What is **DDL**? #card
+ card-last-interval:: 86.42
+ card-repeats:: 5
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2023-02-09T06:22:06.927Z
+ card-last-reviewed:: 2022-11-14T20:22:06.927Z
+ card-last-score:: 5
+ - **Data Definition Language** is a standardised language to ^^define the schema of a database.^^
+ - It's the back-end of "design" options on the Interface (e.g., Create options).
+ - What are the typical **DDL** commands? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:36:00.957Z
+ card-last-score:: 1
+ - The typical DDL tasks include creating, altering, and removing **database objects** such as tables & indexes.
+ - Common DDL keywords include:
+ - ```sql
+ CREATE
+ ALTER
+ DROP
+ ADD
+ CONSTRAINT
+ ```
+ - #### Create a table, its indexes, & constraints
+ - Steps:
+ - 1. Specify **table** (relation) name.
+ 2. For each attribute in the table, specify **Attribute Name**, **Data Type**, and any **constraints**.
+ 3. Specify the **Primary Key** of the table: choose one or more attributes.
+ 4. Specify **Foreign Keys** *if they exist* and assuming that the attributes & table you are referencing exist (you may have to return to this step).
+ - Steps 1-3 ^^must be completed for all tables.^^
+ - #### Data Types
+ - The main data types are **strings**, **numeric**, and **date/time**.
+ -
+ - **Strings**
+ - What can **strings** contain? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:37:34.017Z
+ card-last-reviewed:: 2022-11-14T16:37:34.018Z
+ card-last-score:: 5
+ - **Strings** can contain ^^letters, numbers, & special characters.^^
+ - Types of string: #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-12-08T06:03:14.822Z
+ card-last-reviewed:: 2022-11-14T20:03:14.822Z
+ card-last-score:: 3
+ - `CHAR(size)` is a string of **fixed length**. `size` can be from 0 to 255 - the default is 1.
+ - `VARCHAR(size)` is a string of **variable length**. `size` can be from 0 to 65,535.
+ - if `size` is not specified, it is unlimited
+ - `TEXT` is the same thing as `VARCHAR` except it is unlimited by default, and takes no argument `size`.
+ -
+ - **Date/Time**
+ - Types of date/time: #card
+ card-last-interval:: 47.41
+ card-repeats:: 5
+ card-ease-factor:: 2.28
+ card-next-schedule:: 2023-01-01T05:18:44.919Z
+ card-last-reviewed:: 2022-11-14T20:18:44.919Z
+ card-last-score:: 3
+ - `DATE` Format: YYYY-MM_DD
+ - `TIME` Format: hh:mm:ss
+ - `DATETIME` Format: YYYY-MM-DD hh:mm:ss
+ - `YEAR` A year in four-digit format
+ -
+ - **Numeric**
+ - The maximum `size` value is 255.
+ - MySQL supports **unsigned** numeric types but not all DBMS do.
+ - Types of numerics: #card
+ card-last-interval:: 19.01
+ card-repeats:: 4
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-03T16:48:07.382Z
+ card-last-reviewed:: 2022-11-14T16:48:07.383Z
+ card-last-score:: 3
+ - `INTEGERS` - *See next block*.
+ - `BOOL / BOOLEAN` - 0 is False; non-zero is True.
+ - `FLOAT` - A floating-point number. 4 bytes, single precision.
+ - `DOUBLE` - A floating-point number. 8 bytes, double precision.
+ - `DECIMAL(size, d) / DEC(size,d)` - An exact, fixed-point number.
+ - `size` = total number of digits (max 65, default 10)
+ - `d` = number of digits after the decimal point (max 30, default 0)
+ -
+ - **Integers**
+ - Types of integers:
+ - | **Type** | **Bytes** | **Range** |
+ | `TINYINT` | 1 | -128 to 127 |
+ | `SMALLINT` | 2 | -32,768 to 32,767 |
+ | `MEDIUMINT` | 3 | -8,388,608 to 8,388,607 |
+ | `INT` | 4| -2,147,483,648 to 2,147,483,647 |
+ | `BIGINT` | 8 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
+ - ^^Note:^^ the number in brackets next to integers only refers to the number of digits to display, not size.
+ -
+ - **Others**
+ - Unicode char/string
+ - Binary
+ - Blob, Json, etc.
+ - ### DML: Data Manipulation Language
+ - What is **DML**? #card
+ card-last-interval:: 25.4
+ card-repeats:: 4
+ card-ease-factor:: 2.52
+ card-next-schedule:: 2022-12-12T18:47:31.780Z
+ card-last-reviewed:: 2022-11-17T09:47:31.780Z
+ card-last-score:: 5
+ - **Data Manipulation Language** is a standardised language used for ^^adding, deleting, & modifying data in a database.^^
+ - What are the typical **DML** commands? #card
+ card-last-interval:: 15.05
+ card-repeats:: 4
+ card-ease-factor:: 1.94
+ card-next-schedule:: 2022-11-29T17:40:29.100Z
+ card-last-reviewed:: 2022-11-14T16:40:29.100Z
+ card-last-score:: 3
+ - ```sql
+ INSERT -- insert data
+ SELECT -- query (select) data
+ UPDATE -- update data
+ DELETE -- delete data
+ ```
+-
+- # Autonumber
+ - What does `AUTO_INCREMENT` do in MySQL? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-12-13T03:03:50.803Z
+ card-last-reviewed:: 2022-11-14T20:03:50.803Z
+ card-last-score:: 5
+ - Specifying an attribute to `AUTO_INCREMENT` tells the DBMS to ^^generate a number automatically when a new tuple is inserted into a table.^^
+ - Often, this is used for an "artificial" **primary key** value which is needed to ensure that we have a primary key, but has no meaning for the data being stored.
+ - Using `AUTO_INCREMENT` means that the DBMS takes care of inserting a unique value automatically every time a new tuple is inserted.
+ - By default, `AUTO_INCREMENT` is **1**, and is incremented by 1 for each new tuple inserted.
+-
+- # Constraints
+ - ## Types of Constraints
+ - ### Foreign Keys
+ - What is the syntax for specifying **Foreign Keys**? #card
+ card-last-interval:: 41.44
+ card-repeats:: 5
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-26T06:21:18.467Z
+ card-last-reviewed:: 2022-11-14T20:21:18.468Z
+ card-last-score:: 3
+ - ```sql
+ FOREIGN KEY (attributename) REFERENCES tablename(attributename)
+ ```
+ - You need to specify:
+ - The keyword `FOREIGN KEY` to indicate that it is a foreign key constraint.
+ - The attribute name(s) that will identify the foreign keys in the current table.
+ - If there is more than one attribute, they should be separated by commas.
+ - Attribute names should be enclosed in brackets.
+ - The keyword `REFERENCES` to specify the attribute that the foreign key references.
+ - The table name and the attribute name of the attribute being referenced by the foreign key.
+ - Again, the attribute name(s)should be in brackets.
+ - The table name should be **outside** the brackets.
+ - ^^You cannot create a foreign key link unless the attribute that it is referencing exists.^^
+ - ### Using `ALTER` to Modify Design
+ - **Remember:** You cannot create a foreign key link *unless* the attribute it's referencing already exists.
+ - If you want to create everything but the foreign keys initially, you can add a foreign key later using the `ALTER TABLE` command
+ -
+ - #### Syntax for `ALTER` Command
+ - To add a constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD CONSTRAINT constraintname FOREIGN KEY (attributename) REFERENCES tablename(attribute name);
+ ```
+ - To add an attribute (column) constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD attributename DATATYPE;
+ ```
+ - ### Domain Constraints
+ id:: 6321ba81-0b92-447e-9c6f-1953528d51a8
+ - What is the **Domain Constraint**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:38:56.391Z
+ card-last-score:: 1
+ - The value of each attribute A must be an **atomic** value from the **domain** dom(A).
+ - Essentially: ^^the data types & formats must match to that specified.^^
+ - ### Entity Integrity Constraints (Primary Key Constraints)
+ id:: 6321bafc-6bfc-42da-96a9-f05bcfdff9ba
+ - What is the **Primary Key / Entity Integrity Constraint**? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-12-16T00:47:09.544Z
+ card-last-reviewed:: 2022-11-14T16:47:09.544Z
+ card-last-score:: 5
+ - The **primary key** should uniquely identify each tuple in a relation.
+ - This means:
+ - No duplicate values allowed for the primary key
+ - No `NULL`values allowed for the primary key
+ - **Note:** `NULL` values may possibly also not be permitted for other attributes.
+ - We often see this constraint when filling out forms online ("*required") and the constraint is often necessary for non-key attributes.
+ - However, we should be careful to only add `NOT NULL` constraints in the databases when they are really necessary.
+ -
+ - ### Referential Integrity Constraints
+ - What are **Referential Integrity Constraints**? #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.56
+ card-last-reviewed:: 2022-11-14T20:19:00.925Z
+ - **Referential Integrity Constraints** are specified between two relations and require the concept of a **foreign key**. The constraint ensures that ^^the database must **not** contain any unmatched foreign keys.^^
+ - Therefore, a relationship involving foreign keys **must** be between attributes of the ^^same type & size.^^
+ - In addition, a value for a foreign key attribute **must** exist already as a candidate key value.
+ - Essentially: "no unmatched foreign keys".
+ -
+ - ### Semantic Integrity Constraints
+ - What are **Semantic Integrity Constraints**? #card
+ card-last-interval:: 56.69
+ card-repeats:: 5
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2023-01-07T03:37:12.551Z
+ card-last-reviewed:: 2022-11-11T11:37:12.551Z
+ card-last-score:: 5
+ - **Semantic Integrity Constraints** ensure that the data entered into a row reflects an allowable value for that row. The value must be within the *domain*, or allowable set of values, for that column.
+ - How are **Semantic Integrity Constraints** specified? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:42:45.174Z
+ card-last-score:: 1
+ - **Semantic Integrity Constraints** are specified & enforced using a *constraint specification language*.
+ - What are the two types of **Semantic Integrity Constraints**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-11-25T13:05:15.346Z
+ card-last-reviewed:: 2022-11-21T13:05:15.347Z
+ card-last-score:: 3
+ - **State Constraints:** Constrain an entity to being in certain states.
+ - **Transition Constraints:** Constrain an entity to only being updated in certain ways.
+ - ## Setting Constraints
+ - **Domain Constraints** are set automatically once the data type is chosen.
+ - **Entity Constraints** are also set automatically once a primary key has been chosen.
+ - Usually default constraints are set for foreign keys, but these can be changed.
+ -
+ - ## Update Operations & Constraint Violations
+ - The DBMS must check that the constraints are not violated whenever **update operations** are applied.
+ -
+ - ### Insert Operation
+ - What does the **Insert Operation** do? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-12-16T00:47:14.600Z
+ card-last-reviewed:: 2022-11-14T16:47:14.600Z
+ card-last-score:: 5
+ - The **Insert Operation** provides a list of attribute values for a new tuple $t$ that is to be inserted into a relation $R$.
+ - This can happen directly via the interface or via the query.
+ - If a constraint is violated, the DBMS will reject the insertion - usually with an explanation.
+ - ### Delete Operation
+ - How can a **Delete Operation** violate constraints? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-12-13T03:03:33.858Z
+ card-last-reviewed:: 2022-11-14T20:03:33.859Z
+ card-last-score:: 5
+ - A **delete operation** can only violate **integrity constraints**, i.e., if the tuple being deleted is referenced by the foreign key from other tuples.
+ - The DBMS can:
+ - reject deletion, usually within an explanation.
+ - attempt to *cascade* deletion.
+ - modify referencing attribute.
+ - #### Update Operation
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:32:05.858Z
+ - What is an **Update** Operation? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-20T08:30:42.712Z
+ card-last-reviewed:: 2022-11-11T11:30:42.713Z
+ card-last-score:: 3
+ - An **update** operation is used to change the values of one or more attributes in a tuple of a table.
+ - Issues already discussed with insert & delete could arise with this operation, specifically:
+ - If a primary key is modified, that's essentially the same as deleting one tuple and inserting another tuple in its place.
+ - If a foreign key is modified, the DBMS must ensure that the new value refers to an existing tuple in the reference relation.
+ - ### Cascade Update & Delete
+ - Whenever tuples in the **referenced** (master) table are deleted or updated, the respective tuples of the **referencing** (child) table with a matching foreign key column will be deleted or updated as well.
+ - Note that if cascading `DELETE` is turned on, there could be many deletions performed with a single query such as:
+ - ```sql
+ DELETE FROM employee
+ WHERE ssn = 12345678;
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-12-03T15_59_39.790Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-12-03T15_59_39.790Z.Desktop.md
new file mode 100644
index 00000000..3e5af493
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Introduction to SQL & DDL/2022-12-03T15_59_39.790Z.Desktop.md
@@ -0,0 +1,364 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[The Relational Model]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # SQL
+ - What is **SQL**? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-12-18T17:47:35.469Z
+ card-last-reviewed:: 2022-11-17T09:47:35.470Z
+ card-last-score:: 5
+ - **Structured Query Language (SQL)** is a special-purpose **programming language** for relational database systems.
+ - ### Features of SQL
+ - SQL is based on *relational algebra*.
+ - All relational, set, and hybrid operators are supported.
+ - SQL also has additional operators to allow easier query development.
+ - SQL has been *standardised* since 1987.
+ - The American National Standards Institute (ANSI) and International Organization for Standardization (ISO) form SQL standard committees. Many vendors also take part.
+ - Recent standards include XML-related features in addition to many others, including JSON data types.
+ - ### ANSI/ISO SQL
+ - Despite standards, there can be a lack of portability between database systems due to:
+ - Complexity & size of standards (not all vendors will implement all of the standard).
+ - The vendor may want to keep the syntax consistent with their other software products / OS or develop features to support their user base.
+ - The vendor may want to maintain backward compatibility.
+ - The vendor may want to maintain "Vendor lock-in".
+ - What is the **standardised SQL syntax** comprised of? #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-25T06:29:02.836Z
+ card-last-reviewed:: 2022-11-14T16:29:02.836Z
+ card-last-score:: 5
+ - The **standardised SQL syntax** comprises 3 components:
+ - **DDL -** Data Definition Language
+ - **DCL -** Data Control Language
+ - **DML -** Data Manipulation Language
+ - ### DCL: Data Control Language
+ - What is **DCL** used for? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-12-16T04:21:50.434Z
+ card-last-reviewed:: 2022-11-14T20:21:50.434Z
+ card-last-score:: 5
+ - **Data Control Language** is used to control access to the database & to database relations.
+ - It is the role of the **database administrator**.
+ - Very important in multi-user systems.
+ - What are the typical **DCL** commands? #card
+ card-last-interval:: 41.44
+ card-repeats:: 5
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-26T06:18:39.799Z
+ card-last-reviewed:: 2022-11-14T20:18:39.800Z
+ card-last-score:: 5
+ - ```sql
+ GRANT
+ REVOKE
+ ```
+ - These can be used to:
+ - grant / revoke access to the database.
+ - grant / revoke access to individual relations.
+ -
+ - ### DDL: Data Definition Language
+ - What is **DDL**? #card
+ card-last-interval:: 86.42
+ card-repeats:: 5
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2023-02-09T06:22:06.927Z
+ card-last-reviewed:: 2022-11-14T20:22:06.927Z
+ card-last-score:: 5
+ - **Data Definition Language** is a standardised language to ^^define the schema of a database.^^
+ - It's the back-end of "design" options on the Interface (e.g., Create options).
+ - What are the typical **DDL** commands? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:36:00.957Z
+ card-last-score:: 1
+ - The typical DDL tasks include creating, altering, and removing **database objects** such as tables & indexes.
+ - Common DDL keywords include:
+ - ```sql
+ CREATE
+ ALTER
+ DROP
+ ADD
+ CONSTRAINT
+ ```
+ - #### Create a table, its indexes, & constraints
+ - Steps:
+ - 1. Specify **table** (relation) name.
+ 2. For each attribute in the table, specify **Attribute Name**, **Data Type**, and any **constraints**.
+ 3. Specify the **Primary Key** of the table: choose one or more attributes.
+ 4. Specify **Foreign Keys** *if they exist* and assuming that the attributes & table you are referencing exist (you may have to return to this step).
+ - Steps 1-3 ^^must be completed for all tables.^^
+ - #### Data Types
+ - The main data types are **strings**, **numeric**, and **date/time**.
+ -
+ - **Strings**
+ - What can **strings** contain? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-12-18T07:37:34.017Z
+ card-last-reviewed:: 2022-11-14T16:37:34.018Z
+ card-last-score:: 5
+ - **Strings** can contain ^^letters, numbers, & special characters.^^
+ - Types of string: #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-12-08T06:03:14.822Z
+ card-last-reviewed:: 2022-11-14T20:03:14.822Z
+ card-last-score:: 3
+ - `CHAR(size)` is a string of **fixed length**. `size` can be from 0 to 255 - the default is 1.
+ - `VARCHAR(size)` is a string of **variable length**. `size` can be from 0 to 65,535.
+ - if `size` is not specified, it is unlimited
+ - `TEXT` is the same thing as `VARCHAR` except it is unlimited by default, and takes no argument `size`.
+ -
+ - **Date/Time**
+ - Types of date/time: #card
+ card-last-interval:: 47.41
+ card-repeats:: 5
+ card-ease-factor:: 2.28
+ card-next-schedule:: 2023-01-01T05:18:44.919Z
+ card-last-reviewed:: 2022-11-14T20:18:44.919Z
+ card-last-score:: 3
+ - `DATE` Format: YYYY-MM_DD
+ - `TIME` Format: hh:mm:ss
+ - `DATETIME` Format: YYYY-MM-DD hh:mm:ss
+ - `YEAR` A year in four-digit format
+ -
+ - **Numeric**
+ - The maximum `size` value is 255.
+ - MySQL supports **unsigned** numeric types but not all DBMS do.
+ - Types of numerics: #card
+ card-last-interval:: 19.01
+ card-repeats:: 4
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-03T16:48:07.382Z
+ card-last-reviewed:: 2022-11-14T16:48:07.383Z
+ card-last-score:: 3
+ - `INTEGERS` - *See next block*.
+ - `BOOL / BOOLEAN` - 0 is False; non-zero is True.
+ - `FLOAT` - A floating-point number. 4 bytes, single precision.
+ - `DOUBLE` - A floating-point number. 8 bytes, double precision.
+ - `DECIMAL(size, d) / DEC(size,d)` - An exact, fixed-point number.
+ - `size` = total number of digits (max 65, default 10)
+ - `d` = number of digits after the decimal point (max 30, default 0)
+ -
+ - **Integers**
+ - Types of integers:
+ - | **Type** | **Bytes** | **Range** |
+ | `TINYINT` | 1 | -128 to 127 |
+ | `SMALLINT` | 2 | -32,768 to 32,767 |
+ | `MEDIUMINT` | 3 | -8,388,608 to 8,388,607 |
+ | `INT` | 4| -2,147,483,648 to 2,147,483,647 |
+ | `BIGINT` | 8 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
+ - ^^Note:^^ the number in brackets next to integers only refers to the number of digits to display, not size.
+ -
+ - **Others**
+ - Unicode char/string
+ - Binary
+ - Blob, Json, etc.
+ - ### DML: Data Manipulation Language
+ - What is **DML**? #card
+ card-last-interval:: 25.4
+ card-repeats:: 4
+ card-ease-factor:: 2.52
+ card-next-schedule:: 2022-12-12T18:47:31.780Z
+ card-last-reviewed:: 2022-11-17T09:47:31.780Z
+ card-last-score:: 5
+ - **Data Manipulation Language** is a standardised language used for ^^adding, deleting, & modifying data in a database.^^
+ - What are the typical **DML** commands? #card
+ card-last-interval:: 15.05
+ card-repeats:: 4
+ card-ease-factor:: 1.94
+ card-next-schedule:: 2022-11-29T17:40:29.100Z
+ card-last-reviewed:: 2022-11-14T16:40:29.100Z
+ card-last-score:: 3
+ - ```sql
+ INSERT -- insert data
+ SELECT -- query (select) data
+ UPDATE -- update data
+ DELETE -- delete data
+ ```
+-
+- # Autonumber
+ - What does `AUTO_INCREMENT` do in MySQL? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-12-13T03:03:50.803Z
+ card-last-reviewed:: 2022-11-14T20:03:50.803Z
+ card-last-score:: 5
+ - Specifying an attribute to `AUTO_INCREMENT` tells the DBMS to ^^generate a number automatically when a new tuple is inserted into a table.^^
+ - Often, this is used for an "artificial" **primary key** value which is needed to ensure that we have a primary key, but has no meaning for the data being stored.
+ - Using `AUTO_INCREMENT` means that the DBMS takes care of inserting a unique value automatically every time a new tuple is inserted.
+ - By default, `AUTO_INCREMENT` is **1**, and is incremented by 1 for each new tuple inserted.
+-
+- # Constraints
+ - ## Types of Constraints
+ - ### Foreign Keys
+ - What is the syntax for specifying **Foreign Keys**? #card
+ card-last-interval:: 41.44
+ card-repeats:: 5
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-26T06:21:18.467Z
+ card-last-reviewed:: 2022-11-14T20:21:18.468Z
+ card-last-score:: 3
+ - ```sql
+ FOREIGN KEY (attributename) REFERENCES tablename(attributename)
+ ```
+ - You need to specify:
+ - The keyword `FOREIGN KEY` to indicate that it is a foreign key constraint.
+ - The attribute name(s) that will identify the foreign keys in the current table.
+ - If there is more than one attribute, they should be separated by commas.
+ - Attribute names should be enclosed in brackets.
+ - The keyword `REFERENCES` to specify the attribute that the foreign key references.
+ - The table name and the attribute name of the attribute being referenced by the foreign key.
+ - Again, the attribute name(s)should be in brackets.
+ - The table name should be **outside** the brackets.
+ - ^^You cannot create a foreign key link unless the attribute that it is referencing exists.^^
+ - ### Using `ALTER` to Modify Design
+ - **Remember:** You cannot create a foreign key link *unless* the attribute it's referencing already exists.
+ - If you want to create everything but the foreign keys initially, you can add a foreign key later using the `ALTER TABLE` command
+ -
+ - #### Syntax for `ALTER` Command
+ - To add a constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD CONSTRAINT constraintname FOREIGN KEY (attributename) REFERENCES tablename(attribute name);
+ ```
+ - To add an attribute (column) constraint:
+ - ```SQL
+ ALTER TABLE tablename
+ ADD attributename DATATYPE;
+ ```
+ - ### Domain Constraints
+ id:: 6321ba81-0b92-447e-9c6f-1953528d51a8
+ - What is the **Domain Constraint**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:38:56.391Z
+ card-last-score:: 1
+ - The value of each attribute A must be an **atomic** value from the **domain** dom(A).
+ - Essentially: ^^the data types & formats must match to that specified.^^
+ - ### Entity Integrity Constraints (Primary Key Constraints)
+ id:: 6321bafc-6bfc-42da-96a9-f05bcfdff9ba
+ - What is the **Primary Key / Entity Integrity Constraint**? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-12-16T00:47:09.544Z
+ card-last-reviewed:: 2022-11-14T16:47:09.544Z
+ card-last-score:: 5
+ - The **primary key** should uniquely identify each tuple in a relation.
+ - This means:
+ - No duplicate values allowed for the primary key
+ - No `NULL`values allowed for the primary key
+ - **Note:** `NULL` values may possibly also not be permitted for other attributes.
+ - We often see this constraint when filling out forms online ("*required") and the constraint is often necessary for non-key attributes.
+ - However, we should be careful to only add `NOT NULL` constraints in the databases when they are really necessary.
+ -
+ - ### Referential Integrity Constraints
+ - What are **Referential Integrity Constraints**? #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.56
+ card-last-reviewed:: 2022-11-14T20:19:00.925Z
+ - **Referential Integrity Constraints** are specified between two relations and require the concept of a **foreign key**. The constraint ensures that ^^the database must **not** contain any unmatched foreign keys.^^
+ - Therefore, a relationship involving foreign keys **must** be between attributes of the ^^same type & size.^^
+ - In addition, a value for a foreign key attribute **must** exist already as a candidate key value.
+ - Essentially: "no unmatched foreign keys".
+ -
+ - ### Semantic Integrity Constraints
+ - What are **Semantic Integrity Constraints**? #card
+ card-last-interval:: 56.69
+ card-repeats:: 5
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2023-01-07T03:37:12.551Z
+ card-last-reviewed:: 2022-11-11T11:37:12.551Z
+ card-last-score:: 5
+ - **Semantic Integrity Constraints** ensure that the data entered into a row reflects an allowable value for that row. The value must be within the *domain*, or allowable set of values, for that column.
+ - How are **Semantic Integrity Constraints** specified? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:42:45.174Z
+ card-last-score:: 1
+ - **Semantic Integrity Constraints** are specified & enforced using a *constraint specification language*.
+ - What are the two types of **Semantic Integrity Constraints**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-11-25T13:05:15.346Z
+ card-last-reviewed:: 2022-11-21T13:05:15.347Z
+ card-last-score:: 3
+ - **State Constraints:** Constrain an entity to being in certain states.
+ - **Transition Constraints:** Constrain an entity to only being updated in certain ways.
+ - ## Setting Constraints
+ - **Domain Constraints** are set automatically once the data type is chosen.
+ - **Entity Constraints** are also set automatically once a primary key has been chosen.
+ - Usually default constraints are set for foreign keys, but these can be changed.
+ -
+ - ## Update Operations & Constraint Violations
+ - The DBMS must check that the constraints are not violated whenever **update operations** are applied.
+ -
+ - ### Insert Operation
+ - What does the **Insert Operation** do? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-12-16T00:47:14.600Z
+ card-last-reviewed:: 2022-11-14T16:47:14.600Z
+ card-last-score:: 5
+ - The **Insert Operation** provides a list of attribute values for a new tuple $t$ that is to be inserted into a relation $R$.
+ - This can happen directly via the interface or via the query.
+ - If a constraint is violated, the DBMS will reject the insertion - usually with an explanation.
+ - ### Delete Operation
+ - How can a **Delete Operation** violate constraints? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-12-13T03:03:33.858Z
+ card-last-reviewed:: 2022-11-14T20:03:33.859Z
+ card-last-score:: 5
+ - A **delete operation** can only violate **integrity constraints**, i.e., if the tuple being deleted is referenced by the foreign key from other tuples.
+ - The DBMS can:
+ - reject deletion, usually within an explanation.
+ - attempt to *cascade* deletion.
+ - modify referencing attribute.
+ - #### Update Operation
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:32:05.858Z
+ - What is an **Update** Operation? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-20T08:30:42.712Z
+ card-last-reviewed:: 2022-11-11T11:30:42.713Z
+ card-last-score:: 3
+ - An **update** operation is used to change the values of one or more attributes in a tuple of a table.
+ - Issues already discussed with insert & delete could arise with this operation, specifically:
+ - If a primary key is modified, that's essentially the same as deleting one tuple and inserting another tuple in its place.
+ - If a foreign key is modified, the DBMS must ensure that the new value refers to an existing tuple in the reference relation.
+ - ### Cascade Update & Delete
+ - Whenever tuples in the **referenced** (master) table are deleted or updated, the respective tuples of the **referencing** (child) table with a matching foreign key column will be deleted or updated as well.
+ - Note that if cascading `DELETE` is turned on, there could be many deletions performed with a single query such as:
+ - ```sql
+ DELETE FROM employee
+ WHERE ssn = 12345678;
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Joins & Union Queries/2022-11-09T13_03_58.126Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Joins & Union Queries/2022-11-09T13_03_58.126Z.Desktop.md
new file mode 100644
index 00000000..06e3b519
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Joins & Union Queries/2022-11-09T13_03_58.126Z.Desktop.md
@@ -0,0 +1,180 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Entity Relationship Models]]
+- **Next Topic:** [[Normalisation]]
+- **Relevant Slides:** 
+-
+- # Joins
+ - What are **Joins**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:10.068Z
+ card-last-score:: 1
+ - ^^**Joins** combine multiple tables into one table.^^
+ - This new (temporary) table is then queried to return results so that we can return values from any of the table that were joined.
+ - Tables are joined by specifying links (**joins**) across attributes in the tables.
+ - Joins are carried out on 2 tables at a time, but many tables can be joined in one.
+ - For example, a third table could be joined to a table that results from joining two tables.
+ - ## Specifying Joins #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:57:28.441Z
+ card-last-score:: 1
+ - [1]. In SQL, we must specify *all the tables* that are part of the join in the `FROM` clause.
+ - [2]. We must then specify the **join condition** - for an inner join, the condition is `foreign_key = primary_key / candidate_key`.
+ - [3]. The join condition can be specified in the `FROM` or `WHERE` clause.
+ - ## Different Types of Joins
+ - **Inner Join** is the default when using an **implicit join**.
+ - For **explicit joins**, we must explicitly state the join used.
+ - 
+ - ### Inner Joins #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:56:56.972Z
+ card-last-score:: 1
+ - An `INNER JOIN` includes the tuples from the first (left) of the two tables ^^only when they satisfy the join condition^^ and tuples from the second (right) table ^^only when they also satisfy the join condition.^^
+ - Example:
+ - ```sql
+ SELECT *
+ FROM employee INNER JOIN dependent
+ ON ssn = essn;
+ ```
+ - ### Left Joins #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T08:43:49.911Z
+ card-last-reviewed:: 2022-10-18T08:43:49.912Z
+ card-last-score:: 1
+ - **Left (outer) joins** include all of the tuples from the first (left) of two tables, regardless of whether or not they satisfy the join condition or if there are matching values in the second (right) table.
+ - Tuples from the second (right) table are only included when they satisfy the join condition.
+ - [Essentially the same as right joins.]
+ - Example:
+ - ```sql
+ SELECT *
+ FROM employee LEFT JOIN department ON
+ employee.ssn = department.mgrssn;
+ ```
+ - ### Right Joins #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:25.910Z
+ card-last-score:: 1
+ - **Right (outer) joins** include all of the tuples from the second (right) table, regardless of whether or not they satisfy the join condition or if there are matching values in the first (left) table.
+ - Tuples from the first (left) table are include only if the satisfy the join condition.
+ - [Essentially the same as left joins.]
+ - Example:
+ - ```sql
+ SELECT *
+ FROM employee RIGHT JOIN department ON
+ employee.ssn = department.mgrssn;
+ ```
+ - ## Inner Joining Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-17T23:00:00.000Z
+ card-last-reviewed:: 2022-10-17T13:27:52.837Z
+ card-last-score:: 1
+ - The results of an inner join operation between two tables $R(A_1, A_2, \dots, A_n)$ and $S(B_1, B_2, \dots, B_m)$ is a table $Q(A_1, A_2, \dots, A_n, B_1, B_2, \dots, B_m)$.
+ - $Q$ has one tuple for each combination of tuples (one from $R$ & one from $S$) ^^whenever the combination satisfies the join condition^^ - the join will retrieve **all** attributes in each table.
+ - ### Example: Inner Join Condition for the `employee` & `dependent` Tables
+ - **Join Condition:** `ssn = essn`.
+ - Full query retrieving all employees & their dependents (*dependants* in non-American English), when they have dependents:
+ - ```SQL
+ SELECT *
+ FROM employee INNER JOIN dependent
+ ON ssn = essn;
+ ```
+ - #### Note
+ - When attributes with the same name from different tables are used in a join query, you need to specify the table name to avoid ambiguity.
+ - For example:
+ - `bdate` in `employee` & `dependent`.
+ - We can refer to these unambiguously as `employee.bdate` & `dependent.bdate`.
+ -
+ - ## Implicit & Explicit Joins
+ - The **join condition** can be specified *implicitly* or *explicitly*.
+ - What is an **explicit join**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-17T23:00:00.000Z
+ card-last-reviewed:: 2022-10-17T13:27:41.672Z
+ card-last-score:: 1
+ - An **explicit join** is specified in the `FROM` clause where the tables to be joined are listed.
+ - The keyword `INNER JOIN` is used for inner joins, and the **join condition** is listed using the keyword `ON`.
+ - Syntax:
+ - ```SQL
+ SELECT [DISTINCT]
+ FROM
+ [INNER / LEFT / RIGHT] JOIN
+ ON
+ WHERE
+ ```
+ - What is an **implicit join**? #card
+ id:: 6346a49e-2951-4bdb-ab74-6920aa664c41
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-17T23:00:00.000Z
+ card-last-reviewed:: 2022-10-17T13:28:05.696Z
+ card-last-score:: 1
+ - An **implicit join** is specified on the `WHERE` clause without using the keyword `ON`.
+ - It is referred to as a **join condition**.
+ - All the tables must be listed in the `FROM` clause, separated by commas.
+ - The **join condition** is contained in the `WHERE` clause.
+ - If there are other conditions, the join condition is appended on with `AND`.
+ - Other conditions can be specified in the `WHERE` clause as well as the join condition.
+ - All implicit joins are **inner joins** - all rows from both tables will be returned whenever there is a match between the attributes in the join table.
+ - Syntax:
+ - ```sql
+ SELECT [DISTINCT]
+ FROM
,
+ WHERE AND
+
+ ```
+ - ## Self-Joins & Aliases
+ - What is a **self-join**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:33.200Z
+ card-last-score:: 1
+ - A **self-join** is a normal SQL join that joins a table to itself.
+ - This is accomplished by using **aliases** to give each "instance" of the table a separate name using the keyword `AS`.
+- # Sub-Queries VS Joins
+ - Can sub-queries & joins be used interchangeably? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T07:45:55.095Z
+ card-last-reviewed:: 2022-10-19T08:45:55.097Z
+ card-last-score:: 3
+ - In some cases, you can replace a join with a sub-query.
+ - But recall:
+ - Joins are needed when values across multiple tables must be displayed.
+ - Sub-queries are needed when an existing value from a table needs to be retrieved & used as part of the query solution.
+ - Sub-queries are needed when an aggregate function needs to be performed & used as part of a query solution.
+- # Union Queries
+ - The keyword `UNION` is used to combine the results of two or more queries or tables.
+ - MySQL does not support minus or intersection (intersect) operators, but the same functionality can be built using join.
+ - For union queries, tables must be **union compatible**.
+ - What does it mean to be **union compatible**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:11.787Z
+ card-last-score:: 1
+ - Two relations are **union compatible** if the schemas of two relations match.
+ - i.e., there are the same number of attributes in each relation, and each pair of corresponding attributes have the same **domain**.
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/More Java Code/2022-09-30T10_01_42.352Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/More Java Code/2022-09-30T10_01_42.352Z.Desktop.md
new file mode 100644
index 00000000..3e60286d
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/More Java Code/2022-09-30T10_01_42.352Z.Desktop.md
@@ -0,0 +1,52 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[First Java Code]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Composition & Inheritance
+ - ## Composition
+ - What is **Composition**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-21T20:50:47.300Z
+ card-last-reviewed:: 2022-09-17T20:50:47.301Z
+ card-last-score:: 5
+ - **Composition** is a type of "has-a" relationship. One object is **composed** of another and relies upon its services for its own functionality.
+ - It is one of the fundamental relationships between classes in OOP.
+ - For example:
+ - The class `RacingBike` **has-a** `Wheel` - **Composition**.
+ - How do you represent **Composition** in OOP class diagrams? #card
+ card-last-interval:: 9.55
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-29T07:30:34.783Z
+ card-last-reviewed:: 2022-09-19T18:30:34.784Z
+ card-last-score:: 5
+ - In OOP class diagrams, a **diamond shape** indicates **composition** or a "has-a" relationship.
+ - 
+ - This class diagram tells us that a `Vehicle` object is composed of a single `Engine` object.
+ - How do you realise **Composition** in Java? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-21T19:47:12.777Z
+ card-last-reviewed:: 2022-09-17T19:47:12.777Z
+ card-last-score:: 3
+ - To realise a "has-a" relationship in Java, you must ^^create a link between the **participant classes** using a **reference type variable**.^^
+ - The reference declaration is in the **owner** class.
+ -
+ - # Inheritance
+ - What is **Inheritance**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:31:39.621Z
+ card-last-score:: 1
+ - **Inheritance** is a type of "is-a" relationship.
+ - It is one of the fundamental relationships between classes in OOP.
+ - For example:
+ - A `RacingBike` **is-a** type of `Bicycle` - **Inheritance**.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/More Java Code/2022-10-07T08_33_33.349Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/More Java Code/2022-10-07T08_33_33.349Z.Desktop.md
new file mode 100644
index 00000000..8aaf9f55
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/More Java Code/2022-10-07T08_33_33.349Z.Desktop.md
@@ -0,0 +1,52 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[First Java Code]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Composition & Inheritance
+ - ## Composition
+ - What is **Composition**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T09:28:05.146Z
+ card-last-reviewed:: 2022-09-30T09:28:05.146Z
+ card-last-score:: 5
+ - **Composition** is a type of "has-a" relationship. One object is **composed** of another and relies upon its services for its own functionality.
+ - It is one of the fundamental relationships between classes in OOP.
+ - For example:
+ - The class `RacingBike` **has-a** `Wheel` - **Composition**.
+ - How do you represent **Composition** in OOP class diagrams? #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-15T07:08:01.227Z
+ card-last-reviewed:: 2022-10-04T12:08:01.227Z
+ card-last-score:: 5
+ - In OOP class diagrams, a **diamond shape** indicates **composition** or a "has-a" relationship.
+ - 
+ - This class diagram tells us that a `Vehicle` object is composed of a single `Engine` object.
+ - How do you realise **Composition** in Java? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T09:28:00.640Z
+ card-last-score:: 1
+ - To realise a "has-a" relationship in Java, you must ^^create a link between the **participant classes** using a **reference type variable**.^^
+ - The reference declaration is in the **owner** class.
+ -
+ - # Inheritance
+ - What is **Inheritance**? #card
+ card-last-interval:: 2.22
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-02T14:27:50.641Z
+ card-last-reviewed:: 2022-09-30T09:27:50.642Z
+ card-last-score:: 3
+ - **Inheritance** is a type of "is-a" relationship.
+ - It is one of the fundamental relationships between classes in OOP.
+ - For example:
+ - A `RacingBike` **is-a** type of `Bicycle` - **Inheritance**.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/More Java Code/2022-11-11T12_04_45.349Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/More Java Code/2022-11-11T12_04_45.349Z.Desktop.md
new file mode 100644
index 00000000..efeca672
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/More Java Code/2022-11-11T12_04_45.349Z.Desktop.md
@@ -0,0 +1,52 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[First Java Code]]
+- **Next Topic:** [[Variables & Types]]
+- **Relevant Slides:** 
+-
+- # Composition & Inheritance
+ - ## Composition
+ - What is **Composition**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-17T15:22:03.790Z
+ card-last-reviewed:: 2022-10-07T10:22:03.790Z
+ card-last-score:: 3
+ - **Composition** is a type of "has-a" relationship. One object is **composed** of another and relies upon its services for its own functionality.
+ - It is one of the fundamental relationships between classes in OOP.
+ - For example:
+ - The class `RacingBike` **has-a** `Wheel` - **Composition**.
+ - How do you represent **Composition** in OOP class diagrams? #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-15T07:08:01.227Z
+ card-last-reviewed:: 2022-10-04T12:08:01.227Z
+ card-last-score:: 5
+ - In OOP class diagrams, a **diamond shape** indicates **composition** or a "has-a" relationship.
+ - 
+ - This class diagram tells us that a `Vehicle` object is composed of a single `Engine` object.
+ - How do you realise **Composition** in Java? #card
+ card-last-interval:: 3.58
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T23:31:31.282Z
+ card-last-reviewed:: 2022-10-07T10:31:31.282Z
+ card-last-score:: 5
+ - To realise a "has-a" relationship in Java, you must ^^create a link between the **participant classes** using a **reference type variable**.^^
+ - The reference declaration is in the **owner** class.
+ -
+ - # Inheritance
+ - What is **Inheritance**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-15T14:18:15.221Z
+ card-last-reviewed:: 2022-10-06T17:18:15.222Z
+ card-last-score:: 3
+ - **Inheritance** is a type of "is-a" relationship.
+ - It is one of the fundamental relationships between classes in OOP.
+ - For example:
+ - A `RacingBike` **is-a** type of `Bicycle` - **Inheritance**.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Normalisation/2022-11-11T12_04_45.351Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Normalisation/2022-11-11T12_04_45.351Z.Desktop.md
new file mode 100644
index 00000000..6f469e60
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Normalisation/2022-11-11T12_04_45.351Z.Desktop.md
@@ -0,0 +1,227 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Joins & Union Queries]]
+- **Next Topic:** [[Query Processing: Relational Algebra]]
+- **Relevant Slides:**  
+-
+- # Normalisation
+ - What is **normalisation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:26:27.892Z
+ card-last-score:: 1
+ - **Normalisation** takes each table through a series of tests to "verify" whether or not it belongs to a certain **normal form**.
+ - Normal forms to check:
+ - 1^{st}, 2^{nd}, & 3^{rd} normal forms (**NF**).
+ - Boyce-Codd normal form - strong 3NF.
+ - 4^{th} & 5^{th} Normal Forms.
+ - ### Normalisation Provides:
+ - 1. A formal framework for analysing relation schemas based on **keys** & **functional dependencies** among attributes.
+ 2. A series of **tests** so that a database can be normalised to any degree (e.g., from 1NF to 5NF).
+ - However, normalisation does not necessarily provide a good design if considered in isolation to everything else.
+ - What are **normalisation rules**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:34:44.367Z
+ card-last-score:: 1
+ - **Normalisation** rules gives us a *formal measure* of why one grouping of attributes in a relation schema may be better than the other.
+ - Why normalise? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:34:00.942Z
+ card-last-score:: 1
+ - 1. Redundancy will be reduced or eliminated, reducing storage space as a result.
+ 2. The task of maintaining data integrity is made easier.
+ - However, with normalisation, tables are usually added to the schema and are linked with foreign keys, which causes queries to become more complex as the often require data from multiple tables (requiring joins or subqueries).
+ - ## Normalised & Un-Normalised Databases
+ - Both normalised & un-normalised databases have advantages & disadvantages.
+ - If a data base is **normalised**:
+ - No (or very little) redundancy.
+ - No anomalies when inserting, deleting, or modifying data.
+ - More tables.
+ - More foreign & primary keys to link tables.
+ - More complex queries.
+ - ### Redundancy
+ - What is **redundancy**? #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-29T06:39:09.263Z
+ card-last-reviewed:: 2022-10-26T11:39:09.264Z
+ card-last-score:: 5
+ - **Redundancy** is the unnecessary duplication of data in a database.
+ - Consequences of redundancy:
+ - Space is wasted.
+ - Data can become inconsistent due to potential problems with update, insert, & delete operations.
+ - What is **duplication**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:39:40.006Z
+ card-last-score:: 1
+ - Duplicated data can naturally be present in a database and is not necessarily redundant.
+ - For example, an attribute can have two identical values.
+ - In the company database `ESSN` in `works_on` may be duplicated across many projects.
+ - Data is **duplicated** rather than **redundant** if information is lost when deleting data
+ -
+ - ## Alternatives to Normalisation #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-29T06:34:59.505Z
+ card-last-reviewed:: 2022-10-26T11:34:59.505Z
+ card-last-score:: 5
+ - The alternative to normalisation is to retain redundant data and maintain data integrity by means of code consistency checks.
+ - In some applications, the number of insertions may be very small or non-existent and in such cases, the overhead of normalised tables is generally not required.
+ - ## De-Normalisation
+ - What is **de-normalisation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:26:15.641Z
+ card-last-score:: 1
+ - **De-normalisation** is a process of making compromises to the normalised tables by ^^introducing intentional redundancy^^ for performance reasons (specifically, querying performance).
+ - Typically, de-normalisation will improve query times at the expense of data updates (insert, delete, update).
+- # Functional Dependencies
+ - What is **Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:24:09.173Z
+ card-last-score:: 1
+ - If $A$ & $B$ are attributes of a relation $R$, then $B$ is **functionally dependent (FD)** on $A$ if each value of $A$ is associated with exactly one value of $B$.
+ - i.e., values in $B$ are uniquely determined by values of $A$.
+ - Functional Dependency is one of the main concepts associated with normalisation.
+ - It describes the ^^relationship between attributes.^^
+ - $A$ -> $B$:
+ - FD from $A$ to $B$.
+ - $B$ is FD on $A$.
+ - 
+ - $A$ -> $B$ does not necessarily imply $B$ -> $A$.
+ - $A$ <-> $B$ denotes $A$ -> $B$ & $B$ -> $A$.
+ - $A$ -> $\{B,C\}$ denotes $A$ -> $B$ & $A$ -> $C$.
+ - $\{A,B\}$ -> $C$ denotes that it is the **combination** of $A$ & $B$ that uniquely determines $C$.
+ - ### Note on FDs
+ - A functional dependency is a property of a relation schema $R$ and cannot be inferred automatically. Instead, it must be defined explicitly by someone who knows the **semantics** of $R$.
+ - You will either be explicitly given all FDs, or given enough information about the attributes & the domain to *reasonably* infer the FDs (perhaps having to make assumptions).
+ - ## Types of FDs #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:27:22.772Z
+ card-last-score:: 1
+ - ### Full Functional Dependency
+ - What is a **Full Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:24:16.042Z
+ card-last-score:: 1
+ - A functional dependency $\{X, Y\}$ -> $Z$ is a **full functional dependency** if when some attribute (either $X$ or $Y$) is removed from the left-hand side, the dependency ^^does not hold.^^
+ - There may be any number of attributes on the LHS.
+ - ### Partial Functional Dependency
+ - What is a **Partial Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:40:00.928Z
+ card-last-score:: 1
+ - A functional dependency $\{X, Y\}$ -> $Z$ is a **partial functional dependency** if some attribute (either $X$ or $Y$) can be removed from the LHS and the dependency ^^still holds.^^
+ - There may be any number of attributes on the LHS.
+ - ### Transitive Functional Dependency
+ - What is a **Transitive Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:31:05.365Z
+ card-last-score:: 1
+ - A functional dependency $X$ -> $Y$ is a **transitive functional dependency** in the relation $R$ if there is a set of attributes $Z$ that is neither a candidate key nor a subset of any key of $R$, and borht $X$ -> $Z$ & $Z$ -> $Y$ hold
+ - What is a **Candidate Key (CK)**? #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-29T06:42:33.029Z
+ card-last-reviewed:: 2022-10-26T11:42:33.029Z
+ card-last-score:: 5
+ - A **candidate key (CK)** is one or more attribute(s) in a relation with which you can determine all the attributes in the relation.
+ - Every relation has one or more candidate keys.
+ - We pick one such candidate key as the primary key of a relation.
+ - # Inference Rules for FDs
+ - Typically, the main obvious functional dependencies $F$ are specified for a schema.
+ - However, many others can be inferred from $F$.
+ - We call these the **closure** of $F$: $F^+$.
+ - **1. Reflexive:** Trivially, an attribute, or a set of attributes, always determines itself.
+ - **2. Augmentation:** If $X$ - $Y$, we can infer $XZ$ -> $YZ$.
+ - **3. Transitive:** If $X$ -> $Y$ & $Y$ -> $Z$, we can infer $X$ -> $Z$.
+ - **4. Decomposition:** If $X$ -> $YZ$, we can infer $X$ -> $Y$.
+ - **5. Union (additive):** If $X$ -> $Y$ and $X$ -> $Z$, we can infer if $X$ -> $YZ$.
+ - **6. Pseudotransitive:** If $X$ -> $Y$ and $WY$ -> $Z$, we can infer $WX$ -> $Z$.
+ - Note: Rules 1,2, & 3 are collectively called **Armstrong's Axioms**.
+- # Normal Forms
+ - ## First Normal Form (1NF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:32:19.711Z
+ card-last-score:: 1
+ - A table is in in **1NF** if the table does not have any repeating groups (a group of attributes that occur a variable number of times in each record (non-atomic)).
+ - To ensure first normal form, choose an appropriate primary key (if one is not already specified) and if required, split the table into two or more tables to remove repeating groups.
+ - ## Second Normal Form (2NF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:42:43.105Z
+ card-last-score:: 1
+ - A relation in **2NF** must be in 1NF and be such that where there is a composite primary key, all non-key attributes must be dependent on the *entire* primary key.
+ - If partial dependencies exist, create new relations to split the attributes such that the partial dependency no longer holds.
+ - ## Third Normal Form (3NF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:44:42.467Z
+ card-last-score:: 1
+ - A relation is in **3NF** if it is in 3NF and there are no dependencies between attributes that are not primary keys.
+ - That is, no transitive dependencies exist in the table.
+ - ### Steps to Normalise to 3NF #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:43:05.713Z
+ card-last-score:: 1
+ - 1. Identify an appropriate **Primary Key** if not already given.
+ - This puts the table into **1NF**.
+ - 2. Draw a diagram of **Functional Dependencies** from the primary key.
+ 3. Identify if the dependencies are Full, Partial, or Transitive.
+ 4. Using the diagram of the functional dependencies from the previous steps:
+ - 5. Normalise to **2NF** by ^^removing **partial dependencies**^^ - creating new tables as a result. Ensure that all new tables have Primary Keys.
+ 6. Normalise to **3NF** by ^^removing **transitive dependencies**^^ (if they exist), creating new tables as a result. Ensure that any new tables have Primary Keys and are in 2NF.
+ 7. Check that all resulting tables are themselves in 1NF, 2NF, and 3NF (in particular, make sure that they all have PKs of their own).
+ - ## Boyce-Codd Normal Form (BCNF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:40:29.231Z
+ card-last-score:: 1
+ - Only in rare cases does a 3NF table not meet the requirements off **BCNF**.
+ - These cases are when a table has more than one candidate key.
+ - Depending on the functional dependencies, a 3NF table with two or more overlapping candidate keys may or may not be in BCNF.
+ - If a table in 3NF **does not** have multiple overlapping candidate keys, then it is guaranteed to be in **BCNF**.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Normalisation/2022-11-23T09_22_44.502Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Normalisation/2022-11-23T09_22_44.502Z.Desktop.md
new file mode 100644
index 00000000..ef529988
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Normalisation/2022-11-23T09_22_44.502Z.Desktop.md
@@ -0,0 +1,227 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Joins & Union Queries]]
+- **Next Topic:** [[Query Processing: Relational Algebra]]
+- **Relevant Slides:**  
+-
+- # Normalisation
+ - What is **normalisation**? #card
+ card-last-interval:: 0.95
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-18T17:36:23.333Z
+ card-last-reviewed:: 2022-11-17T19:36:23.333Z
+ card-last-score:: 3
+ - **Normalisation** takes each table through a series of tests to "verify" whether or not it belongs to a certain **normal form**.
+ - Normal forms to check:
+ - 1^{st}, 2^{nd}, & 3^{rd} normal forms (**NF**).
+ - Boyce-Codd normal form - strong 3NF.
+ - 4^{th} & 5^{th} Normal Forms.
+ - ### Normalisation Provides:
+ - 1. A formal framework for analysing relation schemas based on **keys** & **functional dependencies** among attributes.
+ 2. A series of **tests** so that a database can be normalised to any degree (e.g., from 1NF to 5NF).
+ - However, normalisation does not necessarily provide a good design if considered in isolation to everything else.
+ - What are **normalisation rules**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:16:28.568Z
+ card-last-score:: 1
+ - **Normalisation** rules gives us a *formal measure* of why one grouping of attributes in a relation schema may be better than the other.
+ - Why normalise? #card
+ card-last-interval:: 0.95
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-22T11:06:25.159Z
+ card-last-reviewed:: 2022-11-21T13:06:25.160Z
+ card-last-score:: 3
+ - 1. Redundancy will be reduced or eliminated, reducing storage space as a result.
+ 2. The task of maintaining data integrity is made easier.
+ - However, with normalisation, tables are usually added to the schema and are linked with foreign keys, which causes queries to become more complex as the often require data from multiple tables (requiring joins or subqueries).
+ - ## Normalised & Un-Normalised Databases
+ - Both normalised & un-normalised databases have advantages & disadvantages.
+ - If a data base is **normalised**:
+ - No (or very little) redundancy.
+ - No anomalies when inserting, deleting, or modifying data.
+ - More tables.
+ - More foreign & primary keys to link tables.
+ - More complex queries.
+ - ### Redundancy
+ - What is **redundancy**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-18T20:19:53.452Z
+ card-last-reviewed:: 2022-11-14T20:19:53.453Z
+ card-last-score:: 5
+ - **Redundancy** is the unnecessary duplication of data in a database.
+ - Consequences of redundancy:
+ - Space is wasted.
+ - Data can become inconsistent due to potential problems with update, insert, & delete operations.
+ - What is **duplication**? #card
+ card-last-interval:: 2.97
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T19:17:11.015Z
+ card-last-reviewed:: 2022-11-14T20:17:11.015Z
+ card-last-score:: 5
+ - Duplicated data can naturally be present in a database and is not necessarily redundant.
+ - For example, an attribute can have two identical values.
+ - In the company database `ESSN` in `works_on` may be duplicated across many projects.
+ - Data is **duplicated** rather than **redundant** if information is lost when deleting data
+ -
+ - ## Alternatives to Normalisation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:19:50.503Z
+ card-last-score:: 1
+ - The alternative to normalisation is to retain redundant data and maintain data integrity by means of code consistency checks.
+ - In some applications, the number of insertions may be very small or non-existent and in such cases, the overhead of normalised tables is generally not required.
+ - ## De-Normalisation
+ - What is **de-normalisation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:34:49.533Z
+ card-last-score:: 1
+ - **De-normalisation** is a process of making compromises to the normalised tables by ^^introducing intentional redundancy^^ for performance reasons (specifically, querying performance).
+ - Typically, de-normalisation will improve query times at the expense of data updates (insert, delete, update).
+- # Functional Dependencies
+ - What is **Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-22T00:00:00.000Z
+ card-last-reviewed:: 2022-11-21T13:06:48.090Z
+ card-last-score:: 1
+ - If $A$ & $B$ are attributes of a relation $R$, then $B$ is **functionally dependent (FD)** on $A$ if each value of $A$ is associated with exactly one value of $B$.
+ - i.e., values in $B$ are uniquely determined by values of $A$.
+ - Functional Dependency is one of the main concepts associated with normalisation.
+ - It describes the ^^relationship between attributes.^^
+ - $A$ -> $B$:
+ - FD from $A$ to $B$.
+ - $B$ is FD on $A$.
+ - 
+ - $A$ -> $B$ does not necessarily imply $B$ -> $A$.
+ - $A$ <-> $B$ denotes $A$ -> $B$ & $B$ -> $A$.
+ - $A$ -> $\{B,C\}$ denotes $A$ -> $B$ & $A$ -> $C$.
+ - $\{A,B\}$ -> $C$ denotes that it is the **combination** of $A$ & $B$ that uniquely determines $C$.
+ - ### Note on FDs
+ - A functional dependency is a property of a relation schema $R$ and cannot be inferred automatically. Instead, it must be defined explicitly by someone who knows the **semantics** of $R$.
+ - You will either be explicitly given all FDs, or given enough information about the attributes & the domain to *reasonably* infer the FDs (perhaps having to make assumptions).
+ - ## Types of FDs #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:19:30.192Z
+ card-last-score:: 1
+ - ### Full Functional Dependency
+ - What is a **Full Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:15:37.929Z
+ card-last-score:: 1
+ - A functional dependency $\{X, Y\}$ -> $Z$ is a **full functional dependency** if when some attribute (either $X$ or $Y$) is removed from the left-hand side, the dependency ^^does not hold.^^
+ - There may be any number of attributes on the LHS.
+ - ### Partial Functional Dependency
+ - What is a **Partial Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:15:25.672Z
+ card-last-score:: 1
+ - A functional dependency $\{X, Y\}$ -> $Z$ is a **partial functional dependency** if some attribute (either $X$ or $Y$) can be removed from the LHS and the dependency ^^still holds.^^
+ - There may be any number of attributes on the LHS.
+ - ### Transitive Functional Dependency
+ - What is a **Transitive Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:16:18.865Z
+ card-last-score:: 1
+ - A functional dependency $X$ -> $Y$ is a **transitive functional dependency** in the relation $R$ if there is a set of attributes $Z$ that is neither a candidate key nor a subset of any key of $R$, and both $X$ -> $Z$ & $Z$ -> $Y$ hold
+ - What is a **Candidate Key (CK)**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-18T06:20:02.759Z
+ card-last-reviewed:: 2022-11-14T20:20:02.759Z
+ card-last-score:: 3
+ - A **candidate key (CK)** is one or more attribute(s) in a relation with which you can determine all the attributes in the relation.
+ - Every relation has one or more candidate keys.
+ - We pick one such candidate key as the primary key of a relation.
+ - # Inference Rules for FDs
+ - Typically, the main obvious functional dependencies $F$ are specified for a schema.
+ - However, many others can be inferred from $F$.
+ - We call these the **closure** of $F$: $F^+$.
+ - **1. Reflexive:** Trivially, an attribute, or a set of attributes, always determines itself.
+ - **2. Augmentation:** If $X$ - $Y$, we can infer $XZ$ -> $YZ$.
+ - **3. Transitive:** If $X$ -> $Y$ & $Y$ -> $Z$, we can infer $X$ -> $Z$.
+ - **4. Decomposition:** If $X$ -> $YZ$, we can infer $X$ -> $Y$.
+ - **5. Union (additive):** If $X$ -> $Y$ and $X$ -> $Z$, we can infer if $X$ -> $YZ$.
+ - **6. Pseudotransitive:** If $X$ -> $Y$ and $WY$ -> $Z$, we can infer $WX$ -> $Z$.
+ - Note: Rules 1,2, & 3 are collectively called **Armstrong's Axioms**.
+- # Normal Forms
+ - ## First Normal Form (1NF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:12:58.023Z
+ card-last-score:: 1
+ - A table is in in **1NF** if the table ==does not have any repeating groups== (a group of attributes that occur a variable number of times in each record (non-atomic)).
+ - To ensure first normal form, choose an appropriate primary key (if one is not already specified) and if required, split the table into two or more tables to remove repeating groups.
+ - ## Second Normal Form (2NF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:15:09.806Z
+ card-last-score:: 1
+ - A relation in **2NF** must be in 1NF and be such that where there is a composite primary key, all non-key attributes must be dependent on the *entire* primary key.
+ - If partial dependencies exist, create new relations to split the attributes such that the partial dependency no longer holds.
+ - ## Third Normal Form (3NF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:15:39.277Z
+ card-last-score:: 1
+ - A relation is in **3NF** if it is in 3NF and there are no dependencies between attributes that are not primary keys.
+ - That is, no transitive dependencies exist in the table.
+ - ### Steps to Normalise to 3NF #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:17:36.919Z
+ card-last-score:: 1
+ - 1. Identify an appropriate **Primary Key** if not already given.
+ - This puts the table into **1NF**.
+ - 2. Draw a diagram of **Functional Dependencies** from the primary key.
+ 3. Identify if the dependencies are Full, Partial, or Transitive.
+ 4. Using the diagram of the functional dependencies from the previous steps:
+ - 5. Normalise to **2NF** by ^^removing **partial dependencies**^^ - creating new tables as a result. Ensure that all new tables have Primary Keys.
+ 6. Normalise to **3NF** by ^^removing **transitive dependencies**^^ (if they exist), creating new tables as a result. Ensure that any new tables have Primary Keys and are in 2NF.
+ 7. Check that all resulting tables are themselves in 1NF, 2NF, and 3NF (in particular, make sure that they all have PKs of their own).
+ - ## Boyce-Codd Normal Form (BCNF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:17:25.144Z
+ card-last-score:: 1
+ - Only in rare cases does a 3NF table not meet the requirements off **BCNF**.
+ - These cases are when a table has more than one candidate key.
+ - Depending on the functional dependencies, a 3NF table with two or more overlapping candidate keys may or may not be in BCNF.
+ - If a table in 3NF **does not** have multiple overlapping candidate keys, then it is guaranteed to be in **BCNF**.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Normalisation/2022-11-23T12_15_36.865Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Normalisation/2022-11-23T12_15_36.865Z.Desktop.md
new file mode 100644
index 00000000..ef529988
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Normalisation/2022-11-23T12_15_36.865Z.Desktop.md
@@ -0,0 +1,227 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Joins & Union Queries]]
+- **Next Topic:** [[Query Processing: Relational Algebra]]
+- **Relevant Slides:**  
+-
+- # Normalisation
+ - What is **normalisation**? #card
+ card-last-interval:: 0.95
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-18T17:36:23.333Z
+ card-last-reviewed:: 2022-11-17T19:36:23.333Z
+ card-last-score:: 3
+ - **Normalisation** takes each table through a series of tests to "verify" whether or not it belongs to a certain **normal form**.
+ - Normal forms to check:
+ - 1^{st}, 2^{nd}, & 3^{rd} normal forms (**NF**).
+ - Boyce-Codd normal form - strong 3NF.
+ - 4^{th} & 5^{th} Normal Forms.
+ - ### Normalisation Provides:
+ - 1. A formal framework for analysing relation schemas based on **keys** & **functional dependencies** among attributes.
+ 2. A series of **tests** so that a database can be normalised to any degree (e.g., from 1NF to 5NF).
+ - However, normalisation does not necessarily provide a good design if considered in isolation to everything else.
+ - What are **normalisation rules**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:16:28.568Z
+ card-last-score:: 1
+ - **Normalisation** rules gives us a *formal measure* of why one grouping of attributes in a relation schema may be better than the other.
+ - Why normalise? #card
+ card-last-interval:: 0.95
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-22T11:06:25.159Z
+ card-last-reviewed:: 2022-11-21T13:06:25.160Z
+ card-last-score:: 3
+ - 1. Redundancy will be reduced or eliminated, reducing storage space as a result.
+ 2. The task of maintaining data integrity is made easier.
+ - However, with normalisation, tables are usually added to the schema and are linked with foreign keys, which causes queries to become more complex as the often require data from multiple tables (requiring joins or subqueries).
+ - ## Normalised & Un-Normalised Databases
+ - Both normalised & un-normalised databases have advantages & disadvantages.
+ - If a data base is **normalised**:
+ - No (or very little) redundancy.
+ - No anomalies when inserting, deleting, or modifying data.
+ - More tables.
+ - More foreign & primary keys to link tables.
+ - More complex queries.
+ - ### Redundancy
+ - What is **redundancy**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-18T20:19:53.452Z
+ card-last-reviewed:: 2022-11-14T20:19:53.453Z
+ card-last-score:: 5
+ - **Redundancy** is the unnecessary duplication of data in a database.
+ - Consequences of redundancy:
+ - Space is wasted.
+ - Data can become inconsistent due to potential problems with update, insert, & delete operations.
+ - What is **duplication**? #card
+ card-last-interval:: 2.97
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T19:17:11.015Z
+ card-last-reviewed:: 2022-11-14T20:17:11.015Z
+ card-last-score:: 5
+ - Duplicated data can naturally be present in a database and is not necessarily redundant.
+ - For example, an attribute can have two identical values.
+ - In the company database `ESSN` in `works_on` may be duplicated across many projects.
+ - Data is **duplicated** rather than **redundant** if information is lost when deleting data
+ -
+ - ## Alternatives to Normalisation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:19:50.503Z
+ card-last-score:: 1
+ - The alternative to normalisation is to retain redundant data and maintain data integrity by means of code consistency checks.
+ - In some applications, the number of insertions may be very small or non-existent and in such cases, the overhead of normalised tables is generally not required.
+ - ## De-Normalisation
+ - What is **de-normalisation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:34:49.533Z
+ card-last-score:: 1
+ - **De-normalisation** is a process of making compromises to the normalised tables by ^^introducing intentional redundancy^^ for performance reasons (specifically, querying performance).
+ - Typically, de-normalisation will improve query times at the expense of data updates (insert, delete, update).
+- # Functional Dependencies
+ - What is **Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-22T00:00:00.000Z
+ card-last-reviewed:: 2022-11-21T13:06:48.090Z
+ card-last-score:: 1
+ - If $A$ & $B$ are attributes of a relation $R$, then $B$ is **functionally dependent (FD)** on $A$ if each value of $A$ is associated with exactly one value of $B$.
+ - i.e., values in $B$ are uniquely determined by values of $A$.
+ - Functional Dependency is one of the main concepts associated with normalisation.
+ - It describes the ^^relationship between attributes.^^
+ - $A$ -> $B$:
+ - FD from $A$ to $B$.
+ - $B$ is FD on $A$.
+ - 
+ - $A$ -> $B$ does not necessarily imply $B$ -> $A$.
+ - $A$ <-> $B$ denotes $A$ -> $B$ & $B$ -> $A$.
+ - $A$ -> $\{B,C\}$ denotes $A$ -> $B$ & $A$ -> $C$.
+ - $\{A,B\}$ -> $C$ denotes that it is the **combination** of $A$ & $B$ that uniquely determines $C$.
+ - ### Note on FDs
+ - A functional dependency is a property of a relation schema $R$ and cannot be inferred automatically. Instead, it must be defined explicitly by someone who knows the **semantics** of $R$.
+ - You will either be explicitly given all FDs, or given enough information about the attributes & the domain to *reasonably* infer the FDs (perhaps having to make assumptions).
+ - ## Types of FDs #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:19:30.192Z
+ card-last-score:: 1
+ - ### Full Functional Dependency
+ - What is a **Full Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:15:37.929Z
+ card-last-score:: 1
+ - A functional dependency $\{X, Y\}$ -> $Z$ is a **full functional dependency** if when some attribute (either $X$ or $Y$) is removed from the left-hand side, the dependency ^^does not hold.^^
+ - There may be any number of attributes on the LHS.
+ - ### Partial Functional Dependency
+ - What is a **Partial Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:15:25.672Z
+ card-last-score:: 1
+ - A functional dependency $\{X, Y\}$ -> $Z$ is a **partial functional dependency** if some attribute (either $X$ or $Y$) can be removed from the LHS and the dependency ^^still holds.^^
+ - There may be any number of attributes on the LHS.
+ - ### Transitive Functional Dependency
+ - What is a **Transitive Functional Dependency**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:16:18.865Z
+ card-last-score:: 1
+ - A functional dependency $X$ -> $Y$ is a **transitive functional dependency** in the relation $R$ if there is a set of attributes $Z$ that is neither a candidate key nor a subset of any key of $R$, and both $X$ -> $Z$ & $Z$ -> $Y$ hold
+ - What is a **Candidate Key (CK)**? #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-18T06:20:02.759Z
+ card-last-reviewed:: 2022-11-14T20:20:02.759Z
+ card-last-score:: 3
+ - A **candidate key (CK)** is one or more attribute(s) in a relation with which you can determine all the attributes in the relation.
+ - Every relation has one or more candidate keys.
+ - We pick one such candidate key as the primary key of a relation.
+ - # Inference Rules for FDs
+ - Typically, the main obvious functional dependencies $F$ are specified for a schema.
+ - However, many others can be inferred from $F$.
+ - We call these the **closure** of $F$: $F^+$.
+ - **1. Reflexive:** Trivially, an attribute, or a set of attributes, always determines itself.
+ - **2. Augmentation:** If $X$ - $Y$, we can infer $XZ$ -> $YZ$.
+ - **3. Transitive:** If $X$ -> $Y$ & $Y$ -> $Z$, we can infer $X$ -> $Z$.
+ - **4. Decomposition:** If $X$ -> $YZ$, we can infer $X$ -> $Y$.
+ - **5. Union (additive):** If $X$ -> $Y$ and $X$ -> $Z$, we can infer if $X$ -> $YZ$.
+ - **6. Pseudotransitive:** If $X$ -> $Y$ and $WY$ -> $Z$, we can infer $WX$ -> $Z$.
+ - Note: Rules 1,2, & 3 are collectively called **Armstrong's Axioms**.
+- # Normal Forms
+ - ## First Normal Form (1NF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:12:58.023Z
+ card-last-score:: 1
+ - A table is in in **1NF** if the table ==does not have any repeating groups== (a group of attributes that occur a variable number of times in each record (non-atomic)).
+ - To ensure first normal form, choose an appropriate primary key (if one is not already specified) and if required, split the table into two or more tables to remove repeating groups.
+ - ## Second Normal Form (2NF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:15:09.806Z
+ card-last-score:: 1
+ - A relation in **2NF** must be in 1NF and be such that where there is a composite primary key, all non-key attributes must be dependent on the *entire* primary key.
+ - If partial dependencies exist, create new relations to split the attributes such that the partial dependency no longer holds.
+ - ## Third Normal Form (3NF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:15:39.277Z
+ card-last-score:: 1
+ - A relation is in **3NF** if it is in 3NF and there are no dependencies between attributes that are not primary keys.
+ - That is, no transitive dependencies exist in the table.
+ - ### Steps to Normalise to 3NF #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:17:36.919Z
+ card-last-score:: 1
+ - 1. Identify an appropriate **Primary Key** if not already given.
+ - This puts the table into **1NF**.
+ - 2. Draw a diagram of **Functional Dependencies** from the primary key.
+ 3. Identify if the dependencies are Full, Partial, or Transitive.
+ 4. Using the diagram of the functional dependencies from the previous steps:
+ - 5. Normalise to **2NF** by ^^removing **partial dependencies**^^ - creating new tables as a result. Ensure that all new tables have Primary Keys.
+ 6. Normalise to **3NF** by ^^removing **transitive dependencies**^^ (if they exist), creating new tables as a result. Ensure that any new tables have Primary Keys and are in 2NF.
+ 7. Check that all resulting tables are themselves in 1NF, 2NF, and 3NF (in particular, make sure that they all have PKs of their own).
+ - ## Boyce-Codd Normal Form (BCNF) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:17:25.144Z
+ card-last-score:: 1
+ - Only in rare cases does a 3NF table not meet the requirements off **BCNF**.
+ - These cases are when a table has more than one candidate key.
+ - Depending on the functional dependencies, a 3NF table with two or more overlapping candidate keys may or may not be in BCNF.
+ - If a table in 3NF **does not** have multiple overlapping candidate keys, then it is guaranteed to be in **BCNF**.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/OOP Modelling/2022-11-11T12_04_45.359Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/OOP Modelling/2022-11-11T12_04_45.359Z.Desktop.md
new file mode 100644
index 00000000..794ed376
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/OOP Modelling/2022-11-11T12_04_45.359Z.Desktop.md
@@ -0,0 +1,35 @@
+- #[[CT2106 - Object-Oriented Programming]]
+- **Previous Topic:** [[Variables & Types]]
+- **Next Topic:** [[Introduction to Inheritance]]
+- **Relevant Slides:**   
+-
+- # Modelling the Problem
+ - A major part of OOP is modelling the problem.
+ - The goal is to identify the **principle objects** in the problem domain, which we model as classes, the **responsibility** of each of these objects, and the **collaborations** between objects.
+ - The objective of OOP Modelling is to produce a simplified **class diagram**.
+ - **Classes** represent real-world entities.
+ - **Associations** represent collaborations between the entities.
+ - **Attributes** represent the data held about these entities.
+ - **Generalisation** can be used to simplify the structure of the model.
+ - What are **nouns** in OOP? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-20T02:53:27.410Z
+ card-last-reviewed:: 2022-10-08T22:53:27.411Z
+ card-last-score:: 5
+ - **Nouns** are candidate objects in OOP.
+-
+- # OOP Principles
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:41:16.772Z
+ card-last-reviewed:: 2022-10-07T10:41:16.772Z
+ card-last-score:: 5
+ - Consider the following principles when assigning responsibilities:
+ - An **Object** is responsible for its own data.
+ - An Object is responsibility for communicating its state.
+ - **Single Responsibility Principle:** Each **Class** should have a ^^single responsibility.^^
+ - All its services should be aligned with that responsibility.
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-09-30T08_54_51.906Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-09-30T08_54_51.906Z.Desktop.md
new file mode 100644
index 00000000..31639835
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-09-30T08_54_51.906Z.Desktop.md
@@ -0,0 +1,541 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- No previous topic.
+- **Relevant Slides:** 
+-
+- ## Traditional Classes of Computer Systems
+ - What is a **Personal Computer (PC)**?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-09-23T18:28:00.836Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.7
+ card-last-reviewed:: 2022-09-19T18:28:00.836Z
+ - A **Personal Computer** is a computer designed for use by an individual, usually incorporating a graphics display, a keyboard, and a mouse.
+ - What is a **Server**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:51:19.171Z
+ card-last-reviewed:: 2022-09-18T14:51:19.172Z
+ card-last-score:: 3
+ - A **server** is a computer used for running larger programs for multiple users, often simultaneously, and typically accessed only via a network.
+ - What is a **Supercomputer**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:20:18.972Z
+ card-last-reviewed:: 2022-09-18T15:20:18.973Z
+ card-last-score:: 5
+ - A **supercomputer** is a member of a class of computers with the highest performance (and cost). They are configured as servers and typically cost tens to hundreds of millions of dollars.
+ - What is an **Embedded Computer**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:17:21.268Z
+ card-last-reviewed:: 2022-09-18T15:17:21.269Z
+ card-last-score:: 5
+ - An **embedded computer** is a computer inside another device, used for running one predetermined application or collection of software.
+ - What are **Personal Mobile Devices**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:17:24.814Z
+ card-last-reviewed:: 2022-09-18T15:17:24.814Z
+ card-last-score:: 5
+ - **Personal Mobile Devices** are small, wireless devices that connect to the internet.
+ - They rely on batteries for power, and software is installed by downloading apps.
+ - Conventional examples include smartphones and tablets.
+ - What is **Cloud Computing**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:16:02.669Z
+ card-last-reviewed:: 2022-09-18T15:16:02.669Z
+ card-last-score:: 5
+ - **Cloud Computing** refers to large collections of servers that provide services over the internet.
+ - Some providers rent dynamically varying number of servers as a utility.
+ - What is **Software as a Service**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T17:42:30.362Z
+ card-last-reviewed:: 2022-09-19T17:42:30.363Z
+ card-last-score:: 5
+ - **Software as a Service** delivers software & data as a service over the internet, usually via a thing program, such as a browser.
+ - Examples include web search & email.
+ -
+- ## Computer Systems
+ collapsed:: true
+ - {:height 410, :width 414}
+ - What is **Application Software**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:17:30.513Z
+ card-last-reviewed:: 2022-09-18T15:17:30.513Z
+ card-last-score:: 5
+ - **Application Software** consists of user-installed applications & programs.
+ - Application Software provides services to the user that are commonly useful.
+ - What is the purpose of the **Operating System**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:16:09.752Z
+ card-last-reviewed:: 2022-09-18T15:16:09.753Z
+ card-last-score:: 5
+ - The **Operating System** interfaces between a user's program and the hardware, provides a variety of services, and performs supervisory functions.
+ - What is the purpose of the **Hardware**?
+ - The **Hardware** performs the tasks.
+ -
+- ## Seven Great Ideas in Computer Organisation
+ - ### 1. Use **Abstraction** to Simplify Design #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:25:18.076Z
+ card-last-reviewed:: 2022-09-19T18:25:18.076Z
+ card-last-score:: 5
+ - A major productivity technique for hardware & software is to use **abstractions** to characterise the design at different levels of representation
+ - Lower-level details are hidden to offer a simpler model at higher levels.
+ - ### 2. Make the **Common Case** Fast #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:16:44.377Z
+ card-last-reviewed:: 2022-09-18T15:16:44.378Z
+ card-last-score:: 5
+ - Making the **common case fast** will tend to enhance performance better than optimising the rare case.
+ - The common case is often simpler than the rare case, and hence is usually easier to enhance.
+ - ### 3. Performance via **Parallelism** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:03:58.567Z
+ card-last-reviewed:: 2022-09-18T15:03:58.567Z
+ card-last-score:: 5
+ - Involves speeding up performance by using designs that compute operations in **parallel**.
+ - ### 4. Performance via **Pipelining** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-21T20:52:29.657Z
+ card-last-reviewed:: 2022-09-17T20:52:29.657Z
+ card-last-score:: 5
+ - **Performance via Pipelining** is a particular pattern of **parallelism** that is so prevalent in computer architecture that it merits its own name.
+ - ### 5. Performance via **Prediction** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:23:23.782Z
+ card-last-reviewed:: 2022-09-19T18:23:23.782Z
+ card-last-score:: 5
+ - In some cases, it can be ^^faster on average to guess and start working^^ that to wait until you know for sure (assuming that the mechanism to recover from a misprediction is not too expensive, and your prediction is relatively accurate).
+ - ### 6. Hierarchy of Memories #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:18:36.340Z
+ card-last-reviewed:: 2022-09-18T15:18:36.341Z
+ card-last-score:: 5
+ - Computer Architects have found that they can address conflicting demands with a **hierarchy of memories**.
+ - The ^^fastest, smallest, & most expensive memory per bit^^ is at the top of the hierarchy.
+ - The ^^slowest, largest, & cheapest per bit^^ is at the bottom of the hierarchy.
+ - ### 7. Dependability via **Redundancy** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:19:01.340Z
+ card-last-reviewed:: 2022-09-18T15:19:01.341Z
+ card-last-score:: 5
+ - Since any physical device can fail, we make systems **dependable** by including ^^redundant components^^ that can take over when a failure occurs *and* help detect failures.
+ -
+- ## Hardware Organisation
+ - What does basic computer organisation look like? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:27:44.250Z
+ card-last-reviewed:: 2022-09-19T18:27:44.250Z
+ card-last-score:: 5
+ - 
+ - What is an **integrated circuit**? #card
+ collapsed:: true
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-30T12:47:21.597Z
+ card-last-reviewed:: 2022-09-19T17:47:21.597Z
+ card-last-score:: 5
+ - An **integrated circuit**, also called a **chip**, is a device combining dozens to millions of transistors.
+ - ### The CPU
+ collapsed:: true
+ - What is a **CPU**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:22:22.644Z
+ card-last-reviewed:: 2022-09-18T15:22:22.644Z
+ card-last-score:: 5
+ - The **Central Processing Unit (CPU)**, also called the **processor**, is the ^^active part of the computer^^, which contains the datapath & control, and which adds numbers, tests numbers, signals I/O devices to activate, and so on.
+ - The CPU is ^^responsible for executing programs.^^
+ - What are the steps that the CPU takes to process programs? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-22T14:58:32.353Z
+ card-last-reviewed:: 2022-09-18T14:58:32.353Z
+ card-last-score:: 3
+ - **1. Fetch:** Retrieve an instruction from ^^program memory.^^
+ - **2. Decode:** Break down the instruction into parts that have significance to specific sections of the CPU.
+ - **3. Execute:** Various portions of the CPU are connected to perform the desired operation.
+ - **4. Write Back:** Simply "writes back" the results of the execute step ^^if necessary.^^
+ - ### CPU Organisation
+ - What does the **organisation** of the CPU look like? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-22T15:13:04.465Z
+ card-last-reviewed:: 2022-09-18T15:13:04.465Z
+ card-last-score:: 3
+ - Processors are made up of:
+ - A **Control Unit**
+ - **Execution Unit(s)**
+ - A **Register File**
+ - {:height 339, :width 418}
+ -
+ - #### Control Unit
+ - What does the **Control Unit** do? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:27:08.868Z
+ card-last-reviewed:: 2022-09-19T18:27:08.869Z
+ card-last-score:: 5
+ - The **Control Unit** ^^controls the execution^^ of the instructions stored in main memory.
+ - It ^^retrieves & executes^^ them.
+ - What is the architecture of the control unit? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T20:02:39.216Z
+ card-last-reviewed:: 2022-09-14T20:02:39.217Z
+ card-last-score:: 3
+ - The control unit contains a **fetch unit**, a **decode unit**, and an **execute unit**.
+ - It also contains two special registers:
+ - **Program Counter (PC):** keeps the address of the next instruction
+ - **Instruction Register (IR):** keeps the instruction being executed
+ - {:height 266, :width 550}
+ -
+ - ### The Memory Subsystem
+ collapsed:: true
+ - How is the memory divided into storage locations? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:17:42.430Z
+ card-last-reviewed:: 2022-09-18T15:17:42.430Z
+ card-last-score:: 5
+ - Memory is divided into a set of storage location which can hold data.
+ - Locations are numbered.
+ - Addresses are used to tell the memory which location the processor wants to access.
+ - What are the two hierarchies of memory? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:29:01.554Z
+ card-last-score:: 1
+ - **1. Nonvolatile / ROM (Read Only Memory):** Read only memory.
+ - Used to store the BIOS and / or a *bootstrap* or *bootloader* program.
+ - **2. Volatile / RAM (Random Access Memory):** Read / Write memory.
+ - Also called **Primary Memory**.
+ - Used to hold the programs, operating system, and data required by the computer.
+ - #### Primary Memory
+ - How is primary memory connected to the CPU? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:06:00.776Z
+ card-last-reviewed:: 2022-09-19T18:06:00.777Z
+ card-last-score:: 5
+ - **Primary Memory** is directly connected to the Central Processing Unit of the computer.
+ - It must be present for the CPU to function correctly.
+ - What are the three types of Primary Storage? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T15:10:32.299Z
+ card-last-score:: 1
+ - **1. Processors Register:**
+ - Contains information that the CPU needs to carry out the current instruction.
+ - **2. Cache Memory:**
+ - A special type of internal memory used by many CPUs to increase their **throughput**.
+ - **3. Main Memory:**
+ - Contains the programs that are currently being run and the data that the programs are operating on.
+ - What is the **address width**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:21:24.382Z
+ card-last-reviewed:: 2022-09-18T15:21:24.382Z
+ card-last-score:: 5
+ - The **address width** is the number of bits used to represent an address in memory.
+ - The **width** limits the amount of memory that a computer can access.
+ - Most computers use a **64 bit address**, which means that the maximum number of locations is $$ 2^{64} \approx 16 \text{ billion gigabytes}$$.
+ - What operations does the memory subsystem support? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:17:11.140Z
+ card-last-reviewed:: 2022-09-18T15:17:11.140Z
+ card-last-score:: 5
+ - The memory subsystem supports two operations:
+ - **Load** (or read) + the address of the data location to be read.
+ - **Store** (or write) + the address of the location & the data to be written.
+ - How many bytes may the memory system read or write at a time? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:16:57.109Z
+ card-last-reviewed:: 2022-09-18T15:16:57.110Z
+ card-last-score:: 3
+ - Read & Write operations ^^operate at the width of the system's data bus^^, usually 32 bit or 64 bit.
+ - How is a section of memory addressed? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:12:03.194Z
+ card-last-reviewed:: 2022-09-18T15:12:03.195Z
+ card-last-score:: 5
+ - The address ^^contains only the address of the lowest byte^^, and a number of bytes to be read is specified, e.g., 4 bytes.
+ - #### Memory Alignment & Words of Data
+ - When the computer's **word size** is 4 bytes, the data to be read should be at a memory address which is ^^some multiple of four.^^
+ - When this is not the case, e.g., the data starts at address 14 instead of 16, then the computer has to read two or more 4 byte chunks and do some calculation before the requested data has been read, or it may generate ^^an alignment fault.^^
+ - Even though the previous data structure end is at, for example, address 13, the next data structure should start at address 16. Two **padding bytes** are inserted between the two data structures at addresses 14 & 15 to align the next data structure at address 16.
+ - ### The I/O Subsystem
+ - What are **input devices**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:21:35.278Z
+ card-last-reviewed:: 2022-09-18T15:21:35.278Z
+ card-last-score:: 5
+ - Anything that feeds data into the computer.
+ - What are **output devices**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:16:34.930Z
+ card-last-reviewed:: 2022-09-18T15:16:34.931Z
+ card-last-score:: 5
+ - Display / transmit information back to the user.
+ - What does the **I/O Subsystem** contain? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:21:46.984Z
+ card-last-reviewed:: 2022-09-19T18:21:46.985Z
+ card-last-score:: 5
+ - The **I/O Subsystem** contains the devices that the computer uses to communicate with the outside world and to store data.
+ - How do I/O devices communicate with the processor? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:53:22.144Z
+ card-last-reviewed:: 2022-09-18T14:53:22.145Z
+ card-last-score:: 3
+ - I/O devices usually communicate with the processor using the **I/O Bus**.
+ - PCs use the **PCI Express (Peripheral Component Interconnect Express)** bus for their I/O bus.
+ - The Operating System needs a **device driver** to access a given I/O device.
+ - What is a **device driver**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:11:51.628Z
+ card-last-reviewed:: 2022-09-18T15:11:51.628Z
+ card-last-score:: 5
+ - A **device driver** is a program that allows the OS to control an I/O device.
+ - #### I/O Read / Write Operations
+ - The I/O read & write operations are similar to the memory read & write operations.
+ - How does the processor address I/O devices? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-28T14:48:48.247Z
+ card-last-reviewed:: 2022-09-19T17:48:48.248Z
+ card-last-score:: 3
+ - A processor may use:
+ - **Memory-Mapped I/O:** when the address of the I/O device is in the **direct memory space**, and the ^^sequences to read/write data in the device are the same as the memory read/write sequences.^^
+ - **Isolated I/O:** similar process to Memory-Mapped I/O, but the processor has a ^^second set of control signals to distinguish between a **memory access** and am **I/O access**.^^
+ - What is **IO/M**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T15:11:25.751Z
+ card-last-score:: 1
+ - **IO/M** is a **status signal** in **Isolated I/O** that denotes whether the read/write operation pertains to the memory or to the I/O subsystem.
+ - When the **signal is low** (IO/M = 0), i.e., IO/M is `true`, it denotes **memory-related operations**.
+ - When the **signal is high**, (IO/M = 1), i.e., IO/M is `false`, it denotes an **I/O operation**.
+ -
+ -
+ -
+- ## Programs
+ - What are programs? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:13:13.990Z
+ card-last-reviewed:: 2022-09-18T15:13:13.990Z
+ card-last-score:: 5
+ - Programs are ^^sequences of instructions^^ that tell the computer what to do.
+ - To the computer, a program is made out of a ^^sequence of numbers that represent individual operations.^^
+ - These operations are known as **machine instructions** or just **instructions**.
+ - A set of instructions that a processor can execute is known as an **instruction set**.
+ - ### Program Development Tools
+ collapsed:: true
+ - What is a **high-level programming language**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:08:53.500Z
+ card-last-reviewed:: 2022-09-18T15:08:53.500Z
+ card-last-score:: 5
+ - A **high-level programming language** is a ^^portable language^^ such as C that is ^^composed of words & algebraic notation^^ that can be translated by a compiler into **assembly language**.
+ - What is a **compiler**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:43:48.914Z
+ card-last-reviewed:: 2022-09-19T17:43:48.914Z
+ card-last-score:: 5
+ - A **compiler** is a program that translates statements in a given high-level language into assembly language statements.
+ - What is an **assembler**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:10:09.892Z
+ card-last-reviewed:: 2022-09-18T15:10:09.892Z
+ card-last-score:: 5
+ - An **assembler** is a program that translates symbolic, assembly language versions of instructions into the ^^binary version.^^
+ - What is **Assembly Language**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-09-30T21:48:54.576Z
+ card-last-reviewed:: 2022-09-19T17:48:54.576Z
+ card-last-score:: 5
+ - **Assembly Language** is a ^^symbolic representation^^ of **machine instructions**.
+ - What is **Machine Language**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:22:03.638Z
+ card-last-score:: 1
+ - **Machine Language** is a ^^binary representation^^ of **machine instructions**.
+ - What is an **instruction**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:19:26.835Z
+ card-last-reviewed:: 2022-09-18T15:19:26.836Z
+ card-last-score:: 5
+ - An **instruction** is a command that the computer hardware understands & obeys.
+ -
+- ## Operating Systems
+ - What is an **Operating System**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:25:01.958Z
+ card-last-reviewed:: 2022-09-19T18:25:01.958Z
+ card-last-score:: 5
+ - Possible definition: a program that runs on the computer that ^^knows about all the hardware^^ and usually ^^runs in privileged mode^^, having ^^access to physical resources that user programs can't control^^, and has the ^^ability to start & stop user programs.^^
+ - The OS is responsible for managing the physical resources of complex systems, such as PCs, workstations, mainframe computers, etc.
+ - It is also responsible for ^^loading & executing programs^^ and ^^interfacing with the users.^^
+ - Usually, there is no operating system for **small embedded systems**.
+ - Computers designed for one specific task.
+ -
+ - ### Multiprogramming
+ - What is **Multiprogramming**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:23:28.557Z
+ card-last-reviewed:: 2022-09-19T18:23:28.557Z
+ card-last-score:: 5
+ - **Multiprogramming** is a technique that allows the system to ^^present the illusion that multiple programs are running on the computer simultaneously.^^
+ - Many multiprogrammed computers are **multiuser**.
+ - They allow multiple users to be logged in at a time.
+ - How is multiprogramming achieved? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:19:07.150Z
+ card-last-reviewed:: 2022-09-18T15:19:07.151Z
+ card-last-score:: 5
+ - Multiprogramming is achieved by ^^switching rapidly between programs.^^
+ - How does the processor decide which process to execute next? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:20:14.106Z
+ card-last-reviewed:: 2022-09-18T15:20:14.106Z
+ card-last-score:: 5
+ - **FCFS - First Come, First Served:** processes are moved to the CPU in the order in which they arrive.
+ - **SJN - Shortest Job Next:** looks at all processes in the **ready state** and dispatches the one with the smallest service time.
+ - **Round Robin:** distributes the processing time equitably among all ready processes.
+ - ### Context Switching
+ - What is a **Context Switch**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:10:00.458Z
+ card-last-reviewed:: 2022-09-18T15:10:00.458Z
+ card-last-score:: 5
+ - When a program timeslice ends, the OS stops it, removes it, and gives another program control over the processor.
+ - This is a **context switch**.
+ - How does the OS go about a Context Switch? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-22T15:19:47.984Z
+ card-last-reviewed:: 2022-09-18T15:19:47.984Z
+ card-last-score:: 3
+ - copies the current program register file into memory
+ - restores the contents of the next program's register file into the processor
+ - starts executing the next program
+ - From the program point of view, ^^no program can tell that a context switch has been performed.^^
+ - ### Protection
+ - Three rules of Protection in multiprogrammed computers: #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-28T14:45:26.235Z
+ card-last-reviewed:: 2022-09-19T17:45:26.235Z
+ card-last-score:: 3
+ - 1. The result of any program running on the multiprogram computer ^^must be the same as if the program was the only program running on the computer.^^
+ - 2. Programs ^^must not be able to access other programs' data^^ and must be confident that their data will not be modified by other programs (for security and privacy).
+ - 3. Programs ^^must not interfere with other programs' use of I/O devices.^^
+ - How is protection achieved? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:26:58.100Z
+ card-last-score:: 1
+ - Protection is achieved by the ^^operating system having full control over the resources of the system (processor, memory, and I/O devices)^^ through:
+ - **Privileged Mode:** the operating system is the only one that can control the physical resources it executes in privileged mode.
+ - User programs execute in **user mode**.
+ - **Virtual Memory:** each program operates as if it were the only program on the computer, occupying a full set of the address space in its virtual space.
+ - The OS is *translating* memory addresses that the program references into physical addresses used by the memory system.
+ -
+-
+- **Next Topic:** [[Programming Models]]
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-09-30T10_01_42.357Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-09-30T10_01_42.357Z.Desktop.md
new file mode 100644
index 00000000..31639835
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-09-30T10_01_42.357Z.Desktop.md
@@ -0,0 +1,541 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- No previous topic.
+- **Relevant Slides:** 
+-
+- ## Traditional Classes of Computer Systems
+ - What is a **Personal Computer (PC)**?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-09-23T18:28:00.836Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.7
+ card-last-reviewed:: 2022-09-19T18:28:00.836Z
+ - A **Personal Computer** is a computer designed for use by an individual, usually incorporating a graphics display, a keyboard, and a mouse.
+ - What is a **Server**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:51:19.171Z
+ card-last-reviewed:: 2022-09-18T14:51:19.172Z
+ card-last-score:: 3
+ - A **server** is a computer used for running larger programs for multiple users, often simultaneously, and typically accessed only via a network.
+ - What is a **Supercomputer**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:20:18.972Z
+ card-last-reviewed:: 2022-09-18T15:20:18.973Z
+ card-last-score:: 5
+ - A **supercomputer** is a member of a class of computers with the highest performance (and cost). They are configured as servers and typically cost tens to hundreds of millions of dollars.
+ - What is an **Embedded Computer**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:17:21.268Z
+ card-last-reviewed:: 2022-09-18T15:17:21.269Z
+ card-last-score:: 5
+ - An **embedded computer** is a computer inside another device, used for running one predetermined application or collection of software.
+ - What are **Personal Mobile Devices**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:17:24.814Z
+ card-last-reviewed:: 2022-09-18T15:17:24.814Z
+ card-last-score:: 5
+ - **Personal Mobile Devices** are small, wireless devices that connect to the internet.
+ - They rely on batteries for power, and software is installed by downloading apps.
+ - Conventional examples include smartphones and tablets.
+ - What is **Cloud Computing**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:16:02.669Z
+ card-last-reviewed:: 2022-09-18T15:16:02.669Z
+ card-last-score:: 5
+ - **Cloud Computing** refers to large collections of servers that provide services over the internet.
+ - Some providers rent dynamically varying number of servers as a utility.
+ - What is **Software as a Service**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T17:42:30.362Z
+ card-last-reviewed:: 2022-09-19T17:42:30.363Z
+ card-last-score:: 5
+ - **Software as a Service** delivers software & data as a service over the internet, usually via a thing program, such as a browser.
+ - Examples include web search & email.
+ -
+- ## Computer Systems
+ collapsed:: true
+ - {:height 410, :width 414}
+ - What is **Application Software**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:17:30.513Z
+ card-last-reviewed:: 2022-09-18T15:17:30.513Z
+ card-last-score:: 5
+ - **Application Software** consists of user-installed applications & programs.
+ - Application Software provides services to the user that are commonly useful.
+ - What is the purpose of the **Operating System**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:16:09.752Z
+ card-last-reviewed:: 2022-09-18T15:16:09.753Z
+ card-last-score:: 5
+ - The **Operating System** interfaces between a user's program and the hardware, provides a variety of services, and performs supervisory functions.
+ - What is the purpose of the **Hardware**?
+ - The **Hardware** performs the tasks.
+ -
+- ## Seven Great Ideas in Computer Organisation
+ - ### 1. Use **Abstraction** to Simplify Design #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:25:18.076Z
+ card-last-reviewed:: 2022-09-19T18:25:18.076Z
+ card-last-score:: 5
+ - A major productivity technique for hardware & software is to use **abstractions** to characterise the design at different levels of representation
+ - Lower-level details are hidden to offer a simpler model at higher levels.
+ - ### 2. Make the **Common Case** Fast #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:16:44.377Z
+ card-last-reviewed:: 2022-09-18T15:16:44.378Z
+ card-last-score:: 5
+ - Making the **common case fast** will tend to enhance performance better than optimising the rare case.
+ - The common case is often simpler than the rare case, and hence is usually easier to enhance.
+ - ### 3. Performance via **Parallelism** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:03:58.567Z
+ card-last-reviewed:: 2022-09-18T15:03:58.567Z
+ card-last-score:: 5
+ - Involves speeding up performance by using designs that compute operations in **parallel**.
+ - ### 4. Performance via **Pipelining** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-21T20:52:29.657Z
+ card-last-reviewed:: 2022-09-17T20:52:29.657Z
+ card-last-score:: 5
+ - **Performance via Pipelining** is a particular pattern of **parallelism** that is so prevalent in computer architecture that it merits its own name.
+ - ### 5. Performance via **Prediction** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:23:23.782Z
+ card-last-reviewed:: 2022-09-19T18:23:23.782Z
+ card-last-score:: 5
+ - In some cases, it can be ^^faster on average to guess and start working^^ that to wait until you know for sure (assuming that the mechanism to recover from a misprediction is not too expensive, and your prediction is relatively accurate).
+ - ### 6. Hierarchy of Memories #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:18:36.340Z
+ card-last-reviewed:: 2022-09-18T15:18:36.341Z
+ card-last-score:: 5
+ - Computer Architects have found that they can address conflicting demands with a **hierarchy of memories**.
+ - The ^^fastest, smallest, & most expensive memory per bit^^ is at the top of the hierarchy.
+ - The ^^slowest, largest, & cheapest per bit^^ is at the bottom of the hierarchy.
+ - ### 7. Dependability via **Redundancy** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:19:01.340Z
+ card-last-reviewed:: 2022-09-18T15:19:01.341Z
+ card-last-score:: 5
+ - Since any physical device can fail, we make systems **dependable** by including ^^redundant components^^ that can take over when a failure occurs *and* help detect failures.
+ -
+- ## Hardware Organisation
+ - What does basic computer organisation look like? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:27:44.250Z
+ card-last-reviewed:: 2022-09-19T18:27:44.250Z
+ card-last-score:: 5
+ - 
+ - What is an **integrated circuit**? #card
+ collapsed:: true
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-30T12:47:21.597Z
+ card-last-reviewed:: 2022-09-19T17:47:21.597Z
+ card-last-score:: 5
+ - An **integrated circuit**, also called a **chip**, is a device combining dozens to millions of transistors.
+ - ### The CPU
+ collapsed:: true
+ - What is a **CPU**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:22:22.644Z
+ card-last-reviewed:: 2022-09-18T15:22:22.644Z
+ card-last-score:: 5
+ - The **Central Processing Unit (CPU)**, also called the **processor**, is the ^^active part of the computer^^, which contains the datapath & control, and which adds numbers, tests numbers, signals I/O devices to activate, and so on.
+ - The CPU is ^^responsible for executing programs.^^
+ - What are the steps that the CPU takes to process programs? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-22T14:58:32.353Z
+ card-last-reviewed:: 2022-09-18T14:58:32.353Z
+ card-last-score:: 3
+ - **1. Fetch:** Retrieve an instruction from ^^program memory.^^
+ - **2. Decode:** Break down the instruction into parts that have significance to specific sections of the CPU.
+ - **3. Execute:** Various portions of the CPU are connected to perform the desired operation.
+ - **4. Write Back:** Simply "writes back" the results of the execute step ^^if necessary.^^
+ - ### CPU Organisation
+ - What does the **organisation** of the CPU look like? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-22T15:13:04.465Z
+ card-last-reviewed:: 2022-09-18T15:13:04.465Z
+ card-last-score:: 3
+ - Processors are made up of:
+ - A **Control Unit**
+ - **Execution Unit(s)**
+ - A **Register File**
+ - {:height 339, :width 418}
+ -
+ - #### Control Unit
+ - What does the **Control Unit** do? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:27:08.868Z
+ card-last-reviewed:: 2022-09-19T18:27:08.869Z
+ card-last-score:: 5
+ - The **Control Unit** ^^controls the execution^^ of the instructions stored in main memory.
+ - It ^^retrieves & executes^^ them.
+ - What is the architecture of the control unit? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T20:02:39.216Z
+ card-last-reviewed:: 2022-09-14T20:02:39.217Z
+ card-last-score:: 3
+ - The control unit contains a **fetch unit**, a **decode unit**, and an **execute unit**.
+ - It also contains two special registers:
+ - **Program Counter (PC):** keeps the address of the next instruction
+ - **Instruction Register (IR):** keeps the instruction being executed
+ - {:height 266, :width 550}
+ -
+ - ### The Memory Subsystem
+ collapsed:: true
+ - How is the memory divided into storage locations? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:17:42.430Z
+ card-last-reviewed:: 2022-09-18T15:17:42.430Z
+ card-last-score:: 5
+ - Memory is divided into a set of storage location which can hold data.
+ - Locations are numbered.
+ - Addresses are used to tell the memory which location the processor wants to access.
+ - What are the two hierarchies of memory? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:29:01.554Z
+ card-last-score:: 1
+ - **1. Nonvolatile / ROM (Read Only Memory):** Read only memory.
+ - Used to store the BIOS and / or a *bootstrap* or *bootloader* program.
+ - **2. Volatile / RAM (Random Access Memory):** Read / Write memory.
+ - Also called **Primary Memory**.
+ - Used to hold the programs, operating system, and data required by the computer.
+ - #### Primary Memory
+ - How is primary memory connected to the CPU? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:06:00.776Z
+ card-last-reviewed:: 2022-09-19T18:06:00.777Z
+ card-last-score:: 5
+ - **Primary Memory** is directly connected to the Central Processing Unit of the computer.
+ - It must be present for the CPU to function correctly.
+ - What are the three types of Primary Storage? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T15:10:32.299Z
+ card-last-score:: 1
+ - **1. Processors Register:**
+ - Contains information that the CPU needs to carry out the current instruction.
+ - **2. Cache Memory:**
+ - A special type of internal memory used by many CPUs to increase their **throughput**.
+ - **3. Main Memory:**
+ - Contains the programs that are currently being run and the data that the programs are operating on.
+ - What is the **address width**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:21:24.382Z
+ card-last-reviewed:: 2022-09-18T15:21:24.382Z
+ card-last-score:: 5
+ - The **address width** is the number of bits used to represent an address in memory.
+ - The **width** limits the amount of memory that a computer can access.
+ - Most computers use a **64 bit address**, which means that the maximum number of locations is $$ 2^{64} \approx 16 \text{ billion gigabytes}$$.
+ - What operations does the memory subsystem support? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:17:11.140Z
+ card-last-reviewed:: 2022-09-18T15:17:11.140Z
+ card-last-score:: 5
+ - The memory subsystem supports two operations:
+ - **Load** (or read) + the address of the data location to be read.
+ - **Store** (or write) + the address of the location & the data to be written.
+ - How many bytes may the memory system read or write at a time? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:16:57.109Z
+ card-last-reviewed:: 2022-09-18T15:16:57.110Z
+ card-last-score:: 3
+ - Read & Write operations ^^operate at the width of the system's data bus^^, usually 32 bit or 64 bit.
+ - How is a section of memory addressed? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:12:03.194Z
+ card-last-reviewed:: 2022-09-18T15:12:03.195Z
+ card-last-score:: 5
+ - The address ^^contains only the address of the lowest byte^^, and a number of bytes to be read is specified, e.g., 4 bytes.
+ - #### Memory Alignment & Words of Data
+ - When the computer's **word size** is 4 bytes, the data to be read should be at a memory address which is ^^some multiple of four.^^
+ - When this is not the case, e.g., the data starts at address 14 instead of 16, then the computer has to read two or more 4 byte chunks and do some calculation before the requested data has been read, or it may generate ^^an alignment fault.^^
+ - Even though the previous data structure end is at, for example, address 13, the next data structure should start at address 16. Two **padding bytes** are inserted between the two data structures at addresses 14 & 15 to align the next data structure at address 16.
+ - ### The I/O Subsystem
+ - What are **input devices**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:21:35.278Z
+ card-last-reviewed:: 2022-09-18T15:21:35.278Z
+ card-last-score:: 5
+ - Anything that feeds data into the computer.
+ - What are **output devices**? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:16:34.930Z
+ card-last-reviewed:: 2022-09-18T15:16:34.931Z
+ card-last-score:: 5
+ - Display / transmit information back to the user.
+ - What does the **I/O Subsystem** contain? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:21:46.984Z
+ card-last-reviewed:: 2022-09-19T18:21:46.985Z
+ card-last-score:: 5
+ - The **I/O Subsystem** contains the devices that the computer uses to communicate with the outside world and to store data.
+ - How do I/O devices communicate with the processor? #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:53:22.144Z
+ card-last-reviewed:: 2022-09-18T14:53:22.145Z
+ card-last-score:: 3
+ - I/O devices usually communicate with the processor using the **I/O Bus**.
+ - PCs use the **PCI Express (Peripheral Component Interconnect Express)** bus for their I/O bus.
+ - The Operating System needs a **device driver** to access a given I/O device.
+ - What is a **device driver**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:11:51.628Z
+ card-last-reviewed:: 2022-09-18T15:11:51.628Z
+ card-last-score:: 5
+ - A **device driver** is a program that allows the OS to control an I/O device.
+ - #### I/O Read / Write Operations
+ - The I/O read & write operations are similar to the memory read & write operations.
+ - How does the processor address I/O devices? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-28T14:48:48.247Z
+ card-last-reviewed:: 2022-09-19T17:48:48.248Z
+ card-last-score:: 3
+ - A processor may use:
+ - **Memory-Mapped I/O:** when the address of the I/O device is in the **direct memory space**, and the ^^sequences to read/write data in the device are the same as the memory read/write sequences.^^
+ - **Isolated I/O:** similar process to Memory-Mapped I/O, but the processor has a ^^second set of control signals to distinguish between a **memory access** and am **I/O access**.^^
+ - What is **IO/M**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T15:11:25.751Z
+ card-last-score:: 1
+ - **IO/M** is a **status signal** in **Isolated I/O** that denotes whether the read/write operation pertains to the memory or to the I/O subsystem.
+ - When the **signal is low** (IO/M = 0), i.e., IO/M is `true`, it denotes **memory-related operations**.
+ - When the **signal is high**, (IO/M = 1), i.e., IO/M is `false`, it denotes an **I/O operation**.
+ -
+ -
+ -
+- ## Programs
+ - What are programs? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:13:13.990Z
+ card-last-reviewed:: 2022-09-18T15:13:13.990Z
+ card-last-score:: 5
+ - Programs are ^^sequences of instructions^^ that tell the computer what to do.
+ - To the computer, a program is made out of a ^^sequence of numbers that represent individual operations.^^
+ - These operations are known as **machine instructions** or just **instructions**.
+ - A set of instructions that a processor can execute is known as an **instruction set**.
+ - ### Program Development Tools
+ collapsed:: true
+ - What is a **high-level programming language**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:08:53.500Z
+ card-last-reviewed:: 2022-09-18T15:08:53.500Z
+ card-last-score:: 5
+ - A **high-level programming language** is a ^^portable language^^ such as C that is ^^composed of words & algebraic notation^^ that can be translated by a compiler into **assembly language**.
+ - What is a **compiler**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:43:48.914Z
+ card-last-reviewed:: 2022-09-19T17:43:48.914Z
+ card-last-score:: 5
+ - A **compiler** is a program that translates statements in a given high-level language into assembly language statements.
+ - What is an **assembler**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:10:09.892Z
+ card-last-reviewed:: 2022-09-18T15:10:09.892Z
+ card-last-score:: 5
+ - An **assembler** is a program that translates symbolic, assembly language versions of instructions into the ^^binary version.^^
+ - What is **Assembly Language**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-09-30T21:48:54.576Z
+ card-last-reviewed:: 2022-09-19T17:48:54.576Z
+ card-last-score:: 5
+ - **Assembly Language** is a ^^symbolic representation^^ of **machine instructions**.
+ - What is **Machine Language**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:22:03.638Z
+ card-last-score:: 1
+ - **Machine Language** is a ^^binary representation^^ of **machine instructions**.
+ - What is an **instruction**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:19:26.835Z
+ card-last-reviewed:: 2022-09-18T15:19:26.836Z
+ card-last-score:: 5
+ - An **instruction** is a command that the computer hardware understands & obeys.
+ -
+- ## Operating Systems
+ - What is an **Operating System**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:25:01.958Z
+ card-last-reviewed:: 2022-09-19T18:25:01.958Z
+ card-last-score:: 5
+ - Possible definition: a program that runs on the computer that ^^knows about all the hardware^^ and usually ^^runs in privileged mode^^, having ^^access to physical resources that user programs can't control^^, and has the ^^ability to start & stop user programs.^^
+ - The OS is responsible for managing the physical resources of complex systems, such as PCs, workstations, mainframe computers, etc.
+ - It is also responsible for ^^loading & executing programs^^ and ^^interfacing with the users.^^
+ - Usually, there is no operating system for **small embedded systems**.
+ - Computers designed for one specific task.
+ -
+ - ### Multiprogramming
+ - What is **Multiprogramming**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:23:28.557Z
+ card-last-reviewed:: 2022-09-19T18:23:28.557Z
+ card-last-score:: 5
+ - **Multiprogramming** is a technique that allows the system to ^^present the illusion that multiple programs are running on the computer simultaneously.^^
+ - Many multiprogrammed computers are **multiuser**.
+ - They allow multiple users to be logged in at a time.
+ - How is multiprogramming achieved? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:19:07.150Z
+ card-last-reviewed:: 2022-09-18T15:19:07.151Z
+ card-last-score:: 5
+ - Multiprogramming is achieved by ^^switching rapidly between programs.^^
+ - How does the processor decide which process to execute next? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:20:14.106Z
+ card-last-reviewed:: 2022-09-18T15:20:14.106Z
+ card-last-score:: 5
+ - **FCFS - First Come, First Served:** processes are moved to the CPU in the order in which they arrive.
+ - **SJN - Shortest Job Next:** looks at all processes in the **ready state** and dispatches the one with the smallest service time.
+ - **Round Robin:** distributes the processing time equitably among all ready processes.
+ - ### Context Switching
+ - What is a **Context Switch**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-22T15:10:00.458Z
+ card-last-reviewed:: 2022-09-18T15:10:00.458Z
+ card-last-score:: 5
+ - When a program timeslice ends, the OS stops it, removes it, and gives another program control over the processor.
+ - This is a **context switch**.
+ - How does the OS go about a Context Switch? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-22T15:19:47.984Z
+ card-last-reviewed:: 2022-09-18T15:19:47.984Z
+ card-last-score:: 3
+ - copies the current program register file into memory
+ - restores the contents of the next program's register file into the processor
+ - starts executing the next program
+ - From the program point of view, ^^no program can tell that a context switch has been performed.^^
+ - ### Protection
+ - Three rules of Protection in multiprogrammed computers: #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-28T14:45:26.235Z
+ card-last-reviewed:: 2022-09-19T17:45:26.235Z
+ card-last-score:: 3
+ - 1. The result of any program running on the multiprogram computer ^^must be the same as if the program was the only program running on the computer.^^
+ - 2. Programs ^^must not be able to access other programs' data^^ and must be confident that their data will not be modified by other programs (for security and privacy).
+ - 3. Programs ^^must not interfere with other programs' use of I/O devices.^^
+ - How is protection achieved? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:26:58.100Z
+ card-last-score:: 1
+ - Protection is achieved by the ^^operating system having full control over the resources of the system (processor, memory, and I/O devices)^^ through:
+ - **Privileged Mode:** the operating system is the only one that can control the physical resources it executes in privileged mode.
+ - User programs execute in **user mode**.
+ - **Virtual Memory:** each program operates as if it were the only program on the computer, occupying a full set of the address space in its virtual space.
+ - The OS is *translating* memory addresses that the program references into physical addresses used by the memory system.
+ -
+-
+- **Next Topic:** [[Programming Models]]
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-10-07T08_33_33.353Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-10-07T08_33_33.353Z.Desktop.md
new file mode 100644
index 00000000..b6eeecf1
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-10-07T08_33_33.353Z.Desktop.md
@@ -0,0 +1,541 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- No previous topic.
+- **Relevant Slides:** 
+-
+- ## Traditional Classes of Computer Systems
+ - What is a **Personal Computer (PC)**?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-09-23T18:28:00.836Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.7
+ card-last-reviewed:: 2022-09-19T18:28:00.836Z
+ - A **Personal Computer** is a computer designed for use by an individual, usually incorporating a graphics display, a keyboard, and a mouse.
+ - What is a **Server**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T05:29:45.315Z
+ card-last-reviewed:: 2022-09-30T08:29:45.315Z
+ card-last-score:: 3
+ - A **server** is a computer used for running larger programs for multiple users, often simultaneously, and typically accessed only via a network.
+ - What is a **Supercomputer**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:52.646Z
+ card-last-reviewed:: 2022-10-03T11:37:52.647Z
+ card-last-score:: 5
+ - A **supercomputer** is a member of a class of computers with the highest performance (and cost). They are configured as servers and typically cost tens to hundreds of millions of dollars.
+ - What is an **Embedded Computer**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:37.659Z
+ card-last-reviewed:: 2022-10-01T17:30:37.659Z
+ card-last-score:: 5
+ - An **embedded computer** is a computer inside another device, used for running one predetermined application or collection of software.
+ - What are **Personal Mobile Devices**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:31:08.211Z
+ card-last-reviewed:: 2022-10-01T17:31:08.211Z
+ card-last-score:: 5
+ - **Personal Mobile Devices** are small, wireless devices that connect to the internet.
+ - They rely on batteries for power, and software is installed by downloading apps.
+ - Conventional examples include smartphones and tablets.
+ - What is **Cloud Computing**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:28:27.277Z
+ card-last-reviewed:: 2022-10-01T17:28:27.278Z
+ card-last-score:: 5
+ - **Cloud Computing** refers to large collections of servers that provide services over the internet.
+ - Some providers rent dynamically varying number of servers as a utility.
+ - What is **Software as a Service**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:42:21.001Z
+ card-last-reviewed:: 2022-10-03T11:42:21.001Z
+ card-last-score:: 5
+ - **Software as a Service** delivers software & data as a service over the internet, usually via a thing program, such as a browser.
+ - Examples include web search & email.
+ -
+- ## Computer Systems
+ collapsed:: true
+ - {:height 410, :width 414}
+ - What is **Application Software**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:31:12.546Z
+ card-last-reviewed:: 2022-10-01T17:31:12.546Z
+ card-last-score:: 5
+ - **Application Software** consists of user-installed applications & programs.
+ - Application Software provides services to the user that are commonly useful.
+ - What is the purpose of the **Operating System**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:11:34.929Z
+ card-last-reviewed:: 2022-09-30T12:11:34.929Z
+ card-last-score:: 3
+ - The **Operating System** interfaces between a user's program and the hardware, provides a variety of services, and performs supervisory functions.
+ - What is the purpose of the **Hardware**?
+ - The **Hardware** performs the tasks.
+ -
+- ## Seven Great Ideas in Computer Organisation
+ - ### 1. Use **Abstraction** to Simplify Design #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:36.002Z
+ card-last-reviewed:: 2022-10-03T14:28:36.003Z
+ card-last-score:: 5
+ - A major productivity technique for hardware & software is to use **abstractions** to characterise the design at different levels of representation
+ - Lower-level details are hidden to offer a simpler model at higher levels.
+ - ### 2. Make the **Common Case** Fast #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:29:14.556Z
+ card-last-reviewed:: 2022-10-01T17:29:14.557Z
+ card-last-score:: 5
+ - Making the **common case fast** will tend to enhance performance better than optimising the rare case.
+ - The common case is often simpler than the rare case, and hence is usually easier to enhance.
+ - ### 3. Performance via **Parallelism** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:16:13.241Z
+ card-last-reviewed:: 2022-09-30T12:16:13.242Z
+ card-last-score:: 3
+ - Involves speeding up performance by using designs that compute operations in **parallel**.
+ - ### 4. Performance via **Pipelining** #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T04:28:23.981Z
+ card-last-reviewed:: 2022-09-30T09:28:23.982Z
+ card-last-score:: 5
+ - **Performance via Pipelining** is a particular pattern of **parallelism** that is so prevalent in computer architecture that it merits its own name.
+ - ### 5. Performance via **Prediction** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:27:10.532Z
+ card-last-reviewed:: 2022-10-03T14:27:10.533Z
+ card-last-score:: 5
+ - In some cases, it can be ^^faster on average to guess and start working^^ that to wait until you know for sure (assuming that the mechanism to recover from a misprediction is not too expensive, and your prediction is relatively accurate).
+ - ### 6. Hierarchy of Memories #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:35:13.824Z
+ card-last-reviewed:: 2022-10-01T17:35:13.824Z
+ card-last-score:: 3
+ - Computer Architects have found that they can address conflicting demands with a **hierarchy of memories**.
+ - The ^^fastest, smallest, & most expensive memory per bit^^ is at the top of the hierarchy.
+ - The ^^slowest, largest, & cheapest per bit^^ is at the bottom of the hierarchy.
+ - ### 7. Dependability via **Redundancy** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:35:28.794Z
+ card-last-reviewed:: 2022-10-01T17:35:28.794Z
+ card-last-score:: 5
+ - Since any physical device can fail, we make systems **dependable** by including ^^redundant components^^ that can take over when a failure occurs *and* help detect failures.
+ -
+- ## Hardware Organisation
+ - What does basic computer organisation look like? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:58.087Z
+ card-last-reviewed:: 2022-10-03T14:29:58.087Z
+ card-last-score:: 5
+ - 
+ - What is an **integrated circuit**?
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-04T20:17:29.178Z
+ card-last-reviewed:: 2022-10-04T12:17:29.178Z
+ card-last-score:: 5
+ collapsed:: true
+ - An **integrated circuit**, also called a **chip**, is a device combining dozens to millions of transistors.
+ - ### The CPU
+ collapsed:: true
+ - What is a **CPU**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:40:13.962Z
+ card-last-reviewed:: 2022-10-03T11:40:13.962Z
+ card-last-score:: 5
+ - The **Central Processing Unit (CPU)**, also called the **processor**, is the ^^active part of the computer^^, which contains the datapath & control, and which adds numbers, tests numbers, signals I/O devices to activate, and so on.
+ - The CPU is ^^responsible for executing programs.^^
+ - What are the steps that the CPU takes to process programs? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:15:57.207Z
+ card-last-reviewed:: 2022-09-30T12:15:57.208Z
+ card-last-score:: 5
+ - **1. Fetch:** Retrieve an instruction from ^^program memory.^^
+ - **2. Decode:** Break down the instruction into parts that have significance to specific sections of the CPU.
+ - **3. Execute:** Various portions of the CPU are connected to perform the desired operation.
+ - **4. Write Back:** Simply "writes back" the results of the execute step ^^if necessary.^^
+ - ### CPU Organisation
+ - What does the **organisation** of the CPU look like? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-09T20:25:22.675Z
+ card-last-reviewed:: 2022-10-01T13:25:22.675Z
+ card-last-score:: 3
+ - Processors are made up of:
+ - A **Control Unit**
+ - **Execution Unit(s)**
+ - A **Register File**
+ - {:height 339, :width 418}
+ -
+ - #### Control Unit
+ - What does the **Control Unit** do? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:29:08.350Z
+ card-last-reviewed:: 2022-10-03T14:29:08.350Z
+ card-last-score:: 3
+ - The **Control Unit** ^^controls the execution^^ of the instructions stored in main memory.
+ - It ^^retrieves & executes^^ them.
+ - What is the architecture of the control unit? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T05:29:05.114Z
+ card-last-reviewed:: 2022-09-30T08:29:05.115Z
+ card-last-score:: 3
+ - The control unit contains a **fetch unit**, a **decode unit**, and an **execute unit**.
+ - It also contains two special registers:
+ - **Program Counter (PC):** keeps the address of the next instruction
+ - **Instruction Register (IR):** keeps the instruction being executed
+ - {:height 266, :width 550}
+ -
+ - ### The Memory Subsystem
+ collapsed:: true
+ - How is the memory divided into storage locations? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:34:12.415Z
+ card-last-reviewed:: 2022-10-01T17:34:12.416Z
+ card-last-score:: 5
+ - Memory is divided into a set of storage location which can hold data.
+ - Locations are numbered.
+ - Addresses are used to tell the memory which location the processor wants to access.
+ - What are the two hierarchies of memory? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T09:22:16.754Z
+ card-last-score:: 1
+ - **1. Nonvolatile / ROM (Read Only Memory):** Read only memory.
+ - Used to store the BIOS and / or a *bootstrap* or *bootloader* program.
+ - **2. Volatile / RAM (Random Access Memory):** Read / Write memory.
+ - Also called **Primary Memory**.
+ - Used to hold the programs, operating system, and data required by the computer.
+ - #### Primary Memory
+ - How is primary memory connected to the CPU? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:34.991Z
+ card-last-reviewed:: 2022-10-03T11:43:34.992Z
+ card-last-score:: 5
+ - **Primary Memory** is directly connected to the Central Processing Unit of the computer.
+ - It must be present for the CPU to function correctly.
+ - What are the three types of Primary Storage? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-06T23:00:00.000Z
+ card-last-reviewed:: 2022-10-06T09:40:50.799Z
+ card-last-score:: 1
+ - **1. Processor Register:**
+ - Contains information that the CPU needs to carry out the current instruction.
+ - **2. Cache Memory:**
+ - A special type of internal memory used by many CPUs to increase their **throughput**.
+ - **3. Main Memory:**
+ - Contains the programs that are currently being run and the data that the programs are operating on.
+ - What is the **address width**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:30:08.146Z
+ card-last-reviewed:: 2022-09-30T08:30:08.147Z
+ card-last-score:: 3
+ - The **address width** is the number of bits used to represent an address in memory.
+ - The **width** limits the amount of memory that a computer can access.
+ - Most computers use a **64 bit address**, which means that the maximum number of locations is $$ 2^{64} \approx 16 \text{ billion gigabytes}$$.
+ - What operations does the memory subsystem support? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:33.402Z
+ card-last-reviewed:: 2022-10-01T17:30:33.403Z
+ card-last-score:: 5
+ - The memory subsystem supports two operations:
+ - **Load** (or read) + the address of the data location to be read.
+ - **Store** (or write) + the address of the location & the data to be written.
+ - How many bytes may the memory system read or write at a time? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:29:45.960Z
+ card-last-reviewed:: 2022-10-01T17:29:45.960Z
+ card-last-score:: 5
+ - Read & Write operations ^^operate at the width of the system's data bus^^, usually 32 bit or 64 bit.
+ - How is a section of memory addressed? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:24:14.775Z
+ card-last-reviewed:: 2022-10-01T13:24:14.776Z
+ card-last-score:: 5
+ - The address ^^contains only the address of the lowest byte^^, and a number of bytes to be read is specified, e.g., 4 bytes.
+ - #### Memory Alignment & Words of Data
+ - When the computer's **word size** is 4 bytes, the data to be read should be at a memory address which is ^^some multiple of four.^^
+ - When this is not the case, e.g., the data starts at address 14 instead of 16, then the computer has to read two or more 4 byte chunks and do some calculation before the requested data has been read, or it may generate ^^an alignment fault.^^
+ - Even though the previous data structure end is at, for example, address 13, the next data structure should start at address 16. Two **padding bytes** are inserted between the two data structures at addresses 14 & 15 to align the next data structure at address 16.
+ - ### The I/O Subsystem
+ - What are **input devices**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:40.506Z
+ card-last-reviewed:: 2022-09-30T12:11:40.507Z
+ card-last-score:: 5
+ - Anything that feeds data into the computer.
+ - What are **output devices**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:12:09.769Z
+ card-last-reviewed:: 2022-09-30T12:12:09.770Z
+ card-last-score:: 5
+ - Display / transmit information back to the user.
+ - What does the **I/O Subsystem** contain? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:38.831Z
+ card-last-reviewed:: 2022-09-30T12:11:38.832Z
+ card-last-score:: 5
+ - The **I/O Subsystem** contains the devices that the computer uses to communicate with the outside world and to store data.
+ - How do I/O devices communicate with the processor? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T12:14:49.335Z
+ card-last-score:: 1
+ - I/O devices usually communicate with the processor using the **I/O Bus**.
+ - PCs use the **PCI Express (Peripheral Component Interconnect Express)** bus for their I/O bus.
+ - The Operating System needs a **device driver** to access a given I/O device.
+ - What is a **device driver**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:23:41.787Z
+ card-last-reviewed:: 2022-10-01T13:23:41.788Z
+ card-last-score:: 5
+ - A **device driver** is a program that allows the OS to control an I/O device.
+ - #### I/O Read / Write Operations
+ - The I/O read & write operations are similar to the memory read & write operations.
+ - How does the processor address I/O devices? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T14:35:03.201Z
+ card-last-score:: 1
+ - A processor may use:
+ - **Memory-Mapped I/O:** when the address of the I/O device is in the **direct memory space**, and the ^^sequences to read/write data in the device are the same as the memory read/write sequences.^^
+ - **Isolated I/O:** similar process to Memory-Mapped I/O, but the processor has a ^^second set of control signals to distinguish between a **memory access** and am **I/O access**.^^
+ - What is **IO/M**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-04T09:11:16.531Z
+ card-last-reviewed:: 2022-09-30T09:11:16.532Z
+ card-last-score:: 3
+ - **IO/M** is a **status signal** in **Isolated I/O** that denotes whether the read/write operation pertains to the memory or to the I/O subsystem.
+ - When the **signal is low** (IO/M = 0), i.e., IO/M is `true`, it denotes **memory-related operations**.
+ - When the **signal is high**, (IO/M = 1), i.e., IO/M is `false`, it denotes an **I/O operation**.
+ -
+ -
+ -
+- ## Programs
+ - What are programs? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:29:21.265Z
+ card-last-reviewed:: 2022-10-01T13:29:21.266Z
+ card-last-score:: 5
+ - Programs are ^^sequences of instructions^^ that tell the computer what to do.
+ - To the computer, a program is made out of a ^^sequence of numbers that represent individual operations.^^
+ - These operations are known as **machine instructions** or just **instructions**.
+ - A set of instructions that a processor can execute is known as an **instruction set**.
+ - ### Program Development Tools
+ collapsed:: true
+ - What is a **high-level programming language**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:17:29.873Z
+ card-last-reviewed:: 2022-10-01T13:17:29.874Z
+ card-last-score:: 5
+ - A **high-level programming language** is a ^^portable language^^ such as C that is ^^composed of words & algebraic notation^^ that can be translated by a compiler into **assembly language**.
+ - What is a **compiler**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:12:39.064Z
+ card-last-reviewed:: 2022-09-30T12:12:39.064Z
+ card-last-score:: 5
+ - A **compiler** is a program that translates statements in a given high-level language into assembly language statements.
+ - What is an **assembler**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:19:13.686Z
+ card-last-reviewed:: 2022-10-01T13:19:13.686Z
+ card-last-score:: 5
+ - An **assembler** is a program that translates symbolic, assembly language versions of instructions into the ^^binary version.^^
+ - What is **Assembly Language**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-11-07T03:25:47.210Z
+ card-last-reviewed:: 2022-10-04T12:25:47.210Z
+ card-last-score:: 5
+ - **Assembly Language** is a ^^symbolic representation^^ of **machine instructions**.
+ - What is **Machine Language**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-04T09:26:52.257Z
+ card-last-reviewed:: 2022-09-30T09:26:52.258Z
+ card-last-score:: 3
+ - **Machine Language** is a ^^binary representation^^ of **machine instructions**.
+ - What is an **instruction**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:20.118Z
+ card-last-reviewed:: 2022-10-03T11:37:20.118Z
+ card-last-score:: 5
+ - An **instruction** is a command that the computer hardware understands & obeys.
+ -
+- ## Operating Systems
+ - What is an **Operating System**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T14:28:14.754Z
+ card-last-score:: 1
+ - Possible definition: a program that runs on the computer that ^^knows about all the hardware^^ and usually ^^runs in privileged mode^^, having ^^access to physical resources that user programs can't control^^, and has the ^^ability to start & stop user programs.^^
+ - The OS is responsible for managing the physical resources of complex systems, such as PCs, workstations, mainframe computers, etc.
+ - It is also responsible for ^^loading & executing programs^^ and ^^interfacing with the users.^^
+ - Usually, there is no operating system for **small embedded systems**.
+ - Computers designed for one specific task.
+ -
+ - ### Multiprogramming
+ - What is **Multiprogramming**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:10:38.026Z
+ card-last-reviewed:: 2022-09-30T12:10:38.027Z
+ card-last-score:: 3
+ - **Multiprogramming** is a technique that allows the system to ^^present the illusion that multiple programs are running on the computer simultaneously.^^
+ - Many multiprogrammed computers are **multiuser**.
+ - They allow multiple users to be logged in at a time.
+ - How is multiprogramming achieved? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:35:33.411Z
+ card-last-reviewed:: 2022-10-01T17:35:33.411Z
+ card-last-score:: 5
+ - Multiprogramming is achieved by ^^switching rapidly between programs.^^
+ - How does the processor decide which process to execute next? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:37:46.365Z
+ card-last-reviewed:: 2022-10-03T11:37:46.366Z
+ card-last-score:: 3
+ - **FCFS - First Come, First Served:** processes are moved to the CPU in the order in which they arrive.
+ - **SJN - Shortest Job Next:** looks at all processes in the **ready state** and dispatches the one with the smallest service time.
+ - **Round Robin:** distributes the processing time equitably among all ready processes.
+ - ### Context Switching
+ - What is a **Context Switch**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-10T19:19:02.676Z
+ card-last-reviewed:: 2022-10-01T13:19:02.677Z
+ card-last-score:: 3
+ - When a program timeslice ends, the OS stops it, removes it, and gives another program control over the processor.
+ - This is a **context switch**.
+ - How does the OS go about a Context Switch? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:37:36.618Z
+ card-last-reviewed:: 2022-10-03T11:37:36.618Z
+ card-last-score:: 3
+ - copies the current program register file into memory
+ - restores the contents of the next program's register file into the processor
+ - starts executing the next program
+ - From the program point of view, ^^no program can tell that a context switch has been performed.^^
+ - ### Protection
+ - Three rules of Protection in multiprogrammed computers: #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-20T21:34:44.306Z
+ card-last-reviewed:: 2022-10-03T14:34:44.306Z
+ card-last-score:: 3
+ - 1. The result of any program running on the multiprogram computer ^^must be the same as if the program was the only program running on the computer.^^
+ - 2. Programs ^^must not be able to access other programs' data^^ and must be confident that their data will not be modified by other programs (for security and privacy).
+ - 3. Programs ^^must not interfere with other programs' use of I/O devices.^^
+ - How is protection achieved? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T09:24:47.114Z
+ card-last-score:: 1
+ - Protection is achieved by the ^^operating system having full control over the resources of the system (processor, memory, and I/O devices)^^ through:
+ - **Privileged Mode:** the operating system is the only one that can control the physical resources it executes in privileged mode.
+ - User programs execute in **user mode**.
+ - **Virtual Memory:** each program operates as if it were the only program on the computer, occupying a full set of the address space in its virtual space.
+ - The OS is *translating* memory addresses that the program references into physical addresses used by the memory system.
+ -
+-
+- **Next Topic:** [[Programming Models]]
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-10-10T11_59_52.441Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-10-10T11_59_52.441Z.Desktop.md
new file mode 100644
index 00000000..2e6cad7a
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-10-10T11_59_52.441Z.Desktop.md
@@ -0,0 +1,541 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- No previous topic.
+- **Relevant Slides:** 
+-
+- ## Traditional Classes of Computer Systems
+ - What is a **Personal Computer (PC)**?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-09-23T18:28:00.836Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.7
+ card-last-reviewed:: 2022-09-19T18:28:00.836Z
+ - A **Personal Computer** is a computer designed for use by an individual, usually incorporating a graphics display, a keyboard, and a mouse.
+ - What is a **Server**? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T05:29:45.315Z
+ card-last-reviewed:: 2022-09-30T08:29:45.315Z
+ card-last-score:: 3
+ - A **server** is a computer used for running larger programs for multiple users, often simultaneously, and typically accessed only via a network.
+ - What is a **Supercomputer**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:52.646Z
+ card-last-reviewed:: 2022-10-03T11:37:52.647Z
+ card-last-score:: 5
+ - A **supercomputer** is a member of a class of computers with the highest performance (and cost). They are configured as servers and typically cost tens to hundreds of millions of dollars.
+ - What is an **Embedded Computer**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:37.659Z
+ card-last-reviewed:: 2022-10-01T17:30:37.659Z
+ card-last-score:: 5
+ - An **embedded computer** is a computer inside another device, used for running one predetermined application or collection of software.
+ - What are **Personal Mobile Devices**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:31:08.211Z
+ card-last-reviewed:: 2022-10-01T17:31:08.211Z
+ card-last-score:: 5
+ - **Personal Mobile Devices** are small, wireless devices that connect to the internet.
+ - They rely on batteries for power, and software is installed by downloading apps.
+ - Conventional examples include smartphones and tablets.
+ - What is **Cloud Computing**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:28:27.277Z
+ card-last-reviewed:: 2022-10-01T17:28:27.278Z
+ card-last-score:: 5
+ - **Cloud Computing** refers to large collections of servers that provide services over the internet.
+ - Some providers rent dynamically varying number of servers as a utility.
+ - What is **Software as a Service**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:42:21.001Z
+ card-last-reviewed:: 2022-10-03T11:42:21.001Z
+ card-last-score:: 5
+ - **Software as a Service** delivers software & data as a service over the internet, usually via a thing program, such as a browser.
+ - Examples include web search & email.
+ -
+- ## Computer Systems
+ collapsed:: true
+ - {:height 410, :width 414}
+ - What is **Application Software**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:31:12.546Z
+ card-last-reviewed:: 2022-10-01T17:31:12.546Z
+ card-last-score:: 5
+ - **Application Software** consists of user-installed applications & programs.
+ - Application Software provides services to the user that are commonly useful.
+ - What is the purpose of the **Operating System**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:11:34.929Z
+ card-last-reviewed:: 2022-09-30T12:11:34.929Z
+ card-last-score:: 3
+ - The **Operating System** interfaces between a user's program and the hardware, provides a variety of services, and performs supervisory functions.
+ - What is the purpose of the **Hardware**?
+ - The **Hardware** performs the tasks.
+ -
+- ## Seven Great Ideas in Computer Organisation
+ - ### 1. Use **Abstraction** to Simplify Design #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:36.002Z
+ card-last-reviewed:: 2022-10-03T14:28:36.003Z
+ card-last-score:: 5
+ - A major productivity technique for hardware & software is to use **abstractions** to characterise the design at different levels of representation
+ - Lower-level details are hidden to offer a simpler model at higher levels.
+ - ### 2. Make the **Common Case** Fast #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:29:14.556Z
+ card-last-reviewed:: 2022-10-01T17:29:14.557Z
+ card-last-score:: 5
+ - Making the **common case fast** will tend to enhance performance better than optimising the rare case.
+ - The common case is often simpler than the rare case, and hence is usually easier to enhance.
+ - ### 3. Performance via **Parallelism** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:16:13.241Z
+ card-last-reviewed:: 2022-09-30T12:16:13.242Z
+ card-last-score:: 3
+ - Involves speeding up performance by using designs that compute operations in **parallel**.
+ - ### 4. Performance via **Pipelining** #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T04:28:23.981Z
+ card-last-reviewed:: 2022-09-30T09:28:23.982Z
+ card-last-score:: 5
+ - **Performance via Pipelining** is a particular pattern of **parallelism** that is so prevalent in computer architecture that it merits its own name.
+ - ### 5. Performance via **Prediction** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:27:10.532Z
+ card-last-reviewed:: 2022-10-03T14:27:10.533Z
+ card-last-score:: 5
+ - In some cases, it can be ^^faster on average to guess and start working^^ that to wait until you know for sure (assuming that the mechanism to recover from a misprediction is not too expensive, and your prediction is relatively accurate).
+ - ### 6. Hierarchy of Memories #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:35:13.824Z
+ card-last-reviewed:: 2022-10-01T17:35:13.824Z
+ card-last-score:: 3
+ - Computer Architects have found that they can address conflicting demands with a **hierarchy of memories**.
+ - The ^^fastest, smallest, & most expensive memory per bit^^ is at the top of the hierarchy.
+ - The ^^slowest, largest, & cheapest per bit^^ is at the bottom of the hierarchy.
+ - ### 7. Dependability via **Redundancy** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:35:28.794Z
+ card-last-reviewed:: 2022-10-01T17:35:28.794Z
+ card-last-score:: 5
+ - Since any physical device can fail, we make systems **dependable** by including ^^redundant components^^ that can take over when a failure occurs *and* help detect failures.
+ -
+- ## Hardware Organisation
+ - What does basic computer organisation look like? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:58.087Z
+ card-last-reviewed:: 2022-10-03T14:29:58.087Z
+ card-last-score:: 5
+ - 
+ - What is an **integrated circuit**?
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-04T20:17:29.178Z
+ card-last-reviewed:: 2022-10-04T12:17:29.178Z
+ card-last-score:: 5
+ collapsed:: true
+ - An **integrated circuit**, also called a **chip**, is a device combining dozens to millions of transistors.
+ - ### The CPU
+ collapsed:: true
+ - What is a **CPU**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:40:13.962Z
+ card-last-reviewed:: 2022-10-03T11:40:13.962Z
+ card-last-score:: 5
+ - The **Central Processing Unit (CPU)**, also called the **processor**, is the ^^active part of the computer^^, which contains the datapath & control, and which adds numbers, tests numbers, signals I/O devices to activate, and so on.
+ - The CPU is ^^responsible for executing programs.^^
+ - What are the steps that the CPU takes to process programs? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-09T18:15:57.207Z
+ card-last-reviewed:: 2022-09-30T12:15:57.208Z
+ card-last-score:: 5
+ - **1. Fetch:** Retrieve an instruction from ^^program memory.^^
+ - **2. Decode:** Break down the instruction into parts that have significance to specific sections of the CPU.
+ - **3. Execute:** Various portions of the CPU are connected to perform the desired operation.
+ - **4. Write Back:** Simply "writes back" the results of the execute step ^^if necessary.^^
+ - ### CPU Organisation
+ - What does the **organisation** of the CPU look like? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-09T20:25:22.675Z
+ card-last-reviewed:: 2022-10-01T13:25:22.675Z
+ card-last-score:: 3
+ - Processors are made up of:
+ - A **Control Unit**
+ - **Execution Unit(s)**
+ - A **Register File**
+ - {:height 339, :width 418}
+ -
+ - #### Control Unit
+ - What does the **Control Unit** do? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:29:08.350Z
+ card-last-reviewed:: 2022-10-03T14:29:08.350Z
+ card-last-score:: 3
+ - The **Control Unit** ^^controls the execution^^ of the instructions stored in main memory.
+ - It ^^retrieves & executes^^ them.
+ - What is the architecture of the control unit? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T05:29:05.114Z
+ card-last-reviewed:: 2022-09-30T08:29:05.115Z
+ card-last-score:: 3
+ - The control unit contains a **fetch unit**, a **decode unit**, and an **execute unit**.
+ - It also contains two special registers:
+ - **Program Counter (PC):** keeps the address of the next instruction
+ - **Instruction Register (IR):** keeps the instruction being executed
+ - {:height 266, :width 550}
+ -
+ - ### The Memory Subsystem
+ collapsed:: true
+ - How is the memory divided into storage locations? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:34:12.415Z
+ card-last-reviewed:: 2022-10-01T17:34:12.416Z
+ card-last-score:: 5
+ - Memory is divided into a set of storage location which can hold data.
+ - Locations are numbered.
+ - Addresses are used to tell the memory which location the processor wants to access.
+ - What are the two hierarchies of memory? #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T22:24:15.552Z
+ card-last-reviewed:: 2022-10-08T15:24:15.553Z
+ card-last-score:: 5
+ - **1. Nonvolatile / ROM (Read Only Memory):** Read only memory.
+ - Used to store the BIOS and / or a *bootstrap* or *bootloader* program.
+ - **2. Volatile / RAM (Random Access Memory):** Read / Write memory.
+ - Also called **Primary Memory**.
+ - Used to hold the programs, operating system, and data required by the computer.
+ - #### Primary Memory
+ - How is primary memory connected to the CPU? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:34.991Z
+ card-last-reviewed:: 2022-10-03T11:43:34.992Z
+ card-last-score:: 5
+ - **Primary Memory** is directly connected to the Central Processing Unit of the computer.
+ - It must be present for the CPU to function correctly.
+ - What are the three types of Primary Storage? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T10:20:18.031Z
+ card-last-reviewed:: 2022-10-07T10:20:18.032Z
+ card-last-score:: 3
+ - **1. Processor Register:**
+ - Contains information that the CPU needs to carry out the current instruction.
+ - **2. Cache Memory:**
+ - A special type of internal memory used by many CPUs to increase their **throughput**.
+ - **3. Main Memory:**
+ - Contains the programs that are currently being run and the data that the programs are operating on.
+ - What is the **address width**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:30:08.146Z
+ card-last-reviewed:: 2022-09-30T08:30:08.147Z
+ card-last-score:: 3
+ - The **address width** is the number of bits used to represent an address in memory.
+ - The **width** limits the amount of memory that a computer can access.
+ - Most computers use a **64 bit address**, which means that the maximum number of locations is $$ 2^{64} \approx 16 \text{ billion gigabytes}$$.
+ - What operations does the memory subsystem support? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:33.402Z
+ card-last-reviewed:: 2022-10-01T17:30:33.403Z
+ card-last-score:: 5
+ - The memory subsystem supports two operations:
+ - **Load** (or read) + the address of the data location to be read.
+ - **Store** (or write) + the address of the location & the data to be written.
+ - How many bytes may the memory system read or write at a time? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:29:45.960Z
+ card-last-reviewed:: 2022-10-01T17:29:45.960Z
+ card-last-score:: 5
+ - Read & Write operations ^^operate at the width of the system's data bus^^, usually 32 bit or 64 bit.
+ - How is a section of memory addressed? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:24:14.775Z
+ card-last-reviewed:: 2022-10-01T13:24:14.776Z
+ card-last-score:: 5
+ - The address ^^contains only the address of the lowest byte^^, and a number of bytes to be read is specified, e.g., 4 bytes.
+ - #### Memory Alignment & Words of Data
+ - When the computer's **word size** is 4 bytes, the data to be read should be at a memory address which is ^^some multiple of four.^^
+ - When this is not the case, e.g., the data starts at address 14 instead of 16, then the computer has to read two or more 4 byte chunks and do some calculation before the requested data has been read, or it may generate ^^an alignment fault.^^
+ - Even though the previous data structure end is at, for example, address 13, the next data structure should start at address 16. Two **padding bytes** are inserted between the two data structures at addresses 14 & 15 to align the next data structure at address 16.
+ - ### The I/O Subsystem
+ - What are **input devices**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:40.506Z
+ card-last-reviewed:: 2022-09-30T12:11:40.507Z
+ card-last-score:: 5
+ - Anything that feeds data into the computer.
+ - What are **output devices**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:12:09.769Z
+ card-last-reviewed:: 2022-09-30T12:12:09.770Z
+ card-last-score:: 5
+ - Display / transmit information back to the user.
+ - What does the **I/O Subsystem** contain? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:38.831Z
+ card-last-reviewed:: 2022-09-30T12:11:38.832Z
+ card-last-score:: 5
+ - The **I/O Subsystem** contains the devices that the computer uses to communicate with the outside world and to store data.
+ - How do I/O devices communicate with the processor? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:20:26.377Z
+ card-last-score:: 1
+ - I/O devices usually communicate with the processor using the **I/O Bus**.
+ - PCs use the **PCI Express (Peripheral Component Interconnect Express)** bus for their I/O bus.
+ - The Operating System needs a **device driver** to access a given I/O device.
+ - What is a **device driver**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:23:41.787Z
+ card-last-reviewed:: 2022-10-01T13:23:41.788Z
+ card-last-score:: 5
+ - A **device driver** is a program that allows the OS to control an I/O device.
+ - #### I/O Read / Write Operations
+ - The I/O read & write operations are similar to the memory read & write operations.
+ - How does the processor address I/O devices? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-10T17:25:39.877Z
+ card-last-reviewed:: 2022-10-06T17:25:39.878Z
+ card-last-score:: 3
+ - A processor may use:
+ - **Memory-Mapped I/O:** when the address of the I/O device is in the **direct memory space**, and the ^^sequences to read/write data in the device are the same as the memory read/write sequences.^^
+ - **Isolated I/O:** similar process to Memory-Mapped I/O, but the processor has a ^^second set of control signals to distinguish between a **memory access** and am **I/O access**.^^
+ - What is **IO/M**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-16T16:39:35.254Z
+ card-last-reviewed:: 2022-10-07T10:39:35.254Z
+ card-last-score:: 5
+ - **IO/M** is a **status signal** in **Isolated I/O** that denotes whether the read/write operation pertains to the memory or to the I/O subsystem.
+ - When the **signal is low** (IO/M = 0), i.e., IO/M is `true`, it denotes **memory-related operations**.
+ - When the **signal is high**, (IO/M = 1), i.e., IO/M is `false`, it denotes an **I/O operation**.
+ -
+ -
+ -
+- ## Programs
+ - What are programs? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:29:21.265Z
+ card-last-reviewed:: 2022-10-01T13:29:21.266Z
+ card-last-score:: 5
+ - Programs are ^^sequences of instructions^^ that tell the computer what to do.
+ - To the computer, a program is made out of a ^^sequence of numbers that represent individual operations.^^
+ - These operations are known as **machine instructions** or just **instructions**.
+ - A set of instructions that a processor can execute is known as an **instruction set**.
+ - ### Program Development Tools
+ collapsed:: true
+ - What is a **high-level programming language**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:17:29.873Z
+ card-last-reviewed:: 2022-10-01T13:17:29.874Z
+ card-last-score:: 5
+ - A **high-level programming language** is a ^^portable language^^ such as C that is ^^composed of words & algebraic notation^^ that can be translated by a compiler into **assembly language**.
+ - What is a **compiler**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:12:39.064Z
+ card-last-reviewed:: 2022-09-30T12:12:39.064Z
+ card-last-score:: 5
+ - A **compiler** is a program that translates statements in a given high-level language into assembly language statements.
+ - What is an **assembler**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:19:13.686Z
+ card-last-reviewed:: 2022-10-01T13:19:13.686Z
+ card-last-score:: 5
+ - An **assembler** is a program that translates symbolic, assembly language versions of instructions into the ^^binary version.^^
+ - What is **Assembly Language**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-11-07T03:25:47.210Z
+ card-last-reviewed:: 2022-10-04T12:25:47.210Z
+ card-last-score:: 5
+ - **Assembly Language** is a ^^symbolic representation^^ of **machine instructions**.
+ - What is **Machine Language**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-16T16:39:57.935Z
+ card-last-reviewed:: 2022-10-07T10:39:57.935Z
+ card-last-score:: 3
+ - **Machine Language** is a ^^binary representation^^ of **machine instructions**.
+ - What is an **instruction**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:20.118Z
+ card-last-reviewed:: 2022-10-03T11:37:20.118Z
+ card-last-score:: 5
+ - An **instruction** is a command that the computer hardware understands & obeys.
+ -
+- ## Operating Systems
+ - What is an **Operating System**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:38:21.429Z
+ card-last-reviewed:: 2022-10-07T10:38:21.431Z
+ card-last-score:: 3
+ - Possible definition: a program that runs on the computer that ^^knows about all the hardware^^ and usually ^^runs in privileged mode^^, having ^^access to physical resources that user programs can't control^^, and has the ^^ability to start & stop user programs.^^
+ - The OS is responsible for managing the physical resources of complex systems, such as PCs, workstations, mainframe computers, etc.
+ - It is also responsible for ^^loading & executing programs^^ and ^^interfacing with the users.^^
+ - Usually, there is no operating system for **small embedded systems**.
+ - Computers designed for one specific task.
+ -
+ - ### Multiprogramming
+ - What is **Multiprogramming**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:10:38.026Z
+ card-last-reviewed:: 2022-09-30T12:10:38.027Z
+ card-last-score:: 3
+ - **Multiprogramming** is a technique that allows the system to ^^present the illusion that multiple programs are running on the computer simultaneously.^^
+ - Many multiprogrammed computers are **multiuser**.
+ - They allow multiple users to be logged in at a time.
+ - How is multiprogramming achieved? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:35:33.411Z
+ card-last-reviewed:: 2022-10-01T17:35:33.411Z
+ card-last-score:: 5
+ - Multiprogramming is achieved by ^^switching rapidly between programs.^^
+ - How does the processor decide which process to execute next? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:37:46.365Z
+ card-last-reviewed:: 2022-10-03T11:37:46.366Z
+ card-last-score:: 3
+ - **FCFS - First Come, First Served:** processes are moved to the CPU in the order in which they arrive.
+ - **SJN - Shortest Job Next:** looks at all processes in the **ready state** and dispatches the one with the smallest service time.
+ - **Round Robin:** distributes the processing time equitably among all ready processes.
+ - ### Context Switching
+ - What is a **Context Switch**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-10T19:19:02.676Z
+ card-last-reviewed:: 2022-10-01T13:19:02.677Z
+ card-last-score:: 3
+ - When a program timeslice ends, the OS stops it, removes it, and gives another program control over the processor.
+ - This is a **context switch**.
+ - How does the OS go about a Context Switch? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:37:36.618Z
+ card-last-reviewed:: 2022-10-03T11:37:36.618Z
+ card-last-score:: 3
+ - copies the current program register file into memory
+ - restores the contents of the next program's register file into the processor
+ - starts executing the next program
+ - From the program point of view, ^^no program can tell that a context switch has been performed.^^
+ - ### Protection
+ - Three rules of Protection in multiprogrammed computers: #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-20T21:34:44.306Z
+ card-last-reviewed:: 2022-10-03T14:34:44.306Z
+ card-last-score:: 3
+ - 1. The result of any program running on the multiprogram computer ^^must be the same as if the program was the only program running on the computer.^^
+ - 2. Programs ^^must not be able to access other programs' data^^ and must be confident that their data will not be modified by other programs (for security and privacy).
+ - 3. Programs ^^must not interfere with other programs' use of I/O devices.^^
+ - How is protection achieved? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-15T17:20:10.955Z
+ card-last-reviewed:: 2022-10-07T10:20:10.955Z
+ card-last-score:: 3
+ - Protection is achieved by the ^^operating system having full control over the resources of the system (processor, memory, and I/O devices)^^ through:
+ - **Privileged Mode:** the operating system is the only one that can control the physical resources it executes in privileged mode.
+ - User programs execute in **user mode**.
+ - **Virtual Memory:** each program operates as if it were the only program on the computer, occupying a full set of the address space in its virtual space.
+ - The OS is *translating* memory addresses that the program references into physical addresses used by the memory system.
+ -
+-
+- **Next Topic:** [[Programming Models]]
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-10-20T09_05_57.974Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-10-20T09_05_57.974Z.Desktop.md
new file mode 100644
index 00000000..6c16c46f
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-10-20T09_05_57.974Z.Desktop.md
@@ -0,0 +1,541 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- No previous topic.
+- **Relevant Slides:** 
+-
+- ## Traditional Classes of Computer Systems
+ - What is a **Personal Computer (PC)**?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-09-23T18:28:00.836Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.7
+ card-last-reviewed:: 2022-09-19T18:28:00.836Z
+ - A **Personal Computer** is a computer designed for use by an individual, usually incorporating a graphics display, a keyboard, and a mouse.
+ - What is a **Server**? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:42:38.737Z
+ card-last-reviewed:: 2022-10-10T11:42:38.738Z
+ card-last-score:: 3
+ - A **server** is a computer used for running larger programs for multiple users, often simultaneously, and typically accessed only via a network.
+ - What is a **Supercomputer**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:52.646Z
+ card-last-reviewed:: 2022-10-03T11:37:52.647Z
+ card-last-score:: 5
+ - A **supercomputer** is a member of a class of computers with the highest performance (and cost). They are configured as servers and typically cost tens to hundreds of millions of dollars.
+ - What is an **Embedded Computer**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:37.659Z
+ card-last-reviewed:: 2022-10-01T17:30:37.659Z
+ card-last-score:: 5
+ - An **embedded computer** is a computer inside another device, used for running one predetermined application or collection of software.
+ - What are **Personal Mobile Devices**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:31:08.211Z
+ card-last-reviewed:: 2022-10-01T17:31:08.211Z
+ card-last-score:: 5
+ - **Personal Mobile Devices** are small, wireless devices that connect to the internet.
+ - They rely on batteries for power, and software is installed by downloading apps.
+ - Conventional examples include smartphones and tablets.
+ - What is **Cloud Computing**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:28:27.277Z
+ card-last-reviewed:: 2022-10-01T17:28:27.278Z
+ card-last-score:: 5
+ - **Cloud Computing** refers to large collections of servers that provide services over the internet.
+ - Some providers rent dynamically varying number of servers as a utility.
+ - What is **Software as a Service**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:42:21.001Z
+ card-last-reviewed:: 2022-10-03T11:42:21.001Z
+ card-last-score:: 5
+ - **Software as a Service** delivers software & data as a service over the internet, usually via a thing program, such as a browser.
+ - Examples include web search & email.
+ -
+- ## Computer Systems
+ collapsed:: true
+ - {:height 410, :width 414}
+ - What is **Application Software**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:31:12.546Z
+ card-last-reviewed:: 2022-10-01T17:31:12.546Z
+ card-last-score:: 5
+ - **Application Software** consists of user-installed applications & programs.
+ - Application Software provides services to the user that are commonly useful.
+ - What is the purpose of the **Operating System**? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-02T21:44:58.883Z
+ card-last-reviewed:: 2022-10-10T11:44:58.883Z
+ card-last-score:: 5
+ - The **Operating System** interfaces between a user's program and the hardware, provides a variety of services, and performs supervisory functions.
+ - What is the purpose of the **Hardware**?
+ - The **Hardware** performs the tasks.
+ -
+- ## Seven Great Ideas in Computer Organisation
+ - ### 1. Use **Abstraction** to Simplify Design #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:36.002Z
+ card-last-reviewed:: 2022-10-03T14:28:36.003Z
+ card-last-score:: 5
+ - A major productivity technique for hardware & software is to use **abstractions** to characterise the design at different levels of representation
+ - Lower-level details are hidden to offer a simpler model at higher levels.
+ - ### 2. Make the **Common Case** Fast #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:29:14.556Z
+ card-last-reviewed:: 2022-10-01T17:29:14.557Z
+ card-last-score:: 5
+ - Making the **common case fast** will tend to enhance performance better than optimising the rare case.
+ - The common case is often simpler than the rare case, and hence is usually easier to enhance.
+ - ### 3. Performance via **Parallelism** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:16:13.241Z
+ card-last-reviewed:: 2022-09-30T12:16:13.242Z
+ card-last-score:: 3
+ - Involves speeding up performance by using designs that compute operations in **parallel**.
+ - ### 4. Performance via **Pipelining** #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T04:28:23.981Z
+ card-last-reviewed:: 2022-09-30T09:28:23.982Z
+ card-last-score:: 5
+ - **Performance via Pipelining** is a particular pattern of **parallelism** that is so prevalent in computer architecture that it merits its own name.
+ - ### 5. Performance via **Prediction** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:27:10.532Z
+ card-last-reviewed:: 2022-10-03T14:27:10.533Z
+ card-last-score:: 5
+ - In some cases, it can be ^^faster on average to guess and start working^^ that to wait until you know for sure (assuming that the mechanism to recover from a misprediction is not too expensive, and your prediction is relatively accurate).
+ - ### 6. Hierarchy of Memories #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:35:13.824Z
+ card-last-reviewed:: 2022-10-01T17:35:13.824Z
+ card-last-score:: 3
+ - Computer Architects have found that they can address conflicting demands with a **hierarchy of memories**.
+ - The ^^fastest, smallest, & most expensive memory per bit^^ is at the top of the hierarchy.
+ - The ^^slowest, largest, & cheapest per bit^^ is at the bottom of the hierarchy.
+ - ### 7. Dependability via **Redundancy** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:35:28.794Z
+ card-last-reviewed:: 2022-10-01T17:35:28.794Z
+ card-last-score:: 5
+ - Since any physical device can fail, we make systems **dependable** by including ^^redundant components^^ that can take over when a failure occurs *and* help detect failures.
+ -
+- ## Hardware Organisation
+ - What does basic computer organisation look like? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:58.087Z
+ card-last-reviewed:: 2022-10-03T14:29:58.087Z
+ card-last-score:: 5
+ - 
+ - What is an **integrated circuit**?
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-04T20:17:29.178Z
+ card-last-reviewed:: 2022-10-04T12:17:29.178Z
+ card-last-score:: 5
+ collapsed:: true
+ - An **integrated circuit**, also called a **chip**, is a device combining dozens to millions of transistors.
+ - ### The CPU
+ collapsed:: true
+ - What is a **CPU**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:40:13.962Z
+ card-last-reviewed:: 2022-10-03T11:40:13.962Z
+ card-last-score:: 5
+ - The **Central Processing Unit (CPU)**, also called the **processor**, is the ^^active part of the computer^^, which contains the datapath & control, and which adds numbers, tests numbers, signals I/O devices to activate, and so on.
+ - The CPU is ^^responsible for executing programs.^^
+ - What are the steps that the CPU takes to process programs? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-02T21:45:06.768Z
+ card-last-reviewed:: 2022-10-10T11:45:06.768Z
+ card-last-score:: 5
+ - **1. Fetch:** Retrieve an instruction from ^^program memory.^^
+ - **2. Decode:** Break down the instruction into parts that have significance to specific sections of the CPU.
+ - **3. Execute:** Various portions of the CPU are connected to perform the desired operation.
+ - **4. Write Back:** Simply "writes back" the results of the execute step ^^if necessary.^^
+ - ### CPU Organisation
+ - What does the **organisation** of the CPU look like? #card
+ card-last-interval:: 15.05
+ card-repeats:: 4
+ card-ease-factor:: 1.94
+ card-next-schedule:: 2022-10-25T12:45:53.286Z
+ card-last-reviewed:: 2022-10-10T11:45:53.286Z
+ card-last-score:: 3
+ - Processors are made up of:
+ - A **Control Unit**
+ - **Execution Unit(s)**
+ - A **Register File**
+ - {:height 339, :width 418}
+ -
+ - #### Control Unit
+ - What does the **Control Unit** do? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:29:08.350Z
+ card-last-reviewed:: 2022-10-03T14:29:08.350Z
+ card-last-score:: 3
+ - The **Control Unit** ^^controls the execution^^ of the instructions stored in main memory.
+ - It ^^retrieves & executes^^ them.
+ - What is the architecture of the control unit? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:42:33.523Z
+ card-last-reviewed:: 2022-10-10T11:42:33.524Z
+ card-last-score:: 3
+ - The control unit contains a **fetch unit**, a **decode unit**, and an **execute unit**.
+ - It also contains two special registers:
+ - **Program Counter (PC):** keeps the address of the next instruction
+ - **Instruction Register (IR):** keeps the instruction being executed
+ - {:height 266, :width 550}
+ -
+ - ### The Memory Subsystem
+ collapsed:: true
+ - How is the memory divided into storage locations? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:34:12.415Z
+ card-last-reviewed:: 2022-10-01T17:34:12.416Z
+ card-last-score:: 5
+ - Memory is divided into a set of storage location which can hold data.
+ - Locations are numbered.
+ - Addresses are used to tell the memory which location the processor wants to access.
+ - What are the two hierarchies of memory? #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T22:24:15.552Z
+ card-last-reviewed:: 2022-10-08T15:24:15.553Z
+ card-last-score:: 5
+ - **1. Nonvolatile / ROM (Read Only Memory):** Read only memory.
+ - Used to store the BIOS and / or a *bootstrap* or *bootloader* program.
+ - **2. Volatile / RAM (Random Access Memory):** Read / Write memory.
+ - Also called **Primary Memory**.
+ - Used to hold the programs, operating system, and data required by the computer.
+ - #### Primary Memory
+ - How is primary memory connected to the CPU? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:34.991Z
+ card-last-reviewed:: 2022-10-03T11:43:34.992Z
+ card-last-score:: 5
+ - **Primary Memory** is directly connected to the Central Processing Unit of the computer.
+ - It must be present for the CPU to function correctly.
+ - What are the three types of Primary Storage? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T10:20:18.031Z
+ card-last-reviewed:: 2022-10-07T10:20:18.032Z
+ card-last-score:: 3
+ - **1. Processor Register:**
+ - Contains information that the CPU needs to carry out the current instruction.
+ - **2. Cache Memory:**
+ - A special type of internal memory used by many CPUs to increase their **throughput**.
+ - **3. Main Memory:**
+ - Contains the programs that are currently being run and the data that the programs are operating on.
+ - What is the **address width**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T13:30:08.146Z
+ card-last-reviewed:: 2022-09-30T08:30:08.147Z
+ card-last-score:: 3
+ - The **address width** is the number of bits used to represent an address in memory.
+ - The **width** limits the amount of memory that a computer can access.
+ - Most computers use a **64 bit address**, which means that the maximum number of locations is $$ 2^{64} \approx 16 \text{ billion gigabytes}$$.
+ - What operations does the memory subsystem support? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:33.402Z
+ card-last-reviewed:: 2022-10-01T17:30:33.403Z
+ card-last-score:: 5
+ - The memory subsystem supports two operations:
+ - **Load** (or read) + the address of the data location to be read.
+ - **Store** (or write) + the address of the location & the data to be written.
+ - How many bytes may the memory system read or write at a time? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:29:45.960Z
+ card-last-reviewed:: 2022-10-01T17:29:45.960Z
+ card-last-score:: 5
+ - Read & Write operations ^^operate at the width of the system's data bus^^, usually 32 bit or 64 bit.
+ - How is a section of memory addressed? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:24:14.775Z
+ card-last-reviewed:: 2022-10-01T13:24:14.776Z
+ card-last-score:: 5
+ - The address ^^contains only the address of the lowest byte^^, and a number of bytes to be read is specified, e.g., 4 bytes.
+ - #### Memory Alignment & Words of Data
+ - When the computer's **word size** is 4 bytes, the data to be read should be at a memory address which is ^^some multiple of four.^^
+ - When this is not the case, e.g., the data starts at address 14 instead of 16, then the computer has to read two or more 4 byte chunks and do some calculation before the requested data has been read, or it may generate ^^an alignment fault.^^
+ - Even though the previous data structure end is at, for example, address 13, the next data structure should start at address 16. Two **padding bytes** are inserted between the two data structures at addresses 14 & 15 to align the next data structure at address 16.
+ - ### The I/O Subsystem
+ - What are **input devices**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:40.506Z
+ card-last-reviewed:: 2022-09-30T12:11:40.507Z
+ card-last-score:: 5
+ - Anything that feeds data into the computer.
+ - What are **output devices**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:12:09.769Z
+ card-last-reviewed:: 2022-09-30T12:12:09.770Z
+ card-last-score:: 5
+ - Display / transmit information back to the user.
+ - What does the **I/O Subsystem** contain? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:38.831Z
+ card-last-reviewed:: 2022-09-30T12:11:38.832Z
+ card-last-score:: 5
+ - The **I/O Subsystem** contains the devices that the computer uses to communicate with the outside world and to store data.
+ - How do I/O devices communicate with the processor? #card
+ collapsed:: true
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T21:36:17.677Z
+ card-last-reviewed:: 2022-10-10T11:36:17.677Z
+ card-last-score:: 5
+ - I/O devices usually communicate with the processor using the **I/O Bus**.
+ - PCs use the **PCI Express (Peripheral Component Interconnect Express)** bus for their I/O bus.
+ - The Operating System needs a **device driver** to access a given I/O device.
+ - What is a **device driver**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:23:41.787Z
+ card-last-reviewed:: 2022-10-01T13:23:41.788Z
+ card-last-score:: 5
+ - A **device driver** is a program that allows the OS to control an I/O device.
+ - #### I/O Read / Write Operations
+ - The I/O read & write operations are similar to the memory read & write operations.
+ - How does the processor address I/O devices? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-10T17:25:39.877Z
+ card-last-reviewed:: 2022-10-06T17:25:39.878Z
+ card-last-score:: 3
+ - A processor may use:
+ - **Memory-Mapped I/O:** when the address of the I/O device is in the **direct memory space**, and the ^^sequences to read/write data in the device are the same as the memory read/write sequences.^^
+ - **Isolated I/O:** similar process to Memory-Mapped I/O, but the processor has a ^^second set of control signals to distinguish between a **memory access** and am **I/O access**.^^
+ - What is **IO/M**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-16T16:39:35.254Z
+ card-last-reviewed:: 2022-10-07T10:39:35.254Z
+ card-last-score:: 5
+ - **IO/M** is a **status signal** in **Isolated I/O** that denotes whether the read/write operation pertains to the memory or to the I/O subsystem.
+ - When the **signal is low** (IO/M = 0), i.e., IO/M is `true`, it denotes **memory-related operations**.
+ - When the **signal is high**, (IO/M = 1), i.e., IO/M is `false`, it denotes an **I/O operation**.
+ -
+ -
+ -
+- ## Programs
+ - What are programs? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:29:21.265Z
+ card-last-reviewed:: 2022-10-01T13:29:21.266Z
+ card-last-score:: 5
+ - Programs are ^^sequences of instructions^^ that tell the computer what to do.
+ - To the computer, a program is made out of a ^^sequence of numbers that represent individual operations.^^
+ - These operations are known as **machine instructions** or just **instructions**.
+ - A set of instructions that a processor can execute is known as an **instruction set**.
+ - ### Program Development Tools
+ collapsed:: true
+ - What is a **high-level programming language**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:17:29.873Z
+ card-last-reviewed:: 2022-10-01T13:17:29.874Z
+ card-last-score:: 5
+ - A **high-level programming language** is a ^^portable language^^ such as C that is ^^composed of words & algebraic notation^^ that can be translated by a compiler into **assembly language**.
+ - What is a **compiler**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:12:39.064Z
+ card-last-reviewed:: 2022-09-30T12:12:39.064Z
+ card-last-score:: 5
+ - A **compiler** is a program that translates statements in a given high-level language into assembly language statements.
+ - What is an **assembler**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:19:13.686Z
+ card-last-reviewed:: 2022-10-01T13:19:13.686Z
+ card-last-score:: 5
+ - An **assembler** is a program that translates symbolic, assembly language versions of instructions into the ^^binary version.^^
+ - What is **Assembly Language**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-11-07T03:25:47.210Z
+ card-last-reviewed:: 2022-10-04T12:25:47.210Z
+ card-last-score:: 5
+ - **Assembly Language** is a ^^symbolic representation^^ of **machine instructions**.
+ - What is **Machine Language**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-16T16:39:57.935Z
+ card-last-reviewed:: 2022-10-07T10:39:57.935Z
+ card-last-score:: 3
+ - **Machine Language** is a ^^binary representation^^ of **machine instructions**.
+ - What is an **instruction**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:20.118Z
+ card-last-reviewed:: 2022-10-03T11:37:20.118Z
+ card-last-score:: 5
+ - An **instruction** is a command that the computer hardware understands & obeys.
+ -
+- ## Operating Systems
+ - What is an **Operating System**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:38:21.429Z
+ card-last-reviewed:: 2022-10-07T10:38:21.431Z
+ card-last-score:: 3
+ - Possible definition: a program that runs on the computer that ^^knows about all the hardware^^ and usually ^^runs in privileged mode^^, having ^^access to physical resources that user programs can't control^^, and has the ^^ability to start & stop user programs.^^
+ - The OS is responsible for managing the physical resources of complex systems, such as PCs, workstations, mainframe computers, etc.
+ - It is also responsible for ^^loading & executing programs^^ and ^^interfacing with the users.^^
+ - Usually, there is no operating system for **small embedded systems**.
+ - Computers designed for one specific task.
+ -
+ - ### Multiprogramming
+ - What is **Multiprogramming**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-10T17:10:38.026Z
+ card-last-reviewed:: 2022-09-30T12:10:38.027Z
+ card-last-score:: 3
+ - **Multiprogramming** is a technique that allows the system to ^^present the illusion that multiple programs are running on the computer simultaneously.^^
+ - Many multiprogrammed computers are **multiuser**.
+ - They allow multiple users to be logged in at a time.
+ - How is multiprogramming achieved? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:35:33.411Z
+ card-last-reviewed:: 2022-10-01T17:35:33.411Z
+ card-last-score:: 5
+ - Multiprogramming is achieved by ^^switching rapidly between programs.^^
+ - How does the processor decide which process to execute next? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:37:46.365Z
+ card-last-reviewed:: 2022-10-03T11:37:46.366Z
+ card-last-score:: 3
+ - **FCFS - First Come, First Served:** processes are moved to the CPU in the order in which they arrive.
+ - **SJN - Shortest Job Next:** looks at all processes in the **ready state** and dispatches the one with the smallest service time.
+ - **Round Robin:** distributes the processing time equitably among all ready processes.
+ - ### Context Switching
+ - What is a **Context Switch**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-10T19:19:02.676Z
+ card-last-reviewed:: 2022-10-01T13:19:02.677Z
+ card-last-score:: 3
+ - When a program timeslice ends, the OS stops it, removes it, and gives another program control over the processor.
+ - This is a **context switch**.
+ - How does the OS go about a Context Switch? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:37:36.618Z
+ card-last-reviewed:: 2022-10-03T11:37:36.618Z
+ card-last-score:: 3
+ - copies the current program register file into memory
+ - restores the contents of the next program's register file into the processor
+ - starts executing the next program
+ - From the program point of view, ^^no program can tell that a context switch has been performed.^^
+ - ### Protection
+ - Three rules of Protection in multiprogrammed computers: #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-20T21:34:44.306Z
+ card-last-reviewed:: 2022-10-03T14:34:44.306Z
+ card-last-score:: 3
+ - 1. The result of any program running on the multiprogram computer ^^must be the same as if the program was the only program running on the computer.^^
+ - 2. Programs ^^must not be able to access other programs' data^^ and must be confident that their data will not be modified by other programs (for security and privacy).
+ - 3. Programs ^^must not interfere with other programs' use of I/O devices.^^
+ - How is protection achieved? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-15T17:20:10.955Z
+ card-last-reviewed:: 2022-10-07T10:20:10.955Z
+ card-last-score:: 3
+ - Protection is achieved by the ^^operating system having full control over the resources of the system (processor, memory, and I/O devices)^^ through:
+ - **Privileged Mode:** the operating system is the only one that can control the physical resources it executes in privileged mode.
+ - User programs execute in **user mode**.
+ - **Virtual Memory:** each program operates as if it were the only program on the computer, occupying a full set of the address space in its virtual space.
+ - The OS is *translating* memory addresses that the program references into physical addresses used by the memory system.
+ -
+-
+- **Next Topic:** [[Programming Models]]
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-11-11T12_04_45.362Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-11-11T12_04_45.362Z.Desktop.md
new file mode 100644
index 00000000..676c2c99
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Overview of Computer Systems/2022-11-11T12_04_45.362Z.Desktop.md
@@ -0,0 +1,541 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- No previous topic.
+- **Relevant Slides:** 
+-
+- ## Traditional Classes of Computer Systems
+ - What is a **Personal Computer (PC)**?
+ card-last-score:: 5
+ card-repeats:: 2
+ card-next-schedule:: 2022-09-23T18:28:00.836Z
+ card-last-interval:: 4
+ card-ease-factor:: 2.7
+ card-last-reviewed:: 2022-09-19T18:28:00.836Z
+ - A **Personal Computer** is a computer designed for use by an individual, usually incorporating a graphics display, a keyboard, and a mouse.
+ - What is a **Server**? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:42:38.737Z
+ card-last-reviewed:: 2022-10-10T11:42:38.738Z
+ card-last-score:: 3
+ - A **server** is a computer used for running larger programs for multiple users, often simultaneously, and typically accessed only via a network.
+ - What is a **Supercomputer**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:52.646Z
+ card-last-reviewed:: 2022-10-03T11:37:52.647Z
+ card-last-score:: 5
+ - A **supercomputer** is a member of a class of computers with the highest performance (and cost). They are configured as servers and typically cost tens to hundreds of millions of dollars.
+ - What is an **Embedded Computer**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:37.659Z
+ card-last-reviewed:: 2022-10-01T17:30:37.659Z
+ card-last-score:: 5
+ - An **embedded computer** is a computer inside another device, used for running one predetermined application or collection of software.
+ - What are **Personal Mobile Devices**?
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:31:08.211Z
+ card-last-reviewed:: 2022-10-01T17:31:08.211Z
+ card-last-score:: 5
+ - **Personal Mobile Devices** are small, wireless devices that connect to the internet.
+ - They rely on batteries for power, and software is installed by downloading apps.
+ - Conventional examples include smartphones and tablets.
+ - What is **Cloud Computing**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:28:27.277Z
+ card-last-reviewed:: 2022-10-01T17:28:27.278Z
+ card-last-score:: 5
+ - **Cloud Computing** refers to large collections of servers that provide services over the internet.
+ - Some providers rent dynamically varying number of servers as a utility.
+ - What is **Software as a Service**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:42:21.001Z
+ card-last-reviewed:: 2022-10-03T11:42:21.001Z
+ card-last-score:: 5
+ - **Software as a Service** delivers software & data as a service over the internet, usually via a thing program, such as a browser.
+ - Examples include web search & email.
+ -
+- ## Computer Systems
+ collapsed:: true
+ - {:height 410, :width 414}
+ - What is **Application Software**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:31:12.546Z
+ card-last-reviewed:: 2022-10-01T17:31:12.546Z
+ card-last-score:: 5
+ - **Application Software** consists of user-installed applications & programs.
+ - Application Software provides services to the user that are commonly useful.
+ - What is the purpose of the **Operating System**? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-02T21:44:58.883Z
+ card-last-reviewed:: 2022-10-10T11:44:58.883Z
+ card-last-score:: 5
+ - The **Operating System** interfaces between a user's program and the hardware, provides a variety of services, and performs supervisory functions.
+ - What is the purpose of the **Hardware**?
+ - The **Hardware** performs the tasks.
+ -
+- ## Seven Great Ideas in Computer Organisation
+ - ### 1. Use **Abstraction** to Simplify Design #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:36.002Z
+ card-last-reviewed:: 2022-10-03T14:28:36.003Z
+ card-last-score:: 5
+ - A major productivity technique for hardware & software is to use **abstractions** to characterise the design at different levels of representation
+ - Lower-level details are hidden to offer a simpler model at higher levels.
+ - ### 2. Make the **Common Case** Fast #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:29:14.556Z
+ card-last-reviewed:: 2022-10-01T17:29:14.557Z
+ card-last-score:: 5
+ - Making the **common case fast** will tend to enhance performance better than optimising the rare case.
+ - The common case is often simpler than the rare case, and hence is usually easier to enhance.
+ - ### 3. Performance via **Parallelism** #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:35:06.365Z
+ card-last-reviewed:: 2022-10-20T08:35:06.365Z
+ card-last-score:: 5
+ - Involves speeding up performance by using designs that compute operations in **parallel**.
+ - ### 4. Performance via **Pipelining** #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T04:28:23.981Z
+ card-last-reviewed:: 2022-09-30T09:28:23.982Z
+ card-last-score:: 5
+ - **Performance via Pipelining** is a particular pattern of **parallelism** that is so prevalent in computer architecture that it merits its own name.
+ - ### 5. Performance via **Prediction** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:27:10.532Z
+ card-last-reviewed:: 2022-10-03T14:27:10.533Z
+ card-last-score:: 5
+ - In some cases, it can be ^^faster on average to guess and start working^^ that to wait until you know for sure (assuming that the mechanism to recover from a misprediction is not too expensive, and your prediction is relatively accurate).
+ - ### 6. Hierarchy of Memories #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:35:13.824Z
+ card-last-reviewed:: 2022-10-01T17:35:13.824Z
+ card-last-score:: 3
+ - Computer Architects have found that they can address conflicting demands with a **hierarchy of memories**.
+ - The ^^fastest, smallest, & most expensive memory per bit^^ is at the top of the hierarchy.
+ - The ^^slowest, largest, & cheapest per bit^^ is at the bottom of the hierarchy.
+ - ### 7. Dependability via **Redundancy** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:35:28.794Z
+ card-last-reviewed:: 2022-10-01T17:35:28.794Z
+ card-last-score:: 5
+ - Since any physical device can fail, we make systems **dependable** by including ^^redundant components^^ that can take over when a failure occurs *and* help detect failures.
+ -
+- ## Hardware Organisation
+ - What does basic computer organisation look like? #card
+ collapsed:: true
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-11-22T23:24:24.522Z
+ card-last-reviewed:: 2022-10-20T08:24:24.523Z
+ card-last-score:: 5
+ - 
+ - What is an **integrated circuit**?
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-04T20:17:29.178Z
+ card-last-reviewed:: 2022-10-04T12:17:29.178Z
+ card-last-score:: 5
+ collapsed:: true
+ - An **integrated circuit**, also called a **chip**, is a device combining dozens to millions of transistors.
+ - ### The CPU
+ collapsed:: true
+ - What is a **CPU**? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:40:13.962Z
+ card-last-reviewed:: 2022-10-03T11:40:13.962Z
+ card-last-score:: 5
+ - The **Central Processing Unit (CPU)**, also called the **processor**, is the ^^active part of the computer^^, which contains the datapath & control, and which adds numbers, tests numbers, signals I/O devices to activate, and so on.
+ - The CPU is ^^responsible for executing programs.^^
+ - What are the steps that the CPU takes to process programs? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-02T21:45:06.768Z
+ card-last-reviewed:: 2022-10-10T11:45:06.768Z
+ card-last-score:: 5
+ - **1. Fetch:** Retrieve an instruction from ^^program memory.^^
+ - **2. Decode:** Break down the instruction into parts that have significance to specific sections of the CPU.
+ - **3. Execute:** Various portions of the CPU are connected to perform the desired operation.
+ - **4. Write Back:** Simply "writes back" the results of the execute step ^^if necessary.^^
+ - ### CPU Organisation
+ - What does the **organisation** of the CPU look like? #card
+ card-last-interval:: 15.05
+ card-repeats:: 4
+ card-ease-factor:: 1.94
+ card-next-schedule:: 2022-10-25T12:45:53.286Z
+ card-last-reviewed:: 2022-10-10T11:45:53.286Z
+ card-last-score:: 3
+ - Processors are made up of:
+ - A **Control Unit**
+ - **Execution Unit(s)**
+ - A **Register File**
+ - {:height 339, :width 418}
+ -
+ - #### Control Unit
+ - What does the **Control Unit** do? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:29:08.350Z
+ card-last-reviewed:: 2022-10-03T14:29:08.350Z
+ card-last-score:: 3
+ - The **Control Unit** ^^controls the execution^^ of the instructions stored in main memory.
+ - It ^^retrieves & executes^^ them.
+ - What is the architecture of the control unit? #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-27T18:42:33.523Z
+ card-last-reviewed:: 2022-10-10T11:42:33.524Z
+ card-last-score:: 3
+ - The control unit contains a **fetch unit**, a **decode unit**, and an **execute unit**.
+ - It also contains two special registers:
+ - **Program Counter (PC):** keeps the address of the next instruction
+ - **Instruction Register (IR):** keeps the instruction being executed
+ - {:height 266, :width 550}
+ -
+ - ### The Memory Subsystem
+ collapsed:: true
+ - How is the memory divided into storage locations? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:34:12.415Z
+ card-last-reviewed:: 2022-10-01T17:34:12.416Z
+ card-last-score:: 5
+ - Memory is divided into a set of storage location which can hold data.
+ - Locations are numbered.
+ - Addresses are used to tell the memory which location the processor wants to access.
+ - What are the two hierarchies of memory? #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T22:24:15.552Z
+ card-last-reviewed:: 2022-10-08T15:24:15.553Z
+ card-last-score:: 5
+ - **1. Nonvolatile / ROM (Read Only Memory):** Read only memory.
+ - Used to store the BIOS and / or a *bootstrap* or *bootloader* program.
+ - **2. Volatile / RAM (Random Access Memory):** Read / Write memory.
+ - Also called **Primary Memory**.
+ - Used to hold the programs, operating system, and data required by the computer.
+ - #### Primary Memory
+ - How is primary memory connected to the CPU? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:34.991Z
+ card-last-reviewed:: 2022-10-03T11:43:34.992Z
+ card-last-score:: 5
+ - **Primary Memory** is directly connected to the Central Processing Unit of the computer.
+ - It must be present for the CPU to function correctly.
+ - What are the three types of Primary Storage? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T10:20:18.031Z
+ card-last-reviewed:: 2022-10-07T10:20:18.032Z
+ card-last-score:: 3
+ - **1. Processor Register:**
+ - Contains information that the CPU needs to carry out the current instruction.
+ - **2. Cache Memory:**
+ - A special type of internal memory used by many CPUs to increase their **throughput**.
+ - **3. Main Memory:**
+ - Contains the programs that are currently being run and the data that the programs are operating on.
+ - What is the **address width**? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-12T18:33:12.074Z
+ card-last-reviewed:: 2022-10-20T08:33:12.074Z
+ card-last-score:: 3
+ - The **address width** is the number of bits used to represent an address in memory.
+ - The **width** limits the amount of memory that a computer can access.
+ - Most computers use a **64 bit address**, which means that the maximum number of locations is 2^{64} \approx 16 billion gigabytes.
+ - What operations does the memory subsystem support? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:30:33.402Z
+ card-last-reviewed:: 2022-10-01T17:30:33.403Z
+ card-last-score:: 5
+ - The memory subsystem supports two operations:
+ - **Load** (or read) + the address of the data location to be read.
+ - **Store** (or write) + the address of the location & the data to be written.
+ - How many bytes may the memory system read or write at a time? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T22:29:45.960Z
+ card-last-reviewed:: 2022-10-01T17:29:45.960Z
+ card-last-score:: 5
+ - Read & Write operations ^^operate at the width of the system's data bus^^, usually 32 bit or 64 bit.
+ - How is a section of memory addressed? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:24:14.775Z
+ card-last-reviewed:: 2022-10-01T13:24:14.776Z
+ card-last-score:: 5
+ - The address ^^contains only the address of the lowest byte^^, and a number of bytes to be read is specified, e.g., 4 bytes.
+ - #### Memory Alignment & Words of Data
+ - When the computer's **word size** is 4 bytes, the data to be read should be at a memory address which is ^^some multiple of four.^^
+ - When this is not the case, e.g., the data starts at address 14 instead of 16, then the computer has to read two or more 4 byte chunks and do some calculation before the requested data has been read, or it may generate ^^an alignment fault.^^
+ - Even though the previous data structure end is at, for example, address 13, the next data structure should start at address 16. Two **padding bytes** are inserted between the two data structures at addresses 14 & 15 to align the next data structure at address 16.
+ - ### The I/O Subsystem
+ - What are **input devices**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:40.506Z
+ card-last-reviewed:: 2022-09-30T12:11:40.507Z
+ card-last-score:: 5
+ - Anything that feeds data into the computer.
+ - What are **output devices**? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:12:09.769Z
+ card-last-reviewed:: 2022-09-30T12:12:09.770Z
+ card-last-score:: 5
+ - Display / transmit information back to the user.
+ - What does the **I/O Subsystem** contain? #card
+ collapsed:: true
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:38.831Z
+ card-last-reviewed:: 2022-09-30T12:11:38.832Z
+ card-last-score:: 5
+ - The **I/O Subsystem** contains the devices that the computer uses to communicate with the outside world and to store data.
+ - How do I/O devices communicate with the processor? #card
+ collapsed:: true
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T21:36:17.677Z
+ card-last-reviewed:: 2022-10-10T11:36:17.677Z
+ card-last-score:: 5
+ - I/O devices usually communicate with the processor using the **I/O Bus**.
+ - PCs use the **PCI Express (Peripheral Component Interconnect Express)** bus for their I/O bus.
+ - The Operating System needs a **device driver** to access a given I/O device.
+ - What is a **device driver**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:23:41.787Z
+ card-last-reviewed:: 2022-10-01T13:23:41.788Z
+ card-last-score:: 5
+ - A **device driver** is a program that allows the OS to control an I/O device.
+ - #### I/O Read / Write Operations
+ - The I/O read & write operations are similar to the memory read & write operations.
+ - How does the processor address I/O devices? #card
+ card-last-interval:: 7.76
+ card-repeats:: 3
+ card-ease-factor:: 1.94
+ card-next-schedule:: 2022-10-28T02:36:52.036Z
+ card-last-reviewed:: 2022-10-20T08:36:52.037Z
+ card-last-score:: 3
+ - A processor may use:
+ - **Memory-Mapped I/O:** when the address of the I/O device is in the **direct memory space**, and the ^^sequences to read/write data in the device are the same as the memory read/write sequences.^^
+ - **Isolated I/O:** similar process to Memory-Mapped I/O, but the processor has a ^^second set of control signals to distinguish between a **memory access** and am **I/O access**.^^
+ - What is **IO/M**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-16T16:39:35.254Z
+ card-last-reviewed:: 2022-10-07T10:39:35.254Z
+ card-last-score:: 5
+ - **IO/M** is a **status signal** in **Isolated I/O** that denotes whether the read/write operation pertains to the memory or to the I/O subsystem.
+ - When the **signal is low** (IO/M = 0), i.e., IO/M is `true`, it denotes **memory-related operations**.
+ - When the **signal is high**, (IO/M = 1), i.e., IO/M is `false`, it denotes an **I/O operation**.
+ -
+ -
+ -
+- ## Programs
+ - What are programs? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-11T18:29:21.265Z
+ card-last-reviewed:: 2022-10-01T13:29:21.266Z
+ card-last-score:: 5
+ - Programs are ^^sequences of instructions^^ that tell the computer what to do.
+ - To the computer, a program is made out of a ^^sequence of numbers that represent individual operations.^^
+ - These operations are known as **machine instructions** or just **instructions**.
+ - A set of instructions that a processor can execute is known as an **instruction set**.
+ - ### Program Development Tools
+ collapsed:: true
+ - What is a **high-level programming language**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:17:29.873Z
+ card-last-reviewed:: 2022-10-01T13:17:29.874Z
+ card-last-score:: 5
+ - A **high-level programming language** is a ^^portable language^^ such as C that is ^^composed of words & algebraic notation^^ that can be translated by a compiler into **assembly language**.
+ - What is a **compiler**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:12:39.064Z
+ card-last-reviewed:: 2022-09-30T12:12:39.064Z
+ card-last-score:: 5
+ - A **compiler** is a program that translates statements in a given high-level language into assembly language statements.
+ - What is an **assembler**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T17:19:13.686Z
+ card-last-reviewed:: 2022-10-01T13:19:13.686Z
+ card-last-score:: 5
+ - An **assembler** is a program that translates symbolic, assembly language versions of instructions into the ^^binary version.^^
+ - What is **Assembly Language**? #card
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-11-07T03:25:47.210Z
+ card-last-reviewed:: 2022-10-04T12:25:47.210Z
+ card-last-score:: 5
+ - **Assembly Language** is a ^^symbolic representation^^ of **machine instructions**.
+ - What is **Machine Language**? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-16T16:39:57.935Z
+ card-last-reviewed:: 2022-10-07T10:39:57.935Z
+ card-last-score:: 3
+ - **Machine Language** is a ^^binary representation^^ of **machine instructions**.
+ - What is an **instruction**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:20.118Z
+ card-last-reviewed:: 2022-10-03T11:37:20.118Z
+ card-last-score:: 5
+ - An **instruction** is a command that the computer hardware understands & obeys.
+ -
+- ## Operating Systems
+ - What is an **Operating System**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-11T10:38:21.429Z
+ card-last-reviewed:: 2022-10-07T10:38:21.431Z
+ card-last-score:: 3
+ - Possible definition: a program that runs on the computer that ^^knows about all the hardware^^ and usually ^^runs in privileged mode^^, having ^^access to physical resources that user programs can't control^^, and has the ^^ability to start & stop user programs.^^
+ - The OS is responsible for managing the physical resources of complex systems, such as PCs, workstations, mainframe computers, etc.
+ - It is also responsible for ^^loading & executing programs^^ and ^^interfacing with the users.^^
+ - Usually, there is no operating system for **small embedded systems**.
+ - Computers designed for one specific task.
+ -
+ - ### Multiprogramming
+ - What is **Multiprogramming**? #card
+ card-last-interval:: 28.3
+ card-repeats:: 4
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-11-17T15:33:42.952Z
+ card-last-reviewed:: 2022-10-20T08:33:42.952Z
+ card-last-score:: 5
+ - **Multiprogramming** is a technique that allows the system to ^^present the illusion that multiple programs are running on the computer simultaneously.^^
+ - Many multiprogrammed computers are **multiuser**.
+ - They allow multiple users to be logged in at a time.
+ - How is multiprogramming achieved? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-12T21:35:33.411Z
+ card-last-reviewed:: 2022-10-01T17:35:33.411Z
+ card-last-score:: 5
+ - Multiprogramming is achieved by ^^switching rapidly between programs.^^
+ - How does the processor decide which process to execute next? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:37:46.365Z
+ card-last-reviewed:: 2022-10-03T11:37:46.366Z
+ card-last-score:: 3
+ - **FCFS - First Come, First Served:** processes are moved to the CPU in the order in which they arrive.
+ - **SJN - Shortest Job Next:** looks at all processes in the **ready state** and dispatches the one with the smallest service time.
+ - **Round Robin:** distributes the processing time equitably among all ready processes.
+ - ### Context Switching
+ - What is a **Context Switch**? #card
+ card-last-interval:: 23.43
+ card-repeats:: 4
+ card-ease-factor:: 2.42
+ card-next-schedule:: 2022-11-12T18:37:16.898Z
+ card-last-reviewed:: 2022-10-20T08:37:16.898Z
+ card-last-score:: 5
+ - When a program timeslice ends, the OS stops it, removes it, and gives another program control over the processor.
+ - This is a **context switch**.
+ - How does the OS go about a Context Switch? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T18:37:36.618Z
+ card-last-reviewed:: 2022-10-03T11:37:36.618Z
+ card-last-score:: 3
+ - copies the current program register file into memory
+ - restores the contents of the next program's register file into the processor
+ - starts executing the next program
+ - From the program point of view, ^^no program can tell that a context switch has been performed.^^
+ - ### Protection
+ - Three rules of Protection in multiprogrammed computers: #card
+ card-last-interval:: 17.31
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-20T21:34:44.306Z
+ card-last-reviewed:: 2022-10-03T14:34:44.306Z
+ card-last-score:: 3
+ - 1. The result of any program running on the multiprogram computer ^^must be the same as if the program was the only program running on the computer.^^
+ - 2. Programs ^^must not be able to access other programs' data^^ and must be confident that their data will not be modified by other programs (for security and privacy).
+ - 3. Programs ^^must not interfere with other programs' use of I/O devices.^^
+ - How is protection achieved? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-15T17:20:10.955Z
+ card-last-reviewed:: 2022-10-07T10:20:10.955Z
+ card-last-score:: 3
+ - Protection is achieved by the ^^operating system having full control over the resources of the system (processor, memory, and I/O devices)^^ through:
+ - **Privileged Mode:** the operating system is the only one that can control the physical resources it executes in privileged mode.
+ - User programs execute in **user mode**.
+ - **Virtual Memory:** each program operates as if it were the only program on the computer, occupying a full set of the address space in its virtual space.
+ - The OS is *translating* memory addresses that the program references into physical addresses used by the memory system.
+ -
+-
+- **Next Topic:** [[Programming Models]]
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Principle of Inclusion-Exclusion/2022-09-30T08_54_51.910Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Principle of Inclusion-Exclusion/2022-09-30T08_54_51.910Z.Desktop.md
new file mode 100644
index 00000000..435fb041
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Principle of Inclusion-Exclusion/2022-09-30T08_54_51.910Z.Desktop.md
@@ -0,0 +1,70 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Counting]]
+- **Next Topic:**
+- **Relevant Slides:** 
+-
+- (Aside) **Notation for Complement:** $A^C$ for some set $A$.
+- ## Counting with Sets
+ - ### Additive Principle for Sets
+ - #### Additive Principle in terms of "events"
+ - If Event $A$ can occur $m$ ways, and Event $B$ can occur $n$ (disjoint / independent) ways, then event "$A$ *or* $B$" can occur in $m+n$ ways.
+ - But, an "event" can just be expressed as ^^selecting an element of a set.^^
+ - Saying "Event $A$ can occur $m$ ways" is ^^the same^^ as saying "$|A|=m$".
+ - Saying "Event $B$ can occur $n$ ways is the same as saying "$|B|=n$".
+ - If events $A$ and $B$ are **disjoint** / independent, that means that $|A \cap B| = 0$, or, equivalently , $A \cap B = \emptyset$.
+ -
+ - What is the **Additive Principle for Sets**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T19:24:25.898Z
+ card-last-reviewed:: 2022-09-14T19:24:25.898Z
+ card-last-score:: 3
+ - Given two sets $A$ and $B$ with $|A \cap B| = 0$, then:
+ - $$|A \cup B| = |A| + |B|$$
+ - ### Multiplicative Principle for Sets
+ - What is the **Cartesian Product** of two sets? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-09-29T22:50:05.793Z
+ card-last-reviewed:: 2022-09-19T17:50:05.793Z
+ card-last-score:: 5
+ - The **Cartesian Product** of two sets, $A$ and $B$ is:
+ - $$A \times B = \{(x,y) : x \in A \text{ and } y \in B \}$$
+ - This is the set of pairs where the first term in each pair comes from $A$, **and** the second term in each pair comes from $B$.
+ - #### Multiplicative Principle in terms of "events"
+ - If event $A$ can occur $m$ ways, and each possibility allows for $B$ to occur in $n$ (disjoint) ways, then event "$A$ **and** $B$" can occur in $m \times n$ ways.
+ - What is the **Multiplicative Principle for Sets**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:34:12.562Z
+ card-last-reviewed:: 2022-09-19T18:34:12.563Z
+ card-last-score:: 5
+ - Given two sets, $A$ and $B$:
+ - $$|A \times B| = |A| \cdot |B|$$
+ - This extends to 3 or more sets in the obvious way.
+- ## The Principle of Inclusion & Exclusion (PIE)
+ - What is the **Principle of Inclusion & Exclusion**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-30T12:18:17.188Z
+ card-last-reviewed:: 2022-09-26T12:18:17.188Z
+ card-last-score:: 5
+ - For any two finite sets $A$ and $B$:
+ - $$|A \cup B| = |A| + |B| - |A \cap B|$$
+ - This also extends to larger numbers of sets, for example:
+ - For any 3 finite sets $A$, $B$, and $C$:
+ - $$|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C |$$
+- ## Subsets & Power Sets
+ - What is a **power set**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T17:49:45.527Z
+ card-last-reviewed:: 2022-09-19T17:49:45.527Z
+ card-last-score:: 5
+ - The **power set** of a set $A$, denoted by $P(A)$, is the ^^set of all subsets^^ of $A$, ^^including the empty set^^ ($\emptyset$).
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Principle of Inclusion-Exclusion/2022-09-30T10_01_42.359Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Principle of Inclusion-Exclusion/2022-09-30T10_01_42.359Z.Desktop.md
new file mode 100644
index 00000000..435fb041
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Principle of Inclusion-Exclusion/2022-09-30T10_01_42.359Z.Desktop.md
@@ -0,0 +1,70 @@
+- #[[MA284 - Discrete Mathematics]]
+- **Previous Topic:** [[Counting]]
+- **Next Topic:**
+- **Relevant Slides:** 
+-
+- (Aside) **Notation for Complement:** $A^C$ for some set $A$.
+- ## Counting with Sets
+ - ### Additive Principle for Sets
+ - #### Additive Principle in terms of "events"
+ - If Event $A$ can occur $m$ ways, and Event $B$ can occur $n$ (disjoint / independent) ways, then event "$A$ *or* $B$" can occur in $m+n$ ways.
+ - But, an "event" can just be expressed as ^^selecting an element of a set.^^
+ - Saying "Event $A$ can occur $m$ ways" is ^^the same^^ as saying "$|A|=m$".
+ - Saying "Event $B$ can occur $n$ ways is the same as saying "$|B|=n$".
+ - If events $A$ and $B$ are **disjoint** / independent, that means that $|A \cap B| = 0$, or, equivalently , $A \cap B = \emptyset$.
+ -
+ - What is the **Additive Principle for Sets**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T19:24:25.898Z
+ card-last-reviewed:: 2022-09-14T19:24:25.898Z
+ card-last-score:: 3
+ - Given two sets $A$ and $B$ with $|A \cap B| = 0$, then:
+ - $$|A \cup B| = |A| + |B|$$
+ - ### Multiplicative Principle for Sets
+ - What is the **Cartesian Product** of two sets? #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-09-29T22:50:05.793Z
+ card-last-reviewed:: 2022-09-19T17:50:05.793Z
+ card-last-score:: 5
+ - The **Cartesian Product** of two sets, $A$ and $B$ is:
+ - $$A \times B = \{(x,y) : x \in A \text{ and } y \in B \}$$
+ - This is the set of pairs where the first term in each pair comes from $A$, **and** the second term in each pair comes from $B$.
+ - #### Multiplicative Principle in terms of "events"
+ - If event $A$ can occur $m$ ways, and each possibility allows for $B$ to occur in $n$ (disjoint) ways, then event "$A$ **and** $B$" can occur in $m \times n$ ways.
+ - What is the **Multiplicative Principle for Sets**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:34:12.562Z
+ card-last-reviewed:: 2022-09-19T18:34:12.563Z
+ card-last-score:: 5
+ - Given two sets, $A$ and $B$:
+ - $$|A \times B| = |A| \cdot |B|$$
+ - This extends to 3 or more sets in the obvious way.
+- ## The Principle of Inclusion & Exclusion (PIE)
+ - What is the **Principle of Inclusion & Exclusion**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-30T12:18:17.188Z
+ card-last-reviewed:: 2022-09-26T12:18:17.188Z
+ card-last-score:: 5
+ - For any two finite sets $A$ and $B$:
+ - $$|A \cup B| = |A| + |B| - |A \cap B|$$
+ - This also extends to larger numbers of sets, for example:
+ - For any 3 finite sets $A$, $B$, and $C$:
+ - $$|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C |$$
+- ## Subsets & Power Sets
+ - What is a **power set**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T17:49:45.527Z
+ card-last-reviewed:: 2022-09-19T17:49:45.527Z
+ card-last-score:: 5
+ - The **power set** of a set $A$, denoted by $P(A)$, is the ^^set of all subsets^^ of $A$, ^^including the empty set^^ ($\emptyset$).
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-10-07T08_33_33.355Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-10-07T08_33_33.355Z.Desktop.md
new file mode 100644
index 00000000..89183ae6
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-10-07T08_33_33.355Z.Desktop.md
@@ -0,0 +1,136 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Sampling]]
+- **Next Topic:** [[Random Variables]]
+- **Relevant Slides:** 
+-
+- Probability provides the *framework* for the study & application of statistics.
+- # What are Probabilities?
+ - Take, for example, a 6-sided die about to be tossed for the first time.
+ - **Classical:** 6 possible outcomes, by symmetry, each equally likely to occur,
+ - **Frequentist:** Empirical evidence shows that similar dice thrown in the past have landed on each side about equally often.
+ - **Subjective:** The degree of individual belief in occurrence of an event can be influenced by classical or frequentist arguments.
+ - Subjective probabilities are also influenced by other reasons when symmetry arguments don't apply & repeated trials are not possible.
+-
+- # Probability
+ - The probability of an event $A$ is the number of (equally likely & disjoint) outcomes in the event divided by the total number of (equally likely & disjoint) possible outcomes.
+ - $$P(A) = \frac{\text{\# of outcomes in A}}{\text{\# of possible outcomes}}$$
+ - $$(0 \leq P(A) \leq 1)$$
+ - ## Sample Spaces
+ - What is a **sample space**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-03T08:36:59.497Z
+ card-last-reviewed:: 2022-09-29T08:36:59.498Z
+ card-last-score:: 5
+ - The set of all possible outcomes of a random experiment is called the **sample space**, $S$.
+ - $S$ is **discrete** if it consists of a finite or countably infinite set of outcomes.
+ - $S$ is **continuous** if it contains an interval of real numbers.
+ - $$P(S) = 1$$
+ - ## Events
+ - What is an **event**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T09:40:11.548Z
+ card-last-reviewed:: 2022-10-06T09:40:11.549Z
+ card-last-score:: 3
+ - An **event** is a specific collection of sample points / possible outcomes.
+ - An event is denoted by $E$ or by capital letters, $A$, $B$, etc.
+ - What is a **SImple Event**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:11:11.353Z
+ card-last-score:: 1
+ - A **Simple Event** is a collection of only **one** sample point / possible outcomes.
+ - What is a **Compound Event**? #card
+ card-last-interval:: 3.84
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-04T04:30:13.004Z
+ card-last-reviewed:: 2022-09-30T08:30:13.004Z
+ card-last-score:: 5
+ - A **Compound Event** is a collection of **more than one** sample point / possible outcomes.
+ - ## Permuatations
+ - A **permutation** is an arrangement of objects.
+ - It can also be an arrangement of $r$ objects chosen from $n$ distinct objects where replacement in the selection is not allowed.
+ - The symbol, $P^n_r$ represents the number of permutations of $r$ objects selected from $n$ objects.
+ - The calculation is given by the formula:
+ - $$P^n_r = \frac{n!}{(n-r)!}$$
+ - ## Joint Events (and / or)
+ - Probabilities of **joint events** can often be determined from the probabilities of the individual events that comprise them.
+ - Joint events are generated by applying basic set operations to individual events, specifically:
+ - **Complement** of event $A$ is $\bar{A} =$ all outcomes *not* in $A$.
+ - **Union** of events $A \cup B$; $A$ **or** $B$ or both.
+ - **Intersection** of events $A$ **and** $B$ -> $A \cap B$.
+ - **Disjoint** events cannot occur together -> $A \cap B = \empty$.
+ -
+- ## Probability of a Union ($A$ **or** $B$) #card
+ card-last-interval:: 1.62
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-06T02:32:21.829Z
+ card-last-reviewed:: 2022-10-04T12:32:21.830Z
+ card-last-score:: 3
+ - For any two events $A$ and $B$, the probability of union is given by:
+ - $$P(A \cup B) = P(A) + P(B) - P(A \cap B)$$
+ - For two **disjoint** (also called **mutually exclusive**) events $A$ and $B$, the probability that one *or* the other occurs is the sum of the probabilities of the two events (provided that $A$ and $B$ are disjoint).
+ - $$P(A \cup B) = P(A) + P(B)$$
+ - If $P(A \cup B)$ is greater than 1, then you know you have made a mistake and that the events were not mutually exclusive -> there is an intersection.
+- ## Intersections ($A$ **and** $B$)
+ card-last-interval:: 3.51
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T00:26:58.336Z
+ card-last-reviewed:: 2022-10-04T12:26:58.337Z
+ card-last-score:: 5
+ - #### Multiplication Rule for Independent Events #card
+ card-last-interval:: 3.84
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-04T04:37:30.498Z
+ card-last-reviewed:: 2022-09-30T08:37:30.499Z
+ card-last-score:: 5
+ - For two **independent** events $A$ and $B$, the probability that *both* $A$ **and** $B$ occur is the product of the probabilities of the two events.
+ - $$P(A \cap B) = P(A) \times P(B)$$
+ - If two events are **independent**, that means that one event has no impact on the probability of occurrence of the other event.
+- ## Conditional Probability #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:31:44.517Z
+ card-last-score:: 1
+ - $P(B | A)$ is the probability of event $B$ occurring, given that event $A$ has already occurred.
+ - The **conditional probability** of $B$ given $A$, denoted by $P(B | A)$, is defined by:
+ - $$P(B|A) = \frac{P(A \cap B)}{P(A)} \text{, provided } P(A) > 0$$
+ - **Note:** $P(A)$ cannot equal 0, since we know that $A$ *has* occurred.
+ - ### General Multiplication Rule for Dependent Events
+ - The conditional probability can be rewritten to further generalise the multiplication rule:
+ - $$P(A \cap B) = P(A) \cdot P(B|A)$$
+ - $$P(B \cap A) = P(B)B \cdot P(B|A)$$
+ - $$\text{As } P(A \cap B) = P(B \cap A) \text{ implies}$$
+ - $$P(A) \cdot P(B | A) = P(B) \cdot P(A |B)$$
+ - These results mean that $P(A |B)$ can be calculated once we know $P(A)$, $P(B)$, and $P(B | A)$.
+ - #### Bayes' Theorem #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T09:45:39.727Z
+ card-last-score:: 1
+ - **Bayes' Theorem** states that:
+ - $$P(A | B) = \frac{P(B | A) \cdot P(A)}{P(B)} \text{ for } P(B)>0$$
+- ## Independence
+ - Two events, $A$ and $B$ are independent, if and only if:
+ - $$P(A \cap B) = P(A)\cdot P(B)$$
+ - Therefore, to obtain the probability that two independent events will occur, we simply find the product of their individual probabilities.
+ - Two events $A$ and $B$ are independent, if and only if:
+ - $$P(B | A) = P(B) \text{ or } P(A|B) = P(A)$$
+ - assuming the existence of the conditional probabilities.
+ - Otherwise, $A$ and $B$ are **dependent**.
+ - If in an experiment, the events $A$ and $B$ can both occur, then:
+ - $$P(A \cap B) = P(A)P(B|A) \text{, provided } P(A) > 0$$
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-10-10T11_59_52.444Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-10-10T11_59_52.444Z.Desktop.md
new file mode 100644
index 00000000..871b923d
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-10-10T11_59_52.444Z.Desktop.md
@@ -0,0 +1,149 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Sampling]]
+- **Next Topic:** [[Random Variables]]
+- **Relevant Slides:** 
+-
+- Probability provides the *framework* for the study & application of statistics.
+- # What are Probabilities?
+ - Take, for example, a 6-sided die about to be tossed for the first time.
+ - **Classical:** 6 possible outcomes, by symmetry, each equally likely to occur,
+ - **Frequentist:** Empirical evidence shows that similar dice thrown in the past have landed on each side about equally often.
+ - **Subjective:** The degree of individual belief in occurrence of an event can be influenced by classical or frequentist arguments.
+ - Subjective probabilities are also influenced by other reasons when symmetry arguments don't apply & repeated trials are not possible.
+-
+- # Probability
+ - The probability of an event $A$ is the number of (equally likely & disjoint) outcomes in the event divided by the total number of (equally likely & disjoint) possible outcomes.
+ - $$P(A) = \frac{\text{\# of outcomes in A}}{\text{\# of possible outcomes}}$$
+ - $$(0 \leq P(A) \leq 1)$$
+ - ## Sample Spaces
+ - What is a **sample space**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-12T15:07:56.387Z
+ card-last-reviewed:: 2022-10-08T15:07:56.387Z
+ card-last-score:: 5
+ - The set of all possible outcomes of a random experiment is called the **sample space**, $S$.
+ - $S$ is **discrete** if it consists of a finite or countably infinite set of outcomes.
+ - $S$ is **continuous** if it contains an interval of real numbers.
+ - $$P(S) = 1$$
+ - ## Events
+ - What is an **event**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T09:40:11.548Z
+ card-last-reviewed:: 2022-10-06T09:40:11.549Z
+ card-last-score:: 3
+ - An **event** is a specific collection of sample points / possible outcomes.
+ - An event is denoted by $E$ or by capital letters, $A$, $B$, etc.
+ - What is a **SImple Event**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T23:00:00.000Z
+ card-last-reviewed:: 2022-10-09T08:51:51.247Z
+ card-last-score:: 1
+ - A **Simple Event** is a collection of only **one** sample point / possible outcomes.
+ - What is a **Compound Event**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T17:15:57.407Z
+ card-last-reviewed:: 2022-10-06T17:15:57.408Z
+ card-last-score:: 3
+ - A **Compound Event** is a collection of **more than one** sample point / possible outcomes.
+ - ## Permuatations
+ - A **permutation** is an arrangement of objects.
+ - It can also be an arrangement of $r$ objects chosen from $n$ distinct objects where replacement in the selection is not allowed.
+ - The symbol, $P^n_r$ represents the number of permutations of $r$ objects selected from $n$ objects.
+ - The calculation is given by the formula:
+ - $$P^n_r = \frac{n!}{(n-r)!}$$
+ - ## Joint Events (and / or)
+ - Probabilities of **joint events** can often be determined from the probabilities of the individual events that comprise them.
+ - Joint events are generated by applying basic set operations to individual events, specifically:
+ - **Complement** of event $A$ is $\bar{A} =$ all outcomes *not* in $A$.
+ - **Union** of events $A \cup B$; $A$ **or** $B$ or both.
+ - **Intersection** of events $A$ **and** $B$ -> $A \cap B$.
+ - **Disjoint** events cannot occur together -> $A \cap B = \empty$.
+ -
+- ## Probability of a Union ($A$ **or** $B$) #card
+ card-last-interval:: 8.38
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-15T19:46:22.379Z
+ card-last-reviewed:: 2022-10-07T10:46:22.380Z
+ card-last-score:: 5
+ - For any two events $A$ and $B$, the probability of union is given by:
+ - $$P(A \cup B) = P(A) + P(B) - P(A \cap B)$$
+ - For two **disjoint** (also called **mutually exclusive**) events $A$ and $B$, the probability that one *or* the other occurs is the sum of the probabilities of the two events (provided that $A$ and $B$ are disjoint).
+ - $$P(A \cup B) = P(A) + P(B)$$
+ - If $P(A \cup B)$ is greater than 1, then you know you have made a mistake and that the events were not mutually exclusive -> there is an intersection.
+- ## Intersections ($A$ **and** $B$)
+ card-last-interval:: 3.51
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T00:26:58.336Z
+ card-last-reviewed:: 2022-10-04T12:26:58.337Z
+ card-last-score:: 5
+ - #### Multiplication Rule for Independent Events #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-18T14:24:58.694Z
+ card-last-reviewed:: 2022-10-07T10:24:58.695Z
+ card-last-score:: 5
+ - For two **independent** events $A$ and $B$, the probability that *both* $A$ **and** $B$ occur is the product of the probabilities of the two events.
+ - $$P(A \cap B) = P(A) \times P(B)$$
+ - If two events are **independent**, that means that one event has no impact on the probability of occurrence of the other event.
+- ## Conditional Probability
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-04T12:31:44.517Z
+ - What is **conditional probability**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:31:25.004Z
+ card-last-score:: 1
+ - $P(B | A)$ is the probability of event $B$ occurring, given that event $A$ has already occurred.
+ - The **conditional probability** of $B$ given $A$, denoted by $P(B | A)$, is defined by:
+ - $$P(B|A) = \frac{P(A \cap B)}{P(A)} \text{, provided } P(A) > 0$$
+ - **Note:** $P(A)$ cannot equal 0, since we know that $A$ *has* occurred.
+ - ### General Multiplication Rule for Dependent Events #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T09:57:45.051Z
+ card-last-reviewed:: 2022-10-08T14:57:45.052Z
+ card-last-score:: 5
+ - The conditional probability can be rewritten to further generalise the multiplication rule:
+ - $$P(A \cap B) = P(A) \cdot P(B|A)$$
+ - $$P(B \cap A) = P(B)B \cdot P(B|A)$$
+ - $$\text{As } P(A \cap B) = P(B \cap A) \text{ implies}$$
+ - $$P(A) \cdot P(B | A) = P(B) \cdot P(A |B)$$
+ - These results mean that $P(A |B)$ can be calculated once we know $P(A)$, $P(B)$, and $P(B | A)$.
+ - #### Bayes' Theorem #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T17:20:39.188Z
+ card-last-reviewed:: 2022-10-07T10:20:39.189Z
+ card-last-score:: 3
+ - **Bayes' Theorem** states that:
+ - $$P(A | B) = \frac{P(B | A) \cdot P(A)}{P(B)} \text{ for } P(B)>0$$
+- ## Independence
+ - Two events, $A$ and $B$ are independent, if and only if:
+ - $$P(A \cap B) = P(A)\cdot P(B)$$
+ - Therefore, to obtain the probability that two independent events will occur, we simply find the product of their individual probabilities.
+ - Two events $A$ and $B$ are independent, if and only if:
+ - $$P(B | A) = P(B) \text{ or } P(A|B) = P(A)$$
+ - assuming the existence of the conditional probabilities.
+ - Otherwise, $A$ and $B$ are **dependent**.
+ - If in an experiment, the events $A$ and $B$ can both occur, then:
+ - $$P(A \cap B) = P(A)P(B|A) \text{, provided } P(A) > 0$$
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-10-20T09_05_57.977Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-10-20T09_05_57.977Z.Desktop.md
new file mode 100644
index 00000000..097b1666
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-10-20T09_05_57.977Z.Desktop.md
@@ -0,0 +1,155 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Sampling]]
+- **Next Topic:** [[Random Variables]]
+- **Relevant Slides:** 
+-
+- Probability provides the *framework* for the study & application of statistics.
+- # What are Probabilities?
+ - Take, for example, a 6-sided die about to be tossed for the first time.
+ - **Classical:** 6 possible outcomes, by symmetry, each equally likely to occur,
+ - **Frequentist:** Empirical evidence shows that similar dice thrown in the past have landed on each side about equally often.
+ - **Subjective:** The degree of individual belief in occurrence of an event can be influenced by classical or frequentist arguments.
+ - Subjective probabilities are also influenced by other reasons when symmetry arguments don't apply & repeated trials are not possible.
+-
+- # Probability
+ - The probability of an event $A$ is the number of (equally likely & disjoint) outcomes in the event divided by the total number of (equally likely & disjoint) possible outcomes.
+ - $$P(A) = \frac{\text{\# of outcomes in A}}{\text{\# of possible outcomes}}$$
+ - $$(0 \leq P(A) \leq 1)$$
+ - ## Sample Spaces
+ - What is a **sample space**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-12T15:07:56.387Z
+ card-last-reviewed:: 2022-10-08T15:07:56.387Z
+ card-last-score:: 5
+ - The set of all possible outcomes of a random experiment is called the **sample space**, $S$.
+ - $S$ is **discrete** if it consists of a finite or countably infinite set of outcomes.
+ - $S$ is **continuous** if it contains an interval of real numbers.
+ - $$P(S) = 1$$
+ - ## Events
+ - What is an **event**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T09:40:11.548Z
+ card-last-reviewed:: 2022-10-06T09:40:11.549Z
+ card-last-score:: 3
+ - An **event** is a specific collection of sample points / possible outcomes.
+ - An event is denoted by $E$ or by capital letters, $A$, $B$, etc.
+ - What is a **SImple Event**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T23:00:00.000Z
+ card-last-reviewed:: 2022-10-09T08:51:51.247Z
+ card-last-score:: 1
+ - A **Simple Event** is a collection of only **one** sample point / possible outcomes.
+ - What is a **Compound Event**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T17:15:57.407Z
+ card-last-reviewed:: 2022-10-06T17:15:57.408Z
+ card-last-score:: 3
+ - A **Compound Event** is a collection of **more than one** sample point / possible outcomes.
+ - ## Permuatations
+ - A **permutation** is an arrangement of objects.
+ - It can also be an arrangement of $r$ objects chosen from $n$ distinct objects where replacement in the selection is not allowed.
+ - The symbol, $P^n_r$ represents the number of permutations of $r$ objects selected from $n$ objects.
+ - The calculation is given by the formula:
+ - $$P^n_r = \frac{n!}{(n-r)!}$$
+ - ## Joint Events (and / or)
+ - Probabilities of **joint events** can often be determined from the probabilities of the individual events that comprise them.
+ - Joint events are generated by applying basic set operations to individual events, specifically:
+ - **Complement** of event $A$ is $\bar{A} =$ all outcomes *not* in $A$.
+ - **Union** of events $A \cup B$; $A$ **or** $B$ or both.
+ - **Intersection** of events $A$ **and** $B$ -> $A \cap B$.
+ - **Disjoint** events cannot occur together -> $A \cap B = \empty$.
+ -
+- ## Probability of a Union ($A$ **or** $B$) #card
+ card-last-interval:: 8.38
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-15T19:46:22.379Z
+ card-last-reviewed:: 2022-10-07T10:46:22.380Z
+ card-last-score:: 5
+ - For any two events $A$ and $B$, the probability of union is given by:
+ - $$P(A \cup B) = P(A) + P(B) - P(A \cap B)$$
+ - For two **disjoint** (also called **mutually exclusive**) events $A$ and $B$, the probability that one *or* the other occurs is the sum of the probabilities of the two events (provided that $A$ and $B$ are disjoint).
+ - $$P(A \cup B) = P(A) + P(B)$$
+ - If $P(A \cup B)$ is greater than 1, then you know you have made a mistake and that the events were not mutually exclusive -> there is an intersection.
+- ## Intersections ($A$ **and** $B$)
+ card-last-interval:: 3.51
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T00:26:58.336Z
+ card-last-reviewed:: 2022-10-04T12:26:58.337Z
+ card-last-score:: 5
+ - #### Multiplication Rule for Independent Events #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-18T14:24:58.694Z
+ card-last-reviewed:: 2022-10-07T10:24:58.695Z
+ card-last-score:: 5
+ - For two **independent** events $A$ and $B$, the probability that *both* $A$ **and** $B$ occur is the product of the probabilities of the two events.
+ - $$P(A \cap B) = P(A) \times P(B)$$
+ - If two events are **independent**, that means that one event has no impact on the probability of occurrence of the other event.
+- ## Conditional Probability
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-04T12:31:44.517Z
+ - What is **conditional probability**? #card
+ card-last-interval:: 0.81
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-11T06:39:23.513Z
+ card-last-reviewed:: 2022-10-10T11:39:23.513Z
+ card-last-score:: 3
+ - $P(B | A)$ is the probability of event $B$ occurring, given that event $A$ has already occurred.
+ - The **conditional probability** of $B$ given $A$, denoted by $P(B | A)$, is defined by: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:35:35.409Z
+ card-last-score:: 1
+ - $$P(B|A) = \frac{P(A \cap B)}{P(A)} \text{, provided } P(A) > 0$$
+ - **Note:** $P(A)$ cannot equal 0, since we know that $A$ *has* occurred.
+ - ### General Multiplication Rule for Dependent Events #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T09:57:45.051Z
+ card-last-reviewed:: 2022-10-08T14:57:45.052Z
+ card-last-score:: 5
+ - The conditional probability can be rewritten to further generalise the multiplication rule:
+ - $$P(A \cap B) = P(A) \cdot P(B|A)$$
+ - $$P(B \cap A) = P(B)B \cdot P(B|A)$$
+ - $$\text{As } P(A \cap B) = P(B \cap A) \text{ implies}$$
+ - $$P(A) \cdot P(B | A) = P(B) \cdot P(A |B)$$
+ - These results mean that $P(A |B)$ can be calculated once we know $P(A)$, $P(B)$, and $P(B | A)$.
+ - #### Bayes' Theorem #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T17:20:39.188Z
+ card-last-reviewed:: 2022-10-07T10:20:39.189Z
+ card-last-score:: 3
+ - **Bayes' Theorem** states that:
+ - $$P(A | B) = \frac{P(B | A) \cdot P(A)}{P(B)} \text{ for } P(B)>0$$
+- ## Independence
+ - Two events, $A$ and $B$ are independent, if and only if:
+ - $$P(A \cap B) = P(A)\cdot P(B)$$
+ - Therefore, to obtain the probability that two independent events will occur, we simply find the product of their individual probabilities.
+ - Two events $A$ and $B$ are independent, if and only if:
+ - $$P(B | A) = P(B) \text{ or } P(A|B) = P(A)$$
+ - assuming the existence of the conditional probabilities.
+ - Otherwise, $A$ and $B$ are **dependent**.
+ - If in an experiment, the events $A$ and $B$ can both occur, then:
+ - $$P(A \cap B) = P(A)P(B|A) \text{, provided } P(A) > 0$$
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-11-11T12_04_45.364Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-11-11T12_04_45.364Z.Desktop.md
new file mode 100644
index 00000000..be5b6e39
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Probability/2022-11-11T12_04_45.364Z.Desktop.md
@@ -0,0 +1,155 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Sampling]]
+- **Next Topic:** [[Random Variables]]
+- **Relevant Slides:** 
+-
+- Probability provides the *framework* for the study & application of statistics.
+- # What are Probabilities?
+ - Take, for example, a 6-sided die about to be tossed for the first time.
+ - **Classical:** 6 possible outcomes, by symmetry, each equally likely to occur,
+ - **Frequentist:** Empirical evidence shows that similar dice thrown in the past have landed on each side about equally often.
+ - **Subjective:** The degree of individual belief in occurrence of an event can be influenced by classical or frequentist arguments.
+ - Subjective probabilities are also influenced by other reasons when symmetry arguments don't apply & repeated trials are not possible.
+-
+- # Probability
+ - The probability of an event $A$ is the number of (equally likely & disjoint) outcomes in the event divided by the total number of (equally likely & disjoint) possible outcomes.
+ - $$P(A) = \frac{\text{\# of outcomes in A}}{\text{\# of possible outcomes}}$$
+ - $$(0 \leq P(A) \leq 1)$$
+ - ## Sample Spaces
+ - What is a **sample space**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-12T15:07:56.387Z
+ card-last-reviewed:: 2022-10-08T15:07:56.387Z
+ card-last-score:: 5
+ - The set of all possible outcomes of a random experiment is called the **sample space**, $S$.
+ - $S$ is **discrete** if it consists of a finite or countably infinite set of outcomes.
+ - $S$ is **continuous** if it contains an interval of real numbers.
+ - $$P(S) = 1$$
+ - ## Events
+ - What is an **event**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:30:25.650Z
+ card-last-score:: 1
+ - An **event** is a specific collection of sample points / possible outcomes.
+ - An event is denoted by $E$ or by capital letters, $A$, $B$, etc.
+ - What is a **SImple Event**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:28:43.077Z
+ card-last-score:: 1
+ - A **Simple Event** is a collection of only **one** sample point / possible outcomes.
+ - What is a **Compound Event**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:34:49.368Z
+ card-last-score:: 1
+ - A **Compound Event** is a collection of **more than one** sample point / possible outcomes.
+ - ## Permuatations
+ - A **permutation** is an arrangement of objects.
+ - It can also be an arrangement of $r$ objects chosen from $n$ distinct objects where replacement in the selection is not allowed.
+ - The symbol, $P^n_r$ represents the number of permutations of $r$ objects selected from $n$ objects.
+ - The calculation is given by the formula:
+ - $$P^n_r = \frac{n!}{(n-r)!}$$
+ - ## Joint Events (and / or)
+ - Probabilities of **joint events** can often be determined from the probabilities of the individual events that comprise them.
+ - Joint events are generated by applying basic set operations to individual events, specifically:
+ - **Complement** of event $A$ is $\bar{A} =$ all outcomes *not* in $A$.
+ - **Union** of events $A \cup B$; $A$ **or** $B$ or both.
+ - **Intersection** of events $A$ **and** $B$ -> $A \cap B$.
+ - **Disjoint** events cannot occur together -> $A \cap B = \empty$.
+ -
+- ## Probability of a Union ($A$ **or** $B$) #card
+ card-last-interval:: 8.38
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-15T19:46:22.379Z
+ card-last-reviewed:: 2022-10-07T10:46:22.380Z
+ card-last-score:: 5
+ - For any two events $A$ and $B$, the probability of union is given by:
+ - $$P(A \cup B) = P(A) + P(B) - P(A \cap B)$$
+ - For two **disjoint** (also called **mutually exclusive**) events $A$ and $B$, the probability that one *or* the other occurs is the sum of the probabilities of the two events (provided that $A$ and $B$ are disjoint).
+ - $$P(A \cup B) = P(A) + P(B)$$
+ - If $P(A \cup B)$ is greater than 1, then you know you have made a mistake and that the events were not mutually exclusive -> there is an intersection.
+- ## Intersections ($A$ **and** $B$)
+ card-last-interval:: 3.51
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T00:26:58.336Z
+ card-last-reviewed:: 2022-10-04T12:26:58.337Z
+ card-last-score:: 5
+ - #### Multiplication Rule for Independent Events #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-18T14:24:58.694Z
+ card-last-reviewed:: 2022-10-07T10:24:58.695Z
+ card-last-score:: 5
+ - For two **independent** events $A$ and $B$, the probability that *both* $A$ **and** $B$ occur is the product of the probabilities of the two events.
+ - $$P(A \cap B) = P(A) \times P(B)$$
+ - If two events are **independent**, that means that one event has no impact on the probability of occurrence of the other event.
+- ## Conditional Probability
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-04T12:31:44.517Z
+ - What is **conditional probability**? #card
+ card-last-interval:: 0.81
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-11T06:39:23.513Z
+ card-last-reviewed:: 2022-10-10T11:39:23.513Z
+ card-last-score:: 3
+ - $P(B | A)$ is the probability of event $B$ occurring, given that event $A$ has already occurred.
+ - The **conditional probability** of $B$ given $A$, denoted by $P(B | A)$, is defined by: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:35:35.409Z
+ card-last-score:: 1
+ - $$P(B|A) = \frac{P(A \cap B)}{P(A)} \text{, provided } P(A) > 0$$
+ - **Note:** $P(A)$ cannot equal 0, since we know that $A$ *has* occurred.
+ - ### General Multiplication Rule for Dependent Events #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T09:57:45.051Z
+ card-last-reviewed:: 2022-10-08T14:57:45.052Z
+ card-last-score:: 5
+ - The conditional probability can be rewritten to further generalise the multiplication rule:
+ - $$P(A \cap B) = P(A) \cdot P(B|A)$$
+ - $$P(B \cap A) = P(B)B \cdot P(B|A)$$
+ - $$\text{As } P(A \cap B) = P(B \cap A) \text{ implies}$$
+ - $$P(A) \cdot P(B | A) = P(B) \cdot P(A |B)$$
+ - These results mean that $P(A |B)$ can be calculated once we know $P(A)$, $P(B)$, and $P(B | A)$.
+ - #### Bayes' Theorem #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:36:28.145Z
+ card-last-score:: 1
+ - **Bayes' Theorem** states that:
+ - $$P(A | B) = \frac{P(B | A) \cdot P(A)}{P(B)} \text{ for } P(B)>0$$
+- ## Independence
+ - Two events, $A$ and $B$ are independent, if and only if:
+ - $$P(A \cap B) = P(A)\cdot P(B)$$
+ - Therefore, to obtain the probability that two independent events will occur, we simply find the product of their individual probabilities.
+ - Two events $A$ and $B$ are independent, if and only if:
+ - $$P(B | A) = P(B) \text{ or } P(A|B) = P(A)$$
+ - assuming the existence of the conditional probabilities.
+ - Otherwise, $A$ and $B$ are **dependent**.
+ - If in an experiment, the events $A$ and $B$ can both occur, then:
+ - $$P(A \cap B) = P(A)P(B|A) \text{, provided } P(A) > 0$$
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-10-07T08_33_33.358Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-10-07T08_33_33.358Z.Desktop.md
new file mode 100644
index 00000000..5fb3d6c8
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-10-07T08_33_33.358Z.Desktop.md
@@ -0,0 +1,382 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[System Software & Operating Systems]]
+- **Next Topic:** [[CPU Management - Scheduling]]
+- **Relevant Slides:** 
+-
+- # Programs & Processes
+ - What is a **Program**? #card
+ card-last-interval:: 3.58
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-03T21:33:22.211Z
+ card-last-reviewed:: 2022-09-30T08:33:22.211Z
+ card-last-score:: 3
+ - A **Program** is a static entity made up of source program language statements that define process behaviour when executed on a set of data.
+ - What is a **Process**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:08:45.876Z
+ card-last-score:: 1
+ - A **Process** is a dynamic entity that executes a program on a particular set of data using resources allocated by the system.
+ - Two or more processes could execute the same program, each using its own data & resources.
+ - It is a program in execution.
+ - It is composed of:
+ - Program.
+ - Data.
+ - **Process Control Block (PCB)**: contains the state of the process in execution.
+ - ## Process Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:08:33.702Z
+ card-last-score:: 1
+ - In order to execute, a process needs an **Abstract Machine Environment** to manage its use of resources.
+ - The **Process Control Block (PCB)** is required to map the environment state onto the physical machine state.
+ - The OS keeps a **process descriptor** for each process.
+ - 
+ - ## Program Execution #card
+ collapsed:: true
+ card-last-interval:: 4.14
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T15:09:05.962Z
+ card-last-reviewed:: 2022-10-04T12:09:05.963Z
+ card-last-score:: 5
+ - Each execution of a program generates a process that is executed.
+ - Inter-process relationships:
+ - **Competition:** Processes are trying to get access to the same resources of the system, therefore a protection between processes is necessary.
+ - **Cooperation:** Sometimes the processes need to communicate between themselves and exchange information - synchronisation is needed.
+ - ## Process Manager #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-04T12:27:50.598Z
+ - What does the **Process Manager** do? #card
+ - The **Process Manager** implements:
+ - **CPU Sharing** (called *scheduling*): Allocate resources to processes in conformance with certain policies.
+ - **Process Synchronisation** & **Inter-Process Communication**: Deadlock strategies & protection mechanisms.
+ - 
+ - ## Process - User Perspective
+ - When processes are executed in a quasi-parallel fashion, the processes need to synchronise to each other for correct functionality - this is done with directives `wait`/`signal`.
+ - `wait`- wait for a signal from a specific process.
+ - `signal` - send a signal to a specific process.
+ - ## Process - OS Perspective #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:27:24.029Z
+ card-last-score:: 1
+ - The processor's principle function is to execute machine instruction residing in main memory.
+ - These instructions are provided in the form of *programs*.
+ - A processor may interleave the execution of a number of programs over time.
+ - ### Program View
+ - Its execution involves a sequence of instructions within that progam.
+ - The behaviour of individual processes can be characterised by a sequence of instructions.
+ - The ***trace*** of the process.
+ - ### Processor View
+ - The processor executes instructions from main memory, as dictated by changing values in the Program Counter (PC) register.
+ - The behaviour of the processor can be characterised by showing how the traces of various processes are **interleaved**.
+ - ## State Process Models
+ - ### Two-State Process Model #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:29:09.773Z
+ card-last-score:: 1
+ - The process can be in one of two states: *running* or not *running*.
+ - When the OS creates a new process, it enters into the *not running* state; after that, the process exists - it is known to the OS and waits for the opportunity to run.
+ - From time to time, the currently running process will be interrupted and the dispatcher process will select a new process to run.
+ - The new process will be moved to the *running* state and the former one to the *not running* state.
+ - #### Two-State Model Queuing Discipline #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:32:31.055Z
+ card-last-score:: 1
+ - Each process needs to be represented.
+ - Information relating to each process, including current state & location in memory.
+ - Waiting processes should be kept in some kind of queue.
+ - List of pointers to processes blocks.
+ - Linked list of data blocks, each block representing a process.
+ - Dispatcher behaviour:
+ - An interrupted process is transferred to the *waiting queue*.
+ - If the process is completed or aborted, it is discarded.
+ - The dispatcher selects a process from the queue to execute.
+ - ### Five-State Process Model #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T08:36:59.227Z
+ card-last-score:: 1
+ - **Running:** The process is currently being executed.
+ - For single-processor systems, one single process can be in this state at a time.
+ - **Ready:** The process is prepared to execute when given the turn.
+ - **Blocked:** The process cannot execute until some event occurs.
+ - Such as the completion of an I/O operation.
+ - **New:** The process has been created, but has not yet been accepted in the pool of executable processes by the OS.
+ - Typically, a new process has not yet been loaded into main memory.
+ - **Exit:** The process has been released from the pool of executable processes by the OS.
+ - Completed or due to some errors.
+ - #### Five-State Model Process Transition Diagram
+ - 
+ - #### Five-State Model Queuing Discipline #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:34:27.587Z
+ card-last-score:: 1
+ - There are two queues: the *ready queue* & the *blocked queue*.
+ - When a process is admitted into the system, it is placed in the *ready* queue.
+ - When a process is removed from the processor, it is either placed in the *ready* queue or the *blocked* queue, depending on the circumstances.
+ - When an event occurs, all the processes waiting on that event are moved from the *blocked* queue into the *ready* queue.
+ - 
+ - Multiple *blocked* queues, one per event.
+ - When the event occurs, the entire list of processes is moved in ready queue.
+ - 
+ - #### Suspended Processes #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T08:34:48.405Z
+ card-last-score:: 1
+ - The processor is faster than I/O so all the processes could be waiting for I/O.
+ - You can swap these processes to the disk to free up some memory.
+ - The *blocked* state becomes the *suspended* state when swapped to the disk.
+ - 
+ - ## Process Creation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-30T23:00:00.000Z
+ card-last-reviewed:: 2022-09-30T12:11:54.821Z
+ card-last-score:: 1
+ - Creation of new processes:
+ - The OS builds the data structures that are used to manage the process.
+ - The OS allocates space in main memory to the process.
+ - Reasons for process creation:
+ - New batch job.
+ - Interactive logon.
+ - Created by OS to provide a service.
+ - i.e., process to control printing.
+ - Spawned by existing process.
+ - i.e., to exploit parallelism.
+ - ## Process Termination #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-03T08:35:58.103Z
+ card-last-reviewed:: 2022-09-29T08:35:58.104Z
+ card-last-score:: 5
+ - Reasons for **Process Termination**:
+ - Process finished its execution (*natural completion*).
+ - Total time limit exceeded.
+ - Errors (memory unavailable, arithmetic error, protection error, invalid instruction, privileged instruction, I/O failure, etc.).
+ - ## Process Management Services #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-06T23:00:00.000Z
+ card-last-reviewed:: 2022-10-06T09:41:15.822Z
+ card-last-score:: 1
+ - `create(&process_id, attributes)`
+ - Creates a new process with implicit or specified attributes.
+ - `delete(process_id)`
+ - Sometimes known as `destroy`, `terminate`, or `exit`.
+ - Ends the process specified by `process_id`.
+ - Whenever the process is terminated, all the files are closed, and all the allocated resources are released.
+ - `abort(process_id)`
+ - The same as `delete` but for *abnormal termination*.
+ - Usually generates a "**post-mortem dump**" which contains the state of the process before the abnormal termination.
+ - `suspend(process_id)`
+ - Puts the specified process into a **suspended** state.
+ - `resume(process_id)`
+ - Moves the specified process from the *suspended* state to the *ready* state.
+ - `delay(process_id, time)`
+ - Suspends the specified process for a specified period of time.
+ - After the delay time elapses, the process is moved to the ready state.
+ - `get_attribtutes(process_id, &buffer_attributes)`
+ - Used to find out the attributes for the given process.
+ - `set_attributes(process_id, buffer_attributes)`
+ - Used to set the attributes of the specified process.
+ -
+ - ## Process Description
+ - ### OS Control Structures #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:31:12.441Z
+ card-last-score:: 1
+ - #### Memory Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:32:38.582Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Memory Tables** are used to keep track of both main (real) and secondary (virtual) memory.
+ collapsed:: true
+ - Some of the main memory is reserved for use by the OS, the remainder is available to the processes.
+ - Memory Tables contain:
+ - The allocation of main memory to processes.
+ - The allocation of secondary memory to processes.
+ - Any *protection* attributes of blocks of main or virtual memory (such as which processes can access certain shared memory regions).
+ - Any information needed to manage virtual memory.
+ - #### I/O Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:33:28.722Z
+ card-last-score:: 1
+ collapsed:: true
+ - **I/O Tables** are used by the OS to manage the I/O devices.
+ - At any given time, an I/O device may be available or assigned to a particular process.
+ - If an I/O operation is in progress, the OS needs to know the status of the I/O operation and the location in main memory being used as the source or destination of the I/O transfer.
+ - #### File Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:27:44.241Z
+ card-last-score:: 1
+ collapsed:: true
+ - **File Tables** provide information about:
+ - The existence of files.
+ - Their location in secondary memory.
+ - Their current status.
+ - Other attributes.
+ - Much of this information is maintained & managed by the **File Manager**, in which case the process manager has little or no knowledge of files.
+ - ### Process Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:29:00.152Z
+ card-last-score:: 1
+ collapsed:: true
+ - The **Primary Process Table** is used to keep one entry per each process in the operating system.
+ - Each entry contains at least one pointer to a process image.
+ - ### Process Image #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:30:55.694Z
+ card-last-score:: 1
+ collapsed:: true
+ - The **Process Image** contains:
+ - **Stack**
+ collapsed:: true
+ - Each process has one or more stack(s) associated with it.
+ - A **stack** is used to store parameters & calling addresses for procedure & system calls.
+ - **User Data**
+ collapsed:: true
+ - Program data that can be modified, etc.
+ - **Process Control Block** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-06T23:00:00.000Z
+ card-last-reviewed:: 2022-10-06T09:39:34.791Z
+ card-last-score:: 1
+ collapsed:: true
+ - Data needed by the OS to control the process (attributes & information about the process).
+ - Contains:
+ - **Process Identification:** The data always includes a unique identifier for the process.
+ - Numeric identifiers that may be stored with the **Process Control Block** include the **identifier of this process**, the **identifier of the process that created this process** (parent process), and the **User Identifier**.
+ - **Processor State Information:** Defines the status of a process when it is suspended.
+ - **User-Visible Registers** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:26:29.496Z
+ card-last-score:: 1
+ - A **user-visible register** is one that may be referenced by means of the machine language that the processor executes.
+ - **Control & Status Registers** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:26:25.898Z
+ card-last-score:: 1
+ - These are a variety of processor registers that are employed to control the operation of the processor. These include:
+ - **Program Counter:** Contains the address of the next instruction to be fetched.
+ - **Condition Codes:** Result of the most recent arithmetic or logical operation.
+ - **Status Information:** Includes interrupt enabled/disabled flags, execution mode.
+ - **Stack Pointers**
+ - Each process has one or more LIFO system stacks associated with it. A stack is used to store parameters & calling addresses for procedure & system calls.
+ - The stack pointer points to the top of the stack.
+ - **Processor Control Information:** Used by the OS to manage the process.
+ - **Scheduling & State Information** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-04T23:00:00.000Z
+ card-last-reviewed:: 2022-10-04T12:31:53.205Z
+ card-last-score:: 1
+ - This is information that is needed by the operating system to perform its scheduling function. Typical items of information include:
+ - **Process State:** Defines the readiness of the process to be scheduled for execution (e.g., running, ready, waiting, halted).
+ - **Priority:** One or more fields may be used to describe the scheduling priority of the process. In some systems, several values are required (e.g., default, current, highest-allowable).
+ - **Scheduling-Related Information:** This will depend on the scheduling algorithm used. Examples are the amount of time that the process has been waiting an the amount of time that the process executed the last time it was running.
+ - **Event:** Identity of the even the process is awaiting before it can be resumed.
+ - **Data Structuring:** A process may be linked to another process in a queue or other structure.
+ - **Inter-Process Communication:** Various flags, signals, & messages may be associated with communication between two independent processes.
+ - **Process Privileges:** Processes are granted privileges in terms of the memory that may be accessed and the types of instruction that may be executed. In addition, privileges may apply to the use of system utilities & services.
+ - **Memory Management:** This section may include pointers to segment and/or page tables that describe the virtual memory assigned to this process.
+ - **Resource Ownership & Utilisation:** resources controlled by the processes may be indicated, such as opened files. A history of utilisation of the processor or other resources may also be included.
+ - This information may be needed by the scheduler.
+ -
+- ## Threads & Processes
+ - A **process** is sometimes defined as a *heavyweight process*.
+ - A **thread** is defined as a *lightweight process*.
+ - Separate two ideas:
+ - **Process:** Ownership of memory, files, other resources.
+ - Execution of applications.
+ - **Thread:** Unit of execution we use to dispatch.
+ - Share the same address space hence we can read from and write to the same data structures.
+ - What is **multithreading**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-03T08:36:50.414Z
+ card-last-reviewed:: 2022-09-29T08:36:50.415Z
+ card-last-score:: 3
+ - **Multithreading** allows multiple threads per process.
+ - What is a **thread**? #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-03T08:36:25.598Z
+ card-last-reviewed:: 2022-09-29T08:36:25.599Z
+ card-last-score:: 5
+ - A **thread** is a unit of computation associated with a particular heavyweight process, using many of the associated process's resources.
+ - It has a minimum of internal state & a minimum of allocated resources.
+ - A group of threads are share the same resources.
+ - e.g., files, memory space, etc.
+ - The **process** is the execution environment for a family of threads.
+ - A process with one thread is a **classic process**.
+ - Each thread has an individual execution state.
+ - Each thread has a control block, with a state (Running / Blocked / etc.), saved registers, an instruction pointer.
+ - There is a separate stack & hardware state (PC, registers, PSW, etc.) per thread.
+ - Shares memory & files with other threads that are in that process.
+ - Faster to create a thread than a process.
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-10-10T11_59_52.461Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-10-10T11_59_52.461Z.Desktop.md
new file mode 100644
index 00000000..bfd5d682
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-10-10T11_59_52.461Z.Desktop.md
@@ -0,0 +1,407 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[System Software & Operating Systems]]
+- **Next Topic:** [[CPU Management - Scheduling]]
+- **Relevant Slides:** 
+-
+- # Programs & Processes
+ - What is a **Program**? #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:36:52.575Z
+ card-last-reviewed:: 2022-10-07T10:36:52.575Z
+ card-last-score:: 5
+ - A **Program** is a static entity made up of source program language statements that define process behaviour when executed on a set of data.
+ - What is a **Process**? #card
+ collapsed:: true
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T17:43:52.870Z
+ card-last-reviewed:: 2022-10-08T22:43:52.870Z
+ card-last-score:: 5
+ - A **Process** is a dynamic entity that executes a program on a particular set of data using resources allocated by the system.
+ - Two or more processes could execute the same program, each using its own data & resources.
+ - It is a ^^program in execution.^^
+ - It is composed of:
+ - Program.
+ - Data.
+ - **Process Control Block (PCB)**: contains the state of the process in execution.
+ - ## Process Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:41:19.088Z
+ card-last-score:: 1
+ - In order to execute, a process needs an **Abstract Machine Environment** to manage its use of resources.
+ - The **Process Control Block (PCB)** is required to map the environment state onto the physical machine state.
+ - The OS keeps a **process descriptor** for each process.
+ - 
+ - ## Program Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-09T23:00:00.000Z
+ card-last-reviewed:: 2022-10-09T08:50:46.333Z
+ card-last-score:: 1
+ - Each execution of a program generates a process that is executed.
+ - Inter-process relationships:
+ - **Competition:** Processes are trying to get access to the same resources of the system, therefore a protection between processes is necessary.
+ - **Cooperation:** Sometimes the processes need to communicate between themselves and exchange information - synchronisation is needed.
+ - ## Process Manager #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-08T22:40:54.081Z
+ - What does the **Process Manager** do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:27:40.512Z
+ card-last-score:: 1
+ - The **Process Manager** implements:
+ - **CPU Sharing** (called *scheduling*): Allocate resources to processes in conformance with certain policies.
+ - **Process Synchronisation** & **Inter-Process Communication**: Deadlock strategies & protection mechanisms.
+ - 
+ - ## Process - User Perspective
+ - When processes are executed in a quasi-parallel fashion, the processes need to synchronise to each other for correct functionality - this is done with directives `wait`/`signal`.
+ - `wait`- wait for a signal from a specific process.
+ - `signal` - send a signal to a specific process.
+ - ## Process - OS Perspective #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:46:39.454Z
+ card-last-score:: 1
+ - The processor's principle function is to execute machine instruction residing in main memory.
+ - These instructions are provided in the form of *programs*.
+ - A processor may interleave the execution of a number of programs over time.
+ - ### Program View
+ - Its execution involves a sequence of instructions within that progam.
+ - The behaviour of individual processes can be characterised by a sequence of instructions called the ***trace*** of the process.
+ - ### Processor View
+ - The processor executes instructions from main memory, as dictated by changing values in the Program Counter (PC) register.
+ - The behaviour of the processor can be characterised by showing how the traces of various processes are **interleaved**.
+ - ## State Process Models
+ - ### Two-State Process Model #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T17:19:36.319Z
+ card-last-reviewed:: 2022-10-07T10:19:36.319Z
+ card-last-score:: 3
+ - The process can be in one of two states: *running* or not *running*.
+ - When the OS creates a new process, it enters into the *not running* state; after that, the process exists - it is known to the OS and waits for the opportunity to run.
+ - From time to time, the currently running process will be interrupted and the dispatcher process will select a new process to run.
+ - The new process will be moved to the *running* state and the former one to the *not running* state.
+ - #### Two-State Model Queuing Discipline #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:00:41.408Z
+ card-last-score:: 1
+ - Each process needs to be represented.
+ - Information relating to each process, including current state & location in memory.
+ - Waiting processes should be kept in some kind of queue.
+ - List of pointers to processes blocks.
+ - Linked list of data blocks, each block representing a process.
+ - Dispatcher behaviour:
+ - An interrupted process is transferred to the *waiting queue*.
+ - If the process is completed or aborted, it is discarded.
+ - The dispatcher selects a process from the queue to execute.
+ - ### Five-State Process Model #card
+ card-last-interval:: 0.91
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T19:42:23.004Z
+ card-last-reviewed:: 2022-10-08T22:42:23.004Z
+ card-last-score:: 3
+ - **Running:** The process is currently being executed.
+ - For single-processor systems, one single process can be in this state at a time.
+ - **Ready:** The process is prepared to execute when given the turn.
+ - **Blocked:** The process cannot execute until some event occurs.
+ - Such as the completion of an I/O operation.
+ - **New:** The process has been created, but has not yet been accepted in the pool of executable processes by the OS.
+ - Typically, a new process has not yet been loaded into main memory.
+ - **Exit:** The process has been released from the pool of executable processes by the OS.
+ - Completed or due to some errors.
+ - #### Five-State Model Process Transition Diagram
+ - 
+ - #### Five-State Model Queuing Discipline #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:22:11.677Z
+ card-last-score:: 1
+ - There are two queues: the **ready queue** & the **blocked queue**.
+ - When a process is admitted into the system, it is placed in the **ready** queue.
+ - When a process is removed from the processor, it is either placed in the **ready** queue or the **blocked** queue, depending on the circumstances.
+ - When an event occurs, all the processes waiting on that event are moved from the **blocked** queue into the **ready** queue.
+ - 
+ - There are multiple **blocked** queues - one per event.
+ - When the event occurs, the entire list of processes is moved to the **ready** queue.
+ - 
+ - #### Suspended Processes #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:29:42.351Z
+ card-last-score:: 1
+ - The processor is faster than I/O so all the processes could be waiting for I/O.
+ - You can swap these processes to the disk to free up some memory.
+ - The *blocked* state becomes the *suspended* state when swapped to the disk.
+ - 
+ - ## Process Creation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:44:02.345Z
+ card-last-score:: 1
+ - Creation of new processes:
+ - The OS builds the data structures that are used to manage the process.
+ - The OS allocates space in main memory to the process.
+ - Reasons for process creation:
+ - New batch job.
+ - Interactive logon.
+ - Created by OS to provide a service.
+ - i.e., process to control printing.
+ - Spawned by existing process.
+ - i.e., to exploit parallelism.
+ - ## Process Termination
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.6
+ card-last-reviewed:: 2022-10-08T15:27:20.789Z
+ - Reasons for **Process Termination**: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:30:13.715Z
+ card-last-score:: 1
+ - Process finished its execution (*natural completion*).
+ - Total time limit exceeded.
+ - Errors (memory unavailable, arithmetic error, protection error, invalid instruction, privileged instruction, I/O failure, etc.).
+ - ## Process Management Services #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-12T15:26:09.797Z
+ card-last-reviewed:: 2022-10-08T15:26:09.797Z
+ card-last-score:: 5
+ - `create(&process_id, attributes)`
+ - Creates a new process with implicit or specified attributes.
+ - `delete(process_id)`
+ - Sometimes known as `destroy`, `terminate`, or `exit`.
+ - Ends the process specified by `process_id`.
+ - Whenever the process is terminated, all the files are closed, and all the allocated resources are released.
+ - `abort(process_id)`
+ - The same as `delete` but for *abnormal termination*.
+ - Usually generates a "**post-mortem dump**" which contains the state of the process before the abnormal termination.
+ - `suspend(process_id)`
+ - Puts the specified process into a **suspended** state.
+ - `resume(process_id)`
+ - Moves the specified process from the *suspended* state to the *ready* state.
+ - `delay(process_id, time)`
+ - Suspends the specified process for a specified period of time.
+ - After the delay time elapses, the process is moved to the ready state.
+ - `get_attribtutes(process_id, &buffer_attributes)`
+ - Used to find out the attributes for the given process.
+ - `set_attributes(process_id, buffer_attributes)`
+ - Used to set the attributes of the specified process.
+ -
+ - ## Process Description
+ - ### OS Control Structures #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:31:35.247Z
+ card-last-score:: 1
+ - #### Memory Tables #card
+ card-last-interval:: 0.88
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T12:00:59.222Z
+ card-last-reviewed:: 2022-10-08T15:00:59.222Z
+ card-last-score:: 3
+ collapsed:: true
+ - **Memory Tables** are used to keep track of both main (real) and secondary (virtual) memory.
+ collapsed:: true
+ - Some of the main memory is reserved for use by the OS, the remainder is available to the processes.
+ - Memory Tables contain:
+ - The allocation of main memory to processes.
+ - The allocation of secondary memory to processes.
+ - Any *protection* attributes of blocks of main or virtual memory (such as which processes can access certain shared memory regions).
+ - Any information needed to manage virtual memory.
+ - #### I/O Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:41:04.228Z
+ card-last-score:: 1
+ collapsed:: true
+ - **I/O Tables** are used by the OS to manage the I/O devices.
+ - At any given time, an I/O device may be available or assigned to a particular process.
+ - If an I/O operation is in progress, the OS needs to know the status of the I/O operation and the location in main memory being used as the source or destination of the I/O transfer.
+ - #### File Tables #card
+ card-last-interval:: 0.98
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T21:41:12.468Z
+ card-last-reviewed:: 2022-10-08T22:41:12.469Z
+ card-last-score:: 3
+ collapsed:: true
+ - **File Tables** provide information about:
+ - The existence of files.
+ - Their location in secondary memory.
+ - Their current status.
+ - Other attributes.
+ - Much of this information is maintained & managed by the **File Manager**, in which case the process manager has little or no knowledge of files.
+ - ### Process Tables
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:23:42.819Z
+ collapsed:: true
+ - What is the **Primary Process Table**? #card
+ card-last-interval:: 0.76
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-09T09:09:02.595Z
+ card-last-reviewed:: 2022-10-08T15:09:02.596Z
+ card-last-score:: 3
+ - The **Primary Process Table** keeps one entry per each process in the operating system.
+ - Each entry contains at least one pointer to a **process image**.
+ - ### Process Image #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:17:26.136Z
+ card-last-score:: 1
+ collapsed:: true
+ - The **Process Image** contains:
+ - **Stack**
+ collapsed:: true
+ - Each process has one or more stack(s) associated with it.
+ - A **stack** is used to store parameters & calling addresses for procedure & system calls.
+ - **User Data**
+ collapsed:: true
+ - Program data that can be modified, etc.
+ - **Process Control Block** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:19:11.892Z
+ card-last-score:: 1
+ collapsed:: true
+ - Data needed by the OS to control the process (attributes & information about the process).
+ - Contains:
+ - **Process Identification:** The data always includes a unique identifier for the process.
+ - Numeric identifiers that may be stored with the **Process Control Block** include the **identifier of this process**, the **identifier of the process that created this process** (parent process), and the **User Identifier**.
+ - **Processor State Information:** Defines the status of a process when it is suspended.
+ - **User-Visible Registers**
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-08T15:22:36.520Z
+ - What is a **User-Visible Register**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:40:27.702Z
+ card-last-score:: 1
+ - A **user-visible register** is one that may be referenced by means of the machine language that the processor executes.
+ - **Control & Status Registers** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:24:28.838Z
+ card-last-score:: 1
+ - These are a variety of processor registers that are employed to control the operation of the processor. These include:
+ - **Program Counter:** Contains the address of the next instruction to be fetched.
+ - **Condition Codes:** Result of the most recent arithmetic or logical operation.
+ - **Status Information:** Includes interrupt enabled/disabled flags, execution mode.
+ - **Stack Pointers**
+ - Each process has one or more LIFO system stacks associated with it. A stack is used to store parameters & calling addresses for procedure & system calls.
+ - The stack pointer points to the top of the stack.
+ - **Processor Control Information:** Used by the OS to manage the process.
+ - **Scheduling & State Information** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:17:18.163Z
+ card-last-score:: 1
+ - This is information that is needed by the operating system to perform its scheduling function. Typical items of information include:
+ - **Process State:** Defines the readiness of the process to be scheduled for execution (e.g., running, ready, waiting, halted).
+ - **Priority:** One or more fields may be used to describe the scheduling priority of the process. In some systems, several values are required (e.g., default, current, highest-allowable).
+ - **Scheduling-Related Information:** This will depend on the scheduling algorithm used. Examples are the amount of time that the process has been waiting an the amount of time that the process executed the last time it was running.
+ - **Event:** Identity of the even the process is awaiting before it can be resumed.
+ - **Data Structuring:** A process may be linked to another process in a queue or other structure.
+ - **Inter-Process Communication:** Various flags, signals, & messages may be associated with communication between two independent processes.
+ - **Process Privileges:** Processes are granted privileges in terms of the memory that may be accessed and the types of instruction that may be executed. In addition, privileges may apply to the use of system utilities & services.
+ - **Memory Management:** This section may include pointers to segment and/or page tables that describe the virtual memory assigned to this process.
+ - **Resource Ownership & Utilisation:** resources controlled by the processes may be indicated, such as opened files. A history of utilisation of the processor or other resources may also be included.
+ - This information may be needed by the scheduler.
+ -
+- ## Threads & Processes
+ - A **process** is sometimes defined as a *heavyweight process*.
+ - A **thread** is defined as a *lightweight process*.
+ - Separate two ideas:
+ - **Process:** Ownership of memory, files, other resources.
+ - Execution of applications.
+ - **Thread:** Unit of execution we use to dispatch.
+ - Share the same address space hence we can read from and write to the same data structures.
+ - What is **multithreading**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T17:25:59.409Z
+ card-last-reviewed:: 2022-10-06T17:25:59.409Z
+ card-last-score:: 5
+ - **Multithreading** allows multiple threads per process.
+ - What is a **thread**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:17:23.106Z
+ card-last-reviewed:: 2022-10-07T10:17:23.106Z
+ card-last-score:: 5
+ - A **thread** is a unit of computation associated with a particular heavyweight process, using many of the associated process's resources.
+ - It has a minimum of internal state & a minimum of allocated resources.
+ - A group of threads are share the same resources.
+ - e.g., files, memory space, etc.
+ - The **process** is the execution environment for a family of threads.
+ - A process with one thread is a **classic process**.
+ - Each thread has an individual execution state.
+ - Each thread has a control block, with a state (Running / Blocked / etc.), saved registers, an instruction pointer.
+ - There is a separate stack & hardware state (PC, registers, PSW, etc.) per thread.
+ - Shares memory & files with other threads that are in that process.
+ - Faster to create a thread than a process.
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-10-20T09_05_57.980Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-10-20T09_05_57.980Z.Desktop.md
new file mode 100644
index 00000000..d582d703
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-10-20T09_05_57.980Z.Desktop.md
@@ -0,0 +1,407 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[System Software & Operating Systems]]
+- **Next Topic:** [[CPU Management - Scheduling]]
+- **Relevant Slides:** 
+-
+- # Programs & Processes
+ - What is a **Program**? #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:36:52.575Z
+ card-last-reviewed:: 2022-10-07T10:36:52.575Z
+ card-last-score:: 5
+ - A **Program** is a static entity made up of source program language statements that define process behaviour when executed on a set of data.
+ - What is a **Process**? #card
+ collapsed:: true
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T17:43:52.870Z
+ card-last-reviewed:: 2022-10-08T22:43:52.870Z
+ card-last-score:: 5
+ - A **Process** is a dynamic entity that executes a program on a particular set of data using resources allocated by the system.
+ - Two or more processes could execute the same program, each using its own data & resources.
+ - It is a ^^program in execution.^^
+ - It is composed of:
+ - Program.
+ - Data.
+ - **Process Control Block (PCB)**: contains the state of the process in execution.
+ - ## Process Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:40:47.581Z
+ card-last-score:: 1
+ - In order to execute, a process needs an **Abstract Machine Environment** to manage its use of resources.
+ - The **Process Control Block (PCB)** is required to map the environment state onto the physical machine state.
+ - The OS keeps a **process descriptor** for each process.
+ - 
+ - ## Program Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-09T23:00:00.000Z
+ card-last-reviewed:: 2022-10-09T08:50:46.333Z
+ card-last-score:: 1
+ - Each execution of a program generates a process that is executed.
+ - Inter-process relationships:
+ - **Competition:** Processes are trying to get access to the same resources of the system, therefore a protection between processes is necessary.
+ - **Cooperation:** Sometimes the processes need to communicate between themselves and exchange information - synchronisation is needed.
+ - ## Process Manager #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-10T11:40:40.339Z
+ - What does the **Process Manager** do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:37:57.867Z
+ card-last-score:: 1
+ - The **Process Manager** implements:
+ - **CPU Sharing** (called *scheduling*): Allocate resources to processes in conformance with certain policies.
+ - **Process Synchronisation** & **Inter-Process Communication**: Deadlock strategies & protection mechanisms.
+ - 
+ - ## Process - User Perspective
+ - When processes are executed in a quasi-parallel fashion, the processes need to synchronise to each other for correct functionality - this is done with directives `wait`/`signal`.
+ - `wait`- wait for a signal from a specific process.
+ - `signal` - send a signal to a specific process.
+ - ## Process - OS Perspective #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:41:58.996Z
+ card-last-score:: 1
+ - The processor's principle function is to execute machine instruction residing in main memory.
+ - These instructions are provided in the form of *programs*.
+ - A processor may interleave the execution of a number of programs over time.
+ - ### Program View
+ - Its execution involves a sequence of instructions within that progam.
+ - The behaviour of individual processes can be characterised by a sequence of instructions called the ***trace*** of the process.
+ - ### Processor View
+ - The processor executes instructions from main memory, as dictated by changing values in the Program Counter (PC) register.
+ - The behaviour of the processor can be characterised by showing how the traces of various processes are **interleaved**.
+ - ## State Process Models
+ - ### Two-State Process Model #card
+ card-last-interval:: 3.33
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T17:19:36.319Z
+ card-last-reviewed:: 2022-10-07T10:19:36.319Z
+ card-last-score:: 3
+ - The process can be in one of two states: *running* or not *running*.
+ - When the OS creates a new process, it enters into the *not running* state; after that, the process exists - it is known to the OS and waits for the opportunity to run.
+ - From time to time, the currently running process will be interrupted and the dispatcher process will select a new process to run.
+ - The new process will be moved to the *running* state and the former one to the *not running* state.
+ - #### Two-State Model Queuing Discipline #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:32:41.255Z
+ card-last-score:: 1
+ - Each process needs to be represented.
+ - Information relating to each process, including current state & location in memory.
+ - Waiting processes should be kept in some kind of queue.
+ - List of pointers to processes blocks.
+ - Linked list of data blocks, each block representing a process.
+ - Dispatcher behaviour:
+ - An interrupted process is transferred to the *waiting queue*.
+ - If the process is completed or aborted, it is discarded.
+ - The dispatcher selects a process from the queue to execute.
+ - ### Five-State Process Model #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:45:28.816Z
+ card-last-score:: 1
+ - **Running:** The process is currently being executed.
+ - For single-processor systems, one single process can be in this state at a time.
+ - **Ready:** The process is prepared to execute when given the turn.
+ - **Blocked:** The process cannot execute until some event occurs.
+ - Such as the completion of an I/O operation.
+ - **New:** The process has been created, but has not yet been accepted in the pool of executable processes by the OS.
+ - Typically, a new process has not yet been loaded into main memory.
+ - **Exit:** The process has been released from the pool of executable processes by the OS.
+ - Completed or due to some errors.
+ - #### Five-State Model Process Transition Diagram
+ - 
+ - #### Five-State Model Queuing Discipline #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:36:55.805Z
+ card-last-score:: 1
+ - There are two types of queues: the **ready queue** & the **blocked queue**.
+ - When a process is admitted into the system, it is placed in the **ready** queue.
+ - When a process is removed from the processor, it is either placed in the **ready** queue or the **blocked** queue, depending on the circumstances.
+ - When an event occurs, all the processes waiting on that event are moved from the **blocked** queue into the **ready** queue.
+ - 
+ - There are multiple **blocked** queues - one per event.
+ - When the event occurs, the entire list of processes is moved to the **ready** queue.
+ - 
+ - #### Suspended Processes #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:38:36.726Z
+ card-last-score:: 1
+ - The processor is faster than I/O so all the processes could be waiting for I/O.
+ - You can swap these processes to the disk to free up some memory.
+ - The *blocked* state becomes the *suspended* state when swapped to the disk.
+ - 
+ - ## Process Creation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:41:14.067Z
+ card-last-score:: 1
+ - Creation of new processes:
+ - The OS builds the data structures that are used to manage the process.
+ - The OS allocates space in main memory to the process.
+ - Reasons for process creation:
+ - New batch job.
+ - Interactive logon.
+ - Created by OS to provide a service.
+ - i.e., process to control printing.
+ - Spawned by existing process.
+ - i.e., to exploit parallelism.
+ - ## Process Termination
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.6
+ card-last-reviewed:: 2022-10-08T15:27:20.789Z
+ - Reasons for **Process Termination**: #card
+ card-last-interval:: 1.05
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-11T12:33:52.485Z
+ card-last-reviewed:: 2022-10-10T11:33:52.486Z
+ card-last-score:: 3
+ - Process finished its execution (**natural completion**).
+ - Total time limit exceeded.
+ - Errors (memory unavailable, arithmetic error, protection error, invalid instruction, privileged instruction, I/O failure, etc.).
+ - ## Process Management Services #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-12T15:26:09.797Z
+ card-last-reviewed:: 2022-10-08T15:26:09.797Z
+ card-last-score:: 5
+ - `create(&process_id, attributes)`
+ - Creates a new process with implicit or specified attributes.
+ - `delete(process_id)`
+ - Sometimes known as `destroy`, `terminate`, or `exit`.
+ - Ends the process specified by `process_id`.
+ - Whenever the process is terminated, all the files are closed, and all the allocated resources are released.
+ - `abort(process_id)`
+ - The same as `delete` but for *abnormal termination*.
+ - Usually generates a "**post-mortem dump**" which contains the state of the process before the abnormal termination.
+ - `suspend(process_id)`
+ - Puts the specified process into a **suspended** state.
+ - `resume(process_id)`
+ - Moves the specified process from the *suspended* state to the *ready* state.
+ - `delay(process_id, time)`
+ - Suspends the specified process for a specified period of time.
+ - After the delay time elapses, the process is moved to the ready state.
+ - `get_attribtutes(process_id, &buffer_attributes)`
+ - Used to find out the attributes for the given process.
+ - `set_attributes(process_id, buffer_attributes)`
+ - Used to set the attributes of the specified process.
+ -
+ - ## Process Description
+ - ### OS Control Structures #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:39:25.774Z
+ card-last-score:: 1
+ - #### Memory Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:44:14.140Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Memory Tables** are used to keep track of both main (real) and secondary (virtual) memory.
+ collapsed:: true
+ - Some of the main memory is reserved for use by the OS, the remainder is available to the processes.
+ - Memory Tables contain:
+ - The allocation of main memory to processes.
+ - The allocation of secondary memory to processes.
+ - Any *protection* attributes of blocks of main or virtual memory (such as which processes can access certain shared memory regions).
+ - Any information needed to manage virtual memory.
+ - #### I/O Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:40:44.093Z
+ card-last-score:: 1
+ collapsed:: true
+ - **I/O Tables** are used by the OS to manage the I/O devices.
+ - At any given time, an I/O device may be available or assigned to a particular process.
+ - If an I/O operation is in progress, the OS needs to know the status of the I/O operation and the location in main memory being used as the source or destination of the I/O transfer.
+ - #### File Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:46:06.597Z
+ card-last-score:: 1
+ collapsed:: true
+ - **File Tables** provide information about:
+ - The existence of files.
+ - Their location in secondary memory.
+ - Their current status.
+ - Other attributes.
+ - Much of this information is maintained & managed by the **File Manager**, in which case the process manager has little or no knowledge of files.
+ - ### Process Tables
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:23:42.819Z
+ collapsed:: true
+ - What is the **Primary Process Table**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:43:23.723Z
+ card-last-score:: 1
+ - The **Primary Process Table** keeps one entry per each process in the operating system.
+ - Each entry contains at least one pointer to a **process image**.
+ - ### Process Image #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:15.847Z
+ card-last-score:: 1
+ collapsed:: true
+ - The **Process Image** contains:
+ - **Stack**
+ collapsed:: true
+ - Each process has one or more stack(s) associated with it.
+ - A **stack** is used to store parameters & calling addresses for procedure & system calls.
+ - **User Data**
+ collapsed:: true
+ - Program data that can be modified, etc.
+ - **Process Control Block** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:29.384Z
+ card-last-score:: 1
+ collapsed:: true
+ - Data needed by the OS to control the process (attributes & information about the process).
+ - Contains:
+ - **Process Identification:** The data always includes a unique identifier for the process.
+ - Numeric identifiers that may be stored with the **Process Control Block** include the **identifier of this process**, the **identifier of the process that created this process** (parent process), and the **User Identifier**.
+ - **Processor State Information:** Defines the status of a process when it is suspended.
+ - **User-Visible Registers**
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-08T15:22:36.520Z
+ - What is a **User-Visible Register**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:43:17.781Z
+ card-last-score:: 1
+ - A **user-visible register** is one that may be referenced by means of the machine language that the processor executes.
+ - **Control & Status Registers** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:37:21.786Z
+ card-last-score:: 1
+ - These are a variety of processor registers that are employed to control the operation of the processor. These include:
+ - **Program Counter:** Contains the address of the next instruction to be fetched.
+ - **Condition Codes:** Result of the most recent arithmetic or logical operation.
+ - **Status Information:** Includes interrupt enabled/disabled flags, execution mode.
+ - **Stack Pointers**
+ - Each process has one or more LIFO system stacks associated with it. A stack is used to store parameters & calling addresses for procedure & system calls.
+ - The stack pointer points to the top of the stack.
+ - **Processor Control Information:** Used by the OS to manage the process.
+ - **Scheduling & State Information** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:08.265Z
+ card-last-score:: 1
+ - This is information that is needed by the operating system to perform its scheduling function. Typical items of information include:
+ - **Process State:** Defines the readiness of the process to be scheduled for execution (e.g., running, ready, waiting, halted).
+ - **Priority:** One or more fields may be used to describe the scheduling priority of the process. In some systems, several values are required (e.g., default, current, highest-allowable).
+ - **Scheduling-Related Information:** This will depend on the scheduling algorithm used. Examples are the amount of time that the process has been waiting an the amount of time that the process executed the last time it was running.
+ - **Event:** Identity of the even the process is awaiting before it can be resumed.
+ - **Data Structuring:** A process may be linked to another process in a queue or other structure.
+ - **Inter-Process Communication:** Various flags, signals, & messages may be associated with communication between two independent processes.
+ - **Process Privileges:** Processes are granted privileges in terms of the memory that may be accessed and the types of instruction that may be executed. In addition, privileges may apply to the use of system utilities & services.
+ - **Memory Management:** This section may include pointers to segment and/or page tables that describe the virtual memory assigned to this process.
+ - **Resource Ownership & Utilisation:** resources controlled by the processes may be indicated, such as opened files. A history of utilisation of the processor or other resources may also be included.
+ - This information may be needed by the scheduler.
+ -
+- ## Threads & Processes
+ - A **process** is sometimes defined as a *heavyweight process*.
+ - A **thread** is defined as a *lightweight process*.
+ - Separate two ideas:
+ - **Process:** Ownership of memory, files, other resources.
+ - Execution of applications.
+ - **Thread:** Unit of execution we use to dispatch.
+ - Share the same address space hence we can read from and write to the same data structures.
+ - What is **multithreading**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T17:25:59.409Z
+ card-last-reviewed:: 2022-10-06T17:25:59.409Z
+ card-last-score:: 5
+ - **Multithreading** allows multiple threads per process.
+ - What is a **thread**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:17:23.106Z
+ card-last-reviewed:: 2022-10-07T10:17:23.106Z
+ card-last-score:: 5
+ - A **thread** is a unit of computation associated with a particular heavyweight process, using many of the associated process's resources.
+ - It has a minimum of internal state & a minimum of allocated resources.
+ - A group of threads are share the same resources.
+ - e.g., files, memory space, etc.
+ - The **process** is the execution environment for a family of threads.
+ - A process with one thread is a **classic process**.
+ - Each thread has an individual execution state.
+ - Each thread has a control block, with a state (Running / Blocked / etc.), saved registers, an instruction pointer.
+ - There is a separate stack & hardware state (PC, registers, PSW, etc.) per thread.
+ - Shares memory & files with other threads that are in that process.
+ - Faster to create a thread than a process.
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-11-11T12_04_45.366Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-11-11T12_04_45.366Z.Desktop.md
new file mode 100644
index 00000000..7cff88fb
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-11-11T12_04_45.366Z.Desktop.md
@@ -0,0 +1,407 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[System Software & Operating Systems]]
+- **Next Topic:** [[CPU Management - Scheduling]]
+- **Relevant Slides:** 
+-
+- # Programs & Processes
+ - What is a **Program**? #card
+ card-last-interval:: 3.71
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T03:36:52.575Z
+ card-last-reviewed:: 2022-10-07T10:36:52.575Z
+ card-last-score:: 5
+ - A **Program** is a static entity made up of source program language statements that define process behaviour when executed on a set of data.
+ - What is a **Process**? #card
+ collapsed:: true
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-11T17:43:52.870Z
+ card-last-reviewed:: 2022-10-08T22:43:52.870Z
+ card-last-score:: 5
+ - A **Process** is a dynamic entity that executes a program on a particular set of data using resources allocated by the system.
+ - Two or more processes could execute the same program, each using its own data & resources.
+ - It is a ^^program in execution.^^
+ - It is composed of:
+ - Program.
+ - Data.
+ - **Process Control Block (PCB)**: contains the state of the process in execution.
+ - ## Process Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:48:14.190Z
+ card-last-score:: 1
+ - In order to execute, a process needs an **Abstract Machine Environment** to manage its use of resources.
+ - The **Process Control Block (PCB)** is required to map the environment state onto the physical machine state.
+ - The OS keeps a **process descriptor** for each process.
+ - 
+ - ## Program Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:28:39.916Z
+ card-last-score:: 1
+ - Each execution of a program generates a process that is executed.
+ - Inter-process relationships:
+ - **Competition:** Processes are trying to get access to the same resources of the system, therefore a protection between processes is necessary.
+ - **Cooperation:** Sometimes the processes need to communicate between themselves and exchange information - synchronisation is needed.
+ - ## Process Manager #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-20T08:38:16.744Z
+ - What does the **Process Manager** do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:48:20.405Z
+ card-last-score:: 1
+ - The **Process Manager** implements:
+ - **CPU Sharing** (called *scheduling*): Allocate resources to processes in conformance with certain policies.
+ - **Process Synchronisation** & **Inter-Process Communication**: Deadlock strategies & protection mechanisms.
+ - 
+ - ## Process - User Perspective
+ - When processes are executed in a quasi-parallel fashion, the processes need to synchronise to each other for correct functionality - this is done with directives `wait`/`signal`.
+ - `wait`- wait for a signal from a specific process.
+ - `signal` - send a signal to a specific process.
+ - ## Process - OS Perspective #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:41:58.996Z
+ card-last-score:: 1
+ - The processor's principle function is to execute machine instruction residing in main memory.
+ - These instructions are provided in the form of *programs*.
+ - A processor may interleave the execution of a number of programs over time.
+ - ### Program View
+ - Its execution involves a sequence of instructions within that progam.
+ - The behaviour of individual processes can be characterised by a sequence of instructions called the ***trace*** of the process.
+ - ### Processor View
+ - The processor executes instructions from main memory, as dictated by changing values in the Program Counter (PC) register.
+ - The behaviour of the processor can be characterised by showing how the traces of various processes are **interleaved**.
+ - ## State Process Models
+ - ### Two-State Process Model #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-29T05:35:44.137Z
+ card-last-reviewed:: 2022-10-20T08:35:44.137Z
+ card-last-score:: 3
+ - The process can be in one of two states: *running* or not *running*.
+ - When the OS creates a new process, it enters into the *not running* state; after that, the process exists - it is known to the OS and waits for the opportunity to run.
+ - From time to time, the currently running process will be interrupted and the dispatcher process will select a new process to run.
+ - The new process will be moved to the *running* state and the former one to the *not running* state.
+ - #### Two-State Model Queuing Discipline #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:50:58.883Z
+ card-last-score:: 1
+ - Each process needs to be represented.
+ - Information relating to each process, including current state & location in memory.
+ - Waiting processes should be kept in some kind of queue.
+ - List of pointers to processes blocks.
+ - Linked list of data blocks, each block representing a process.
+ - Dispatcher behaviour:
+ - An interrupted process is transferred to the *waiting queue*.
+ - If the process is completed or aborted, it is discarded.
+ - The dispatcher selects a process from the queue to execute.
+ - ### Five-State Process Model #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:45:28.816Z
+ card-last-score:: 1
+ - **Running:** The process is currently being executed.
+ - For single-processor systems, one single process can be in this state at a time.
+ - **Ready:** The process is prepared to execute when given the turn.
+ - **Blocked:** The process cannot execute until some event occurs.
+ - Such as the completion of an I/O operation.
+ - **New:** The process has been created, but has not yet been accepted in the pool of executable processes by the OS.
+ - Typically, a new process has not yet been loaded into main memory.
+ - **Exit:** The process has been released from the pool of executable processes by the OS.
+ - Completed or due to some errors.
+ - #### Five-State Model Process Transition Diagram
+ - 
+ - #### Five-State Model Queuing Discipline #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:41:05.316Z
+ card-last-score:: 1
+ - There are two types of queues: the **ready queue** & the **blocked queue**.
+ - When a process is admitted into the system, it is placed in the **ready** queue.
+ - When a process is removed from the processor, it is either placed in the **ready** queue or the **blocked** queue, depending on the circumstances.
+ - When an event occurs, all the processes waiting on that event are moved from the **blocked** queue into the **ready** queue.
+ - 
+ - There are multiple **blocked** queues - one per event.
+ - When the event occurs, the entire list of processes is moved to the **ready** queue.
+ - 
+ - #### Suspended Processes #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:38:36.726Z
+ card-last-score:: 1
+ - The processor is faster than I/O so all the processes could be waiting for I/O.
+ - You can swap these processes to the disk to free up some memory.
+ - The *blocked* state becomes the *suspended* state when swapped to the disk.
+ - 
+ - ## Process Creation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:39:16.423Z
+ card-last-score:: 1
+ - Creation of new processes:
+ - The OS builds the data structures that are used to manage the process.
+ - The OS allocates space in main memory to the process.
+ - Reasons for process creation:
+ - New batch job.
+ - Interactive logon.
+ - Created by OS to provide a service.
+ - i.e., process to control printing.
+ - Spawned by existing process.
+ - i.e., to exploit parallelism.
+ - ## Process Termination
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.6
+ card-last-reviewed:: 2022-10-08T15:27:20.789Z
+ - Reasons for **Process Termination**: #card
+ card-last-interval:: 1.05
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-11T12:33:52.485Z
+ card-last-reviewed:: 2022-10-10T11:33:52.486Z
+ card-last-score:: 3
+ - Process finished its execution (**natural completion**).
+ - Total time limit exceeded.
+ - Errors (memory unavailable, arithmetic error, protection error, invalid instruction, privileged instruction, I/O failure, etc.).
+ - ## Process Management Services #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-12T15:26:09.797Z
+ card-last-reviewed:: 2022-10-08T15:26:09.797Z
+ card-last-score:: 5
+ - `create(&process_id, attributes)`
+ - Creates a new process with implicit or specified attributes.
+ - `delete(process_id)`
+ - Sometimes known as `destroy`, `terminate`, or `exit`.
+ - Ends the process specified by `process_id`.
+ - Whenever the process is terminated, all the files are closed, and all the allocated resources are released.
+ - `abort(process_id)`
+ - The same as `delete` but for *abnormal termination*.
+ - Usually generates a "**post-mortem dump**" which contains the state of the process before the abnormal termination.
+ - `suspend(process_id)`
+ - Puts the specified process into a **suspended** state.
+ - `resume(process_id)`
+ - Moves the specified process from the *suspended* state to the *ready* state.
+ - `delay(process_id, time)`
+ - Suspends the specified process for a specified period of time.
+ - After the delay time elapses, the process is moved to the ready state.
+ - `get_attribtutes(process_id, &buffer_attributes)`
+ - Used to find out the attributes for the given process.
+ - `set_attributes(process_id, buffer_attributes)`
+ - Used to set the attributes of the specified process.
+ -
+ - ## Process Description
+ - ### OS Control Structures #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:39:25.774Z
+ card-last-score:: 1
+ - #### Memory Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:44:14.140Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Memory Tables** are used to keep track of both main (real) and secondary (virtual) memory.
+ collapsed:: true
+ - Some of the main memory is reserved for use by the OS, the remainder is available to the processes.
+ - Memory Tables contain:
+ - The allocation of main memory to processes.
+ - The allocation of secondary memory to processes.
+ - Any *protection* attributes of blocks of main or virtual memory (such as which processes can access certain shared memory regions).
+ - Any information needed to manage virtual memory.
+ - #### I/O Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:38:12.118Z
+ card-last-score:: 1
+ collapsed:: true
+ - **I/O Tables** are used by the OS to manage the I/O devices.
+ - At any given time, an I/O device may be available or assigned to a particular process.
+ - If an I/O operation is in progress, the OS needs to know the status of the I/O operation and the location in main memory being used as the source or destination of the I/O transfer.
+ - #### File Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:42:26.702Z
+ card-last-score:: 1
+ collapsed:: true
+ - **File Tables** provide information about:
+ - The existence of files.
+ - Their location in secondary memory.
+ - Their current status.
+ - Other attributes.
+ - Much of this information is maintained & managed by the **File Manager**, in which case the process manager has little or no knowledge of files.
+ - ### Process Tables
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:23:42.819Z
+ collapsed:: true
+ - What is the **Primary Process Table**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:43:23.723Z
+ card-last-score:: 1
+ - The **Primary Process Table** keeps one entry per each process in the operating system.
+ - Each entry contains at least one pointer to a **process image**.
+ - ### Process Image #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:15.847Z
+ card-last-score:: 1
+ collapsed:: true
+ - The **Process Image** contains:
+ - **Stack**
+ collapsed:: true
+ - Each process has one or more stack(s) associated with it.
+ - A **stack** is used to store parameters & calling addresses for procedure & system calls.
+ - **User Data**
+ collapsed:: true
+ - Program data that can be modified, etc.
+ - **Process Control Block** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-26T23:00:00.000Z
+ card-last-reviewed:: 2022-10-26T11:50:51.394Z
+ card-last-score:: 1
+ collapsed:: true
+ - Data needed by the OS to control the process (attributes & information about the process).
+ - Contains:
+ - **Process Identification:** The data always includes a unique identifier for the process.
+ - Numeric identifiers that may be stored with the **Process Control Block** include the **identifier of this process**, the **identifier of the process that created this process** (parent process), and the **User Identifier**.
+ - **Processor State Information:** Defines the status of a process when it is suspended.
+ - **User-Visible Registers**
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-08T15:22:36.520Z
+ - What is a **User-Visible Register**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:43:17.781Z
+ card-last-score:: 1
+ - A **user-visible register** is one that may be referenced by means of the machine language that the processor executes.
+ - **Control & Status Registers** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:37:21.786Z
+ card-last-score:: 1
+ - These are a variety of processor registers that are employed to control the operation of the processor. These include:
+ - **Program Counter:** Contains the address of the next instruction to be fetched.
+ - **Condition Codes:** Result of the most recent arithmetic or logical operation.
+ - **Status Information:** Includes interrupt enabled/disabled flags, execution mode.
+ - **Stack Pointers**
+ - Each process has one or more LIFO system stacks associated with it. A stack is used to store parameters & calling addresses for procedure & system calls.
+ - The stack pointer points to the top of the stack.
+ - **Processor Control Information:** Used by the OS to manage the process.
+ - **Scheduling & State Information** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:35:08.265Z
+ card-last-score:: 1
+ - This is information that is needed by the operating system to perform its scheduling function. Typical items of information include:
+ - **Process State:** Defines the readiness of the process to be scheduled for execution (e.g., running, ready, waiting, halted).
+ - **Priority:** One or more fields may be used to describe the scheduling priority of the process. In some systems, several values are required (e.g., default, current, highest-allowable).
+ - **Scheduling-Related Information:** This will depend on the scheduling algorithm used. Examples are the amount of time that the process has been waiting an the amount of time that the process executed the last time it was running.
+ - **Event:** Identity of the even the process is awaiting before it can be resumed.
+ - **Data Structuring:** A process may be linked to another process in a queue or other structure.
+ - **Inter-Process Communication:** Various flags, signals, & messages may be associated with communication between two independent processes.
+ - **Process Privileges:** Processes are granted privileges in terms of the memory that may be accessed and the types of instruction that may be executed. In addition, privileges may apply to the use of system utilities & services.
+ - **Memory Management:** This section may include pointers to segment and/or page tables that describe the virtual memory assigned to this process.
+ - **Resource Ownership & Utilisation:** resources controlled by the processes may be indicated, such as opened files. A history of utilisation of the processor or other resources may also be included.
+ - This information may be needed by the scheduler.
+ -
+- ## Threads & Processes
+ - A **process** is sometimes defined as a *heavyweight process*.
+ - A **thread** is defined as a *lightweight process*.
+ - Separate two ideas:
+ - **Process:** Ownership of memory, files, other resources.
+ - Execution of applications.
+ - **Thread:** Unit of execution we use to dispatch.
+ - Share the same address space hence we can read from and write to the same data structures.
+ - What is **multithreading**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:36:55.022Z
+ card-last-score:: 1
+ - **Multithreading** allows multiple threads per process.
+ - What is a **thread**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:17:23.106Z
+ card-last-reviewed:: 2022-10-07T10:17:23.106Z
+ card-last-score:: 5
+ - A **thread** is a unit of computation associated with a particular heavyweight process, using many of the associated process's resources.
+ - It has a minimum of internal state & a minimum of allocated resources.
+ - A group of threads are share the same resources.
+ - e.g., files, memory space, etc.
+ - The **process** is the execution environment for a family of threads.
+ - A process with one thread is a **classic process**.
+ - Each thread has an individual execution state.
+ - Each thread has a control block, with a state (Running / Blocked / etc.), saved registers, an instruction pointer.
+ - There is a separate stack & hardware state (PC, registers, PSW, etc.) per thread.
+ - Shares memory & files with other threads that are in that process.
+ - Faster to create a thread than a process.
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-11-23T09_22_44.503Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-11-23T09_22_44.503Z.Desktop.md
new file mode 100644
index 00000000..fc87b7d4
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-11-23T09_22_44.503Z.Desktop.md
@@ -0,0 +1,407 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[System Software & Operating Systems]]
+- **Next Topic:** [[CPU Management - Scheduling]]
+- **Relevant Slides:** 
+-
+- # Programs & Processes
+ - What is a **Program**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:29:07.510Z
+ card-last-score:: 1
+ - A **Program** is a static entity made up of source program language statements that define process behaviour when executed on a set of data.
+ - What is a **Process**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:39:13.229Z
+ card-last-score:: 1
+ - A **Process** is a dynamic entity that executes a program on a particular set of data using resources allocated by the system.
+ - Two or more processes could execute the same program, each using its own data & resources.
+ - It is a ^^program in execution.^^
+ - It is composed of:
+ - Program.
+ - Data.
+ - **Process Control Block (PCB)**: contains the state of the process in execution.
+ - ## Process Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:14:34.752Z
+ card-last-score:: 1
+ - In order to execute, a process needs an **Abstract Machine Environment** to manage its use of resources.
+ - The **Process Control Block (PCB)** is required to map the environment state onto the physical machine state.
+ - The OS keeps a **process descriptor** for each process.
+ - 
+ - ## Program Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-22T00:00:00.000Z
+ card-last-reviewed:: 2022-11-21T13:09:10.088Z
+ card-last-score:: 1
+ - Each execution of a program generates a process that is executed.
+ - Inter-process relationships:
+ - **Competition:** Processes are trying to get access to the same resources of the system, therefore a protection between processes is necessary.
+ - **Cooperation:** Sometimes the processes need to communicate between themselves and exchange information - synchronisation is needed.
+ - ## Process Manager #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-11-17T20:18:15.885Z
+ - What does the **Process Manager** do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:13:51.555Z
+ card-last-score:: 1
+ - The **Process Manager** implements:
+ - **CPU Sharing** (called *scheduling*): Allocate resources to processes in conformance with certain policies.
+ - **Process Synchronisation** & **Inter-Process Communication**: Deadlock strategies & protection mechanisms.
+ - 
+ - ## Process - User Perspective
+ - When processes are executed in a quasi-parallel fashion, the processes need to synchronise to each other for correct functionality - this is done with directives `wait`/`signal`.
+ - `wait`- wait for a signal from a specific process.
+ - `signal` - send a signal to a specific process.
+ - ## Process - OS Perspective #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:49.152Z
+ card-last-score:: 1
+ - The processor's principle function is to execute machine instruction residing in main memory.
+ - These instructions are provided in the form of *programs*.
+ - A processor may interleave the execution of a number of programs over time.
+ - ### Program View
+ - Its execution involves a sequence of instructions within that progam.
+ - The behaviour of individual processes can be characterised by a sequence of instructions called the ***trace*** of the process.
+ - ### Processor View
+ - The processor executes instructions from main memory, as dictated by changing values in the Program Counter (PC) register.
+ - The behaviour of the processor can be characterised by showing how the traces of various processes are **interleaved**.
+ - ## State Process Models
+ - ### Two-State Process Model #card
+ card-last-interval:: 15.48
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-11-30T07:19:45.198Z
+ card-last-reviewed:: 2022-11-14T20:19:45.199Z
+ card-last-score:: 3
+ - The process can be in one of two states: *running* or not *running*.
+ - When the OS creates a new process, it enters into the *not running* state; after that, the process exists - it is known to the OS and waits for the opportunity to run.
+ - From time to time, the currently running process will be interrupted and the dispatcher process will select a new process to run.
+ - The new process will be moved to the *running* state and the former one to the *not running* state.
+ - #### Two-State Model Queuing Discipline #card
+ card-last-interval:: 1.01
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T20:13:25.916Z
+ card-last-reviewed:: 2022-11-14T20:13:25.916Z
+ card-last-score:: 3
+ - Each process needs to be represented.
+ - Information relating to each process, including current state & location in memory.
+ - Waiting processes should be kept in some kind of queue.
+ - List of pointers to processes blocks.
+ - Linked list of data blocks, each block representing a process.
+ - Dispatcher behaviour:
+ - An interrupted process is transferred to the *waiting queue*.
+ - If the process is completed or aborted, it is discarded.
+ - The dispatcher selects a process from the queue to execute.
+ - ### Five-State Process Model #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-18T16:27:46.160Z
+ card-last-reviewed:: 2022-11-14T16:27:46.161Z
+ card-last-score:: 3
+ - **Running:** The process is currently being executed.
+ - For single-processor systems, one single process can be in this state at a time.
+ - **Ready:** The process is prepared to execute when given the turn.
+ - **Blocked:** The process cannot execute until some event occurs.
+ - Such as the completion of an I/O operation.
+ - **New:** The process has been created, but has not yet been accepted in the pool of executable processes by the OS.
+ - Typically, a new process has not yet been loaded into main memory.
+ - **Exit:** The process has been released from the pool of executable processes by the OS.
+ - Completed or due to some errors.
+ - #### Five-State Model Process Transition Diagram
+ - 
+ - #### Five-State Model Queuing Discipline #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:18:38.089Z
+ card-last-score:: 1
+ - There are two types of queues: the **ready queue** & the **blocked queue**.
+ - When a process is admitted into the system, it is placed in the **ready** queue.
+ - When a process is removed from the processor, it is either placed in the **ready** queue or the **blocked** queue, depending on the circumstances.
+ - When an event occurs, all the processes waiting on that event are moved from the **blocked** queue into the **ready** queue.
+ - 
+ - There are multiple **blocked** queues - one per event.
+ - When the event occurs, the entire list of processes is moved to the **ready** queue.
+ - 
+ - #### Suspended Processes #card
+ card-last-interval:: 0.79
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T10:27:13.430Z
+ card-last-reviewed:: 2022-11-14T16:27:13.430Z
+ card-last-score:: 3
+ - The processor is faster than I/O so all the processes could be waiting for I/O.
+ - You can swap these processes to the disk to free up some memory.
+ - The *blocked* state becomes the *suspended* state when swapped to the disk.
+ - 
+ - ## Process Creation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:35:10.727Z
+ card-last-score:: 1
+ - Creation of new processes:
+ - The OS builds the data structures that are used to manage the process.
+ - The OS allocates space in main memory to the process.
+ - Reasons for process creation:
+ - New batch job.
+ - Interactive logon.
+ - Created by OS to provide a service.
+ - i.e., process to control printing.
+ - Spawned by existing process.
+ - i.e., to exploit parallelism.
+ - ## Process Termination
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.6
+ card-last-reviewed:: 2022-10-08T15:27:20.789Z
+ - Reasons for **Process Termination**: #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-23T13:37:45.614Z
+ card-last-reviewed:: 2022-11-14T16:37:45.615Z
+ card-last-score:: 3
+ - Process finished its execution (**natural completion**).
+ - Total time limit exceeded.
+ - Errors (memory unavailable, arithmetic error, protection error, invalid instruction, privileged instruction, I/O failure, etc.).
+ - ## Process Management Services #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:43:04.324Z
+ card-last-score:: 1
+ - `create(&process_id, attributes)`
+ - Creates a new process with implicit or specified attributes.
+ - `delete(process_id)`
+ - Sometimes known as `destroy`, `terminate`, or `exit`.
+ - Ends the process specified by `process_id`.
+ - Whenever the process is terminated, all the files are closed, and all the allocated resources are released.
+ - `abort(process_id)`
+ - The same as `delete` but for *abnormal termination*.
+ - Usually generates a "**post-mortem dump**" which contains the state of the process before the abnormal termination.
+ - `suspend(process_id)`
+ - Puts the specified process into a **suspended** state.
+ - `resume(process_id)`
+ - Moves the specified process from the *suspended* state to the *ready* state.
+ - `delay(process_id, time)`
+ - Suspends the specified process for a specified period of time.
+ - After the delay time elapses, the process is moved to the ready state.
+ - `get_attribtutes(process_id, &buffer_attributes)`
+ - Used to find out the attributes for the given process.
+ - `set_attributes(process_id, buffer_attributes)`
+ - Used to set the attributes of the specified process.
+ -
+ - ## Process Description
+ - ### OS Control Structures #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:10.635Z
+ card-last-score:: 1
+ - #### Memory Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:25.598Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Memory Tables** are used to keep track of both main (real) and secondary (virtual) memory.
+ collapsed:: true
+ - Some of the main memory is reserved for use by the OS, the remainder is available to the processes.
+ - Memory Tables contain:
+ - The allocation of main memory to processes.
+ - The allocation of secondary memory to processes.
+ - Any *protection* attributes of blocks of main or virtual memory (such as which processes can access certain shared memory regions).
+ - Any information needed to manage virtual memory.
+ - #### I/O Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:35:16.384Z
+ card-last-score:: 1
+ collapsed:: true
+ - **I/O Tables** are used by the OS to manage the I/O devices.
+ - At any given time, an I/O device may be available or assigned to a particular process.
+ - If an I/O operation is in progress, the OS needs to know the status of the I/O operation and the location in main memory being used as the source or destination of the I/O transfer.
+ - #### File Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T19:40:13.935Z
+ card-last-score:: 1
+ collapsed:: true
+ - **File Tables** provide information about:
+ - The existence of files.
+ - Their location in secondary memory.
+ - Their current status.
+ - Other attributes.
+ - Much of this information is maintained & managed by the **File Manager**, in which case the process manager has little or no knowledge of files.
+ - ### Process Tables
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:23:42.819Z
+ collapsed:: true
+ - What is the **Primary Process Table**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:29.312Z
+ card-last-score:: 1
+ - The **Primary Process Table** keeps one entry per each process in the operating system.
+ - Each entry contains at least one pointer to a **process image**.
+ - ### Process Image #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:31.530Z
+ card-last-score:: 1
+ collapsed:: true
+ - The **Process Image** contains:
+ - **Stack**
+ collapsed:: true
+ - Each process has one or more stack(s) associated with it.
+ - A **stack** is used to store parameters & calling addresses for procedure & system calls.
+ - **User Data**
+ collapsed:: true
+ - Program data that can be modified, etc.
+ - **Process Control Block** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:16:30.724Z
+ card-last-score:: 1
+ collapsed:: true
+ - Data needed by the OS to control the process (attributes & information about the process).
+ - Contains:
+ - **Process Identification:** The data always includes a unique identifier for the process.
+ - Numeric identifiers that may be stored with the **Process Control Block** include the **identifier of this process**, the **identifier of the process that created this process** (parent process), and the **User Identifier**.
+ - **Processor State Information:** Defines the status of a process when it is suspended.
+ - **User-Visible Registers**
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-08T15:22:36.520Z
+ - What is a **User-Visible Register**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T09:49:41.863Z
+ card-last-score:: 1
+ - A **user-visible register** is one that may be referenced by means of the machine language that the processor executes.
+ - **Control & Status Registers** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-22T00:00:00.000Z
+ card-last-reviewed:: 2022-11-21T13:08:22.338Z
+ card-last-score:: 1
+ - These are a variety of processor registers that are employed to control the operation of the processor. These include:
+ - **Program Counter:** Contains the address of the next instruction to be fetched.
+ - **Condition Codes:** Result of the most recent arithmetic or logical operation.
+ - **Status Information:** Includes interrupt enabled/disabled flags, execution mode.
+ - **Stack Pointers**
+ - Each process has one or more LIFO system stacks associated with it. A stack is used to store parameters & calling addresses for procedure & system calls.
+ - The stack pointer points to the top of the stack.
+ - **Processor Control Information:** Used by the OS to manage the process.
+ - **Scheduling & State Information** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:18.371Z
+ card-last-score:: 1
+ - This is information that is needed by the operating system to perform its scheduling function. Typical items of information include:
+ - **Process State:** Defines the readiness of the process to be scheduled for execution (e.g., running, ready, waiting, halted).
+ - **Priority:** One or more fields may be used to describe the scheduling priority of the process. In some systems, several values are required (e.g., default, current, highest-allowable).
+ - **Scheduling-Related Information:** This will depend on the scheduling algorithm used. Examples are the amount of time that the process has been waiting an the amount of time that the process executed the last time it was running.
+ - **Event:** Identity of the even the process is awaiting before it can be resumed.
+ - **Data Structuring:** A process may be linked to another process in a queue or other structure.
+ - **Inter-Process Communication:** Various flags, signals, & messages may be associated with communication between two independent processes.
+ - **Process Privileges:** Processes are granted privileges in terms of the memory that may be accessed and the types of instruction that may be executed. In addition, privileges may apply to the use of system utilities & services.
+ - **Memory Management:** This section may include pointers to segment and/or page tables that describe the virtual memory assigned to this process.
+ - **Resource Ownership & Utilisation:** resources controlled by the processes may be indicated, such as opened files. A history of utilisation of the processor or other resources may also be included.
+ - This information may be needed by the scheduler.
+ -
+- ## Threads & Processes
+ - A **process** is sometimes defined as a *heavyweight process*.
+ - A **thread** is defined as a *lightweight process*.
+ - Separate two ideas:
+ - **Process:** Ownership of memory, files, other resources.
+ - Execution of applications.
+ - **Thread:** Unit of execution we use to dispatch.
+ - Share the same address space hence we can read from and write to the same data structures.
+ - What is **multithreading**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:15:51.123Z
+ card-last-score:: 1
+ - **Multithreading** allows multiple threads per process.
+ - What is a **thread**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:35:09.592Z
+ card-last-score:: 1
+ - A **thread** is a unit of computation associated with a particular heavyweight process, using many of the associated process's resources.
+ - It has a minimum of internal state & a minimum of allocated resources.
+ - A group of threads are share the same resources.
+ - e.g., files, memory space, etc.
+ - The **process** is the execution environment for a family of threads.
+ - A process with one thread is a **classic process**.
+ - Each thread has an individual execution state.
+ - Each thread has a control block, with a state (Running / Blocked / etc.), saved registers, an instruction pointer.
+ - There is a separate stack & hardware state (PC, registers, PSW, etc.) per thread.
+ - Shares memory & files with other threads that are in that process.
+ - Faster to create a thread than a process.
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-11-23T12_15_36.870Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-11-23T12_15_36.870Z.Desktop.md
new file mode 100644
index 00000000..fc87b7d4
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Management/2022-11-23T12_15_36.870Z.Desktop.md
@@ -0,0 +1,407 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[System Software & Operating Systems]]
+- **Next Topic:** [[CPU Management - Scheduling]]
+- **Relevant Slides:** 
+-
+- # Programs & Processes
+ - What is a **Program**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:29:07.510Z
+ card-last-score:: 1
+ - A **Program** is a static entity made up of source program language statements that define process behaviour when executed on a set of data.
+ - What is a **Process**? #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:39:13.229Z
+ card-last-score:: 1
+ - A **Process** is a dynamic entity that executes a program on a particular set of data using resources allocated by the system.
+ - Two or more processes could execute the same program, each using its own data & resources.
+ - It is a ^^program in execution.^^
+ - It is composed of:
+ - Program.
+ - Data.
+ - **Process Control Block (PCB)**: contains the state of the process in execution.
+ - ## Process Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:14:34.752Z
+ card-last-score:: 1
+ - In order to execute, a process needs an **Abstract Machine Environment** to manage its use of resources.
+ - The **Process Control Block (PCB)** is required to map the environment state onto the physical machine state.
+ - The OS keeps a **process descriptor** for each process.
+ - 
+ - ## Program Execution #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-22T00:00:00.000Z
+ card-last-reviewed:: 2022-11-21T13:09:10.088Z
+ card-last-score:: 1
+ - Each execution of a program generates a process that is executed.
+ - Inter-process relationships:
+ - **Competition:** Processes are trying to get access to the same resources of the system, therefore a protection between processes is necessary.
+ - **Cooperation:** Sometimes the processes need to communicate between themselves and exchange information - synchronisation is needed.
+ - ## Process Manager #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-11-17T20:18:15.885Z
+ - What does the **Process Manager** do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:13:51.555Z
+ card-last-score:: 1
+ - The **Process Manager** implements:
+ - **CPU Sharing** (called *scheduling*): Allocate resources to processes in conformance with certain policies.
+ - **Process Synchronisation** & **Inter-Process Communication**: Deadlock strategies & protection mechanisms.
+ - 
+ - ## Process - User Perspective
+ - When processes are executed in a quasi-parallel fashion, the processes need to synchronise to each other for correct functionality - this is done with directives `wait`/`signal`.
+ - `wait`- wait for a signal from a specific process.
+ - `signal` - send a signal to a specific process.
+ - ## Process - OS Perspective #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:49.152Z
+ card-last-score:: 1
+ - The processor's principle function is to execute machine instruction residing in main memory.
+ - These instructions are provided in the form of *programs*.
+ - A processor may interleave the execution of a number of programs over time.
+ - ### Program View
+ - Its execution involves a sequence of instructions within that progam.
+ - The behaviour of individual processes can be characterised by a sequence of instructions called the ***trace*** of the process.
+ - ### Processor View
+ - The processor executes instructions from main memory, as dictated by changing values in the Program Counter (PC) register.
+ - The behaviour of the processor can be characterised by showing how the traces of various processes are **interleaved**.
+ - ## State Process Models
+ - ### Two-State Process Model #card
+ card-last-interval:: 15.48
+ card-repeats:: 4
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-11-30T07:19:45.198Z
+ card-last-reviewed:: 2022-11-14T20:19:45.199Z
+ card-last-score:: 3
+ - The process can be in one of two states: *running* or not *running*.
+ - When the OS creates a new process, it enters into the *not running* state; after that, the process exists - it is known to the OS and waits for the opportunity to run.
+ - From time to time, the currently running process will be interrupted and the dispatcher process will select a new process to run.
+ - The new process will be moved to the *running* state and the former one to the *not running* state.
+ - #### Two-State Model Queuing Discipline #card
+ card-last-interval:: 1.01
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T20:13:25.916Z
+ card-last-reviewed:: 2022-11-14T20:13:25.916Z
+ card-last-score:: 3
+ - Each process needs to be represented.
+ - Information relating to each process, including current state & location in memory.
+ - Waiting processes should be kept in some kind of queue.
+ - List of pointers to processes blocks.
+ - Linked list of data blocks, each block representing a process.
+ - Dispatcher behaviour:
+ - An interrupted process is transferred to the *waiting queue*.
+ - If the process is completed or aborted, it is discarded.
+ - The dispatcher selects a process from the queue to execute.
+ - ### Five-State Process Model #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-18T16:27:46.160Z
+ card-last-reviewed:: 2022-11-14T16:27:46.161Z
+ card-last-score:: 3
+ - **Running:** The process is currently being executed.
+ - For single-processor systems, one single process can be in this state at a time.
+ - **Ready:** The process is prepared to execute when given the turn.
+ - **Blocked:** The process cannot execute until some event occurs.
+ - Such as the completion of an I/O operation.
+ - **New:** The process has been created, but has not yet been accepted in the pool of executable processes by the OS.
+ - Typically, a new process has not yet been loaded into main memory.
+ - **Exit:** The process has been released from the pool of executable processes by the OS.
+ - Completed or due to some errors.
+ - #### Five-State Model Process Transition Diagram
+ - 
+ - #### Five-State Model Queuing Discipline #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:18:38.089Z
+ card-last-score:: 1
+ - There are two types of queues: the **ready queue** & the **blocked queue**.
+ - When a process is admitted into the system, it is placed in the **ready** queue.
+ - When a process is removed from the processor, it is either placed in the **ready** queue or the **blocked** queue, depending on the circumstances.
+ - When an event occurs, all the processes waiting on that event are moved from the **blocked** queue into the **ready** queue.
+ - 
+ - There are multiple **blocked** queues - one per event.
+ - When the event occurs, the entire list of processes is moved to the **ready** queue.
+ - 
+ - #### Suspended Processes #card
+ card-last-interval:: 0.79
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T10:27:13.430Z
+ card-last-reviewed:: 2022-11-14T16:27:13.430Z
+ card-last-score:: 3
+ - The processor is faster than I/O so all the processes could be waiting for I/O.
+ - You can swap these processes to the disk to free up some memory.
+ - The *blocked* state becomes the *suspended* state when swapped to the disk.
+ - 
+ - ## Process Creation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:35:10.727Z
+ card-last-score:: 1
+ - Creation of new processes:
+ - The OS builds the data structures that are used to manage the process.
+ - The OS allocates space in main memory to the process.
+ - Reasons for process creation:
+ - New batch job.
+ - Interactive logon.
+ - Created by OS to provide a service.
+ - i.e., process to control printing.
+ - Spawned by existing process.
+ - i.e., to exploit parallelism.
+ - ## Process Termination
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.6
+ card-last-reviewed:: 2022-10-08T15:27:20.789Z
+ - Reasons for **Process Termination**: #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-11-23T13:37:45.614Z
+ card-last-reviewed:: 2022-11-14T16:37:45.615Z
+ card-last-score:: 3
+ - Process finished its execution (**natural completion**).
+ - Total time limit exceeded.
+ - Errors (memory unavailable, arithmetic error, protection error, invalid instruction, privileged instruction, I/O failure, etc.).
+ - ## Process Management Services #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:43:04.324Z
+ card-last-score:: 1
+ - `create(&process_id, attributes)`
+ - Creates a new process with implicit or specified attributes.
+ - `delete(process_id)`
+ - Sometimes known as `destroy`, `terminate`, or `exit`.
+ - Ends the process specified by `process_id`.
+ - Whenever the process is terminated, all the files are closed, and all the allocated resources are released.
+ - `abort(process_id)`
+ - The same as `delete` but for *abnormal termination*.
+ - Usually generates a "**post-mortem dump**" which contains the state of the process before the abnormal termination.
+ - `suspend(process_id)`
+ - Puts the specified process into a **suspended** state.
+ - `resume(process_id)`
+ - Moves the specified process from the *suspended* state to the *ready* state.
+ - `delay(process_id, time)`
+ - Suspends the specified process for a specified period of time.
+ - After the delay time elapses, the process is moved to the ready state.
+ - `get_attribtutes(process_id, &buffer_attributes)`
+ - Used to find out the attributes for the given process.
+ - `set_attributes(process_id, buffer_attributes)`
+ - Used to set the attributes of the specified process.
+ -
+ - ## Process Description
+ - ### OS Control Structures #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:10.635Z
+ card-last-score:: 1
+ - #### Memory Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:25.598Z
+ card-last-score:: 1
+ collapsed:: true
+ - **Memory Tables** are used to keep track of both main (real) and secondary (virtual) memory.
+ collapsed:: true
+ - Some of the main memory is reserved for use by the OS, the remainder is available to the processes.
+ - Memory Tables contain:
+ - The allocation of main memory to processes.
+ - The allocation of secondary memory to processes.
+ - Any *protection* attributes of blocks of main or virtual memory (such as which processes can access certain shared memory regions).
+ - Any information needed to manage virtual memory.
+ - #### I/O Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-19T00:00:00.000Z
+ card-last-reviewed:: 2022-11-18T18:35:16.384Z
+ card-last-score:: 1
+ collapsed:: true
+ - **I/O Tables** are used by the OS to manage the I/O devices.
+ - At any given time, an I/O device may be available or assigned to a particular process.
+ - If an I/O operation is in progress, the OS needs to know the status of the I/O operation and the location in main memory being used as the source or destination of the I/O transfer.
+ - #### File Tables #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T19:40:13.935Z
+ card-last-score:: 1
+ collapsed:: true
+ - **File Tables** provide information about:
+ - The existence of files.
+ - Their location in secondary memory.
+ - Their current status.
+ - Other attributes.
+ - Much of this information is maintained & managed by the **File Manager**, in which case the process manager has little or no knowledge of files.
+ - ### Process Tables
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-07T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-07T10:23:42.819Z
+ collapsed:: true
+ - What is the **Primary Process Table**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:29.312Z
+ card-last-score:: 1
+ - The **Primary Process Table** keeps one entry per each process in the operating system.
+ - Each entry contains at least one pointer to a **process image**.
+ - ### Process Image #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:31.530Z
+ card-last-score:: 1
+ collapsed:: true
+ - The **Process Image** contains:
+ - **Stack**
+ collapsed:: true
+ - Each process has one or more stack(s) associated with it.
+ - A **stack** is used to store parameters & calling addresses for procedure & system calls.
+ - **User Data**
+ collapsed:: true
+ - Program data that can be modified, etc.
+ - **Process Control Block** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:16:30.724Z
+ card-last-score:: 1
+ collapsed:: true
+ - Data needed by the OS to control the process (attributes & information about the process).
+ - Contains:
+ - **Process Identification:** The data always includes a unique identifier for the process.
+ - Numeric identifiers that may be stored with the **Process Control Block** include the **identifier of this process**, the **identifier of the process that created this process** (parent process), and the **User Identifier**.
+ - **Processor State Information:** Defines the status of a process when it is suspended.
+ - **User-Visible Registers**
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-08T15:22:36.520Z
+ - What is a **User-Visible Register**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T09:49:41.863Z
+ card-last-score:: 1
+ - A **user-visible register** is one that may be referenced by means of the machine language that the processor executes.
+ - **Control & Status Registers** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-22T00:00:00.000Z
+ card-last-reviewed:: 2022-11-21T13:08:22.338Z
+ card-last-score:: 1
+ - These are a variety of processor registers that are employed to control the operation of the processor. These include:
+ - **Program Counter:** Contains the address of the next instruction to be fetched.
+ - **Condition Codes:** Result of the most recent arithmetic or logical operation.
+ - **Status Information:** Includes interrupt enabled/disabled flags, execution mode.
+ - **Stack Pointers**
+ - Each process has one or more LIFO system stacks associated with it. A stack is used to store parameters & calling addresses for procedure & system calls.
+ - The stack pointer points to the top of the stack.
+ - **Processor Control Information:** Used by the OS to manage the process.
+ - **Scheduling & State Information** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:26:18.371Z
+ card-last-score:: 1
+ - This is information that is needed by the operating system to perform its scheduling function. Typical items of information include:
+ - **Process State:** Defines the readiness of the process to be scheduled for execution (e.g., running, ready, waiting, halted).
+ - **Priority:** One or more fields may be used to describe the scheduling priority of the process. In some systems, several values are required (e.g., default, current, highest-allowable).
+ - **Scheduling-Related Information:** This will depend on the scheduling algorithm used. Examples are the amount of time that the process has been waiting an the amount of time that the process executed the last time it was running.
+ - **Event:** Identity of the even the process is awaiting before it can be resumed.
+ - **Data Structuring:** A process may be linked to another process in a queue or other structure.
+ - **Inter-Process Communication:** Various flags, signals, & messages may be associated with communication between two independent processes.
+ - **Process Privileges:** Processes are granted privileges in terms of the memory that may be accessed and the types of instruction that may be executed. In addition, privileges may apply to the use of system utilities & services.
+ - **Memory Management:** This section may include pointers to segment and/or page tables that describe the virtual memory assigned to this process.
+ - **Resource Ownership & Utilisation:** resources controlled by the processes may be indicated, such as opened files. A history of utilisation of the processor or other resources may also be included.
+ - This information may be needed by the scheduler.
+ -
+- ## Threads & Processes
+ - A **process** is sometimes defined as a *heavyweight process*.
+ - A **thread** is defined as a *lightweight process*.
+ - Separate two ideas:
+ - **Process:** Ownership of memory, files, other resources.
+ - Execution of applications.
+ - **Thread:** Unit of execution we use to dispatch.
+ - Share the same address space hence we can read from and write to the same data structures.
+ - What is **multithreading**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-18T00:00:00.000Z
+ card-last-reviewed:: 2022-11-17T20:15:51.123Z
+ card-last-score:: 1
+ - **Multithreading** allows multiple threads per process.
+ - What is a **thread**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:35:09.592Z
+ card-last-score:: 1
+ - A **thread** is a unit of computation associated with a particular heavyweight process, using many of the associated process's resources.
+ - It has a minimum of internal state & a minimum of allocated resources.
+ - A group of threads are share the same resources.
+ - e.g., files, memory space, etc.
+ - The **process** is the execution environment for a family of threads.
+ - A process with one thread is a **classic process**.
+ - Each thread has an individual execution state.
+ - Each thread has a control block, with a state (Running / Blocked / etc.), saved registers, an instruction pointer.
+ - There is a separate stack & hardware state (PC, registers, PSW, etc.) per thread.
+ - Shares memory & files with other threads that are in that process.
+ - Faster to create a thread than a process.
+ - 
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-09T13_03_58.133Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-09T13_03_58.133Z.Desktop.md
new file mode 100644
index 00000000..9a58f32c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-09T13_03_58.133Z.Desktop.md
@@ -0,0 +1,453 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[CPU Management - Scheduling]]
+- **Next Topic:** [[Memory Management]]
+- **Relevant Slides:** 
+-
+- # Concurrent Programming
+ collapsed:: true
+ - What are **Concurrent Programs**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T10:56:45.458Z
+ card-last-reviewed:: 2022-10-18T11:56:45.458Z
+ card-last-score:: 3
+ - **Concurrent Programs** are interleaving sets of sequential atomic instructions.
+ - i.e., interacting sequential processes that run at the same time, on the same or different processors.
+ - Processes are **interleaved** - at any time, each processor runs an instruction of the sequential processes.
+ - ## Correctness
+ - Generalisation: A program will be correct if its preconditions hold, as then its post conditions will also hold.
+ - A concurrent program must be correct under ^^all possible **interleavings**.^^
+ - If all the maths is done in registers, then the results will depend on **interleaving** (indeterminate calculation).
+ - This dependency on unforeseen circumstances is known as a **Race Condition**.
+ - What is a **Race Condition**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:50.090Z
+ card-last-score:: 1
+ - A **Race Condition** occurs when a program output is dependent on the sequence or timing of code execution.
+ - If multiple processes of execution enter a **critical section** at about the same time, both will attempt to update the shared data structure.
+ - This will lead to surprising & undesirable results.
+ - You must work to avoid this with concurrent code.
+ - If we get different results every time we run some code, the result is **indeterminate**.
+ - What is a **Critical Section**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T07:27:24.102Z
+ card-last-reviewed:: 2022-10-18T08:27:24.103Z
+ card-last-score:: 3
+ - A **critical section** is a part of a program where a shared resource is accessed.
+ - A critical section must be protected in ways that avoid concurrent access.
+ - What are **Deterministic Computations**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:36:09.807Z
+ card-last-score:: 1
+ - **Deterministic Computations** have the same result each time.
+ - We want deterministic concurrent code.
+ - We can use synchronisation mechanisms.
+ - ### Handling Race Conditions
+ - We need a mechanism to control access to shared resources in concurrent code - **Synchronisation** is necessary for any shared data structure.
+ - The idea is to focus on the critical sections of the code, i.e., sections that access shared resources.
+ - We want critical sections to run with **mutual exclusion** - only one process should be able to execute that code at the same time.
+ - #### Critical Section Properties #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-17T23:00:00.000Z
+ card-last-reviewed:: 2022-10-17T13:27:38.061Z
+ card-last-score:: 1
+ - **Mutual Exclusion:** Only one process can access the critical section at a time.
+ - **Guarantee of Progress:** Processes outside the critical section cannot stop another from entering it.
+ - **Bounded Waiting:** A process waiting to enter the critical section will eventually enter.
+ - Processes in the critical section will eventually leave.
+ - **Performance:** The overhead of entering / exiting should be small.
+ - **Fair:** Don't make certain processes wait much longer than others.
+ - #### Atomicity #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:35.061Z
+ card-last-score:: 1
+ - Basic atomicity is provided by the hardware.
+ - E.g., References & Assignments (i.e., read & write operations) are atomic in all CPUs.
+ - However, higher-level constructs (i.e., any sequence of two or more CPU instructions) are not atomic in general.
+ - Some languages (e.g., Java) have mechanisms to specify multiple instructions as atomic.
+ - #### Conditional Synchronisation
+ - Strategy: Person $A$ writes a rough draft and then Person $B$ edits it.
+ - $A$ & $B$ cannot write at the same time (as they are working on different versions of the paper).
+ - We must ensure that $B$ cannot start until $A$ is finished.
+ - 
+ -
+- # Mutual Exclusion Solutions
+ collapsed:: true
+ - ## Locks
+ collapsed:: true
+ - What is a **lock**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:27.130Z
+ card-last-score:: 1
+ - A **lock** is a token that you need to enter a critical section of code.
+ - If a process wants to execute a critical section, it must have the lock.
+ - Need to ask for lock.
+ - Need to release lock.
+ - There are no restrictions on executing other code.
+ - 
+ - ### Lock States & Operation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:24.868Z
+ card-last-score:: 1
+ - Locks have 2 states:
+ - **Held:** Some process is in the critical section.
+ - **Not Held:** No process is in the critical section.
+ - Locks have 2 operations:
+ - **Acquire:** Mark lock as held or wait until released. If not **held**, this is executed immediately.
+ - If many processes call acquire, only one process can get the lock.
+ - **Release:** Mark lock as **not held**.
+ - ### Using Locks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:14.291Z
+ card-last-score:: 1
+ - Locks are declared like variables.
+ - `Lock myLock;`
+ - A program can use multiple locks.
+ - To use a lock, surround the critical section as follows:
+ - Call `acquire()` at the start of the critical section.
+ id:: 63442116-a2c1-4c25-9309-e880471bb359
+ - Call `release()` at the end of the critical section.
+ - 
+ - ### Lock Benefits #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:26:03.658Z
+ card-last-score:: 1
+ - Only one process can execute the critical section code at a time.
+ - When a process is finished (& calls `release()`), another process can enter the critical section.
+ - Achieves the requirements of **mutual exclusion** & **progress** for concurrent systems.
+ - ### Lock Limitations #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:16.629Z
+ card-last-score:: 1
+ - Acquiring a lock only blocks processes trying to acquire the *same* lock.
+ - Process may acquire other locks.
+ - ^^You must use the same lock for all critical sections accessing the same data (or resource).^^
+ - ### Hardware-Based Lock
+ - Processor has a special instruction called "test & set".
+ - Allows atomic read **and** update.
+ - ```c
+ //c code for test and set behaviour
+ bool test_and_set (bool *flag) {
+ bool old = *flag;
+ *flag = true;
+ return old;
+ }
+ ```
+ - #### Hardware-Based Spinlock
+ - ```c
+ struct lock {
+ bool held; //initially FALSE
+ }
+ void acquire(lock) {
+ while(test_and_set(&lock->held))
+ ; //just wait
+ return;
+ }
+ void release(lock) {
+ lock->held = FALSE;
+ }
+ ```
+ - #### Drawbacks of Spinlocks #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-22T03:46:00.445Z
+ card-last-reviewed:: 2022-10-19T08:46:00.446Z
+ card-last-score:: 5
+ - Spinlocks are a form of **busy waiting** -> they burn CPU time.
+ - Once acquired, they are held until explicitly released.
+ - Inefficient if the lock is held for long periods.
+ - OS overhead of context switching.
+ - If the Process Scheduler makes processes sleep while the lock is held, all other processes use their CPU time to spin while the process with the lock make no progress.
+ - ### Do locks give us sufficient safety? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:27:35.977Z
+ card-last-score:: 1
+ - If you can demonstrate *any* cases in which the following properties do not hold, then the system is **not correct**.
+ - 1. **Check Safety Properties:** These must *always* be true.
+ - **Mutual Exclusion:** Two processes must not interleave certain sequences of instructions.
+ - **Absence of Deadlock:** **Deadlock** is when a non-terminating system cannot respond to any signal.
+ - 2. **Check Liveness Properties:** These must *eventually* be true.
+ - **Absence of Starvation:** Information that is sent is delivered.
+ - **Fairness:** Any contention must be resolved.
+ - ### Lock Deadlock Scenario
+ - 
+ - ### Protocols to Avoid Deadlock #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T11:54:54.328Z
+ card-last-score:: 1
+ - Add a timer to the `lock.request()` method.
+ - Cancel the job & attempt it another time if it takes too long.
+ - Add a new `lock.check()` method to see if a lock is already held before requesting it.
+ - You can do something else and come back & check again.
+ - Avoid hold & wait protocol.
+ - Never hold onto one resource when you need two.
+ - ### Livelock by trying to avoid deadlock
+ - 
+ - ### Starvation
+ - What is **Starvation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:27.898Z
+ card-last-score:: 1
+ - **Starvation** is a more general case of livelock.
+ - One or more processes do not get run as another process is locking the resource.
+ - ### Locks / Critical Sections & Reliability
+ - What if a process is interrupted, suspended, or crashes inside its critical section? #card
+ - In the middle of the critical section, the system may be in an inconsistent state. The process is holding a lock, and if it dies, no other process waiting on that lock can proceed.
+ - Developers must ensure that critical regions are very short and always terminate.
+ - ### Beyond Locks
+ - Locks only provide **mutual exclusion**.
+ - They ensure that only one process is in the critical section at a time.
+ - Locks are good for protecting our shared resource to prevent race conditions & avoid non-deterministic execution.
+ - What about fairness, avoiding starvation, & livelock?
+ - We need to be able to place an ordering on the scheduling of a process.
+ -
+ - ## Semaphores
+ collapsed:: true
+ - Example: We want to place an order on when processes execute.
+ background-color:: green
+ - Producer-Consumer:
+ - Producer: Creates a resource (data).
+ - Consumer: Uses a resource (data).
+ - E.g.: `ps | grep "gcc" | wc`.
+ - Don't want producers & consumers to operate in **lockstep** (i.e., atomicity).
+ - Each command must wait for the previous output.
+ - Implies lots of context switching (i.e., very expensive).
+ - ^^**Solution:** Place a fixed-size buffer between producers & consumers.^^
+ - ^^Synchronise access to buffer.^^
+ - ^^Producer waits if the buffer is full; the consumer waits if the buffer is empty.^^
+ - What is a **semaphore**? #card
+ - A **semaphore** is a higher-level synchronisation primitive.
+ - Semaphores are a kind of **generalised lock**.
+ - They are the main synchronisation primitive used in the original UNIX.
+ - Semaphores are implemented with a **counter** that is manipulated atomically via 2 operations: **signal** & **wait**.
+ - `wait(semaphore)`: AKA `down()` or `P()`.
+ - **Decrement** counter.
+ - If counter is zero, then block until semaphore is **signalled**.
+ - `signal(semaphore)`: AKA `up()` or `V()`.
+ - **Increment** counter.
+ - Wake up one **waiter**, if any.
+ - `sem_init(semaphore, counter)`:
+ - Set initial counter value.
+ - ### Semaphore PseudoCode #card
+ - `wait()` & `signal()` are **critical sections**.
+ - Hence, they must be executed **atomically** with respect to each other.
+ - Each semaphore has an associated queue of processes.
+ - When `wait()` is called by a process:
+ - If the semaphore is available -> the process continues.
+ - If the semaphore is unavailable -> the process blocks, waits on queue.
+ - `signal()` opens the semaphore.
+ - If processes are waiting on a queue -> one process is unblocked.
+ - If no processes are on the queue -> the signal is remembered for the next time `wait()` is called.
+ - Note: Blocking processes is **not** spinning - they release the CPU to do other work.
+ - ```pseudocode
+ struct semaphore {
+ int value;
+ queue L[]; // list of processes
+ }
+ - wait (S) {
+ if (s.value > 0) {
+ s.value--;
+ }
+ else {
+ add this process to s.L;
+ block;
+ }
+ }
+ - signal(S) {
+ if (S.L != EMPTY) {
+ remove a process P from S.L;
+ wakeup(P);
+ }
+ else {
+ s.value++;
+ }
+ }
+ ```
+ - ### Semaphore Initialisation
+ - If the semaphore is initialised to `1`: #card
+ - The first call to `wait` goes through -> The semaphore value goes from `1` to `0`.
+ - The second call to `wait` **blocks** -> The semaphore value stays at `0`, the process goes on the queue.
+ - If the first process calls `signal()` -> The semaphore value stays at `0` and wakes up the second process.
+ - The semaphore acts like a **mutex lock**.
+ - We can use semaphores to implement locks.
+ - This is called a **binary semaphore**.
+ - If the semaphore is initialised to `2`: #card
+ - The initial value of the semaphore = the number of processes that can be active at once.
+ - `sem_init(sem, 2)`:
+ - `value = 2, L = []`.
+ - Consider multiple processes:
+ - Process1: `wait(sem)`.
+ - `value = 1, L = []` -> P1 executes.
+ - Process2: `wait(sem)`.
+ - `value = 0, L = []` -> P2 executes.
+ - Process3: `wait(sem)`.
+ - `value = 0, L = [P3]` -> P3 blocks.
+ - ### Counting Semaphores #card
+ - Allocating a number of resources.
+ - Shared buffers: each time you want to access a buffer, call `wait()`.
+ - You are queued if there is no buffer available.
+ - Counter is initialised to $N$ = number resources.
+ - This is called a **counting semaphore**.
+ - Useful for **conditional synchronisation**.
+ - i.e., if one process is waiting for another process to finish a price of work before it continues.
+ - ### Semaphores for Mutual Exclusion #card
+ - With semaphores, guaranteeing mutual exclusion for $N$ processes is trivial.
+ - ```c
+ semaphore mutex = 1;
+
+ void Process(int i) {
+ while (1) {
+ // Non-Critical Section Bit
+ wait(mutex); // grab the mutual exclusion semaphore
+ // Do the Critical Section Bit
+ signal(mutex);
+ }
+ }
+
+ int main() {
+ cobegin {
+ Process(1); Process(2);
+ }
+ }
+ ```
+ - ### Bounded Buffer Problem #card
+ collapsed:: true
+ - Producer-Consumer Problem:
+ - Buffer in memory - finite size of $N$ entries.
+ - A producer process inserts an entry into the buffer.
+ - A consumer process removes an entry from the buffer.
+ - Processes are **concurrent** - we must use a synchronisation mechanism to control access to shared variables describing the buffer state.
+ - #### Producer-Consumer Single Buffer
+ - Simplest case:
+ - Single producer process & single consumer process.
+ - Single shared buffer between the producer & consumer.
+ - Requirements:
+ - Consumer must wait for Producer to fill the buffer.
+ - Producer must wait for the Consumer to empty the buffer (if filled).
+ - 
+ -
+ - ### Semaphores Can Be Hard to Use #card
+ - Complex patterns of resource usage.
+ - Cannot capture relationships with semaphores alone.
+ - Need extra state variables to record information.
+ - Produce buggy code that is hard to write.
+ - E.g., if one coder forgets to do `V()`/`signal()` after a critical section, the whole system can deadlock.
+ - ## Monitors
+ collapsed:: true
+ - What are **Monitors**? #card
+ - **Monitors** are an extension of the monolithic monitor used in the OS t allocate memory.
+ - A programming language construct that supports controlled access to shared data.
+ - Synchronisation code added by compiler, enforced at runtime -> less work for programmer.
+ - Monitors can keep track of **who** is allowed to access the shared data and **when** they can do it.
+ - Monitors are a higher-level construct than semaphores.
+ - Monitors encapsulate:
+ - Shared data structures.
+ - Procedures that operate on shared data.
+ - Synchronisation between concurrent processes that invoke these procedures.
+ -
+- # Detection & Protection of Deadlock
+ - ## Requirements for Deadlock #card
+ - All four conditions must hold for deadlock to occur:
+ - 1. **Mutex:** At least **one** resource must be **non-shareable**.
+ 2. **No Pre-Emption:** Resources cannot be **pre-empted** (no way to break priority or take a resource away once allocated).
+ - Locks have this property.
+ - 3. **Hold & Wait:** There is an existing process holding a resource and waiting for another resource.
+ 4. **Circular Wait:** There exists a set of process $P_1, P_2, \cdots, P_N$ such that $P_1$ is waiting for $P_2$, $P_2$ is waiting for $P_3$, ..., and $P_N$ is waiting for $P_1$.
+ - If only three conditions hold then you can get **starvation**, but not deadlock.
+ - ## Deadlocks Without Locks #card
+ - Deadlocks can occur for any resource or any time a process waits, e.g.:
+ - Messages: waiting to receive a message before sending a message.
+ - i.e., hold & wait.
+ - Allocation: waiting to allocate resources before freeing another resource.
+ - i.e., hold & wait.
+ - ## Dealing with Deadlocks #card
+ - ### Strategy 1: Ignore #card
+ - Ignore the fact that deadlocks may occur.
+ - Write code, put nothing special in.
+ - Sometimes you have to reboot the system.
+ - May work for some unimportant or simple applications where deadlock does not occur often.
+ - Quite a common approach.
+ - ### Strategy 2: Reactive #card
+ - Periodically check for evidence of a deadlock.
+ - E.g., add timeouts to acquiring a lock, if you timeout, then it implies that deadlock has occurred and you must do something.
+ - Recovery actions:
+ - Blue screen of death & reboot computer.
+ - Pick a process to terminate, e.g., a low-priority one.
+ - Only works with some types of applications.
+ - May corrupt data, so the process needs to do clean-up when terminated.
+ - ### Strategy 3: Proactive #card
+ - Prevent one of the four necessary conditions for deadlock.
+ - No single approach is appropriate (or possible) for all circumstances.
+ - Need techniques for each of the four conditions.
+ - #### Solution 1: No Mutual Exclusion
+ - Make resources shareable.
+ - E.g., read-only files - no need for locks.
+ - ### Solution 2: Adding Pre-Emption
+ - Locks cannot be pre-empted but other pre-emptive methods are possible.
+ - Strategy: pre-empt resources.
+ - Example: If process $A$ is waiting for a resource held by process $B$, then take the resource from $B$ and give it to $A$.
+ - Problems:
+ - Only works for some resources
+ - E.g., CPU & Memory (using virtual memory).
+ - Not possible if a resource cannot be saved & restored.
+ - Otherwise, taking away a lock causes issues.
+ - Also, there is an overhead cost for "pre-empt" & "restore".
+ - ### Solution 3: Avoid Hold & Wait
+ - Only request a resource when you have none, i.e., release a resource before requesting another.
+ - Never hold $x$ when want $y$.
+ - Works in many cases, but you cannot maintain a relationship between $x$ & $y$.
+ - Acquire all resources at once, e.g., use a single lock to protect all data.
+ - Having fewer locks is called **lock coarsening**.
+ - Problem: All processes accessing $A$ or $B$ cannot run at the same time, even if they don't access both variables.
+ - #### Solution 4: Eliminate Circular Waits
+ - Strategy: Impose an ordering on resources.
+ - Processes must acquire the highest-ranked resource first.
+ - Locks are always acquired in the same order.
+ - We have eliminated the circular dependency, but we will need to lock a resource for a longer period.
+ - Strategy: Define an ordering of **all** locks in your program.
+ - Always acquire locks in that order.
+ - Problem: Sometimes you do not know the order that the events will be used.
+ - How do we know the global order?
+ - Need extra code to find this out and then acquire them in the right order.
+ - It could get worse.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-10T12_58_13.911Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-10T12_58_13.911Z.Desktop.md
new file mode 100644
index 00000000..007c50d7
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-10T12_58_13.911Z.Desktop.md
@@ -0,0 +1,468 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[CPU Management - Scheduling]]
+- **Next Topic:** [[Memory Management]]
+- **Relevant Slides:** 
+-
+- # Concurrent Programming
+ collapsed:: true
+ - What are **Concurrent Programs**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T10:56:45.458Z
+ card-last-reviewed:: 2022-10-18T11:56:45.458Z
+ card-last-score:: 3
+ - **Concurrent Programs** are interleaving sets of sequential atomic instructions.
+ - i.e., interacting sequential processes that run at the same time, on the same or different processors.
+ - Processes are **interleaved** - at any time, each processor runs an instruction of the sequential processes.
+ - ## Correctness
+ - Generalisation: A program will be correct if its preconditions hold, as then its post conditions will also hold.
+ - A concurrent program must be correct under ^^all possible **interleavings**.^^
+ - If all the maths is done in registers, then the results will depend on **interleaving** (indeterminate calculation).
+ - This dependency on unforeseen circumstances is known as a **Race Condition**.
+ - What is a **Race Condition**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:50.090Z
+ card-last-score:: 1
+ - A **Race Condition** occurs when a program output is dependent on the sequence or timing of code execution.
+ - If multiple processes of execution enter a **critical section** at about the same time, both will attempt to update the shared data structure.
+ - This will lead to surprising & undesirable results.
+ - You must work to avoid this with concurrent code.
+ - If we get different results every time we run some code, the result is **indeterminate**.
+ - What is a **Critical Section**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T07:27:24.102Z
+ card-last-reviewed:: 2022-10-18T08:27:24.103Z
+ card-last-score:: 3
+ - A **critical section** is a part of a program where a shared resource is accessed.
+ - A critical section must be protected in ways that avoid concurrent access.
+ - What are **Deterministic Computations**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:36:09.807Z
+ card-last-score:: 1
+ - **Deterministic Computations** have the same result each time.
+ - We want deterministic concurrent code.
+ - We can use synchronisation mechanisms.
+ - ### Handling Race Conditions
+ - We need a mechanism to control access to shared resources in concurrent code - **Synchronisation** is necessary for any shared data structure.
+ - The idea is to focus on the critical sections of the code, i.e., sections that access shared resources.
+ - We want critical sections to run with **mutual exclusion** - only one process should be able to execute that code at the same time.
+ - #### Critical Section Properties #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-17T23:00:00.000Z
+ card-last-reviewed:: 2022-10-17T13:27:38.061Z
+ card-last-score:: 1
+ - **Mutual Exclusion:** Only one process can access the critical section at a time.
+ - **Guarantee of Progress:** Processes outside the critical section cannot stop another from entering it.
+ - **Bounded Waiting:** A process waiting to enter the critical section will eventually enter.
+ - Processes in the critical section will eventually leave.
+ - **Performance:** The overhead of entering / exiting should be small.
+ - **Fair:** Don't make certain processes wait much longer than others.
+ - #### Atomicity #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:35.061Z
+ card-last-score:: 1
+ - Basic atomicity is provided by the hardware.
+ - E.g., References & Assignments (i.e., read & write operations) are atomic in all CPUs.
+ - However, higher-level constructs (i.e., any sequence of two or more CPU instructions) are not atomic in general.
+ - Some languages (e.g., Java) have mechanisms to specify multiple instructions as atomic.
+ - #### Conditional Synchronisation
+ - Strategy: Person $A$ writes a rough draft and then Person $B$ edits it.
+ - $A$ & $B$ cannot write at the same time (as they are working on different versions of the paper).
+ - We must ensure that $B$ cannot start until $A$ is finished.
+ - 
+ -
+- # Mutual Exclusion Solutions
+ collapsed:: true
+ - ## Locks
+ collapsed:: true
+ - What is a **lock**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:27.130Z
+ card-last-score:: 1
+ - A **lock** is a token that you need to enter a critical section of code.
+ - If a process wants to execute a critical section, it must have the lock.
+ - Need to ask for lock.
+ - Need to release lock.
+ - There are no restrictions on executing other code.
+ - 
+ - ### Lock States & Operation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:24.868Z
+ card-last-score:: 1
+ - Locks have 2 states:
+ - **Held:** Some process is in the critical section.
+ - **Not Held:** No process is in the critical section.
+ - Locks have 2 operations:
+ - **Acquire:** Mark lock as held or wait until released. If not **held**, this is executed immediately.
+ - If many processes call acquire, only one process can get the lock.
+ - **Release:** Mark lock as **not held**.
+ - ### Using Locks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:14.291Z
+ card-last-score:: 1
+ - Locks are declared like variables.
+ - `Lock myLock;`
+ - A program can use multiple locks.
+ - To use a lock, surround the critical section as follows:
+ - Call `acquire()` at the start of the critical section.
+ id:: 63442116-a2c1-4c25-9309-e880471bb359
+ - Call `release()` at the end of the critical section.
+ - 
+ - ### Lock Benefits #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:26:03.658Z
+ card-last-score:: 1
+ - Only one process can execute the critical section code at a time.
+ - When a process is finished (& calls `release()`), another process can enter the critical section.
+ - Achieves the requirements of **mutual exclusion** & **progress** for concurrent systems.
+ - ### Lock Limitations #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:16.629Z
+ card-last-score:: 1
+ - Acquiring a lock only blocks processes trying to acquire the *same* lock.
+ - Process may acquire other locks.
+ - ^^You must use the same lock for all critical sections accessing the same data (or resource).^^
+ - ### Hardware-Based Lock
+ - Processor has a special instruction called "test & set".
+ - Allows atomic read **and** update.
+ - ```c
+ //c code for test and set behaviour
+ bool test_and_set (bool *flag) {
+ bool old = *flag;
+ *flag = true;
+ return old;
+ }
+ ```
+ - #### Hardware-Based Spinlock
+ - ```c
+ struct lock {
+ bool held; //initially FALSE
+ }
+ void acquire(lock) {
+ while(test_and_set(&lock->held))
+ ; //just wait
+ return;
+ }
+ void release(lock) {
+ lock->held = FALSE;
+ }
+ ```
+ - #### Drawbacks of Spinlocks #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-22T03:46:00.445Z
+ card-last-reviewed:: 2022-10-19T08:46:00.446Z
+ card-last-score:: 5
+ - Spinlocks are a form of **busy waiting** -> they burn CPU time.
+ - Once acquired, they are held until explicitly released.
+ - Inefficient if the lock is held for long periods.
+ - OS overhead of context switching.
+ - If the Process Scheduler makes processes sleep while the lock is held, all other processes use their CPU time to spin while the process with the lock make no progress.
+ - ### Do locks give us sufficient safety? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:45:25.529Z
+ card-last-score:: 1
+ - If you can demonstrate *any* cases in which the following properties do not hold, then the system is **not correct**.
+ - 1. **Check Safety Properties:** These must *always* be true.
+ - **Mutual Exclusion:** Two processes must not interleave certain sequences of instructions.
+ - **Absence of Deadlock:** **Deadlock** is when a non-terminating system cannot respond to any signal.
+ - 2. **Check Liveness Properties:** These must *eventually* be true.
+ - **Absence of Starvation:** Information that is sent is delivered.
+ - **Fairness:** Any contention must be resolved.
+ - ### Lock Deadlock Scenario
+ - 
+ - ### Protocols to Avoid Deadlock #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T11:54:54.328Z
+ card-last-score:: 1
+ - Add a timer to the `lock.request()` method.
+ - Cancel the job & attempt it another time if it takes too long.
+ - Add a new `lock.check()` method to see if a lock is already held before requesting it.
+ - You can do something else and come back & check again.
+ - Avoid hold & wait protocol.
+ - Never hold onto one resource when you need two.
+ - ### Livelock by trying to avoid deadlock
+ - 
+ - ### Starvation
+ - What is **Starvation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:27.898Z
+ card-last-score:: 1
+ - **Starvation** is a more general case of livelock.
+ - One or more processes do not get run as another process is locking the resource.
+ - ### Locks / Critical Sections & Reliability
+ - What if a process is interrupted, suspended, or crashes inside its critical section? #card
+ - In the middle of the critical section, the system may be in an inconsistent state. The process is holding a lock, and if it dies, no other process waiting on that lock can proceed.
+ - Developers must ensure that critical regions are very short and always terminate.
+ - ### Beyond Locks
+ - Locks only provide **mutual exclusion**.
+ - They ensure that only one process is in the critical section at a time.
+ - Locks are good for protecting our shared resource to prevent race conditions & avoid non-deterministic execution.
+ - What about fairness, avoiding starvation, & livelock?
+ - We need to be able to place an ordering on the scheduling of a process.
+ -
+ - ## Semaphores
+ collapsed:: true
+ - Example: We want to place an order on when processes execute.
+ background-color:: green
+ - Producer-Consumer:
+ - Producer: Creates a resource (data).
+ - Consumer: Uses a resource (data).
+ - E.g.: `ps | grep "gcc" | wc`.
+ - Don't want producers & consumers to operate in **lockstep** (i.e., atomicity).
+ - Each command must wait for the previous output.
+ - Implies lots of context switching (i.e., very expensive).
+ - ^^**Solution:** Place a fixed-size buffer between producers & consumers.^^
+ - ^^Synchronise access to buffer.^^
+ - ^^Producer waits if the buffer is full; the consumer waits if the buffer is empty.^^
+ - What is a **semaphore**? #card
+ - A **semaphore** is a higher-level synchronisation primitive.
+ - Semaphores are a kind of **generalised lock**.
+ - They are the main synchronisation primitive used in the original UNIX.
+ - Semaphores are implemented with a **counter** that is manipulated atomically via 2 operations: **signal** & **wait**.
+ - `wait(semaphore)`: AKA `down()` or `P()`.
+ - **Decrement** counter.
+ - If counter is zero, then block until semaphore is **signalled**.
+ - `signal(semaphore)`: AKA `up()` or `V()`.
+ - **Increment** counter.
+ - Wake up one **waiter**, if any.
+ - `sem_init(semaphore, counter)`:
+ - Set initial counter value.
+ - ### Semaphore PseudoCode #card
+ - `wait()` & `signal()` are **critical sections**.
+ - Hence, they must be executed **atomically** with respect to each other.
+ - Each semaphore has an associated queue of processes.
+ - When `wait()` is called by a process:
+ - If the semaphore is available -> the process continues.
+ - If the semaphore is unavailable -> the process blocks, waits on queue.
+ - `signal()` opens the semaphore.
+ - If processes are waiting on a queue -> one process is unblocked.
+ - If no processes are on the queue -> the signal is remembered for the next time `wait()` is called.
+ - Note: Blocking processes is **not** spinning - they release the CPU to do other work.
+ - ```pseudocode
+ struct semaphore {
+ int value;
+ queue L[]; // list of processes
+ }
+ - wait (S) {
+ if (s.value > 0) {
+ s.value--;
+ }
+ else {
+ add this process to s.L;
+ block;
+ }
+ }
+ - signal(S) {
+ if (S.L != EMPTY) {
+ remove a process P from S.L;
+ wakeup(P);
+ }
+ else {
+ s.value++;
+ }
+ }
+ ```
+ - ### Semaphore Initialisation
+ - If the semaphore is initialised to `1`: #card
+ - The first call to `wait` goes through -> The semaphore value goes from `1` to `0`.
+ - The second call to `wait` **blocks** -> The semaphore value stays at `0`, the process goes on the queue.
+ - If the first process calls `signal()` -> The semaphore value stays at `0` and wakes up the second process.
+ - The semaphore acts like a **mutex lock**.
+ - We can use semaphores to implement locks.
+ - This is called a **binary semaphore**.
+ - If the semaphore is initialised to `2`: #card
+ - The initial value of the semaphore = the number of processes that can be active at once.
+ - `sem_init(sem, 2)`:
+ - `value = 2, L = []`.
+ - Consider multiple processes:
+ - Process1: `wait(sem)`.
+ - `value = 1, L = []` -> P1 executes.
+ - Process2: `wait(sem)`.
+ - `value = 0, L = []` -> P2 executes.
+ - Process3: `wait(sem)`.
+ - `value = 0, L = [P3]` -> P3 blocks.
+ - ### Counting Semaphores #card
+ - Allocating a number of resources.
+ - Shared buffers: each time you want to access a buffer, call `wait()`.
+ - You are queued if there is no buffer available.
+ - Counter is initialised to $N$ = number resources.
+ - This is called a **counting semaphore**.
+ - Useful for **conditional synchronisation**.
+ - i.e., if one process is waiting for another process to finish a price of work before it continues.
+ - ### Semaphores for Mutual Exclusion #card
+ - With semaphores, guaranteeing mutual exclusion for $N$ processes is trivial.
+ - ```c
+ semaphore mutex = 1;
+
+ void Process(int i) {
+ while (1) {
+ // Non-Critical Section Bit
+ wait(mutex); // grab the mutual exclusion semaphore
+ // Do the Critical Section Bit
+ signal(mutex);
+ }
+ }
+
+ int main() {
+ cobegin {
+ Process(1); Process(2);
+ }
+ }
+ ```
+ - ### Bounded Buffer Problem #card
+ collapsed:: true
+ - Producer-Consumer Problem:
+ - Buffer in memory - finite size of $N$ entries.
+ - A producer process inserts an entry into the buffer.
+ - A consumer process removes an entry from the buffer.
+ - Processes are **concurrent** - we must use a synchronisation mechanism to control access to shared variables describing the buffer state.
+ - #### Producer-Consumer Single Buffer
+ - Simplest case:
+ - Single producer process & single consumer process.
+ - Single shared buffer between the producer & consumer.
+ - Requirements:
+ - Consumer must wait for Producer to fill the buffer.
+ - Producer must wait for the Consumer to empty the buffer (if filled).
+ - 
+ -
+ - ### Semaphores Can Be Hard to Use #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:40:18.812Z
+ card-last-score:: 1
+ - Complex patterns of resource usage.
+ - Cannot capture relationships with semaphores alone.
+ - Need extra state variables to record information.
+ - Produce buggy code that is hard to write.
+ - E.g., if one coder forgets to do `V()`/`signal()` after a critical section, the whole system can deadlock.
+ - ## Monitors
+ collapsed:: true
+ - What are **Monitors**? #card
+ - **Monitors** are an extension of the monolithic monitor used in the OS t allocate memory.
+ - A programming language construct that supports controlled access to shared data.
+ - Synchronisation code added by compiler, enforced at runtime -> less work for programmer.
+ - Monitors can keep track of **who** is allowed to access the shared data and **when** they can do it.
+ - Monitors are a higher-level construct than semaphores.
+ - Monitors encapsulate:
+ - Shared data structures.
+ - Procedures that operate on shared data.
+ - Synchronisation between concurrent processes that invoke these procedures.
+ -
+- # Detection & Protection of Deadlock
+ - ## Requirements for Deadlock #card
+ - All four conditions must hold for deadlock to occur:
+ - 1. **Mutex:** At least **one** resource must be **non-shareable**.
+ 2. **No Pre-Emption:** Resources cannot be **pre-empted** (no way to break priority or take a resource away once allocated).
+ - Locks have this property.
+ - 3. **Hold & Wait:** There is an existing process holding a resource and waiting for another resource.
+ 4. **Circular Wait:** There exists a set of process $P_1, P_2, \cdots, P_N$ such that $P_1$ is waiting for $P_2$, $P_2$ is waiting for $P_3$, ..., and $P_N$ is waiting for $P_1$.
+ - If only three conditions hold then you can get **starvation**, but not deadlock.
+ - ## Deadlocks Without Locks #card
+ - Deadlocks can occur for any resource or any time a process waits, e.g.:
+ - Messages: waiting to receive a message before sending a message.
+ - i.e., hold & wait.
+ - Allocation: waiting to allocate resources before freeing another resource.
+ - i.e., hold & wait.
+ - ## Dealing with Deadlocks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:42:50.653Z
+ card-last-score:: 1
+ - ### Strategy 1: Ignore #card
+ collapsed:: true
+ - Ignore the fact that deadlocks may occur.
+ - Write code, put nothing special in.
+ - Sometimes you have to reboot the system.
+ - May work for some unimportant or simple applications where deadlock does not occur often.
+ - Quite a common approach.
+ - ### Strategy 2: Reactive #card
+ collapsed:: true
+ - Periodically check for evidence of a deadlock.
+ - E.g., add timeouts to acquiring a lock, if you timeout, then it implies that deadlock has occurred and you must do something.
+ - Recovery actions:
+ - Blue screen of death & reboot computer.
+ - Pick a process to terminate, e.g., a low-priority one.
+ - Only works with some types of applications.
+ - May corrupt data, so the process needs to do clean-up when terminated.
+ - ### Strategy 3: Proactive #card
+ collapsed:: true
+ - Prevent one of the four necessary conditions for deadlock.
+ - No single approach is appropriate (or possible) for all circumstances.
+ - Need techniques for each of the four conditions.
+ - #### Solution 1: No Mutual Exclusion
+ - Make resources shareable.
+ - E.g., read-only files - no need for locks.
+ - ### Solution 2: Adding Pre-Emption
+ - Locks cannot be pre-empted but other pre-emptive methods are possible.
+ - Strategy: pre-empt resources.
+ - Example: If process $A$ is waiting for a resource held by process $B$, then take the resource from $B$ and give it to $A$.
+ - Problems:
+ - Only works for some resources
+ - E.g., CPU & Memory (using virtual memory).
+ - Not possible if a resource cannot be saved & restored.
+ - Otherwise, taking away a lock causes issues.
+ - Also, there is an overhead cost for "pre-empt" & "restore".
+ - ### Solution 3: Avoid Hold & Wait
+ - Only request a resource when you have none, i.e., release a resource before requesting another.
+ - Never hold $x$ when want $y$.
+ - Works in many cases, but you cannot maintain a relationship between $x$ & $y$.
+ - Acquire all resources at once, e.g., use a single lock to protect all data.
+ - Having fewer locks is called **lock coarsening**.
+ - Problem: All processes accessing $A$ or $B$ cannot run at the same time, even if they don't access both variables.
+ - #### Solution 4: Eliminate Circular Waits
+ - Strategy: Impose an ordering on resources.
+ - Processes must acquire the highest-ranked resource first.
+ - Locks are always acquired in the same order.
+ - We have eliminated the circular dependency, but we will need to lock a resource for a longer period.
+ - Strategy: Define an ordering of **all** locks in your program.
+ - Always acquire locks in that order.
+ - Problem: Sometimes you do not know the order that the events will be used.
+ - How do we know the global order?
+ - Need extra code to find this out and then acquire them in the right order.
+ - It could get worse.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-10T15_58_09.936Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-10T15_58_09.936Z.Desktop.md
new file mode 100644
index 00000000..007c50d7
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-10T15_58_09.936Z.Desktop.md
@@ -0,0 +1,468 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[CPU Management - Scheduling]]
+- **Next Topic:** [[Memory Management]]
+- **Relevant Slides:** 
+-
+- # Concurrent Programming
+ collapsed:: true
+ - What are **Concurrent Programs**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T10:56:45.458Z
+ card-last-reviewed:: 2022-10-18T11:56:45.458Z
+ card-last-score:: 3
+ - **Concurrent Programs** are interleaving sets of sequential atomic instructions.
+ - i.e., interacting sequential processes that run at the same time, on the same or different processors.
+ - Processes are **interleaved** - at any time, each processor runs an instruction of the sequential processes.
+ - ## Correctness
+ - Generalisation: A program will be correct if its preconditions hold, as then its post conditions will also hold.
+ - A concurrent program must be correct under ^^all possible **interleavings**.^^
+ - If all the maths is done in registers, then the results will depend on **interleaving** (indeterminate calculation).
+ - This dependency on unforeseen circumstances is known as a **Race Condition**.
+ - What is a **Race Condition**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:50.090Z
+ card-last-score:: 1
+ - A **Race Condition** occurs when a program output is dependent on the sequence or timing of code execution.
+ - If multiple processes of execution enter a **critical section** at about the same time, both will attempt to update the shared data structure.
+ - This will lead to surprising & undesirable results.
+ - You must work to avoid this with concurrent code.
+ - If we get different results every time we run some code, the result is **indeterminate**.
+ - What is a **Critical Section**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T07:27:24.102Z
+ card-last-reviewed:: 2022-10-18T08:27:24.103Z
+ card-last-score:: 3
+ - A **critical section** is a part of a program where a shared resource is accessed.
+ - A critical section must be protected in ways that avoid concurrent access.
+ - What are **Deterministic Computations**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:36:09.807Z
+ card-last-score:: 1
+ - **Deterministic Computations** have the same result each time.
+ - We want deterministic concurrent code.
+ - We can use synchronisation mechanisms.
+ - ### Handling Race Conditions
+ - We need a mechanism to control access to shared resources in concurrent code - **Synchronisation** is necessary for any shared data structure.
+ - The idea is to focus on the critical sections of the code, i.e., sections that access shared resources.
+ - We want critical sections to run with **mutual exclusion** - only one process should be able to execute that code at the same time.
+ - #### Critical Section Properties #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-17T23:00:00.000Z
+ card-last-reviewed:: 2022-10-17T13:27:38.061Z
+ card-last-score:: 1
+ - **Mutual Exclusion:** Only one process can access the critical section at a time.
+ - **Guarantee of Progress:** Processes outside the critical section cannot stop another from entering it.
+ - **Bounded Waiting:** A process waiting to enter the critical section will eventually enter.
+ - Processes in the critical section will eventually leave.
+ - **Performance:** The overhead of entering / exiting should be small.
+ - **Fair:** Don't make certain processes wait much longer than others.
+ - #### Atomicity #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:35.061Z
+ card-last-score:: 1
+ - Basic atomicity is provided by the hardware.
+ - E.g., References & Assignments (i.e., read & write operations) are atomic in all CPUs.
+ - However, higher-level constructs (i.e., any sequence of two or more CPU instructions) are not atomic in general.
+ - Some languages (e.g., Java) have mechanisms to specify multiple instructions as atomic.
+ - #### Conditional Synchronisation
+ - Strategy: Person $A$ writes a rough draft and then Person $B$ edits it.
+ - $A$ & $B$ cannot write at the same time (as they are working on different versions of the paper).
+ - We must ensure that $B$ cannot start until $A$ is finished.
+ - 
+ -
+- # Mutual Exclusion Solutions
+ collapsed:: true
+ - ## Locks
+ collapsed:: true
+ - What is a **lock**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:27.130Z
+ card-last-score:: 1
+ - A **lock** is a token that you need to enter a critical section of code.
+ - If a process wants to execute a critical section, it must have the lock.
+ - Need to ask for lock.
+ - Need to release lock.
+ - There are no restrictions on executing other code.
+ - 
+ - ### Lock States & Operation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:24.868Z
+ card-last-score:: 1
+ - Locks have 2 states:
+ - **Held:** Some process is in the critical section.
+ - **Not Held:** No process is in the critical section.
+ - Locks have 2 operations:
+ - **Acquire:** Mark lock as held or wait until released. If not **held**, this is executed immediately.
+ - If many processes call acquire, only one process can get the lock.
+ - **Release:** Mark lock as **not held**.
+ - ### Using Locks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:14.291Z
+ card-last-score:: 1
+ - Locks are declared like variables.
+ - `Lock myLock;`
+ - A program can use multiple locks.
+ - To use a lock, surround the critical section as follows:
+ - Call `acquire()` at the start of the critical section.
+ id:: 63442116-a2c1-4c25-9309-e880471bb359
+ - Call `release()` at the end of the critical section.
+ - 
+ - ### Lock Benefits #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:26:03.658Z
+ card-last-score:: 1
+ - Only one process can execute the critical section code at a time.
+ - When a process is finished (& calls `release()`), another process can enter the critical section.
+ - Achieves the requirements of **mutual exclusion** & **progress** for concurrent systems.
+ - ### Lock Limitations #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:16.629Z
+ card-last-score:: 1
+ - Acquiring a lock only blocks processes trying to acquire the *same* lock.
+ - Process may acquire other locks.
+ - ^^You must use the same lock for all critical sections accessing the same data (or resource).^^
+ - ### Hardware-Based Lock
+ - Processor has a special instruction called "test & set".
+ - Allows atomic read **and** update.
+ - ```c
+ //c code for test and set behaviour
+ bool test_and_set (bool *flag) {
+ bool old = *flag;
+ *flag = true;
+ return old;
+ }
+ ```
+ - #### Hardware-Based Spinlock
+ - ```c
+ struct lock {
+ bool held; //initially FALSE
+ }
+ void acquire(lock) {
+ while(test_and_set(&lock->held))
+ ; //just wait
+ return;
+ }
+ void release(lock) {
+ lock->held = FALSE;
+ }
+ ```
+ - #### Drawbacks of Spinlocks #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-22T03:46:00.445Z
+ card-last-reviewed:: 2022-10-19T08:46:00.446Z
+ card-last-score:: 5
+ - Spinlocks are a form of **busy waiting** -> they burn CPU time.
+ - Once acquired, they are held until explicitly released.
+ - Inefficient if the lock is held for long periods.
+ - OS overhead of context switching.
+ - If the Process Scheduler makes processes sleep while the lock is held, all other processes use their CPU time to spin while the process with the lock make no progress.
+ - ### Do locks give us sufficient safety? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:45:25.529Z
+ card-last-score:: 1
+ - If you can demonstrate *any* cases in which the following properties do not hold, then the system is **not correct**.
+ - 1. **Check Safety Properties:** These must *always* be true.
+ - **Mutual Exclusion:** Two processes must not interleave certain sequences of instructions.
+ - **Absence of Deadlock:** **Deadlock** is when a non-terminating system cannot respond to any signal.
+ - 2. **Check Liveness Properties:** These must *eventually* be true.
+ - **Absence of Starvation:** Information that is sent is delivered.
+ - **Fairness:** Any contention must be resolved.
+ - ### Lock Deadlock Scenario
+ - 
+ - ### Protocols to Avoid Deadlock #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T11:54:54.328Z
+ card-last-score:: 1
+ - Add a timer to the `lock.request()` method.
+ - Cancel the job & attempt it another time if it takes too long.
+ - Add a new `lock.check()` method to see if a lock is already held before requesting it.
+ - You can do something else and come back & check again.
+ - Avoid hold & wait protocol.
+ - Never hold onto one resource when you need two.
+ - ### Livelock by trying to avoid deadlock
+ - 
+ - ### Starvation
+ - What is **Starvation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:27.898Z
+ card-last-score:: 1
+ - **Starvation** is a more general case of livelock.
+ - One or more processes do not get run as another process is locking the resource.
+ - ### Locks / Critical Sections & Reliability
+ - What if a process is interrupted, suspended, or crashes inside its critical section? #card
+ - In the middle of the critical section, the system may be in an inconsistent state. The process is holding a lock, and if it dies, no other process waiting on that lock can proceed.
+ - Developers must ensure that critical regions are very short and always terminate.
+ - ### Beyond Locks
+ - Locks only provide **mutual exclusion**.
+ - They ensure that only one process is in the critical section at a time.
+ - Locks are good for protecting our shared resource to prevent race conditions & avoid non-deterministic execution.
+ - What about fairness, avoiding starvation, & livelock?
+ - We need to be able to place an ordering on the scheduling of a process.
+ -
+ - ## Semaphores
+ collapsed:: true
+ - Example: We want to place an order on when processes execute.
+ background-color:: green
+ - Producer-Consumer:
+ - Producer: Creates a resource (data).
+ - Consumer: Uses a resource (data).
+ - E.g.: `ps | grep "gcc" | wc`.
+ - Don't want producers & consumers to operate in **lockstep** (i.e., atomicity).
+ - Each command must wait for the previous output.
+ - Implies lots of context switching (i.e., very expensive).
+ - ^^**Solution:** Place a fixed-size buffer between producers & consumers.^^
+ - ^^Synchronise access to buffer.^^
+ - ^^Producer waits if the buffer is full; the consumer waits if the buffer is empty.^^
+ - What is a **semaphore**? #card
+ - A **semaphore** is a higher-level synchronisation primitive.
+ - Semaphores are a kind of **generalised lock**.
+ - They are the main synchronisation primitive used in the original UNIX.
+ - Semaphores are implemented with a **counter** that is manipulated atomically via 2 operations: **signal** & **wait**.
+ - `wait(semaphore)`: AKA `down()` or `P()`.
+ - **Decrement** counter.
+ - If counter is zero, then block until semaphore is **signalled**.
+ - `signal(semaphore)`: AKA `up()` or `V()`.
+ - **Increment** counter.
+ - Wake up one **waiter**, if any.
+ - `sem_init(semaphore, counter)`:
+ - Set initial counter value.
+ - ### Semaphore PseudoCode #card
+ - `wait()` & `signal()` are **critical sections**.
+ - Hence, they must be executed **atomically** with respect to each other.
+ - Each semaphore has an associated queue of processes.
+ - When `wait()` is called by a process:
+ - If the semaphore is available -> the process continues.
+ - If the semaphore is unavailable -> the process blocks, waits on queue.
+ - `signal()` opens the semaphore.
+ - If processes are waiting on a queue -> one process is unblocked.
+ - If no processes are on the queue -> the signal is remembered for the next time `wait()` is called.
+ - Note: Blocking processes is **not** spinning - they release the CPU to do other work.
+ - ```pseudocode
+ struct semaphore {
+ int value;
+ queue L[]; // list of processes
+ }
+ - wait (S) {
+ if (s.value > 0) {
+ s.value--;
+ }
+ else {
+ add this process to s.L;
+ block;
+ }
+ }
+ - signal(S) {
+ if (S.L != EMPTY) {
+ remove a process P from S.L;
+ wakeup(P);
+ }
+ else {
+ s.value++;
+ }
+ }
+ ```
+ - ### Semaphore Initialisation
+ - If the semaphore is initialised to `1`: #card
+ - The first call to `wait` goes through -> The semaphore value goes from `1` to `0`.
+ - The second call to `wait` **blocks** -> The semaphore value stays at `0`, the process goes on the queue.
+ - If the first process calls `signal()` -> The semaphore value stays at `0` and wakes up the second process.
+ - The semaphore acts like a **mutex lock**.
+ - We can use semaphores to implement locks.
+ - This is called a **binary semaphore**.
+ - If the semaphore is initialised to `2`: #card
+ - The initial value of the semaphore = the number of processes that can be active at once.
+ - `sem_init(sem, 2)`:
+ - `value = 2, L = []`.
+ - Consider multiple processes:
+ - Process1: `wait(sem)`.
+ - `value = 1, L = []` -> P1 executes.
+ - Process2: `wait(sem)`.
+ - `value = 0, L = []` -> P2 executes.
+ - Process3: `wait(sem)`.
+ - `value = 0, L = [P3]` -> P3 blocks.
+ - ### Counting Semaphores #card
+ - Allocating a number of resources.
+ - Shared buffers: each time you want to access a buffer, call `wait()`.
+ - You are queued if there is no buffer available.
+ - Counter is initialised to $N$ = number resources.
+ - This is called a **counting semaphore**.
+ - Useful for **conditional synchronisation**.
+ - i.e., if one process is waiting for another process to finish a price of work before it continues.
+ - ### Semaphores for Mutual Exclusion #card
+ - With semaphores, guaranteeing mutual exclusion for $N$ processes is trivial.
+ - ```c
+ semaphore mutex = 1;
+
+ void Process(int i) {
+ while (1) {
+ // Non-Critical Section Bit
+ wait(mutex); // grab the mutual exclusion semaphore
+ // Do the Critical Section Bit
+ signal(mutex);
+ }
+ }
+
+ int main() {
+ cobegin {
+ Process(1); Process(2);
+ }
+ }
+ ```
+ - ### Bounded Buffer Problem #card
+ collapsed:: true
+ - Producer-Consumer Problem:
+ - Buffer in memory - finite size of $N$ entries.
+ - A producer process inserts an entry into the buffer.
+ - A consumer process removes an entry from the buffer.
+ - Processes are **concurrent** - we must use a synchronisation mechanism to control access to shared variables describing the buffer state.
+ - #### Producer-Consumer Single Buffer
+ - Simplest case:
+ - Single producer process & single consumer process.
+ - Single shared buffer between the producer & consumer.
+ - Requirements:
+ - Consumer must wait for Producer to fill the buffer.
+ - Producer must wait for the Consumer to empty the buffer (if filled).
+ - 
+ -
+ - ### Semaphores Can Be Hard to Use #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:40:18.812Z
+ card-last-score:: 1
+ - Complex patterns of resource usage.
+ - Cannot capture relationships with semaphores alone.
+ - Need extra state variables to record information.
+ - Produce buggy code that is hard to write.
+ - E.g., if one coder forgets to do `V()`/`signal()` after a critical section, the whole system can deadlock.
+ - ## Monitors
+ collapsed:: true
+ - What are **Monitors**? #card
+ - **Monitors** are an extension of the monolithic monitor used in the OS t allocate memory.
+ - A programming language construct that supports controlled access to shared data.
+ - Synchronisation code added by compiler, enforced at runtime -> less work for programmer.
+ - Monitors can keep track of **who** is allowed to access the shared data and **when** they can do it.
+ - Monitors are a higher-level construct than semaphores.
+ - Monitors encapsulate:
+ - Shared data structures.
+ - Procedures that operate on shared data.
+ - Synchronisation between concurrent processes that invoke these procedures.
+ -
+- # Detection & Protection of Deadlock
+ - ## Requirements for Deadlock #card
+ - All four conditions must hold for deadlock to occur:
+ - 1. **Mutex:** At least **one** resource must be **non-shareable**.
+ 2. **No Pre-Emption:** Resources cannot be **pre-empted** (no way to break priority or take a resource away once allocated).
+ - Locks have this property.
+ - 3. **Hold & Wait:** There is an existing process holding a resource and waiting for another resource.
+ 4. **Circular Wait:** There exists a set of process $P_1, P_2, \cdots, P_N$ such that $P_1$ is waiting for $P_2$, $P_2$ is waiting for $P_3$, ..., and $P_N$ is waiting for $P_1$.
+ - If only three conditions hold then you can get **starvation**, but not deadlock.
+ - ## Deadlocks Without Locks #card
+ - Deadlocks can occur for any resource or any time a process waits, e.g.:
+ - Messages: waiting to receive a message before sending a message.
+ - i.e., hold & wait.
+ - Allocation: waiting to allocate resources before freeing another resource.
+ - i.e., hold & wait.
+ - ## Dealing with Deadlocks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:42:50.653Z
+ card-last-score:: 1
+ - ### Strategy 1: Ignore #card
+ collapsed:: true
+ - Ignore the fact that deadlocks may occur.
+ - Write code, put nothing special in.
+ - Sometimes you have to reboot the system.
+ - May work for some unimportant or simple applications where deadlock does not occur often.
+ - Quite a common approach.
+ - ### Strategy 2: Reactive #card
+ collapsed:: true
+ - Periodically check for evidence of a deadlock.
+ - E.g., add timeouts to acquiring a lock, if you timeout, then it implies that deadlock has occurred and you must do something.
+ - Recovery actions:
+ - Blue screen of death & reboot computer.
+ - Pick a process to terminate, e.g., a low-priority one.
+ - Only works with some types of applications.
+ - May corrupt data, so the process needs to do clean-up when terminated.
+ - ### Strategy 3: Proactive #card
+ collapsed:: true
+ - Prevent one of the four necessary conditions for deadlock.
+ - No single approach is appropriate (or possible) for all circumstances.
+ - Need techniques for each of the four conditions.
+ - #### Solution 1: No Mutual Exclusion
+ - Make resources shareable.
+ - E.g., read-only files - no need for locks.
+ - ### Solution 2: Adding Pre-Emption
+ - Locks cannot be pre-empted but other pre-emptive methods are possible.
+ - Strategy: pre-empt resources.
+ - Example: If process $A$ is waiting for a resource held by process $B$, then take the resource from $B$ and give it to $A$.
+ - Problems:
+ - Only works for some resources
+ - E.g., CPU & Memory (using virtual memory).
+ - Not possible if a resource cannot be saved & restored.
+ - Otherwise, taking away a lock causes issues.
+ - Also, there is an overhead cost for "pre-empt" & "restore".
+ - ### Solution 3: Avoid Hold & Wait
+ - Only request a resource when you have none, i.e., release a resource before requesting another.
+ - Never hold $x$ when want $y$.
+ - Works in many cases, but you cannot maintain a relationship between $x$ & $y$.
+ - Acquire all resources at once, e.g., use a single lock to protect all data.
+ - Having fewer locks is called **lock coarsening**.
+ - Problem: All processes accessing $A$ or $B$ cannot run at the same time, even if they don't access both variables.
+ - #### Solution 4: Eliminate Circular Waits
+ - Strategy: Impose an ordering on resources.
+ - Processes must acquire the highest-ranked resource first.
+ - Locks are always acquired in the same order.
+ - We have eliminated the circular dependency, but we will need to lock a resource for a longer period.
+ - Strategy: Define an ordering of **all** locks in your program.
+ - Always acquire locks in that order.
+ - Problem: Sometimes you do not know the order that the events will be used.
+ - How do we know the global order?
+ - Need extra code to find this out and then acquire them in the right order.
+ - It could get worse.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-10T19_23_44.097Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-10T19_23_44.097Z.Desktop.md
new file mode 100644
index 00000000..007c50d7
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-10T19_23_44.097Z.Desktop.md
@@ -0,0 +1,468 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[CPU Management - Scheduling]]
+- **Next Topic:** [[Memory Management]]
+- **Relevant Slides:** 
+-
+- # Concurrent Programming
+ collapsed:: true
+ - What are **Concurrent Programs**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T10:56:45.458Z
+ card-last-reviewed:: 2022-10-18T11:56:45.458Z
+ card-last-score:: 3
+ - **Concurrent Programs** are interleaving sets of sequential atomic instructions.
+ - i.e., interacting sequential processes that run at the same time, on the same or different processors.
+ - Processes are **interleaved** - at any time, each processor runs an instruction of the sequential processes.
+ - ## Correctness
+ - Generalisation: A program will be correct if its preconditions hold, as then its post conditions will also hold.
+ - A concurrent program must be correct under ^^all possible **interleavings**.^^
+ - If all the maths is done in registers, then the results will depend on **interleaving** (indeterminate calculation).
+ - This dependency on unforeseen circumstances is known as a **Race Condition**.
+ - What is a **Race Condition**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:50.090Z
+ card-last-score:: 1
+ - A **Race Condition** occurs when a program output is dependent on the sequence or timing of code execution.
+ - If multiple processes of execution enter a **critical section** at about the same time, both will attempt to update the shared data structure.
+ - This will lead to surprising & undesirable results.
+ - You must work to avoid this with concurrent code.
+ - If we get different results every time we run some code, the result is **indeterminate**.
+ - What is a **Critical Section**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T07:27:24.102Z
+ card-last-reviewed:: 2022-10-18T08:27:24.103Z
+ card-last-score:: 3
+ - A **critical section** is a part of a program where a shared resource is accessed.
+ - A critical section must be protected in ways that avoid concurrent access.
+ - What are **Deterministic Computations**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:36:09.807Z
+ card-last-score:: 1
+ - **Deterministic Computations** have the same result each time.
+ - We want deterministic concurrent code.
+ - We can use synchronisation mechanisms.
+ - ### Handling Race Conditions
+ - We need a mechanism to control access to shared resources in concurrent code - **Synchronisation** is necessary for any shared data structure.
+ - The idea is to focus on the critical sections of the code, i.e., sections that access shared resources.
+ - We want critical sections to run with **mutual exclusion** - only one process should be able to execute that code at the same time.
+ - #### Critical Section Properties #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-17T23:00:00.000Z
+ card-last-reviewed:: 2022-10-17T13:27:38.061Z
+ card-last-score:: 1
+ - **Mutual Exclusion:** Only one process can access the critical section at a time.
+ - **Guarantee of Progress:** Processes outside the critical section cannot stop another from entering it.
+ - **Bounded Waiting:** A process waiting to enter the critical section will eventually enter.
+ - Processes in the critical section will eventually leave.
+ - **Performance:** The overhead of entering / exiting should be small.
+ - **Fair:** Don't make certain processes wait much longer than others.
+ - #### Atomicity #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:35.061Z
+ card-last-score:: 1
+ - Basic atomicity is provided by the hardware.
+ - E.g., References & Assignments (i.e., read & write operations) are atomic in all CPUs.
+ - However, higher-level constructs (i.e., any sequence of two or more CPU instructions) are not atomic in general.
+ - Some languages (e.g., Java) have mechanisms to specify multiple instructions as atomic.
+ - #### Conditional Synchronisation
+ - Strategy: Person $A$ writes a rough draft and then Person $B$ edits it.
+ - $A$ & $B$ cannot write at the same time (as they are working on different versions of the paper).
+ - We must ensure that $B$ cannot start until $A$ is finished.
+ - 
+ -
+- # Mutual Exclusion Solutions
+ collapsed:: true
+ - ## Locks
+ collapsed:: true
+ - What is a **lock**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:27.130Z
+ card-last-score:: 1
+ - A **lock** is a token that you need to enter a critical section of code.
+ - If a process wants to execute a critical section, it must have the lock.
+ - Need to ask for lock.
+ - Need to release lock.
+ - There are no restrictions on executing other code.
+ - 
+ - ### Lock States & Operation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:24.868Z
+ card-last-score:: 1
+ - Locks have 2 states:
+ - **Held:** Some process is in the critical section.
+ - **Not Held:** No process is in the critical section.
+ - Locks have 2 operations:
+ - **Acquire:** Mark lock as held or wait until released. If not **held**, this is executed immediately.
+ - If many processes call acquire, only one process can get the lock.
+ - **Release:** Mark lock as **not held**.
+ - ### Using Locks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:14.291Z
+ card-last-score:: 1
+ - Locks are declared like variables.
+ - `Lock myLock;`
+ - A program can use multiple locks.
+ - To use a lock, surround the critical section as follows:
+ - Call `acquire()` at the start of the critical section.
+ id:: 63442116-a2c1-4c25-9309-e880471bb359
+ - Call `release()` at the end of the critical section.
+ - 
+ - ### Lock Benefits #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:26:03.658Z
+ card-last-score:: 1
+ - Only one process can execute the critical section code at a time.
+ - When a process is finished (& calls `release()`), another process can enter the critical section.
+ - Achieves the requirements of **mutual exclusion** & **progress** for concurrent systems.
+ - ### Lock Limitations #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:16.629Z
+ card-last-score:: 1
+ - Acquiring a lock only blocks processes trying to acquire the *same* lock.
+ - Process may acquire other locks.
+ - ^^You must use the same lock for all critical sections accessing the same data (or resource).^^
+ - ### Hardware-Based Lock
+ - Processor has a special instruction called "test & set".
+ - Allows atomic read **and** update.
+ - ```c
+ //c code for test and set behaviour
+ bool test_and_set (bool *flag) {
+ bool old = *flag;
+ *flag = true;
+ return old;
+ }
+ ```
+ - #### Hardware-Based Spinlock
+ - ```c
+ struct lock {
+ bool held; //initially FALSE
+ }
+ void acquire(lock) {
+ while(test_and_set(&lock->held))
+ ; //just wait
+ return;
+ }
+ void release(lock) {
+ lock->held = FALSE;
+ }
+ ```
+ - #### Drawbacks of Spinlocks #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-22T03:46:00.445Z
+ card-last-reviewed:: 2022-10-19T08:46:00.446Z
+ card-last-score:: 5
+ - Spinlocks are a form of **busy waiting** -> they burn CPU time.
+ - Once acquired, they are held until explicitly released.
+ - Inefficient if the lock is held for long periods.
+ - OS overhead of context switching.
+ - If the Process Scheduler makes processes sleep while the lock is held, all other processes use their CPU time to spin while the process with the lock make no progress.
+ - ### Do locks give us sufficient safety? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:45:25.529Z
+ card-last-score:: 1
+ - If you can demonstrate *any* cases in which the following properties do not hold, then the system is **not correct**.
+ - 1. **Check Safety Properties:** These must *always* be true.
+ - **Mutual Exclusion:** Two processes must not interleave certain sequences of instructions.
+ - **Absence of Deadlock:** **Deadlock** is when a non-terminating system cannot respond to any signal.
+ - 2. **Check Liveness Properties:** These must *eventually* be true.
+ - **Absence of Starvation:** Information that is sent is delivered.
+ - **Fairness:** Any contention must be resolved.
+ - ### Lock Deadlock Scenario
+ - 
+ - ### Protocols to Avoid Deadlock #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T11:54:54.328Z
+ card-last-score:: 1
+ - Add a timer to the `lock.request()` method.
+ - Cancel the job & attempt it another time if it takes too long.
+ - Add a new `lock.check()` method to see if a lock is already held before requesting it.
+ - You can do something else and come back & check again.
+ - Avoid hold & wait protocol.
+ - Never hold onto one resource when you need two.
+ - ### Livelock by trying to avoid deadlock
+ - 
+ - ### Starvation
+ - What is **Starvation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:27.898Z
+ card-last-score:: 1
+ - **Starvation** is a more general case of livelock.
+ - One or more processes do not get run as another process is locking the resource.
+ - ### Locks / Critical Sections & Reliability
+ - What if a process is interrupted, suspended, or crashes inside its critical section? #card
+ - In the middle of the critical section, the system may be in an inconsistent state. The process is holding a lock, and if it dies, no other process waiting on that lock can proceed.
+ - Developers must ensure that critical regions are very short and always terminate.
+ - ### Beyond Locks
+ - Locks only provide **mutual exclusion**.
+ - They ensure that only one process is in the critical section at a time.
+ - Locks are good for protecting our shared resource to prevent race conditions & avoid non-deterministic execution.
+ - What about fairness, avoiding starvation, & livelock?
+ - We need to be able to place an ordering on the scheduling of a process.
+ -
+ - ## Semaphores
+ collapsed:: true
+ - Example: We want to place an order on when processes execute.
+ background-color:: green
+ - Producer-Consumer:
+ - Producer: Creates a resource (data).
+ - Consumer: Uses a resource (data).
+ - E.g.: `ps | grep "gcc" | wc`.
+ - Don't want producers & consumers to operate in **lockstep** (i.e., atomicity).
+ - Each command must wait for the previous output.
+ - Implies lots of context switching (i.e., very expensive).
+ - ^^**Solution:** Place a fixed-size buffer between producers & consumers.^^
+ - ^^Synchronise access to buffer.^^
+ - ^^Producer waits if the buffer is full; the consumer waits if the buffer is empty.^^
+ - What is a **semaphore**? #card
+ - A **semaphore** is a higher-level synchronisation primitive.
+ - Semaphores are a kind of **generalised lock**.
+ - They are the main synchronisation primitive used in the original UNIX.
+ - Semaphores are implemented with a **counter** that is manipulated atomically via 2 operations: **signal** & **wait**.
+ - `wait(semaphore)`: AKA `down()` or `P()`.
+ - **Decrement** counter.
+ - If counter is zero, then block until semaphore is **signalled**.
+ - `signal(semaphore)`: AKA `up()` or `V()`.
+ - **Increment** counter.
+ - Wake up one **waiter**, if any.
+ - `sem_init(semaphore, counter)`:
+ - Set initial counter value.
+ - ### Semaphore PseudoCode #card
+ - `wait()` & `signal()` are **critical sections**.
+ - Hence, they must be executed **atomically** with respect to each other.
+ - Each semaphore has an associated queue of processes.
+ - When `wait()` is called by a process:
+ - If the semaphore is available -> the process continues.
+ - If the semaphore is unavailable -> the process blocks, waits on queue.
+ - `signal()` opens the semaphore.
+ - If processes are waiting on a queue -> one process is unblocked.
+ - If no processes are on the queue -> the signal is remembered for the next time `wait()` is called.
+ - Note: Blocking processes is **not** spinning - they release the CPU to do other work.
+ - ```pseudocode
+ struct semaphore {
+ int value;
+ queue L[]; // list of processes
+ }
+ - wait (S) {
+ if (s.value > 0) {
+ s.value--;
+ }
+ else {
+ add this process to s.L;
+ block;
+ }
+ }
+ - signal(S) {
+ if (S.L != EMPTY) {
+ remove a process P from S.L;
+ wakeup(P);
+ }
+ else {
+ s.value++;
+ }
+ }
+ ```
+ - ### Semaphore Initialisation
+ - If the semaphore is initialised to `1`: #card
+ - The first call to `wait` goes through -> The semaphore value goes from `1` to `0`.
+ - The second call to `wait` **blocks** -> The semaphore value stays at `0`, the process goes on the queue.
+ - If the first process calls `signal()` -> The semaphore value stays at `0` and wakes up the second process.
+ - The semaphore acts like a **mutex lock**.
+ - We can use semaphores to implement locks.
+ - This is called a **binary semaphore**.
+ - If the semaphore is initialised to `2`: #card
+ - The initial value of the semaphore = the number of processes that can be active at once.
+ - `sem_init(sem, 2)`:
+ - `value = 2, L = []`.
+ - Consider multiple processes:
+ - Process1: `wait(sem)`.
+ - `value = 1, L = []` -> P1 executes.
+ - Process2: `wait(sem)`.
+ - `value = 0, L = []` -> P2 executes.
+ - Process3: `wait(sem)`.
+ - `value = 0, L = [P3]` -> P3 blocks.
+ - ### Counting Semaphores #card
+ - Allocating a number of resources.
+ - Shared buffers: each time you want to access a buffer, call `wait()`.
+ - You are queued if there is no buffer available.
+ - Counter is initialised to $N$ = number resources.
+ - This is called a **counting semaphore**.
+ - Useful for **conditional synchronisation**.
+ - i.e., if one process is waiting for another process to finish a price of work before it continues.
+ - ### Semaphores for Mutual Exclusion #card
+ - With semaphores, guaranteeing mutual exclusion for $N$ processes is trivial.
+ - ```c
+ semaphore mutex = 1;
+
+ void Process(int i) {
+ while (1) {
+ // Non-Critical Section Bit
+ wait(mutex); // grab the mutual exclusion semaphore
+ // Do the Critical Section Bit
+ signal(mutex);
+ }
+ }
+
+ int main() {
+ cobegin {
+ Process(1); Process(2);
+ }
+ }
+ ```
+ - ### Bounded Buffer Problem #card
+ collapsed:: true
+ - Producer-Consumer Problem:
+ - Buffer in memory - finite size of $N$ entries.
+ - A producer process inserts an entry into the buffer.
+ - A consumer process removes an entry from the buffer.
+ - Processes are **concurrent** - we must use a synchronisation mechanism to control access to shared variables describing the buffer state.
+ - #### Producer-Consumer Single Buffer
+ - Simplest case:
+ - Single producer process & single consumer process.
+ - Single shared buffer between the producer & consumer.
+ - Requirements:
+ - Consumer must wait for Producer to fill the buffer.
+ - Producer must wait for the Consumer to empty the buffer (if filled).
+ - 
+ -
+ - ### Semaphores Can Be Hard to Use #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:40:18.812Z
+ card-last-score:: 1
+ - Complex patterns of resource usage.
+ - Cannot capture relationships with semaphores alone.
+ - Need extra state variables to record information.
+ - Produce buggy code that is hard to write.
+ - E.g., if one coder forgets to do `V()`/`signal()` after a critical section, the whole system can deadlock.
+ - ## Monitors
+ collapsed:: true
+ - What are **Monitors**? #card
+ - **Monitors** are an extension of the monolithic monitor used in the OS t allocate memory.
+ - A programming language construct that supports controlled access to shared data.
+ - Synchronisation code added by compiler, enforced at runtime -> less work for programmer.
+ - Monitors can keep track of **who** is allowed to access the shared data and **when** they can do it.
+ - Monitors are a higher-level construct than semaphores.
+ - Monitors encapsulate:
+ - Shared data structures.
+ - Procedures that operate on shared data.
+ - Synchronisation between concurrent processes that invoke these procedures.
+ -
+- # Detection & Protection of Deadlock
+ - ## Requirements for Deadlock #card
+ - All four conditions must hold for deadlock to occur:
+ - 1. **Mutex:** At least **one** resource must be **non-shareable**.
+ 2. **No Pre-Emption:** Resources cannot be **pre-empted** (no way to break priority or take a resource away once allocated).
+ - Locks have this property.
+ - 3. **Hold & Wait:** There is an existing process holding a resource and waiting for another resource.
+ 4. **Circular Wait:** There exists a set of process $P_1, P_2, \cdots, P_N$ such that $P_1$ is waiting for $P_2$, $P_2$ is waiting for $P_3$, ..., and $P_N$ is waiting for $P_1$.
+ - If only three conditions hold then you can get **starvation**, but not deadlock.
+ - ## Deadlocks Without Locks #card
+ - Deadlocks can occur for any resource or any time a process waits, e.g.:
+ - Messages: waiting to receive a message before sending a message.
+ - i.e., hold & wait.
+ - Allocation: waiting to allocate resources before freeing another resource.
+ - i.e., hold & wait.
+ - ## Dealing with Deadlocks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:42:50.653Z
+ card-last-score:: 1
+ - ### Strategy 1: Ignore #card
+ collapsed:: true
+ - Ignore the fact that deadlocks may occur.
+ - Write code, put nothing special in.
+ - Sometimes you have to reboot the system.
+ - May work for some unimportant or simple applications where deadlock does not occur often.
+ - Quite a common approach.
+ - ### Strategy 2: Reactive #card
+ collapsed:: true
+ - Periodically check for evidence of a deadlock.
+ - E.g., add timeouts to acquiring a lock, if you timeout, then it implies that deadlock has occurred and you must do something.
+ - Recovery actions:
+ - Blue screen of death & reboot computer.
+ - Pick a process to terminate, e.g., a low-priority one.
+ - Only works with some types of applications.
+ - May corrupt data, so the process needs to do clean-up when terminated.
+ - ### Strategy 3: Proactive #card
+ collapsed:: true
+ - Prevent one of the four necessary conditions for deadlock.
+ - No single approach is appropriate (or possible) for all circumstances.
+ - Need techniques for each of the four conditions.
+ - #### Solution 1: No Mutual Exclusion
+ - Make resources shareable.
+ - E.g., read-only files - no need for locks.
+ - ### Solution 2: Adding Pre-Emption
+ - Locks cannot be pre-empted but other pre-emptive methods are possible.
+ - Strategy: pre-empt resources.
+ - Example: If process $A$ is waiting for a resource held by process $B$, then take the resource from $B$ and give it to $A$.
+ - Problems:
+ - Only works for some resources
+ - E.g., CPU & Memory (using virtual memory).
+ - Not possible if a resource cannot be saved & restored.
+ - Otherwise, taking away a lock causes issues.
+ - Also, there is an overhead cost for "pre-empt" & "restore".
+ - ### Solution 3: Avoid Hold & Wait
+ - Only request a resource when you have none, i.e., release a resource before requesting another.
+ - Never hold $x$ when want $y$.
+ - Works in many cases, but you cannot maintain a relationship between $x$ & $y$.
+ - Acquire all resources at once, e.g., use a single lock to protect all data.
+ - Having fewer locks is called **lock coarsening**.
+ - Problem: All processes accessing $A$ or $B$ cannot run at the same time, even if they don't access both variables.
+ - #### Solution 4: Eliminate Circular Waits
+ - Strategy: Impose an ordering on resources.
+ - Processes must acquire the highest-ranked resource first.
+ - Locks are always acquired in the same order.
+ - We have eliminated the circular dependency, but we will need to lock a resource for a longer period.
+ - Strategy: Define an ordering of **all** locks in your program.
+ - Always acquire locks in that order.
+ - Problem: Sometimes you do not know the order that the events will be used.
+ - How do we know the global order?
+ - Need extra code to find this out and then acquire them in the right order.
+ - It could get worse.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-11T12_04_45.369Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-11T12_04_45.369Z.Desktop.md
new file mode 100644
index 00000000..7092a1c4
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-11T12_04_45.369Z.Desktop.md
@@ -0,0 +1,486 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[CPU Management - Scheduling]]
+- **Next Topic:** [[Memory Management]]
+- **Relevant Slides:** 
+-
+- # Concurrent Programming
+ collapsed:: true
+ - What are **Concurrent Programs**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T10:56:45.458Z
+ card-last-reviewed:: 2022-10-18T11:56:45.458Z
+ card-last-score:: 3
+ - **Concurrent Programs** are interleaving sets of sequential atomic instructions.
+ - i.e., interacting sequential processes that run at the same time, on the same or different processors.
+ - Processes are **interleaved** - at any time, each processor runs an instruction of the sequential processes.
+ - ## Correctness
+ - Generalisation: A program will be correct if its preconditions hold, as then its post conditions will also hold.
+ - A concurrent program must be correct under ^^all possible **interleavings**.^^
+ - If all the maths is done in registers, then the results will depend on **interleaving** (indeterminate calculation).
+ - This dependency on unforeseen circumstances is known as a **Race Condition**.
+ - What is a **Race Condition**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:50.090Z
+ card-last-score:: 1
+ - A **Race Condition** occurs when a program output is dependent on the sequence or timing of code execution.
+ - If multiple processes of execution enter a **critical section** at about the same time, both will attempt to update the shared data structure.
+ - This will lead to surprising & undesirable results.
+ - You must work to avoid this with concurrent code.
+ - If we get different results every time we run some code, the result is **indeterminate**.
+ - What is a **Critical Section**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T07:27:24.102Z
+ card-last-reviewed:: 2022-10-18T08:27:24.103Z
+ card-last-score:: 3
+ - A **critical section** is a part of a program where a shared resource is accessed.
+ - A critical section must be protected in ways that avoid concurrent access.
+ - What are **Deterministic Computations**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:36:09.807Z
+ card-last-score:: 1
+ - **Deterministic Computations** have the same result each time.
+ - We want deterministic concurrent code.
+ - We can use synchronisation mechanisms.
+ - ### Handling Race Conditions
+ - We need a mechanism to control access to shared resources in concurrent code - **Synchronisation** is necessary for any shared data structure.
+ - The idea is to focus on the critical sections of the code, i.e., sections that access shared resources.
+ - We want critical sections to run with **mutual exclusion** - only one process should be able to execute that code at the same time.
+ - #### Critical Section Properties #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-17T23:00:00.000Z
+ card-last-reviewed:: 2022-10-17T13:27:38.061Z
+ card-last-score:: 1
+ - **Mutual Exclusion:** Only one process can access the critical section at a time.
+ - **Guarantee of Progress:** Processes outside the critical section cannot stop another from entering it.
+ - **Bounded Waiting:** A process waiting to enter the critical section will eventually enter.
+ - Processes in the critical section will eventually leave.
+ - **Performance:** The overhead of entering / exiting should be small.
+ - **Fair:** Don't make certain processes wait much longer than others.
+ - #### Atomicity #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:35.061Z
+ card-last-score:: 1
+ - Basic atomicity is provided by the hardware.
+ - E.g., References & Assignments (i.e., read & write operations) are atomic in all CPUs.
+ - However, higher-level constructs (i.e., any sequence of two or more CPU instructions) are not atomic in general.
+ - Some languages (e.g., Java) have mechanisms to specify multiple instructions as atomic.
+ - #### Conditional Synchronisation
+ - Strategy: Person $A$ writes a rough draft and then Person $B$ edits it.
+ - $A$ & $B$ cannot write at the same time (as they are working on different versions of the paper).
+ - We must ensure that $B$ cannot start until $A$ is finished.
+ - 
+ -
+- # Mutual Exclusion Solutions
+ collapsed:: true
+ - ## Locks
+ collapsed:: true
+ - What is a **lock**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:27.130Z
+ card-last-score:: 1
+ - A **lock** is a token that you need to enter a critical section of code.
+ - If a process wants to execute a critical section, it must have the lock.
+ - Need to ask for lock.
+ - Need to release lock.
+ - There are no restrictions on executing other code.
+ - 
+ - ### Lock States & Operation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:24.868Z
+ card-last-score:: 1
+ - Locks have 2 states:
+ - **Held:** Some process is in the critical section.
+ - **Not Held:** No process is in the critical section.
+ - Locks have 2 operations:
+ - **Acquire:** Mark lock as held or wait until released. If not **held**, this is executed immediately.
+ - If many processes call acquire, only one process can get the lock.
+ - **Release:** Mark lock as **not held**.
+ - ### Using Locks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:14.291Z
+ card-last-score:: 1
+ - Locks are declared like variables.
+ - `Lock myLock;`
+ - A program can use multiple locks.
+ - To use a lock, surround the critical section as follows:
+ - Call `acquire()` at the start of the critical section.
+ id:: 63442116-a2c1-4c25-9309-e880471bb359
+ - Call `release()` at the end of the critical section.
+ - 
+ - ### Lock Benefits #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:26:03.658Z
+ card-last-score:: 1
+ - Only one process can execute the critical section code at a time.
+ - When a process is finished (& calls `release()`), another process can enter the critical section.
+ - Achieves the requirements of **mutual exclusion** & **progress** for concurrent systems.
+ - ### Lock Limitations #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:16.629Z
+ card-last-score:: 1
+ - Acquiring a lock only blocks processes trying to acquire the *same* lock.
+ - Process may acquire other locks.
+ - ^^You must use the same lock for all critical sections accessing the same data (or resource).^^
+ - ### Hardware-Based Lock
+ - Processor has a special instruction called "test & set".
+ - Allows atomic read **and** update.
+ - ```c
+ //c code for test and set behaviour
+ bool test_and_set (bool *flag) {
+ bool old = *flag;
+ *flag = true;
+ return old;
+ }
+ ```
+ - #### Hardware-Based Spinlock
+ - ```c
+ struct lock {
+ bool held; //initially FALSE
+ }
+ void acquire(lock) {
+ while(test_and_set(&lock->held))
+ ; //just wait
+ return;
+ }
+ void release(lock) {
+ lock->held = FALSE;
+ }
+ ```
+ - #### Drawbacks of Spinlocks #card
+ card-last-interval:: 2.8
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-22T03:46:00.445Z
+ card-last-reviewed:: 2022-10-19T08:46:00.446Z
+ card-last-score:: 5
+ - Spinlocks are a form of **busy waiting** -> they burn CPU time.
+ - Once acquired, they are held until explicitly released.
+ - Inefficient if the lock is held for long periods.
+ - OS overhead of context switching.
+ - If the Process Scheduler makes processes sleep while the lock is held, all other processes use their CPU time to spin while the process with the lock make no progress.
+ - ### Do locks give us sufficient safety? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:45:25.529Z
+ card-last-score:: 1
+ - If you can demonstrate *any* cases in which the following properties do not hold, then the system is **not correct**.
+ - 1. **Check Safety Properties:** These must *always* be true.
+ - **Mutual Exclusion:** Two processes must not interleave certain sequences of instructions.
+ - **Absence of Deadlock:** **Deadlock** is when a non-terminating system cannot respond to any signal.
+ - 2. **Check Liveness Properties:** These must *eventually* be true.
+ - **Absence of Starvation:** Information that is sent is delivered.
+ - **Fairness:** Any contention must be resolved.
+ - ### Lock Deadlock Scenario
+ - 
+ - ### Protocols to Avoid Deadlock #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T11:54:54.328Z
+ card-last-score:: 1
+ - Add a timer to the `lock.request()` method.
+ - Cancel the job & attempt it another time if it takes too long.
+ - Add a new `lock.check()` method to see if a lock is already held before requesting it.
+ - You can do something else and come back & check again.
+ - Avoid hold & wait protocol.
+ - Never hold onto one resource when you need two.
+ - ### Livelock by trying to avoid deadlock
+ - 
+ - ### Starvation
+ - What is **Starvation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T13:32:27.898Z
+ card-last-score:: 1
+ - **Starvation** is a more general case of livelock.
+ - One or more processes do not get run as another process is locking the resource.
+ - ### Locks / Critical Sections & Reliability
+ - What if a process is interrupted, suspended, or crashes inside its critical section? #card
+ - In the middle of the critical section, the system may be in an inconsistent state. The process is holding a lock, and if it dies, no other process waiting on that lock can proceed.
+ - Developers must ensure that critical regions are very short and always terminate.
+ - ### Beyond Locks
+ - Locks only provide **mutual exclusion**.
+ - They ensure that only one process is in the critical section at a time.
+ - Locks are good for protecting our shared resource to prevent race conditions & avoid non-deterministic execution.
+ - What about fairness, avoiding starvation, & livelock?
+ - We need to be able to place an ordering on the scheduling of a process.
+ -
+ - ## Semaphores
+ collapsed:: true
+ - Example: We want to place an order on when processes execute.
+ background-color:: green
+ - Producer-Consumer:
+ - Producer: Creates a resource (data).
+ - Consumer: Uses a resource (data).
+ - E.g.: `ps | grep "gcc" | wc`.
+ - Don't want producers & consumers to operate in **lockstep** (i.e., atomicity).
+ - Each command must wait for the previous output.
+ - Implies lots of context switching (i.e., very expensive).
+ - ^^**Solution:** Place a fixed-size buffer between producers & consumers.^^
+ - ^^Synchronise access to buffer.^^
+ - ^^Producer waits if the buffer is full; the consumer waits if the buffer is empty.^^
+ - What is a **semaphore**? #card
+ - A **semaphore** is a higher-level synchronisation primitive.
+ - Semaphores are a kind of **generalised lock**.
+ - They are the main synchronisation primitive used in the original UNIX.
+ - Semaphores are implemented with a **counter** that is manipulated atomically via 2 operations: **signal** & **wait**.
+ - `wait(semaphore)`: AKA `down()` or `P()`.
+ - **Decrement** counter.
+ - If counter is zero, then block until semaphore is **signalled**.
+ - `signal(semaphore)`: AKA `up()` or `V()`.
+ - **Increment** counter.
+ - Wake up one **waiter**, if any.
+ - `sem_init(semaphore, counter)`:
+ - Set initial counter value.
+ - ### Semaphore PseudoCode #card
+ - `wait()` & `signal()` are **critical sections**.
+ - Hence, they must be executed **atomically** with respect to each other.
+ - Each semaphore has an associated queue of processes.
+ - When `wait()` is called by a process:
+ - If the semaphore is available -> the process continues.
+ - If the semaphore is unavailable -> the process blocks, waits on queue.
+ - `signal()` opens the semaphore.
+ - If processes are waiting on a queue -> one process is unblocked.
+ - If no processes are on the queue -> the signal is remembered for the next time `wait()` is called.
+ - Note: Blocking processes is **not** spinning - they release the CPU to do other work.
+ - ```pseudocode
+ struct semaphore {
+ int value;
+ queue L[]; // list of processes
+ }
+ - wait (S) {
+ if (s.value > 0) {
+ s.value--;
+ }
+ else {
+ add this process to s.L;
+ block;
+ }
+ }
+ - signal(S) {
+ if (S.L != EMPTY) {
+ remove a process P from S.L;
+ wakeup(P);
+ }
+ else {
+ s.value++;
+ }
+ }
+ ```
+ - ### Semaphore Initialisation
+ - If the semaphore is initialised to `1`: #card
+ - The first call to `wait` goes through -> The semaphore value goes from `1` to `0`.
+ - The second call to `wait` **blocks** -> The semaphore value stays at `0`, the process goes on the queue.
+ - If the first process calls `signal()` -> The semaphore value stays at `0` and wakes up the second process.
+ - The semaphore acts like a **mutex lock**.
+ - We can use semaphores to implement locks.
+ - This is called a **binary semaphore**.
+ - If the semaphore is initialised to `2`: #card
+ - The initial value of the semaphore = the number of processes that can be active at once.
+ - `sem_init(sem, 2)`:
+ - `value = 2, L = []`.
+ - Consider multiple processes:
+ - Process1: `wait(sem)`.
+ - `value = 1, L = []` -> P1 executes.
+ - Process2: `wait(sem)`.
+ - `value = 0, L = []` -> P2 executes.
+ - Process3: `wait(sem)`.
+ - `value = 0, L = [P3]` -> P3 blocks.
+ - ### Counting Semaphores #card
+ - Allocating a number of resources.
+ - Shared buffers: each time you want to access a buffer, call `wait()`.
+ - You are queued if there is no buffer available.
+ - Counter is initialised to $N$ = number resources.
+ - This is called a **counting semaphore**.
+ - Useful for **conditional synchronisation**.
+ - i.e., if one process is waiting for another process to finish a price of work before it continues.
+ - ### Semaphores for Mutual Exclusion #card
+ - With semaphores, guaranteeing mutual exclusion for $N$ processes is trivial.
+ - ```c
+ semaphore mutex = 1;
+
+ void Process(int i) {
+ while (1) {
+ // Non-Critical Section Bit
+ wait(mutex); // grab the mutual exclusion semaphore
+ // Do the Critical Section Bit
+ signal(mutex);
+ }
+ }
+
+ int main() {
+ cobegin {
+ Process(1); Process(2);
+ }
+ }
+ ```
+ - ### Bounded Buffer Problem #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-11T00:00:00.000Z
+ card-last-reviewed:: 2022-11-10T10:55:02.784Z
+ card-last-score:: 1
+ - Producer-Consumer Problem:
+ - Buffer in memory - finite size of $N$ entries.
+ - A producer process inserts an entry into the buffer.
+ - A consumer process removes an entry from the buffer.
+ - Processes are **concurrent** - we must use a synchronisation mechanism to control access to shared variables describing the buffer state.
+ - #### Producer-Consumer Single Buffer
+ - Simplest case:
+ - Single producer process & single consumer process.
+ - Single shared buffer between the producer & consumer.
+ - Requirements:
+ - Consumer must wait for Producer to fill the buffer.
+ - Producer must wait for the Consumer to empty the buffer (if filled).
+ - 
+ -
+ - ### Semaphores Can Be Hard to Use #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:40:18.812Z
+ card-last-score:: 1
+ - Complex patterns of resource usage.
+ - Cannot capture relationships with semaphores alone.
+ - Need extra state variables to record information.
+ - Produce buggy code that is hard to write.
+ - E.g., if one coder forgets to do `V()`/`signal()` after a critical section, the whole system can deadlock.
+ - ## Monitors
+ collapsed:: true
+ - What are **Monitors**? #card
+ - **Monitors** are an extension of the monolithic monitor used in the OS t allocate memory.
+ - A programming language construct that supports controlled access to shared data.
+ - Synchronisation code added by compiler, enforced at runtime -> less work for programmer.
+ - Monitors can keep track of **who** is allowed to access the shared data and **when** they can do it.
+ - Monitors are a higher-level construct than semaphores.
+ - Monitors encapsulate:
+ - Shared data structures.
+ - Procedures that operate on shared data.
+ - Synchronisation between concurrent processes that invoke these procedures.
+ -
+- # Detection & Protection of Deadlock
+ - ## Requirements for Deadlock #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-11T00:00:00.000Z
+ card-last-reviewed:: 2022-11-10T10:55:28.721Z
+ card-last-score:: 1
+ - All four conditions must hold for deadlock to occur:
+ - 1. **Mutex:** At least **one** resource must be **non-shareable**.
+ 2. **No Pre-Emption:** Resources cannot be **pre-empted** (no way to break priority or take a resource away once allocated).
+ - Locks have this property.
+ - 3. **Hold & Wait:** There is an existing process holding a resource and waiting for another resource.
+ 4. **Circular Wait:** There exists a set of process $P_1, P_2, \cdots, P_N$ such that $P_1$ is waiting for $P_2$, $P_2$ is waiting for $P_3$, ..., and $P_N$ is waiting for $P_1$.
+ - If only three conditions hold then you can get **starvation**, but not deadlock.
+ - ## Deadlocks Without Locks #card
+ - Deadlocks can occur for any resource or any time a process waits, e.g.:
+ - Messages: waiting to receive a message before sending a message.
+ - i.e., hold & wait.
+ - Allocation: waiting to allocate resources before freeing another resource.
+ - i.e., hold & wait.
+ - ## Dealing with Deadlocks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:42:50.653Z
+ card-last-score:: 1
+ - ### Strategy 1: Ignore #card
+ collapsed:: true
+ - Ignore the fact that deadlocks may occur.
+ - Write code, put nothing special in.
+ - Sometimes you have to reboot the system.
+ - May work for some unimportant or simple applications where deadlock does not occur often.
+ - Quite a common approach.
+ - ### Strategy 2: Reactive #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-11T00:00:00.000Z
+ card-last-reviewed:: 2022-11-10T10:58:24.765Z
+ card-last-score:: 1
+ - Periodically check for evidence of a deadlock.
+ - E.g., add timeouts to acquiring a lock, if you timeout, then it implies that deadlock has occurred and you must do something.
+ - Recovery actions:
+ - Blue screen of death & reboot computer.
+ - Pick a process to terminate, e.g., a low-priority one.
+ - Only works with some types of applications.
+ - May corrupt data, so the process needs to do clean-up when terminated.
+ - ### Strategy 3: Proactive #card
+ collapsed:: true
+ - Prevent one of the four necessary conditions for deadlock.
+ - No single approach is appropriate (or possible) for all circumstances.
+ - Need techniques for each of the four conditions.
+ - #### Solution 1: No Mutual Exclusion
+ - Make resources shareable.
+ - E.g., read-only files - no need for locks.
+ - ### Solution 2: Adding Pre-Emption
+ - Locks cannot be pre-empted but other pre-emptive methods are possible.
+ - Strategy: pre-empt resources.
+ - Example: If process $A$ is waiting for a resource held by process $B$, then take the resource from $B$ and give it to $A$.
+ - Problems:
+ - Only works for some resources
+ - E.g., CPU & Memory (using virtual memory).
+ - Not possible if a resource cannot be saved & restored.
+ - Otherwise, taking away a lock causes issues.
+ - Also, there is an overhead cost for "pre-empt" & "restore".
+ - ### Solution 3: Avoid Hold & Wait
+ - Only request a resource when you have none, i.e., release a resource before requesting another.
+ - Never hold $x$ when want $y$.
+ - Works in many cases, but you cannot maintain a relationship between $x$ & $y$.
+ - Acquire all resources at once, e.g., use a single lock to protect all data.
+ - Having fewer locks is called **lock coarsening**.
+ - Problem: All processes accessing $A$ or $B$ cannot run at the same time, even if they don't access both variables.
+ - #### Solution 4: Eliminate Circular Waits
+ - Strategy: Impose an ordering on resources.
+ - Processes must acquire the highest-ranked resource first.
+ - Locks are always acquired in the same order.
+ - We have eliminated the circular dependency, but we will need to lock a resource for a longer period.
+ - Strategy: Define an ordering of **all** locks in your program.
+ - Always acquire locks in that order.
+ - Problem: Sometimes you do not know the order that the events will be used.
+ - How do we know the global order?
+ - Need extra code to find this out and then acquire them in the right order.
+ - It could get worse.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-16T12_02_11.494Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-16T12_02_11.494Z.Desktop.md
new file mode 100644
index 00000000..31e3f60a
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Process Synchronisation/2022-11-16T12_02_11.494Z.Desktop.md
@@ -0,0 +1,552 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[CPU Management - Scheduling]]
+- **Next Topic:** [[Memory Management]]
+- **Relevant Slides:** 
+-
+- # Concurrent Programming
+ collapsed:: true
+ - What are **Concurrent Programs**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T10:56:45.458Z
+ card-last-reviewed:: 2022-10-18T11:56:45.458Z
+ card-last-score:: 3
+ - **Concurrent Programs** are interleaving sets of sequential atomic instructions.
+ - i.e., interacting sequential processes that run at the same time, on the same or different processors.
+ - Processes are **interleaved** - at any time, each processor runs an instruction of the sequential processes.
+ - ## Correctness
+ - Generalisation: A program will be correct if its preconditions hold, as then its post conditions will also hold.
+ - A concurrent program must be correct under ^^all possible **interleavings**.^^
+ - If all the maths is done in registers, then the results will depend on **interleaving** (indeterminate calculation).
+ - This dependency on unforeseen circumstances is known as a **Race Condition**.
+ - What is a **Race Condition**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:50.090Z
+ card-last-score:: 1
+ - A **Race Condition** occurs when a program output is dependent on the sequence or timing of code execution.
+ - If multiple processes of execution enter a **critical section** at about the same time, both will attempt to update the shared data structure.
+ - This will lead to surprising & undesirable results.
+ - You must work to avoid this with concurrent code.
+ - If we get different results every time we run some code, the result is **indeterminate**.
+ - What is a **Critical Section**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-19T07:27:24.102Z
+ card-last-reviewed:: 2022-10-18T08:27:24.103Z
+ card-last-score:: 3
+ - A **critical section** is a part of a program where a shared resource is accessed.
+ - A critical section must be protected in ways that avoid concurrent access.
+ - What are **Deterministic Computations**? #card
+ card-last-interval:: 0.98
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T19:07:48.411Z
+ card-last-reviewed:: 2022-11-14T20:07:48.412Z
+ card-last-score:: 3
+ - **Deterministic Computations** have the same result each time.
+ - We want deterministic concurrent code.
+ - We can use synchronisation mechanisms.
+ - ### Handling Race Conditions
+ - We need a mechanism to control access to shared resources in concurrent code - **Synchronisation** is necessary for any shared data structure.
+ - The idea is to focus on the critical sections of the code, i.e., sections that access shared resources.
+ - We want critical sections to run with **mutual exclusion** - only one process should be able to execute that code at the same time.
+ - #### Critical Section Properties #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:05:01.085Z
+ card-last-score:: 1
+ - **Mutual Exclusion:** Only one process can access the critical section at a time.
+ - **Guarantee of Progress:** Processes outside the critical section cannot stop another from entering it.
+ - **Bounded Waiting:** A process waiting to enter the critical section will eventually enter.
+ - Processes in the critical section will eventually leave.
+ - **Performance:** The overhead of entering / exiting should be small.
+ - **Fair:** Don't make certain processes wait much longer than others.
+ - #### Atomicity #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-19T23:00:00.000Z
+ card-last-reviewed:: 2022-10-19T08:46:35.061Z
+ card-last-score:: 1
+ - Basic atomicity is provided by the hardware.
+ - E.g., References & Assignments (i.e., read & write operations) are atomic in all CPUs.
+ - However, higher-level constructs (i.e., any sequence of two or more CPU instructions) are not atomic in general.
+ - Some languages (e.g., Java) have mechanisms to specify multiple instructions as atomic.
+ - #### Conditional Synchronisation
+ - Strategy: Person $A$ writes a rough draft and then Person $B$ edits it.
+ - $A$ & $B$ cannot write at the same time (as they are working on different versions of the paper).
+ - We must ensure that $B$ cannot start until $A$ is finished.
+ - 
+ -
+- # Mutual Exclusion Solutions
+ collapsed:: true
+ - ## Locks
+ collapsed:: true
+ - What is a **lock**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-18T23:00:00.000Z
+ card-last-reviewed:: 2022-10-18T08:22:27.130Z
+ card-last-score:: 1
+ - A **lock** is a token that you need to enter a critical section of code.
+ - If a process wants to execute a critical section, it must have the lock.
+ - Need to ask for lock.
+ - Need to release lock.
+ - There are no restrictions on executing other code.
+ - 
+ - ### Lock States & Operation #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-12T00:00:00.000Z
+ card-last-reviewed:: 2022-11-11T11:41:54.981Z
+ card-last-score:: 1
+ - Locks have 2 states:
+ - **Held:** Some process is in the critical section.
+ - **Not Held:** No process is in the critical section.
+ - Locks have 2 operations:
+ - **Acquire:** Mark lock as held or wait until released. If not **held**, this is executed immediately.
+ - If many processes call acquire, only one process can get the lock.
+ - **Release:** Mark lock as **not held**.
+ - ### Using Locks #card
+ card-last-interval:: 2.8
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-11-17T15:07:42.144Z
+ card-last-reviewed:: 2022-11-14T20:07:42.144Z
+ card-last-score:: 5
+ - Locks are declared like variables.
+ - `Lock myLock;`
+ - A program can use multiple locks.
+ - To use a lock, surround the critical section as follows:
+ - Call `acquire()` at the start of the critical section.
+ id:: 63442116-a2c1-4c25-9309-e880471bb359
+ - Call `release()` at the end of the critical section.
+ - 
+ - ### Lock Benefits #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-20T23:00:00.000Z
+ card-last-reviewed:: 2022-10-20T08:26:03.658Z
+ card-last-score:: 1
+ - Only one process can execute the critical section code at a time.
+ - When a process is finished (& calls `release()`), another process can enter the critical section.
+ - Achieves the requirements of **mutual exclusion** & **progress** for concurrent systems.
+ - ### Lock Limitations #card
+ card-last-interval:: 0.98
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-11-15T19:09:12.011Z
+ card-last-reviewed:: 2022-11-14T20:09:12.011Z
+ card-last-score:: 3
+ - Acquiring a lock only blocks processes trying to acquire the *same* lock.
+ - Process may acquire other locks.
+ - ^^You must use the same lock for all critical sections accessing the same data (or resource).^^
+ - ### Hardware-Based Lock
+ - Processor has a special instruction called "test & set".
+ - Allows atomic read **and** update.
+ - ```c
+ //c code for test and set behaviour
+ bool test_and_set (bool *flag) {
+ bool old = *flag;
+ *flag = true;
+ return old;
+ }
+ ```
+ - #### Hardware-Based Spinlock
+ - ```c
+ struct lock {
+ bool held; //initially FALSE
+ }
+ void acquire(lock) {
+ while(test_and_set(&lock->held))
+ ; //just wait
+ return;
+ }
+ void release(lock) {
+ lock->held = FALSE;
+ }
+ ```
+ - #### Drawbacks of Spinlocks #card
+ card-last-interval:: 3.45
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-11-18T06:09:40.073Z
+ card-last-reviewed:: 2022-11-14T20:09:40.073Z
+ card-last-score:: 3
+ - Spinlocks are a form of **busy waiting** -> they burn CPU time.
+ - Once acquired, they are held until explicitly released.
+ - Inefficient if the lock is held for long periods.
+ - OS overhead of context switching.
+ - If the Process Scheduler makes processes sleep while the lock is held, all other processes use their CPU time to spin while the process with the lock make no progress.
+ - ### Do locks give us sufficient safety? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:24:13.793Z
+ card-last-score:: 1
+ - If you can demonstrate *any* cases in which the following properties do not hold, then the system is **not correct**.
+ - 1. **Check Safety Properties:** These must *always* be true.
+ - **Mutual Exclusion:** Two processes must not interleave certain sequences of instructions.
+ - **Absence of Deadlock:** **Deadlock** is when a non-terminating system cannot respond to any signal.
+ - 2. **Check Liveness Properties:** These must *eventually* be true.
+ - **Absence of Starvation:** Information that is sent is delivered.
+ - **Fairness:** Any contention must be resolved.
+ - ### Lock Deadlock Scenario
+ - 
+ - ### Protocols to Avoid Deadlock #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:09:06.660Z
+ card-last-score:: 1
+ - Add a timer to the `lock.request()` method.
+ - Cancel the job & attempt it another time if it takes too long.
+ - Add a new `lock.check()` method to see if a lock is already held before requesting it.
+ - You can do something else and come back & check again.
+ - Avoid hold & wait protocol.
+ - Never hold onto one resource when you need two.
+ - ### Livelock by trying to avoid deadlock
+ - 
+ - ### Starvation
+ - What is **Starvation**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:08:54.153Z
+ card-last-score:: 1
+ - **Starvation** is a more general case of livelock.
+ - One or more processes do not get run as another process is locking the resource.
+ - ### Locks / Critical Sections & Reliability
+ - What if a process is interrupted, suspended, or crashes inside its critical section? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:17:34.955Z
+ card-last-score:: 1
+ - In the middle of the critical section, the system may be in an inconsistent state. The process is holding a lock, and if it dies, no other process waiting on that lock can proceed.
+ - Developers must ensure that critical regions are very short and always terminate.
+ - ### Beyond Locks
+ - Locks only provide **mutual exclusion**.
+ - They ensure that only one process is in the critical section at a time.
+ - Locks are good for protecting our shared resource to prevent race conditions & avoid non-deterministic execution.
+ - What about fairness, avoiding starvation, & livelock?
+ - We need to be able to place an ordering on the scheduling of a process.
+ -
+ - ## Semaphores
+ collapsed:: true
+ - Example: We want to place an order on when processes execute.
+ background-color:: green
+ - Producer-Consumer:
+ - Producer: Creates a resource (data).
+ - Consumer: Uses a resource (data).
+ - E.g.: `ps | grep "gcc" | wc`.
+ - Don't want producers & consumers to operate in **lockstep** (i.e., atomicity).
+ - Each command must wait for the previous output.
+ - Implies lots of context switching (i.e., very expensive).
+ - ^^**Solution:** Place a fixed-size buffer between producers & consumers.^^
+ - ^^Synchronise access to buffer.^^
+ - ^^Producer waits if the buffer is full; the consumer waits if the buffer is empty.^^
+ - What is a **semaphore**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:50:12.454Z
+ card-last-score:: 1
+ - A **semaphore** is a higher-level synchronisation primitive.
+ - Semaphores are a kind of **generalised lock**.
+ - They are the main synchronisation primitive used in the original UNIX.
+ - Semaphores are implemented with a **counter** that is manipulated atomically via 2 operations: **signal** & **wait**.
+ - `wait(semaphore)`: AKA `down()` or `P()`.
+ - **Decrement** counter.
+ - If counter is zero, then block until semaphore is **signalled**.
+ - `signal(semaphore)`: AKA `up()` or `V()`.
+ - **Increment** counter.
+ - Wake up one **waiter**, if any.
+ - `sem_init(semaphore, counter)`:
+ - Set initial counter value.
+ - ### Semaphore PseudoCode #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:13:51.708Z
+ card-last-score:: 1
+ - `wait()` & `signal()` are **critical sections**.
+ - Hence, they must be executed **atomically** with respect to each other.
+ - Each semaphore has an associated queue of processes.
+ - When `wait()` is called by a process:
+ - If the semaphore is available -> the process continues.
+ - If the semaphore is unavailable -> the process blocks, waits on queue.
+ - `signal()` opens the semaphore.
+ - If processes are waiting on a queue -> one process is unblocked.
+ - If no processes are on the queue -> the signal is remembered for the next time `wait()` is called.
+ - Note: Blocking processes is **not** spinning - they release the CPU to do other work.
+ - ```pseudocode
+ struct semaphore {
+ int value;
+ queue L[]; // list of processes
+ }
+ - wait (S) {
+ if (s.value > 0) {
+ s.value--;
+ }
+ else {
+ add this process to s.L;
+ block;
+ }
+ }
+ - signal(S) {
+ if (S.L != EMPTY) {
+ remove a process P from S.L;
+ wakeup(P);
+ }
+ else {
+ s.value++;
+ }
+ }
+ ```
+ - ### Semaphore Initialisation
+ - If the semaphore is initialised to `1`: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:52:48.262Z
+ card-last-score:: 1
+ - The first call to `wait` goes through -> The semaphore value goes from `1` to `0`.
+ - The second call to `wait` **blocks** -> The semaphore value stays at `0`, the process goes on the queue.
+ - If the first process calls `signal()` -> The semaphore value stays at `0` and wakes up the second process.
+ - The semaphore acts like a **mutex lock**.
+ - We can use semaphores to implement locks.
+ - This is called a **binary semaphore**.
+ - If the semaphore is initialised to `2`: #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:51:38.462Z
+ card-last-score:: 1
+ - The initial value of the semaphore = the number of processes that can be active at once.
+ - `sem_init(sem, 2)`:
+ - `value = 2, L = []`.
+ - Consider multiple processes:
+ - Process1: `wait(sem)`.
+ - `value = 1, L = []` -> P1 executes.
+ - Process2: `wait(sem)`.
+ - `value = 0, L = []` -> P2 executes.
+ - Process3: `wait(sem)`.
+ - `value = 0, L = [P3]` -> P3 blocks.
+ - ### Counting Semaphores #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T15:52:26.139Z
+ card-last-score:: 1
+ - Allocating a number of resources.
+ - Shared buffers: each time you want to access a buffer, call `wait()`.
+ - You are queued if there is no buffer available.
+ - Counter is initialised to $N$ = number resources.
+ - This is called a **counting semaphore**.
+ - Useful for **conditional synchronisation**.
+ - i.e., if one process is waiting for another process to finish a price of work before it continues.
+ - ### Semaphores for Mutual Exclusion #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:15:56.292Z
+ card-last-score:: 1
+ - With semaphores, guaranteeing mutual exclusion for $N$ processes is trivial.
+ - ```c
+ semaphore mutex = 1;
+
+ void Process(int i) {
+ while (1) {
+ // Non-Critical Section Bit
+ wait(mutex); // grab the mutual exclusion semaphore
+ // Do the Critical Section Bit
+ signal(mutex);
+ }
+ }
+
+ int main() {
+ cobegin {
+ Process(1); Process(2);
+ }
+ }
+ ```
+ - ### Bounded Buffer Problem #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-11T00:00:00.000Z
+ card-last-reviewed:: 2022-11-10T10:55:02.784Z
+ card-last-score:: 1
+ - Producer-Consumer Problem:
+ - Buffer in memory - finite size of $N$ entries.
+ - A producer process inserts an entry into the buffer.
+ - A consumer process removes an entry from the buffer.
+ - Processes are **concurrent** - we must use a synchronisation mechanism to control access to shared variables describing the buffer state.
+ - #### Producer-Consumer Single Buffer
+ - Simplest case:
+ - Single producer process & single consumer process.
+ - Single shared buffer between the producer & consumer.
+ - Requirements:
+ - Consumer must wait for Producer to fill the buffer.
+ - Producer must wait for the Consumer to empty the buffer (if filled).
+ - 
+ -
+ - ### Semaphores Can Be Hard to Use #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:24:06.193Z
+ card-last-score:: 1
+ - Complex patterns of resource usage.
+ - Cannot capture relationships with semaphores alone.
+ - Need extra state variables to record information.
+ - Produce buggy code that is hard to write.
+ - E.g., if one coder forgets to do `V()`/`signal()` after a critical section, the whole system can deadlock.
+ - ## Monitors
+ collapsed:: true
+ - What are **Monitors**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:24:14.222Z
+ card-last-score:: 1
+ - **Monitors** are an extension of the monolithic monitor used in the OS to allocate memory.
+ - A programming language construct that supports controlled access to shared data.
+ - Synchronisation code added by compiler, enforced at runtime -> less work for programmer.
+ - Monitors can keep track of **who** is allowed to access the shared data and **when** they can do it.
+ - Monitors are a higher-level construct than semaphores.
+ - Monitors encapsulate:
+ - Shared data structures.
+ - Procedures that operate on shared data.
+ - Synchronisation between concurrent processes that invoke these procedures.
+ -
+- # Detection & Protection of Deadlock
+ - ## Requirements for Deadlock #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-11T00:00:00.000Z
+ card-last-reviewed:: 2022-11-10T10:55:28.721Z
+ card-last-score:: 1
+ - All four conditions must hold for deadlock to occur:
+ - 1. **Mutex:** At least **one** resource must be **non-shareable**.
+ 2. **No Pre-Emption:** Resources cannot be **pre-empted** (no way to break priority or take a resource away once allocated).
+ - Locks have this property.
+ - 3. **Hold & Wait:** There is an existing process holding a resource and waiting for another resource.
+ 4. **Circular Wait:** There exists a set of process $P_1, P_2, \cdots, P_N$ such that $P_1$ is waiting for $P_2$, $P_2$ is waiting for $P_3$, ..., and $P_N$ is waiting for $P_1$.
+ - If only three conditions hold then you can get **starvation**, but not deadlock.
+ - ## Deadlocks Without Locks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:13:42.597Z
+ card-last-score:: 1
+ - Deadlocks can occur for any resource or any time a process waits, e.g.:
+ - Messages: waiting to receive a message before sending a message.
+ - i.e., hold & wait.
+ - Allocation: waiting to allocate resources before freeing another resource.
+ - i.e., hold & wait.
+ - ## Dealing with Deadlocks #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T20:25:37.300Z
+ card-last-score:: 1
+ - ### Strategy 1: Ignore #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:14:57.281Z
+ card-last-score:: 1
+ - Ignore the fact that deadlocks may occur.
+ - Write code, put nothing special in.
+ - Sometimes you have to reboot the system.
+ - May work for some unimportant or simple applications where deadlock does not occur often.
+ - Quite a common approach.
+ - ### Strategy 2: Reactive #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-11T00:00:00.000Z
+ card-last-reviewed:: 2022-11-10T10:58:24.765Z
+ card-last-score:: 1
+ - Periodically check for evidence of a deadlock.
+ - E.g., add timeouts to acquiring a lock, if you timeout, then it implies that deadlock has occurred and you must do something.
+ - Recovery actions:
+ - Blue screen of death & reboot computer.
+ - Pick a process to terminate, e.g., a low-priority one.
+ - Only works with some types of applications.
+ - May corrupt data, so the process needs to do clean-up when terminated.
+ - ### Strategy 3: Proactive #card
+ collapsed:: true
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-15T00:00:00.000Z
+ card-last-reviewed:: 2022-11-14T16:18:36.908Z
+ card-last-score:: 1
+ - Prevent one of the four necessary conditions for deadlock.
+ - No single approach is appropriate (or possible) for all circumstances.
+ - Need techniques for each of the four conditions.
+ - #### Solution 1: No Mutual Exclusion
+ - Make resources shareable.
+ - E.g., read-only files - no need for locks.
+ - ### Solution 2: Adding Pre-Emption
+ - Locks cannot be pre-empted but other pre-emptive methods are possible.
+ - Strategy: pre-empt resources.
+ - Example: If process $A$ is waiting for a resource held by process $B$, then take the resource from $B$ and give it to $A$.
+ - Problems:
+ - Only works for some resources
+ - E.g., CPU & Memory (using virtual memory).
+ - Not possible if a resource cannot be saved & restored.
+ - Otherwise, taking away a lock causes issues.
+ - Also, there is an overhead cost for "pre-empt" & "restore".
+ - ### Solution 3: Avoid Hold & Wait
+ - Only request a resource when you have none, i.e., release a resource before requesting another.
+ - Never hold $x$ when want $y$.
+ - Works in many cases, but you cannot maintain a relationship between $x$ & $y$.
+ - Acquire all resources at once, e.g., use a single lock to protect all data.
+ - Having fewer locks is called **lock coarsening**.
+ - Problem: All processes accessing $A$ or $B$ cannot run at the same time, even if they don't access both variables.
+ - #### Solution 4: Eliminate Circular Waits
+ - Strategy: Impose an ordering on resources.
+ - Processes must acquire the highest-ranked resource first.
+ - Locks are always acquired in the same order.
+ - We have eliminated the circular dependency, but we will need to lock a resource for a longer period.
+ - Strategy: Define an ordering of **all** locks in your program.
+ - Always acquire locks in that order.
+ - Problem: Sometimes you do not know the order that the events will be used.
+ - How do we know the global order?
+ - Need extra code to find this out and then acquire them in the right order.
+ - It could get worse.
+ -
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-09-30T10_01_42.369Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-09-30T10_01_42.369Z.Desktop.md
new file mode 100644
index 00000000..f4acf898
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-09-30T10_01_42.369Z.Desktop.md
@@ -0,0 +1,401 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Overview of Computer Systems]]
+- **Relevant Slides:** 
+-
+- What is a **Processor Programming Model**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:30:08.809Z
+ card-last-score:: 1
+ - A **Processor Programming Model** defines ^^how instructions access their operands and how instructions are described in the processor's assembly language.^^
+ - Processors with different programming models can offer similar sets of operations but may require very different approaches to programming.
+-
+- ## Instructions
+ - What is the **Instruction Cycle**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:44:15.029Z
+ card-last-reviewed:: 2022-09-19T17:44:15.030Z
+ card-last-score:: 5
+ - The **Instruction Cycle** is the ^^procedure of processing an instruction^^ by the microprocessor.
+ - **Fetch:** read the instructions from memory
+ - **Decode:** Determine what is to be done
+ - **Execute:** Perform the operation
+ - Each of the functions fetch -> decode -> execute consist of a sequence of one or more operations inside the CPU (and interaction with the subsystems).
+ - ### Types of Instructions
+ - #### Data Transfer Instructions
+ - What are **Data Transfer Instructions**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:23:45.121Z
+ card-last-reviewed:: 2022-09-18T15:23:45.122Z
+ card-last-score:: 5
+ - Operations that ^^move data^^ from one place to another.
+ - These instructions ^^don't modify^^ the data, they just copy it to the destination.
+ - What operations can data transfer instructions do? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T20:04:00.341Z
+ card-last-reviewed:: 2022-09-14T20:04:00.342Z
+ card-last-score:: 3
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-22T14:49:14.991Z
+ card-last-reviewed:: 2022-09-18T14:49:14.991Z
+ card-last-score:: 5
+ 1. **Load data** from memory into the microprocessor. #card
+ - These instructions copy data from memory into microprocessor registers (i.e., LD).
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:25:37.994Z
+ card-last-reviewed:: 2022-09-19T18:25:37.995Z
+ card-last-score:: 3
+ 2. **Store data** from the microprocessor into the memory. #card
+ - Similar to load data, except that the data is copied in the opposite direction (i.e., ST).
+ - Data is saved from internal microprocessor registers into the memory
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:27:19.756Z
+ card-last-reviewed:: 2022-09-19T18:27:19.757Z
+ card-last-score:: 5
+ 3. **Move data** within the microprocessor. #card
+ - These instructions move data from one microprocessor register to another (i.e., MOV)
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:44:07.730Z
+ card-last-reviewed:: 2022-09-19T17:44:07.731Z
+ card-last-score:: 5
+ 4. **Input data** into the microprocessor.
+ - A microprocessor may need to input data from the outside world.
+ - These are the instructions that input data from the input device into the microprocessor.
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:47:33.165Z
+ card-last-reviewed:: 2022-09-19T17:47:33.165Z
+ card-last-score:: 5
+ 5. **Output data** from the microprocessor.
+ - The microprocessor copies data from one of its internal registers to an output device.
+ - Example: the microprocessor may want to show the content of an internal register on a display (the key has been pressed) (i.e., IOWR).
+ - #### Data Operation Instructions #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:22:56.393Z
+ card-last-reviewed:: 2022-09-19T18:22:56.393Z
+ card-last-score:: 5
+ - Instructions ^^do^^ modify their data values.
+ - They typically perform some operation (e.g., +, -, *) using one or two data values (operands) and store the result.
+ - What operations can data operation instructions do? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:24:32.521Z
+ card-last-reviewed:: 2022-09-19T18:24:32.522Z
+ card-last-score:: 5
+ - **Arithmetic Instructions** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:22:33.756Z
+ card-last-reviewed:: 2022-09-19T18:22:33.756Z
+ card-last-score:: 5
+ - add, subtract, multiply, or divide
+ - ADD, SUB, MUL, DIV
+ - Instructions that increment or decrement one from a value
+ - INC, DEC
+ - Floating point instructions that operate on floating point values
+ - FADD, FSUB, FMUL, FDIV
+ - **Logic Instructions** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:06:07.075Z
+ card-last-reviewed:: 2022-09-19T18:06:07.076Z
+ card-last-score:: 5
+ - AND, OR, XOR, NOT, etc.
+ - **Shift Instructions** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T20:03:10.515Z
+ card-last-reviewed:: 2022-09-14T20:03:10.515Z
+ card-last-score:: 3
+ - SR, SL, RR, RL, etc.
+ - #### Program Control Instructions #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-21T20:52:13.309Z
+ card-last-reviewed:: 2022-09-17T20:52:13.310Z
+ card-last-score:: 5
+ - **Jump** or **branch** instructions are used to ^^go to another part of the program^^; Jumps can be **absolute** or **conditional**.
+ - e.g., if, then, else.
+ - Instructions that can generate **interrupts**.
+ - Software interrupts.
+ - **Jump & branch instructions** (conditional or unconditional) #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:23:56.248Z
+ card-last-reviewed:: 2022-09-19T18:23:56.248Z
+ card-last-score:: 5
+ - **JZ:** Jump if the zero flag is set.
+ - **JNZ:** Jump if the zero flag is **not** set.
+ - **JMP:** Unconditional jump - flags are ignored.
+ - etc.
+ - **Comparison Instructions** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:49:38.450Z
+ card-last-reviewed:: 2022-09-19T17:49:38.451Z
+ card-last-score:: 5
+ - TEST: logical BITWISE AND
+ - **Calls & Returns** a / from a routine (conditional or unconditional) #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:26:43.360Z
+ card-last-reviewed:: 2022-09-19T18:26:43.361Z
+ card-last-score:: 5
+ - **Call:** call a subroutine at a certain line.
+ - **RET:** return from a subroutine.
+ - **IRET:** interrupt & return.
+ - **Software Interrupts** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:26:39.506Z
+ card-last-reviewed:: 2022-09-19T18:26:39.507Z
+ card-last-score:: 5
+ - Generated by devices outside of a microprocessor (not part of the instruction set).
+ - INT
+ - **Exceptions & Traps** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T17:43:10.837Z
+ card-last-score:: 1
+ - Triggered when valid instructions perform invalid operations.
+ - e.g., dividing by zero.
+ - **Halt Instructions** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:21:28.059Z
+ card-last-reviewed:: 2022-09-18T15:21:28.060Z
+ card-last-score:: 5
+ - Causes the processor to stop executions.
+ - e.g., at the end of the program.
+ - HALT
+-
+- ## Stack Architectures
+ - ### The Stack
+ - **Last In First Out (LIFO)** data structure.
+ - Consists of **locations**, each of which can hold a **word of data**.
+ - It can be used to explicitly **save / restore** data.
+ - What operations does the stack support? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:28:06.057Z
+ card-last-reviewed:: 2022-09-19T18:28:06.058Z
+ card-last-score:: 5
+ - The stack supports ^^two operations.^^
+ - **PUSH:** takes one argument and places the value of the argument at the top of the stack.
+ - **POP:** removes one element from the stack, saving it into a predefined register of the processor.
+ - The stack is ^^used implicitly by procedure call instructions.^^
+ - (if available in the data set).
+ - When new data is added to the stack, it is placed at the top of the stack, and all of the contents of the stack are pushed down one location.
+ - ### Implementing Stacks
+ - What are the two ways to implement a stack? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T20:02:02.188Z
+ card-last-reviewed:: 2022-09-14T20:02:02.189Z
+ card-last-score:: 3
+ - card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-19T23:00:00.000Z
+ card-last-reviewed:: 2022-09-19T18:25:12.624Z
+ card-last-score:: 1
+ 1. **Dedicated Hardware Stack** #card
+ - Has a ^^hardware limitation^^ (limited number of locations).
+ - Very fast.
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:06:34.732Z
+ card-last-reviewed:: 2022-09-19T18:06:34.733Z
+ card-last-score:: 5
+ 2. **Memory Implemented Stack** #card
+ - Limited by the ^^physical memory of the system.^^
+ - Slow compared with hardware stacks, since extra memory addressing has to take place for each stack operation.
+ - {:height 405, :width 638}
+ - Every **push operation** will ^^increment the top of the **stack pointer**^^ with the word size of the machine.
+ - Every **pop operation** will ^^decrement the top of the stack pointer^^ (with the word size of the machine).
+ - **Stack overflows** can occur in both stack implementations
+ - What is a **stack overflow**? #card
+ card-last-interval:: 11.16
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-30T20:49:01.529Z
+ card-last-reviewed:: 2022-09-19T17:49:01.530Z
+ card-last-score:: 5
+ - A **stack overflow** occurs when the amount of data in the stack exceeds the amount of space allocated to the stack (or the hardware limit of the stack).
+ - ### Instructions in Stack-Based Architecture #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:28:26.926Z
+ card-last-reviewed:: 2022-09-19T18:28:26.926Z
+ card-last-score:: 3
+ - Instructions in a stack-base architecture get their operands from the stack and write their results to the stack.
+ - The advantage of this is that ^^program code takes little memory - there is no need to specify the address of the operands or registers.^^
+ - PUSH is one exception, because it needs the operand to be specified (either as a constant or as an address).
+ - ### Programs in a Stack-Based Architecture
+ - Writing programs for stack-based architecture is not easy.
+ - Stack-based architectures are better suited for **postfix** notation rather than **infix** notation.
+ - What is **infix notation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:49:06.464Z
+ card-last-reviewed:: 2022-09-19T17:49:06.465Z
+ card-last-score:: 5
+ - **Infix notation** is the traditional way of representing mathematical expressions, with ^^operations placed **between** the operands.^^
+ - e.g., a + b
+ - What is **postfix notation**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-22T15:21:53.178Z
+ card-last-reviewed:: 2022-09-18T15:21:53.178Z
+ card-last-score:: 5
+ - In **postfix notation**, ^^the operation is placed **after** the operands.^^
+ - e.g., a b +
+ - Stack-based architectures are better suited for **postfix notation**.
+ - Once an expression has been converted into postfix notation, implementing it in programs is easy.
+ - ### Using Stacks to Implement Procedure Calls
+ - Programs need a way to **pass inputs to the procedures** that they call and to receive outputs back from them.
+ - Procedures need to be able to **allocate space in memory for local variables** without overriding any data used by their calling program.
+ - It is impossible to determine which registers may be used safely by the procedure (especially if the procedure is located in a library).
+ - So, a mechanism to **save / restore registers** of the calling program has to be in place.
+ - Procedures need a way to figure out where they were called from.
+ - So, the execution can **return to the calling program** where the procedure completes (they need to restore the program counter).
+ - How are procedure calls implemented in Stacks? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-22T14:49:10.043Z
+ card-last-reviewed:: 2022-09-18T14:49:10.044Z
+ card-last-score:: 3
+ - 
+ - When a procedure is called, a **block of memory** in the stack called a **stack frame** is allocated.
+ - The top of the stack pointer is incremented by the **number of locations** in the stack frame.
+ - When a procedure finishes, it jumps to the **return address** of the stack and the execution of the calling program resumes.
+ - How are nested procedure calls implemented in the stack? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-09-23T18:28:18.819Z
+ card-last-reviewed:: 2022-09-19T18:28:18.819Z
+ card-last-score:: 3
+ - 
+ - main program calls function f(),
+ - function f() calls function g(),
+ - function g() calls function h()
+- ## General-Purpose Register Architectures
+ - ### General-Purpose Register File
+ - In GPR Architectures, instructions read their operands and write their results to a **random access register file**.
+ - The general-purpose register file allows the ^^access of **any** register in **any** order^^ by specifying the number (register ID) of the register.
+ - What is the main difference between a GPR & a stack? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-09-23T18:05:31.335Z
+ card-last-reviewed:: 2022-09-19T18:05:31.335Z
+ card-last-score:: 3
+ - The main difference between a GPR and a stack is that repeatedly reading a register will produce the same result and **will not** modify the state of the register file.
+ - Popping an item from a LIFO structure (stack) **will** modify the contents of the stack,
+ - Many GPR architectures assign special values to some registers in the register file to make programming easier.
+ - e.g., sometimes, register 0 is hardwired with value 0 to generate this most common constant.
+ - ### Instructions in GPR Architecture
+ - What do GPR instructions need to specify? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-21T20:52:42.181Z
+ card-last-reviewed:: 2022-09-17T20:52:42.181Z
+ card-last-score:: 3
+ - GPR instructions need to specify:
+ - **the register** that holds their **input operands**
+ - the register that will hole the **result**
+ - What is the most common GPR instruction format? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-15T22:48:52.100Z
+ card-last-reviewed:: 2022-09-19T17:48:52.100Z
+ card-last-score:: 5
+ - The most common GPR instruction format is the **three operands instruction format**.
+ - e.g., "ADD r1, r2, r3" instructs the processor to read the contents of r2 and r3, add them together, and write the results in r1.
+ - Instructions that only have one or two inputs are also present in GPR architecture.
+ - Which architecture allows **caching**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T18:23:37.492Z
+ card-last-reviewed:: 2022-09-19T18:23:37.492Z
+ card-last-score:: 5
+ - In GPR Architecture, ^^programs can choose which values should be stored in the register file at any given time^^, allowing them to **cache** the most accessed data.
+ - In stack-based architectures, once the data has been used, it's gone.
+ - From this point of view, ^^GPR architectures have **better performance**^^, at the expense of needing **more storage space** for the program.
+ - larger instructions are needed to encode the addresses of the operands.
+ - #### Simple GPR Instruction Set
+ - 
+ -
+ - ### Programs in a GPR Architecure #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T23:00:00.000Z
+ card-last-reviewed:: 2022-09-18T15:22:40.946Z
+ card-last-score:: 1
+ - Programming a GPR architecture processor is **less structured** than programming a stack-based architecture processor.
+ - There are **fewer restrictions on the order** in which operations can be executed.
+ - In stack-based architectures, instructions must execute in the order that would leave the operands for the next instructions on the top of the stack.
+ - In GPR, any order that places the operands for the next instruction in the register file before the instruction executes is valid.
+ - Operations that access different registers can be **reordered** without making the program invalid.
+ -
+- ## Stack-Bases vs GPR Architectures
+ - Stack-based architectures are still attractive for certain embedded systems.
+ - GPR architectures are used by modern computers.
+ - ## Stack-Based Architectures #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-18T20:02:49.354Z
+ card-last-reviewed:: 2022-09-14T20:02:49.354Z
+ card-last-score:: 3
+ - Instructions take **fewer bits** to encode.
+ - **Reduced amount of memory** taken up by programs.
+ - Manages the **use of registers automatically** (no need for programmer intervention).
+ - The instruction set **does not change** if the size of the register file has changed.
+ - ## GPR Architectures
+ - With the evolution of technology, the amount of space taken up by a program is less important.
+ - Compilers for GPR architecture achieve **better performance** with a given number of general-purpose registers than those on stack-based architectures with the same number of registers.
+ - The compiler can choose which values to keep (**cache**) in the register file at any time.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-10-07T08_33_33.362Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-10-07T08_33_33.362Z.Desktop.md
new file mode 100644
index 00000000..0ba1d889
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-10-07T08_33_33.362Z.Desktop.md
@@ -0,0 +1,401 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Overview of Computer Systems]]
+- **Relevant Slides:** 
+-
+- What is a **Processor Programming Model**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-04T08:27:22.997Z
+ card-last-reviewed:: 2022-09-30T08:27:22.998Z
+ card-last-score:: 3
+ - A **Processor Programming Model** defines ^^how instructions access their operands and how instructions are described in the processor's assembly language.^^
+ - Processors with different programming models can offer similar sets of operations but may require very different approaches to programming.
+-
+- ## Instructions
+ - What is the **Instruction Cycle**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:30.873Z
+ card-last-reviewed:: 2022-10-03T11:42:30.874Z
+ card-last-score:: 5
+ - The **Instruction Cycle** is the ^^procedure of processing an instruction^^ by the microprocessor.
+ - **Fetch:** read the instructions from memory
+ - **Decode:** Determine what is to be done
+ - **Execute:** Perform the operation
+ - Each of the functions fetch -> decode -> execute consist of a sequence of one or more operations inside the CPU (and interaction with the subsystems).
+ - ### Types of Instructions
+ - #### Data Transfer Instructions
+ - What are **Data Transfer Instructions**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:48.321Z
+ card-last-reviewed:: 2022-10-03T11:40:48.321Z
+ card-last-score:: 5
+ - Operations that ^^move data^^ from one place to another.
+ - These instructions ^^don't modify^^ the data, they just copy it to the destination.
+ - What operations can data transfer instructions do? #card
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:46:12.475Z
+ card-last-reviewed:: 2022-09-30T08:46:12.475Z
+ card-last-score:: 5
+ - card-last-interval:: 11.56
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T21:26:36.529Z
+ card-last-reviewed:: 2022-09-30T08:26:36.529Z
+ card-last-score:: 5
+ 1. **Load data** from memory into the microprocessor. #card
+ - These instructions copy data from memory into microprocessor registers (i.e., LD).
+ - card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:28:41.508Z
+ card-last-reviewed:: 2022-10-03T14:28:41.509Z
+ card-last-score:: 5
+ 2. **Store data** from the microprocessor into the memory. #card
+ - Similar to load data, except that the data is copied in the opposite direction (i.e., ST).
+ - Data is saved from internal microprocessor registers into the memory
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:32.655Z
+ card-last-reviewed:: 2022-10-03T14:29:32.655Z
+ card-last-score:: 5
+ 3. **Move data** within the microprocessor.
+ - These instructions move data from one microprocessor register to another (i.e., MOV)
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:44:07.730Z
+ card-last-reviewed:: 2022-09-19T17:44:07.731Z
+ card-last-score:: 5
+ 4. **Input data** into the microprocessor.
+ - A microprocessor may need to input data from the outside world.
+ - These are the instructions that input data from the input device into the microprocessor.
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:47:33.165Z
+ card-last-reviewed:: 2022-09-19T17:47:33.165Z
+ card-last-score:: 5
+ 5. **Output data** from the microprocessor.
+ - The microprocessor copies data from one of its internal registers to an output device.
+ - Example: the microprocessor may want to show the content of an internal register on a display (the key has been pressed) (i.e., IOWR).
+ - #### Data Operation Instructions #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:45:28.268Z
+ card-last-reviewed:: 2022-10-03T11:45:28.268Z
+ card-last-score:: 5
+ - Instructions that *do* modify their data values.
+ - They typically perform some operation (e.g., +, -, *) using one or two data values (operands) and store the result.
+ - What operations can data operation instructions do? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-03T23:00:00.000Z
+ card-last-reviewed:: 2022-10-03T14:27:42.566Z
+ card-last-score:: 1
+ - **Arithmetic Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:56.702Z
+ card-last-reviewed:: 2022-10-03T11:44:56.702Z
+ card-last-score:: 5
+ - add, subtract, multiply, or divide
+ - ADD, SUB, MUL, DIV
+ - Instructions that increment or decrement one from a value
+ - INC, DEC
+ - Floating point instructions that operate on floating point values
+ - FADD, FSUB, FMUL, FDIV
+ - **Logic Instructions**
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:49.421Z
+ card-last-reviewed:: 2022-10-03T11:43:49.421Z
+ card-last-score:: 5
+ - AND, OR, XOR, NOT, etc.
+ - **Shift Instructions**
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:45:44.876Z
+ card-last-reviewed:: 2022-09-30T08:45:44.877Z
+ card-last-score:: 5
+ - SR, SL, RR, RL, etc.
+ - #### Program Control Instructions #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T04:28:17.821Z
+ card-last-reviewed:: 2022-09-30T09:28:17.821Z
+ card-last-score:: 5
+ - **Jump** or **branch** instructions are used to ^^go to another part of the program^^; Jumps can be **absolute** or **conditional**.
+ - e.g., if, then, else.
+ - Instructions that can generate **interrupts**.
+ - Software interrupts.
+ - **Jump & branch instructions** (conditional or unconditional)
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:27:30.317Z
+ card-last-reviewed:: 2022-10-03T14:27:30.317Z
+ card-last-score:: 5
+ - **JZ:** Jump if the zero flag is set.
+ - **JNZ:** Jump if the zero flag is **not** set.
+ - **JMP:** Unconditional jump - flags are ignored.
+ - etc.
+ - **Comparison Instructions** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:42:52.048Z
+ card-last-reviewed:: 2022-10-03T11:42:52.049Z
+ card-last-score:: 3
+ - TEST: logical BITWISE AND
+ - **Calls & Returns** a / from a routine (conditional or unconditional) #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:28:56.319Z
+ card-last-reviewed:: 2022-10-03T14:28:56.319Z
+ card-last-score:: 3
+ - **Call:** call a subroutine at a certain line.
+ - **RET:** return from a subroutine.
+ - **IRET:** interrupt & return.
+ - **Software Interrupts** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:46.482Z
+ card-last-reviewed:: 2022-10-03T14:28:46.483Z
+ card-last-score:: 5
+ - Generated by devices outside of a microprocessor (not part of the instruction set).
+ - INT
+ - **Exceptions & Traps** #card
+ card-last-interval:: 4.14
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-04T12:23:07.638Z
+ card-last-reviewed:: 2022-09-30T09:23:07.638Z
+ card-last-score:: 5
+ - Triggered when valid instructions perform invalid operations.
+ - e.g., dividing by zero.
+ - **Halt Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:56.173Z
+ card-last-reviewed:: 2022-10-03T11:37:56.174Z
+ card-last-score:: 5
+ - Causes the processor to stop executions.
+ - e.g., at the end of the program.
+ - HALT
+-
+- ## Stack Architectures
+ - ### The Stack
+ - **Last In First Out (LIFO)** data structure.
+ - Consists of **locations**, each of which can hold a **word of data**.
+ - It can be used to explicitly **save / restore** data.
+ - What operations does the stack support? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:30:00.780Z
+ card-last-reviewed:: 2022-10-03T14:30:00.780Z
+ card-last-score:: 5
+ - The stack supports ^^two operations.^^
+ - **PUSH:** takes one argument and places the value of the argument at the top of the stack.
+ - **POP:** removes one element from the stack, saving it into a predefined register of the processor.
+ - The stack is ^^used implicitly by procedure call instructions.^^
+ - (if available in the data set).
+ - When new data is added to the stack, it is placed at the top of the stack, and all of the contents of the stack are pushed down one location.
+ - ### Implementing Stacks
+ - What are the two ways to implement a stack? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T05:45:27.331Z
+ card-last-reviewed:: 2022-09-30T08:45:27.331Z
+ card-last-score:: 3
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-04T09:27:02.226Z
+ card-last-reviewed:: 2022-09-30T09:27:02.226Z
+ card-last-score:: 3
+ 1. **Dedicated Hardware Stack** #card
+ - Has a ^^hardware limitation^^ (limited number of locations).
+ - Very fast.
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:04.293Z
+ card-last-reviewed:: 2022-10-03T11:44:04.294Z
+ card-last-score:: 5
+ 2. **Memory Implemented Stack** #card
+ - Limited by the ^^physical memory of the system.^^
+ - Slow compared with hardware stacks, since extra memory addressing has to take place for each stack operation.
+ - {:height 405, :width 638}
+ - Every **push operation** will ^^increment the top of the **stack pointer**^^ with the word size of the machine.
+ - Every **pop operation** will ^^decrement the top of the stack pointer^^ (with the word size of the machine).
+ - **Stack overflows** can occur in both stack implementations
+ - What is a **stack overflow**? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-04T20:25:37.658Z
+ card-last-reviewed:: 2022-10-04T12:25:37.659Z
+ card-last-score:: 5
+ - A **stack overflow** occurs when the amount of data in the stack exceeds the amount of space allocated to the stack (or the hardware limit of the stack).
+ - ### Instructions in Stack-Based Architecture #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T21:30:35.451Z
+ card-last-reviewed:: 2022-10-03T14:30:35.452Z
+ card-last-score:: 3
+ - Instructions in a stack-base architecture get their operands from the stack and write their results to the stack.
+ - The advantage of this is that ^^program code takes little memory - there is no need to specify the address of the operands or registers.^^
+ - PUSH is one exception, because it needs the operand to be specified (either as a constant or as an address).
+ - ### Programs in a Stack-Based Architecture
+ - Writing programs for stack-based architecture is not easy.
+ - Stack-based architectures are better suited for **postfix** notation rather than **infix** notation.
+ - What is **infix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:45.628Z
+ card-last-reviewed:: 2022-10-03T11:42:45.628Z
+ card-last-score:: 5
+ - **Infix notation** is the traditional way of representing mathematical expressions, with ^^operations placed **between** the operands.^^
+ - e.g., a + b
+ - What is **postfix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:39:50.328Z
+ card-last-reviewed:: 2022-10-03T11:39:50.328Z
+ card-last-score:: 5
+ - In **postfix notation**, ^^the operation is placed **after** the operands.^^
+ - e.g., a b +
+ - Stack-based architectures are better suited for **postfix notation**.
+ - Once an expression has been converted into postfix notation, implementing it in programs is easy.
+ - ### Using Stacks to Implement Procedure Calls
+ - Programs need a way to **pass inputs to the procedures** that they call and to receive outputs back from them.
+ - Procedures need to be able to **allocate space in memory for local variables** without overriding any data used by their calling program.
+ - It is impossible to determine which registers may be used safely by the procedure (especially if the procedure is located in a library).
+ - So, a mechanism to **save / restore registers** of the calling program has to be in place.
+ - Procedures need a way to figure out where they were called from.
+ - So, the execution can **return to the calling program** where the procedure completes (they need to restore the program counter).
+ - How are procedure calls implemented in Stacks? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-08T12:27:13.347Z
+ card-last-reviewed:: 2022-10-04T12:27:13.347Z
+ card-last-score:: 3
+ - 
+ - When a procedure is called, a **block of memory** in the stack called a **stack frame** is allocated.
+ - The top of the stack pointer is incremented by the **number of locations** in the stack frame.
+ - When a procedure finishes, it jumps to the **return address** of the stack and the execution of the calling program resumes.
+ - How are nested procedure calls implemented in the stack? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T21:30:20.346Z
+ card-last-reviewed:: 2022-10-03T14:30:20.347Z
+ card-last-score:: 3
+ - 
+ - main program calls function f(),
+ - function f() calls function g(),
+ - function g() calls function h()
+- ## General-Purpose Register Architectures
+ - ### General-Purpose Register File
+ - In GPR Architectures, instructions read their operands and write their results to a **random access register file**.
+ - The general-purpose register file allows the ^^access of **any** register in **any** order^^ by specifying the number (register ID) of the register.
+ - What is the main difference between a GPR & a stack? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:43:13.452Z
+ card-last-reviewed:: 2022-10-03T11:43:13.452Z
+ card-last-score:: 3
+ - The main difference between a GPR and a stack is that repeatedly reading a register will produce the same result and **will not** modify the state of the register file.
+ - Popping an item from a LIFO structure (stack) **will** modify the contents of the stack,
+ - Many GPR architectures assign special values to some registers in the register file to make programming easier.
+ - e.g., sometimes, register 0 is hardwired with value 0 to generate this most common constant.
+ - ### Instructions in GPR Architecture
+ - What do GPR instructions need to specify? #card
+ card-last-interval:: 9.84
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T05:28:31.531Z
+ card-last-reviewed:: 2022-09-30T09:28:31.531Z
+ card-last-score:: 5
+ - GPR instructions need to specify:
+ - **the register** that holds their **input operands**
+ - the register that will hole the **result**
+ - What is the most common GPR instruction format? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-15T22:48:52.100Z
+ card-last-reviewed:: 2022-09-19T17:48:52.100Z
+ card-last-score:: 5
+ - The most common GPR instruction format is the **three operands instruction format**.
+ - e.g., "ADD r1, r2, r3" instructs the processor to read the contents of r2 and r3, add them together, and write the results in r1.
+ - Instructions that only have one or two inputs are also present in GPR architecture.
+ - Which architecture allows **caching**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:50.487Z
+ card-last-reviewed:: 2022-09-30T12:11:50.488Z
+ card-last-score:: 5
+ - In GPR Architecture, ^^programs can choose which values should be stored in the register file at any given time^^, allowing them to **cache** the most accessed data.
+ - In stack-based architectures, once the data has been used, it's gone.
+ - From this point of view, ^^GPR architectures have **better performance**^^, at the expense of needing **more storage space** for the program.
+ - larger instructions are needed to encode the addresses of the operands.
+ - #### Simple GPR Instruction Set
+ - 
+ -
+ - ### Programs in a GPR Architecure #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T12:29:33.188Z
+ card-last-reviewed:: 2022-10-04T12:29:33.188Z
+ card-last-score:: 5
+ - Programming a GPR architecture processor is **less structured** than programming a stack-based architecture processor.
+ - There are **fewer restrictions on the order** in which operations can be executed.
+ - In stack-based architectures, instructions must execute in the order that would leave the operands for the next instructions on the top of the stack.
+ - In GPR, any order that places the operands for the next instruction in the register file before the instruction executes is valid.
+ - Operations that access different registers can be **reordered** without making the program invalid.
+ -
+- ## Stack-Bases vs GPR Architectures
+ - Stack-based architectures are still attractive for certain embedded systems.
+ - GPR architectures are used by modern computers.
+ - ## Stack-Based Architectures #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T12:29:47.226Z
+ card-last-reviewed:: 2022-10-04T12:29:47.226Z
+ card-last-score:: 5
+ - Instructions take **fewer bits** to encode.
+ - **Reduced amount of memory** taken up by programs.
+ - Manages the **use of registers automatically** (no need for programmer intervention).
+ - The instruction set **does not change** if the size of the register file has changed.
+ - ## GPR Architectures
+ - With the evolution of technology, the amount of space taken up by a program is less important.
+ - Compilers for GPR architecture achieve **better performance** with a given number of general-purpose registers than those on stack-based architectures with the same number of registers.
+ - The compiler can choose which values to keep (**cache**) in the register file at any time.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-10-10T11_59_52.467Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-10-10T11_59_52.467Z.Desktop.md
new file mode 100644
index 00000000..75bba2f0
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-10-10T11_59_52.467Z.Desktop.md
@@ -0,0 +1,401 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Overview of Computer Systems]]
+- **Relevant Slides:** 
+-
+- What is a **Processor Programming Model**? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:41:26.528Z
+ card-last-score:: 1
+ - A **Processor Programming Model** defines ^^how instructions access their operands and how instructions are described in the processor's assembly language.^^
+ - Processors with different programming models can offer similar sets of operations but may require very different approaches to programming.
+-
+- ## Instructions
+ - What is the **Instruction Cycle**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:30.873Z
+ card-last-reviewed:: 2022-10-03T11:42:30.874Z
+ card-last-score:: 5
+ - The **Instruction Cycle** is the ^^procedure of processing an instruction^^ by the microprocessor.
+ - **Fetch:** read the instructions from memory
+ - **Decode:** Determine what is to be done
+ - **Execute:** Perform the operation
+ - Each of the functions fetch -> decode -> execute consist of a sequence of one or more operations inside the CPU (and interaction with the subsystems).
+ - ### Types of Instructions
+ - #### Data Transfer Instructions
+ - What are **Data Transfer Instructions**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:48.321Z
+ card-last-reviewed:: 2022-10-03T11:40:48.321Z
+ card-last-score:: 5
+ - Operations that ^^move data^^ from one place to another.
+ - These instructions ^^don't modify^^ the data, they just copy it to the destination.
+ - What operations can data transfer instructions do? #card
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:46:12.475Z
+ card-last-reviewed:: 2022-09-30T08:46:12.475Z
+ card-last-score:: 5
+ - card-last-interval:: 11.56
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T21:26:36.529Z
+ card-last-reviewed:: 2022-09-30T08:26:36.529Z
+ card-last-score:: 5
+ 1. **Load data** from memory into the microprocessor. #card
+ - These instructions copy data from memory into microprocessor registers (i.e., LD).
+ - card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:28:41.508Z
+ card-last-reviewed:: 2022-10-03T14:28:41.509Z
+ card-last-score:: 5
+ 2. **Store data** from the microprocessor into the memory. #card
+ - Similar to load data, except that the data is copied in the opposite direction (i.e., ST).
+ - Data is saved from internal microprocessor registers into the memory
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:32.655Z
+ card-last-reviewed:: 2022-10-03T14:29:32.655Z
+ card-last-score:: 5
+ 3. **Move data** within the microprocessor.
+ - These instructions move data from one microprocessor register to another (i.e., MOV)
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:44:07.730Z
+ card-last-reviewed:: 2022-09-19T17:44:07.731Z
+ card-last-score:: 5
+ 4. **Input data** into the microprocessor.
+ - A microprocessor may need to input data from the outside world.
+ - These are the instructions that input data from the input device into the microprocessor.
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:47:33.165Z
+ card-last-reviewed:: 2022-09-19T17:47:33.165Z
+ card-last-score:: 5
+ 5. **Output data** from the microprocessor.
+ - The microprocessor copies data from one of its internal registers to an output device.
+ - Example: the microprocessor may want to show the content of an internal register on a display (the key has been pressed) (i.e., IOWR).
+ - #### Data Operation Instructions #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:45:28.268Z
+ card-last-reviewed:: 2022-10-03T11:45:28.268Z
+ card-last-score:: 5
+ - Instructions that *do* modify their data values.
+ - They typically perform some operation (e.g., +, -, *) using one or two data values (operands) and store the result.
+ - What operations can data operation instructions do? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-10T17:11:57.372Z
+ card-last-reviewed:: 2022-10-06T17:11:57.372Z
+ card-last-score:: 5
+ - **Arithmetic Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:56.702Z
+ card-last-reviewed:: 2022-10-03T11:44:56.702Z
+ card-last-score:: 5
+ - add, subtract, multiply, or divide
+ - ADD, SUB, MUL, DIV
+ - Instructions that increment or decrement one from a value
+ - INC, DEC
+ - Floating point instructions that operate on floating point values
+ - FADD, FSUB, FMUL, FDIV
+ - **Logic Instructions**
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:49.421Z
+ card-last-reviewed:: 2022-10-03T11:43:49.421Z
+ card-last-score:: 5
+ - AND, OR, XOR, NOT, etc.
+ - **Shift Instructions**
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:45:44.876Z
+ card-last-reviewed:: 2022-09-30T08:45:44.877Z
+ card-last-score:: 5
+ - SR, SL, RR, RL, etc.
+ - #### Program Control Instructions #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T04:28:17.821Z
+ card-last-reviewed:: 2022-09-30T09:28:17.821Z
+ card-last-score:: 5
+ - **Jump** or **branch** instructions are used to ^^go to another part of the program^^; Jumps can be **absolute** or **conditional**.
+ - e.g., if, then, else.
+ - Instructions that can generate **interrupts**.
+ - Software interrupts.
+ - **Jump & branch instructions** (conditional or unconditional)
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:27:30.317Z
+ card-last-reviewed:: 2022-10-03T14:27:30.317Z
+ card-last-score:: 5
+ - **JZ:** Jump if the zero flag is set.
+ - **JNZ:** Jump if the zero flag is **not** set.
+ - **JMP:** Unconditional jump - flags are ignored.
+ - etc.
+ - **Comparison Instructions** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:42:52.048Z
+ card-last-reviewed:: 2022-10-03T11:42:52.049Z
+ card-last-score:: 3
+ - TEST: logical BITWISE AND
+ - **Calls & Returns** a / from a routine (conditional or unconditional) #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:28:56.319Z
+ card-last-reviewed:: 2022-10-03T14:28:56.319Z
+ card-last-score:: 3
+ - **Call:** call a subroutine at a certain line.
+ - **RET:** return from a subroutine.
+ - **IRET:** interrupt & return.
+ - **Software Interrupts** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:46.482Z
+ card-last-reviewed:: 2022-10-03T14:28:46.483Z
+ card-last-score:: 5
+ - Generated by devices outside of a microprocessor (not part of the instruction set).
+ - INT
+ - **Exceptions & Traps** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:33:23.926Z
+ card-last-score:: 1
+ - Triggered when valid instructions perform invalid operations.
+ - e.g., dividing by zero.
+ - **Halt Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:56.173Z
+ card-last-reviewed:: 2022-10-03T11:37:56.174Z
+ card-last-score:: 5
+ - Causes the processor to stop executions.
+ - e.g., at the end of the program.
+ - HALT
+-
+- ## Stack Architectures
+ - ### The Stack
+ - **Last In First Out (LIFO)** data structure.
+ - Consists of **locations**, each of which can hold a **word of data**.
+ - It can be used to explicitly **save / restore** data.
+ - What operations does the stack support? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:30:00.780Z
+ card-last-reviewed:: 2022-10-03T14:30:00.780Z
+ card-last-score:: 5
+ - The stack supports ^^two operations.^^
+ - **PUSH:** takes one argument and places the value of the argument at the top of the stack.
+ - **POP:** removes one element from the stack, saving it into a predefined register of the processor.
+ - The stack is ^^used implicitly by procedure call instructions.^^
+ - (if available in the data set).
+ - When new data is added to the stack, it is placed at the top of the stack, and all of the contents of the stack are pushed down one location.
+ - ### Implementing Stacks
+ - What are the two ways to implement a stack? #card
+ card-last-interval:: 8.88
+ card-repeats:: 3
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-09T05:45:27.331Z
+ card-last-reviewed:: 2022-09-30T08:45:27.331Z
+ card-last-score:: 3
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-12T15:29:51.594Z
+ card-last-reviewed:: 2022-10-08T15:29:51.595Z
+ card-last-score:: 3
+ 1. **Dedicated Hardware Stack** #card
+ - Has a ^^hardware limitation^^ (limited number of locations).
+ - Very fast.
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:04.293Z
+ card-last-reviewed:: 2022-10-03T11:44:04.294Z
+ card-last-score:: 5
+ 2. **Memory Implemented Stack** #card
+ - Limited by the ^^physical memory of the system.^^
+ - Slow compared with hardware stacks, since extra memory addressing has to take place for each stack operation.
+ - {:height 405, :width 638}
+ - Every **push operation** will ^^increment the top of the **stack pointer**^^ with the word size of the machine.
+ - Every **pop operation** will ^^decrement the top of the stack pointer^^ (with the word size of the machine).
+ - **Stack overflows** can occur in both stack implementations
+ - What is a **stack overflow**? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-04T20:25:37.658Z
+ card-last-reviewed:: 2022-10-04T12:25:37.659Z
+ card-last-score:: 5
+ - A **stack overflow** occurs when the amount of data in the stack exceeds the amount of space allocated to the stack (or the hardware limit of the stack).
+ - ### Instructions in Stack-Based Architecture #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T21:30:35.451Z
+ card-last-reviewed:: 2022-10-03T14:30:35.452Z
+ card-last-score:: 3
+ - Instructions in a stack-base architecture get their operands from the stack and write their results to the stack.
+ - The advantage of this is that ^^program code takes little memory - there is no need to specify the address of the operands or registers.^^
+ - PUSH is one exception, because it needs the operand to be specified (either as a constant or as an address).
+ - ### Programs in a Stack-Based Architecture
+ - Writing programs for stack-based architecture is not easy.
+ - Stack-based architectures are better suited for **postfix** notation rather than **infix** notation.
+ - What is **infix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:45.628Z
+ card-last-reviewed:: 2022-10-03T11:42:45.628Z
+ card-last-score:: 5
+ - **Infix notation** is the traditional way of representing mathematical expressions, with ^^operations placed **between** the operands.^^
+ - e.g., a + b
+ - What is **postfix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:39:50.328Z
+ card-last-reviewed:: 2022-10-03T11:39:50.328Z
+ card-last-score:: 5
+ - In **postfix notation**, ^^the operation is placed **after** the operands.^^
+ - e.g., a b +
+ - Stack-based architectures are better suited for **postfix notation**.
+ - Once an expression has been converted into postfix notation, implementing it in programs is easy.
+ - ### Using Stacks to Implement Procedure Calls
+ - Programs need a way to **pass inputs to the procedures** that they call and to receive outputs back from them.
+ - Procedures need to be able to **allocate space in memory for local variables** without overriding any data used by their calling program.
+ - It is impossible to determine which registers may be used safely by the procedure (especially if the procedure is located in a library).
+ - So, a mechanism to **save / restore registers** of the calling program has to be in place.
+ - Procedures need a way to figure out where they were called from.
+ - So, the execution can **return to the calling program** where the procedure completes (they need to restore the program counter).
+ - How are procedure calls implemented in Stacks? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T04:57:53.451Z
+ card-last-reviewed:: 2022-10-08T22:57:53.496Z
+ card-last-score:: 5
+ - 
+ - When a procedure is called,^^a block of memory in the stack called a **stack frame** is allocated.^^
+ - The top of the **stack pointer** is incremented by the number of locations in the stack frame.
+ - When a procedure finishes, it jumps to the **return address** of the stack and the execution of the calling program resumes.
+ - How are nested procedure calls implemented in the stack? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T21:30:20.346Z
+ card-last-reviewed:: 2022-10-03T14:30:20.347Z
+ card-last-score:: 3
+ - 
+ - main program calls function f(),
+ - function f() calls function g(),
+ - function g() calls function h()
+- ## General-Purpose Register Architectures
+ - ### General-Purpose Register File
+ - In GPR Architectures, instructions read their operands and write their results to a **random access register file**.
+ - The general-purpose register file allows the ^^access of **any** register in **any** order^^ by specifying the number (register ID) of the register.
+ - What is the main difference between a GPR & a stack? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:43:13.452Z
+ card-last-reviewed:: 2022-10-03T11:43:13.452Z
+ card-last-score:: 3
+ - The main difference between a GPR and a stack is that repeatedly reading a register will produce the same result and **will not** modify the state of the register file.
+ - Popping an item from a LIFO structure (stack) **will** modify the contents of the stack,
+ - Many GPR architectures assign special values to some registers in the register file to make programming easier.
+ - e.g., sometimes, register 0 is hardwired with value 0 to generate this most common constant.
+ - ### Instructions in GPR Architecture
+ - What do GPR instructions need to specify? #card
+ card-last-interval:: 9.84
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T05:28:31.531Z
+ card-last-reviewed:: 2022-09-30T09:28:31.531Z
+ card-last-score:: 5
+ - GPR instructions need to specify:
+ - **the register** that holds their **input operands**
+ - the register that will hole the **result**
+ - What is the most common GPR instruction format? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-15T22:48:52.100Z
+ card-last-reviewed:: 2022-09-19T17:48:52.100Z
+ card-last-score:: 5
+ - The most common GPR instruction format is the **three operands instruction format**.
+ - e.g., "ADD r1, r2, r3" instructs the processor to read the contents of r2 and r3, add them together, and write the results in r1.
+ - Instructions that only have one or two inputs are also present in GPR architecture.
+ - Which architecture allows **caching**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:50.487Z
+ card-last-reviewed:: 2022-09-30T12:11:50.488Z
+ card-last-score:: 5
+ - In GPR Architecture, ^^programs can choose which values should be stored in the register file at any given time^^, allowing them to **cache** the most accessed data.
+ - In stack-based architectures, once the data has been used, it's gone.
+ - From this point of view, ^^GPR architectures have **better performance**^^, at the expense of needing **more storage space** for the program.
+ - larger instructions are needed to encode the addresses of the operands.
+ - #### Simple GPR Instruction Set
+ - 
+ -
+ - ### Programs in a GPR Architecure #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:58:16.278Z
+ card-last-reviewed:: 2022-10-08T22:58:16.278Z
+ card-last-score:: 5
+ - Programming a GPR architecture processor is **less structured** than programming a stack-based architecture processor.
+ - There are **fewer restrictions on the order** in which operations can be executed.
+ - In stack-based architectures, instructions must execute in the order that would leave the operands for the next instructions on the top of the stack.
+ - In GPR, any order that places the operands for the next instruction in the register file before the instruction executes is valid.
+ - Operations that access different registers can be **reordered** without making the program invalid.
+ -
+- ## Stack-Bases vs GPR Architectures
+ - Stack-based architectures are still attractive for certain embedded systems.
+ - GPR architectures are used by modern computers.
+ - ## Stack-Based Architectures #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:59:04.549Z
+ card-last-reviewed:: 2022-10-08T22:59:04.550Z
+ card-last-score:: 5
+ - Instructions take **fewer bits** to encode.
+ - **Reduced amount of memory** taken up by programs.
+ - Manages the **use of registers automatically** (no need for programmer intervention).
+ - The instruction set **does not change** if the size of the register file has changed.
+ - ## GPR Architectures
+ - With the evolution of technology, the amount of space taken up by a program is less important.
+ - Compilers for GPR architecture achieve **better performance** with a given number of general-purpose registers than those on stack-based architectures with the same number of registers.
+ - The compiler can choose which values to keep (**cache**) in the register file at any time.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-10-20T09_05_57.990Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-10-20T09_05_57.990Z.Desktop.md
new file mode 100644
index 00000000..560b8a24
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-10-20T09_05_57.990Z.Desktop.md
@@ -0,0 +1,401 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Overview of Computer Systems]]
+- **Relevant Slides:** 
+-
+- What is a **Processor Programming Model**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:40:54.101Z
+ card-last-reviewed:: 2022-10-10T11:40:54.101Z
+ card-last-score:: 5
+ - A **Processor Programming Model** defines ^^how instructions access their operands and how instructions are described in the processor's assembly language.^^
+ - Processors with different programming models can offer similar sets of operations but may require very different approaches to programming.
+-
+- ## Instructions
+ - What is the **Instruction Cycle**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:30.873Z
+ card-last-reviewed:: 2022-10-03T11:42:30.874Z
+ card-last-score:: 5
+ - The **Instruction Cycle** is the ^^procedure of processing an instruction^^ by the microprocessor.
+ - **Fetch:** read the instructions from memory
+ - **Decode:** Determine what is to be done
+ - **Execute:** Perform the operation
+ - Each of the functions fetch -> decode -> execute consist of a sequence of one or more operations inside the CPU (and interaction with the subsystems).
+ - ### Types of Instructions
+ - #### Data Transfer Instructions
+ - What are **Data Transfer Instructions**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:48.321Z
+ card-last-reviewed:: 2022-10-03T11:40:48.321Z
+ card-last-score:: 5
+ - Operations that ^^move data^^ from one place to another.
+ - These instructions ^^don't modify^^ the data, they just copy it to the destination.
+ - What operations can data transfer instructions do? #card
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:46:12.475Z
+ card-last-reviewed:: 2022-09-30T08:46:12.475Z
+ card-last-score:: 5
+ - card-last-interval:: 11.56
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T21:26:36.529Z
+ card-last-reviewed:: 2022-09-30T08:26:36.529Z
+ card-last-score:: 5
+ 1. **Load data** from memory into the microprocessor. #card
+ - These instructions copy data from memory into microprocessor registers (i.e., LD).
+ - card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:28:41.508Z
+ card-last-reviewed:: 2022-10-03T14:28:41.509Z
+ card-last-score:: 5
+ 2. **Store data** from the microprocessor into the memory. #card
+ - Similar to load data, except that the data is copied in the opposite direction (i.e., ST).
+ - Data is saved from internal microprocessor registers into the memory
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:32.655Z
+ card-last-reviewed:: 2022-10-03T14:29:32.655Z
+ card-last-score:: 5
+ 3. **Move data** within the microprocessor.
+ - These instructions move data from one microprocessor register to another (i.e., MOV)
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:44:07.730Z
+ card-last-reviewed:: 2022-09-19T17:44:07.731Z
+ card-last-score:: 5
+ 4. **Input data** into the microprocessor.
+ - A microprocessor may need to input data from the outside world.
+ - These are the instructions that input data from the input device into the microprocessor.
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:47:33.165Z
+ card-last-reviewed:: 2022-09-19T17:47:33.165Z
+ card-last-score:: 5
+ 5. **Output data** from the microprocessor.
+ - The microprocessor copies data from one of its internal registers to an output device.
+ - Example: the microprocessor may want to show the content of an internal register on a display (the key has been pressed) (i.e., IOWR).
+ - #### Data Operation Instructions #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:45:28.268Z
+ card-last-reviewed:: 2022-10-03T11:45:28.268Z
+ card-last-score:: 5
+ - Instructions that *do* modify their data values.
+ - They typically perform some operation (e.g., +, -, *) using one or two data values (operands) and store the result.
+ - What operations can data operation instructions do? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-10T17:11:57.372Z
+ card-last-reviewed:: 2022-10-06T17:11:57.372Z
+ card-last-score:: 5
+ - **Arithmetic Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:56.702Z
+ card-last-reviewed:: 2022-10-03T11:44:56.702Z
+ card-last-score:: 5
+ - add, subtract, multiply, or divide
+ - ADD, SUB, MUL, DIV
+ - Instructions that increment or decrement one from a value
+ - INC, DEC
+ - Floating point instructions that operate on floating point values
+ - FADD, FSUB, FMUL, FDIV
+ - **Logic Instructions**
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:49.421Z
+ card-last-reviewed:: 2022-10-03T11:43:49.421Z
+ card-last-score:: 5
+ - AND, OR, XOR, NOT, etc.
+ - **Shift Instructions**
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:45:44.876Z
+ card-last-reviewed:: 2022-09-30T08:45:44.877Z
+ card-last-score:: 5
+ - SR, SL, RR, RL, etc.
+ - #### Program Control Instructions #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T04:28:17.821Z
+ card-last-reviewed:: 2022-09-30T09:28:17.821Z
+ card-last-score:: 5
+ - **Jump** or **branch** instructions are used to ^^go to another part of the program^^; Jumps can be **absolute** or **conditional**.
+ - e.g., if, then, else.
+ - Instructions that can generate **interrupts**.
+ - Software interrupts.
+ - **Jump & branch instructions** (conditional or unconditional)
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:27:30.317Z
+ card-last-reviewed:: 2022-10-03T14:27:30.317Z
+ card-last-score:: 5
+ - **JZ:** Jump if the zero flag is set.
+ - **JNZ:** Jump if the zero flag is **not** set.
+ - **JMP:** Unconditional jump - flags are ignored.
+ - etc.
+ - **Comparison Instructions** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:42:52.048Z
+ card-last-reviewed:: 2022-10-03T11:42:52.049Z
+ card-last-score:: 3
+ - TEST: logical BITWISE AND
+ - **Calls & Returns** a / from a routine (conditional or unconditional) #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:28:56.319Z
+ card-last-reviewed:: 2022-10-03T14:28:56.319Z
+ card-last-score:: 3
+ - **Call:** call a subroutine at a certain line.
+ - **RET:** return from a subroutine.
+ - **IRET:** interrupt & return.
+ - **Software Interrupts** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:46.482Z
+ card-last-reviewed:: 2022-10-03T14:28:46.483Z
+ card-last-score:: 5
+ - Generated by devices outside of a microprocessor (not part of the instruction set).
+ - INT
+ - **Exceptions & Traps** #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:40:14.195Z
+ card-last-score:: 1
+ - Triggered when valid instructions perform invalid operations.
+ - e.g., dividing by zero.
+ - **Halt Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:56.173Z
+ card-last-reviewed:: 2022-10-03T11:37:56.174Z
+ card-last-score:: 5
+ - Causes the processor to stop executions.
+ - e.g., at the end of the program.
+ - HALT
+-
+- ## Stack Architectures
+ - ### The Stack
+ - **Last In First Out (LIFO)** data structure.
+ - Consists of **locations**, each of which can hold a **word of data**.
+ - It can be used to explicitly **save / restore** data.
+ - What operations does the stack support? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:30:00.780Z
+ card-last-reviewed:: 2022-10-03T14:30:00.780Z
+ card-last-score:: 5
+ - The stack supports ^^two operations.^^
+ - **PUSH:** takes one argument and places the value of the argument at the top of the stack.
+ - **POP:** removes one element from the stack, saving it into a predefined register of the processor.
+ - The stack is ^^used implicitly by procedure call instructions.^^
+ - (if available in the data set).
+ - When new data is added to the stack, it is placed at the top of the stack, and all of the contents of the stack are pushed down one location.
+ - ### Implementing Stacks
+ - What are the two ways to implement a stack? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-31T23:42:47.216Z
+ card-last-reviewed:: 2022-10-10T11:42:47.216Z
+ card-last-score:: 5
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-12T15:29:51.594Z
+ card-last-reviewed:: 2022-10-08T15:29:51.595Z
+ card-last-score:: 3
+ 1. **Dedicated Hardware Stack** #card
+ - Has a ^^hardware limitation^^ (limited number of locations).
+ - Very fast.
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:04.293Z
+ card-last-reviewed:: 2022-10-03T11:44:04.294Z
+ card-last-score:: 5
+ 2. **Memory Implemented Stack** #card
+ - Limited by the ^^physical memory of the system.^^
+ - Slow compared with hardware stacks, since extra memory addressing has to take place for each stack operation.
+ - {:height 405, :width 638}
+ - Every **push operation** will ^^increment the top of the **stack pointer**^^ with the word size of the machine.
+ - Every **pop operation** will ^^decrement the top of the stack pointer^^ (with the word size of the machine).
+ - **Stack overflows** can occur in both stack implementations
+ - What is a **stack overflow**? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-04T20:25:37.658Z
+ card-last-reviewed:: 2022-10-04T12:25:37.659Z
+ card-last-score:: 5
+ - A **stack overflow** occurs when the amount of data in the stack exceeds the amount of space allocated to the stack (or the hardware limit of the stack).
+ - ### Instructions in Stack-Based Architecture #card
+ card-last-interval:: 15.05
+ card-repeats:: 4
+ card-ease-factor:: 1.94
+ card-next-schedule:: 2022-11-03T09:43:35.672Z
+ card-last-reviewed:: 2022-10-19T08:43:35.673Z
+ card-last-score:: 3
+ - Instructions in a stack-base architecture get their operands from the stack and write their results to the stack.
+ - The advantage of this is that ^^program code takes little memory - there is no need to specify the address of the operands or registers.^^
+ - PUSH is one exception, because it needs the operand to be specified (either as a constant or as an address).
+ - ### Programs in a Stack-Based Architecture
+ - Writing programs for stack-based architecture is not easy.
+ - Stack-based architectures are better suited for **postfix** notation rather than **infix** notation.
+ - What is **infix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:45.628Z
+ card-last-reviewed:: 2022-10-03T11:42:45.628Z
+ card-last-score:: 5
+ - **Infix notation** is the traditional way of representing mathematical expressions, with ^^operations placed **between** the operands.^^
+ - e.g., a + b
+ - What is **postfix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:39:50.328Z
+ card-last-reviewed:: 2022-10-03T11:39:50.328Z
+ card-last-score:: 5
+ - In **postfix notation**, ^^the operation is placed **after** the operands.^^
+ - e.g., a b +
+ - Stack-based architectures are better suited for **postfix notation**.
+ - Once an expression has been converted into postfix notation, implementing it in programs is easy.
+ - ### Using Stacks to Implement Procedure Calls
+ - Programs need a way to **pass inputs to the procedures** that they call and to receive outputs back from them.
+ - Procedures need to be able to **allocate space in memory for local variables** without overriding any data used by their calling program.
+ - It is impossible to determine which registers may be used safely by the procedure (especially if the procedure is located in a library).
+ - So, a mechanism to **save / restore registers** of the calling program has to be in place.
+ - Procedures need a way to figure out where they were called from.
+ - So, the execution can **return to the calling program** where the procedure completes (they need to restore the program counter).
+ - How are procedure calls implemented in Stacks? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T04:57:53.451Z
+ card-last-reviewed:: 2022-10-08T22:57:53.496Z
+ card-last-score:: 5
+ - 
+ - When a procedure is called,^^a block of memory in the stack called a **stack frame** is allocated.^^
+ - The top of the **stack pointer** is incremented by the number of locations in the stack frame.
+ - When a procedure finishes, it jumps to the **return address** of the stack and the execution of the calling program resumes.
+ - How are nested procedure calls implemented in the stack? #card
+ card-last-interval:: 8.32
+ card-repeats:: 3
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-11T21:30:20.346Z
+ card-last-reviewed:: 2022-10-03T14:30:20.347Z
+ card-last-score:: 3
+ - 
+ - main program calls function f(),
+ - function f() calls function g(),
+ - function g() calls function h()
+- ## General-Purpose Register Architectures
+ - ### General-Purpose Register File
+ - In GPR Architectures, instructions read their operands and write their results to a **random access register file**.
+ - The general-purpose register file allows the ^^access of **any** register in **any** order^^ by specifying the number (register ID) of the register.
+ - What is the main difference between a GPR & a stack? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:43:13.452Z
+ card-last-reviewed:: 2022-10-03T11:43:13.452Z
+ card-last-score:: 3
+ - The main difference between a GPR and a stack is that repeatedly reading a register will produce the same result and **will not** modify the state of the register file.
+ - Popping an item from a LIFO structure (stack) **will** modify the contents of the stack,
+ - Many GPR architectures assign special values to some registers in the register file to make programming easier.
+ - e.g., sometimes, register 0 is hardwired with value 0 to generate this most common constant.
+ - ### Instructions in GPR Architecture
+ - What do GPR instructions need to specify? #card
+ card-last-interval:: 9.84
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T05:28:31.531Z
+ card-last-reviewed:: 2022-09-30T09:28:31.531Z
+ card-last-score:: 5
+ - GPR instructions need to specify:
+ - **the register** that holds their **input operands**
+ - the register that will hole the **result**
+ - What is the most common GPR instruction format? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-15T22:48:52.100Z
+ card-last-reviewed:: 2022-09-19T17:48:52.100Z
+ card-last-score:: 5
+ - The most common GPR instruction format is the **three operands instruction format**.
+ - e.g., "ADD r1, r2, r3" instructs the processor to read the contents of r2 and r3, add them together, and write the results in r1.
+ - Instructions that only have one or two inputs are also present in GPR architecture.
+ - Which architecture allows **caching**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:50.487Z
+ card-last-reviewed:: 2022-09-30T12:11:50.488Z
+ card-last-score:: 5
+ - In GPR Architecture, ^^programs can choose which values should be stored in the register file at any given time^^, allowing them to **cache** the most accessed data.
+ - In stack-based architectures, once the data has been used, it's gone.
+ - From this point of view, ^^GPR architectures have **better performance**^^, at the expense of needing **more storage space** for the program.
+ - larger instructions are needed to encode the addresses of the operands.
+ - #### Simple GPR Instruction Set
+ - 
+ -
+ - ### Programs in a GPR Architecure #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:58:16.278Z
+ card-last-reviewed:: 2022-10-08T22:58:16.278Z
+ card-last-score:: 5
+ - Programming a GPR architecture processor is **less structured** than programming a stack-based architecture processor.
+ - There are **fewer restrictions on the order** in which operations can be executed.
+ - In stack-based architectures, instructions must execute in the order that would leave the operands for the next instructions on the top of the stack.
+ - In GPR, any order that places the operands for the next instruction in the register file before the instruction executes is valid.
+ - Operations that access different registers can be **reordered** without making the program invalid.
+ -
+- ## Stack-Bases vs GPR Architectures
+ - Stack-based architectures are still attractive for certain embedded systems.
+ - GPR architectures are used by modern computers.
+ - ## Stack-Based Architectures #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:59:04.549Z
+ card-last-reviewed:: 2022-10-08T22:59:04.550Z
+ card-last-score:: 5
+ - Instructions take **fewer bits** to encode.
+ - **Reduced amount of memory** taken up by programs.
+ - Manages the **use of registers automatically** (no need for programmer intervention).
+ - The instruction set **does not change** if the size of the register file has changed.
+ - ## GPR Architectures
+ - With the evolution of technology, the amount of space taken up by a program is less important.
+ - Compilers for GPR architecture achieve **better performance** with a given number of general-purpose registers than those on stack-based architectures with the same number of registers.
+ - The compiler can choose which values to keep (**cache**) in the register file at any time.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-11-09T13_03_58.137Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-11-09T13_03_58.137Z.Desktop.md
new file mode 100644
index 00000000..1f9a61a2
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-11-09T13_03_58.137Z.Desktop.md
@@ -0,0 +1,401 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Overview of Computer Systems]]
+- **Relevant Slides:** 
+-
+- What is a **Processor Programming Model**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:40:54.101Z
+ card-last-reviewed:: 2022-10-10T11:40:54.101Z
+ card-last-score:: 5
+ - A **Processor Programming Model** defines ^^how instructions access their operands and how instructions are described in the processor's assembly language.^^
+ - Processors with different programming models can offer similar sets of operations but may require very different approaches to programming.
+-
+- ## Instructions
+ - What is the **Instruction Cycle**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:30.873Z
+ card-last-reviewed:: 2022-10-03T11:42:30.874Z
+ card-last-score:: 5
+ - The **Instruction Cycle** is the ^^procedure of processing an instruction^^ by the microprocessor.
+ - **Fetch:** read the instructions from memory
+ - **Decode:** Determine what is to be done
+ - **Execute:** Perform the operation
+ - Each of the functions fetch -> decode -> execute consist of a sequence of one or more operations inside the CPU (and interaction with the subsystems).
+ - ### Types of Instructions
+ - #### Data Transfer Instructions
+ - What are **Data Transfer Instructions**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:48.321Z
+ card-last-reviewed:: 2022-10-03T11:40:48.321Z
+ card-last-score:: 5
+ - Operations that ^^move data^^ from one place to another.
+ - These instructions ^^don't modify^^ the data, they just copy it to the destination.
+ - What operations can data transfer instructions do? #card
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:46:12.475Z
+ card-last-reviewed:: 2022-09-30T08:46:12.475Z
+ card-last-score:: 5
+ - card-last-interval:: 11.56
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T21:26:36.529Z
+ card-last-reviewed:: 2022-09-30T08:26:36.529Z
+ card-last-score:: 5
+ 1. **Load data** from memory into the microprocessor. #card
+ - These instructions copy data from memory into microprocessor registers (i.e., LD).
+ - card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:28:41.508Z
+ card-last-reviewed:: 2022-10-03T14:28:41.509Z
+ card-last-score:: 5
+ 2. **Store data** from the microprocessor into the memory. #card
+ - Similar to load data, except that the data is copied in the opposite direction (i.e., ST).
+ - Data is saved from internal microprocessor registers into the memory
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:32.655Z
+ card-last-reviewed:: 2022-10-03T14:29:32.655Z
+ card-last-score:: 5
+ 3. **Move data** within the microprocessor.
+ - These instructions move data from one microprocessor register to another (i.e., MOV)
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:44:07.730Z
+ card-last-reviewed:: 2022-09-19T17:44:07.731Z
+ card-last-score:: 5
+ 4. **Input data** into the microprocessor.
+ - A microprocessor may need to input data from the outside world.
+ - These are the instructions that input data from the input device into the microprocessor.
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:47:33.165Z
+ card-last-reviewed:: 2022-09-19T17:47:33.165Z
+ card-last-score:: 5
+ 5. **Output data** from the microprocessor.
+ - The microprocessor copies data from one of its internal registers to an output device.
+ - Example: the microprocessor may want to show the content of an internal register on a display (the key has been pressed) (i.e., IOWR).
+ - #### Data Operation Instructions #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:45:28.268Z
+ card-last-reviewed:: 2022-10-03T11:45:28.268Z
+ card-last-score:: 5
+ - Instructions that *do* modify their data values.
+ - They typically perform some operation (e.g., +, -, *) using one or two data values (operands) and store the result.
+ - What operations can data operation instructions do? #card
+ card-last-interval:: 10.64
+ card-repeats:: 3
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-10-30T23:33:48.626Z
+ card-last-reviewed:: 2022-10-20T08:33:48.627Z
+ card-last-score:: 3
+ - **Arithmetic Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:56.702Z
+ card-last-reviewed:: 2022-10-03T11:44:56.702Z
+ card-last-score:: 5
+ - add, subtract, multiply, or divide
+ - ADD, SUB, MUL, DIV
+ - Instructions that increment or decrement one from a value
+ - INC, DEC
+ - Floating point instructions that operate on floating point values
+ - FADD, FSUB, FMUL, FDIV
+ - **Logic Instructions**
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:49.421Z
+ card-last-reviewed:: 2022-10-03T11:43:49.421Z
+ card-last-score:: 5
+ - AND, OR, XOR, NOT, etc.
+ - **Shift Instructions**
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:45:44.876Z
+ card-last-reviewed:: 2022-09-30T08:45:44.877Z
+ card-last-score:: 5
+ - SR, SL, RR, RL, etc.
+ - #### Program Control Instructions #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T04:28:17.821Z
+ card-last-reviewed:: 2022-09-30T09:28:17.821Z
+ card-last-score:: 5
+ - **Jump** or **branch** instructions are used to ^^go to another part of the program^^; Jumps can be **absolute** or **conditional**.
+ - e.g., if, then, else.
+ - Instructions that can generate **interrupts**.
+ - Software interrupts.
+ - **Jump & branch instructions** (conditional or unconditional)
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:27:30.317Z
+ card-last-reviewed:: 2022-10-03T14:27:30.317Z
+ card-last-score:: 5
+ - **JZ:** Jump if the zero flag is set.
+ - **JNZ:** Jump if the zero flag is **not** set.
+ - **JMP:** Unconditional jump - flags are ignored.
+ - etc.
+ - **Comparison Instructions** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:42:52.048Z
+ card-last-reviewed:: 2022-10-03T11:42:52.049Z
+ card-last-score:: 3
+ - TEST: logical BITWISE AND
+ - **Calls & Returns** a / from a routine (conditional or unconditional) #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:28:56.319Z
+ card-last-reviewed:: 2022-10-03T14:28:56.319Z
+ card-last-score:: 3
+ - **Call:** call a subroutine at a certain line.
+ - **RET:** return from a subroutine.
+ - **IRET:** interrupt & return.
+ - **Software Interrupts** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:46.482Z
+ card-last-reviewed:: 2022-10-03T14:28:46.483Z
+ card-last-score:: 5
+ - Generated by devices outside of a microprocessor (not part of the instruction set).
+ - INT
+ - **Exceptions & Traps** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-24T08:41:17.975Z
+ card-last-reviewed:: 2022-10-20T08:41:17.975Z
+ card-last-score:: 5
+ - Triggered when valid instructions perform invalid operations.
+ - e.g., dividing by zero.
+ - **Halt Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:56.173Z
+ card-last-reviewed:: 2022-10-03T11:37:56.174Z
+ card-last-score:: 5
+ - Causes the processor to stop executions.
+ - e.g., at the end of the program.
+ - HALT
+-
+- ## Stack Architectures
+ - ### The Stack
+ - **Last In First Out (LIFO)** data structure.
+ - Consists of **locations**, each of which can hold a **word of data**.
+ - It can be used to explicitly **save / restore** data.
+ - What operations does the stack support? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:30:00.780Z
+ card-last-reviewed:: 2022-10-03T14:30:00.780Z
+ card-last-score:: 5
+ - The stack supports ^^two operations.^^
+ - **PUSH:** takes one argument and places the value of the argument at the top of the stack.
+ - **POP:** removes one element from the stack, saving it into a predefined register of the processor.
+ - The stack is ^^used implicitly by procedure call instructions.^^
+ - (if available in the data set).
+ - When new data is added to the stack, it is placed at the top of the stack, and all of the contents of the stack are pushed down one location.
+ - ### Implementing Stacks
+ - What are the two ways to implement a stack? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-31T23:42:47.216Z
+ card-last-reviewed:: 2022-10-10T11:42:47.216Z
+ card-last-score:: 5
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-12T15:29:51.594Z
+ card-last-reviewed:: 2022-10-08T15:29:51.595Z
+ card-last-score:: 3
+ 1. **Dedicated Hardware Stack** #card
+ - Has a ^^hardware limitation^^ (limited number of locations).
+ - Very fast.
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:04.293Z
+ card-last-reviewed:: 2022-10-03T11:44:04.294Z
+ card-last-score:: 5
+ 2. **Memory Implemented Stack** #card
+ - Limited by the ^^physical memory of the system.^^
+ - Slow compared with hardware stacks, since extra memory addressing has to take place for each stack operation.
+ - {:height 405, :width 638}
+ - Every **push operation** will ^^increment the top of the **stack pointer**^^ with the word size of the machine.
+ - Every **pop operation** will ^^decrement the top of the stack pointer^^ (with the word size of the machine).
+ - **Stack overflows** can occur in both stack implementations
+ - What is a **stack overflow**? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-04T20:25:37.658Z
+ card-last-reviewed:: 2022-10-04T12:25:37.659Z
+ card-last-score:: 5
+ - A **stack overflow** occurs when the amount of data in the stack exceeds the amount of space allocated to the stack (or the hardware limit of the stack).
+ - ### Instructions in Stack-Based Architecture #card
+ card-last-interval:: 15.05
+ card-repeats:: 4
+ card-ease-factor:: 1.94
+ card-next-schedule:: 2022-11-03T09:43:35.672Z
+ card-last-reviewed:: 2022-10-19T08:43:35.673Z
+ card-last-score:: 3
+ - Instructions in a stack-base architecture get their operands from the stack and write their results to the stack.
+ - The advantage of this is that ^^program code takes little memory - there is no need to specify the address of the operands or registers.^^
+ - PUSH is one exception, because it needs the operand to be specified (either as a constant or as an address).
+ - ### Programs in a Stack-Based Architecture
+ - Writing programs for stack-based architecture is not easy.
+ - Stack-based architectures are better suited for **postfix** notation rather than **infix** notation.
+ - What is **infix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:45.628Z
+ card-last-reviewed:: 2022-10-03T11:42:45.628Z
+ card-last-score:: 5
+ - **Infix notation** is the traditional way of representing mathematical expressions, with ^^operations placed **between** the operands.^^
+ - e.g., a + b
+ - What is **postfix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:39:50.328Z
+ card-last-reviewed:: 2022-10-03T11:39:50.328Z
+ card-last-score:: 5
+ - In **postfix notation**, ^^the operation is placed **after** the operands.^^
+ - e.g., a b +
+ - Stack-based architectures are better suited for **postfix notation**.
+ - Once an expression has been converted into postfix notation, implementing it in programs is easy.
+ - ### Using Stacks to Implement Procedure Calls
+ - Programs need a way to **pass inputs to the procedures** that they call and to receive outputs back from them.
+ - Procedures need to be able to **allocate space in memory for local variables** without overriding any data used by their calling program.
+ - It is impossible to determine which registers may be used safely by the procedure (especially if the procedure is located in a library).
+ - So, a mechanism to **save / restore registers** of the calling program has to be in place.
+ - Procedures need a way to figure out where they were called from.
+ - So, the execution can **return to the calling program** where the procedure completes (they need to restore the program counter).
+ - How are procedure calls implemented in Stacks? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T04:57:53.451Z
+ card-last-reviewed:: 2022-10-08T22:57:53.496Z
+ card-last-score:: 5
+ - 
+ - When a procedure is called,^^a block of memory in the stack called a **stack frame** is allocated.^^
+ - The top of the **stack pointer** is incremented by the number of locations in the stack frame.
+ - When a procedure finishes, it jumps to the **return address** of the stack and the execution of the calling program resumes.
+ - How are nested procedure calls implemented in the stack? #card
+ card-last-interval:: 19.01
+ card-repeats:: 4
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-11-08T08:24:29.547Z
+ card-last-reviewed:: 2022-10-20T08:24:29.548Z
+ card-last-score:: 5
+ - 
+ - main program calls function f(),
+ - function f() calls function g(),
+ - function g() calls function h()
+- ## General-Purpose Register Architectures
+ - ### General-Purpose Register File
+ - In GPR Architectures, instructions read their operands and write their results to a **random access register file**.
+ - The general-purpose register file allows the ^^access of **any** register in **any** order^^ by specifying the number (register ID) of the register.
+ - What is the main difference between a GPR & a stack? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:43:13.452Z
+ card-last-reviewed:: 2022-10-03T11:43:13.452Z
+ card-last-score:: 3
+ - The main difference between a GPR and a stack is that repeatedly reading a register will produce the same result and **will not** modify the state of the register file.
+ - Popping an item from a LIFO structure (stack) **will** modify the contents of the stack,
+ - Many GPR architectures assign special values to some registers in the register file to make programming easier.
+ - e.g., sometimes, register 0 is hardwired with value 0 to generate this most common constant.
+ - ### Instructions in GPR Architecture
+ - What do GPR instructions need to specify? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-11-10T20:30:05.069Z
+ card-last-reviewed:: 2022-10-20T08:30:05.069Z
+ card-last-score:: 3
+ - GPR instructions need to specify:
+ - **the register** that holds their **input operands**
+ - the register that will hole the **result**
+ - What is the most common GPR instruction format? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-15T22:48:52.100Z
+ card-last-reviewed:: 2022-09-19T17:48:52.100Z
+ card-last-score:: 5
+ - The most common GPR instruction format is the **three operands instruction format**.
+ - e.g., "ADD r1, r2, r3" instructs the processor to read the contents of r2 and r3, add them together, and write the results in r1.
+ - Instructions that only have one or two inputs are also present in GPR architecture.
+ - Which architecture allows **caching**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:50.487Z
+ card-last-reviewed:: 2022-09-30T12:11:50.488Z
+ card-last-score:: 5
+ - In GPR Architecture, ^^programs can choose which values should be stored in the register file at any given time^^, allowing them to **cache** the most accessed data.
+ - In stack-based architectures, once the data has been used, it's gone.
+ - From this point of view, ^^GPR architectures have **better performance**^^, at the expense of needing **more storage space** for the program.
+ - larger instructions are needed to encode the addresses of the operands.
+ - #### Simple GPR Instruction Set
+ - 
+ -
+ - ### Programs in a GPR Architecure #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:58:16.278Z
+ card-last-reviewed:: 2022-10-08T22:58:16.278Z
+ card-last-score:: 5
+ - Programming a GPR architecture processor is **less structured** than programming a stack-based architecture processor.
+ - There are **fewer restrictions on the order** in which operations can be executed.
+ - In stack-based architectures, instructions must execute in the order that would leave the operands for the next instructions on the top of the stack.
+ - In GPR, any order that places the operands for the next instruction in the register file before the instruction executes is valid.
+ - Operations that access different registers can be **reordered** without making the program invalid.
+ -
+- ## Stack-Bases vs GPR Architectures
+ - Stack-based architectures are still attractive for certain embedded systems.
+ - GPR architectures are used by modern computers.
+ - ## Stack-Based Architectures #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:59:04.549Z
+ card-last-reviewed:: 2022-10-08T22:59:04.550Z
+ card-last-score:: 5
+ - Instructions take **fewer bits** to encode.
+ - **Reduced amount of memory** taken up by programs.
+ - Manages the **use of registers automatically** (no need for programmer intervention).
+ - The instruction set **does not change** if the size of the register file has changed.
+ - ## GPR Architectures
+ - With the evolution of technology, the amount of space taken up by a program is less important.
+ - Compilers for GPR architecture achieve **better performance** with a given number of general-purpose registers than those on stack-based architectures with the same number of registers.
+ - The compiler can choose which values to keep (**cache**) in the register file at any time.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-11-11T12_04_45.375Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-11-11T12_04_45.375Z.Desktop.md
new file mode 100644
index 00000000..91f001ff
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Programming Models/2022-11-11T12_04_45.375Z.Desktop.md
@@ -0,0 +1,401 @@
+- #[[CT213 - Computer Systems & Organisation]]
+- **Previous Topic:** [[Overview of Computer Systems]]
+- **Relevant Slides:** 
+-
+- What is a **Processor Programming Model**? #card
+ card-last-interval:: 3.09
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-13T13:40:54.101Z
+ card-last-reviewed:: 2022-10-10T11:40:54.101Z
+ card-last-score:: 5
+ - A **Processor Programming Model** defines ^^how instructions access their operands and how instructions are described in the processor's assembly language.^^
+ - Processors with different programming models can offer similar sets of operations but may require very different approaches to programming.
+-
+- ## Instructions
+ - What is the **Instruction Cycle**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:30.873Z
+ card-last-reviewed:: 2022-10-03T11:42:30.874Z
+ card-last-score:: 5
+ - The **Instruction Cycle** is the ^^procedure of processing an instruction^^ by the microprocessor.
+ - **Fetch:** read the instructions from memory
+ - **Decode:** Determine what is to be done
+ - **Execute:** Perform the operation
+ - Each of the functions fetch -> decode -> execute consist of a sequence of one or more operations inside the CPU (and interaction with the subsystems).
+ - ### Types of Instructions
+ - #### Data Transfer Instructions
+ - What are **Data Transfer Instructions**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:40:48.321Z
+ card-last-reviewed:: 2022-10-03T11:40:48.321Z
+ card-last-score:: 5
+ - Operations that ^^move data^^ from one place to another.
+ - These instructions ^^don't modify^^ the data, they just copy it to the destination.
+ - What operations can data transfer instructions do? #card
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:46:12.475Z
+ card-last-reviewed:: 2022-09-30T08:46:12.475Z
+ card-last-score:: 5
+ - card-last-interval:: 11.56
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T21:26:36.529Z
+ card-last-reviewed:: 2022-09-30T08:26:36.529Z
+ card-last-score:: 5
+ 1. **Load data** from memory into the microprocessor. #card
+ - These instructions copy data from memory into microprocessor registers (i.e., LD).
+ - card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T19:28:41.508Z
+ card-last-reviewed:: 2022-10-03T14:28:41.509Z
+ card-last-score:: 5
+ 2. **Store data** from the microprocessor into the memory. #card
+ - Similar to load data, except that the data is copied in the opposite direction (i.e., ST).
+ - Data is saved from internal microprocessor registers into the memory
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:29:32.655Z
+ card-last-reviewed:: 2022-10-03T14:29:32.655Z
+ card-last-score:: 5
+ 3. **Move data** within the microprocessor.
+ - These instructions move data from one microprocessor register to another (i.e., MOV)
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:44:07.730Z
+ card-last-reviewed:: 2022-09-19T17:44:07.731Z
+ card-last-score:: 5
+ 4. **Input data** into the microprocessor.
+ - A microprocessor may need to input data from the outside world.
+ - These are the instructions that input data from the input device into the microprocessor.
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-09-23T17:47:33.165Z
+ card-last-reviewed:: 2022-09-19T17:47:33.165Z
+ card-last-score:: 5
+ 5. **Output data** from the microprocessor.
+ - The microprocessor copies data from one of its internal registers to an output device.
+ - Example: the microprocessor may want to show the content of an internal register on a display (the key has been pressed) (i.e., IOWR).
+ - #### Data Operation Instructions #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:45:28.268Z
+ card-last-reviewed:: 2022-10-03T11:45:28.268Z
+ card-last-score:: 5
+ - Instructions that *do* modify their data values.
+ - They typically perform some operation (e.g., +, -, *) using one or two data values (operands) and store the result.
+ - What operations can data operation instructions do? #card
+ card-last-interval:: 10.64
+ card-repeats:: 3
+ card-ease-factor:: 2.66
+ card-next-schedule:: 2022-10-30T23:33:48.626Z
+ card-last-reviewed:: 2022-10-20T08:33:48.627Z
+ card-last-score:: 3
+ - **Arithmetic Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:56.702Z
+ card-last-reviewed:: 2022-10-03T11:44:56.702Z
+ card-last-score:: 5
+ - add, subtract, multiply, or divide
+ - ADD, SUB, MUL, DIV
+ - Instructions that increment or decrement one from a value
+ - INC, DEC
+ - Floating point instructions that operate on floating point values
+ - FADD, FSUB, FMUL, FDIV
+ - **Logic Instructions**
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:43:49.421Z
+ card-last-reviewed:: 2022-10-03T11:43:49.421Z
+ card-last-score:: 5
+ - AND, OR, XOR, NOT, etc.
+ - **Shift Instructions**
+ card-last-interval:: 10.92
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-11T06:45:44.876Z
+ card-last-reviewed:: 2022-09-30T08:45:44.877Z
+ card-last-score:: 5
+ - SR, SL, RR, RL, etc.
+ - #### Program Control Instructions #card
+ card-last-interval:: 10.8
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T04:28:17.821Z
+ card-last-reviewed:: 2022-09-30T09:28:17.821Z
+ card-last-score:: 5
+ - **Jump** or **branch** instructions are used to ^^go to another part of the program^^; Jumps can be **absolute** or **conditional**.
+ - e.g., if, then, else.
+ - Instructions that can generate **interrupts**.
+ - Software interrupts.
+ - **Jump & branch instructions** (conditional or unconditional)
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:27:30.317Z
+ card-last-reviewed:: 2022-10-03T14:27:30.317Z
+ card-last-score:: 5
+ - **JZ:** Jump if the zero flag is set.
+ - **JNZ:** Jump if the zero flag is **not** set.
+ - **JMP:** Unconditional jump - flags are ignored.
+ - etc.
+ - **Comparison Instructions** #card
+ card-last-interval:: 10.24
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-13T16:42:52.048Z
+ card-last-reviewed:: 2022-10-03T11:42:52.049Z
+ card-last-score:: 3
+ - TEST: logical BITWISE AND
+ - **Calls & Returns** a / from a routine (conditional or unconditional) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:44:38.495Z
+ card-last-score:: 1
+ - **Call:** call a subroutine at a certain line.
+ - **RET:** return from a subroutine.
+ - **IRET:** interrupt & return.
+ - **Software Interrupts** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:28:46.482Z
+ card-last-reviewed:: 2022-10-03T14:28:46.483Z
+ card-last-score:: 5
+ - Generated by devices outside of a microprocessor (not part of the instruction set).
+ - INT
+ - **Exceptions & Traps** #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-24T08:41:17.975Z
+ card-last-reviewed:: 2022-10-20T08:41:17.975Z
+ card-last-score:: 5
+ - Triggered when valid instructions perform invalid operations.
+ - e.g., dividing by zero.
+ - **Halt Instructions** #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:37:56.173Z
+ card-last-reviewed:: 2022-10-03T11:37:56.174Z
+ card-last-score:: 5
+ - Causes the processor to stop executions.
+ - e.g., at the end of the program.
+ - HALT
+-
+- ## Stack Architectures
+ - ### The Stack
+ - **Last In First Out (LIFO)** data structure.
+ - Consists of **locations**, each of which can hold a **word of data**.
+ - It can be used to explicitly **save / restore** data.
+ - What operations does the stack support? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T18:30:00.780Z
+ card-last-reviewed:: 2022-10-03T14:30:00.780Z
+ card-last-score:: 5
+ - The stack supports ^^two operations.^^
+ - **PUSH:** takes one argument and places the value of the argument at the top of the stack.
+ - **POP:** removes one element from the stack, saving it into a predefined register of the processor.
+ - The stack is ^^used implicitly by procedure call instructions.^^
+ - (if available in the data set).
+ - When new data is added to the stack, it is placed at the top of the stack, and all of the contents of the stack are pushed down one location.
+ - ### Implementing Stacks
+ - What are the two ways to implement a stack? #card
+ card-last-interval:: 41.44
+ card-repeats:: 5
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-12-20T22:45:42.001Z
+ card-last-reviewed:: 2022-11-09T12:45:42.002Z
+ card-last-score:: 3
+ - card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.08
+ card-next-schedule:: 2022-10-12T15:29:51.594Z
+ card-last-reviewed:: 2022-10-08T15:29:51.595Z
+ card-last-score:: 3
+ 1. **Dedicated Hardware Stack** #card
+ - Has a ^^hardware limitation^^ (limited number of locations).
+ - Very fast.
+ - card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:44:04.293Z
+ card-last-reviewed:: 2022-10-03T11:44:04.294Z
+ card-last-score:: 5
+ 2. **Memory Implemented Stack** #card
+ - Limited by the ^^physical memory of the system.^^
+ - Slow compared with hardware stacks, since extra memory addressing has to take place for each stack operation.
+ - {:height 405, :width 638}
+ - Every **push operation** will ^^increment the top of the **stack pointer**^^ with the word size of the machine.
+ - Every **pop operation** will ^^decrement the top of the stack pointer^^ (with the word size of the machine).
+ - **Stack overflows** can occur in both stack implementations
+ - What is a **stack overflow**? #card
+ card-last-interval:: 31.36
+ card-repeats:: 4
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-11-04T20:25:37.658Z
+ card-last-reviewed:: 2022-10-04T12:25:37.659Z
+ card-last-score:: 5
+ - A **stack overflow** occurs when the amount of data in the stack exceeds the amount of space allocated to the stack (or the hardware limit of the stack).
+ - ### Instructions in Stack-Based Architecture #card
+ card-last-interval:: 15.05
+ card-repeats:: 4
+ card-ease-factor:: 1.94
+ card-next-schedule:: 2022-11-03T09:43:35.672Z
+ card-last-reviewed:: 2022-10-19T08:43:35.673Z
+ card-last-score:: 3
+ - Instructions in a stack-base architecture get their operands from the stack and write their results to the stack.
+ - The advantage of this is that ^^program code takes little memory - there is no need to specify the address of the operands or registers.^^
+ - PUSH is one exception, because it needs the operand to be specified (either as a constant or as an address).
+ - ### Programs in a Stack-Based Architecture
+ - Writing programs for stack-based architecture is not easy.
+ - Stack-based architectures are better suited for **postfix** notation rather than **infix** notation.
+ - What is **infix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:42:45.628Z
+ card-last-reviewed:: 2022-10-03T11:42:45.628Z
+ card-last-score:: 5
+ - **Infix notation** is the traditional way of representing mathematical expressions, with ^^operations placed **between** the operands.^^
+ - e.g., a + b
+ - What is **postfix notation**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-14T15:39:50.328Z
+ card-last-reviewed:: 2022-10-03T11:39:50.328Z
+ card-last-score:: 5
+ - In **postfix notation**, ^^the operation is placed **after** the operands.^^
+ - e.g., a b +
+ - Stack-based architectures are better suited for **postfix notation**.
+ - Once an expression has been converted into postfix notation, implementing it in programs is easy.
+ - ### Using Stacks to Implement Procedure Calls
+ - Programs need a way to **pass inputs to the procedures** that they call and to receive outputs back from them.
+ - Procedures need to be able to **allocate space in memory for local variables** without overriding any data used by their calling program.
+ - It is impossible to determine which registers may be used safely by the procedure (especially if the procedure is located in a library).
+ - So, a mechanism to **save / restore registers** of the calling program has to be in place.
+ - Procedures need a way to figure out where they were called from.
+ - So, the execution can **return to the calling program** where the procedure completes (they need to restore the program counter).
+ - How are procedure calls implemented in Stacks? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T04:57:53.451Z
+ card-last-reviewed:: 2022-10-08T22:57:53.496Z
+ card-last-score:: 5
+ - 
+ - When a procedure is called,^^a block of memory in the stack called a **stack frame** is allocated.^^
+ - The top of the **stack pointer** is incremented by the number of locations in the stack frame.
+ - When a procedure finishes, it jumps to the **return address** of the stack and the execution of the calling program resumes.
+ - How are nested procedure calls implemented in the stack? #card
+ card-last-interval:: 19.01
+ card-repeats:: 4
+ card-ease-factor:: 2.18
+ card-next-schedule:: 2022-11-08T08:24:29.547Z
+ card-last-reviewed:: 2022-10-20T08:24:29.548Z
+ card-last-score:: 5
+ - 
+ - main program calls function f(),
+ - function f() calls function g(),
+ - function g() calls function h()
+- ## General-Purpose Register Architectures
+ - ### General-Purpose Register File
+ - In GPR Architectures, instructions read their operands and write their results to a **random access register file**.
+ - The general-purpose register file allows the ^^access of **any** register in **any** order^^ by specifying the number (register ID) of the register.
+ - What is the main difference between a GPR & a stack? #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-12T17:43:13.452Z
+ card-last-reviewed:: 2022-10-03T11:43:13.452Z
+ card-last-score:: 3
+ - The main difference between a GPR and a stack is that repeatedly reading a register will produce the same result and **will not** modify the state of the register file.
+ - Popping an item from a LIFO structure (stack) **will** modify the contents of the stack,
+ - Many GPR architectures assign special values to some registers in the register file to make programming easier.
+ - e.g., sometimes, register 0 is hardwired with value 0 to generate this most common constant.
+ - ### Instructions in GPR Architecture
+ - What do GPR instructions need to specify? #card
+ card-last-interval:: 21.53
+ card-repeats:: 4
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-11-10T20:30:05.069Z
+ card-last-reviewed:: 2022-10-20T08:30:05.069Z
+ card-last-score:: 3
+ - GPR instructions need to specify:
+ - **the register** that holds their **input operands**
+ - the register that will hole the **result**
+ - What is the most common GPR instruction format? #card
+ card-last-interval:: 26.21
+ card-repeats:: 4
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-15T22:48:52.100Z
+ card-last-reviewed:: 2022-09-19T17:48:52.100Z
+ card-last-score:: 5
+ - The most common GPR instruction format is the **three operands instruction format**.
+ - e.g., "ADD r1, r2, r3" instructs the processor to read the contents of r2 and r3, add them together, and write the results in r1.
+ - Instructions that only have one or two inputs are also present in GPR architecture.
+ - Which architecture allows **caching**? #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:11:50.487Z
+ card-last-reviewed:: 2022-09-30T12:11:50.488Z
+ card-last-score:: 5
+ - In GPR Architecture, ^^programs can choose which values should be stored in the register file at any given time^^, allowing them to **cache** the most accessed data.
+ - In stack-based architectures, once the data has been used, it's gone.
+ - From this point of view, ^^GPR architectures have **better performance**^^, at the expense of needing **more storage space** for the program.
+ - larger instructions are needed to encode the addresses of the operands.
+ - #### Simple GPR Instruction Set
+ - 
+ -
+ - ### Programs in a GPR Architecure #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:58:16.278Z
+ card-last-reviewed:: 2022-10-08T22:58:16.278Z
+ card-last-score:: 5
+ - Programming a GPR architecture processor is **less structured** than programming a stack-based architecture processor.
+ - There are **fewer restrictions on the order** in which operations can be executed.
+ - In stack-based architectures, instructions must execute in the order that would leave the operands for the next instructions on the top of the stack.
+ - In GPR, any order that places the operands for the next instruction in the register file before the instruction executes is valid.
+ - Operations that access different registers can be **reordered** without making the program invalid.
+ -
+- ## Stack-Bases vs GPR Architectures
+ - Stack-based architectures are still attractive for certain embedded systems.
+ - GPR architectures are used by modern computers.
+ - ## Stack-Based Architectures #card
+ card-last-interval:: 10.6
+ card-repeats:: 3
+ card-ease-factor:: 2.56
+ card-next-schedule:: 2022-10-19T12:59:04.549Z
+ card-last-reviewed:: 2022-10-08T22:59:04.550Z
+ card-last-score:: 5
+ - Instructions take **fewer bits** to encode.
+ - **Reduced amount of memory** taken up by programs.
+ - Manages the **use of registers automatically** (no need for programmer intervention).
+ - The instruction set **does not change** if the size of the register file has changed.
+ - ## GPR Architectures
+ - With the evolution of technology, the amount of space taken up by a program is less important.
+ - Compilers for GPR architecture achieve **better performance** with a given number of general-purpose registers than those on stack-based architectures with the same number of registers.
+ - The compiler can choose which values to keep (**cache**) in the register file at any time.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Query Processing & Optimisation/2022-11-09T13_03_58.139Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Query Processing & Optimisation/2022-11-09T13_03_58.139Z.Desktop.md
new file mode 100644
index 00000000..9751c541
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Query Processing & Optimisation/2022-11-09T13_03_58.139Z.Desktop.md
@@ -0,0 +1,136 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Query Processing: Relational Algebra]]
+- **Next Topic:**
+- **Relevant Slides:** 
+-
+- # Trees
+ - What is a **tree**? #card
+ - A **tree** is a collection of data arranged as a finite set of elements called **nodes**, such that the tree is empty or the tree contains a distinguished node, called the **root node**, and all other nodes are arranged in subtrees such that each node has a parent node.
+ - Nodes typically contain *data* and some pointers to other nodes.
+ - Nodes may be: #card
+ - **Root:** No node points to it.
+ - **Inner:** Has parent & child nodes.
+ - **Leaves:** Has no child nodes.
+ - What is a **binary tree**? #card
+ - Tree data structures (a grouping of data) are used frequently in computing allowing data to be stored in a non-linear (non-list) way.
+ - They are often called **binary trees** where each node can have at most two child nodes.
+ - ## SQL -> Relational Algebra
+ - How to translate SQL to Relational Algebra? #card
+ - `SELECT` *attributes* corresponds to $\pi$.
+ - `JOIN`s correspond to relational algebra **joins** $\Join$ with ==any join conditions specified as part of the join.==
+ - Any condition in a `WHERE` clause corresponds to a **sigma** $\sigma$ relational algebra operator with associated conditions.
+ - In addition, we have rules for aggregate functions (`SUM`, `AVG`, `COUNT`, etc.), `GROUP BY` & `HAVING`, and subqueries.
+ - ## Query Tree
+ - What is a **query tree**? #card
+ - A **query tree** is a binary tree that corresponds to a relational algebra expression where:
+ - (**Input**) Tables are the leaf nodes.
+ - Relational algebra operators are at internal nodes.
+ - (**Output / Result**) The root of the tree returns the result (often with one final relational algebra operator).
+ - The sequence of operations is directed from ^^leaves to root^^ and from ^^left to right^^.
+ - i.e., the bottom-most, left-most side of the tree is executed first.
+ - ### Materialisation Evaluation #card
+ - One approach to executing a query represented by a query tree is **Materialisation Evaluation**.
+ - Traverse the tree from bottom to top, left to right. At each stage:
+ - 1. Execute internal node operation whenever data for its child nodes are available.
+ 2. Replace the internal node operation (and all child nodes) by the table resulting from executing the operation.
+ - **Note:** The results of operations are saved as temporary tables and are used as inputs to other operators.
+ - ### How to Draw a Query Tree #card
+ - We must remember the order of execution - from bottom to top, completing each level, and then left to right. Therefore:
+ - The first operations - **fetching tables** - should be at the leaves of the tree.
+ - The last operator - often $\pi$ or aggregate functions - should be at the root of the tree.
+ - Joins must be applied to tables (two at a time) and should be at internal nodes.
+ - Any other operators should be at one or more internal nodes.
+ - **Important:** When joining or multiplying more than two tables, operators can only be applied to two operands at a time.
+ - 
+ - ### Annotating Tree
+ - Each relational algebra operation can be evaluated using one of several different algorithms and Seach relational algebra expression can be evaluated in many ways.
+ - What is an **evaluation plan**? #card
+ - An **evaluation plan** is an annotated expression / query tree specifying the execution strategy for a query.
+ - ### Issues to Consider with Query Trees #card
+ - Size of temporary tables.
+ - Algorithms used for execution plan.
+- # Optimisation
+ - Different query trees for a given query can have different *costs*.
+ - Different evaluation plans for a given query can have different costs.
+ - **Optimisation techniques** attempt to choose the best among a number of potential query trees.
+ - ## Cost Estimates
+ - How to calculate cost estimates? #card
+ - Cost factors include CPU speed, disk access time, network communication time, etc.
+ - Disk access is typically the predominant cost and can be measured by the number of blocks read / number of blocks written per query.
+ - What is the main cost estimate used? #card
+ - The main cost estimate used is the number of block transfers where each block contains a number of records.
+ - The number of blocks transferred from disk depends on:
+ - The size of the buffer in main memory - having more memory reduces the need for more disk accesses.
+ - Indexing structures used (primary, secondary, etc.).
+ - Whether or not all blocks of a file must be transferred.
+ - e.g., if a search can be done on the primary key of the index file or on the secondary index, then only retrieve blocks that satisfy the search condition.
+ - As in typical in Computing, often we use **worst case estimates**, knowing that any *actual* cost cannot exceed a worst case estimate.
+ - #### DBMS Catalog #card
+ - The **DBMS Catalog** stores statistical information about each table such as table sizes, indexes & their depths, etc.
+ - The statistical information on the tables & attributes used in a query can be found in the DBMS catalog and these are used to calculate estimates also.
+ - In the DBMS catalog, for each table $R$, information is stored on:
+ - The number of tuples / records in $R$.
+ - The number of blocks containing tuples of table $R$.
+ - The size of a record in bytes.
+ - The blocking factor.
+ - Information on the number of distinct values per attribute and the number of values that would satisfy a set of equality operations on that attribute (by having averages, min, max, etc.).
+ - Information on indices (index type, index field values, etc.).
+ - ## Optimisation Approach 1: Compare Cost Estimates Across Different Solutions #card
+ - Cost is usually measured as the **total elapsed time** for answering a query.
+ - One approach to optimisation is to calculate cost estimates for each possible query tree.
+ - The query tree with the lowest **cost estimate** should then be chosen.
+ - ### Steps
+ - 1. Generate query trees & evaluation plans (maybe not all).
+ 2. For each query tree, get cost estimates using the DBMS catalog.
+ - This results in a set of cost estimates such that the best can be chosen and the query tree with the lowest cost estimate can then be picked as the single best query tree & evaluation plan.
+ - Therefore, to choose among plans, the optimiser has to estimate the cost of each evaluation plan.
+ - There are two aspects to this. For each node of the tree, estimate the cost of performing associated operation, and estimate the size of the result and if it is sorted.
+ - ### Summary
+ - While cost-based optimisation is good, it is expensive.
+ - As query complexity increases, so does the number of different query trees & plans possible, and each query tree requires its own cost estimates.
+ - **NB:** It is important that the amount of time an optimiser spends on calculating the best solution is not longer than the amount of time which would elapse if executing a solution picked at random.
+ - ## Optimisation Approach 2: Heuristic Optimisation #card
+ - Optimisers often use **heuristics** to reduce the number of choices that must be made in a cost-based fashion.
+ - Heuristic Optimisation transforms the query tree by ==using a set of rules that typically (but not always) improve execution performance.==
+ - Some cost-based estimation is also performed as part of the heuristic optimisation and to choose between a reduced set of trees and/or evaluation plans.
+ - ### Steps
+ - 1. Create a **canonical query tree**.
+ 2. Apply a **set of heuristics** to the tree to create a more efficient query tree.
+ 3. If appropriate, create cost estimates of this query tree to ensure the best evaluation plan.
+ - ### Canonical Query Trees
+ - What is a **canonical query tree**? #card
+ - A **canonical query tree** is an *inefficient* query tree representing relational algebra expressions which can be created **directly** from the SQL solution following a sequence of quick & easy steps.
+ - A canonical query tree:
+ - Uses **Cartesian Product** instead of **Joins**.
+ - Keeps all conditions ($\sigma$) together in one internal node.
+ - $\pi$ become the root node.
+ - #### Steps to create a Canonical Query Tree with `SELECT`/`WHERE`/`FROM` clauses and no sub-queries:
+ - 1. All relations in the `FROM` clause become leaves of the tree.
+ - They should be combined with a **Cartesian Product** ($\times$) of the relations.
+ - **Note:** Only two relations can be involved in a Cartesian Product at a time (binary tree).
+ - 2. All conditions in the `WHERE` clause and any `JOIN` conditions in `WHERE` or `FROM` clauses become a sequence of relational algebra in **one** inner node of the tree (with inputs from the previous step).
+ 3. All conditions from the `SELECT` clause become a relational algebra expression in the root node.
+ - Heuristic Optimisation **must** transform this canonical query tree into a final query tree that is efficient to execute.
+ - In general, heuristic optimisation tries to ==apply the most restrictive operators as early as possible== in the tree and to ==reduce the size of the temporary tables / results== created that move "up" the tree.
+ - Heuristic Optimisation must include rules for equivalence among relational algebra expressions that can be applied to the initial tree.
+ - ### Heuristic Optimisation Algorithm #card
+ - **Input:** A canonical query tree.
+ - **Process:**
+ - 1. Decompose any $\sigma$ with AND conditions into an individual $\sigma$.
+ 2. Move each $\sigma$ operator as far down the query tree as possible, thus eliminating unwanted tuples.
+ - Heuristic 1 tries to reduce the size of the tables to be combined as much as possible.
+ - Therefore, if a selection operator ($\sigma$) occurs *after* a Cartesian product or a join, check to see if it could occur *before* these operations.
+ - 3. Rearrange the leaf nodes so that the most restrictive $\sigma$ can be applied first (using information from the DBMS catalog) and so that future JOINS are possible.
+ - **Note:** "Most restrictive" means those operators that result in relations with the fewest tuples or with the smallest absolute size.
+ - These operations should happen first, i.e., on the left-hand side of the lowest level of the tree.
+ - If we don't have any information from the DBMS catalog, we might leave nodes as they are, use the database schema (# of columns) to make a good estimate, or use sample data (# of rows) & database schema (# of columns) to make a good estimate.
+ - 4. Combine Cartesian Product operators with $\sigma$ to form JOIN operators where appropriate (replacing all $\times$).
+ - Must first ensure that the leaf nodes are ordered such that this can occur. If not, re-order the leaf nodes and ensure to keep any select operators with the appropriate leaf node.
+ - 5. Decompose $\pi$ and move each $\pi$ as far down the tree as possible, possibly creating new $\pi$ operators in the process to eliminate unwanted columns.
+ - This heuristic ensure that the size of the tables to be joined are as small as possible.
+ - Therefore, for each $\pi$ check if that $\pi$ can be carried out before the join. For each table, check if additional $\pi$s can be introduced (these may not be stated explicitly in the query).
+ - **Note:** Must ensure that all needed columns further up the tree are retained (even if they are not immediately necessary).
+ - 6. Identify subtrees that represent groups of operations that can be executed by a single algorithm.
+ 7. Add an evaluation plan.
+ - **Output:** An efficient query tree.
+ -
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Query Processing%3A Relational Algebra/2022-11-10T07_51_40.543Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Query Processing%3A Relational Algebra/2022-11-10T07_51_40.543Z.Desktop.md
new file mode 100644
index 00000000..a82e4616
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Query Processing%3A Relational Algebra/2022-11-10T07_51_40.543Z.Desktop.md
@@ -0,0 +1,141 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Normalisation]]
+- **Next Topic:** [[Query Processing & Optimisation]]
+- **Relevant Slides:** 
+-
+- # Query Processing
+ - What is **Query Processing**? #card
+ - **Query Processing** transforms SQL (a high-level language) into a correct & efficient low-level language representation of **relational algebra**.
+ - Each relational algebra operator has code associated with it, which, when run, performs the operation on the data specified, allowing the specified data to be output as the result.
+ - ## Steps Involved in Processing an SQL Query #card
+ - 1. Process (Parse & Translate) the query and create an internal representation of the query.
+ - This may be an Operator Tree, Query Tree, or Query Graph (for more complicated queries).
+ - 2. Optimise.
+ 3. Execute / Evaluate returning results.
+ - What do you need to translate SQL to Relational Algebra? #card
+ - To translate SQL to Relational Algebra, you must have a meaningful set of relational algebra operators, and a mapping (translation) between SQL code & relational algebra expressions.
+- # Relational Algebra
+ - Two formal languages exist for the relational model:
+ - **Relational Algebra** (procedural).
+ - **Relational Calculus** (non-procedural).
+ - Both are logically equivalent.
+ - ## Relational Algebra Operations
+ - A basic set of operations exist for the relational model.
+ - These allow for the specification of basic retrieval requests.
+ - A sequence of Relational Algebra (RA) operations forms a **relational algebra expression**.
+ - RA operations are divided into two groups:
+ - Operations based on **mathematical set theory** (e.g., union, product, etc.).
+ - Specific relational database operations.
+ - ## Relational Algebra vs SQL #card
+ - The core operations & functions (i.e., programs) in the internal modules of most relational database systems are based on **relational algebra**.
+ - SQL is a **declarative language** - It allows you to specify the results that you require, not the order of the operations to retrieve these results.
+ - Relational Algebra is **procedural** - We must specify exactly *how* to retrieve results when using relational algebra.
+ - ## Relational Algebra Expressions
+ - A valid relational algebra expression is built by connecting tables or expressions with defined **unary & binary operators** & their arguments (if applicable).
+ - Temporary relations resulting from a relational algebra expression can be used as input to a new relational algebra expression.
+ - Expressions in brackets are evaluated first.
+ - Relational Algebra operators are either **unary** or **binary**.
+ - ## Working With the [RelaX Calculator](: https://dbis-uibk.github.io/relax/calc/local/uibk/local/0)
+ - There is no standard language for relational algebra like there is for SQL.
+ - One University group have developed a calculator that supports a *fairly* command standard.
+ - Note that it is Case Sensitive.
+ - The RelaX calculator provides a number of datasets with the option of also using your own dataset.
+ - ### Loading a Dataset
+ - 1. Go to the "Group Editor" tab.
+ 2. Copy text from the file on Blackboard and add.
+ 3. Then choose "Preview".
+ 4. Then choose "Use group in Editor".
+ - **Note:** Only stored temporarily.
+ - ### Note on Degrees
+ - The **degree** of the relation resulting from a selection of a table $R$ is the same as the degree of $R$, i.e., they have the same number of attributes (columns).
+ - The operation is **commutative** - i.e., a sequence of selects can be applied in any order.
+ - E.g.:
+ - $$\sigma_{\text{hours < 20 and pno = 10}}\text{works\_on}$$
+ - $$\sigma_{\text{pno = 10 and hours < 20}}\text{works\_on}$$
+- # Relational Algebra: Unary Operators
+ - Each operation takes one relation or expression as input and gives a new relation as a result.
+ - ## Selection Operator ($\sigma$) #card
+ - Used to **select** certain tuples (rows) from a relation $R$.
+ - **Notation:** $\sigma_pR$, where $p$ is the **selection predicate** (i.e., a *condidtion*) and $R$ is a relation / table name.
+ - **Note:** The Selection ($\sigma$) operator in relational algebra is **not** the same as the `SELECT` clause in an SQL query.
+ - An SQL `SELECT` query could be equivalent to a combination of relational algebra operators, ($\sigma$, $\pi$, or `JOIN`).
+ - ### Example (Using Company Schema)
+ - Find the projects with pno = 10 and hours worked < 20.
+ background-color:: green
+ - $$\sigma_{\text{hours < 20 AND pno = 10}}\text{works\_on}$$
+ - Returns the set:
+ - {(333445555, 10, 10.0 ), (999887777, 10, 10.0)}
+ - ## Projection Operator ($\pi$) #card
+ - Used to return certain attributes / columns.
+ - **Notation:**
+ - $$\pi_{A_1, A_2, \cdots, A_k}(R)$$
+ - Where $A_1, \cdots, A_k$ are attribute names, $R$ is a relation name.
+ - The result is a relation with the $k$ attributes listed in the same order as they appear in the list.
+ - Duplicate tuples are removed from the result.
+ - **Note:** Commutativity does *not* hold.
+ - ### Example (Using Company Schema)
+ - List all the department numbers where employees work.
+ background-color:: green
+ - $$\pi_\text{dno}\text{employee}$$
+ - Returns: {5,4,1}.
+ - ## Rename Operators ($\rho$ & $\leftarrow$) #card
+ - Rename Operation ($\rho$).
+ - **Notation:** $\rho_x(E)$, where the result of the expression $E$ is saved with the name $x$.
+ - ## Order Operator ($\tau$) #card
+ - Used to **order** by certain columns from a relation $R$.
+ - **Notation:** $\tau_{A_1, A_2, \cdots, A_k}R$ where $A_1, A_2, \cdots, A_k$ are attributes with either ASC or DESC.
+ - ## Group By Operator ($\gamma$)
+ - Used to **group** by certain columns from a relation $R$.
+ - ## Aggregate Functions Supported by RelaX
+ - (Not part of Relation Algebra),
+ - `COUNT(*)`.
+ - `COUNT(column)`.
+ - `MIN(column)`.
+ - `MAX(column)`.
+ - `SUM(column)`.
+ - `AVG(column)`.
+- # Binary Operators
+ - General syntax: `(child_expression) function argument (child_argument)`.
+ - ## Union Operator ($\cup$) #card
+ - **Notation:** $(R) \cup (S)$, where $R$ & $S$ are relations.
+ - Returns all tuples from $R$ & all tuples from $S$.
+ - **Note:** No duplicates will be returned.
+ - ## Intersection Operator ($\cap$) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:37:06.082Z
+ card-last-score:: 1
+ - **Notation:** $(R) \cap (S)$, where $R$ & $S$ are relations.
+ - Returns all tuples from $R that are also in $S$.
+ - ## Set Difference ($-$) #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-11-10T00:00:00.000Z
+ card-last-reviewed:: 2022-11-09T12:42:11.446Z
+ card-last-score:: 1
+ - **Notation:** $(R) - (S)$ where $R$ & $S$ are relations.
+ - Returns tuples that are in relation $R$ but not in $S$.
+ - **Note:** $(R) - (S)$ and $(S) - (R)$ are not the same.
+ - ## Union Compatibility
+ - What is **Union Compatibility**? #card
+ - For union, intersection, & minus, relations must be **union compatible**.
+ - That is, schemas of relations must match, i.e., have the same number of attributes and each corresponding attributes have the same domain.
+ - ## Cartesian Product Operator ($\times$) (Cross-Join) #card
+ id:: 636a860b-5170-4227-befa-68876a53c856
+ - **Notation:** $(R) \times (S)$ where $R$ & $S$ are relations / tables.
+ - **Returns:** Tuples comprising the concatenation (combination) of *every tuple* in $R$ with *every tuple* in $S$.
+ - **Note:** No condition specified.
+ - ### Cartesian Product vs Join #card
+ - The main difference between a Cartesian product operator and a Join operator is that, with a Join, only tuples **satisfying a condition** appear in the result, while in a Cartesian product operator, all combinations of tuples are included in the result.
+ - ## Join Operator ($\Join$) #card
+ - The **Join Operator** is a *hybrid* operator - it is a combination of the **Cartesian Product** operator ($\times$) & a **Select** operator ($\sigma$).
+ - Tables are joined together based on the **condition** specified.
+ - ## Equi & Theta Joins #card
+ - **Notation:** $(R_1) \Join p (R_2)$ where $p$ is the **join condition** and $R_1$ & $R_2$ are relations.
+ - **Result:** The `JOIN` operation returns all combinations of tuples from relation $R_1$ & relation $R_2$ satisfying the join condition $p$.
+ - **Note:** EQUI JOINS use only equality comparisons (`=`) in the join condition $p$.
+-
+-
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Random Variables/2022-10-07T08_33_33.380Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Random Variables/2022-10-07T08_33_33.380Z.Desktop.md
new file mode 100644
index 00000000..59e3e9ed
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Random Variables/2022-10-07T08_33_33.380Z.Desktop.md
@@ -0,0 +1,70 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Probability]]
+- **Next Topic:**
+- **Relevant Slides:** 
+-
+- # Random Variables
+ - What is a **random variable** #card
+ - A **random variable** is a function that associates a real number with each element in the sample space.
+ - The probability distribution of a random variable $X$ gives the probability for each value of $X$.
+ - A random variable takes a **numeric** value based on the outcome of a random event.
+ - Random variables are denoted by a capital letter - $X$, $Y$, $Z$, etc.
+ - A particular value of a random variable will be denoted with a lower case letter - $x$, $y$, $z$, etc.
+ - What are the two types of random variables? #card
+ - There are two types of random variables:
+ - **Discrete** random variables can take one of a finite number of distinct outcomes.
+ - **Continuous** random variables can take any numeric value within a range of values.
+ -
+-
+- # Probability Distributions
+ - ## Discrete Probability Distributions
+ collapsed:: true
+ - What is the **probability distribution** of some discrete random variable $X$? #card
+ - The set of ordered pairs $(x, f(x))$ is a **probability function**, **probability mass function** (pmf), or **probability distribution** of the discrete random variable $X$ if, for each possible outcome $x$:
+ - 1. $f(x) \geq 0$,
+ - 2. $\displaystyle \sum_n f(x) = 1$,
+ - 3. $P(X = x) = f(x)$.
+ - What is the **cumulative distribution function** of a discrete random variable $X$? #card
+ - The **cumulative distribution function** is the probability that a random variable $X$ with a given probability distribution will be found at a value less than or equal to $x$.
+ - The **cumulative distribution function** $F(x)$ of a discrete random variable $X$ with probability distribution $f(x) is:
+ - $$F(x) = P(X \leq x) = \sum_{t \leq x} f(t), \text{ for } - \infty < x < \infty$$
+ - ## Continuous Probability Distributions
+ - What is the **probability distribution function** for a continuous random variable? #card
+ - The function $f(x)$ is a **probability distribution function** (pdf) for a continuous random variable $X$, defined over a set of real numbers, if:
+ - 1. $f(x) \geq 0, \text{ for all } x \in R$,
+ - 2. $\int^{\infty}_{- \infty} f(x) dx = 1$,
+ - 3. $P(a < X < b) = \int^{b}_{a} f(x)dx$.
+ - **Note:** $P(X = x) = 0$, i.e., there is no area exactly at $x$.
+ -
+-
+- # Expected Value - Location
+ - What is **expected value** for a **discrete** random variable? #card
+ - A useful summary of interest is the average, or **expected value** of a random variable.
+ - The **expected value** is denoted by $E[X]$ & $\mu$.
+ - The expected value of a **discrete** random variable can be found by summing the products of each possible value multiplied by the probability that it occurs:
+ - $$\mu = E[X] = \sum_x xP(X = x)$$
+ - What is the **expected value** for a **continuous** random variable? #card
+ - A useful summary of interest is the average, or **expected value** of a random variable.
+ - The **expected value** is denoted by $E[X]$ & $\mu$.
+ - The **expected value** of a **continuous** random variable can be found by:
+ - $$\mu = E(X) = \int_x xf(x)dx$$
+- # Variance, Standard Deviation - Spread
+ - What is the **variance** & hence the **standard deviation** of a discrete random variable? #card
+ - The **variance** of a **discrete** random variable measures the squared deviation from the mean:
+ - $$\sigma^2 = \text{Var}(X) = E[(X - \mu)^2] = \sum_x (x - \mu)^2 P(X =x)$$
+ - Alternatively, variance can be calculated by:
+ - $$\text{Var}(X) = E(X^2) - E^2(X)$$
+ - Where
+ - $$E(X^2) = \sum x^2P(X = x)$$
+ - Or, more usefully, the **standard deviation** is:
+ - $$\sigma = \text{sd}(X) = \sqrt{\text{Var}(X)}$$
+ - The standard deviation has the advantage of being in the same units as $X$ (& $\mu$).
+ - What is the **variance** of a **continuous** random variable? #card
+ - The **variance** of a **continuous** random variable is:
+ - $$\text{var}(X) = \int_x (x - \mu)^2 f(x)dx$$
+- # Means & Variances
+ - Adding or subtracting a constant from data shifts the mean, but does not change the variance or the standard deviation.
+ - $$E[X +c] = E[X] +c, \ \ \text{Var}(X+c) = \text{Var}(X), \ \ \text{sd}(X + c) = sd(X)$$
+ - $$E[X -c] = E[X] -c,\ \ \text{Var}(X -c) = \text{Var}(X), \ \ \text{sd}(X - c) = \text{sd}(X)$$
+ - Multiplying a random variable by a constant multiplies the mean by that constant, and the variance by the *square* of that constant.
+ - $$E[aX] = aE[X], \ \ \text{Var}(aX) = a^2 \text{Var}(X), \ \ \text{sd}(aX) = |a|\text{sd}(X)$$
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Random Variables/2022-10-10T11_59_52.469Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Random Variables/2022-10-10T11_59_52.469Z.Desktop.md
new file mode 100644
index 00000000..e336f475
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Random Variables/2022-10-10T11_59_52.469Z.Desktop.md
@@ -0,0 +1,123 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Probability]]
+- **Next Topic:**
+- **Relevant Slides:** 
+-
+- # Random Variables
+ - What is a **random variable**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T17:17:27.762Z
+ card-last-reviewed:: 2022-10-06T17:17:27.763Z
+ card-last-score:: 3
+ - A **random variable** is a function that associates a real number with each element in the sample space.
+ - The probability distribution of a random variable $X$ gives the probability for each value of $X$.
+ - A random variable takes a **numeric** value based on the outcome of a random event.
+ - Random variables are denoted by a capital letter - $X$, $Y$, $Z$, etc.
+ - A particular value of a random variable will be denoted with a lower case letter - $x$, $y$, $z$, etc.
+ - What are the two types of random variables? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T17:12:47.990Z
+ card-last-reviewed:: 2022-10-06T17:12:47.990Z
+ card-last-score:: 5
+ - There are two types of random variables:
+ - **Discrete** random variables can take one of a finite number of distinct outcomes.
+ - **Continuous** random variables can take any numeric value within a range of values.
+ -
+-
+- # Probability Distributions
+ - ## Discrete Probability Distributions
+ collapsed:: true
+ - What is the **probability distribution** of some discrete random variable $X$? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:28:47.119Z
+ card-last-score:: 1
+ - The set of ordered pairs $(x, f(x))$ is a **probability function**, **probability mass function** (pmf), or **probability distribution** of the discrete random variable $X$ if, for each possible outcome $x$:
+ - 1. $f(x) \geq 0$,
+ - 2. $\displaystyle \sum_n f(x) = 1$,
+ - 3. $P(X = x) = f(x)$.
+ - What is the **cumulative distribution function** of a discrete random variable $X$? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T22:48:20.110Z
+ card-last-score:: 1
+ - The **cumulative distribution function** is the probability that a random variable $X$ with a given probability distribution will be ^^found at a value less than or equal to^^ $x$.
+ - The **cumulative distribution function** $F(x)$ of a discrete random variable $X$ with probability distribution $f(x)$ is:
+ - $$F(x) = P(X \leq x) = \sum_{t \leq x} f(t), \text{ for } - \infty < x < \infty$$
+ - ## Continuous Probability Distributions
+ - What is the **probability distribution function** for a continuous random variable? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:01:46.930Z
+ card-last-score:: 1
+ - The function $f(x)$ is a **probability distribution function** (pdf) for a continuous random variable $X$, defined over a set of real numbers, if:
+ - 1. $f(x) \geq 0, \text{ for all } x \in R$,
+ - 2. $\int^{\infty}_{- \infty} f(x) dx = 1$,
+ - 3. $P(a < X < b) = \int^{b}_{a} f(x)dx$.
+ - **Note:** $P(X = x) = 0$, i.e., there is no area exactly at $x$.
+ -
+-
+- # Expected Value - Location
+ - What is **expected value** for a **discrete** random variable? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:29:15.248Z
+ card-last-score:: 1
+ - The average, or **expected value** of a random variable is denoted by $E[X]$ & $\mu$.
+ - It can be found by summing the products of each possible value multiplied by the probability that it occurs:
+ - $$\mu = E[X] = \sum_x xP(X = x)$$
+ - What is the **expected value** for a **continuous** random variable? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T15:16:06.768Z
+ card-last-score:: 1
+ - A useful summary of interest is the average, or **expected value** of a random variable.
+ - The **expected value** is denoted by $E[X]$ & $\mu$.
+ - The **expected value** of a ***continuous*** random variable can be found by:
+ - $$\mu = E(X) = \int_{-\infty}^{\infty} xf(x)dx$$
+- # Variance, Standard Deviation - Spread
+ - What is the **variance** & hence the **standard deviation** of a discrete random variable? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T14:56:57.367Z
+ card-last-score:: 1
+ - The **variance** of a **discrete** random variable measures the squared deviation from the mean:
+ - $$\sigma^2 = \text{Var}(X) = E[(X - \mu)^2] = \sum_x (x - \mu)^2 P(X =x)$$
+ - Alternatively, variance can be calculated by:
+ - $$\text{Var}(X) = E(X^2) - E^2(X)$$
+ - Where
+ - $$E(X^2) = \sum x^2P(X = x)$$
+ - Or, more usefully, the **standard deviation** is:
+ - $$\sigma = \text{sd}(X) = \sqrt{\text{Var}(X)}$$
+ - The standard deviation has the advantage of being in the same units as $X$ (& $\mu$).
+ - What is the **variance** of a ***continuous*** random variable? #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-08T14:57:59.229Z
+ - The **variance** of a **continuous** random variable is:
+ - $$\text{var}(X) = \int_x (x - \mu)^2 f(x)dx$$
+- # Means & Variances
+ - Adding or subtracting a constant from data shifts the mean, but does not change the variance or the standard deviation.
+ - $$E[X +c] = E[X] +c, \ \ \text{Var}(X+c) = \text{Var}(X), \ \ \text{sd}(X + c) = sd(X)$$
+ - $$E[X -c] = E[X] -c,\ \ \text{Var}(X -c) = \text{Var}(X), \ \ \text{sd}(X - c) = \text{sd}(X)$$
+ - Multiplying a random variable by a constant multiplies the mean by that constant, and the variance by the *square* of that constant.
+ - $$E[aX] = aE[X], \ \ \text{Var}(aX) = a^2 \text{Var}(X), \ \ \text{sd}(aX) = |a|\text{sd}(X)$$
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/Random Variables/2022-10-20T09_05_57.994Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/Random Variables/2022-10-20T09_05_57.994Z.Desktop.md
new file mode 100644
index 00000000..5e5e8510
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/Random Variables/2022-10-20T09_05_57.994Z.Desktop.md
@@ -0,0 +1,123 @@
+- #[[ST2001 - Statistics in Data Science I]]
+- **Previous Topic:** [[Probability]]
+- **Next Topic:** [[Discrete Probability Distributions: Binomial & Poisson]]
+- **Relevant Slides:** 
+-
+- # Random Variables
+ - What is a **random variable**? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T17:17:27.762Z
+ card-last-reviewed:: 2022-10-06T17:17:27.763Z
+ card-last-score:: 3
+ - A **random variable** is a function that associates a real number with each element in the sample space.
+ - The probability distribution of a random variable $X$ gives the probability for each value of $X$.
+ - A random variable takes a **numeric** value based on the outcome of a random event.
+ - Random variables are denoted by a capital letter - $X$, $Y$, $Z$, etc.
+ - A particular value of a random variable will be denoted with a lower case letter - $x$, $y$, $z$, etc.
+ - What are the two types of random variables? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-10T17:12:47.990Z
+ card-last-reviewed:: 2022-10-06T17:12:47.990Z
+ card-last-score:: 5
+ - There are two types of random variables:
+ - **Discrete** random variables can take one of a finite number of distinct outcomes.
+ - **Continuous** random variables can take any numeric value within a range of values.
+ -
+-
+- # Probability Distributions
+ - ## Discrete Probability Distributions
+ collapsed:: true
+ - What is the **probability distribution** of some discrete random variable $X$? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:38:24.612Z
+ card-last-score:: 1
+ - The set of ordered pairs $(x, f(x))$ is a **probability function**, **probability mass function** (pmf), or **probability distribution** of the discrete random variable $X$ if, for each possible outcome $x$:
+ - 1. $f(x) \geq 0$,
+ - 2. $\displaystyle \sum_n f(x) = 1$,
+ - 3. $P(X = x) = f(x)$.
+ - What is the **cumulative distribution function** of a discrete random variable $X$? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:42:14.103Z
+ card-last-score:: 1
+ - The **cumulative distribution function** is the probability that a random variable $X$ with a given probability distribution will be ^^found at a value less than or equal to^^ $x$.
+ - The **cumulative distribution function** $F(x)$ of a discrete random variable $X$ with probability distribution $f(x)$ is:
+ - $$F(x) = P(X \leq x) = \sum_{t \leq x} f(t), \text{ for } - \infty < x < \infty$$
+ - ## Continuous Probability Distributions
+ - What is the **probability distribution function** for a continuous random variable? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:33:14.442Z
+ card-last-score:: 1
+ - The function $f(x)$ is a **probability distribution function** (pdf) for a continuous random variable $X$, defined over a set of real numbers, if:
+ - 1. $f(x) \geq 0, \text{ for all } x \in R$,
+ - 2. $\int^{\infty}_{- \infty} f(x) dx = 1$,
+ - 3. $P(a < X < b) = \int^{b}_{a} f(x)dx$.
+ - **Note:** $P(X = x) = 0$, i.e., there is no area exactly at $x$.
+ -
+-
+- # Expected Value - Location
+ - What is **expected value** for a **discrete** random variable? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:38:32.978Z
+ card-last-score:: 1
+ - The average, or **expected value** of a random variable is denoted by $E[X]$ & $\mu$.
+ - It can be found by summing the products of each possible value multiplied by the probability that it occurs:
+ - $$\mu = E[X] = \sum_x xP(X = x)$$
+ - What is the **expected value** for a **continuous** random variable? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:34:30.811Z
+ card-last-score:: 1
+ - A useful summary of interest is the average, or **expected value** of a random variable.
+ - The **expected value** is denoted by $E[X]$ & $\mu$.
+ - The **expected value** of a ***continuous*** random variable can be found by:
+ - $$\mu = E(X) = \int_{-\infty}^{\infty} xf(x)dx$$
+- # Variance, Standard Deviation - Spread
+ - What is the **variance** & hence the **standard deviation** of a discrete random variable? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-reviewed:: 2022-10-10T11:32:08.228Z
+ card-last-score:: 1
+ - The **variance** of a **discrete** random variable measures the squared deviation from the mean:
+ - $$\sigma^2 = \text{Var}(X) = E[(X - \mu)^2] = \sum_x (x - \mu)^2 P(X =x)$$
+ - Alternatively, variance can be calculated by:
+ - $$\text{Var}(X) = E(X^2) - E^2(X)$$
+ - Where
+ - $$E(X^2) = \sum x^2P(X = x)$$
+ - Or, more usefully, the **standard deviation** is:
+ - $$\sigma = \text{sd}(X) = \sqrt{\text{Var}(X)}$$
+ - The standard deviation has the advantage of being in the same units as $X$ (& $\mu$).
+ - What is the **variance** of a ***continuous*** random variable? #card
+ card-last-score:: 1
+ card-repeats:: 1
+ card-next-schedule:: 2022-10-10T23:00:00.000Z
+ card-last-interval:: -1
+ card-ease-factor:: 2.5
+ card-last-reviewed:: 2022-10-10T11:32:22.698Z
+ - The **variance** of a **continuous** random variable is:
+ - $$\text{var}(X) = \int_x (x - \mu)^2 f(x)dx$$
+- # Means & Variances
+ - Adding or subtracting a constant from data shifts the mean, but does not change the variance or the standard deviation.
+ - $$E[X +c] = E[X] +c, \ \ \text{Var}(X+c) = \text{Var}(X), \ \ \text{sd}(X + c) = sd(X)$$
+ - $$E[X -c] = E[X] -c,\ \ \text{Var}(X -c) = \text{Var}(X), \ \ \text{sd}(X - c) = \text{sd}(X)$$
+ - Multiplying a random variable by a constant multiplies the mean by that constant, and the variance by the *square* of that constant.
+ - $$E[aX] = aE[X], \ \ \text{Var}(aX) = a^2 \text{Var}(X), \ \ \text{sd}(aX) = |a|\text{sd}(X)$$
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/SCRUM Roles & Ceremonies/2022-10-10T11_59_52.471Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/SCRUM Roles & Ceremonies/2022-10-10T11_59_52.471Z.Desktop.md
new file mode 100644
index 00000000..3ded0d27
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/SCRUM Roles & Ceremonies/2022-10-10T11_59_52.471Z.Desktop.md
@@ -0,0 +1,184 @@
+- #[[CT216 - Software Engineering I]]
+- **Previous Topic:** [[Introduction to Agile Methods]]
+- **Next Topic:** [[Agile Methods - Extreme Programming]]
+- **Relevant Slides:** 
+-
+- # Scrum Framework
+ - ## Roles
+ collapsed:: true
+ - Product Owner
+ - ScrumMaster
+ - Team
+ -
+ - ### Product Owner #card
+ card-last-interval:: 14.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-23T02:50:34.914Z
+ card-last-reviewed:: 2022-10-08T22:50:34.914Z
+ card-last-score:: 5
+ - Define the features of the product.
+ - Tries to remove conjecture - "I know the customer wants this" as opposed to "I believe this would be a good feature".
+ - Decide on release date and content.
+ - Usually responsible for press release.
+ - Be responsible for the profitability of the product (ROI).
+ - Prioritise features according to market value.
+ - Conduct market research, feasibility studies.
+ - Adjust features & priority every iteration, as needed.
+ - Accept or reject work results.
+ - ### Scrum Master #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-12T15:17:35.580Z
+ card-last-reviewed:: 2022-10-08T15:17:35.581Z
+ card-last-score:: 3
+ - Represents management to the project.
+ - Often one of the engineers.
+ - Responsible for enacting Scrum values & practices.
+ - Removes impediments.
+ - Ensure that the team is fully functional & productive.
+ - Enable close cooperation across all roles & functions.
+ - Shield the team from external interfaces.
+ - ### Scrum Team #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:45:22.892Z
+ card-last-reviewed:: 2022-10-07T10:45:22.892Z
+ card-last-score:: 3
+ - Typically 5-10 people.
+ - Cross-functional.
+ - QA, Programmers, UI Designers, etc.
+ - Members should be full-time.
+ - May be exceptions (e.g., System Admin, etc.).
+ - Teams are self-organising.
+ - Membership can change only between sprints.
+ -
+ - ## Ceremonies
+ collapsed:: true
+ - Sprints
+ - Sprint Planning
+ - Sprint Review
+ - Sprint Retrospective
+ - Daily Scrum Meeting
+ -
+ - ### Sprints #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T04:54:56.129Z
+ card-last-reviewed:: 2022-10-08T22:54:56.130Z
+ card-last-score:: 5
+ collapsed:: true
+ - Scrum projects make progress in a series of **sprints**.
+ - Target duration is one month.
+ - + / - a week or two (2 - 6 weeks max).
+ - Product is designed, coded, and tested during the sprint.
+ - The output is a built which may or may not be a release.
+ - Move onto the next sprint.
+ -
+ - #### No changes during Sprint
+ - Plan sprint durations around how long you can commit to keeping the change out of the Sprint.
+ - ### Sprint Planning #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-10-08T23:00:00.000Z
+ card-last-reviewed:: 2022-10-08T14:57:07.042Z
+ card-last-score:: 1
+ collapsed:: true
+ - The Team selects items from the **product backlog** that they can commit to completing.
+ - The **Sprint Backlog** is created.
+ - Tasks are identified & the length of each is estimated (1-16 hours).
+ - This is done collaboratively by the team.
+ - 
+ - #### Sprint Backlog
+ - What is the **Product Backlog**? #card
+ card-last-interval:: 14.2
+ card-repeats:: 3
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-23T02:50:06.337Z
+ card-last-reviewed:: 2022-10-08T22:50:06.337Z
+ card-last-score:: 5
+ - The **Product Backlog** is a list of desired work on the project (the requirements).
+ - It's usually a combination of:
+ - **story-based work** - "let user search & replace".
+ - **task-based work** - "improve exception handling".
+ - The list is prioritised by the **Product Owner**.
+ - The **Product Owner** is typically a Product Manager, Marketing, Internal Customer, etc.
+ - Priority groupings (high, medium, low, etc.).
+ - Re-prioritised at the start of each sprint.
+ - Spreadsheet (usually).
+ - To create a Sprint Backlog, you must have a Sprint goal.
+ - The Scrum team takes the Sprint Goal and decides what tasks are necessary.
+ - The Team self-organises around how they will meet the Sprint Goal.
+ - Manager does not assign tasks to individuals.
+ - Managers don't make decisions for the team.
+ - A Sprint Backlog is created.
+ - #### Sprint Backlogs during the Sprint
+ - Changes
+ - The Team adds new tasks whenever they need to, in order to meet the Sprint Goal.
+ - The Team can remove unnecessary tasks.
+ - But, the Sprint Backlog can only be updated by the team.
+ - Estimates are updated whenever there's new information.
+ -
+ - ### Sprint Review Meeting #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T04:52:59.135Z
+ card-last-reviewed:: 2022-10-08T22:52:59.135Z
+ card-last-score:: 5
+ - The Team presents what it accomplished during the sprint.
+ - It typically takes the form of a demo of new features or underlying architecture.
+ - Informal.
+ - 2 hour prep time.
+ - No slides.
+ - Participants.
+ - Customers.
+ - Management.
+ - Product Owners.
+ - Engineering Team.
+ - ### Sprint Retrospective Meeting #card
+ card-last-interval:: 8.64
+ card-repeats:: 3
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-17T13:50:17.417Z
+ card-last-reviewed:: 2022-10-08T22:50:17.418Z
+ card-last-score:: 3
+ - Typically 15-30 mintues.
+ - Done after every sprint.
+ - Feedback meeting - time to reflect on how things are going...
+ - Many participants.
+ - Scrum Master
+ - Product Owner
+ - Team
+ - Possibly customers & others
+ - The whole team gathers & discusses what they'd like to:
+ - Start doing.
+ - Stop doing.
+ - Continue doing,
+ -
+-
+- ## Pros / Cons of Agile Methods #card
+ card-last-interval:: 9.28
+ card-repeats:: 3
+ card-ease-factor:: 2.32
+ card-next-schedule:: 2022-10-18T04:52:37.640Z
+ card-last-reviewed:: 2022-10-08T22:52:37.640Z
+ card-last-score:: 5
+ - ### Advantages
+ - Completely developed & tested features in short iterations.
+ - Simplicity of the process.
+ - Clearly defined rules.
+ - Increasing productivity.
+ - Self-organising.
+ - Each team member carries a lot of responsibility.
+ - Improved communication.
+ - Combination with Extreme Programming.
+ - ### Disadvantages
+ - "Undisciplined hacking" (no written documentation).
+ - Violation of responsibility.
+ - Current mainly carried by the inventors.
+ - Employee burnout & fatigue.
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-21T07_20_58.209Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-21T07_20_58.209Z.Desktop.md
new file mode 100644
index 00000000..4129fe4d
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-21T07_20_58.209Z.Desktop.md
@@ -0,0 +1,122 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Introduction to SQL & DDL]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Notes on Syntax
+ - While SQL is case insensitive, Linux ^^is not.^^
+ - web1.cs.nuigalway.ie is a ^^linux server^^, so we need to be careful with table names in particular, as `EMPLOYEE` is ^^not the same thing^^ as `employee`.
+ - Attribute names are separated by commas.
+ - Strings are enclosed in quotes.
+ - Numbers are not enclosed in quotes.
+ -
+ - Usually, SQL keywords are capitalised while table & keyword names are mostly kept in lowercase unless using camelCase instead of snake_case.
+ - Code should be organised horizontally & vertically, and not all written on one line.
+ - Code blocks are separated by a semicolon.
+ - Comments can be made using `#`, `--`, & `/* */`.
+-
+- # **CRUD** Operations in DML
+ - What are **CRUD** Operations? #card
+ - **CRUD** operations are the 4 basic functions that we may wish to perform on *persistent* data.
+ - **Create:** insert a new tuple. `INSERT`
+ - **Read:** retrieve some data. `SELECT`
+ - **Update:** modify some data. `Update`
+ - **Delete:** delete some data or a tuple. `DELETE`
+ - ## Read: `SELECT`
+ - The basic syntax for an SQL select query to *read* data consists of 6 clauses. #card
+ collapsed:: true
+ - ```sql
+ SELECT [DISTINCT]
+ FROM
+ WHERE
+ GROUP BY
+ HAVING
+ ORDER BY
+ ```
+ - The order of these clauses ^^cannot be changed.^^
+ - `SELECT` & `FROM` are ^^always required^^, other clauses are optional.
+ - ### `SELECT FROM
WHERE ` #card
+ collapsed:: true
+ - `` is a list of **attribute** (column) names (separated by commas) whose values will be retrieved by the query.
+ - `
` is a list of table names (separated by commas) containing the attributes.
+ - `` is a **Boolean** expression that identifies the tuples to be retrieved by the query.
+ - For each **tuple** (row) in the table(s) which are part of the query:
+ - the tuple is checked to see if the condition is **true** for this tuple.
+ - If **true**, the tuple **is** part of the output.
+ - If **false**, the tuple is **not** part of the output.
+ - The comparison operators are:
+ - `=` `<=` `<` `>` `>=` `!=`
+ - Conditions can be compounded by use of Boolean `AND`, `OR`, and can be negated with `NOT`.
+ - ^^Note:^^ In some versions of SQL, (e.g., in MS), the `!=` operator is written as `<>`.
+ - ### Calculated or Derived Fields #card
+ collapsed:: true
+ - We can specify an SQL expression in the `SELECT` clause which can involve **numerical operations** on **numeric** fields and **counting operations** on **non-numeric** fields.
+ - e.g.,
+ - ```sql
+ SELECT ssn, salary/12 FROM employee;
+ ```
+ - ### Tidying Up the Output #card
+ collapsed:: true
+ - We can use keywords `CAST`, `AS`, & `DECIMAL(x, y)` to specify the total number of digits `x` and the number of digits after the decimal point `y` when we're working with **real numbers**.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ FROM employee;
+ ```
+ - We can also use the keyword `AS` to rename output.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ AS monthlySalary
+ FROM employee;
+ ```
+ -
+ - ### Keyword `DISTINCT` #card
+ collapsed:: true
+ - The keyword `DISTINCT` automatically removes duplicates from the returned result set.
+ - We should be careful of using with large result sets as it can be an expensive operation to perform (not a problem for our small examples).
+ - ```sql
+ SELECT DISTINCT salary
+ FROM employee;
+ ```
+ - ### Selecting All Attribute Values for Selected Tuples #card
+ - To retrieve all attribute values of selected tuples, you do not have to explicitly list all the attribute names - instead, you can use ```SELECT *```.
+ - ### New Operators
+ collapsed:: true
+ - `BETWEEN` #card
+ - The `BETWEEN` operator selects values within a given range. The values can be numbers, texts, or dates.
+ - ```sql
+ SELECT
+ FROM
+ WHERE BETWEEN AND ;
+ ```
+ - `IN` #card
+ - The `IN` operator tests if a data value matches one of a list of values.
+ - It is a shorthand for multiple `OR` conditions.
+ - ```sql
+ SELECT
+ FROM
+ WHERE IN (, , ...);
+
+ -- OR --
+
+ SELECT
+ FROM
+ WHERE IN (SELECT );
+ ```
+ - `LIKE` #card
+ - Allows string comparison, when equality is too strict.
+ - There are 2 wildcards, often used in conjunction with the `LIKE` operator:
+ - The percent sign `%` represents zero, one, or multiple characters.
+ - The underscore sign `_` represents one, single character.
+ - ```sql
+ SELECT
+ FROM
+ WHERE LIKE ;
+ ```
+ - `IS NULL` #card
+ - Allows an explicit search for `NULL`.
+ -
+ -
+ - ### Set Operators
+ - `UNION`
+ - `INTERSECTION`
+ - `MINUS / DIFFERENCE`
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-22T07_59_49.185Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-22T07_59_49.185Z.Desktop.md
new file mode 100644
index 00000000..4129fe4d
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-22T07_59_49.185Z.Desktop.md
@@ -0,0 +1,122 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Introduction to SQL & DDL]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Notes on Syntax
+ - While SQL is case insensitive, Linux ^^is not.^^
+ - web1.cs.nuigalway.ie is a ^^linux server^^, so we need to be careful with table names in particular, as `EMPLOYEE` is ^^not the same thing^^ as `employee`.
+ - Attribute names are separated by commas.
+ - Strings are enclosed in quotes.
+ - Numbers are not enclosed in quotes.
+ -
+ - Usually, SQL keywords are capitalised while table & keyword names are mostly kept in lowercase unless using camelCase instead of snake_case.
+ - Code should be organised horizontally & vertically, and not all written on one line.
+ - Code blocks are separated by a semicolon.
+ - Comments can be made using `#`, `--`, & `/* */`.
+-
+- # **CRUD** Operations in DML
+ - What are **CRUD** Operations? #card
+ - **CRUD** operations are the 4 basic functions that we may wish to perform on *persistent* data.
+ - **Create:** insert a new tuple. `INSERT`
+ - **Read:** retrieve some data. `SELECT`
+ - **Update:** modify some data. `Update`
+ - **Delete:** delete some data or a tuple. `DELETE`
+ - ## Read: `SELECT`
+ - The basic syntax for an SQL select query to *read* data consists of 6 clauses. #card
+ collapsed:: true
+ - ```sql
+ SELECT [DISTINCT]
+ FROM
+ WHERE
+ GROUP BY
+ HAVING
+ ORDER BY
+ ```
+ - The order of these clauses ^^cannot be changed.^^
+ - `SELECT` & `FROM` are ^^always required^^, other clauses are optional.
+ - ### `SELECT FROM
WHERE ` #card
+ collapsed:: true
+ - `` is a list of **attribute** (column) names (separated by commas) whose values will be retrieved by the query.
+ - `
` is a list of table names (separated by commas) containing the attributes.
+ - `` is a **Boolean** expression that identifies the tuples to be retrieved by the query.
+ - For each **tuple** (row) in the table(s) which are part of the query:
+ - the tuple is checked to see if the condition is **true** for this tuple.
+ - If **true**, the tuple **is** part of the output.
+ - If **false**, the tuple is **not** part of the output.
+ - The comparison operators are:
+ - `=` `<=` `<` `>` `>=` `!=`
+ - Conditions can be compounded by use of Boolean `AND`, `OR`, and can be negated with `NOT`.
+ - ^^Note:^^ In some versions of SQL, (e.g., in MS), the `!=` operator is written as `<>`.
+ - ### Calculated or Derived Fields #card
+ collapsed:: true
+ - We can specify an SQL expression in the `SELECT` clause which can involve **numerical operations** on **numeric** fields and **counting operations** on **non-numeric** fields.
+ - e.g.,
+ - ```sql
+ SELECT ssn, salary/12 FROM employee;
+ ```
+ - ### Tidying Up the Output #card
+ collapsed:: true
+ - We can use keywords `CAST`, `AS`, & `DECIMAL(x, y)` to specify the total number of digits `x` and the number of digits after the decimal point `y` when we're working with **real numbers**.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ FROM employee;
+ ```
+ - We can also use the keyword `AS` to rename output.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ AS monthlySalary
+ FROM employee;
+ ```
+ -
+ - ### Keyword `DISTINCT` #card
+ collapsed:: true
+ - The keyword `DISTINCT` automatically removes duplicates from the returned result set.
+ - We should be careful of using with large result sets as it can be an expensive operation to perform (not a problem for our small examples).
+ - ```sql
+ SELECT DISTINCT salary
+ FROM employee;
+ ```
+ - ### Selecting All Attribute Values for Selected Tuples #card
+ - To retrieve all attribute values of selected tuples, you do not have to explicitly list all the attribute names - instead, you can use ```SELECT *```.
+ - ### New Operators
+ collapsed:: true
+ - `BETWEEN` #card
+ - The `BETWEEN` operator selects values within a given range. The values can be numbers, texts, or dates.
+ - ```sql
+ SELECT
+ FROM
+ WHERE BETWEEN AND ;
+ ```
+ - `IN` #card
+ - The `IN` operator tests if a data value matches one of a list of values.
+ - It is a shorthand for multiple `OR` conditions.
+ - ```sql
+ SELECT
+ FROM
+ WHERE IN (, , ...);
+
+ -- OR --
+
+ SELECT
+ FROM
+ WHERE IN (SELECT );
+ ```
+ - `LIKE` #card
+ - Allows string comparison, when equality is too strict.
+ - There are 2 wildcards, often used in conjunction with the `LIKE` operator:
+ - The percent sign `%` represents zero, one, or multiple characters.
+ - The underscore sign `_` represents one, single character.
+ - ```sql
+ SELECT
+ FROM
+ WHERE LIKE ;
+ ```
+ - `IS NULL` #card
+ - Allows an explicit search for `NULL`.
+ -
+ -
+ - ### Set Operators
+ - `UNION`
+ - `INTERSECTION`
+ - `MINUS / DIFFERENCE`
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-30T08_54_51.922Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-30T08_54_51.922Z.Desktop.md
new file mode 100644
index 00000000..ad613846
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-30T08_54_51.922Z.Desktop.md
@@ -0,0 +1,194 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Introduction to SQL & DDL]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Notes on Syntax
+ - While SQL is case insensitive, Linux ^^is not.^^
+ - web1.cs.nuigalway.ie is a ^^linux server^^, so we need to be careful with table names in particular, as `EMPLOYEE` is ^^not the same thing^^ as `employee`.
+ - Attribute names are separated by commas.
+ - Strings are enclosed in quotes.
+ - Numbers are not enclosed in quotes.
+ -
+ - Usually, SQL keywords are capitalised while table & keyword names are mostly kept in lowercase unless using camelCase instead of snake_case.
+ - Code should be organised horizontally & vertically, and not all written on one line.
+ - Code blocks are separated by a semicolon.
+ - Comments can be made using `#`, `--`, & `/* */`.
+-
+- # **CRUD** Operations in DML
+ - What are **CRUD** Operations? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-24T23:00:00.000Z
+ card-last-reviewed:: 2022-09-24T17:00:12.767Z
+ card-last-score:: 1
+ - **CRUD** operations are the 4 basic functions that we may wish to perform on *persistent* data.
+ - **Create:** insert a new tuple. `INSERT`
+ - **Read:** retrieve some data. `SELECT`
+ - **Update:** modify some data. `Update`
+ - **Delete:** delete some data or a tuple. `DELETE`
+ - ## Read: `SELECT`
+ - The basic syntax for an SQL select query to *read* data consists of 6 clauses. #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:18:06.301Z
+ card-last-reviewed:: 2022-09-26T12:18:06.301Z
+ card-last-score:: 3
+ - ```sql
+ SELECT [DISTINCT]
+ FROM
+ WHERE
+ GROUP BY
+ HAVING
+ ORDER BY
+ ```
+ - The order of these clauses ^^cannot be changed.^^
+ - `SELECT` & `FROM` are ^^always required^^, other clauses are optional.
+ - ### `SELECT FROM
WHERE ` #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-28T17:00:54.009Z
+ card-last-reviewed:: 2022-09-24T17:00:54.010Z
+ card-last-score:: 5
+ - `` is a list of **attribute** (column) names (separated by commas) whose values will be retrieved by the query.
+ - `
` is a list of table names (separated by commas) containing the attributes.
+ - `` is a **Boolean** expression that identifies the tuples to be retrieved by the query.
+ - For each **tuple** (row) in the table(s) which are part of the query:
+ - the tuple is checked to see if the condition is **true** for this tuple.
+ - If **true**, the tuple **is** part of the output.
+ - If **false**, the tuple is **not** part of the output.
+ - The comparison operators are:
+ - `=` `<=` `<` `>` `>=` `!=`
+ - Conditions can be compounded by use of Boolean `AND`, `OR`, and can be negated with `NOT`.
+ - ^^Note:^^ In some versions of SQL, (e.g., in MS), the `!=` operator is written as `<>`.
+ - ### Calculated or Derived Fields #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:13:51.230Z
+ card-last-reviewed:: 2022-09-26T12:13:51.230Z
+ card-last-score:: 3
+ - We can specify an SQL expression in the `SELECT` clause which can involve **numerical operations** on **numeric** fields and **counting operations** on **non-numeric** fields.
+ - e.g.,
+ - ```sql
+ SELECT ssn, salary/12 FROM employee;
+ ```
+ - ### Tidying Up the Output #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:15:08.064Z
+ card-last-reviewed:: 2022-09-26T12:15:08.065Z
+ card-last-score:: 3
+ - We can use keywords `CAST`, `AS`, & `DECIMAL(x, y)` to specify the total number of digits `x` and the number of digits after the decimal point `y` when we're working with **real numbers**.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ FROM employee;
+ ```
+ - We can also use the keyword `AS` to rename output.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ AS monthlySalary
+ FROM employee;
+ ```
+ -
+ - ### Keyword `DISTINCT` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:12:52.222Z
+ card-last-reviewed:: 2022-09-26T12:12:52.223Z
+ card-last-score:: 5
+ - The keyword `DISTINCT` automatically removes duplicates from the returned result set.
+ - We should be careful of using with large result sets as it can be an expensive operation to perform (not a problem for our small examples).
+ - ```sql
+ SELECT DISTINCT salary
+ FROM employee;
+ ```
+ - ### Selecting All Attribute Values for Selected Tuples #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:15:11.914Z
+ card-last-reviewed:: 2022-09-26T12:15:11.915Z
+ card-last-score:: 5
+ - To retrieve all attribute values of selected tuples, you do not have to explicitly list all the attribute names - instead, you can use ```SELECT *```.
+ - ### New Operators
+ collapsed:: true
+ - `BETWEEN` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-26T20:27:09.511Z
+ card-last-reviewed:: 2022-09-22T20:27:09.512Z
+ card-last-score:: 5
+ - The `BETWEEN` operator selects values within a given range. The values can be numbers, texts, or dates.
+ - ```sql
+ SELECT
+ FROM
+ WHERE BETWEEN AND ;
+ ```
+ - `IN` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:14:02.819Z
+ card-last-reviewed:: 2022-09-26T12:14:02.820Z
+ card-last-score:: 5
+ - The `IN` operator tests if a data value matches one of a list of values.
+ - It is a shorthand for multiple `OR` conditions.
+ - ```sql
+ SELECT
+ FROM
+ WHERE IN (, , ...);
+
+ -- OR --
+
+ SELECT
+ FROM
+ WHERE IN (SELECT );
+ ```
+ - `LIKE` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-26T20:27:37.725Z
+ card-last-reviewed:: 2022-09-22T20:27:37.726Z
+ card-last-score:: 5
+ - Allows string comparison, when equality is too strict.
+ - There are 2 wildcards, often used in conjunction with the `LIKE` operator:
+ - The percent sign `%` represents zero, one, or multiple characters.
+ - The underscore sign `_` represents one, single character.
+ - ```sql
+ SELECT
+ FROM
+ WHERE LIKE ;
+ ```
+ - `IS NULL` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-28T17:00:36.501Z
+ card-last-reviewed:: 2022-09-24T17:00:36.502Z
+ card-last-score:: 5
+ - Allows an explicit search for `NULL`.
+ -
+ -
+ - ### Set Operators
+ - `UNION`
+ - `INTERSECTION`
+ - `MINUS / DIFFERENCE`
+-
+-
+- ```SQL
+ SELECT full_name, ssn FROM (
+ SELECT ssn, CONCAT(fname, " ", minit, " ", lname)
+ AS full_name from employee) AS dtable
+ WHERE full_name IN ("John B Smith", "James E Borg", "Joyce A English");
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-30T10_01_42.370Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-30T10_01_42.370Z.Desktop.md
new file mode 100644
index 00000000..ad613846
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-09-30T10_01_42.370Z.Desktop.md
@@ -0,0 +1,194 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Introduction to SQL & DDL]]
+- **Next Topic:** null
+- **Relevant Slides:** 
+-
+- # Notes on Syntax
+ - While SQL is case insensitive, Linux ^^is not.^^
+ - web1.cs.nuigalway.ie is a ^^linux server^^, so we need to be careful with table names in particular, as `EMPLOYEE` is ^^not the same thing^^ as `employee`.
+ - Attribute names are separated by commas.
+ - Strings are enclosed in quotes.
+ - Numbers are not enclosed in quotes.
+ -
+ - Usually, SQL keywords are capitalised while table & keyword names are mostly kept in lowercase unless using camelCase instead of snake_case.
+ - Code should be organised horizontally & vertically, and not all written on one line.
+ - Code blocks are separated by a semicolon.
+ - Comments can be made using `#`, `--`, & `/* */`.
+-
+- # **CRUD** Operations in DML
+ - What are **CRUD** Operations? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-24T23:00:00.000Z
+ card-last-reviewed:: 2022-09-24T17:00:12.767Z
+ card-last-score:: 1
+ - **CRUD** operations are the 4 basic functions that we may wish to perform on *persistent* data.
+ - **Create:** insert a new tuple. `INSERT`
+ - **Read:** retrieve some data. `SELECT`
+ - **Update:** modify some data. `Update`
+ - **Delete:** delete some data or a tuple. `DELETE`
+ - ## Read: `SELECT`
+ - The basic syntax for an SQL select query to *read* data consists of 6 clauses. #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:18:06.301Z
+ card-last-reviewed:: 2022-09-26T12:18:06.301Z
+ card-last-score:: 3
+ - ```sql
+ SELECT [DISTINCT]
+ FROM
+ WHERE
+ GROUP BY
+ HAVING
+ ORDER BY
+ ```
+ - The order of these clauses ^^cannot be changed.^^
+ - `SELECT` & `FROM` are ^^always required^^, other clauses are optional.
+ - ### `SELECT FROM
WHERE ` #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-28T17:00:54.009Z
+ card-last-reviewed:: 2022-09-24T17:00:54.010Z
+ card-last-score:: 5
+ - `` is a list of **attribute** (column) names (separated by commas) whose values will be retrieved by the query.
+ - `
` is a list of table names (separated by commas) containing the attributes.
+ - `` is a **Boolean** expression that identifies the tuples to be retrieved by the query.
+ - For each **tuple** (row) in the table(s) which are part of the query:
+ - the tuple is checked to see if the condition is **true** for this tuple.
+ - If **true**, the tuple **is** part of the output.
+ - If **false**, the tuple is **not** part of the output.
+ - The comparison operators are:
+ - `=` `<=` `<` `>` `>=` `!=`
+ - Conditions can be compounded by use of Boolean `AND`, `OR`, and can be negated with `NOT`.
+ - ^^Note:^^ In some versions of SQL, (e.g., in MS), the `!=` operator is written as `<>`.
+ - ### Calculated or Derived Fields #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:13:51.230Z
+ card-last-reviewed:: 2022-09-26T12:13:51.230Z
+ card-last-score:: 3
+ - We can specify an SQL expression in the `SELECT` clause which can involve **numerical operations** on **numeric** fields and **counting operations** on **non-numeric** fields.
+ - e.g.,
+ - ```sql
+ SELECT ssn, salary/12 FROM employee;
+ ```
+ - ### Tidying Up the Output #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:15:08.064Z
+ card-last-reviewed:: 2022-09-26T12:15:08.065Z
+ card-last-score:: 3
+ - We can use keywords `CAST`, `AS`, & `DECIMAL(x, y)` to specify the total number of digits `x` and the number of digits after the decimal point `y` when we're working with **real numbers**.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ FROM employee;
+ ```
+ - We can also use the keyword `AS` to rename output.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ AS monthlySalary
+ FROM employee;
+ ```
+ -
+ - ### Keyword `DISTINCT` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:12:52.222Z
+ card-last-reviewed:: 2022-09-26T12:12:52.223Z
+ card-last-score:: 5
+ - The keyword `DISTINCT` automatically removes duplicates from the returned result set.
+ - We should be careful of using with large result sets as it can be an expensive operation to perform (not a problem for our small examples).
+ - ```sql
+ SELECT DISTINCT salary
+ FROM employee;
+ ```
+ - ### Selecting All Attribute Values for Selected Tuples #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:15:11.914Z
+ card-last-reviewed:: 2022-09-26T12:15:11.915Z
+ card-last-score:: 5
+ - To retrieve all attribute values of selected tuples, you do not have to explicitly list all the attribute names - instead, you can use ```SELECT *```.
+ - ### New Operators
+ collapsed:: true
+ - `BETWEEN` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-26T20:27:09.511Z
+ card-last-reviewed:: 2022-09-22T20:27:09.512Z
+ card-last-score:: 5
+ - The `BETWEEN` operator selects values within a given range. The values can be numbers, texts, or dates.
+ - ```sql
+ SELECT
+ FROM
+ WHERE BETWEEN AND ;
+ ```
+ - `IN` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:14:02.819Z
+ card-last-reviewed:: 2022-09-26T12:14:02.820Z
+ card-last-score:: 5
+ - The `IN` operator tests if a data value matches one of a list of values.
+ - It is a shorthand for multiple `OR` conditions.
+ - ```sql
+ SELECT
+ FROM
+ WHERE IN (, , ...);
+
+ -- OR --
+
+ SELECT
+ FROM
+ WHERE IN (SELECT );
+ ```
+ - `LIKE` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-26T20:27:37.725Z
+ card-last-reviewed:: 2022-09-22T20:27:37.726Z
+ card-last-score:: 5
+ - Allows string comparison, when equality is too strict.
+ - There are 2 wildcards, often used in conjunction with the `LIKE` operator:
+ - The percent sign `%` represents zero, one, or multiple characters.
+ - The underscore sign `_` represents one, single character.
+ - ```sql
+ SELECT
+ FROM
+ WHERE LIKE ;
+ ```
+ - `IS NULL` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-28T17:00:36.501Z
+ card-last-reviewed:: 2022-09-24T17:00:36.502Z
+ card-last-score:: 5
+ - Allows an explicit search for `NULL`.
+ -
+ -
+ - ### Set Operators
+ - `UNION`
+ - `INTERSECTION`
+ - `MINUS / DIFFERENCE`
+-
+-
+- ```SQL
+ SELECT full_name, ssn FROM (
+ SELECT ssn, CONCAT(fname, " ", minit, " ", lname)
+ AS full_name from employee) AS dtable
+ WHERE full_name IN ("John B Smith", "James E Borg", "Joyce A English");
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-10-07T18_07_00.025Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-10-07T18_07_00.025Z.Desktop.md
new file mode 100644
index 00000000..688c7c6c
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML Statement/2022-10-07T18_07_00.025Z.Desktop.md
@@ -0,0 +1,194 @@
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Introduction to SQL & DDL]]
+- **Next Topic:** [[SQL DML: SELECT]]
+- **Relevant Slides:** 
+-
+- # Notes on Syntax
+ - While SQL is case insensitive, Linux ^^is not.^^
+ - web1.cs.nuigalway.ie is a ^^linux server^^, so we need to be careful with table names in particular, as `EMPLOYEE` is ^^not the same thing^^ as `employee`.
+ - Attribute names are separated by commas.
+ - Strings are enclosed in quotes.
+ - Numbers are not enclosed in quotes.
+ -
+ - Usually, SQL keywords are capitalised while table & keyword names are mostly kept in lowercase unless using camelCase instead of snake_case.
+ - Code should be organised horizontally & vertically, and not all written on one line.
+ - Code blocks are separated by a semicolon.
+ - Comments can be made using `#`, `--`, & `/* */`.
+-
+- # **CRUD** Operations in DML
+ - What are **CRUD** Operations? #card
+ card-last-interval:: 4.14
+ card-repeats:: 2
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-10-07T17:31:41.234Z
+ card-last-reviewed:: 2022-10-03T14:31:41.234Z
+ card-last-score:: 5
+ - **CRUD** operations are the 4 basic functions that we may wish to perform on *persistent* data.
+ - **Create:** insert a new tuple. `INSERT`
+ - **Read:** retrieve some data. `SELECT`
+ - **Update:** modify some data. `Update`
+ - **Delete:** delete some data or a tuple. `DELETE`
+ - ## Read: `SELECT`
+ - The basic syntax for an SQL select query to *read* data consists of 6 clauses. #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-08T12:16:18.126Z
+ card-last-reviewed:: 2022-10-04T12:16:18.126Z
+ card-last-score:: 3
+ - ```sql
+ SELECT [DISTINCT]
+ FROM
+ WHERE
+ GROUP BY
+ HAVING
+ ORDER BY
+ ```
+ - The order of these clauses ^^cannot be changed.^^
+ - `SELECT` & `FROM` are ^^always required^^, other clauses are optional.
+ - ### `SELECT FROM
WHERE ` #card
+ collapsed:: true
+ card-last-interval:: 33.64
+ card-repeats:: 4
+ card-ease-factor:: 2.9
+ card-next-schedule:: 2022-11-10T01:17:27.890Z
+ card-last-reviewed:: 2022-10-07T10:17:27.890Z
+ card-last-score:: 5
+ - `` is a list of **attribute** (column) names (separated by commas) whose values will be retrieved by the query.
+ - `
` is a list of table names (separated by commas) containing the attributes.
+ - `` is a **Boolean** expression that identifies the tuples to be retrieved by the query.
+ - For each **tuple** (row) in the table(s) which are part of the query:
+ - the tuple is checked to see if the condition is **true** for this tuple.
+ - If **true**, the tuple **is** part of the output.
+ - If **false**, the tuple is **not** part of the output.
+ - The comparison operators are:
+ - `=` `<=` `<` `>` `>=` `!=`
+ - Conditions can be compounded by use of Boolean `AND`, `OR`, and can be negated with `NOT`.
+ - ^^Note:^^ In some versions of SQL, (e.g., in MS), the `!=` operator is written as `<>`.
+ - ### Calculated or Derived Fields #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T12:13:32.097Z
+ card-last-reviewed:: 2022-10-04T12:13:32.098Z
+ card-last-score:: 5
+ - We can specify an SQL expression in the `SELECT` clause which can involve **numerical operations** on **numeric** fields and **counting operations** on **non-numeric** fields.
+ - e.g.,
+ - ```sql
+ SELECT ssn, salary/12 FROM employee;
+ ```
+ - ### Tidying Up the Output #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T12:15:09.891Z
+ card-last-reviewed:: 2022-10-04T12:15:09.891Z
+ card-last-score:: 5
+ - We can use keywords `CAST`, `AS`, & `DECIMAL(x, y)` to specify the total number of digits `x` and the number of digits after the decimal point `y` when we're working with **real numbers**.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ FROM employee;
+ ```
+ - We can also use the keyword `AS` to rename output.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ AS monthlySalary
+ FROM employee;
+ ```
+ -
+ - ### Keyword `DISTINCT` #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-08T12:11:39.665Z
+ card-last-reviewed:: 2022-10-04T12:11:39.665Z
+ card-last-score:: 5
+ - The keyword `DISTINCT` automatically removes duplicates from the returned result set.
+ - We should be careful of using with large result sets as it can be an expensive operation to perform (not a problem for our small examples).
+ - ```sql
+ SELECT DISTINCT salary
+ FROM employee;
+ ```
+ - ### Selecting All Attribute Values for Selected Tuples #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:41:40.689Z
+ card-last-reviewed:: 2022-10-07T10:41:40.689Z
+ card-last-score:: 5
+ - To retrieve all attribute values of selected tuples, you do not have to explicitly list all the attribute names - instead, you can use `SELECT *`.
+ - ### New Operators
+ collapsed:: true
+ - `BETWEEN` #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-07T14:32:19.512Z
+ card-last-reviewed:: 2022-10-03T14:32:19.512Z
+ card-last-score:: 5
+ - The `BETWEEN` operator selects values within a given range. The values can be numbers, texts, or dates.
+ - ```sql
+ SELECT
+ FROM
+ WHERE BETWEEN AND ;
+ ```
+ - `IN` #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T12:13:52.063Z
+ card-last-reviewed:: 2022-10-04T12:13:52.063Z
+ card-last-score:: 3
+ - The `IN` operator tests if a data value matches one of a list of values.
+ - It is a shorthand for multiple `OR` conditions.
+ - ```sql
+ SELECT
+ FROM
+ WHERE IN (, , ...);
+
+ -- OR --
+
+ SELECT
+ FROM
+ WHERE IN (SELECT );
+ ```
+ - `LIKE` #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-08T12:25:59.076Z
+ card-last-reviewed:: 2022-10-04T12:25:59.076Z
+ card-last-score:: 5
+ - Allows string comparison, when equality is too strict.
+ - There are 2 wildcards, often used in conjunction with the `LIKE` operator:
+ - The percent sign `%` represents zero, one, or multiple characters.
+ - The underscore sign `_` represents one, single character.
+ - ```sql
+ SELECT
+ FROM
+ WHERE LIKE ;
+ ```
+ - `IS NULL` #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-11T16:12:30.812Z
+ card-last-reviewed:: 2022-09-30T12:12:30.812Z
+ card-last-score:: 5
+ - Allows an explicit search for `NULL`.
+ -
+ -
+ - ### Set Operators
+ - `UNION`
+ - `INTERSECTION`
+ - `MINUS / DIFFERENCE`
+-
+-
+- ```SQL
+ SELECT full_name, ssn FROM (
+ SELECT ssn, CONCAT(fname, " ", minit, " ", lname)
+ AS full_name from employee) AS dtable
+ WHERE full_name IN ("John B Smith", "James E Borg", "Joyce A English");
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML%3A SELECT/2022-09-30T20_40_57.000Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML%3A SELECT/2022-09-30T20_40_57.000Z.Desktop.md
new file mode 100644
index 00000000..780d7833
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML%3A SELECT/2022-09-30T20_40_57.000Z.Desktop.md
@@ -0,0 +1,196 @@
+title:: SQL DML: SELECT
+
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[Introduction to SQL & DDL]]
+- **Next Topic:** [[SQL SELECT: Working with Strings & Subqueries]]
+- **Relevant Slides:** 
+-
+- # Notes on Syntax
+ - While SQL is case insensitive, Linux ^^is not.^^
+ - web1.cs.nuigalway.ie is a ^^linux server^^, so we need to be careful with table names in particular, as `EMPLOYEE` is ^^not the same thing^^ as `employee`.
+ - Attribute names are separated by commas.
+ - Strings are enclosed in quotes.
+ - Numbers are not enclosed in quotes.
+ -
+ - Usually, SQL keywords are capitalised while table & keyword names are mostly kept in lowercase unless using camelCase instead of snake_case.
+ - Code should be organised horizontally & vertically, and not all written on one line.
+ - Code blocks are separated by a semicolon.
+ - Comments can be made using `#`, `--`, & `/* */`.
+-
+- # **CRUD** Operations in DML
+ - What are **CRUD** Operations? #card
+ card-last-interval:: -1
+ card-repeats:: 1
+ card-ease-factor:: 2.5
+ card-next-schedule:: 2022-09-24T23:00:00.000Z
+ card-last-reviewed:: 2022-09-24T17:00:12.767Z
+ card-last-score:: 1
+ - **CRUD** operations are the 4 basic functions that we may wish to perform on *persistent* data.
+ - **Create:** insert a new tuple. `INSERT`
+ - **Read:** retrieve some data. `SELECT`
+ - **Update:** modify some data. `Update`
+ - **Delete:** delete some data or a tuple. `DELETE`
+ - ## Read: `SELECT`
+ - The basic syntax for an SQL select query to *read* data consists of 6 clauses. #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:18:06.301Z
+ card-last-reviewed:: 2022-09-26T12:18:06.301Z
+ card-last-score:: 3
+ - ```sql
+ SELECT [DISTINCT]
+ FROM
+ WHERE
+ GROUP BY
+ HAVING
+ ORDER BY
+ ```
+ - The order of these clauses ^^cannot be changed.^^
+ - `SELECT` & `FROM` are ^^always required^^, other clauses are optional.
+ - ### `SELECT FROM
WHERE ` #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-04T12:12:20.540Z
+ card-last-reviewed:: 2022-09-30T12:12:20.540Z
+ card-last-score:: 5
+ - `` is a list of **attribute** (column) names (separated by commas) whose values will be retrieved by the query.
+ - `
` is a list of table names (separated by commas) containing the attributes.
+ - `` is a **Boolean** expression that identifies the tuples to be retrieved by the query.
+ - For each **tuple** (row) in the table(s) which are part of the query:
+ - the tuple is checked to see if the condition is **true** for this tuple.
+ - If **true**, the tuple **is** part of the output.
+ - If **false**, the tuple is **not** part of the output.
+ - The comparison operators are:
+ - `=` `<=` `<` `>` `>=` `!=`
+ - Conditions can be compounded by use of Boolean `AND`, `OR`, and can be negated with `NOT`.
+ - ^^Note:^^ In some versions of SQL, (e.g., in MS), the `!=` operator is written as `<>`.
+ - ### Calculated or Derived Fields #card
+ collapsed:: true
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:13:51.230Z
+ card-last-reviewed:: 2022-09-26T12:13:51.230Z
+ card-last-score:: 3
+ - We can specify an SQL expression in the `SELECT` clause which can involve **numerical operations** on **numeric** fields and **counting operations** on **non-numeric** fields.
+ - e.g.,
+ - ```sql
+ SELECT ssn, salary/12 FROM employee;
+ ```
+ - ### Tidying Up the Output #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.36
+ card-next-schedule:: 2022-09-30T12:15:08.064Z
+ card-last-reviewed:: 2022-09-26T12:15:08.065Z
+ card-last-score:: 3
+ - We can use keywords `CAST`, `AS`, & `DECIMAL(x, y)` to specify the total number of digits `x` and the number of digits after the decimal point `y` when we're working with **real numbers**.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ FROM employee;
+ ```
+ - We can also use the keyword `AS` to rename output.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ AS monthlySalary
+ FROM employee;
+ ```
+ -
+ - ### Keyword `DISTINCT` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:12:52.222Z
+ card-last-reviewed:: 2022-09-26T12:12:52.223Z
+ card-last-score:: 5
+ - The keyword `DISTINCT` automatically removes duplicates from the returned result set.
+ - We should be careful of using with large result sets as it can be an expensive operation to perform (not a problem for our small examples).
+ - ```sql
+ SELECT DISTINCT salary
+ FROM employee;
+ ```
+ - ### Selecting All Attribute Values for Selected Tuples #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:15:11.914Z
+ card-last-reviewed:: 2022-09-26T12:15:11.915Z
+ card-last-score:: 5
+ - To retrieve all attribute values of selected tuples, you do not have to explicitly list all the attribute names - instead, you can use ```SELECT *```.
+ - ### New Operators
+ collapsed:: true
+ - `BETWEEN` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-26T20:27:09.511Z
+ card-last-reviewed:: 2022-09-22T20:27:09.512Z
+ card-last-score:: 5
+ - The `BETWEEN` operator selects values within a given range. The values can be numbers, texts, or dates.
+ - ```sql
+ SELECT
+ FROM
+ WHERE BETWEEN AND ;
+ ```
+ - `IN` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-30T12:14:02.819Z
+ card-last-reviewed:: 2022-09-26T12:14:02.820Z
+ card-last-score:: 5
+ - The `IN` operator tests if a data value matches one of a list of values.
+ - It is a shorthand for multiple `OR` conditions.
+ - ```sql
+ SELECT
+ FROM
+ WHERE IN (, , ...);
+
+ -- OR --
+
+ SELECT
+ FROM
+ WHERE IN (SELECT );
+ ```
+ - `LIKE` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-26T20:27:37.725Z
+ card-last-reviewed:: 2022-09-22T20:27:37.726Z
+ card-last-score:: 5
+ - Allows string comparison, when equality is too strict.
+ - There are 2 wildcards, often used in conjunction with the `LIKE` operator:
+ - The percent sign `%` represents zero, one, or multiple characters.
+ - The underscore sign `_` represents one, single character.
+ - ```sql
+ SELECT
+ FROM
+ WHERE LIKE ;
+ ```
+ - `IS NULL` #card
+ card-last-interval:: 4
+ card-repeats:: 1
+ card-ease-factor:: 2.6
+ card-next-schedule:: 2022-09-28T17:00:36.501Z
+ card-last-reviewed:: 2022-09-24T17:00:36.502Z
+ card-last-score:: 5
+ - Allows an explicit search for `NULL`.
+ -
+ -
+ - ### Set Operators
+ - `UNION`
+ - `INTERSECTION`
+ - `MINUS / DIFFERENCE`
+-
+-
+- ```SQL
+ SELECT full_name, ssn FROM (
+ SELECT ssn, CONCAT(fname, " ", minit, " ", lname)
+ AS full_name from employee) AS dtable
+ WHERE full_name IN ("John B Smith", "James E Borg", "Joyce A English");
+ ```
\ No newline at end of file
diff --git a/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML%3A SELECT/2022-10-07T18_07_00.027Z.Desktop.md b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML%3A SELECT/2022-10-07T18_07_00.027Z.Desktop.md
new file mode 100644
index 00000000..65139d4d
--- /dev/null
+++ b/second/semester1/logseq-stuff/logseq/bak/pages/SQL DML%3A SELECT/2022-10-07T18_07_00.027Z.Desktop.md
@@ -0,0 +1,192 @@
+title:: SQL DML: SELECT
+
+- #[[CT230 - Database Systems I]]
+- **Previous Topic:** [[SQL DML Statement]]
+- **Next Topic:** [[SQL SELECT: Working with Strings & Subqueries]]
+- **Relevant Slides:** 
+-
+- # Notes on Syntax
+ - While SQL is case insensitive, Linux ^^is not.^^
+ - web1.cs.nuigalway.ie is a ^^linux server^^, so we need to be careful with table names in particular, as `EMPLOYEE` is ^^not the same thing^^ as `employee`.
+ - Attribute names are separated by commas.
+ - Strings are enclosed in quotes.
+ - Numbers are not enclosed in quotes.
+ -
+ - Usually, SQL keywords are capitalised while table & keyword names are mostly kept in lowercase unless using camelCase instead of snake_case.
+ - Code should be organised horizontally & vertically, and not all written on one line.
+ - Code blocks are separated by a semicolon.
+ - Comments can be made using `#`, `--`, & `/* */`.
+-
+- # **CRUD** Operations in DML
+ - What are **CRUD** Operations? #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-11T10:21:09.621Z
+ card-last-reviewed:: 2022-10-07T10:21:09.622Z
+ card-last-score:: 3
+ - **CRUD** operations are the 4 basic functions that we may wish to perform on *persistent* data.
+ - **Create:** insert a new tuple. `INSERT`
+ - **Read:** retrieve some data. `SELECT`
+ - **Update:** modify some data. `Update`
+ - **Delete:** delete some data or a tuple. `DELETE`
+ - ## Read: `SELECT`
+ - The basic syntax for an SQL select query to *read* data consists of 6 clauses. #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.22
+ card-next-schedule:: 2022-10-08T12:16:16.550Z
+ card-last-reviewed:: 2022-10-04T12:16:16.551Z
+ card-last-score:: 3
+ - ```sql
+ SELECT [DISTINCT]
+ FROM
+ WHERE
+ GROUP BY
+ HAVING
+ ORDER BY
+ ```
+ - The order of these clauses ^^cannot be changed.^^
+ - `SELECT` & `FROM` are ^^always required^^, other clauses are optional.
+ - ### `SELECT FROM
WHERE ` #card
+ card-last-interval:: 11.2
+ card-repeats:: 3
+ card-ease-factor:: 2.8
+ card-next-schedule:: 2022-10-17T13:42:05.898Z
+ card-last-reviewed:: 2022-10-06T09:42:05.898Z
+ card-last-score:: 5
+ - `` is a list of **attribute** (column) names (separated by commas) whose values will be retrieved by the query.
+ - `
` is a list of table names (separated by commas) containing the attributes.
+ - `` is a **Boolean** expression that identifies the tuples to be retrieved by the query.
+ - For each **tuple** (row) in the table(s) which are part of the query:
+ - the tuple is checked to see if the condition is **true** for this tuple.
+ - If **true**, the tuple **is** part of the output.
+ - If **false**, the tuple is **not** part of the output.
+ - The comparison operators are:
+ - `=` `<=` `<` `>` `>=` `!=`
+ - Conditions can be compounded by use of Boolean `AND`, `OR`, and can be negated with `NOT`.
+ - ^^Note:^^ In some versions of SQL, (e.g., in MS), the `!=` operator is written as `<>`.
+ - ### Calculated or Derived Fields #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T12:13:30.296Z
+ card-last-reviewed:: 2022-10-04T12:13:30.297Z
+ card-last-score:: 5
+ - We can specify an SQL expression in the `SELECT` clause which can involve **numerical operations** on **numeric** fields and **counting operations** on **non-numeric** fields.
+ - e.g.,
+ - ```sql
+ SELECT ssn, salary/12 FROM employee;
+ ```
+ - ### Tidying Up the Output #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T12:15:11.672Z
+ card-last-reviewed:: 2022-10-04T12:15:11.673Z
+ card-last-score:: 5
+ - We can use keywords `CAST`, `AS`, & `DECIMAL(x, y)` to specify the total number of digits `x` and the number of digits after the decimal point `y` when we're working with **real numbers**.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ FROM employee;
+ ```
+ - We can also use the keyword `AS` to rename output.
+ - ```sql
+ SELECT ssn, CAST(salary/12.0 AS DECIMAL(8,2))
+ AS monthlySalary
+ FROM employee;
+ ```
+ -
+ - ### Keyword `DISTINCT` #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-08T12:11:42.208Z
+ card-last-reviewed:: 2022-10-04T12:11:42.208Z
+ card-last-score:: 5
+ - The keyword `DISTINCT` automatically removes duplicates from the returned result set.
+ - We should be careful of using with large result sets as it can be an expensive operation to perform (not a problem for our small examples).
+ - ```sql
+ SELECT DISTINCT salary
+ FROM employee;
+ ```
+ - ### Selecting All Attribute Values for Selected Tuples #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-11T10:41:26.643Z
+ card-last-reviewed:: 2022-10-07T10:41:26.644Z
+ card-last-score:: 5
+ - To retrieve all attribute values of selected tuples, you do not have to explicitly list all the attribute names - instead, you can use ```SELECT *```.
+ - ### New Operators
+ - `BETWEEN` #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.7
+ card-next-schedule:: 2022-10-07T14:32:09.742Z
+ card-last-reviewed:: 2022-10-03T14:32:09.742Z
+ card-last-score:: 5
+ - The `BETWEEN` operator selects values within a given range. The values can be numbers, texts, or dates.
+ - ```sql
+ SELECT
+ FROM
+ WHERE BETWEEN AND ;
+ ```
+ - `IN` #card
+ card-last-interval:: 4
+ card-repeats:: 2
+ card-ease-factor:: 2.46
+ card-next-schedule:: 2022-10-08T12:13:54.146Z
+ card-last-reviewed:: 2022-10-04T12:13:54.147Z
+ card-last-score:: 3
+ - The `IN` operator tests if a data value matches one of a list of values.
+ - It is a shorthand for multiple `OR` conditions.
+ - ```sql
+ SELECT