Transcript Session 4

LBSC 690
Session 4
Programming
Languages
How do we learn a language?
Learn by listening
Then reading
Then writing
How do we teach programming?
Learn to write first
Contributes to programming problems
Programming Languages
Programs are written in a programming
language.
Two types:
Procedural and non-procedural
(declarative).
Are artificial languages.
Artificial Languages
Consist of:
A set of symbols (an alphabet)
A vocabulary
Controlled segment (an authority list)
A user-defined segment
Syntax
Semantics
Levels of Languages
“Low” to “high”
Machine language
Lowest level
All languages must be translated into this
to run on the computer
Unique to each platform
Next level:
Assembler
Levels (Cont’d)
Higher Level Languages:
Basic, Pascal, C, Fortran, Cobol, Visual
Basic, Visual C, etc.
Fourth Generation Languages:
NOMAD, QBE, etc.
Object Oriented Languages:
Smalltalk, C++, Java.
Software Tools
Facilitate writing programs:
Compilers & Interpreters.
Software Development Environments.
Anatomy of a Web
Presentation
A Web Presentation
A collection of one or more Web pages
The Web Site
A server on the Internet containing one or more
Web presentations
A Web page
An HTML (HyperText Markup Language)
document, consisting of text and tags. Has a .html
or .htm extension
Home page
Entry point for a Web presentation
What is HTML?
HyperText Markup Language.
Based on Standard Generalized Markup Language
(SGML).
Developed by Tim Berners-Lee
Describes the structure of a document.
Not its presentation.
Does not describe page content.
Designed to be used cross-platform.
A web browser interprets and displays HTML
documents
HTML is a Markup Language
Start with text and add special tags
around words and paragraphs.
Tags indicate different parts of a page
and produce different effects in the
browser.
HTML has a given, defined set of tags.
Users cannot create their own.
HTML Versions
HTML 2.0.
Base set of tags.
HTML 3.2.
Second release.
HTML 4.0.
Current generation.
Includes new features for flexibility.
HTML 4.01.
Has corrections for 4.0.
What do HTML Files look like?
Contain:
Text of page itself,
Special instructions called HTML tags
indicating page elements, structure,
formatting and hypertext links to other
pages or to included media.
Look at HTML sources.
Display the HTML source code.
Viewing HTML Source Code
1. Start your Web browser
2. Display the Web page you want to
view
3. Click “View”
4. Click “Source” (In Netscape click “Page
Source”
Assignment 2:Creating Web Site
Use a text editor.
Saves files in ASCII format.
In Unix, pico is a text editor,
In Windows, Notepad and DOS Edit are text
editors.
View your created pages with browser.
Create a Web site in your public WAM
directory.
View it again.
Tags
Each HTML tag gives a specific instruction or
command and requires beginning and ending
angle brackets (not case sensitive):
Most tags have an opening and a closing tag:
For example:
<HTML>
Text
</HTML> {The forward slash indicates the
end.}.
This tag identifies the content of this file as a Web page.
Tags (Cont’d.)
<HEAD> & </HEAD> tag:
Specifies that the lines in it are prologue, e.g., the
title:
<TITLE> & </TITLE>
<BODY> & </BODY> tags:
Encloses the remainder of the text and other
contents (links, pictures, etc).
<P> & </P> tags:
Indicates beginning & end of a new paragraph.
<BR>: Indicates start of a new line. (No</BR>).
Tags (Cont’d).
Blank spaces require special codes;
“&nbsp”
Headings are used to divide and organize
sections of text.(Can be up to 6 levels).
<H1> &</H!> up to <H6> & </H6>.
To use preformatted text, e.g., tables:
<PRE> & </PRE>.
TAGS (Cont’d.)
To add comments use the Comments
tag:
<!-- This is a comment.-->.
Certain tags have attributes:
E.g., <BODY TEXT=“BLUE”>
LISTS
HTML defines different kinds of lists:
Ordered: <OL> &</OL>.
Each list item is indicated by <LI>.
Unordered (bulleted) lists: <UL> &</UL>.
Glossary lists: <DL>.
NOTE: Nested lists can be created.
IMAGES
Can be added to Web pages
Tag is:
<IMG SRC=“?”> where “?” specifies
location of image on your computer.
Should use GIF or JPEG images.
Thumbnail images
Can be used in background.
LINKS
Can create links:
To other pages on the Web: <A
HREF=“?”>.
Within a Web page: <A NAME=“?”>.
Links to images: <A HREF=“?”>.
Links to E-mail: <A HREF=mailto:?>.
Also links to Files and FTP sites.
NOTE: Must add </A> after above tags.
OTHER CAPABILITIES
Create Tables
Create Forms
Create Frames
Divide browser windows into sections, each
displaying a different Web page.
Create Advanced Web Pages
Use of JavaScript & Java Applets
Cascading Style Sheets
Are used to define formatting and layout of
information on Web pages
For a single page or multiple pages
Can specify formats in one central location
Provides greater capability than using
individual tags on each page.
Can focus use on specific elements: classes
Sources of Help for HTML
Specifications:
www.w3.org/TR/hrml401/cover.html.
A Beginner’s Guide to HTML:
www.ncsa.uiuc.edu/General/Internet/WWW/
HTMLPrimer.html.
Laura Lemay,Teach yourself Web Publishing
with HTML 4 in a Week, Fourth
Edition,SamsNet.1997.
Ed Tittel, HTML for Dummies, IDG Books,
1997.