SlideShare una empresa de Scribd logo
1 de 28
groningen.py / 16-01-2012
Schedule


• Input for Python meetups
• From Java to Python
Meetups
• groningen.py (thanks Mark)
• Talk and learn about Python development
• Community
• Regular meetings
What do we need?

• A time, space & some drinks
• Subjects / Format
• You!
• Please invite and suggest
How do you use python?

 • For how long?
 • Web
   development?
 • As main language?
 • Framework?
Contents
• Any subject you’d like to hear about?
• Any subject you’d like to talk about?



     python 3.0     web services

 django 1.4           data migration

        performance tuning
Meeting schedule


• How often?
• What day of week / time?
Let’s start



From Java to Python
Ivor Bosloper

                          using Geodjango


Preferred general purpose language:
     Basic/
   Assembler          C            Java       Python

  1985         1995         2001            2010
Java2py
Disclaimer: I love Java/JVM
 • Typesafe/checked references
 • Garbage collection
 • Object Oriented
 • Huge API
 • General purpose
 • Security, i18n
 • Great debugging (e.g. with stacktraces)
Java2py
Why Python? Productivity!


 • Readability
 • Pragmatic and language possibilities
 • Development cycle
Readability matters
Readability


public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
}
Readability
            @Entity
            public class Farm {
              @Id @GeneratedValue
              private Long id;

                private String name;

                @ManyToOne(optional=true)
                private Address address;

                public Long getId() {
                  return this.id;
                }

                public void setId(Long id) {
                  this.id = id;
                }

                public String getName() {
                  return this.name;
                }



DRY
                public void setName(String name) {
                  this.name = name;
                }

                public Address getAddress() {
                  return this.address;
                }

                public void setAddress(Address address) {
                  this.address = address;
                }

                public String toString() {
                  return this.name;
                }
            }
Readability
Readability




No .properties, .xml, sql (/hql)
Readability

XML Theory:
human readable

XML Practice:
Readability of a binary
combined with the
efficiency of flat text.
Flexibility
• XML or .properties configuration allows only
  programmed logic


• settings.py allows custom logic
Readability
Pragmatic APIs
• APIs created for use, not for possibilities

   DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
   DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
   Document doc = docBuilder.parse(new File("file.xml"));

   XpathFactory xpf = XPathFactory.newInstance();
   XPath xpath = xpf.newXPath();
   NodeSet books = (NodeSet) xpath.evaluate("/Books/Book",doc,XpathConstants.NODESET);
Pragmatic APIs
• APIs created for use, not for possibilities


     InputStream imageInputStream = FileInputStream("c.jpg");

     SeekableStream seekableImageStream = SeekableStream.wrapInputStream(imageInputStream, true);
     RenderedOp originalImage = JAI.create(JAI_STREAM_ACTION, seekableImageStream);
     ((OpImage) originalImage.getRendering()).setTileCache(null);
     int origImageWidth = originalImage.getWidth();
     double scale = 220.0 / originalImage.getWidth();

     ParameterBlock paramBlock = new ParameterBlock();
     paramBlock.addSource(originalImage); // The source image
     paramBlock.add(scale); // The xScale
     paramBlock.add(scale); // The yScale
     paramBlock.add(0.0); // The x translation
     paramBlock.add(0.0); // The y translation

     RenderingHints qualityHints = new RenderingHints(RenderingHints.KEY_RENDERING,
     RenderingHints.VALUE_RENDER_QUALITY);
     RenderedOp resizedImage = JAI.create(JAI_SUBSAMPLE_AVERAGE_ACTION, paramBlock, qualityHints);

     // lastly, write the newly-resized image to an output stream, in a specific encoding
     FileOutputStream encoderOutputStream = new FileOutputStream("c-thumb.jpg");
     JAI.create(JAI_ENCODE_ACTION, resizedImage, encoderOutputStream, JAI_ENCODE_FORMAT_JPEG, null);
Development cycle
• Getting started (Django)
Development cycle
Edit            Save       Edit            Save



       Reload page     Reload page           Compile
   (2 seconds)

                       Restart              Package
                                             (war)

                                  Deploy
                             (20 seconds)
Missing from py?

• Concurrency (!)
• Learn again: Performance tuning
• Safety of jvm


• (Adoption of big companies)
Concurrency?
         • The free lunch
           is over (2005)
         • Azul 768-core
           machine (2007)
         • Python GIL in
           2011?
Performance tuning

• Profiling
• GC options
• Memory
Safety of native code
Organizational adoption


• Commercial vendors
• Developer/deployer roles

Más contenido relacionado

La actualidad más candente

Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017Romain Dorgueil
 
Python在豆瓣的应用
Python在豆瓣的应用Python在豆瓣的应用
Python在豆瓣的应用Qiangning Hong
 
Developing High Performance Application with Aerospike & Go
Developing High Performance Application with Aerospike & GoDeveloping High Performance Application with Aerospike & Go
Developing High Performance Application with Aerospike & GoChris Stivers
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinKai Koenig
 
GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)Gagan Agrawal
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy PluginsPaul King
 
The Ring programming language version 1.8 book - Part 18 of 202
The Ring programming language version 1.8 book - Part 18 of 202The Ring programming language version 1.8 book - Part 18 of 202
The Ring programming language version 1.8 book - Part 18 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 20 of 210
The Ring programming language version 1.9 book - Part 20 of 210The Ring programming language version 1.9 book - Part 20 of 210
The Ring programming language version 1.9 book - Part 20 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 14 of 184
The Ring programming language version 1.5.3 book - Part 14 of 184The Ring programming language version 1.5.3 book - Part 14 of 184
The Ring programming language version 1.5.3 book - Part 14 of 184Mahmoud Samir Fayed
 
Intro to Python
Intro to PythonIntro to Python
Intro to Pythonpetrov
 
Multiprocessing with python
Multiprocessing with pythonMultiprocessing with python
Multiprocessing with pythonPatrick Vergain
 
Groovy DSLs (JavaOne Presentation)
Groovy DSLs (JavaOne Presentation)Groovy DSLs (JavaOne Presentation)
Groovy DSLs (JavaOne Presentation)Jim Driscoll
 
EuroPython 2015 - Big Data with Python and Hadoop
EuroPython 2015 - Big Data with Python and HadoopEuroPython 2015 - Big Data with Python and Hadoop
EuroPython 2015 - Big Data with Python and HadoopMax Tepkeev
 
Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartGabriele Lana
 
Application-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageApplication-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageESUG
 

La actualidad más candente (20)

Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
 
Stetl-engine-nlextract-smartem
Stetl-engine-nlextract-smartemStetl-engine-nlextract-smartem
Stetl-engine-nlextract-smartem
 
Python在豆瓣的应用
Python在豆瓣的应用Python在豆瓣的应用
Python在豆瓣的应用
 
Developing High Performance Application with Aerospike & Go
Developing High Performance Application with Aerospike & GoDeveloping High Performance Application with Aerospike & Go
Developing High Performance Application with Aerospike & Go
 
Ontopia tutorial
Ontopia tutorialOntopia tutorial
Ontopia tutorial
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with Kotlin
 
GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy Plugins
 
The Ring programming language version 1.8 book - Part 18 of 202
The Ring programming language version 1.8 book - Part 18 of 202The Ring programming language version 1.8 book - Part 18 of 202
The Ring programming language version 1.8 book - Part 18 of 202
 
The Ring programming language version 1.9 book - Part 20 of 210
The Ring programming language version 1.9 book - Part 20 of 210The Ring programming language version 1.9 book - Part 20 of 210
The Ring programming language version 1.9 book - Part 20 of 210
 
The Ring programming language version 1.5.3 book - Part 14 of 184
The Ring programming language version 1.5.3 book - Part 14 of 184The Ring programming language version 1.5.3 book - Part 14 of 184
The Ring programming language version 1.5.3 book - Part 14 of 184
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Multiprocessing with python
Multiprocessing with pythonMultiprocessing with python
Multiprocessing with python
 
C# Is The Future
C# Is The FutureC# Is The Future
C# Is The Future
 
Groovy DSLs (JavaOne Presentation)
Groovy DSLs (JavaOne Presentation)Groovy DSLs (JavaOne Presentation)
Groovy DSLs (JavaOne Presentation)
 
EuroPython 2015 - Big Data with Python and Hadoop
EuroPython 2015 - Big Data with Python and HadoopEuroPython 2015 - Big Data with Python and Hadoop
EuroPython 2015 - Big Data with Python and Hadoop
 
Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing Part
 
Down the Rabbit Hole
Down the Rabbit HoleDown the Rabbit Hole
Down the Rabbit Hole
 
Application-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageApplication-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta Language
 

Destacado

Python mu Java mı?
Python mu Java mı?Python mu Java mı?
Python mu Java mı?aerkanc
 
Python Ireland Feb '11 Talks: Introduction to Python
Python Ireland Feb '11 Talks: Introduction to PythonPython Ireland Feb '11 Talks: Introduction to Python
Python Ireland Feb '11 Talks: Introduction to PythonPython Ireland
 
Features formed by a river
Features formed by a riverFeatures formed by a river
Features formed by a riverZawadiShihemi
 
Flooding 7 River Tees Case Study
Flooding 7 River Tees Case StudyFlooding 7 River Tees Case Study
Flooding 7 River Tees Case Studytudorgeog
 
River processes and landforms
River processes and landformsRiver processes and landforms
River processes and landformsjacksonthree
 
The Geography of Rivers
The Geography of RiversThe Geography of Rivers
The Geography of RiversNoel Hogan
 
River Changes And Landforms
River Changes And LandformsRiver Changes And Landforms
River Changes And Landformswhiskeyhj
 

Destacado (9)

Python mu Java mı?
Python mu Java mı?Python mu Java mı?
Python mu Java mı?
 
Python Ireland Feb '11 Talks: Introduction to Python
Python Ireland Feb '11 Talks: Introduction to PythonPython Ireland Feb '11 Talks: Introduction to Python
Python Ireland Feb '11 Talks: Introduction to Python
 
Features formed by a river
Features formed by a riverFeatures formed by a river
Features formed by a river
 
Flooding 7 River Tees Case Study
Flooding 7 River Tees Case StudyFlooding 7 River Tees Case Study
Flooding 7 River Tees Case Study
 
River processes and landforms
River processes and landformsRiver processes and landforms
River processes and landforms
 
The Geography of Rivers
The Geography of RiversThe Geography of Rivers
The Geography of Rivers
 
Rivers
RiversRivers
Rivers
 
Force & Motion
Force & MotionForce & Motion
Force & Motion
 
River Changes And Landforms
River Changes And LandformsRiver Changes And Landforms
River Changes And Landforms
 

Similar a From Java to Python

"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James NelsonGWTcon
 
Having Fun with Kotlin Android - DILo Surabaya
Having Fun with Kotlin Android - DILo SurabayaHaving Fun with Kotlin Android - DILo Surabaya
Having Fun with Kotlin Android - DILo SurabayaDILo Surabaya
 
Kotlin for all the Things
Kotlin for all the ThingsKotlin for all the Things
Kotlin for all the ThingsEamonn Boyle
 
Why is Java relevant? New features of Java8
Why is Java relevant? New features of Java8 Why is Java relevant? New features of Java8
Why is Java relevant? New features of Java8 xshyamx
 
Gg Code Mash2009 20090106
Gg Code Mash2009 20090106Gg Code Mash2009 20090106
Gg Code Mash2009 20090106Jim Shingler
 
HashiCorp Vault Plugin Infrastructure
HashiCorp Vault Plugin InfrastructureHashiCorp Vault Plugin Infrastructure
HashiCorp Vault Plugin InfrastructureNicolas Corrarello
 
Useful Python Libraries for Network Engineers - PyOhio 2018
Useful Python Libraries for Network Engineers - PyOhio 2018Useful Python Libraries for Network Engineers - PyOhio 2018
Useful Python Libraries for Network Engineers - PyOhio 2018Hank Preston
 
Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)Joachim Baumann
 
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInScalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInVitaly Gordon
 
Ceylon - the language and its tools
Ceylon - the language and its toolsCeylon - the language and its tools
Ceylon - the language and its toolsMax Andersen
 
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...Theo Jungeblut
 
Building High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 FirestarterBuilding High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 FirestarterMithun T. Dhar
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introductionBirol Efe
 

Similar a From Java to Python (20)

"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
 
Having Fun with Kotlin Android - DILo Surabaya
Having Fun with Kotlin Android - DILo SurabayaHaving Fun with Kotlin Android - DILo Surabaya
Having Fun with Kotlin Android - DILo Surabaya
 
Kotlin for all the Things
Kotlin for all the ThingsKotlin for all the Things
Kotlin for all the Things
 
Why is Java relevant? New features of Java8
Why is Java relevant? New features of Java8 Why is Java relevant? New features of Java8
Why is Java relevant? New features of Java8
 
Gg Code Mash2009 20090106
Gg Code Mash2009 20090106Gg Code Mash2009 20090106
Gg Code Mash2009 20090106
 
HashiCorp Vault Plugin Infrastructure
HashiCorp Vault Plugin InfrastructureHashiCorp Vault Plugin Infrastructure
HashiCorp Vault Plugin Infrastructure
 
Gwt.create
Gwt.createGwt.create
Gwt.create
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Dynamic C#
Dynamic C# Dynamic C#
Dynamic C#
 
Useful Python Libraries for Network Engineers - PyOhio 2018
Useful Python Libraries for Network Engineers - PyOhio 2018Useful Python Libraries for Network Engineers - PyOhio 2018
Useful Python Libraries for Network Engineers - PyOhio 2018
 
What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?
 
S313937 cdi dochez
S313937 cdi dochezS313937 cdi dochez
S313937 cdi dochez
 
Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)
 
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInScalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedIn
 
Ceylon - the language and its tools
Ceylon - the language and its toolsCeylon - the language and its tools
Ceylon - the language and its tools
 
Gcrc talk
Gcrc talkGcrc talk
Gcrc talk
 
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 
Building High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 FirestarterBuilding High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 Firestarter
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introduction
 

Último

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Último (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

From Java to Python

  • 2. Schedule • Input for Python meetups • From Java to Python
  • 3. Meetups • groningen.py (thanks Mark) • Talk and learn about Python development • Community • Regular meetings
  • 4. What do we need? • A time, space & some drinks • Subjects / Format • You! • Please invite and suggest
  • 5. How do you use python? • For how long? • Web development? • As main language? • Framework?
  • 6. Contents • Any subject you’d like to hear about? • Any subject you’d like to talk about? python 3.0 web services django 1.4 data migration performance tuning
  • 7. Meeting schedule • How often? • What day of week / time?
  • 9. Ivor Bosloper using Geodjango Preferred general purpose language: Basic/ Assembler C Java Python 1985 1995 2001 2010
  • 10. Java2py Disclaimer: I love Java/JVM • Typesafe/checked references • Garbage collection • Object Oriented • Huge API • General purpose • Security, i18n • Great debugging (e.g. with stacktraces)
  • 11. Java2py Why Python? Productivity! • Readability • Pragmatic and language possibilities • Development cycle
  • 13. Readability public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); } }
  • 14. Readability @Entity public class Farm { @Id @GeneratedValue private Long id; private String name; @ManyToOne(optional=true) private Address address; public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } public String getName() { return this.name; } DRY public void setName(String name) { this.name = name; } public Address getAddress() { return this.address; } public void setAddress(Address address) { this.address = address; } public String toString() { return this.name; } }
  • 17. Readability XML Theory: human readable XML Practice: Readability of a binary combined with the efficiency of flat text.
  • 18. Flexibility • XML or .properties configuration allows only programmed logic • settings.py allows custom logic
  • 20. Pragmatic APIs • APIs created for use, not for possibilities DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); Document doc = docBuilder.parse(new File("file.xml")); XpathFactory xpf = XPathFactory.newInstance(); XPath xpath = xpf.newXPath(); NodeSet books = (NodeSet) xpath.evaluate("/Books/Book",doc,XpathConstants.NODESET);
  • 21. Pragmatic APIs • APIs created for use, not for possibilities InputStream imageInputStream = FileInputStream("c.jpg"); SeekableStream seekableImageStream = SeekableStream.wrapInputStream(imageInputStream, true); RenderedOp originalImage = JAI.create(JAI_STREAM_ACTION, seekableImageStream); ((OpImage) originalImage.getRendering()).setTileCache(null); int origImageWidth = originalImage.getWidth(); double scale = 220.0 / originalImage.getWidth(); ParameterBlock paramBlock = new ParameterBlock(); paramBlock.addSource(originalImage); // The source image paramBlock.add(scale); // The xScale paramBlock.add(scale); // The yScale paramBlock.add(0.0); // The x translation paramBlock.add(0.0); // The y translation RenderingHints qualityHints = new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); RenderedOp resizedImage = JAI.create(JAI_SUBSAMPLE_AVERAGE_ACTION, paramBlock, qualityHints); // lastly, write the newly-resized image to an output stream, in a specific encoding FileOutputStream encoderOutputStream = new FileOutputStream("c-thumb.jpg"); JAI.create(JAI_ENCODE_ACTION, resizedImage, encoderOutputStream, JAI_ENCODE_FORMAT_JPEG, null);
  • 22. Development cycle • Getting started (Django)
  • 23. Development cycle Edit Save Edit Save Reload page Reload page Compile (2 seconds) Restart Package (war) Deploy (20 seconds)
  • 24. Missing from py? • Concurrency (!) • Learn again: Performance tuning • Safety of jvm • (Adoption of big companies)
  • 25. Concurrency? • The free lunch is over (2005) • Azul 768-core machine (2007) • Python GIL in 2011?
  • 26. Performance tuning • Profiling • GC options • Memory
  • 28. Organizational adoption • Commercial vendors • Developer/deployer roles

Notas del editor

  1. groningen.py
  2. I would like to talk about two things : the idea of organizing python meetings : Do the kick-off presentation myself
  3. Would like to call it groningen.py (after groningen.rb) The purpose is to talk and learn about python usage
  4. Let me know if you have ideas on any of the above.
  5. Quick scan: how do you use python We don’t need definitive answers
  6. I prefer to hear from experience, over tutorial style talks
  7. My name is Ivor Bosloper A few months ago I started a company called Crop-R. We’re building a product for farmers and developing it in GeoDjango. We all use a load of languages, but if you’d ask me: what’s your preferred general purpose language I’d come up with this answer. Only very recently I switched from Java to Python.
  8. I would still consider Java for many projects. (reference, gc, oo, API, general purpose). This all holds for Python as well…
  9. I wanted to make this talk experience driven, so not a theoretic comparison. Let me know at the end if I succeeded. Still love Java but prefer python
  10. Developers spend 80% of their time reading code.
  11. Hello world starts showing it. But I don’t like theoretic examples, so let’s take some example code from a project
  12. Repetitiveness. Verbosity.
  13. Powerful language: you don’t need configuration languages
  14. Inefficient. Unreadable.
  15. And worse: you have to think of everything in advance! It’s not a programming language (executes some logic). E.g. servlet-mapping has strict rules. You can not do random pattern matching!
  16. The language has some nice constructs to make your code really concise. Declarative programming. Callbacks.
  17. I want to be able to plugin a new XML Implementation.
  18. What I miss (or don’t know): please Concurrency ( One big global lock )
  19. I didn’t understand why no of the datastructutes (like dict) had concurrent behaviour documented. In Java, most datastructures have this part documented. Only after reading a bit I discovered there is no concurrency… ?! In CPython at least.
  20. Java only crashes (in practice) on native code. That is: non-managed code. Java libraries