Skip to content

Commit

Permalink
Merge pull request #52 from code4policy/main_sync
Browse files Browse the repository at this point in the history
Sync main with master on a separate branch
  • Loading branch information
hileamlakB authored Jan 3, 2024
2 parents fcf223b + e2eba79 commit a5be6aa
Show file tree
Hide file tree
Showing 37 changed files with 145 additions and 88 deletions.
4 changes: 3 additions & 1 deletion agile/03-user-stories.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ User stories ought to have a definition of done. Generally there is one generic
Source:
[http://agileforall.com/new-to-agile-invest-in-good-user-stories/](http://agileforall.com/new-to-agile-invest-in-good-user-stories/)

### ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
Further reading [from the Agile Alliance](https://www.agilealliance.org/glossary/user-stories/#q=~(infinite~false~filters~(postType~(~'page~'post~'aa_book~'aa_event_session~'aa_experience_report~'aa_glossary~'aa_research_paper~'aa_video)~tags~(~'user*20stories))~searchTerm~'~sort~false~sortDirection~'asc~page~1))

### ➡️ Try It

Since we're running a scrummy class, and this class is our product. Lets write good user stories for the class! Lets do this one in pairs.

Expand Down
9 changes: 7 additions & 2 deletions agile/07-reading2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Assignment

1. Spend some time reading whatever intersets you from the menu of choices below - feel free to go off script and read about anything else tangentially related that you find valuable. If your research takes you to something interesting, send it to your classmates on Slack. Participate in a discussion in slack about any of the topics you've read about (there is a channel called #agile where we can discuss). Remember, participation in discussions on slack is required and will be graded.
2. Write down questions you might have about agile and tech projects in government as you go along. One of our guest speakers will be David Zvenyach, former executive director of 18F who will discuss running agile teams in government.
1. Spend some time reading whatever intersets you from the menu of choices below - feel free to go off script and read about anything else tangentially related that you find valuable. **This is your opportunity to think about real-world applications of agile in government and get your most burning questions answered.** If your research takes you to something interesting, send it to your classmates on Slack. Participate in a discussion in slack about any of the topics you've read about (there is a channel called #agile where we can discuss). Remember, participation in discussions on slack is required and will be graded.
2. Write down questions you might have about agile and tech projects in government as you go along. One of our guest speakers will be [David Eaves](https://www.hks.harvard.edu/faculty/david-eaves), who will discuss running agile teams in government.

## Menu Of Readings

Expand All @@ -26,6 +26,7 @@ Do you have burning questions about Scrum? Like "What are the most common pitfal

### Additional Resources

- Agile BS (David Z's reccomendation) https://media.defense.gov/2018/Oct/09/2002049591/-1/-1/0/DIB_DETECTING_AGILE_BS_2018.10.05.PDF
- Chaos Report: https://www.projectsmart.co.uk/white-papers/chaos-report.pdf
- What is Code: https://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/
- Few additional thoughts
Expand All @@ -34,3 +35,7 @@ Do you have burning questions about Scrum? Like "What are the most common pitfal
- Spend some time thumbing through the some of the micropurchases


## Submit your questions for David Eaves

https://docs.google.com/forms/d/e/1FAIpQLScEYEGjXldj4ZLXsnYXKTBQnaxQUUQj4Mcgq0s9JSL9c8BTWA/viewform?usp=sf_link

4 changes: 2 additions & 2 deletions codeconcepts/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ def multiply(a,b):

This would both print to the terminal and return a value. The return is the very last logical thing that happens in the execution of a function. Once a `return` is called, no additional code can be run inside the function. The same is true in JavaScript (and all programming languages).

## Try It
## ➡️ Try It

Complete the following assignment: https://classroom.github.com/a/qqn_nYAr
Complete the following assignment: https://classroom.github.com/a/9pY8aTQJ
3 changes: 3 additions & 0 deletions commandline/01-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Now that you have an understanding of option/flags vs. positional arguments, let
* **clear**s all output from your console
* on macOS, you can also press `Ctrl+L` to clear your console while retaining history or `Cmd-K` to clear console while deleting the history. `Ctrl+L` should work on Ubuntu as well.


### :large_orange_diamond: Example

1. print your username to the command line using `whoami`
Expand Down Expand Up @@ -195,10 +196,12 @@ for a given command, its usually either
### also, know when to reach out to someone...
don't go down rabbit holes trying to figure something out if there is someone who knows better nearby and you've already tried the three things above, they might be able to save you a lot of stress. I'm always happy to help out.


## :white_check_mark: Try It

Let's see if you can learn how to use a new command! Experiment working with `cowsay` in the command line by completing the following assignment: https://classroom.github.com/a/4yAnW2NV


## Dangers

The terminal is a powerful tool (especially in linux)
Expand Down
3 changes: 2 additions & 1 deletion commandline/02-filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ In the example above, if I was in the Downloads folder and I wanted the relative

In the same example above, the absolute path to the Documents folder would be `/Users/mehtad/Documents`.


#### :raised_hand: Pop Quiz

If you are in the Downloads folder, what folder is:
Expand Down Expand Up @@ -149,6 +150,7 @@ If you don't have Sublime Text installed, run `brew cask install sublime-text` o
* `wc -w <path>` only counts words. A "word" is defined as any set of characters delimited by a space.
* `wc -c <path>` only counts characters


### :white_check_mark: Try It

1. Take some time to cd around and explore your filesystem. See what is at the root, see if you can find some of the files you use daily.
Expand Down Expand Up @@ -188,7 +190,6 @@ The command line not only lets you navigate the file system but also manipulate

Complete the following assignment: https://classroom.github.com/a/d4WK4RbX


### Finding Files and Folders

#### `find`
Expand Down
4 changes: 2 additions & 2 deletions commandline/025-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Lets create and run a very small python program

## ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Example
## ❇️ Example

1. Create and "assignments" folder, navigate to it, and create an empty file called `hello.py`

Expand All @@ -25,7 +25,7 @@ Lets create and run a very small python program
python3 hello.py
```
## ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
## ➡️ Try It
1. In your assignments folder, create a new python program called "aplusb.py"
Expand Down
18 changes: 9 additions & 9 deletions commandline/03-redirection.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ First, lets install a new command `fortune`
fortune | cowsay > wisecow.txt
```

## ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Example: Redirection
## ❇️ Example: Redirection

1. Redirect a fact about planet mars into the mars.txt.

Expand Down Expand Up @@ -73,7 +73,7 @@ cat ~/Development/universe/solar_system/planets/mars.txt

In this screenshot, the first example with the `%` at the end has no newline. The latter example does.

## ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Example: piping
## ❇️ Example: piping

Count the number of characters in the string "hello world" using `wc`.

Expand All @@ -93,13 +93,13 @@ Count the number of characters in the first line of `mars.txt`
cat ~/Development/universe/solar_system/planets/mars.txt | head -n 1 | wc -c
```

## ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
## ➡️ Try It

Count the number of characters in `mars.txt`
Count the number of characters in the last line of `mars.txt`


## ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Example: piping
## ❇️ Example: piping

Count number of **folders** in the `universe` folder.

Expand All @@ -108,7 +108,7 @@ cd ~/Development/universe
find . -type d | wc -l
```

## ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
## ➡️ Try It

Count number of **files** in the `universe` folder.

Expand All @@ -122,23 +122,23 @@ Configure slackcat by running this command and following the instructions in you
slackcat --configure
```

## ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Example
## ❇️ Example

Let's use slackchat to send a simple message to the `#scratchwork` channel.

```
echo "hello world" | slackcat -c scratchwork
```

## ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
## ➡️ Try It

Notice how the message is being sent as a snippet. Figure out how to send a normal, non-snippet, message using slackcat.

<!--
echo "hello" | slackcat -t -s -c scratchwork
-->

## ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
## ➡️ Try It

1. Count the total number of files and folders in the `~/Development/universe/` directory and send this to the person sitting next to you using slackcat. Use only one line and piping. You can use the `--noop` flag to first test it out without sending the message, then you can remove it to send the message. (hint: start with `tree`)

Expand All @@ -154,7 +154,7 @@ cd ~/Development/universe/solar_system
tree | slackcat -c scratchwork
-->

## ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Example: piping and redirection
## ❇️ Example: piping and redirection

House Office Expenditure Data: https://projects.propublica.org/represent/expenditures

Expand Down
8 changes: 4 additions & 4 deletions commandline/04-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Many Unix-like operating systems have arisen over the years, of which Linux is t
* Files and Processes
- "[Everything is a file](https://www.youtube.com/watch?v=dDwXnB6XeiA)" (oversimplification, but a useful one)
- How does the operating system work?
- Files! [http://www.ee.surrey.ac.uk/Teaching/Unix/unixintro.html](http://www.ee.surrey.ac.uk/Teaching/Unix/unixintro.html)
- Files [http://www.ee.surrey.ac.uk/Teaching/Unix/unixintro.html](http://www.ee.surrey.ac.uk/Teaching/Unix/unixintro.html)
- `ps aux` to see the processes that are running, same as opening the "activity monitor"

* Exploring the root directory (in case you're ever wondering what all those files in `/` are)
Expand Down Expand Up @@ -65,7 +65,7 @@ Check out all of your environment variables: `printenv`

* `which echo` for example, will tell you where the echo command is located, it will be within one of the folders specified in `$PATH` otherwise you would have to call it explicitly every time as `/bin/echo`

## ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Example: permanently setting an environment variable
## ❇️ Example: permanently setting an environment variable

Lets modify an environment variable in side your your `~/.bash_profile` (macOS) or `~/.bashrc` (Ubuntu).

Expand Down Expand Up @@ -170,7 +170,7 @@ Prepend any command with `sudo` in order to run the command as root user. Try to

![](https://imgs.xkcd.com/comics/sandwich.png)

## ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Example
## ❇️ Example

1. Make a file called `sayhello.py` in your `assignments` folder within `~/Development`.

Expand Down Expand Up @@ -201,7 +201,7 @@ Prepend any command with `sudo` in order to run the command as root user. Try to
```


## ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
## ➡️ Try It

This program below will add 1 to the input on STDIN.

Expand Down
3 changes: 2 additions & 1 deletion commandline/05-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Grab a file
```
wget https://projects.propublica.org/congress/assets/staffers/2017Q1-house-disburse-detail.csv
```
If running wget tells you "command not found", install it using `brew install wget` on Mac or `sudo apt-get install wget` for Ubuntu.

Take a look

Expand Down Expand Up @@ -53,7 +54,7 @@ cat 2017Q1-house-disburse-detail.csv | csvgrep -c OFFICE -m WATER > spending_by_
cat spending_by_waters_office.csv |csvstat
cat 2017Q1-house-disburse-detail.csv | csvgrep -c PURPOSE -m WATER > spending_on_water.csv
> cat spending_on_water.csv | csvstat
cat spending_on_water.csv | csvstat
```

Hmm...who is spending so much on water?
Expand Down
2 changes: 1 addition & 1 deletion commandline/07-homework.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pip3 install csvkit

## Homework

Complete the following assignment: https://classroom.github.com/a/ciZOS9c2
Complete the following assignment: https://classroom.github.com/a/CI_-NfZL
2 changes: 1 addition & 1 deletion data/01.5-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Follow the beginning of this tutorial: https://developer.mozilla.org/en-US/docs/

## Tools

- [Validate JSON](http://pro.jsonlint.com/) by pasting into this tool (or many other "linters") online. They will display the data properly and tell you if its valid JSON or not. If it is not valid, you might have trouble reading it into a programming language.
- [Validate JSON](https://jsonlint.com/) by pasting into this tool (or many other "linters") online. They will display the data properly and tell you if its valid JSON or not. If it is not valid, you might have trouble reading it into a programming language.

- JSON Formatter Chrome Extension: https://chrome.google.com/webstore/detail/json-formatter/mhimpmpmffogbmmkmajibklelopddmjf

Expand Down
2 changes: 1 addition & 1 deletion data/03-1-python-text-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ print(full_text)
```


### ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
### ➡️ Try It

Create a file called `name.txt` with your full name in it.

Expand Down
3 changes: 1 addition & 2 deletions data/03-2-python-csv-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ import csv
with open('testwrite.csv', 'r') as f:
reader = csv.DictReader(f)
rows = list(reader)
rows = [dict(row) for row in rows] # Convert OrderedDict to regular dict

print(rows)
```

Note that since we have loaded the entire CSV into memory in the variable `rows` we can now put our `for` loop outside of the context manager since we no longer need access to the file, `f`.


### ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
### ➡️ Try It

Write a python script called `veggies.py` that defines a list of dicts named vegetables like so:

Expand Down
6 changes: 3 additions & 3 deletions data/03-3-python-json-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ print(data)
```


### ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
### ➡️ Try It

In a new file called `cookveggies.py`

Expand All @@ -48,7 +48,7 @@ In a new file called `cookveggies.py`
]
```
### ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Example
### ❇️ Example
Download superheroes.json
Expand All @@ -67,7 +67,7 @@ then write a python program that
hint for bonus: To get the unique elements in a list use the `set` method. For example, try running `list(set([1, 1, 2, 3]))` in your python console. Alternatively you can use an if statement to only add the powers to the list if they are not already in there.
### ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
### ➡️ Try It
Lets Read `superheroes.json` (in this folder) and output a flat CSV of members. The columns should be: `name, age, secretIdentity, powers, squadName, homeTown, formed, secretBase, active`. Any column that is top level, such as `squadName` should just be repeated for every row.
Expand Down
2 changes: 1 addition & 1 deletion data/03-4-python-datetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ print(date_str)

Its often a good idea to put this conversion into a function if you plan to use it again.

### ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
### ➡️ Try It

1. Set a variable `birthday = "1-May-12"`.
2. Parse the date using `datetime.datetime.strptime`.
Expand Down
2 changes: 1 addition & 1 deletion data/03-5-python-filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ print(cool_people)

If you use Python's [Pandas](https://pandas.pydata.org/) library for data manipulation and analysis instead, the code would look like this: https://gist.github.com/AlJohri/59c9762845519f999eb28fe45276f4c1

### ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
### ➡️ Try It

1. Read `output/vegetables.csv` into a variable called `vegetables`.
2. Loop through `vegetables` and filter down to only green vegtables using a whitelist.
Expand Down
7 changes: 5 additions & 2 deletions data/03-6-python-grouping.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ This should output:
{'Honda': 1, 'Tesla': 1, 'Toyota': 4}
```

If you use Python's [Pandas](https://pandas.pydata.org/) library for data manipulation and analysis instead, the code would look like this: https://gist.github.com/AlJohri/59c9762845519f999eb28fe45276f4c1
#### A quick sidenote: PANDAS
If you're manipulating tabular data in Python, it may be a good idea to use the [Pandas](https://pandas.pydata.org/) library. This provides an abstraction called a "DataFrame" (you may be familiar with this if you've used other statistical programming languages like R. It is basically just a representation of a spreadsheet table, but in Python.

### ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Try It
If you use Python's [Pandas](https://pandas.pydata.org/) library for data manipulation and analysis instead, the code for the above assignment would look like this: https://gist.github.com/AlJohri/59c9762845519f999eb28fe45276f4c1

### ➡️ Try It

1. Read `vegtables.csv` into a variable called `vegtables`.
2. Group `vegtables` by `color` as a variable `vegtables_by_color`.
Expand Down
2 changes: 1 addition & 1 deletion data/03-8-python-practice.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Follow the instructions in this repository's README: https://github.com/code4pol

## Pandas

https://pandas.pydata.org/pandas-docs/stable/getting_started/10min.html
https://pandas.pydata.org/docs/user_guide/10min.html

## Demo of Jupyter Notebooks

Expand Down
7 changes: 3 additions & 4 deletions finalproject/01-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ The final project will take place in two sprints

**Sprint 1 - MVP**

- Section B - Jan 7-14
- Section A - Jan 8-15
First week of class + weekend (roughly)

**Sprint 2 - Submission**

- Section B - Jan 14-21
- Section A - Jan 15-21
Second week of class + weekend (roughly)


## Requirements

Expand Down
2 changes: 1 addition & 1 deletion finalproject/brainstorm.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You can find example D3 visualizations at the following places, but I'd also enc
- http://bl.ocks.org/ (same website, examples by different people)
-->

In this course you won't be asked to create your own D3 visualization (unless you want to try!). We will however, select an example visualization, and learn enough code to tweak it to suit the needs of your dataset. You will also manipulate the data in your dataset to fit the format that the visualization requires.
In this course you will be asked to create your own D3 visualization, but with the help of ChatGPT! We will use example visualizations, and learn enough code to tweak it to suit the needs of your dataset. You will also manipulate the data in your dataset to fit the format that the visualization requires.

This [graphic by FT Visual Journalism team](https://github.com/ft-interactive/chart-doctor/tree/master/visual-vocabulary) is a good starting point if you're not sure what type of visulization you need.

Expand Down
Loading

0 comments on commit a5be6aa

Please sign in to comment.