Showing posts with label -. Show all posts
Showing posts with label -. Show all posts

Tuesday, 8 April 2014

How to hide a folder without Any software-cmd Tricks-No one can't find the folder

How to hide a folder without Any software-cmd Tricks-No one can't find the folder

Step 1:-

           Open RUN --> Type 'cmd' in RUN -->Enter.

Step 2:-

           Go to the drive of the folder.(ex:  d: (d:\>) )

Step 3:-

           To Hide a folder attrib -s -h demo

(i) attrib-Attribute.

(ii) s-System.

(iii) h-Hide

(iv) 'demo'- Folder Name.

Tats it. .. ..


To view hidden folder.

Similary type in cmd prompt as 'attrib +s +h demo'

Monday, 31 March 2014

C Program graphics | Press me button game in c, download press-me-button game using C graphics

C Program graphics | Press me button game in c, download press-me-button game using C graphics

Source code:-)

#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <graphics.h>
#include <stdlib.h>

union REGS i, o;
int left = 265, top = 250;

void initialize_graphics_mode()
{
  int gd = DETECT, gm, error;

  initgraph(&gd,&gm,"C:\\TC\\BGI");

  error = graphresult();

  if (error != grOk)
  {
    perror("Error ");
    printf("Press any key to exit...\n");
    getch();
    exit(EXIT_FAILURE);
  }
}

void showmouseptr()
{
  i.x.ax = 1;
  int86(0x33,&i,&o);
}

void hidemouseptr()
{
  i.x.ax = 2;
  int86(0x33,&i,&o);
}

void getmousepos(int *x,int *y)
{
  i.x.ax = 3;
  int86(0x33,&i,&o);

  *x = o.x.cx;
  *y = o.x.dx;
}

void draw_bar()
{
  hidemouseptr();
  setfillstyle(SOLID_FILL,CYAN);
  bar(190,180,450,350);
  showmouseptr();
}

void draw_button(int x, int y)
{
  hidemouseptr();
  setfillstyle(SOLID_FILL,MAGENTA);
  bar(x,y,x+100,y+30);
  moveto(x+5,y);
  setcolor(YELLOW);
  outtext("Press me");
  showmouseptr();
}

void draw()
{
  settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  outtextxy(155,451,"<a href="http://errors000.blogspot.in"">errors000.blogspot.in"</a>);
  setcolor(BLUE);
  rectangle(0,0,639,450);
  setcolor(RED);
  outtextxy(160,25,"Try to press the \"Press me\" button");
  outtextxy(210,50,"Press escape key to exit");
  setfillstyle(XHATCH_FILL,GREEN);
  setcolor(BLUE);
  bar(1,1,75,449);
  bar(565,1,638,449);
  showmouseptr();
  draw_bar();
  draw_button(left,top);
}

void initialize()
{
  initialize_graphics_mode();

  if( !initmouse() )
  {
    closegraph();
    printf("Unable to initialize the mouse");
    printf("Press any key to exit...\n");
    getch();
    exit(EXIT_SUCCESS);
  }

  draw();
}

int initmouse()
{
  i.x.ax = 0;
  int86(0x33,&i,&o);
  return ( o.x.ax );
}

void get_input()
{
  int x, y;

  while(1)
  {
    getmousepos(&x,&y);

    /* mouse pointer in left of button */

    if( x >= (left-3) && y >= (top-3) && y <= (top+30+3) && x < left )
    {
      draw_bar();
      left = left + 4;

      if (left > 350)
        left = 190;

      draw_button(left,top);
    }

    /* mouse pointer in right of button */

    else if (x<=(left+100+3)&&y>=(top-3)&&y<=(top+30+3)&&x>(left+100))
    {
      draw_bar();
      left = left - 4;

      if (left < 190)
        left = 350;

      draw_button(left,top);
    }

    /* mouse pointer above button */

    else if(x>(left-3) && y>=(top-3) && y<(top) && x<= (left+100+3))
    {
      draw_bar();
      top = top + 4;

      if (top > 320)
        top = 180;

      draw_button(left,top);
    }

    /* mouse pointer below button */

    else if (x>(left-3)&&y>(top+30)&&y<=(top+30+3)&&x<=(left+100+3))
    {
      draw_bar();
      top = top - 4;

      if (top < 180)
        top = 320;

      draw_button(left,top);
    }

    if (kbhit())
    {
      if (getkey() == 1)
        exit(EXIT_SUCCESS);
    }
  }
}

int getkey()
{
  i.h.ah = 0;
  int86(22,&i,&o);

  return( o.h.ah );
}

main()
{
  initialize();

  get_input();
  return 0;
}

C Program | To Find ASCII Value of a Character-Source code

C Program | To Find ASCII Value of a Character

Source code:-)

 /* Source code to find ASCII value of a character entered by user */

#include <stdio.h>
int main(){
    char c;
    printf("Enter a character: ");
    scanf("%c",&c);        /* Takes a character from user */
    printf("ASCII value of %c = %d",c,c);
    return 0;
}

Output:-)

Enter a character: G
ASCII value of G = 71

C program to check odd or even number-Source code

C program to check odd or even number-Source code

Source Code:-)


#include<stdio.h>

main()
{
   int n;

   printf("Enter an integer\n");
   scanf("%d",&n);

   if ( n%2 == 0 )
      printf("Even\n");
   else
      printf("Odd\n");

   return 0;
}

C Program-Find Size of int, float, double and char of System-Syntax-Source Code-Output

 C Program-Find Size of int, float, double and char of System

Syntax of size of Operator:-

 temp = sizeof(operand);
/* Here, temp is a variable of type integer,i.e, sizeof() operator
   returns integer value. */

 

Source Code :-)

/* This program computes the size of variable using sizeof operator.*/ 

#include <stdio.h> 

int main()

int a; 

float b; 

double c; 

char d; 

printf("Size of int: %d bytes\n",sizeof(a)); 

printf("Size of float: %d bytes\n",sizeof(b)); 

printf("Size of double: %d bytes\n",sizeof(c)); 

printf("Size of char: %d byte\n",sizeof(d)); 

return 0; 

}

OUTPUT :-)

Size of int: 4 bytes
Size of float: 4 bytes
Size of double: 8 bytes
Size of char: 1 byte

C Programming Language-C Program to Print a Statement

 C Program to Print a Statement

Source Code:-

/* C Program to print a statement. */
#include <stdio.h>
int main()
{
   printf("Welcome to Errors"); /* printf() used to prints the content inside quotation */
   return 0;
}


Output :-)

Welcome to Errors

Sunday, 30 March 2014

JAVA PROGRAMS-Bank Transaction

Program Name:- Bank Transaction

import java.io.*;
class bankacc
{
int withdraw,deposite,amt;
int accbal;
static String accname;
static int accno;
public void withdraw()throws IOException
{
DataInputStream inp=new DataInputStream(System.in);
System.out.println("enter the amount for withdraw");
amt=Integer.parseInt(inp.readLine());
if(accbal<amt)
{
System.out.println("You can't withdraw amount");
}
else
{
accbal=accbal-amt;
}
}
public void deposite()throws IOException
{
DataInputStream inp=new DataInputStream(System.in);
System.out.println("enter the amount for deposite");
amt=Integer.parseInt(inp.readLine());
accbal=accbal+amt;
}
public void disp()
{
System.out.println("account name\t:"+accname);
System.out.println("\naccount number\t:"+accno);
System.out.println("\nbalance\t:"+accbal);
}
public static void main(String args[])throws IOException
{
DataInputStream inp=new DataInputStream(System.in);
bankacc bd=new bankacc();
System.out.println("enter the accno:");
accno=Integer.parseInt(inp.readLine());
System.out.println("enter the accname");
accname=inp.readLine();
int c=0,ch;
while(c==0)
{
System.out.println("1.deposite\n");
System.out.println("2.withdraw\n");
System.out.println("3.display");
System.out.println("\n 4.enter your choice\n");
ch=Integer.parseInt(inp.readLine());
if(ch==1)
bd.deposite();
else if(ch==2)
bd.withdraw();
else
bd.disp();
System.out.println("do you want continue enter the 0");
c=Integer.parseInt(inp.readLine());
}
}
}


OUTPUT;-


Compile:-

c:\javaprograms>javac banckacc.java


RUN:-


c:\javaprograms>java bankacc


Enter the account number:

1

Enter the account name:

Ajith

1.Deposit

2.Withdraw

3.Display

Enter your choice:

1

Enter the amount to deposite:

500

Do you want to continue:

0

1.Deposit

2.Withdraw

3.Display

Enter your choice:

3

Account Name:Ajith

Account Number:1

Balance:500

Do you want to continue:

0


1.Deposit

2.Withdraw

3.Display

Enter your choice:

2

Enter the amount of withdraw:

260

Do you want to continue:

0


1.Deposit

2.Withdraw

3.Display

Enter your choice:

3


Account Name:Ajith

Account number:1

Balance:240


Do you want to continue:

1

Java Programs - Alphabetical order of the given Name

 Alphabetical order of the given Name


Program Name:-    alpha.java


import java.io.*;
import java.lang.*;
class alpha
{
public static void main(String args[])throws IOException
 {
 String a[]=new String[10];
 String b;
 int n;
 DataInputStream in=new DataInputStream(System.in);
 System.out.print("\nEnter the Number of name  :");
 n=Integer.parseInt(in.readLine());
 for(int i=0;i<n;i++)
  {
  a[i]=in.readLine();
  }
  for(int i=0;i<n;i++)
  {
  for(int j=i+1;j<n;j++)
   {
    if(a[i].compareTo(a[j])<0)
    {
    b=a[i];
    a[i]=a[j];
    a[j]=b;
    }
   }
  }
 System.out.println("\n Alphabetical order of name is:");
 for(int i=0;i<n;i++)
 {
 System.out.println(a[i]);
 }
 }
}

JAVA PROGRAMS-Dispatch Program In Java

Dispatch Program In Java

Program Name:- dispatch.java

import java.io.*;
class a
{
void callme()
 {
 System.out.println("\nInside A's callme method");
 }
}
class b extends a
{
 void callme()
 {
 System.out.println("\nInside B's callme method");
 }
}
class c extends b
{
 void callme()
 {
 System.out.println("\nInside C's callme method");
 }
}
class dispatch
{
public static void main(String args[])
 {
 a obj=new a();
 b obj1=new b();
 c obj2=new c();
 a r;
 r=obj;
 obj.callme();
 r=obj1;
 obj1.callme();
 r=obj2;
 obj2.callme();
 }
}

JAVA PROGRAMS-Matrix Program in Java

Matrix Program in Java

  Program Name:- matrix.java 

import java.io.*;

class matrix

{

public static void main(String args[])throws IOException

{

 DataInputStream in=new DataInputStream(System.in);

 int i,j,m,n,k;

 int a[][]=new int[10][10];

 int b[][]=new int[10][10];

 int c[][]=new int[10][10];

 int d[][]=new int[10][10];

 System.out.print("\n Enter the row and column\n\n");

 m=Integer.parseInt(in.readLine());

 n=Integer.parseInt(in.readLine());

 System.out.print("\n Enter the element of matrix A\n\n");

 for(i=0;i<m;i++)

 {

 for(j=0;j<n;j++)

 {

 a[i][j]=Integer.parseInt(in.readLine());

 }

 }

 System.out.print("\n Enter the element of matrix B\n\n");

 for(i=0;i<m;i++)

 {

 for(j=0;j<n;j++)

 {

 b[i][j]=Integer.parseInt(in.readLine());

 }

 }

 for(i=0;i<m;i++)

 {

 for(j=0;j<n;j++)

 {

 for(k=0;k<m;k++)

 {

 c[i][j]=c[i][j]+a[i][k]*b[k][j];

 }

 }

 }

 System.out.print("\n A matrix\n");

 for(i=0;i<m;i++)

 {

 for(j=0;j<n;j++)

 {

 System.out.print(a[i][j]+"\t");

 }

 System.out.println();

 }

 System.out.print("\n B matrix\n");

 for(i=0;i<m;i++)

 {

 for(j=0;j<n;j++)

 {

 System.out.print(b[i][j]+"\t");

 }

 System.out.println();

 }

 System.out.print("\n Multipul matrix\n");

 for(i=0;i<m;i++)

 {

 for(j=0;j<n;j++)

 {

 System.out.print(c[i][j]+"\t");

 }

 System.out.println();

 }

 }

}


JAVA PROGRAMS-Method In Java Program

Method In Java Program

Program Name:- method.java


import java.io.*;

class circle

{

double radius;

final double pi=3.14;

circle(double r)

 {

 radius=r;

 }

double area()

 {

 return pi*radius*radius;

 }

double circum()

 {

 return 2*pi*radius;

 }

}

class cylinder extends circle

{

double hight;

cylinder(double r,double h)

 {

 super(r);

 hight=h;

 }

double area()

 {

 return circum()*hight;

 }

double volume()

 {

 return pi*radius*hight;

 }

}

class method

{

public static void main(String args[])

 {

 double area,area1,sectionarea,surfacearea,volume;

 circle cir=new circle(5.5);

 cylinder cy=new cylinder(3.2,12.5);

 area=cir.area();

 area1=cir.circum();

 System.out.println("\nArea of the circle of radius "+cir.radius+"\t:"+area);

 System.out.println("\nCircum ference of a circle\t:"+area1);

 System.out.println("\nCalculation for cylinder of radius "+cy.radius+" and height  "+cy.hight);

 surfacearea=cy.area();

 volume=cy.volume();

 System.out.println("\nSurface area\t"+surfacearea);

 System.out.println("\nVolume    \t"+volume);

 }

}

JAVA PROGRAMS-Student Details Program in Java

Student Details Program in Java

Program Name:- student1.java

import java.io.*;

class studentdetail

{

int sno;

String sname,major,yos;

 void getdata()throws IOException

 {

 DataInputStream in=new DataInputStream(System.in);

 System.out.print("\n Enter the student number\t:");

 sno=Integer.parseInt(in.readLine());

 System.out.print("\n Enter the student name\t:");

 sname=in.readLine();

 System.out.print("\n Enter the student Major\t:");

 major=in.readLine();

 System.out.print("\n Enter the year of student\t:");

 yos=in.readLine();

 }

}

class markdetails extends studentdetail

{

int m1,m2,m3,m4,tot;

String res;

void read()throws IOException

 {

 DataInputStream in=new DataInputStream(System.in);

 getdata();

 System.out.print("\n Enter the mark1\t:");

 m1=Integer.parseInt(in.readLine());

 System.out.print("\n Enter the mark2\t:");

 m2=Integer.parseInt(in.readLine());

 System.out.print("\n Enter the mark3\t:");

 m3=Integer.parseInt(in.readLine());

 System.out.print("\n Enter the mark4\t:");

 m4=Integer.parseInt(in.readLine());

 }

void total()

 {

 tot=m1+m2+m3+m4;

 }

 void result()

 {

 if((m1>=50)&&(m2>=50)&&(m3>=50)&&(m4>=50))

 res="Pass";

 else

 res="Fail";

 }

 void display()

 {

 System.out.println("\n\n \t Student details \n\n");

 System.out.println("\n Student number\t:"+sno);

 System.out.println("\n Student name\t:"+sname);

 System.out.println("\n Student major\t:"+major);

 System.out.println("\n Year of Study\t:"+yos);

 System.out.print("\n mark1: \t"+m1+"\n\n mark2: \t"+m2+"\n\n mark3: \t"+m3+"\n\n mark4: \t"+m4);

 System.out.print("\n\n Total: \t"+tot+"\n\n Result: "+res);

 }

}

class student1

{

public static void main(String[]args)throws IOException

{

markdetails in=new markdetails();

in.read();

in.total();

in.result();

in.display();

}

}

JAVA PROGRAMS-Java Program using Super key

Java Program using Super key


Program Name:-  superkey.java


class rectangle

{

int length,breadth;

 rectangle(int l,int m)

 {

 length=l;

 breadth=m;

 }

 int area()

 {

 int a;

 a=length*breadth;

 return(a);

 }

}

class box extends rectangle

{

int height;

 box(int l,int b,int h)

 {

 super(l,b);

 height=h;

 }

 int volume()

 {

 int v;

 v=length*breadth*height;

 return(v);

 }

}

class superkey

{

 public static void main(String args[])

 {

 box in=new box(10,10,10);

 int a,v;

 a=in.area();

 v=in.volume();

 System.out.print("\nArea\t:"+a);

 System.out.print(" \nVolume\t:"+v);

 }

}


JAVA PROGRAMS-Stack Program In Java

Stack Program In Java

Program Name:- stackdemo.java

import java.io.*;
class stack
{
int s[]=new int[100];
int top;
void stack()
 {
 top=0;
 System.out.println("\n The stack is empty");
 }
public void push()throws IOException
 {
 DataInputStream inp=new DataInputStream(System.in);
 int x;
 if(top==100)
  {
  System.out.println("The Stack is full");
  }
 else
  {
  System.out.print("\n Enter the value  :");
  x=Integer.parseInt(inp.readLine());
  s[top]=x;
  top++;
  System.out.println("\n The value is pushed");
  }
 }
public void pop()throws IOException
 {
 DataInputStream inp=new DataInputStream(System.in);
 int y;
 if(top==0)
  {
  System.out.println("\n The stack is empty");
  }
 else
  {
  top--;
  y=s[top];
  s[top]='\0';
  System.out.println("\n The value is poped");
  }
 }
void display()
 {
 int i;
 if(top==0)
 {
  System.out.println("\nThe stack is empty");
  }
 else
  {
   System.out.println("\nValues are top-->");
  }
 for(i=top-1;i>=0;i--)
  System.out.println(s[i]);
 }
}
public class stackdemo
{
public static void main(String args[])throws IOException
 {
 stack in=new stack();
 int item=0;
 int opt=1;
 String s=new String();
 while(opt<4)
 {
 System.out.println("\n\n\t\t Main menu\n\n1.push\n\n2.Pop\n\n3.Display\n\n4.Exit\n\nSelection the option");
 DataInputStream din=new DataInputStream(System.in);
 s=din.readLine();
 opt=Integer.parseInt(s);
 switch(opt)
  {
   case 1:
   System.out.println("\nEnter the elementis add");
   in.push();
   break;
   case 2:
   System.out.println("\nEnter the delete item");
   in.pop();
   break;
   case 3:
   System.out.println("\nThe stack element is:");
   in.display();
   break;
   default:
   opt=4;
   }
  }
 }
}

Monday, 3 March 2014

PHP TUTORIALS-Create Login Page with DataBase-PhpMyAdmin-Mysql

PHP TUTORIALS Create Login Page with DataBase-PhpMyAdmin-Mysql

FULL DETAILS..

PHP TUTORIALS-Create Login Page with Database using PhpMyAdmin-Mysql


PHP TUTORIALS Create Login Page with DataBase PhpMyAdmin Mysql PART2 



Program Name :- htmllogin.html

<html>

<head>

<body bgcolor="">

<font>

<center><h1>Login</h1></center>

</font>

<form action="login.php" method="POST">

Username:<input type="text" name="uname">

Password:<input type="password" name="pass"><br>

<input type="submit" value="login" name="submit">

</form>

</body>

</head>

</html>


Program Name:-  login.php

<?php

require ('sql_connect.php');

if (isset($_POST['submit'])){

$username=mysql_escape_string($_POST['uname']);

$password=mysql_escape_string($_POST['pass']);

if (!$_POST['uname'] | !$_POST['pass'])

 {

echo ("<SCRIPT LANGUAGE='JavaScript'>

        window.alert('You did not complete all of the required fields')

        window.location.href='htmlogin.html'

        </SCRIPT>");

exit();

     }

$sql= mysql_query("SELECT * FROM `login_users` WHERE `username` = '$username' AND `password` = '$password'");

if(mysql_num_rows($sql) > 0)

{

echo ("<SCRIPT LANGUAGE='JavaScript'>

        window.alert('Login Succesfully!.')

        window.location.href='htmllogin.html'

        </SCRIPT>");

exit();

}

else{

echo ("<SCRIPT LANGUAGE='JavaScript'>

        window.alert('Wrong username password combination.Please re-enter.')

        window.location.href='htmllogin.html'

        </SCRIPT>");

exit();

}

}

else{

}

?>


Program Name:-   sql_connect.php

<?php

mysql_connect("localhost", "root", "") or die("mysql connection is failure.");

mysql_select_db("login") or die("Database does not exists.");

?>