



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




David Evans http://www.cs.virginia.edu/evans
CS150: Computer Science University of Virginia Computer Science
Avian Flu Virus
Lecture 27: Viruses and OOP 2
From Paul Grahamās āUndergraduationā: My friend Robert learned a lot by writing network software when he was an undergrad. One of his projects was to connect Harvard to the Arpanet; it had been one of the original nodes, but by 1984 the connection had died. Not only was this work not for a class, but because he spent all his time on it and neglected his studies, he was kicked out of school for a year. ... When Robert got kicked out of grad school for writing the Internet worm of 1988, I envied him enormously for finding a way out without the stigma of failure. ... It all evened out in the end, and now heās a professor at MIT. But youāll probably be happier if you donāt go to that extreme; it caused him a lot of worry at the time. 3 years of probation, 400 hours of community service, $10,000+ fine
Lecture 27: Viruses and OOP 3
Lecture 27: Viruses and OOP 4
Input: A program P and input I Output: true if evaluating (P I) would cause a remote computer to be āinfectedā.
Input: A program specification P Output: true if evaluating (P) would cause a file on the host computer to be āinfectedā.
Lecture 27: Viruses and OOP 5
Suppose we could define is-virus? Then:
Lecture 27: Viruses and OOP 6
(define (halts? P) (is-virus? ā(lambda () (begin ((remove-infects P)) (infect-files))))) #t: Since it is a virus, we know (infect-files) was evaluated, and P must halt.
#f: The (infect-files) would not evaluate, so P must not halt.
Can we make remove- infects? Yes, just remove all file writes.
Lecture 27: Viruses and OOP 7
Lecture 27: Viruses and OOP 9
Lecture 27: Viruses and OOP 10
Lecture 27: Viruses and OOP 11
History of Object-Oriented Programming
Lecture 27: Viruses and OOP 12
Pre-History:
Jay Forrester
Lecture 27: Viruses and OOP 19
class counter; integer count; begin procedure reset(); count := 0; end; procedure next(); count := count + 1; end; integer procedure current(); current := count; end; end Lecture 27: Viruses and OOP 20
XEROX Palo Alto Research Center (PARC) 1970s:
Lecture 27: Viruses and OOP 21
(Just a model)
ā Donāt worry about what anybody else is going to do⦠The best way to predict the future is to invent it. Really smart people with reasonable funding can do just about anything that doesn't violate too many of Newton's Laws!ā ā Alan Kay, 1971
Lecture 27: Viruses and OOP 22
Lecture 27: Viruses and OOP 23
Lecture 27: Viruses and OOP 24
Lecture 27: Viruses and OOP 25
Lecture 27: Viruses and OOP 26
class counter: def init(self): self._count = 0 def rest(self): self._count = 0 def next(self): self._count = self._count + 1 def current(self): return self._count
counter() creates a new counter using the init method count is the instance variable ( is just a naming convention)
Lecture 27: Viruses and OOP 27
Lecture 27: Viruses and OOP 28
By the word operation, we mean any process which alters the mutual relation of two or more things, be this relation of what kind it may. This is the most general definition, and would include all subjects in the universe. Again, it might act upon other things besides number, were objects found whose mutual fundamental relations could be expressed by those of the abstract science of operations, and which should be also susceptible of adaptations to the action of the operating notation and mechanism of the engine... Supposing, for instance, that the fundamental relations of pitched sounds in the science of harmony and of musical composition were susceptible of such expression and adaptations, the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent. (^) Ada, Countess of Lovelace, around 1843
Lecture 27: Viruses and OOP 29