CS 200 - Fall 2023. 11/01/2023.


[Home]

Welcome to CS 200!

Video of the Day

The Lava Lamps that help keep the Internet Secure submitted by Dylan Council.

I hope you are doing well! I was scrolling on instagram and saw a really cool video about randomness and cryptography.

To my understanding, because the processes of generating randomness through computers are not truly random, Cloudflare uses a wall of lava lamps to generate randomness. They have a camera that takes pictures of the lava lamps, which are never in the same position as before. Then, they generate a string based on the picture (I'm not entirely sure how this works) to encrypt around 10% of the world's web traffic.

This video is slightly outdated, but I thought it was worth sharing!

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

Two boys on bicycles 20 miles apart, began racing directly toward each other. The instant they started, a fly on the handle of one bicycle started flying straight toward the other cyclist. As soon as it reached the other handle bar it turned and started back. The fly went back and forth this way, from handle bar to handle bar, until the two bicycles met. If each bicycle had a constant speed of 10 miles per hour, and the fly flew at a constant speed of 15 miles per hour, how far did the fly fly?

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

Lecture 17: Computer Architecture.

Administrivia

  • I have Office hours via zoom, meeting ID 459 434 2854. Wednesday 4-6pm.

  • ULA office hours posted on csofficehours.org. See the posting on Ed Discussions for more information.

  • Homework assignments: [Assignments]. hw5 is available. You will submit with gradescope.

    Midterm Exam II: Thursday November 9th, 7pm

  • Midterm exam Thursday November 9th, 7pm, WLH 207. As with the first midterm, the accessibility exam room will be WLH 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.

    Computer Architecture

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

    The current version of Python, 3.11, generates some new byte codes that were not part of previous versions. I have added definitions for these op codes to hw5.py. See dis.html which includes bytecodes new in 3.11.

  • bytecode.py
  • pvm.py
  • Bytecode API
          classBinaryOp
    Enum for the argument of the BINARY_OP instruction (3.11+).
    
    Arithmetic operations
    
    BinaryOp.ADD (0): x + y BinaryOp.SUBTRACT (10): x - y
    BinaryOp.MULTIPLY (5): x * y BinaryOp.TRUE_DIVIDE (11): x / y
    BinaryOp.FLOOR_DIVIDE (2): x // y BinaryOp.REMAINDER (6): x % y
    BinaryOp.MATRIX_MULTIPLY (4): x @ y BinaryOp.POWER (8): x ** y
    
    Logical and binary operations
    
    BinaryOp.LSHIFT (3): x << y BinaryOp.RSHIFT (9): x >> y BinaryOp.AND
    (1): x & y BinaryOp.OR (7): x | y BinaryOp.XOR (12): x ^ y
    
    Inplace operations:
    
    BinaryOp.INPLACE_ADD (13): x += y BinaryOp.INPLACE_SUBTRACT (23): x -=
    y BinaryOp.INPLACE_MULTIPLY (18): x *= y BinaryOp.INPLACE_TRUE_DIVIDE
    (24): x /= y BinaryOp.INPLACE_FLOOR_DIVIDE (15): x //= y
    BinaryOp.INPLACE_REMAINDER (19): x %= y
    BinaryOp.INPLACE_MATRIX_MULTIPLY (17): x @= y BinaryOp.INPLACE_POWER
    (21): x **= y BinaryOp.INPLACE_LSHIFT (16): x <<= y
    BinaryOp.INPLACE_RSHIFT (22): x >>= y BinaryOp.INPLACE_AND (14): x &=
    y BinaryOp.INPLACE_OR (20): x |= y BinaryOp.INPLACE_XOR (25): x ^= y
    	  
    See updated BINARY_OP and SYMBOLS in hw5.py.

  • Iterators.html

    Getting to know UNIX

    UNIX Introduction Principle 3.
    [Home]