Structure Query Language, C programming, Java, Servlet, Jsp, Unix

Monday 26 November 2012

Create user friendly application that show different shapes like circle, square, rectangle, round rectangle, arc, oval in listview and on selecting draw that shape using ShapeDrawable class

Set7Activity.java
package ps.set7;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Set7Activity extends Activity implements OnItemClickListener 
{
 /**
     * www.master-gtu.blogspot.com
     * pankaj sharma (8460479175)
     * vijay chavda  (8460420769) 
     */
 String flags[]={"circle","square","rectangle","round rect","arc","oval"};
 ListView lv;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        lv=(ListView) findViewById(R.id.listView1);
        
        ArrayAdapter<String>aa=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,flags);
        lv.setAdapter(aa);
        lv.setOnItemClickListener(this);
    }
 @Override
 public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) 
 {
  Intent i=new Intent(this, screen.class);
  i.putExtra("id", arg2);
  startActivity(i);
 }
}
screen.java
package ps.set7;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.Shape;
import android.os.Bundle;
import android.view.View;

public class screen extends Activity 
{
 /**
     * www.master-gtu.blogspot.com
     * pankaj sharma (8460479175)
     * vijay chavda  (8460420769) 
     */
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  // TODO Auto-generated method stub
  super.onCreate(savedInstanceState);
  setContentView(new screen1(this,getIntent().getIntExtra("id", 0)));
 }
 private class screen1 extends View
 {
  int shape=0;
  public screen1(Context context, int id) {
   super(context);
   shape=id;
  }
  @Override
  protected void onDraw(Canvas canvas) {
   // TODO Auto-generated method stub
   super.onDraw(canvas);
   Shape s=new Shape() {
    
    @Override
    public void draw(Canvas c, Paint paint) 
    {
     paint.setColor(Color.RED);
     if(shape==0)
     {
      c.drawCircle(100, 100, 50, paint);
     }
     else if(shape==1)
     {
      c.drawRect(100, 100, 200, 200,paint);
     }
     else if(shape==2)
     {
      c.drawRect(100, 100, 150, 200, paint);
     }
     else if(shape==3)
     {
      RectF rect=new RectF(100, 100, 150, 200);
      c.drawRoundRect(rect, 5, 5, paint);
     }
     else if(shape==4)
     {
      RectF rect=new RectF(100, 100, 150, 200);
      c.drawArc(rect, 0, 150, true, paint);
     }
     else if(shape==5)
     {
      RectF rect=new RectF(100, 100, 150, 200);
      c.drawOval(rect,paint);
     }
    }
   };
   
   ShapeDrawable obj=new ShapeDrawable();
   obj.setShape(s);
   obj.draw(canvas);
  }
 }
}

Create android application that shows different country flags on listview and on selecting it will show flag of that country

Set6Activity.java
package ps.set6;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;

public class Set6Activity extends Activity implements OnItemClickListener {
    /**
     * www.master-gtu.blogspot.com
     * pankaj sharma (8460479175)
     * vijay chavda  (8460420769) 
     */
 String flags[]={"india","bhutan","nepal","japan"};
 int id[]={R.drawable.india,R.drawable.bhutan,R.drawable.nepal,R.drawable.japan};
 ListView lv;
 ImageView img;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        lv=(ListView) findViewById(R.id.listView1);
        img=(ImageView) findViewById(R.id.imageView1);
        
        ArrayAdapter<String>aa=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,flags);
        lv.setAdapter(aa);
        lv.setOnItemClickListener(this);
    }
 @Override
 public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) 
 {
  img.setImageResource(id[arg2]);
 }
}

Sunday 18 November 2012

Write a Script for Simple Database Management System Operation


clear
echo "\nDATABASE MANAGEMENT SYSTEM OPERATION\n"
echo "-----------------------------------------"
echo "1. VIEW RECORD BASES ON QUERY"
echo "2. ADD RECORD"
echo "3. DELETE RECORD"
echo "4. COUNT TOTAL NUMBER OF RECORD"
echo "5. EXIT"
echo "Enter your choice"
read ch
case $ch in
1)
echo " * Serching Record * "
echo "1. EMP_NO"
echo "2. EMP_NAME"
echo "3. EMP_ADDRESS"
echo "4. EMP_AGE"
echo "5. EMP_GENDER"
echo "6. EMP_DESIGNATION"
echo "7. EMP_BASIC_SALARY"
read serch_choice
case $serch_choice in
1)
echo "Enter Employee NO "
read empno
empno=`expr $empno + 1`

head -$empno emp.txt > temp1

tail -1 temp1 > temp2
no= `awk '{print $1}' temp2`
echo $no
;;
2)
echo "Enter Employee's Name"
read empname
grep "$empname" emp.txt
;;
3)
echo "Enter Address"
read empadd
grep "$empadd" emp.txt
;;
4)
echo "Enter Age"
read age
grep "$age" emp.txt
;;
5)
echo "Enter Gender"
read gender
grep "$gender" emp.txt
;;
6)
echo "Enter Designation"
read empdesig
grep "$empdesig" emp.txt
;;

7)
echo "Enter Basic Salary"
read bs
grep "$bs" emp.txt
;;
8)
echo "wrong choice"
;;
esac
;;
2)
echo "Enter emp_no : "
read empno
echo "Enter emp_name : "
read empname
echo "Enter address : "
read empadd
echo "Enter age : "
read age
echo "Enter Gender : "
read gender
echo "Enter designation : "
read empdesig
echo "Enter basic salary : "
read bs
record="$empno|$empname|$empaddr|$age|$gender|$empdesig|$bs"
`echo $record>>emp.txt`
echo " \t Record insert successfully..."
;;
3)
echo "Enter name"
read name
#`sed "/$name/d" emp.txt>tempfile1`
`grep -w "/$name/d" emp.txt>tempfile1`
`cat tempfile1>emp.txt`
rm tempfile1
  echo "\t Record delete successfully..."
;;
4) echo "Enter name"
read name
`sed "/$name/d" emp.txt>tempfile1`
`cat tempfile1>emp.txt`
rm tempfile1
echo "Enter emp_no : "
read empno
echo "Enter emp_name : "
read empname
echo "Enter address : "
read empadd
echo "Enter age : "
read age
echo "Enter Gender : "
read gender
echo "Enter designation : "
read empdesig
echo "Enter basic salary : "
read bs
record="$empno|$empname|$empaddr|$age|$gender|$empdesig|$bs"
`echo $record>>emp.txt`
echo " \t Record modify successfully..."
;;
Esac

Wednesday 14 November 2012

Simple Gallery View Example in android

Demo18Activity.java
package ps.demo18;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;
import android.widget.Toast;

public class Demo18Activity extends Activity implements OnItemClickListener {
    /** 
     * www.master-gtu.blogspot.com
     * pankaj sharma(8460479175), 
     * chavda vijay(8460420769) 
     */
 Gallery gv;
 int images[]={R.drawable.photo1,R.drawable.photo2,R.drawable.photo3,R.drawable.photo4};
 ImageView img;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        gv=(Gallery) findViewById(R.id.gallery1);
        
        img=(ImageView) findViewById(R.id.imageView1);
        
        gv.setAdapter(new arrayAdapter(this));
        
        gv.setOnItemClickListener(this);
    }
    private class arrayAdapter extends BaseAdapter
    {
     int images[]={R.drawable.photo1,R.drawable.photo2,R.drawable.photo3,R.drawable.photo4};
     Context c;
     public arrayAdapter(Context context)
     {
      c=context;
     }
  @Override
  public int getCount() {
   // TODO Auto-generated method stub
   return images.length;
  }

  @Override
  public Object getItem(int arg0) {
   // TODO Auto-generated method stub
   return arg0;
  }

  @Override
  public long getItemId(int arg0) {
   // TODO Auto-generated method stub
   return arg0;
  }

  @Override
  public View getView(int arg0, View arg1, ViewGroup arg2) {
   // TODO Auto-generated method stub
   
   ImageView img = new ImageView(c);
   img.setImageResource(images[arg0]);
   img.setLayoutParams(new Gallery.LayoutParams(100, 200));
   
   return img;
  }
    }
 @Override
 public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
  // TODO Auto-generated method stub

  img.setImageResource(images[arg2]);
  Toast.makeText(this, images[arg2]+" selected", 1).show();
 }
}

Wednesday 7 November 2012

Literature Survey & Acknowledgement


Acknowledgement

There are a number of people whom I would like to thank for their help and support in the creation of this dissertation!

I would like to thank the lecturers and staff of JVIMS for their support, guidance and patience but especially Prof. Apexa Joshi for her support as thesis advisor. Her encouragement at all stages of this project work has been contributed greatly to present the contents of the project.

We are grateful to Prof. Apexa Joshi, Seema Makhecha(H.O.D), Dr. K.J.Thankanchand Director of JVIMS M.C.A. College, for allowing us to carry out our dissertation work.

We would also like to thank all the staff members of the computer department, college library which provided us lot of valuable information regarding our project and for their understanding
whenever I required time to study or research. Last but not the least; we are obliged to our parents & all those who have directly or indirectly helped us to make this dissertation happen.


Literature survey


  1. How does a webmaster ensure that they appear high on search results? The answer is SEO(search engine optimization). Jerri Ledford (2008) defines the term SEO as “Improving a web site in an attempt to attract search engine crawlers”. A crawler is a piece of software that selects websites and indexes their contents for the purposes of building a search database.
  2. SEO is not a new idea; it has been around nearly as long as the search engines. However with the massive increase in traffic and usage on the internet, it has become a hugely important part of the design process. We use various techniques like keyword research, link building etc.
  3. This dissertation sets out to determine and document the main search engine optimization techniques used today i.e. Keyword research which is most important. The final part of the dissertation will apply all this to techniques to website for optimizing our site in search engine ranking.