Warning! You are being recorded (and transcribed) (provided the technology is working correctly).
Pre-class instructions: Please grab a whiteboard.
Approximate overview
Scholarly
Cultural
Peer
Wellness
Misc
At the next CS Table we will discuss web browsers, privacy, and advertising. Our discussion will go beyond Google and the Chrome browser, but our two readings focus on recent changes Google has been pushing in Chrome.
Victor Wong. How Privacy Sandbox raises the bar for ads privacy. Privacy Sandbox (Google). August 15, 2023. https://privacysandbox.com/news/how-privacy-sandbox-raises-the-bar-for-ads-privacy
Bennett Cyphers. Don’t Play in Google’s Privacy Sandbox. Electronic Frontier Foundation. August 30, 2019. https://www.eff.org/deeplinks/2019/08/dont-play-googles-privacy-sandbox-1
Please feel free to explore beyond these readings, and come with questions if you’re not sure about some of the details. Printed readings will be available outside Noyce 3827 on Monday afternoon.
Join us in JRC 224A at noon on Tuesdays to participate. Students who do not have a meal plan may sign in at the entrance to the dining hall to charge their meals to the department; students who charge meals to the department are expected to participate in CS Table discussion. All students, faculty, and staff are welcome to attend.
A few common comments from the tracing quiz. Let me know if any of these don’t make sense.
What is this description parameter for image-subtract (or other procedures)?
Userful Meaning
Description gives a string used to describe the image. It’s there to support visually impaired users (or people who are bad at understanding drawings).
It’s almost always optional.
Should we generate descriptions for the shapes and such we’re making?
I was planning to put that in the requirements for E.
But you don’t have to shoot for E on every assignment or on the first submission.
Agh! I’m trying to do outlined triangles and all I get is the bottom part of the bigger triangle. What’s going on?
It aligns at the left and top.
How do we deal with it?
TPS.
We can see what happens when we use a semi-transparent object.
We can add space by putting a blank rectangle at the left.
Can’t we just use points inside the blank rectangle?
Yeah, you wish. (Forthcoming procedure.
Why are we using a rectangle rather than a triangle to shift?
Because it’s convenient. It’s transparent, so it doesn’t really matter what it is.
Is there something other than shifting that help.
We could also use
placeand thenimage-subtract
Sam appears to have broken place. It is not a good technology day.
We could also use
overlay.
Okay, how about if I want to get the diagonal right, too?
Drawing + math!
TPS
> (image-subtract (solid-right-triangle 100 100 "blue")
(solid-right-triangle 100 100 (rgb 0 0 0 127)))
.
> (image-subtract (solid-right-triangle 100 100 "blue")
(solid-right-triangle 90 90 (rgb 0 0 0 127)))
.
> (image-subtract (solid-right-triangle 110 110 "blue")
(beside (rectangle 0 10 (rgb 0 0 0 0))
(solid-right-triangle 90 90 (rgb 0 0 0 127))))
. . rectangle: arity mismatch;
the expected number of arguments does not match the given number
given: 3
> (image-subtract (solid-right-triangle 110 110 "blue")
(beside (solid-rectangle 0 10 (rgb 0 0 0 0))
(solid-right-triangle 90 90 (rgb 0 0 0 127))))
.
> (image-subtract (solid-right-triangle 110 110 "blue")
(beside (solid-rectangle 10 10 (rgb 0 0 0 0))
(solid-right-triangle 90 90 (rgb 0 0 0 127))))
.
> (image-subtract (solid-right-triangle 110 110 "blue")
(above (solid-rectangle 10 10 (rgb 0 0 0 0))
(beside (solid-rectangle 10 10 (rgb 0 0 0 0))
(solid-right-triangle 90 90 (rgb 0 0 0 127)))))
.
> (solid-polygon (list (pt 10 10) (pt 100 100) (pt 10 100)) "blue")
.
> (solid-coordinate-polygon (list (pt 10 10) (pt 100 100) (pt 10 100)) "blue")
left: 10, top: 10, width: 100, height: 100
.
> (define shift
(lambda (image hoff voff)
(above (solid-rectangle 1 voff (rgb 0 0 0 0))
(beside (solid-rectangle hoff 1 (rgb 0 0 0 0))
image))))
> (image-subtract (solid-right-triangle 120 120 "blue")
(shift (solid-right-triangle 100 100 (rgb 0 0 255 128))
10 10))
.
> (image-subtract (solid-right-triangle 120 120 "blue")
(shift (solid-right-triangle 100 100 (rgb 0 0 255 255))
10 10))
.
> (image-subtract (solid-right-triangle 120 120 "blue")
(shift (solid-right-triangle 90 90 (rgb 0 0 255 255))
10 10))
.
> (image-subtract (solid-right-triangle 120 120 "blue")
(place (solid-right-triangle 90 90 (rgb 0 0 255 255))
10 10
(solid-rectangle 120 120 (rgb 0 0 0 0))))
. . place: arity mismatch;
the expected number of arguments does not match the given number
given: 4
> (image-subtract (solid-right-triangle 120 120 "blue")
(overlay (solid-right-triangle 90 90 (rgb 0 0 255 255))
(solid-rectangle 120 120 (rgb 0 0 0 0))))
.
> (image-subtract (solid-right-triangle 120 120 "blue")
(overlay (solid-right-triangle 90 90 (rgb 0 0 255 255))
(solid-rectangle 110 110 (rgb 0 0 0 0))))
.
> (image-subtract (solid-right-triangle 120 120 "blue")
(overlay (solid-right-triangle 90 90 (rgb 0 0 255 255))
(solid-rectangle 110 110 (rgb 0 0 0 0))))
> (image-subtract (solid-right-triangle 120 120 "blue")
(place (solid-right-triangle 90 90 (rgb 0 0 255 255))
"left" 10
"top" 10
(solid-rectangle 120 120 (rgb 0 0 0 0))))
.
> (image-subtract (solid-right-triangle 120 120 "blue")
(place (solid-right-triangle 30 30 (rgb 0 0 255 255))
"left" 10
"top" 40
(solid-rectangle 120 120 (rgb 0 0 0 0))))
.
When you see \" within a string, it counts as one character. That’s
because a ". (Otherwise, Racket can’t tell the difference between an
ending quotation mark and a quotation mark within a string.)
Add the following before submitting
; SAM SAID WE CAN STOP HERE!
Please read the rest of the lab and ask questions.