CX 103: Introduction to Computers

Lecture 10
 
 

Announcements

Exam 1: Tuesday, March 13
 
 

Today:

<META> Tags and the !DOCTYPE Tag

FRAMES
Bits, Bytes and Binary I
 



<META> Tags and the !DOCTYPE Tag




<META> Tags

Provide "about-the-document" information

Belong in HEAD part of html file

Provide Information to Search Engines

Not necessary, but improve the chances your web page will be found.

Examples:

<META NAME = "KEYWORDS" CONTENT = baseball pitches Cone Clemens Red Sox Yankees>

<META NAME = "DESCRIPTION" CONTENT="This document displays the cover of a New York Times Magazine which features an article about the pitchers David Cone and Roger Clemens. There are image links to the homepages of the Boston Red Sox and New York Yankees."
 
 

!DOCTYPE

Appears at very top of file:

<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 Frameset//EN "http://www.w3.org/TR/html4/frameset.dtd">

<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.0 Transitional//EN">


FRAMES




So Far: Display only one page at a time

Frames: Display several pages at once

Can be connected or independent
 
 

Some Examples of Output:

frames.html

rowframes.html

framesHW.html
 



 
 
 

<FRAMESET>                    </FRAMESET>

replace

<BODY>                                     </BODY>
 
 
 
 

FRAMESET specifies arrangement:

Horizontal (ROWS)

Verical (COLS)

Size of Components

Examples

<FRAMESET COLS = 200,400>

<FRAMESET COLS= 100,*>

<FRAMESET ROWS = 40%,*>

<FRAMESET ROWS = *,*>
 
 


<HTML>

<HEAD>

<!--frames.html -->

<TITLE>Two Newspapers</TITLE>

</HEAD>

<FRAMESET ROWS ="50%,50%">

<FRAME SRC="http://www.losangelestimes.com">

<FRAME SRC="http://www.detroitnews.com">

</FRAMESET>

</HTML>

frames.html



<HTML>

<HEAD>

<TITLE>Frames With Three Windows</TITLE>

</HEAD>

<FRAMESET COLS ="*,*,*">

<FRAME SRC="http://www.middlebury.edu/~math">

<FRAME SRC="http://www.middlebury.edu/~russian">

<FRAME SRC="http://www.middlebury.edu/~econ">

</FRAMESET>

</HTML>

frames3.html



<HTML>

<HEAD>

<TITLE>Another Example of Frames</TITLE>

<!--rowframes.html-->

</HEAD>

<FRAMESET rows ="*,*">

<FRAME SRC="FormatCommands.HTML">

<FRAME SRC="FormattingText.HTML">
 
 

</FRAMESET>

</HTML>
rowframes.html


<HTML>

<HEAD>

<TITLE> Navigating Rutland Herald</TITLE>

<!-RutlandHerald.html--->

</HEAD>

<FRAMESET COLS = 25%,*>

<FRAME SRC="Navigation.html" NAME = "left">

<FRAME SRC= "Herald.html" NAME ="right">

</FRAMESET>

RutlandHerald.html


<HTML>

<HEAD>

<TITLE>Navigating the Rutland Herald</TITLE>

<!--Navigation.html->

</HEAD>
 
 

<BODY BGCOLOR = lightblue>

<FONT COLOR = red>

<H1>Today's Headlines</H1>

<FONT SIZE = +2>

<UL>

<LI><A HREF="Herald.html#Killington" TARGET = "right">Killington Owners Upbeat</A></LI>

<LI><A HREF="Herald.html#Town Meeting" TARGET = "right">Town Meeting</A> </LI><BR>

<LI><A HREF="Herald.html#Storm" TARGET = "right">Storm Gains Strength</A> </LI><BR>

<LI><A HREF="Herald.html#47" TARGET = "right">Storm of '47</A></LI>

<LI><A HREF="Herald.html#rampage" TARGET = "right">Student's Gun Rampage</A></LI><BR>

<LI><A HREF="Herald.html#Cheney" TARGET = "right">Cheney's Blocked Artery</A></LI><BR>

</UL>

</FONT>

<FONT COLOR = red>

<H1> Photo Pick</H1>

<UL>

<LI><A HREF="Herald.html#Photo" TARGET = "right">Click Here</A></LI>

</UL>

</FONT>

</BODY>

</HTML>

Navigation.html-


<HTML>

<HEAD> <TITLE> Rutland Herald </TITLE></HEAD>

<!-Herald.html -->

<BODY BGCOLOR = "white">

<IMG SRC = "rutherhead.jpg" WIDTH = 350 HEIGHT = 61 ALT = ""Rutalnd Herald Logo">

<P>

<STRONG>

<A NAME = "Killington"> </A>

<A HREF="http://rutlandherald.nybor.com/News/Story/21734.html">Killington owners upbeat despite $10. 4 million second quarter loss</A>

</STRONG>

<BR>

American Skiing Co. reported Tuesday a second quarter loss of $10.4 million, or 34 cents per share - an improvement over the second quarter of last year when the company lost $15.1 million, or 50 cents per share.<BR>

American Skiing Co. also reported record revenues and skier visits for

the quarter. Total revenues were $156.6 million compared to $126.6

million for the same quarter a year earlier.

<BR>

The company's second quarter ended Jan. 28.

<BR>

Through the first six months of its fiscal year, the company lost $34.6

million, or $1.14 a share, compared to a loss of $43.1 million, or $1.42

a share, for the same period last year.

<BR>

Resort revenue was $125.5 million for the quarter compared to $104.5

million for the comparable quarter last year. Revenue from real estate

sales was $30.7 million compared to $22.1 million a year ago.

<BR>

<font face="arial" size="1"> Mar. 7, 2001</font>

</P>

<P>

<STRONG>

<A NAME = "Town Meeting"></A>

<A HREF="http://rutlandherald.nybor.com/News/Story/21704.html">Town meetingstorm is one of the greats</a>

</STRONG>

<BR>

MONTPELIER - A lion of a snowstorm roared in and across Vermont and most of the Northeast Tuesday, leaving in its wake messy roads, canceled town meetings, collapsing roofs and ecstatic ski areas.

<BR>

A winter storm warning was in effect for most of the day Tuesday, and the National Weather Service in Burlington predicted that some parts of the state could see up to 4 feet of snow by the time the storm ended.

<BR>

"Burlington will likely approach 2 feet from this storm, which would

rank as the third greatest snowstorm on record," said an early morning

statement from the National Weather Service.

<BR>

"It's like a political convention - it's very longwinded," said Ray Burke, a

snowplow dispatcher with the state Agency of Transportation.

Late Tuesday afternoon authorities located a 15-year-old boy who had

been missing on Lake Champlain for more than 28 hours.

There was no immediate word on his condition.

<BR>

<font face="arial" size="1"> Mar. 7, 2001</font>

</P>

<P>

<STRONG>

<A NAME = "Storm"></A>

<A HREF="http://rutlandherald.nybor.com/News/Story/21678.html">Storm gains second wind, disrupts tradition</A>

</STRONG>

<BR>

A nor'easter of historic proportions began to dump what could be as much as 3 feet of snow across Vermont Monday, closing roads, schools and stores and keeping countless people away from the state's 200-year-old tradition of town meeting.

<BR>

March is known to roar in like a lion. But state highway dispatcher Ray

Burke called the current storm a different animal.

<BR>

"It's like a political convention - it's very longwinded," Burke said from

the state's central garage in Berlin.

<BR>

Snow began to fall before sunrise Monday, closing practically every

school in the state's four southernmost counties.

<BR>

Accumulation measured up to a foot at the Addison-Rutland county line

by the time dozens of stores and small businesses shut early in the

afternoon.

<BR>

<font face="arial" size="1"> Mar. 6, 2001</font>

</P>

<P>

<STRONG>

<A NAME = "47"> </A>

<A HREF="http://rutlandherald.nybor.com/News/Story/21677.html">Not since the storm of '47 . . .</a>

</STRONG>

<BR>

You think this is a big one? &quot;Vermont's deepest snowstorm in modern times&quot; fell during the March town meeting in 1947, forcing the postponement of many meetings, according to the bible of Vermont weather, David Ludlum's &quot;The Vermont Weather Book.&quot;

<BR>

<font face="arial" size="1"> Mar. 6, 2001</font>

</P>

<P>

<STRONG>

<A NAME = "rampage"> </A>

<A HREF="http://rutlandherald.nybor.com/News/Story/21675.html">Student's gun rampage kills two, wounds 13</a>

</STRONG>

<BR>

SANTEE, Calif. - A 15-year-old boy who had been picked on and had talked about shooting classmates allegedly opened fire in a high school bathroom Monday, killing two people and wounding 13 in the nation's deadliest school attack since Columbine.

<BR>

<font face="arial" size="1">Mar. 6, 2001</font>

</P>

<P>

<STRONG>

<A NAME = "Cheney"> </A>

<A HREF="http://rutlandherald.nybor.com/News/Story/21674.html">Cheney has procedure to reopen blocked artery</a>

</STRONG>

<BR>

WASHINGTON - Vice President Dick Cheney checked himself into George Washington University Hospital Monday, where he underwent a procedure to reopen a blocked artery after he experienced chest pains Saturday, Sunday and twice on Monday.

<BR>

<font face="arial" size="1">Mar. 6, 2001</font>

</P>

<BR><BR>

<A NAME = "Photo"></A>

<IMG SRC = "SnowPix.jpg" BORDER = 3 ALT=Shoveling Snow>

</BODY>

</HTML>

herald.html




Bits, Bytes, and the Binary Number System I

What is a Bit?
 
 

Transistors - basic building blocks of a computer

-a switch that is either ON or OFF

"ON State" ?electricity flows

"OFF State" ? electricity doesn't flow

Let 0 represent the OFF state

Let 1 represent the ON state

0 and 1 are called Binary Digits (or Bits)

View a bit as the fundamental unit of storage on a computer.

Binary Number System: elements are 0,1

Decimal Number System: elements are 0,1,2,3,4,5,6,7,8,9
 



What is a Byte?

A single bit has limited usefulness: it can represent only two values (0 or 1) and hence can distinguish only between two states.

A Byte is an ordered string of 8 bits:
1
0
0
1
0
0
0
1

 
 
0
0
0
0
0
0
0
0

 
 
1
1
1
0
0
1
0
1

How many different Bytes are there?

How many different states can a byte represent?
 



 
 

Two Bits: 22 = 4 possibilities


0
0
0
1
1
0
1
1

With 2 bits, we can represent  22 = 4 states
 
 
 
 
 
 

Three Bits:  23 = 8 possibilities


0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1



number of bits
number of states
Power of 2
1
2
21
2
4
22
3
8
23
4
16
24
5
32
25
6
64
26
7
128
27
8
256
28
9
512
29
10
1024
210
15
32768
215
16
65536
216



ASCII

The Printables

The Non-Printables

What is a KB?