CS 2010 - Fall 2025.


[Home]

Welcome to CS 2010! 11/17/2025

Video of the Day

What is random?

Radioactive random numbers

Here is a random number generator using radioactive decay. This is a way to generate a truly random number, contrasted to the pseudo-random numbers that our computers generate using a seed. This device generates the random number by measuring radioactive pulses generated by a thorium lantern mantle and natural background radiation and using the timing between the pulses to generate the random number.

Benford's Law: Anomalous Numbers. Real-life random numbers are rarely uniform.

I hereby solicit suggestions for the video of the day. Please email me your ideas with explanations. Selected entries will win five 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.

Recursive Image of the Day

Logical Problem of the Day

Flipping a coin or rolling a die generates a random number. What is a pseudo-random number?

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

  • ASF Poker Case The program used the built-in pseudo random number generator to shuffle the deck. However, there were issues.

  • Lava Lamp Randomness

    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.

    Poem of the Day

    From Claude Sonnet 4.
    **"Regular Expression (Taylor's Version)"**
    
    *Verse 1:*
    I remember when I first learned to code at seventeen
    Writing patterns in my IDE, living the developer dream
    You were there in my syntax, matching every single line
    Backslashes and brackets, thought you'd always be mine
    
    But debugging at midnight, when my regex wouldn't work
    You'd match things that I never meant, drove me going berserk
    Greedy quantifiers taking more than they should
    I was young and naive, thought I understood
    
    *Chorus:*
    We are never ever ever getting back together
    My regex and me, no we're not clever
    I used to think we were forever
    But you're too complex, I should know better
    We are never ever ever getting back together
    
    You and your lookaheads and your capture groups
    Making my code break in infinite loops
    
    *Verse 2:*
    I've got a blank space in my pattern matching
    And I'll write your name... `[A-Za-z]+`
    Got a long list of stack overflow questions
    They'll tell you I'm insane
    
    But I've got edge cases, they're multiplying
    And you crash when I need you most
    `.*` is too greedy, why are you lying?
    My performance is toast
    
    *Bridge:*
    This is why we can't have nice things
    (When your regex breaks everything)
    One little dot-star and it's ruined
    (All my parsing, I'm so wounded)
    
    *Outro:*
    I should've known from the start
    You'd tear my program apart
    With your cryptic notation
    Causing stack overflow frustration
    
    But maybe we could try again someday
    If I learn to escape properly this way...
    
    *Spoken:* "I'd like to thank my IDE's syntax highlighting and Stack
    Overflow for helping me through this breakup."
    
    ---
    
    *P.S. - Any resemblance to actual Taylor Swift songs is purely
    intentional and done with the utmost respect for the Queen of Pop and
    her incredible songwriting talent.*
    

    I then asked Claude to explain its thought process.
    When you ask for a poem about regular expressions in Taylor Swift's
    style, my thought process would involve several key considerations:
    
    **Understanding the Challenge:**
    - I need to bridge two very different worlds: technical programming
      concepts (regex) and Taylor Swift's distinctive lyrical style
    - This requires translating abstract, technical ideas into relatable,
      emotional narratives
    
    **Analyzing Taylor Swift's Style:**
    - Her lyrics often tell stories with vivid, specific details
    - She frequently uses metaphors from everyday life (relationships,
      small towns, seasons)
    - Her songs have strong emotional arcs - often about heartbreak,
      growth, or empowerment
    - She uses conversational, accessible language mixed with clever wordplay
    - Common themes include nostalgia, betrayal, self-discovery, and resilience
    
    **Finding the Creative Bridge:**
    - I'd look for ways regex concepts could mirror relationship or life experiences
    - Pattern matching → looking for signs in relationships
    - Wildcards → the unpredictability of love
    - Escaping characters → protecting yourself emotionally
    - Failed matches → romantic disappointments
    
    **Technical Translation:**
    - Convert regex syntax into metaphorical language
    - Make programming frustrations feel like emotional struggles
    - Turn debugging into a narrative of persistence and eventual success
    
    **Structural Approach:**
    - Likely format it as song verses with a chorus
    - Include specific regex syntax as "inside jokes" for programmers
    - Build to an empowering conclusion, as many Swift songs do
    
    The goal would be making regex feel emotionally resonant while
    capturing Swift's voice authentically.
    

    Lecture 33: Strings and Languages.

    Administrivia

  • Final exam date has been announced: Tuesday, December 16th at 9am. RTBA

  • I have office hours Wednesdays from 4-6 pm, on Zoom, ID 459 434 2854.

  • I am available for lunch on Mondays at 1 pm in Morse.

  • ULA office hours are found at https://csofficehours.org/CS201/schedule. Sign up via the queue.

  • CS Peer Advisers. Fall 2025 Peer Advisors Office Hours Schedule.

  • Homework assignments: [Assignments]. hw7 is now available. hw6 extension to Monday November 17th.

    Announcements

  • CS Colloquium - Bjarne Stroustrup, Columbia University.
    Tuesday, November 18, 2025
    4:00 PM - 5:00 PM
    Sloane Physics Laboratory (SPL 59)

    Concept-based Generic Programming

    Abstract: This talk presents programming techniques to illustrate the facilities and principles of C++ generic programming using concepts. Concepts are C++’s way to express constraints on generic code. As an initial example, it provides a simple type system that eliminate narrowing conversions and provides range checking without unnecessary notational or run-time overheads.

    Concepts are used throughout to provide user-defined extensions to the type system. The aim is to show their utility and the fundamental ideas behind them, rather than to provide a detailed or complete explanation of C++’s language support for generic programming or the extensive support provided by the standard library.

    The final sections briefly present design rationales and origins for key parts of the concept design, including uniform treatment of types, use patterns, the relationship to Object-Oriented Programming, value arguments, notation, concept type-matching, definition checking and static reflection (a C++26 improvements in the support of general programming).

    Bio: Bjarne Stroustrup is the designer and original implementer of C++ as well as the author of The C++ Programming Language (4th Edition), A Tour of C++ (3rd edition), Programming: Principles and Practice using C++ (3rd Edition), and many popular and academic publications. Dr. Stroustrup is a professor at Columbia University in New York City. He is a member of the US National Academy of Engineering, and an IEEE, ACM, and CHM fellow. He received the 2018 Charles Stark Draper Prize, the IEEE Computer Society's 2018 Computer Pioneer Award, and the 2017 IET Faraday Medal. His research interests include distributed systems, design, programming techniques, software development tools, and programming languages. He is actively involved in the ISO standardization of C++. He holds a masters in Mathematics from Aarhus University, where he is an honorary professor, and a PhD in Computer Science from Cambridge University, where he is an honorary fellow of Churchill College.

    Website: www.Stroustrup.com

  • Yale Information Society Project See this week's events.

  • Office of Career Services STEMConnect Pop Up advising Fall schedule. Drop in to one and have your resume reviewed, hear advice about finding internships, and learn more about how to get connected to alumni for networking opportunities.

    Lecture: Strings and Languages.

    Strings.html (jupyter) Alphabet.

    Getting to know UNIX

    UNIX Introduction Principle 5.
    [Home]