To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
-[ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-[ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-[ ] [Set up project integrations](https://git.ucsc.edu/awaghili/cse138-final-study-quiz/-/settings/integrations)
## Collaborate with your team
-[ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-[ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-[ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
Use the built-in continuous integration in GitLab.
-[ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
-[ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-[ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-[ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-[ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
user_input=input("Press Enter to continue to the next question, or type 's' to mark this question as answered (and skip in the future): ").strip().lower()
ifuser_input=="s":
save_answered(item.question_text)
answered_set.add(item.question_text)
print(f"End of section: {self.title}\n")
defrun_quiz(sections):
answered_set=load_answered()
forsectioninsections:
section.run_section(answered_set)
print("Quiz finished!")
clocks=[
QuizItem(
question_text="What is a Logical Clock?",
answer_text="An abstract mechanism to assign a value to events to provide a notion of ordering",
),
QuizItem(
question_text="What are the three key mechanisms for a logical clock",
answer_text="1) How to incorporate an event into a clock \n 2) How to merge two clocks \n 3) How to compare two clocks?",
),
QuizItem(
question_text="What are the two most common logical clocks?",
answer_text="Lamport Clock and Vector Clock",
),
QuizItem(
question_text="How does a Lamport Clock implement the three key mechanisms?",
answer_text="1) Incorporation: increment the integer \n 2) Merging: Take the max of between two integers \n 3) Comparison: use < operator",
),
QuizItem(
question_text="How does a Vector Clock implement the three key mechanisms?",
answer_text="1) Incorporation: increment the position in the vector of the host where the event occured \n 2) Merging: Pairwise max of the two vector clocks \n 3) Comparison: VC > VC' <=> (forall i: VC_i >= VC'_i) and (exists j: VC_j > VC'_j)",
),
QuizItem(
question_text="What type of ordering is a vector clock?",
answer_text="Strict Partial Order",
),
QuizItem(
question_text="What type of ordering is a lamport clock (after breaking ties)?",
answer_text="Total Order",
),
]
happens_before=[
QuizItem(
question_text="What is the formal definition of A happens before B (A -> B)",
answer_text="A is a potential cause of B",
),
QuizItem(
question_text="What type of ordering is happens before?",
answer_text="strict partial order",
),
QuizItem(
question_text="If neither A->B nor B->A holds, then what can be said about the relation of A and B?",
answer_text="A || B",
),
QuizItem(
question_text="For the given vector clocks: \n A = [1 4 15] \n B = [3 1 2] \n C = [5 4 18] \n What can be said about the relationship between these events. Why?",
answer_text="""\n1) C > A (A -> C) because for all i in N (where N is # of nodes), C[i] >= A[i] and there exists a j in N such that C[j] > A[j]
\n2) C > B (B -> C) because for all i in N (where N is # of nodes), C[i] >= B[i] and there exists a j in N such that C[j] > B[j]
\n3) C is concurrent with B (B || C) because there exists i in N such that A[i] > B[i] and there exists j in N such that B[j] > A[j].""",
),
QuizItem(
question_text="For two events A and B, we know A->B if... (What are the three conditions for a happens before relationship to be established?)",
answer_text="""\n1) A and B are events on the same timeline, with B happening further down the timeline than A (Note: You can always establish a total order on the same timeline)
\n2) A is a message being sent, B is the same message being received
\n3) There exist an event C such that A->C, and C->B (Transitive property)
"""
),
QuizItem(
question_text="What are the conditions for both the lamport and vector clock for happens before relationship to hold",
answer_text="1) Lamport Clock: A -> B => LC(A) < LC (B) (and similarly) LC(A) > LC(B) => A not -> B \n 2) Vector Clock A -> B <=> VC(A) < VC(B)"
),
QuizItem(
question_text="If A || B and B || C, is A || C?",
answer_text="No, concurrency is not transitive."
),
]
fifo=[
QuizItem(
question_text="What is the formal definition of the FIFO Property?",
answer_text="If Host A sends messages X then Y to Host B => B delivers X, then Y."
),
]
causal_delivery=[
QuizItem(
question_text="What is the formal defintition of the Causal Property?",
answer_text="If A and B are messages, and A->B => Any host delivering A and B delivers A first.",
),
QuizItem(
question_text="What type of property (safety vs liveness) is causal delivery?",
answer_text="Safety Property (A violation has a finite witness)",
),
QuizItem(
question_text="Draw a Lamport Diagram which shows a violation of causal delivery but no FIFO delivery.",
answer_text="",
answer_image="./causal_violation_fifo.png",
)
]
orderings=[]
snapshot=[]
network_models=[
QuizItem(
question_text="What are the two main network models?",
answer_text="1. Asynchronous \n 2.Synchronous",
),
QuizItem(
question_text="What is the definition of the synchronous model?",
answer_text="There is an upper bound T on message delivery and processing time (this implies that time can be used as a failure detector)",
),
QuizItem(
question_text="What is the definition of the asynchronous model",
answer_text="There does not exists an upper bound T (as defined in the synchronous model)",
),
]
fault_models=[
QuizItem(
question_text="What are the five fault models and what do they say?",
answer_text="1. None: No Failure \n 2. Fail-Stop: Detectable failures \n 3. Crash: Failures but not entirely detectable \n 4. Omission: Messages may be lost \n 5. Byzantine: Anything can happen",
),
]
protocol_properties=[
QuizItem(
question_text="What is a Safety Property?",
answer_text="A safety property is a proterty in which a bad things never happens in a system. If the property is violated, there exists a finite witness that demonstrates the failure. You can point to a specific point in time in which the property was not upheld.",
),
QuizItem(
question_text="What is a Liveness Property?",
answer_text="Ensure that a good thing eventually happens in a system. If liveness is violated, there does not exist a finite witness of the failure, it requires infinite non-progress to be violated.",
),
]
reliable_delivery=[
QuizItem(
question_text="What is the formal definition of reliable delivery?",
answer_text="If a host A sends a message M to host B, and not all messages are dropped, then B eventually delivers M",
),
QuizItem(
question_text="Is reliable delivery a safety or liveness property? Why?",
answer_text="A liveness property since the message will *eventually* be delivered if not all messages are dropped.",
),
QuizItem(
question_text="What is an example way to implement a reliable delivery protocol?",
answer_text="Repeatedly send a message (using some delay mechanism) until it has been acknowledged.",
),
QuizItem(
question_text="How do you maintain exactly-once delivery when employing a reliable delivery protocol?",
answer_text="A liveness property since the message will eventually be delivered if not all messages are dropped.",
),
QuizItem(
question_text="What is the definition of idempotency?",
answer_text="Sending a message multiple times should have the same effect as if it was sent once.",
),
QuizItem(
question_text="How would you implement an exactly-once delivery protocol?",
answer_text="",
),
]
reliable_broadcast=[]
consistency=[
QuizItem(
question_text="What is are the three main types of consistency studied in class?",
question_text="What type of property is Strong Consistency? Why?",
answer_text="Strong Consistency is a safety property since a violation would require a fitness witness of the system behaving differently from a non-distributed system.",