Thursday, 1 September 2011

XML

XML was created by W3C to overcome the limitations of HTML.

HTML was designed with Humans in mind. As humans, you and I have the intelligence to understand the meaning and intent of most documents.

A machine, unfortunately, can't do that. While the tags in the document tell a browser how to display this information, the tags don't tell the browser what the information is.

A tag is the text between the left angle bracket (<) and the right angle bracket (>). There are starting tags (such as <name>) and ending tags (such as </name>)

An element is the starting tag, the ending tag, and everything in between. e.g.the <name> element can contain three child elements:
<title>, <first-name>, and <last-name>.


An attribute is a name-value pair inside the starting tag of an element.

XML creates document with self-describing data.
XML simplifies data interchange.
XML enables smart code.
XML enables smart searches.


Parser is a piece of code that attempts to read a document and interpret its contents.

Invalid Documents: don't follow the XML syntax rules and the rules defined in DTD/Schema.

Valid Documents: follow both the XML syntax rules and the rules defined in DTD/Schema.

Well-formed Documents: follow the XML syntax rules but don't have a DTD/Schema.

An XML document must be contained in a single element. That single element is called the root element, and it contains all the text and any other elements in document.

XML elements can't overlap.
You can't leave out any end tags.
XML elements are case sensitive.

XML Attributes must have values, those values must be enclosed within quotation marks.
If the value of the attribute contains a single or double quote:
a) you can use like (name="Preetesh's car")
b) Use Entity like &quot, &apos.


Most XML documents start with an XML declaration that provides basic information about the document to the parser.

The declaration can contain up to three name-value pairs.
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>ISO-8859-1 includes all char-set used by most Western European languages.
default encoding is "UTF-8".
default reference is 'standalone="no" '.
standalone="yes" means this XML doc can be processed without reading any other files.

A comment begins with <!-- and ends with -->.

JUnit

JUnit is a software testing framework for unit testing.

It is written in Java and designed to test Java applications.

It is an Open Source Software maintained by the JUnit.org community.


JUnit is a simple, open source framework to write and run repeatable tests.
It is an instance of the xUnit architecture for unit testing frameworks.

JUnit features include:
  1. Assertions for testing expected results
  2. Test fixtures for sharing common test data
  3. Test runners for running tests
JUnit was originally written by Erich Gamma and Kent Beck.

JUnit is mostly used by developers. JUnit is designed for unit testing, which is really a coding process, not a testing process. But many testers or QA engineers, are also required to use JUnit for unit testing.

Current and Electrons

Why is flow of current visible in form of spark/discharge, contrary to
flow of current in a wire?

Because sparks and discharges occur when the electrons are accelerated
by very high voltages, have therefore very high energies, and are hence able to ionize (or at least excite) gas atoms. When these atoms recombine (or get de-excited), light is released. What you see is that light.

In contrast, the electrons forming the current in wire have in general very low energies (rough estimate: the energy is at least a factor 1000 lower).

(1) Electrons forming the current in wire is not enough to ionize atoms or even cause much excitations,

(2) even the small excitations which are nevertheless caused don't release very much energy when the atoms get de-excited, and therefore no visible light, but at best infrared radiation, and

(3) wires are obviously not transparent, so even if light was created in the wire, you would not see it from outside.

Electrons can't be seen because, they are smaller than the wavelength of visible light.

Founders in Java Technology

Java(called Oak 1991-94) : James Gosling in 1995

Servlets  : Sun in 1997
Servlet 2.4  : 2003 (J2EE 1.4) web.xml uses XML Schema
Servlet 2.5  : 2005 (JEE5, JavaSE5) supports Annotation
Servlet 3.0  : Dec2009 (JEE6, JavaSE6) Pluggability, Ease of Development, AsyncServlet, Security, File Uploading


JSP   : Sun in 1999

EJB   : IBM in 1997
EJB 2.1   : in 2003
EJB 3.0   : in 2006
EJB 3.1   : in Dec 2009

Tomcat & Ant  : James Duncan Davidson

JUnit   : Kent Beck

Java Collections Framework : Josh Bloch

JBoss AppServer  : Marc Fleury in 2001

Struts   : Craig Mcclanahan

Spring   : Rod Johnson

Hibernate  : Gavin King

JSF   : Java Community Process

in 2006 (JSF 1.2 -- JEE5)
in 2009 (JSF 2.0 -- JEE6)
in Oct2010 (JSF 2.1)

Different CodeNames of Java:
-----------------------------------
Java 1 - Oak (1991-95)
Java 1.0.2 - Java
J2SE 1.2 - Playground (1998)
J2SE 1.3 - Kestrel (2000)
J2SE 1.4 - Merlin (2002)
Java SE 5 - Tiger (2004)
Java SE 6 - Mustang (2006)
Java SE 7 - Dolphin (2011)
Java SE 8 - *** (2012)

RSS

RSS (Rich Site Summary) is a format for delivering regularly changing web content. Many news-related sites, weblogs and other online publishers syndicate their content as an RSS Feed to whoever wants it.

RSS solves a problem for people who regularly use the web. It allows you to easily stay informed by retrieving the latest content from the sites you are interested in.

Benefits:
1. You save time by not needing to visit each site individually.
2. You ensure your privacy, by not needing to join each site's email newsletter.


A variety of RSS Readers are available for different platforms. Some popular feed readers include Amphetadesk (Windows, Linux, Mac), FeedReader (Windows), and NewsGator (Windows - integrates with Outlook).

There are also a number of web-based feed readers available. My Yahoo, Bloglines, and Google Reader are popular web-based feed readers.

Once you have your Feed Reader, it is a matter of finding sites that syndicate content and adding their RSS feed to the list of feeds your Feed Reader checks. Many sites display a small icon with the acronyms RSS, XML, or RDF to let you know a feed is available.