Please follow the standard start-of-class routine.
Warning! You are being recorded (and transcribed) (provided the technology is working correctly).
Approximate overview
CHANGES.txt that describes what you’ve changed.(export ...).Scholarly
Artistic/Cultural
Multicultural
Peer
Musical, theatric, sporting, academic, and similar events involving this section’s students are welcome.
Wellness
Misc
These do not earn tokens, but are worth your consideration.
I have credit for all seven LAs. What should I do during LA time?
You can choose to leave or to work on MP3.
Do we have new work to do over break?
No.
There’s not even a reading due at the end of break.
However, you may find that you want to use break to catch up. For example, you might work on redos, you might try to memorize some “vocabulary”, you might complete some of the labs that you didn’t complete.
I wish we had more time in class to complete labs. Would that be possible?
I try to balance talking with lab time. Some folks need a bit more talking, some need a bit more doing. If you want more lab time, you can always do labs here with a friend and the evening tutors. (Sorry, I know that’s not the best answer.)
I’d like to leave early for fall break. Do I have to show up next Friday?
You will miss the opportunity to take LAs.
You must let me know that you won’t be here.
We’ll all miss you.
But it’s up to you.
Central themes
I’ve written gamma-correct-color, but I struggled to write
gamma-correct-half and gamma-correct-double. The evening tutor
“helped” me write a complicated solution. Can we talk about it? I
think it will help me better understand section and compose.
;;; (gamma-correct-color color gamma) -> color?
;;; color : rgb?
;;; gamma : number?
;;; Gamma correct the color by the given amount. You can read
;;; "the literature" for the details.
;;; (gamma-correct-half canvas) -> canvas?
;;; canvas : canvas?
;;; Gamma correct each of the pixels in `canvas` by 1/2
;;; (gamma-correct-double canvas) -> canvas?
;;; canvas : canvas?
;;; Gamma correct each of the pixels in `canvas` by 2
pixel-map needs a one-parameter function as its first
parameter, but gamma-correct expects two.(define gch
(lambda (color)
(gamma-correct color 0.5)))
(define gamma-correct-half
(lambda (image)
(pixel-map gch image)))
This is not much different than defining rgb-bluer ourselves and then
using it with pixel-map.
(define image-bluer
(lambda (image)
(pixel-map rgb-bluer image)))
(define gcdouble
(lambda (color)
(gamma-correct color 2)))
(define gamma-correct-double
(lambda (image)
(pixel-map gcdouble image)))
At some point, you get used to using l-s and r-s (not necessarily
on this assignment).
gch is taking a two-parameter procedure (gamma-correct) and filling in one of the parameters (the second/right) with a constant (0.5). We can use r-s to do the same thing.
(define gch
(r-s gamma-correct 0.5))
We know that Scamper often just does substitution for defined values.
(define gamma-correct-half
(lambda (image)
(pixel-map (r-s gamma-correct 0.5) image)))
If we prefer lambda, we cold also write.
(define gamma-correct-half
(lambda (image)
(pixel-map (lambda (color) (gamma-correct color 0.5)) image)))
We can write gamma-correct-double similarly.
(define gamma-correct-double
(lambda (image)
(pixel-map (r-s gamma-correct 2.0) image)))
Wow. I have two nearly identical procedures. I want to “factor out” the commonality.
(define gamma-correct-image
(lambda (image amt)
(pixel-map (r-s gamma-correct amt) image)))
(define gamma-correct-half
(lambda (image)
(gamma-correct-image image 0.5)))
(define gamma-correct-double
(lambda (image)
(gamma-correct-image image 2.0)))
Taking one more step …
(define gamma-correct-half
(r-s gamma-correct-image 0.5))
(define gamma-correct-double
(r-s gamma-correct-image 2.0))