Top Banner
Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010
26

Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Dec 25, 2015

Download

Documents

Gerald Russell
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Lesson 1“Hello, World!”

MDST3703 – Studio TrackAlvarado

28 January 2010

Page 2: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Today’s Goals

• Take first steps in acquiring media fluency– Critical– Practical

• Begin to acquire basic understanding of a computer as a symbolic form– With a history and cultural logic– With specific representational properties

• Become familiar with writing code

Page 3: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Why program?

Page 4: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

“All programming entails world-making, as the ritual act of writing and running Hello World reminds us.”

Matt Kirschenbaum, “Hello Worlds”

Page 5: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

“Computers should not be black boxes but rather understood as engines for creating powerful and persuasive models of the world around us. … An appreciation of how complex ideas can be imagined and expressed as a set of formal procedures — rules, models, algorithms — in the virtual space of a computer will be an essential element of a humanities education.”

Page 6: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

What is a computer?

Page 7: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

ß

Bush’s Memex(Is this a computer?)

Page 8: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

com⋅put⋅er  /kəm-pyutər/ [kuhm-pyoo-ter]–noun1. Also called processor. An electronic

device designed to accept data, perform prescribed mathematical and logical operations at high speed, and display the results of these operations. Compare analog computer, digital computer.

2. A person who computes; computist.Origin:1640–50; compute + -er 1 ; cf. MF computeur

Page 9: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.
Page 10: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

So …

• Computers encode labor– They have agency in the world via interactivity and

intelligent agents• Programming is about creating and

controlling this new kind of labor– It is writing in the imperative mode

Page 11: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Representation

• To perform work, a computer must represent the world

• But a programmer must first represent that world for the computer– Think of examples from Hyperland

• What do we represent?– Algorithms and data– This is what we will learn do in this class

Page 12: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Plato’s Cave

Page 13: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.
Page 14: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

The Role of Programming

Page 15: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Basic Toolkit

• Raw Text editor– PC: EditPlus OR jEdit– Mac: TextWrangler

• SSH Client– PC: PuTTY– Mac: Terminal

• FTP Client– PC and Mac: FileZilla

• File compression program– PC: WinRAR– Mac: StuffIt

Page 16: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Some Explanation

• Raw text editor – not a word processor– Basic set of characters understood by the computer

• SSH Client – allows you to perform operations on the server– E.g. Create and delete directories (folders)

• FTP Client – allows you to move files between your computer to the server– i.e. upload and download – FTP = File Transfer Protocol

Page 17: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Vocabulary

• Raw Text• Client and Server• Protocol• Operating System

Page 18: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Testing out your account

• PC users run putty.exe• Mac users, start Terminal– If not in toolbar or apps, use Search

• From the command line, enter:ssh [email protected]

• Press “return” and follow the instructions• Use your blue.unix password• Let me know if you don’t know it

Page 19: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Exercise 1: Hello World

1. Open up your text editorjEdit or TextWrangler

2. Create a new file3. Add Code4. Save file to the web server5. View output on the browser

Page 20: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

E1:1 Open text editor and create file

• Download and install your raw text editor– jEdit is probably the best option

• Double click on the icon• You should have a blank page to work with

Page 21: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

E1:2 Add some code

<?phpecho “Hello, World!”;?>

Page 22: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Elements of code

• Tags – structure your code, like paragraphs• Commands – verbs • Arguments – nouns• Punctuation

<?phpecho “Hello, World!”;?>

Page 23: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

E1:3 Save the file

• In TextWrangler– Choose: File Save to FTP/SFTP Server– Enter server info in dialog box and press “Connect”– Enter file name as index.php, select folder, and press

“Save”• In jEdit– Choose: File Save – Enter file name (index.php) at bottom– Then choose: Plugins FTP Connect to Secure FTP Server– Enter server info and press “OK”, then press “Save”

Page 24: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

E1:4 View results on the Web

• Open your browser– We prefer FireFox, but Internet Explorer or Safari

will do• Enter this address– http://studio1.shanti.virginia.edu/~userid

Page 25: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Other stuff

• Variables and arrays– Numbers and strings

• Operators– Arithmetic– Logical

• A little HTML

Page 26: Lesson 1 “Hello, World!” MDST3703 – Studio Track Alvarado 28 January 2010.

Resources

• PHP’s Manual– http://www.php.net/manual/en/

• W3 Schools– http://www.w3schools.com/

• jEdit User’s Guide– http://www.jedit.org/users-guide/