EBoard 07: Cut and compose (Section 3)

Warning! You are being recorded and transcribed, provided the technology is working correctly.

Today’s start-of-class procedure

  • Plan to sit with your partner from last class (in the same place).
  • Don’t forget to introduce yourselves again!
  • Whoever was logged in last time should log in again. Bring up the lab.

Approximate optimistic overview

  • Administrative stuff [10 min]
  • Some academic integrity issues [5 min]
  • About Wednesday’s quiz [5 min]
  • About reducing redundancy [5 min]
  • About MP3 [15 min]
  • Questions [5 min]
  • Lab [30 min]
  • Turn in lab [5 min]

Administrative stuff

Introductory notes

  • I’m running out of time on Otter.ai, so I’ll only be recording section 1.
  • Please try to avoid putting images and colors in the definitions pane. When you do so, your Racket file ends up saving in a strange format that doesn’t work with Gradescope. Yay computers!
  • I’d also recommend that you do without image-load and image-save in the definitions pane.

Upcoming activities

Scholarly

  • Thursday, 13 February 2025, 11:00 a.m.–Noon, JRC 101. Grinnell Lecture: Darrius Hills on “The Achievement of Identity: Soul Work, Salvation, and Black Manhood in the Religious Imagination of James Baldwin”.
  • Tuesday, 18 February 2025, Noon–12:50 p.m., PDR 224C (White Dining Room). CS Table: ???

Artistic

  • Friday, 7 February 2025, 3:00–5:00 p.m., Burling Digital Studio. Make a Fidget Workshop.
  • Tuesday, 11 February 2025, 4:00–5:00 p.m., Bucksbaum 131 (GCMoA). Gallery Talk with Chen, Kluber, and Tavares.
  • Friday, 14 February 2025, 5:00–6:30 p.m. (talk at 6:00), 926 Broad St (Stewart Arts Building). Opening Reception for Artist Salon: Works by Grinnell College Art Majors

Multicultural

  • Friday, 7 February 2025, 4:00-5:00 p.m., HSSC N1170 (Global Living Room) Middle of Everywhere: How to Order a Coffee in Singapore.

Peer

Musical, theatric, sporting, and academic events involving this section’s students are welcome.

Wellness

  • Friday, 7 February 2025, 5:30–8:00 p.m., Downtown Grinnell. The Sweet Stroll.
  • Friday, 7 February 2025, 6:00–8:00 p.m., The Aux Gym. Badminton.
  • Tuesday, 11 February 2025, 12:15–12:50 p.m., GCMoA. Yoga in the Museum.
  • Tuesday, 11 February 2025, 4:30–6:30 p.m., BRAC P103 (Multipurpose Dance Studio). Wellness Yoga.

Misc

Other good things

These do not earn tokens, but are worth your consideration.

  • Saturday, 2025-02-08, 1:00–3:00 p.m., Natatorium. Swimming Last Chance Meet
  • Saturday, 2025-02-08, 1:00–3:00 p.m., Darby. Women’s Basketball vs. Lake Forest
  • Saturday, 2025-02-08, 3:00–5:00 p.m., Darby. Men’s Basketball vs. Lake Forest

Upcoming work

Friday PSA

  • You’re awesome.
  • People care about you.
  • Take care of yourself this weekend! (and every weekend)
  • What is right for you may not be the same as what is right for others.
  • Moderation is essential.
  • Consent is essential, but not sufficient.

Academic Integrity

Example one: A student comment from mini-project 2.

For the pentagon, I did get a little bit of help from the programming assitant chatgpt, I was having trouble with knowing how to incorporate real-part, imag-part, and tying it all together.

  • Thanks for citing.
  • However, Do not use AI programming assistants!
  • Ask a human being. Don’t ask the computer.
  • Evening tutor sessions (Sunday to Thursday, 7–10pm, here): Individualized help (usually on homework assignments). (Also Sunday 3–5:00 pm.)
  • Evening mentor sessions (Sunday, 7:30–8:30 in 3819, Tuesday 7:00-8:00 p.m. in 3820): Review of topics. Quiz prep.

Example two: Some code from mini-project 2

(build-list sides (lambda (i) (make-point side-length (general-radius sides) (general-theta sides) (+ 2 i))))))
  • Hmmmm … I haven’t taught you build-list. So the student found it on the Interweb. (Hopefully not with ChatGPT.)
  • Let’s see where (of course, they cited it).
  • Nope.
  • Citing is important!!
  • In general, I’d prefer that you not go far beyond what we’ve learned in class.

Example three: Strange file uploaded

  • Make sure to upload the correct file.

About Wednesday’s Quizzes

There are many goals and processes for decomposition. Not only are we breaking a big problem into smaller parts, we are also trying to avoid repeating ourselves.

In many cases, I saw that you did some decomposition well, but left some repeated code. My initial inclination was to mark all of those as “Redo”. After some reflection, I decided that talking about it in class would suffice. If there’s more than one case of repetition, you have a redo. If there’s only one, you have an S.

On to the problem itself …

About reducing redundancy

Sam, how do I reduce redundancy in my compute-pentagon-point procedure?

(define compute-pentagon-point
  (lambda (radius num)
    (pt (real-part (make-polar radius (* 2/5 num pi)))
        (imag-part (make-polar radius (* 2/5 num pi))))))
  • First of all, great job on using the radius, rather than the side length, so that you don’t have to duplicate the conversion of side length to radius!
  • Second, TPS!
(define compute-pentagon-polar
  (lambda (radius num)
    (make-polar radius (* 2/5 num pi))))

(define compute-pentagon-point
  (lambda (radius num)
    (pt (real-part (compute-pentagon-polar radius num))
        (imag-part (compute-pentagon-polar radius num)))))

We’ve made the code more readable (or may have, if we choose the right name for that helper procedure), but we haven’t eliminated redundancy.

(define polar->point 
  (lambda (polar)
    (pt (real-part polar)
        (imag-part polar))))

(define compute-pentagon-point
  (lambda (radius num)
    (polar->point (compute-pentagon-polar radius num))))

Combining them

(define compute-pentagon-point
  (lambda (radius num)
    (polar->point (make-polar radius (* 2/5 num pi)))))

Important lessons

  • If we have redundant computations, we should create a helper procedure that does part of the computation.
    • One helper for the redudant code
    • One helper that takes the result of the redundant code
  • Decompose! It makes things more readable.

About Mini-Project Three

Transform images!

Have fun with kittens.

Q&A

Administrative

Do I have to tell you when I’m spending a token to turn something in late?

No.

I got an I on MP1. Will you charge me tokens for redoing MP1?

No.

I got an I on MP2. Will you charge me tokens for redoing MP2?

Yes. Tokens are my way of encouraging you to make sure you make an appropriate start on mini-projects.

When do we make up quizzes?

Option 1: During the next quiz day, there will (usually) be make-ups for past quizzes. (They aren’t identical.)

Option 2: On the SoLA (take-home exams).

Can you tell us more about take-home exams?

Yes, when I distribute them. But not today.

Is it okay that I learned things from the Racket Web site and cited them?

Yes.

When redoing a mini-project do I have to start over?

Generally, no. Just fix the parts that we tell you need fixing.

Readings

MP3

Lab

Same partners, new submission. (Submit for class 7, not class 6.)