Menus

Jun 14, 2016

HTML 5 Introduction

HTML 5
Introduction
HTML 5 is nothing different than HTML, it is an advanced & modified version of HTML standers which most of new browsers supports this standard. HTML 5 has introduced some new tags and removed some unnecessary tags from the HTML standers.
The first web browser, Mosaic, was introduced in 1993. A year later Netscape, based on Mosaic, was introduced and the net began to become popular. HTML was used in both browsers, but there was no "standard" HTML until the introduction of HTML 2.0.
HTML 2.0 was first published in 1995.* HTML 3.0 was published two years later and 4.01 two years after that. HTML 4.01 has been the work horse of the net ever since.
The first "working draft" of HTML5 came out in January of 2008 and it already has surprisingly broad browser support. However HTML5 is not yet fully implemented and won't be for some years yet.
Two groups, the W3C and the WHATWG (Web Hypertext Application Technology Working Group), are in charge of developing HTML5.
In many ways HTML5 is not all that different that 4.01. Certain tags, such as the <font> tag that were "deprecated" but worked in HTML 4.01 don't work in HTML5. There are a number of other odds and ends that have been changed, but they tidy up old messes rather than introduce fundamental changes.

Some rules for HTML5 were established:
  • New features should be based on HTML, CSS, DOM, and JavaScript
  • Reduce the need for external plugins (like Flash)
  • Better error handling
  • More markup to replace scripting
  • HTML5 should be device independent
  • The development process should be visible to the public

The doctype declaration
At the very top of the page you will see the doctype declaration:
<!DOCTYPE html>
Like any language, HTML5 has a grammar and a vocabulary.
Grammar: <!DOCTYPE html> goes at the top of every HTML5 page.
Vocabulary: The HTML5 word <!DOCTYPE html> means "this page is written in HTML5"

A Sample HTML5 Document
Text Box: <!DOCTYPE html>
<html>
    <head> 
        <title>Title of the document</title>
   </head>
  <body>
      The content of the document......
  </body>
</html>

<NAV> tag
The <nav> tag defines a set of navigation links.
A Sample HTML5 Document
Text Box: <nav>
  <a href="/html/">HTML</a> |
  <a href="/css/">CSS</a> |
  <a href="/js/">JavaScript</a> |
  <a href="/jquery/">jQuery</a>
</nav>

HTML5 Video
Many modern websites show videos. HTML5 defines a new element which specifies a standard way to embed a video/movie on the web page: the <video> element. In HTML 4.01 or older version browsers shows the videos through a plug-ins (like flash player).
Example:
Text Box: <video width="320" height="240" controls="controls">
    <source src="movie.mp4" type="video/mp4" />
    <source src="movie.ogg" type="video/ogg" />
   Your browser does not support the video tag.
</video>
·         You should also insert text content between the <video> and </video> tags for browsers that do not support the <video> element.
·         The <video> element allows multiple <source> elements. <source> elements can link to different video files. The browser will use the first recognized format.
·         The control attribute adds video controls, like play, pause, and volume.

HTML Video Tags:
<video> : Defines a video or movie
<source> : Defines multiple media resources for media elements, such as <video> and <audio>
<track> : Defines text tracks in mediaplayer.
Note: The <track> tag is not supported in any of the major browsers.

HTML5 Audio
Similarly to video before HTML5 standard browsers use the plug-ins to play the audio file. HTML5 defines a new element which specifies a standard way to embed an audio file on a web page: the <audio> element.
Example:
Text Box: <audio controls="controls">
    <source src="song.mp3" type="audio/mpeg" />
    <source src="song.ogg" type="audio/ogg" />
   Your browser does not support the audio tag.
</audio>

·         The control attribute adds audio controls, like play, pause, and volume.
·         You should also insert text content between the <audio> and </audio> tags for browsers that do not support the <audio> element.
·         The <audio> element allows multiple <source> elements. <source> elements can link to different audio files. The browser will use the first recognized format.

HTML5 Canvas
The canvas concept was originally introduced by Apple to be used in Mac OS X WebKit to create dashboard widgets. Before the arrival of canvas, you could only use drawing APIs in a browser through plug-ins such as Adobe plug-ins for Flash and Scalable Vector Graphics (SVG), Vector Markup Language (VML) only in Internet Explorer, or other clever JavaScript hacks.
When you use a canvas element in your web page, it creates a rectangular area on the page. By default, this rectangular area is 300 pixels wide and 150 pixels high, but you can specify the exact size and set other attributes for your canvas element.
A Basic Canvas Element:
<canvas></canvas>
Once you have added a canvas element to your page, you can use JavaScript to manipulate it any way you want. You can add graphics, lines and text to it, you can draw on it, and you can even add advanced animations to it.
The canvas API supports the same two-dimensional drawing operations that most modern operating systems and frameworks support.
To programmatically use a canvas, you have to first get its context. You can then perform actions on the context and finally apply those actions to the context. You can then perform actions on the context and finally apply those actions to the context.

Canvas Coordinates
Canvas coordinates start at x=0, y=0 in the upper-left corner, which we will refer to as the origin and increase (in pixels) horizontally over the x-axis and vertically over the y-axis.

Adding a Canvas to a page
Adding a canvas element in an HTML page is pretty straight-forward.
Example:
<canvas id="diagonal" style="border: 1px solid;" width="200" height="200"></canvas>
Note the addition of the ID="diagonal" to make it easy to locate this canvas element programmatically. An ID attribute is crucial to any canvas because all the useful operations on this element must be done through scripting.

Script code for Example canvas:
<script>
function drawDiagonal(){
        //Get the canvas element and its drawing context
        var canvas = document.getElementById('diagonal');
        var context = canvas.getContext('2d');

        //Create a path in absolute coordinates
        context.beginPath();
        context.moveTo(70,140);
        context.lineTo(140,70);

        //Stroke the line onto the canvas
        context.stroke();
}
        window.addEventListener("load", drawDiagonal, true);
</script>
        The drawing methods moveTo() and lineTo() do not actually create the line; you finalize a canvas operation and draw the line by calling the context.stroke() method.
Lets examine the JavaScript code used to create the diagonal line. It is a simple example, but it captures the essential flow of working with the Canvas API. You should know the detail of Canvas API for further drawing advance at canvas.

HTML5 Scalable Vector Graphics (SVG)
Vector graphics are quite different. Vector graphics represent images with mathematical descriptions of geometry. A vector image contains all of the information needed to draw an image from high-level geometric objects such as lines and shapes.
As you can tell by the name, SVG is an example of vector graphics.
When you magnify, rotate, or otherwise transform SVG content, all of the lines making up the image are crisply redrawn. SVG scales without losing quality.
Example: Adding SVG to Page
<!doctype html>
<svg width="200" height="200">
</svg>

Adding Simple Shapes to the SVG:
The SVG language includes basic shape elements such as rectangles, circles, and ellipses. The size and position of shape elements are defined with attributes. For rectangles, these are width and height.
Exmaple:
<!doctype html>
<svg width="200" height="200">
<rect x="10" y="20" width="100" height="80" stroke="red" fill="#ccc" />
<circle cx="120" cy="80" r="40" stroke="#00f" fill="none" stroke-width="8" />
</svg>


Transforming SVG Elements
There are organizational elements in SVG intended to combine multiple elements so that they can be transformed or linked to as units. The <g> element stands for “group.” Groups can be used to combine multiple related elements. As a group, they can be referred to by a common ID. A group can also be transformed as a unit. If you add a transform attribute to a group, all of that group’s contents are transformed. The transform attribute can include commands to rotate, translate, scale, and skew.
Example:
<svg width="200" height="200">
<g transform="translate(60,0) rotate(30) scale(0.75)" id="ShapeGroup">
<rect x="10" y="20" width="100" height="80" stroke="red" fill="#ccc" />
<circle cx="120" cy="80" r="40" stroke="#00f" fill="none" stroke-width="8" />
</g>
</svg>
Reusing Content:
SVG has a <defs> element for defining content for future use. It also has an element named <use> that you can link to your definitions. This lets you reuse the same content multiple times and eliminate redundancy. Figure below shows a group used three times at different transformed positions and scales. The group has the id ShapeGroup, and it contains a rectangle and a circle. The actual rectangle and circle shapes are just defined the one time inside of the <defs> element. The defined group is not, by itself, visible. Instead, there are three <use> elements linked to the shape group, so three rectangles and three circles appear rendered on the page.
Example:
<svg width="200" height="200">
<defs>
<g id="ShapeGroup">
<rect x="10" y="20" width="100" height="80" stroke="red" fill="#ccc" />
<circle cx="120" cy="80" r="40" stroke="#00f" fill="none" stroke-width="8" />
</g>
</defs>
<use xlink:href="#ShapeGroup" transform="translate(60,0) scale(0.5)"/>
<use xlink:href="#ShapeGroup" transform="translate(120,80) scale(0.4)"/>
<use xlink:href="#ShapeGroup" transform="translate(20,60) scale(0.25)"/>
</svg>



SVG Text:
SVG also supports text. Text in SVG is selectable within the browser (see Figure 3-11). Should they choose to, browsers and search engines could also allow users to search for text inside of SVG text elements. This has major usability and accessibility benefits.
SVG Text has attributes that are similar to CSS style rules for HTML.
Example:
<svg width="600" height="200">
<text x="10" y="80"
font-family="Droid Sans"
stroke="#00f" fill="#0ff" font-size="40px"
font-weight="bold">
Select this text!
</text>
</svg>


JavaScript fibonacci series.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Fibonacii Series</title>
</head>
<body>
<script type="text/javascript">
var first=0,second=1,third,i;
var term = parseInt(prompt("How Many Terms"));

Jun 11, 2016

Unit 3: Understanding Process Management of Operating System



UNIT 3
Process Management

Process
A process is defined as an entity which represents the basic unit of work to be implemented in the system i.e. a process is a program in execution. The execution of a process must progress in a sequential fashion. In general, a process will need certain resources such as the CPU time, memory, files, I/O devices and etc. to accomplish its task. As a process executes, it changes state. The state of a process is defined by its current activity. Each process may be in one of the following states: New state, ready state, waiting state, running state, and finished (Exit) state.
Process states
1.   New: A process that has just been created but has not yet been admitted to the pool of executable processes by the OS.
2.   Ready: Process that is prepared to execute when given the opportunity. That is, they are not waiting on anything except the CPU availability.

Jun 8, 2016

Javascript program to check if entered number is valid or not.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Number Valid Form</title>
<script type="text/javascript">
function validNumber(thisform)
        {
        var num=thisform.num.value;
        if(num==null || num =="")
                {
                alert("Enter the Number");
                thisform.num.focus();
                return false;
                }
        if(isNaN(num))
                {
                alert("It's not a Valid Number");
                thisform.num.focus();
                return false;
                }
        return true;
        }

Jun 7, 2016

How to make spring login application using spring-security in netbeans.

(Sharing is the most valuable work in this world, so friend don’t forget to share.)
I hope this spring-security login application will help you to grasp the concept of spring-security. 
You required additional four packages which are shown in below figure:


Flow chart of Library Management System made using C

Dear friends this flowchart was made by me when I was in BCA 2nd semester. I hope this flowchart will help you to make your flow chart.

You can download it by clicking below link:

Flow chart of project Library Management System made using C

How to split a table into two tables using microsoft office word.

Step 1
Start Word and open the document containing the table you would like to split.
Step 2
Click the cursor in the first cell of the row in which you want to begin the second table. For example, if your table has nine rows, and you want one table of four rows and one table of five rows, click the cursor into the first cell of row four.
Step 3
Click the “Layout” tab. Note that you will only use the tools inside this tab if you’ve clicked inside a table. If you don’t see the tab, try clicking the table again.
Step 4
Click the “Split Table” button on the ribbon. The table is split.
Thank you J


How to remove all the hyperlinks in a word document from msword

Open the document in MS-Word
Press CTRL+A
Press CTRL+SHIFT+F9

Thank You J

How to remove all the superscripts from a word document in MS-Word

  1. Open the document in MS-word
  2. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  3. Click the More button, if it is available.
  4. Make sure both the Find What and Replace With boxes are empty.
  5. Click once in the Find What box.
  6. Choose Format | Font. Word displays the Find Font dialog box.
  7. Click the Superscript check box until it shows as selected.
  8. Click OK to close the Find Font dialog box.
  9. Make Sure Replace tab is empty
  10. Click Replace All.

A list of symbols of emotions which we can use in facebook

Icon
Meaning
:‑) :) :D :o) :] :3 :c) :> =] 8) =) :} :^) :)
Smiley or happy face.
:‑D 8‑D 8D x‑D xD X‑D XD =‑D =D =‑3 =3 B^D
Laughing, big grin, laugh with glasses

Java Internationalization Example

  1. Create a folder I18N
  2. Goto above folder from command prompt
  3. Create a java class named I18NSample.java which is as follows:
import java.util.*;
public class I18NSample{
        static public void main(String args[]){
            String language;
            String country;
            //if(args.length!=2){
                language="en";
                country="US";
            //}else{
               // language=args[0];
                //country=args[1];
           // }

Integrating Struts2 with Hibernate

Follow steps:
1.   Create a table named users in database with following details:
CREATE TABLE `users` (
  `uname` varchar(10) NOT NULL,
  `pwd` varchar(10) default NULL,
  `email` varchar(50) default NULL,
  `dor` date default NULL,
  PRIMARY KEY  (`uname`),
  UNIQUE KEY `email` (`email`)
);
and

Contact Form

Name

Email *

Message *