SlideShare a Scribd company logo
1 of 87
Download to read offline
Aprendendo a
Aprender
Fabio Akita @akitaonrails
http://u.akita.ws/montesclaros
?
+Fácil
+Elegante
Ciência da
Computação
Charles Babbage (1791-1871)
John von Neumann (1903 – 1957)
Alan Mathison Turing (1912 – 1954)
“The Imitation Game" (2014 - Benedict Cumberbatch)
people = 20	
count = 0	
people.times do |person_a|	
people.times do |person_b|	
count += 1 if person_b > person_a	
end	
end	
puts count # => 190
people = 20	
count = 0	
people.times do |person_a|	
people.times do |person_b|	
count += 1 if person_b > person_a	
end	
end	
puts count # => 190
people = 20	
count = 0	
people.times do |person_a|	
people.times do |person_b|	
count += 1 if person_b > person_a	
end	
end	
puts count # => 190
people = 20	
puts (people * (people - 1) / 2) # => 190
require 'benchmark'	
people = 10_000	
Benchmark.bm do |x|	
x.report do	
count = 0	
people.times do |person_a|	
people.times do |person_b|	
count += 1 if person_b > person_a	
end	
end	
puts count	
end	
x.report do	
puts (people * (people - 1) / 2)	
end	
end
require 'benchmark'	
people = 10_000	
Benchmark.bm do |x|	
x.report do	
count = 0	
people.times do |person_a|	
people.times do |person_b|	
count += 1 if person_b > person_a	
end	
end	
puts count	
end	
x.report do	
puts (people * (people - 1) / 2)	
end	
end
require 'benchmark'	
people = 10_000	
Benchmark.bm do |x|	
x.report do	
count = 0	
people.times do |person_a|	
people.times do |person_b|	
count += 1 if person_b > person_a	
end	
end	
puts count	
end	
x.report do	
puts (people * (people - 1) / 2)	
end	
end
require 'benchmark'	
people = 10_000	
Benchmark.bm do |x|	
x.report do	
count = 0	
people.times do |person_a|	
people.times do |person_b|	
count += 1 if person_b > person_a	
end	
end	
puts count	
end	
x.report do	
puts (people * (people - 1) / 2)	
end	
end
user system total real	
190	
0.000000 0.000000 0.000000 ( 0.000043)	
190	
0.000000 0.000000 0.000000 ( 0.000008)
user system total real	
190	
0.000000 0.000000 0.000000 ( 0.000043)	
190	
0.000000 0.000000 0.000000 ( 0.000008)
user system total real	
190	
0.000000 0.000000 0.000000 ( 0.000043)	
190	
0.000000 0.000000 0.000000 ( 0.000008)
user system total real	
49995000	
6.310000 0.000000 6.310000 ( 6.354882)	
49995000	
0.000000 0.000000 0.000000 ( 0.000011)
user system total real	
49995000	
6.310000 0.000000 6.310000 ( 6.354882)	
49995000	
0.000000 0.000000 0.000000 ( 0.000011)
user system total real	
49995000	
6.310000 0.000000 6.310000 ( 6.354882)	
49995000	
0.000000 0.000000 0.000000 ( 0.000011)
“The Social Network" (2010)
http://u.akita.ws/naousesqllike
“I made up the term
‘object-oriented’,
and I can tell you
I didn’t have
C++ in mind”
- Alan Kay
soma = 1 + 2
soma = 1 + 2
soma = 1.+(2)
soma = 1 + 2
soma = 1.+(2)
soma = 1.send(:+, 2)
Ole-Johan Dahl e Kristen Nygaard
require 'prime'	
gerador_de_primos = Fiber.new do	
numero = 1	
loop do	
Fiber.yield(numero) if numero.prime?	
numero += 1	
end	
end
require 'prime'	
gerador_de_primos = Fiber.new do	
numero = 1	
loop do	
Fiber.yield(numero) if numero.prime?	
numero += 1	
end	
end	
gerador_de_primos.resume
=> 2
require 'prime'	
gerador_de_primos = Fiber.new do	
numero = 1	
loop do	
Fiber.yield(numero) if numero.prime?	
numero += 1	
end	
end	
gerador_de_primos.resume
=> 2
gerador_de_primos.resume
=> 3
require 'prime'	
gerador_de_primos = Fiber.new do	
numero = 1	
loop do	
Fiber.yield(numero) if numero.prime?	
numero += 1	
end	
end	
gerador_de_primos.resume
=> 2
gerador_de_primos.resume
=> 3
gerador_de_primos.resume
=> 5
Gordon Moore - Intel co-founder
Gordon Bell - DEC early employee
Vaticano 2005
Vaticano 2013
Vaticano 2005
Vaticano 2013
Douglas Engelbart - 1925 a 2/Jul/2013
Douglas Engelbart - 1925 a 2/Jul/2013
Pablo Picasso
Bons artistas Copiam
Grandes artistas Roubam
Ciência da
Computação
OBRIGADO!
slideshare.net/akitaonrails
codeminer42.com
@akitaonrails

More Related Content

More from Fabio Akita

More from Fabio Akita (20)

Devconf 2019 - São Carlos
Devconf 2019 - São CarlosDevconf 2019 - São Carlos
Devconf 2019 - São Carlos
 
Meetup Nerdzão - English Talk about Languages
Meetup Nerdzão  - English Talk about LanguagesMeetup Nerdzão  - English Talk about Languages
Meetup Nerdzão - English Talk about Languages
 
Desmistificando Blockchains p/ Developers - Criciuma Dev Conf 2018
Desmistificando Blockchains p/ Developers - Criciuma Dev Conf 2018Desmistificando Blockchains p/ Developers - Criciuma Dev Conf 2018
Desmistificando Blockchains p/ Developers - Criciuma Dev Conf 2018
 
Desmistificando Blockchains - 20o Encontro Locaweb SP
Desmistificando Blockchains - 20o Encontro Locaweb SPDesmistificando Blockchains - 20o Encontro Locaweb SP
Desmistificando Blockchains - 20o Encontro Locaweb SP
 
Desmistificando Blockchains - Insiter Goiania
Desmistificando Blockchains - Insiter GoianiaDesmistificando Blockchains - Insiter Goiania
Desmistificando Blockchains - Insiter Goiania
 
Blockchain em 7 minutos - 7Masters
Blockchain em 7 minutos - 7MastersBlockchain em 7 minutos - 7Masters
Blockchain em 7 minutos - 7Masters
 
Elixir -Tolerância a Falhas para Adultos - GDG Campinas
Elixir  -Tolerância a Falhas para Adultos - GDG CampinasElixir  -Tolerância a Falhas para Adultos - GDG Campinas
Elixir -Tolerância a Falhas para Adultos - GDG Campinas
 
Desmistificando Mitos de Tech Startups - Intercon 2017
Desmistificando Mitos de Tech Startups - Intercon 2017Desmistificando Mitos de Tech Startups - Intercon 2017
Desmistificando Mitos de Tech Startups - Intercon 2017
 
30 Days to Elixir and Crystal and Back to Ruby
30 Days to Elixir and Crystal and Back to Ruby30 Days to Elixir and Crystal and Back to Ruby
30 Days to Elixir and Crystal and Back to Ruby
 
Uma Discussão sobre a Carreira de TI
Uma Discussão sobre a Carreira de TIUma Discussão sobre a Carreira de TI
Uma Discussão sobre a Carreira de TI
 
THE CONF - Opening Keynote
THE CONF - Opening KeynoteTHE CONF - Opening Keynote
THE CONF - Opening Keynote
 
A Journey through New Languages - Rancho Dev 2017
A Journey through New Languages - Rancho Dev 2017A Journey through New Languages - Rancho Dev 2017
A Journey through New Languages - Rancho Dev 2017
 
Desmistificando Mitos de Startups - Sebrae - AP
Desmistificando Mitos de Startups - Sebrae - APDesmistificando Mitos de Startups - Sebrae - AP
Desmistificando Mitos de Startups - Sebrae - AP
 
A Journey through New Languages - Guru Sorocaba 2017
A Journey through New Languages - Guru Sorocaba 2017A Journey through New Languages - Guru Sorocaba 2017
A Journey through New Languages - Guru Sorocaba 2017
 
A Journey through New Languages - Insiter 2017
A Journey through New Languages - Insiter 2017A Journey through New Languages - Insiter 2017
A Journey through New Languages - Insiter 2017
 
A Journey through New Languages - Locaweb Tech Day
A Journey through New Languages - Locaweb Tech DayA Journey through New Languages - Locaweb Tech Day
A Journey through New Languages - Locaweb Tech Day
 
A Journey through new Languages - Intercon 2016
A Journey through new Languages - Intercon 2016A Journey through new Languages - Intercon 2016
A Journey through new Languages - Intercon 2016
 
Premature Optimization 2.0 - Intercon 2016
Premature Optimization 2.0 - Intercon 2016Premature Optimization 2.0 - Intercon 2016
Premature Optimization 2.0 - Intercon 2016
 
Conexão Kinghost - Otimização Prematura
Conexão Kinghost - Otimização PrematuraConexão Kinghost - Otimização Prematura
Conexão Kinghost - Otimização Prematura
 
The Open Commerce Conference - Premature Optimisation: The Root of All Evil
The Open Commerce Conference - Premature Optimisation: The Root of All EvilThe Open Commerce Conference - Premature Optimisation: The Root of All Evil
The Open Commerce Conference - Premature Optimisation: The Root of All Evil
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Aprendendo a Aprender - Alagoas Dev Day