├── .gitignore ├── Gemfile ├── _config.yml ├── _includes ├── header.md └── nav.md ├── assets ├── css │ └── style.scss └── pdfs │ ├── ajax.pdf │ ├── algorithms.pdf │ ├── arrays_and_strings.pdf │ ├── artificial_intelligence_and_machine_learning.pdf │ ├── ascii.pdf │ ├── binary.pdf │ ├── binary_search.pdf │ ├── boolean_expressions.pdf │ ├── bubble_sort.pdf │ ├── bugs_and_debugging.pdf │ ├── command-line_interaction.pdf │ ├── compiling.pdf │ ├── computational_complexity.pdf │ ├── computers_and_computing.pdf │ ├── cpu_and_soc.pdf │ ├── css.pdf │ ├── cybersecurity.pdf │ ├── data_types.pdf │ ├── dns_and_dhcp.pdf │ ├── exit_codes.pdf │ ├── file_io.pdf │ ├── functions.pdf │ ├── hexadecimal.pdf │ ├── how_computers_work.pdf │ ├── html.pdf │ ├── http.pdf │ ├── images.pdf │ ├── insertion_sort.pdf │ ├── internet_basics.pdf │ ├── ip_addresses.pdf │ ├── javascript.pdf │ ├── libraries.pdf │ ├── linear_search.pdf │ ├── loops.pdf │ ├── memory.pdf │ ├── merge_sort.pdf │ ├── models_and_simulations.pdf │ ├── mvc.pdf │ ├── ncurses.pdf │ ├── operators.pdf │ ├── principles_of_good_design.pdf │ ├── pseudocode.pdf │ ├── python.pdf │ ├── python_for_web_programming.pdf │ ├── recursion.pdf │ ├── routers.pdf │ ├── scratch.pdf │ ├── selection_sort.pdf │ ├── sql.pdf │ ├── structures_and_encapsulation.pdf │ ├── syntax.pdf │ ├── tcp_and_ip.pdf │ ├── tools.pdf │ ├── transistors_and_logic.pdf │ ├── trust_models.pdf │ ├── typecasting.pdf │ ├── unsolvable_problems.pdf │ ├── variables.pdf │ ├── version_control_and_collaboration.pdf │ └── virtual_and_augmented_reality.pdf ├── curriculum ├── 0 │ ├── index.md │ └── notes │ │ ├── algorithms.png │ │ ├── animoji.png │ │ ├── answer.png │ │ ├── bounce.png │ │ ├── costume.png │ │ ├── cough_function.png │ │ ├── cough_function_2.png │ │ ├── count.png │ │ ├── emoji.png │ │ ├── emoji_zoomed.png │ │ ├── forever.png │ │ ├── hello_world.png │ │ ├── index.md │ │ ├── input_output.png │ │ ├── join.png │ │ ├── keyboard.png │ │ ├── marco.png │ │ ├── meow.png │ │ ├── meow_wait.png │ │ ├── oscartime.png │ │ ├── pet-0.png │ │ ├── polo.png │ │ ├── rgb.png │ │ ├── rgb_combined.png │ │ ├── running_time.png │ │ ├── scratch.png │ │ ├── seal.png │ │ └── unicode.png ├── 1 │ ├── index.md │ └── notes │ │ ├── ask_say.png │ │ ├── ask_say_join.png │ │ ├── change_counter_by_1.png │ │ ├── cs50_sandbox.png │ │ ├── editor.png │ │ ├── forever.png │ │ ├── if_else.png │ │ ├── if_else_if.png │ │ ├── if_x_y.png │ │ ├── index.md │ │ ├── repeat.png │ │ ├── say_hello_world.png │ │ ├── set_counter_to_0.png │ │ └── when_green_flag.png ├── 2 │ ├── index.md │ └── notes │ │ ├── index.md │ │ ├── ram.png │ │ └── zamyla.png ├── 3 │ ├── index.md │ └── notes │ │ ├── bitmap.png │ │ ├── breakpoint.png │ │ ├── cs50_ide.png │ │ ├── debugger_panel.png │ │ ├── index.md │ │ ├── memory_layout.png │ │ ├── pointers.png │ │ ├── stack.png │ │ ├── strings.png │ │ └── strings_with_addresses.png ├── 4 │ ├── index.md │ └── notes │ │ ├── index.md │ │ ├── linked_list.png │ │ ├── tree.png │ │ └── trie.png ├── 5 │ ├── index.md │ └── notes │ │ ├── dom.png │ │ ├── http_server.png │ │ ├── index.md │ │ ├── network.png │ │ ├── request.png │ │ ├── response.png │ │ └── view_source.png ├── 6 │ ├── index.md │ └── notes │ │ └── index.md ├── 7 │ ├── index.md │ └── notes │ │ ├── index.md │ │ ├── mvc.png │ │ ├── words1.png │ │ └── words2.png ├── 8 │ ├── index.md │ └── notes │ │ ├── create_table.png │ │ ├── faculty.png │ │ ├── index.md │ │ ├── phpliteadmin.png │ │ ├── schema.png │ │ └── store.png ├── data_science │ ├── analyzing_data │ │ └── notes │ │ │ ├── buoy_network.gif │ │ │ ├── buoys.jpg │ │ │ ├── index.md │ │ │ ├── top_100_words.jpg │ │ │ └── wave_graph.png │ ├── collecting_data │ │ └── notes │ │ │ ├── bias.jpg │ │ │ ├── bit_depth.gif │ │ │ ├── buoys.jpg │ │ │ ├── digital_sampling.png │ │ │ ├── index.md │ │ │ └── song_metadata.png │ └── index.md ├── impact_of_computing │ ├── index.md │ └── notes │ │ ├── cc.png │ │ ├── gofundme.png │ │ ├── index.md │ │ ├── kickstarter.png │ │ ├── landline.jpg │ │ ├── mobile_phone.jpg │ │ ├── shard.png │ │ └── warning.jpg ├── index.md └── understanding_technology │ ├── hardware │ ├── index.md │ └── notes │ │ ├── ascii.png │ │ ├── cpu.png │ │ ├── display.png │ │ ├── funnel.png │ │ ├── hddinside.png │ │ ├── hddout.png │ │ ├── index.md │ │ ├── mac.png │ │ ├── pi.png │ │ ├── ram.png │ │ ├── ssdinside.png │ │ ├── ssdout.png │ │ ├── tradeoff.png │ │ ├── usb.png │ │ └── windows.png │ ├── index.md │ ├── internet │ ├── index.md │ └── notes │ │ ├── happycat.jpg │ │ ├── homenetwork.png │ │ ├── index.md │ │ ├── mac.png │ │ ├── macadv.png │ │ ├── network.png │ │ ├── tracerouteberkeley.png │ │ ├── traceroutegoogle.png │ │ ├── traceroutejp.png │ │ ├── traceroutemit.png │ │ └── windows.png │ ├── multimedia │ ├── index.md │ └── notes │ │ ├── apples.png │ │ ├── band.png │ │ ├── garageband.png │ │ ├── index.md │ │ ├── interframe.png │ │ ├── nyan.gif │ │ ├── sanders.png │ │ ├── smile.png │ │ ├── sunflower1.png │ │ ├── sunflower2.png │ │ ├── vr.png │ │ ├── xp.png │ │ └── xpzoom.png │ └── security │ ├── index.md │ └── notes │ ├── alicebob.png │ ├── bob.png │ ├── index.md │ ├── phishing.png │ ├── rsa.png │ └── vpn.png ├── favicon.ico ├── index.md ├── periods ├── 1.md └── 5.md ├── syllabus.md └── tools.md /.gitignore: -------------------------------------------------------------------------------- 1 | .* 2 | !.gitignore 3 | 4 | _site 5 | 6 | Gemfile.lock 7 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | gem "github-pages", group: :jekyll_plugins 3 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | permalink: pretty 2 | 3 | plugins: 4 | - jekyll-remote-theme 5 | 6 | remote_theme: cs50/jekyll-theme-cs50 7 | 8 | title: CS50 AP 9 | -------------------------------------------------------------------------------- /_includes/header.md: -------------------------------------------------------------------------------- 1 | # [CS50 AP]({{ "/" | relative_url }}) 2 | 3 | Harvard University\\ 4 | 2019–2020 5 | -------------------------------------------------------------------------------- /_includes/nav.md: -------------------------------------------------------------------------------- 1 | *** 2 | 3 | * [CS50 IDE](https://ide.cs50.io/) 4 | * [CS50 Programmer's Manual](https://man.cs50.io/) 5 | 6 | *** 7 | 8 | * [Status Page](https://cs50.statuspage.io/) 9 | * [Style Guide](https://cs50.readthedocs.io/style/c/) 10 | 11 | *** 12 | 13 | * [**Curriculum**]({{ "/curriculum" | relative_url }}) 14 | * [Tools]({{ "/tools" | relative_url }}) 15 | * [Syllabus]({{"/syllabus" | relative_url }}) 16 | -------------------------------------------------------------------------------- /assets/css/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import "{{ site.theme }}"; -------------------------------------------------------------------------------- /assets/pdfs/ajax.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/ajax.pdf -------------------------------------------------------------------------------- /assets/pdfs/algorithms.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/algorithms.pdf -------------------------------------------------------------------------------- /assets/pdfs/arrays_and_strings.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/arrays_and_strings.pdf -------------------------------------------------------------------------------- /assets/pdfs/artificial_intelligence_and_machine_learning.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/artificial_intelligence_and_machine_learning.pdf -------------------------------------------------------------------------------- /assets/pdfs/ascii.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/ascii.pdf -------------------------------------------------------------------------------- /assets/pdfs/binary.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/binary.pdf -------------------------------------------------------------------------------- /assets/pdfs/binary_search.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/binary_search.pdf -------------------------------------------------------------------------------- /assets/pdfs/boolean_expressions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/boolean_expressions.pdf -------------------------------------------------------------------------------- /assets/pdfs/bubble_sort.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/bubble_sort.pdf -------------------------------------------------------------------------------- /assets/pdfs/bugs_and_debugging.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/bugs_and_debugging.pdf -------------------------------------------------------------------------------- /assets/pdfs/command-line_interaction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/command-line_interaction.pdf -------------------------------------------------------------------------------- /assets/pdfs/compiling.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/compiling.pdf -------------------------------------------------------------------------------- /assets/pdfs/computational_complexity.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/computational_complexity.pdf -------------------------------------------------------------------------------- /assets/pdfs/computers_and_computing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/computers_and_computing.pdf -------------------------------------------------------------------------------- /assets/pdfs/cpu_and_soc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/cpu_and_soc.pdf -------------------------------------------------------------------------------- /assets/pdfs/css.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/css.pdf -------------------------------------------------------------------------------- /assets/pdfs/cybersecurity.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/cybersecurity.pdf -------------------------------------------------------------------------------- /assets/pdfs/data_types.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/data_types.pdf -------------------------------------------------------------------------------- /assets/pdfs/dns_and_dhcp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/dns_and_dhcp.pdf -------------------------------------------------------------------------------- /assets/pdfs/exit_codes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/exit_codes.pdf -------------------------------------------------------------------------------- /assets/pdfs/file_io.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/file_io.pdf -------------------------------------------------------------------------------- /assets/pdfs/functions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/functions.pdf -------------------------------------------------------------------------------- /assets/pdfs/hexadecimal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/hexadecimal.pdf -------------------------------------------------------------------------------- /assets/pdfs/how_computers_work.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/how_computers_work.pdf -------------------------------------------------------------------------------- /assets/pdfs/html.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/html.pdf -------------------------------------------------------------------------------- /assets/pdfs/http.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/http.pdf -------------------------------------------------------------------------------- /assets/pdfs/images.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/images.pdf -------------------------------------------------------------------------------- /assets/pdfs/insertion_sort.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/insertion_sort.pdf -------------------------------------------------------------------------------- /assets/pdfs/internet_basics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/internet_basics.pdf -------------------------------------------------------------------------------- /assets/pdfs/ip_addresses.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/ip_addresses.pdf -------------------------------------------------------------------------------- /assets/pdfs/javascript.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/javascript.pdf -------------------------------------------------------------------------------- /assets/pdfs/libraries.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/libraries.pdf -------------------------------------------------------------------------------- /assets/pdfs/linear_search.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/linear_search.pdf -------------------------------------------------------------------------------- /assets/pdfs/loops.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/loops.pdf -------------------------------------------------------------------------------- /assets/pdfs/memory.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/memory.pdf -------------------------------------------------------------------------------- /assets/pdfs/merge_sort.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/merge_sort.pdf -------------------------------------------------------------------------------- /assets/pdfs/models_and_simulations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/models_and_simulations.pdf -------------------------------------------------------------------------------- /assets/pdfs/mvc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/mvc.pdf -------------------------------------------------------------------------------- /assets/pdfs/ncurses.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/ncurses.pdf -------------------------------------------------------------------------------- /assets/pdfs/operators.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/operators.pdf -------------------------------------------------------------------------------- /assets/pdfs/principles_of_good_design.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/principles_of_good_design.pdf -------------------------------------------------------------------------------- /assets/pdfs/pseudocode.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/pseudocode.pdf -------------------------------------------------------------------------------- /assets/pdfs/python.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/python.pdf -------------------------------------------------------------------------------- /assets/pdfs/python_for_web_programming.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/python_for_web_programming.pdf -------------------------------------------------------------------------------- /assets/pdfs/recursion.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/recursion.pdf -------------------------------------------------------------------------------- /assets/pdfs/routers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/routers.pdf -------------------------------------------------------------------------------- /assets/pdfs/scratch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/scratch.pdf -------------------------------------------------------------------------------- /assets/pdfs/selection_sort.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/selection_sort.pdf -------------------------------------------------------------------------------- /assets/pdfs/sql.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/sql.pdf -------------------------------------------------------------------------------- /assets/pdfs/structures_and_encapsulation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/structures_and_encapsulation.pdf -------------------------------------------------------------------------------- /assets/pdfs/syntax.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/syntax.pdf -------------------------------------------------------------------------------- /assets/pdfs/tcp_and_ip.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/tcp_and_ip.pdf -------------------------------------------------------------------------------- /assets/pdfs/tools.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/tools.pdf -------------------------------------------------------------------------------- /assets/pdfs/transistors_and_logic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/transistors_and_logic.pdf -------------------------------------------------------------------------------- /assets/pdfs/trust_models.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/trust_models.pdf -------------------------------------------------------------------------------- /assets/pdfs/typecasting.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/typecasting.pdf -------------------------------------------------------------------------------- /assets/pdfs/unsolvable_problems.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/unsolvable_problems.pdf -------------------------------------------------------------------------------- /assets/pdfs/variables.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/variables.pdf -------------------------------------------------------------------------------- /assets/pdfs/version_control_and_collaboration.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/version_control_and_collaboration.pdf -------------------------------------------------------------------------------- /assets/pdfs/virtual_and_augmented_reality.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/assets/pdfs/virtual_and_augmented_reality.pdf -------------------------------------------------------------------------------- /curriculum/0/index.md: -------------------------------------------------------------------------------- 1 | # Chapter 0 2 | 3 | * [Notes](notes) 4 | * Problem 5 | * [Scratch](https://docs.cs50.net/2019/ap/problems/scratch/scratch.html) 6 | * [Slides](https://cdn.cs50.net/2018/fall/lectures/0/lecture0.pdf) 7 | * Source Code from Lecture 8 | * [Index](https://cdn.cs50.net/2018/fall/lectures/0/src0/) 9 | * [ZIP](https://cdn.cs50.net/2018/fall/lectures/0/src0.zip) 10 | * [Syllabus]({{ "/syllabus" | relative_url }}) 11 | * [Video](https://video.cs50.net/2018/fall/lectures/0) 12 | * Reference Sheets 13 | * [Algorithms](https://ap.cs50.school/assets/pdfs/algorithms.pdf) 14 | * [ASCII](https://ap.cs50.school/assets/pdfs/ascii.pdf) 15 | * [Binary](https://ap.cs50.school/assets/pdfs/binary.pdf) 16 | * [Pseudocode](https://ap.cs50.school/assets/pdfs/pseudocode.pdf) 17 | * [Scratch](https://ap.cs50.school/assets/pdfs/scratch.pdf) 18 | -------------------------------------------------------------------------------- /curriculum/0/notes/algorithms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/algorithms.png -------------------------------------------------------------------------------- /curriculum/0/notes/animoji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/animoji.png -------------------------------------------------------------------------------- /curriculum/0/notes/answer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/answer.png -------------------------------------------------------------------------------- /curriculum/0/notes/bounce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/bounce.png -------------------------------------------------------------------------------- /curriculum/0/notes/costume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/costume.png -------------------------------------------------------------------------------- /curriculum/0/notes/cough_function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/cough_function.png -------------------------------------------------------------------------------- /curriculum/0/notes/cough_function_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/cough_function_2.png -------------------------------------------------------------------------------- /curriculum/0/notes/count.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/count.png -------------------------------------------------------------------------------- /curriculum/0/notes/emoji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/emoji.png -------------------------------------------------------------------------------- /curriculum/0/notes/emoji_zoomed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/emoji_zoomed.png -------------------------------------------------------------------------------- /curriculum/0/notes/forever.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/forever.png -------------------------------------------------------------------------------- /curriculum/0/notes/hello_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/hello_world.png -------------------------------------------------------------------------------- /curriculum/0/notes/index.md: -------------------------------------------------------------------------------- 1 | ## Lecture 0 2 | {:.no_toc} 3 | 4 | * TOC 5 | {:toc} 6 | 7 | ## Welcome 8 | 9 | * When David was a freshman, he was too intimidated to take any computer science classes. But even if the topic feels out of your comfort zone, know that we'll fill in all the blanks along the way, until we are all on the same page. 10 | * In fact, 68% of CS50 students have never taken a CS course before. 11 | * To support you, there is an amazing staff, sections, and office hours. 12 | * And importantly, too: 13 | > what ultimately matters in this course is not so much where you end up relative to your classmates but where you end up relative to where you started. 14 | 15 | ## What is computer science? 16 | 17 | * Computer science is fundamentally problem-solving, and programming alone or (more likely) collaboratively is one way to do that. 18 | * Collaboration is an important aspect of problem solving. It can take on many forms, such as communication or consultation. Collaboration helps us see diverse perspectives, which can help us avoid bias in the development of computing innovations. 19 | * We can think of problem-solving as the process of taking some input (details about our problem) and generate some output (the solution to our problem). The "black box" in the middle is what we'll gradually learn more and more about in this course.
20 | ![word "input", arrow into box, arrow out of box, word "output"](input_output.png) 21 | * We need a way to represent inputs in some standard way, and if our problem were to simply count the number of people in the lecture hall, we'd have many options. We could write tally marks on a board, or use our hands. In fact, with just one hand, we can use our fingers creatively: with just our thumb up, we could represent one; with our just index finger up, we could represent two; with both our thumb and index finger up, we could represent three. And by continuing to use a pattern of permutations, we could represent 32 different values with just five fingers! 22 | 23 | ## Binary 24 | 25 | * A computer, at the lowest level, stores data in binary, where there are just two digits, 0 and 1. And that maps to how our computers use electricity, which is easy to turn off or on. 26 | * As humans, we know the following represents one hundred and twenty-three. 27 | ``` 28 | 1 2 3 29 | ``` 30 | * The `3` is in the ones column, the `2` is in the tens column, and the `1` is in the hundreds column. 31 | * So `123` is 100×1 + 10×2 + 1×3 = 100 + 20 + 3 = 123. 32 | * In binary, with just two digits, we have powers of two for each place value: 33 |
 34 |   4 2 1
 35 |   0 0 0
 36 |   
37 | * This would still be equal to 0. 38 | * Now if we change the binary value to, say, `0 1 1`, the decimal value would be 3. 39 |
 40 |   4 2 1
 41 |   0 1 1
 42 |   
43 | * With enough bits, or binary digits, computers can count much higher. 44 | * To represent letters, all we need to do is decide how numbers map to letters. Some humans, many years ago, collectively decided on a standard mapping called [ASCII](https://en.wikipedia.org/wiki/ASCII). The letter "A", for example, is the number 65, and "B" is 66, and so on. 45 | * A byte is 8 bits, and we use that as a unit to manage bits. The number 72, for example, fits into one byte. 46 | * And computer programs know, based on the context of its code, whether the binary numbers should be interpreted as numbers, or letters, or even other media. 47 | 48 | ## Representing data 49 | 50 | * **Abstraction** is a concept in computer science where some low-level implementation (such as how data is ultimately stored in binary) is simplified or taken for granted, so we can use that implementation at a higher level (such as representing letters, that we can then use in our programs). 51 | * On a standard American keyboard, letters with accent marks, and many other symbols and characters, aren't visible: 52 | ![computer keyboard with labeled keys](keyboard.png) 53 | * To solve that problem, computers can represent letters with standards in addition to ASCII. 54 | * It turns out that both letters with accent marks, as well as emoji, can be represented as characters with multiple bytes, with a standard called [Unicode](https://en.wikipedia.org/wiki/Unicode) (one specific version of which is called UTF-8). 55 | ![text editor with various options for accent marks over the letter a](unicode.png) 56 | ![on-screen emoji selector](emoji.png) 57 | * When we receive an emoji, our computer is actually just receiving a decimal number like `128514` (`11111011000000010` in binary, if you can read that more easily) that it then maps to the image of the emoji. 58 | * Computers can also use binary to represent images. With three bytes, each representing some amount of red, green, and blue, we can represent millions of colors:
59 | ![red square labeled with 72, green square labeled with 73, blue square labeled with 33](rgb.png) 60 | * The red, green, and blue values are combined to get a light yellow color:
61 | ![light yellow square](rgb_combined.png) 62 | * Each image is comprised of thousands or millions of pixels, or squares of colors, that we can see once we zoom in far enough: 63 | ![zoomed-in emoji of laughing tears of joy with squares of pixels distinguishable](emoji_zoomed.png) 64 | * And videos are just many, many images displayed one after another, at some number of frames per second. 65 | * On newer iPhones, the "Animoji" feature is just lots of images, generated and displayed one after another: 66 | ![various animoji](animoji.png) 67 | * We can think of videos as abstractions over images, images as abstractions over pixels, and pixels as abstractions over bits. 68 | 69 | ## Algorithms 70 | 71 | * So now we can represent inputs and outputs. Inputs and outputs can come in various forms, such as tactile, audio, visual, or text. The black box earlier will contain *algorithms*, step-by-step instructions for solving a problem:
72 | ![box with word "algorithms"](algorithms.png) 73 | * Let's say we wanted to find a friend, Mike Smith, in a phone book. 74 | * We could start by flipping through the book, one page at a time, until we find Mike Smith or reach the end of the book. 75 | * We could also flip two pages at a time, but if we go too far, we'll have to know to go back a page. 76 | * But the most efficient way would be opening the phone book to the middle, decide whether Mike will be in the left half or right half of the book (because the book is alphabetized), and immediately throw away half of the problem. We can repeat this, dividing the problem in half each time. 77 | * In fact, we can represent the efficiency of each of those algorithms with a chart:
78 | ![chart with: "size of problem" as x-axis; "time to solve" as y-axis; red, steep straight line from origin to top of graph labeled "n"; yellow, less steep straight line from origin to top of graph labeled "n/2"; green, curved line that gets less and less steep from origin to right of graph labeled "log n"](running_time.png) 79 | * Our first solution, one page at a time, is like the red line: our time to solve increases linearly as the size of the problem increases. 80 | * The second solution, two pages at a time, is like the yellow line: our slope is less steep, but still linear. 81 | * Our final solution, is like the green line: logarithmic, since our time to solve rises more and more slowly as the size of the problem increases. In other words, if the phone book went from 1000 to 2000 pages, we would need one more step to find Mike. If the size doubled again from 2000 to 4000 pages, we would still only need one more step. 82 | * Instinctively, we knew how to solve this problem since we have encountered it in our day lives, but what if we didn't? We can think about solving a problem or designing a program with different strategies, including but not limited to: 83 | * brainstorming 84 | * planning and storyboarding 85 | * organizing the problem into several components or parts and solving each one modularly 86 | * creating diagrams or flow charts 87 | * developing a set of tests check if your program does the desired task 88 | * It is important to investigate multiple solutions based on the constraints of the problem to find the most efficient solution for the desired user. Some methods for investigating are: 89 | * collecting data via surveys 90 | * user testing 91 | * interviewing future users 92 | * direct observations 93 | * Interviewing future users play a large role in the development process as they can help provide multiple perspectives that the developer may not have thought about. 94 | 95 | ## Pseudocode 96 | 97 | * We can write *pseudocode*, an informal syntax that is just a more specific version of English (or other human language) that represents our algorithm: 98 |
 99 |    0 pick up phone book
100 |    1 open to middle of phone book
101 |    2 look at names
102 |    3 if Smith is among names
103 |    4     call Mike
104 |    5 else if Smith is earlier in book
105 |    6     open to middle of left half of book
106 |    7     go back to step 2
107 |    8 else if Smith is later in book
108 |    9     open to middle of right half of book
109 |   10     go back to step 2
110 |   11 else
111 |   12     quit
112 |   
113 | * Some of these lines start with verbs, or actions. We'll start calling these *functions*: 114 |
115 |    0 pick up phone book
116 |    1 open to middle of phone book
117 |    2 look at names
118 |    3 if Smith is among names
119 |    4     call Mike
120 |    5 else if Smith is earlier in book
121 |    6     open to middle of left half of book
122 |    7     go back to step 2
123 |    8 else if Smith is later in book
124 |    9     open to middle of right half of book
125 |   10     go back to step 2
126 |   11 else
127 |   12     quit
128 |   
129 | * We also have questions that lead to different paths, like forks in the road, which we'll call *conditions*: 130 |
131 |    0 pick up phone book
132 |    1 open to middle of phone book
133 |    2 look at names
134 |    3 if Smith is among names
135 |    4     call Mike
136 |    5 else if Smith is earlier in book
137 |    6     open to middle of left half of book
138 |    7     go back to step 2
139 |    8 else if Smith is later in book
140 |    9     open to middle of right half of book
141 |   10     go back to step 2
142 |   11 else
143 |   12     quit
144 |   
145 | * And the answers to questions that decide where we go are called *Boolean expressions*, which eventually result to a value of true or false: 146 |
147 |    0 pick up phone book
148 |    1 open to middle of phone book
149 |    2 look at names
150 |    3 if Smith is among names
151 |    4     call Mike
152 |    5 else if Smith is earlier in book
153 |    6     open to middle of left half of book
154 |    7     go back to step 2
155 |    8 else if Smith is later in book
156 |    9     open to middle of right half of book
157 |   10     go back to step 2
158 |   11 else
159 |   12     quit
160 |   
161 | * Finally, we have words that lead to cycles, where we can repeat parts of our program, called *loops*: 162 |
163 |    0 pick up phone book
164 |    1 open to middle of phone book
165 |    2 look at names
166 |    3 if Smith is among names
167 |    4     call Mike
168 |    5 else if Smith is earlier in book
169 |    6     open to middle of left half of book
170 |    7     go back to step 2
171 |    8 else if Smith is later in book
172 |    9     open to middle of right half of book
173 |   10     go back to step 2
174 |   11 else
175 |   12     quit
176 |   
177 | 178 | ## Scratch 179 | 180 | * We can write programs with the building blocks we just discovered: 181 | * functions 182 | * conditions 183 | * Boolean expressions 184 | * loops 185 | * We'll use a graphical programming language called [Scratch](https://scratch.mit.edu/), where we'll drag and drop blocks that contain instructions. 186 | * Later in our course, we'll move onto textual programming languages like C, and Python, and JavaScript. All of these languages, including Scratch, has more powerful features like: 187 | * variables 188 | * the ability to store values and change them 189 | * threads 190 | * the ability for our program to do multiple things at once 191 | * events 192 | * the ability to respond to changes in our program or inputs 193 | * ... 194 | * David's first program in Scratch was [Oscartime](https://scratch.mit.edu/projects/76196420/), which we play with a volunteer. The game involves clicking and dragging trash that falls from the top of the screen:
195 | ![screenshot of oscartime, with cartoon image of shoe being dropped into a cartoon image of trash can](oscartime.png) 196 | * We can already start to decompose the program for the game: 197 | * The animation of the trash can is a sequence of 3 images, displayed one after another. 198 | * The score was being stored in a variable, and increased with each piece of trash we dragged. 199 | * The programming environment for Scratch looks like this:
200 | ![screenshot of scratch](scratch.png) 201 | * On the left, we have puzzle pieces that represent functions or variables, or other concepts, that we can drag and drop into our instruction area in the center. 202 | * On the right, we have a stage that will be shown by our program to a human, where we can add or change backgrounds, characters (called sprites in Scratch), and more. 203 | * We can drag a few blocks to make Scratch say "hello, world":
204 | ![screenshot of hello, world](hello_world.png) 205 | * The "when green flag clicked" block is the start of our program, and below it we've snapped in a "say" block and typed in "hello, world". 206 | * We can also drag in the "ask and wait" block, with a question like "What's your name?", and combine it with a "say" block for the answer:
207 | ![screenshot of question and answer](answer.png) 208 | * We can use the "join" block to combine two phrases so Scratch can say "hello, David":
209 | ![screenshot of join](join.png) 210 | * Notice that we can nest instructions and variables. 211 | * We can try to make Scratch (the name of the cat) say meow:
212 | ![three blocks labeled "start sound Meow", one after the other](meow.png) 213 | * But when we click the green flag, we only hear the meow sound once. Our first bug, or mistake! It turns out that computers can do things really quickly, so it went to each block, started playing the sound, and moved on to the next block. So all three "meow"s overlapped and sounded like one. 214 | * We can fix this with "play sound until done", and even "wait" before we say meow again:
215 | ![three blocks labeled "play sound Meow until done", with a "wait 1 second" block between each](meow_wait.png) 216 | * We can copy and paste these blocks over and over again, but our program can have better design if we use a loop, like the "forever" block:
217 | ![blocks labeled "play sound Meow until done" and "wait 1 second", nested inside a block that is labeled "forever"](forever.png) 218 | * We have another program, [counting sheep](https://scratch.mit.edu/projects/26329219/):
219 | ![blocks labeled "set counter to 1", "forever", "say counter for 1 seconds", "wait 1 seconds", "change counter by 1"](count.png) 220 | * Here, "counter" is a variable where we store a value, and increase it every time our sheep says it. 221 | * We can have our sheep double the counter each time, and if we wait a while, eventually the sheep gives up and says "infinity". Since computers has to store values physically, there is only a finite number of bits. The programmer (in this case, the writers of the Scratch language) will have to decide on a limit to how many bits are used for each type of variable, as well as how to handle reaching those limits. 222 | * We can tinker with other blocks, and have Scratch meow when we "pet" him with our mouse pointer:
223 | ![blocks labeled "forever", "if touching mouse pointer then", "play sound meow until done"](pet-0.png) 224 | * We need the "forever" block because, otherwise, our program would check that condition at the very beginning, and then stop. 225 | * We can also use the "if else" block to have different sounds play depending on the condition. 226 | * With a few more blocks, we can make Scratch move on the screen, left and right:
227 | ![blocks labeled "set rotation style left-right", "forever", "move 10 steps", "if touching edge then", "turn 180 degrees"](bounce.png) 228 | * And if we find some images of Scratch with his legs in various positions, we can even simulate walking:
229 | ![blocks labeled "set rotation style left-right", "forever", "move 10 steps", "if touching edge then", "turn 180 degrees", "next costume"](costume.png) 230 | * In another tab called "Costumes", we can set what Scratch looks like in each frame. And animation is just a more complex version of this. 231 | * By exploring what other blocks we have available, we can have Scratch follow us with blocks like "point toward mouse cursor". 232 | * We can also have multiple scripts, or snippets of code, in the same program:
233 | ![two sets of blocks, each under a "when green flag clicked" block. the first set of blocks is: "set muted to false", "forever", "if key space pressed then", "if muted = false then", "set muted to true", "else", "set muted to false", "wait 1 seconds". the second set is: "forever", "if muted = false then", "start sound SeaLion", "think hi hi hi for 2 seconds", "wait 1 seconds"](seal.png) 234 | * With the space bar, we can change the value of the variable called "muted", and the second script will play the sound or not depending on the value of "muted". 235 | * With events, we can have two sprites, each with their own script, interact with each other:
236 | ![blocks labeled "forever", "if key space pressed? then", "say Marco for 2 seconds", "broadcast event"](marco.png)
237 | ![blocks labeled "when I receive event", "say Polo for 2 seconds"](polo.png) 238 | * We put these sets of blocks on different sprites, and now when we click the green flag, one says "Marco" and the other says "Polo" on its own! 239 | * One sign of a poorly designed program is one where we copy and paste the same code over and over again. The acronym of DRY, or "Don't Repeat Yourself", is a good reminder. For example, instead of duplicating the same blocks, we can use a "repeat" block to do something over and over again. 240 | * The next step is abstracting away some of our code into a function. We can make a block called "cough" and put some blocks inside it:
241 | ![two sets of blocks. the first set of blocks is: "define cough", "say cough for 1 seconds", "wait 1 seconds". the second set is: "when green flag clicked", "repeat 3", "cough"](cough_function.png) 242 | * Now, all of our sprites can use the same "cough" block, in as many places as we'd like. 243 | * We can even put a number of times into our cough function, so we only need a single block to cough any number of times:
244 | ![two sets of blocks. the first set of blocks is: "define cough n times", "repeat n", say cough for 1 seconds", "wait 1 seconds". the second set is: "when green flag clicked", "cough 3 times"](cough_function_2.png) 245 | * As we use higher-level programming languages, we'll see more examples of how collections of code written by others, called libraries, will be useful for us to write programs of our own. 246 | * We play more examples of interactive games, written by former students. 247 | * Welcome aboard! 248 | -------------------------------------------------------------------------------- /curriculum/0/notes/input_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/input_output.png -------------------------------------------------------------------------------- /curriculum/0/notes/join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/join.png -------------------------------------------------------------------------------- /curriculum/0/notes/keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/keyboard.png -------------------------------------------------------------------------------- /curriculum/0/notes/marco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/marco.png -------------------------------------------------------------------------------- /curriculum/0/notes/meow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/meow.png -------------------------------------------------------------------------------- /curriculum/0/notes/meow_wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/meow_wait.png -------------------------------------------------------------------------------- /curriculum/0/notes/oscartime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/oscartime.png -------------------------------------------------------------------------------- /curriculum/0/notes/pet-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/pet-0.png -------------------------------------------------------------------------------- /curriculum/0/notes/polo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/polo.png -------------------------------------------------------------------------------- /curriculum/0/notes/rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/rgb.png -------------------------------------------------------------------------------- /curriculum/0/notes/rgb_combined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/rgb_combined.png -------------------------------------------------------------------------------- /curriculum/0/notes/running_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/running_time.png -------------------------------------------------------------------------------- /curriculum/0/notes/scratch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/scratch.png -------------------------------------------------------------------------------- /curriculum/0/notes/seal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/seal.png -------------------------------------------------------------------------------- /curriculum/0/notes/unicode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/0/notes/unicode.png -------------------------------------------------------------------------------- /curriculum/1/index.md: -------------------------------------------------------------------------------- 1 | # Chapter 1 2 | 3 | * [Notes](notes) 4 | * Problems 5 | * [Hello](https://docs.cs50.net/2019/ap/problems/hello/hello.html) 6 | * [Fahrenheit](https://docs.cs50.net/2019/ap/problems/fahrenheit/fahrenheit.html) 7 | * [ISBN](https://docs.cs50.net/2019/ap/problems/isbn/isbn.html) 8 | * [Pennies](https://docs.cs50.net/2019/ap/problems/pennies/pennies.html) 9 | * [Cash](https://docs.cs50.net/2019/ap/problems/cash/cash.html) or [Credit](https://docs.cs50.net/2019/ap/problems/credit/credit.html) 10 | * [Mario(less comfy)](https://docs.cs50.net/2019/ap/problems/mario/less/mario.html) or [Mario(more comfy)](https://docs.cs50.net/2019/ap/problems/mario/more/mario.html) 11 | * Shorts 12 | * [Command Line](https://www.youtube.com/watch?v=lnYKOnz9ln8) 13 | * [Conditional Statements](https://www.youtube.com/watch?v=FqUeHzvci10) 14 | * [Data Types](https://www.youtube.com/watch?v=q6K8KMqt8wQ) 15 | * [Loops](https://www.youtube.com/watch?v=QOvo-xFL9II) 16 | * [Operators](https://www.youtube.com/watch?v=7apBtlEkJzk) 17 | * [Slides](https://cdn.cs50.net/2018/fall/lectures/1/lecture1.pdf) 18 | * Source Code 19 | * [Index](https://cdn.cs50.net/2018/fall/lectures/1/src1/) 20 | * [PDF](https://cdn.cs50.net/2018/fall/lectures/1/src1.pdf) 21 | * [Sandbox](https://sandbox.cs50.io/fbe800b2-4c6f-4bf4-8642-a853ee08ce5d) 22 | * [ZIP](https://cdn.cs50.net/2018/fall/lectures/1/src1.zip) 23 | * [Video](https://video.cs50.net/2018/fall/lectures/1) 24 | * Reference Sheets 25 | * [Boolean Expressions](https://ap.cs50.school/assets/pdfs/boolean_expressions.pdf) 26 | * [Data Types](https://ap.cs50.school/assets/pdfs/data_types.pdf) 27 | * [Functions](https://ap.cs50.school/assets/pdfs/functions.pdf) 28 | * [Libraries](https://ap.cs50.school/assets/pdfs/libraries.pdf) 29 | * [Loops](https://ap.cs50.school/assets/pdfs/loops.pdf) 30 | * [Operators](https://ap.cs50.school/assets/pdfs/operators.pdf) 31 | * [Principles of Good Design](https://ap.cs50.school/assets/pdfs/principles_of_good_design.pdf) 32 | * [Syntax](https://ap.cs50.school/assets/pdfs/syntax.pdf) 33 | * [Variables](https://ap.cs50.school/assets/pdfs/variables.pdf) 34 | -------------------------------------------------------------------------------- /curriculum/1/notes/ask_say.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/ask_say.png -------------------------------------------------------------------------------- /curriculum/1/notes/ask_say_join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/ask_say_join.png -------------------------------------------------------------------------------- /curriculum/1/notes/change_counter_by_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/change_counter_by_1.png -------------------------------------------------------------------------------- /curriculum/1/notes/cs50_sandbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/cs50_sandbox.png -------------------------------------------------------------------------------- /curriculum/1/notes/editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/editor.png -------------------------------------------------------------------------------- /curriculum/1/notes/forever.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/forever.png -------------------------------------------------------------------------------- /curriculum/1/notes/if_else.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/if_else.png -------------------------------------------------------------------------------- /curriculum/1/notes/if_else_if.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/if_else_if.png -------------------------------------------------------------------------------- /curriculum/1/notes/if_x_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/if_x_y.png -------------------------------------------------------------------------------- /curriculum/1/notes/repeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/repeat.png -------------------------------------------------------------------------------- /curriculum/1/notes/say_hello_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/say_hello_world.png -------------------------------------------------------------------------------- /curriculum/1/notes/set_counter_to_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/set_counter_to_0.png -------------------------------------------------------------------------------- /curriculum/1/notes/when_green_flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/1/notes/when_green_flag.png -------------------------------------------------------------------------------- /curriculum/2/index.md: -------------------------------------------------------------------------------- 1 | # Chapter 2 2 | 3 | * Demos 4 | * [Sorting Algorithms Animations](https://www.toptal.com/developers/sorting-algorithms) 5 | * [What different sorting algorithms sound like](https://www.youtube.com/watch?v=t8g-iYGHpEA) 6 | * [Notes](notes) 7 | * Problems 8 | * [Old Friends](https://docs.cs50.net/2019/ap/problems/friends/friends.html) 9 | * [Calc](https://docs.cs50.net/2019/ap/problems/calc/calc.html) 10 | * [Caesar](https://docs.cs50.net/2019/ap/problems/caesar/caesar.html) 11 | * [Crack](https://docs.cs50.net/2019/ap/problems/crack/crack.html) or [Vigenère](https://docs.cs50.net/2019/ap/problems/vigenere/vigenere.html) 12 | * Shorts 13 | * [Algorithms summary](https://www.youtube.com/watch?v=ktWL3nN38ZA) 14 | * [Arrays](https://www.youtube.com/watch?v=mISkNAfWl8k) 15 | * [Binary search](https://www.youtube.com/watch?v=T98PIp4omUA) 16 | * [Bubble sort](https://www.youtube.com/watch?v=RT-hUXUWQ2I) 17 | * [Command line](https://www.youtube.com/watch?v=thL7ILwRNMM) 18 | * [Debugging](https://www.youtube.com/watch?v=w4TAY2HPLEg) 19 | * [Functions](https://www.youtube.com/watch?v=b7-0sb-DV84) 20 | * [Insertion sort](https://www.youtube.com/watch?v=O0VbBkUvriI) 21 | * [Linear search](https://www.youtube.com/watch?v=TwsgCHYmbbA) 22 | * [Merge sort](https://www.youtube.com/watch?v=Ns7tGNbtvV4) 23 | * [Selection sort](https://www.youtube.com/watch?v=3hH8kTHFw2A) 24 | * [Slides](https://cdn.cs50.net/2018/fall/lectures/2/lecture2.pdf) 25 | * Source Code 26 | * [Index](https://cdn.cs50.net/2018/fall/lectures/2/src2/) 27 | * [PDF](https://cdn.cs50.net/2018/fall/lectures/2/src2.pdf) 28 | * [Sandbox](https://sandbox.cs50.io/edf25846-8cf8-4391-bda0-8649f25ac1e2) 29 | * [ZIP](https://cdn.cs50.net/2018/fall/lectures/2/src2.zip) 30 | * [Video](https://video.cs50.net/2018/fall/lectures/2) 31 | * Reference Sheets 32 | * [Arrays and Strings](https://ap.cs50.school/assets/pdfs/arrays_and_strings.pdf) 33 | * [Binary Search](https://ap.cs50.school/assets/pdfs/binary_search.pdf) 34 | * [Bubble Sort](https://ap.cs50.school/assets/pdfs/bubble_sort.pdf) 35 | * [Command-Line Interaction](https://ap.cs50.school/assets/pdfs/command-line_interaction.pdf) 36 | * [Compiling](https://ap.cs50.school/assets/pdfs/compiling.pdf) 37 | * [Computational Complexity](https://ap.cs50.school/assets/pdfs/computational_complexity.pdf) 38 | * [Exit Codes](https://ap.cs50.school/assets/pdfs/exit_codes.pdf) 39 | * [Insertion Sort](https://ap.cs50.school/assets/pdfs/insertion_sort.pdf) 40 | * [Linear Search](https://ap.cs50.school/assets/pdfs/linear_search.pdf) 41 | * [Merge Sort](https://ap.cs50.school/assets/pdfs/merge_sort.pdf) 42 | * [Recursion](https://ap.cs50.school/assets/pdfs/recursion.pdf) 43 | * [Selection Sort](https://ap.cs50.school/assets/pdfs/selection_sort.pdf) 44 | * [Typecasting](https://ap.cs50.school/assets/pdfs/typecasting.pdf) 45 | -------------------------------------------------------------------------------- /curriculum/2/notes/ram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/2/notes/ram.png -------------------------------------------------------------------------------- /curriculum/2/notes/zamyla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/2/notes/zamyla.png -------------------------------------------------------------------------------- /curriculum/3/index.md: -------------------------------------------------------------------------------- 1 | # Chapter 3 2 | 3 | * Clips 4 | * [CSI Zoom Enhance](https://www.youtube.com/watch?v=i3gv2zOmJiA) 5 | * [Let's Enhance](https://www.youtube.com/watch?v=17MctJPzR8w) 6 | * [Pointer Fun with Binky](https://www.youtube.com/watch?v=_d0jFalGxnQ) 7 | * [Notes](notes) 8 | * Problems 9 | * [Fifteen](https://docs.cs50.net/2019/ap/problems/fifteen/fifteen.html) 10 | * [Whodunit](https://docs.cs50.net/2019/ap/problems/whodunit/whodunit.html) 11 | * [Resize (less comfy)](https://docs.cs50.net/2019/ap/problems/resize/less/resize.html) or [Resize (more comfy)](https://docs.cs50.net/2019/ap/problems/resize/more/resize.html) 12 | * [Recover](https://docs.cs50.net/2019/ap/problems/recover/recover.html) 13 | * Shorts 14 | * [Call Stacks](https://www.youtube.com/watch?v=aCPkszeKRa4) 15 | * [Dynamic Memory Allocation](https://www.youtube.com/watch?v=xa4ugmMDhiE) 16 | * [File Pointers](https://www.youtube.com/watch?v=-BNy3eEBGt0) 17 | * [Hexadecimal](https://www.youtube.com/watch?v=8okwMK6htKE) 18 | * [Pointers](https://www.youtube.com/watch?v=8VAhORT0ZW8) 19 | * [Recursion](https://www.youtube.com/watch?v=nrXIMgInokU) 20 | * [Slides](https://cdn.cs50.net/2018/fall/lectures/3/lecture3.pdf) 21 | * Source Code 22 | * [CS50 Library](https://github.com/cs50/libcs50/tree/develop/src) 23 | * [Index](https://cdn.cs50.net/2018/fall/lectures/3/src3/) 24 | * [PDF](https://cdn.cs50.net/2018/fall/lectures/3/src3.pdf) 25 | * [Sandbox](https://sandbox.cs50.io/13f78b0a-70db-4dc3-90f5-87164e38d431) 26 | * [ZIP](https://cdn.cs50.net/2018/fall/lectures/3/src3.zip) 27 | * [Video](https://video.cs50.net/2018/fall/lectures/3/) 28 | * Reference Sheets 29 | * [Bugs and Debugging](https://ap.cs50.school/assets/pdfs/bugs_and_debugging.pdf) 30 | * [File I/O](https://ap.cs50.school/assets/pdfs/file_io.pdf) 31 | * [Hexadecimal](https://ap.cs50.school/assets/pdfs/hexadecimal.pdf) 32 | * [Images](https://ap.cs50.school/assets/pdfs/images.pdf) 33 | * [Structures and Encapsulation](https://ap.cs50.school/assets/pdfs/structures_and_encapsulation.pdf) 34 | -------------------------------------------------------------------------------- /curriculum/3/notes/bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/3/notes/bitmap.png -------------------------------------------------------------------------------- /curriculum/3/notes/breakpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/3/notes/breakpoint.png -------------------------------------------------------------------------------- /curriculum/3/notes/cs50_ide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/3/notes/cs50_ide.png -------------------------------------------------------------------------------- /curriculum/3/notes/debugger_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/3/notes/debugger_panel.png -------------------------------------------------------------------------------- /curriculum/3/notes/memory_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/3/notes/memory_layout.png -------------------------------------------------------------------------------- /curriculum/3/notes/pointers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/3/notes/pointers.png -------------------------------------------------------------------------------- /curriculum/3/notes/stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/3/notes/stack.png -------------------------------------------------------------------------------- /curriculum/3/notes/strings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/3/notes/strings.png -------------------------------------------------------------------------------- /curriculum/3/notes/strings_with_addresses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/3/notes/strings_with_addresses.png -------------------------------------------------------------------------------- /curriculum/4/index.md: -------------------------------------------------------------------------------- 1 | # Chapter 4 2 | 3 | * Problem 4 | * [Speller (hash table)](https://docs.cs50.net/2019/ap/problems/speller/hashtable/speller.html) of [Speller (trie)](https://docs.cs50.net/2019/ap/problems/speller/trie/speller.html) 5 | * [Notes](notes) 6 | * Shorts 7 | * [Custom data types](https://www.youtube.com/watch?v=crxfzK3Oc9M) 8 | * [Data structures](https://www.youtube.com/watch?v=Ryz5KK5G8Sc) 9 | * [Hash tables](https://www.youtube.com/watch?v=a97eCq6EN88) 10 | * [Linked lists](https://www.youtube.com/watch?v=xdkSNe43iNM) 11 | * [Tries](https://www.youtube.com/watch?v=MTxh0kx1Vvs) 12 | * [Slides](https://cdn.cs50.net/2018/fall/lectures/4/lecture4.pdf) 13 | * Source Code 14 | * [Index](https://cdn.cs50.net/2018/fall/lectures/4/src4/) 15 | * [PDF](https://cdn.cs50.net/2018/fall/lectures/4/src4.pdf) 16 | * [Sandbox](https://sandbox.cs50.io/86b99f4c-deb6-4a5b-8d1f-75d5dbf9a35d) 17 | * [ZIP](https://cdn.cs50.net/2018/fall/lectures/4/src4.zip) 18 | * [Video](https://video.cs50.net/2018/fall/lectures/4) 19 | -------------------------------------------------------------------------------- /curriculum/4/notes/linked_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/4/notes/linked_list.png -------------------------------------------------------------------------------- /curriculum/4/notes/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/4/notes/tree.png -------------------------------------------------------------------------------- /curriculum/4/notes/trie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/4/notes/trie.png -------------------------------------------------------------------------------- /curriculum/5/index.md: -------------------------------------------------------------------------------- 1 | # Chapter 5 2 | 3 | * [Notes](notes) 4 | * Problems 5 | * [Defender of the Web](https://docs.cs50.net/2019/ap/problems/defender/defender.html) 6 | * [Be the Teacher](https://docs.cs50.net/2019/ap/problems/teacher/teacher.html) 7 | * [Homepage](https://docs.cs50.net/2019/ap/problems/homepage/homepage.html) 8 | * Shorts 9 | * [CSS](https://www.youtube.com/watch?v=Ub3FKU21ubk) 10 | * [HTML](https://www.youtube.com/watch?v=YK78KhMf7bs) 11 | * [HTTP](https://www.youtube.com/watch?v=4axL8Gfw2nI) 12 | * [Internet primer](https://www.youtube.com/watch?v=04GztBlVo_s) 13 | * [IP](https://www.youtube.com/watch?v=A1g9SokDJSU) 14 | * [JavaScript](https://www.youtube.com/watch?v=Z93IaNfavZw) 15 | * [TCP](https://www.youtube.com/watch?v=GP7uvI_6uas) 16 | * [Slides](https://cdn.cs50.net/2018/fall/lectures/5/lecture5.pdf) 17 | * Source Code 18 | * [Index](https://cdn.cs50.net/2018/fall/lectures/5/src5/) 19 | * [PDF](https://cdn.cs50.net/2018/fall/lectures/5/src5.pdf) 20 | * [Sandbox](https://sandbox.cs50.io/b0df4352-0dac-4722-bfc7-fe58e4c91bf5), in which you can run `http-server` and then click circular reload icon in embedded browser 21 | * [ZIP](https://cdn.cs50.net/2018/fall/lectures/5/src5.zip) 22 | * [Video](https://video.cs50.net/2018/fall/lectures/5) 23 | * Reference Sheets 24 | * [CSS](https://ap.cs50.school/assets/pdfs/css.pdf) 25 | * [DNS and DHCP](https://ap.cs50.school/assets/pdfs/dns_and_dhcp.pdf) 26 | * [HTML](https://ap.cs50.school/assets/pdfs/html.pdf) 27 | * [HTTP](https://ap.cs50.school/assets/pdfs/http.pdf) 28 | * [Internet Basics](https://ap.cs50.school/assets/pdfs/internet_basics.pdf) 29 | * [IP Addresses](https://ap.cs50.school/assets/pdfs/ip_addresses.pdf) 30 | * [JavaScript](https://ap.cs50.school/assets/pdfs/javascript.pdf) 31 | * [TCP and IP](https://ap.cs50.school/assets/pdfs/tcp_and_ip.pdf) 32 | -------------------------------------------------------------------------------- /curriculum/5/notes/dom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/5/notes/dom.png -------------------------------------------------------------------------------- /curriculum/5/notes/http_server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/5/notes/http_server.png -------------------------------------------------------------------------------- /curriculum/5/notes/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/5/notes/network.png -------------------------------------------------------------------------------- /curriculum/5/notes/request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/5/notes/request.png -------------------------------------------------------------------------------- /curriculum/5/notes/response.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/5/notes/response.png -------------------------------------------------------------------------------- /curriculum/5/notes/view_source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/5/notes/view_source.png -------------------------------------------------------------------------------- /curriculum/6/index.md: -------------------------------------------------------------------------------- 1 | # Chapter 6 2 | 3 | * [Notes](notes) 4 | * Problems 5 | * [Analyze This](https://docs.cs50.net/2019/ap/problems/analyze/analyze.html) 6 | * Sentimental 7 | * [Hello](https://docs.cs50.net/2019/ap/problems/sentimental/hello/hello.html) 8 | * [Mario(less)](https://docs.cs50.net/2019/ap/problems/sentimental/mario/less/mario.html) or [Mario(more)](https://docs.cs50.net/2019/ap/problems/sentimental/mario/more/mario.html) 9 | * [Cash](https://docs.cs50.net/2019/ap/problems/sentimental/cash/cash.html) or [Credit](https://docs.cs50.net/2019/ap/problems/sentimental/credit/credit.html) 10 | * [Caesar](https://docs.cs50.net/2019/ap/problems/sentimental/caesar/caesar.html), [Vigenère](https://docs.cs50.net/2019/ap/problems/sentimental/vigenere/vigenere.html), or [Crack](https://docs.cs50.net/2019/ap/problems/sentimental/crack/crack.html) 11 | * [Bleep](https://docs.cs50.net/2019/ap/problems/bleep/bleep.html) 12 | * [Slides](https://cdn.cs50.net/2018/fall/lectures/6/lecture6.pdf) 13 | * Source Code 14 | * [Index](https://cdn.cs50.net/2018/fall/lectures/6/src6/) 15 | * [PDF](https://cdn.cs50.net/2018/fall/lectures/6/src6.pdf) 16 | * [Sandbox](https://sandbox.cs50.io/bf2e6473-45bc-4ac4-bee2-7cd9b89aa6a8) 17 | * [ZIP](https://cdn.cs50.net/2018/fall/lectures/6/src6.zip) 18 | * [Video](https://video.cs50.net/2018/fall/lectures/6) 19 | * Reference Sheet 20 | * [Python](https://ap.cs50.school/assets/pdfs/python.pdf) 21 | -------------------------------------------------------------------------------- /curriculum/6/notes/index.md: -------------------------------------------------------------------------------- 1 | # Lecture 6 2 | {:.no_toc} 3 | 4 | * TOC 5 | {:toc} 6 | 7 | ## Last Time 8 | 9 | * We learned some basics about the internet, and technologies like: 10 | * TCP/IP, protocols by which computers can send each other messages across a network of many computers, using IP addresses and port numbers. 11 | * HTTP, a protocol by which browsers, and other programs, can make a request for a webpage (or other content) from a server. 12 | * URLs, including a domain name and parameters like `?q=cats`, to pass along additional inputs to a server. 13 | * HTTP status codes, like 404 Not Found, which shows us an error page, and 301 Moved Permanently, which redirects us to the right URL if a website has moved. 14 | * HTML and CSS, languages by which we can format and stylize webpages. 15 | * JavaScript and the DOM, Document Object Model, by which we can change nodes in a tree representation of an HTML page, thereby changing the page itself. 16 | 17 | ## Python 18 | 19 | * Python is another programming language, but it is interpreted (run top to bottom by an interpreter, like JavaScript) and higher-level (including features and libraries that are more powerful). 20 | * For example, we can implement the entire `resize` program in just a few lines with Python: 21 | ```python 22 | import sys 23 | from PIL import Image 24 | 25 | if len(sys.argv) != 4: 26 | sys.exit("Usage: python resize.py n infile outfile") 27 | 28 | n = int(sys.argv[1]) 29 | infile = sys.argv[2] 30 | outfile = sys.argv[3] 31 | 32 | inimage = Image.open(infile) 33 | width, height = inimage.size 34 | outimage = inimage.resize((width * n, height * n)) 35 | 36 | outimage.save(outfile) 37 | ``` 38 | * First, we `import` (like `include`) a `sys` library (for command-line arguments) and an `Image` library. 39 | * We check that there are the right number of command-line arguments with `len(sys.argv)`, and then create some variables `n`, `infile`, and `outfile`, without having to specify their types. 40 | * Then, we use the Image library to open the input image, getting its width and height, resizing it with a `resize` function, and finally saving it to an output file. 41 | * Let's take a look at some new syntax. In Python, we can create variables with just `counter = 0`. To increment a variable, we can use `counter = counter + 1` or `counter += 1`. 42 | * Conditions look like: 43 | ```python 44 | if x < y: 45 | something 46 | elif: 47 | something 48 | else: 49 | something 50 | ``` 51 | * Unlike in C and JavaScript (whereby braces `{` `}` are used for blocks of code), the exact indentation of each line is what determines the level of nesting in Python. 52 | * Boolean expressions are slightly different, too: 53 | ```python 54 | while True: 55 | something 56 | ``` 57 | * Loops can be created with another function, `range`, that, in the example below, returns a range of numbers from 0, up to but not including 50: 58 | ```python 59 | for i in range(50): 60 | something 61 | ``` 62 | * In Python, we'll start by looking at just a few data types: 63 | * `bool`, `True` or `False` 64 | * `float`, real numbers 65 | * `int`, integers 66 | * `str`, strings 67 | * `dict`, a dictionary of key-value pairs, that act like hash tables 68 | * `list`, like arrays, but can automatically resize 69 | * `range`, range of values 70 | * `set`, a collection of unique things 71 | * `tuple`, a group of two or more things 72 | * In Python, we can too include the CS50 library, but our syntax will be: 73 | ```python 74 | from cs50 import get_float, get_int, get_string 75 | ``` 76 | * Notice that we specify the functions we want to use. 77 | * In Python, we can run our program without compiling it with `python hello.py` (or whatever the name of our file is). 78 | * `python` is name of the program that we're actually running at the command line, and it is an interpreter which can read our source code (written in the language Python) and run it, one line at a time. (Technically, there is a compiler that turns our source code into something called bytecode that the interpreter actually runs, but that is abstracted away for us.) 79 | 80 | ## Data types in Python 81 | 82 | * Our first `hello.py` program is just: 83 | ```python 84 | print("hello, world") 85 | ``` 86 | * Notice that we didn't need a `main` function, or anything that we needed to import for the `print` function. The `print` function in Python also adds a new line for us automatically. 87 | * Now we can run it with `python hello.py`. 88 | * We can get strings from a user: 89 | ```python 90 | from cs50 import get_string 91 | 92 | s = get_string("Name: ") 93 | print("hello,", s) 94 | ``` 95 | * We create a variable called `s`, without specifying the type, and we can pass in multiple variables into the `print` function, which will print them for us on the same line, separated by a space automatically. 96 | * To avoid the extra spaces, we can put variables inside a string similar to how they are included in C: `print(f"hello, {s}")`. Here, we're saying that the string `hello, {s}` is a formatted string, with the `f` in front of the string, and so the variable `s` will be substituted in the string. And we don't need to worry about the variable type; we can just include them inside strings. 97 | * We can do some math, too: 98 | ```python 99 | from cs50 import get_int 100 | 101 | x = get_int("x: ") 102 | 103 | y = get_int("y: ") 104 | 105 | print(f"x + y = {x + y}") 106 | print(f"x - y = {x - y}") 107 | print(f"x * y = {x * y}") 108 | print(f"x / y = {x / y}") 109 | print(f"x mod y = {x % y}") 110 | ``` 111 | * Notice that expressions like `{x + y}` will be evaluated, or calculated, before it's substituted into the string to be printed. 112 | * By running this program, we see that everything works as we might expect, even dividing two integers to get a floating-point value. (To keep the old behavior of always returning a truncated integer with division, there is the `//` operator.) 113 | * We can experiment with floating-point values: 114 | ```python 115 | from cs50 import get_float 116 | 117 | x = get_float("x: ") 118 | 119 | y = get_float("y: ") 120 | 121 | z = x / y 122 | 123 | print(f"x / y = {z}") 124 | ``` 125 | * We see the following when we run this program: 126 | ``` 127 | $ python floats.py 128 | x: 1 129 | y: 10 130 | x / y = 0.1 131 | ``` 132 | * We can print more decimal places with syntax like `print(f"x / y = {z:.50f}")`: 133 | ``` 134 | x / y = 0.10000000000000000555111512312578270211815834045410 135 | ``` 136 | * It turns out that Python still has floating-point imprecision by default, but there are some libraries that will use more memory to store decimal values more precisely. 137 | * We can see if Python has integer overflow: 138 | ```python 139 | from time import sleep 140 | 141 | i = 1 142 | while True: 143 | print(i) 144 | i *= 2 145 | sleep(1) 146 | ``` 147 | * We use the `sleep` function to pause our program for one second, but double `i` over and over. And it turns out that integers in Python can be as big as memory allows, so we won't experience overflow for a much longer time. 148 | 149 | ## Programming in Python 150 | 151 | * Let's take a closer look at conditions: 152 | ```python 153 | from cs50 import get_int 154 | 155 | # Get x from user 156 | x = get_int("x: ") 157 | 158 | # Get y from user 159 | y = get_int("y: ") 160 | 161 | # Compare x and y 162 | if x < y: 163 | print("x is less than y") 164 | elif x > y: 165 | print("x is greater than y") 166 | else: 167 | print("x is equal to y") 168 | ``` 169 | * Notice that we use consistent indentation, but we don't need parentheses or braces for our conditions. 170 | * Comments, too, start with just a single `#` character. 171 | * We can compare strings the way we might expect: 172 | ```python 173 | from cs50 import get_char 174 | 175 | # Prompt user for answer 176 | c = get_string("Answer: ") 177 | 178 | # Check answer 179 | if c == "Y" or c == "y": 180 | print("yes") 181 | elif c == "N" or c == "n": 182 | print("no") 183 | ``` 184 | * Strings can be compared directly, and Boolean expressions can include the words `and` and `or`. 185 | * We can write functions in Pythons like this: 186 | ```python 187 | def main(): 188 | for i in range(3): 189 | cough() 190 | 191 | 192 | def cough(): 193 | """Cough once""" 194 | print("cough") 195 | 196 | 197 | if __name__ == "__main__": 198 | main() 199 | ``` 200 | * We use the `def` keyword to define a function `cough`, indicating that it takes no parameters, or inputs, by using just `()`, and call it from our `main` function. Notice that all the code for each function is indented additionally, instead of surrounded by braces. 201 | * Then, at the below, we use a special line `if __name__ == "__main__":` to call our `main` function when our program is run. This way, the interpreter will know about the `cough` function by the time `main` actually calls it. We could also call `cough` directly, instead of `main`, though that would be unconventional in Python. (Instead, we want to try to be "Pythonic", or following the styles and patterns encouraged by the language and its community.) 202 | * We can add parameters and loops to our `cough` function, too: 203 | ```python 204 | def main(): 205 | cough(3) 206 | 207 | 208 | def cough(n): 209 | for i in range(n): 210 | print("cough") 211 | 212 | 213 | if __name__ == "__main__": 214 | main() 215 | ``` 216 | * `n` is a variable that can be passed into `cough`, which we can also pass into `range`. And notice that we don't specify types in Python, so `n` can be of any data type (and can even be assigned to have a value of another type). It's up to us, the programmer, to use this great power with great responsibility. 217 | * We can define a function to get a positive integer: 218 | ```python 219 | from cs50 import get_int 220 | 221 | 222 | def main(): 223 | i = get_positive_int("Positive integer: ") 224 | print(i) 225 | 226 | 227 | def get_positive_int(prompt): 228 | while True: 229 | n = get_int(prompt) 230 | if n > 0: 231 | break 232 | return n 233 | 234 | 235 | if __name__ == "__main__": 236 | main() 237 | ``` 238 | * Since there is no do-while loop in Python as there is in C, we have a `while` loop that will go on infinitely, but we use `break` to end the loop if `n > 0`. Then, our function will just `return n`. 239 | * Notice that variables in Python have function scope by default, meaning that `n` can be initialized within a loop, but still be accessible later in the function. 240 | * We can print each character in a string and capitalize them: 241 | ```python 242 | from cs50 import get_string 243 | 244 | s = get_string() 245 | for c in s: 246 | print(c.upper(), end="") 247 | print() 248 | ``` 249 | * Notice that we can easily iterate over characters in a string with something like `for c in s`, and we print the uppercase version of each character with `c.upper()`. Strings in Python are objects, like a data structure with both the value it stores, as well as built-in functions like `.upper()` that we can call. 250 | * Finally, we pass in another argument to the `print` function, `end=""`, to prevent a new line from being printed each time. Python has named arguments, where we can name arguments that we can pass in, in addition to positional arguments, based on the position they are in the list. With named arguments, we can pass in arguments in different orders, and omit optional arguments entirely. Notice that this example is labeled with `end`, indicating the string that we want to end each printed line with. By passing in an empty string, `""`, nothing will be printed after each character. Before, when we called `print` without the `end` argument, the function used `\n` as the default for `end`, which is how we got new lines automatically. 251 | * We can get the length of the string with the `len()` function. 252 | ```python 253 | from cs50 import get_string 254 | 255 | s = get_string("Name: ") 256 | print(len(s)) 257 | ``` 258 | * We'll be using version 3 of Python, which the world is starting to use more and more, so when searching for documentation, we want to be sure that it's for the right version. 259 | * We can take command-line arguments with: 260 | ```python 261 | from sys import argv 262 | 263 | if len(argv) == 2: 264 | print(f"hello, {argv[1]}") 265 | else: 266 | print("hello, world") 267 | ``` 268 | * We check the number of arguments by looking at the length of `argv`, a list of arguments, and if there is 2, we print the second one. Like in C, the first command-line argument is the name of the program we wrote, rather than the word `python`, which is technically the name of the program we run at the command-line. 269 | * We can print each argument in the list: 270 | ```python 271 | from sys import argv 272 | 273 | for s in argv: 274 | print(s) 275 | ``` 276 | * This will iterate over each element in the list `argv`, allowing us to use it as `s`. 277 | * And we can iterate over each character, of each argument: 278 | ```python 279 | from sys import argv 280 | 281 | for s in argv: 282 | for c in s: 283 | print(c) 284 | print() 285 | ``` 286 | * We can swap two variables in Python just by reversing their orders: 287 | ```python 288 | x = 1 289 | y = 2 290 | 291 | print(f"x is {x}, y is {y}") 292 | x, y = y, x 293 | print(f"x is {x}, y is {y}") 294 | ``` 295 | * Here, we're using `x, y = y, x` to set `x` to `y` at the same time as setting `y` to `x`. 296 | * We can create a list and add to it: 297 | ```python 298 | from cs50 import get_int 299 | 300 | numbers = [] 301 | 302 | # Prompt for numbers (until EOF) 303 | while True: 304 | 305 | # Prompt for number 306 | number = get_int("number: ") 307 | 308 | # Check for EOF 309 | if not number: 310 | break 311 | 312 | # Check whether number is already in list 313 | if number not in numbers: 314 | 315 | # Add number to list 316 | numbers.append(number) 317 | 318 | # Print numbers 319 | print() 320 | for number in numbers: 321 | print(number) 322 | ``` 323 | * Here, we create a empty list called `numbers` with `numbers = []`, and we get a `number` from the user. If that `number` is not already in our list, we add it to our list. We can use `not in` to check if a value is (not) in a list, and `append` to add a value to the end of a list. 324 | * We can create our own data structures, objects: 325 | ```python 326 | from cs50 import get_string 327 | 328 | # Space for students 329 | students = [] 330 | 331 | # Prompt for students' names and dorms 332 | for i in range(3): 333 | name = get_string("name: ") 334 | dorm = get_string("dorm: ") 335 | students.append({"name": name, "dorm": dorm}) 336 | 337 | # Print students' names and dorms 338 | for student in students: 339 | print(f"{student['name']} is in {student['dorm']}.") 340 | ``` 341 | * We create a list called `students`, and after we get some input from the user, we append a dictionary of key-value pairs, `{"name": name, "dorm": dorm}`, to that list. Here, `"name"` and `"dorm"` are the keys, and we want their values to be the variables we gathered as input. Then, we can later access each object's values with `student['name']` or `student['dorm']` to print them out. In Python, we can index into dictionaries with words or strings, as opposed to just numeric indexes in lists. 342 | * Let's print four question marks, one at a time: 343 | ```python 344 | for i in range(4): 345 | print("?", end="") 346 | print() 347 | ``` 348 | * We can print a vertical bar of hash marks, too: 349 | ```python 350 | for i in range(3): 351 | print("#") 352 | ``` 353 | * And we can print a square with a nested loop: 354 | ```python 355 | for i in range(3): 356 | for j in range(3): 357 | print("#", end="") 358 | print() 359 | ``` 360 | * Now we can revisit `resize.py`, and it might make more sense to us now: 361 | ```python 362 | from PIL import Image 363 | from sys import argv 364 | 365 | if len(sys.argv) != 4: 366 | sys.exit("Usage: python resize.py n infile outfile") 367 | 368 | n = int(sys.argv[1]) 369 | infile = sys.argv[2] 370 | outfile = sys.argv[3] 371 | 372 | inimage = Image.open(infile) 373 | width, height = inimage.size 374 | outimage = inimage.resize((width * n, height * n)) 375 | 376 | outimage.save(outfile) 377 | ``` 378 | * We import the Image library from something called PIL, a free open-source library that we can download and install (which doesn't come with Python by default). 379 | * Then, we import `argv` from the system library, and we check our arguments, storing them as `n`, `infile`, and `outfile`, converting the string input for `n` into an `int` as we do so. 380 | * By reading the documentation for Python and the Image library, we can open files as an image, getting its `size` and calling a `resize` function on it to get another image, which we can then `save` to another file. 381 | * Let's look at another example, a spell-checker in Python: 382 | ```python 383 | # Words in dictionary 384 | words = set() 385 | 386 | def check(word): 387 | """Return true if word is in dictionary else false""" 388 | return word.lower() in words 389 | 390 | def load(dictionary): 391 | """Load dictionary into memory, returning true if successful else false""" 392 | file = open(dictionary, "r") 393 | for line in file: 394 | words.add(line.rstrip("\n")) 395 | file.close() 396 | return True 397 | 398 | def size(): 399 | """Returns number of words in dictionary if loaded else 0 if not yet loaded""" 400 | return len(words) 401 | 402 | def unload(): 403 | """Unloads dictionary from memory, returning true if successful else false""" 404 | return True 405 | ``` 406 | * The functions for `dictionary.py` are pretty straightforward, since all we need is a `set()`, a collection into which we can load unique values. In `load`, we open the `dictionary` file, and add each line in the file as a word (without the newline character). 407 | * For `check`, we can just return whether `word` is in `words`, and for `size`, we can just return the length of `words`. Finally, we don't need to do anything to `unload`, since Python manages memory for us. 408 | * By having used C first, we have an understanding (and appreciation!) for the abstractions that a higher-level language like Python provides us. Indeed, if we run some tests for performance, a speller implementation in Python might be 1.5x slower, and so depending on the application, this may or may not be important enough to justify the human time it might take to write a program in a lower-level language like C, which might run much faster or require less memory. 409 | -------------------------------------------------------------------------------- /curriculum/7/index.md: -------------------------------------------------------------------------------- 1 | # Chapter 7 2 | 3 | * [Notes](notes) 4 | * Problems 5 | * [Similarities](https://docs.cs50.net/2019/ap/problems/similarities/similarities.html) 6 | * [Survey](https://docs.cs50.net/2019/ap/problems/survey/survey.html) 7 | * Shorts 8 | * [Ajax](https://www.youtube.com/watch?v=dQcBs4S-wEQw) 9 | * [Flask](https://www.youtube.com/watch?v=X0dwkDh8kwA) 10 | * [JavaScript](https://www.youtube.com/watch?v=Z93IaNfavZw) 11 | * [Python](https://www.youtube.com/watch?v=mgBpcQRDtl0) 12 | * [Slides](https://cdn.cs50.net/2018/fall/lectures/7/lecture7.pdf) 13 | * Source Code 14 | * [Index](https://cdn.cs50.net/2018/fall/lectures/7/src7/) 15 | * [PDF](https://cdn.cs50.net/2018/fall/lectures/7/src7.pdf) 16 | * [Sandbox](https://sandbox.cs50.io/e5e09c03-1783-49c2-84a5-6a17332d1f47) 17 | * [ZIP](https://cdn.cs50.net/2018/fall/lectures/7/src7.zip) 18 | * [Video](https://video.cs50.net/2018/fall/lectures/7) 19 | * Reference Sheets 20 | * [Ajax](https://ap.cs50.school/assets/pdfs/ajax.pdf) 21 | * [MVC](https://ap.cs50.school/assets/pdfs/mvc.pdf) 22 | * [Python for Web Programming](https://ap.cs50.school/assets/pdfs/python_for_web_programming.pdf) 23 | -------------------------------------------------------------------------------- /curriculum/7/notes/mvc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/7/notes/mvc.png -------------------------------------------------------------------------------- /curriculum/7/notes/words1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/7/notes/words1.png -------------------------------------------------------------------------------- /curriculum/7/notes/words2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/7/notes/words2.png -------------------------------------------------------------------------------- /curriculum/8/index.md: -------------------------------------------------------------------------------- 1 | # Chapter 8 2 | 3 | * [About Quiz](https://docs.cs50.net/2018/fall/quiz/about.html) 4 | * [Notes](notes) 5 | * Problem 6 | * [Finance](https://docs.cs50.net/2019/ap/problems/finance/finance.html) 7 | * Shorts 8 | * [Ajax](https://www.youtube.com/watch?v=dQcBs4S-wEQ) 9 | * [Flask](https://www.youtube.com/watch?v=X0dwkDh8kwA) 10 | * [SQL](https://www.youtube.com/watch?v=AywtnUjQ6X4) 11 | * [Slides](https://cdn.cs50.net/2018/fall/lectures/8/lecture8.pdf) 12 | * Source Code 13 | * [Google Spreadsheet](https://docs.google.com/spreadsheets/d/1lOcpedVe1TeT5cByAlkBnN0vU-TkU6XQJDeplWktY7k/edit?usp=sharing) 14 | * [Index](https://cdn.cs50.net/2018/fall/lectures/8/src8/) 15 | * [PDF](https://cdn.cs50.net/2018/fall/lectures/8/src8.pdf) 16 | * [Sandbox](https://sandbox.cs50.io/5cb25506-2dda-44df-a5b1-c11e17e76915) 17 | * [ZIP](https://cdn.cs50.net/2018/fall/lectures/8/src8.zip) 18 | * [Video](https://video.cs50.net/2018/fall/lectures/8) 19 | * Reference Sheets 20 | * [Ajax](https://ap.cs50.school/assets/pdfs/ajax.pdf) 21 | * [MVC](https://ap.cs50.school/assets/pdfs/mvc.pdf) 22 | * [Python for Web Programming](https://ap.cs50.school/assets/pdfs/python_for_web_programming.pdf) 23 | -------------------------------------------------------------------------------- /curriculum/8/notes/create_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/8/notes/create_table.png -------------------------------------------------------------------------------- /curriculum/8/notes/faculty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/8/notes/faculty.png -------------------------------------------------------------------------------- /curriculum/8/notes/phpliteadmin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/8/notes/phpliteadmin.png -------------------------------------------------------------------------------- /curriculum/8/notes/schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/8/notes/schema.png -------------------------------------------------------------------------------- /curriculum/8/notes/store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/8/notes/store.png -------------------------------------------------------------------------------- /curriculum/data_science/analyzing_data/notes/buoy_network.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/data_science/analyzing_data/notes/buoy_network.gif -------------------------------------------------------------------------------- /curriculum/data_science/analyzing_data/notes/buoys.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/data_science/analyzing_data/notes/buoys.jpg -------------------------------------------------------------------------------- /curriculum/data_science/analyzing_data/notes/index.md: -------------------------------------------------------------------------------- 1 | # Ananlyzing Data 2 | {:.no_toc} 3 | 4 | * TOC 5 | {:toc} 6 | 7 | ## Preprocessing Data 8 | 9 | When working with data, it is likely that we'll have to manipulate it or preprocess it in some way before we're able to analyze it. Over time humans have developed different methods to analyze data varying in ease of use. One such example is manipulating data in an Excel spreadsheet or Google Sheet versus manipulating data in a database textually with a language like SQL. Ultimately, the choice is yours on which tool you're comfortable using for the most part. When we start looking at larger data sets, we'll also need to consider which tools can handle that data sets of that scale. 10 | 11 | Let's say we want to articles submitted to a scholarly journal to get published. Well we may want to programmatically iterate over their abstracts to get a sense of what words or topics occur most frequently. We'll need to consider a few things before we can start analyzing. 12 | 13 | #### 1. Cleaning data 14 | * If we are trying to get a sense of topic-based words we'll need to get rid of some words that are irrelevant like "the", "of", "it", etc. These are referred to as "stop words". 15 | 16 | ![top 100 words](top_100_words.jpg) 17 | 18 | * We also might want to consider treating capitalized words the same as their lowercased equivalents. This step can vary based on how the data is collected. Are users selecting items from a drop down menu or multiple choice? Or are they writing answers in an open field? 19 | * If we really wanted to be fancy we could lemmatize the data set, which means we would only be working with root words. Words like "run", "ran", "runs", and "running" would all count as the same word. 20 | * These methods allow all of our data to be uniform so that it is easier to analyze, without changing the primary data. 21 | * It is likely that we won't catch all the aspects of our data that needs to be cleaned in our first pass. After we start analyzing we may see patterns we want to eliminate or explore further. We can iteratively clean our data throughout this process to make sure we are analyzing uniform data. 22 | 23 | #### 2. Incomplete or missing data 24 | * If we're analyzing abstracts, how do we handle papers that have incomplete or missing abstracts? 25 | * Do we eliminate all papers without abstracts from our sample? Do we use a sample from the paper itself? It is ultimately up to you, the programmer, to decide this. 26 | * Be sure to be consistent with how you handle these data points! 27 | 28 | #### 3. Invalid data 29 | * Our data set could contain words of different languages using special symbols that our programming environment may not be able to display. 30 | * In some programming environments, these characters may be represented as their Unicode equivalent. How do we handle such words when we analyze them? 31 | * Do we remove them from our data set? Do we translate them to some English translation? 32 | * Again, the key is to be consistent! 33 | 34 | #### 4. Combining data sources 35 | * In order to find themes across all abstracts, we'll have to look at all the papers' abstracts. 36 | * We may want to copy all the abstracts from the papers into one file to make analysis easier. 37 | * Additionally, there may be cases were some papers have the abstract included as a separate file as opposed to included in the same file as the entire paper. 38 | 39 | ## Extracting Information 40 | 41 | The raw data we collect from devices will seldom (if ever) tell us what do with it. It is our job to interpret it and make decisions based on those interpretations. 42 | 43 | Raw data is a collection of numbers, text, or values. We can collect information, that is the patterns or facts the data presents, by analyzing this data. For example, if our data was a collection of words from an article we could easily extract a fact like what word was used most frequently. If we used more articles from the same author we might find patterns in their writing style that we couldn't otherwise see in just one document. 44 | 45 | Sometimes we want to collect data over a period of time instead of just once. In this way we are able to determine trends over time. Remember our [buoy example](../../collecting_data/notes/#signals)? 46 | 47 | ![buoys](buoys.jpg) 48 | 49 | It wouldn't make sense to only collect this data once and be done with it. We could imagine a database that stores all the values of relative distance between the surface buoy and the anchor once every second or 5 times a second if we wanted to be even more precise. Even with all this raw data a computer can't determine what is normal and what is not. We, as the human, would need to determine a range of values that we consider to be normal, or a baseline. 50 | 51 | We could further extrapolate that any value outside of this range might indicate a storm or a tsunami. This is called correlation. We can observe storm like conditions when the relative distance changes dramatically or falls outside of the range we've deemed to be "normal". Correlation does not always imply causation, though, consider other factors that could change a buoy's relative distance to its anchor, such as animals, humans, or boats. 52 | 53 | If we really wanted to confirm our hypothesis that a storm may be on its way we would probably want to use more than one data source, or buoys in this case. That way we can rule out external factors that may be occurring at one location. We could use this network of buoys to gather even more information by programmatically comparing distances of neighboring buoys and taking the average, for example. 54 | 55 | ![buoy network](buoy_network.gif) 56 | 57 | Ultimately the size of our data set will determine our conclusions and how confident we are in those conclusions. The larger the sample size, the smaller the margin of error. Imagine we asked 10 people what their favorite color was and all 10 said green. Our results would show that 100% of people chose green as their favorite color, but this would not be true of the population of the earth. If we sampled 1 million people, the distribution of favorite colors may be more representative of the larger population. 58 | 59 | ## Data Visualizations 60 | 61 | When we look at data over long periods of time, it is often easier to see trends with some sort of visualization. Some examples include charts, diagrams, graphs, and infographics. 62 | 63 | To view yearly trends of wave heights in the Pacific, we could take the daily average height for an entire year and manually skim over the data. This is something we'd likely have to do programmatically as our buoys are likely collecting various types of data like water temperature and wind direction so we'll need to extract wave height. Looking at all these numbers, even just for wave height seems tedious and we might miss overarching trends. Plotting this data on a graph, we can see greater wave height in the winter months than in the summer months. 64 | 65 | ![wave height graph](wave_graph.png) 66 | -------------------------------------------------------------------------------- /curriculum/data_science/analyzing_data/notes/top_100_words.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/data_science/analyzing_data/notes/top_100_words.jpg -------------------------------------------------------------------------------- /curriculum/data_science/analyzing_data/notes/wave_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/data_science/analyzing_data/notes/wave_graph.png -------------------------------------------------------------------------------- /curriculum/data_science/collecting_data/notes/bias.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/data_science/collecting_data/notes/bias.jpg -------------------------------------------------------------------------------- /curriculum/data_science/collecting_data/notes/bit_depth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/data_science/collecting_data/notes/bit_depth.gif -------------------------------------------------------------------------------- /curriculum/data_science/collecting_data/notes/buoys.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/data_science/collecting_data/notes/buoys.jpg -------------------------------------------------------------------------------- /curriculum/data_science/collecting_data/notes/digital_sampling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/data_science/collecting_data/notes/digital_sampling.png -------------------------------------------------------------------------------- /curriculum/data_science/collecting_data/notes/index.md: -------------------------------------------------------------------------------- 1 | # Collecting Data 2 | {:.no_toc} 3 | 4 | * TOC 5 | {:toc} 6 | 7 | ## What is Data Science 8 | 9 | Data science can be defined as using data systematically to make decisions or obtain insight. 10 | 11 | ## Analog vs. Digital Data 12 | 13 | Representing values in the real world digitally, isn't always as easy as it sounds. We've already seen how computers can't really store numbers like 1/3, but what other data do computers have difficultly representing? 14 | 15 | Turns out computers rely on pixels to display images. Each pixel is made up of three values: red, green, and blue. These are called RGB values. Often times various hardware and software have different color palletes, or bit depths. 16 | 17 | For example, if we were to represent an image using 8-bit color we would have access to 28 values or 256 distinct colors. If we were then able to use 24-bit color we'd have access to 224 values or 16,777,216 colors. 18 | 19 | ![bit depth animation](bit_depth.gif) 20 | 21 | This notion of bit depth means that we can't actually represent all the colors we see in the real world digitally, rather we have to approximate them to the nearest value we can represent. 22 | 23 | ## Signals 24 | 25 | A signal is one way of transmitting information from one device to another. Analog signals are continuous, meaning their values are constantly changing over time. Digital signals, however, are discrete, meaning that we capture a snapshot of the analog data over a specific time interval. 26 | 27 | Consider a buoy in the middle of the ocean tied to an anchor. The distance between the anchor and the surface buoy is constantly changing because of wave activity. 28 | 29 | ![buoy attached to anchor](buoys.jpg) 30 | 31 | If we wanted to measure this distance between the anchor and the buoy on the surface we would have to use a sampling technique. We could transmit its distance to a secondary device, like a Tsunameter, every second which could approximate its relative distance to the anchor. If we sample the analog signal more frequently we can more closely approximate the analog input. 32 | 33 | ![analog versus digital sampling graph](digital_sampling.png) 34 | 35 | ## Metadata 36 | 37 | When we collect or store data, we often want additional information about that data, also called metadata, to let a computer know how to interpret or display the data. If our data was a song in the form of an mp3 file our metadata might contain information like song name, track number, and album name. Then if we play this song on an mp3 player like an iPod that information could be displayed on the screen. 38 | 39 | Changing the metadata does not affect the primary data (although it may affect how your computer interprets that data). Metadata for a song in iTunes might look something like this. 40 | 41 | ![song_metadata](song_metadata.png) 42 | 43 | We could change the title of this song to be whatever we want, but that will not change how the song sounds when we play it. It will, however, affect how our music player organizes it in our library. The metadata here also makes songs easier to search for since most music players allow you to search fields of the metadata. For example, we could search for this song by searching for "Never Gonna Give You Up", "Rick Astley", or "Whenever You Need Somebody", etc. Imagine if we didn't have this information, we may have to skim through every song in our library or playlist just to find the song we want to listen to. The song still exists and sounds the same it is just significantly more difficult to find it or use our data. 44 | 45 | Metadata is the reason we can sort or filter the music in our library or playlist. We can pull the metadata to sort our music by artist alphabetically, or look at all the tracks in a specific album. 46 | 47 | ## Data Collection 48 | 49 | Collecting data is often the most daunting part of data science. Whether we are collecting data in person or online, biases can affect the data that we collect. 50 | 51 | Data collection can be affected by response bias, that is how we ask a question can affect the answer. "How user-friendly was our platform?", insinuates that the platform was indeed user-friendly and making participants feel like any other answer is not the norm. Convenience sampling is another form of bias that affect data collection. If we only collect information from a specific group of people because it easy to do so our data won't be representative of the entire population. 52 | 53 | ![response bias comic](bias.jpg) 54 | 55 | When humans collect data, we can usually assume there will be some degree of bias. But surely computers can be more objective, right? Remember computers are only as objective as the algorithms they are running and who created those algorithms, you guessed it, humans. 56 | 57 | Let's consider an example. Say we want to design a machine learning algorithm to determine which recommends resumes employers for a particular job. Well, we'll need a training set for our algorithm to learn from, this would likely be in the form of some data on what resumes resulted in getting hired for similar jobs in the past. If past employers were prejudice towards a particular gender, ethnicity, or group, your algorithm would reflect the same forms of prejudice. This is just one way bias can be embedded in an algorithm, but bias can exist at every level of software development. It is your job as the developer to be aware of of this to reduce bias in your own work. 58 | -------------------------------------------------------------------------------- /curriculum/data_science/collecting_data/notes/song_metadata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/data_science/collecting_data/notes/song_metadata.png -------------------------------------------------------------------------------- /curriculum/data_science/index.md: -------------------------------------------------------------------------------- 1 | # Data Science 2 | 3 | * [Collecting Data](collecting_data/notes) 4 | * [Analyzing Data](analyzing_data/notes) 5 | -------------------------------------------------------------------------------- /curriculum/impact_of_computing/index.md: -------------------------------------------------------------------------------- 1 | # Impact of Computing 2 | 3 | * [Notes](notes) 4 | * Problem 5 | * [Simulate!](https://docs.cs50.net/2019/ap/problems/simulate/simulate.html) 6 | * [Degrees of Scalability](https://docs.cs50.net/2019/ap/problems/scalability/scalability.html) 7 | * Reference Sheets 8 | * [Artificial Intelligence and Machine Learning](https://ap.cs50.school/assets/pdfs/artificial_intelligence_and_machine_learning.pdf) 9 | * [Models and Simulations](https://ap.cs50.school/assets/pdfs/models_and_simulations.pdf) 10 | * [Version Control and Documentation](https://ap.cs50.school/assets/pdfs/version_control_and_documentation.pdf) 11 | -------------------------------------------------------------------------------- /curriculum/impact_of_computing/notes/cc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/impact_of_computing/notes/cc.png -------------------------------------------------------------------------------- /curriculum/impact_of_computing/notes/gofundme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/impact_of_computing/notes/gofundme.png -------------------------------------------------------------------------------- /curriculum/impact_of_computing/notes/index.md: -------------------------------------------------------------------------------- 1 | # Impact of Computing 2 | {:.no_toc} 3 | 4 | * TOC 5 | {:toc} 6 | 7 | ## Developing Computational Artifacts 8 | 9 | More often than not, developers work in teams to accomplish a shared goal. There are various models for collaboration such as pair programming, consultation for debugging, and splitting front end and back development. This idea of compartmentalizing code into various independent parts is called modularity. This allows us to easily add or modify existing projects without having to rewrite the entire thing from scratch. Imagine if every time our computers broke we had to buy an entirely new one. This may be the case, but if we can identify which part is broken or faulty we can replace just the broken component, saving us money and time. 10 | 11 | Collaborating with others is about more than just programming. You have to communicate with one another about the design of the program. You'll also have to consider the inputs and outputs each of you expect for your portion. You may not always agree so conflict resolution will be key to navigating the project. You'll need to negotiate and ultimately come to some consensus with your team. 12 | 13 | Although it is nearly impossible to consider all the ways your computational artifact can be used, it is important to consider the various ways it can be used both intentionally and unintentionally. These users could potentially have positive or negative effects on your project as a whole. For example, the world wide web was originally designed to provide a quick way to share information to the scientific community. Had users only used this technology for that purpose, we would not have the extensive access to resources that we do today, furthermore other fields such as medicine, engineering, communications, and the arts would have missed out on this technology since they were not the intended audience. 14 | 15 | ## Scaling 16 | 17 | Scalability is a program's ability to scale to accommodate larger data sets, or more generally, an increased work load. Scalability itself is not a discrete feature in a program but is a part of the design process, and is often a cooperation of software and hardware. As data sets grow, and thus increase the work load of a program, it becomes increasingly more important to consider program or database's ability to accommodate any increase in data. 18 | 19 | Large increases in users and data usually prompt businesses and developers to consider more scalable options. Consider if Facebook only used a database that could only store 10,000 rows of user information. That may have seemed like a lot when they started implementing their platform but over time usage grows and the need for more space becomes a necessity. One way that companies have handled their large user databases is with a concept known as sharding. This allows us to store a database in multiple databases using a shared key. 20 | 21 | ![sharded database](shard.png) 22 | 23 | ## People and Computers 24 | 25 | Behind all the technology we use and interact is a person or, more likely, a team of people. The development of these new technologies have changed our lives drastically. Perhaps you remember rotary phones or landlines more generally. 26 | 27 | ![landline](landline.jpg) 28 | 29 | Landlines were physically connected to a telephone line. In the 1940s, companies like AT&T and Motorola developed mobile phones that were essentially just two-way radio signals. 30 | 31 | ![mobile phone](mobile_phone.jpg) 32 | 33 | It wasn't until the early 90s that companies started integrating other features that we now consider trivial, like calculators and text messaging. 34 | 35 | In this day and age, most everyone has a cell phone. Just like any other convenience, this technology too, comes with a cost. The average American spends about four hours on their phone in a day! While the original developers likely anticipated certain outcomes like more frequent communication with others, it seems unlikely that they anticipated the rate at which we would use them for things other than calling and texting. 36 | 37 | ## Solving Other Problems at Scale 38 | 39 | Just as we have distributed computing solutions, whereby we can solve problems more efficiently by allowing multiple machines to run different tasks, we can have distributed science. Using technology, research can be carried out by people all over the world who can contribute data via their own computing devices. This is called citizen science. 40 | 41 | In this way, other fields outside of computer science have developed more efficient and accurate systems to identify problems or concerns and develop and test solutions. Moreover, we can share these results with more people than we otherwise could have. 42 | 43 | ![kickstarter](kickstarter.png) 44 | 45 | Platforms like Kickstarter and GoFundMe have adopted to similar models to fund all sorts of projects via their website. They use what's referred to as crowdsourcing to connect start ups, social causes, and other organizations with funding. Each platform has a slightly different model but generally people see a product or cause they want to fund and contribute some amount of money (predetermined or otherwise). Over time more people contribute and eventually the group might reach their goal that they may have otherwise been able to do with a single funder. 46 | 47 | ## Models and Simulations 48 | 49 | Computer programs can be used to create models and simulations, to test hypotheses and generate new understanding and knowledge. Simulations can model existing knowledge (like finding the area of a circle) or help us explore phenomenon that could happen in the future (like predicting the damage caused by a natural disaster). Simulations are applicable in everyday life, from testing new car designs to modeling possible furniture arrangements. Taking advantage of simulations as a tool can help people and companies save time, money, and effort by modeling new ideas before putting them into production. We can often use simulations to model phenomenon that would be difficult given the constraints of the real world. If we wanted to simulate the trajectory of a rocket through space, that would be impossible because of the Earth's gravitational pull. 50 | 51 | ### Monte Carlo Simulation 52 | 53 | 54 | Developing simulations take on a similar life as developing programs. It is unlikely that one could build a simulation to model a complex system all at once, top to bottom. We might try to modularize the system and design one part of it first. We could also simplify some of the underlying functionality of our simulation and get that part to work before building on top of that. Remember that just like our programs, bias can be embedded into the simulations we build depending on what assumptions and simplifications we make. 55 | 56 | Aside from the mathematical equations that we may want to use in a simulation, we may also want to incorporate some degree of randomness. If there is a 30% chance of picking a winning ticket in a lottery, we could model this using a random number generator (also called an RNG)[^1]. We can write this program such that the RNG would output any number between 0 and 9, where 0, 1, and 2 represent a winning ticket. The output every time this program ran would be different. We could implement this in C with the [`rand()`](https://man.cs50.io/3/random) and [`srand()`](https://man.cs50.io/3/srandom)functions. In `rand()`'s documentation, we can see that `rand()` actually produces the same random numbers on every run, unless we specify a "seed" or initializer using `srand()`. 57 | 58 | ```c 59 | #include 60 | #include 61 | #include 62 | 63 | int main(void) 64 | { 65 | // Use current time as seed for random generator 66 | srand(time(0)); 67 | // Picks a number between 0 and 9 68 | int ticket = rand() % 10; 69 | // Prints the ticket number 70 | printf("%i \n", ticket); 71 | 72 | // Decides fate 73 | if (ticket < 3) 74 | { 75 | printf("You won!\n"); 76 | } 77 | else 78 | { 79 | printf("You lost!\n"); 80 | } 81 | } 82 | ``` 83 | 84 | ## The Digital Divide 85 | 86 | The digital divide describes the disparity between those who have access to technology and those who do not, including but not limited to access to a computer, the internet, or other hardware and software. It even more broadly describes the uneven distribution of usage between groups by socioeconomic status, race, gender, and geographical location. But it isn't just groups that are affected by the digital divide. Within a group or community too, there are individuals who do have access or have limited access to computers and the internet. 87 | 88 | There are many factors that contribute to the digital divide, such as: 89 | * physical accessibility 90 | * financial accessibility 91 | * accessibility for individuals with disabilities 92 | * cognitive accessibility 93 | * etc. 94 | 95 | Solutions are rarely addressed at scale because because there is often "bigger fish to fry". Human needs such as food supply and health care take precedence over digital inclusion. 96 | 97 | When we consider technological resources and solutions, we need to consider who has access? Who benefits from this technology? Furthermore, are these concerns that are occurring locally for a particular solution or globally? Ultimately, we as individuals along with organizations and governments have the power to improve or worsen this divide. 98 | 99 | ## Ethics and Legalities of Computing 100 | 101 | Intellectual property refers to creations of the human mind. Things like trademarks, copyrights, and patents are all forms of intellectual property. Digital content is also subject to the laws around intellectual property. Content created on a computer is considered the intellectual property of the creator or organization. 102 | 103 | Technology has made it easier than ever to create and distribute our creative works, but this is a two way street. With ease of access and distribution comes ease of unauthorized use and modification. Tools like BitTorrent and LimeWire are some such tools that enabled to peer to peer sharing of files, which were typically illegal copies of music, movies, and other digital media. This often brings up well warranted concerns of ownership, value, and use when it comes to digital information. Do you really own a movie that you purchased on Amazon Prime, or that song you bought on iTunes? If you then burn that to a disk or flash drive and give it to a friend, do they also have ownership of that property? You may seen a warning like the one below shown before the start of a movie. This is one measure taken to make user's aware of the legal implications of unauthorized use. 104 | 105 | ![warning](warning.jpg) 106 | 107 | In a professional setting, most companies and organizations have employees sign contracts with an intellectual property clause. Typically, digital content you produce on the job is the property of the company or organization. Even in a personal setting it is a good idea to consider different measures to safeguard your own intellectual property. This could be as simple as encrypting your data or storing it somewhere that has taken other measures to protect your data. 108 | 109 | ## Legal Use 110 | 111 | There are ways to use others work legally. These products are typically labelled as open source or open access or licensed under the Creative Commons license. These licenses and labels allow us access to information that we may not have had access to otherwise, as well as contribute to this base of information for others to use. 112 | 113 | CS50's own curriculum is licensed under the Creative Commons' Attribution-NonCommercial-ShareAlike license. In short, anyone can use, share, or modify our work legally, so long as they credit us and distribute their work under the same license. 114 | 115 | ![creative commons](cc.png) 116 | 117 | The term open source is used to describe programs that are not only free to access and use but also to modify and extend for any purpose. Python is considered an open source software. People are continuously building and adding other features and modules to adapt it to their needs. 118 | 119 | Open access refers to research output that is free of any and all restrictions. The [Digital Public Library of America](https://dp.la/) for is one such example, whereby users have access to millions of multimedia resources without restriction. 120 | 121 | Regardless of how the information or material is licensed or labelled, it is a good idea to cite all sources, just as you would in a paper in your English class. Simply supplying a link to the site in a comment of your code can suffice. 122 | 123 | --- 124 | 125 | [^1]: In the exam reference sheet for the AP CSP exam, the syntax for a random number generator is `RANDOM(a, b)` where the return value is any number between `a` and `b`, inclusive. 126 | -------------------------------------------------------------------------------- /curriculum/impact_of_computing/notes/kickstarter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/impact_of_computing/notes/kickstarter.png -------------------------------------------------------------------------------- /curriculum/impact_of_computing/notes/landline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/impact_of_computing/notes/landline.jpg -------------------------------------------------------------------------------- /curriculum/impact_of_computing/notes/mobile_phone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/impact_of_computing/notes/mobile_phone.jpg -------------------------------------------------------------------------------- /curriculum/impact_of_computing/notes/shard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/impact_of_computing/notes/shard.png -------------------------------------------------------------------------------- /curriculum/impact_of_computing/notes/warning.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/impact_of_computing/notes/warning.jpg -------------------------------------------------------------------------------- /curriculum/index.md: -------------------------------------------------------------------------------- 1 | # CS50 Core Curriculum 2 | 3 | * [Chapter 0](0) 4 | * [Chapter 1](1) 5 | * [Chapter 2](2) 6 | * [Chapter 3](3) 7 | * [Chapter 4](4) 8 | * [Chapter 5](5) 9 | * [Chapter 6](6) 10 | * [Chapter 7](7) 11 | * [Chapter 8](8) 12 | 13 | # AP Modules 14 | 15 | * [Understanding Technology](understanding_technology) 16 | * [Data Science](data_science) 17 | * [Impact of Computing](impact_of_computing) 18 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/index.md: -------------------------------------------------------------------------------- 1 | # Hardware 2 | 3 | * [Notes](notes) 4 | * Problem 5 | * [Around the House](https://docs.cs50.net/2019/ap/problems/house/house.html) 6 | * [Tech Spot](https://docs.cs50.net/2019/ap/problems/tech/tech.html) 7 | * [Algorithms](https://docs.cs50.net/2019/ap/problems/algorithms/algorithms.html) 8 | * [UI](https://docs.cs50.net/2019/ap/problems/ui/ui.html) 9 | * [Slides](http://cdn.cs50.net/cscie1a/2017/fall/lectures/hardware/hardware.pdf) 10 | * [Video](https://video.cs50.net/cscie1a/2017/fall/lectures/hardware) 11 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/ascii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/ascii.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/cpu.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/display.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/funnel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/funnel.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/hddinside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/hddinside.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/hddout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/hddout.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/index.md: -------------------------------------------------------------------------------- 1 | # Hardware 2 | {:.no_toc} 3 | 4 | * TOC 5 | {:toc} 6 | 7 | 8 | ## Binary 9 | 10 | - We use computers everyday 11 | - Inside a computer are "0s and 1s" 12 | - Computers use the binary number system to represent info 13 | - How do computers represent info with just binary? 14 | - Consider the decimal number (what we human typically use) 123 15 | - The rightmost column is the 1s column 16 | - The middle, the 10s 17 | - The leftmost, the 100s 18 | 19 | |100| 10| 1| 20 | |:--:|:--:|:--:| 21 | |1 |2 |3 | 22 | 23 | - Thus we have 100 x 1 + 10 x 2 + 1 x 3 = 100 + 20 + 3 = 123 24 | - Inside a computer, the binary 000 would represent 0, just like in our human world! 25 | - However, in this case we are dealing with binary so: 26 | - The right most column is the 1s place 27 | - The middle, the 2s 28 | - The leftmost, the 4s 29 | 30 | |4| 2| 1| 31 | |:--:|:--:|:--:| 32 | |0 |0 |0 | 33 | 34 | - In the human world (decimal) we use powers of 10 for place values 35 | - 100 = 1, 101 = 10, 102 = 100, 103 = 1000, etc. 36 | - In the computer world (binary) we use powers of 2 for place values 37 | - 20 = 1, 21 = 2, 22 = 4, 23 = 8, etc. 38 | - The difference between decimal numbers and binary numbers is changing the base 39 | - For the binary number 000, we have 4 x 0 + 2 x 0 + 1 x 0 = 0 + 0 + 0 = 0! 40 | - Consider the binary number 001: 41 | 42 | |4| 2| 1| 43 | |:--:|:--:|:--:| 44 | |0 |0 |0 | 45 | 46 | - We have 4 x 0 + 2 x 0 + 1 x 1 = 0 + 0 + 1 = 1 47 | - How do we represent the decimal number 2 in binary? 48 | - We don't need a 4, be we need a 2, and also no 1 49 | 50 | |4| 2| 1| 51 | |:--:|:--:|:--:| 52 | |0 |1 |0 | 53 | 54 | - This gives us 4 x 0 + 2 x 1 + 1 x 0 = 0 + 2 + 0 = 2 55 | - Likewise, the number 3 would be: 56 | 57 | |4| 2| 1| 58 | |:--:|:--:|:--:| 59 | |0 |1 |1 | 60 | 61 | - As we need a 2 and a 1 62 | - Thus, 4 x 0 + 2 x 1 + 1 x 1 = 0 + 2 + 1 = 3 63 | - Similarly, 4 would be: 64 | 65 | |4| 2| 1| 66 | |:--:|:--:|:--:| 67 | |1 |0 |0 | 68 | 69 | - What about 7? 70 | 71 | |4| 2| 1| 72 | |:--:|:--:|:--:| 73 | |1 |1 |1 | 74 | 75 | - Which yields 4 x 1 + 2 x 1 + 1 x 1 = 4 + 2 + 1 = 7 76 | - What about 8? 77 | - We can't count to 8 without another bit (binary digit) 78 | - We run into this in the real world too if we need a four-digit number vs a 3-digit number 79 | - Start with the 1s, 10s, 100s place and add the 1000s 80 | - Here we'll add the next power of 2, 8 81 | 82 | |8|4| 2| 1| 83 | |:--:|:--:|:--:|:--:| 84 | |1 |0 |0 |0 | 85 | 86 | - 8 x 1 + 4 x 0 + 2 x 0 + 1 x 0 = 8 87 | - Just like decimal numbers (base 10), numbers represent larger values on the left side and decrease as we move right. 88 | - So if we wanted to compare the binary numbers 1001 and 1010 we could start on the far left side of the number and look for where the numbers differ. The one with a 1 will be larger than the one with a 0. 89 | 90 | |8|4|2|1| 91 | |:--:|:--:|:--:|:--:| 92 | |1|0|**_0_**|1| 93 | |1|0|**_1_**|0| 94 | 95 | - Even though computers only use binary, they can count as high as humans can! 96 | - They do it with a smaller vocabulary, just 1 and 0. 97 | - This is because it's easier to represent two states in the physical world 98 | - If you think of one of these bits as being a light bulb: 99 | - 0 is off 100 | - 1 is on 101 | - Light bulbs just need electricity to turn on or off 102 | - Electricity is sufficient to turn a switch on or off 103 | - Inside a computer exists these switches called transistors 104 | - Modern computers have billions! 105 | - Turned off represents 0 106 | - Turned on represents 1 107 | - Using these transistors we can store values, store data, compute, and do everything we can with computers 108 | - David demonstrates how transistors work using light bulbs 109 | - So far all that we can represent is numbers 110 | - A decision needs to be made on what pattern of 1s and 0s to represent letters, words, and paragraphs 111 | - All computers can store is 0s and 1s 112 | - To represent letters, we need a mapping of 0s and 1s to characters 113 | - ASCII (American Standard Code for Information Interchange) does this 114 | 115 | ![ascii chart](ascii.png) 116 | 117 | - 65 -> A, 66 -> B, 67 -> C, etc. 118 | - 97 -> a, 98 -> b, 99 -> c, etc. 119 | - ASCII also has mapping for punctuation symbols 120 | - Programs like notepad, textedit, and MicroSoft Word decide weather to display patterns of bits as letters or words 121 | - Computers only store 0s and 1s, but the programs interpret those bits in a certain way 122 | - For example, if MicroSoft word sees a pattern of buts representing the number 65, it will interpret that as "A" 123 | - ASCII is limited 124 | - Original ASCII is 7 bits, thus giving 128 characters 125 | - Extended ASCII is 8 bits, yielding 256 characters 126 | - Many symbols are not represented 127 | - UNICODE is a bigger set of characters that includes written languages other than English and even emoji! 😲 128 | - All are still represented by a pattern of bits 129 | - Consider this pattern of bits: 01001000 01001001 130 | - 16 bits or 2 bytes (1 byte = 8 bits) 131 | 132 | |128|64|32|16|8|4|2|1| |128|64|32|16|8|4|2|1| 133 | |:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:| 134 | |0 |1 |0 |0 |1 |0 |0 |0 | |0 |1 |0 |0 |1 |0 |0 |1 | 135 | 136 | | 1 x 64 + 1 x 8 | 1 x 64 + 1 x 8 + 1 x 1| 137 | |:--:|:--:| 138 | | 72 | 73 | 139 | | H | I | 140 | 141 | - Using ASCII we get the word "HI" 142 | 143 | ## CPU 144 | 145 | - If you have heard that your computer has "Intel Inside," it has an Intel processor in it 146 | 147 | ![CPU](cpu.png) 148 | 149 | - The backside of the processor has pins that connect into the motherboard 150 | - The motherboard is a circuit board made of silicon 151 | - The CPU is the brain of the computer 152 | - Does all the thinking 153 | - Performs math in numbers fed to it 154 | - Helps display numbers on a screen 155 | - Adds or deletes numbers 156 | - CPUs now can have multiple cores 157 | - Cores are the devices inside the CPU that can preform mathematical operations, load info from memory, save info to memory, etc. 158 | - The more cores, the more tasks a CPU can do at once 159 | - CPUs now also support hyper-threading 160 | - Where a single core will present itself as multiple cores to a computer's operating system 161 | - Systems on a Chip (SoaC) are when a CPU and more are all interconnected at once rather than attached to a motherboard 162 | - Popular in phones, tables, and game consoles 163 | - Raspberry Pi 164 | 165 | ![raspberry pi](pi.png) 166 | 167 | ## RAM (Random Access Memory) 168 | - Circuit board with chips that slides into a slot on the motherboard 169 | 170 | ![ram](ram.png) 171 | - The chips store data 172 | - Only stores data when the power is on 173 | - Files and programs are loaded onto these chips when ran 174 | - Fast memory 175 | - You can check your RAM and other specs: 176 | - Windows Task Manager 177 | 178 | ![windows task manager](windows.png) 179 | - CPU chart shows when peak usage occurs 180 | - GHz is the number of operations a CPU can perform per second (in billions) 181 | - 1.94 GHz = 1.94 billion operations per second 182 | - Logical processors in this case is 4, which means both cores support hyper-threading 183 | - Each core will do two things at once as if 4 cores exist 184 | - Mac System Profiler 185 | 186 | ![mac](mac.png) 187 | 188 | ## Hard Drives 189 | 190 | - When you turn a computer off, you need a place to store data 191 | - A hard disk drive (HDD) stores this information 192 | 193 | ![hard drive exterior](hddout.png) 194 | - RAM may store 1 GB, 2 GB, 4 GB, through 16 GB or so 195 | - HDD stores 256 GB, 1024 GB (AKA terabyte or TB), 2 TB 196 | - Inside a HDD, metal platters physically spin around 197 | 198 | ![hard drive interior](hddinside.png) 199 | 200 | - Data is stored on these disks 201 | - The reading heads move back and forth reading data from the device 202 | - Uses tiny magnetic particles where north pole orientation represents 1 and south pole orientation represents 0 203 | - Power is only needed to read or change the data 204 | - Data is preserved when power is off 205 | - David shows a video of a HDD running in slowmo 206 | - To store data in a hard drive, RAM sends data and instructions to the HDD 207 | - The hard drive translates that data into voltage fluctuations 208 | - Some signals spin the platters, others move the read/write heads 209 | - Pulses sent to the read/write head turn on a magnet which creates a field that changes the polarity of a tiny portion of the metal platter's surface 210 | - Power is sent in different directions as to change polarity 211 | - To read, the particles on the disk use their charge to move the read/write head. 212 | - Pieces of a file can be spread out around the platters 213 | - A special file keeps track of data's location 214 | - Anytime you have a physical device that moves over a period of time, things go wrong 215 | - Dropping a HDD can corrupt files 216 | - Platters spin slower than how fast electrons move 217 | 218 | ## Flash Memory 219 | 220 | - Solid state disk (SSD) 221 | 222 | ![solid state drive exterior](ssdout.png) 223 | - Smaller (3.5 inch width for HDD vs 2.5 inch width for SSD) 224 | - Still fits where old HDDs are 225 | - No moving particles 226 | - Inside, it looks a lot like RAM 227 | 228 | ![solid state drive interior](ssdinside.png) 229 | - Much faster than HDD 230 | - Programs/files load and save more quickly 231 | - SSD theoretically don't last as long as HDD 232 | - Finite number of writes 233 | - Hybrid Drives 234 | - Some GB of solid state memory and more GB or TB of HDD space 235 | - Stores as much of frequently-needed data on the SSD 236 | - Stores less frequently-needed data on HDD 237 | - Flash memory also exists in the form of USB sticks 238 | - Might store 1 GB, 16 GB, or more 239 | - Portable 240 | - External SSDs exist for more storage 241 | - Might store 256 GB or more 242 | - Can be used to share data with others without network usage 243 | - Can also have external HDD 244 | 245 | ## Types of Memory and Funneling 246 | 247 | - There is a tradeoff between space, money, and speed of data transfer 248 | 249 | ![funnel](funnel.png) 250 | - Data is pushed "down the funnel" to your CPU 251 | - From the hard drive, data first goes to the RAM 252 | 253 | ![tradeoffs](tradeoff.png) 254 | 255 | - Theoretically, the CPU never has to wait for data to crunch 256 | - There is a tiny amount of memory (bytes) called registers where numbers are stored for operations. 257 | - Memory at the bottom is more expensive 258 | - Disk is important for the long-term storage 259 | - RAM is important as it stores programs you use simultaneously 260 | - L3, L2, L1 cache are on the motherboard 261 | - As an analogy for memory, picture a candy store 262 | - A customer approaches the counter and requests candy 263 | - The shop owner then leaves the counter to grab the candy before returning moments later 264 | - Not super efficient to walk all the way to the store room to grab candy 265 | - Better to have a cache of memory 266 | - Instead, the shop owner leaves the counter to ready a cache of candy before the customers arrive 267 | - When a customer comes, the candy can be distributed quickly 268 | - Cache memory similarly helps the CPU in this manner 269 | - We can see sizes of cache looking at computer specs like before 270 | 271 | ## Display Connectors 272 | 273 | ![display](display.png) 274 | 275 | - These sockets all connect to monitors or displays 276 | - Mini DisplayPort are used form monitors 277 | - HDMI is not only on laptops and computers but also TVs 278 | - VGA is older, but still commonly uses on projectors 279 | 280 | ## USB (Universal Serial Bus) 281 | 282 | ![usb](usb.png) 283 | - Can plug in a whole range of peripheral devices including printers, keyboards, mice, scanners, etc. 284 | - USB-A most common 285 | - USB-B is often used for printers and scanners 286 | - USB-C is newer and can be plugged in coming from different directions 287 | - Other variants often exist for phones 288 | - Older USB connections are slower when transferring data 289 | - Hard drives can connect via USB 290 | - Even if a hard drive is fast, if the USB is slow, the transfer of data will be slow 291 | 292 | ## Wireless 293 | 294 | - Wifi is wireless internet 295 | - Bluetooth allows devices such as wireless keyboards and headphones to connect to your computer 296 | - Limited range 297 | - This is ok as it is used for you to connect to your own device 298 | 299 | ## Operating System (OS) 300 | 301 | - Software that ensures all devices work and can intercommunicate 302 | - MacOS and Windows are popular OS 303 | - Can be installed by the user, but is typically done so by a manufacturer 304 | - Installed on HDD or SDD so that it exists persistently without power 305 | - When you hit power on your computer, the OS is loaded into RAM 306 | - Gives you the graphical interface that you see 307 | - Knows how to: 308 | - Talk to your keyboard and mouse 309 | - Display info on the screen 310 | - Move things around in memory 311 | - This is all thanks to device drivers installed with the OS 312 | - Special software designed to talk to certain model of printer, camera, scanner, etc. 313 | - When an OS doesn't recognize a device, perhaps because it's too new, you can download new device drives from the device manufacturer 314 | - Teaches Window, MacOS, or Linux about that new hardware 315 | - Future-proofing structure 316 | - It's this intersection of hardware and software that makes computers powerful! 317 | 318 | ## Looking Underneath the Hood 319 | 320 | - David and Colton Ogden look at the exterior of an old ThinkPad computer, examining ports 321 | - Power bricks convert power from the wall into safe amounts for the computer 322 | - David and Colton examine the inside of an old window desktop, highlighting the motherboard, heatsink, RAM, Hard Drive, etc. 323 | - David and Colton then look inside a HDD 324 | - Once exposed to air and dust, it's no longer reliable enough to use 325 | - David and Colton then look at a motherboard examining all the ports on it 326 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/mac.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/pi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/pi.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/ram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/ram.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/ssdinside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/ssdinside.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/ssdout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/ssdout.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/tradeoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/tradeoff.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/usb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/usb.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/hardware/notes/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/hardware/notes/windows.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/index.md: -------------------------------------------------------------------------------- 1 | # Understanding Technology 2 | 3 | * [Hardware](hardware) 4 | * [Internet](internet) 5 | * [Multimedia](multimedia) 6 | * [Security](security) 7 | * Reference Sheets 8 | * [Computers and Computing](https://ap.cs50.school/assets/pdfs/computers_and_computing.pdf) 9 | * [CPU and SoC](https://ap.cs50.school/assets/pdfs/cpu_and_soc.pdf) 10 | * [Cybersecurity](https://ap.cs50.school/assets/pdfs/cybersecurity.pdf) 11 | * [How Computers Work](https://ap.cs50.school/assets/pdfs/how_computers_work.pdf) 12 | * [Memory](https://ap.cs50.school/assets/pdfs/memory.pdf) 13 | * [Routers](https://ap.cs50.school/assets/pdfs/routers.pdf) 14 | * [Transistors and Logic](https://ap.cs50.school/assets/pdfs/transistors_and_logic.pdf) 15 | * [Trust Models](https://ap.cs50.school/assets/pdfs/trust_models.pdf) 16 | * [Virtual and Augmented Reality](https://ap.cs50.school/assets/pdfs/virtual_and_augmented_reality.pdf) 17 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/index.md: -------------------------------------------------------------------------------- 1 | # Internet 2 | 3 | * [Notes](notes) 4 | * [Slides](http://cdn.cs50.net/cscie1a/2017/fall/lectures/internet/internet.pdf) 5 | * [Video](https://video.cs50.net/cscie1a/2017/fall/lectures/internet) 6 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/happycat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/happycat.jpg -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/homenetwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/homenetwork.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/index.md: -------------------------------------------------------------------------------- 1 | # Internet 2 | {:.no_toc} 3 | 4 | * TOC 5 | {:toc} 6 | 7 | 8 | ## Introduction 9 | - We use the internet on a daily basis and have constant access and connectivity 10 | - Home network 11 | 12 | ![home network](homenetwork.png) 13 | 14 | - Cable modem, DSL modem, or FIOS device 15 | - Connects to the internet 16 | - Pay monthly for an ISP (Internet Service Provider) 17 | - Verizon, Comcast, etc. 18 | - Could have built in wireless connectivity for your devices 19 | - May need an additional home router 20 | - Devices connect to a router via cables or wifi 21 | 22 | ## IP 23 | 24 | - Every computer on the internet has an IP (Internet Protocol) address 25 | - Of the form #.#.#.# 26 | - Four numbers separated by dots of the values 0-255 27 | - Other IP address formats exist today as well 28 | - Like postal addresses, they uniquely identify computers on the internet 29 | - Any device connected to the internet has an IP address 30 | - Allows other computers to talk to it 31 | - ISPs assign a IP address to your computer (router) 32 | - Used to be physically configured 33 | - DHCP (Dynamic Host Configuration Protocol) 34 | - Software that ISPs provides to allow your computer to request an IP address 35 | - DHCP servers respond with a specific IP address for your Home 36 | - Multiple devices can connect to your home network 37 | - The home router supports DHCP and assigns IP addresses to your devices 38 | 39 | ## DNS 40 | 41 | - We access websites using domain names (Facebook.com, Google.com, etc.), but it turns out that these sites too have IP addresses 42 | - DNS (Domain Name System) servers convert domain names into IP addresses 43 | 44 | ## Packets 45 | 46 | - Computers communicate by sending packets, which are like virtual envelopes sent between computers 47 | - Ultimately still 0s and 1s 48 | - The bandwidth (measured in bits/second) of a network defines the maximum amount of data that can be sent in fixed amount of time. You can check your network bandwidth by visiting [fast.com](https://fast.com). 49 | - As an analogy, suppose we want to find a cat image on the internet 50 | - So, we send a request to a server, say Google, like "get cat.jpg" 51 | - We place this request in an envelope 52 | - On the envelope, we list out IP as the return address 53 | - However, for the recipient of the request, we don't know the IP address for Google 54 | - Have to rely on DNS 55 | - Send a request to our ISPs DNS server for Google's IP address 56 | - If the ISP's DNS server doesn't know a website's IP address, it has been configured to ask another DNS server 57 | - There exist root servers that know where to look to for an IP address if it exists 58 | - After sending the request off, we'll get a response ms later 59 | 60 | ![happy cat](happycat.jpg) 61 | - The cat will be sent back in one or more packets 62 | - If the cat image is too large for a single envelope, sending it in one packet could take up internet traffic 63 | - To solve this, Google will divide the cat image into smaller fragments 64 | - Put the fragments into different envelopes 65 | - Write information on the envelopes 66 | - Return address: Google's IP address 67 | - Delivery address: Our IP address 68 | - List the number of packets on each envelope (1 of 4, 2 of 4, etc.) 69 | 70 | ## TCP/IP 71 | 72 | - IP goes beyond addresses 73 | - Set of conventions computers and servers follow to allow intercommunication 74 | - Fragmentation like in the envelope example are supported by IP 75 | - If missing a packet, you can logically infer which packet you're missing based on the ones received 76 | - However, IP doesn't tell computers what to do in this case 77 | - TCP (Transmission Control Protocol) ensures packets can get to their destination 78 | - Commonly used with IP (TCP/IP) 79 | - Supports sequence numbers that help data get to its destination 80 | - When missing a packet, a computer can make a request for the missing packet 81 | - The computer will put packets together to get a whole file 82 | - Also includes conventions for requesting services (port identifiers) 83 | - To make sure Google knows we're requesting a webpage and not an email or other service 84 | 85 | ## Ports 86 | 87 | - Per TCP, the world has standardized numbers that represent different services 88 | - If 5.6.7.8 is Google's IP address, 5.6.7.8;80 (port 80) lets use know that we want a webpage 89 | - 80 means http (hypertext transfer protocol) 90 | - The language that web servers speak 91 | - Google will send the request to their web server via http 92 | - Many websites use secure connections with SSL or HTTPS, which uses the port 443 93 | - These SSL certificates validate encryption keys used in secure communications. They are typically issued by a certificate authority. 94 | - Email uses port 25 95 | - Other ports exist as well 96 | 97 | ## Protocols 98 | 99 | - Protocols are just sets of rules 100 | - Humans use these all the time, such as the protocol for meeting people: handshakes 101 | - When a request is made to Google for an image, HTTP tells Google how to respond appropriately 102 | - The world wide web is an application used to view webpages, programs, and files that uses the HTTP protocol. These webpages are prefixed with `http://www`. 103 | - The world wide web uses the internet, which is a much larger system comprised of networks, connecting millions of computers. 104 | 105 | ## UDP 106 | 107 | - User Datagram Protocol 108 | - Doesn't guarantee delivery 109 | - Used for video conferencing such as FaceTime 110 | - Packets can be dropped for the sake of keeping the conversation flowing 111 | - Used anytime you want to keep data coming without waiting for a buffer to fill 112 | 113 | ## IPs in More Detail 114 | 115 | - IP addresses are limited 116 | - In the format #.#.#.#, each number is 8 bits, so 32 bits total 117 | - This yields 232 or about 4 billion possible addresses 118 | - We're running out of addresses for all computers 119 | - Current version of addresses is IPv4 120 | - Moving towards IPv6 121 | - Uses 128 bits, yielding 2128 possible addresses 122 | - How do you find your IP address? 123 | - On a Mac, go to system preferences an poke around a bit 124 | 125 | ![mac](mac.png) 126 | - Private addresses exist 127 | - 10.#.#.#, 192.168.#.#, or 172.16.#.# 128 | - Only with special configuration can someone talk to your computer 129 | - Your personal device is not a server, so people should not need to access them directly 130 | - Your device needs to request data from servers 131 | - Even email is stored on a server such as Gmail and your device makes a request to that server to access that email 132 | - Looking at advanced settings... 133 | 134 | ![mac ethernet settings](macadv.png) 135 | - Subnet mask is used to decide if another computer is on the same network 136 | - Router (aka Gateway) has its own address 137 | - Routs data in different directions 138 | - On windows: 139 | 140 | ![windows](windows.png) 141 | - Shows DNS servers as well 142 | 143 | ## Routers 144 | 145 | - Routers have bunches if wires coming and going out of them 146 | - They have a big table with IP addresses and where data should be routed to get to that destination 147 | - Often, the data is routed to some next router 148 | - Routers purpose is to send data in the direction of a destination 149 | - The next router will send it to another until it reaches a destination 150 | 151 | ![network](network.png) 152 | - The internet is a network of networks (with their own routers) that was designed to be scalable. Scalability is the capacity for the system to change in size and scale to meet new demands. 153 | - Often multiple ways to go from A to B to create a more fault-tolerant system, this is called network redundancy. 154 | - Based in US Military logic to prevent downtime if a particular router goes down 155 | - When multiple packets are sent, like cat.jpg from Google, they can each take a different path, still getting to their destination eventually 156 | - Sometimes the internet is busy and the quickest path changes 157 | - Having multiple paths from A to B 158 | 159 | 160 | ## Traceroute 161 | 162 | - How long does it take for this process of data transfer to take on the internet? 163 | - Traceroute is a program that sends packets to each router on a path to a destination, reporting the time it takes to reach that router 164 | - From Sanders Theatre to Google.com: 165 | 166 | ![traceroute Google](traceroutegoogle.png) 167 | - 1-2: A few unnamed routers at Harvard 168 | - 3-4: More Harvard routers 169 | - 5-6: Level3 is a ISP 170 | - 7+: The routers are denying the request 171 | - From Sanders Theatre to Berkeley.edu 172 | 173 | ![traceroute Berkeley](tracerouteberkeley.png) 174 | - 6: Northern Crossroads 175 | - 7-14: A fast connection 176 | - 8-9: Chicago 177 | - 10-11: Denver 178 | - 12-13: Las Vegas 179 | - 14: Los Angeles 180 | - 19 is where it arrives at Berkeley in 80 ms! 181 | 182 | - From Sanders Theatre to MIT.edu 183 | 184 | ![traceroute MIT](traceroutemit.png) 185 | - 6-7: Goes to New York connectivity 186 | - 8: MIT's website is outsourced to Akamai's NYC servers 187 | 188 | - From Sanders Theatre to CNN.jp 189 | 190 | ![traceroute Japan](traceroutejp.png) 191 | - 9-10 jumps from Seattle to Osaka past an ocean! 192 | - Using undersea cabling 193 | 194 | ## Undersea Cabling 195 | 196 | - David shows a video about undersea cables 197 | 198 | ## Cable Modem Demo 199 | 200 | - David examines a home cable modem, focusing on its ports 201 | - Coaxial cable to plug into the wall 202 | - Phone jacks (RJ11) as many services are bundled together these days 203 | - Four jacks for ethernet cables (RJ45) 204 | - Devices can plug into these for internet connectivity 205 | - This modem has wifi support built in 206 | 207 | ## Network Switch Demo 208 | 209 | - David examines a network switch 210 | - A device that you can plug into your router to allow more connections for all your other devices 211 | 212 | ## Home Router Demo 213 | 214 | - David examines a home router 215 | - Home routers can have wifi, firewall, and switching capabilities 216 | 217 | ## Network Cable Demo 218 | 219 | - David cuts open a network ethernet cable to examine its inner workings 220 | - Inside a network cable are 8 wires of different colors 221 | - Some are for transmitting data, others for receiving data 222 | - Others still are for insulation and cancellation of interference 223 | 224 | ## AP CSP Terminology 225 | 226 | - __Computing device__: a physical artifact that can run a program 227 | - __Computing system__: a group of computing devices and programs working together for a common purpose 228 | - __Computing network__: a computing system that contains a group of interconnected computing devices capable of sending and receiving data. 229 | - __Path__: a sequence of directly connected computing devices that begins and ends at the receiver. 230 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/mac.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/macadv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/macadv.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/network.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/tracerouteberkeley.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/tracerouteberkeley.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/traceroutegoogle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/traceroutegoogle.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/traceroutejp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/traceroutejp.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/traceroutemit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/traceroutemit.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/internet/notes/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/internet/notes/windows.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/index.md: -------------------------------------------------------------------------------- 1 | # Multimedia 2 | 3 | * [Notes](notes) 4 | * [Slides](http://cdn.cs50.net/cscie1a/2017/fall/lectures/multimedia/multimedia.pdf) 5 | * [Video](https://video.cs50.net/cscie1a/2017/fall/lectures/multimedia) 6 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/apples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/apples.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/band.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/band.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/garageband.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/garageband.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/index.md: -------------------------------------------------------------------------------- 1 | # Multimedia 2 | {:.no_toc} 3 | 4 | * TOC 5 | {:toc} 6 | 7 | 8 | ## Introduction 9 | 10 | - Odds are you use it everyday, but what is it? 11 | 12 | ## Audio 13 | 14 | - Computers are good at recording, playing back, and generating audio 15 | - Uses different file formats 16 | - File formats are just a way of storing 0s and 1s on disk so that certain software knows how to interpret it 17 | - MIDI 18 | - Way of storing musical notes for certain songs 19 | - Can do this for different instruments 20 | - Programs can render the notes for these instruments 21 | - GarageBand 22 | - Included with macOS 23 | 24 | ![GarageBand](band.png) 25 | 26 | - This is the Star Wars theme in MIDI 27 | - Doesn't sound quite as good as the actual version 28 | - Computer synthesizes the notes 29 | - Not an actual recording 30 | - Computer interprets notes in the MIDI file 31 | - MIDI is common in the digital workspace among musicians who wish to share music with each other. 32 | - Humans typically like to hear music preformed and recorded by humans 33 | - File formats for recorded music include: 34 | - AAC 35 | - MIDI 36 | - MP3 37 | - WAV 38 | - WAV is an early sound format, but still used 39 | - Uncompressed data storage allowing high quality 40 | - MP3 41 | - File format for audio that uses compression 42 | - Significantly reduce how many bits are necessary to store a song 43 | - Discards 0s and 1s that humans can't necessarily hear 44 | - True audiophiles may disagree 45 | - Trade off between optimizing storage space and sacrificing quality 46 | - This compression is said to be lossy 47 | - Losing the quality in the compression process 48 | - AAC 49 | - Similar to MP3 50 | - May see when you download a song from iTunes 51 | - Streaming services such as Spotify don't transfer a file to you but rather stream bits of information to you 52 | - How do we think about the quality of these formats? 53 | - Sampling frequency 54 | - Number of times per seconds we take a digital snapshot of what a person would hear 55 | - Bit depth 56 | - Number of bits used for these individual snapshots 57 | - Sampling frequency x bit depth = number of bits necessary to store one second of music 58 | - Audio file formats allow you to modify what these parameters are 59 | 60 | ## Graphics 61 | 62 | - A graphic, what we see with multimedia, is really just a bunch of pixels both horizontal and vertical 63 | - All file formats are rectangular in nature, though transparent pixels can make images look to take on other shapes 64 | - In the simplest form, each of the dots or pixels is a bunch of 0s and 1s 65 | 66 | ![smile](smile.png) 67 | 68 | - To create a file format, we just need to determine a mapping 69 | - This image is only black and white, so how to represent color? 70 | 71 | ## RGB 72 | 73 | - RGB stands for Red Green Blue 74 | - With information giving an amount of red, an amount of green, and an amount of blue, you can tell a computer how to colorize pixels 75 | - None of the colors yields a black pixel 76 | - All of the colors yields a white pixel 77 | - In between these two options is where we get all sorts of colors 78 | - Consider the three bytes: 11111111 00000000 00000000 79 | - If we interpret these bytes to represent colors, it appears we want all of the red, none of the green, and none of the blue 80 | - These 24 bits (3 bytes = 3 x 8 bits = 24 bits) represent the color we know as red! 81 | - If a computer wanted to represent this color, it would store these 24 bits 82 | - Consider the three bytes: 00000000 11111111 00000000 83 | - Green 84 | - Consider the three bytes: 00000000 0000000 11111111 85 | - Blue 86 | - Consider the three bytes: 00000000 0000000 0000000 87 | - Black 88 | - Consider the three bytes: 11111111 11111111 11111111 89 | - White 90 | - Can get many color variations by mixing the above colors in different quantities 91 | - When we talk about image formats, we typically don’t talk in terms of binary but rather something called hexadecimal (base-16, contains 16 digits) 92 | - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f 93 | - 0 is the smallest number we can represent in single digit 94 | - f is the largest number (value of 15) we can represent in a single digit 95 | - Consider the 8 bits: 1111 1111 96 | - Each hexadecimal digit represents four bits 97 | - One hexadecimal digit can represent the first four bits, another can represent the second four 98 | - Represent something with eight symbols using only two! 99 | - 1111 is the decimal number 15, which is f 100 | - Therefore, 1111 1111 in hexadecimal is ff 101 | - Red can thus be represented in hexadecimal as ff 00 00 102 | - Green can be represented in hexadecimal as 00 ff 00 103 | - Blue can be represented in hexadecimal as 00 00 ff 104 | - A lot of graphical editing software such as Photoshop use hexadecimal to represent colors 105 | 106 | ## Bitmap Format 107 | 108 | - This background for Windows XP was a bitmap file (.bmp) 109 | 110 | ![XP](xp.png) 111 | - A mapping or grid of bits much like the smiley face from before 112 | - Zooming in on this image show that it is just a grid of dots 113 | 114 | ![XP zoom](xpzoom.png) 115 | 116 | - Notice the pixelation 117 | - Much like with audio, so too in the world of images do you have discretion over how many bits to use 118 | - How many bits to represent each pixel's color? 119 | - Resolution is another factor 120 | - An image that is only 100 pixels scaled up only duplicates the existing limited information, resulting in a blotchy image 121 | - Would be better to start with image that has a higher resolution (more pixels) 122 | - A lot of repeated colors, so it seems silly to represent each color with the same number of bits 123 | 124 | ## Image Compression 125 | 126 | - Graphical file formats can often be compressed 127 | - Can be done lossy or losslessly 128 | - With audio, we threw away audio information that the human ear can't necessarily hear 129 | - This is lossy compression; throwing information away 130 | - Using fewer bits to represent the same information is lossless compression 131 | - Lossless compression 132 | 133 | ![apples](apples.png) 134 | 135 | - There is a lot of repeated blue in the first image 136 | - Using the same 24 bits to represent each pixel! 137 | - The second image is compressed and not what a user would see 138 | - The first column contains the color that the rest of the row (scan line) should have 139 | - Image contains instructions on how to repeat the color in a particular row 140 | - When a color is encountered that isn't in the first column (the apple in this case), the instructions would list the colors for each non-repeated pixel 141 | - This uses less bits but makes the original information recoverable 142 | - Lossy compression 143 | 144 | ![sunflower1](sunflower1.png) 145 | 146 | - This is a .jpg photograph that is somewhat compressed, but not easy to tell 147 | - Let's say we want to compress this image further so that we can share it without going over a social media platform's limit 148 | - It contains more complicated patterns of colors, so let's try a lossy compression resulting in the following: 149 | 150 | ![sunflower2](sunflower2.png) 151 | 152 | - Lossy compression means that I won't be able to get that original image back 153 | - The compression throws away bits of information 154 | - "Does the sky really need this many shades of blue?" 155 | - "Does this leaf really need this many shades of green" 156 | - Replaces bits with only a few colors giving an approximation 157 | - I will not be able to know how clear the sky used to be from this information 158 | 159 | ## Image File Formats 160 | 161 | - BMP 162 | - Originally used by Windows 163 | - Not super common these days 164 | - GIF 165 | - Low quality images 166 | - Only supports 8-bit color 167 | - Often used for memes 168 | - Can be animated 169 | - Like a video file with only a few images 170 | 171 | ![nyan](nyan.gif) 172 | 173 | - JPEG 174 | - Supports 24-bit color 175 | - Losslessly compresses 176 | - Can minimize amount of compression to create high quality photos 177 | - PNG 178 | - High quality graphics 179 | - Supports 24-bit color 180 | - All these formats ultimately have an limited amount of information 181 | - Ultimate just store pixels and colors of when the image was taken 182 | 183 | ## "Enhance" 184 | 185 | - Common for popular culture abuses of what it means to be a multimedia format 186 | - "Enhancing" means to make an image as clear as possible not matter what format it was saved in 187 | - [David shows a clip of characters "enhancing" an image](https://video.cs50.net/cscie1a/2017/fall/lectures/multimedia?t=27m30s) 188 | - The characters zoom into a pixelated frame of a video and somehow clear it up to see a reflection 189 | - Video is just a whole bunch of images being shown to us quickly (24 frames per second, etc.) 190 | - The pixelated image only contains information for those pixels 191 | - There is no way to obtain a clear image unless the original image was already at a high resolution 192 | - [David contrasts this with an aware clip of Futurama](https://video.cs50.net/cscie1a/2017/fall/lectures/multimedia?t=30m5s) 193 | 194 | ## Video Compression 195 | 196 | - You can think of a video format as similar to a flip book 197 | - Video formats are just a bunch of images shown quickly in succession to create the illusion of motion 198 | - Not necessarily all information stored as png, jpg, gif, or even images 199 | - Algorithms and mathematics can help go from one frame to another 200 | - Opportunities for compression 201 | - Can leverage same image compression techniques for each frame (intra-frame coding) 202 | - Background of multiple frames can contain redundant information 203 | 204 | ![interframe](interframe.png) 205 | 206 | - Compare current frame and next frame of video and determine what has changed 207 | - Store these differences 208 | - Key frames store a snapshot of time to remember what the video looks like 209 | - In each subsequent frame remember what has changed 210 | - Using algorithms and math, background is drawn 211 | - Key frames are stored multiple times to guarantee that frames can be recovered 212 | 213 | ## Video File Formats 214 | 215 | - In the world of video, there are more solutions on how to store information 216 | - Video file formats are containers 217 | - Containers are digital container in which you can put multiple types of data 218 | - Can include a video track, audio track, a secondary audio track (for different languages), closed captions, ... 219 | - AVI 220 | - Commonly used in Windows 221 | - DivX 222 | - Matroska 223 | - Open source container meant to be more versatile 224 | - MP4 225 | - Pretty much universal in all browsers 226 | - QuickTime 227 | - Commonly used in MacOS 228 | - Codecs 229 | - Ways of storing and encoding information 230 | - For video: 231 | - H.264 232 | - MPEG-4 Part-2 233 | - ... 234 | - For audio: 235 | - Can be stand alone files or tracks in a container! 236 | - AAC 237 | - MP3 238 | - ... 239 | 240 | ## 3D Video 241 | 242 | - Increasingly, 3D formats are becoming more common 243 | 244 | ![Sanders](sanders.png) 245 | 246 | - This is a 360 degree image of Sanders Theatre 247 | - A spherical image 248 | - Looks distorted in 2D 249 | - Like flattening a globe 250 | - Images can contain metadata 251 | - Information that viewers can't see 252 | - Tells programs, applications, and browsers how to display the image 253 | - With sensors on a headset, users can experience virtual reality 254 | 255 | ![VR](vr.png) 256 | 257 | - More file formats are still on the horizon, but ultimately all of them boil down to storing 0s and 1s! 258 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/interframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/interframe.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/nyan.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/nyan.gif -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/sanders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/sanders.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/smile.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/sunflower1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/sunflower1.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/sunflower2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/sunflower2.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/vr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/vr.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/xp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/xp.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/multimedia/notes/xpzoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/multimedia/notes/xpzoom.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/security/index.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | * [Notes](notes) 4 | * [Slides](http://cdn.cs50.net/cscie1a/2017/fall/lectures/security/security.pdf) 5 | * [Video](https://video.cs50.net/cscie1a/2017/fall/lectures/security) 6 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/security/notes/alicebob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/security/notes/alicebob.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/security/notes/bob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/security/notes/bob.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/security/notes/index.md: -------------------------------------------------------------------------------- 1 | # Security 2 | {:.no_toc} 3 | 4 | * TOC 5 | {:toc} 6 | 7 | ## Introduction 8 | 9 | - Our data is under constant threat, but how can we defend ourselves? 10 | 11 | ## Privacy 12 | 13 | - Keeping people away from things you don't want them to see 14 | - Computers are among the least secure devices you own 15 | - Data or files are stored on them as 0s and 1s 16 | - Can be financial info, photos, or other personally identifiable information (PII), such as: 17 | - Social Security number 18 | - age 19 | - race 20 | - phone number 21 | - medical information 22 | - biometric information 23 | 24 | ## Deleting Files 25 | 26 | - What does it mean to delete a file off of a hard drive? 27 | - Visually, it disappears from a desktop or folder 28 | - Files are stored on a computer as 0s and 1s 29 | - Some space needs to be allocated for the file 30 | - The operating system has a file that keeps track of files an their location on disk 31 | - Graphically, when a file is deleted, it moves to the trash (or recycle bin) 32 | - It can still be easily revived from here, until you empty the trash 33 | - However, an operating system doesn't actually delete it from the hard drive 34 | - It simply forgets the location and existence of the file! 35 | - One can theoretically recover data by looking for familiar patterns of bits 36 | - So how do we delete more securely? 37 | - Re-saving a file with overridden information actually could not override the old bits but rather create more 0s and 1s stored on a hard drive! 38 | - Special software can wipe data off of a hard drive 39 | - Who do computers have this obvious flaw with deleting? 40 | - What if we accidentally delete a file? 41 | - This structure allows for recovery 42 | - Wiping data also takes a lot of time, so it's much faster to just forget locations of data 43 | 44 | ## Cookies 45 | 46 | - A feature supported by HTTP 47 | - Little values a web server puts on a user's browser 48 | - Used to remember if a user has visited a website before 49 | - Allows you to not have to log in every time you visit or refresh a page 50 | - When you log into a web server, a cookie is planted on your browser 51 | - Stored in a database 52 | - Browser will send value to web server to remind of previous login 53 | - When we make a request we send: 54 | ``` 55 | GET / HTTP/1.1 56 | Host: example.com 57 | ``` 58 | - We receive: 59 | ``` 60 | HTTP/1.1 200 OK 61 | Set-Cookie: session=29823bf3-075a-433a-8754-707d05c418ab 62 | ``` 63 | - The server gives us a cookie. 64 | - A cookie is like an ink-based hand stamp for an amusement park or club 65 | - Wireless information can be intercepted 66 | - What if a hacker could obtain the cookie 67 | - Session hijacking attack 68 | - If you have already logged in, hacker can pretend to be you 69 | - Encryption scrambles this value so hackers cannot easily use it 70 | - Browser history remembers everywhere you've been and everything you've done there 71 | - Convenient if you want to recall a website you've visited 72 | - But, so can anyone else with access to your browser 73 | - Can clear browser history and cookies 74 | - History likely not securely scrubbed 75 | - Will protect you from nosey friends 76 | - Websites will forget you visited as the cookies will be deleted as well! 77 | - Search engines can use your history and cookies to suggest targeted websites or products based on websites you've visited. This can be considered convenient but this information can also be sold or misused in a variety of ways both individually and at scale. 78 | - Every convenience that these technologies offer us comes with a cost. We can have our browser store things like our shipping information or credit card number to make it that much easier to purchase things online, but if someone were to gain access to our machine, they too would acquire this information. This too, brings up ethical concerns. How accountable are companies for our data? What are their obligations to their users in regards to how their data is used and stored? Are these businesses intentionally trying to harm us by selling or distributing our data? 79 | - Computing can even play a part in social and political issues, like in 2018, when [Cambridge Analytica](https://en.wikipedia.org/wiki/Facebook%E2%80%93Cambridge_Analytica_data_scandal) harvested user Facebook data fro political advertising. 80 | 81 | ## Incognito Mode 82 | 83 | - Can open up a typically different colored browser window 84 | - Use if you want history automatically removed 85 | - Useful when building a website as sometimes you want a browser to forget old iterations of your website build 86 | 87 | ## Authentication 88 | 89 | - All of this assumes you log in 90 | - If you don't use a passcode to protect your device, anyone can pretend to be you 91 | - What if you lose your phone or device? 92 | 93 | ## Passwords 94 | 95 | - On a phone could only be a few digits 96 | - Not super secure 97 | - \__ \__ \__ \__ 98 | - With numbers, each space has 10 options 99 | - 10 x 10 x 10 x 10 = 10,000 possibilities 100 | - 0000-9999 101 | - On many smartphones, you will have to wait for an amount of time if you have entered a bad passcode 102 | - Slows down the process of someone guessing 103 | - Add more digits or letters of the alphabet 104 | - Using a-z, A-Z, 0-9 105 | - \__ \__ \__ \__ 106 | - Each space now has 62 options (26 + 26 + 10) 107 | - 62 x 62 x 62 x 62 = 14,776,336 possibilities 108 | - Maybe you're super secure and you have a 20-char password 109 | - You could forget it 110 | - Annoying to type in repetitively 111 | - No one fits all 112 | - Short = bad, longer = good 113 | - Don't use popular words and phrases 114 | - Hackers will look for words or common phrases 115 | - Most common Passwords 116 | 1. 123456 117 | 2. 123456789 118 | 3. qwerty 119 | 4. 12345678 120 | 5. 111111 121 | 6. 1234567890 122 | 7. 1234567 123 | 8. password 124 | 9. 123123 125 | 10. 987654321 126 | - Hackers have dictionaries of bad passwords that they can search through and try 127 | - Random passwords 128 | - Usually have to confirm so it can be hard to replicate 129 | - Using numbers to represent letter is common 130 | - 1 for l 131 | - 4 for A 132 | - It's suggested you mix uppercase, lowercase, and and throw in numbers 133 | - Good to use misspellengs 134 | - Don't put your post-it with your password on your monitor! 135 | - Constant password changes can be a net negative 136 | - Can encourage easier passwords to help with memorization 137 | 138 | ## Password Resetting 139 | 140 | - What if you forget your password? 141 | - Often can click on a link to reset your password 142 | - Asks you to type email address or username 143 | - Typically, you get an email with a link 144 | - Hopefully this goes back to the same website! 145 | - It likely has a random value in the URL 146 | - Once back at the website, you update your password 147 | - The website has a database 148 | - It generated a random number and stored it with a note indicating password recovery 149 | - The website assumes that anyone who has access to this value and to the user's email is you 150 | - Typically, tech staff can't tell you what your password is 151 | - Odds are your password is encrypted (scrambled) or, more technically, hashed in their database 152 | - Getting a password in email means that the password are not hashed or encrypted! 153 | - Also, sending a password over email opens that email to interception 154 | - This is a red flag if a website does this 155 | 156 | ## Using The Same Password 157 | 158 | - You may have a favorite password that you reuse 159 | - Upside is that it's convenient 160 | - However, what if one of the websites are hacked? 161 | - A hacker may try to use the password on other websites to see what she or he can get into! 162 | 163 | ## Password Managers 164 | 165 | - Difficult to remember all these passwords 166 | - Software called password managers exist that store on your phone or hard drive all usernames and passwords in an encrypted way 167 | - You have a master password that logs you into everywhere! 168 | - Store it physically in somewhere like a safety deposit box 169 | - Password managers create long random passwords and will log in for you 170 | - All websites have different passwords! 171 | - However, if you lose the master password, you cannot get the accounts back! 172 | 173 | ## Two Factor Authentication 174 | 175 | - First factor is a password 176 | - Historically, something "only" the user knows 177 | - Can be guessed 178 | - Second factor should be fundamentally different 179 | - Should be something you have 180 | - An RSA device displays a unique value that is synced with a server 181 | 182 | ![RSA](rsa.png) 183 | - This number needs to be typed in too! 184 | - As long as this device isn't stolen by someone with your password, they can't get in as easily 185 | - Phones now run software that allows you to get a code and type them in 186 | - Should think about what websites you care about the most and enable two factor authentication 187 | - Some companies can use sms (text messages) 188 | 189 | ## Network security 190 | 191 | - So many of our current networks are wireless 192 | - You probably been conditioned to look for free wifi 193 | - Sometimes still might not connect for various reasons 194 | - If the wireless connection has not padlock (no password to log in) the connection is not secure 195 | - You may still visit https or secure websites 196 | - However, everything you do on http sites can be seen 197 | - What to do? 198 | - Don't use that network 199 | - Use a VPN (Virtual Private Network) 200 | - Connection to internet is encrypted 201 | 202 | ![VPN](vpn.png) 203 | - With an unsecured connection, anyone can access your data 204 | 205 | ## VPN 206 | 207 | - First establish encrypted connection to a server and let this server communicate for you 208 | - The connection between the VPN server and website can still be insecure! 209 | - Because we are encrypting data through an algorithm, using a VPN can slow down speed 210 | 211 | ## Firewall 212 | 213 | - A physical firewall is a wall between connected buildings that prevents the spread of fire 214 | - In the world of computer science, a firewall is software that looks at IP addresses and helps keep bad guys out and user data inside 215 | - Helps prevent people from accessing your computer 216 | 217 | ## Encryption 218 | 219 | - Data sent via public networks can be "sniffed" by adversaries. One way this can happen is through a rogue access point, a wireless access point not authorized by the network administrator, that gives unauthorized access to secure networks. 220 | - Suppose I want to send a secret message for "HI" 221 | - HI ➟ IJ 222 | - Change each letter by 1 223 | - The recipient needs to know how it changed to revert 224 | - Plaintext ➟ Cyphertext ➟ Plaintext 225 | - HI ➟ IJ ➟ HI 226 | - This is called a caesar cypher 227 | - Rotational cyphers are not that secure 228 | - Can be guessed easily 229 | - Not used for internet encryption 230 | - For this to work, recipient needs the key 231 | - To know the key, we need to agree in advance 232 | - Can't send it encrypted as well as they need the key! 233 | 234 | ## Public Key Cryptography 235 | 236 | - The last example with a caesar cypher is secret-key cryptography 237 | - Only one key 238 | - In public key cryptography there are two keys, one public and one private 239 | - Mathematical relationship between them 240 | - Use public key to encrypt, private key to decrypt 241 | 242 | ![Alice and Bob](alicebob.png) 243 | - Bob's private key can undo the effects of his public key 244 | - When Bob responds... 245 | 246 | ![Bob Response](bob.png) 247 | - Bob sends a message using Alice's public key 248 | - Your browser has its own public and private keys 249 | - So does websites like Google and Amazon 250 | - This allows them to communicate securely with you 251 | - Often this processes is used to exchange a secret key 252 | 253 | ## Phishing 254 | 255 | - These kind of attacks have become so prevent that the following has been posted around Harvard's campus 256 | 257 | ![phishing](phishing.png) 258 | - Phishing attacks are when an adversary sends a somewhat official-looking email 259 | - May contain a link asking for a password or account info 260 | - The email may contain an elaborate backstory "justifying" the request 261 | - The malicious email is trying to obtain information from you 262 | - Odds are that the link provided doesn't go to the website being claimed 263 | - Can go to a website that looks legit 264 | - People can just copy HTML 265 | - Results in giving up private information 266 | - It's healthy to distrust most email you get 267 | - Don't follow links, type in the address for the company yourself 268 | - Sketchy emails may have typographical errors 269 | 270 | ## Malware 271 | 272 | - Malicious software can also be sent via email 273 | - Windows is particularly vulnerable 274 | - Software can be injected into your browser and your computer to erase your hard drive, make your computer send spam, or hold your data hostage 275 | - Some malware encrypts your data and asks for large sums of money to get the key to decrypt it 276 | - Key could not even work! 277 | - This is called ransomware 278 | - Malware can ultimately do anything on your computer 279 | - Viruses are a type of malware that self replicates and inserts code into existing programs 280 | - Computer virus and malware scanning software can help protect a computer from malicious software 281 | - All real-world systems have the potential to be exploited. An adversary only needs one point of weakness and the developer needs to make sure the _entire_ system is secure. 282 | - As users of technology, we can do our part to combat against adversaries by updating our software regularly and reviewing and modifying the permissions we give to the software that we install. 283 | 284 | ## Trust 285 | 286 | - At the end of the day, all of security and privacy boils down to trust 287 | - People around you 288 | - Algorithms/software 289 | - Manufacturers 290 | - Websites 291 | - Everything we post online can be used in a way that is unintended. Anyone who can view the things we post can repost it, screenshot it, forward it to others, etc. 292 | - Using multiple usernames and pseudonyms can help obscure your identity online, but combining various types of information available online can help others deduce private information about you 293 | - We've downloaded software with trust that it will only do what it claims 294 | - Word could log your key strokes 295 | - Chrome could monitor you even when not on Google's website 296 | - Snapchat could not delete posts after being seen 297 | - There have been cases where software was written to cover tracks of being monitored! 298 | - Who's to say the software we're using is actually doing what we say? 299 | - It's east to curl up into a ball and worry, but we need to decide who to trust 300 | - Security measures make it more difficult for someone to be malicious, but ultimately they can't guarantee privacy 301 | - You have to decide what data you're comfortable with storing, what you view on the internet, who to trust, and how much to trust them 302 | -------------------------------------------------------------------------------- /curriculum/understanding_technology/security/notes/phishing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/security/notes/phishing.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/security/notes/rsa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/security/notes/rsa.png -------------------------------------------------------------------------------- /curriculum/understanding_technology/security/notes/vpn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/curriculum/understanding_technology/security/notes/vpn.png -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs50/ap-2020/de97a625b89b7095d3a5c0f27e0e40fb16692020/favicon.ico -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: false 3 | --- 4 | 5 | # Hello, world! 6 | 7 | This is CS50 AP, Harvard University's introduction to the intellectual enterprises of computer science and the art of programming for students in high school, which satisfies the College Board's new AP CS Principles curriculum framework. 8 | 9 | -------------------------------------------------------------------------------- /periods/1.md: -------------------------------------------------------------------------------- 1 | # Unit 0 2 | 3 | * [Computers and Computing]({{"/units/unit0/computers_and_computing" | relative_url }}) 4 | * [How Computers Work]({{"/units/unit0/how_computers_work" | relative_url }}) 5 | * [Binary and ASCII]({{"/units/unit0/binary_and_ascii" | relative_url }}) 6 | * [Logic and Processors]({{"/units/unit0/logic_and_processors" | relative_url }}) 7 | 8 | 102 | -------------------------------------------------------------------------------- /periods/5.md: -------------------------------------------------------------------------------- 1 | # Unit 0 2 | 3 | * [Computers and Computing]({{"/units/unit0/computers_and_computing" | relative_url }}) 4 | * [How Computers Work]({{"/units/unit0/how_computers_work" | relative_url }}) 5 | * [Binary and ASCII]({{"/units/unit0/binary_and_ascii" | relative_url }}) 6 | * [Logic and Processors]({{"/units/unit0/logic_and_processors" | relative_url }}) 7 | * [Memory]({{"/units/unit0/memory" | relative_url }}) 8 | * [Algorithms]({{"/units/unit0/algorithms" | relative_url }}) 9 | 10 | 11 | # Unit 1 12 | 13 | * [Pseudocode]({{"/units/unit1/pseudocode" | relative_url }}) 14 | * [Scratch]({{"/units/unit1/scratch" | relative_url }}) 15 | * [Syntax]({{"/units/unit1/syntax" | relative_url }}) 16 | * [Variables]({{"/units/unit1/variables" | relative_url }}) 17 | * [Data Types]({{"/units/unit1/data_types" | relative_url }}) 18 | * [Operators]({{"/units/unit1/operators" | relative_url }}) 19 | * [Boolean Expressions and Conditionals]({{"/units/unit1/boolean_expressions_and_conditionals" | relative_url }}) 20 | * [Loops]({{"/units/unit1/loops" | relative_url }}) 21 | 22 | # Unit 2 23 | 24 | * [Compiling]({{"/units/unit2/compiling" | relative_url }}) 25 | * [Functions]({{"/units/unit2/functions" | relative_url }}) 26 | * [Arrays and Strings]({{"/units/unit2/arrays_and_strings" | relative_url }}) 27 | * [Command-Line Interaction]({{"/units/unit2/command-line_interaction" | relative_url }}) 28 | * [Exit Codes]({{"/units/unit2/exit_codes" | relative_url }}) 29 | * [Libraries]({{"/units/unit2/libraries" | relative_url }}) 30 | * [Typecasting]({{"/units/unit2/typecasting" | relative_url }}) 31 | * [Bugs and Debugging]({{"/units/unit2/bugs_and_debugging" | relative_url }}) 32 | 33 | # Unit 3 34 | 35 | * [Linear Search]({{"/units/unit3/linear_search" | relative_url }}) 36 | * [Bubble Sort]({{"/units/unit3/bubble_sort" | relative_url }}) 37 | * [Selection Sort]({{"/units/unit3/selection_sort" | relative_url }}) 38 | * [Insertion Sort]({{"/units/unit3/insertion_sort" | relative_url }}) 39 | * [Binary Search]({{"/units/unit3/binary_search" | relative_url }}) 40 | * [Computational Complexity]({{"/units/unit3/computational_complexity" | relative_url }}) 41 | * [Unsolvable Problems]({{"/units/unit3/unsolvable_problems" | relative_url }}) 42 | * [Models and Simulations]({{"/units/unit3/models_and_simulations" | relative_url }}) 43 | 44 | # Unit 4 45 | 46 | * [Principles of Good Design]({{"/units/unit4/principles_of_good_design" | relative_url }}) 47 | * [ncurses]({{"/units/unit4/ncurses" | relative_url }}) 48 | * [Structures and Encapsulation]({{"/units/unit4/structures_and_encapsulation" | relative_url }}) 49 | * [Recursion]({{"/units/unit4/recursion" | relative_url }}) 50 | * [Merge Sort]({{"/units/unit4/merge_sort" | relative_url }}) 51 | * [Hexadecimal]({{"/units/unit4/hexadecimal" | relative_url }}) 52 | * [File I/O]({{"/units/unit4/file_io" | relative_url }}) 53 | * [Images]({{"/units/unit4/images" | relative_url }}) 54 | 55 | 102 | -------------------------------------------------------------------------------- /syllabus.md: -------------------------------------------------------------------------------- 1 | # Syllabus 2 | 3 | ###### [Download the full syllabus as a PDF with mappings to the AP CSP Framework's Learning Objectives](https://www.dropbox.com/s/dl/3osf5dq3et1b13i/Syllabus%202019-20.pdf?dl=0) 4 | 5 | ## Description 6 | 7 | CS50 is Harvard University’s introduction to the intellectual enterprises of computer science and the art of programming for students with a diversity of technological background and experience. CS50 for AP Computer Science Principles is an adaptation of CS50 specifically tailored to align with the AP Computer Science Principles curriculum framework. The course’s assignments, materials, and resources are all identical to the version of the course taught at the college-level, albeit adapted to suit a secondary school audience. 8 | 9 | Among this course’s objectives is to supply students with a comprehensive introduction to the fundamentals of the discipline of computer science. We will do so using programming in several different languages as a vehicle to introduce these fundamentals, including such topics as algorithms, abstraction, data, global impact, and internet technologies. Though the course is programming-heavy, it should be stressed that this is not a “programming course”; rather, this course should be considered one of problem-solving, creativity, and exploration. By year’s end, students will have a richer understanding of the key principles of the discipline of computer science. Students will be able to speak intelligently about how computers work and how they enable us to become better problem-solvers, and will hopefully be able to communicate that knowledge to others. 10 | 11 | Whether students elect to take no other computer science courses in their lifetime or consider this class the first step in a longer course of study, it is our sincere hope that they feel more comfortable with—and indeed sometimes skeptical of—the technologies that surround us each day. 12 | 13 | ## Expectations 14 | 15 | Students are expected to submit all problems! If students would like to receive AP credit they will need to take the [AP CSP Exam](https://apcentral.collegeboard.org/courses/ap-computer-science-principles/exam) and complete the [Create and Explore Tasks](https://apcentral.collegeboard.org/pdf/ap-csp-student-task-directions.pdf). 16 | 17 | ## Prerequisites 18 | 19 | The only background required for CS50 for AP Computer Science Principles is completion of Algebra I or its equivalent. 20 | 21 | ## Books 22 | 23 | No books are required for this course. However, students may want to supplement their preparation for or review of some lectures with self-assigned readings relevant to those lectures' content from either of the books below. The first is intended for those inexperienced in (or less comfortable with the idea of) programming. The second is intended for those experienced in (or more comfortable with the idea of) programming. 24 | 25 | ### For Those Less Comfortable 26 | 27 | * _C Programming Absolute Beginner's Guide_, Third Edition 28 | Greg Perry, Dean Miller 29 | Pearson Education, 2014 30 | ISBN 0-789-75198-4 31 | 32 | ### For Those More Comfortable 33 | 34 | * _Programming in C_, Fourth Edition 35 | Stephen G. Kochan 36 | Pearson Education, 2015 37 | ISBN 0-321-77641-0 38 |
39 | 40 | The book below is recommended for those interested in understanding how their own computers work for personal edification. 41 | 42 | * _How Computers Work_, Ninth Edition 43 | Ron White 44 | Que Publishing, 2008 45 | ISBN 0-7897-3613-6 46 |
47 | 48 | This last book below is recommended for aspiring hackers, those interested in programming techniques and low-level optimization of code for applications beyond the scope of this course. 49 | 50 | * _Hacker's Delight_, Second Edition 51 | Henry S. Warren Jr. 52 | Pearson Education, 2013 53 | ISBN 0-321-84268-5 54 | 55 | ## Overview 56 | 57 | Consistent with the AP Computer Science Principles curriculum framework, the course’s material is organized around seven so-called “big ideas” as well as six computational thinking practices. The seven big ideas are: 58 | 1. Creativity 59 | 2. Abstraction 60 | 3. Data and Information 61 | 4. Algorithms 62 | 5. Programming 63 | 6. The Internet 64 | 7. Global Impact 65 |
66 | 67 | And the six computational thinking practices are: 68 | 69 | * P1. Connecting Computing 70 | * P2. Creating Computational Artifacts 71 | * P3. Abstracting 72 | * P4. Analyzing Problems and Artifacts 73 | * P5. Communicating (both orally and in writing) 74 | * P6. Collaborating 75 | 76 | ## Curriculum 77 | 78 | The core curriculum is identical to that of the college. The AP modules include topics that are not covered in CS50 here on campus, but are essential to the AP Computer Science Principles Course. The AP modules are less programming centric and can be used wherever you see fit. 79 | 80 | ## CS50 Core Curriculum 81 | 82 | ### Chapter 0 83 | 84 | Binary. ASCII. Algorithms. Pseudocode. Scratch. 85 | 86 | ### Chapter 1 87 | 88 | Syntax. Variables. Data Types. Operators. Boolean Expressions and Conditionals. Loops. 89 | 90 | ### Chapter 2 91 | 92 | Compiling. Debugging. Arrays and Strings. Command-Line Interaction. Exit Codes. Searching. Computational Complexity. Computational Models. 93 | 94 | ### Chapter 3 95 | 96 | Functions. Tools for Debugging. More on Strings. Memory. Pointers. Structs. 97 | 98 | ### Chapter 4 99 | 100 | Valgrind. More on Structs. Linked Lists. Hash Tables. Trees. Tries. 101 | 102 | ### Chapter 5 103 | 104 | Internet Basics. HTTP. HTML. Forms. CSS. JavaScript. 105 | 106 | ### Chapter 6 107 | 108 | Python. Conditionals. Booleans. Loops. Data Types. Functions. 109 | 110 | ### Chapter 7 111 | 112 | Flask. MVC. Autocomplete. Events. Ajax. JSON. 113 | 114 | ### Chapter 8 115 | 116 | Cookies. Sessions. Databases. SQL. Race Conditions. 117 | 118 | ## AP Modules 119 | 120 | ### Understanding Technology 121 | 122 | Hardware. The Internet. Multimedia. Security. 123 | 124 | ### Data Science 125 | 126 | Collecting Data. Analyzing Data. 127 | 128 | ### Impact of Computing 129 | 130 | The Development Process. Scaling. Models. Simulations. The Digital Divide. Ethics and Legalities of Computing. 131 | 132 | ## Recommended Order 133 | 134 | We present below a recommended ordering of the curriculum and a suggested timetable. These recommendations are based on a 36-week long school year, where students are available for 180 classroom minutes. However, student experience can vary widely; these recommendations are designed to capture an "average" class. 135 | 136 | 1. Understanding Technology (3 weeks) 137 | 2. Chapter 0 (2 weeks) 138 | 3. Performance Task 1: Explore (2 weeks) 139 | 4. Chapter 1 (4 weeks) 140 | 5. Chapter 2 (3 weeks) 141 | 6. Chapter 3 (4 weeks) 142 | 7. Chapter 4 (2 weeks) 143 | 8. Data Science (1 week) 144 | 9. Chapter 5 (3 weeks) 145 | 10. Chapter 6 (3 weeks) 146 | 11. Chapter 7 (3 weeks) 147 | 12. Chapter 8 (2 weeks) 148 | 13. Performance Task 2: Create (3 weeks) 149 | 12. Impact of Computing (1 week) 150 | 151 | ## Academic Honesty 152 | 153 | This course's philosophy on academic honesty is best stated as "be reasonable." The course recognizes that interactions with classmates and others can facilitate mastery of the course's material. However, there remains a line between enlisting the help of another and submitting the work of another. This policy characterizes both sides of that line. 154 | 155 | The essence of all work that students submit to this course must be their own. Collaboration on problems is not permitted except to the extent that students may ask classmates and others for help so long as that help does not reduce to another doing thier work for them. Generally speaking, when asking for help, students may show their code to others, but they may not view their peers', so long as they respect this policy's other constraints. Collaboration on the AP Computer Science Principle's through-course assessments, namely the create and explore task, is permitted to the extent prescribed by their description provided by the College Board. 156 | 157 | Below are rules of thumb that (inexhaustively) characterize acts that the course considers reasonable and not reasonable. Acts considered not reasonable by the course are handled harshly. 158 | 159 | ### Reasonable 160 | 161 | * Communicating with classmates about problems in English (or some other spoken language). 162 | * Discussing the course's material with others in order to understand it better. 163 | * Helping a classmate identify a bug in his or her code in class, elsewhere, or even online, as by viewing, compiling, or running his or her code, even on your own computer. 164 | * Incorporating snippets of code that you find online or elsewhere into your own code, provided that those snippets are not themselves solutions to assigned problems and that you cite the snippets' origins. 165 | * Reviewing past semesters' quizzes and solutions thereto. 166 | * Sending or showing code that you've written to someone, possibly a classmate, so that he or she might help you identify and fix a bug. 167 | * Sharing snippets of your own code online so that others might help you identify and fix a bug. 168 | * Turning to the web or elsewhere for instruction beyond the course's own, for references, and for solutions to technical difficulties, but not for outright solutions to problems or your own through-course assessments. 169 | * White-boarding solutions to problems with others using diagrams or pseudocode but not actual code. 170 | * Working with (and even paying) a tutor to help you with the course, provided the tutor does not do your work for you. 171 | 172 | ### Not Reasonable 173 | 174 | * Accessing a solution in CS50 Vault to some problem prior to (re-)submitting your own. 175 | * Asking a classmate to see his or her solution to a problem before (re-)submitting your own. 176 | * Decompiling, deobfuscating, or disassembling the staff's solutions to problems. 177 | * Failing to cite (as with comments) the origins of code or techniques that you discover outside of the course's own lessons and integrate into your own work, even while respecting this policy's other constraints. 178 | * Giving or showing to a classmate a solution to a problem when it is he or she, and not you, who is struggling to solve it. 179 | * Looking at another individual's work during a test or quiz. 180 | * Paying or offering to pay an individual for work that you may submit as (part of) your own. 181 | * Providing or making available solutions to problems to individuals who might take this course in the future. 182 | * Searching for, soliciting, or viewing a test or quiz's questions or answers prior to taking a test or quiz. 183 | * Searching for or soliciting outright solutions to problems online or elsewhere. 184 | * Splitting a problem's workload with another individual and combining your work, when prohibited. 185 | * Submitting (after possibly modifying) the work of another individual beyond allowed snippets. 186 | * Submitting the same or similar work to this course that you have submitted or will submit to another. 187 | * Submitting work to this course that you intend to use outside of the course (e.g., for a job) without prior approval. 188 | * Using resources during a test or quiz beyond those explicitly allowed in the test or quiz's instructions. 189 | * Viewing another's solution to a problem and basing your own solution on it. 190 | -------------------------------------------------------------------------------- /tools.md: -------------------------------------------------------------------------------- 1 | # CS50 Tools 2 | 3 | 4 | 5 | --- 6 | 7 | ## CS50 Sandbox 8 | 9 | Temporary programming environments for students and teachers 10 | 11 | 12 | ## CS50 IDE 13 | 14 | CS50 IDE is a cloud-based Integrated Development Environment powered by AWS Cloud9 that features a cloud-based Ubuntu environment. Since it’s cloud-based, you can continue working on your problem sets even if you use a different computer! 15 | 16 | You can also share your workspace with others. Visit [https://cs50.readthedocs.io/ide/online/#sharing-your-workspace](https://cs50.readthedocs.io/ide/online/#sharing-your-workspace) for more information. 17 | 18 | ## Command-Line Tools 19 | 20 | #### `help50` 21 | 22 | Prints less arcane compiler and Valgrind messages 23 | Usage: `help50 ./program command line args` or 24 | `help50 valgrind ./program command line args` 25 | 26 | #### `debug50` 27 | 28 | Runs a program step by step, line by line, to see what is happening 29 | Usage: `debug50 ./program command line args` 30 | 31 | #### `style50` 32 | 33 | Checks for alignment to the [CS50 style guide](https://cs50.readthedocs.io/style/c/) 34 | Usage: `style50 program.c` 35 | 36 | #### `check50` 37 | 38 | Checks for correctness using test cases 39 | Usage: `check50 cs50/problems/2018/ap/problem_name` 40 | 41 | ## Documentation 42 | 43 | 44 | --------------------------------------------------------------------------------