HTML Headings

HTML Headings

Headings are defined with the <h1> to <h6> tags.

<h1> defines the most important heading. <h6> defines the least important heading.

Example

<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>


Note: Browsers automatically add some empty space (a margin) before and after each heading.

Importance of Headings

Use HTML headings for headings only. Don't use headings to make text BIG or bold.Search engines use your headings to index the structure and content of your web pages.
               Since users may skim your pages by its headings, it is important to use headings to show the document structure.

H1 headings should be used as main headings, followed by H2 headings, then the less important H3 headings, and so on.



HTML Lines


The <hr>tag creates a horizontal line in an HTML page.

The hr element can be used to separate content:

Example

<p>This is a paragraph</p>
<hr><p>This is a paragraph</p>
<hr><p>This is a paragraph</p>


example of heading and lines :: futureX



HTML Comments


Comments can be inserted into the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed.

Comments are written like this:

Example

<!-- This is a comment -->

Note: There is an exclamation point after the opening bracket, but not before the closing bracket.



« Previous Chapter                                                                                                                                          Next Chapter »


String Handling in java

In java, string is basically an immutable object. We will discuss about immutable string later. Let's first understand what is string and how we can create the string object.

Generally string is a sequence of characters. But in java, string is an object. String class is used to create string object.


There are two ways to create String object:


  • By string literal
  • By new keyword



By String Literal :
String literal is created by double quote.
For Example:

String s="Hello";


Each time you create a string literal, the JVM checks the string constant pool first. If the string already exists in the pool, a reference to the pooled instance returns. If the string does not exist in the pool, a new String object instantiates, then is placed in the pool.For example:


String s1="Welcome";
String s2="Welcome";//no new object will be created


In the above example only one object will be created.First time JVM will find no string object with the name "Welcome" in string constant pool,so it will create a new object.Second time it will find the string with the name "Welcome" in string constant pool,so it will not create new object whether will return the reference to the same instance.

String objects are stored in a special memory area known as string constant pool inside the Heap memory.

Why java uses concept of string literal?

To make Java more memory efficient (because no new objects are created if it exists already in string constant pool).


By new Keyword :

String s=new String("Welcome");//creates two objects and one reference variable


In such case, JVM will create a new String object in normal(non pool) Heap memory and the literal "Welcome" will be placed in the string constant pool.The variable s will refer to the object in Heap(non pool).



Immutable String:

In java, strings are immutable (unmodifiable) objects.For example


class Simple{
 public static void main(String args[]){

   String s="Sachin";
   s.concat(" Tendulkar");//concat() method appends the string at the end
   System.out.println(s);//will print Sachin because strings are immutable objects
 }
}


Output: Sachin


As you can see in the above figure that two objects will be created but no reference variable refers to "Sachin Tendulkar".But if we explicitely assign it to the reference variable, it will refer to "Sachin Tendulkar" object.For example:


class Simple{
 public static void main(String args[]){

   String s="Sachin";
   s=s.concat(" Tendulkar");
   System.out.println(s);
 }
}


Output: Sachin Tendulkar


Why string objects are immutable in java?

Because java uses the concept of string literal.Suppose there are 5 reference variables,all referes to one object "sachin".If one reference variable changes the value of the object, it will be affected to all the reference variables. That is why string objects are immutable in java.


                                           JAVA TUTORIALS HOMEPAGE

HTML Attributes :: futureX

Attributes provide additional information about HTML elements.


HTML Attributes:


  • HTML elements can have attributes
  • Attributes provide additional information about an element
  • Attributes are always specified in the start tag
  • Attributes come in name/value pairs like: name="value"

Example:

HTML links are defined with the <a> tag. The link address is specified in the href attribute:


<a href="http://www.futurextech.blogspot.com">This is a link</a>


Attribute values should always be enclosed in quotes.

Double style quotes are the most common, but single style quotes are also allowed.

In some rare situations, when the attribute value itself contains quotes, it is necessary to use single quotes: name='John "Alfred" Nelson'


HTML Tip: Use Lowercase Attributes

Attribute names and attribute values are case-insensitive.

However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation.

Newer versions of (X)HTML will demand lowercase attributes.



« Previous Chapter                                                                                                                                          Next Chapter »




An HTML element is everything from the start tag to the end tag:


HTML elements :: futurex 




  Start tag                       Element content                               End tag

 <p>                                This is a example paragraph              </p>
 <a href="default.html">  This is a link                              </a>
 <br>  

 The start tag is often called the opening tag. The end tag is often called the closing tag.


HTML Element Syntax

An HTML element starts with a start tag / opening tag.
An HTML element ends with an end tag / closing tag.
The element content is everything between the start and the end tag.
Some HTML elements have empty content.
Empty elements are closed in the start tag.
Most HTML elements can have attributes.

Nested HTML Elements


Most HTML elements can be nested (can contain other HTML elements).

HTML documents consist of nested HTML elements.

Example


<!DOCTYPE html>
<html>

<body>
<p>This is my first paragraph.</p>
</body>

</html>

Don't Forget the End Tag

Some HTML elements might display correctly even if you forget the end tag:

<p>This is a paragraph
<p>This is a paragraph
The example above works in most browsers, because the closing tag is considered optional.

Never rely on this. Many HTML elements will produce unexpected results and/or errors if you forget the end tag .

Empty HTML Elements

HTML elements with no content are called empty elements.

<br> is an empty element without a closing tag (the <br> tag defines a line break).

Tip: In XHTML, all elements must be closed. Adding a slash inside the start tag, like <br />, is the proper way of closing empty elements in XHTML (and XML).

HTML Tip: Use Lowercase Tags

HTML tags are not case sensitive: <P> means the same as <p>. Many web sites use uppercase HTML tags.

We use lowercase because the World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in XHTML.



« Previous Chapter                                                                                                                                          Next Chapter »


QR code :: futureX

QR code (abbreviated from Quick Response Code) is the trademark for a type of matrix bar code (or two-dimensional bar code) first designed for the automotive industry in Japan. Bar codes are optical machine-readable labels attached to items that transmit information related to the item. Initially patented, its patent holder has chosen not to exercise those rights. Recently, the QR Code system has become popular outside the automotive industry due to its fast readability and greater storage capacity compared to standard UPC bar codes  The code consists of black modules (square dots) arranged in a square pattern on a white background. The information encoded may be made up of four standardized types ("modes") of data (numeric, alphanumeric, byte / binary), or through supported extensions, virtually any type of data.



Invention:


The QR code was invented in Japan by the Toyota subsidiary Denso Wave in 1994 to track vehicles during the manufacturing process, and originally was designed to allow components to be scanned at high speed. It has since become one of the most popular types of two-dimensional bar codes.
Unlike the older one-dimensional bar code that was designed to be mechanically scanned by a narrow beam of light, the QR code is detected as a 2-dimensional digital image by a semiconductor image sensor and is then digitally analyzed by a programmed processor. The processor locates the three distinctive squares at the corners of the image, and uses a smaller square near the fourth corner to normalize the image for size, orientation, and angle of viewing. The small dots are then converted to binary numbers and validity checked with an error-correcting code.


QR code structure :: futureX




Standards:



There are several standards in documents covering the physical encoding of QR codes:

October 1997 – AIM (Association for Automatic Identification and Mobility) International

January 1999 – JIS X 0510

June 2000 – ISO/IEC 18004:2000
Defines QR code models 1 and 2 symbols.

1 September 2006 – ISO/IEC 18004:2006
Defines QR code 2005 symbols, an extension of QR code model 2. Does not specify how to read QR code model 1 symbols, or require this for compliance.
At the application layer, there is some variation between most of the implementations. Japan's NTT DoCoMo has established de facto standards for the encoding of URLs, contact information, and several other data types.The open-source "ZXing" project maintains a list of QR code data types.





Uses:


Originally designed for industrial uses, QR codes have become common in consumer advertising. Smartphone users can install an app with a QR-code scanner that can read a displayed code and convert it to a URL directing the smartphone's browser to the website of a company, store, or product associated with that code providing specific information.
In the shopping industry, knowing what causes the consumers to be motivated when approaching products by the use of QR codes, advertisers and marketers can use the behavior of scanning to get consumers to buy, causing it to be the best impact on ad and marketing design." As a result, the QR code has become a focus of advertising strategy, since it provides quick and effortless access to the brand's website. Beyond mere convenience to the consumer, the importance of this capability is that it increases the conversion rate (that is, increases the chance that contact with the advertisement will convert to a sale), by coaxing qualified prospects further down the conversion funnel without any delay or effort, bringing the viewer to the advertiser's site immediately, where a longer and more targeted sales pitch may continue. Although initially used to track parts in vehicle manufacturing, QR codes are now (as of 2012) used over a much wider range of applications, including commercial tracking, entertainment and transport ticketing, product/loyalty marketing (examples: mobile couponing where a company's discounted and percent discount can be captured using a QR code decoder which is a mobile app, or storing a company's information such as address and related information alongside its alpha-numeric text data as can be seen in Yellow Pages directory), and in-store product labeling. It can also be used in storing personal information for use by government. An example of this is Philippines National Bureau of Investigation (NBI) where NBI clearances now come with a QR code. Many of these applications target mobile-phone users (via mobile tagging). Users may receive text, add a vCard contact to their device, open a Uniform Resource Identifier (URI), or compose an e-mail or text message after scanning QR codes. They can generate and print their own QR codes for others to scan and use by visiting one of several pay or free QR code-generating sites or apps. Google has a popular API to generate QR codes, and apps for scanning QR codes can be found on nearly all smartphone devices.QR codes storing addresses and Uniform Resource Locators (URLs) may appear in magazines, on signs, on buses, on business cards, or on almost any object about which users might need information. Users with a camera phone equipped with the correct reader application can scan the image of the QR code to display text, contact information, connect to a wireless network, or open a web page in the telephone's browser. This act of linking from physical world objects is termed hardlinking or object hyperlinking. QR codes also may be linked to a location to track where a code has been scanned. Either the application that scans the QR code retrieves the geo information by using GPS and cell tower triangulation (aGPS) or the URL encoded in the QR code itself is associated with a location.


QR codes have been used and printed on Chinese train tickets since late 2009.
In June 2011, the Royal Dutch Mint (Koninklijke Nederlandse Munt) issued the world's first official coin with a QR code to celebrate the centennial of its current building and premises. The coin was able to be scanned by a smartphone and link to a special website with contents about the historical event and design of the coin.This was the first time a QR code was used on currency.

Copyright © 2013 futureX | Blogger Template by Clairvo