SlideShare ist ein Scribd-Unternehmen logo
1 von 31
cs1120 Fall 2011   Class 31:
David Evans
4 November 2011    Deanonymizing
Plan
Dictionaries in Python
History of Object-Oriented Programming




                                         2
Python Dictionary
Dictionary abstraction provides a lookup table.
  Each entry in a dictionary is a
           <key, value>
  pair. The key must be an immutable object.
  The value can be anything.
dictionary[key] evaluates to the value associated
  with key. Running time is approximately
  constant!       Recall: Class 9 on consistent hashing. Python
                       dictionaries use (inconsistent) hashing to make
                       lookups nearly constant time.
Dictionary Example
                  Create a new, empty dictionary
>>> d = {}
>>> d['UVa'] = 1818 Add an entry: key ‘UVa’, value 1818
>>> d['UVa'] = 1819 Update the value: key ‘UVa’, value 1819
>>> d['Cambridge'] = 1209
>>> d['UVa']
1819
>>> d['Oxford']

Traceback (most recent call last):
 File "<pyshell#93>", line 1, in <module>
  d['Oxford']
KeyError: 'Oxford'
6
Histogramming
 Define a procedure histogram that takes a text
 string as its input, and returns a dictionary that
 maps each word in the input text to the
 number of occurrences in the text.

Useful string method: split([separator])
        outputs a list of the words in the string

>>> 'here we go'.split()
['here', 'we', 'go']
>>> "Simula, Nygaard and Dahl, Norway, 1962".split(",")
['Simula', ' Nygaard and Dahl', ' Norway', ' 1962']
>>> histogram("""
                         "Mathematicians stand on each
                         others' shoulders and computer
def histogram(text):     scientists stand on each others' toes."
                         Richard Hamming""")
  d = {}                 {'and': 1, 'on': 2, 'shoulders':
                         1, 'computer': 1, 'Richard':
  words = text.split()   1, 'scientists': 1, "others'": 2, 'stand':
                         2, 'Hamming': 1, 'each':
                         2, '"Mathematicians': 1, 'toes."': 1}




                                                                  8
>>> declaration =
def histogram(text):     urllib.urlopen('http://www.cs.virginia.edu/cs11
  d = {}                 20/readings/declaration.html').read()
                         >>> histogram(declaration)
  words = text.split()   {'government,': 1, 'all':
  for w in words:        11, 'forbidden': 1, '</title>':
                         1, '1776</b>': 1, 'hath': 1, 'Caesar':
    if w in d:           1, 'invariably': 1, 'settlement':
       d[w] = d[w] + 1   1, 'Lee,': 2, 'causes': 1, 'whose':
                         2, 'hold': 3, 'duty,': 1, 'ages,':
    else:                2, 'Object': 1, 'suspending': 1, 'to':
       d[w] = 1          66, 'present': 1, 'Providence,':
                         1, 'under': 1, '<dd>For': 9, 'should.':
  return d               1, 'sent': 1, 'Stone,': 1, 'paralleled':
                         1, …
Sorting the Histogram
Expression ::= lambda Parameters : Expression   sorted(collection, cmp)
                                                Returns a new sorted list of the
     Makes a procedure, just like Scheme’s
     lambda (instead of listing parameters in
                                                elements in collection ordered by cmp.
     (), separate with :)
                                                cmp specifies a comparison function of
                                                two arguments which should return a
  >>> sorted([1,5,3,2,4],<)                     negative, zero or positive number
  SyntaxError: invalid syntax
                                                depending on whether the first
  >>> <
                                                argument is considered smaller
  SyntaxError: invalid syntax
  >>> sorted([1,5,3,2,4], lambda a, b: a > b)   than, equal to, or larger than the
  [1, 5, 3, 2, 4]                               second argument.
  >>> sorted([1,5,3,2,4], lambda a, b: a - b)
  [1, 2, 3, 4, 5]




                                                                                         10
Showing the Histogram

def show_histogram(d):
  keys = d.keys()
  okeys = sorted(keys,


  for k in okeys:
    print str(k) + ": " + str(d[k])
Showing the Histogram

def show_histogram(d):
  keys = d.keys()
  okeys = sorted(keys,
                   lambda k1, k2: d[k2] - d[k1])
  for k in okeys:
     print str(k) + ": " + str(d[k])
Author Fingerprinting
 (aka Plagarism Detection)
“The program identifies phrases of three words
or more in an author’s known work and searches
for them in unattributed plays. In tests where
authors are known to be different, there are up
to 20 matches because some phrases are in
common usage. When Edward III was tested
against Shakespeare’s works published before
1596 there were 200 matches.”
                      The Times, 12 October 2009
def histogram(text):
                                                  d = {}
                                                  words = text.split()
                                                  for w in words:
                                                    if w in d:
                                                       d[w] = d[w] + 1
def phrase_collector(text, plen):
                                                    else:
  d = {}
                                                       d[w] = 1
  words = text.split()
                                                  return d
  words = map(lambda s: s.lower(), words)
  for windex in range(0, len(words) - plen):
    phrase = tuple(words[windex:windex+plen])
    if phrase in d:                          Dictionary keys must be
       d[phrase] = d[phrase] + 1             immutable: convert the
                                             (mutable) list to an
    else:                                    immutable tuple.
       d[phrase]= 1
  return d
def common_phrases(d1, d2):
  keys = d1.keys()
  common = {}
  for k in keys:
     if k in d2:
        common[k] = (d1[k], d2[k])
  return common
 myhomepage = urllib.urlopen('http://www.cs.virginia.edu/evans/index.html').read()
 declaration = urllib.urlopen('http://www.cs.virginia.edu/cs1120/readings/declaration.html').read()

                                  >>> ptj = phrase_collector(declaration, 3)
                                  >>> ptj
                                  {('samuel', 'adams,', 'john'): 1, ('to', 'pass', 'others'):
                                  1, ('absolute', 'despotism,', 'it'): 1, ('a', 'firm', 'reliance'):
                                  1, ('with', 'his', 'measures.'): 1, ('are', 'his.', '<p>'):
                                  1, ('the', 'ruler', 'of'): 1, …
                                  >>> pde = phrase_collector(myhomepage, 3)
                                  >>> common_phrases(ptj, pde)
                                  {('from', 'the', '<a'): (1, 1)}
>>> pde = phrase_collector(myhomepage, 2)
>>> ptj = phrase_collector(declaration, 2)
>>> show_phrases(common_phrases(ptj, pde))
('of', 'the'): (12, 5)
('in', 'the'): (7, 7)
('the', '<a'): (1, 10)
('for', 'the'): (6, 5)
('to', 'the'): (7, 3)
('from', 'the'): (3, 5)
('to', 'be'): (6, 1)
('<p>', 'i'): (1, 6)
('on', 'the'): (5, 2)
('we', 'have'): (5, 1)
('of', 'their'): (4, 1)
('and', 'the'): (3, 1)
('to', 'provide'): (1, 3)
('of', 'a'): (2, 2)
('the', 'state'): (2, 2)
('by', 'their'): (3, 1)
('the', 'same'): (2, 1)
…
History of
Object-Oriented
  Programming
Computing in World War II
Cryptanalysis (Lorenz: Collossus at Bletchley
  Park, Enigma: Bombes at Bletchley, NCR in US)
Ballistics Tables, calculations for Hydrogen
  bomb (ENIAC at U. Pennsylvania)
Batch processing: submit a program and its
  data, wait your turn, get a result

Building a flight simulator required a different type of computing:
                        interactive computing
Pre-History:
          MIT’s Project Whirlwind (1947-1960s)




Jay Forrester
Whirlwind Innovations




Magnetic Core Memory
(first version used vacuum tubes)   IBM 704 (used by John McCarthy to
                                    create LISP) commercialized this
August 29, 1949:
  First Soviet
  Atomic Test
Short or Endless Golden Age of
                           Nuclear Weapons?
             60000
                                        Tsar Bomba (50 Mt, largest ever = 10x all of WWII)
             50000


             40000


             30000
kilotons




             20000

                                 First H-Bomb (10Mt)             B83 (1.2Mt), largest
             10000                                               in currently active arsenal

                 0
                  1940   1950    1960     1970    1980    1990     2000     2010    2020

           Hiroshima (12kt), Nagasaki (20kt)
Semi-Automatic Ground
Environment (SAGE)
MIT/IBM, 1950-1982
Coordinate radar
  stations in real-time to
  track incoming
  bombers
Total cost: $55B
  (more than Manhattan
  Project)
First intercontinental ballistic missile
               First successful test: August 21, 1957




R-7 Semyorka
                        Sputnik: launched by R-7, October 4, 1957
Sketchpad
                              Ivan Sutherland’s 1963 PhD thesis
                               (supervised by Claude Shannon)




Interactive drawing program
Light pen
Components in
  Sketchpad
Objects in Sketchpad
In the process of making the Sketchpad system operate, a few very general
functions were developed which make no reference at all to the specific types
of entities on which they operate. These general functions give the Sketchpad
system the ability to operate on a wide range of problems. The motivation for
making the functions as general as possible came from the desire to get as much
result as possible from the programming effort involved. For example, the general
function for expanding instances makes it possible for Sketchpad to handle any
fixed geometry subpicture. The rewards that come from implementing general
functions are so great that the author has become reluctant to write any
programs for specific jobs. Each of the general functions implemented in the
Sketchpad system abstracts, in some sense, some common property of pictures
independent of the specific subject matter of the pictures themselves.
                                                           Ivan Sutherland,
             Sketchpad: a Man-Machine Graphical Communication System, 1963
Simula
Considered the first
  “object-oriented”
  programming language
Language designed for
  simulation by Kristen
  Nygaard and Ole-Johan
  Dahl (Norway, 1962)
Had special syntax for
  defining classes that
  packages state and
  procedures together
Counter in Simula
class counter;
  integer count;
  begin
   procedure reset(); count := 0; end;
   procedure next();
       count := count + 1; end;
   integer procedure current();
      current := count; end;
  end
                Does this have everything we need for
                “object-oriented programming”?
Object-Oriented Programming
Object-Oriented Programming is a state of mind
   where you program by thinking about objects
It is difficult to reach that state of mind if your
   language doesn’t have mechanisms for
   packaging state and procedures (Python has
   class, Scheme has lambda expressions)
Other things can help: dynamic
   dispatch, inheritance, automatic memory
   management, mixins, good donuts, etc.
Charge
Monday: continue OOP history
PS6 Due Monday
Next week:
  PS7 Due next Monday: only one week!
  building a (mini) Scheme interpreter
      (in Python and Java)
              Reminder: Peter has office hours now!
                      (going over to Rice)

                                                      31

Weitere ähnliche Inhalte

Was ist angesagt?

Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013aleks-f
 
Introduction à dart
Introduction à dartIntroduction à dart
Introduction à dartyohanbeschi
 
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...Dr. Volkan OBAN
 
Modern technologies in data science
Modern technologies in data science Modern technologies in data science
Modern technologies in data science Chucheng Hsieh
 
Martin Fowler's Refactoring Techniques Quick Reference
Martin Fowler's Refactoring Techniques Quick ReferenceMartin Fowler's Refactoring Techniques Quick Reference
Martin Fowler's Refactoring Techniques Quick ReferenceSeung-Bum Lee
 
From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019Leonardo Borges
 
(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your GroovyAlonso Torres
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6Nitay Neeman
 
Clojure: The Art of Abstraction
Clojure: The Art of AbstractionClojure: The Art of Abstraction
Clojure: The Art of AbstractionAlex Miller
 
The Ring programming language version 1.5.2 book - Part 34 of 181
The Ring programming language version 1.5.2 book - Part 34 of 181The Ring programming language version 1.5.2 book - Part 34 of 181
The Ring programming language version 1.5.2 book - Part 34 of 181Mahmoud Samir Fayed
 
The Logical Burrito - pattern matching, term rewriting and unification
The Logical Burrito - pattern matching, term rewriting and unificationThe Logical Burrito - pattern matching, term rewriting and unification
The Logical Burrito - pattern matching, term rewriting and unificationNorman Richards
 

Was ist angesagt? (20)

Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013
 
ruby1_6up
ruby1_6upruby1_6up
ruby1_6up
 
Introduction à dart
Introduction à dartIntroduction à dart
Introduction à dart
 
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
 
Modern technologies in data science
Modern technologies in data science Modern technologies in data science
Modern technologies in data science
 
core.logic introduction
core.logic introductioncore.logic introduction
core.logic introduction
 
Groovy
GroovyGroovy
Groovy
 
Martin Fowler's Refactoring Techniques Quick Reference
Martin Fowler's Refactoring Techniques Quick ReferenceMartin Fowler's Refactoring Techniques Quick Reference
Martin Fowler's Refactoring Techniques Quick Reference
 
360|iDev
360|iDev360|iDev
360|iDev
 
Hammurabi
HammurabiHammurabi
Hammurabi
 
7. arrays
7. arrays7. arrays
7. arrays
 
Coding in Style
Coding in StyleCoding in Style
Coding in Style
 
From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019
 
(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6
 
Clojure: The Art of Abstraction
Clojure: The Art of AbstractionClojure: The Art of Abstraction
Clojure: The Art of Abstraction
 
The Ring programming language version 1.5.2 book - Part 34 of 181
The Ring programming language version 1.5.2 book - Part 34 of 181The Ring programming language version 1.5.2 book - Part 34 of 181
The Ring programming language version 1.5.2 book - Part 34 of 181
 
The Logical Burrito - pattern matching, term rewriting and unification
The Logical Burrito - pattern matching, term rewriting and unificationThe Logical Burrito - pattern matching, term rewriting and unification
The Logical Burrito - pattern matching, term rewriting and unification
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
 
Sneaking inside Kotlin features
Sneaking inside Kotlin featuresSneaking inside Kotlin features
Sneaking inside Kotlin features
 

Andere mochten auch

Class 30: Sex, Religion, and Politics
Class 30: Sex, Religion, and PoliticsClass 30: Sex, Religion, and Politics
Class 30: Sex, Religion, and PoliticsDavid Evans
 
Class 17: Golden Sneezewort
Class 17: Golden SneezewortClass 17: Golden Sneezewort
Class 17: Golden SneezewortDavid Evans
 
Class 39: ...and the World Wide Web
Class 39: ...and the World Wide WebClass 39: ...and the World Wide Web
Class 39: ...and the World Wide WebDavid Evans
 
Lecture 1: Introduction
Lecture 1: IntroductionLecture 1: Introduction
Lecture 1: IntroductionDavid Evans
 
Class 12: Computing Machines
Class 12: Computing MachinesClass 12: Computing Machines
Class 12: Computing MachinesDavid Evans
 
Class 34: Proving Unprovability
Class 34: Proving UnprovabilityClass 34: Proving Unprovability
Class 34: Proving UnprovabilityDavid Evans
 
Class 11: Deeper List Procedures
Class 11: Deeper List ProceduresClass 11: Deeper List Procedures
Class 11: Deeper List ProceduresDavid Evans
 
Web Server Scheduling
Web Server SchedulingWeb Server Scheduling
Web Server SchedulingDavid Evans
 
Multi-Tasking Map (MapReduce, Tasks in Rust)
Multi-Tasking Map (MapReduce, Tasks in Rust)Multi-Tasking Map (MapReduce, Tasks in Rust)
Multi-Tasking Map (MapReduce, Tasks in Rust)David Evans
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in ParadiseDavid Evans
 
Class 24: Imperative Programming
Class 24: Imperative ProgrammingClass 24: Imperative Programming
Class 24: Imperative ProgrammingDavid Evans
 
The First Billion Android Activations
The First Billion Android ActivationsThe First Billion Android Activations
The First Billion Android ActivationsDavid Evans
 
Cryptographic Future
Cryptographic FutureCryptographic Future
Cryptographic FutureDavid Evans
 
Bakers and Philosophers
Bakers and PhilosophersBakers and Philosophers
Bakers and PhilosophersDavid Evans
 
Engineering Cryptographic Applications: Symmetric Encryption
Engineering Cryptographic Applications: Symmetric EncryptionEngineering Cryptographic Applications: Symmetric Encryption
Engineering Cryptographic Applications: Symmetric EncryptionDavid Evans
 
Scheduling in Linux and Web Servers
Scheduling in Linux and Web ServersScheduling in Linux and Web Servers
Scheduling in Linux and Web ServersDavid Evans
 
Class 1: Introduction - What is an Operating System?
Class 1: Introduction - What is an Operating System?Class 1: Introduction - What is an Operating System?
Class 1: Introduction - What is an Operating System?David Evans
 

Andere mochten auch (19)

Storage Systems
Storage SystemsStorage Systems
Storage Systems
 
Class 30: Sex, Religion, and Politics
Class 30: Sex, Religion, and PoliticsClass 30: Sex, Religion, and Politics
Class 30: Sex, Religion, and Politics
 
Class 17: Golden Sneezewort
Class 17: Golden SneezewortClass 17: Golden Sneezewort
Class 17: Golden Sneezewort
 
Class 39: ...and the World Wide Web
Class 39: ...and the World Wide WebClass 39: ...and the World Wide Web
Class 39: ...and the World Wide Web
 
Lecture 1: Introduction
Lecture 1: IntroductionLecture 1: Introduction
Lecture 1: Introduction
 
Class 12: Computing Machines
Class 12: Computing MachinesClass 12: Computing Machines
Class 12: Computing Machines
 
Lecture20
Lecture20Lecture20
Lecture20
 
Class 34: Proving Unprovability
Class 34: Proving UnprovabilityClass 34: Proving Unprovability
Class 34: Proving Unprovability
 
Class 11: Deeper List Procedures
Class 11: Deeper List ProceduresClass 11: Deeper List Procedures
Class 11: Deeper List Procedures
 
Web Server Scheduling
Web Server SchedulingWeb Server Scheduling
Web Server Scheduling
 
Multi-Tasking Map (MapReduce, Tasks in Rust)
Multi-Tasking Map (MapReduce, Tasks in Rust)Multi-Tasking Map (MapReduce, Tasks in Rust)
Multi-Tasking Map (MapReduce, Tasks in Rust)
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in Paradise
 
Class 24: Imperative Programming
Class 24: Imperative ProgrammingClass 24: Imperative Programming
Class 24: Imperative Programming
 
The First Billion Android Activations
The First Billion Android ActivationsThe First Billion Android Activations
The First Billion Android Activations
 
Cryptographic Future
Cryptographic FutureCryptographic Future
Cryptographic Future
 
Bakers and Philosophers
Bakers and PhilosophersBakers and Philosophers
Bakers and Philosophers
 
Engineering Cryptographic Applications: Symmetric Encryption
Engineering Cryptographic Applications: Symmetric EncryptionEngineering Cryptographic Applications: Symmetric Encryption
Engineering Cryptographic Applications: Symmetric Encryption
 
Scheduling in Linux and Web Servers
Scheduling in Linux and Web ServersScheduling in Linux and Web Servers
Scheduling in Linux and Web Servers
 
Class 1: Introduction - What is an Operating System?
Class 1: Introduction - What is an Operating System?Class 1: Introduction - What is an Operating System?
Class 1: Introduction - What is an Operating System?
 

Ähnlich wie Class 31: Deanonymizing

Microsoft Word Practice Exercise Set 2
Microsoft Word   Practice Exercise Set 2Microsoft Word   Practice Exercise Set 2
Microsoft Word Practice Exercise Set 2rampan
 
Generic Functional Programming with Type Classes
Generic Functional Programming with Type ClassesGeneric Functional Programming with Type Classes
Generic Functional Programming with Type ClassesTapio Rautonen
 
Basics of Python programming (part 2)
Basics of Python programming (part 2)Basics of Python programming (part 2)
Basics of Python programming (part 2)Pedro Rodrigues
 
Scoobi - Scala for Startups
Scoobi - Scala for StartupsScoobi - Scala for Startups
Scoobi - Scala for Startupsbmlever
 
Pydiomatic
PydiomaticPydiomatic
Pydiomaticrik0
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent SevenMike Fogus
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayUtkarsh Sengar
 
R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)Christopher Roach
 
Clojure Intro
Clojure IntroClojure Intro
Clojure Introthnetos
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Guy Lebanon
 
Declarative Thinking, Declarative Practice
Declarative Thinking, Declarative PracticeDeclarative Thinking, Declarative Practice
Declarative Thinking, Declarative PracticeKevlin Henney
 
A Taste of Python - Devdays Toronto 2009
A Taste of Python - Devdays Toronto 2009A Taste of Python - Devdays Toronto 2009
A Taste of Python - Devdays Toronto 2009Jordan Baker
 
Fp in scala part 2
Fp in scala part 2Fp in scala part 2
Fp in scala part 2Hang Zhao
 
R Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdfR Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdfTimothy McBush Hiele
 

Ähnlich wie Class 31: Deanonymizing (20)

R language introduction
R language introductionR language introduction
R language introduction
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
Microsoft Word Practice Exercise Set 2
Microsoft Word   Practice Exercise Set 2Microsoft Word   Practice Exercise Set 2
Microsoft Word Practice Exercise Set 2
 
Generic Functional Programming with Type Classes
Generic Functional Programming with Type ClassesGeneric Functional Programming with Type Classes
Generic Functional Programming with Type Classes
 
Basics of Python programming (part 2)
Basics of Python programming (part 2)Basics of Python programming (part 2)
Basics of Python programming (part 2)
 
03.01 hash tables
03.01 hash tables03.01 hash tables
03.01 hash tables
 
Scoobi - Scala for Startups
Scoobi - Scala for StartupsScoobi - Scala for Startups
Scoobi - Scala for Startups
 
Hw09 Hadoop + Clojure
Hw09   Hadoop + ClojureHw09   Hadoop + Clojure
Hw09 Hadoop + Clojure
 
Pydiomatic
PydiomaticPydiomatic
Pydiomatic
 
Python idiomatico
Python idiomaticoPython idiomatico
Python idiomatico
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent Seven
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
 
R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)
 
Clojure Intro
Clojure IntroClojure Intro
Clojure Intro
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
 
Declarative Thinking, Declarative Practice
Declarative Thinking, Declarative PracticeDeclarative Thinking, Declarative Practice
Declarative Thinking, Declarative Practice
 
A Taste of Python - Devdays Toronto 2009
A Taste of Python - Devdays Toronto 2009A Taste of Python - Devdays Toronto 2009
A Taste of Python - Devdays Toronto 2009
 
Fp in scala part 2
Fp in scala part 2Fp in scala part 2
Fp in scala part 2
 
R Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdfR Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdf
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 

Mehr von David Evans

Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!David Evans
 
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for CypherpunksTrick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for CypherpunksDavid Evans
 
Hidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeHidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeDavid Evans
 
Anonymity in Bitcoin
Anonymity in BitcoinAnonymity in Bitcoin
Anonymity in BitcoinDavid Evans
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm ConfirmationsDavid Evans
 
Scripting Transactions
Scripting TransactionsScripting Transactions
Scripting TransactionsDavid Evans
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in ParadiseDavid Evans
 
Mining Economics
Mining EconomicsMining Economics
Mining EconomicsDavid Evans
 
Becoming More Paranoid
Becoming More ParanoidBecoming More Paranoid
Becoming More ParanoidDavid Evans
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key SignaturesDavid Evans
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to CryptographyDavid Evans
 
Class 1: What is Money?
Class 1: What is Money?Class 1: What is Money?
Class 1: What is Money?David Evans
 
Multi-Party Computation for the Masses
Multi-Party Computation for the MassesMulti-Party Computation for the Masses
Multi-Party Computation for the MassesDavid Evans
 
Proof of Reserve
Proof of ReserveProof of Reserve
Proof of ReserveDavid Evans
 
Blooming Sidechains!
Blooming Sidechains!Blooming Sidechains!
Blooming Sidechains!David Evans
 
Useful Proofs of Work, Permacoin
Useful Proofs of Work, PermacoinUseful Proofs of Work, Permacoin
Useful Proofs of Work, PermacoinDavid Evans
 

Mehr von David Evans (20)

Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!
 
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for CypherpunksTrick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
 
Hidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeHidden Services, Zero Knowledge
Hidden Services, Zero Knowledge
 
Anonymity in Bitcoin
Anonymity in BitcoinAnonymity in Bitcoin
Anonymity in Bitcoin
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm Confirmations
 
Scripting Transactions
Scripting TransactionsScripting Transactions
Scripting Transactions
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in Paradise
 
Bitcoin Script
Bitcoin ScriptBitcoin Script
Bitcoin Script
 
Mining Economics
Mining EconomicsMining Economics
Mining Economics
 
Mining
MiningMining
Mining
 
The Blockchain
The BlockchainThe Blockchain
The Blockchain
 
Becoming More Paranoid
Becoming More ParanoidBecoming More Paranoid
Becoming More Paranoid
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key Signatures
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Class 1: What is Money?
Class 1: What is Money?Class 1: What is Money?
Class 1: What is Money?
 
Multi-Party Computation for the Masses
Multi-Party Computation for the MassesMulti-Party Computation for the Masses
Multi-Party Computation for the Masses
 
Proof of Reserve
Proof of ReserveProof of Reserve
Proof of Reserve
 
Silk Road
Silk RoadSilk Road
Silk Road
 
Blooming Sidechains!
Blooming Sidechains!Blooming Sidechains!
Blooming Sidechains!
 
Useful Proofs of Work, Permacoin
Useful Proofs of Work, PermacoinUseful Proofs of Work, Permacoin
Useful Proofs of Work, Permacoin
 

Kürzlich hochgeladen

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Kürzlich hochgeladen (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

Class 31: Deanonymizing

  • 1. cs1120 Fall 2011 Class 31: David Evans 4 November 2011 Deanonymizing
  • 2. Plan Dictionaries in Python History of Object-Oriented Programming 2
  • 3. Python Dictionary Dictionary abstraction provides a lookup table. Each entry in a dictionary is a <key, value> pair. The key must be an immutable object. The value can be anything. dictionary[key] evaluates to the value associated with key. Running time is approximately constant! Recall: Class 9 on consistent hashing. Python dictionaries use (inconsistent) hashing to make lookups nearly constant time.
  • 4. Dictionary Example Create a new, empty dictionary >>> d = {} >>> d['UVa'] = 1818 Add an entry: key ‘UVa’, value 1818 >>> d['UVa'] = 1819 Update the value: key ‘UVa’, value 1819 >>> d['Cambridge'] = 1209 >>> d['UVa'] 1819 >>> d['Oxford'] Traceback (most recent call last): File "<pyshell#93>", line 1, in <module> d['Oxford'] KeyError: 'Oxford'
  • 5.
  • 6. 6
  • 7. Histogramming Define a procedure histogram that takes a text string as its input, and returns a dictionary that maps each word in the input text to the number of occurrences in the text. Useful string method: split([separator]) outputs a list of the words in the string >>> 'here we go'.split() ['here', 'we', 'go'] >>> "Simula, Nygaard and Dahl, Norway, 1962".split(",") ['Simula', ' Nygaard and Dahl', ' Norway', ' 1962']
  • 8. >>> histogram(""" "Mathematicians stand on each others' shoulders and computer def histogram(text): scientists stand on each others' toes." Richard Hamming""") d = {} {'and': 1, 'on': 2, 'shoulders': 1, 'computer': 1, 'Richard': words = text.split() 1, 'scientists': 1, "others'": 2, 'stand': 2, 'Hamming': 1, 'each': 2, '"Mathematicians': 1, 'toes."': 1} 8
  • 9. >>> declaration = def histogram(text): urllib.urlopen('http://www.cs.virginia.edu/cs11 d = {} 20/readings/declaration.html').read() >>> histogram(declaration) words = text.split() {'government,': 1, 'all': for w in words: 11, 'forbidden': 1, '</title>': 1, '1776</b>': 1, 'hath': 1, 'Caesar': if w in d: 1, 'invariably': 1, 'settlement': d[w] = d[w] + 1 1, 'Lee,': 2, 'causes': 1, 'whose': 2, 'hold': 3, 'duty,': 1, 'ages,': else: 2, 'Object': 1, 'suspending': 1, 'to': d[w] = 1 66, 'present': 1, 'Providence,': 1, 'under': 1, '<dd>For': 9, 'should.': return d 1, 'sent': 1, 'Stone,': 1, 'paralleled': 1, …
  • 10. Sorting the Histogram Expression ::= lambda Parameters : Expression sorted(collection, cmp) Returns a new sorted list of the Makes a procedure, just like Scheme’s lambda (instead of listing parameters in elements in collection ordered by cmp. (), separate with :) cmp specifies a comparison function of two arguments which should return a >>> sorted([1,5,3,2,4],<) negative, zero or positive number SyntaxError: invalid syntax depending on whether the first >>> < argument is considered smaller SyntaxError: invalid syntax >>> sorted([1,5,3,2,4], lambda a, b: a > b) than, equal to, or larger than the [1, 5, 3, 2, 4] second argument. >>> sorted([1,5,3,2,4], lambda a, b: a - b) [1, 2, 3, 4, 5] 10
  • 11. Showing the Histogram def show_histogram(d): keys = d.keys() okeys = sorted(keys, for k in okeys: print str(k) + ": " + str(d[k])
  • 12. Showing the Histogram def show_histogram(d): keys = d.keys() okeys = sorted(keys, lambda k1, k2: d[k2] - d[k1]) for k in okeys: print str(k) + ": " + str(d[k])
  • 13. Author Fingerprinting (aka Plagarism Detection) “The program identifies phrases of three words or more in an author’s known work and searches for them in unattributed plays. In tests where authors are known to be different, there are up to 20 matches because some phrases are in common usage. When Edward III was tested against Shakespeare’s works published before 1596 there were 200 matches.” The Times, 12 October 2009
  • 14. def histogram(text): d = {} words = text.split() for w in words: if w in d: d[w] = d[w] + 1 def phrase_collector(text, plen): else: d = {} d[w] = 1 words = text.split() return d words = map(lambda s: s.lower(), words) for windex in range(0, len(words) - plen): phrase = tuple(words[windex:windex+plen]) if phrase in d: Dictionary keys must be d[phrase] = d[phrase] + 1 immutable: convert the (mutable) list to an else: immutable tuple. d[phrase]= 1 return d
  • 15. def common_phrases(d1, d2): keys = d1.keys() common = {} for k in keys: if k in d2: common[k] = (d1[k], d2[k]) return common myhomepage = urllib.urlopen('http://www.cs.virginia.edu/evans/index.html').read() declaration = urllib.urlopen('http://www.cs.virginia.edu/cs1120/readings/declaration.html').read() >>> ptj = phrase_collector(declaration, 3) >>> ptj {('samuel', 'adams,', 'john'): 1, ('to', 'pass', 'others'): 1, ('absolute', 'despotism,', 'it'): 1, ('a', 'firm', 'reliance'): 1, ('with', 'his', 'measures.'): 1, ('are', 'his.', '<p>'): 1, ('the', 'ruler', 'of'): 1, … >>> pde = phrase_collector(myhomepage, 3) >>> common_phrases(ptj, pde) {('from', 'the', '<a'): (1, 1)}
  • 16. >>> pde = phrase_collector(myhomepage, 2) >>> ptj = phrase_collector(declaration, 2) >>> show_phrases(common_phrases(ptj, pde)) ('of', 'the'): (12, 5) ('in', 'the'): (7, 7) ('the', '<a'): (1, 10) ('for', 'the'): (6, 5) ('to', 'the'): (7, 3) ('from', 'the'): (3, 5) ('to', 'be'): (6, 1) ('<p>', 'i'): (1, 6) ('on', 'the'): (5, 2) ('we', 'have'): (5, 1) ('of', 'their'): (4, 1) ('and', 'the'): (3, 1) ('to', 'provide'): (1, 3) ('of', 'a'): (2, 2) ('the', 'state'): (2, 2) ('by', 'their'): (3, 1) ('the', 'same'): (2, 1) …
  • 18. Computing in World War II Cryptanalysis (Lorenz: Collossus at Bletchley Park, Enigma: Bombes at Bletchley, NCR in US) Ballistics Tables, calculations for Hydrogen bomb (ENIAC at U. Pennsylvania) Batch processing: submit a program and its data, wait your turn, get a result Building a flight simulator required a different type of computing: interactive computing
  • 19. Pre-History: MIT’s Project Whirlwind (1947-1960s) Jay Forrester
  • 20. Whirlwind Innovations Magnetic Core Memory (first version used vacuum tubes) IBM 704 (used by John McCarthy to create LISP) commercialized this
  • 21. August 29, 1949: First Soviet Atomic Test
  • 22. Short or Endless Golden Age of Nuclear Weapons? 60000 Tsar Bomba (50 Mt, largest ever = 10x all of WWII) 50000 40000 30000 kilotons 20000 First H-Bomb (10Mt) B83 (1.2Mt), largest 10000 in currently active arsenal 0 1940 1950 1960 1970 1980 1990 2000 2010 2020 Hiroshima (12kt), Nagasaki (20kt)
  • 23. Semi-Automatic Ground Environment (SAGE) MIT/IBM, 1950-1982 Coordinate radar stations in real-time to track incoming bombers Total cost: $55B (more than Manhattan Project)
  • 24. First intercontinental ballistic missile First successful test: August 21, 1957 R-7 Semyorka Sputnik: launched by R-7, October 4, 1957
  • 25. Sketchpad Ivan Sutherland’s 1963 PhD thesis (supervised by Claude Shannon) Interactive drawing program Light pen
  • 26. Components in Sketchpad
  • 27. Objects in Sketchpad In the process of making the Sketchpad system operate, a few very general functions were developed which make no reference at all to the specific types of entities on which they operate. These general functions give the Sketchpad system the ability to operate on a wide range of problems. The motivation for making the functions as general as possible came from the desire to get as much result as possible from the programming effort involved. For example, the general function for expanding instances makes it possible for Sketchpad to handle any fixed geometry subpicture. The rewards that come from implementing general functions are so great that the author has become reluctant to write any programs for specific jobs. Each of the general functions implemented in the Sketchpad system abstracts, in some sense, some common property of pictures independent of the specific subject matter of the pictures themselves. Ivan Sutherland, Sketchpad: a Man-Machine Graphical Communication System, 1963
  • 28. Simula Considered the first “object-oriented” programming language Language designed for simulation by Kristen Nygaard and Ole-Johan Dahl (Norway, 1962) Had special syntax for defining classes that packages state and procedures together
  • 29. Counter in Simula class counter; integer count; begin procedure reset(); count := 0; end; procedure next(); count := count + 1; end; integer procedure current(); current := count; end; end Does this have everything we need for “object-oriented programming”?
  • 30. Object-Oriented Programming Object-Oriented Programming is a state of mind where you program by thinking about objects It is difficult to reach that state of mind if your language doesn’t have mechanisms for packaging state and procedures (Python has class, Scheme has lambda expressions) Other things can help: dynamic dispatch, inheritance, automatic memory management, mixins, good donuts, etc.
  • 31. Charge Monday: continue OOP history PS6 Due Monday Next week: PS7 Due next Monday: only one week! building a (mini) Scheme interpreter (in Python and Java) Reminder: Peter has office hours now! (going over to Rice) 31