Wednesday, 18 September 2013

Interbase (IB) vs Firebird (FB): Differences and Similarities between Interbase and Firebird

Interbase (IB) vs Firebird (FB): Differences and Similarities between Interbase and Firebird

There are a lot of differences and similarities between Interbase and Firebird. I have tried to compare both Interbase and Firebird in my way (Interbase vs Firebird).

Interbase and Firebird are two different database servers. Firebird has originated from Interbase. After the release of Interbase 6.0 in 2000, developers moved away from Interbase and made first freeware and open-source version of Interbase and named it Firebird 1.0, made it available on SourceForge. Up to this point, all the features of Interbase and Firebird were same but after this different team started working on their products (Interbase and Firebird).

Following are the differences between Interbase and Firebird:

1. Firebird is freeware and open source while Interbase is commercial and  is currently developed and marketed by Embarcadero Technologies. So Firebird as being freeware and open source, the community members can change/modify anything in the source code and all other users of Firebird will be benefitted of that. 

2. Delphi supports officially only Interbase, however drivers probably work with basic functions and there are free and paid drivers and libraries available for Firebird. With Enterprise and Architect Editions of Delphi XE4, Firebird drivers are also supported. Delphi works well with Interbase using two different sets of access components. Interbase Express provides specific support for Interbase only. It does not support Firebird. Database Express, a more generic set of components for various databases, is also part of Delphi and supports both Interbase and Firebird. IBX is usually preferred over DBX for Delphi access to Interbase.

3. In Firebird, there is an embedded version so you don't need a real server - single user "server" is embedded into Delphi (Win) or Lazarus/FreePascal (Win/Lin) executable.

4. Interbase and Firebird DLLs: Usually we use gds32.dll to connect with interbase database server and fbclient.dll to connect with firebird server.

5. Latest Releases of Interbase and Firebird: 

InterBase XE is the latest version of Interbase which was released in 2010. Interbase XE new features include a 64 bit client and server, improved security, improved scalability, support for dynamic SQL in stored procedures, and optimized performance of large objects with stream methods.

Firebird 2.5.2 is the current stable version. New features included in this Firebird release are improved multithreading, regular expression syntax and the ability to query remote databases. The planned 3.0 release is expected to support stored procedures in languages such as Java and C++, and SQL window functions that restrict query results. An alpha version was released in August 2013.

Tuesday, 17 September 2013

What is the difference between dbExpress, dbGo and BDE in Delphi? Why to use dbExpress?

What is the difference between dbExpress, dbGo and BDE in Delphi? Why to use dbExpress?

There are a lot of database connectivity options in Delphi. Embarcadero supplies drivers for many databases, including Oracle, Firebird, InterBase, DB2, Informix, SQL Server, MySQL and ODBC. Additional drivers are available from third parties. Delphi supports many databases using several data access providers like dbExpress, dbGo, BDE, Interbase, FIBPlus, DevartIntebase (third party) etc. We will only talk about difference between BDE, dbGo and dbExpress and why should we use dbExpress instead of dbGo and BDE?

BDE is Borland Database Engine which was used in earlier versions of Delphi. Although its not deprecated still in Delphi XE4 but its advisable to migrate from BDE to dbExpress. 

dbGo for ADO mainly uses ADO connections to connect to MSSQL Server. No further enhancements have been made to dbGo since Delphi 6 when dbExpress was introduced. 

Both BDE and dbGo are bidirectional and uses connected access to database which degrades the performance in case of complex applications.  

dbExpress was introduced in Delphi 6 to replace BDE. dbExpress is a light-weight, extensible, cross-platform, high-performance mechanism for accessing data from SQL servers. dbExpress provides connectivity to databases for the Windows, .NET and Linux (using Kylix) platforms. dbExpress allows you to access different database servers like MySQL, Interbase, Oracle, MS SQL, Firebird, Informix etc. 

Disconnected Access and Unidirectional Approach in dbExpress

BDE and dbGo for ADO use connected data access techniques, that operate directly on the table or database but dbExpress architecture is the disconnected data access implementation available in Delphi. Instead of directly making any modification in database table, the dbExpress architecture requires the use of a TDataSetProvider to feed a TClientDataSet before we can connect to a TDataSource and data-aware controls.

One of the most significant features of dbExpress lies in the fact that it accesses databases using unidirectional datasets. Unidirectional datasets do not buffer data in memory - such a dataset cannot be displayed in a DBGrid. To build a user interface using dbExpress you will need to use two more components: TDataSetProvider and TClientDataSet as described above. 

Due to disconned access and unidirectional approach, dbExpress is provides good performance, so it is suitable for complex applications.

Friday, 13 September 2013

Can Developers / Programmers live without StackOverflow?

Can Developers / Programmers live without StackOverflow?

A Software developer or programmer faces new challenges everyday during project development. In each line of code, there is something new to explore. While developing any application, any product, we know many things technically how to do? But, there are many things for which we have to google. There may be many unforeseen exceptions which may come in the coding path. While coding, a software developer encounters many errors and exception, some of them he or she already knows how to resolve and for many of them he / she has to google. 

When I am saying "google", I mean searching on the internet. But I have noticed that while searching any code related queries on the google, out of first 10 results, at least 5 are from stackoverflow. When I land on stackoverflow pages by searching my problem / errors / exceptions, I feel somewhat confident to know that I am not the single person in the universe who is getting this kind of error. There are lot of my friends across the globe to help me out. I am so much impressed with the people on stackoverflow who are expert in their technologies and have thousands of reputation points on stack overflow. Sometimes I think, would I be able to compete them in future? 95% of my problems are resolved by stackoverflow expert discussions.

Even if you don't find any useful link while googling, and also there is no link on stackoverflow, you can ask your question there on stackoverflow. A lot of experts with very high reputation points are sitting on stackoverflow who will help you out within minutes. When your question gets resolved, it will also help other developers who would encounter the error you asked on stackoverflow because stackoverflow has very good google rank and its pages get indexed on google search within minutes and start appearing on first page of google when you search similar problem again.

If you encounter any problem and solve it by yourself after some struggle, I will suggest you to share your finding on stackoverflow. Ask a question and answer it yourself because it will surely help other programmers around the world who encounter this problem in the future.

I feel a lot of dependency on Stackoverflow. So, as a software developer, I think StackOverflow is boon to me which is solving my problems for almost 4 years and will continue to favor me in future.

Saturday, 7 September 2013

How to create and consume webservices in Delphi using HTTP and SOAP protocols?

How to create and consume webservices in Delphi using HTTP and SOAP protocols?

I had to create and consume a webservice in my delphi XE4 application. I searched on the internet and after a lot of search I was able to pick some useful links (texts and video tutuorials) which may be useful to you while creating and consuming a webservice in delphi. I am just sharing those links to you in a sequence I understood them.


If you are new in webservices with delphi, you must start from this tutorial. This tutorial on webservices in delphi is written by Pawel Glowacki on Embarcadero Blogs.


This is the video tutorial on Embarcadero Development Network (EDN). This video tutorial on webservices in delphi is presented by Wecsley Fey - Aquasoft IT. He teaches consuming of webservices in delphi step by step with a simple examples. 



Read this article on consuming web service in delphi after clearing your concepts by reading above links. This link is for delphi 7, but it will give you clear idea on how to implement webservice in any version of delphi.


This link is also very simple for consuming web services in delphi. This site also provides some interesting web services which you can consume for free for testing purposes. You can create a demo delphi application and consume the webservice given on this site to play around.



You will have to sign in to Embarcadero to watch this video tutorial on building and consuming web services in Delphi and Delph Prism.

Bug Tracking with EurekaLog in Delphi and C++ Builder

Bug Tracking with EurekaLog in Delphi and C++ Builder

EurekaLog is the new Delphi and C++Builder exception tracer tool that gives your application (GUI, Console, Web, etc.) the power to catch all exceptions, memory leaks and detect infinite-loops and deadlocks. It generates a detailed log with the call stack at the point that raised the exception, showing unit, class, method and line number, (see this example), and displays it on screen and optionally sends it back to you via email or to a Web Server (using the HTTP-S/FTP protocols or sending directly to your preferred "Web Bug Tracker" software), thus helping speed up the process of bug-location and resolution by a factor of 10!

EurekaLog Performance

EurekaLog is easy to use because it's fully integrated into the IDE - just enable EurekaLog for your application and rebuild your application to add EurekaLog's features. EurekaLog does not affect application performance (it runs only when an exception occurs) and increases compiled file size by just 0.5% - 4% (it uses this space to store some additional, compressed and encrypted debugging information). You do not need to distribute any additional files with your EurekaLog-enabled application.

EurekaLog Compatibility

EurekaLog is compatible with Delphi 3, 4, 5, 6, 7, 2005, 2006, 2007, 2009, 2010, XE, XE2, XE3, XE4 and with C++Builder 5, 6, 2006, 2007, 2009, 2010, XE, XE2, XE3, XE4 (including Personal, Turbo and Starter editions). It works on Windows 95, Windows 98, Windows ME, Windows NT, 2000, Windows XP (x32 and x64), Windows Vista (x32 and x64), Windows 7 (x32 and x64), Windows 8 (x32 and x64), Windows Server 2003, Windows Server 2008 (x32 and x64), Windows Server 2008 R2 (x32 and x64), Windows Server 2012 (x32 and x64). It supports both Win32 and Win64 platforms. It supports VCL, CLX and FMX (FireMonkey) frameworks.

Note: Delphi 3 and Windows 95-NT are supported only by EurekaLog 4-6. EurekaLog 7 is the current and most recent version of EurekaLog. With EurekaLog, you also get free access to licenses for older versions EurekaLog 4, EurekaLog 5, and EurekaLog 6. Download links to installers of earlier versions will be available in your control panel after purchase. Please note that old versions are no longer developed nor supported. They are provided only for backward compatibility purposes. You can use them, if you need support old systems (Delphi 3, Windows 95, Windows 98, Windows ME, Windows NT).

Friday, 30 August 2013

CSS3 Basic Interview Questions and Answers for Web Designers and Developers

CSS3 Basic Interview Questions and Answers for Web Designers and Developers

Below is the list of CSS3 basic interview questions and answers. These CSS3 interview questions and answers are meant for freshers as well as for experienced web designers and developers. So, If you going for an interview on CSS3,  I suggest you to must give a look at following CSS3 interview questions. These CSS3 interview questions are based on basic introduction to CSS3, why we need CSS3, difference between CSS and CSS3, CSS3 modules, CSS3 browser support, rounded corners in CSS3, borders and shadows in CSS3, CSS3 animation and opacity etc. So lets have a look on following basic CSS3 interview questions and answers.

1. What is the difference between CSS and CSS3?

CSS3 is upgreaded version of CSS with new future like Selectors,Box Model, Backgrounds and Borders, Text Effects,2D/3D Transformations, Animations, Multiple Column Layout, User Interface etc
   
2. List out CSS3 modules.

Below are the listed major modules:

Selectors
Box Model
Backgrounds and Borders
Text Effects
2D/3D Transformations
Animations
Multiple Column Layout
User Interface
   
3. What new futures added in CSS3 for Borders and how Browser Support it?

Following border futures added:

border-radius
box-shadow
border-image

and all modern Browser Support it like below:

Internet Explorer 9 supports border-radius and box-shadow
Firefox requires the prefix -moz- for border-image.
Chrome and Safari requires the prefix -webkit- for border-image.
Opera requires the prefix -o- for border-image.
   
4. How you will create Rounded Corners using CSS3?

We have to creat a class like below:

<style>
.roundc{
border:2px solid #ff0000;
border-radius:25px;
background:#dddddd;
width:300px;
-moz-border-radius:25px; /* Firefox */
-webkit-border-radius:25px; /* Chrome and Safari */
-o-border-radius:25px; /* Opera */
}
</style>

and we have to add this class where we want the round corner like in below div
<div class="roundc" > this is the round corner by css3 </div>
   
5. How we create border using images by CSS3?

By using border-image: property of css3 we can create a border using images like below

.roundpcds
{
border-image:url(borderpcds.png) 30 30 round;
-moz-border-image:url(borderpcds.png) 30 30 round; /* Firefox */
-webkit-border-image:url(borderpcds.png) 30 30 round; /* Safari and Chrome */
-o-border-image:url(borderpcds.png) 30 30 round; /* Opera */
}

.stretchPcds
{
-moz-border-image:url(borderpcds.png) 30 30 stretch; /* Firefox */
-webkit-border-image:url(borderpcds.png) 30 30 stretch; /* Safari and Chrome */
-o-border-image:url(borderpcds.png) 30 30 stretch; /* Opera */
border-image:url(borderpcds.png) 30 30 stretch;
}
   
6. How you will create Box Shadow and text Shadow using CSS3?

Like below we can create Box Shadow using CSS3 .boxshadowabc
{
box-shadow: 10px 10px 5px #ccccc;
} 

.textshadowabc
{
text-shadow: 5px 5px 5px #FF0000;
} 

and then need to use these class boxshadownabc ,textshadowabc
   
7. What is the CSS3 The background size Property?

The background-size property specifies the size of the background image.

As we know Before CSS3, the background image size was find out by the real size of the image. In CSS3 it is possible to specify the size of the background image, which allows you to re-use background images in different ways.

.abcbp1
{
background:url(background.gif);
-moz-background-size:80px 60px; /* Firefox 3.6 */
background-size:80px 60px; /* or we can do background-size:100% 100%;*/
background-repeat:no-repeat;
}
   
8. What is the word wrap / word wrapping in CSS3?

To Allow long words to be able to break and wrap onto the next line in css3 we used word-wrap property like below class 

.wordwrappcds{word-wrap:break-word;}
   
9. What is the CSS3 animation?

When the animation is created in the @keyframe, bind it to a selector, otherwise the animation will have no effect.

Bind the animation to a selector by specifying at least these two CSS3 animation properties:

A) Specify the name of the animation
B) Specify the duration of the animation   

10. What is Opacity in CSS3?

Opacity is used to show or hide the html element For example 0 for hide and 1 for show.

11. What is the other name of combined selector in CSS3 and what is it used for?

The other name of combined selector in CSS3 is known as Grouping

12. How is multiple background images handled in CSS3?

If you want to use the multiple background ,we can insert as follows...

background-image: url(decoration.png), url(ribbon.png), url(old_paper.jpg); also we can mention the position of the image either percentage value or top left, left center like this

13. What is wrapping in CSS3?

Wrapping is a vital property for proper display of contents in web pages. If wrapping is disabled then the user could not display and view long lines that goes outside the window boundary and thus becomes useless.

Definition:

The wrap() method wraps specified HTML element(s) around each selected element.

Syntax

$(selector).wrap(wrappingElement,function(index))

where wrapping element specifies what HTML element(s) to wrap around each selected element.It's compulsory.

Possible values:

HTML elements
jQuery objects 
DOM elements

function(index) is Optional. Specifies a function that returns the wrapping element 

index - Returns the index position of the element in the set

14. What is the syntax of opacity in CSS3?

Firefox uses the property opacity:x
Ex:style="opacity:0.4;

IE uses filter:alpha (opacity=x)
Ex:filter:alpha(opacity=40)"

15. What is CSS rule 'ruleset'? 

There are two types of CSS rules: ruleset and at-rule.

Ruleset identifies selector or selectors and declares style which is to be attached to that selector or selectors. For example P {text-indent: 10pt} is a CSS rule. CSS rulesets consist of two parts: selector, e.g. P and declaration, e.g. {text-indent: 10pt}.

P {text-indent: 10pt} - CSS rule (ruleset)
{text-indent: 10pt} - CSS declaration
text-indent - CSS property
10pt - CSS value

16. What are the various style sheets?  

Inline, external, imported and embedded are the different types of style sheets.

17. What are style sheet properties?

CSS Background
CSS Text
CSS Font
CSS Border
CSS Outline
CSS Margin
CSS Padding
CSS List
CSS Table

18. List various font attributes used in style sheet?

font-style
font-variant
font-weight
font-size/line-height
font-family
caption
icon
menu
message-box
small-caption
status-bar  

19. What are the five possible values for “position”? 

Values for position: static, relative, absolute, fixed, inherit 

20. What does isNaN function do? 

Return true if the argument is not a number.       

21. What is a CSS File? It is used for what purpose?

CSS stands for "Cascading Style Sheets", and are used to control and manage font styles, font sizes, and web site color combinations that are used in a web page. In order to retain continuity of "look and feel" throughout a website, all pages within a website will often refer to a single CSS file. The CSS file is typically contained in a separate file from the website, and the various web pages retrieve the CSS file each time a web page is displayed. CSS files 
make global appearance changes easy -- a single change in a CSS file will mean that any pages using that CSS file will automatically display the changes .

22. How do I make a picture as a background on my web pages?

Point the body background to the name of your image you wish to use as the background as shown below. This body line should be the first line after your < / head> tag.

<body background="picture.gif">

You can also have the background image fixed, so it does not move when using the scroll bar in the browser. To do this add the BGPROPERTIES tag as shown below. 

<body background="picture.gif" bgproperties="fixed"> 

23. How do I add scrolling text to my page? 

Keep in mind not all browsers support scrolling text. however to do this add a tag similar to the below example:

<marquee >THIS WOULD SCROLL< /marquee> 

The above example would create the below scrolling text. If your browser supports scrolling text the below example should be scrolling. More examples can be found on our main HTML page that lists most of the HTML commands. 

24. How do I make it so that someone can mail me by just clicking on text with subject?

Use the mailto command in your A HREF link tag as shown below:

<a href="mailto:support@computerhope.com?Subject=Enquiry">Click here to mail</ a> . 

25. How do I align pictures so that one may be higher or lower than the other?

Use the align statement in your IMG SRC tag as shown below. 

<img src="http://www.computerhope.com/chguy.gif" align=top> 

Also, instead of align=top you can do align=middle, and align=bottom.  

26. What is external Style Sheet? How to link?

External Style Sheet is a template/document/file containing style information which can be linked with any number of HTML documents. This is a very convenient way of formatting the entire site as well as restyling it by editing just one file. The file is linked with HTML documents via the LINK element inside the HEAD element. Files containing style information must have extension .css, e.g. style.css. 

<HEAD> 
<LINK REL=STYLESHEET HREF="style.css" TYPE="text/css"> 
</ HEAD>   

27. Is CSS case sensitive? 

Cascading Style Sheets (CSS) is not case sensitive. However, font families, URLs to images, and other direct references with the style sheet may be. The trick is that if you write a document using an XML declaration and an XHTML doctype, then the CSS class names will be case sensitive for some browsers. It is a good idea to avoid naming classes where the only difference is the case, for example: div.myclass { ...} div.myClass { ... } If the DOCTYPE or XML declaration is ever removed from your pages, even by mistake, the last instance of the style will be used, regardless of case.   

Thursday, 29 August 2013

HTML5 Interview Questions and Answers for Web Designers and Developers

HTML5 Interview Questions and Answers for Web Designers and Developers

Below is the list of HTML5 basic interview questions and answers. These HTML5 interview questions and answers are meant for freshers as well as for experienced web designers and developers. So, If you going for an interview on HTML5,  I suggest you to must give a look at following HTML5 interview questions. These HTML5 interview questions are based on basic introduction to HTML5, why we need HTML5, doctype of HTML5, media elements in HTML5, embedding audio and video to HTM5, canvas element in HTML5, types of storage in HTML5 like localStorage and sessionStorage, new Form elements in HTML5, deprecated elements in HTML5, HTML5 APIs etc. So lets have a look on following basic HTML5 interview questions and answers.

1. What's new HTML5 DocType and Charset?

As HTML5 is now not a subset of SGML, its DocType is simplified as follows:

<!doctype html>

And HTML5 uses UTF-8 encoding as follows:

<meta charset="UTF-8">

2. How can we embed Audio in HTML5?

HTML 5 comes with a standard way of embedding audio files. Supported audio formats are MP3, Wav and Ogg.

<audio controls>
<source src="jamshed.mp3" type="audio/mpeg">
Your browser doesn't support audio embedding feature.
</audio>

3. How can we embed Video in HTML5?

Same like audio, HTML 5 defined standard way of embedding video files. Supported video formats are MP4, WebM and Ogg.

<video width="450" height="340" controls>
<source src="jamshed.mp4" type="video/mp4">
Your browser does'nt support video embedding feature.
</video>

4. What are the new media elements in HTML5 other than audio and video?

HTML 5 has strong support for media. Other than audio and video tags, it comes with the following tags:

<embed> acts as a container for external application.
<track> defines text track for media.
<source> is helpful for multiple media sources for audio and video.

5. What is the usage of canvas element in HTML5?

<canvas> is an element in HTML5 which we can use to draw graphics with the help of scripting (which is most probably JavaScript). 

This element behaves like a container for graphics and rest of the things will be done by scripting. We can draw images, graphs and a bit of animations etc. using <canvas> element.

<canvas id="canvas1" width="300" height="100">
</canvas>

6. What are the different types of storage in HTML5?

HTML5 has the capability to store data locally. Previously, it was done with the help of cookies. The exciting thing about this storage is that it's fast as well as secure.

There are two different objects which can be used to store data:

localStorage object stores data for a longer period of time even if the browser is closed.
sessionStorage object stores data for a specific session.

7. What are the new Form Elements introduced in HTML5?

There are a number of new form elements that have been introduced in HTML 5 as follows:

datalist
datetime
output
keygen
date
month
week
time
number
range
email
url

8. What are the deprecated Elements in HTML5 from HTML4?

Elements that are deprecated from HTML 4 to HTML 5 are:

frame
frameset
noframe
applet
big
center
basefront

9. What are the new APIs provided by HTML5 standard?

HTML 5 standard comes with a number of new APIs. Few of them are as follows:

Media API
Text Track API
Application Cache API
User Interaction
Data Transfer API
Command API
Constraint Validation API
History API
and many more....

10. What is the difference between HTML 5 Application Cache and regular HTML Browser Cache?

One of the key features of HTML 5 is "Application Cache" that enables us to make an offline version of a web application. It allows to fetch few or all of website contents such as HTML files, CSS, images, JavaScript, etc. locally. This feature speeds up the site performance. This is achieved with the help of a manifest file defined as follows:

<!doctype html>
<html manifest="example.appcache">
.....
</html>

As compared with traditional browser caching, it's not compulsory for the user to visit website contents to be cached.

11. Can you give an example of Canvas element and how it can be used?

<canvas id=“myCanvas” width=“500″ height=“400″>
</canvas>
<script type=“text/javascript”>
var myCanvas=document.getElementById(“myCanvas”);
var myText=myCanvas.getContext(“2d”);
myText.fillStyle=“#82345c”;
myText.fillRect(0,0,150,75);
</script>

12. What is the purpose of HTML5 versus XHTML?

HTML5 is the next version of HTML 4.01, XHTML 1.0 and DOM Level 2 HTML. It aims to reduce the need for proprietary plug-in-based rich internet application (RIA) technologies such as Adobe Flash, Microsoft Silverlight, Apache Pivot, and Sun JavaFX. Instead of using those plugins, it enables browser to serve elements such as video and audio without any additional requirements on the client machine.

13. What is the difference between HTML and HTML5?

HTML5 is nothing more then upgraded version of HTML where in HTML5 supports the innovative features such as Video, Audio/mp3, date select function , placeholder , Canvas, 2D/3D Graphics, Local SQL Database added so that no need to do external plugin like Flash player or other library elemenents.

14. What are some other advantages of HTML5?

a) Cleaner markup than earlier versions of HTML
b) Additional semantics of new elements like <header>, <nav>, and <time>
c) New form input types and attributes that will (and in Opera’s case, do) take the hassle out of scripting forms.

15. What is the  <!DOCTYPE>? Is it mandatory to use in HTML5?

The <!DOCTYPE> is an instruction to the web browser about what version of HTML the page is written in. The <!DOCTYPE> tag does not have an end tag. It is not case sensitive.

The <!DOCTYPE> declaration must be the very first thing in HTML5 document, before the <html> tag.  As In HTML 4.01, all <! DOCTYPE > declarations require a reference to a Document Type Definition (DTD), because HTML 4.01 was based on Standard Generalized Markup Language (SGML). WHERE AS HTML5 is not based on SGML, and therefore does not require a reference to a Document Type Definition (DTD).

16. What are the New Media Elements in HTML5?

New Media Elements in HTML5 are :

<audio> For multimedia content, sounds, music or other audio streams
<video> For video content, such as a movie clip or other video streams
<source> For media resources for media elements, defined inside video or audio
elements
<embed> For embedded content, such as a plug-in
<track> For text tracks used in mediaplayers

17. What is the major improvement with HTML5 in reference to Flash?

Flash is not supported by major mobile devices such as iPad, iPhone and universal android applications. Those mobile devices have lack of support for installing flash plugins. HTML5 is supported by all the devices, apps and browser including Apple and Android products. Compared to Flash, HTML5 is very secured and protected. That eliminates major concerns that we have seen with Flash.

18. What is the sessionStorage Object in HTML5 ? How you can create and access that?

The HTML5 sessionStorage object stores the data for one session. The data is deleted when the user closes the browser window. We can create and access a sessionStorage, created “name” as session

<script type=“text/javascript”>
sessionStorage.name=“mySessionStorage”;
document.write(sessionStorage.name);
</script>

19.  What is the use of localStorage in HTML5?

Before HTML5 LocalStores was done with cookies. Cookies are not very good for large amounts of data, because they are passed on by every request to the server, so it was very slow and in-effective. 

In HTML5, the data is NOT passed on by every server request, but used ONLY when asked for. It is possible to store large amounts of data without affecting the website's performance.and The data is stored in different areas for different websites, and a website can only access data stored by itself.

And for creating localstores just need to call localStorage object like below we are storing name and address

<script type="text/javascript">
localStorage.name="myLocalStorage";
document.write(localStorage.name);
</script> 
<script type="text/javascript">
localStorage.address="The Professionals Point.";
document.write(localStorage.address);
</script>

20. How many new Markup Elements you know in HTML5?

Following are the new markup elements introduced in HTML5:

<article> Specifies independent, self-contained content, could be a news-article, blog post, forum post, or other articles which can be distributed independently from the rest of the site.

<aside> For content aside from the content it is placed in. The aside content should be related to the surrounding content

<bdi> For text that should not be bound to the text-direction of its parent elements

<command> A button, or a radiobutton, or a checkbox

<details> For describing details about a document, or parts of a document

<summary> A caption, or summary, inside the details element

<figure> For grouping a section of stand-alone content, could be a video

<figcaption> The caption of the figure section

<footer> For a footer of a document or section, could include the name of the author, the date of the document, contact information, or copyright information

<header> For an introduction of a document or section, could include navigation

<hgroup> For a section of headings, using <h1> to <h6>, where the largest is the main heading of the section, and the others are sub-headings

<mark> For text that should be highlighted

<meter> For a measurement, used only if the maximum and minimum values are known

<nav> For a section of navigation

<progress> The state of a work in progress

<ruby> For ruby annotation (Chinese notes or characters)

<rt> For explanation of the ruby annotation

<rp> What to show browsers that do not support the ruby element

<section> For a section in a document. Such as chapters, headers, footers, or any other sections of the document

<time> For defining a time or a date, or both

<wbr> Word break. For defining a line-break opportunity.

21.  Do you know New Input Type Attribute in HTML5?

Yes, we can use below new input type Attribute in HTML5:

tel The input is of type telephone number
search The input field is a search field
url a URL
email One or more email addresses
datetime A date and/or time
date A date
month A month
week A week
time The input value is of type time
datetime-local A local date/time
number A number
range A number in a given range
color A hexadecimal color, like #82345c
placeholder Specifies a short hint that describes the expected value of an input field

22. What does a <hgroup> tag do?

The <hgroup> tag is used to group heading elements. The <hgroup> element is used to group a set of <h1> to <h6> elements.

<hgroup>
<h1>Hello</h1>
<h2>How r u?</h2>
</hgroup>

23. Which video formats are used for the video element?

Internet Explorer 9+: MP4
Chrome 6+: MP4, WebM, Ogg
Firefox 3.6+ : WebM, Ogg
Safari 5+ : MP4,
Opera 10.6+ : WebM,Ogg