12-week Session Tuesdays, February 5 - April 30, 6:30-7:30pm (no class April 2)
Students will gain or expand their coding knowledge through a variety of programming languages and projects based on experience level, building from visual-based languages to Python. They will apply practical computer science skills such as source code control, software design, reverse engineering, bug resolution, and coding environments.
The Padawan section requires previous Code Em experience including these concepts:
This class will require 2+ hours of time outside the class. Several sessions will be flipped -- students will be given an assignment to review online (lecture) materials before the next class so that we can spend the time in class actually applying the concepts correctly.
Students should bring their own laptops if possible. Students should have access to a Cloud9 capable browser outside of class.
Tubes to Gates, Ada to Python, what do you remember?
Whiteboard truth tables.
Setup with access to this blog, slack, GitHub and Cloud9 environment created.
Writing code that other humans can understand is pretty much the point of programming languages.
Flipping next class, so review this before the next class. This presentation does not include the notes -- see if you remember the terms and look them up if necessary. Fire up the Python interpreter if needed to remember lists, tuples, classes and functions (methods).
We started off reviewing this blog and its purpose during this session -- the intent being that we use class time to "code" while we are together to help get students "unstuck". We quickly went through the review -- great recollection of Python programming basics and navigating within the Cloud9 environment. We got new AWS IAM accounts setup and Cloud9 environments. We'll need to work through some assignments that reinforce earlier binary number system and boolean algebra learnings! We were a little rusty there, but eventually remembered the primary gates and that they can be used to perform mathematical operations. We used paper instead of the whiteboard.
It is like English class, but your prose is code.
Musical Pair Programming. Starting with a base sketch of a program on paper, students will swap the paper to finish the challenge. Part of the challenge will be to label the code with the terms reviewed in the assignment deck.
We'll work on the challenge to only use boolean operators to perform mathematical operations. This challenge will include methods for
full_adder. And we'll also use this to introduce some unit testing concepts. In fact, since we started working some on the challenge to add numbers without use
+, we are going to stop all that coding to write our tests first!
The sum of A + B = (not A and B) or (A and not B)
Data Structures with a focus on Classes -- the GitHub assignent link is in the class slack channel.
Musical Code worksheet and tests for full/half adder. GitHub Classroom data assignment.
We actually jumped around a lot to make sure everyone: 1) is following this blog, 2) has access to slack, 3) can get back on their Cloud9, 4) can run Python code on Cloud9 and 5) can run a Jupyter Notebook server on Cloud9. And we got all this done while also reviewing terms and discussing the binary adder challenge and prepping for this week's assignment which will be posted here soon! We discussed test driven development and I proposed starting with this test for the final binary adder function:
import unittest from binary_adder import * class TestAdder(unittest.TestCase): def test_adder(self): ''' Test a binary_adder function. Add two binary digits (input as strings). The solution must not use the '+' operator. ''' self.assertEqual(binary_adder('1','1'),'10') self.assertEqual(binary_adder('101','1010'),'1111') self.assertEqual(binary_adder('1101','11100101010'),str(bin(0b1101 + 0b11100101010)[2:])) if __name__ == '__main__': unittest.main()
As part of the challenge you should add tests for your
half_adder(a,b) and your
full_adder(carry_in, a, b). Next time we'll discuss the difference between black box testing and clear box testing -- what type of test the above is and why this challenge also needs a clear box text.
What is it good for? Absolutely everything!
Back to the books: dictionaries and indexes. Python dictionaries and keys are rooted in real-world books. We'll take some time to revisit physical books to reinforce programming language data structure terms.
We'll continue work on the Elementary Data 1 assignment in class. If the students get through the basic assignment, they can create unit tests to verify their solutions!
Is a 3D dictionary an actual Webster's Dictionary or a Python dictionary of dictionaries of dictionaries?
Elementary Data 2 will be the assignment -- link will be in our slack channel when ready.
Elementary Data 1 assignment.
We made sure again that everyone has access to slack and cloud9. We accepted the assignment and walked through that Jupyter notebook to review the 3 questions for the assignment. Hope ya'll are working on it!! We also re-reviewed the half-adder assignment and reviewed the logic gate circuit for a half adder and full adder -- where the full adder takes two bits and a carry bit to add and produces a sum and carry for the next stage full adder. Please review the code in last week's Actual. Use it to test your full adder assignment. So, there are two assignments in progress right now!
Lists, tuples and bears, oh my!
Divide and conquer or seeing the forest in the trees.
We'll go through the Elementary Data 1 assignment to check on progress. I expect we'll need to revisit getting input from a user to populate our Contacts dictionaries. We'll also review a quick way to persist the data to avoid going through a new Contact list setup everytime. The classtime will be used to make sure we can get through the other 2 parts of the assignment and prep for the next Elementary Data Assignment.
Big Oh of Log N.
Elementary Data 2 will be posted by the end of next week.
We walked through the Elementary Data Assignment again. We talked about searching and improving search using a balanced tree -- and discussed the math behind the improvement. We spent more time again making sure we are comfortable with Jupyter and Cloud9, saving our environment keys in the Slack channel, etc.
Time to get the class to tell me what they have learned.
We'll review again if anyone has done more work on the assignment. We will finish the Data1 and shelve some pickles so that it is even easier to work on at home.
Classes are attributes AND operations!
Elementary Data 2 will be posted by the end of the week.
We reviewed solutions to the Data assignment for key collisions and searching on first or last name. A different solution was discussed -- what is better? We then added some persistence to our solution and discussed the upcoming assignment.
Dictionaries of indices!
Relate what we are doing to the card search again. Discuss real-world database issues.
In class, write the code for a dictionary of indices.
Don't fear the pointer.
Elementary Data 2 will be posted during the class.
We reviewed the data workbooks and code. We worked through creating a dictionary of indices to the list of contacts.
Intro to SQL
Use MySQL in the Cloud9 environment to learn some basic SQL.
A new meaning for JOIN.
Try to create your own database and tables.
Since MySQL is already on the Cloud9 enivronment, we used it to create a database and a couple of tables to hold contact information. We then INSERTed data and SELECTed data using JOINs with our foreign keys.
Continue the exploration of SQL.
We'll draw some diagrams to represent the structure of our database -- ER diagram and Class diagram.
More hands-on with MySQL.
Entities belong to other entities.
Think of something other than contacts for which you would like to create a database.
More SQL! This time we talked more about foreign keys and the direction of relation as well as the cardinality of relations. And we did more hands-on to re-enforce this learning.
Well, it seems different at this poing.
Discuss serverless and what this means. Have an active discussion about the pros.
Get an intro to a Python serverless framework.
It is okay to let frameworks do a lot of heavy lifting for you.
In class Assignment on Flask/Zappa