cs151

Welcome!

Calvin (Deutschbein)

W1D1: 26 Aug


Announcements

  • Welcome to CS-151: Intro to Programming with Python!
  • By FRIDAY 11:59 PM: Fill out this survey
    • There are weekly, 1 hour meetings with peer tutors on Wednesday or Thursday.
    • Attending these is 10% of your grade.
    • Read the instructions carefully and fill out as many times as you can!
  • By MONDAY 11:59 PM: "Introductions" assignment.
    • A minimal problem set to familiarize yourself with how to submit coding assignments.
    • Links will be posted on the course website and on the Discord.
      • They will not be posted on Canvas or via email to help encourage you to use the website and Discord

In general

    • Visit the webpage @ cd-public.github.io/courses/cs1f24
      • Linked from Canvas
      • 2nd Google result for "calvin deutschbein courses"
      • 4th Google result for "calvin willamette courses" (easier to spell)
    • The syllabus and calendar are there for you - check exam days, mostly.
    • Join the Discord server - you got an email invite from me ("ckdeutschbein@")
    • Bring a computer if at all possible, or let me know to find you one.
      • Set up your computer for the term.
      • Website -> Resources -> Setup. Video guides.

About Me

Name
Calvin (Deutschbein)
Call me
(Professor) Calvin
Pronouns
they/them
Office
Ford 3rd Floor
Office Hours
Discord me between 12:00 AM and 11:59 PM
Catch me after CS151 (11:20-12:00) or my CC (1:00)
Email:
ckdeutschbein@willamette.edu
~24 hour maximum response time, I do Discord before email
Website:
cd-public.github.io

Background

Thesis Title
Mining Secure Behavior of Hardware Designs
Plain English
Just as there are bugs in code that makes software, modern hardware is also written in code and therefore may contain bugs. I find these bugs.
Thesis
Specification mining can discover properties that can be used to verify the secure behavior of closed source CISC CPU designs, properties that can be used to verify the temporal correctness of CPU designs, and hyperproperties that can be used to verify that modules, SoCs, and CPUs have secure information flow.
Some partners
Intel Corporation, Semiconductor Research Corporation, Synopsys, MITRE, Cycuity

Course Structure

  • Class on MWF
  • Section on either W or Th.
    • 10% of final grade for section attendance.
  • Code assignment every Monday 11:59 PM
    • 5 problem sets - series of small puzzle-like programs
    • Latter, 5 projects - one holisitic program
    • 50% of final grade total (20 for problem sets, 30 for projects)
  • Two Midterms (open book/note)
    • Friday of Week 6 - October 4
    • Friday of Week 11 - November 8
    • 10% of final grade each
  • Final exam (open book/note)
    • 8 AM to 11 AM on either 11 Dec or 12 Dec
    • 20% of final grade

My goal is to help 100% of students achieve an A in this course.

Sections

  • Everyone will be placed into small sections of 8-10 students, with one section leader
  • All section leaders are students who recently took and excelled in this course
  • Will meet as a group with your section leader once a week for an hour to go over and work on problems
    • These meetings will be on Wednesdays or Thursdays
    • Poll out today, finalize by Friday.
  • Section leaders will also serve as a secondary source you can ask for help or guidance from throughout the week
    • This tutoring is part of their job! Don’t hesitateto ask them for some extra assistance!
  • Planning to start section meetings next week
  • Small sections are mandatory. They help you, and your attendance helps your peers. As a result, we have a policy for attendance. Every unexcused absence after the third will result in a 5% deduction, per absence, to your final grade. If you cannot attend your section, reach out and we will place you in a section at another time.

Academic Honesty

  • You must write your code yourself.
    • You may "use" AIs like ChatGPT, Gemini, to "write" your code. They are okay at it, but not great.
      • You must cite what you used with the prompt, both for honesty and so I can provide feedback.
    • You may collaborate with your peers but may not copy their work.
      • Peer collaboration requires enthusiastic consent by all parties.
      • You must say who you worked with, again to help me understand how to provide feedback.
    • You may use online communities, most like Stack Overflow and GeeksforGeeks
      • In fact, you should. They are better than the AIs, and learning to use them is more rewarding.
      • Do not copy solutions from these sites, use them to learn how to solve a problem then write yourself.
      • Please cite - I want you to learn to use these and will often have suggestions.
    • Dishonesty is when you take work (code) someone else did and claim you did yourself.

Citation

  • Professor Jed Rembold did most of the work to make these slides.
  • If you see him around ask him:
    What is the square root of E over m?
  • (He was recently in the Washington Post for proving some of Einstein's work - fun!)

Speaking of Code

  • Python: It's the real deal.
    • Python is my favorite to express ideas by typing
    • It has notable advantage over unformated text or prose.
    • Like speaking, writing, or typing it has a learning curve.
    • Like speaking, writing, or typing, once I learned it I used it alot.
  • We start this class with a subset of Python called "Karel".
    • This reminds me typing of while I had to look at the keyboard.

Karel 1

Calvin (Deutschbein)

W1D1: 26 Aug

Karel

  • Imagine a robot on flat surface, like my robot vacuum.
    • The robot 'eats' socks and then needs rescued.
  • We assume the world is a grid.
  • Karel has a few actions:
    • Can move forward one space
    • Can turn left 90 degrees (just like NASCAR 🏎️)
    • Can pick up a 'beeper'
    • Can drop off a 'beeper'
  • We will be spending the first several class days getting Karel to solve a wide variety of problems
    • This content is not in your book, but more in-depth descriptions can be found here

The World

  • Karel’s world is defined on a grid
  • Compass directions are maplike
    • Up is North, Down is South
    • Right is East, Left is West
    • Oregon would be in the upper left #PNW
  • Walls are impassable
  • 'Beepers' are diamonds
    • Do not ask me why they are called beepers.
    • I will make something up.
    • We just had to call them something, okay?
  • Karel is an irregular pentagon.
    • I have no idea what to call that shape.
    • <checks notes> it says here "house-shaped"

Commands

  • Karel can perform 4 actions: Two to move, and two to beep.
    Command Action
    move() Moves Karel forward one intersection in whatever direction they are facing
    turn_left() Rotates Karel 90 deg counter-clockwise
    pick_beeper() Picks up a beeper on the ground
    put_beeper() Places a beeper on the ground
  • By performing a bunch of actions, one after another, Karel can get up to all manner of hijinks.

Example

  • Karel’s world is defined on a grid
  • Suppose Karel is in Oregon (the upper left)
  • Karel yearns for gatorque down in Florida.
  • The US interstate highway runs on a grid.
    • There's also some missing connections e.g.:
    • Boise, Idaho, to Las Vegas, Nevada, or
    • Salem, Maine, to Richmond, Virginia.
  • We imagine a (very simplified) map as like so.
  • Take a moment to write out how to move, and left-turn, to get to the delicious gatorque.
  • pick-beeper could be named pick-gatorque in this instance.

Example

  • Start here...
  • Specify 2 actions...move() turn_left()
  • Each action gets its own line.
  • Karel is now here...
  • Karel! That way is poutine not gatorque!

Announcements

  • Welcome to CS-151: Intro to Programming with Python!
  • By FRIDAY 11:59 PM: Fill out this survey
    • There are weekly, 1 hour meetings with peer tutors on Wednesday or Thursday.
    • Attending these is 10% of your grade.
    • Read the instructions carefully and fill out as many times as you can!
  • By MONDAY 11:59 PM: "Introductions" assignment.
    • A minimal problem set to familiarize yourself with how to submit coding assignments.
    • Links will be posted on the course website and on the Discord.
      • They will not be posted on Canvas or via email to help encourage you to use the website and Discord