SlideShare uma empresa Scribd logo
1 de 14
Python
 Scott G. Ainsworth
      for ODU ACM
       22 Sept 2011
What is Python?

 Easy to learn

 Simple syntax

 Dynamic typing

 High-level data structures    Free

                                Linux/Unix, OS X, Windows

                                MIT’s language of choice
Why Python?
 Fast development cycle
   Interactive & edit, debug/run
   vs. edit, compile, debug/run

 Extensive standard and add-on libraries
   (MIT’s language of choice)

 Python, Jython, & IronPython

 Google AppEngine
Basic Syntax

 Block structured

 But no braces

 Indent defines blocks



                  def fib(n):
                      a, b = 0, 1
                      while b < n:
                          print b,
                          a, b = b, a+b
Numbers & Strings

 Integers: -231 – 231-1    'value' == "value"
    5 + 23
                            """multiple
 Long: unlimited            lines"""
    1234567890123456789    u'unicode'
 Boolean:                  'substring'[2:5] == 'bst'
    True or False
      0 or 1

 Real and Complex:
    1.25 / 6.3
    Complex(1.1,2.2)
Sequence Types

 Lists
    primes = [ 2, 3, 5, 7, 11, 13, 17, 19, 23 ]
    primes.append(27)
    Primes[-2:] = [ 23, 27 ]

 Tuples
    primes = ( 2, 3, 5, 7, 11, 13, 17,19, 23 )
    primes.append(27)  # fails, tuples are immutable
    primes[-2:] = ( 23, 27 )

 Strings are an immutable list of single characters
Dictionaries & Sets

 Dictionaries
   pdict = { "p1" : 2, "p2" : 3, "p3" : 5 }
   pdict["p4"] = 7
   pdict["p2"] == 3

 Sets
   primes = Set([ 2, 3, 5, 7, 11, 13, 17,19, 23 ])
   primes.append(27) # fails, set are unordered
   primes.add(27) # succeeds
Classes

Class complex:
    """implement complex numbers"""

   def __init__(self, r, i):
       self.__r = r
       self.__i = i

   def isreal(self):
       return self.c == 0

   def __add__(self, c):
       return complex(self.r + c.r, self.i + c.i)
Memento & Timemap for
    www.cs.odu.edu

http://api.wayback.archive.org/memento/timemap/link/http://www.cs.odu.edu
   1.   <http://www.cs.odu.edu>; rel="original",
   2.   <http://api.wayback.archive.org/list/timemap/link/http://www.cs.odu.edu>;
        rel="timemap"; type="application/link-format”,
   3.   <http://api.wayback.archive.org/memento/19970102130137/http://cs.odu.edu/>;
        rel="first memento"; datetime="Thu, 02 Jan 1997 13:01:37 GMT”,
   4.   <http://api.wayback.archive.org/memento/19970606105039/http://www.cs.odu.edu/
        >; rel="memento"; datetime="Fri, 06 Jun 1997 10:50:39 GMT",

Output from timemap.py test
   1.   Original: http://www.cs.odu.edu
   2.   Time Map:
        http://api.wayback.archive.org/list/timemap/link/http://www.cs.odu.edu
   3.   First Memento:
        (datetime.datetime(1997, 1, 2, 13, 1, 37, tzinfo=tzutc()), 'http://api.wayback.archive.o
        rg/memento/19970102130137/http://cs.odu.edu/')
   4.   1997-06-06 10:50:39+00:00 =
        http://api.wayback.archive.org/memento/19970606105039/http://www.cs.odu.edu/
timemap.py Output
Original:       http://www.cs.odu.edu
Time Bundle:    http://api.wayback.archive.org/list/timebundle/
                         http://www.cs.odu.edu
Time Gate:      http://api.wayback.archive.org/list/timegate/
                         http://www.cs.odu.edu
Time Map:       http://api.wayback.archive.org/list/timemap/link/
                         http://www.cs.odu.edu
First Memento: 1997-01-02 13:01:37+00:00
Last Memento: 2011-07-20 01:58:31+00:00
Mementos:
        1997-06-06 10:50:39+00:00 = http://api.wayback.archive.org/memento/
                19970606105039/http://www.cs.odu.edu/
        1997-10-10 20:16:32+00:00 = http://api.wayback.archive.org/memento/
                19971010201632/http://www.cs.odu.edu/
Code Walk Through
 class TimeMap: Memento timemap container class

 class TimeMapTokenizer: Helper class to tokenize a link-style
   timemap
 __main__: Used for quick unit testing




Download the code:
   http://www.cs.odu.edu/~sainswor/uploads/Downloads/timemap.py
Summary

 Easy to learn                 Fast development cycle

 Dynamic typing                Extensive standard and
                                 add-on libraries
 High-level data structures
                                Widely-supported
 Free

 Linux/Unix, OS X, Windows
Questions?
Links
 Slides: http://www.cs.odu.edu/~sainswor/uploads/Downloads/ACM-Python.py

 Code: http://www.cs.odu.edu/~sainswor/uploads/Downloads/timemap.py

 Python: http://www.python.org

 Python Docs: http://docs.python.org

 Python Libraries: http://pypi.python.org

Mais conteúdo relacionado

Mais procurados

Diving into byte code optimization in python
Diving into byte code optimization in python Diving into byte code optimization in python
Diving into byte code optimization in python Chetan Giridhar
 
Syed Ubaid Ali Jafri - Cryptography Techniques
Syed Ubaid Ali Jafri - Cryptography TechniquesSyed Ubaid Ali Jafri - Cryptography Techniques
Syed Ubaid Ali Jafri - Cryptography TechniquesSyed Ubaid Ali Jafri
 
Playing 44CON CTF for fun and profit
Playing 44CON CTF for fun and profitPlaying 44CON CTF for fun and profit
Playing 44CON CTF for fun and profit44CON
 
Gate level minimization (2nd update)
Gate level minimization (2nd update)Gate level minimization (2nd update)
Gate level minimization (2nd update)Aravir Rose
 
Swift - Krzysztof Skarupa
Swift -  Krzysztof SkarupaSwift -  Krzysztof Skarupa
Swift - Krzysztof SkarupaSunscrapers
 
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Mozaic Works
 
Introduction to programming - class 11
Introduction to programming - class 11Introduction to programming - class 11
Introduction to programming - class 11Paul Brebner
 
Gate level minimization (1st update)
Gate level minimization (1st update)Gate level minimization (1st update)
Gate level minimization (1st update)Aravir Rose
 
Parallel binary search
Parallel binary searchParallel binary search
Parallel binary search승혁 조
 
Elixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
Elixir - Tolerância a Falhas para Adultos - Secot VIII SorocabaElixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
Elixir - Tolerância a Falhas para Adultos - Secot VIII SorocabaFabio Akita
 
All I Needed for Functional Programming I Learned in High School Algebra
All I Needed for Functional Programming I Learned in High School AlgebraAll I Needed for Functional Programming I Learned in High School Algebra
All I Needed for Functional Programming I Learned in High School AlgebraEric Normand
 

Mais procurados (20)

Diving into byte code optimization in python
Diving into byte code optimization in python Diving into byte code optimization in python
Diving into byte code optimization in python
 
Syed Ubaid Ali Jafri - Cryptography Techniques
Syed Ubaid Ali Jafri - Cryptography TechniquesSyed Ubaid Ali Jafri - Cryptography Techniques
Syed Ubaid Ali Jafri - Cryptography Techniques
 
Playing 44CON CTF for fun and profit
Playing 44CON CTF for fun and profitPlaying 44CON CTF for fun and profit
Playing 44CON CTF for fun and profit
 
Langrange method for MATLAB Code
Langrange method for MATLAB CodeLangrange method for MATLAB Code
Langrange method for MATLAB Code
 
Python Tidbits
Python TidbitsPython Tidbits
Python Tidbits
 
Newton's method for MATLAB Code
Newton's method for MATLAB CodeNewton's method for MATLAB Code
Newton's method for MATLAB Code
 
Building HTML5 enabled web applications with Visual Studio 2011
Building HTML5 enabled web applications with Visual Studio 2011 Building HTML5 enabled web applications with Visual Studio 2011
Building HTML5 enabled web applications with Visual Studio 2011
 
Gate level minimization (2nd update)
Gate level minimization (2nd update)Gate level minimization (2nd update)
Gate level minimization (2nd update)
 
We Must Go Deeper
We Must Go DeeperWe Must Go Deeper
We Must Go Deeper
 
About Go
About GoAbout Go
About Go
 
Swift - Krzysztof Skarupa
Swift -  Krzysztof SkarupaSwift -  Krzysztof Skarupa
Swift - Krzysztof Skarupa
 
Ezmath
EzmathEzmath
Ezmath
 
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
 
Introduction to programming - class 11
Introduction to programming - class 11Introduction to programming - class 11
Introduction to programming - class 11
 
Gate level minimization (1st update)
Gate level minimization (1st update)Gate level minimization (1st update)
Gate level minimization (1st update)
 
Parallel binary search
Parallel binary searchParallel binary search
Parallel binary search
 
FFT
FFTFFT
FFT
 
Elixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
Elixir - Tolerância a Falhas para Adultos - Secot VIII SorocabaElixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
Elixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
 
Py3k
Py3kPy3k
Py3k
 
All I Needed for Functional Programming I Learned in High School Algebra
All I Needed for Functional Programming I Learned in High School AlgebraAll I Needed for Functional Programming I Learned in High School Algebra
All I Needed for Functional Programming I Learned in High School Algebra
 

Destaque

Digital Preservation 2013
Digital Preservation 2013Digital Preservation 2013
Digital Preservation 2013Mat Kelly
 
Browsing and Recomposition Policies to Minimize Temporal Error When Utilizing...
Browsing and Recomposition Policies to Minimize Temporal Error When Utilizing...Browsing and Recomposition Policies to Minimize Temporal Error When Utilizing...
Browsing and Recomposition Policies to Minimize Temporal Error When Utilizing...ScottAinsworth
 
Reading the Correct History? Modeling Temporal Intention in Resource Sharing
Reading the Correct History? Modeling Temporal Intention in Resource SharingReading the Correct History? Modeling Temporal Intention in Resource Sharing
Reading the Correct History? Modeling Temporal Intention in Resource Sharingheinestien
 
An Evaluation of Caching Policies for Memento TimeMaps
An Evaluation of Caching Policies for Memento TimeMapsAn Evaluation of Caching Policies for Memento TimeMaps
An Evaluation of Caching Policies for Memento TimeMapsJustin Brunelle
 
Evaluating Sliding and Sticky Target Policies by Measuring Temporal Drift in ...
Evaluating Sliding and Sticky Target Policies by Measuring Temporal Drift in ...Evaluating Sliding and Sticky Target Policies by Measuring Temporal Drift in ...
Evaluating Sliding and Sticky Target Policies by Measuring Temporal Drift in ...ScottAinsworth
 
Access Patterns for Robots and Humans in Web Archives
Access Patterns for Robots and Humans in Web ArchivesAccess Patterns for Robots and Humans in Web Archives
Access Patterns for Robots and Humans in Web ArchivesYasmin AlNoamany, PhD
 
Using Web Archives to Enrich the Live Web Experience Through Storytelling
Using Web Archives to Enrich  the Live Web Experience Through StorytellingUsing Web Archives to Enrich  the Live Web Experience Through Storytelling
Using Web Archives to Enrich the Live Web Experience Through StorytellingYasmin AlNoamany, PhD
 
Only One Out of Five Archived Web Pages Existed as Presented
Only One Out of Five Archived Web Pages Existed as Presented Only One Out of Five Archived Web Pages Existed as Presented
Only One Out of Five Archived Web Pages Existed as Presented ScottAinsworth
 

Destaque (8)

Digital Preservation 2013
Digital Preservation 2013Digital Preservation 2013
Digital Preservation 2013
 
Browsing and Recomposition Policies to Minimize Temporal Error When Utilizing...
Browsing and Recomposition Policies to Minimize Temporal Error When Utilizing...Browsing and Recomposition Policies to Minimize Temporal Error When Utilizing...
Browsing and Recomposition Policies to Minimize Temporal Error When Utilizing...
 
Reading the Correct History? Modeling Temporal Intention in Resource Sharing
Reading the Correct History? Modeling Temporal Intention in Resource SharingReading the Correct History? Modeling Temporal Intention in Resource Sharing
Reading the Correct History? Modeling Temporal Intention in Resource Sharing
 
An Evaluation of Caching Policies for Memento TimeMaps
An Evaluation of Caching Policies for Memento TimeMapsAn Evaluation of Caching Policies for Memento TimeMaps
An Evaluation of Caching Policies for Memento TimeMaps
 
Evaluating Sliding and Sticky Target Policies by Measuring Temporal Drift in ...
Evaluating Sliding and Sticky Target Policies by Measuring Temporal Drift in ...Evaluating Sliding and Sticky Target Policies by Measuring Temporal Drift in ...
Evaluating Sliding and Sticky Target Policies by Measuring Temporal Drift in ...
 
Access Patterns for Robots and Humans in Web Archives
Access Patterns for Robots and Humans in Web ArchivesAccess Patterns for Robots and Humans in Web Archives
Access Patterns for Robots and Humans in Web Archives
 
Using Web Archives to Enrich the Live Web Experience Through Storytelling
Using Web Archives to Enrich  the Live Web Experience Through StorytellingUsing Web Archives to Enrich  the Live Web Experience Through Storytelling
Using Web Archives to Enrich the Live Web Experience Through Storytelling
 
Only One Out of Five Archived Web Pages Existed as Presented
Only One Out of Five Archived Web Pages Existed as Presented Only One Out of Five Archived Web Pages Existed as Presented
Only One Out of Five Archived Web Pages Existed as Presented
 

Semelhante a ODU ACM Python & Memento Presentation

Automatic and Interpretable Machine Learning with H2O and LIME
Automatic and Interpretable Machine Learning with H2O and LIMEAutomatic and Interpretable Machine Learning with H2O and LIME
Automatic and Interpretable Machine Learning with H2O and LIMEJo-fai Chow
 
Python 표준 라이브러리
Python 표준 라이브러리Python 표준 라이브러리
Python 표준 라이브러리용 최
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.pptssuserd64918
 
Network Analysis with networkX : Real-World Example-1
Network Analysis with networkX : Real-World Example-1Network Analysis with networkX : Real-World Example-1
Network Analysis with networkX : Real-World Example-1Kyunghoon Kim
 
Numerical tour in the Python eco-system: Python, NumPy, scikit-learn
Numerical tour in the Python eco-system: Python, NumPy, scikit-learnNumerical tour in the Python eco-system: Python, NumPy, scikit-learn
Numerical tour in the Python eco-system: Python, NumPy, scikit-learnArnaud Joly
 
Once Upon a Process
Once Upon a ProcessOnce Upon a Process
Once Upon a ProcessDavid Evans
 
java 8 Hands on Workshop
java 8 Hands on Workshopjava 8 Hands on Workshop
java 8 Hands on WorkshopJeanne Boyarsky
 
RDataMining slides-r-programming
RDataMining slides-r-programmingRDataMining slides-r-programming
RDataMining slides-r-programmingYanchang Zhao
 
Rust "Hot or Not" at Sioux
Rust "Hot or Not" at SiouxRust "Hot or Not" at Sioux
Rust "Hot or Not" at Siouxnikomatsakis
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoMatt Stine
 
Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Pritam Samanta
 
A peek on numerical programming in perl and python e christopher dyken 2005
A peek on numerical programming in perl and python  e christopher dyken  2005A peek on numerical programming in perl and python  e christopher dyken  2005
A peek on numerical programming in perl and python e christopher dyken 2005Jules Krdenas
 
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014PyData
 
Python for Linux System Administration
Python for Linux System AdministrationPython for Linux System Administration
Python for Linux System Administrationvceder
 

Semelhante a ODU ACM Python & Memento Presentation (20)

Automatic and Interpretable Machine Learning with H2O and LIME
Automatic and Interpretable Machine Learning with H2O and LIMEAutomatic and Interpretable Machine Learning with H2O and LIME
Automatic and Interpretable Machine Learning with H2O and LIME
 
go.ppt
go.pptgo.ppt
go.ppt
 
Python 표준 라이브러리
Python 표준 라이브러리Python 표준 라이브러리
Python 표준 라이브러리
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.ppt
 
Writing Faster Python 3
Writing Faster Python 3Writing Faster Python 3
Writing Faster Python 3
 
Network Analysis with networkX : Real-World Example-1
Network Analysis with networkX : Real-World Example-1Network Analysis with networkX : Real-World Example-1
Network Analysis with networkX : Real-World Example-1
 
Python_intro.ppt
Python_intro.pptPython_intro.ppt
Python_intro.ppt
 
Numerical tour in the Python eco-system: Python, NumPy, scikit-learn
Numerical tour in the Python eco-system: Python, NumPy, scikit-learnNumerical tour in the Python eco-system: Python, NumPy, scikit-learn
Numerical tour in the Python eco-system: Python, NumPy, scikit-learn
 
Once Upon a Process
Once Upon a ProcessOnce Upon a Process
Once Upon a Process
 
java 8 Hands on Workshop
java 8 Hands on Workshopjava 8 Hands on Workshop
java 8 Hands on Workshop
 
Python Orientation
Python OrientationPython Orientation
Python Orientation
 
RDataMining slides-r-programming
RDataMining slides-r-programmingRDataMining slides-r-programming
RDataMining slides-r-programming
 
Rust "Hot or Not" at Sioux
Rust "Hot or Not" at SiouxRust "Hot or Not" at Sioux
Rust "Hot or Not" at Sioux
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 
Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game
 
A peek on numerical programming in perl and python e christopher dyken 2005
A peek on numerical programming in perl and python  e christopher dyken  2005A peek on numerical programming in perl and python  e christopher dyken  2005
A peek on numerical programming in perl and python e christopher dyken 2005
 
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
 
Python.pdf
Python.pdfPython.pdf
Python.pdf
 
Python for Linux System Administration
Python for Linux System AdministrationPython for Linux System Administration
Python for Linux System Administration
 
python.ppt
python.pptpython.ppt
python.ppt
 

Último

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Último (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

ODU ACM Python & Memento Presentation

  • 1. Python Scott G. Ainsworth for ODU ACM 22 Sept 2011
  • 2. What is Python?  Easy to learn  Simple syntax  Dynamic typing  High-level data structures  Free  Linux/Unix, OS X, Windows  MIT’s language of choice
  • 3. Why Python?  Fast development cycle  Interactive & edit, debug/run  vs. edit, compile, debug/run  Extensive standard and add-on libraries  (MIT’s language of choice)  Python, Jython, & IronPython  Google AppEngine
  • 4. Basic Syntax  Block structured  But no braces  Indent defines blocks def fib(n): a, b = 0, 1 while b < n: print b, a, b = b, a+b
  • 5. Numbers & Strings  Integers: -231 – 231-1  'value' == "value"  5 + 23  """multiple  Long: unlimited lines"""  1234567890123456789  u'unicode'  Boolean:  'substring'[2:5] == 'bst'  True or False 0 or 1  Real and Complex:  1.25 / 6.3  Complex(1.1,2.2)
  • 6. Sequence Types  Lists  primes = [ 2, 3, 5, 7, 11, 13, 17, 19, 23 ]  primes.append(27)  Primes[-2:] = [ 23, 27 ]  Tuples  primes = ( 2, 3, 5, 7, 11, 13, 17,19, 23 )  primes.append(27) # fails, tuples are immutable  primes[-2:] = ( 23, 27 )  Strings are an immutable list of single characters
  • 7. Dictionaries & Sets  Dictionaries  pdict = { "p1" : 2, "p2" : 3, "p3" : 5 }  pdict["p4"] = 7  pdict["p2"] == 3  Sets  primes = Set([ 2, 3, 5, 7, 11, 13, 17,19, 23 ])  primes.append(27) # fails, set are unordered  primes.add(27) # succeeds
  • 8. Classes Class complex: """implement complex numbers""" def __init__(self, r, i): self.__r = r self.__i = i def isreal(self): return self.c == 0 def __add__(self, c): return complex(self.r + c.r, self.i + c.i)
  • 9. Memento & Timemap for www.cs.odu.edu http://api.wayback.archive.org/memento/timemap/link/http://www.cs.odu.edu 1. <http://www.cs.odu.edu>; rel="original", 2. <http://api.wayback.archive.org/list/timemap/link/http://www.cs.odu.edu>; rel="timemap"; type="application/link-format”, 3. <http://api.wayback.archive.org/memento/19970102130137/http://cs.odu.edu/>; rel="first memento"; datetime="Thu, 02 Jan 1997 13:01:37 GMT”, 4. <http://api.wayback.archive.org/memento/19970606105039/http://www.cs.odu.edu/ >; rel="memento"; datetime="Fri, 06 Jun 1997 10:50:39 GMT", Output from timemap.py test 1. Original: http://www.cs.odu.edu 2. Time Map: http://api.wayback.archive.org/list/timemap/link/http://www.cs.odu.edu 3. First Memento: (datetime.datetime(1997, 1, 2, 13, 1, 37, tzinfo=tzutc()), 'http://api.wayback.archive.o rg/memento/19970102130137/http://cs.odu.edu/') 4. 1997-06-06 10:50:39+00:00 = http://api.wayback.archive.org/memento/19970606105039/http://www.cs.odu.edu/
  • 10. timemap.py Output Original: http://www.cs.odu.edu Time Bundle: http://api.wayback.archive.org/list/timebundle/ http://www.cs.odu.edu Time Gate: http://api.wayback.archive.org/list/timegate/ http://www.cs.odu.edu Time Map: http://api.wayback.archive.org/list/timemap/link/ http://www.cs.odu.edu First Memento: 1997-01-02 13:01:37+00:00 Last Memento: 2011-07-20 01:58:31+00:00 Mementos: 1997-06-06 10:50:39+00:00 = http://api.wayback.archive.org/memento/ 19970606105039/http://www.cs.odu.edu/ 1997-10-10 20:16:32+00:00 = http://api.wayback.archive.org/memento/ 19971010201632/http://www.cs.odu.edu/
  • 11. Code Walk Through  class TimeMap: Memento timemap container class  class TimeMapTokenizer: Helper class to tokenize a link-style timemap  __main__: Used for quick unit testing Download the code: http://www.cs.odu.edu/~sainswor/uploads/Downloads/timemap.py
  • 12. Summary  Easy to learn  Fast development cycle  Dynamic typing  Extensive standard and add-on libraries  High-level data structures  Widely-supported  Free  Linux/Unix, OS X, Windows
  • 14. Links  Slides: http://www.cs.odu.edu/~sainswor/uploads/Downloads/ACM-Python.py  Code: http://www.cs.odu.edu/~sainswor/uploads/Downloads/timemap.py  Python: http://www.python.org  Python Docs: http://docs.python.org  Python Libraries: http://pypi.python.org

Notas do Editor

  1. Relationship to other languages
  2. Quick introduction to the syntax
  3. Lists, tuples, dictionaries, &amp; strings
  4. Lists, tuples, dictionaries, &amp; strings
  5. Relationship to other languages