Potter x Voldemort: Lições Ofidiglotas da Prática Pythonica Rodrigo Senra - [email protected] PythonBrasil[6] - Curitiba - PR 1
Dec 14, 2014
Potter x Voldemort:Lições Ofidiglotas da Prática
Pythonica
Rodrigo Senra - [email protected][6] - Curitiba - PR
1
•Eu, Vocês e Python
•Potter x Voldemort: o porquê !
•Hack Maligno: Depurador Omnisciente
•1 palavra dos patrocinadores
Anatomia do Blá
2
Apenas um rapaz latino americano...
• Desenvolvedor e Projetista de Softwarena HI Tecnologia (desde 2008)
(no mercado desde 1996 )
• Engenheiro de Computação Graduação-MSc-(PhD quase acabando) IC-Unicamp
• Entusiasta de Python(primeiro contato em 1997)
3
3
Cenas dos últimos capítulos...
[1] 2005 - BigKahuna
[2] 2006 - Show PyrotécnicoIteradores, Geradores,Hooks,Decoradores
[3] 2007 - Show Pyrotécnico IIRouting, RTSP, Twisted, GIS
[4] 2008 - ISIS-NBP Bibliotecas Digitais
[5] 2009 - Rest, Gtw e CompiladoresSFC(Rede Petri) + ST(Pascal) > Ladder
4
Python: 1001 utilidades
5
Interface IPTABLES (Python > Linux Kernel)
Servidor de Streaming (RTSP)
Sintetizador de Voz (CPqD’s TextoFala, MRCP)
Alta-disponibilidade para Clusters Linux
Gerador de tráfego - TCP/UDP
Gerenciamento de Riscos (Com JS)
Monitoramento Remoto (Zenoss before Zenoss)
Automação de Força de Vendas
Bibliotecas DigitaisSistemas de Cadastros Governamentais
Rastreamento de pornografia em Intranet
Python: 1001 utilidades
5
Interface IPTABLES (Python > Linux Kernel)
Servidor de Streaming (RTSP)Sintetizador de Voz (CPqD’s TextoFala, MRCP)
Alta-disponibilidade para Clusters Linux
Gerador de tráfego - TCP/UDP
Gerenciamento de Riscos (Com JS)
Monitoramento Remoto (Zenoss before Zenoss)
Automação de Força de Vendas
Bibliotecas DigitaisSistemas de Cadastros Governamentais
Rastreamento de pornografia em Intranet
Python: 1001 utilidades
6
Quem está aí ?
7
Quem está aí ?✓Profissionais de
Informática
7
Quem está aí ?✓Profissionais de
Informática
✓Desenvolvedores
7
Quem está aí ?✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
7
Quem está aí ?✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
✓Professores
7
Quem está aí ?✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
✓Professores
✓1ª vez na PyConBrasil
7
Quem está aí ?✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
✓Professores
✓1ª vez na PyConBrasil
✓Membros APyBr
7
Quem está aí ?✓Profissionais de
Informática
✓Desenvolvedores
✓Estudantes
✓Professores
✓1ª vez na PyConBrasil
✓Membros APyBr
• Nenhuma resposta acima!
7
O porquê do título !
8
Duelo de linguagens
9
Duelo de linguagens
9
Duelo de linguagens
10
11
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));
Java
11
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));
Javausing System;class App {public static int Main(String[] args) { int count = 0; for (String line = Console.In.ReadLine(); line != null; line = Console.In.ReadLine()) { count += System.Convert.ToInt32(line); } Console.WriteLine(count.ToString()); return(0); }
C#
11
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));
Javausing System;class App {public static int Main(String[] args) { int count = 0; for (String line = Console.In.ReadLine(); line != null; line = Console.In.ReadLine()) { count += System.Convert.ToInt32(line); } Console.WriteLine(count.ToString()); return(0); }
C#import syscount = 0while 1: line = sys.stdin.readline().strip() if not line: break count += int(line)print count
Python
11
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));
Javausing System;class App {public static int Main(String[] args) { int count = 0; for (String line = Console.In.ReadLine(); line != null; line = Console.In.ReadLine()) { count += System.Convert.ToInt32(line); } Console.WriteLine(count.ToString()); return(0); }
C#import syscount = 0while 1: line = sys.stdin.readline().strip() if not line: break count += int(line)print count
Pythonimport sys, itertoolsprint sum(itertools.imap(int, sys.stdin))
Python
11
Truth lies on statistics!
12
13
2000
DC#
Mac OSXLinux
WindowsME
2000XP
Vista7
40
Plankalkü
Transistor
50
FortranLISP
Harddisk
CircuitoIntegrado
60
COBOLSIMULABASICLOGO
ITSOS360
MULTICS
Mouse
InterrupçõesVirt.MemARPANET
RS-232
70
PascalC
SmalltalkProlog
UNIXCP/MVMS
Floppy
Micro-processador
PONGTCP/IP
Ethernet
80
AdaC++PerlSQL
LISAMacintosh
UNIXMS-DOSWindows
1.0-2.0OS/2
MINIXAIX
HPUXSCOGNURISC
90
JavascriptPython
JavaPHP
BeOSLinuxSolaris
Windows2.0 - 98
OpenBSD
ISAWWW
Go
13
x86 Ubuntu™ Intel® Q6600® one core - http://shootout.alioth.debian.org/
15
Hack MalignoDepurador Omnisciente
16
Omniscient Debugger
Bil Lewis
2006-01-11http://video.google.com/videoplay?docid=3897010229726822034#
“... describes the concept that debuggers shouldknow 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.”
In 1969, Bob Balzer implemented a version of omniscient debugging for Fortran that ran on a mainframe and had a TTY interface(see “EXDAMS—Extendible Debugging and MonitoringSystem,” ACM Spring Joint Computer Conference, 1969)
17
18
Quem assistiu (ontem)a palestra
MetaPython Reciclado do JS ?
Vamos ter que usar aquela fábrica
de metaclasses ?
19
Hora da Demo
Dá tempo de vero Python em ação ?
É possível ?Seria pedir muito ?
20
Uma palavra dos patrocinadores...
21
Uma palavra dos patrocinadores...
21
Perguntas ?Comentários ?
22
Até crianças
podem lidar com Python!
23
Até crianças
podem lidar com Python!
23
Obrigado a todos pela atenção.
Rodrigo Dias Arruda Senrahttp://rodrigo.senra.nom.br
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