SlideShare a Scribd company logo
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

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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 to 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 to 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
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...Product School
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...Sri Ambati
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...Product School
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 

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

Editor's Notes

  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