Witshaper is the Professional (Computing Skills, English Learning and Soft Skills) Skill Development Training Center. We provide Professional IT Courses and Soft Skill Training in Dehradun to Students, Employees and organization. Who wish to pursue a career in IT Technology. Witshaper is led by a motivated team of IT experts and Soft Skill Professionals. We provide high quality trainings. Our Emphasis is on giving the practical knowledge to the students, so that they will get to know in depth and never forget what they opt, we provide to the students real learning environment. Witshaper prepares students and professionals to be the part of this growing industry. Be a part of Witshaper and get your dreams successful

Tuesday, 12 May 2015

java program to check a particular sentence found in the file or not

package newpackage3;


/**
 *
 * @author rajani
 */


import java.io.*;
import java.util.Scanner;
import java.util.regex.MatchResult;
public class Test {
    public static void main(String[] args) throws FileNotFoundException {
        int count=0,count2=0;
        //MatchResult mr;
        Scanner s = new Scanner(new File("amazon.txt"));
         Scanner s1 = new Scanner(new File("amazoncomp.txt"));
        while (null != s.findWithinHorizon("java", 0)) {
            count=1;
            MatchResult mr = s.match();
           // System.out.printf("Word found: %s at index %d to %d.%n", mr.group(),
                  //  mr.start(), mr.end());
        }
        while (null != s1.findWithinHorizon("java", 0)) {
            count2=1;
            MatchResult mr = s1.match();
            //System.out.printf("Word found: %s at index %d to %d.%n", mr.group(),mr.start(), mr.end());
        }
        s.close();
        if(count==1)
        {
         System.out.printf("amazon.txt file data found "); 
        }
        if(count2==1)
        {
         System.out.printf("amazoncomp.txt file data found "); 
        }
    }
}

java program to search Exact data of different files

package newpackage3;
/**
 *
 * @author rajani
 */
import java.io.File;
import org.apache.commons.io.FileUtils;
public class compareFileContent
{
        public static void main(String[] args) throws Exception
        {
                /* Get the files to be compared first */
                File file1 = new File("temp.txt");
                File file2 = new File("amazon.txt");
                File file3 = new File("amazoncomp.txt");
                boolean compareResult = FileUtils.contentEquals(file1, file2);
                boolean compp=FileUtils.contentEquals(file1,file3);
                if(compareResult==true)
                {
                    System.out.println("amazon file");
                }
                if(compp==true)
                {
                   System.out.println("amazoncomp file");
                }
                  
               
        }
}

java program for moving ractangle on left, right, top, down side using KeyboarListner



import java.awt.event.KeyListener;
import java.awt.event.KeyEvent;
import java.awt.Rectangle;
import javax.swing.JPanel;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
 class Canvas extends JPanel
{
//attributes
private Rectangle sampleObject;
//constructor
public Canvas ( )
{
//initialize object
sampleObject = new Rectangle ( 5, 5, 10, 10 );
//set canavs background colour
setBackground ( Color.black );
//add the key listener in the constructor of your canavas/panel
addKeyListener ( new myKeyListener ( ) );
//ensure focus is on this canavas/panel for key operations.
setFocusable ( true );
}
//painting
public void paintComponent ( Graphics graphics )
{
super.paintComponent ( graphics );
Graphics2D graphics2d = ( Graphics2D ) graphics;
graphics.setColor ( Color.red );
graphics2d.fill ( sampleObject );
}
//function which essentially re-creates rectangle with varying x orientations. (x-movement)
public void mutateRectangleXOrientation ( int mutationDistance )
{
sampleObject.setBounds ( ( int ) sampleObject.getX ( ) + mutationDistance, ( int ) sampleObject.getY
( ), ( int ) sampleObject.getWidth ( ), ( int ) sampleObject.getHeight ( ) );
}
//function which essentially re-creates rectangle with varying y orientations. (y-movement)
public void mutateRectangleYOrientation ( int mutationDistance )
{
sampleObject.setBounds ( ( int ) sampleObject.getX ( ), ( int ) sampleObject.getY ( ) +
mutationDistance, ( int ) sampleObject.getWidth ( ), ( int ) sampleObject.getHeight ( ) );
}
//listener
private class myKeyListener implements KeyListener
{
//implement all the possible actions on keys
public void keyPressed ( KeyEvent keyEvent )
{
switch ( keyEvent.getKeyCode ( ) )
{
case KeyEvent.VK_RIGHT:
{
mutateRectangleXOrientation ( 10 );
}
break;
case KeyEvent.VK_LEFT:
{
mutateRectangleXOrientation ( -10 );
}
break;
case KeyEvent.VK_UP:
{
mutateRectangleYOrientation ( -10 );
}
break;
case KeyEvent.VK_DOWN:
{
mutateRectangleYOrientation ( 10 );
}
break;
case KeyEvent.VK_ESCAPE:
{
System.exit ( 0 );
}
break;
}
repaint ( ); //this is here to ensure that the screen updates per graphics operation
}
public void keyReleased ( KeyEvent keyEvent )
{
}
public void keyTyped ( KeyEvent keyEvent )
{
}
}}
public class Display
{
public static void main ( String [ ] arguments )
{
JFrame frame = new JFrame ( "key listener demo" );
Canvas panel = new Canvas ( );
frame.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
frame.add ( panel );
frame.setContentPane ( panel );
frame.setPreferredSize ( new Dimension ( 800, 600 ) );
frame.setLocationRelativeTo ( null );
frame.setVisible ( true );
frame.pack ( );
}
}

Saturday, 10 January 2015

face book page analysis commands in R Language


Face book page analysis steps

install.packages("Rook")

Installing package into ‘E:/Users/cherub/Documents/R/win-library/3.1’

(as ‘lib’ is unspecified)

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/Rook_1.1-1.zip'

Content type 'application/zip' length 278588 bytes (272 Kb)

package ‘Rook’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in

E:\Users\cherub\AppData\Local\Temp\Rtmp4I7BWi\downloaded_packages

> install.packages("Rfacebook")

Installing package into ‘E:/Users/cherub/Documents/R/win-library/3.1’

(as ‘lib’ is unspecified)

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/Rfacebook_0.4.zip'

Content type 'application/zip' length 56670 bytes (55 Kb)

package ‘Rfacebook’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in

E:\Users\cherub\AppData\Local\Temp\Rtmp4I7BWi\downloaded_packages

> require("Rfacebook")

Loading required package: Rfacebook

Loading required package: httr

Loading required package: rjson

package ‘Rfacebook’ was built under R version 3.1.2

> page_name <- "forbes"

"CAACEdEose0cBABPMO40HvHNn0NZBxlXkRZBal0V2bgPGjRnZACznRzxwrqtT0DYDwGh36dbBpVL0

f5nTsL6ZBA7lgfGJrfkb08waKtRrEHKVjgRcDgE8S5oPC7VpSAFeYtgXAlaX3IquKADT5sn89f8CgYyV6k3I

gIaZBB8HT9cnqXwNzLGkMdt3ZBu9PwIO6bWfV7ZB46FufYoPxMp1SW6"

> page <- getPage(page_name, token, n = number_posts, feed = FALSE)

> data_frame_gender <-

data.frame(post=character(),male=numeric(),female=numeric(),etc=numeric(),likes=numeric(),type=chara

cter(),stringsAsFactors=FALSE)

> for(i in 1:length(posts))

+     post <- getPost(temp,token)

+     data_frame_gender[i,1] <- post$post$message

+     data_frame_gender[i,5] <- post$post$likes

+     data_frame_gender[i,6] <- post$post$type

+     gender_frame <- data.frame(gender=character(),stringsAsFactors=FALSE)

+     for(j in 1:length(post$likes$from_id))

+         likes <- post$likes$from_id

+         user_id <- likes[j]

+         user <- getUsers(user_id,token=token)

+         gender <- user$gender

+         gender_frame[nrow(gender_frame)+1,] <- gender

+     number_males <- nrow(subset(gender_frame, gender=="male"))

+     number_females <- nrow(subset(gender_frame, gender=="female"))

+     number_etc <- data_frame_gender[i,5] - (number_males+number_females)

+     data_frame_gender[i,2] <- number_males

+     data_frame_gender[i,3] <- number_females

+     data_frame_gender[i,4] <- number_etc

> for(i in 1:length(posts))

+     #dataframe values:

+     post <- getPost(temp,token)

+     data_frame_gender[i,1] <- post$post$message

+     data_frame_gender[i,5] <- post$post$likes

+     data_frame_gender[i,6] <- post$post$type

+     gender_frame <- data.frame(gender=character(),stringsAsFactors=FALSE)

+     for(j in 1:length(post$likes$from_id))

+         likes <- post$likes$from_id

+         user_id <- likes[j]

+         user <- getUsers(user_id,token=token)

+         gender <- user$gender

+         gender_frame[nrow(gender_frame)+1,] <- gender

+     number_males <- nrow(subset(gender_frame, gender=="male"))

+     number_females <- nrow(subset(gender_frame, gender=="female"))

+     number_etc <- data_frame_gender[i,5] - (number_males+number_females)

+     data_frame_gender[i,2] <- number_males

+     data_frame_gender[i,3] <- number_females

+     data_frame_gender[i,4] <- number_etc

c(sum(data_frame_gender$male),sum(data_frame_gender$female),sum(data_frame_gender$etc))

> pct <- round(slices/sum(slices)*100)

> lbls <- names(data_frame_gender[2:4])

> lbls <- paste(lbls, pct) # add percents to labels

> lbls <- paste(lbls,"%",sep="") # ad % to labels

> pie(slices, labels = lbls, main="Gender Distribution of all analyzed posts")









face book page analysis

FCAEBOOK COMMANDS TO GET THE DATA OF FACE BOOK




With the advent of social networking, especially Facebook we are busy everyday posting our details and adding and rejecting people as friends and creating so called a social virtual human network which shares ideas, feeling, status, pictures and so on. This paper presents the practical implementation of how to know the detailed status of social networking Facebook account so as to know the total number of people on our network, our friends, their numbers gender-wise, their status, their IDs, picture shared, likes unlike, different reactions of people in our network on our posts, all can be studied as a summary with the help of Analysis Software R with an additional package of Facebook R on it.

getting data from facebook

fbdata

Friday, 9 January 2015

. Net C# project on on-line voting using face recognition

click on link to download the project

An on line voting system for Indian election is proposed for the first time in this paper. The proposed model has a greater security in the sense that voter high security password is confirmed before the vote is accepted in the main database of Election Commission of India. The additional feature of the model is that the voter can confirm if his/her vote has gone to correct candidate/party.
on line voting using face recognition

project on prison management system



download project  


This project is aimed at developing a prison management system that is a collection of registers and reports for the effective management of prison. Besides this police and government officials can see crime/criminals reports for their purpose.


prison management system