Friday 18 October 2013

Use best proxy server its really work








Best Proxy server Bi pass

Go to your browser

In address bar write below proxy server site name

www.underget.com

enjoy surfing free...!!!!

How to get data from Database

 

Simaple select query

 

select * from student;
 

Select query with right Join

 

select distinct * from student right join sc on marks<=70;


Insert Query in SQL

how to store data in Database

 insert into student values(&roll_no,'&name','&class','&birthdate');

INSERT INTO COURSE VALUES(&course_no,'&course_name',&max_marks,&pass_marks)

Create Table with primary key

In Sql query prompt write down below code example
 
create table student
   (roll_no int  not null,
   name varchar(10),
  class varchar(10),
   birthdate date,
   primary key(roll_no)
   ) ;


Create Table with primary key and check and null Constrain

create table course
  (course_no int not null primary key,
  course_name varchar(20),
  max_marks int,
  pass_marks int,
  check (max_marks>0 and max_marks<100));

Create Table with Foreign Key

create table sc
     (roll_no int,
      course_no int,
     marks int,
     foreign key(roll_no) references student(roll_no),
    foreign key(course_no) references course(course_no))  ;

Best and sort code for Linked List In C++

/*
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    ::::  THIS PROGRAMM INDICATES THE CONCEPT OF LINKED LIST   ::::
    ::::  CREATED BY : DX PANCHAL(M.C.A.)  DATED:5/03/2013     ::::
    ::::  PROGRAMMING LANGUAGE : c++                           ::::
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

*/
#include<iostream.h>
#include<conio.h>
#include<malloc.h>
#include<dos.h>

struct list
{
  int info;
  struct list *next;

};

typedef struct list *newnode;
newnode first,newn,temp,save,avail,pred;
void main()
{
 int ch,i,choice;
 textcolor(WHITE);
 clrscr();
 first=NULL;
 avail=(newnode)malloc(sizeof(struct list));
 avail->next=NULL;
 cout<<"\n\t\tENTER VALUES YOU WANT TO CREATE NODE\n";
 cin>>ch;
 temp=avail;
 for(i=1;i<ch;i++)
 {
  temp->next=(newnode)malloc(sizeof(struct list));
  temp=temp->next;
  temp->next=NULL;

 }
 cout<<"\n\t\tYOU HAVE "<<ch<<"  NODE SUCCESSFULLY CREATED....!!!";
 getch();

 do
 {

  clrscr();
  cout<<"\n\t\t ";
  cout<<"\n\t\t|       LINKED LIST MENU         |";
  cout<<"\n\t\t|________________________________|\n";
  cout<<"\n\t\t[1] FOR INSERT NODE AT FIRST      ";
  cout<<"\n\t\t[2] FOR INSERT NODE AT LAST       ";
  cout<<"\n\t\t[3] FOR INSERT NODE AS ORDER      ";
  cout<<"\n\t\t[4] FOR DELETE NODE AT FIRST      ";
  cout<<"\n\t\t[5] FOR DELETE NODE AT LAST       ";
  cout<<"\n\t\t[6] FOR DELETE NODE AT ORDER      ";
  cout<<"\n\t\t[7] FOR DISPLAY NODE LIST         ";
  cout<<"\n\t\t[0] FOR EXIT                      ";
  cout<<"\n\t\t ";
  cin>>choice;
  switch(choice)
  {
   case 1:
       if(avail==NULL)
       {
         cout<<"\n\t\t";
         textcolor(RED+BLINK);
         cprintf("NO NODE AVAILABLE FOR INSERT OPERATION..!!!");
         textcolor(WHITE);

       }
       else
       {
         newn=avail;
         avail=avail->next;
         cout<<"\n\t\tENTER VALUE FOR NODE ";
         cin>>newn->info;
         if(first==NULL)
         {
          newn->next=NULL;
          first=newn;
         }
         else
         {
         newn->next=first;
         first=newn;

         }
          cout<<"\n\t\tOPERATION SUCCESSFULL..!!!";

       }
       getch();
       break;
   case 2:
      if(avail==NULL)
       {
         cout<<"\n\t\t";
         textcolor(RED+BLINK);
         cprintf("NO NODE AVAILABLE FOR INSERT OPERATION..!!!");
         textcolor(WHITE);

       }
       else
       {
         newn=avail;
         avail=avail->next;
         cout<<"\n\t\tENTER VALUE FOR NODE ";
         cin>>newn->info;
         if(first==NULL)
         {
          newn->next=NULL;
          first=newn;
         }
         else
         {
         save=first;
         while(save->next!=NULL)
         {
          save=save->next;
         }
         save->next=newn;
         newn->next=NULL;


         }
          cout<<"\n\t\tOPERATION SUCCESSFULL..!!!";

       }
       getch();
       break;
   case 3:
       if(avail==NULL)
       {
         cout<<"\n\t\t";
         textcolor(RED+BLINK);
         cprintf("NO NODE AVAILABLE FOR INSERT OPERATION..!!!");
         textcolor(WHITE);

       }
       else
       {
         newn=avail;
         avail=avail->next;
         cout<<"\n\t\tENTER VALUE FOR NODE ";
         cin>>newn->info;
         if(first==NULL)
         {
          newn->next=NULL;
          first=newn;
         }
         else
         {
        if(newn->info<=first->info)
        {
          newn->next=first;
          first=newn;

        }
        else
        {
          save=first;
          while(newn->info>=(save->next)->info&&save->next!=NULL)
          {
          save=save->next;
          }

          newn->next=save->next;
          save->next=newn;
        }
         }
         cout<<"\n\t\tOPERATION SUCCESSFULL..!!!";

       }


       getch();
       break;


   case 4:
       if(first==NULL)
       {
         cout<<"\n\t\t";
         textcolor(RED+BLINK);
         cprintf("NO NODE AVAILABLE FOR DELETE OPERATION..!!!");
         textcolor(WHITE);
       }
       else
       {
        temp=first;
        first=temp->next;
        cout<<"\n\t\tFIRST NODE IS DELETED SUCCESSFULLY...!!!";
        temp->next=avail;
        temp=avail;

       }
       getch();
       break;
   case 5:

       if(first==NULL)
       {
         cout<<"\n\t\t";
         textcolor(RED+BLINK);
         cprintf("NO NODE AVAILABLE FOR DELETE OPERATION..!!!");
         textcolor(WHITE);
       }
       else
       {
        temp=first;
        while((temp->next)->next!=NULL)
        {
         temp=temp->next;
        }


        (temp->next)->next=avail;
        avail=temp->next;
        temp->next=NULL;
        cout<<"\n\t\tLAST NODE IS DELETED SUCCESSFULLY...!!!";

       }
       getch();
       break;

   case 6:
       if(first==NULL)
       {
         cout<<"\n\t\t";
         textcolor(RED+BLINK);
         cprintf("NO NODE AVAILABLE FOR DELETE OPERATION..!!!");
         textcolor(WHITE);
       }
       else
       {
        temp=first;
        int selected;
        cout<<"\n\t\tENTER NODE DATA WHICH YOU WANT TO DELETE..!!!";
        cin>>selected;
        while(temp->info!=selected)
        {
         pred=temp;
         temp=temp->next;
        }
        pred->next=temp->next;
        if(temp->info!=selected)
        {
          cout<<"\n\t\tSORRY,NODE NOT FOUND...!!!";


        }
        else
        {
        avail=temp->next;
        avail=temp;

         cout<<"\n\t\tSELECTED NODE IS DELETED SUCCESSFULLY...!!!";
        }
       }
       getch();
       break;
   
   case 7:
       cout<<"\n\t\t ";
       cout<<"\n\t\t TOTAL NODE IN  LIST";
       if(first==NULL)
       {
         cout<<"\n\t\t";
         textcolor(RED+BLINK);
         cprintf("NO NODE AVAILABLE FOR DISPLAY OPERATION..!!!");
         textcolor(WHITE);

       }
       else
       {
        temp=first;
        cout<<"\n\t\t------------------------------";
        cout<<"\n\t\t| DATA | NODE ADD.| NXT. ADD.|";
        cout<<"\n\t\t------------------------------";
        while(temp!=NULL)
        {
         cout<<"\n\n\t\t";
         cout<<"|"<<temp->info<<"    | "<<unsigned(temp)<<"     | "<<unsigned(temp->next)<<"|";

         temp=temp->next;

        }

       }
        cout<<"\n\t\t ";

       break;
   case 0:
      cout<<"\n\t\tDO YOU WANT EXIT...!!! ";
      cout<<"\n\t\tPRESS ANY KEY TO EXIT";
      getch();
      break;


   default:
       cout<<"\n\t\t";
       textcolor(RED+BLINK);
       cprintf("INVALID CHOICE.....!!!");
       textcolor(WHITE);

  }



 getch();


 }while(choice!=0);



}

Friday 11 October 2013


import java.io.FileInputStream;
import java.util.Scanner;
import java.io.File;

class FileTest1
{
public static void  main(String Dx[])
{
  FileInputStream fin;
 
 try{
            
           
                  
             Scanner scanner = new Scanner(new File("abc.txt"));
            while (scanner.hasNext()) {
             String line = scanner.next();
            String cells[] = line.split(" ");                         
            System.out.println(line);}
                
          System.out.println("Operation is successfully Compleated");      
        }
       catch(Exception e)
        {System.out.println(e);}
}


}
import java.util.Scanner;
class UserInput
{
 public static void main(String Dx[])
  {
    
     Scanner in=new Scanner(System.in);
    
     int no;     
     System.out.println("ENTER NO:-"); 
     no=in.nextInt();
     System.out.println("YOUR ROLL NO :"+no);
    
      
 }


}

How to write String in File in Java Programm

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.File;
class FileTest
{
public static void  main(String Dx[])
{
  FileOutputStream fout;
  File file;
 try{
            
             file=new File("abc.txt");
            fout=new FileOutputStream(file);
             String s="Hi, Hello ,how r u?";
                if(!file.exists())
                 {file.createNewFile();}
               byte[]  b=s.getBytes();
                 fout.write(b);
               fout.flush();
               fout.close();
          System.out.println("Operation is successfully Compleated");      
        }
       catch(Exception e)
        {System.out.println(e);}
}


}

How to change Background color by selecting color from Listview

activitymain.xml file::> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xm...