Skip to content

Commit

Permalink
Update Thu Jun 3 18:00:57 PDT 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
zedchance committed Jun 4, 2021
1 parent 300d6cf commit 6668831
Show file tree
Hide file tree
Showing 632 changed files with 239,872 additions and 2,580 deletions.
41 changes: 41 additions & 0 deletions content/CS133/CS133-lecture-20210519.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: "CS133-lecture-20210519"
# date: 2021-05-19T09:43:57-07:00
draft: false
bookToc: true
tags: ["app distribution"]
---

## Mobile development – App distribution

![image_2021-05-19-09-45-48](/notes/image_2021-05-19-09-45-48.png)
![image_2021-05-19-09-46-25](/notes/image_2021-05-19-09-46-25.png)

### Certificates, UDID, signing authorities

![image_2021-05-19-09-47-38](/notes/image_2021-05-19-09-47-38.png)
![image_2021-05-19-09-48-15](/notes/image_2021-05-19-09-48-15.png)
![image_2021-05-19-09-49-13](/notes/image_2021-05-19-09-49-13.png)

### Signing and distribution

![image_2021-05-19-09-50-43](/notes/image_2021-05-19-09-50-43.png)
![image_2021-05-19-09-51-38](/notes/image_2021-05-19-09-51-38.png)
![image_2021-05-19-09-52-21](/notes/image_2021-05-19-09-52-21.png)
![image_2021-05-19-09-55-22](/notes/image_2021-05-19-09-55-22.png)
![image_2021-05-19-09-55-59](/notes/image_2021-05-19-09-55-59.png)
![image_2021-05-19-09-56-54](/notes/image_2021-05-19-09-56-54.png)
![image_2021-05-19-09-57-43](/notes/image_2021-05-19-09-57-43.png)

### Building native apps using CN1

![image_2021-05-19-09-58-07](/notes/image_2021-05-19-09-58-07.png)
![image_2021-05-19-09-58-49](/notes/image_2021-05-19-09-58-49.png)
![image_2021-05-19-10-00-07](/notes/image_2021-05-19-10-00-07.png)
![image_2021-05-19-10-00-21](/notes/image_2021-05-19-10-00-21.png)

### Downloading/installing native apps

![image_2021-05-19-10-01-18](/notes/image_2021-05-19-10-01-18.png)
![image_2021-05-19-10-03-01](/notes/image_2021-05-19-10-03-01.png)

52 changes: 52 additions & 0 deletions content/CS134/CS134-lecture-20210601.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: "CS134-lecture-20210601"
# date: 2021-06-01T11:34:27-07:00
draft: false
bookToc: true
tags: ["syllabus", "DBMS"]
---

# Course orientation

## Syllabus

{{< hint info >}}
[134Sy_Summer2021.pdf](/notes/134Sy_Summer2021.pdf)
{{< /hint >}}

## Notes during orientation

- 5 assignments, 5 weekly homeworks
- Effort may be taken into account during assignment grading
- Assignments build upon the previous assignment
- Midterm on June 22, and final on last day

## Introduction to database management systems

![image_2021-06-02-09-30-55](/notes/image_2021-06-02-09-30-55.png)
![image_2021-06-02-09-34-14](/notes/image_2021-06-02-09-34-14.png)

{{< columns >}}
Files
- persistent
- on disk
- easy to work with
<--->
DBMS
- needs knowledge of software
- needs to design database structure
- can handle more complex situations
{{< /columns >}}

Imagine we have 2 different files: `student_info` and `grade_record`

![image_2021-06-02-09-38-24](/notes/image_2021-06-02-09-38-24.png)

Notice the duplication among the 2 files.
This will waste storage if using a normal file system.
There may also be inconsistencies between the 2 files if only 1 is changed.
DBMS can control all of these things for you.

![image_2021-06-02-09-45-17](/notes/image_2021-06-02-09-45-17.png)
![image_2021-06-02-10-04-16](/notes/image_2021-06-02-10-04-16.png)

166 changes: 166 additions & 0 deletions content/CS134/CS134-lecture-20210602.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
---
title: "CS134-lecture-20210602"
# date: 2021-06-02T16:16:01-07:00
draft: false
bookToc: true
tags: ["DBMS", "ER model"]
---

## DBMS cont.

### Database users

![image_2021-06-02-16-30-56](/notes/image_2021-06-02-16-30-56.png)

If we're storing student information in a database, we'll have fields such as

- age
- birthdate

If we want to store one in the database, which should we pick?
Why only one?

We should choose the birthdate because
- we can derive the age
- birthdate is also more accurate of a measure of age
- we won't need to increment the age in the database every year

What is the disadvantage of saving both?
- we don't want to waste space when we can derive the age from the birthdate.
- if we save both we have to make sure they are consistent.
In other words: we would have to increment the age on the birthdate.

For end users:
- casual end users: need to use a sophisticated database query language, like SQL
- naive users: use a menu-driven interface
- sophisticated end users: familiar with DBMS to implement their applications

### Data models

![image_2021-06-02-16-41-38](/notes/image_2021-06-02-16-41-38.png)

High level models
- ER, entity-relationship model, best for relational database
- UML

Representational / implementation model
- relational data model, uses relational database
- object data model, O-O, O-R
- network and hierarchical model, uses graph model

### DBMS architecture and data independency

![image_2021-06-02-16-48-52](/notes/image_2021-06-02-16-48-52.png)

At the conceptual schema level, the user doesn't necessarily know the exact implementation of the internal schema level.

### Database languages

![image_2021-06-02-16-51-02](/notes/image_2021-06-02-16-51-02.png)

SQL is a comprehensive integrated language of DDL and DML for relational databases.

## Entity-relationship model

![image_2021-06-02-16-56-12](/notes/image_2021-06-02-16-56-12.png)

{{< hint info >}}
Note: ER diagram notation can change based on different textbooks.
We will use the original notation that is used in our text book.
{{< /hint >}}

### Entity and attributes

![image_2021-06-02-16-58-12](/notes/image_2021-06-02-16-58-12.png)

Properties can be used to describe the entity.
For example for a student:

![image_2021-06-02-16-59-55](/notes/image_2021-06-02-16-59-55.png)
![image_2021-06-02-17-00-37](/notes/image_2021-06-02-17-00-37.png)
![image_2021-06-02-17-02-41](/notes/image_2021-06-02-17-02-41.png)
![image_2021-06-02-17-03-00](/notes/image_2021-06-02-17-03-00.png)

On notation:
- entities are in rectangles
- attributes are circled and connected to the entity

![image_2021-06-02-17-04-05](/notes/image_2021-06-02-17-04-05.png)

The divisibility of an attribute depends on application.
We can divide address into subparts:

![image_2021-06-02-17-06-19](/notes/image_2021-06-02-17-06-19.png)

Here, address is the composite attribute.
Name can also be composite.

![image_2021-06-02-17-08-34](/notes/image_2021-06-02-17-08-34.png)

![image_2021-06-02-17-10-50](/notes/image_2021-06-02-17-10-50.png)

Students can only have 1 birthdate, but they can have multiple phone numbers.
We can indicate that by a double circle.

![image_2021-06-02-17-11-07](/notes/image_2021-06-02-17-11-07.png)

![image_2021-06-02-17-13-37](/notes/image_2021-06-02-17-13-37.png)

Since age can be calculated from the birthdate, we can put the age attribute in the ER diagram, but we indicate it can be derived with a dashed line.

![image_2021-06-02-17-15-10](/notes/image_2021-06-02-17-15-10.png)

![image_2021-06-02-17-16-46](/notes/image_2021-06-02-17-16-46.png)

### ER diagram notation

![image_2021-06-02-17-18-13](/notes/image_2021-06-02-17-18-13.png)

### Keys

![image_2021-06-02-17-18-42](/notes/image_2021-06-02-17-18-42.png)

- must be a unique identifier

We underline the attribute name to indicate that it is the key

![image_2021-06-02-17-20-52](/notes/image_2021-06-02-17-20-52.png)

If we have an entity called classroom:

![image_2021-06-02-17-23-06](/notes/image_2021-06-02-17-23-06.png)

We can use a composite key of the attributes building and roomNo.

![image_2021-06-02-19-16-30](/notes/image_2021-06-02-19-16-30.png)

Keys must be minimal.
In other words: adding capacity to the composite key for the classroom model wouldn't add anything beneficial.

### Value sets

![image_2021-06-02-19-21-21](/notes/image_2021-06-02-19-21-21.png)

### ER diagram example

![image_2021-06-02-19-24-48](/notes/image_2021-06-02-19-24-48.png)
![image_2021-06-02-19-28-01](/notes/image_2021-06-02-19-28-01.png)

### Relationship

![image_2021-06-02-19-33-02](/notes/image_2021-06-02-19-33-02.png)

Relationships are drawn using a diamond.

![image_2021-06-02-19-35-20](/notes/image_2021-06-02-19-35-20.png)
![image_2021-06-02-19-36-36](/notes/image_2021-06-02-19-36-36.png)
![image_2021-06-02-19-37-55](/notes/image_2021-06-02-19-37-55.png)

### Structure constraint

![image_2021-06-02-19-38-37](/notes/image_2021-06-02-19-38-37.png)
![image_2021-06-02-19-39-23](/notes/image_2021-06-02-19-39-23.png)
![image_2021-06-02-19-40-41](/notes/image_2021-06-02-19-40-41.png)
![image_2021-06-02-19-43-34](/notes/image_2021-06-02-19-43-34.png)
![image_2021-06-02-19-45-01](/notes/image_2021-06-02-19-45-01.png)

88 changes: 88 additions & 0 deletions content/CS134/CS134-lecture-20210603.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: "CS134-lecture-20210603"
# date: 2021-06-03T16:27:55-07:00
draft: false
bookToc: true
tags: ["ER model"]
---

## ER model cont.

### Structure constraint cont.

![image_2021-06-03-16-33-28](/notes/image_2021-06-03-16-33-28.png)
![image_2021-06-03-16-38-40](/notes/image_2021-06-03-16-38-40.png)
![image_2021-06-03-16-38-45](/notes/image_2021-06-03-16-38-45.png)
![image_2021-06-03-16-39-39](/notes/image_2021-06-03-16-39-39.png)

The reason we have both {{<k>}} M {{</k>}} and {{<k>}} N {{</k>}} is because they are are both in the same association.
It is okay to reuse {{<k>}} M {{</k>}} in other places in the diagram.

![image_2021-06-03-16-44-19](/notes/image_2021-06-03-16-44-19.png)
![image_2021-06-03-16-44-36](/notes/image_2021-06-03-16-44-36.png)
![image_2021-06-03-16-50-35](/notes/image_2021-06-03-16-50-35.png)

{{< hint info >}}
Note: The double line from `employee` to `works_for` indicates the total participation.
{{< /hint >}}

### Weak entity

![image_2021-06-03-16-58-18](/notes/image_2021-06-03-16-58-18.png)

Entity has
- key
- instance

![image_2021-06-03-17-08-02](/notes/image_2021-06-03-17-08-02.png)

In this diagram, we don't necessarily know what key we should use for the `dependent` entity.
We need to treat `dependent` as a weak entity, indicated by a double box, also note the total participation association.

![image_2021-06-03-17-12-13](/notes/image_2021-06-03-17-12-13.png)

We can use a partial key of the `employee`'s key plus the `dependent`'s name, indicated by a dashed line.

![image_2021-06-03-17-14-20](/notes/image_2021-06-03-17-14-20.png)

### Attributes of relationship types

![image_2021-06-03-17-19-31](/notes/image_2021-06-03-17-19-31.png)
![image_2021-06-03-17-21-45](/notes/image_2021-06-03-17-21-45.png)
![image_2021-06-03-17-25-13](/notes/image_2021-06-03-17-25-13.png)

{{< hint info >}}
Note: We could optionally have `mgr_start_date` belong to either entity, because it is a 1:1 relationship.
{{< /hint >}}

If one entity, say `department`, has total participation, it is better to have `mgm_start_date` belong to that entity.
(If we had `mgr_start_date` belong to `employee`, then all except 1 `employee`s would have a null attribute, thus it is better to have the `department` hold the attribute.)

![image_2021-06-03-17-32-35](/notes/image_2021-06-03-17-32-35.png)

We have 2 choices for the `emp_start_date` attribute, it can either belong to the `employee` or the `works_for` association.

### Recursive relationships

![image_2021-06-03-17-35-20](/notes/image_2021-06-03-17-35-20.png)

### Non-binary relationship

![image_2021-06-03-17-40-11](/notes/image_2021-06-03-17-40-11.png)

{{< hint danger >}}
Non-binary relationships will **not** be on exams/assignments.
{{< /hint >}}

## A bigger ER diagram example

![image_2021-06-03-17-42-26](/notes/image_2021-06-03-17-42-26.png)

## In class exercise

{{< hint info >}}
Note: This exercise is not included in the week 1 assignment.
{{< /hint >}}

1. The university keeps track of each student's name (first name, middle name, last name), student number, social security number, permanent address and phone, birthdate, sex, class (e.g. freshman, sophomore, ..., graduate), and degree program (e.g. B.A., B.S., ..., Ph.D.). Some user applications need to refer to the street, city, state, and zip of the student's permanent address, and to the student's last name. Both social security number and student number have unique values for each student.

10 changes: 10 additions & 0 deletions content/CS134/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "CS134"
# date: 2021-05-14T18:39:36-07:00
bookCollapseSection: true
weight: 1
---

# CS134 – Database Management Systems

{{<section>}}
2 changes: 1 addition & 1 deletion content/CS135/CS135-lecture-20210225.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ To test this:
We can also define a nicer method for the user:

```rkt
(define (fact x) (fact-helper x))
(define (fact x) (fact-helper x 1))
```

So now we can call it like this:
Expand Down
2 changes: 1 addition & 1 deletion content/CS138/CS138-lecture-20210504.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "CS138-lecture-20210504"
# date: 2021-05-04T08:43:10-07:00
draft: false
bookToc: true
tags: ["LAN", "data centers"]
tags: ["LAN", "data centers", "review"]
---

## LAN cont.
Expand Down
10 changes: 10 additions & 0 deletions content/CS139/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "CS139"
# date: 2021-05-14T18:44:06-07:00
bookCollapseSection: true
weight: 1
---

# CS139 – Operating System Principles

{{<section>}}

0 comments on commit 6668831

Please sign in to comment.