CS 200 - Fall 2024. 11/6/2024


[Home]

Welcome to CS 200!

Video of the Day

Socratica Python videos:

Bit about Bytes: Understanding Python Bytecode See James BennettWriting more efficient Python code.

I hereby solicit suggestions for the video of the day. Please email me your ideas with explanations. Selected entries will win 5 homework points. If your video is played at the beginning of class, you must also briefly explain something about the video and something about yourself — in person.

Logical problem of the day

The 1975 edition of the American Heritage Dictionary contains a definition of the word "anticlimax" (or "bathos"). What do the editors provide as an example?

https://pollev.com/slade You may also download the app to your phone. Use the "slade" poll id.

Canvas Quiz of the Day (need daily password)

Most days, there will be a simple canvas quiz related to the lecture. You need a password to activate the quiz, which I will provide in class. These quizzes will count toward your class participation grade. The quiz is available only during class.

Click for today's quiz.

Lecture 19: Midterm Review.

Announcements

  • DSAC Event Tuesday November 12, 6pm, Davies Auditorium.
    DSAC would like to invite you to attend this year's DSAC-Faculty joint advising session on Tuesday, 12 November @ 6p in Davies Auditorium. This is an opportunity during the Yale College Advising Period to hear from faculty about the different paths in Computer Science. We'll also advertise new courses, ULA Hiring for Spring 2025, the BS/MS program, and your class + peer advisors.

    This event will be a live, in-person event with a recording posted afterwards. A zoom-in option is not available during the session.

    Please RSVP here if you plan to attend.

  • If you have an upcoming performance or athletic event, I am happy to promote it during class. Just send me a note.

    Administrivia

  • I am available for lunch on Mondays at 1pm (not noon) at Franklin College Dining Hall.

  • I have office hours Wednesdays from 4-6 pm, on zoom, id 459 434 2854. I may be a little late today.

  • ULA office hours are found at in Ed Discussions.

  • Homework assignments: [Assignments]. hw5 is available. Discuss installing Python 3.10 https://www.python.org/downloads/release/python-31011/

    Midterm Exam II: Thursday November 7th, 7pm, ML 211

    The second midterm will similar to the first. You will have 2 hours. Here is a sample midterm exam. (solutions) There will also be a question on data structures.

    There will be a UNIX question, as in the first midterm. Here is a sample UNIX transcript (solutions) UNIX will cover through principle 3.

    Review session: Today at 6pm on zoom. Check Ed Discussions for deets and slides.

    From Rudy:

    You can tell them that I also updated the original message with detailed answers - for those that can't (or don't want to) attend the session.
    Note: Rudy ran out of time and did not cover decorators. I will discuss them today. Rudy's slides

    Python Virtual Machine

    PVM.html jupyter notebook - Python Virtual Machine and hw5. - PVM-lite

    The version of Python on the zoo is 3.10. That is the version used by this assignment and the autograder. There were some major changes to byte codes in version 3.11, and for that matter, in version 3.9. See dis.html and specify version 3.10.

  • bytecode.py
  • pvm.py
  • byterun github code repository
  • byterun - the code.

  • Example with return None. Note: constant folding.
    >>> def f():
    ...   a = 3 + 4
    ... 
    >>> dis.dis(f)
      2           0 LOAD_CONST               1 (7)
                  2 STORE_FAST               0 (a)
                  4 LOAD_CONST               0 (None)
                  6 RETURN_VALUE
    
    >>> def f2():
    ...   a = 3 + 4
    ...   return a
    ... 
    >>> dis.dis(f2)
      2           0 LOAD_CONST               1 (7)
                  2 STORE_FAST               0 (a)
    
      3           4 LOAD_FAST                0 (a)
                  6 RETURN_VALUE
    
  • Recorded lecture 10/26/24 covered Iterators and Decorators:
  • Exceptions.html

    Getting to know UNIX

    UNIX Introduction Principle 4.
    [Home]