Pages

Monday, January 5, 2015

Arithmetic operation for given input string values as equation

package com;

import java.util.Scanner;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class Equation {

static Scanner s = new Scanner(System.in);

public static void main(String[] args) throws NullPointerException,
ScriptException {

String eq = null;

Scanner s = new Scanner(System.in);
System.out.println("enter the equation");
eq = s.nextLine();
char[] aa = eq.toCharArray();
String bb = new String();

for (int i = 0; i < aa.length; i++) {
if (aa[i] != '+' & aa[i] != '-' & aa[i] != '*' & aa[i] != '/'
& Character.isDigit(aa[i]) == false) {
bb = bb.concat(String.valueOf(insert(aa[i])));

}

else {
bb = bb.concat(String.valueOf(aa[i]));

}
}
System.out.println(bb);

ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine engine = mgr.getEngineByName("JavaScript");
System.out.println("Result : "+engine.eval(bb));

}

private static int insert(char val) {

int a;
System.out.println("Enter the value of " + val + ": ");
a = s.nextInt();
return a;

}
}



OUTPUT:-

enter the equation
a*x+y*3+z*2
Enter the value of a: 
4
Enter the value of x: 
3
Enter the value of y: 
2
Enter the value of z: 
2
4*3+2*3+2*2
Result : 22.0

Monday, December 22, 2014

java program to display rhombus using the star key (*)

public class Star {

public static void main(String[] args) {               

                int i,j,space,rows=5,k=0;
   
   for(i=1;i<=rows;++i)
   {
       for(space=1;space<=rows-i;++space)
       {
          System.out.print("  ");
       }
       while(k!=2*i-1)
       {
          System.out.print("* ");
          ++k;
       }
       k=0;
       System.out.print("\n");
       
   }
   
   for(i=rows-1;i>=1;--i)
   {
       for(space=0;space
          System.out.print("  ");
       for(j=i;j<=2*i-1;++j)
         System.out.print("* ");
       for(j=0;j
           System.out.print("* ");
       System.out.print("\n");
   }
   
}
}  



output:



        * 

      * * * 
    * * * * * 
  * * * * * * * 
* * * * * * * * * 
  * * * * * * * 
    * * * * * 
      * * * 
        * 

Friday, December 19, 2014

Java program to find the duplicate element in the given string sentences and its count.

import java.util.HashSet;
public class DuplicateElement 
{
 public static void main(String a[])
{
    String Str="welcome to program";
        DuplicateElement dcs = new DuplicateElement();
        for (String retval: Str.split("\\s", 0))
        {
        dcs.duplicate(retval);
         }
  }
 public static void duplicate(String str)
    {
    char[] chrs = str.toCharArray();
    HashSet s=new HashSet();
    for(int i=0;i
    {
    if(!s.add(chrs[i]))
    {
   System.out.println("The duplicate element contain in the word : "+str);
    System.out.println("and its count is : "+str.length());
    }
    }
   
    }
}

Monday, November 24, 2014

SQL Injection

It is type of attack perform in the online web application in order to get the admin access without entering the credential for authentication.
It can happen because of improper validation in client and server side.
For Client side, java-script will help to validate the input data from the end user. After travel through the network, it can be validate in the server side using PL SQL.
T
Type the character as mentioned below in the field of log in username and password.

'
admin'
admin' or '1'=='1
admin' or 1==1--

The result for injecting the sql will execute the query to produce the error for back end or successful authentication occurs.

Thursday, August 28, 2014

Java Program for Floyd's triangle


Program:-

class Floyd {
public static void main(String args[]) {
int num = 1, c, d;
System.out.println("Floyd's triangle :-");
for (c = 1; c <= 4; c++) {
for (d = 1; d <= c; d++) {
System.out.print(num + " ");
num++;
}
System.out.println();
}
}
}


Output:


Floyd's triangle :-
1
2 3
4 5 6
7 8 9 10

Wednesday, August 6, 2014

Fabricators In Delhi | Supplier of Steel Doors Windows | Fabricatorsindelhi.com


We are one of Top Fabricators in Delhi
and NCR . Leveraging to the vast experience, NEW KALKAJI STEEL has marked its distinctive place in the domain of manufacturer and supplier of

, Gates, Grills, Railling, Rolling Shutter, Boundry Wall Raillings,Fiber Shade,Heavy North Star Shade,Steel Drain Cover etc .
Being registered with ROF, GST, CST, ST, PF, ESI, etc, the company is thoroughly committed towards delivering the consistent quality products to the clients. Located in New Delhi(Delhi), the company is known as the foremost Manufacturer and Supplier in India.
We also deal in Factory shade, Heavy structure and all type iron and ss work in-house, factory, farm houses etc.

We provide services in all over Delhi and NCR.
Our products serve the diverse purposes and thus are used in Pharmaceuticals, Chemical Drugs, Dies,
Air Conditioning, Power Plants, Chemical Plants, Petrochemical Plants, Petroleum Refineries, etc.
We firmly believe in developing a strong bond with the clients by providing them the unmatched products. Our chief motto is to gratify the esteemed clients to their full extent. The success of our company largely depends upon the trust of the clients in our venture.
Specialization :-
(a)Fiber Shade
(b)Stainless Steel Gate
(c) Backside covering
More Details contact us at +91-9312408169 / 8586911805 email:- newkalkajisteel@gmail.com

Sunday, May 18, 2014

Heap Graph Based Software Theft Detection



Objective:
The objective of the project is our birthmark system brings to the industry a practical solution to protect their intellectual property right. Although software birthmark is a relatively new and less focused research area for the time being.

Features:

  •  A dynamic birthmark is one that is extracted when the program is executing.
  •  It also gives the definition of graph isomorphism as follows.
  • JavaScript Heap Profiler
  • Graph Generator and Filter

Scope of Project:
The scope of the project is to proposed a robust heap graph based software birthmark system for JavaScript programs and against reference injection attacks and streamlined every process of the system to make it scalable

Limitations:

  • There are 3 kinds of potential attacks to our birthmark system
  • The attacker can inject objects or references that are of no use into the program. There will be addition nodes and edges on the resulting heap graph
  • The attacker can purposely remove classes or references from the program. The resulting heap graph will have some nodes and edges missing
  • Class refactoring refers to the process of restructuring classes. It is commonly used to improve the design of object oriented programs.


Abstract:
As JavaScript is becoming more and more popular, JavaScript programs are valuable assets to many companies. However, the source code of JavaScript programs can be easily obtained and plagiarism of JavaScript programs is a serious threat to the industry. There are techniques like code obfuscation and watermarking which can make the source code of a program difficult to understand by humans and prove the ownership of the program. However, code obfuscation cannot avoid the source code being copied and a watermark can be defaced. In this paper, we use a relatively new technique, software birthmark, to help detect code theft of JavaScript programs. A birthmark is a unique characteristic a program possesses that can be used to identify the program. We extend two recent birthmark systems that extract the birthmark of software from the run-time heap. We propose a redesigned system with improved robustness and performed extensive experiments to justify the effectiveness and robustness of it. Our evaluation based on 200 large-scale websites showed that our birthmark system exhibits 100% accuracy. We remark that it is solid and ready for practical use.