Lecture 23


JavaScript Variables are Dynamically Typed
Any variable in JavaScript can hold any type of value, and the that type can
change midway through the program


Lecture 24
Design Heuristics


Heuristic
Rule of thumb learned through trial & error
Common sense lesson drawn from experience
Qualitative principle, guideline, general judgment

System
A collection of elements which working together produces a result not achieved
by the things alone

The structure
(in terms of components, connections, constraints) of a product or a process

Lecture 25
Web Design for Usability


Heuristic:
Heuristics don‘t always lead to the best results

What‘s a Good Site?
• The one that achieves the result that it was designed for.

SPEED:
• Users don't read; they scan
• Users don't make optimal choices; they look for the first good-enough solution
• Users don't figure out how things work; they muddle through

Design is Important!
• 62% of shoppers gave up looking for the item they wanted to buy online (Zona
Research)
• 40% visitors don‘t return to a site if their first visit was a -ive experience
(Forrester Research)
• 83% of users have left sites in frustration due to poor navigation, slowness
(NetSmart Research)
• Simple designs have greater impact: they can be understood immediately!
(Mullet/Sano)


Designs should be consistent & predictable (unified)
Website Navigation:
• The interface/controls that a Website provides to the user for accessing various
parts of the Website
A Few Navigation Design Heuristics:
1. Put the main navigation on the left of the page
2. It should be ”invisible‘ until it is wanted
3. It should require an economy of action & time
4. It should remain consistent
5. Labels should be clear, understandable
6. Labels should be legible

Using Motion
1. Use motion to attract the viewer‘s attention
2. Avoid the use of motion for —cosmetic“ purposes
Success is defined by the user, not the builder

Lecture 26
Arrays

:
Array
An indexed list of elements

Arrays in JavaScript
•In JavaScript, arrays are implemented in the form of the ”Array‘ object
•The key property of the ”Array‘ object is ”length‘, i.e the number of elements in
an array
•Two of the key ”Array‘ methods are:
œreverse( )
œsort( )

JavaScript Arrays are Heterogeneous
Unlike many other popular languages, a JavaScript Array can hold elements of
multiple data types, simultaneously

Pseudo Code
1.Declare the array that will be used for storing the words
2.Prompt the user and read the user input into the elements of the array
3.Now write the array to the document
4.Sort the array
5.W rite the sorted array to the document


Lecture 27
Computer Networks


Computer Network
Multiple computers that are connected together to share information and other
resources


Examples of Computer Network Usage
•I can send an eMail message to a remote computer using the SMTP protocol
•I can browse documents residing on a remote computer using the HTTP
protocol
•I can download or upload files to a remote computer using the FTP protocol
•I can run a program on a remote computer using the TELNET protocol

Components of Conventional Computer Networks
1.Computers
2.Network Interface Cards (NIC)
3.Hub
4.Cables
5.Protocol

Hub
•A device that is used to connect several com puters to form a network

Packet
•The smallest unit of data transmitted over a com puter network

Private Networks
•Organizations having many computers usually connect them in the form of
private networks

Public Networks
•All networks that are not private, are … public
•Example: Internet

VPN: Virtual Private Network (1)
• AVPN looks like a secure, private network
•Key benefit of VPNs over conventional PNs: Lower cost

Types of Computer Networks
••LAN: Local Area Network)
•WAN: W ide Area Network)
LAN
•A network of computers located in the same building or a handful of nearby
buildings
WAN
•A network in which computers are separated by great distances, typically a
cross cities or even continents

Router
•A special-purpose computer that directs data traffic when several paths are
available
Bridge
•Used to form a connection between two separate, but sim ilar networks

Gateway

•A special-purpose computer that connects and translates between networks that
use different communications protocols


Modem
•I/O device used for connecting two computers over telephone lines
•modem = modulator + demodulator

Bus
•No server is required
•One computer sends data to another by broadcasting the address of the
receiver and the data over the bus

Ring
•No server is required
•A computer sends the message to its neighbor. The neighbor exam ines the
message to determine if it is the intended recipient

Networking Protocols

•Networks use protocols, or rules, to exchange info through shared channels

Ethernet Protocol
•A computer using this protocol checks if a shared connection is in use before
transmitting a message
•If not, the computer transmits data

Token Ring Protocol
•This protocol passes a special message called a token through the network
Types of Communication Channels
1 . Wire
2 . Wireless

Bandwidth
•Capacity of a communication channel for carrying data
•Measured in bits/s (bps), kb/s, Mb/s, Gb/s, Tb/s
•Optical fiber channels have the highest (1 Tb/s)
•Telephone lines the lowest (56 kb/s)

Firewall
•A system that that guards a private network, enforcing an access/deny policy to all
traffic going to and coming from the Internet


Lecture 28
Introduction to the Internet


Internet
•Enables users located at far-way locations to easily share information with
others located all over the world
Internet Users W orldwide
673M in 2002
1B+ in 2005
1.2M Internet users in Pakistan in 5/2000
In early 2002,
54% of Australian population
51% of Singaporean population
39% of Japanese population
3% of Chinese population
Key Characteristics
Universal Access
Sam e functionality to everyone
Growth Rate
The fastest growing technology ever
Freedom of Speech
Internal rate of return (IRR)
The Digital Advantage
Is digital: can correct errors

Internet Networking Protocols
Communications on the Internet is controlled by a set of two protocols: TCP and IP
TCP/IP Transmission Control Protocol/Internet Protocol

Lecture 29
Functions & Variable Scope


Function
A group of statements that is put together (or defined) once and then can be
used (by reference) repeatedly on a W eb page

Arguments of a Function
•Arguments define the interface between the function and the rest of the W eb
page

Methods
•Methods are functions

Object:
A named collection of properties (data, state) & methods (instructions, behavior)

Event Handlers
•Special-purpose functions that come predefined with JavaScript

Local and Global Variables
Local or Function-level Variable
Effective only in the function in which they are declared


Global Variables
Visible everywhere on the Web page




Lecture 30
Internet Services


IP Address
•A unique identifier for a computer on a TCP/IP network

Domain Names
•A dom ain name is a meaningful, easy-to-remember ”label‘ for an IP address

DNS: Domain Name System
•DNS is the way that Internet domain names are located & translated into IP
addresses
•Maintaining a single, central table of domain name/IP address relationships is
im practical

FTP: File Transfer Protocol
• Used to transfer files between computers on a TCP/IP network (e.g Internet)
Telnet Protocol
• Using Telnet, a user can remotely log on to a computer (connected to the
user‘s through a TCP/IP network, e.g. Internet) & have control over it like a local
user, including control over running various programs

The Web
• The greatest, shared resource of information created by humankind email
• Computer-to-computer messaging

eMail Clients
• Programs used for writing, sending, receiving, and displaying eMail m essages
• Examples: Outlook, Communicator, Hotmail, YahooMail

SMTP: Simple M ail Transfer Protocol
A protocol used to send and receive eMail messages over a TCP/IP network

POP3: Post Office Protocol
• A protocol used for receiving eMail messages

Instant Messaging

• The IM services available on the Internet (e.g. ICQ, AIM, MSN Messenger,
Yahoo! Messenger) allow us to maintain a list of people (contacts) that we
interact with regularly

VoIP: Voice over IP
• Voice delivered from one device to another using the Internet Protocol
Pro
Much cheaper than traditional phone service
Con
Noticeably poor quality of voice as compared with land-line phone service, but
not much worse than cell phone service


Lecture 31
Developing Presentations


Spreadsheets:
• Electronic replacement for ledgers

The Structure of A Spreadsheet:
• Collection of cells arranged in rows and columns

Presentation Development SW :
• One can use a word processor to develop presentations of reasonable quality

Popular SW :
• Microsoft PowerPoint
• CA Harvard Graphics
• Lotus Freelance Graphics
• Corel Presentation


Lecture 32
Event Handling


What is Event Handling?
• Capturing events and responding to them
• The system sends events to the program and the program responds to them as
they arrive

Event Driven Programs:
• Programs that can capture and respond to events are called ”event-driven
programs‘
JavaScript Handling of Events:
• Events handlers are placed in the BODY part of a W eb page as attributes in
HTML tags

In-Line JavaScript Event Handling :
• The event handler attribute consists of 3 parts:
1. The identifier of the event handler
2. The equal sign
3. A string consisting of JavaScript statements enclosed in double or
onFocus & onBlur:
• onFocus executes the specified JavaScript code when a window receives
focus or when a form elem ent receives input focus
• onBlur executes the specified JavaScript code when a window loses focus or a
form element loses focus
onLoad & onUnload:
• onLoad executes the specified JavaScript code when a new document is
loaded into a window
• onUnload executes the specified JavaScript code when a user exits a
document

Lecture 33
Graphics & Animation


Computer Graphics:
• Images created with the help of com puters

Pixel:
• The smallest image forming element on a computer display

Color Mapping :
• Instead of letting each pixel assume one out of 16 million possible colors, only a
limited number of colors œ called the platelet œ are allowed

Dithering:
• In this scheme, pixels of alternating colors are used to simulate a color that is
not present in the platelet

Aliasing:
• The computer screen consists of square-ish pixels arranged in a fixed grid

Anti-Aliasing:
• Anti-aliasing is another technique used for managing the ”staircase‘ effect

Vector or Object-Oriented Graphics:
• Treats everything that is drawn as an object
• Relatively small file size
• Examples: swf, svg, wmf, ps

Bit-Mapped or Raster Graphics:
• Treats everything that is drawn as a bit-m ap
• Relatively large file size
• Examples: gif, jpg, bmp
3-D Graphics:
• Flat images enhanced to impart the illusion of depth

3-D Graphics: Applications:
• Games
• Medical images
• 3-D CAD

3-D Rendering:
• The process of converting information about 3-D objects into a bit-map that can
be displayed on a 2-D computer display

Animation:
• Graphics in motion, e.g. cartoons

Computer Animation: Examples
• Games
• Cartoons, movies
• Visualization of processes, e.g the IM process

Tweening:
• This process of creating these in-between images from key images is called
inbetweening (or tweening for short)


Lecture 34
Intelligent Systems


Genetic Algorithms (2):
An initial set of random solutions is ranked in terms of ability to solve the
problem at hand

Fuzzy Logic:
• Based on the principles of the approximate reasoning faculty that humans use
when faced with linguistic ambiguity
Robotics:
• Automatic machines that perform various tasks that were previously done by
humans
• Example:
1. Pilot-less combat airplanes
2. Land-mine hunters
3. Autonomous vacuum -cleaners
Autonomous Web Agents:
• Also known as mobile agents, softbots
• Computer program that perform s various actions continuously, autonomously
on behalf of their principal!


Lecture 36
Data management


JavaScript doesn‘t support drawing of graphics

Data Entry:
• New titles are added every day
• New customers are being added every day
• That new data needs to be added accurately

Data Updates :
• Old titles are deleted on a regular basis

Data Security :
• The security of the customers‘ personal data is of utmost importance. Hackers
are always looking for that type of data, especially for credit card numbers

Data Integrity:
• Integrity refers to maintaining the correctness and consistency of the data

Data Accessibility:
œ Data be stored in an organized manner
œ Additional info about the data be stored

DBMS :
• A DBMS is the SW system that operates a database, and is not the database
itself

Database:
• A collection of data organized in such a fashion that the computer can quickly
search for a desired data item

Tabular Storage: Features & Possibilities:
• Similar items of data form a column

CONCLUSION:
Tabular storage is better than flat-file storage


Lecture 37
Database Software




Sponsored Links


Relational Databases
•Databases consisting of two or more related tables are called relational
databases

RDBM S
•Relational DBMS software
•Contains facilities for creating, populating, modifying, and querying relational
databases
•Examples:
œAccess
œFileMaker Pro
œSQL Server
œOracle

Some Terminology
•Primary Key is a field that uniquely identifies each record stored in a table
•Queries are used to view, change, and analyze data. They can be used to:
•Forms can be used for entering, editing, or viewing data, one record at a tim e
•Reports are an effective, user-friendly way of presenting data. All DBMSes
provide tools for producing custom reports.
•Data normalization is the process of efficiently organizing data in a database.

Data M ining
•The process of analyzing large databases to identify patterns.


Lecture 39
Cyber Crime


W hat was going on?
•A coordinated, distributed DoS (Denial of Service) attack was taking place

Three Phases of the DoS
1.Search
2.Arm
3.Attack
1. Search for Drones
•The attackers set about acquiring the control over the com puters to be used in
the attack …
•by scanning œ using e.g. Sscan SW œ a large numbers of computers attached to
the Internet
•Once a computer with a weak security scheme is identified, the attackers try a
break-in
•Once conquered, that computer œ called a drone œ will be used to scan others

2. Arming the Drones
•After several drones have been conquered, the DoS SW is loaded on to them
•Examples: Tribal Flood Network, Trinoo, TFN2K
•Like a time-bomb, that SW can be set to bring itself into action at a specified
time

3. The Actual Attack
•At the pre-specified time or on comm and, the SW implanted on all of the drones
wakesup and starts sending a huge number of messages to the targeted servers

Neutralizing the Attack
•They setup filters that blocked all those packets
•It took them around 3 hours to identify and block most of the hostile packets
•BTW , the sender‘s IP address can be spoofed, making it impossible to block the
attack just by blocking the IP addresses

Who Done It?
•The DoS SW is not custom SW , and can be downloaded from the Internet.
Therefore, it is difficult to track the person who launched the attack by analyzing
that SW

DoS Attack: A Cyber Crime
•DoS is a crime, but of a new type - made possible by the existence of the
Internet

Cyber crime can be used to …
•Damage a home computer
•Bring down a business
•Weaken the telecom, financial, or even defense-related systems of a country

Cyberwarfare:
A clear and present threat as well opportunity for all of the world‘s armed force!

M ail Bombing
•A stream of large-sized eMails are sent to an address, overloading the
destination account

Break-Ins
•Hackers are always trying to break-in into Internet-connected computers to steal
info or plant malicious programs

Credit Card Fraud
•A thief somehow breaks into an eCommerce server and gets hold of credit
numbers and related info

Software Piracy
•Using a piece of SW without the author‘s permission or employing it for uses not
allowed by the author is SW piracy

Web Store Spoofing
•A fake Web store (e.g. an online bookstore) is built
•Customers somehow find that Web site and place their orders, giving away their
credit card info in the process



Viruses
•Self-replicating SW that eludes detection and is designed to attach itself to other
files


Anatomy of a Virus
•A virus consists of 2 parts:
•Transmission mechanism
•Payload

Other Virus-Like Programs
•There are other computer program s that are similar to viruses in some ways but
different in some others
•Three types:
œTrojan horses
œLogic- or time-bombs
œWorms

Trojan Horses
•They appear to be something interesting and harmless (e.g. a game) but when
they are executed, destruction results

Logic- or Time-Bombs
•It executes its payload when a predetermined event occurs

Worms
•Harmless in the sense that they only make copies of themselves on the infected
computer
•Harmful in the sense that it can use up available computer resources (i.e. memory,


Lecture 41
Images & Animation


Flash Animation
•Designed for 2-D animations, but can be used for storing static vector-images as
well
•A special program (called a plug-in) is required to view Flash files in a W eb
browser
•Can be used to design complete, anim ated W eb sites with hardly any HTM L in it
•Binary-file storage

Structured Vector Graphics
•New format; may become more popular than Flash
•Plug-in required
•Text-file storage; search engine friendly


Lecture 42
The Computing Profession


IT: Information Technology
The group of technologies concerned with the capture, processing and
transmission of information in the digital-electronic form

W ho is a computing professional?
•Professionals involved in the development and/or maintenance of SW and/or
computer HW
•Computer scientists, software engineers, computer engineers, and some of the
telecoms engineers are generally classified as computing professionals

Development Team
•The number of development teams has varied between 3-7 at this organization
•Team-size has varied between 3-35
•Large team s are organized as a collection of sub-teams
•Lowest-level team: No more than 7 m embers
•Responsible for a project from after the specifications stage till the very end

Project Manager

•Responsibilities:
œPlanning and tracking of the project
œArranging of the appropriate resources
œClient relationship management
•Profile:
œ5+ years of team-lead experience
œProfessional development course(s) in SW project management
œTechnical MS and/or Technical BS + MBA

Team Lead
•Responsibilities:
œPlanning and tracking of the project
œDetailed design
œProfessional development of team m embers
œIn case of small teams, development activities
•Profile:
œ5+ years of development experience
œExcellent interpersonal skills
œGood planning skills
œGood design skills

Developer
•Responsibilities:
Module-level design
Coding
Unit-testing


•Profile:
Technical BS

Executive Team
•CEO œ Chief Executive Officer
œDeveloper of the vision of the organization
•COO œ Chief Operating Officer
œResponsible for the day-to-day operations
œGreat organizational & interpersonal skills
•CM SO œ Chief Marketing & Sales Officer
œResponsible for bringing in work
Configuration Management Team
•2-3 members

Process Team
•1-2 members
•Team‘s goal: To continuously im prove the SW development process to achieve
im provements in cost, schedule, and quality

Quality Assurance Team

•Around 20 members
•Responsible for assuring the quality of all SW (i.e. making sure that it does what
it is supposed to) that is produced at the organization
Technology Transfer Team
•This team is responsible for:
œEvaluating new technologies, products, processes
œSelecting the ones that are right for the organization
œDeveloping an expertise in their use
œIntroducing them in various ongoing/future projects

Support Team
•2-3 members
•Members possess expertise in both HW & SW
Ethics
•Ethics is a collection of heuristics that, when followed, im proves our way of life
Professional Ethics
•Professional ethics are a category of ethics, and here we discus the professional
ethics relevant to computing


Lecture 43
The Future of Computing


The key weakness of the Web?
•The Web (as it currently exists) was designed for humans to read, not for
computers to understand and manipulate meaningfully

•Computers face great problems in dealing with the current text- and graphics-
based content of the Web

Future of the Web: Semantic Web
Whereas, today‘s Web‘s content is designed for humans to read; the Semantic
Web‘s content will be designed for computers to understand meaningfully
However, the Semantic Web is not a replacement but an extension of the present
Web, in which info is given well defined meaning

Holographic Storage
•Digital data stored in and read from a 3-D optical m aterial with the help of lasers
•Depending upon the material, they could be read-only or R/W

Slave _ M aster
•The way things are progressing right now, the roles m ay reverse over a 50-100
year time frame
•Computers may becom e self-replicating, self-healing, and self-programming just
like humans