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

Wednesday, 13 May 2015

java applet example of ActionListener java applet example of ActionListener

import java.awt.*;
import java.applet.*;
// import an extra class for the ActionListener
import java.awt.event.*;

public class ActionExample extends Applet implements ActionListener
{
     Button okButton;
     Button wrongButton;
     TextField nameField;
     CheckboxGroup radioGroup;
     Checkbox radio1;
     Checkbox radio2;
     Checkbox radio3;
     public void init() 
     { 
          setLayout(new FlowLayout());
          okButton = new Button("Action!");
          wrongButton = new Button("Don't click!");
          nameField = new TextField("Type here Something",35);
          radioGroup = new CheckboxGroup();
          radio1 = new Checkbox("Red", radioGroup,false);
          radio2 = new Checkbox("Blue", radioGroup,true);
          radio3 = new Checkbox("Green", radioGroup,false);
          add(okButton);
          add(wrongButton);
          add(nameField);
          add(radio1);
          add(radio2);
          add(radio3); 
          okButton.addActionListener(this);
          wrongButton.addActionListener(this);
         } 
         public void paint(Graphics g)
         {
 
          if (radio1.getState()) g.setColor(Color.red);
 
        else if (radio2.getState()) g.setColor(Color.blue);
          else g.setColor(Color.green);
 
 
          g.drawString(nameField.getText(),20,100);
     }
   public void actionPerformed(ActionEvent evt) 
         { 
              if (evt.getSource() == okButton)  
                   repaint(); 
          else if (evt.getSource() == wrongButton) 
          {
               wrongButton.setLabel("Not here!"); 
               nameField.setText("That was the wrong button!"); 
               repaint();
          }
     } 
}
/*<applet code="ActionExample.java" height=200 width=300></applet>*/

presentation slides (Comparison of Efficient parallel Index Algorithms ) and presentation Moodle Based Skill Development Survey




presentation Moodle Based Skill Development Survey Module Implementation

Moodle is one of the leading web based learning management system with various plugins available for different functionality.This paper proposes the methods to add customized survey modules in Moodle. With this method we tested the  functionality of some soft skills based surveys and their outputs, integrated in Moodle



https://drive.google.com/file/d/0B7SRUSGOtQ9hZFdnY1Aza0JGNG8/view?usp=sharing

Comparison of Efficient parallel Index Algorithms used for RDF data store using Graphical processing unit with CUDA

The exponential growth of semantic web and the resultant generation of large-scale RDF (Resource Description Framework) triples pose new challenges in the domain of RDF-storage and retrieval.Graphical processing units (GPUs) are being actively probed in the area of Big Data study, machine learning, and augmented certainty ever since ,such applications are categorized by massive data spanned and produced over distributed network. GPUs be responsible for a parallel programming agenda using CUDA (Compute Unified Device Architecture) that can be developed to proficiently collected and make inferences on these massive data-sets. 



https://drive.google.com/file/d/0B7SRUSGOtQ9hcGRFaC0weGNOdDg/view?usp=sharing

Seminar Report On Cloud Computing



Contents


















Abstract
During the past years a vast number of online file storage services have been introduced .while several of these services provide basic functionality such as an uploading and retrieving files by a specific user, more advanced services offer features such as shared folders, real-time collaboration ,minimization of data transfers or unlimited storage space. Within this report I am giving an overview of existing file storage solutions, and also try to analyze the Drop-box client software as well as its transmission protocols, show the weaknesses and possible attack vectors. And conclude by discussing the security improvements.
Key words: cloud computing, drop-box, attacks




Tuesday, 12 May 2015

JAVA Program to represent Bank System using inheritance function ,constructor and user input


import java.io.*;
/*Base class Account*/
class Account
{
 double accBal;
 Account()
 {
 }
 Account(double d)
 {
  accBal=d;
  if(accBal<1000)
  {
   System.out.println("Invlaid amount. Amount should be > or = 1000");
   accBal=1000;
  }
 }
 
 void credit(double amt)
 {
  accBal=accBal+amt;
 }
 
 void debit(double amt)
 {
  if(amt>accBal)
   System.out.println("Debit amount exceeded account balance");
  else
   accBal=accBal-amt;
 }
 
 double getBalance()
 {
  return(accBal);
 }
}
//Derived class SavingsAccount
class SavingsAccount extends Account
{
 double rate;
 SavingsAccount(double r,double amt)
 {
  super(amt); 
  rate=r;
 }

 public void calculateInterest()
 {
  accBal=accBal*rate;
 }
}
class CheckingAccount extends Account
{
 double fee;
 CheckingAccount(double f,double amt)
 {
  super(amt);
  fee=f;
 }
 void credit(double amt)
 {
  accBal=accBal+amt-fee;
 }
 void debit(double amt)
 {
  if(amt>accBal)
   System.out.println("Debit amount exceeded account balance");
  else
   accBal=accBal-amt-fee;
 }

 
}
class Bank
{
 public static void main(String args[])
 {
  int a,b;
  DataInputStream d= new DataInputStream(System.in);
  double amount,rate =5,fee=100;
 
  try
  {
  System.out.println("Press 1. SavingAccounts 2. Checking Accounts");
  a=Integer.parseInt(d.readLine());
  switch(a)
  {
  case 1:
  System.out.println("Enter amount to open account");
  amount=Double.valueOf(d.readLine());
  SavingsAccount sa=new SavingsAccount(rate,amount); 
  
  System.out.println("Thank you for opening account your Initial Balanceis :"+sa.getBalance());
  do
  {
  System.out.println("Enter choice:\n1.Withdraw\n2.Deposit\n3.CheckBalance\n 4.Exit");
  a=Integer.parseInt(d.readLine()); 
  switch(a)
  {
   case 1:
      System.out.println("Enter amount to withdraw");
      amount=Double.valueOf(d.readLine());
      sa.debit(amount);
      sa.calculateInterest();
      System.out.println("Balance is :"+sa.getBalance());
      break;
   case 2:
      System.out.println("Enter amount to deposit");
      amount=Double.valueOf(d.readLine());
      sa.credit(amount);
      sa.calculateInterest();
      System.out.println("Balance is :"+sa.getBalance());
      break;
   case 3:
      System.out.println("Your balance is"+sa.getBalance());
      break;
  }
  }
  while(a!=4);
  break;
  case 2:
  System.out.println("Enter amount to open account");
  amount=Double.valueOf(d.readLine());
  CheckingAccount ca=new CheckingAccount(fee,amount); 
  
  System.out.println("Thank you for opening account your Initial Balanceis :"+ca.getBalance());
  do
  {
  System.out.println("Enter choice:\n1.Withdraw\n2.Deposit\n3.CheckBalance\n 4.Exit");
  a=Integer.parseInt(d.readLine()); 
  switch(a)
  {
   case 1:
      System.out.println("Enter amount to withdraw");
      amount=Double.valueOf(d.readLine());
      ca.debit(amount);
      System.out.println("Balance is :"+ca.getBalance());
      break;
   case 2:
      System.out.println("Enter amount to deposit");
      amount=Double.valueOf(d.readLine());
      ca.credit(amount);
      System.out.println("Balance is :"+ca.getBalance());
      break;
   case 3:
      System.out.println("Your balance is"+ca.getBalance());
      break;
  }
  }
  while(a!=4);
  break;
  }
  }
  catch(Exception e)
  {}
 }
}

 

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 ( );
}
}