SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
A Humanist's Introduction to Programming (with Ruby)     Wayne Graham & Joe Gilbert MITH, Oct. 19, 2010
What does that mean? (We're still figuring it out.)
Why teach programming to humanities scholars?
Jean Bauer Early American Foreign Service Database
Mapping Taqwacore: the Kominas
Why program? ,[object Object],[object Object],[object Object]
Why program? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is a programming language? ,[object Object],[object Object]
What is a programming language? ..like human languages in some ways!   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why Ruby? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
  ,[object Object],[object Object],[object Object],[object Object]
Why not Ruby? ,[object Object],[object Object],[object Object],[object Object]
What we will cover ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What we won't cover ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Try it out! ,[object Object],[object Object],[object Object],http://rubyinstaller.org/
We work with a few basic types of information ,[object Object],[object Object]
Types of information numbers, letters, boolean values ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Variables "words" that hold information ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Collections
Collections text, numbers...collections? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Operators arithmetic and more ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Type casting duck typing and type casting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Special Symbols ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Printing things to the screen ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Do something! Store your street address, city, state, and zip code in variables (or even better, a hash!), then print them in the usual format: Joseph Gilbert 160 McCormick Road Charlottesville, VA 22902 address = {'name' => 'Joseph Gilbert', 'street' => '160 McCormick Road', 'city' => 'Charlottesville', 'state' => 'VA', 'zip' => '22902'} puts address['name'] puts address['street'] puts address['city'] + ', ' + address['state'] + ' ' + address['zip']
Repeating yourself  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Repetition: "iterating" with each ,[object Object],[object Object],[object Object],[object Object]
.each for hashes ,[object Object],[object Object],[object Object],[object Object]
Do Something, pt. 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],authors = {"Charles Dickens" => "1870", "William Thackeray" => "1863", "Anthony Trollope" => "1882", "Gerard Manley Hopkins" => "1889"} authors.each do |author, year|   puts author.to_s + " passed away in " + year.to_s end
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Más contenido relacionado

La actualidad más candente

Djabot – Python Jabber Bot
Djabot – Python Jabber BotDjabot – Python Jabber Bot
Djabot – Python Jabber Botmarekkuziel
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl TechniquesDave Cross
 
Session Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersSession Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersStephan Schmidt
 
Perl Tidy Perl Critic
Perl Tidy Perl CriticPerl Tidy Perl Critic
Perl Tidy Perl Criticolegmmiller
 
The Big Documentation Extravaganza
The Big Documentation ExtravaganzaThe Big Documentation Extravaganza
The Big Documentation ExtravaganzaStephan Schmidt
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2fishwarter
 
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flaskJim Yeh
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpointwebhostingguy
 
Writing and using php streams and sockets tek11
Writing and using php streams and sockets   tek11Writing and using php streams and sockets   tek11
Writing and using php streams and sockets tek11Elizabeth Smith
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Stephan Schmidt
 
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBJesse Wolgamott
 
Introduction to Google API - Focusky
Introduction to Google API - FocuskyIntroduction to Google API - Focusky
Introduction to Google API - FocuskyFocusky Presentation
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplicationolegmmiller
 
Streams, sockets and filters oh my!
Streams, sockets and filters oh my!Streams, sockets and filters oh my!
Streams, sockets and filters oh my!Elizabeth Smith
 
XML Transformations With PHP
XML Transformations With PHPXML Transformations With PHP
XML Transformations With PHPStephan Schmidt
 
Boost Maintainability
Boost MaintainabilityBoost Maintainability
Boost MaintainabilityMosky Liu
 
Using Jenkins for Continuous Integration of Perl components OSD2011
Using Jenkins for Continuous Integration of Perl components OSD2011 Using Jenkins for Continuous Integration of Perl components OSD2011
Using Jenkins for Continuous Integration of Perl components OSD2011 Jonas Brømsø
 
Text indexing and search libraries for PHP - Zoë Slattery - Barcelona PHP Con...
Text indexing and search libraries for PHP - Zoë Slattery - Barcelona PHP Con...Text indexing and search libraries for PHP - Zoë Slattery - Barcelona PHP Con...
Text indexing and search libraries for PHP - Zoë Slattery - Barcelona PHP Con...phpbarcelona
 

La actualidad más candente (20)

Djabot – Python Jabber Bot
Djabot – Python Jabber BotDjabot – Python Jabber Bot
Djabot – Python Jabber Bot
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
PEAR For The Masses
PEAR For The MassesPEAR For The Masses
PEAR For The Masses
 
Session Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersSession Server - Maintaing State between several Servers
Session Server - Maintaing State between several Servers
 
Perl Tidy Perl Critic
Perl Tidy Perl CriticPerl Tidy Perl Critic
Perl Tidy Perl Critic
 
The Big Documentation Extravaganza
The Big Documentation ExtravaganzaThe Big Documentation Extravaganza
The Big Documentation Extravaganza
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flask
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
Writing and using php streams and sockets tek11
Writing and using php streams and sockets   tek11Writing and using php streams and sockets   tek11
Writing and using php streams and sockets tek11
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5
 
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
 
Introduction to Google API - Focusky
Introduction to Google API - FocuskyIntroduction to Google API - Focusky
Introduction to Google API - Focusky
 
Presentation log4 j
Presentation log4 jPresentation log4 j
Presentation log4 j
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication
 
Streams, sockets and filters oh my!
Streams, sockets and filters oh my!Streams, sockets and filters oh my!
Streams, sockets and filters oh my!
 
XML Transformations With PHP
XML Transformations With PHPXML Transformations With PHP
XML Transformations With PHP
 
Boost Maintainability
Boost MaintainabilityBoost Maintainability
Boost Maintainability
 
Using Jenkins for Continuous Integration of Perl components OSD2011
Using Jenkins for Continuous Integration of Perl components OSD2011 Using Jenkins for Continuous Integration of Perl components OSD2011
Using Jenkins for Continuous Integration of Perl components OSD2011
 
Text indexing and search libraries for PHP - Zoë Slattery - Barcelona PHP Con...
Text indexing and search libraries for PHP - Zoë Slattery - Barcelona PHP Con...Text indexing and search libraries for PHP - Zoë Slattery - Barcelona PHP Con...
Text indexing and search libraries for PHP - Zoë Slattery - Barcelona PHP Con...
 

Destacado

Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overviewagorolabs
 
The next 2500 days
The next 2500 daysThe next 2500 days
The next 2500 daysKevin Feenan
 
Programming Paradigm
Programming ParadigmProgramming Paradigm
Programming ParadigmSabahtHussein
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming ParadigmsDirecti Group
 

Destacado (7)

Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
 
The next 2500 days
The next 2500 daysThe next 2500 days
The next 2500 days
 
Paradigm 1218656614474137 8
Paradigm 1218656614474137 8Paradigm 1218656614474137 8
Paradigm 1218656614474137 8
 
Programming Paradigm
Programming ParadigmProgramming Paradigm
Programming Paradigm
 
Standard Algorithms
Standard AlgorithmsStandard Algorithms
Standard Algorithms
 
Prgramming paradigms
Prgramming paradigmsPrgramming paradigms
Prgramming paradigms
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 

Similar a MITH Digital Dialogues: Intro to Programming for Humanists (with Ruby)

03 Php Array String Functions
03 Php Array String Functions03 Php Array String Functions
03 Php Array String FunctionsGeshan Manandhar
 
Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP yucefmerhi
 
Why Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaMarko Gargenta
 
Php Training
Php TrainingPhp Training
Php Trainingadfa
 
Anvita Dynamic Fontson Web Feb2001
Anvita Dynamic Fontson Web Feb2001Anvita Dynamic Fontson Web Feb2001
Anvita Dynamic Fontson Web Feb2001guest6e7a1b1
 
Php Form
Php FormPhp Form
Php Formlotlot
 
Business Intelligence Portfolio
Business Intelligence PortfolioBusiness Intelligence Portfolio
Business Intelligence PortfolioDrewAllen
 
Haml & Sass presentation
Haml & Sass presentationHaml & Sass presentation
Haml & Sass presentationbryanbibat
 
Forum Presentation
Forum PresentationForum Presentation
Forum PresentationAngus Pratt
 
PHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the GoodPHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the GoodJeremy Kendall
 
Intro to #memtech PHP 2011-12-05
Intro to #memtech PHP   2011-12-05Intro to #memtech PHP   2011-12-05
Intro to #memtech PHP 2011-12-05Jeremy Kendall
 
REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)almostobsolete
 
A brief history of the web
A brief history of the webA brief history of the web
A brief history of the webJorge Zapico
 
How to be a better Google-r
How to be a better Google-rHow to be a better Google-r
How to be a better Google-rMike Taylor
 
Getting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsGetting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsAtlassian
 
Open Source Package PHP & MySQL
Open Source Package PHP & MySQLOpen Source Package PHP & MySQL
Open Source Package PHP & MySQLkalaisai
 

Similar a MITH Digital Dialogues: Intro to Programming for Humanists (with Ruby) (20)

Domain Specific Languages
Domain Specific LanguagesDomain Specific Languages
Domain Specific Languages
 
03 Php Array String Functions
03 Php Array String Functions03 Php Array String Functions
03 Php Array String Functions
 
Php 3 1
Php 3 1Php 3 1
Php 3 1
 
Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP
 
Why Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, Marakana
 
Php Training
Php TrainingPhp Training
Php Training
 
Anvita Dynamic Fontson Web Feb2001
Anvita Dynamic Fontson Web Feb2001Anvita Dynamic Fontson Web Feb2001
Anvita Dynamic Fontson Web Feb2001
 
Php Form
Php FormPhp Form
Php Form
 
Learning Ruby
Learning RubyLearning Ruby
Learning Ruby
 
Business Intelligence Portfolio
Business Intelligence PortfolioBusiness Intelligence Portfolio
Business Intelligence Portfolio
 
Haml & Sass presentation
Haml & Sass presentationHaml & Sass presentation
Haml & Sass presentation
 
Forum Presentation
Forum PresentationForum Presentation
Forum Presentation
 
PHP MySQL
PHP MySQLPHP MySQL
PHP MySQL
 
PHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the GoodPHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the Good
 
Intro to #memtech PHP 2011-12-05
Intro to #memtech PHP   2011-12-05Intro to #memtech PHP   2011-12-05
Intro to #memtech PHP 2011-12-05
 
REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)
 
A brief history of the web
A brief history of the webA brief history of the web
A brief history of the web
 
How to be a better Google-r
How to be a better Google-rHow to be a better Google-r
How to be a better Google-r
 
Getting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsGetting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial Gadgets
 
Open Source Package PHP & MySQL
Open Source Package PHP & MySQLOpen Source Package PHP & MySQL
Open Source Package PHP & MySQL
 

MITH Digital Dialogues: Intro to Programming for Humanists (with Ruby)

  • 1. A Humanist's Introduction to Programming (with Ruby)     Wayne Graham & Joe Gilbert MITH, Oct. 19, 2010
  • 2. What does that mean? (We're still figuring it out.)
  • 3. Why teach programming to humanities scholars?
  • 4. Jean Bauer Early American Foreign Service Database
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. Do something! Store your street address, city, state, and zip code in variables (or even better, a hash!), then print them in the usual format: Joseph Gilbert 160 McCormick Road Charlottesville, VA 22902 address = {'name' => 'Joseph Gilbert', 'street' => '160 McCormick Road', 'city' => 'Charlottesville', 'state' => 'VA', 'zip' => '22902'} puts address['name'] puts address['street'] puts address['city'] + ', ' + address['state'] + ' ' + address['zip']
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.

Notas del editor

  1. characters and words (strings) sometimes two different things, depending on language
  2. "Doing stuff" usually doesn't change the variables used.  You'd need to use write things like  new_variable = my_variable + 2 or my_variable = my_variable + 2  to use this value later.
  3. address = {'name' => 'Joseph Gilbert', 'street' => '160 McCormick Road', 'city' => 'Charlottesville', 'state' => 'VA', 'zip' => '22902'} puts address['name'] puts address['street'] puts address['city'] + ', ' + address['state'] + ' ' + address['zip']
  4. authors = {"Charles Dickens" => "1870", "William Thackeray" => "1863", "Anthony Trollope" => "1882", "Gerard Manley Hopkins" => "1889"} authors.each do |author, year|   puts author.to_s + " passed away in " + year.to_s end authors.each do |author, year|   puts author.to_s + " passed away in " + year.to_s endauthors = {"Charles Dickens" => "1870", "William Thackeray" => "1863", "Anthony Trollope" => "1882", "Gerard Manley Hopkins" => "1889"} authors.each do |author, year|   puts author.to_s + " passed away in " + year.to_s endauthors = {"Charles Dickens" => "1870", "William Thackeray" => "1863", "Anthony Trollope" => "1882", "Gerard Manley Hopkins" => "1889"} authors.each do |author, year|   puts author.to_s + " passed away in " + year.to_s endauthors = {"Charles Dickens" => "1870", "William Thackeray" => "1863", "Anthony Trollope" => "1882", "Gerard Manley Hopkins" => "1889"} authors.each do |author, year|   puts author.to_s + " passed away in " + year.to_s end