Wednesday, January 10th, 2024
Through pride we are ever deceiving ourselves. But deep down below the surface of the average conscience a still, small voice says to us, something is out of tune.
— Carl Jung
- PostgreSQL database object (e.g. unique constraint) naming convention: StackOverflow
- PortSwigger Web Security Academy
- I should probably continue doing this (thanks Lance for reminding me in Discord announcement XD). Seems like the site got an overhaul.
- I’m more interested in API testing, so that’s where I’ll start.
MUS106 Discussion 1: Intro & BeepBox Project
- song listening session
- ”Ward Riders”
- distorted, powerful
- very active bass drum
- energetic
- ”Make it Right”
- began with syncopated rhythm section (drums)
- synthesized sounds
- 6/8
- chorus, harmonized vocals in bridge section
- use of sampled vocals
- similarities
- percussion (drums)
- groove-oriented
- ”Ward Riders”
- contrast 2 songs
- BeepBox project
- 2 phrases minimum per track, 4 vertical phrases total
ECS165A Lecture 2: Intro to DBMS
- typical DBMS functionalities
- maintenance
- access control
- transaction
- concurrent access
- versioning
- persistence & recovery
- logging
- indexing & query optimization
- …
- Why DBMS?
- DBMS helps provide an abstraction layer between application and data—modifying / improving the database software should not affect the application code, i.e. DBMS enables lower coupling.
- Reduces application development time: no need to worry about data access.
- Data integrity & security guarantees (e.g. via limiting privileges)
- Universal interface for data adminstration across all databases & applications
- Concurrent access with crash recovery: DBMS uses in-memory pages/cache to prevent having to write the disk every time. This protects the database file from being corrupted during concurrent access.
- There’s a need for specialized database software, e.g. videos, Human Genome project, etc.
- making a database
ECS122A Lecture 2: Recurrence via Substitution
Basic Terminology
- Assume RAM has cells that store -bit integer, where (i.e. bits can store ). An algorithm’s memory usage is described as the number of such cells used.
- primitive operation
- arithmetic/logic
- memory read/write
- dereference pointer
- branching
- running time
- desirable scaling property
- poly-time
- types of algorithm analysis
- algorithm growth terminology
- asymptotic analysis of log bases
- divide and conquer
Recurrences
- recurrence
- useful formulas to “solve” recurrence (i.e. transform a recurrence into a closed-form expression)
- solving recurrence (find upper bound for a recurrence)
- via substitution
- via recursion tree
- via master theorem
ECS122A quiz 1 study guide
Caution: Answers might be wildly wrong XD
Q1
Prove that
Use the definition of big-Theta notation. Find that makes and that makes .
Guess a constant , we need to find such that this relationship is true for .
For , left-hand side is , whereas the right-hand side is , so the inequality holds from now on. Technically induction is needed, but I’m too lazy for this.
For the other constant:
Guess a constant , we need to find such that the relationship is true for .
For , left-hand side is , and the right-hand side is , so the inequality holds for .
Q2
Prove via limit lemma
Assuming the is the natural log for simplicity.
Since and , .
Q3 i)
Prove via limit lemma that
Assuming is the natural log.
Since , via the limit lemma.
Q3 ii)
Can you prove for some ? Explain why or why not.
Yes, this works for . For instance, given , we have:
Since , we know via limit lemma.
is sublinear time, so we know that this works for all .
Q4 i-iii
Provide sample code for i-iii i) ii) iii)
Skipped.
Q4 iv
Write a recurrence for the code below:
Each problem has one subproblem foo(n/2)
and has some work with time complexity . We can write the recurrence as .
Q5
i) Write pseudocode that lists the subsets of an array of ints. ii) Write psuedocode finds the smallest number of an array of ints. iii) Write psudedocode the list all possible substring of a string S. iv) Given you have two sort lists write pseudocode that returns a new merged sorted
Since we’re working on divide and conquer, I used recursion as much as possible. The code is quite literally crap.
i)
ii)
iii)
iv)