Skip to content

Commit b129c10

Browse files
tofergreggCS107E BOT
authored andcommitted
released a0
commit 31874dd692f0aaa724c93387c15ca29d4cb74c28 Author: Chris Gregg <[email protected]> Date: Thu Jan 9 12:12:14 2025 -0800 released a0
1 parent 4bdf8b3 commit b129c10

File tree

2 files changed

+176
-1
lines changed

2 files changed

+176
-1
lines changed

_data/unreleased.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
permalink,title,released
2-
"/assignments/assign0/","Assignment 0: Git oriented",false
32
"/assignments/assign1/","Assignment 1: Larson Scanner",false
43
"/assignments/assign2/","Assignment 2: Clock",false
54
"/assignments/assign3/","Assignment 3: String Formatting",false

assignments/assign0/README.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
---
2+
released: true
3+
permalink: /assignments/assign0/
4+
title: "Assignment 0: Git oriented"
5+
attribution: Assignment written by Maria Paula Hernandez, CS107e TA
6+
7+
toc: true
8+
---
9+
10+
{% comment %}
11+
Task list to copy/paste when creating PR for this assign:
12+
13+
**Before releasing assign0:**
14+
15+
- [ ] Review writeup/starter files/process (TA)
16+
- [ ] Followup on issues from previous quarter postmortem ()
17+
18+
**To prep for assign0:**
19+
20+
- [ ]
21+
22+
{% endcomment %}
23+
24+
25+
{% include duedate.html n=0 %}
26+
27+
<small>This assignment is not for a grade, but it's critical that you complete it on-time and understand the steps in the workflow you will be using for all assignments. If you run into troubles, please reach out on Ed or come by office hours!</small>
28+
29+
## Goals
30+
31+
Your goal for this assignment is two-fold:
32+
33+
1. Walk through and understand the git workflow we use in this course
34+
2. Practice with your tools and refresh on background concepts
35+
36+
This assignment will give you practice with the standard tasks of getting starter code, editing files,
37+
committing changes, and submitting your work.
38+
39+
Have our <a href="/guides/cs107e-git#assignment-workflow" target="gwg">Git Workflow Guide</a> open in another browser tab. You will be following along with the section "Assignment Workflow" of the guide.
40+
41+
## Steps
42+
43+
### 0. Choose your editor and configure for use with git
44+
45+
In Lab 0, we asked you to explore text editors like vim and emacs. You
46+
will be making heavy use of your chosen editor, so now is a good time to invest in
47+
becoming comfortable and efficient with it. This can be in the form of
48+
watching tutorial videos, reading manuals, bringing questions to OH, sharing tips with
49+
each other, and practicing on your own.
50+
51+
Some git commands automatically open a text editor on your behalf. If you have not set an editor
52+
in your git config, it uses a default choice. Which editor does git use as its default?
53+
Is this your preferred editor? If it is not, you can configure git to use the editor you prefer with the following command:
54+
55+
```console
56+
$ git config --global core.editor [NAME-OF-YOUR-PREFERRED-EDITOR]
57+
```
58+
59+
### 1. Pull starter code
60+
61+
To get the starter files, follow the instructions "Pull assignment starter code" in the <a href="/guides/cs107e-git#pull-assignment-starter-code" target="gwg">Git Workflow Guide</a>.
62+
63+
Pulling the starter code adds a new subfolder named `assign0` to your `mycode` repo.
64+
This folder contain the starter files for the assignment.
65+
66+
### 2. Answer background questions
67+
68+
In the `assign0` subfolder, find the file named `background.txt` and open it in your editor.
69+
70+
Add answers to the following questions. Make sure each your response is clearly labeled (i.e.
71+
we know what question it corresponds to) and reasonably organized.
72+
73+
> **Tip** If you're stuck on any of the questions, take a look at the guides section
74+
> of the course website, post on Ed, or start reading some articles online!
75+
> {: .callout-info}
76+
77+
1. What is the result of performing a bitwise OR of the following two
78+
hexadecimal numbers (include the result in decimal): `0x0f OR 0xff`. Now left
79+
shift that number by 24; what is the result in hexadecimal? Assume numbers are 32-bit.
80+
81+
2. How many milliamperes of current will flow through a 1.5K resistor connected
82+
to 3V on one end and 0V (Ground) on the other end?
83+
84+
3. Find a file in the directory `/etc` on your computer; tell us the name of the
85+
file and the number of bytes contained in that file. How many files and
86+
directories are contained in the first level of directory `/etc`? Show the
87+
the commands you used to answer this question.
88+
89+
4. Explain difference between an absolute and relative path.
90+
91+
5. What do `~`, `.`, `..`, represent? What happens when you pass them as arguments to the `cd` command?
92+
93+
6. Change directory to your `mycode` repo and find the folder named `cs107e`. What is
94+
the absolute path to this folder? How can you quickly change to this directory using the
95+
`CS107E` environment variable you created during your environment setup? Poke around
96+
in the `cs107e` folder to familiarize yourself to what files it contains. Try out the `pinout.py` command.
97+
98+
7. What editor are you using? What is your plan on learning
99+
how to best use your chosen editor? (i.e. for people using vim, you can run the `vimtutor` command from your terminal). Confirm you have configured git to use your chosen editor.
100+
101+
8. Explain what it means to have something on `$PATH`.
102+
103+
9. Start planning the arrangement of windows and tools you are going to want in your environment and the workflow you will use.
104+
We want you to come up with a setup that works for you, for sure you want to be able to keep
105+
multiple terminals open, i.e edit code in one window and compile/execute in another without ever closing out your editor.
106+
We cannot stress enough how much time and pain this will save you. Also, learn the key bindings so you can quickly switch between your code and your shell, without reaching for your mouse.
107+
Tell us what your setup you are using and the commands to switch between windows/tabs/panes.
108+
109+
10. Unix has many many useful commands, below is a list of a few that we feel everyone should know.
110+
You can run `man [command]` in your terminal to see the manual page and learn more.
111+
For each command give us a short description of what it does (in your own words) and an example of how you would use it.
112+
If there are options for the command try a few out and tell us about any you think would be useful
113+
(i.e `rm` has an option `-r` which makes `rm` recursive allowing you to delete a directory not just a file.
114+
Be careful with that one btw, there's no getting your directory back!).
115+
Commands to know: `cd`, `pwd`, `ls`, `cat`, `mkdir`, `rmdir`, `touch`, `rm`, `echo`.
116+
117+
11. Type the prefix of a valid command into the shell and stop half-way and type Tab. What happens? Try using tab complete when entering with the path argument to a command such as `cd`.
118+
119+
12. Again start typing in a command, before finishing this time hit `ctrl-c` , what happens?
120+
121+
13. Try running `sleep 10`, then enter `ctrl-c` , what happens?
122+
123+
14. What does `ctrl-r` do in terminal and why is this useful? How about the up arrow ?
124+
125+
15. In git speak, what is a "commit"? What is a "branch"?
126+
If you're unsure, refer to our [git guide](/guides/git).
127+
128+
16. If there are resources (tutorials, blogs, videos, books, etc.) that you are finding particularly helpful as you get oriented with the environment and tools, tell us about them here and please share with everyone on our Ed forum!
129+
130+
Save your edits to `background.txt` and exit your editor.
131+
132+
### 3. Commit your changes locally and push to remote
133+
134+
Follow the instructions in "Assignment commit" of the <a href="/guides/cs107e-git#assignment-commit" target="gwg">Git Workflow Guide</a> to `git commit` a local snapshot, followed by `git push` to sync those changes to your remote repo.
135+
136+
After you do this, both the local and repo repositories should be up to date. Browse the `dev` branch of your remote repo on GitHub to confirm it is in sync.
137+
138+
<a name="submit"></a>
139+
### 4. Make submit tag
140+
Apply the tag `assign0-submit` to indicate these files are the ones to grade. Follow the instructions in the section "Assignment Tags"
141+
in <a href="/guides/cs107e-git#assignment-tags" target="gwg">Git Workflow Guide</a> to create and push a tag.
142+
143+
Browse your remote repo on GitHub <https://github.com> and confirm that your new tag is listed.
144+
145+
### 5. Add photo file and edit README with your info
146+
147+
What's missing? A cherished course tradition is creating a Wall of Fame in Gates B02
148+
to introduce all members of our community to one another. We
149+
want to include you on our wall!
150+
151+
Find a photo of yourself that you would like to share. Copy this photo file into your `assign0` folder.
152+
153+
Edit the `README.md` file in the `assign0` folder to include the following information:
154+
1. Your preferred name and pronouns
155+
2. Your hometown
156+
3. Your year and major
157+
158+
Add both the photo file and README.md to the staging index. Commit and push to your remote repo.
159+
160+
### 6. Move submit tag
161+
162+
To indicate this updated commit should replace your previous submission, move the submit tag. Read the section "Assignment Tags" in the <a href="/guides/cs107e-git#assignment-tags" target="gwg">Git Workflow Guide</a> for instructions on how to move a tag.
163+
164+
Browse your remote repo on GitHub and confirm that your submit tag is placed on the commit which contains the correct content for all three files (`background.txt`, `README.md`, and your photo file).
165+
166+
## Success!
167+
You have now successfully navigated the full assignment workflow:
168+
- pull starter files
169+
- edit files
170+
- add and commit changes
171+
- push to remote
172+
- make submit tag
173+
- update submission and move tag
174+
- confirm results on remote repo on Github
175+
176+
And you're ready for the further adventures to come.

0 commit comments

Comments
 (0)