Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

How do clocks impact computing?

Von Neumann Architecture

von Neumann Architecture

We have talked about the ALU at length and we have touched on memory, but next we will start to focus on the Control unit.

We discussed that the operations we need to carry out is mostly

Control Unit

The control unit converts binary instructions to signals and timing to direct the other components.

What signals?

We will go to the ALU again since the control unit serves it to figure out what it needs.
Remember in the ALU, has input signals that determine which calculation it will execute based on the input.

8bit ALU

Why Timing signals?

Again, the ALU itself tells us why we need this, we saw that different calculations the ALU does take different amount of times to propagate through the circuit.

Even adding numbers of different numbers that require different number of carries can take different amount of times.

So the control unit waits an amount of time, that’s longer than the slowest calculation before sending the next instruction. It also has to wait that long before reading the output of the ALU and sending that result to memory as needed.

What is a clock?

In a computer the clock refers to a clock signal, historically this was called a logic beat. This is represented by a sinusoidal (sine wave) or square (on, off, on, off) signal that operates with a constant frequency.

This has changed a lot over time.

The first mechanical analog computer, the Z1 operated at 1 Hz, or one cycle per second; its most direct successor moved up to 5-10Hz; later there were computers at 100kHz or 100,000Hz, but where one instruction took 20 cycles, so it had an effective rate at 5kHz.

Execution Times

cd Documents/inclass/systems/
ls
demo				kwl-sp26-brownsarahm		tiny-book
gh-inclass-sp26-brownsarahm	test
git clone https://github.com/introcompsys/spring2023.git
Cloning into 'spring2023'...
remote: Enumerating objects: 5176, done.
remote: Counting objects: 100% (1518/1518), done.
remote: Compressing objects: 100% (348/348), done.
remote: Total 5176 (delta 1223), reused 1432 (delta 1167), pack-reused 3658 (from 1)
Receiving objects: 100% (5176/5176), 131.08 MiB | 8.55 MiB/s, done.
Resolving deltas: 100% (3748/3748), done.
time grep "index" spring2023/
grep: spring2023/: Is a directory

real	0m0.008s
user	0m0.001s
sys	0m0.005s
time grep "index" spring2023/*

and we get results

and at the bottom we see the timing results.

We get three times:

The real time includes the user time, the system time, and any scheduling or waiting time that that occurs.

spring2023/_config.yml:                              syllabus/index.md, _review/*, _prepare/*, _practice/*]  # Patterns to skip when building the book. Can be glob-style (e.g. "*skip.ipynb")
grep: spring2023/_data: Is a directory
grep: spring2023/_practice: Is a directorya
grep: spring2023/_prepare: Is a directory
grep: spring2023/_review: Is a directory
grep: spring2023/_static: Is a directory
spring2023/_toc.yml:root: index
spring2023/_toc.yml:    # - file: syllabus/index
spring2023/_toc.yml:    - file: genindex
spring2023/_toc.yml:    # - file: letters/index
spring2023/_toc.yml:# - file: assignments/index
grep: spring2023/activities: Is a directory
grep: spring2023/faq: Is a directory
grep: spring2023/img: Is a directory
grep: spring2023/notes: Is a directory
grep: spring2023/resources: Is a directory
grep: spring2023/syllabus: Is a directory

real	0m0.008s
user	0m0.002s
sys	0m0.005s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.006s
user	0m0.002s
sys	0m0.004s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.006s
user	0m0.002s
sys	0m0.003s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.011s
user	0m0.003s
sys	0m0.007s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.009s
user	0m0.003s
sys	0m0.006s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.006s
user	0m0.002s
sys	0m0.003s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.005s
user	0m0.002s
sys	0m0.003s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.007s
user	0m0.002s
sys	0m0.004s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.010s
user	0m0.003s
sys	0m0.007s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.006s
user	0m0.002s
sys	0m0.003s
time grep "index" spring2023/_practice/*
spring2023/_practice/2023-01-26.md:1. read Chapter 1, "Decoding your confusion while coding" in [The Programmer's Brain](https://www.manning.com/books/the-programmers-brain#toc) add a file called {index}`brain.md` to your kwl repo that summarizes your thoughts on the chapter and how, if at all, it changes how you think about debugging and learning to program.
spring2023/_practice/2023-01-26.md:3. [complete the syllabus quiz](https://forms.gle/sDpJCYEHNTSW2w2w7). If you get less than 100%, submit an FAQ for the course website in your KWL repo in a file named {index}`syllabus-faq.md` about something that confused you with your best guess at the correct answer. If you get 100%, make a note in your badge PR.
spring2023/_practice/2023-01-31.md:2. Try using setting up git using your favorite IDE or GitHub Desktop. Make a file {index}`gitoffline.md` and include some notes of how it went. Was it hard? easy? what did you figure out or get stuck on. 
spring2023/_practice/2023-02-02.md:2. Download the course website repo via terminal. Append the commands used to a {index}`terminalwork.md`  
spring2023/_practice/2023-02-02.md:3. Explore the difference between git add and git commit: try committing and pushing without adding, then add and push without committing. Describe what happens in each case in your {index}`gitcommit.md`. Compare what happens based on what you can see on GitHub and what you can see with git status. 
spring2023/_practice/2023-02-09.md:1. Create a merge conflict in your github in class repo and resolve it using your favorite IDE, then create one and resolve it on GitHub in browser. Describe how you created it, show the files, and describe how your IDE helps or does not help in {index}`ide_merge_conflict.md`. Give advice for when you think someone should resolve a merge conflict in GitHub vs using an IDE. (if you do not regulary use an, IDE, try VSCode)
spring2023/_practice/2023-02-14.md:2. Add to your {index}`software.md` a section about if that project does or does not adhere to the unix philosophy and why. 
spring2023/_practice/2023-02-14.md:3. create {index}`methods.md` and answer the following:
spring2023/_practice/2023-02-21.md:1. Practice with git log and redirects to write the commit history of your main branch for your kwl chart to a file {index}`gitlog.txt` and commit that file to your kwl repo.
spring2023/_practice/2023-02-21.md:1. Read about different workflows in git and add responses to the below in a {index}`workflows.md` in your kwl repo. Two good places to read from are [Git Book](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows#ch05-distributed-git) and the [atlassian Docs](https://www.atlassian.com/git/tutorials/comparing-workflows)
spring2023/_practice/2023-02-23.md:2. Read about [git internals](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) to review what we did in class in greater detail. Make {index}`gitplumbingdetail.md`. Create a visualization that is compatible with version control (eg can be viewed in plain text and compared line by line, such as table or mermaid graph) that shows the relationship between at least three porcelain commands and their corresponding plumbing commands. 
spring2023/_practice/2023-02-23.md:3. Create {index}`gitislike.md` and explain main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or how you would explain it to someone else at a high level. This might be analogies or explanations using other programming concepts or concepts from a hobby. 
spring2023/_practice/2023-03-02.md:1. use `git cat-file` over the objects to draw a graph diagram of your current status in your test directory include your drawing in {index}`test_repo_map.md` using [mermaid](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) syntax to diagram it. Name each node in your graph with 5-7 characters of the hash and the type. eg `0c913 commit`
spring2023/_practice/2023-03-02.md:1. Update your diagram in {index}`test_repo_map.md` after the following. 
spring2023/_practice/2023-03-07.md:1. Learn more about how git is working on changing from SHA-1 to SHA-256 and answer the transition questions below) {index}`gittransition.md`
spring2023/_practice/2023-03-09.md:2. Write a bash script that can generate a file in your KWL repo with a list of all of your PRs and PR reviews. Save the script as {index}`groupcontributions.sh` and its output as {index}`group_contributions-YYYY-MM-DD.md` 
spring2023/_practice/2023-03-21.md:1. File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add {index}`octal-practice.md` to your KWL repo and answer the following.
spring2023/_practice/2023-03-28.md:1. Describe a type of project where it would be worth it for you to learn a language you have never used before in {index}`newlanguage.md` This should be based in what types of features for the language your project would require and/or what would contribute to the long term health of the project.
spring2023/_practice/2023-03-28.md:1. Try out/learn about one of the following languages that you have not used before, do something small that is typical of that language (eg a toy data analysis in R): [R](https://www.r-project.org/), [Julia](https://julialang.org/), [Clojure](https://clojure.org/guides/getting_started), [Stan](https://mc-stan.org/), [Go](https://go.dev/).  Try to use official documentation only to figure out a toy task to do.  Answer the following questions in {index}`languagelearning.md`:
spring2023/_practice/2023-04-04.md:2. Install [ gcc](https://gcc.gnu.org/install/) locally and practice using it.  Repeat steps we did in class on your computer and then change the order of parameters; try skipping steps to produce errors, etc. Export the list of variations you tried and summarize what you learned as a list of tips and reminders on what the parameters do/why/when you would need them (or not) in {index} `gcctips.md`.  (to reinforce what we learned)
spring2023/_practice/2023-04-04.md:8. Answer the following in {index}`hpc.md` of your KWL repo:  (to think about how the design of the system we used in class impacts programming and connect it to other ideas taught in CS)
spring2023/_practice/2023-04-06.md:1. Add {index}`bitwise.md` to your kwl and write the bitwise operations required for the following transformations:
spring2023/_practice/2023-04-06.md:3. Create {index}`readingbytes.md` and answer the following:
spring2023/_practice/2023-04-06.md:4. Read about integer overflow and describe what it is, use an example assuming an 8 bit system, and  how integer overflow is handled in Python, C, Javascript, and one other language of your choice in {index}`overflow_languages.md` 
spring2023/_practice/2023-04-18.md:4. Answer reflection questions below in {index}`systemsabstractions.md` based on the systems abstraction reading:
spring2023/_practice/2023-04-25.md:1. Simulate a more computationally intensive program using the `sleep` function in C and compare the time of a threaded vs single threaded (ie serial, no intentional threading) version of the program. Include your two programs and the bash script to show how you tested it with notes on the performance in {index}`threaded.md` (to better illustrate the impact of the threads)
spring2023/_practice/2023-04-25.md:1. Learn about the system libraries in two languages (one can be C or Python, one must be something else). Find the name(s) of the library or libraries. In {index}`systeminteraction.md` summarize what types of support are shared or different?  What does that tell you about the language?
spring2023/_practice/2023-04-25.md:2.  Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in {index}`whymultithread.md`.

real	0m0.007s
user	0m0.002s
sys	0m0.004s
time grep "index" spring2023/_practice/* > file.txt
real	0m0.006s
user	0m0.002s
sys	0m0.004s
time grep "index" spring2023/_practice/* > file.txt
real	0m0.011s
user	0m0.003s
sys	0m0.008s
time grep "index" spring2023/_practice/* > file.txt
real	0m0.007s
user	0m0.002s
sys	0m0.004s
time grep "index" spring2023/_practice/* > file.txt
real	0m0.008s
user	0m0.002s
sys	0m0.006s
time grep "index" spring2023/_practice/* > file.txt
real	0m0.006s
user	0m0.002s
sys	0m0.003s
time grep "index" spring2023/_practice/* > file.txt
real	0m0.007s
user	0m0.002s
sys	0m0.004s

Threading

ssh seawulf
Last login: Thu Apr  9 12:46:40 2026 from 172.20.24.214
mkdir thread
cd thread/
nano sq_sum_threaded.c
cat sq_sum_threaded.c
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>

/* single global variable */
/* shared, accessible, modifiable by all threads */
int accum = 0;

void* square(void* x) {
  int xi = (int)x;
  accum += xi * xi;
  return NULL; /* nothing to return, prevent warning */
}

int main(int argc, char** argv) {
  int i;
  pthread_t ths[20];
  for (i = 0; i < 20; i++) {
    pthread_create(&ths[i], NULL, square, (void*)(i + 1));
  }

  for (i = 0; i < 20; i++) {
    void* res;
    pthread_join(ths[i], &res);
  }

  printf("accum = %d\n", accum);
  return 0;
}
gcc -pthread -Wall -g -o sqsum sq_sum_threaded.c -lm
sq_sum_threaded.c: In function ‘square’:
sq_sum_threaded.c:10:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   int xi = (int)x;
            ^
sq_sum_threaded.c: In function ‘main’:
sq_sum_threaded.c:19:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     pthread_create(&ths[i], NULL, square, (void*)(i + 1));
                                           ^
./sqsum
accum = 2870
for i in {1..10000}
> do ./sqsum
> done | sort | uniq -c
      2 accum = 2470
      2 accum = 2509
      1 accum = 2546
      2 accum = 2581
      2 accum = 2614
      4 accum = 2645
      2 accum = 2674
      1 accum = 2701
      1 accum = 2725
      1 accum = 2726
      1 accum = 2749
      1 accum = 2770
      3 accum = 2789
      5 accum = 2806
      4 accum = 2821
      2 accum = 2834
      6 accum = 2845
     10 accum = 2854
      8 accum = 2861
     10 accum = 2866
      1 accum = 2869
   9931 accum = 2870
head sq
sqsum              sq_sum_threaded.c
head sq
sqsum              sq_sum_threaded.c
head sq_sum_threaded.c
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>

/* single global variable */
/* shared, accessible, modifiable by all threads */
int accum = 0;

void* square(void* x) {
  int xi = (int)x;
cat sq_sum_threaded.c
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>

/* single global variable */
/* shared, accessible, modifiable by all threads */
int accum = 0;

void* square(void* x) {
  int xi = (int)x;
  accum += xi * xi;
  return NULL; /* nothing to return, prevent warning */
}

int main(int argc, char** argv) {
  int i;
  pthread_t ths[20];
  for (i = 0; i < 20; i++) {
    pthread_create(&ths[i], NULL, square, (void*)(i + 1));
  }

  for (i = 0; i < 20; i++) {
    void* res;
    pthread_join(ths[i], &res);
  }

  printf("accum = %d\n", accum);
  return 0;
}
cp sq_sum_threaded.c sq_sum_locked.c
nano sq_sum_locked.c
gcc -pthread -Wall -g -o sqsuml sq_sum_locked.c -lm
sq_sum_locked.c: In function ‘square’:
sq_sum_locked.c:11:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   int xi = (int)x;
            ^
sq_sum_locked.c: In function ‘main’:
sq_sum_locked.c:24:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     pthread_create(&ths[i], NULL, square, (void*)(i + 1));
                                           ^
./sqsuml
accum = 2870
for i in {1..10000}; do ./sqsuml; done | sort | uniq -c
  10000 accum = 2870
time for i in {1..10000}; do ./sqsuml; done | sort | uniq -c
  10000 accum = 2870

real	0m16.780s
user	0m5.810s
sys	0m17.082s
time for i in {1..10000}; do ./sqsum; done | sort | uniq -c
      3 accum = 2509
      2 accum = 2546
      2 accum = 2614
      2 accum = 2645
      1 accum = 2674
      1 accum = 2701
      1 accum = 2726
      6 accum = 2845
     12 accum = 2854
     12 accum = 2861
     20 accum = 2866
      1 accum = 2869
   9937 accum = 2870

real	0m17.249s
user	0m5.834s
sys	0m17.459s
Connection to seawulf.uri.edu closed by remote host.
Connection to seawulf.uri.edu closed.
client_loop: send disconnect: Broken pipe
## Prepare for Next Class 

```{include} ../_prepare/2026-04-21.md

Badges

Review
Practice
  1. Review the notes from today

  2. Update your KWL chart.

  3. If you were to use something from this course in an internship for an interview, what story could you tell?

  4. Use time to compare using a bash loop to do the same operation on every file in a folder vs using the wildcard operator and sending the list of files to command. In loop_v_list.md include your code exerpts, the results and hypothesize why the faster one is faster.

Experience Report Evidence

Questions After Today’s Class