Acronym for Password Authentication Protocol. A
method for verifying the identity of a user attempting to log on to a
Point-to-Point Protocol (PPP) server. PAP is used if a more rigorous method,
such as the Challenge Handshake Authentication Protocol (CHAP), is not available
or if the user name and password that the user submitted to PAP must be sent to
another program without encryption. 2. Acronym for Printer Access Protocol. The protocol
in AppleTalk networks that governs communication between computers and printers.
Javascript Array
PMA08:41
Creating an Object
We have already seen an example of an Array object being created. To create an Array object, we used the JavaScript statement
var myArray = new Array();
So how is this statement made up?
The first half of the statement is familiar to us. We use the
var keyword to define a variable called myArray. This variable is initialized, using the assignment
operator (=), to the right-hand side of the
statement.
The right-hand side of the statement consists of two parts. First
we have the keyword new. This tells JavaScript that we
want to create a new object. Next we have Array(). This
is the constructor for an Array
object. It tells JavaScript what type of object we want to create. Most objects
have constructors like this. For example, the Date
object has the Date() constructor.
we can pass parameters to the constructor Array() to
add data to our object. For example, to create an Array
object that has three elements containing the data "Paul", "Paula", and "Pauline", we use
var myArray = new Array("Paul", "Paula", "Pauline");
Let's see some more examples, this time using the Date object. The simplest way of creating a Date object is
var myDate = new Date();
This will create a Date object containing
the date and time that it was created. However,
var myDate = new Date("1 Jan 2000");
will create a Date object containing the
date 1 January 2000.
How object data is stored in variables differs from how primitive
data, such as text and numbers, is stored. (Primitive data is the most basic
data possible in JavaScript.) With primitive data, the variable holds the data's
actual value. For example
var myNumber = 23;
means that the variable myNumber will
hold the data 23. However, variables assigned to objects don't hold the actual
data, but rather a reference to the memory address where
the data can be found. This doesn't mean we can get hold of the memory
address—this is something only JavaScript has details of and keeps to itself in
the background. All you need to remember is that when we say that a variable
references an object, this is what we mean. We show this in the following
example:
var myArrayRef = new Array(0, 1, 2); var mySecondArrayRef = myArrayRef; myArrayRef[0] = 100; alert(mySecondArrayRef[0]);
First we set variable myArrayRef
reference to the new array object, and then we set mySecondArrayRef to the same reference—for example, now mySecondArrayRef is set to reference the same array object.
So when we set the first element of the array to 100 as shown here:
myArrayRef [0] = 100;
and display the contents of the first element of the array
referenced in mySecondArrayRef as follows:
alert(mySecondArrayRef[0])
we'll see it also magically has changed to 100! However, as we now
know, it's not magic; it's because both variables referenced the same array
object because when it comes to objects, it's a reference to the object and not
the object stored in a variable. When we did the assignment, it didn't make a
copy of the array object, it simply copied the reference. Contrast that with the
following:
var myVariable = "ABC"; var mySecondVariable = myVariable; myVariable = "DEF"; alert(mySecondVariable);
In this case we're dealing with a string, which is primitive data
type, as are numbers. This time it's the actual data that's stored in the
variable, so when we do this:
var mySecondVariable = myVariable;
mySecondVariable gets its own separate
copy of the data in myVariable. So the alert at the end
will still show mySecondVariable as holding "ABC."
To summarize this section, we create a JavaScript object using the
following basic syntax:
var myVariable = new ObjectName(optional parameters);
Creating a Cookie-Javascript
PMA08:39
To make life easier for ourselves, we'll write a function
that allows us to create a new cookie and set certain of its attributes with
more ease. We'll look at the code first and create an example using it
shortly.
function setCookie(cookieName, cookieValue, cookiePath, cookieExpires) { cookieValue = escape(cookieValue); if (cookieExpires == "") { var nowDate = new Date(); nowDate.setMonth(nowDate.getMonth() + 6); cookieExpires = nowDate.toGMTString(); } if (cookiePath != "") { cookiePath = ";Path=" + cookiePath; } document.cookie = cookieName + "=" + cookieValue + ";expires=" + cookieExpires + cookiePath; }
The secure and domain parts of the cookie string are unlikely to be needed,
so we just allow the name, value, expires, and path parts of a cookie to be set by the function. If we don't
want to set a path or expiration date, we just pass empty strings for those
parameters. If no path is specified, the current directory and its
subdirectories will be the path. If no expiration date is set, we just assume a
date six months from now.
The first line of the function introduces the escape() function, which we've not seen before.
cookieValue = escape(cookieValue);
When we talked about setting the value of a cookie, we mentioned
that certain characters cannot be used directly, such as a semicolon. (This also
applies to the name of the cookie.) To get around this problem, we can use the
built-in escape() and unescape() functions.
alert(escape("2001 a space odyssey;"));
We can see that the spaces have been converted to %20, % indicating that they
represent an escape or special character rather than an actual character, and
that 20 is the ASCII value of the actual character. The
semicolon has been converted to %3B, as we'd
expect.
As we'll see later, when retrieving cookie values we can use the
unescape() function to convert from the encoded version
to plain text.
Back to our function; we next have an if
statement.
if (cookieExpires == "") { var nowDate = new Date(); nowDate.setMonth(nowDate.getMonth() + 6); cookieExpires = nowDate.toGMTString(); }
This deals with the situation where an empty string, "", has been passed for the cookieExpires parameter of the function. Because most of the
time we want a cookie to last longer than the session it's created in, we set a
default value for expires that is six months after the
current date.
Next, if a value other than an empty string ("") has been passed to the function for the cookiePath parameter, we need to add that value when we
create the cookie. We simply put "path=" in front of
any value that has been passed in the cookiePath
parameter.
if (cookiePath != "") { cookiePath = ";Path=" + cookiePath; }
Finally on the last line we actually create the cookie, putting
together the cookieName, cookieValue, cookieExpires, and
cookiePath parts of the string.
document.cookie = cookieName + "=" + cookieValue + ";expires=" + cookieExpires + cookiePath;
We'll be using the setCookie() function
whenever we want to create a new cookie because it makes setting a cookie
slightly easier than having to remember all the parts we want to set. More
importantly, it can be used to set the expiration date to a date six months
ahead of the current date.
For example, to use the function and set a cookie with default
values for expires and path we
just type the following:
setCookie("cookieName","cookieValue","","")
what is X Series for Network Communications
PMA07:36
A set of recommendations adopted by the International
Telecommunication Union Telecommunication Standardization Sector ITU-T,
formerly the CCITT, and International Organization for Standardization ISO for
standardizing equipment and protocols used in both public access and private
computer networks.
Recommendation Number | What It Covers |
X.25 | Interface required to connect a computer to a packet-switched network such as the Internet |
X.75 | Protocols for connecting two public data networks |
X.200 | Seven-layer set of protocols known as the ISO/OSI reference model for standardizing computer-to-computer connections |
X.400 | Format at the ISO/OSI application layer for e-mail messages over various network transports, including Ethernet, X.25, and TCP/IP. Gateways must be used to translate e-mail messages between the X.400 and Internet formats |
X.445 | Asynchronous Protocol Specification, which governs the transmission of X.400 messages over dial-up telephone lines |
X.500 | Protocols for client/server systems that maintain and access directories of users and resources in X.400 form |
X.509 | Digital certificates |
What is MIME?
PMA07:34
Acronym for Multipurpose
Internet Mail Extensions. A protocol widely used on the Internet that
extends the SMTP Simple Mail Transfer Protocol to permit data, such as video,
sound, and binary files, to be transmitted by Internet e-mail without having to
be translated into ASCII format first. This is accomplished by the use of MIME
types, which describe the contents of a document. A MIME-compliant application
sending a file, such as some e-mail programs, assigns a MIME type to the file.
The receiving application, which must also be MIME-compliant, refers to a
standardized list of documents that are organized into MIME types and subtypes
to interpret the content of the file. For instance, one MIME type is text, and it has a number of subtypes, including plain and html. A MIME type of text/html refers to a file that contains text written in HTML.
MIME is part of HTTP, and both Web browsers and HTTP servers use MIME to
interpret e-mail files they send and receive.
What is memory management?
PMA07:32
In operating systems for personal computers, procedures for optimizing the use
of RAM (random access memory). These procedures include selectively storing
data, monitoring it carefully, and freeing memory when the data is no longer
needed. Most current operating systems optimize RAM usage on their own; some
older operating systems, such as early versions of MS-DOS, required the use of
third-party utilities to optimize RAM usage and necessitated that the user be
more knowledgeable about how the operating system and applications used memory.
See also
memory management unit, RAM. 2. In programming, the process of ensuring that a program
releases each chunk of memory when it is no longer needed. In some languages,
such as C and C++, the programmer must keep track of memory usage by the
program. Java, a newer language, automatically frees any chunk of memory that is
not in use. See
also C, C++, garbage collection, Java.
Memory management program :- A program used to store data and programs in system memory, monitor their use, and reassign the freed space following their execution. 2. A program that uses hard disk space as an extension of the random access memory RAM.
Memory management unit :-The hardware that supports the mapping of virtual memory addresses to physical memory addresses. In some systems, such as those based on the 68020, the memory management unit is separate from the processor. In most modern microcomputers, however, the memory management unit is built into the CPU chip. In some systems, the memory management unit provides interfacing between the microprocessor and memory. This type of memory management unit is typically responsible for address multiplexing and, in the case of DRAMs, the refresh cycle. Acronym: MMU. See also physical address, refresh cycle, virtual address.
Memory management program :- A program used to store data and programs in system memory, monitor their use, and reassign the freed space following their execution. 2. A program that uses hard disk space as an extension of the random access memory RAM.
Memory management unit :-The hardware that supports the mapping of virtual memory addresses to physical memory addresses. In some systems, such as those based on the 68020, the memory management unit is separate from the processor. In most modern microcomputers, however, the memory management unit is built into the CPU chip. In some systems, the memory management unit provides interfacing between the microprocessor and memory. This type of memory management unit is typically responsible for address multiplexing and, in the case of DRAMs, the refresh cycle. Acronym: MMU. See also physical address, refresh cycle, virtual address.
What is markup language?
PMA07:30
A set of codes in a text file that instructs a computer
how to format the file on a printer or video display or how to index and link
its contents. Examples of markup languages are Hypertext Markup LanguageHTML
and Extensible Markup Language XML, which are used in Web pages, and Standard
Generalized Markup Language SGML, which is used for typesetting and desktop
publishing purposes and in electronic
documents. Markup languages of this sort are designed to enable documents and other files to be platform-independent and highly portable between applications. See also HTML, SGML, XML.
documents. Markup languages of this sort are designed to enable documents and other files to be platform-independent and highly portable between applications. See also HTML, SGML, XML.
why need For a relational database?
PMA09:49
A database or database management system that stores
information in tables—rows and columns of data—and conducts searches by using
data in specified columns of one table to find additional data in another table.
In a relational database, the rows of a table represent records (collections of
information about separate items) and the columns represent fields (particular
attributes of a record). In conducting searches, a relational database matches
information from a field in one table with information in a corresponding field
of another table to produce a third table that combines requested data from both
tables.
For example, if one table contains the fields EMPLOYEE-ID, LAST-NAME, FIRST-NAME, and HIRE-DATE, and another contains the fields DEPT, EMPLOYEE-ID, and SALARY, a relational database can match the EMPLOYEE-ID fields in the two tables to find such information as the names of all employees earning a certain salary or the departments of all employees hired after a certain date. In other words, a relational database uses matching values in two tables to relate information in one to information in the other. Microcomputer database products typically are relational databases. Compare flat-file database, inverted-list database.
For example, if one table contains the fields EMPLOYEE-ID, LAST-NAME, FIRST-NAME, and HIRE-DATE, and another contains the fields DEPT, EMPLOYEE-ID, and SALARY, a relational database can match the EMPLOYEE-ID fields in the two tables to find such information as the names of all employees earning a certain salary or the departments of all employees hired after a certain date. In other words, a relational database uses matching values in two tables to relate information in one to information in the other. Microcomputer database products typically are relational databases. Compare flat-file database, inverted-list database.
Os registry?
PMA09:47
A central hierarchical database in Windows 9x, Windows
CE, Windows NT, and Windows 2000 used to store information necessary to
configure the system for one or more users, applications, and hardware devices.
The Registry contains information that Windows continually references during
operation, such as profiles for each user, the applications installed on the
computer and the types of documents each can create, property sheet settings for
folders and application icons, what hardware exists on the system, and which
ports are being used.
The Registry replaces most of the text-based .ini files used in Windows 3. x and MS-DOS configuration files, such as AUTOEXEC.BAT and CONFIG.SYS. Although the Registry is common to the several Windows platforms, there are some differences among them. Also called: system registry. See also hierarchical database, .ini, input/output port, property sheet, Registry Editor.
The Registry replaces most of the text-based .ini files used in Windows 3. x and MS-DOS configuration files, such as AUTOEXEC.BAT and CONFIG.SYS. Although the Registry is common to the several Windows platforms, there are some differences among them. Also called: system registry. See also hierarchical database, .ini, input/output port, property sheet, Registry Editor.
Whai is macro?
PMA09:45
In applications, a set of keystrokes and instructions recorded and saved under a
short key code or macro name. When the key code is typed or the macro name is
used, the program carries out the instructions of the macro. Users can create a
macro to save time by replacing an often-used, sometimes lengthy, series of
strokes with a shorter version. 2. In programming languages, such as C or assembly language,
a name that defines a set of instructions that are substituted for the macro
name wherever the name appears in a program a process called macro expansion when the program is compiled or assembled.
Macros are similar to functions in that they can take arguments and in that they are calls to lengthier sets of instructions. Unlike functions, macros are replaced by the actual instructions they represent when the program is prepared for execution; function instructions are copied into a program only once.
Macros are similar to functions in that they can take arguments and in that they are calls to lengthier sets of instructions. Unlike functions, macros are replaced by the actual instructions they represent when the program is prepared for execution; function instructions are copied into a program only once.