Warning This class is being recorded (and transcribed), provided Sam remembered to hit the “Record” button.
Approximate overview
Academic
Cultural
Peer
Wellness
Misc
Do you need help? I built a system that helps you see combinations of schedules.
http://www.unconflictgrinnell.com/
Can you sign up for multiple sections in round 1 under the new registration system?
Yes.
Can you join the wait list for conflicting classes?
I think so.
If you put yourself on the wait list for multiple sections of the same class, how many credits does it count against the “no more than 8 credits in round 1”.
I’ve been told that all the sections of the same class count together as one four-credit class.
How do we know which LAs we still have to do?
Bad answer: You can look on gradescope.
Less bad answer: Sam will send out new grade reports after he finishes grading these quizzes.
The autograder is incorrect.
You are correct.
The rubric says “Explain how the image was created.” What do you mean?
I want the procedure call that generated the image.
#|
I created the sample image using (my-fractal ___ ___ ___).
|#
Whe does image-save save the image?
In the same directory/folder as your Racket program.
Or you can use a full path name if you want it elsewhere.
What are the key ideas in vectors?
map operation. (There may
be a vector-map.Some new concepts
Key vector operations
(vector-set! vec pos value) -> changes the value and returns nothing(vector-ref vec pos) -> returns the value at the given position(vector val1 ... valn) -> make a new vector(vector-length vec) -> determine how many values are in the vectorAdditional vector operation
(vector-copy vec) -> returns a copy of the vector.(vector-append vec1 vec2) -> make a new copy of the vector.Warning! Mutation is dangerous.
> (define vec (vector "a" "b" "c"))
> (vector-set! vec 1 "bee")
> vec
'#("a" "bee" "c")
> (define cev vec)
> cev
'#("a" "bee" "c")
> (vector-set! cev 2 "see")
> cev
'#("a" "bee" "see")
> vec
'#("a" "bee" "see") ; whaaaa?
If we want to create a new copy of the vector, we should use vector-copy.
What do you call the #?
Why would I want two names for the same vector?
Is there a way to combine vectors?
Yes, it’s called
vector-appendand it builds a new vector.
If we mutate the result of vector-append, does it affect the original vectors?
No.
If we mutate the original vectors, does it affect the appended vector?
No.
What does this do?
(define size 20000)
(define list-of-values (range size))
(define list-result
(time (map (cut (list-ref list-of-values <>)) list-of-values)))
list-of-values is the list '(0 1 2 3 ... 19999).(cut (list-ref list-of-values <>)) takes one input and looks for it
in list-of-values (returning the index)map does that lookup for every value in the list; we’re doing
20,000 lookups (one for element 0, one for element 1, one for element 2,
…).If I change the 20000 to 40000, what effect will it have on the time it takes?
If I change the 20000 to 80000, what effect will it have on the time it takes?
For 20,000, about 313 milliseconds on my computer For 40,000, about 1189 milliseconds on my computer (about 4 times) For 80,000, I guess 5000 milliseconds on my computer 4881
(define size 80000)
(define rounds 50000)
(define list-of-values (range size))
(define vector-of-values (list->vector list-of-values))
(define list-result
(time (map (cut (vector-ref vector-of-values <>)) list-of-values)))
WIth 80000, it’s one millisecond. With 800000, it’s 790 milliseconds With 1600000, we’re doubling the number of calls, so it should double