Skip to content

Commit

Permalink
Course content minor updates, readme updates (#31)
Browse files Browse the repository at this point in the history
* readme updates, migrate generate_slides.sh from shell course

* some slide updates

---------

Co-authored-by: Simeon Wong <[email protected]>
  • Loading branch information
dtxe and dtxe authored Aug 22, 2024
1 parent c35b080 commit a795075
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 75 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.DS_Store
.vscode/
/03_instructional_team/lessons/pdf/*
/03_instructional_team/lessons/html/*
/03_instructional_team/lessons/pptx/*
/03_instructional_team/node_modules
Binary file modified 01_materials/slides/01_git_installation.pdf
Binary file not shown.
Binary file modified 01_materials/slides/02_git_version_control.pdf
Binary file not shown.
Binary file modified 01_materials/slides/03_git_basics.pdf
Binary file not shown.
Binary file modified 01_materials/slides/04_optional_git_slide.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions 02_activities/assignments/git_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ In this assignment, you will be learning more about `git` and `GitHub` by workin

> b. What is a _pull request_?

> c. How do I open up a _pull request_?
> c. Describe the steps to open a _pull request_?

> d. Give me a step by step guide on how to add someone to your repository.
> d. Describe the steps to add a collaborator to a repository (share write permissions)

> e. What is the difference between `git` and `GitHub`?

Expand Down Expand Up @@ -50,7 +50,7 @@ Feel free to at any point (recommended after answering every 2 questions) to sta
🚨 **Please review our [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md)** 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.

### Submission Parameters:
* Submission Due Date: `11:59 PM - 28/04/2024`
* Submission Due Date: `2024-08-25 - 23:59`
* The branch name for your repo should be: `assignment`
* What to submit for this assignment:
* The mentioned markdown file above (README.md) should be populated with what we have asked for and should be the only change in your pull request.
Expand Down
21 changes: 13 additions & 8 deletions 03_instructional_team/generate_slides.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# CONFIGURATION
folder_md="lessons/"
folder_md="markdown_slides/"
folder_output="../01_materials/slides" # This will be used for both PDF and HTML

# Clear the screen for the splash screen
Expand Down Expand Up @@ -38,7 +38,7 @@ function show_help() {
echo ""
echo "Options:"
echo " --html Generate slides in HTML format. This option"
echo " processes all Markdown files in the 'lessons'"
echo " processes all Markdown files in the 'markdown_slides'"
echo " directory, outputting HTML files."
echo ""
echo " --pdf Generate slides in PDF format. Similar to --html,"
Expand All @@ -59,8 +59,8 @@ function show_help() {
echo " $0 --pdf"
echo ""
echo "Note:"
echo " Ensure Marp CLI is installed and accessible in your system's PATH."
echo " The script processes Markdown (.md) files located in the 'lessons'"
echo " Ensure Node.js is installed and npm is accessible in your system's PATH."
echo " The script processes Markdown (.md) files located in the 'markdown_slides'"
echo -e " directory, preserving filenames but changing extensions to .html or .pdf.\n\n"
}

Expand All @@ -71,11 +71,16 @@ if [ "$#" -lt 1 ]; then
fi

# Check for Marp CLI installation
if ! command -v marp &> /dev/null; then
echo "- Error: Marp CLI is not installed. Please install Marp CLI to proceed."
if ! command -v npx >/dev/null 2>&1; then
echo "- Error: npx is not installed. Please install Node.js to proceed."
exit 1
fi

if ! npx marp --version >/dev/null 2>&1; then
echo "- Marp CLI is not installed. Installing Marp CLI in this repository..."
npm install --no-save @marp-team/marp-cli
fi

# Defaults
output_type=""
theme_path=""
Expand Down Expand Up @@ -144,12 +149,12 @@ for markdown_file in $markdown_files; do
# Generate HTML
output_file+=".html"
echo " - Generating HTML: $output_file"
marp "$markdown_file" --output "$output_file" --html --allow-local-files ${theme_path:+--theme-set $theme_path} # &> /dev/null
npx marp "$markdown_file" --output "$output_file" --html --allow-local-files ${theme_path:+--theme-set $theme_path} # &> /dev/null
elif [ "$output_type" = "--pdf" ]; then
# Generate PDF
output_file+=".pdf"
echo " - Generating PDF: $output_file"
marp "$markdown_file" --output "$output_file" --pdf --allow-local-files --pdf-notes ${theme_path:+--theme-set $theme_path} # &> /dev/null
npx marp "$markdown_file" --output "$output_file" --pdf --allow-local-files --pdf-notes ${theme_path:+--theme-set $theme_path} # &> /dev/null
else
# nahhh
show_help
Expand Down
5 changes: 4 additions & 1 deletion 03_instructional_team/markdown_slides/01_git_installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
marp: true
theme: dsi-certificates-theme
style: |
section {
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}
_class: invert
paginate: true
---
Expand Down
72 changes: 34 additions & 38 deletions 03_instructional_team/markdown_slides/02_git_version_control.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
marp: true
theme: dsi-certificates-theme
style: |
section {
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}
_class: invert
paginate: true
---
Expand All @@ -13,6 +16,8 @@ $ echo "Data Sciences Institute"

---
Prerequisites:
- Git version ≥2.39
- Git Credential Manager
- GitHub account

---
Expand All @@ -31,43 +36,31 @@ References
## `Version Control`

---
##### What is Version Control?
Version control is a system that records changes to a file or a set of files over time so that we can recall a specific version later. We may already do this by copying files to another directory to save past versions.While it is simple, it lacks flexibility and complexity.
#### What is Version Control?
Version control is a system:
* that records changes to a file or a set of files over time
* that enables recall a specific version

---
Version Control Systems (VCS) can do a number of things and can be applied on nearly any type of file on our computers:
- revert files to a previous state
- revert entire project to a previous state
- compare changes over time
- see who modified something last
- who introduced an issue and when
- recover lost files
We may already do this by copying files to another directory to save past versions. While it is simple, it lacks flexibility and complexity.

---
##### Local Version Control Systems
Local VCSs were developed to keep track of changes to our files by putting them in a version database.

![bg right contain](./pics/02_lvc.png)

---
##### Centralized Version Control Systems
Centralized VCSs (CVCS) were developed to enable collaboration with developers on other systems. CVCSs have a single server that contains all the versioned files.

![bg left contain](./pics/02_cvcs.png)

---
CVCSs allow some level of transparency to others' work and give Administrators a level of control over what developers can and can't do.

Unfortunately, a single server means that if it ever goes down, all collaboration halts for however long that lasts for. Additionally, if backups haven't been kept, work could easily be lost.
#### Why version control?
Version Control Systems (VCS) can do a number of things and can be applied on nearly any type of file on our computers:
* revert files to a previous state
* revert entire project to a previous state
* compare changes over time
* see who modified something last
* who introduced an issue and when
* recover lost files

---
##### Distributed Version Control Systems
To handle the limitations of LVCSs and CVCSs, Distributed VCSs were created. This includes Git, Mercurial and Bazaar.
#### Why specialized version control for software teams?
* Robust software is documented as it is written
* Log changes and reasoning for why changes are made
* Working in teams requires code-specific version control
* Changing one part of a code project can affect behaviour in seemingly unrelated features
* In-progress state of one component can render the entire program temporarily unusable (e.g. syntax error)

Collaborators mirror the entire repsoitory, therefore if a server dies, any one of the collaborators' repositories can be copied back to the server to restore it.

---
![w:560 center](./pics/02_dvcs.png)

---

Expand All @@ -80,22 +73,25 @@ Questions?
## `Git`

---
##### Git Basics
Git thinks of data in a very different way than other VCSs. Instead of storing a set of files and the changes over time, Git thinks of its data more like a set of snapshots of a mini file system.
### Git Basics
Git is the most common VCS in modern coding teams.

If files have not changed, Git does not store the file again, it links to the previous identical file already stored.
##### Git is efficient with storage
* Git stores snapshots of files in your project directory
* If files have not changed, Git does not store the file again, it links to the previous identical file already stored.

---
![w:1100 center](./pics/02_git_data.png)

![auto center](./pics/02_git_data.png)

---
##### Local Operations
##### Git can operate locally
Most operations on Git only need local files and resources to operate. Git also keeps the entire history of our projects on our local disks meaning we can see changes made months ago without a remote server.

We also don't need to be connected to the server to get work done, rather we only need to be connected when we want to upload our work.

---
##### Benefits
##### Git assures integrity
Git uses a check-summing mechanism called *SHA-1 hash* which is calculated based on the contents of a file or directory structure in Git. It looks somehting like this:
```
24b9da6552252987aa493b52f8696cd6d3b00393
Expand Down
18 changes: 13 additions & 5 deletions 03_instructional_team/markdown_slides/03_git_basics.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
marp: true
theme: dsi-certificates-theme
style: |
section {
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}
_class: invert
paginate: true
---
Expand Down Expand Up @@ -327,12 +330,17 @@ $ git remote show origin
Here we can see the URL that we're fetching and pulling from, our remote branches, and configurations for git push (to the main branch or another).

---
To send and retrieve work between our local and remote repositories, we have to authenticate a personal access token:
To send and retrieve work between our local and remote repositories, we use Git Credential Manager.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;![w:350 left](./pics/03_settings.png) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;![w:340 right](./pics/03_developer.png)
```console
$ git credential-manager github login
```

---
![w:1150 center](./pics/03_personal_auth.png)
To check our login status

```console
$ git credential-manager github list
```

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
marp: true
theme: dsi-certificates-theme
style: |
section {
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}
_class: invert
paginate: true
---
Expand Down
File renamed without changes.
File renamed without changes.
68 changes: 52 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,37 @@ By the end of the module, participants will be able to:
* Use Git to collaboratively save, restore, and update work through version control
* Explain the difference between Git and GitHub

## Assignments
## Activities
This module has two types of activities.
1. Assignments are mandatory, and form part of your evaluation.
1. Homework is not assessed, but are provided to you for extra practice. We encourage you to check each other's homework solutions during Work Periods or ask a Learning Support!

### Assignments
Participants should review the [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md) for instructions on how to complete assignments in this module.

Assignments are typically due on the Sunday following the module's live learning session.

1. [Git Assignment](./02_activities/assignments/git_assignment.md)

### Homework
1. [Git Homework](./02_activities/homework/git_homework_1.md)


## Contacts

**Questions can be submitted to the _#cohort-3-help_ channel on Slack**
**Questions can be submitted to the _#cohort-4-help_ channel on Slack**

* Technical Facilitator:
* **Simeon Wong** (he/him)
[email protected]

* Learning Support Staff:
* **Michaela Drouillard** (she/her)
michaela.drouillard@mail.utoronto.ca
* **Julia Gallucci** (she/her)
[email protected]
* **Emma Teng**
[email protected]
* **Simeon Wong** (he/him)
[email protected]

* Learning Support Staff:
* **Emma Teng** (she/her)
e.teng@mail.utoronto.ca
* **Sidra Bushra** (she/her)
[email protected]
* **Pedram Asli**


## Delivery of the Learning Module

Expand Down Expand Up @@ -88,8 +96,36 @@ Feel free to use the following as resources:
- [Git vs GitHub: What's the difference?](https://www.youtube.com/watch?v=wpISo9TNjfU)

### How to get help

![image](./steps_to_ask_for_help.png)
#### 1. Gather information about your problem
- Copy and paste your error message
- Copy and paste the code that caused the error, and the last few commands leading up to the error
- Write down what you are trying to accomplish with your code. Include both the specific action, and the bigger picture and context
- (optional) Take a screenshot of your entire workspace

#### 2. Try searching the web for your error message
- Sometimes, the error has common solutions that can be easy to find!
- This will be faster than waiting for an answer
- If none of the solutions apply, consider asking a Generative AI tool
- Paste your code, the error message, and a description of your overall goals

#### 3. Try asking in your cohort's Slack help channel
- Since we're all working through the same material, there's a good chance one of your peers has encountered the same error, or has already solved it
- Try searching in the DSI Certificates Slack help channel for whether a similar query has been posted
- If the question has not yet been answered, post your question!
- Describe your the overall goals, the context, and the specific details of what you were trying to accomplish
- Make sure to **copy and paste** your code, your error message
- Copying and pasting helps:
1. your peers and teaching team quickly try out your code
1. others to find your question in the future

#### Great resources on how to ask good technical questions that get useful answers
- [Asking for Help - The Odin Project](https://www.theodinproject.com/lessons/foundations-asking-for-help)
- [How do I ask a good question? - Stack Overflow](https://stackoverflow.com/help/how-to-ask)
- [The XY problem: A question pitfall that won't get useful answers](https://xyproblem.info/)
- [How to create a minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)

#### Getting help: A summary
<img src="steps_to_ask_for_help.png" width="700">

<hr>

Expand All @@ -101,7 +137,7 @@ Feel free to use the following as resources:
├── 01_materials
├── 02_activities
├── 03_instructional_team
├── 04_cohort_three
├── 04_this_cohort
├── .gitignore
├── LICENSE
├── README.md
Expand All @@ -112,7 +148,7 @@ Feel free to use the following as resources:
* **materials**: Module slides and interactive notebooks (.ipynb files) used during learning sessions.
* **activities**: Contains graded assignments, exercises, and homework to practice concepts covered in the learning module.
* **instructional_team**: Resources for the instructional team.
* **cohort_three**: Additional materials and resources for cohort three.
* **this_cohort**: Additional materials and resources for this cohort.
* **.gitignore**: Files to exclude from this folder, specified by the Technical Facilitator
* **LICENSE**: The license for this repository.
* **README**: This file.
Expand Down

0 comments on commit a795075

Please sign in to comment.