Tuesday, February 19, 2013

BASIC OF C LANGUAGE


C LANGUAGE HISTORY
             A high-level programming language developed by Dennis Ritchie at Bell Labs in the mid 1970s. Although originally designed as a systems programming language, C has proved to be a powerful and flexible language that can be used for a variety of applications, from business programs to engineering. 

           C is a particularly popular language for personal computer programmers because it is relatively small -- it requires less memory than other languages.
The first major program written in C was the UNIX operating system, and for many years C was considered to be inextricably linked with UNIX. Now, however, C is an important language independent of UNIX.
           Although it is a high-level language, C is much closer to assembly language than are most other high-level languages. This closeness to the underlying machine language allows C programmers to write very efficient code

Where is C useful?
             C’s ability to communicate directly with hardware makes it a powerful choice for system programmers. In fact, popular operating systems such as Unix and Linux are written entirely in C. Additionally, even compilers and interpreters for other languages such as FORTRAN, Pascal, and BASIC are written in C. However, C’s scope is not just limited to developing system programs. It is also used to develop any kind of application, including complex business ones. The following is a partial list of areas where C language is used: 
  • Embedded Systems  
  • Systems Programming
  • Artificial Intelligence
  • Industrial Automation
  • Computer Graphics
  • Space Research
  • Image Processing
  • Game Programming
What kind of language is C? 
             C is a structured programming language, which means that it allows you to develop programs using well-defined control structures, and provides modularity (breaking the task into multiple sub tasks that are simple enough to understand and to reuse). 
           C is often called a middle-level language because it combines the best elements of low-level or machine language with high-level languages. 
Why you should learn C? 
  • C is simple.
  • There are only 32 keywords so C is very easy to master. Keywords are words that have special meaning in C language.
  • C programs run faster than programs written in most other languages.
  • C enables easy communication with computer hardware making it easy to write system programs such as compilers and interpreters.
A C program basically has the following form:
  • Preprocessor Commands
  • Functions
  • Variables
  • Statements & Expressions
  • Comments
The following program is written in the C programming language. Open a text file hello.c using vi editor and put the following lines inside that file.
#include

int main()
{
   /* My first program */
   printf("Hello, World! \n");
  
   return 0;
}
Preprocessor Commands: 
       These commands tells the compiler to do preprocessing before doing actual compilation. Like #include  is a preprocessor command which tells a C compiler to include stdio.h file before going to actual compilation. You will learn more about C Preprocessors in C Preprocessors session.
Functions: 
         It is the main building blocks of any C Program. Every C Program will have one or more functions and there is one mandatory function which is called main() function. This function is prefixed with keyword int which means this function returns an integer value when it exits. This integer value is retured using return statement.
The C Programming language provides a set of built-in functions. In the above example printf()is a C built-in function which is used to print anything on the screen. Check Built in function section for more detail.

Variables: 
         These are used to hold numbers, strings and complex data for manipulation. 

Statements & Expressions :
           Expressions combine variables and constants to create new values. Statements are expressions, assignments, function calls, or control flow statements which make up C programs.

Comments: 
         These are used to give additional useful information inside a C Program. All the comments will be put inside /*...*/ as given in the example above. A comment can span through multiple lines.
Characteristics of C
                C's characteristics that define the language and also have lead to its popularity as a programming language. 
  • Small size
  • Extensive use of function calls
  • Loose typing -- unlike PASCAL
  • Structured language
  • Low level (BitWise) programming readily available
  • Pointer implementation - extensive use of pointers for memory, array, structures and functions.

C has now become a widely used professional language for various reasons.
  • It has high-level constructs.
  • It can handle low-level activities.
  • It produces efficient programs.
  • It can be compiled on a variety of computers.
C Program Structure
  • A C program basically has the following form:
  • Preprocessor Commands
  • Type definitions
  • Function prototypes -- declare function types and variables passed to function.
  • Variables
  • Functions
  • We must have a main() function.
A function has the form:

type function_name (parameters)
                        {
                                                  local variables

                                                  C Statements

                         }
If the type definition is omitted C assumes that function returns an integer type. NOTE: This can be a source of problems in a program.
So returning to our first C program:

  /* Sample program */

                        main()
                                                  {

                                                  printf( ``I Like C n'' );
                                                  exit ( 0 );

                                                  }


C has a concept of 'data types' which are used to define a variable before its use. The definition of a variable will assign storage for the variable and define the type of data that will be held in the location.
The value of a variable can be changed any time.
C has the following basic built-in datatypes.
  • int
  • float
  • double
  • char
int - data type
int is used to define integer numbers.
    {
        int Count;
        Count = 5;
    }

float - data type
float is used to define floating point numbers.

    {
        float Miles;
        Miles = 5.6;
    }

double - data type
double is used to define BIG floating point numbers. It reserves twice the storage for the number. On PCs this is likely to be 8 bytes.

    {
        double Atoms;
        Atoms = 2500000;
    }

char - data type
char defines characters.
    {
        char Letter;
        Letter = 'x';
    }

Modifiers
The data types explained above have the following modifiers.
  • short
  • long
  • signed
  • unsigned
The modifiers define the amount of storage allocated to the variable. The amount of storage allocated is not cast in stone. ANSI has the following rules:


        short int <=    int <= long int
            float <= double <= long double

What this means is that a 'short int' should assign less than or the same amount of storage as an 'int' and the 'int' should be less or the same bytes than a 'long int'. What this means in the real world is:

                 Type Bytes             Range

            short int                            2          -32,768 -> +32,767                (32kb)
   unsigned short int                       2                0 -> +65,535                   (64Kb)
         unsigned int                         4                0 -> +4,294,967,295         ( 4Gb)
                  int                              4   -2,147,483,648 -> +2,147,483,647  ( 2Gb)
             long int                            4   -2,147,483,648 -> +2,147,483,647  ( 2Gb)
          signed char                         1             -128 -> +127
        unsigned char                       1                0 -> +255
                float                             4
               double                          8 
          long double                       12



A type qualifier is used to refine the declaration of a variable, a function, and parameters, by specifying whether:
Qualifiers
  • The value of a variable can be changed.
  • The value of a variable must always be read from memory rather than from a register
Standard C language recognizes the following two qualifiers:
  • const
  • volatile
The const qualifier is used to tell C that the variable value can not change after initialisation.
const float pi=3.14159;
Now pi cannot be changed at a later time within the program.

Another way to define constants is with the #define preprocessor which has the advantage that it does not use any storage

The volatile qualifier declares a data type that can have its value changed in ways outside the control or detection of the compiler (such as a variable updated by the system clock or by another program). This prevents the compiler from optimizing code referring to the object by storing the object's value in a register and re-reading it from there, rather than from memory, where it may have changed. You will use this qualifier once you will become expert in "C". So for now just proceed.

Array Initialization
  • As with other declarations, array declarations can include an optional initialization
  • Scalar variables are initialized with a single value
  • Arrays are initialized with a list of values
  • The list is enclosed in curly braces
int array [8] = {2, 4, 6, 8, 10, 12, 14, 16};

The number of initializers cannot be more than the number of elements in the array but it can be less in which case, the remaining elements are initialized to 0.if you like, the array size can be inferred from the number of initializers by leaving the square brackets empty so these are identical declarations:
int array1 [8] = {2, 4, 6, 8, 10, 12, 14, 16};
int array2 [] = {2, 4, 6, 8, 10, 12, 14, 16};

An array of characters ie string can be initialized as follows:
char string[10] = "Hello";


A variable is just a named area of storage that can hold a single value (numeric or character). The C language demands that you declare the name of each variable that you are going to use and its type, or class, before you actually try to do anything with it.
The Programming language C has two main variable types
  • Local Variables
  • Global Variables
Local Variables
  • Local variables scope is confined within the block or function where it is defined. Local variables must always be defined at the top of a block.
  • When a local variable is defined - it is not initalised by the system, you must initalise it yourself.
  • When execution of the block starts the variable is available, and when the block ends the variable 'dies'.
Check following example's output
   main()
   {
      int i=4;
      int j=10;
  
      i++;
  
      if (j > 0)
      {
         /* i defined in 'main' can be seen */
         printf("i is %d\n",i);
      }
  
      if (j > 0)
      {
         /* 'i' is defined and so local to this block */
         int i=100;
         printf("i is %d\n",i);     
      }/* 'i' (value 100) dies here */
  
      printf("i is %d\n",i); /* 'i' (value 5) is now visable.*/
   }
  
   This will generate following output
   i is 5
   i is 100
   i is 5

Here ++ is called incremental operator and it increase the value of any integer variable by 1. Thus i++ is equivalent to i = i + 1;
You will see -- operator also which is called decremental operator and it i decrease the value of any integer variable by 1. Thus i-- is equivalent to i = i - 1;
Global Variables
Global variable is defined at the top of the program file and it can be visible and modified by any function that may reference it.
Global variables are initalised automatically by the system when you define them!
Data Type
Initialser
int
0
char
'\0'
float
0
pointer
NULL

If same variable name is being used for global and local variable then local variable takes preference in its scope. But it is not a good practice to use global variables and local variables with the same name.

   int i=4;          /* Global definition   */
  
   main()
   {
       i++;          /* Global variable     */
       func();
       printf( "Value of i = %d -- main function\n", i );
   }

   func()
   {
       int i=10;     /* Local definition */
       i++;          /* Local variable    */
       printf( "Value of i = %d -- func() function\n", i );
   }

   This will produce following result
   Value of i = 11 -- func() function
   Value of i = 5 -- main function

i in main function is global and will be incremented to 5. i in func is internal and will be incremented to 11. When control returns to main the internal variable will die and and any reference to i will be to the global.
A storage class defines the scope (visibility) and life time of variables and/or functions within a C Program.
There are following storage classes which can be used in a C Program
  • auto
  • register
  • static
  • extern
auto - Storage Class
auto is the default storage class for all local variables.
            {
            int Count;
            auto int Month;
            }

The example above defines two variables with the same storage class. auto can only be used within functions, i.e. local variables.

register - Storage Class
register is used to define local variables that should be stored in a register instead of RAM. This means that the variable has a maximum size equal to the register size (usually one word) and cant have the unary '&' operator applied to it (as it does not have a memory location).
            {
            register int  Miles;
            }
Register should only be used for variables that require quick access - such as counters. It should also be noted that defining 'register' goes not mean that the variable will be stored in a register. It means that it MIGHT be stored in a register - depending on hardware and implimentation restrictions.

static - Storage Class
static is the default storage class for global variables. The two variables below (count and road) both have a static storage class.
            static int Count;
        int Road;

        {
            printf("%d\n", Road);
        }
static variables can be 'seen' within all functions in this source file. At link time, the static variables defined here will not be seen by the object modules that are brought in.
static can also be defined within a function. If this is done the variable is initalised at run time but is not reinitalized when the function is called. This inside a function static variable retains its value during vairous calls.
   void func(void);
  
   static count=10; /* Global variable - static is the default */
  
   main()
   {
     while (count--)
     {
         func();
     }
  
   }
  
   void func( void )
   {
     static i = 5;
     i++;
     printf("i is %d and count is %d\n", i, count);
   }
  
   This will produce following result
  
   i is 6 and count is 9
   i is 7 and count is 8
   i is 8 and count is 7
   i is 9 and count is 6
   i is 10 and count is 5
   i is 11 and count is 4
   i is 12 and count is 3
   i is 13 and count is 2
   i is 14 and count is 1
   i is 15 and count is 0

NOTE : Here keyword void means function does not return anything and it does not take any parameter. static variables are initialized to 0 automatically.

Definition vs Declaration : Before proceeding, let us understand the difference between defintion and declaration of a variable or function. Definition means where a variable or function is defined in reality and actual memory is allocated for variable or function. Declaration means just giving a reference of a variable and function. Through declaration we assure to the complier that this variable or function has been defined somewhere else in the program and will be provided at the time of linking. In the above examples char *func(void) has been put at the top which is a declaration of this function where as this function has been defined below to main()function.
There is one more very important use for 'static'. Consider this bit of code.

   char *func(void);

   main()
   {
      char *Text1;
      Text1 = func();
   }

   char *func(void)
   {
      char Text2[10]="martin";
      return(Text2);
   }

Now, 'func' returns a pointer to the memory location where 'text2' starts BUT text2 has a storage class of 'auto' and will disappear when we exit the function and could be overwritten but something else. The answer is to specify
    static char Text[10]="martin";

The storage assigned to 'text2' will remain reserved for the duration if the program.

extern - Storage Class
extern is used to give a reference of a global variable that is visible to ALL the program files. When you use 'extern' the variable cannot be initalized as all it does is point the variable name at a storage location that has been previously defined.
When you have multiple files and you define a global variable or function which will be used in other files also, then extern will be used in another file to give reference of defined variable or function. Just for understanding extern is used to decalre a global variable or function in another files.
File 1: main.c
   int count=5;

   main()
   {
     write_extern();
   }
File 2: write.c
   void write_extern(void);

   extern int count;

   void write_extern(void)
   {
     printf("count is %i\n", count);
   }
Here extern keyword is being used to declare count in another file.

      
What is Operator?
 Simple answer can be given using expression 4 + 5 is equal to 9. Here 4 and 5 are called operands and + is called operator. C language supports following type of operators.
  • Arithmetic Operators
  • Logical (or Relational) Operators
  • Bitwise Operators
  • Assignment Operators
  • Misc Operators

Arithmetic Operators:
        
               There are following arithmetic operators supported by C language:
Assume variable A holds 10 and variable B holds 20 then:
Operator
Description
Example
+
Adds two operands
A + B will give 30
-
Subtracts second operand from the first
A - B will give -10
*
Multiply both operands
A * B will give 200
/
Divide numerator by denumerator
B / A will give 2
%
Modulus Operator and remainder of after an integer division
B % A will give 0
++
Increment operator, increases integer value by one
A++ will give 11
--
Decrement operator, decreases integer value by one
A-- will give 9

Logical (or Relational) Operators:
            There are following logical operators supported by C language
Assume variable A holds 10 and variable B holds 20 then:

Show Examples
Operator
Description
Example
==
Checks if the value of two operands is equal or not, if yes then condition becomes true.
(A == B) is not true.
!=
Checks if the value of two operands is equal or not, if values are not equal then condition becomes true.
(A != B) is true.
> 
Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true.
(A > B) is not true.
< 
Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true.
(A < B) is true.
>=
Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.
(A >= B) is not true.
<=
Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true.
(A <= B) is true.
&&
Called Logical AND operator. If both the operands are non zero then then condition becomes true.
(A && B) is true.
||
Called Logical OR Operator. If any of the two operands is non zero then then condition becomes true.
(A || B) is true.
!
Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false.
!(A && B) is false.


Bitwise Operators:
Bitwise operator works on bits and perform bit by bit operation.
Assume if A = 60; and B = 13; Now in binary format they will be as follows:
A = 0011 1100
B = 0000 1101
-----------------
A&B = 0000 1100
A|B = 0011 1101
A^B = 0011 0001
~A  = 1100 0011

Show Examples
There are following Bitwise operators supported by C language
Operator
Description
Example
&
Binary AND Operator copies a bit to the result if it exists in both operands.
(A & B) will give 12 which is 0000 1100
|
Binary OR Operator copies a bit if it exists in eather operand.
(A | B) will give 61 which is 0011 1101
^
Binary XOR Operator copies the bit if it is set in one operand but not both.
(A ^ B) will give 49 which is 0011 0001
~
Binary Ones Complement Operator is unary and has the efect of 'flipping' bits.
(~A ) will give -60 which is 1100 0011
<< 
Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand.
A << 2 will give 240 which is 1111 0000
>> 
Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand.
A >> 2 will give 15 which is 0000 1111

Assignment Operators:
There are following assignment operators supported by C language:
Operator
Description
Example
=
Simple assignment operator, Assigns values from right side operands to left side operand
C = A + B will assigne value of A + B into C
+=
Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand
C += A is equivalent to C = C + A
-=
Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand
C -= A is equivalent to C = C - A
*=
Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand
C *= A is equivalent to C = C * A
/=
Divide AND assignment operator, It divides left operand with the right operand and assign the result to left operand
C /= A is equivalent to C = C / A
%=
Modulus AND assignment operator, It takes modulus using two operands and assign the result to left operand
C %= A is equivalent to C = C % A
<<=
Left shift AND assignment operator
C <<= 2 is same as C = C << 2
>>=
Right shift AND assignment operator
C >>= 2 is same as C = C >> 2
&=
Bitwise AND assignment operator
C &= 2 is same as C = C & 2
^=
bitwise exclusive OR and assignment operator
C ^= 2 is same as C = C ^ 2
|=
bitwise inclusive OR and assignment operator
C |= 2 is same as C = C | 2

Short Notes on L-VALUE and R-VALUE:
x = 1; takes the value on the right (e.g. 1) and puts it in the memory referenced by x. Here x and 1 are known as L-VALUES and R-VALUES respectively L-values can be on either side of the assignment operator where as R-values only appear on the right.
So x is an L-value because it can appear on the left as we've just seen, or on the right like this: y = x; However, constants like 1 are R-values because 1 could appear on the right, but 1 = x; is invalid.

Misc Operators
There are few other operators supported by C Language.
Operator
Description
Example
sizeof()
Returns the size of an variable.
sizeof(a), where a is interger, will return 4.
&
Returns the address of an variable.
&a; will give actaul address of the variable.
*
Pointer to a variable.
*a; will pointer to a variable.
? :
Conditional Expression
If Condition is true ? Then value X : Otherwise value Y
Operators Categories:
         All the operators we have discussed above can be categorised into following categories:
  • Postfix operators, which follow a single operand.
  • Unary prefix operators, which precede a single operand.
  • Binary operators, which take two operands and perform a variety of arithmetic and logical operations.
  • The conditional operator (a ternary operator), which takes three operands and evaluates either the second or third expression, depending on the evaluation of the first expression.
  • Assignment operators, which assign a value to a variable.
  • The comma operator, which guarantees left-to-right evaluation of comma-separated expressions.

Precedence of C Operators:
           Operator precedence determines the grouping of terms in an expression. This affects how an expression is evaluated. Certain operators have higher precedence than others; for example, the multiplication operator has higher precedence than the addition operator:
For example x = 7 + 3 * 2; Here x is assigned 13, not 20 because operator * has higher precedenace than + so it first get multiplied with 3*2 and then adds into 7.
Here operators with the highest precedence appear at the top of the table, those with the lowest appear at the bottom. Within an expression, higher precedenace operators will be evaluated first.
Category 
Operator 
Associativity 
Postfix 
() [] -> . ++ - -  
Left to right 
Unary 
+ - ! ~ ++ - - (type) * & sizeof 
Right to left 
Multiplicative  
* / % 
Left to right 
Additive  
+ - 
Left to right 
Shift  
<< >> 
Left to right 
Relational  
< <= > >= 
Left to right 
Equality  
== != 
Left to right 
Bitwise AND 
Left to right 
Bitwise XOR 
Left to right 
Bitwise OR 
Left to right 
Logical AND 
&& 
Left to right 
Logical OR 
|| 
Left to right 
Conditional 
?: 
Right to left 
Assignment 
= += -= *= /= %= >>= <<= &= ^= |= 
Right to left 
Comma 
Left to right 



















Monday, February 11, 2013

MULTIMEDIA


Definition of Multimedia

Multimedia uses computers to present text, audio, video, animation, interactive features, and still images in various ways and combinations made possible through the advancement of technology. By combining media and content, those interested in multimedia can take on and work with a variety of media forms to get their content across. This is an exciting new field for those interested in computers, technology, and creative career options. Multimedia can be accessed through computers or electronic devices and integrates the various forms together. One example of multimedia would be combining a website with video, audio, or text images.



Minimum requirements of multimedia computer are:-
a) Intel pentium processor or any process with MMX
b) 32/64 MB RAM / technology + graphics accelerator
c) Keyboard, Mouse , CD-ROM drive
d) 4 GB Hard disk
e) Sound card with external speaker and microphone
f) SVGA display ( color monitor)
g) Voice display (built-in)
Components of Multimedia

Text

It may be an easy content type to forget when considering multimedia systems, but text content is by far the most common media type in computing applications. Most multimedia systems use a combination of text and other media to deliver functionality. Text in multimedia systems can express specific information, or it can act as reinforcement for information contained in other media items. This is a common practice in applications with accessibility requirements.

Images

Digital image files appear in many multimedia applications. Digital photographs can display application content or can alternatively form part of a user interface. Interactive elements, such as buttons, often use custom images created by the designers and developers involved in an application. Digital image files use a variety of formats and file extensions. Among the most common are JPEGs and PNGs. Both of these often appear on websites, as the formats allow developers to minimize on file size while maximizing on picture quality. Graphic design software programs such as Photoshop and Paint.NET allow developers to create complex visual effects with digital images.

Audio

Audio files and streams play a major role in some multimedia systems. Audio files appear as part of application content and also to aid interaction. When they appear within Web applications and sites, audio files sometimes need to be deployed using plug-in media players. Audio formats include MP3, WMA, Wave, MIDI and RealAudio. When developers include audio within a website, they will generally use a compressed format to minimize on download times. Web services can also stream audio, so that users can begin playback before the entire file is downloaded.

Video

Digital video appears in many multimedia applications, particularly on the Web. As with audio, websites can stream digital video to increase the speed and availability of playback. Common digital video formats include Flash, MPEG, AVI, WMV and QuickTime. Most digital video requires use of browser plug-ins to play within Web pages, but in many cases the user's browser will already have the required resources installed.

Animation

Animated components are common within both Web and desktop multimedia applications. Animations can also include interactive effects, allowing users to engage with the animation action using their mouse and keyboard. The most common tool for creating animations on the Web is Adobe Flash, which also facilitates desktop applications. Using Flash, developers can author FLV files, exporting them as SWF movies for deployment to users. Flash also uses ActionScript code to achieve animated and interactive effects.

A Multimedia system has four basic characteristics:
·                     Multimedia systems must be computer controlled.
·                     Multimedia systems are integrated.
·                     The information they handle must be represented digitally.
·                     The interface to the final presentation of media is usually interactive.

Application of Multimedia:-
a) Multimedia presentation : Multimedia presentation can be used to better explain a subject matter to the students because it enhance the comprehension capability of students. It is extremely effective in getting across new ideas and concepts.
b) Entertainment : Multimedia technology is used by entertainment industry as in games, films, cartoons,animation,sound effects etc.
c) Software : Multimedia is used for training purpose or guide. So users can operate software without help of trainers.
d) Business communication : Multimedia is very powerful tool for enhancing the quality of business communication.
e) Multimedia web pages : Multimedia feature in web pages make more attractive, user friendly.

 Benefits of Multimedia tools
Education:
Project Management Skills
  • Creating a timeline for the completion of the project.
  • Allocating resources and time to different parts of the project.
  • Assigning roles to team members.
Research Skills
  • Determining the nature of the problem and how research should be organized.
  • Posing thoughtful questions about structure, models, cases, values, and roles.
  • Searching for information using text, electronic, and pictorial information sources.
  • Developing new information with interviews, questionnaires and other survey methods.
  • Analyzing and interpreting all the information collected to identify and interpret patterns.
Organization and Representation Skills
  • Deciding how to segment and sequence information to make it understandable.
  • Deciding how information will be represented (text, pictures, movies, audio, etc.).
  • Deciding how the information will be organized (hierarchy, sequence) and how it will be linked.
Presentation Skills
  • Mapping the design onto the presentation and implementing the ideas in multimedia.
  • Attracting and maintaining the interests of the intended audiences.
Reflection Skills
  • Evaluating the program and the process used to create it.
  • Revising the design of the program using feedback.

Features for a Multimedia System
Given the above challenges the following feature a for a Multimedia System:

Very High Processing Power
-- needed to deal with large data processing and real time delivery of media.
Special hardware commonplace.
Multimedia Capable File System
-- needed to deliver real-time media -- e.g. Video/Audio Streaming. Special
Hardware/Software needed e.g RAID technology.
Data Representations/File Formats that support multimedia
-- Data representations/file formats should be easy to handle yet allow for
compression/decompression in real-time.
Efficient and High I/O
-- input and output to the file subsystem needs to be efficient and fast. Needs to
allow for real-time recording as well as playback of data. e.g. Direct to Disk
recording systems.
Special Operating System
-- to allow access to file system and process data efficiently and quickly. Needs
to support direct transfers to disk, real-time scheduling, fast interrupt processing,
I/O streaming etc.
Storage and Memory
-- large storage units (of the order of 50 -100 Gb or more) and large memory (50 -
100 Mb or more). Large Caches also required and frequently of Level 2 and 3
hierarchy for efficient management.
Network Support
-- Client-server systems common as distributed systems common.
Software Tools
-- user friendly tools needed to handle media, design and develop applications,
deliver media.
Engineering
Software engineers may use multimedia in Computer Simulations for anything from entertainment to training such as military or industrial training. Multimedia for software interfaces are often done as a collaboration between creative professionals and software engineers.
Industry
In the Industrial sector, multimedia is used as a way to help present information to shareholders, superiors and coworkers. Multimedia is also helpful for providing employee training, advertising and selling products all over the world via virtually unlimited web-based technology

Industry
In the Industrial sector, multimedia is used as a way to help present information to shareholders, superiors and coworkers. Multimedia is also helpful for providing employee training, advertising and selling products all over the world via virtually unlimited web-based technology

Mathematical and scientific research

In mathematical and scientific research, multimedia is mainly used for modeling and simulation. For example, a scientist can look at a molecular model of a particular substance and manipulate it to arrive at a new substance. Representative research can be found in journals such as the Journal of Multimedia.



Medicine

In Medicine, doctors can get trained by looking at a virtual surgery or they can simulate how the human body is affected by diseases spread by viruses and bacteria and then develop techniques to prevent it.

Document imaging

Document imaging is a technique that takes hard copy of an image/document and converts it into a digital format (for example, scanners).
Disabilities
Ability Media allows those with disabilities to gain qualifications in the multimedia field so they can pursue careers that give them access to a wide array of powerful communication forms.


Thursday, February 7, 2013

DBMS


Explain DBMS?

        A DBMS is best described as a collection of programs that manage the database structure and that control shared access to the data in the database. Current DBMSes also store the relationships between the database components; they also take care of defining the required access paths to those components
      A database management system (DBMS) is the combination of data, hardware, software and users to help an enterprise manage its operational data.
      The main function of a DBMS is to provide efficient and reliable methods of data retrieval to many users. Efficient data retrieval is an essential function of database systems. DBMS must be able to deal with several users who try to simultaneously access several items and most frequently, the same data item A DBMS is a set of programs that is used to store and manipulation data that include the following:
      • Adding new data, for example adding details of new student.
      • Deleting unwanted data, for example deleting the details of students who have  
       completed course.
      • Changing existing data, for example modifying the fee paid by the student.
Components of DBMS
     A database system has four components. These four
components are important for understanding and designing the database system. These
are:
      1. Data
      2. Hardware
      3. Software
      4. Users
1. Data
     A Data item is the smallest unit of named data: It may consist of bits or bytes. A Data item is often referred to as field or data element. A Data aggregate is the collection of data items within the record, which is given a name and referred as a whole. Data can be collected orally or written. A database can be integrated and shared. Data stored in a system is partition into one or two databases. So if by chance data lost or damaged at one place, then it can be accessed from the second place by using the sharing facility of data base system. So a shared data also cane be reused according to the user’s requirement. Also data must be in the integrated form. Integration means data should be in unique form i.e. data collected by using a well-defined manner with no redundancy, for example Roll number in a class is non-redundant form and so these have unique resistance, but names in class may be in the redundant form and can create lot of problems later on in using and accessing the data.
2. Hardware
      Hardware is also a major and primary part of the database. Without hardware nothing can be done. The definition of Hardware is “which we can touch and see”, i.e. it has physical existences. All physical quantity or items are in this category. For example, all the hardware input/output and storage devices like keyboard, mouse, scanner, monitor, storage devices (hard disk, floppy disk, magnetic disk, and magnetic drum) etc. are commonly used with a computer system.
3. Software
      Software is another major part of the database system. It is the other side of hardware. Hardware and software are two sides of a coin. They go side by side. Software is a system. Software are further subdivided into two categories, First type is system software (like all the operating systems, all the languages and system packages etc.) and second one is an application software (payroll, electricity billing, hospital management and hostel administration etc.). We can define software as which we cannot touch and see. Software only can execute. By using software, data can be manipulated, organized and stored. -
4. Users
      Without user all of the above said components (data, hardware & software) are meaning less. User can collect the data, operate and handle the hardware. Also operator feeds the data and arranges the data in order by executing the software. Other components
      1. People - Database administrator; system developer; end user.
      2. CASE tools: Computer-aided Software Engineering (CASE) tools.
      3. User interface - Microsoft Access; PowerBuilder.
      4. Application Programs - PowerBuilder script language; Visual Basic; C++; COBOL.
      5. Repository - Store definitions of data called METADATA, screen and report formats, menu definitions, etc.
     6. Database - Store actual occurrences data.
      7. DBMS - Provide tools to manage all of this - create data, maintain data, control security access to data and to the repository, etc.
Various functions of DBMS
  • Data definition: The DBMS must be able to accept data definitions (external schemas, the conceptual schema, the internal schema, and all associated mappings) in source form and convert them to the appropriate object form.

      • Data manipu1ation: The DBMS must be able to handle requests from the users to retrieve, update, or delete existing data the database, or to add new data to the database. In other words, the DBMS must include a data manipulation language (DML) processor component.
      • Data security and integrity: The DBMS must monitor user requests and reject
any attempt to violate the security and integrity rules defined by the DBA.
      • Data recovery and concurrency: The DBMS - or else some other related software component, usually called the transaction manager - must enforce certain recovery and concurrency controls.
      • Data Dictionary: The DBMS must provide a data dictionary function. The data dictionary can be regarded as a database in its own right. The dictionary contains “data about the data” (sometimes called metadata) - that is, definitions of other objects in the system - rather than just”raw data.” In particular, all the various schemas and mapping (external, conceptual, etc.) will physically be stored, in both source and object form, in the dictionary. A comprehensive dictionary will also include cross- reference information, showing, for instance, which programs use which pieces of the database, which users require which reports, which terminals are connected to the system, and so on. The dictionary might even - in fact, probably should — be integrated into the database it defines, and thus include its own definition. It should certainly be possible to query the dictionary just like any other database, so that, for example, it is possible to tell which programs and or users are likely to be affected by some proposed change to the system.
ADVANTAGES OF DBMS
      One of the major advantages of using a database system is that the organization
can be handled easily and have centralized management and control over the data by the DBA. Some more and main advantages of database management system are given below:
      The main advantages of DBMS are:
1. Controlling Redundancy
      In a DBMS there is no redundancy (duplicate data). If any type of duplicate data arises, then DBA can control and arrange data in non-redundant way. It stores the data on the basis of a primary key, which is always unique key and have non-redundant information. For example, Roll no is the primary key to store the student data.
In traditional file processing, every user group maintains its own files. Each group independently keeps files on their db e.g., students. Therefore, much of the data is stored twice or more. Redundancy leads to several problems:
     
      • Duplication of effort
      • Storage space wasted when the same data is stored repeatedly
      Files that represent the same data may become inconsistent (since the updates are applied independently by each users group).We can use controlled redundancy.
2. Restricting Unauthorized Access
      A DBMS should provide a security and authorization subsystem.
      • Some db users will not be authorized to access all information in the db (e.g., financial data).
      • Some users are allowed only to retrieve data.
      • Some users are allowed both to retrieve and to update database.
3. Providing Persistent Storage for Program Objects and Data Structures
      Data structure provided by DBMS must be compatible with the programming language’s data structures. E.g., object oriented DBMS are compatible with programming languages such as C++, SMALL TALK, and the DBMS software automatically performs conversions between programming data structure and file formats.
4. Permitting Inferencing and Actions Using Deduction Rules
      Deductive database systems provide capabilities for defining deduction rules for inferencing new information from the stored database facts.
5. Inconsistency can be reduced
      In a database system to some extent data is stored in, inconsistent way. Inconsistency is another form of delicacy. Suppose that an em1oyee “Japneet” work in department “Computer” is represented by two distinct entries in a database. So way inconsistent data is stored and DBA can remove this inconsistent data by using DBMS.
6. Data can be shared
      In a database system data can be easily shared by different users. For example, student data can be share by teacher department, administrative block, accounts branch arid laboratory etc.
7. Standard can be enforced or maintained
      By using database system, standard can be maintained in an organization. DBA is overall controller of database system. Database is manually computed, but when DBA uses a DBMS and enter the data in computer, then standard can be enforced or maintained by using the computerized system.
8. Security can be maintained
      Passwords can be applied in a database system or file can be secured by DBA. Also in a database system, there are different coding techniques to code the data i.e. safe the data from unauthorized access. Also it provides login facility to use for securing and saving the data either by accidental threat or by intentional threat. Same recovery procedure can be also maintained to access the data by using the DBMS facility.
9. Integrity can be maintained
      In a database system, data can be written or stored in integrated way. Integration means unification and sequencing of data. In other words it can be defined as “the data contained in the data base is both accurate and consistent”. ‘Data can be accessed if it is
compiled in a unique form. We can take primary key ad some secondary key for integration of data. Centralized control can also ensure that adequate checks are
incorporated in the DBMS to provide data integrity.
10. Confliction can be removed
      In a database system, data can be written or arranged in a well-defined manner by DBA. So there is no confliction between the databases. DBA select the best file structure and accessing strategy to get better performance for the representation and use of the
data.
11. Providing Multiple User Interfaces
      For example query languages, programming languages interfaces, forms, menu- driven interfaces, etc.
12. Representing Complex Relationships Among Data
      It is used to represent Complex Relationships Among Data
13. Providing Backup and Recovery
      The DBMS also provides back up and recovery features.

DISADVANTAGES OF DBMS
      Database management system has many advantages, but due to some major problem  arise in using the DBMS, it has some disadvantages 
1.Cost
      A significant disadvantage of DBMS is cost. In addition to the cost of purchasing or developing the software, the organization *111 also purchase or upgrade the hardware
and so it becomes a costly system. Also additional cost occurs due to migration of data
from one environment of DBMS to another environment.
2. Problems associated with centralization
      Centralization also means that data is accessible from a single source. As we know the centralized data can be accessed by each user, so there is no security of data from unauthorized access and data can be damaged or lost.
3. Complexity of backup and recovery
      Backup and recovery are fairly complex in DBMS environment. As in a DBMS, if you take a backup of the data then it may affect the multi-user database system which is in operation. Damage database can be recovered from the backup floppy, but iterate duplicacy in loading to the concurrent multi-user database system.
4. Confidentiality, Privacy and Security
      When information is centralized and is made available to users from remote locations, the possibilities of abuse are often more than in a conventional system. To reduce the chances of unauthorized users accessing sensitive information, it is necessary to take technical, administrative and, possibly, legal measures. Most, databases store valuable information that must be protected against deliberate trespass and destruction.
5. Data Quality
      Since the database is accessible to users remotely, adequate controls are needed to control users updating data and to control data quality. With increased number of users accessing data directly, there are enormous opportunities for users to damage the data. Unless there are suitable controls, the data quality may be compromised.
6. Data Integrity
      Since a large number of users could be using .a database concurrently, technical safeguards are necessary to ensure that the data remain correct during operation. The main threat to data integrity comes from several different users attempting to update the same data at the same time. The database therefore needs to be protected against inadvertent changes by the users.
7. Enterprise Vulnerability
      Centralizing all data of an enterprise in one database may mean that the database becomes an indispensable resource. The survival of the enterprise may depend on reliable information being available from its database. The enterprise therefore becomes vulnerable to the destruction of the database or to unauthorized modification of the database.
8. The Cost of using a DBMS
      Conventional data processing systems are typically designed to run a number of well-defined, preplanned processes. Such systems are often “tuned” to run efficiently for the processes that they were designed for. Although the conventional systems are usually fairly inflexible in that new applications may be difficult to implement and/or expensive to run, they are usually very efficient for the applications they are designed for.
      The database approach on the other hand provides a flexible alternative where new applications can be developed relatively inexpensively. The flexible approach is not without its costs and one of these costs is the additional cost of running applications that the conventional system was designed for. Using standardized software is almost always less machine efficient than specialized software.