Tuesday, 5 November 2019

Few Linux App & commands which is going to used to Build AOSP(Android Open Source Project) Source Code

1. sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip unrar
2. sudo apt-get install adb fastboot repo
3. sudo apt-get install geany vim(These're two best code editors)
4. sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java8-installer
    sudo apt-get install oracle-java8-set-default
    sudo apt-get install openjdk-8-jdk
5. sudo apt-get install -y chrpath gawk texinfo libsdl1.2-dev whiptail diffstat cpio libssl-dev
6. sudo apt-get install openssh-server openssh-client

Commands :
lunch:   lunch <product_name>-<build_variant>
   tapas:   tapas [<App1> <App2> ...] [arm|x86|mips|armv5] [eng|userdebug|user]
   croot:   Changes directory to the top of the tree.
   m:       Makes from the top of the tree.
   mm:      Builds all of the modules in the current directory, but not their dependencies.
   mmm:     Builds all of the modules in the supplied directories, but not their dependencies.
            To limit the modules being built use the syntax: mmm dir/:target1,target2.
   mma:     Builds all of the modules in the current directory, and their dependencies.
   mmma:    Builds all of the modules in the supplied directories, and their dependencies.
   cgrep <PATTERN> Greps on all local C/C++ files.
ggrep <PATTERN> Greps on all local Gradle files.
jgrep <PATTERN> Greps on all local Java files.
resgrep <PATTERN> Greps on all local res/*.xml files.
mangrep <PATTERN> Greps on all local AndroidManifest.xml files.
mgrep <PATTERN> Greps on all local Makefiles files.
sepgrep <PATTERN> Greps on all local sepolicy files.
sgrep <PATTERN> Greps on all local source files.
   godir:   Go to the directory containing a file.

Wednesday, 28 June 2017

How to overcome with following error 'adb.exe start server failed android studio'

1. netstat -ano | findstr 5037(This is adb port that will show in android studion terminal/message)
2. Take the PID no 
3.open the task manager stop the PID manually and again click on run button on Android studio.

Saturday, 3 September 2016

How to speed up your Gradle

Create a file named gradle.properties in the following directory:

/home/<username>/.gradle/ (Linux)

/Users/<username>/.gradle/ (Mac)

C:\Users\<username>\.gradle (Windows)


After Create open in notepad and then write following lines :-



org.gradle.parallel=true

org.gradle.daemon=true

org.gradle.jvmargs=-Xmx8192M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8


Add this line to your build.gradle(Module: app) ->



android{

   ...

dexOptions { javaMaxHeapSize "4g" //specify the heap size for the dex process}

...

}


After this go to setting(Android studio ALT+CTRL+S) - > Theb go to Build,Execution,Deployment -> then Compiler Check all and in command line write  --offline






This will decrease the gradle build time. 

If you have any queries asked me anytime.

Thank you






Thursday, 4 February 2016

Delete your Facebook account permannently

How to delete you facebook account Permanently.


If you want to delete, click on below link
 Delete Facebook account


When you press "delete account" button , Your account will not delete permanently , still you have 14 days to activate it . After 14 days , it will automatically delete your photos and every post.

Thank you.

Thursday, 24 September 2015

Mainly this error comes with $_GET, $_POST and $_REQUEST
Example :
Let us having a index.php page
form name='form1' method='post' action='index.php'
Enter your ID input type='text' value='' name='id'
................
................

and we want to use this 'id' to other page.
Then we use
$id=$_GET['id'];
Then it will show  Notices likes this
Notice: Undefined index: id
First we have to know about what is $_GET
In the php manual,it says “An associative array of variables passed to the current script via the URL parameters”. The word “associative array” clearly tells us what this error is. If we access any array variable which is not set, it will throw an error saying that the index is undefined.
All you need to do to fix it is change this line:
$id = $_GET['id'];
to this:
$id = isset($_GET['id']) ? $_GET['id'] : '';

if you have any query related to php ."skandkr24@gmail.com" -- This is my mail ID 
Free feel to mail me . I'll help you.



Tuesday, 23 October 2012

CLL


/*  CLL as a class */
#include <iostream.h>
#include <conio.h>

class node
 {
public:
int  data;
node *next;
node()   //default constructor
 {
next=NULL;
 }
node(int x)   //parameterised constructor
 {
next=NULL;
data=x;
 }
  /* parameterised constructor will initialize the data field with x */
  };


class linkedlist
 {
node *head; //to store the address of the starting node
public:
linkedlist() //Default constructor
  {
head=NULL;
  }

~linkedlist(); // Destructor to delete a linked list.
void create();
void print();
int count();
int search(int x);
void insertf(int x);//insert at the front
void insertr(int x);//insert at the rear
void Deletef( );//Delete from the front
void Deleter();//Delete from the Rear
 };

 linkedlist:: ~linkedlist()
     {
node *p;
if(head!=NULL)
  {
while(head->next!=head)
  {
p=head->next;
head->next=p->next;
delete p;
  }
delete head;
head=NULL;
   }
    }

void linkedlist:: create()
  {
int x,n,i;
node *p;
cout << "\n Enter no of nodes : ";
cin>>n;
for(i=0;i<n;i++)
  {
cout<<"\n Next Data : ";
cin >> x;
if(head==NULL) // inserting the first node
   {
head=new node(x);
head->next=head;
   }
else
   {
p=new node(x);
p->next=head->next;
head->next=p;
head=p;
   }
  }
  }

 void linkedlist::print()
  {
cout<<"\n Data stored in the linked list : ";
node *p;
if(head==NULL)
return;
p=head->next;
do
  {
cout<<"  "<<p->data;
p=p->next;
  }while(head->next != p);
 }

int linkedlist::count()
 {
int i=0;
node *p;
if(head==NULL)
return 0;
p=head->next;
   do
     {
i++;
p=p->next;
     }while(head->next != p);
   return i;
 }

int linkedlist::search(int x)
 {
int i=0;
node *p;
if(head==NULL)
return -1;
p=head->next;
do
  {
i++;
if(p->data==x)
return i;
p=p->next;
  }while(head->next != p);
return -1;
 }

void linkedlist::insertf(int x)
 {
node *p;
if(head==NULL) // inserting the first node
   {
head=new node(x);
head->next=head;
   }
else
   {
p=new node(x);
p->next=head->next;
head->next=p;
   }
 }

void linkedlist::insertr(int x)
 {
node *p;
if(head==NULL) // inserting the first node
 {
head=new node(x);
head->next=head;
 }
else
 {
p=new node(x);
p->next=head->next;
head->next=p;
head=p;
 }

 }

 void linkedlist::Deletef()
   {
node *p;
if(head->next==head)
 {
delete head;
head=NULL;
 }
else
 {
p=head->next;
head->next=p->next;
delete p;
 }
  }

 void linkedlist::Deleter()
   {
node *p;
if(head->next==head)
 {
delete head;
head=NULL;
 }
else
 {
p=head->next;
while(p->next != head) // locate the predecessor of head node
p=p->next;
p->next=head->next;
delete head;
head=p;
 }
  }



void main()
 {
int op,x,loc;
linkedlist l,l1,l2;
clrscr();
do
{
cout<<"\n\n1)Create\n2)Print\n3)Insert(front)\n4)insert(rear)";
cout<<"\n5)Delete(front)\n6)Delete(rear)\n7)length";
cout<<"\n8)Search\n9)Quit";
cout<<"\nEnter your Choice : ";
cin >> op;
switch(op)
  {
case 1: l.create();break;
case 2: l.print();break;
case 3: cout<<"Enter the data  :"; cin>>x;
l.insertf(x);break;
case 4: cout<<"Enter the data  :"; cin>>x;
l.insertr(x);break;
case 5: l.Deletef();break;
case 6: l.Deleter();break;
case 7: cout << "Length of the linked list = "<<l.count();
break;
case 8: cout << "Enter element to be searched : ";
cin >> x;
loc=l.search(x);
if(loc==-1)
cout << "\n Element not found ";
else
cout << "\n Found at location : "<<loc;
break;
}
      }while(op!=9);
 }

/*

OUTPUT:

1)Create
2)Print
3)Insert(front)
4)insert(rear)
5)Delete(front)
6)Delete(rear)
7)length
8)Search
9)Quit
Enter your Choice : 1

 Enter no of nodes : 4

 Next Data : 1

 Next Data : 2

 Next Data : 3

 Next Data : 4



Enter your Choice : 2

 Data stored in the linked list :   1  2  3  4


Enter your Choice : 3

Enter the data  :55

Enter your Choice : 4

Enter the data  :45

Enter your Choice : 5

Enter your Choice : 6

Enter your Choice : 2

 Data stored in the linked list :   1  2  3  4


Enter your Choice : 7
 Length of the linked list = 4


Enter your Choice : 8
 Enter element to be searched : 4

 Found at location : 4


Enter your Choice : 9

*/

//SLL


//Singly linked list(SLL)....................
#include<iostream.h>
#include<conio.h>
class node
{
 public:
 int data;
 node *next;
 node()
 {
  next=NULL;
 }
 node(int x)
 {
  next=NULL;
  data=x;
 }
};
class linkedlist
{
 node *head;
 public:
       linkedlist()
{
 head=NULL;
}
 
void create();
void print();
void insert(int x,int loc);
void Delete(int loc);
int search(int x);

};

void linkedlist::create()
{
 int x,n,i;
 node *p;
 cout<<"\nEnter no of nodes:";
 cin>>n;
 for(i=0;i<n;i++)
 {
  cout<<"\nNext Data:";
  cin>>x;
  if(head==NULL)
  head=p=new node(x);
  else
   {
    p->next=new node(x);
    p=p->next;
   }
  }
}
void linkedlist::print()
{
 cout<<"\nData stored in a linked list:";
 for(node *p=head;p!=NULL;p=p->next)
 cout<<p->data<<" ";
}
void linkedlist::insert(int x,int loc)
{
node *p=new node(x);
if(loc==1)
{
p->next=head;
head=p;
}
else
{
node *q=head;
for(int i=1;i<loc-1;i++)
if(q!=NULL)
 q=q->next;
 else
   {
      cout<<"OVERFLOW";
      return;
   }
 p->next=q->next;
 q->next=p;
}
}
void linkedlist::Delete(int loc)
{
 node *p,*q;
 int i;
 if(loc==1)
 {
  p=head;
  head=head->next;
  delete p;
 }
 else
 {
 q=head;
 for(i=1;i<loc-1;i++)
 if(q->next==NULL)
 {
  cout<<"\nUnderflow........";
  return;
 }
 else
    q=q->next;
    p=q->next;
    q->next=p->next;
    delete p;
    }
    }
int linkedlist::search(int x)
{
 int i=0;
 for(node *p=head;p!=NULL;p=p->next)
 {
  if(p->data==x)
  return(i);
  i++;
 }
  return -1;
}
void main()
{
 int op,x,loc;
 clrscr();
 linkedlist l;
 do
 {
  cout<<"\n1)Create\n2)print\n3)Insert\n4)Delete\n5)search\n6)quit";
  cout<<"\nEnter your choice:";
  cin>>op;
  switch(op)
  {
   case 1:l.create();
   break;
   case 2:l.print();
   break;
   case 3:cout<<"\nEnter the location:";
 cin>>loc;
 cout<<"\nEnter the data:";
 cin>>x;
 l.insert(x,loc);
 break;
   case 4:cout<<"\nEnter the location:";
 cin>>loc;
 l.Delete(loc);
 break;
   case 5:cout<<"\nEnter the element to be searched:";
 cin>>x;
 loc=l.search(x);
 if(loc==-1)
 cout<<"\nElement not found..";
 else
 cout<<"\nfound at location:"<<loc+1;
 break;

  }
 }while(op!=6);getch();
 }

Monday, 24 October 2011

Idea about "Change"....

Change is inspiring.
The best change often starts as one simple thought.

Change is positive.
It brings an enduring transformation.

Change is inevitable.
The sooner we open up to it, the better.

Change is essence of life.
If we don't change, we don't grow.

change is future.
And it is here right now.

Be the change you want to see!

Wednesday, 19 October 2011

"C program for Student Database from linked list"

/*PROBLEM DEFINATION : Implement the Mini Project of Student Database using Linked list for following requirements:
    a. Creation of Student Database in memory containing student ID, Name, Name
        Initials, Address, Contact No and Date of Birth .
    b. Insertion, Deletion, Modification of student record for a given student ID.
    c. Sorting on name initials and searching a particular student record on name initials
  */

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

struct stud
{
 int rn,id,ph;
 char add[30],na[20],d[15],in[5];
 struct stud *next;
}*h=NULL,*p,*q,*t;

void add()
{
  clrscr();
  p =(stud *)malloc(sizeof(stud));
  printf("\nEnter the Initials of Student : ");
  scanf("%s",&p->in);
  printf("\nEnter the Last Name of Student : ");
  scanf("%s",&p->na);
  printf("\nEnter the ID of Student : ");
  scanf("%d",&p->id);
  printf("\nEnter the Roll No. of Student : ");
  scanf("%d",&p->rn);
  printf("\nEnter the Ph No. of Student : ");
  scanf("%d",&p->ph);
  printf("\nEnter the Address of Student : ");
  scanf("%s",&p->add);
  printf("\nEnter the D.O.B. of Student(dd/mm/yyyy) : ");
  scanf("%s",&p->d);

  p->next=NULL;

  if(h==NULL)
  {
   h=p;
  }
  else
  {
    q=h;
    while(q->next!=NULL)
    q=q->next;
    q->next=p;
  }
  ts++;
}

void addAt(int r)
{
 q=h;
 while(q->rn!=r || q==NULL)
  q=q->next;
 if(q->rn==r)
 {
  clrscr();
  p =(stud *)malloc(sizeof(stud));
  printf("\nEnter the Initials of Student : ");
  scanf("%s",&p->in);
  printf("\nEnter the Last Name of Student : ");
  scanf("%s",&p->na);
  printf("\nEnter the ID of Student : ");
  scanf("%d",&p->id);
  printf("\nEnter the Roll No. of Student : ");
  scanf("%d",&p->rn);
  printf("\nEnter the Ph No. of Student : ");
  scanf("%d",&p->ph);
  printf("\nEnter the Address of Student : ");
  scanf("%s",&p->add);
  printf("\nEnter the D.O.B. of Student(dd/mm/yyyy) : ");
  scanf("%s",&p->d);
  p->next=q->next;
  q->next=p;
  ts++;
 }
 else
 {
  printf("\n\nRecord Not Found.");
 }
}


void delAt(int r)
{
 q=h;
 while((q->next)->rn!=r || q==NULL)
  q=q->next;
 if((q->next)->rn==r)
 {
  q->next=(q->next)->next;
  printf("\n\nRecord Deleted.");
  ts--;
 }
 else
  printf("\n\nRecord Not Found.");
}

void modAt(int id)
{
 q=h;
 int ch;
 while(q->id!=id && q!=NULL)
  q=q->next;
 if(q->id==id)
 {
  clrscr();
  printf("******* MODIFY *******\n1.Name Initials\n2.Last Name");
  printf("\n3.Roll No.\n4.Phone\n5.Add\n6.D.O.B.:\nEnter choice: ");
  scanf("%d",&ch);
  switch(ch)
  {
  case 1 :  printf("\n\nEnter the Initials of Student : ");
          scanf("%s",&q->in);break;
  case 2 :  printf("\nEnter the Last Name of Student : ");
          scanf("%s",&q->na);break;
  case 3 :  printf("\nEnter the Roll No. of Student : ");
          scanf("%d",&q->rn);break;
  case 4 :  printf("\nEnter the Ph No. of Student : ");
          scanf("%d",&q->ph);break;
  case 5 :  printf("\nEnter the Address of Student : ");
          scanf("%s",&q->add);break;
  case 6 :  printf("\nEnter the D.O.B. of Student(dd/mm/yyyy) : ");
          scanf("%s",&q->d);break;
  }
 }
 else
  printf("\nRecord not Found.");
}

void search(char ni[5])
{
 int flag=0;
 q=h;
 clrscr();
 while(q!=NULL)
 {
  if(stricmp(q->in,ni)==0)
  {
  flag=1;
  printf("\n\nInitals of Student :   %s ",q->in);
  printf("\n\nLast Name of Student : %s ",q->na);
  printf("\n\nID of Student :        %d ",q->id);
  printf("\n\nRoll No. of Student :  %d",q->rn);
  printf("\n\nPh No. of Student :    %d",q->ph);
  printf("\n\nAddress of Student :   %s",q->add);
  printf("\n\nD.O.B. of Student :    %s",q->d);
  printf("\n\n\n");
  }
  q=q->next;
 }
 if(flag==0)
  printf("\n\nNo Match Found.");
}

void sort()
{
 p=h;
 while(p!=NULL)
 {
  q=h;
  while(q!=NULL)
  {
   if(stricmp(q->in,(q->next)->in)>0)
   {
    strcpy(t->in,q->in);
    strcpy(t->na,q->na);
    t->id=q->id;
    t->rn=q->rn;
    t->ph=q->ph;
    strcpy(t->add,q->add);
    strcpy(t->d,q->d);


    strcpy(q->in,(q->next)->in);
    strcpy(q->na,(q->next)->na);
    q->id=  (q->next)->id;
    q->rn=  (q->next)->rn;
    q->ph=  (q->next)->ph;
    strcpy(q->add,(q->next)->add);
    strcpy(q->d,(q->next)->d);

    strcpy((q->next)->in,t->in);
    strcpy((q->next)->na,t->na);
    (q->next)->id = t->id;
    (q->next)->rn = t->rn;
    (q->next)->ph = t->ph;
    strcpy((q->next)->add,t->add);
    strcpy((q->next)->d,t->d);

   }
   q=q->next;
  }
  p=p->next;
 }

}

void disp()
{
 p=h;
 clrscr();
 while(p!=NULL)
 {
  printf("\nInitals of Student :   %s ",p->in);
  printf("\nName of Student :      %s ",p->na);
  printf("\nID of Student :        %d ",p->id);
  printf("\nRoll No. of Student :  %d",p->rn);
  printf("\nPh No. of Student :    %d",p->ph);
  printf("\nAddress of Student :   %s",p->add);
  printf("\nD.O.B. of Student :    %s",p->d);
  printf("\n\n");
  p=p->next;
 }
}

void main()
{
 int ch=0,r;
 char ni[5];
 clrscr();
 while(ch!=8)
 {
  clrscr();
  printf("1.Add the Record.\n\n2.Add Record at Locn.\n\n3.Delete Record.");
  printf("\n\n4.Modify Record.\n\n5.Search Record.\n\n6.Sort Records.");
  printf("\n\n7.Display\n\n8.Exit");
  printf("\n\nEnter the Choice: ");
  scanf("%d",&ch);
   switch(ch)
   {
    case 1:
    add();
    break;

    case 2:
    printf("\nEnter the Roll No. : ");
    scanf("%d",&r);
    addAt(r);
    break;

    case 3:
    printf("\nEnter the Roll No. : ");
    scanf("%d",&r);
    delAt(r);
    break;

    case 4:
    printf("\nEnter the ID : ");
    scanf("%d",&r);
    modAt(r);
    break;

    case 5:
    printf("\nEnter the Initials : ");
    scanf("%s",&ni);
    search(ni);
    break;

    case 6:
    sort();
    printf("\n\nSorted");
    break;
    case 7:
    disp();
    break;
   }
 getch();
 }
 getch();
}
*/
OUTPUT :
==========

1.Add the Record.
2.Add Record at Locn.
3.Delete Record.
4.Modify Record.
5.Search Record.
6.Sort Records.
7.Display
8.Exit

Enter the Choice: 1
Enter the Initials of Student : T.T.
Enter the Last Name of Student : MOJAD
Enter the ID of Student : 001
Enter the Roll No. of Student : 1
Enter the Ph No. of Student : 1234
Enter the Address of Student : qwer
Enter the D.O.B. of Student(dd/mm/yyyy) :10/12/1988

1.Add the Record.
2.Add Record at Locn.
3.Delete Record.
4.Modify Record.
5.Search Record.
6.Sort Records.
7.Display
8.Exit

Enter the Choice: 7
Initals of Student :   T.T.
Name of Student :      MOJAD
ID of Student :        1
Roll No. of Student :  1
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    10/12/1988

Initals of Student :   A.M.
Name of Student :      Mehata
ID of Student :        2
Roll No. of Student :  2
Ph No. of Student :    12345
Address of Student :   abde
D.O.B. of Student :    10/12/1990

Initals of Student :   S.M.
Name of Student :      Mane
ID of Student :        3
Roll No. of Student :  3
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    12/12/1989

1.Add the Record.
2.Add Record at Locn.
3.Delete Record.
4.Modify Record.
5.Search Record.
6.Sort Records.
7.Display
8.Exit

Enter the Choice: 2
Enter the Roll No. : 2
Enter the Initials of Student : Z.Z.
Enter the Last Name of Student : Shaikh
Enter the ID of Student : 005
Enter the Roll No. of Student : 4
Enter the Ph No. of Student : 1234
Enter the Address of Student : qwer
Enter the D.O.B. of Student(dd/mm/yyyy) : 14/3/1991

Initals of Student :   T.T.
Name of Student :      MOJAD
ID of Student :        1
Roll No. of Student :  1
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    10/12/1988

Initals of Student :   A.M.
Name of Student :      Mehata
ID of Student :        2
Roll No. of Student :  2
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    10/12/1990

Initals of Student :   Z.Z.
Name of Student :      Shaikh
ID of Student :        5
Roll No. of Student :  4
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :   14/3/1991

Initals of Student :   S.M.
Name of Student :      Mane
ID of Student :        3
Roll No. of Student :  3
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    12/12/1989

1.Add the Record.
2.Add Record at Locn.
3.Delete Record.
4.Modify Record.
5.Search Record.
6.Sort Records.
7.Display
8.Exit

Enter the Choice: 5
Enter the Initials : a.m.

Initals of Student :   A.M.
Last Name of Student : Mehata
ID of Student :        2
Roll No. of Student :  2
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    10/12/1990

1.Add the Record.
2.Add Record at Locn.
3.Delete Record.
4.Modify Record.
5.Search Record.
6.Sort Records.
7.Display
8.Exit

Enter the Choice: 4
Enter the ID : 001

******* MODIFY *******
1.Name Initials
2.Last Name
3.Roll No.
4.Phone
5.Add
6.D.O.B.:
Enter choice: 1

Enter the Initials of Student : T.D.

Initals of Student :   T.D.
Name of Student :      MOJAD
ID of Student :        1
Roll No. of Student :  1
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    10/12/1988

Initals of Student :   A.M.
Name of Student :      Mehata
ID of Student :        2
Roll No. of Student :  2
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    10/12/1990

Initals of Student :   Z.Z.
Name of Student :      Shaikh
ID of Student :        5
Roll No. of Student :  4
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    14/3/1991

Initals of Student :   S.M.
Name of Student :      Mane
ID of Student :        3
Roll No. of Student :  3
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    12/12/1989

1.Add the Record.
2.Add Record at Locn.
3.Delete Record.
4.Modify Record.
5.Search Record.
6.Sort Records.
7.Display
8.Exit

Enter the Choice: 6
Sorted
Initals of Student :   A.M.
Name of Student :      Mehata
ID of Student :        2
Roll No. of Student :  2
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    10/12/1990

Initals of Student :   S.M.
Name of Student :      Mane
ID of Student :        3
Roll No. of Student :  3
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    12/12/1989

Initals of Student :   T.D.
Name of Student :      MOJAD
ID of Student :        1
Roll No. of Student :  1
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    10/12/1988

Initals of Student :   Z.Z.
Name of Student :      Shaikh
ID of Student :        5
Roll No. of Student :  4
Ph No. of Student :    1234
Address of Student :   qwer
D.O.B. of Student :    14/3/1991
*/

"C program for Circular queue"

/* Program for showing various operations on a Circular queue  represented
   using linked list.
   */

#include<stdio.h>
#include<conio.h>
typedef struct node
 {
   int data;
   struct node *next;
 }node;
void init(node **R);
void enqueue(node **R,int x);
int dequeue(node **R);
int empty(node *rear);
void print(node *rear);
int front_element(node *rear);
int rear_element(node *rear);
void main()
{
 int x,option;
 int n = 0,i;
 node *rear;
 init(&rear);
 clrscr();
 do
   {
      printf("\n1]Insert\t2]Delete\t3]Print");
      printf("\t4]Front element\t5]Rear Element\t6]Quit");
      printf("\nEnter your option:  ");
      scanf("%d",&option);
      switch(option)
      {
        case 1: printf("\nEnter queue data : ");
            scanf("\n %d",&x);
            enqueue(&rear,x);
            break;
        case 2 : if(! empty(rear))
            {
              x=dequeue(&rear);
              printf("\n Element deleted = %d",x);
            }
             else
              printf("\n Uderflow..... Cannot deleted");
             break;
        case 3 : print(rear);
             break;
        case 4 :if(!empty(rear))
               printf("\nFront Element = %d",front_element(rear));
            else
               printf("\nQueue is empty");
            break;
        case 5 :if(!empty(rear))
               printf("\nRear Element = %d",rear_element(rear));
            else
               printf("\nQueue is empty");
            break;
     }
  }while(option != 6);

 }

 void init(node **R)
    {
      *R = NULL;
    }

 void enqueue(node **R,int x)
    {
     node *p;
     p = (node *)malloc(sizeof(node));
     p->data = x;
     if(empty(*R))
    {
      p->next = p;
      *R = p;
    }
     else
       {
      p->next = (*R)->next;
      (*R)->next = p;
      (*R) = p;
       }
    }

int dequeue(node **R)
  {
    int x;
    node *p;
    p=(*R)->next;
    x=p->data;
    if(p->next == p)
     {
         *R = NULL;
         free(p);
         return(x);
     }
   (*R)->next = p->next;
   free(p);
   return(x);
 }

void print(node *rear)
  {
   node *p;
   if(!empty(rear))
      {
      p = rear->next;
      }
   else
     {
       printf("\nQueue is empty");
       return;
     }

   printf("\n");
   do
     {
    printf("%d  ",p->data);
    p = p->next;
     }while(p != rear->next);
  }

int empty(node *P)
  {
    if(P->next== NULL)
        return(1);
    return(0);
  }

int front_element(node *rear)
  {
     return(rear->next->data);
  }

int rear_element(node *rear)
  {
     return(rear->data);
  }
  /*
  OUTPUT:-

1]Insert        2]Delete        3]Print 4]Front element 5]Rear Element  6]Quit 
Enter your option:  1                                                          
                                                                               
Enter queue data : 23                                                          
                                                                               
1]Insert        2]Delete        3]Print 4]Front element 5]Rear Element  6]Quit 
Enter your option:  1                                                          
                                                                               
Enter queue data : 34                                                          
                                                                               
1]Insert        2]Delete        3]Print 4]Front element 5]Rear Element  6]Quit 
Enter your option:  1                                                          
                                                                               
Enter queue data : 45                                                          
                                                                               
1]Insert        2]Delete        3]Print 4]Front element 5]Rear Element  6]Quit 
Enter your option:  3                                                          
                                                                               
23  34  45                                                                     
1]Insert        2]Delete        3]Print 4]Front element 5]Rear Element  6]Quit 
Enter your option:  4                                                          
                                                                               
Front Element = 23                                                             
1]Insert        2]Delete        3]Print 4]Front element 5]Rear Element  6]Quit 
Enter your option:  5                                                          
                                                                               
Rear Element = 45                                                              
1]Insert        2]Delete        3]Print 4]Front element 5]Rear Element  6]Quit 
Enter your option:  2                                                          
                                                                               
 Element deleted = 23                                                          
1]Insert        2]Delete        3]Print 4]Front element 5]Rear Element  6]Quit 
Enter your option:  6
*/
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               

"C program for Stack as ADT"

/*  IMPLEMENT STACK AS AN ADT USING ARRAY. USE THIS ADT TO
        PERFORM EXPRESSION CONVERSION & EVALUATION (INFIX TO
        POSTFIX,INFIX TO PREFIX,PREFIX TO INFIX,PREFIX TO POSTFIX,
        POSTFIX TO INFIX & POSTFIX TO PREFIX)
   */ .


  #include<stdio.h>
  #include<conio.h>
  #include<ctype.h>
  #include<string.h>
  #define MAX 20
  void in2post();
  void in2pre();
  void post2in();
  void pre2in();
  void post2pre();

  char s[MAX];
  char s1[MAX][MAX];
  int top=-1;
  void main()
   {
    char e[MAX];
    int choice;
    char ch;
    do
    {
     clrscr();
     printf("\n\n\t================= GIVEN MENU FOR STACK=================");
     printf("\n\n\t 1.Infix to Postfix");
     printf("\n\n\t 2.Infix to Prefix");
     printf("\n\n\t 3.Postfix to Infix");
     printf("\n\n\t 4.Prefix to Infix");
     printf("\n\n\t 5.Postfix to Prefix");
     printf("\n\n\t 6.EXIT");
     printf("\n\n\t Enter the Choice(1,2,3,4,5,6): ");
     scanf("%d",&choice);
     printf("\n\n\t^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
     switch(choice)
      {
    case 1:
           printf("\n\n\t*** INFIX TO POSTFIX ***");
           printf("\n\n\t Enter the Infix Exp: ");
           scanf("%s",&e);
           in2post(e);
           break;

    case 2:
           printf("\n\n\t*** INFIX TO PREFIX ***");
           printf("\n\n\t Enter the Infix Exp: ");
           scanf("%s",&e);
           in2pre(e);
           break;

    case 3:
           printf("\n\n\t*** POSTFIX TO INFIX ***");
           printf("\n\n\t Enter the Postfix Exp: ");
           scanf("%s",&e);
           post2in(e);
           break;

    case 4:
           printf("\n\n\t*** PREFIX TO INFIX ***");
           printf("\n\n\t Enter the Prefix Exp: ");
           scanf("%s",&e);
           pre2in(e);
           break;

    case 5:
           printf("\n\n\t*** POSTFIX TO PREFIX ***");
           printf("\n\n\t Enter the Postfix Exp: ");
           scanf("%s",&e);
           post2pre(e);
           break;

    case 6:
           exit(0);
           break;

    default:
        printf("\n\n\t*** INVALID CHOICE ***");
      }
      printf("\n\n\t^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
      printf("\n\n\t Do you want to continue(y/n): ");
      ch=getche();
    }while(ch=='Y'||ch=='y');
    getch();
   }


  void push(char c)
   {
    if(top>=MAX-1)
     {
       printf("\n\n\T Stack is Full...");
       return ;
     }
    else
     {
      top++;
      s[top]=c;
     }
   }

  char pop()
   {
     char c;
     if(top<0)
      {
    return NULL;
      }
     else
      {
    c=s[top];
    top--;
    return(c);
      }
   }

  int prior(char c)
   {
     if(c=='$'||c=='^')
     return 3;
     if(c=='*'||c=='/'||c=='%')
     return 2 ;
     else
      {
       if(c=='+'||c=='-')
       return 1 ;
       else
       return 0 ;
      }
   }

  void in2post(char e[MAX])
   {
    int i=0,p=0;
    char pe[MAX],c,opr;
    while(e[i]!='\0')
     {
      c=e[i];
      if(isalpha(c))
      pe[p++]=c;
      if(c=='(')
      push(c);
      if(c=='*'||c=='/'||c=='+'||c=='-'||c=='%'||c=='$'||c=='^')
       {
    if(top!=-1)
     {
      opr=pop();
      while(prior(opr)>=prior(c))
       {
         pe[p++]=opr;
         opr=pop();
       }
      push(opr);
      push(c);
     }
    else
     push(c);
       }
      if(c==')')
       {
    opr=pop();
    while(opr!='(')
     {
      pe[p++]=opr;
      opr=pop();
     }
       }
      i++;
      }
      while(top!=-1)
      pe[p++]=pop();;
      pe[p++]='\0';
      printf("\n\n\t %s",pe);
   }


  void in2pre(char e[])
   {
    char pe[MAX],c,opr;
    int i=0,p=0;
    strrev(e);
    while(e[i]!='\0')
     {
      c=e[i];
      if(isalpha(c))
      pe[p++]=c;
      if(c==')')
      push(c);
      if(c=='*'||c=='/'||c=='+'||c=='-'||c=='%'||c=='$'||c=='^')
       {
    if(top!=-1)
     {
      opr=pop();
      while(prior(opr)>prior(c))
       {
        pe[p++]=opr;
        opr=pop();
       }
      push(opr);
      push(c);
     }
    else
    push(c);
       }
      if(c=='(')
       {
    opr=pop();
    while(opr!=')')
     {
      pe[p++]=opr;
      opr=pop();
     }
       }
       i++;
      }
      while(top!=-1)
      pe[p++]=pop();
      pe[p++]='\0';
      strrev(pe);
      printf("\n\n\t Prefix Exp is: %s",pe);
    }


  void post2in(char post[])
   {
    char in[20],p1[20],p2[20],ch,o,t[10];
    int i=0;
    while(post[i]!='\0')
     {
      ch=post[i];
      if(isalpha(ch))
       {
     t[0]=ch;
     t[1]='\0';
     top++;
     strcpy(s1[top],t);
       }
      if(ch=='*'||ch=='^'||ch=='+'||ch=='-'||ch=='/')
       {
     strcpy(p2,s1[top]);
     top--;
     strcpy(p1,s1[top]);
     top--;
     t[0]=ch;
     t[1]='\0';
     strcat(p1,t);
     strcat(p1,p2);
     top++;
     strcpy(s1[top],p1);
       }
       i++;
     }

    strcpy(in,s1[top]);
    printf("\n\n\t Infix Exp is: %s",in);
   }

  void pre2in(char pre[])
   {
    char in[MAX],p1[MAX],p2[MAX],ch,o,t[10];
    int i=0;
    strrev(pre);
    while(pre[i]!='\0')
     {
      ch=pre[i];
      if(isalpha(ch))
       {
     t[0]=ch;
     t[1]='\0';
     top++;
     strcpy(s1[top],t);
       }
      if(ch=='*'||ch=='^'||ch=='+'||ch=='-'||ch=='/')
       {
     strcpy(p2,s1[top]);
     top--;
     strcpy(p1,s1[top]);
     top--;
     t[0]=ch;
     t[1]='\0';
     strcat(p1,t);
     strcat(p1,p2);
     top++;
     strcpy(s1[top],p1);
       }
       i++;
     }
    strcpy(in,s1[top]);
    strrev(in);
    printf("\n\n\t Infix Exp is: %s",in);
   }


  void post2pre(char post[])
   {
    char in[MAX],p1[20],p2[20],ch,o,t[10];
    int i=0;
    while(post[i]!='\0')
     {
      ch=post[i];
      if(isalpha(ch))
       {
    t[0]=ch;
    t[1]='\0';
    top++;
    strcpy(s1[top],t);
       }
      if(ch=='*'||ch=='^'||ch=='+'||ch=='-'||ch=='/')
       {
    strcpy(p2,s1[top]);
    top--;
    strcpy(p1,s1[top]);
    top--;
    t[0]=ch;
    t[1]='\0';
    strcat(t,p1);
    strcat(t,p2);
    top++;
    strcpy(s1[top],t);
       }
       i++;
     }
     strcpy(in,s1[top]);
     printf("\n\n\t Prefix Exp is: %s",in);

   }

/*
OUTPUT:-


         GIVEN MENU FOR STACK
 1.Infix to Postfix      2.Infix to Prefix       3.Postfix to Infix      4.Prefi
x to Infix       5.Postfix to Prefix     6.EXIT
        Enter the Choice(1,2,3,4,5,6): 1

 INFIX TO POSTFIX
 Enter the Infix Exp: a+b*c


         abc*+



      
        Enter the Choice(1,2,3,4,5,6): 2

INFIX TO PREFIX
 Enter the Infix Exp: a+c*b/d

Prefix Exp is: +a/*cbd
 Do you want to continue(y/n):y


        Enter the Choice(1,2,3,4,5,6): 3

 POSTFIX TO INFIX
 Enter the Postfix Exp: a+*c/b-d

 Infix Exp is: d
 Do you want to continue(y/n):y


        Enter the Choice(1,2,3,4,5,6): 4

 PREFIX TO INFIX
 Enter the Prefix Exp: a?b+c*d

 Infix Exp is: a
 Do you want to continue(y/n):y


        
        Enter the Choice(1,2,3,4,5,6):5

POSTFIX TO PREFIX
 Enter the Postfix Exp: a^b+c-d/e

 Prefix Exp is: e
 Do you want to continue(y/n):y

*/






























































































































































Few Linux App & commands which is going to used to Build AOSP(Android Open Source Project) Source Code

1. sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32n...