Wednesday, 31 December 2008

java is the king

hi

Java is still the number one programming language in the market there are different types of languages available in the computer world but i strongly recommend java as most of the mnc are working on the projects that are puerly run on java so one should go for it rather then waisting time

Monday, 29 December 2008

validations

hi

this is the topic about validation because there are number of ways to add validations but the easiest way is to implement it on client side scripting means its better to implement everything on the javascript but its not an easy way to implement as there are number of new ways that can be used generally the programmming languages uses the server site scripting there are difficulties in implemention of client side scripting

ok bye take care

Parveen Sharma

Tuesday, 23 December 2008

hello dear all

sir /madam

now i m back i will add new lectures on php javascript and html


all these languages are important
take care all

Sunday, 30 November 2008

lecture on database join (simplified)

Join (SQL)
--------------------

SQL JOIN clause combines records from two tables in a relational database, resulting in a new, temporary table, sometimes called a "joined table". A JOIN may also be thought of as a SQL operation that relates tables by means of values common between them. SQL specifies four types of JOIN:

1) INNER Join.
2) OUTER Join.
3) LEFT Join.
4) RIGHT Join.

In special cases, a table (base table, view, or joined table) can JOIN to itself in a self-join.

A programmer writes a JOIN predicate to identify the records for joining. If the predicate evaluates positively, the combined record is inserted into the temporary (or "joined") table. Any predicate supported by SQL can become a JOIN-predicate, for example, WHERE-clauses.

Mathematically, a JOIN provides the fundamental operation in relational algebra and generalizes function composition.

[edit] Sample tables
All subsequent explanations on join types in this article make use of the following two tables. The rows in these tables serve to illustrate the effect of different types of joins and join-predicates. In the following tables, Department.DepartmentID is the primary key, while Employee.DepartmentID is a foreign key.

Employee Table
LastName DepartmentID
Rafferty 31
Jones 33
Steinberg 33
Robinson 34
Smith 34
Jasper NULL
Department Table
DepartmentID DepartmentName
31 Sales
33 Engineering
34 Clerical
35 Marketing


Note: The "Marketing" Department currently has no listed employees. Employee "Jasper" has not been assigned to any Department yet.


Inner join
----------------

An inner join requires each record in the two joined tables to have a matching record.


An inner join essentially combines the records from two tables (A and B) based on a given join-predicate. The result of the join can be defined as the outcome of first taking the Cartesian product (or cross-join) of all records in the tables (combining every record in table A with every record in table B) - then return all records which satisfy the join predicate. Actual SQL implementations will normally use other approaches where possible, since computing the Cartesian product is not very efficient. This type of join occurs most commonly in applications, and represents the default join-type.

SQL specifies two different syntactical ways to express joins. The first, called "explicit join notation", uses the keyword JOIN, whereas the second uses the "implicit join notation". The implicit join notation lists the tables for joining in the FROM clause of a SELECT statement, using commas to separate them. Thus, it specifies a cross-join, and the WHERE clause may apply additional filter-predicates. Those filter-predicates function comparably to join-predicates in the explicit notation.

One can further classify inner joins as equi-joins, as natural joins, or as cross-joins (see below).

Programmers should take special care when joining tables on columns that can contain NULL values, since NULL will never match any other value (or even NULL itself), unless the join condition explicitly uses the IS NULL or IS NOT NULL predicates.

As an example, the following query takes all the records from the Employee table and finds the matching record(s) in the Department table, based on the join predicate. The join predicate compares the values in the DepartmentID column in both tables. If it finds no match (i.e., the department-id of an employee does not match the current department-id from the Department table), then the joined record remains outside the joined table, i.e., outside the (intermediate) result of the join.

Example of an explicit inner join:

SELECT *
FROM employee
INNER JOIN department
ON employee.DepartmentID = department.DepartmentID
Is equivalent to:

SELECT *
FROM employee, department
WHERE employee.DepartmentID = department.DepartmentID
Explicit Inner join result:

Employee.LastName Employee.DepartmentID Department.DepartmentName Department.DepartmentID
Smith 34 Clerical 34
Jones 33 Engineering 33
Robinson 34 Clerical 34
Steinberg 33 Engineering 33
Rafferty 31 Sales 31

Notice that the employee "Jasper" and the department "Marketing" do not appear. Neither of these has any matching records in the respective other table: "Jasper" has no associated department and no employee has the department ID 35. Thus, no information on Jasper or on Marketing appears in the joined table. Depending on the desired results, this behavior may be a subtle bug. Outer joins may be used to avoid it.


Types of inner joins
---------------------------------


Equi-join
-------------------
An equi-join, also known as an equijoin, is a specific type of comparator-based join, or theta join, that uses only equality comparisons in the join-predicate. Using other comparison operators (such as <) disqualifies a join as an equi-join. The query shown above has already provided an example of an equi-join:

SELECT Employee.lastName, Employee.DepartmentID, Department.DepartmentName
FROM Employee INNER JOIN Department
ON Employee.DepartmentID = Department.DepartmentID
ORDER BY Employee.lastName;
The resulting joined table contains two columns named DepartmentID, one from table Employee and one from table Department

SQL:2003 does not have a specific syntax to express equi-joins, but some database engines provide a shorthand syntax: for example, MySQL and PostgreSQL support USING(DepartmentID) in addition to the ON ... syntax.


Natural join
----------------------
A natural join offers a further specialization of equi-joins. The join predicate arises implicitly by comparing all columns in both tables that have the same column-name in the joined tables. The resulting joined table contains only one column for each pair of equally-named columns.

The above sample query for inner joins can be expressed as a natural join in the following way:

SELECT *
FROM employee NATURAL JOIN department
The result appears slightly different, however, because only one DepartmentID column occurs in the joined table.

DepartmentID Employee.LastName Department.DepartmentName
34 Smith Clerical
33 Jones Engineering
34 Robinson Clerical
33 Steinberg Engineering
31 Rafferty Sales
This section may contain original research or unverified claims.
Please help Wikipedia by adding references. See the talk page for details.(August 2008)

Using the NATURAL JOIN keyword to express joins can suffer from ambiguity at best, and could, in the case of poor coding or design, leave systems open to problems if schema changes occur in the database. For example, the removal, addition, or renaming of columns changes the semantics of a natural join. Thus, the safer approach involves explicitly coding the join-condition using a regular inner join, but such problems are likely to show in the cases of poor design.

The Oracle database implementation of SQL selects the appropriate column in the naturally-joined table from which to gather data. An error-message such as "ORA-25155: column used in NATURAL join cannot have qualifier" is an error to help prevent or reduce the problems that could occur may encourage checking and precise specification of the columns named in the query, and can also help in providing compile time checking (instead of errors in query).


Cross join
----------------
A cross join, cartesian join or product provides the foundation upon which all types of inner joins operate. A cross join returns the cartesian product of the sets of records from the two joined tables. Thus, it equates to an inner join where the join-condition always evaluates to True or join-condition is absent in statement.

If A and B are two sets, then the cross join is written as A × B.

The SQL code for a cross join lists the tables for joining (FROM), but does not include any filtering join-predicate.

Example of an explicit cross join:

SELECT *
FROM employee CROSS JOIN department
Example of an implicit cross join:

SELECT *
FROM employee, department;
Employee.LastName Employee.DepartmentID Department.DepartmentName Department.DepartmentID
Rafferty 31 Sales 31
Jones 33 Sales 31
Steinberg 33 Sales 31
Smith 34 Sales 31
Robinson 34 Sales 31
Jasper NULL Sales 31
Rafferty 31 Engineering 33
Jones 33 Engineering 33
Steinberg 33 Engineering 33
Smith 34 Engineering 33
Robinson 34 Engineering 33
Jasper NULL Engineering 33
Rafferty 31 Clerical 34
Jones 33 Clerical 34
Steinberg 33 Clerical 34
Smith 34 Clerical 34
Robinson 34 Clerical 34
Jasper NULL Clerical 34
Rafferty 31 Marketing 35
Jones 33 Marketing 35
Steinberg 33 Marketing 35
Smith 34 Marketing 35
Robinson 34 Marketing 35
Jasper NULL Marketing 35

The cross join does not apply any predicate to filter records from the joined table. Programmers can further filter the results of a cross join by using a WHERE clause.


[edit] Outer joins
An outer join does not require each record in the two joined tables to have a matching record. The joined table retains each record—even if no other matching record exists. Outer joins subdivide further into left outer joins, right outer joins, and full outer joins, depending on which table(s) one retains the rows from (left, right, or both).

(For a table to qualify as left or right its name has to appear after the FROM or JOIN keyword, respectively.)

No implicit join-notation for outer joins exists in SQL:2003.


[edit] Left outer join
The result of a left outer join (or simply left join) for tables A and B always contains all records of the "left" table (A), even if the join-condition does not find any matching record in the "right" table (B). This means that if the ON clause matches 0 (zero) records in B, the join will still return a row in the result—but with NULL in each column from B. This means that a left outer join returns all the values from the left table, plus matched values from the right table (or NULL in case of no matching join predicate).

For example, this allows us to find an employee's department, but still to show the employee even when their department does not exist (contrary to the inner-join example above, where employees in non-existent departments are excluded from the result).

Example of a left outer join, with the additional result row italicized:

SELECT *
FROM employee LEFT OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
Employee.LastName Employee.DepartmentID Department.DepartmentName Department.DepartmentID
Jones 33 Engineering 33
Rafferty 31 Sales 31
Robinson 34 Clerical 34
Smith 34 Clerical 34
Jasper NULL NULL NULL
Steinberg 33 Engineering 33


[edit] Right outer joins
A right outer join (or right join) closely resembles a left outer join, except with the tables reversed. Every record from the "right" table (B) will appear in the joined table at least once. If no matching row from the "left" table (A) exists, NULL will appear in columns from A for those records that have no match in A.

A right outer join returns all the values from the right table and matched values from the left table (NULL in case of no matching join predicate).

For example, this allows us to find each employee and their department, but still show departments that have no employees.

Example right outer join, with the additional result row italicized:

SELECT *
FROM employee RIGHT OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
Employee.LastName Employee.DepartmentID Department.DepartmentName Department.DepartmentID
Smith 34 Clerical 34
Jones 33 Engineering 33
Robinson 34 Clerical 34
Steinberg 33 Engineering 33
Rafferty 31 Sales 31
NULL NULL Marketing 35


[edit] Full outer join
A full outer join combines the results of both left and right outer joins. The joined table will contain all records from both tables, and fill in NULLs for missing matches on either side.

For example, this allows us to see each employee who is in a department and each department that has an employee, but also see each employee who is not part of a department and each department who doesn't have an employee.

Example full outer join:

SELECT *
FROM employee
FULL OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
Employee.LastName Employee.DepartmentID Department.DepartmentName Department.DepartmentID
Smith 34 Clerical 34
Jones 33 Engineering 33
Robinson 34 Clerical 34
Jasper NULL NULL NULL
Steinberg 33 Engineering 33
Rafferty 31 Sales 31
NULL NULL Marketing 35

Some database systems like db2 (version 2 and before) do not support this functionality directly, but they can emulate it through the use of left and right outer joins and unions. The same example can appear as follows:

SELECT *
FROM employee
LEFT JOIN department
ON employee.DepartmentID = department.DepartmentID
UNION
SELECT *
FROM employee
RIGHT JOIN department
ON employee.DepartmentID = department.DepartmentID
WHERE employee.DepartmentID IS NULL
or as follows:

SELECT *
FROM employee
LEFT JOIN department
ON employee.DepartmentID = department.DepartmentID
UNION
SELECT *
FROM department
LEFT JOIN employee
ON employee.DepartmentID = department.DepartmentID
WHERE employee.DepartmentID IS NULL
or as follows:

SELECT *
FROM department
RIGHT JOIN employee
ON employee.DepartmentID = department.DepartmentID
UNION
SELECT *
FROM employee
RIGHT JOIN department
ON employee.DepartmentID = department.DepartmentID
WHERE employee.DepartmentID IS NULL
Note: UNION=UNION ALL in above examples


[edit] Self-join
A self-join is joining a table to itself.[1] This is best illustrated by the following example.

Example

A query to find all pairings of two employees in the same country is desired. If you had two separate tables for employees and a query which requested employees in the first table having the same country as employees in the second table, you could use a normal join operation to find the answer table. However, all the employee information is contained within a single large table. [2]

Considering a modified Employee table such as the following:

Employee Table EmployeeID LastName Country DepartmentID
123 Rafferty Australia 31
124 Jones Australia 33
145 Steinberg Australia 33
201 Robinson United States 34
305 Smith United Kingdom 34
306 Jasper United Kingdom NULL



An example solution query could be as follows:

SELECT F.EmployeeID, F.LastName, S.EmployeeID, S.LastName, F.Country
FROM Employee F, Employee S
WHERE F.Country = S.Country
AND F.EmployeeID < S.EmployeeID
ORDER BY F.EmployeeID, S.EmployeeID;
Which results in the following table being generated.

Employee Table after Self-join by Country EmployeeID LastName EmployeeID LastName Country
123 Rafferty 124 Jones Australia
123 Rafferty 145 Steinberg Australia
124 Jones 145 Steinberg Australia
305 Smith 306 Jasper United Kingdom

For this example, note that:

F and S are aliases for the first and second copies of the employee table.
The condition F.Country = S.Country excludes pairings between employees in different countries. The example question only wanted pairs of employees in the same country.
The condition F.EmployeeID < S.EmployeeID excludes pairings where the EmployeeIDs are the same.
F.EmployeeID < S.EmployeeID also excludes duplicate pairings. Without it only the following less useful part of the table would be generated (for the United Kingdom only shown):
EmployeeID LastName EmployeeID LastName Country
305 Smith 305 Smith United Kingdom
305 Smith 306 Jasper United Kingdom
306 Jasper 305 Smith United Kingdom
306 Jasper 306 Jasper United Kingdom

Only one of the two middle pairings is needed to satisfy the original question, and the topmost and bottommost are of no interest at all in this example.


[edit] Alternatives
The effect of outer joins can also be obtained using correlated subqueries. For example

SELECT employee.LastName, employee.DepartmentID, department.DepartmentName
FROM employee LEFT OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID
can also be written as

SELECT employee.LastName, employee.DepartmentID,
(SELECT department.DepartmentName
FROM department
WHERE employee.DepartmentID = department.DepartmentID )
FROM employee...........

[edit] Implementation
Much work in database-systems has aimed at efficient implementation of joins, because relational systems commonly call for joins, yet face difficulties in optimising their efficient execution. The problem arises because (inner) joins operate both commutatively and associatively. In practice, this means that the user merely supplies the list of tables for joining and the join conditions to use, and the database system has the task of determining the most efficient way to perform the operation. A query optimizer determines how to execute a query containing joins. A query optimizer has two basic freedoms:

Join order: Because joins function commutatively and associatively, the order in which the system joins tables does not change the final result-set of the query. However, join-order does have an enormous impact on the cost of the join operation, so choosing the best join order becomes very important.
Join method: Given two tables and a join condition, multiple algorithms can produce the result-set of the join. Which algorithm runs most efficiently depends on the sizes of the input tables, the number of rows from each table that match the join condition, and the operations required by the rest of the query.
Many join-algorithms treat their inputs differently. One can refer to the inputs to a join as the "outer" and "inner" join operands, or "left" and "right", respectively. In the case of nested loops, for example, the database system will scan the entire inner relation for each row of the outer relation.

One can classify query-plans involving joins as follows:

left-deep
using a base table (rather than another join) as the inner operand of each join in the plan
right-deep
using a base table as the outer operand of each join in the plan
bushy
neither left-deep nor right-deep; both inputs to a join may themselves result from joins
These names derive from the appearance of the query plan if drawn as a tree, with the outer join relation on the left and the inner relation on the right (as convention dictates).


[edit] Join algorithms
Three fundamental algorithms exist for performing a join operation.


[edit] Nested loops
Please refer to main articles: Nested loop join and block nested loop
Use of nested loops produces the simplest join-algorithm. For each tuple in the outer join relation, the system scans the entire inner-join relation and appends any tuples that match the join-condition to the result set. Naturally, this algorithm performs poorly with large join-relations: inner or outer or both. An index on columns in the inner relation in the join-predicate can enhance performance.

The block nested loops (BNL) approach offers a refinement to this technique: for every block in the outer relation, the system scans the entire inner relation. For each match between the current inner tuple and one of the tuples in the current block of the outer relation, the system adds a tuple to the join result-set. This variant means doing more computation for each tuple of the inner relation, but far fewer scans of the inner relation.


Merge join
-------------------
If both join relations come in order, sorted by the join attribute(s), the system can perform the join trivially, thus:

Consider the current "group" of tuples from the inner relation; a group consists of a set of contiguous tuples in the inner relation with the same value in the join attribute.
For each matching tuple in the current inner group, add a tuple to the join result. Once the inner group has been exhausted, advance both the inner and outer scans to the next group.
Merge joins offer one reason why many optimizers keep track of the sort order produced by query plan operators—if one or both input relations to a merge join arrives already sorted on the join attribute, the system need not perform an additional sort. Otherwise, the DBMS will need to perform the sort, usually using an external sort to avoid consuming too much memory.

WAP AND WML SIMPLIFIED

The WAP protocol was designed to show internet contents on wireless clients, like mobile phones.
------------------------------------------------------------
What You Should Already Know
Before you continue you should have a basic understanding of the following:
HTML
JavaScript
XML
--------------------------------------------------------------------------------

What is WAP?
The wireless industry came up with the idea of WAP. The point of this standard was to show internet contents on wireless clients, like mobile phones.

WAP stands for Wireless Application Protocol
WAP is an application communication protocol
WAP is used to access services and information
WAP is inherited from Internet standards
WAP is for handheld devices such as mobile phones
WAP is a protocol designed for micro browsers
WAP enables the creating of web applications for mobile devices.
WAP uses the mark-up language WML (not HTML)
WML is defined as an XML 1.0 application

--------------------------------------------------------------------------------

The Wireless Application Protocol
The WAP protocol is the leading standard for information services on wireless terminals like digital mobile phones.

The WAP standard is based on Internet standards (HTML, XML and TCP/IP). It consists of a WML language specification, a WMLScript specification, and a Wireless Telephony Application Interface (WTAI) specification.

WAP is published by the WAP Forum, founded in 1997 by Ericsson, Motorola, Nokia, and Unwired Planet. Forum members now represent over 90% of the global handset market, as well as leading infrastructure providers, software developers and other organizations. You can read more about the WAP forum at our WAP Forum page.


--------------------------------------------------------------------------------

WAP Micro Browsers
To fit into a small wireless terminal, WAP uses a Micro Browser.

A Micro Browser is a small piece of software that makes minimal demands on hardware, memory and CPU. It can display information written in a restricted mark-up language called WML.

The Micro Browser can also interpret a reduced version of JavaScript called WMLScript.


--------------------------------------------------------------------------------

What is WML?
WML stands for Wireless Markup Language. It is a mark-up language inherited from HTML, but WML is based on XML, so it is much stricter than HTML.

WML is used to create pages that can be displayed in a WAP browser. Pages in WML are called DECKS. Decks are constructed as a set of CARDS.


--------------------------------------------------------------------------------

What is WMLScript?
WML uses WMLScript to run simple code on the client. WMLScript is a light JavaScript language. However, WML scripts are not embedded in the WML pages. WML pages only contains references to script URLs. WML scripts need to be compiled into byte code on a server before they can run in a WAP browser.

Visit our WMLScript tutorial to learn more about scripting in WML documents.


--------------------------------------------------------------------------------

Examples of WAP use
Checking train table information
Ticket purchase
Flight check in
Viewing traffic information
Checking weather conditions
Looking up stock values
Looking up phone numbers
Looking up addresses
Looking up sport results

--------------------------------------------------------------------------------


WAP Simplification
------------------------------

WAP is an open international standard for application layer network communications in a wireless communication environment. Its main use is to enable access to the Internet (HTTP) from a mobile phone or PDA.

A WAP browser provides all of the basic services of a computer based web browser but simplified to operate within the restrictions of a mobile phone, such as its smaller view screen. WAP sites are websites written in, or dynamically converted to, WML (Wireless Markup Language) and accessed via the WAP browser.

Before the introduction of WAP, service providers had extremely limited opportunities to offer interactive data services. Interactive data applications are required to support now commonplace activities such as:

Email by mobile phone
Tracking of stock market prices
Sports results
News headlines
Music downloads



Another lesson on WAP
------------------------------------
The original WAP was a simple platform for access to web-like WML services and e-mail using mobile phones in Europe and the SE Asian regions and continues today with a considerable user base. The later versions of WAP were primarily for the United States region and was designed for a different requirement - to enable full web XHTML access using mobile devices with a higher specification and cost, and with a higher degree of software complexity.

There has been considerable discussion about whether the WAP protocol design was appropriate. Some have suggested that the bandwidth-sparing simple interface of Gopher would be a better match for mobile phones and Personal digital assistants (PDAs).

The initial design of WAP was specifically aimed at protocol independence across a range of different protocols (SMS, IP over PPP over a circuit switched bearer, IP over GPRS, etc). This has led to a protocol considerably more complex than an approach directly over IP might have caused.

Most controversial, especially for many from the IP side, was the design of WAP over IP. WAP's transmission layer protocol, WTP, uses its own retransmission mechanisms over UDP to attempt to solve the problem of inadequacy using TCP over high packet loss networks.



WML BASICS
---------------
Wireless Markup Language
----------------------------------------

Evolution of mobile web standardsWireless Markup Language, based on XML, is a markup language intended for devices that implement the Wireless Application Protocol (WAP) specification, such as mobile phones, and preceded the use of other markup languages now used with WAP, such as XHTML and even standard HTML (which are gaining in popularity as processing power in mobile devices increases).

Contents
1 WML history
2 WML markup
3 Criticism
4 References
5 See also
6 External links



WML history
Building on Openwave's HDML, Nokia's "Tagged Text Markup Language" (TTML) and Ericsson's proprietary markup language for mobile content, the WAP Forum created the WML 1.1 standard in 1998[1]. WML 2.0 was specified in 2001[2] , but has not been widely adopted. It was an attempt at bridging WML and XHTML Basic before the WAP 2.0 spec was finalized [3]. In the end, XHTML Mobile Profile became the markup language used in WAP 2.0. The newest WML version in active use is 1.3.


WML markup
WML documents are XML documents that validate against the WML DTD (Document Type Definition)[4] . The W3C Markup Validation service (http://validator.w3.org/) can be used to validate WML documents (they are validated against their declared document type).
Wireless Markup Language is a lot like HTML (Hyper Text Markup Language) in that it provides navigational support, data input, hyperlinks, text and image presentation, and forms. A WML document is known as a “deck”. Data in the deck is structured into one or more “cards” (pages) – each of which represents a single interaction with the user. The introduction of the terms "deck" and "card" into the internet and mobile phone communities was a result of the user interface software and its interaction with wireless communications services having to comply with the requirements of the laws of two or more nations.[citation needed]

WML decks are stored on an ordinary web server trivially configured to serve the text/vnd.wap.wml MIME type in addition to plain HTML and variants. The WML cards when requested by a device are accessed by a bridge WAP gateway, which sits between mobile devices and the World Wide Web, passing pages from one to the other much like a proxy. The gateways send the WML pages on in a form suitable for mobile device reception (WAP Binary XML). This process is hidden from the phone, so it may access the page in the same way as a browser accesses HTML, using a URL (for example, http://example.com/foo.wml). (Provided the mobile phone operator has not specifically locked the phone to prevent access of user-specified URLs.)

WML has a scaled down set of procedural elements which can be used by the author to control navigation to other cards.

It is an error and misconception to think of WML as a pinhole view of the Internet. The real power and value of WML is that it provides an interface for the phone hardware to initiate a call based on web content requested by user query. Consider a service that lets you enter a zip code, and obtain a list of clickable phone numbers of pizza parlors and taxicabs in your immediate location:

Mobile devices are moving towards support for greater amounts of XHTML and even standard HTML as processing power in handsets increases. These standards are concerned with formatting and presentation. They do not however address cell-phone or mobile device hardware interfacing in the same way as WML.

Friday, 28 November 2008

Introduction to Scripting language Web Browser etc


Scripting Language
-----------------------------



A scripting language, script language or extension language, is a programming language that allows some control of a single or many software application(s). "Scripts" are often treated as distinct from "programs", which execute independently from any other application. At the same time they are distinct from the core code of the application, which is usually written in a different language, and by being accessible to the end user they enable the behavior of the application to be adapted to the user's needs. Scripts are often, but not always, interpreted from the source code or "semi-compiled" to byte code which is interpreted, unlike the applications they are associated with, which are traditionally compiled to native machine code for the system on which they run. Scripting languages are nearly always embedded in the application with which they are associated.

The name "script" is derived from the written script of the performing arts, in which dialogue is set down to be spoken by human actors. Early script languages were often called batch languages or job control languages. Such early scripting languages were created to shorten the traditional edit-compile-link-run process.





Web browsers

-----------------------------




Main article: Client-side scripting


Web browsers are typically used to render HTML, but in time a host of special-purpose languages has developed to control their operation. These include ECMAScript, a very versatile procedural scripting language superficially resembling Java; Cascading style sheets, which enable style metadata to be abstracted from content; XML which can be used for content in conjunction with style metadata, as an alternative to HTML; and XSLT, a presentation language that transforms XML content into a new form. Techniques involving the combination of XML and JavaScript scripting to improve the user's subjective impression of responsiveness have become significant enough to acquire a name: AJAX. The Document Object Model standard ensures that all browsers respond in a predictable manner to the same JavaScript.

The Mozilla project has developed its own system for extending the user interface of the browser itself, called XUL.








Web servers
--------------------






On the server side of the HTTP link, application servers and other dynamic content servers such as Web content management systems provide content through a large variety of techniques and technologies typified by the scripting approach. Particularly prominent in this area are PHP, Coldfusion and ASP, but other developments such as Ruby on Rails have carved out a niche.



Text processing languages
---------------------------------------




The processing of text-based records is one of the oldest uses of scripting languages. Many, such as Unix's awk, sed, and grep were originally designed to aid programmers in automating tasks that involved Unix text-based configuration and log files. Of primary importance here is the regular expression, a language developed for the formal description of the lexical structure of text, and used by all of these tools.

Perl was originally designed to overcome the limitations of these tools, but has grown to be one of the most widespread general purpose scripting languages.



General-purpose dynamic languages
---------------------------------------------



Some languages, such as Perl, began as scripting languages but were developed into programming languages suitable for broader purposes. Other similar languages – frequently interpreted, memory-managed, or dynamic – have been described as "scripting languages" for these similarities, even if they are more commonly used for applications programming. They are usually not called "scripting languages" by their own users.

introduction to html (must read article)

Introduction to html

Markup
--------------
Markup is the information that is added to a document to convey information about the documents structure or presentation . markup languages are all arround us in everyday computing. while you may not see it , word processing document are filled with html code indicating the structure and presentation of the document . (what you see on your screen just looks like a page of text) but the formatting is done "behind the scenes"
by the markup(HTML) and its successor,XHTML, are the not so behind the scenes markup language that are used to tell web browser how to structure and some may say display web pages.

HTML
----------------
HTML (HyperText Markup Language) is the predominant markup language for Web pages. It provides a means to describe the structure of text-based information in a document — by denoting certain text as links, headings, paragraphs, lists, and so on — and to supplement that text with interactive forms, embedded images, and other objects. HTML is written in the form of tags, surrounded by angle brackets. HTML can also describe, to some degree, the appearance and semantics of a document, and can include embedded scripting language code (such as JavaScript) which can affect the behavior of Web browsers and other HTML processors.

Extension of html pages is html or htm.

Origins
--------------
Tim Berners-LeeIn 1980,


physicist Tim Berners-Lee,
who was an independent contractor at CERN, proposed and prototyped ENQUIRE, a system for CERN researchers to use and share documents. In 1989, Berners-Lee and CERN data systems engineer Robert Cailliau each submitted separate proposals for an Internet-based hypertext system providing similar functionality. The following year, they collaborated on a joint proposal, the WorldWideWeb (W3) .



First specifications
-------------------------------
The first publicly available description of HTML was a document called HTML Tags, first mentioned on the Internet by Berners-Lee in late 1991. It describes 22 elements comprising the initial, relatively simple design of HTML. Thirteen of these elements still exist in HTML 4.

Berners-Lee considered HTML to be, at the time, an application of SGML(standard generalized markup language), but it was not formally defined as such until the mid-1993 publication, by the IETF(internet engineering task force), of the first proposal for an HTML specification: Berners-Lee and Dan Connolly's "Hypertext Markup Language (HTML)" Internet-Draft, which included an SGML Document Type Definition to define the grammar.[5] The draft expired after six months, but was notable for its acknowledgment of the NCSA Mosaic browser's custom tag for embedding in-line images, reflecting the IETF's philosophy of basing standards on successful prototypes.[6] Similarly, Dave Raggett's competing Internet-Draft, "HTML+ (Hypertext Markup Format)", from late 1993, suggested standardizing already-implemented features like tables and fill-out forms.

After the HTML and HTML+ drafts expired in early 1994, the IETF created an HTML Working Group, which in 1995 completed "HTML 2.0", the first HTML specification intended to be treated as a standard against which future implementations should be based.[6] Published as Request for Comments 1866, HTML 2.0 included ideas from the HTML and HTML+ drafts.[8] There was no "HTML 1.0"; the 2.0 designation was intended to distinguish the new edition from previous drafts.

Further development under the auspices of the IETF was stalled by competing interests. Since 1996, the HTML specifications have been maintained, with input from commercial software vendors, by the World Wide Web Consortium (W3C).[10] However, in 2000, HTML also became an international standard . The last HTML specification published by the W3C is the HTML 4.01 Recommendation, published in late 1999. Its issues and errors were last acknowledged by errata published in 2001.

Thursday, 27 November 2008

Introduction to css <>

Introduction to css

Style sheet basics


---------------------------
A style sheet associates look or formatting to a particular

piece of content in document . in the case of css style sheet

relay

on an underline markup structure such as xhtml .
they are not a replacement of markup.


Without a binding to an element , a style really does not

mean anything the purpose of a style sheet is to create a

presentation for a particular element or a set of elements.
Binding an element to a style specification is a very simple
it consist of a selector in this case simply the element name

followed by its associated style information (called rules)
with in curly braces . the rules are composed of properties

name and prooperty value separated by coulmns with each

rule in turn being seprated by semicolon . The basic syntax

is as follows.

selector {property1: value1; property2: value;.......}
for example

<.style type="text/css">
h1{font-size:21pt;color:red;}
<./style>
on some of the browsers this may also work

Most of the times style tag is given outof html or in the head

tag but in internet explorer it can be written any where it

works forward only.

Note: Final rule in a list of style properties doesnt require

semicolon.

The syntax should be followed by the programmer is

h1
{
font-size: 21pt ;
color : red ;
font-family : Impact ;
}





Different Types of Styles
-----------------------------------
1) External Style sheet
-----------------------------



Syntax
---------
<.link rel="stylesheet" type="text/css" href="main.css" />

Note:
a) Type property is optional in most of the browsers.
b)href property is the name of the stylesheet file which is

already constructed.


Example of style sheet file

File Name : main.css.
File Extension : should be css.
code:
font
{
font-size:23pt;
font-face:Verdana;
}
h1
{
font-size:34pt;
font-face:Times;
}
First of all in a note padtype the above code and save the

file with css extension example main.css

After That
---------------
In html file where u want to use this style sheet just mention

the link with the link tag in head tag as follows

File Name:Sample.html
extension:html
<.html>
<.head>
<.link rel="stylesheet" type="text/css" href="main.css"/>
<./head>
<.body>
<.font>
Testing the font
<./font>
<.h1>
Testing the header
<./h1>


Purpose
-------------
Can set style for many documents with one style sheet

style information cached by the browser.

Concern
-------------

Require extradownload time for the style sheet ,
which might delay the page rendering or in case of import
cause a rendering flash.


2) Document Wide Style
-------------------------------------
<.style type="text/css">
body{
color:red;
font-size:21pt
}
<./style>



This syntax can be used with in the html outof the html tag or

in the head tag

in the above example body tag is having setting color is red
and font size is 21 point what ever u are mentioning in the

tag is considered as the part of the body .

Purpose
--------------
Can easily control the style document by document
No extra file is require

Concern
---------------
Need to reapply style information for other documents


3)Inline Styles
------------------------




Example
<.p style="color:red">Test



Purpose
-----------
1) Can easily control style to a single character
instance.
2)Overrides any external or document styles.

Concern
--------------
1)Need to reapply style information
throughtout the document and outside the
document

2)Bound to closely to the markup difficult to update

Wednesday, 26 November 2008

Introduction to PHP With history (must read article)

Language by Rasmus Lerdorf and Andi Gutmans
Zend provides a certification program for programmers to become certified PHP developers.

PHP
Introduction
-----------------
PHP is a scripting language originally designed for producing dynamic web pages. It has evolved to include a command line interface capability and can be used in standalone graphical applications.

While PHP was originally created by Rasmus Lerdorf in 1995, the main implementation of PHP is now produced by The PHP Group and serves as the de facto standard for PHP as there is no formal specification.[4] PHP is free software released under the PHP License, however it is incompatible with the GPL due to restrictions on the usage of the term PHP.


History

Rasmus Lerdorf, who wrote the original Common Gateway Interface binaries
Andi Gutmans and Zeev Suraski, who rewrote the parser that formed PHP 3
PHP originally stood for Personal Home Page.It began in 1994 as a set of Common Gateway Interface binaries written in the C programming language by the Danish/Greenlandic programmer Rasmus Lerdorf. Lerdorf initially created these Personal Home Page Tools to replace a small set of Perl scripts he had been using to maintain his personal homepage. The tools were used to perform tasks such as displaying his résumé and recording how much traffic his page was receiving. He combined these binaries with his Form Interpreter to create PHP/FI, which had more functionality. PHP/FI included a larger implementation for the C programming language and could communicate with databases, enabling the building of simple, dynamic web applications. Lerdorf released PHP publicly on June 8, 1995 to accelerate bug location and improve the code. This release was named PHP version 2 and already had the basic functionality that PHP has today. This included Perl-like variables, form handling, and the ability to embed HTML. The syntax was similar to Perl but was more limited, simpler, and less consistent.

Zeev Suraski and Andi Gutmans, two Israeli developers at the Technion IIT, rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive initialism PHP: Hypertext Preprocessor.[4] The development team officially released PHP/FI 2 in November 1997 after months of beta testing. Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999.[11] They also founded Zend Technologies in Ramat Gan, Israel.

On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released.[4] On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.[12] The most recent update released by The PHP Group is for the older PHP version 4 code branch. As of August, 2008 this branch is up to version 4.4.9. PHP 4 is no longer under development nor will any security updates be released.
In 2008, PHP 5 became the only stable version under development. Late static binding has been missing from PHP and will be added in version 5.3.[15][16] PHP 6 is under development alongside PHP 5. Major changes include the removal of register_globals,[17] magic quotes, and safe mode.
PHP does not have complete native support for Unicode or multibyte strings;[19] unicode support will be included in PHP 6.[20] Many high profile open source projects ceased to support PHP 4 in new code as of February 5, 2008, due to the GoPHP5 initiative, provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5.

It runs in both 32-bit and 64-bit environments, but on Windows the only official distribution is 32-bit, requiring Windows 32-bit compatibility mode to be enabled while using IIS in a 64-bit Windows environment. There is a third-party distribution available for 64-bit Windows




Description
-----------------
PHP is a general-purpose scripting language that is especially suited for web development. PHP generally runs on a web server, taking PHP code as its input and creating web pages as output.
It can also be used for
command-line scripting
client-side GUI applications
PHP can be deployed on most web servers, many operating systems and platforms, and can be used with many relational database management systems.





It is available free of charge, and the PHP Group provides the complete source code for users to build, customize and extend for their own use.


PHP primarily acts as a filter, taking input from a file or stream containing text and/or PHP instructions and outputs another stream of data; most commonly the output will be HTML. It can automatically detect the language of the user. From PHP 4, the PHP parser compiles input to produce bytecode for processing by the Zend Engine, giving improved performance over its interpreter predecessor.

Originally designed to create dynamic web pages, PHP's principal focus is server-side scripting, and it is similar to other server-side scripting languages that provide dynamic content from a web server to a client, such as Microsoft's ASP.NET system, Sun Microsystems' JavaServer Pages. PHP has also attracted the development of many frameworks that provide building blocks and a design structure to promote rapid application development (RAD). Some of these include


CakePHP

PRADO

Symfony

Zend Framework

smarty

xamp


offering features similar to other web application frameworks.




Syntax Of Php


Syntax-highlighted PHP code embedded within HTMLPHP only parses code within its delimiters. Anything outside its delimiters is sent directly to the output and is not parsed by PHP. The most common delimiters are < ?php and ?>, which are open and close delimiters respectively. < script language="php"> and < /script> delimiters are also available. Short tags can be used to start PHP code, < ? or < ?= (which is used to echo back a string or variable) and the tag to end PHP code, ? >. These tags are commonly used, but like ASP-style tags (< % or < %= and % >), they are less portable as they can be disabled in the PHP configuration. For this reason, the use of short tags and ASP-style tags is discouraged.[50] The purpose of these delimiters is to separate PHP code from non-PHP code, including HTML. Everything outside the delimiters is ignored by the parser and is passed through as output.[51]

Variables are prefixed with a dollar symbol and a type does not need to be specified in advance. Unlike function and class names, variable names are case sensitive. Both double-quoted ("") and heredoc strings allow the ability to embed a variable's value into the string.[52] PHP treats newlines as whitespace in the manner of a free-form language (except when inside string quotes), and statements are terminated by a semicolon.[53] PHP has three types of comment syntax: /* */ serves as block comments, and // as well as # are used for inline comments.[54] The echo statement is one of several facilities PHP provides to output text (e.g. to a web browser).

In terms of keywords and language syntax, PHP is similar to most high level languages that follow the C style syntax. If conditions, for and while loops, and function returns are similar in syntax to languages such as C, C++, Java and Perl.


Data types
PHP stores whole numbers in a platform-dependent range. This range is typically that of 32-bit signed integers. Unsigned integers are converted to signed values in certain situations; this behavior is different from other programming languages.[55] Integer variables can be assigned using decimal (positive and negative), octal, and hexadecimal notations. Real numbers are also stored in a platform-specific range. They can be specified using floating point notation, or two forms of scientific notation.[56] PHP has a native Boolean type that is similar to the native Boolean types in Java and C++. Using the Boolean type conversion rules, non-zero values are interpreted as true and zero as false, as in Perl and C++.[56] The null data type represents a variable that has no value. The only value in the null data type is NULL.[56] Variables of the "resource" type represent references to resources from external sources. These are typically created by functions from a particular extension, and can only be processed by functions from the same extension; examples include file, image, and database resources.[56] Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays. Order is preserved in lists of values and in hashes with both keys and values, and the two can be intermingled.[56] PHP also supports strings, which can be used with single quotes, double quotes, or heredoc syntax.[57]

The Standard PHP Library (SPL) attempts to solve standard problems and implements efficient data access interfaces and classes. [58]


Functions

PHP has hundreds of base functions and thousands more from extensions. These functions are well documented on the PHP site, but unfortunately, the built-in library has a wide variety of naming conventions and inconsistencies.[59] PHP currently has no functions for thread programming.

Functions are not first-class functions and can only be referenced by their name. [60] User-defined functions can be created at any time without being prototyped.[60] Functions can be defined inside code blocks, permitting a run-time decision as to whether or not a function should be defined. Function calls must use parentheses, with the exception of zero argument class constructor functions called with the PHP new operator, where parentheses are optional. PHP supports quasi-anonymous functions through the create_function() function, although they are not true anonymous functions because anonymous functions are nameless, but functions can only be referenced by name, or indirectly through a variable $function_name();, in PHP.



PHP gained support for first-class functions and closures. True anonymous functions are supported using the following syntax:

function getAdder($x)
{
return function ($y) use ($x) {
return $x + $y;
};
}
Here, getAdder() function creates a closure using parameter $x (keyword "use" forces getting variable from context), which takes additional argument $y and returns it to the caller. Such function can be stored, given as the parameter to another functions, etc. For more details see Lambda functions and closures RFC.


Objects
Basic object-oriented programming functionality was added in PHP 3.[4] Object handling was completely rewritten for PHP 5, expanding the feature set and enhancing performance.[61] In previous versions of PHP, objects were handled like primitive types.[61] The drawback of this method was that the whole object was copied when a variable was assigned or passed as a parameter to a method. In the new approach, objects are referenced by handle, and not by value. PHP 5 introduced private and protected member variables and methods, along with abstract classes and final classes as well as abstract methods and final methods. It also introduced a standard way of declaring constructors and destructors, similar to that of other object-oriented languages such as C++, and a standard exception handling model. Furthermore, PHP 5 added interfaces and allowed for multiple interfaces to be implemented. There are special interfaces that allow objects to interact with the runtime system. Objects implementing ArrayAccess can be used with array syntax and objects implementing Iterator or IteratorAggregate can be used with the foreach language construct. There is no virtual table feature in the engine, so static variables are bound with a name instead of a reference at compile time.[62]

If the developer creates a copy of an object using the reserved word clone, the Zend engine will check if a __clone() method has been defined or not. If not, it will call a default __clone() which will copy the object's properties. If a __clone() method is defined, then it will be responsible for setting the necessary properties in the created object. For convenience, the engine will supply a function that imports the properties of the source object, so that the programmer can start with a by-value replica of the source object and only override properties that need to be changed.





PHP is a widely-used general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It generally runs on a web server, taking PHP code as its input and creating web pages as output. It can be deployed on most web servers and on almost every operating system and platform free of charge.PHP is installed on more than 20 million websites and 1 million web servers.The most recent major release of PHP was version 5.2.6 on May 1, 2008.


<

Tuesday, 25 November 2008

second lecture of mysql

mysql>create database student;
student;to create new database
Result:: Query OK,1 row affected <0.01>it means database is created
successfully
To Connect to the database
mysql>connect student;

This will change the database to student but on command
prompt we will have still"mysql> " prompt
Database is a logical concept it will have tables in
physicallity so now create tables in a database
mysql> create table cls(name varchar(50),rollno int(11));
Result : Query ok ,etc...a table with name cls is
created having fields name type varchar means we
can enter text of max length 50 rollno is integer having length 11int can work without integer
length also now insert data to the table Insert command
to assign values as per the structure of the table the use
following commandmysql> insert into cls
values("Parveen",122);remember this will work only if
u pass values as per the structure of the table
Note ::Where clause does not work with insert if u
understand then ok otherwise we will discuss later on
insert can work like this if u want to give value to the
particular field
mysql>insert into cls(rollno) values(234);
this will insert data in the rollno field only and
corresponding name field will be empty which is a bad
practice. This is for the knowledge of
the programmer Resutl Query ok etc...
Another format of insert command is
with set attribute
mysql> insert into cls set rollno=123, name="news";
Result :Query okin this example order does
not matter.

First lecture of mysql

Introductory notes of mysql mysql is a database software supported by php
programming language To use this database first of
all install this database software there are different
types of methods of installing it I m giving here example of
this first of all it will ask the name
of server type localhost then type any email address
in next textbox as require it can be faque also but u
should use @ symbol as this simple is judge by the
computer to consider it as an email id
Important steps to start start mysql generally from Start menu progamms
1) mysql command line client
2) Then it will ask for
password on mysql prompt
type the password now start my sql.
First Command
mysql>Show databases;
note remember its not a database but databses and
also remember to use semicolon always for
termination as this is the most common mistake while typing.
Result it will show name of already
existing databases in tabular form

Monday, 24 November 2008

this is the sported file nn.php for rajinder

< ?php
$dbhost="localhost";
$dbuser="root";
$dbpass="123";
//$nm=$_POST['n1'];
//$roll=$_POST['n2'];
//$class=$_POST['n3'];
$result=mysql_connect($dbhost,$dbuser,$dbpass);
$db=mysql_select_db( " student");
$rs=mysql_query("select * from info");
Print " < table border cellpadding=3>";
print ' NameRoll_NoClass';
while($info = mysql_fetch_array( $rs ))
{
Print " < tr>";
Print " < td>".$info['name'] ." < /td> ";
Print " < td>".$info['roll_no'] . " < /td> ";
Print " < td>".$info['class'] ." < /td> ";
}
Print " < /table>";

? >


This is the second file rajinder first use abc.html which is posted earlier
now use this file save it in nn.html format

remember to have student database
and
info table
in ur database

This is for rajinder

< html >
< head >
< title >
Php My Sql connectivity
< /title >
< /head>
< form action="nn.php" method="post">
< table border=2>
< tr>
< td>
< strong>name::< /strong>< /td>< td> < input type="text" name="n1">< /td>< tr> < td>
< strong>Age    ::< /strong>
< /td>< td>< input type="text" name="n2">< /td>
< tr>< td>Roll_No::< /td>< td>
< input type="text" name="n3">< /td>
< /tr>< tr>
< td colspan=2>
< input type="submit" >
< td>
< /tr>
< /table>
< /form>
< /html>

simple html page22

plz ignore spaces then type for example <> is having spaces remove them while using it rest works perfect
<>
<>
<>
This is a head
< /title >
< /head >


< /html >

mysqlphp







name::
Age ::
Roll_No::




this page is used to enter data
like name age etc. for this u should have database and concerned table in mysql

Few sql commands

some usefull mysql commands---------------------------------------
1)help( \?) synonym for help.
2) clear (\c) clear command.
3)connect(\r) reconnect to the server. Optional arguments are db and host.
4)ego (\g) send command to mysql server ,display result vertically.
5)exit (\q) same as quit Exit mysql;
6)go (\g) Send command to mysql server.
7)help (\h) Display this help.
8)notee (\t) Don't write into outfile.
9)print (\p) Print current command.
10)prompt (\R) Change your mysql promptfor example :
mysql>prompt miseeql;
Result miseeql>
11)Status get status from the server.
12)use (\u) use another database.Takes database name as argument.
13)Warnings (\W) show warnings after statement.
14)nowarning (\w) Don't show warnings after every statements.

php program to create table insert data and show data in tabular format

< ? php

$dbhost="localhost";

$dbname="root";

$dbpass="123";

$rs=mysql_connect($dbhost,$dbname,$dbpass);

$nm=$_POST['n1'];$rl=$_POST['n2'];

//This is to check whether connection established or not

//if($rs)

//echo "Connected ";

//else

//echo "Not Connected";

$ds=mysql_select_db(test);

//This is to check whether database connected or not

//if($ds)

//echo "connected to database";

//else

///echo "Not connected to database";$ts=mysql_query("create table student (name varchar(50),roll_no int(10))");

//this is to check whether query run successfully or notif($ts)echo "Table is created";

//else

//echo "Table is not created";

$is=mysql_query("insert into student values('$nm',$rl)");

//This is to check the execution of Insert Command

//if($is)

//echo "Insert is working";

//else

//echo "Insert is not working"; $sl=mysql_query("select * from student");

print '<.table border=2 color="red">';

print '<.th> Name<.th>Roll_No';

print '<.tr>';

while($info=mysql_fetch_array($sl))

{

print '<.td> '.$info['name'].'';

print '<.td>'.$info['roll_no'].'<./td>';

print '<./tr>';

}

print '<./table>';

? >

this is a page for php

<.html><.head><.title>This is the first site<./title><./head><.body>
<.form action="create.php" method="post"><.table border="2".><.tr><.td>Name:<./td><.td><.input type="text" name="n1"><./td><.tr><.td>Roll_No:<./td><.td><.input type="text" name="n2"><./td><./tr><.tr><.td><.input type="submit"><./td><./tr><./table><./form><./body><./html>

simple html

  1. <>
  2. <><>This is the first site< /title>< /head>
  3. <> < action="create.php" method="post">
  4. < border="2"> <> <>Name:< /td >
  5. <>
  6. < type="text" name="n1">
  7. < /td > <>
  8. <>Roll_No:< /td >
  9. <>
  10. < type="text" name="n2">< /td>
  11. < /tr><>
  12. < type="submit">< /td>< /tr>< /table>< /form>< /body>
  13. < /html>

simple html for php

<>
<>
<>
This is the first site
< /title>
< /head>
<>

< action="create.php" method="post">
< border="2">
<>
<>
Name:
< /td>
<>
< type="text" name="n1">
< /td>
<>
<>
Roll_No:
< /td>
<>
< type="text" name="n2">
< /td>
< /tr>
<>
<>
< type="submit">
< /td>
< /tr>
< /table>
< /form>
< /body>
< /html>