Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pythonica
1. Potter x Voldemort:
Lições Ofidiglotas da Prática
Pythonica
Rodrigo Senra - rsenra@acm.org
PythonBrasil[6] - Curitiba - PR
1
2. Anatomia do Blá
• Eu, Vocês e Python
• Potter x Voldemort: o porquê !
• Hack Maligno: Depurador Omnisciente
• 1 palavra dos patrocinadores
2
3. • Engenheiro de Computação
Graduação-MSc-(PhD quase acabando) IC-Unicamp
• Desenvolvedor e Projetista de Software
na HI Tecnologia (desde 2008)
(no mercado desde 1996 )
• Entusiasta deem 1997)
(primeiro contato
Python
3
3
4. Cenas dos últimos capítulos...
[1] 2005 - BigKahuna
[2] 2006 - Show Pyrotécnico
Iteradores, Geradores,Hooks,Decoradores
[3] 2007 - Show Pyrotécnico II
Routing, RTSP, Twisted, GIS
[4] 2008 - ISIS-NBP
Bibliotecas Digitais
[5] 2009 - Rest, Gtw e Compiladores
SFC(Rede Petri) + ST(Pascal) > Ladder
4
6. Python: 1001 utilidades
Interface IPTABLES (Python > Linux Kernel)
Alta-disponibilidade para Clusters Linux
Servidor de Streaming (RTSP)
Sintetizador de Voz (CPqD’s TextoFala, MRCP)
Monitoramento Remoto (Zenoss before Zenoss)
Gerador de tráfego - TCP/UDP
Automação de Força de Vendas
Rastreamento de pornografia em Intranet
Bibliotecas Digitais
Sistemas de Cadastros Governamentais
Gerenciamento de Riscos (Com JS)
5
7. Python: 1001 utilidades
Interface IPTABLES (Python > Linux Kernel)
Alta-disponibilidade para Clusters Linux
Servidor de Streaming (RTSP)
Sintetizador de Voz (CPqD’s TextoFala, MRCP)
Monitoramento Remoto (Zenoss before Zenoss)
Gerador de tráfego - TCP/UDP
Automação de Força de Vendas
Rastreamento de pornografia em Intranet
Bibliotecas Digitais
Sistemas de Cadastros Governamentais
Gerenciamento de Riscos (Com JS)
6
10. Quem está aí ?
✓Profissionais de
Informática
✓Desenvolvedores
7
11. Quem está aí ?
✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
7
12. Quem está aí ?
✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
✓Professores
7
13. Quem está aí ?
✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
✓Professores
✓1ª vez na PyConBrasil
7
14. Quem está aí ?
✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
✓Professores
✓1ª vez na PyConBrasil
✓Membros APyBr
7
15. Quem está aí ?
✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
✓Professores
✓1ª vez na PyConBrasil
✓Membros APyBr
• Nenhuma resposta acima!
7
21. Java
import java.io.*;
import java.util.*;
import java.text.*;
public class sumcol {
public static void main(String[] args) {
int count = 0;
String line;
try {
BufferedReader in = new BufferedReader(
new InputStreamReader(System.in));
while ((line = in.readLine()) != null) {
count = count + Integer.parseInt(line);
}
} catch (IOException e) { }
System.out.println(Integer.toString(count));
11
22. Java
C#
importSystem;
using java.io.*;
importApp {
class java.util.*;
import static int Main(String[] args) {
public java.text.*;
public class sumcol {
int count = 0;
public static void main(String[] args) {
for (String line = Console.In.ReadLine();
int count != 0;
line = null;
String line; Console.In.ReadLine())
line =
try {count += System.Convert.ToInt32(line); }
{
BufferedReader in = new BufferedReader(
Console.WriteLine(count.ToString());
return(0); new InputStreamReader(System.in));
} while ((line = in.readLine()) != null) {
count = count + Integer.parseInt(line);
}
} catch (IOException e) { }
System.out.println(Integer.toString(count));
11
23. Python
Java
C#
importSystem;
import java.io.*;
using sys
importApp {
class java.util.*;
count = 0
import1:
public java.text.*;
while static int Main(String[] args) {
public class sumcol {
line = count = 0;
int sys.stdin.readline().strip()
public static void main(String[] args) {
for (String line = Console.In.ReadLine();
if not line:
int count != 0;
break line = null;
count += line; Console.In.ReadLine())
String int(line)
line =
print try {count += System.Convert.ToInt32(line); }
{
count
BufferedReader in = new BufferedReader(
Console.WriteLine(count.ToString());
return(0); new InputStreamReader(System.in));
} while ((line = in.readLine()) != null) {
count = count + Integer.parseInt(line);
}
} catch (IOException e) { }
System.out.println(Integer.toString(count));
11
24. Python
Java
C#
importSystem;
import java.io.*;
using sys
importApp { itertools
count java.util.*;
class sys,
import= 0
import1:
public java.text.*;
while static int Main(String[] args) {
print sum(itertools.imap(int, sys.stdin))
public class sumcol {
line = count = 0;
int sys.stdin.readline().strip()
public static void main(String[] args) {
for (String line = Console.In.ReadLine();
if not line:
int count != 0;
break line = null;
count += line; Console.In.ReadLine())
String int(line)
line =
print try {count += System.Convert.ToInt32(line); }
{
count
BufferedReader in = new BufferedReader(
Console.WriteLine(count.ToString());
return(0); new InputStreamReader(System.in));
} while ((line = in.readLine()) != null) {
count = count + Integer.parseInt(line);
}
} catch (IOException e) { }
System.out.println(Integer.toString(count));
11
27. 40 50 60 70 80 90 2000
Plankalkü Fortran COBOL Pascal Ada Javascript D
LISP SIMULA C C++ Python C#
BASIC Smalltalk Perl Java Go
LOGO Prolog SQL PHP
ITS UNIX LISA BeOS Mac OSX
OS360 CP/M Macintosh Linux Linux
MULTICS VMS UNIX Solaris
MS-DOS OpenBSD Windows
ME
Windows Windows
2000
1.0-2.0 2.0 - 98
Ethernet XP
RS-232 OS/2 Vista
TCP/IP MINIX
ARPANET PONG 7
AIX
Circuito Virt.Mem HPUX
Micro-
Integrado Interrupções processador SCO
GNU WWW
Transistor Harddisk Mouse Floppy
RISC ISA
13
32. Omniscient Debugger
“... describes the concept that debuggers should
know everything about the run of a program,
that they should remember every state change,
and be able to present to you the value of
any variable at any point in time.
Essentially, omniscient debugging means
that you can go backwards in time.”
Bil Lewis
In 1969, Bob Balzer implemented a version of
omniscient debugging for Fortran that ran on
2006-01-11
a mainframe and had a TTY interface http://video.google.com/videoplay?docid=3897010229726822034#
(see “EXDAMS—Extendible Debugging and Monitoring
System,” ACM Spring Joint Computer Conference, 1969)
17
41. Obrigado a todos
pela atenção.
Rodrigo Dias Arruda Senra
http://rodrigo.senra.nom.br
rsenra@acm.org
As opiniões e conclusões expressas nesta apresentação são de exclusiva responsabilidade de Rodrigo Senra.
Não é necessário requisitar permissão do autor para o uso de partes ou do todo desta apresentação, desde que
não sejam feitas alterações no conteúdo reutilizado e que esta nota esteja presente na íntegra no material
resultante.
Imagens e referências para outros trabalhos nesta apresentação permanecem propriedade daqueles que detêm
seus direitos de copyright.
24