menu

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Menu

  • C
  • C++
  • CCNA
  • Java

Translate

Wednesday, 9 September 2015

To check largest among two numbers without using if statement

To check largest among two numbers without using if statement

============================================================

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("Enter two numbers");
scanf("%d%d",&a,&b);
c=a>b?a:b;
printf("The largest number is %d",c);
getch();

}
 
========================

Out put
Enter two numbers
10
20
The largest number is 20
Program to concatenate of two strings without using strcat function

 ------------------------------------------------------------

#include<stdio.h>
#include<conio.h>
void main()
{
    char str1[50],str2[50];
    int i,j,n,k;
    clrscr();
    printf("\n Please Give The STRING OF A : ");
    scanf("%s",str1);
    printf("\n Please Give The STRING OF B : ");
    scanf("%s",str2);
    for(i=0,k=0;a[i]!='\0';i++)
        k++;
    for(j=0,n=0;b[j]!='\0';j++)
        n++;
    printf("VALUE OF K=%d",k);
    printf("VALUE OF N=%d",n);
    for(i=k,j=0;i<=n+k;i++,j++)
            str1[i]=str2[j];

    printf("\n THE Concatenated string is %s .",str1);
    getch();
}


------------------------------------------------------------------------------------------------
Please Give The STRING OF A : Mudasir
 Please Give The STRING OF B : Najar
VALUE OF K= 4VALUE OF N= 5

 THE Concatenated stringis MudsirNajar

Tuesday, 8 September 2015

Crossover and Mutation



Introduction
Crossover and mutation are two basic operators of Genetic Algorithm (GA). Performance of GA very depends on them. Type and implementation of operators depends on encoding and also on a problem.
There are many ways how to do crossover and mutation. In this chapter are only some examples and suggestions how to do it for several encoding.

Binary Encoding
Crossover
Single point crossover - one crossover point is selected, binary string from beginning of chromosome to the crossover point is copied from one parent, the rest is copied from the second parent


                11001011                    +                    11011111           =              11001111

Two point crossover - two crossover point are selected, binary string from beginning of chromosome to the first crossover point is copied from one parent, the part from the first to the second crossover point is copied from the second parent and the rest is copied from the first parent

                       11001011              +             11011111                           =             11011111

Uniform crossover - bits are randomly copied from the first or from the second parent
              11001011                    +                 11011101                     =               11011111

Arithmetic crossover - some arithmetic operation is performed to make a new offspring

                       11001011                +                       11011111              =             11001001    (AND)
 
 
 
Mutation
Bit inversion - selected bits are inverted

11001001         =>       10001001
 

Permutation Encoding
Crossover
Single point crossover - one crossover point is selected, till this point the permutation is copied from the first parent, then the second parent is scanned and if the number is not yet in the offspring it is added
Note: there are more ways how to produce the rest after crossover point
(1 2 3 4 5 6 7 8 9) + (4 5 3 6 8 9 7 2 1) = (1 2 3 4 5 6 8 9 7)
Mutation
Order changing - two numbers are selected and exchanged
(1 2 3 4 5 6 8 9 7) => (1 8 3 4 5 6 2 9 7)

Value Encoding
Crossover
All crossovers from binary encoding can be used
Mutation
  •  Adding a small number (for real value encoding) - to selected values is added (or subtracted) a small number
(1.29  5.68  2.86  4.11  5.55) => (1.29  5.68  2.73  4.22  5.55)

Tree Encoding
Crossover
  • Tree crossover - in both parent one crossover point is selected, parents are divided in that point and exchange part below crossover point to produce new offspring

 
 Mutation
  • Changing operator, number - selected nodes are changed

Sixth Sense Technology


Sixth Sense Technology


Definition of Sixth Sense Technology
Sixth Sense Technology integrates digital information into the physical world and its objects, making the entire world your computer. It can turn any surface into a touch-screen for computing, controlled by simple hand gestures. It is not a technology which is aimed at changing human habits but causing computers and other machines to adapt to human needs. It also supports multi user and multi touch provisions. Sixth Sense device is a mini-projector coupled with a camera and a cell phone-which acts as the computer and your connection to the Cloud, all the information stored on the web. The current prototype costs around $350. The Sixth Sense prototype is used to implement several applications that have shown the usefulness, viability and flexibility of the system

Introduction of Sixth Sense Technology
'Sixth Sense' is a wearable gestural interface that augments the physical world around us with digital information and lets us use natural hand gestures to interact with that information the hardware components are coupled in a pendant like mobile wearable device. The Sixth Sense prototype is comprised of a pocket projector, a mirror,colored marker and a camera. The camera, mirror and projector is connected wirelessly to a blue tooth smart phone device that can easily fit into the user's pocket.A software then processes the data that is collected by the capturing device and produces analysis.The software that is used in sixth sense device is open source type


Gesture Recognition
It is a technology which is aimed at interpreting human gestures with the help of mathematical algorithms. Gesture recognition technique basically focuses on the emotion recognition from the face and hand gesture recognition. Gender recognition technique enables humans to interact with computers in a more direct way without using any external interfacing devices. It can provide a much better alternative to text user interfaces and graphical user interface which requires the need of a keyboard or mouse to interact with the computer. Interfaces which solely depends on the gestures requires precise hand pose tracking. In the early versions of gesture recognition process special type of hand gloves which provide information about hand position orientation and flux of the fingers. In the SixthSense devices colored bands are used for this purpose. Once hand pose has been captured the gestures can be recognized using different technique's. Neural network approaches or statistical templates are the commonly used techniques used for the recognition purposes. This technique have an high accuracy usually showing accuracy of more than 95%. Time dependent neural network will also be used for real time recognition of the gestures

APPLICATION
The sixth sense technology finds a lot of application in the modern world. The sixth sense devices bridge the gap by bringing the digital world into the real world and in that process allowing the users toiu interact with the information without the help of any machine interfaces. Prototypes of the sixth sense device have demonstrated viability, usefulness and flexibility of this new technology. According to the words of its developers the extend of use of this new device is only limited by the imagination of human beings
The sixth sense recognizes the objects around us and displays the information relating to those objects in a real time environment. The sixth sense technology allows the user to interact the information through hand gestures. This is a quiet efficient way compared to the text and graphic based user interface. It has the potential to form the transparent user interface for accessing the information around us