SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
Úvod do programování aneb Do nitra stroje
PŘEDNÁŠKA   3                   Karel Minařík
1   Opakování




                Úvod do programování
? Najít pánev
      Fatal Error

   ? Najít olej
Do!lyNalít olej do pánve
   1. vejce
   2. Zapálit plyn
   ? Čím zapálit plyn
               Cancel   OK


   3. Vzít vejce
   4. Rozklepnout vejce o okraj pánve




                             Úvod do programování Přednáška 3
JEDNODUCHÝ ALGORITMUS
Nalezení největšího čísla
z neuspořádaného seznamu čísel


1. Předpokládejme, že první číslo v seznamu je největší.

2. Podívejme se na postupně na každé zbývající číslo v seznamu. Pokud je
větší než dosud největší číslo, zapišme si je.

3. Jakmile jsme prošli všechna čísla, je poslední zapsané číslo největším
číslem v  seznamu.




                                                           Úvod do programování Přednáška 3
Počítač nedělá to, co chceme, aby dělal.
Počítač dělá přesně to, co mu řekneme, aby dělal.




                                       Úvod do programování Přednáška 3
History of Programming Languages
  1954                         1960                                                1965                                               1970                           1975             1980             1985                 1990                 1995             2000   2001                          2002                                             2003                                               2004




                                                                                                                                                              1986      1990   1990   1991   1991   1993      1994   1995          1996   1996      1997   1997   2000      2001                        2001                                    2003                                     2003                                    2004
                  For more than half of the fifty years computer programmers have been    This timeline includes fifty of the more than 2500 documented
                  writing code, O’Reilly has provided developers with comprehensive,      programming languages. It is based on an original diagram created


www.oreilly.com
                  in-depth technical information. We’ve kept pace with rapidly changing   by Éric Lévénez (www.levenez.com), augmented with suggestions
                  technologies as new languages have emerged, developed, and              from O’Reilly authors, friends, and conference attendees.
                  matured. Whether you want to learn something new or need
                                                                                          For information and discussion on this poster,
                  answers to tough technical questions, you’ll find what you need
                                                                                          go to www.oreilly.com/go/languageposter.
                  in O’Reilly books and on the O’Reilly Network.
                                                                                                                                                                                                                                                                                   ©2004 O’Reilly Media, Inc. O’Reilly logo is a registered trademark of O’Reilly Media, Inc. All other trademarks are property of their respective owners. part#30417
Programovatelnost
  Programmability




                    Úvod do programování Přednáška 3
˚
„GENERACE“ PROGRAMOVACÍCH JAZYKU
První generace
Strojový kód: 0 a 1. První počítače: přepínače, nikoliv text. Absolutní výkon.
Závislý na hardware.
Příklad: 10110000 01100001

Druhá generace
Assembler (assembly language). Závislý na hardware.
Příklad: mov al, 61h

Třetí generace
Čitelný a snadno zapsatelný lidmi. Většina moderních jazyků.
Příklad: let b = c + 2 * d

Čtvrtá generace
Reportovací nástroje, SQL (structured query language), domain-specific languages.
Navržené pro konkrétní účel.
Příklad: SELECT * FROM employees WHERE ORDER BY surname


Pátá generace
Synonymum pro vizuální programování nebo označení vývoje pomocí definic
omezení, stroj sám má zkonstruovat algoritmus. Akademické použití.

                                                                        Úvod do programování Přednáška 3
PŘÍSTUPY K PROGRAMOVÁNÍ (PARADIGMATA)
Procedurální programování
Bud´synonymum pro imperativní programování — prostá posloupnost kroků
(„recept“). Nebo označení pro programování stylem volání procedur (rutina,
sub-rutina, funkce). Modularita.
Zejména: PHP, Perl

Objektově orientované programování
Objekty, jejich vlastnosti a vztahy (Malý pes štěká na chlapce). Dědičnost,
modularita, polymorfismus, zapouzdření.
Zejména: Java, Ruby

Funkční programování
Nepopisuje kroky algoritmu, ale matematické vztahy.
Zejména: Lisp, Erlang

Vizuální programování
Vytváření instrukcí a posloupností vizuálně, pomocí grafických reprezentací,
nikoliv textem.
Zejména: Max/MSP, Apple Automator




                                                                         Úvod do programování Přednáška 3
Perl, 1987
Skriptovací jazyk, práce s textem, knihovny (CPAN), duct-tape of the internet

Java, 1995
Objektový, nezávislý na platformě (Write once, run anywhere). Java <applet>
běží v internetových prohlížečích.

PHP, 1995
Dynamické webové stránky —  snadná integrace, zprovoznění. Masivní rozšíření
— tzv. LAMP.




                                                                    Úvod do programování Přednáška 3
Úvod do programování Přednáška 3
— Yukihiro Matsumoto (Matz)
Přednáška Ruby Design Principles
http://itc.conversationsnetwork.org/shows/detail1638.html

                                                            Úvod do programování Přednáška 3
„Věřím, že – alespoň do jisté míry – je smyslem života být šťastný.
Na základě tohoto přesvědčení je Ruby navrženo tak, že je
nejenom snadné, ale i zábavné v něm programovat. Ruby vám
umožňuje soustředit se na kreativní stránku programování,
a nepřidělává vám další starosti.“
~ Yukihiro Matsumoto, předmluva k prvnímu vydání knihy Programming Ruby




                                                                   Úvod do programování Přednáška 3
2   Ruby — Instalace




                       Úvod do programování
www.ruby-doc.org/docs/ProgrammingRuby
VYBAVENÍ




1. Ruby :)

2. Konzole pro přímé zadání kódu

3. Editor

4. Dokumentace (!)




                                   Úvod do programování Přednáška 3
3   Základní typy a operace




                              Úvod do programování
ZÁKLADNÍ TYPY A OPERACE




1. Čísla

2. Texty (řetězce)

3. Pole

4. Aritmetické operace
5. Komentáře
6. Smyčky

7. Podmínky

8. Proměnné




                          Úvod do programování Přednáška 3
puts 1 + 1


→2

puts quot;1quot; + quot;1quot;


→ quot;11quot;


číslovka   ×   písmeno

puts (1 + 1).class
puts (quot;1quot; + quot;1quot;).class




Datové typy

                         Úvod do programování Přednáška 3
puts 1 + 1

puts quot;1quot; + quot;1quot;

puts 2 + 2 * 5

puts (2 + 2) * 5

puts quot;Ahojquot; + quot;Sároquot;

puts quot;Ahojquot; + quot; quot; + quot;Sároquot;

   puts quot;Ahojquot; + 2     (číslo není řetězec)


# puts quot;Ahojquot; + 2      (Tento příkaz nebude Ruby provádět)


puts quot;Nebudu ve škole zlobitnquot; * 10


Aritmetické operace

                                                             Úvod do programování Přednáška 3
200.times do
  puts quot;Nebudu ve škole zlobit. quot;
end

1.upto 200 do |i|
  print quot;#{i}. Nebudu ve škole zlobit. quot;
end
print quot;n-----nquot;




               … aneb co dělají počítače nejraději




                                                 Úvod do programování Přednáška 3
… to be continued!

       

Mais conteúdo relacionado

Destaque

Cdi primaria lengua 2011
Cdi primaria lengua 2011Cdi primaria lengua 2011
Cdi primaria lengua 2011mrafaelmartin
 
V47 Ch2 Dev Marketing Strategies Lesley Yu
V47 Ch2 Dev Marketing Strategies Lesley YuV47 Ch2 Dev Marketing Strategies Lesley Yu
V47 Ch2 Dev Marketing Strategies Lesley Yulesleyyu
 
Culpepper scrap capabilities_December 2016
Culpepper scrap capabilities_December 2016Culpepper scrap capabilities_December 2016
Culpepper scrap capabilities_December 2016Terri Plaut
 
Apuntes unidad 1 y 2
Apuntes     unidad 1 y 2Apuntes     unidad 1 y 2
Apuntes unidad 1 y 2decmiel
 
Mejoramos el Polideportivo de Ciudad Jardín
Mejoramos el Polideportivo de Ciudad JardínMejoramos el Polideportivo de Ciudad Jardín
Mejoramos el Polideportivo de Ciudad JardínMarivi Perez
 
BSide 2016 Information-Driven Product Design
BSide 2016 Information-Driven Product DesignBSide 2016 Information-Driven Product Design
BSide 2016 Information-Driven Product DesignNikon Rasumov
 
Fabrican adeudos y presionan para depositar los pagos en cuentas poco transpa...
Fabrican adeudos y presionan para depositar los pagos en cuentas poco transpa...Fabrican adeudos y presionan para depositar los pagos en cuentas poco transpa...
Fabrican adeudos y presionan para depositar los pagos en cuentas poco transpa...Juan Cruz Vega
 
Maravillas del mundo moderno
Maravillas del mundo modernoMaravillas del mundo moderno
Maravillas del mundo modernoreyler10
 
Employee of the year msh 3.12.2016
Employee of the year   msh 3.12.2016Employee of the year   msh 3.12.2016
Employee of the year msh 3.12.2016Nawaz Hussain
 
Google docs
Google docsGoogle docs
Google docsfausto10
 

Destaque (15)

Cdi primaria lengua 2011
Cdi primaria lengua 2011Cdi primaria lengua 2011
Cdi primaria lengua 2011
 
V47 Ch2 Dev Marketing Strategies Lesley Yu
V47 Ch2 Dev Marketing Strategies Lesley YuV47 Ch2 Dev Marketing Strategies Lesley Yu
V47 Ch2 Dev Marketing Strategies Lesley Yu
 
Culpepper scrap capabilities_December 2016
Culpepper scrap capabilities_December 2016Culpepper scrap capabilities_December 2016
Culpepper scrap capabilities_December 2016
 
Apuntes unidad 1 y 2
Apuntes     unidad 1 y 2Apuntes     unidad 1 y 2
Apuntes unidad 1 y 2
 
Mejoramos el Polideportivo de Ciudad Jardín
Mejoramos el Polideportivo de Ciudad JardínMejoramos el Polideportivo de Ciudad Jardín
Mejoramos el Polideportivo de Ciudad Jardín
 
1bgu b 3p-sanchez kenet
1bgu b 3p-sanchez kenet1bgu b 3p-sanchez kenet
1bgu b 3p-sanchez kenet
 
BSide 2016 Information-Driven Product Design
BSide 2016 Information-Driven Product DesignBSide 2016 Information-Driven Product Design
BSide 2016 Information-Driven Product Design
 
Cdi matematicas06
Cdi matematicas06Cdi matematicas06
Cdi matematicas06
 
Receta paella
Receta paellaReceta paella
Receta paella
 
Fabrican adeudos y presionan para depositar los pagos en cuentas poco transpa...
Fabrican adeudos y presionan para depositar los pagos en cuentas poco transpa...Fabrican adeudos y presionan para depositar los pagos en cuentas poco transpa...
Fabrican adeudos y presionan para depositar los pagos en cuentas poco transpa...
 
Maravillas del mundo moderno
Maravillas del mundo modernoMaravillas del mundo moderno
Maravillas del mundo moderno
 
Raúl Fuentes (2)
Raúl Fuentes (2)Raúl Fuentes (2)
Raúl Fuentes (2)
 
Employee of the year msh 3.12.2016
Employee of the year   msh 3.12.2016Employee of the year   msh 3.12.2016
Employee of the year msh 3.12.2016
 
Práctica 1 del Tema 1
Práctica 1 del Tema 1Práctica 1 del Tema 1
Práctica 1 del Tema 1
 
Google docs
Google docsGoogle docs
Google docs
 

Semelhante a Úvod do programování 3 (to be continued)

Ti1220 Lecture 1: Programming Linguistics
Ti1220 Lecture 1: Programming LinguisticsTi1220 Lecture 1: Programming Linguistics
Ti1220 Lecture 1: Programming LinguisticsEelco Visser
 
Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Prof. Wim Van Criekinge
 
Jay Phillips's Presentation at eComm 2009
Jay Phillips's Presentation at eComm 2009Jay Phillips's Presentation at eComm 2009
Jay Phillips's Presentation at eComm 2009eCommConf
 
Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016Robert 'Bob' Reyes
 
COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE Pavan Kalyan
 
Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)Jan Wedekind
 
All we like sheep: Cloning as an Engineering Tool
All we like sheep: Cloning as an Engineering ToolAll we like sheep: Cloning as an Engineering Tool
All we like sheep: Cloning as an Engineering Toolmigod
 
Úvod do programování 7
Úvod do programování 7Úvod do programování 7
Úvod do programování 7Karel Minarik
 
Speech Recognition Technology
Speech Recognition TechnologySpeech Recognition Technology
Speech Recognition TechnologyAamir-sheriff
 
Perl University: Getting Started with Perl
Perl University: Getting Started with PerlPerl University: Getting Started with Perl
Perl University: Getting Started with Perlbrian d foy
 
Php Symfony and software-life-cycle
Php Symfony and software-life-cyclePhp Symfony and software-life-cycle
Php Symfony and software-life-cycleSwatantra Kumar
 
EricEvans_StrategicDesign.ppt
EricEvans_StrategicDesign.pptEricEvans_StrategicDesign.ppt
EricEvans_StrategicDesign.pptNisha819927
 

Semelhante a Úvod do programování 3 (to be continued) (20)

Ti1220 Lecture 1: Programming Linguistics
Ti1220 Lecture 1: Programming LinguisticsTi1220 Lecture 1: Programming Linguistics
Ti1220 Lecture 1: Programming Linguistics
 
Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013
 
Jay Phillips's Presentation at eComm 2009
Jay Phillips's Presentation at eComm 2009Jay Phillips's Presentation at eComm 2009
Jay Phillips's Presentation at eComm 2009
 
perl lauange
perl lauangeperl lauange
perl lauange
 
Pearl
PearlPearl
Pearl
 
Perl 101
Perl 101Perl 101
Perl 101
 
Amoocon May 2009 Germany
Amoocon May 2009   GermanyAmoocon May 2009   Germany
Amoocon May 2009 Germany
 
Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016
 
COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE
 
Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)
 
Logic Programming and ILP
Logic Programming and ILPLogic Programming and ILP
Logic Programming and ILP
 
All we like sheep: Cloning as an Engineering Tool
All we like sheep: Cloning as an Engineering ToolAll we like sheep: Cloning as an Engineering Tool
All we like sheep: Cloning as an Engineering Tool
 
Úvod do programování 7
Úvod do programování 7Úvod do programování 7
Úvod do programování 7
 
Speech Recognition Technology
Speech Recognition TechnologySpeech Recognition Technology
Speech Recognition Technology
 
Perl University: Getting Started with Perl
Perl University: Getting Started with PerlPerl University: Getting Started with Perl
Perl University: Getting Started with Perl
 
December06Bulletin
December06BulletinDecember06Bulletin
December06Bulletin
 
December06Bulletin
December06BulletinDecember06Bulletin
December06Bulletin
 
Php Symfony and software-life-cycle
Php Symfony and software-life-cyclePhp Symfony and software-life-cycle
Php Symfony and software-life-cycle
 
ForLoops.pptx
ForLoops.pptxForLoops.pptx
ForLoops.pptx
 
EricEvans_StrategicDesign.ppt
EricEvans_StrategicDesign.pptEricEvans_StrategicDesign.ppt
EricEvans_StrategicDesign.ppt
 

Mais de Karel Minarik

Vizualizace dat a D3.js [EUROPEN 2014]
Vizualizace dat a D3.js [EUROPEN 2014]Vizualizace dat a D3.js [EUROPEN 2014]
Vizualizace dat a D3.js [EUROPEN 2014]Karel Minarik
 
Elasticsearch (Rubyshift 2013)
Elasticsearch (Rubyshift 2013)Elasticsearch (Rubyshift 2013)
Elasticsearch (Rubyshift 2013)Karel Minarik
 
Elasticsearch in 15 Minutes
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 MinutesKarel Minarik
 
Realtime Analytics With Elasticsearch [New Media Inspiration 2013]
Realtime Analytics With Elasticsearch [New Media Inspiration 2013]Realtime Analytics With Elasticsearch [New Media Inspiration 2013]
Realtime Analytics With Elasticsearch [New Media Inspiration 2013]Karel Minarik
 
Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]Karel Minarik
 
Shell's Kitchen: Infrastructure As Code (Webexpo 2012)
Shell's Kitchen: Infrastructure As Code (Webexpo 2012)Shell's Kitchen: Infrastructure As Code (Webexpo 2012)
Shell's Kitchen: Infrastructure As Code (Webexpo 2012)Karel Minarik
 
Elastic Search: Beyond Ordinary Fulltext Search (Webexpo 2011 Prague)
Elastic Search: Beyond Ordinary Fulltext Search (Webexpo 2011 Prague)Elastic Search: Beyond Ordinary Fulltext Search (Webexpo 2011 Prague)
Elastic Search: Beyond Ordinary Fulltext Search (Webexpo 2011 Prague)Karel Minarik
 
Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Karel Minarik
 
Redis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational DatabasesRedis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational DatabasesKarel Minarik
 
CouchDB – A Database for the Web
CouchDB – A Database for the WebCouchDB – A Database for the Web
CouchDB – A Database for the WebKarel Minarik
 
Spoiling The Youth With Ruby (Euruko 2010)
Spoiling The Youth With Ruby (Euruko 2010)Spoiling The Youth With Ruby (Euruko 2010)
Spoiling The Youth With Ruby (Euruko 2010)Karel Minarik
 
Verzovani kodu s Gitem (Karel Minarik)
Verzovani kodu s Gitem (Karel Minarik)Verzovani kodu s Gitem (Karel Minarik)
Verzovani kodu s Gitem (Karel Minarik)Karel Minarik
 
Představení Ruby on Rails [Junior Internet]
Představení Ruby on Rails [Junior Internet]Představení Ruby on Rails [Junior Internet]
Představení Ruby on Rails [Junior Internet]Karel Minarik
 
Efektivni vyvoj webovych aplikaci v Ruby on Rails (Webexpo)
Efektivni vyvoj webovych aplikaci v Ruby on Rails (Webexpo)Efektivni vyvoj webovych aplikaci v Ruby on Rails (Webexpo)
Efektivni vyvoj webovych aplikaci v Ruby on Rails (Webexpo)Karel Minarik
 
Úvod do Ruby on Rails
Úvod do Ruby on RailsÚvod do Ruby on Rails
Úvod do Ruby on RailsKarel Minarik
 
Úvod do programování 6
Úvod do programování 6Úvod do programování 6
Úvod do programování 6Karel Minarik
 
Úvod do programování 5
Úvod do programování 5Úvod do programování 5
Úvod do programování 5Karel Minarik
 
Úvod do programování 4
Úvod do programování 4Úvod do programování 4
Úvod do programování 4Karel Minarik
 
Úvod do programování aneb Do nitra stroje
Úvod do programování aneb Do nitra strojeÚvod do programování aneb Do nitra stroje
Úvod do programování aneb Do nitra strojeKarel Minarik
 
Interaktivita, originalita a návrhové vzory
Interaktivita, originalita a návrhové vzoryInteraktivita, originalita a návrhové vzory
Interaktivita, originalita a návrhové vzoryKarel Minarik
 

Mais de Karel Minarik (20)

Vizualizace dat a D3.js [EUROPEN 2014]
Vizualizace dat a D3.js [EUROPEN 2014]Vizualizace dat a D3.js [EUROPEN 2014]
Vizualizace dat a D3.js [EUROPEN 2014]
 
Elasticsearch (Rubyshift 2013)
Elasticsearch (Rubyshift 2013)Elasticsearch (Rubyshift 2013)
Elasticsearch (Rubyshift 2013)
 
Elasticsearch in 15 Minutes
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 Minutes
 
Realtime Analytics With Elasticsearch [New Media Inspiration 2013]
Realtime Analytics With Elasticsearch [New Media Inspiration 2013]Realtime Analytics With Elasticsearch [New Media Inspiration 2013]
Realtime Analytics With Elasticsearch [New Media Inspiration 2013]
 
Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]
 
Shell's Kitchen: Infrastructure As Code (Webexpo 2012)
Shell's Kitchen: Infrastructure As Code (Webexpo 2012)Shell's Kitchen: Infrastructure As Code (Webexpo 2012)
Shell's Kitchen: Infrastructure As Code (Webexpo 2012)
 
Elastic Search: Beyond Ordinary Fulltext Search (Webexpo 2011 Prague)
Elastic Search: Beyond Ordinary Fulltext Search (Webexpo 2011 Prague)Elastic Search: Beyond Ordinary Fulltext Search (Webexpo 2011 Prague)
Elastic Search: Beyond Ordinary Fulltext Search (Webexpo 2011 Prague)
 
Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)
 
Redis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational DatabasesRedis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational Databases
 
CouchDB – A Database for the Web
CouchDB – A Database for the WebCouchDB – A Database for the Web
CouchDB – A Database for the Web
 
Spoiling The Youth With Ruby (Euruko 2010)
Spoiling The Youth With Ruby (Euruko 2010)Spoiling The Youth With Ruby (Euruko 2010)
Spoiling The Youth With Ruby (Euruko 2010)
 
Verzovani kodu s Gitem (Karel Minarik)
Verzovani kodu s Gitem (Karel Minarik)Verzovani kodu s Gitem (Karel Minarik)
Verzovani kodu s Gitem (Karel Minarik)
 
Představení Ruby on Rails [Junior Internet]
Představení Ruby on Rails [Junior Internet]Představení Ruby on Rails [Junior Internet]
Představení Ruby on Rails [Junior Internet]
 
Efektivni vyvoj webovych aplikaci v Ruby on Rails (Webexpo)
Efektivni vyvoj webovych aplikaci v Ruby on Rails (Webexpo)Efektivni vyvoj webovych aplikaci v Ruby on Rails (Webexpo)
Efektivni vyvoj webovych aplikaci v Ruby on Rails (Webexpo)
 
Úvod do Ruby on Rails
Úvod do Ruby on RailsÚvod do Ruby on Rails
Úvod do Ruby on Rails
 
Úvod do programování 6
Úvod do programování 6Úvod do programování 6
Úvod do programování 6
 
Úvod do programování 5
Úvod do programování 5Úvod do programování 5
Úvod do programování 5
 
Úvod do programování 4
Úvod do programování 4Úvod do programování 4
Úvod do programování 4
 
Úvod do programování aneb Do nitra stroje
Úvod do programování aneb Do nitra strojeÚvod do programování aneb Do nitra stroje
Úvod do programování aneb Do nitra stroje
 
Interaktivita, originalita a návrhové vzory
Interaktivita, originalita a návrhové vzoryInteraktivita, originalita a návrhové vzory
Interaktivita, originalita a návrhové vzory
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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 SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Úvod do programování 3 (to be continued)

  • 1. Úvod do programování aneb Do nitra stroje PŘEDNÁŠKA 3 Karel Minařík
  • 2. 1 Opakování Úvod do programování
  • 3. ? Najít pánev Fatal Error ? Najít olej Do!lyNalít olej do pánve 1. vejce 2. Zapálit plyn ? Čím zapálit plyn Cancel OK 3. Vzít vejce 4. Rozklepnout vejce o okraj pánve Úvod do programování Přednáška 3
  • 4. JEDNODUCHÝ ALGORITMUS Nalezení největšího čísla z neuspořádaného seznamu čísel 1. Předpokládejme, že první číslo v seznamu je největší. 2. Podívejme se na postupně na každé zbývající číslo v seznamu. Pokud je větší než dosud největší číslo, zapišme si je. 3. Jakmile jsme prošli všechna čísla, je poslední zapsané číslo největším číslem v  seznamu. Úvod do programování Přednáška 3
  • 5. Počítač nedělá to, co chceme, aby dělal. Počítač dělá přesně to, co mu řekneme, aby dělal. Úvod do programování Přednáška 3
  • 6. History of Programming Languages 1954 1960 1965 1970 1975 1980 1985 1990 1995 2000 2001 2002 2003 2004 1986 1990 1990 1991 1991 1993 1994 1995 1996 1996 1997 1997 2000 2001 2001 2003 2003 2004 For more than half of the fifty years computer programmers have been This timeline includes fifty of the more than 2500 documented writing code, O’Reilly has provided developers with comprehensive, programming languages. It is based on an original diagram created www.oreilly.com in-depth technical information. We’ve kept pace with rapidly changing by Éric Lévénez (www.levenez.com), augmented with suggestions technologies as new languages have emerged, developed, and from O’Reilly authors, friends, and conference attendees. matured. Whether you want to learn something new or need For information and discussion on this poster, answers to tough technical questions, you’ll find what you need go to www.oreilly.com/go/languageposter. in O’Reilly books and on the O’Reilly Network. ©2004 O’Reilly Media, Inc. O’Reilly logo is a registered trademark of O’Reilly Media, Inc. All other trademarks are property of their respective owners. part#30417
  • 7.
  • 8. Programovatelnost Programmability Úvod do programování Přednáška 3
  • 9. ˚ „GENERACE“ PROGRAMOVACÍCH JAZYKU První generace Strojový kód: 0 a 1. První počítače: přepínače, nikoliv text. Absolutní výkon. Závislý na hardware. Příklad: 10110000 01100001 Druhá generace Assembler (assembly language). Závislý na hardware. Příklad: mov al, 61h Třetí generace Čitelný a snadno zapsatelný lidmi. Většina moderních jazyků. Příklad: let b = c + 2 * d Čtvrtá generace Reportovací nástroje, SQL (structured query language), domain-specific languages. Navržené pro konkrétní účel. Příklad: SELECT * FROM employees WHERE ORDER BY surname Pátá generace Synonymum pro vizuální programování nebo označení vývoje pomocí definic omezení, stroj sám má zkonstruovat algoritmus. Akademické použití. Úvod do programování Přednáška 3
  • 10. PŘÍSTUPY K PROGRAMOVÁNÍ (PARADIGMATA) Procedurální programování Bud´synonymum pro imperativní programování — prostá posloupnost kroků („recept“). Nebo označení pro programování stylem volání procedur (rutina, sub-rutina, funkce). Modularita. Zejména: PHP, Perl Objektově orientované programování Objekty, jejich vlastnosti a vztahy (Malý pes štěká na chlapce). Dědičnost, modularita, polymorfismus, zapouzdření. Zejména: Java, Ruby Funkční programování Nepopisuje kroky algoritmu, ale matematické vztahy. Zejména: Lisp, Erlang Vizuální programování Vytváření instrukcí a posloupností vizuálně, pomocí grafických reprezentací, nikoliv textem. Zejména: Max/MSP, Apple Automator Úvod do programování Přednáška 3
  • 11. Perl, 1987 Skriptovací jazyk, práce s textem, knihovny (CPAN), duct-tape of the internet Java, 1995 Objektový, nezávislý na platformě (Write once, run anywhere). Java <applet> běží v internetových prohlížečích. PHP, 1995 Dynamické webové stránky —  snadná integrace, zprovoznění. Masivní rozšíření — tzv. LAMP. Úvod do programování Přednáška 3
  • 12. Úvod do programování Přednáška 3
  • 14. Přednáška Ruby Design Principles http://itc.conversationsnetwork.org/shows/detail1638.html Úvod do programování Přednáška 3
  • 15. „Věřím, že – alespoň do jisté míry – je smyslem života být šťastný. Na základě tohoto přesvědčení je Ruby navrženo tak, že je nejenom snadné, ale i zábavné v něm programovat. Ruby vám umožňuje soustředit se na kreativní stránku programování, a nepřidělává vám další starosti.“ ~ Yukihiro Matsumoto, předmluva k prvnímu vydání knihy Programming Ruby Úvod do programování Přednáška 3
  • 16. 2 Ruby — Instalace Úvod do programování
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 25. VYBAVENÍ 1. Ruby :) 2. Konzole pro přímé zadání kódu 3. Editor 4. Dokumentace (!) Úvod do programování Přednáška 3
  • 26. 3 Základní typy a operace Úvod do programování
  • 27. ZÁKLADNÍ TYPY A OPERACE 1. Čísla 2. Texty (řetězce) 3. Pole 4. Aritmetické operace 5. Komentáře 6. Smyčky 7. Podmínky 8. Proměnné Úvod do programování Přednáška 3
  • 28. puts 1 + 1 →2 puts quot;1quot; + quot;1quot; → quot;11quot; číslovka × písmeno puts (1 + 1).class puts (quot;1quot; + quot;1quot;).class Datové typy Úvod do programování Přednáška 3
  • 29. puts 1 + 1 puts quot;1quot; + quot;1quot; puts 2 + 2 * 5 puts (2 + 2) * 5 puts quot;Ahojquot; + quot;Sároquot; puts quot;Ahojquot; + quot; quot; + quot;Sároquot; puts quot;Ahojquot; + 2 (číslo není řetězec) # puts quot;Ahojquot; + 2 (Tento příkaz nebude Ruby provádět) puts quot;Nebudu ve škole zlobitnquot; * 10 Aritmetické operace Úvod do programování Přednáška 3
  • 30. 200.times do puts quot;Nebudu ve škole zlobit. quot; end 1.upto 200 do |i| print quot;#{i}. Nebudu ve škole zlobit. quot; end print quot;n-----nquot; … aneb co dělají počítače nejraději Úvod do programování Přednáška 3
  • 31. … to be continued! 