CSC 151 2019S, Class 07: More regular expressions, Pair programming, evaluating expressions, and other issues
Overview
- Preliminaries
- Notes and news
- Upcoming work
- Extra credit
- Friday PSA
- Questions
- Quiz
- RegExp lab, continued
- Discussion of pair programming reading
- Class code of conduct
Preliminaries
News / Etc.
- Please sit where you sat on Wednesday! Whoever was logged in should
log in now.
- Don’t forget to log out when you are done!
- Even after I talked about pulling the keyboard away from your
partner, some of you did that.
- Goals for today: Quiz done by 10:20. Lab work until 10:45. Discussion
until 11:20.
Upcoming work
- Reading due before class Monday
- Assignment 4 due Tuesday night.
- Partners assigned via email.
- Flash cards due Wednesday at 8:00 p.m.
- Covers Wednesday/Friday/Monday classes
- Lab writeup due before class Wednesday.
- Exercise: TBD
- Subject: CSC 151.01 Writeup for Class 7 (YOUR NAMES)
- To: csc151-01-grader@grinnell.edu
- Once Upon a Time Wolf (tickets required), Bucksbaum.
TONIGHT, 7pm.
- Once Upon a Time Wolf (tickets required), Bucksbaum.
TOMORROW, 7pm
- Any Data Week activity next week.
- HackGC weekend of 15-17 February 2019. (I’m still looking for links.)
- Gardner concert (Karen Meat w/ Katie Sin and Prairie Dogs) TONIGHT, 8:30 p.m.
- Home track meet, Saturday, 9 Feb 2019, all-day and beyond. (30 min suffices)
- Conference Swim and Dive meet, 15-17 February 2019. Dive times to
be announced later.
- Boxing, 2:00 pm, Saturday, Dance Studio
- HIIT training, 4:30 pm, Tuesday, Dance Studio, Bear. (Cap of two EC units.)
- HIIT training, 10:00 am, Saturday, Dance Studio, Bear
- Hatha Yoga, 7:00 pm, Tuesday, Dance Studo, Bear. (Cap of two EC units.)
- Brazilian Jiu-Itsu, Wednesday and Friday, 6:30, Dance Studio (cap of two
EC units.)
- Any Sex Week activity next week.
- Host a prospie! (Details forthcoming.)
- Saturday, 1-2pm JRC 225, Prospie Host Training Session
Other things (no judgement involved)
Friday PSA
- You’re awesome. I care. Care for yourself.
Questions
Can my group analyze State of the Union addresses instead of assorted
public domain books?
Sure. However, you’ll need to do something creative about the
“Compare characters based on their verb usage” part of the assignment.
Do we need to include the punctuation in string->sentences
?
Nope.
How do I replace “aa” with something
(regexp-replace* #px"aa" mystring "something")
If you don’t use star or brackets or anything, it matches the thing
exactly.
How do I replace “aa” with something but not more than two a’s?
I think (regexp-replace* #px"([^a]+)aa([^a]+)" mytext "\\1SOMETHING\\2")
But that’s not perfect
> (regexp-replace* #px"([^a]+)aa([^a]+)" "baab aaa aaaa" "\\1REPLACE\\2")
> "bREPLACEb aaa aaaa"
> (regexp-replace* #px"([^a]+)aa([^a]+)" "baab aaa aaaa baaaaac qaabaaq" "\\1REPLACE\\2")
"bREPLACEb aaa aaaa baaaaac qREPLACEbaaq"
; Replace "aa" with replacement, but not "aaa"
(define replace-aa
(lambda (str replacement)
(regexp-replace* #px"\u1"
(regexp-replace* #px"\u0001aa\u0001"
(regexp-replace* #px"(aa+)" str "\u1\\1\u1")
replacement)
"")))
Quiz
If you finish early, relish the time to sit quietly. (Alternately, go
get some water or use the rest room.)
Lab, continued
We’ll have about twenty minutes to work on the lab.
Write up exercise 6.
Pair programming
- There are two people, driver (at keyboard), and naviagator (not at keyboard)
- The navigator watches what the driver is doing and warns them when
they’re driving off the road (e.g., “you forgot a paren”)
- The navigator can suggest other approaches.
- Help troubleshoot
- The navigator can provide reference, particularly if you have multiple
computers.
- If you don’t like pair programming, it may be that you’re doing it
wrong. (Or maybe you have a really bad partner. Or maybe you
are the really bad partner.)
- Benefits
- Pair pressure: You don’t want to let your partner down.
- The rubber plant effect. Talking through a problem helps.
(It works with a rubber plant. It works better with someone
who responds and/or asks questions.)
- In industry, evidence that pair programmers are more productive
than two people working individually.
Class code of conduct
There are potential problems. Bad pairing can make partners feel
unvalued or useless or want to leave this awesome department or …
What are some practices that we can all agree upon that would make
pairing successful?
I will do my best to …
- Instead of saying “You did this wrong”, say “Maybe we got this wrong”
- “We” not “I”
- Don’t blame, suggest.
- Don’t talk when other people are talking.
- Switch regularly. Talk at the beginning of class. We’ll use the timer,
but you can ignore it. You can switch at each problem. Or at each
intution.
- Own your confusion
- Be honest about what you do and don’t understand. (And what you have
and have not done.)
- Try to be empathetic. Give your partner the benefit of the doubt.
- Listen to other ideas, be willing to try them out.
- Driver: Talk while writing/coding. Helps your partner learn and understand.
Also helps you learn and understand.
- Check in with yourself; if you’re having a problem with someone else,
maybe you are the problem.
- Be open; honest, but not harsh.
- Don’t do the lab before coming to class. (Don’t do hw before meeting
with your partner, etc.)
- Don’t rush your partner, even when you aren’t yet at the writeup.
- Take a look at the assignment before meeting, but don’t code.
- Sam doesn’t know everything, so you certainly don’t.
- Don’t make people who are underrepresented prove that they are people.
(Be careful particularly with gender and race issues.)
- Be active in whatever role you’re in.
- Talk through goals of a homework, before you start working on it.
- Embrace each other’s strengths.
- Don’t Samsplain.
- Pay attention to non-verbal queues.