python no appengine - encontros gtug-sp

51
Encontros SP-GTUG 2010

Upload: fernando-masanori

Post on 22-May-2015

2.384 views

Category:

Technology


1 download

DESCRIPTION

Python é uma linguagem considerada frugal, simples, sem ser simplória! Entenda como construir algoritmos ninjas com essa linguagem, adotada pela Google e pelo MIT. Veremos muito, muito código, desde algoritmos clássicos até tutoriais do Google App Engine. A palestra é baseada nos seguintes livros: Learning Python, 4th ed, Head First Programming e Programming Google App Engine. Utilizo estes livros nas disciplinas que ministro na FATEC e vou levá-los para quem quiser dar uma olhada. Por coincidência todos foram lançados em novembro do ano passado! Ministrada por: Fernando Masanori (http://www.google.com/profiles/fmasanori)

TRANSCRIPT

Page 1: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 2: Python no Appengine - Encontros GTUG-SP

Algoritmos em PythonFernando Masanori <[email protected]> 27 março 2010

EncontrosSP-GTUG2010

Page 3: Python no Appengine - Encontros GTUG-SP

• Apresentação

• Motivação para o GTUG

• Algoritmos clássicos (Python 3.1)

– Código

– E mais código

• Google App Engine (Python 2.5)

– Código

– E mais código

• Referências

EncontrosSP-GTUG2010

Page 4: Python no Appengine - Encontros GTUG-SP

Apresentação

...................................................................................................

EncontrosSP-GTUG2010

Page 5: Python no Appengine - Encontros GTUG-SP

• Graduação Computação IME-USP

• Mestrado Computação ITA

• ed e lint Unix Cobra

• Credicard Mastercard

• PriceWaterhouseCoopers

• Professor FATEC SJC

• Business Intelligence with Pentaho

• Google Technology User

• E o público? Professores? Estudantes?

• Desenvolvedores: C, Java, Python? EncontrosSP-GTUG2010

Page 6: Python no Appengine - Encontros GTUG-SP

Motivação para o GTUG

...................................................................................................

EncontrosSP-GTUG2010

Page 7: Python no Appengine - Encontros GTUG-SP

”Python tem sido uma parte importante do Google desde o início, e permanece assim conforme o sistema cresce e evolui. Hoje, dezenas de engenheiros do Google usam Python, e estamos procurando por mais

pessoas com conhecimento nessa linguagem.“

Peter Norvig, diretor de qualidade de busca do Google Inc.

EncontrosSP-GTUG2010

Page 8: Python no Appengine - Encontros GTUG-SP

“[…] our general philosophy there is "Python where we can, C++ where we must". Alex Martelli, Líder Técnico, Sistemas de Produção, Google Inc.

EncontrosSP-GTUG2010

Page 9: Python no Appengine - Encontros GTUG-SP

"Python is fast enough for our site and allows us to produce maintainable features in record times, with a minimum of developers,“

Cuong Do, Software Architect, YouTube.com

EncontrosSP-GTUG2010

Page 10: Python no Appengine - Encontros GTUG-SP

Algoritmos Clássicos (Python 3.1)

...................................................................................................

EncontrosSP-GTUG2010

Page 11: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Algorithm March with Ninjas

Page 12: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

“A good algorithm is like a sharp knife: it does what it is supposed to do with a minimum amount of applied effort.”

T. Cormen, C. Leiserson, R. Rivest, C. Stein, Introduction to Algorithms

Page 13: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

“A Computação anda sobre três pernas: a correção, a eficiência e a elegância.”

I. Simon

Page 14: Python no Appengine - Encontros GTUG-SP

Jogo da Forca

...................................................................................................

EncontrosSP-GTUG2010

Page 15: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 16: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 17: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 18: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 19: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 20: Python no Appengine - Encontros GTUG-SP

Urllib.request e API do Twitter

...................................................................................................

EncontrosSP-GTUG2010

Bateria inclusa

Page 21: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 22: Python no Appengine - Encontros GTUG-SP

Banco de Dados

...................................................................................................

EncontrosSP-GTUG2010

Bateria inclusa

Page 23: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

“Programming is best regarded as the process of creatingworks of literature, which are meant to be read.”

D.E. Knuth, Literate Programming

Page 24: Python no Appengine - Encontros GTUG-SP

Pygame.mixer

...................................................................................................

EncontrosSP-GTUG2010

Obs.: necessita instalação Pygame

Page 25: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 26: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 27: Python no Appengine - Encontros GTUG-SP

Google App Engine (Python 2.5)

...................................................................................................

EncontrosSP-GTUG2010

Page 28: Python no Appengine - Encontros GTUG-SP

Hello World

...................................................................................................

EncontrosSP-GTUG2010

Page 29: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 30: Python no Appengine - Encontros GTUG-SP

• app.yaml para gtug-sp.appspot.com

EncontrosSP-GTUG2010

Page 31: Python no Appengine - Encontros GTUG-SP

Clock1

...................................................................................................

EncontrosSP-GTUG2010

Page 32: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 33: Python no Appengine - Encontros GTUG-SP

Clock2 handler wsgi

...................................................................................................

EncontrosSP-GTUG2010

Page 34: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 35: Python no Appengine - Encontros GTUG-SP

Clock3 users

...................................................................................................

EncontrosSP-GTUG2010

Page 36: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 37: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 38: Python no Appengine - Encontros GTUG-SP

Clock4 user timezone (2º handler)

...................................................................................................

EncontrosSP-GTUG2010

Page 39: Python no Appengine - Encontros GTUG-SP

• app.yaml com

EncontrosSP-GTUG2010

Page 40: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 41: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 42: Python no Appengine - Encontros GTUG-SP

• models.py

EncontrosSP-GTUG2010

Page 43: Python no Appengine - Encontros GTUG-SP

• prefs.py

EncontrosSP-GTUG2010

Page 44: Python no Appengine - Encontros GTUG-SP

Clock5 memcache

...................................................................................................

EncontrosSP-GTUG2010

Page 45: Python no Appengine - Encontros GTUG-SP

• models.py

EncontrosSP-GTUG2010

Page 46: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Page 47: Python no Appengine - Encontros GTUG-SP

Referências (execute o código dos links!!)

...................................................................................................

EncontrosSP-GTUG2010

Page 48: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Código fonte em:http://www.headfirstlabs.com/books/hfprog/

Page 49: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Código fonte em:http://www.rmi.net/~lutz/lp4e-examples.html

Page 50: Python no Appengine - Encontros GTUG-SP

EncontrosSP-GTUG2010

Código fonte em:http://ae-book.appspot.com/downloads/

Page 51: Python no Appengine - Encontros GTUG-SP

Agradecimentos

www.globalcode.com.br

EncontrosSP-GTUG2010