الأربعاء، 31 ديسمبر 2008

A Quick History of HTML

A Quick History of HTML

To understand the need for XML, you have to first consider the role of HTML. In the

early days of the Internet, some European physicists created HTML by simplifying

another markup language known as SGML (Standard Generalized Markup Language). I

won’t get into the details of SGML, but let’s just say it was overly complicated, at least

for the purpose of sharing scientific documents on the Internet. So, pioneering physicists

created a simplified version of SGML called HTML that could be used to create what we

now know as Web pages. The creation of HTML represents the birth of the World Wide

Web—a layer of visual documents that resides on the global network known as the Internet

 

HTML was great in its early days because it allowed scientists to share information over

the Internet in an efficient and relatively structured manner. It wasn’t until later that

HTML started to become an all-encompassing formatting and display language for Web

pages. It didn’t take long before Web browsers caught on and HTML started being used

to code more than scientific papers. HTML quickly went from a tidy little markup language

for researchers to a full-blown online publishing language. And once it was established

that HTML could be jazzed up simply by adding new tags, the creators of Web

browsers pretty much went crazy by adding lots of nifty features to the language.

Although these new features were neat at first, they compromised the simplicity of

HTML and introduced lots of inconsistencies when it came to how browsers rendered

Web pages. HTML had started to resemble a bad remodeling job on a house that really

should’ve been left alone.

As with most revolutions, the birth of the Web was very chaotic, and the modifications to

HTML reflected that chaos. More recently, a significant effort has been made to reel in

the inconsistencies of HTML and to attempt to restore some order to the language. The

problem with disorder in HTML is that it results in Web browsers having to guess at how

a page is to be displayed, which is not a good thing. Ideally, a Web page designer should

be able to define exactly how a page is to look and have it look the same regardless of

what kind of browser or operating system someone is using. This utopia is still off in the future somewhere, but XML is playing a significant role in leading us toward it.

Real-World XML

Real-World XML

Hopefully by now I’ve given you some understanding of the reasons XML came into

being, as well as an idea of how it will likely fit in with HTML as the future of the Web

unfolds. What I haven’t explained yet is how XML is impacting the real world with new

markup languages. Fortunately, a lot of work has been done to make XML a technology

that you can put to work immediately, and there are numerous XML-related

technologies that are being introduced as I write this. Following is a list of some of the

major XML-based languages that are supported either on the Web or in major third party

applications, along with the kinds of information they represent:

WML—Web pages for mobile devices

• XMLNews—news stories

• CDF—Web channels

• OSD—descriptions of software

• OFX—financial information (electronic funds transfer, for example)

• RDF—descriptions of information in Web pages (helps to aid search engines)

• MathML—mathematical equations

• P3P—Web privacy policies

• RELML—real estate listings

• HRMML—human resource information (resumes, for example)

• VoxML—voice response scripts (“Press 1 for this, press 2 for that,” for example)

• VML—vector graphics

• SVG—vector graphics

• SMIL—multimedia presentations

• 3DML—three-dimensional virtual worlds

As you can see, XML people love acronyms! And as the brief descriptions of each language

suggest, these XML languages are as varied as their acronyms. A few of these languages

are supported in the latest Web browsers, and the remaining languages have

special applications that can be used to create and share data in each respective format.

To give you an idea regarding how these languages are impacting the real world, consider

the fact that the major job-posting Web sites (HotJobs.com, Hire.com, etc.) are

incorporating HRMML (Human Resource Management Markup Language) into their

systems. Additionally, Microsoft and Intuit are investing heavily in OFX (Open Financial

eXchange) as the future of electronic financial transactions. As of this writing, OFX is

supported by over 1,300 banks and brokerages, in addition to payroll-processing companies.

In other words, your paycheck may already depend on XML!

I could go on and on about how different XML languages are infiltrating the real world,

but I think you get the idea. You’ll get to know several of the languages listed throughout

the remainder of the book. More specifically, Hour 21, “Going Wireless with WML,”

shows you how to code Web pages for mobile devices, while Part VI, “A Few Interesting

XML Languages,” shows you how to use the SVG, SMIL, and 3DML languages.

 

السبت، 27 ديسمبر 2008

When to use elements versus attributes


The oldest question asked by adopters of XML is when to use elements and when to use attributes in XML design. As with most design issues, this question rarely has absolute answers, but developers have also experienced a lack of very clear guidelines to help them make this decision. In this article, Uche Ogbuji offers a set of guiding principles for what to put in elements and what to put in attributes.

Several frequently pondered questions of DTD design in SGML have followed the legacy to its offshoot, XML. Regardless of what XML schema language you use, you might find yourself asking:

  • When do I use elements and when do I use attributes for presenting bits of information?
  • When do I require an order for elements, and when do I just allow arbitrary order?
  • When do I use wrapper elements around sequences of similar elements?

In my experience working with users of XML, the first question is by far the most common. In some cases the answer is pretty unambiguous:

  • If the information in question could be itself marked up with elements, put it in an element.
  • If the information is suitable for attribute form, but could end up as multiple attributes of the same name on the same element, use child elements instead.
  • If the information is required to be in a standard DTD-like attribute type such as IDIDREF, or ENTITY, use an attribute.
  • If the information should not be normalized for white space, use elements. (XML processors normalize attributes in ways that can change the raw text of the attribute value.)


الخميس، 25 ديسمبر 2008

OOP Interview Questions

Questions

What is class,object,interface,structure,enum?

What is value type and reference type?

What is inheritance and polymorphism?

What are properties and indexer?

How to make a property,indexer readonly?

What is overloading and overriding?

Difference between Interface,abstract class, sealed class, static class and partial class?

how to implement singelton in C# & its uses?

What is event & delegates and its difference?

What is difference between overriding and shadowing?

What are the access allowed for compilation units(namespace),class and structs and what are its default access?

What’s difference between Association, Aggregation and Inheritance relationships?

What are Generics?

What are iterators?

What are nullable types? Is Nullable I and int ?i are same.

How to assign default value to nullable types? Did nested nullable types are allowed

What is covariance and contravariance? Did Delegate and method overriding support these?

What is anonymous method?

Did a generic class can be inherited by a normal class?

Difference between dispose and destructor?

What are virtual methods? How are they used?

What is the use of base,new,virtual and override keywords?

What is the difference between const and readonly variables?

use of operator overloading of implicit & explicit operators?

Is there any way to access private memebers of an object from another object? (Yes)

What is the difference between string and StringBuilder?

what is the difference between int and Int32?

When static constructor is invoked?

When compiler adds a default constructor to a class?

what is the difference between passing a value object by reference and a reference object by value?

what is output parameter and parameter array?

How to handle exceptions?

How to throw an caught exception from cath block?

Did it possible to cast a generic type of derived class to generic type of base class?

Is Inheritance possible in Static class?

What is marker interface?

Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it possible to inherit a class to struct?

What is the use of "default" and "Using" keyword?

Difference between direct type casting and using "as" keyword?

Use of Checked and UnChecked operators?

What is short circuit logical evaluation?

 

ADO.Net Interview Questions

Questions

Explain about Ado.Net Objects

What are the data providers available in .net to connect to database

Types of Concurrency Control

What are the steps to connect to a database ?

What is difference between dataset and datareader

How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures

How can we force the connection object to close after my datareader is closed

How do we get changed value dataset?

How add/remove row’s in “DataTable” object of “DataSet”

How can we load multiple tables in a DataSet

How can we add relation’s between table in a DataSet

What’s difference between Dataset. clone and Dataset. copy

Explain what a diffgram is and its usage

How xml files and be read and write using dataset

What are the different row versions available

Explain acid properties

Explain the ADO . Net Architecture

How can we add an expression for a column?

Which method do you invoke on the Data Adapter control to load your generated dataset with data

How to filter rows? Example filter employee's who salary > 1500

How to get a particular row number for a given condition? Example empcode=1000

How to sort data in datatable? Sort data using Employeename field

About Data Adapter Events?

If a dataset contains 100 rows, how to fetch rows between 5 and 15 only

What’s basic use of Data View?

How can we load multiple tables in a Dataset?

What is typed dataset ?

What is ReadXml?

How to remove or clear the rows in a datatable?

How to copy records from one datatable to another datatable?

 

السبت، 20 ديسمبر 2008

¯ What is ADO.NET?

¯   Overview

ü     A Database is an organized collection of information that is divided into tables. Each table is further divided into rows and columns; these columns store the actual information.

ü      You access a database using Structured Query Language (SQL), which is a standard language supported by most database software including SQL Server, Access, and Oracle.

ü       

¯    What is ADO.NET?

1.       ADO.NET is the new database technology of the .NET (Dot Net) platform, and it builds on Microsoft ActiveX® Data Objects (ADO).

2.     ADO.NET is an integral part of the .NET Compact Framework, providing access to relational data, XML documents, and application data.

3.     ADO.NET defines DataSet and DataTable objects which are optimized for moving disconnected sets of data across intranets and Internets, including through firewalls. It also includes the traditional Connection and Command objects, as well as an object called a DataReader that resembles a forward-only, read-only ADO recordset. If you create a new application, your application requires some form of data access most of the time.

 

You can use ADO.NET to access data by using the new .NET Framework data providers which are:

 

Data Provider for SQL Server (System.Data.SqlClient).

Data Provider for OLEDB (System.Data.OleDb).

Data Provider for ODBC (System.Data.Odbc).

Data Provider for Oracle (System.Data.OracleClient).

 

ü     The ADO.NET classes are found in System.Data.dll (Root Class) and are integrated with the XML classes in System.Xml.dll.

DataSet object represents a disconnected cache of data which is made up of DataTables and DataRelations that represent the result of the command

ý      ADO.NET allows data manipulation to be done using either a connected or a disconnected model. The following table describes how each method works

Connected Model

Disconnected Model

  1. The application establishes a connection with the data source.
  2. The application reads data and executes commands to manipulate data on the data source.
  3. The connection remains open until closed by either the client or the server.
  1. The application establishes a connection with the data source.
  2. Requested data is transferred to the application and stored in a memory cache on the client.
  3. The connection is closed.
  4. The application modifies or otherwise works with the data.
  5. To synchronize changes back to the data source, the connection is reestablished, the data transferred, and the connection is immediately closed.

The disconnected model helps conserve server resources and helps the scalability of the application.

The following table lists the components used in each data access model.

Component

Description

Applicable Data Access Model

Data source

The data source is the database on the server, but can also be many other kinds of data repositories such as an XML file.

Connected
Disconnected

Connection

The Connection object includes information necessary to establish a connection to the data source.
Connections are data source specific. For example, use a SqlConnection to make a connection to a SQL database.

Connected
Disconnected

Command

A Command object executes read and write operations on the data source.
Command objects are data source specific and are associated with a Connection object.

Connected
Disconnected

DataReader

The DataReader represents a set of read-only, forward-only rows from a database. Use a DataReader when you need fast access and need only to read through the data from beginning to end one time.
The DataReader is data source specific.

Connected

DataAdapter

A DataAdapter manages the process of communicating with the data source.
Commands are associated with a DataAdapter. When a command is executed, the DataAdapter automatically opens and closes the connection with the data source.
The DataAdapter is data source specific.

Disconnected

DataSet

The DataSet is the client-side, in-memory copy of the data. DataAdapters fill the DataSet tables, rows, and columns using data from the data source.
DataSets are source neutral, meaning they can contain data from different kinds of data sources.
DataSets also have multiple tables. A single DataSet can therefore be used to hold data from multiple different sources. You can also use the DataSet to establish relationships between tables.

Disconnected