Code Em


Tech Em Studios

Class Material and Information



Deck | blog.techemstudios.com/decks/code-em.html

Lesson Plan | blog.techemstudios.com/classes/code-em.html

Github Resources | http://github.com/techemstudios/...


Instructor Email | chris@techemstudios.com

What You Need

  • Email address
  • Slack account
  • Github account


You don't need to bring your own computer unless you would like too.

For class we will provide iPads and Chromebooks for you to use!

$whoami

🕵️‍ - My name is Chris or Mr. Chris, or alias  Mr. Longhair

🌇 - I live in the city with my two cats, one fish, and little brother

📝 - I've been working at Tech Em for 3 years! I spend my week teaching classes at the studio and at different schools around Richmond. We also have some projects that we like to collaborate and work on remotely!

🌎 - I love learning about the Internet, computer security and other people, places around the world!

$whoareyou

  • name
  • grade
  • ever programmed?

Any questions?

Day 1

What is a computer?

What is computing?

Does a computer require electricity?

Tally Sticks

Can you take a guess at what people might of used these for?

We can call these a form of mechanical aid that helped people count before they actually had what we know today as computers!

Abacus

2700 BC - Present

The Chinese Bead Abacus

Pascal's Calculator

1642 - 1800s

The first Digital Mechanical Calculator

Invented by Thomas de Colmar in 1820

Meet the Vacuum Tube

Definition:

A vacuum tube, also called a valve in British English, is a device that controls electric current flow in a high vacuum between electrodes to which an electric potential difference has been applied.

  • The cathode is heated, as in a light bulb, so it will emit electrons, this is called thermionic emission
  • The anode is the part that accepts the emitted electrons
  • Vacuum tubes must be hot to work

Cool Fact

Although the vacuum tube was invented by John Ambrose Fleming, it was Thomas Edison who discovered the Edison effect

The “Edison effect” states that electricity does not necessarily need a solid material to move through; it can move through gas or vacuums as well. Without this realization, vacuum tubes would never have been invented.

Vacuum tubes were used in all sorts of electrical devices after being invented. Naturally making their way to being used in the first electric computers!

1st Generation Computers: Electric Computers

The ENIAC, 1946, Electronic Numerical Integrator And Computer

17,468 vacuum tubes!!!

More pictures

someone in the back yells

"Well, yeah all these big machines are cool and all. But how do we make them do what we want? And what language do they even talk?"

Meet Ada

Ada Lovelace

The first computer programmer!

Computer programming or coding is the act of creating human readable computer instructions

Computers use binary code to represent text, computer instructions, and lots of other types of data. This code is based on the binary number system, which uses only 0 and 1


Humans though, don't use 0 and 1 to represent things. And Ada realized that, so she started to think about ways in which we could develop human readable instructions, that could then be translated into the binary code that computers understand

Today's Activity


Lightbot



Can you identify what the human readable instructions are in Lightbot?

One Thing To Remember:

Lightbot introduces us to the concept of computer programming. By using instructions and arranging them into a logical sequence, we have the ability to program our robots.

Review for Day 1

  • What is computing?
  • What do we mean when we say computer programming?
  • Over the years have computers gotten bigger, or smaller?
  • Before the invention of the transistor, electric computers used something called a _ _ _ _ _ _ _ tube?

Day 2

Remember, before transistors were invented, we used vacuum tubes. We talked about some of the problems with vacuum tubes, two being their size and reliability.


Three physicists were credited with the invention of the transistor in 1947: Walter H. Brattain, John Bardeen, and William Shockley who contributed the most.


Can you spot the cat?

Vacuum Tubes vs. Transistors

  • The transistor became cheaper in the 1960s and was much smaller, worked on lower voltages, and used less power.
  • In addition, unlike vacuum tubes, they were much less likely to be damaged by being dropped and had extremely long life.
  • Eventually, they were also much cheaper than glass vacuum tubes. At this time, most radios, television sets, and amplifiers began using transistors instead.

2nd Generation Computers: Electric Computers

The IBM 1401, first made in 1959

10,000 transistors!

It's all about the transistor now!

Transistors can be used as a switch or amplifier

Using a transistor as a switch, it's purpose becomes to control the flow of electricity through it


Similar to a light switch it only has two states
on and off

How do you change the state of a light switch?


By using your hand to push it into the opposite of whatever state it currently is in

We obviously can't do the same thing with a transistor! There is nothing to touch!

So we use electricity!


Depending on if we send a small or big electric signal to the transistor, the transistor will either be in the on state, or the off state.

Besides using a transistor as a switch, it can also be used as an amplifier

When using a transistor as an amplifier, you can think of the transistor taking a smaller(lower) electric signal and making it into a bigger (higher) electric signal


While with the switch we can think of on and off, with the amplifier we can think lower and higher

The transistor remains an essential building block within circuits, and further all electronics. If it wasn't for the transistor, cell phones and computers would be very different, or maybe not invented at all. Today, billions of microscopic transistors are placed on small computer chips, which then go into your favorite devices!

Cool Fact

A common size in transistor manufacturing is 22nm, or nano meters. A nano meter is one-billionth of a meter!

Cool picture from Office of Science, Department of Energy, USA

Today's Activity


Lightbot



In the second level, they introduce the concept of procedures. This gives us a new instruction called P1, that tells our robot to run the instructions that we have put into the box called Procedure 1

Heads Up! You will be given a P2 at some point as well.

One Thing To Remember:

The vacuum tube became replaced by the transistor. A transistor can act as either a switch or a amplifier. Today, transistors are created at microscopic sizes, allowing you to fit BILLIONS on a small computer chip.

Just think, if you have a cell phone in your pocket, you are carrying around billions of tiny little transistors right in your pocket!

Review for Day 2

  • What is a transistor?
  • How many transistors are they able to fit onto a small computer chip today??
  • In Lightbot, they introduced a new concept called procedures, and with that a instruction called P1, what's it purpose?
  • Before the invention of the transistor, electric computers used something called a _ _ _ _ _ _ _ tube?

Day 7

Python

Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python has a design philosophy that emphasizes code readability, notably using significant whitespace. It provides constructs that enable clear programming on both small and large scales.

The Interpreter

So what can we do with this thing?



- Give it input, and it will give you output

- Try to add two numbers, you don't need to use spaces

                    
                        213432523 + 12929342010
                    
                

Press ENTER!

We can use it as a calculator! So cool, it adds numbers together.

Can it add letters, words?

                    
                        hello + hello
                    
                

Ooops! It has yelled at us! Let's take a closer look

Expressions

                    
                        hello + hello
                        10 + 10
                        12.4 + 15.7
                        good + bye
                        10 * 20
                    
                    

Statements

                        
                            a = 10 + 10
                            b = "my name is Chris"
                            print (a + b)
                        
                        

Variables

Think of it as a box, or place that we can store data.

Even different types of data

                    
                        a = 13
                        b = 27 
                        a + b
                        c = a + b
                        print(c)
                    
                
                    
                        c = hello + hello
                    
                

Data Types!

                    
                        a = 10
                        b = "hello"
                        type(a)
                        type(b)
                    
                

Python has 4 main data types that it uses

- String

- Integer

- Float

- Boolean

What is one thing(four in this case) that you should remember for next week?!?



YOUR DATA TYPES!

Day 8

What is the Python Interpreter?


What if we want to save the code that we have typed in?

We can create a file, but what kind of file?

Introducing the .py file extension!

The Text Editor

- File Manager

- Open File Tabs / Editing Area

- Terminal / Python Output

Let's create a new file!


1. Save the file

2. Add some code

3. Save!

4. Tell the computer to execute the file!

What happened?

Python has 4 main data types that it uses

- String

- Integer

- Float

- Boolean

Variables

                                                    
                                                        a = 13
                                                        b = 27 
                                                        a + b
                                                        c = a + b
                                                        print(c)
                                                    
                                                

Spring Break Review

  • What is a variable?
  • Can you remember the four data types that we have discussed so far?
  • If we have an error, or bug, where will the computer tell us?
  • Can we combine a string with a integer?

Day 9

Coding Activity:

Python Pizza Planner

Review for Day 9

Day 10

Review for Day 10

Day 11

Class Challenges

#1 - Pizza Party Planner

Tech Em Elementary is hoping to have a pizza party for it’s end of school year celebration. Mrs. Sirexa is thinking that some students from the Code Em class can help her with the planning by developing a computer program that will tell her how many pizzas she needs to order!

Data:


  • There are a total of three classrooms
  • Each classroom has fourteen students and two teachers
  • Each student will get two slices of pizza
  • Each teacher will get one slice of pizza
  • Each pizza has eleven slices
  • One pizza costs thirteen dollars, forty nine cents

Questions:


  • How many students are eating pizza?
  • How many total people are eating pizza?
  • How many total slices will be needed?
  • What will the total cost be?

#2 - School Lunch List Picker 4000

The Tech Em cafeteria staff is looking to add some more randomness to it’s weekly lunch schedule. Currently the lunch schedule is chosen by Chef Chris pulling five pieces of paper out of a hat to decide what will be on the schedule that week. But the kids have been complaining that Chef Chris always seems to end up pulling out the same pieces of paper every week! To solve this problem he has enlisted the help of the Code Em class to develop a program that will randomly select from a list of lunch options every week. He also wants to be able to add to this list throughout the school year new options if he needs too.

Data:


Fall Menu Items - Pumpkin Quesadillas, Carrot & Apple Salad, Roasted Chicken, Orange Glazed Turkey, Chicken Noodle Soup, Pasta Carbonara, Pumpkin Alfredo, Beef-and-Pineapple Tacos, Sweet Potato Kale Grilled Cheese, Beef-and-Bacon Meatloaf, Lemon Garlic Shrimp

Winter Menu Items - Cajun Jambalaya, Beef Stroganoff, Chicken and Dumplings, Vegetarian Lasagna, Chicken Pot Pie, Pot Roast & Potatoes, Shepherd's Pie, Sweet Potato Chili, Chicken Tortilla Soup, Mushroom Risotto, Shredded Beef Enchiladas, Tater Tot Casserole, Cheesy Beef Quesadillas, Meatball Subs

Spring Menu Items - Lemon Baked Tilapia, Turkey Burger, Chicken Fajitas, Honey Sesame Chicken, BBQ Chicken Pizza, Tuscan Mac & Cheese, Veggie Chow Mein, Mushroom-Herb Spaghetti, Bison nachos, Chicken Cordon Bleu, Sweet and Sour Pork, Grilled Fish and Chips, Chicken Green Bean, and Bacon Pasta, Fiesta Chicken Salad, Salmon Zucchini Linguine

#3 - Conditional Calculator

Using conditional statements and the four main operators, create a program that allows a user to select two numbers, choose an operator, and then correctly compute the answer. There are a couple ways you can do this, short or long.

  • Addition
  • Subtraction
  • Multiplication
  • Division

#4 - Lonely Loops Survival Game

For our last challenge we are going to be build a text survival game using Loops, Input, and lots of Conditionals! Everyone will start out with the same basic template but it is up to you to decide where to take your adventure!

Starting Code:


https://bit.ly/2Uze0B7

Review for Day 11

Day 12