cps 1: computer science fundamentals vijay abhijit 18th may, 2001

19
CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Upload: gavin-lane

Post on 13-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

CPS 1: Computer Science Fundamentals

Vijay Abhijit

18th May, 2001

Page 2: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Administrivia

• Read webpage regularly– http://www.cs.duke.edu/education/courses/summer01/cps001

• Read newsgroup – news:duke.cs.cps001– don’t forget to read handout on reading news !

• On webpage you will find:– Assignment information– Syllabus and timetable– Handout of slides

Page 3: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Administrivia (contd.)

• Textbooks !

– Please arrange for them so that we can start on pre-reading at home

– Readings to be assigned from next week

• Good to have a floppy with you in case of network failure / congestion– Save work to acpub later from floppy

Page 4: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Assignment 0

• Send me email! ([email protected] OR [email protected]) [due Fri, May 18, 11:59pm]

– Your name

– Major

– Class [Fresh / Soph / Jun / Sen / Grad]

– Box at home? [PC / Mac]

– Programmed before? [Never / Basic / Pascal / HTML / Java / C++ / C / Other]

– What would you like to learn from this course?

Page 5: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Assignment 1

• Make a webpage and make a newsgroup posting [due Tue, May 22, 11:59pm]

– You will not have two assignments in parallel, except this just once

– Detailed instructions on webpage!

– Make sure you read instructions carefully before you start

– Would you want me to assist you at the North Cluster on Saturday / Sunday?

– Start early !

Page 6: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Final Exam, Mid Term & Quizzes

• Final Exam– June 28th [2:00 - 5:00pm] ?

• Mid Term– June 6th [during classhours] ?

• Quizzes start next Friday– 45 min duration

• Full syllabus to be up on web by this weekend

Page 7: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Review from yesterday

IMAGE FORMATS• gif [GRAPHICAL INTERCHANGE FORMAT]

– originally from Compuserve– file has gif or giff extension– supports 256 colors

• jpeg [JOINT PHOTOGRAPHIC EXPERTS GROUP]– file has jpg / jpeg / jfif extension– economizes on the way data is stored – identifies and discards "extra" data– “lossy” compression

Page 8: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Review from yesterday

IMAGE FORMATS [contd.]• bmp [BITMAP]

– file has bmp / dib / vga / bga / rle / rl4 / rl8 extension

– from Windows

– uncompressed format, files are “huge”

• Where else is compression used– Programs like Winzip!

Page 9: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Files saved as .html vs .htm

• You can save files as either .html or .htm– Browser will still treat it as HTML file

• .htm was the only way out on DOS machines– only three letter extensions permitted in DOS

• But if you have words.html and you use

<A HREF=“words.htm”>, you will not get words.html

Page 10: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

HTML wrapup

• So far you have dealt with– <HTML>

– <HEAD>, <TITLE>

– <BODY>

– <OL>, <UL>, <LI>

– <I>, <B>, <U>

– <IMG>, ALT>

– <BGCOLOR>, BACKGROUND>, <BR>, <H1>

Page 11: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Advanced HTML : index.html is “special”

• index.htm OR index.html is “default” page picked up by browser when you direct it to a site

• If you have say home.html in your public_html directory, it won’t work…

• Moral of the story: Always name your home page as index.html

Page 12: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Advanced HTML : COMMENTS & mailto:

• <!-- I am a comment. I am not displayed on the web page-->– Useful when you do not want to display something on webpage

but do not want to delete that code

– Useful when you wish to share “info” in your source code

• <a href="mailto:[email protected]"> Vijay Abhijit</a>– click on the link and you can send mail...

Page 13: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Advanced HTML

• Paragraphs and align– <P>, </P>

– <P ALIGN=RIGHT>

• Tables– <TABLE BORDER="1" WIDTH="100" ALIGN=RIGHT>

– <TR>

– <TD>

Page 14: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Color Codes• red FF0000

• blue 0000FF

• orange FF7F00

• purple 9370DB

• yellow FFFF00

• black 000000

• green 00FF00

• white FFFFFF

Page 15: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Tricks to keep in mind :)• How do you print a “<In times of need” on a

webpage?– Most browsers treat <In times of need as badly formatted tag

and ignore it

– &lt; AND &gt;

• How do you print multiple spaces between words in a web page?– &nbsp;

Page 16: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Background Sound!• <BGSOUND SRC="elshad.midi" AUTOSTART=TRUE LOOP=INFINITE>– midi [MUSICAL INSTRUMENT DIGITAL INTERFACE]– causes elshad.midi to be played in an infinite loop, the moment

the page is loaded– elshad.midi picked up from same directory as HTML file that

above code is embedded in– use BGSOUND with caution– nothing turns people off more than annoying music that plays

forever

Page 17: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Talking of Sound...• Heard of MP3?

– MPEG [MOVING PICTURES EXPERTS GROUP]• format for storing movie files

• file has .mpeg or .mpg extension

• compression system

– MP3 is MPEG subsystem for compressing sound– [MPEG audio Layer-3] Encoding

Page 18: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

The Idea behind MP3

• Certain sounds that human ear cannot hear

• Certain sounds that human ear hears much better than others

• If there are two sounds playing simultaneously we hear louder one better than softer one

• Throw away certain parts of song, compress rest!

• None complains except perhaps your dog!

Page 19: CPS 1: Computer Science Fundamentals Vijay Abhijit 18th May, 2001

Next week : Java!

• Real programming!