Showing posts with label Tutorials. Show all posts
Showing posts with label Tutorials. Show all posts

Friday, March 24, 2017

Applications of computers in various fields

Computers have their application or utility everywhere. We find their applications in almost every sphere of life–particularly in fields where computations are required to be done at a very fast speed and where data is so complicated that the human brain finds it difficult to cope up with.


As you must be aware, computer now-a-days are being used almost in every department to do the work at a greater speed and accuracy. They can keep the record of all the employees and prepare their pay bill in a matter of minutes every month. They can keep automatic checks on the stock of a particular item. Some of the prominent areas of computer applications are:

In Tourism: Hotels use computers to speed up billing and checkout the availability of rooms. So is the case with railways and airline reservations for booking tickets. Architects can display their scale models on a computer and study them from various angles and perspectives. Structural problems can now be solved quickly and accurately.

In Banks: Banks also have started using computers extensively. Terminals are provided in the branch and the main computer is located centrally. This enables the branches to use the central computer system for information on things such as current balance,deposits, overdrafts, interest charges, etc. MICR encoded cheques can be read and sorted out with a speed of 3000 cheques per minute by computers as compared to hours taken by manual sorting. Electronic funds transfer (EFT) allows a person to transfer funds through computer signals over wires and telephone lines making
the work possible in a very short time.

In Industry: Computers are finding their greatest use in factories and industries of all kinds. They have taken over the work ranging from monotonous and risky jobs like welding to highly complex jobs such as process control. Drills, saws and entire assembly lines can be computerized. Moreover, quality control tests and the manufacturing of products, which require a lot of refinement, are done with the help of computers. Not only this, Thermal Power Plants, Oil refineries and chemical industries fully depend on
computerized control systems because in such industries the lag between two major events may be just a fraction of a second.

In Transportation: Today computers have made it possible for planes to land in foggy and stormy atmosphere also. The aircraft has a variety of sensors, which measure the plane’s altitude, position, speed, height and direction. Computer use all this information to keep the plane flying in the right direction. In fact, the Auto–pilot feature has made the work of pilot much easy.

In Education: Computers have proved to be excellent teachers. They can possess the knowledge given to them by the experts and teach you with all the patience in the world. You may like to repeat a lesson hundred times, go ahead, you may get tired but the computer will keep on teaching you. Computer based instructions (CBI) and Computer Aided Learning (CAL) are common tools used for teaching. Computer based encyclopedia such as Britannica provide you enormous amount of information on anything.

In Entertainment: Computers are also great entertainers. Many computer games are available which are like the traditional games like chess, football, cricket, etc. Dungeons and dragons provide the opportunity to test your memory and ability to think. Other games like Braino and Volcano test your knowledge.

Sunday, March 31, 2013

QBasic - Checking Palindrome Word

Description:
This tutorial will show how find if a word or string is a palindrome. A palindrome is a word or string that is the same printed forwards and backward.

Examples:
bob
noon
1991
redder

Note: the Oxford English Dictionary states that the longest palindromic word is tattarrattat.

The Guinness Book of Records states that detartrated is the longest word and a soap dish vender saippuakuppinippukauppias is a long palindrome name. (Don’t ask how to pronounce that name).


Note: The program uses LCASE$ instead of UCASE$. LCASE$ converts strings to lowercase.

Code:
DIM Wrd AS STRING
DIM RevWrd AS STRING
DIM x AS INTEGER

CLS

INPUT "Enter Word: ", Wrd

FOR x = LEN(Wrd) TO 1 STEP -1
    RevWrd = RevWrd + MID$(Wrd, x, 1)
NEXT x

PRINT
PRINT "Original Word: "; LCASE$(Wrd)
PRINT "Reverse Word: "; LCASE$(RevWrd)

IF LCASE$(Wrd) = LCASE$(RevWrd) THEN
    PRINT "The Word Is A Palindrome"
ELSE
    PRINT "The Word Is Not A Palindrome"
END IF

Wednesday, March 27, 2013

What is Query? MS -ACCESS

All of the queries that you have created to this point have been variations of “select” queries. Select que-ries are used to display data but do not actually change the data in any way.


Queries, in contrast, are used to change the data in existing tables or make new tables based on the query's results set. The primary advantage of action queries is that they allow you to modify a large number of records without having to write Visual Basic programs. Access provides four different types of action que-ries:

1. Make table— creates a new table based on the results set of the query;
2. Append— similar to a make-table query, except that the results set of the query is appended to an existing table;
3. Update— allows the values of one or more fields in the result set to be modified; and,
4. Delete— deletes all the records in the results set from the underlying table.

Friday, March 15, 2013

HTML5 - Drag and Drop

Drag and drop is a part of the HTML5 standard.

Drag and Drop

Drag and drop is a very common feature. It is when you "grab" an object and drag it to a different location.
In HTML5, drag and drop is part of the standard, and any element can be draggable.

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support drag and drop.
Note: Drag and drop does not work in Safari 5.1.2.

HTML5 Drag and Drop Example

The example below is a simple drag and drop example:
It might seem complicated, but lets go through all the different parts of a drag and drop event.

Make an Element Draggable

First of all: To make an element draggable, set the draggable attribute to true:
<img draggable="true">

What to Drag - ondragstart and setData()

Then, specify what should happen when the element is dragged.
In the example above, the ondragstart attribute calls a function, drag(event), that specifies what data to be dragged.
The dataTransfer.setData() method sets the data type and the value of the dragged data:
function drag(ev)
{
ev.dataTransfer.setData("Text",ev.target.id);
}
In this case, the data type is "Text" and the value is the id of the draggable element ("drag1").

Where to Drop - ondragover

The ondragover event specifies where the dragged data can be dropped.
By default, data/elements cannot be dropped in other elements. To allow a drop, we must prevent the default handling of the element.
This is done by calling the event.preventDefault() method for the ondragover event:
event.preventDefault()

Do the Drop - ondrop

When the dragged data is dropped, a drop event occurs.
In the example above, the ondrop attribute calls a function, drop(event):
function drop(ev)
{
ev.preventDefault();
var data=ev.dataTransfer.getData("Text");
ev.target.appendChild(document.getElementById(data));
}
Code explained:
  • Call preventDefault() to prevent the browser default handling of the data (default is open as link on drop)
  • Get the dragged data with the dataTransfer.getData("Text") method. This method will return any data that was set to the same type in the setData() method
  • The dragged data is the id of the dragged element ("drag1")
  • Append the dragged element into the drop element

Wednesday, March 13, 2013

HTML5 Inline SVG

HTML5 has support for inline SVG.

What is SVG?

  • SVG stands for Scalable Vector Graphics
  • SVG is used to define vector-based graphics for the Web
  • SVG defines the graphics in XML format
  • SVG graphics do NOT lose any quality if they are zoomed or resized
  • Every element and every attribute in SVG files can be animated
  • SVG is a W3C recommendation

SVG Advantages

Advantages of using SVG over other image formats (like JPEG and GIF) are:
  • SVG images can be created and edited with any text editor
  • SVG images can be searched, indexed, scripted, and compressed
  • SVG images are scalable
  • SVG images can be printed with high quality at any resolution
  • SVG images are zoomable (and the image can be zoomed without degradation)

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support inline SVG.

Embed SVG Directly Into HTML Pages

In HTML5, you can embed SVG elements directly into your HTML page:

Differences Between SVG and Canvas

SVG is a language for describing 2D graphics in XML.
Canvas draws 2D graphics, on the fly (with a JavaScript).
SVG is XML based, which means that every element is available within the SVG DOM. You can attach JavaScript event handlers for an element.
In SVG, each drawn shape is remembered as an object. If attributes of an SVG object are changed, the browser can automatically re-render the shape.
Canvas is rendered pixel by pixel. In canvas, once the graphic is drawn, it is forgotten by the browser. If its position should be changed, the entire scene needs to be redrawn, including any objects that might have been covered by the graphic.

Comparison of Canvas and SVG

The table below shows some important differences between Canvas and SVG:

Canvas SVG
  • Resolution dependent
  • No support for event handlers
  • Poor text rendering capabilities
  • You can save the resulting image as .png or .jpg
  • Well suited for graphic-intensive games
  • Resolution independent
  • Support for event handlers
  • Best suited for applications with large rendering areas (Google Maps)
  • Slow rendering if complex (anything that uses the DOM a lot will be slow)
  • Not suited for game applications

Thursday, March 7, 2013

HTML5 Canvas

The <canvas> element is used to draw graphics, on the fly, on a web page.
Draw a red rectangle, a gradient rectangle, a multicolor rectangle, and some multicolor text onto the canvas:
 
What is Canvas?
The HTML5 <canvas> element is used to draw graphics, on the fly, via scripting (usually JavaScript).
The <canvas> element is only a container for graphics. You must use a script to actually draw the graphics.
Canvas has several methods for drawing paths, boxes, circles, characters, and adding images.

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the <canvas> element.
Note: Internet Explorer 8 and earlier versions, do not support the <canvas> element.

Create a Canvas

A canvas is a rectangular area on an HTML page, and it is specified with the <canvas> element.
Note: By default, the <canvas> element has no border and no content.
The markup looks like this:
<canvas id="myCanvas" width="200" height="100"></canvas>
Note: Always specify an id attribute (to be referred to in a script), and a width and height attribute to define the size of the canvas.
Tip: You can have multiple <canvas> elements on one HTML page.
To add a border, use the style attribute:

Example

<canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;">
</canvas>

Draw Onto The Canvas With JavaScript

All drawing on the canvas must be done inside a JavaScript:

Example

<script>
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.fillStyle="#FF0000";
ctx.fillRect(0,0,150,75);
</script>
Example explained:
First, find the <canvas> element:
var c=document.getElementById("myCanvas"); 
Then, call its getContext() method (you must pass the string "2d" to the getContext() method):

var ctx=c.getContext("2d"); 
The getContext("2d") object is a built-in HTML5 object, with many properties and methods for drawing paths, boxes, circles, text, images, and more.

The next two lines draw a red rectangle:

ctx.fillStyle="#FF0000";
ctx.fillRect(0,0,150,75); 
The fillStyle property can be a CSS color, a gradient, or a pattern. The default fillStyle is #000000 (black).
The fillRect(x,y,width,height) method draws a rectangle filled with the current fill style.

New Elements in HTML5

The internet, and the use of the internet, has changed a lot since HTML 4.01 became a standard in 1999.
Today, some elements in HTML 4.01 are obsolete, never used, or not used the way they were intended. These elements are removed or re-written in HTML5.

To better handle today's internet use, HTML5 also includes new elements for better structure, better form handling, drawing, and for media content.

New Semantic/Structural Elements

HTML5 offers new elements for better structure:
Tag Description
<article> Defines an article
<aside> Defines content aside from the page content
<bdi> Isolates a part of text that might be formatted in a different direction from other text outside it
<command> Defines a command button that a user can invoke
<details> Defines additional details that the user can view or hide
<dialog> Defines a dialog box or window
<summary> Defines a visible heading for a <details> element
<figure> Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.
<figcaption> Defines a caption for a <figure> element
<footer> Defines a footer for a document or section
<header> Defines a header for a document or section
<hgroup> Groups a set of <h1> to <h6> elements when a heading has multiple levels
<mark> Defines marked/highlighted text
<meter> Defines a scalar measurement within a known range (a gauge)
<nav> Defines navigation links
<progress> Represents the progress of a task
<ruby> Defines a ruby annotation (for East Asian typography)
<rt> Defines an explanation/pronunciation of characters (for East Asian typography)
<rp> Defines what to show in browsers that do not support ruby annotations
<section> Defines a section in a document
<time> Defines a date/time
<wbr> Defines a possible line-break


New Media Elements

HTML5 offers new elements for media content:
Tag Description
<audio> Defines sound content
<video> Defines a video or movie
<source> Defines multiple media resources for <video> and <audio>
<embed> Defines a container for an external application or interactive content (a plug-in)
<track> Defines text tracks for <video> and <audio>


The new <canvas> Element

Tag Description
<canvas> Used to draw graphics, on the fly, via scripting (usually JavaScript)


New Form Elements

HTML5 offers new form elements, for more functionality:
Tag Description
<datalist> Specifies a list of pre-defined options for input controls
<keygen> Defines a key-pair generator field (for forms)
<output> Defines the result of a calculation


Removed Elements

The following HTML 4.01 elements are removed from HTML5:
  • <acronym>
  • <applet>
  • <basefont>
  • <big>
  • <center>
  • <dir>
  • <font>
  • <frame>
  • <frameset>
  • <noframes>
  • <strike>
  • <tt>

What is HTML5? HTML5 Introduction.

  • HTML5 will be the new standard for HTML.
  • The previous version of HTML, HTML 4.01, came in 1999. The web has changed a lot since then.
  • HTML5 is still a work in progress. However, the major browsers support many of the new HTML5 elements and APIs.

How Did HTML5 Get Started?

HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG).
WHATWG was working with web forms and applications, and W3C was working with XHTML 2.0. In 2006, they decided to cooperate and create a new version of HTML.
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 HTML5 <!DOCTYPE>

In HTML5 there is only one <!doctype> declaration, and it is very simple:
<!DOCTYPE html>

Minimum HTML5 Document

Below is a simple HTML5 document, with the minimum of required tags:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
            The content of the document......
</body>
</html>

HTML5 - New Features

Some of the most interesting new features in HTML5:
  • The <canvas> element for 2D drawing
  • The <video> and <audio> elements for media playback
  • Support for local storage
  • New content-specific elements, like <article>, <footer>, <header>, <nav>, <section>
  • New form controls, like calendar, date, time, email, url, search

Browser Support for HTML5

HTML5 is not yet an official standard, and no browsers have full HTML5 support.

But all major browsers (Safari, Chrome, Firefox, Opera, Internet Explorer) continue to add new HTML5 features to their latest versions.