Skip to content

Commit c6239ad

Browse files
Merge branch 'main' of https://github.com/PdxCodeGuild/class_HB2 into muki-lab01-average-numbers
2 parents 07add5a + a4779bb commit c6239ad

File tree

13 files changed

+137
-16
lines changed

13 files changed

+137
-16
lines changed

0 General/00 Getting Started.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88

99
* NOTE: When some text below is placed between `<` and `>`, that means the user should provide their own text in the command and the user should not include the `<` and `>`.
1010

11+
* To follow the guide, keep the two points in mind:
12+
* At each "**Execute the following commmand**" statement below, Type the command into your CLI and press enter.
13+
* Replace any part of the command within the `<` and `>` with your specific text.
14+
* The statement folling the "Sample command and output" statement is just an example of what the CLI might display on the line you execute the command and the following lines which display the reponse output of your command.
15+
1116

1217
1. Open CLI.
1318

14-
1. Make sure we are in correct folder (directory). We should be inside <class_name> folder (directory). `pwd` shows the current 'working directory':
19+
1. Make sure we are in correct folder (directory). We should be inside <class_name> folder (directory). `pwd` shows the current 'working directory'. **Execute the following commmand**:
1520
```
1621
pwd
1722
```
@@ -26,7 +31,7 @@
2631
PS C:\Users\Bruce\Programming\class_name>
2732
```
2833
29-
1. Verify we are in a directory that is a git repository:
34+
1. Verify we are in a directory that is a git repository. **Execute the following commmand**:
3035
```
3136
git status
3237
```
@@ -46,7 +51,7 @@
4651
* lab-name: `getting-started`
4752
* My name is 'Bruce' so my branch name would be `bruce-lab00-getting-started`.
4853
* The command we will use (where `<branch-name>` is replaced by your branch name decided above):
49-
* This command creates a new branch named `<branch-name>` from the current state of the `main` branch.
54+
* This command creates a new branch named `<branch-name>` from the current state of the `main` branch. **Execute the following commmand**:
5055
```
5156
git checkout -b <branch-name>
5257
```
@@ -57,7 +62,7 @@
5762
PS C:\Users\Bruce\Programming\class_name>
5863
```
5964
60-
1. We can verify current git branch and list local branches using `git branch`:
65+
1. We can verify current git branch and list local branches using `git branch`. **Execute the following commmand**:
6166
```
6267
git branch
6368
```
@@ -70,7 +75,7 @@
7075
PS C:\Users\Bruce\Programming\class_name>
7176
```
7277
73-
1. Verify contents of current directory:
78+
1. Verify contents of current directory. **Execute the following commmand**:
7479
```
7580
ls
7681
```
@@ -89,7 +94,7 @@
8994
9095
PS C:\Users\Bruce\Programming\class_name>
9196
```
92-
1. Change directory (folder) into the `code` directory:
97+
1. Change directory (folder) into the `code` directory. **Execute the following commmand**:
9398
```
9499
cd code
95100
```
@@ -99,7 +104,7 @@
99104
PS C:\Users\Bruce\Programming\class_name\code>
100105
```
101106
102-
1. Verify we are in `code` directory:
107+
1. Verify we are in `code` directory. **Execute the following commmand**:
103108
```
104109
pwd
105110
```
@@ -114,7 +119,7 @@
114119
PS C:\Users\Bruce\Programming\class_name\code>
115120
```
116121
117-
1. Create your directory inside the `code` directory. Use the lowercase version or your name:
122+
1. Create your directory inside the `code` directory. Use the lowercase version or your name. **Execute the following commmand**:
118123
```
119124
mkdir <studentdirectoryname>
120125
```
@@ -132,7 +137,7 @@
132137
PS C:\Users\Bruce\Programming\class_name\code>
133138
```
134139
135-
1. Change directory into your personal directory:
140+
1. Change directory into your personal directory. **Execute the following commmand**:
136141
```
137142
cd <studentdirectoryname>
138143
```
@@ -147,7 +152,7 @@
147152
* This markdown file named `README.md` will hold your name, your directory name, and your GitHub username.
148153
* You can also add any other information or links to the file later if you choose.
149154
* The '#' below will make that line render as a heading in the markdown file.
150-
* We will use something like this, where `Firstname Lastname` is replaced by your first and last name:
155+
* We will use something like this, where `Firstname Lastname` is replaced by your first and last name. **Execute the following commmand**:
151156
```
152157
echo "# Firstname Lastname" > README.md
153158
```
@@ -171,7 +176,7 @@
171176
brucestull
172177
```
173178
174-
1. Use `git status` to get the status of our branch:
179+
1. Use `git status` to get the status of our branch. **Execute the following commmand**:
175180
```
176181
git status
177182
```
@@ -199,7 +204,7 @@
199204
PS C:\Users\Bruce\Programming\class_HB2\code\bruce>
200205
```
201206
202-
1. Let's now add the files and directories we created to be tracked by git:
207+
1. Let's now add the files and directories we created to be tracked by git. **Execute the following commmand**:
203208
```
204209
git add -A
205210
```
@@ -218,7 +223,7 @@
218223
git add <directorypath>
219224
```
220225
221-
1. Let's use `git status` again to verify we are tracking the proper files:
226+
1. Let's use `git status` again to verify we are tracking the proper files. **Execute the following commmand**:
222227
```
223228
git status
224229
```
@@ -236,7 +241,7 @@
236241
1. We can now `commit` our changes to the branch `<studentname-labnumber-lab-name>` git history.
237242
* The `<commit message>` below is used to describe the changes this commit includes.
238243
* The `<commit message>` may be something like "Added directory for storing labs and included personal README.md"
239-
* We will use the command `git commit -m "<commit message>"`:
244+
* We will use the command `git commit -m "<commit message>"`. **Execute the following commmand**:
240245
```
241246
git commit -m "<commit message>"
242247
```
@@ -249,7 +254,7 @@
249254
PS C:\Users\Bruce\Programming\class_name\code\bruce>
250255
```
251256
252-
1. Finally we can push our code to remote repository hosted on Github. This will allow the instructor and TAs to see the code changes and grade the labs:
257+
1. Finally we can push our code to remote repository hosted on Github. This will allow the instructor and TAs to see the code changes and grade the labs. **Execute the following commmand**:
253258
```
254259
git push origin <branch-name>
255260
```

0 General/11 Git Lab Workflow.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,76 @@
55
* Replace the `<new-branch-name>` items below with your appropriate formed `<studentdirectoryname-labnumber-lab-name>` branch name.
66
* An example `<new-branch-name>` would be `bruce-lab01-python-exercise`
77

8+
1. It's good practice to get the current git status to see what branch is current, what files have been changed, and other details:
9+
`git status`
10+
11+
1. Reminder, git branch can be used to see our current branch and other available local branches:
12+
`git branch`
13+
814
1. Checkout the `main` branch since we want to keep it syncronized with remote:
915
`git checkout main`
16+
1017
1. Retrieve the remote changes to `main` branch and sync them to local repository:
1118
`git pull origin main`
19+
1220
1. Create a new branch `<new-branch-name>` from current state of `main` branch:
1321
`git checkout -b <new-branch-name>`
22+
1423
1. Do some code changes.
24+
1525
1. Add all the changes made to git tracking (or add only `<filename>` or `<directoryname>` changes):
1626
`git add -A`
27+
1728
1. Commit the changes made to the branch:
1829
`git commit -m <commit message>`
30+
1931
1. Push local changes to branch `<new-branch-name>` to the remote repository `origin`:
2032
`git push origin <new-branch-name>`
33+
2134
1. Do some more code changes.
35+
2236
1. Add all the changes made to git tracking:
2337
`git add -A`
38+
2439
1. Commit the changes made to the branch:
2540
`git commit -m <commit message>`
41+
2642
1. Push local changes to branch `<new-branch-name>` to the remote repository `origin`:
2743
`git push origin <new-branch-name>`
44+
2845
1. When lab is completed, [create pull request on GitHub](10%20GitHub%20Pull%20Request.md).
46+
47+
1. After lab has been graded and pull request approved, perform the following two commands to remove the reference to the remote branch, and then delete your local branch:
48+
1. `git remote update origin --prune`
49+
1. `git branch -d <graded-and-merged-branch-name>`
50+
2951
1. Repeat process for new labs.
3052

3153
## Use the following to switch between multiple in-process lab branches.
3254

3355
1. Git `add` and `commit` changes to current branch:
3456
1. `git add -A`
3557
1. `git commit -m <commit message>`
58+
3659
1. Checkout the different branch we want to work on:
3760
* `git checkout <a-branch-name>`
61+
3862
1. Do the code changes for this branch.
63+
3964
1. Git `add` and `commit` changes to the new current branch `<a-branch-name>`:
4065
1. `git add -A`
4166
1. `git commit -m <commit message>`
67+
4268
1. Checkout some other branch we want to work on:
4369
* `git checkout <some-other-branch-name>`
70+
4471
1. Repeat process as needed.
4572

4673
## Use the following to delete branches for labs which have already been graded.
4774
* NOTE: We delete the branches after they have been merged into `main` since the work has been completed and all the changes have been recorded in the `commit`s. We no longer need the branches.
4875

4976
1. Sync our local record of remote branches. This will remove local references to branches which have been deleted on remote:
5077
* `git remote update origin --prune`
78+
5179
1. Delete the local copy of the branch:
5280
* `git branch -d <lab-branch-which-has-been-graded>`
File renamed without changes.

1 Python/labs/02 Unit Converter

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Lab 1: Unit Converter
2+
This lab will involve writing a program that allows the user to convert a number between units.
3+
4+
Version 1
5+
Ask the user for the number of feet, and print out the equivalent distance in meters. Hint: 1 ft is 0.3048 m. So we can get the output in meters by multiplying the input distance by 0.3048. Below is some sample input/output.
6+
7+
> what is the distance in feet? 12
8+
> 12 ft is 3.6576 m
9+
Version 2
10+
Allow the user to also enter the units. Then depending on the units, convert the distance into meters. The units we'll allow are feet, miles, meters, and kilometers.
11+
12+
1 ft is 0.3048 m
13+
1 mi is 1609.34 m
14+
1 m is 1 m
15+
1 km is 1000 m
16+
Below is some sample input/output:
17+
18+
> what is the distance? 100
19+
> what are the units? mi
20+
> 100 mi is 160934 m
21+
Version 3
22+
Add support for yards, and inches.
23+
24+
1 yard is 0.9144 m
25+
1 inch is 0.0254 m
26+
Version 4 - optional
27+
Now we'll ask the user for the distance, the starting units, and the units to convert to.
28+
29+
You can think of the values for the conversions as elements in a matrix, where the rows will be the units you're converting from, and the columns will be the units you're converting to. Along the horizontal, the values will be 1 (1 meter is 1 meter, 1 foot is 1 foot, etc).
30+
31+
ft mi m km
32+
ft 1 0.3048
33+
mi 1 1609.34
34+
m 1/0.3048 1/1609.34 1 1/1000
35+
km 1000 1
36+
But instead of filling out that matrix, and checking for each pair of units (if from_units == 'mi' and to_units == 'km'), we can just convert any unit to meters, then convert the distance in meters to any other unit.
37+
38+
Furthermore you can convert them from meters by dividing a distance (in meters) by those same values used above. So first convert from the input units to meters, then convert from meters to the output units.
39+
40+
Below is some sample input/output:
41+
42+
> what is the distance? 100
43+
> what are the input units? ft
44+
> what are the output units? mi
45+
100 ft is 0.0189394 mi
46+
Turning in your lab
47+
Make sure you are still on your lab branch with git status. This will also show you a list of files that have been modified.
48+
Add any files you want git to keep track of using git add filename. Replace filename with the name of your file. You can also use git add . to add everything within the current folder.
49+
Commit your work using git commit -m "Your commit message". Make sure your commit message is descriptive and describes what has been changed during this commit.
50+
Finally we can run the command git push to send our files up to Github. This may throw an error, but worry not, there will be a suggested command to run, simply copy and paste that command and you should be good to go.
51+
Don't forget to visit Github and create a pull request to submit your work for review.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Presentation Day: November 4th, 2022
2929

3030
| Lab | Name | Date Assigned | Due By Start Of Class | Hard Due Date |
3131
| --- | ---------------------- | ------------- | --------------------- | ------------- |
32-
| 01 | Lab | 00 Jun | 00 Jun | 00 Jun |
32+
| 01 | Lab Average Numbers | 28 Jun | 05 Jul | 12 Jul |
3333
| 02 | Lab | 00 Jun | 00 Jun | 00 Jun |
3434
| 03 | Lab | 00 Jun | 00 Jun | 00 Jun |
3535
| 04 | Lab | 00 Jun | 00 Jun | 00 Jun |

code/daniel/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Daniel Douglass
2+
3+
Directory name:
4+
daniel
5+
6+
GitHub Username:
7+
DanielD6464
8+

code/jonpan/README.md

142 Bytes

Jonathan Pan

Directory Name: jonpan

GitHub Username: notvert

code/jonpan/lab00.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# loop over the elements
2+
# for num in nums:
3+
# print(num)
4+
5+
# loop over the indices
6+
# for i in range(len(nums)):
7+
# print(nums[i])
8+
9+
# We're going to average a list of numbers. Start with the following list, iterate through it,
10+
# keeping a 'running sum', then divide that sum by the number of elements in that list.
11+
# Remember len will give you the length of a list.
12+
13+
nums = [5, 0, 8, 3, 4, 1, 6]
14+
15+
sum = 0
16+
17+
for num in nums:
18+
sum = sum + num
19+
20+
average = sum/(len(nums))
21+
22+
print(average)
23+

code/justin/README.md

156 Bytes

Justin Young

Directory name: justin

GitHub Username: justin-young5

code/kaceyb/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Kacey Broetje
2+
3+
## Directory name: Kacey
4+
5+
## GitHub Username: Demolishen

0 commit comments

Comments
 (0)