lesson 1 “hello, world!”

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

Upload: darby

Post on 25-Feb-2016

30 views

Category:

Documents


0 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lesson 1 “Hello, World!”

Lesson 1“Hello, World!”

MDST3703 – Studio TrackAlvarado

28 January 2010

Page 2: Lesson 1 “Hello, World!”

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!”

Why program?

Page 4: Lesson 1 “Hello, World!”

“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!”

“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!”

What is a computer?

Page 7: Lesson 1 “Hello, World!”

ß

Bush’s Memex(Is this a computer?)

Page 8: Lesson 1 “Hello, World!”

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!”
Page 10: Lesson 1 “Hello, World!”

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!”

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!”

Plato’s Cave

Page 13: Lesson 1 “Hello, World!”
Page 14: Lesson 1 “Hello, World!”

The Role of Programming

Page 15: Lesson 1 “Hello, World!”

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!”

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!”

Vocabulary

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

Page 18: Lesson 1 “Hello, World!”

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!”

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!”

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!”

E1:2 Add some code

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

Page 22: Lesson 1 “Hello, World!”

Elements of code

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

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

Page 23: Lesson 1 “Hello, World!”

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!”

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!”

Other stuff

• Variables and arrays– Numbers and strings

• Operators– Arithmetic– Logical

• A little HTML

Page 26: Lesson 1 “Hello, World!”

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/