More Practice
More PracticeΒΆ
Note
these are listed by the date they were posted
import os
from IPython.display import Markdown, display
prep_file_list = sorted(os.listdir('../_practice/'))
for prep_file in prep_file_list:
date_str = prep_file[:-3]
date_link = '[' + date_str + '](../notes/' + date_str + ')'
display(Markdown(date_link))
display(Markdown('../_practice/' + prep_file))
(optional) try mapping out using mermaid syntax, we'll be using other tools that will faciltate rendering later, or try getting it to render on your own.
(optional) read chapter 1 the programmmer's brain. Some of the ideas we talked about today are mentioned there, and it relates to where you're suppoed to be looking for things that you have done, but didn't really understand.
try adding something to this page or the glossary of the course site or link a glossary term to an occurence of it on the site.
Find the "Try it yourself" boxes in these notes, try them and add notes/ responses under a
## More Practice
heading in yourgitoffline.md
file of your KWL repo.Download the course site repo via terminal.
Explore the difference between
git add
andgit commit
try committing and pushing without adding, then add and push without committing. Describe what happens in each case in yourgitoffline.md
Try to do as many things as possible on the terminal for a whole week.
Make yourself a bash cheatsheet (and/or contribute to one on the course site)
Read through part 1 of the programmer's brain and try the exercises, especially in chapter 4.
Once your PRs in your KWL are merged so that main and feedback match, pull to updates your local copy. In a new terminal window, navigate there and then move the your KWL chart to a file called
chart.md
. Create a new README files with a list of all the files in your repo. Usehistory N
(N is the number of past commands that history will return) and redirects to write the steps you took toreorg.md
. Review that file to make sure it doesn't have extra steps in it and remove any if needed using nano then commit that file to your repo.find a place where there is a comment in the course notes indicating content to add and submit a PR adding that content. This could be today's notes or a past day's.
Add a new file to your KWL repo called
stdinouterr.md
Try the following one at a time in your terminal and describe what happens and explain why or list questions for each in the file. What tips/reminders would you give a new user (or yourself) about using redirects andecho
?echo "hello world" > fa > fb
echo "a test" > fc fd
> fe echo "hi there"
echo "hello " > ff world
<ff echo hello
fa < echo hello there
cat
Complete the
Try it Yourself
blocks above in yourhardwaresurvey.md
.Expand on your update to
abstraction.md
: Can you reconcile different ways you have seen memory before?
Read about different workflows in git and add responses to the below in a
workflows.md
in your kwl repo. Git Book atlassian DocsContribute either a glossary term, cheatsheet item, additional resource/reference, or history sidebar to the course website.
## Workflow Reflection
1. What advantages might it provide that git can be used with different workflows?
1. Which workflow do you think you would like to work with best and why?
1. Describe a scenario that might make it better for the whole team to use a workflow other than the one you prefer.
Add to your
gitplumbing.md
file explanations of the main git operations we have seen (add, commit, push) in your own words in a way that will either help you remember or behow you would explain it to someone else at a high level. This might be analogies or explanations using other progrmaming concepts or concepts from a hobby. Add this under a subheading##
with a descriptive title (for example "Git In terms of") For one thing your understanding changed or an open question you, look up or experiment to find the answer
Read more about git's change from SHA-1 to SHA-256 and reflect on what you learned (questions provided)
(priority) In a language of your choice or pseudocode, write a short program to convert, without using libraries, between all pairs of (binary, decimal, hexidecimal) in
numbers.md
. Test your code, but include in the markdown file enclosed in three backticks so that it is a "code block" write the name of the language after the ticks like:
```python
# python code
```
Find an open source repository and look at the .gitignore file. In
donotcommit.md
reflect on what types of content typically get ignored and why you think they are ignored. If you can't figure out why, try to look it up.Create a second git story for the other type form your first (code mistake or git mistake) in
gitstory2.md
add something to the glossary, cheatsheet or a history sidebar to the notes.
build your kwl repo to a pdf or one other format locally.
Add
templating.md
to your KWL repo and explain templating in your own words using other programming concepts you have learned so far. Include in a markdown (same as HTML<!-- comment -->
) comment the list of CSC courses you have taken for context while we give you feedback.Learn about the documentation ecosystem in another language that you know. In
docs.md
include a summary of your findings and compare and contrast it to jupyter book/sphinx.
priority add or link a glossary or cheatsheet, OR add a box with some historical context or extra reading links to the notes from any past class (in order to practice git/github and using jupyter book features, which are similar to other documentation tools, so even if you do not work in a python centric environment the concepts will translate)
priority write a script that outputs the first 3 lines of each
.fastq
line and sbatch script that runs it and saves the output to files and e-mails you when it is done. Submit the job. (to reinforce /practice what we saw in class)File permissions are represented numerically often in octal, by transforming the permissions for each level (owner, group, all) as binary into a number. Add
octal.md
to your KWL repo and answer the following. Try to think through it on your own, but you may look up the answers, as long as you link to (or ideally cite using jupyterbook citations) a high quality source.1. Transform the permissions [`r--`, `rw-`, `rwx`] to octal, by treating it as three bits. 1. Transform the permission we changed our script to `rwxr-xr-x` to octal. 1. Which of the following would prevent a file from being edited by other people 777 or 755?
Answer the following in
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)1. What kinds of things would your code need to do if you were going to run it on an HPC system? 1. What Sbatch options seem the most helpful? 1. How might you go about setting the time limits for a script? How could you estimate how long it will take?
optional Configure ssh keys to your GitHub account (this is actually GitHub's preferred terminal authentication method)
(priority) Compare at least 3 IDEs for working in a single language. Create
favoriteide.md
and include your most important criteria with their rankings, how each IDE meets/does not meet those criteria, and a conclusion of which IDE is the best based on your criteria.
(priority) Describe a type of project where it would be worth it for you to learn a language you have never used before in
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.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 or ): R, Julia, Clojure, Stan, Go, . Answer the following questions:
1. What is this language designed for? 1. What Progrmaming paradigm(s) does it support? 1. What about it makes it easy to learn for someone who already knows some other language (name that language)? 1. What about it is hard to larn for (pick a language) prgorammers? 1. What is its most unique feature(s)?
(priority) Write two short programs that do the same thing in different ways and compile them both to assembly (eg using a for vs while loop to sum numbers up to a number). Check the assembly to see if they produce the same thing or if it's different.
Add (or link) a glossary term, cheatsheet tip, or historical context to note on the course website.
(priority) Add to
overflow.md
how integer overflow is handled in Python, C, Javascript, and one other language of your choice.Add to
readingbytes.md
and exmaple of how machine code that was a 3 bit instruction followed by an 8 bit address might render.Add a box to the notes for any class that includes historical context of something covered in class or a related topic. Use the tempalte below:
```{admonition} Historical Context ```
In
floatexpt.md
design an experiment using thefractions.Fraction
class in python that shows helps illustrate how.1*3 == .3
evaluates toFalse
but.1*4 ==.4
evaluates toTrue
. (practice/review)
In
addertypes.md
compare ripple adders and lookahead adders.1. Give a synopsis of each adder type 1. Compare them in terms of time (assume that each gate requires one unite of time) 1. Compare them in terms of space/cost by counting the total number of gates required.
(priority) While we saw many types of gates today, but we actually could get all of the operations needed using only NAND gates. Work out how to use NAND gates to implement a half adder.
Pick one historical event about computers, memory and storage or networking and the web (not limited to what is on those pages) and in, 'history-
' describe the event, how it impacted what has come since. Map out what you know about computer hardware in some form of visual or outline in
hardwaremap.md
and bring three questions to class.
(priority) Compare the time of the following operations, investigate what the different operations do/not do, how do the three times compare? and hypothesize explanations in
timing.md
. Which times are constant vs variable? Which vary the most? least? Tip: use a script with loops and see the optionsand write output to a file (to test how these impact your work. extension idea: expand the level of detail to include more analysis on this, Try to find operations that increase the user vs system time. You can use basic bash operations or programs you have from other courses )1. wget https://github.com/introcompsys/spring2022/blob/main/img/2022-01-27-mental_model_advanced.svg 2. wget https://raw.githubusercontent.com/introcompsys/spring2022/main/img/2022-01-27-mental_model_advanced.svg 3. kwlcheck 4. kwlfilecheck 5. hello world compiled from C
Practice exploring the list of processes running on your computer and investigate how much resources different things you do on a regular basis use. Make some general observations In
kernelproc.md
.
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
systeminteraction.md
make notes for each language about what categories of functions they provide.(priority) Research examples of programs using multi-threading besides splitting up a single calculation for time reasons, include three examples in
whymultithread.md
.
Make a table that compares and contrasts the unix file system to git as a file system on at least 5 aspects (eg header + 5 rows) in
filesystem.md
. Based on this, write a definition of a file system generally and how knowing that these are both file systems helps reinforce concepts and improve understanding.In
whypointers.md
write a blog-post style argument for why understanding pointers as a concept is important for a computer science student even if they will not work directly in a language that uses pointers. Consider your audience to be a student who is in CSC212 and struggling. Use two examples from this class where we relied on the concept of pointers to explain how something worked.Reflect on how thise course impacts programming/debugging skills in
skillup.md
. You can write this as how you think your own skill has improved or as if you are convincing another student to take this class. Touch on at least three topics.
In
surprisingfacts.md
explain why each of the following and one additional fact of your own is true. For each fact, include a demo showing that it happens.1. rename and move use the same command in bash 1. `git revert` adds a commit 1. adding to a large number can result in a negative number 1. the following would most likelycause an endless loop `while not(i==.3)` 1. A program without any inputs or randomization in it can give different results each time it is run
For two imaginary projects, compare compare and contrast different programming languages and git workflows. Choose the two projects so that the best language and best workflow will be different choices. Include a description of each project, your comparisons, and conclusions in
projectplanning.md