Overview
This week we will introduce a new topic which has been included as supplementary compontent of chapter 6, bitwise operators and numeral systems. We'll do this by pairing up and working on our first large project.
Friday, October 23rd
Classwork / Homework / Evaluation
I'm out today, but Chris will be here. You will spend both class time and homework time on your Base64 converter project. Your commits for this week's evaluation are due by 11:59 pm on Sunday, October 25th.
By the way, inspired by the discussion in class about using Python's built-in Base64 tools, I did a little digging and easily found the sourcecode. base64.py contains Python source that does the file handling, but it utilizes binascii.c" to do the bit twiddling. You may recall I predicted this would be the case. Anyway, since the rules of this game are that you have to be able to explain any code you use in solving the encode / decode problem, you could study these source files until you understand them (if you can do that, Chris and I can ask you to start teaching the class ;-), but you will probably find it to be much easier to use Python's bitwise operators to implement it yourself. Either way, we will achieve our learning objectives.
Wednesday, October 21st
Classwork / Homework / Evaluation
The project pairs and shared repos are:
- AJ and Ehan
- Aidan and Aidan
- Myer and Dugan
- Sebastian and Kyle
- Patrick and Jonah
- Ethan and Jacques
- Sami and Cole
- Rubbah and Evie
- Grace and James
- Senai and Nicole
Today in class you need to send me a link to shared repo you'll be using for this project, and confirm before you leave that your pair in the above list is linked to it.
Monday, October 19th
Classwork
Shout out to Ehan for being responsible and emailing us with a thoughtful question. I'll start class today by developing a solution to the Letter Counts exercise. Ehan also asked about exercises 6, 7 and 8, but I think it best we look at these one per day at the start of class. They require sustained attention to get much out of seeing a solution, and attention tends to wane if we try to do too much in one sitting.
I have radically updated our planning calendar to allow for a lot more time for programming projects. Today we will choose pairs for our first large programming project.
Project: Base64 Encoder
You and your partner have just been hired write a Base64 encoder / decoder. Your customer has told you that they want to be able to give your encoder any binary file as input and get back a text file containing only Base64 characters as output.
When they feed this same output text file into your decoder, they want to get back an exact copy of their original binary file.
Assuming you have
and your base64encode program in the same
directory, a sample run of the program might look like this:
$ ./base64encode GHClogoSmall.png
producing GHClogoSmall_b64_png.txt as output. Running:
$ ./base64decode GHClogoSmall_b64_png.txt
would generate the original GHClogoSmall.png exactly as it was
originally.