CS 200 - Fall 2024. 11/4/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

If a bat and a ball together cost $1.10, and the bat costs a dollar more than the ball, how much does the ball cost ?

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

The formation and revision of intuitions, Meyer and Frederick. Cognition, Volume 240, November 2023. Shane Frederick is a Professor of Marketing at the Yale School of Management.

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 18: Computer Architecture, PVM, Exceptions.

Announcements

  • Talk today at 3:45 p.m.
    “The Internet We Could Have Had“
    Professor Chris Kelty, UCLA
    November 4, 3:45 - 5:15 PM, Humanities Quadrangle, room 276

    Abstract: What was the internet we could have had and how is it related to the one we do? This talk will offer part of a book project on the moral and technical imagination of the internet as a global brain, a new economy, and a participatory democracy, and how it enabled instead an ad-revenue-driven social media hellscape of privacy violation, data extraction, and autocratic monopolies. In particular it will focus on the internet as an era of artificial intelligence, and offer a revision of the place of the internet as part of the technical infrastructure of knowledge and power. What are the implications--for science and politics--of automated data circulation, ennobled by an ethics of sharing, and mystified by the most expensive statistical clustering experiments in history?

    Bio: Christopher M. Kelty is a professor at the University of California, Los Angeles. He has a joint appointment in the Institute for Society and Genetics, the department of Information Studies and the Department of Anthropology. His research focuses on the cultural significance of information technology, especially in science and engineering. He is the author most recently of Two Bits: The Cultural Significance of Free Software (Duke University Press, 2008), as well as numerous articles on open source and free software, including its impact on education, nanotechnology, the life sciences, and issues of peer review and research process in the sciences and in the humanities.

  • 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.

  • ULA office hours are found at in Ed Discussions.

  • Homework assignments: [Assignments]. hw5 is available. Discuss installing Python 3.10

    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.

    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]