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

J
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]
1 of 30

Recommended

Modern Web Development with Perl by
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with PerlDave Cross
32.3K views77 slides
API Design Antipatterns - APICon SF by
API Design Antipatterns - APICon SFAPI Design Antipatterns - APICon SF
API Design Antipatterns - APICon SFManish Pandit
1.1K views79 slides
Inroduction to XSLT with PHP4 by
Inroduction to XSLT with PHP4Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Stephan Schmidt
959 views49 slides
XML and Web Services with PHP5 and PEAR by
XML and Web Services with PHP5 and PEARXML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEARStephan Schmidt
9.3K views253 slides
How Xslate Works by
How Xslate WorksHow Xslate Works
How Xslate WorksGoro Fuji
4.8K views57 slides
Lucene And Solr Intro by
Lucene And Solr IntroLucene And Solr Intro
Lucene And Solr Intropascaldimassimo
4K views46 slides

More Related Content

What's hot

Djabot – Python Jabber Bot by
Djabot – Python Jabber BotDjabot – Python Jabber Bot
Djabot – Python Jabber Botmarekkuziel
2.1K views18 slides
Advanced Perl Techniques by
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl TechniquesDave Cross
7.2K views156 slides
PEAR For The Masses by
PEAR For The MassesPEAR For The Masses
PEAR For The MassesStephan Schmidt
1.5K views40 slides
Session Server - Maintaing State between several Servers by
Session Server - Maintaing State between several ServersSession Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersStephan Schmidt
1.8K views34 slides
Perl Tidy Perl Critic by
Perl Tidy Perl CriticPerl Tidy Perl Critic
Perl Tidy Perl Criticolegmmiller
2.9K views27 slides
The Big Documentation Extravaganza by
The Big Documentation ExtravaganzaThe Big Documentation Extravaganza
The Big Documentation ExtravaganzaStephan Schmidt
1.8K views44 slides

What's hot(20)

Djabot – Python Jabber Bot by marekkuziel
Djabot – Python Jabber BotDjabot – Python Jabber Bot
Djabot – Python Jabber Bot
marekkuziel2.1K views
Advanced Perl Techniques by Dave Cross
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
Dave Cross7.2K views
Session Server - Maintaing State between several Servers by Stephan Schmidt
Session Server - Maintaing State between several ServersSession Server - Maintaing State between several Servers
Session Server - Maintaing State between several Servers
Stephan Schmidt1.8K views
Perl Tidy Perl Critic by olegmmiller
Perl Tidy Perl CriticPerl Tidy Perl Critic
Perl Tidy Perl Critic
olegmmiller2.9K views
The Big Documentation Extravaganza by Stephan Schmidt
The Big Documentation ExtravaganzaThe Big Documentation Extravaganza
The Big Documentation Extravaganza
Stephan Schmidt1.8K views
The Django Web Application Framework 2 by fishwarter
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter7.7K views
Web develop in flask by Jim Yeh
Web develop in flaskWeb develop in flask
Web develop in flask
Jim Yeh5.7K views
course slides -- powerpoint by webhostingguy
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
webhostingguy1.8K views
Writing and using php streams and sockets tek11 by Elizabeth Smith
Writing and using php streams and sockets   tek11Writing and using php streams and sockets   tek11
Writing and using php streams and sockets tek11
Elizabeth Smith2.3K views
Go OO! - Real-life Design Patterns in PHP 5 by Stephan Schmidt
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
Stephan Schmidt5.1K views
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB by Jesse Wolgamott
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
Jesse Wolgamott9.7K views
Create a web-app with Cgi Appplication by olegmmiller
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication
olegmmiller7.2K views
Streams, sockets and filters oh my! by Elizabeth Smith
Streams, sockets and filters oh my!Streams, sockets and filters oh my!
Streams, sockets and filters oh my!
Elizabeth Smith4.2K views
Boost Maintainability by Mosky Liu
Boost MaintainabilityBoost Maintainability
Boost Maintainability
Mosky Liu1.5K views
Using Jenkins for Continuous Integration of Perl components OSD2011 by Jonas Brømsø
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ø10.9K views
Text indexing and search libraries for PHP - Zoë Slattery - Barcelona PHP Con... by phpbarcelona
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...
phpbarcelona3.7K views

Viewers also liked

Computer Programming Overview by
Computer Programming OverviewComputer Programming Overview
Computer Programming Overviewagorolabs
1.4K views37 slides
The next 2500 days by
The next 2500 daysThe next 2500 days
The next 2500 daysKevin Feenan
549 views15 slides
Paradigm 1218656614474137 8 by
Paradigm 1218656614474137 8Paradigm 1218656614474137 8
Paradigm 1218656614474137 8Daniel Mielke, CPIM
570 views12 slides
Programming Paradigm by
Programming ParadigmProgramming Paradigm
Programming ParadigmSabahtHussein
975 views4 slides
Standard Algorithms by
Standard AlgorithmsStandard Algorithms
Standard AlgorithmsSabahtHussein
1.2K views6 slides
Prgramming paradigms by
Prgramming paradigmsPrgramming paradigms
Prgramming paradigmsAnirudh Chauhan
2.2K views27 slides

Viewers also liked(7)

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

Domain Specific Languages by
Domain Specific LanguagesDomain Specific Languages
Domain Specific LanguagesWee Witthawaskul
3.6K views59 slides
03 Php Array String Functions by
03 Php Array String Functions03 Php Array String Functions
03 Php Array String FunctionsGeshan Manandhar
3K views20 slides
Lecture 3 - Comm Lab: Web @ ITP by
Lecture 3 - Comm Lab: Web @ ITP Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP yucefmerhi
374 views57 slides
Why Python by Marilyn Davis, Marakana by
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaMarko Gargenta
2.6K views77 slides
Php Training by
Php TrainingPhp Training
Php Trainingadfa
5.9K views26 slides

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

Lecture 3 - Comm Lab: Web @ ITP by yucefmerhi
Lecture 3 - Comm Lab: Web @ ITP Lecture 3 - Comm Lab: Web @ ITP
Lecture 3 - Comm Lab: Web @ ITP
yucefmerhi374 views
Why Python by Marilyn Davis, Marakana by Marko Gargenta
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, Marakana
Marko Gargenta2.6K views
Php Training by adfa
Php TrainingPhp Training
Php Training
adfa5.9K views
Anvita Dynamic Fontson Web Feb2001 by guest6e7a1b1
Anvita Dynamic Fontson Web Feb2001Anvita Dynamic Fontson Web Feb2001
Anvita Dynamic Fontson Web Feb2001
guest6e7a1b1406 views
Php Form by lotlot
Php FormPhp Form
Php Form
lotlot8K views
Business Intelligence Portfolio by DrewAllen
Business Intelligence PortfolioBusiness Intelligence Portfolio
Business Intelligence Portfolio
DrewAllen239 views
Haml & Sass presentation by bryanbibat
Haml & Sass presentationHaml & Sass presentation
Haml & Sass presentation
bryanbibat671 views
Forum Presentation by Angus Pratt
Forum PresentationForum Presentation
Forum Presentation
Angus Pratt4.9K views
PHP 102: Out with the Bad, In with the Good by Jeremy Kendall
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
Jeremy Kendall4.6K views
Intro to #memtech PHP 2011-12-05 by Jeremy Kendall
Intro to #memtech PHP   2011-12-05Intro to #memtech PHP   2011-12-05
Intro to #memtech PHP 2011-12-05
Jeremy Kendall1.4K views
REST, HTTP, and the PATCH verb (with kittens) by almostobsolete
REST, HTTP, and the PATCH verb (with kittens)REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)
almostobsolete590 views
A brief history of the web by Jorge Zapico
A brief history of the webA brief history of the web
A brief history of the web
Jorge Zapico551 views
How to be a better Google-r by Mike Taylor
How to be a better Google-rHow to be a better Google-r
How to be a better Google-r
Mike Taylor1.8K views
Getting the Most Out of OpenSocial Gadgets by Atlassian
Getting the Most Out of OpenSocial GadgetsGetting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial Gadgets
Atlassian1K views
Open Source Package PHP & MySQL by kalaisai
Open Source Package PHP & MySQLOpen Source Package PHP & MySQL
Open Source Package PHP & MySQL
kalaisai5.7K views

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.

Editor's Notes

  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