CSC104 week 11~~~
During the last half of the lecture, we talked about the privacy problem caused by computers. It is also a question for me. I do not know who operate my own computer. Microsoft? Apple? The government? I have no idea. My my personal information has already been known bu someone. The professor uses the example "prism program" by US . We may leak our personal information by various ways. For instance, credit card, buyer loyalty plans, surveys and computer use. However, there are some ways to help us to protect information to a great extend. We protect personal information by setting password and pins, know something about contacts, update security software, OSs or encrypt for something extremely important. It is indeed teach me a lot and help me to protect myself.
During the rest half part of the class, we discussed about flatten and depth function.Flatten:; flatten : list -> list
(define (flatten L)
(cond
[(cons? L) (apply append (map flatten L))]
[else (list L)]))
; predict what (flatten 3) does
; predict what (flatten (list 3)) does
; predict what (flatten (list 1 2 (list 3))) does Depth: ; depth : list -> number
(define (depth L)
(cond
[(cons? L) (+ 1 (apply max (map depth L)))]
[else 0]))
; predict what (depth 3) does
; predict what (depth (list 3 4)) does
; predict what (depth (list 3 4 (list 5 6))) does The biggest difference here is the first one produce a list while the later one produce a number.
The key points that I conclude are:
1. When I see "apply something", just regardless of "apply" and focus on the description after "apply".
2. Focus on every single function after map each of them.
3. Using the right condition for each single function.
All in all, I did good on my quiz and I learned how to protect myself online this week and hopefully, I think I gradually find my own way of studying CSC course~
No comments:
Post a Comment