Wednesday, 12 December 2012

java program to develope chat server using ServerSocket and Socket class.

Client side:-

import java.net.*;
import java.io.*;
class Client
{
public static void main(String args[]) throws Exception
{
Socket soc=new Socket(InetAddress.getLocalHost(),8888);
InputStream in=soc.getInputStream();
OutputStream out=soc.getOutputStream();

DataInputStream sin=new DataInputStream(in);
DataOutputStream sout=new DataOutputStream(out);
BufferedReader br=new BufferedReader(new       InputStreamReader(System.in));
String str;
while(true)
{
System.out.println("Server :"+sin.readUTF());
System.out.print("ME :");
str=br.readLine();
sout.writeUTF(str);
sout.flush();
}
}
}
               Server Side:-

          import java.net.*;
               import java.io.*;


             class Server
            {
          public static void main(String args[]) throws Exception
                 {
             //*******************************
                 //Remember we are storing Server socket into Socket by calling accept() method

            ServerSocket ss=new ServerSocket(8888);
            Socket soc =ss.accept();
                //*****************
          InputStream in=soc.getInputStream();
                OutputStream out=soc.getOutputStream();

               DataInputStream sin=new DataInputStream(in);
           DataOutputStream sout=new DataOutputStream(out);
             BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

           String str;

             sout.writeUTF("Wel come...Ready to recived you.");

       while(true)
        {
System.out.println("Client :"+sin.readUTF());
System.out.print("ME :");
str=br.readLine();
sout.writeUTF(str);
sout.flush();
      }


}
}


java swing program to retrive data from database and display using JTABLE



import javax.swing.*;
import javax.swing.table.*;
import java.sql.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;

class ShowFrame extends JFrame
{
ShowFrame()
{ try
{



JTable tab = new JTable();
  JScrollPane sc=new JScrollPane(tab);
DefaultTableModel df=new DefaultTableModel();
add(sc);

Class.forName("com.mysql.jdbc.Driver");
Connection cn=DriverManager.getConnection("jdbc:mysql://localhost/nirav","root","root");
Statement st=cn.createStatement();
ResultSet rs=st.executeQuery("select * from t1 ");


ResultSetMetaData meta= rs.getMetaData();
int count=meta.getColumnCount();
String c[]=new String[count];
for(int i=0;i<count;i++)
{
c[i]=meta.getColumnName(i+1);
df.addColumn(c[i]);
}


Object row[]=new Object[count];
while(rs.next())
{
for(int i=0;i<count;i++)
{
row[i]=rs.getString(i+1);
}
df.addRow(row);
}

tab.setModel(df);
//add(pan);
rs.close();
  cn.close();
}
catch(Exception e)
{
}
}

             }


class MainRetrive
{
public static void main(String str[])
{
ShowFrame sf=new ShowFrame();
//sf.setSize(200,200);
sf.setBounds(200,200,400,300);
sf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
sf.setVisible(true);

}

}

java swing program with jdbc to performed insert and retrive opeartion.




import javax.swing.*;
import javax.swing.table.*;
import java.sql.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;

class ShowFrame extends JFrame
{
ShowFrame()
{ try
{

JTable tab = new JTable();
JScrollPane sc=new JScrollPane(tab);


DefaultTableModel df=new DefaultTableModel();
add(sc);
Class.forName("com.mysql.jdbc.Driver");
Connection cn=DriverManager.getConnection("jdbc:mysql://localhost/nirav","root","root");
Statement st=cn.createStatement();


ResultSet rs=st.executeQuery("select * from t1 where");
ResultSetMetaData meta= rs.getMetaData();
int count=meta.getColumnCount();
String c[]=new String[count];


for(int i=0;i<count;i++)
{
c[i]=meta.getColumnName(i+1);
df.addColumn(c[i]);
}
Object row[]=new Object[count];
while(rs.next())
{
for(int i=0;i<count;i++)
{
row[i]=rs.getString(i+1);
}
df.addRow(row);
}
tab.setModel(df);

rs.close();
cn.close();
}

catch(Exception e)
{
System.out.println(e.toString());
}
}

}
class MyClass extends JFrame
{
JLabel l1,l2,l3;
JTextField id,name;
JPanel pan;
JButton insert,retrive;
MyClass()
{
l1=new JLabel("Id");
l2=new JLabel("Name");
l3=new JLabel("");
id=new JTextField(15);
name=new JTextField(15);
insert=new JButton("Insert");
retrive=new JButton("Retrive");

pan=new JPanel(new GridLayout(4,2));
pan.add(l1);
pan.add(id);
pan.add(l2);
pan.add(name);
pan.add(insert);
pan.add(retrive);
pan.add(l3);
add(pan,BorderLayout.CENTER);

insert.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{ try{

Class.forName("com.mysql.jdbc.Driver");
Connection cn=DriverManager.getConnection("jdbc:mysql://localhost/nirav","root","root");

Statement st=cn.createStatement();
int idd=Integer.parseInt(id.getText());
String n=name.getText();
int i=st.executeUpdate("insert into t1(id,name) values("+ idd +",'"+ n +"')");
cn.close();
l3.setText(i+"successFully inserted");
}
catch(Exception e)
{l3.setText(e.toString());}
}
});
retrive.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
ShowFrame sf=new ShowFrame();
//sf.setSize(200,200);
sf.setBounds(200,200,400,300);
sf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
sf.setVisible(true);

}
});
}
}


class MainInsert
{
public static void main(String str[])
{

MyClass frm=new MyClass();
frm.setSize(200,200);
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frm.setVisible(true);

}

}

Thursday, 6 September 2012

java program to find string matching in another string.


import java.io.*;

class paturn_match
{
       public static void main(String args[]) throws IOException
       {
             BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
             char test[] = new char[100];
             char given_str[] = new char[15];
             String temp;
             int i,j,lentext,lenp,flag=0,count=0;
         
             System.out.print("Enter Text  =  ");
             temp = br.readLine();
             test = temp.toCharArray();
             lentext = temp.length();
         
             System.out.print("Enter Paturn  =  ");
             temp = br.readLine();
             given_str = temp.toCharArray();
             lenp = temp.length();

             for(i=0;i!=lentext-1;i++)
             {
                   j=i;
                   int k=0;
                   flag=0;
                         while((test[i] == given_str[k]) && (flag !=1))
                         {
                               j=j+1;
                               k=k+1;
                                    if(k>=(lenp-1))
                                    {
                                          flag=1;
                                          break;
                                    }
                         } //WHILE
                     
                         if((k>0) && (flag==1))
                         {
                               System.out.println(" Paturn found at  " + i);
                               count++;
                         }
            }  // FOR LOOP
        
            System.out.println(" count = " + count);
    }
} //paturn_match.java

output:


Enter Text  =  hello hello
Enter Paturn  =  he
 Paturn found at  0
 Paturn found at  6
 count = 2

Tuesday, 4 September 2012

java program to use awt check box in applet.


// Demonstrate check boxes.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
<applet code="CheckboxDemo" width=250 height=200>
</applet>
*/
public class CheckboxDemo extends Applet implements ItemListener
{
String msg = "";
Checkbox obj1, obj2, obj3, obj4;
public void init()
{
obj1 = new Checkbox("A",  false);
obj2 = new Checkbox("B",  false);
obj3 = new Checkbox("C",  true);
obj4 = new Checkbox("D",  false);
add(obj1);
add(obj2);
add(obj3);
add(obj4);
obj1.addItemListener(this);
obj2.addItemListener(this);
obj3.addItemListener(this);
obj4.addItemListener(this);
}
public void itemStateChanged(ItemEvent ie)
{
//repaint();
}
// Display current state of the check boxes.
public void paint(Graphics g)
{
msg = "Current state: ";
g.drawString(msg, 6, 80);
msg = " A: " + obj1.getState();
g.drawString(msg, 6, 100);
msg = " B: " + obj2.getState();
g.drawString(msg, 6, 120);
msg = " C: " + obj3.getState();
g.drawString(msg, 6, 140);
msg = " D: " + obj4.getState();
g.drawString(msg, 6, 160);
}
}

Output:

java program to use awt check box group in applet.

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
<applet code="CBGroup" width=250 height=200>
</applet>
*/
public class CBGroup extends Applet implements ItemListener
{
String msg = "";
Checkbox obj1, obj2, obj3, obj4;
CheckboxGroup cbg;

public void init()
{
cbg = new CheckboxGroup();
obj1 = new Checkbox("A", cbg, false);
obj2 = new Checkbox("B", cbg, false);
obj3 = new Checkbox("C", cbg, true);
obj4 = new Checkbox("D", cbg, false);
add(obj1);
add(obj2);
add(obj3);
add(obj4);
obj1.addItemListener(this);
obj2.addItemListener(this);
obj3.addItemListener(this);
obj4.addItemListener(this);
}
public void itemStateChanged(ItemEvent ie)
{
repaint();
}
// Display current state of the check boxes.
public void paint(Graphics g)
{
msg = "Current selection: ";
msg += cbg.getSelectedCheckbox().getLabel();
g.drawString(msg, 6, 100);
}
}
output:

Saturday, 1 September 2012

How to performed inheritance in vb.net.Explain use of mybase , me and myclass in vb.net


Module Module1
    Class Button
        Public Sub New()
            Console.WriteLine("in base calss")
        End Sub
        Public Overridable Sub Paint()
            ' Paint button here. '        
            Console.WriteLine("in base calss's paint")
        End Sub
    End Class

    Class B1
        Inherits Button
        Public p As Integer = 10
        Public Sub New()
            Console.WriteLine("in base calss b1")
        End Sub
        Public Overrides Sub Paint()
            ' First, paint the button. '
            'MyBase.Paint()
            ' Now, paint the banner. … '
            Console.WriteLine("in base calss 2's paint")
        End Sub

    End Class
    Class B2
        Inherits B1
        Dim p As Integer = 15
        Public Sub New()
            Console.WriteLine("in base calss last")
        End Sub
        Public Overrides Sub Paint()
            Dim p As Integer = 5
            Console.WriteLine("use of me " + Me.p.ToString) 'also mybase can be used but mostly mybase is used for static
            Console.WriteLine("use of mybase" + MyBase.p.ToString)
            Console.WriteLine("use of local" + p.ToString)

            ' First, paint the button. '
            MyBase.Paint()
            Console.WriteLine("in child calss's paint")
            ' Now, paint the banner. … '
        End Sub

    End Class
    Public Sub main()
        Dim b As New B2()
        Dim str As String = "hello"
        'Console.Write(Mid(str, 2))
        'Console.Write(substring(str, 2))

        b.Paint()
        Console.Read()

    End Sub

End Module


CONSOLE OUTPUT IS:--

Wednesday, 29 August 2012

Program for calculating total elapsed time using the concept of multithreading and System.currentTimeMillis() method.


import  java.io.*;
class Child extends Thread
{
Child(String str)
{
super(str);
start();
}
public void run()
{

try
{
for(int n=1;n<=5;n++)
{
System.out.println("Child thread: "+n);
Thread.sleep(1000);
}

}
catch (InterruptedException e)
{
System.out.println("Child interrupted.");
}

}
}

class prog
{
public static void main(String a[]) throws Exception
{
long timestart = System.currentTimeMillis();
new Child("child");

Thread t = Thread.currentThread();
//System.out.println("current thread"+t);
t.setName("my thread");

try
{

for(int n=1;n<=5;n++)
{
System.out.println("main thread: "+n);
Thread.sleep(1000);
}
}
catch(Exception e)
{
System.out.println("not  valid");
}
long timelast = System.currentTimeMillis();
float result =(timelast-timestart)/1000;
System.out.println("total time elapsed in seconds :  "+result);

}
}


main thread: 1
Child thread: 1
main thread: 2
Child thread: 2
main thread: 3
Child thread: 3
Child thread: 4
main thread: 4
main thread: 5
Child thread: 5
total time elapsed in seconds :  5.0

Sunday, 19 August 2012

insertion and deletion of node (value) in singly linked list in java

import java.io.*;
class Node
{
    private Node next;
    private int data;
    Node(int data)
    {
        this.data=data; 
    } 
 
    public    Node getNext()
    {
        return next;
    }

  public void setNext(Node next)
    {
        this.next=next;
    }

    public    int getData()
    {
        return data;
    }
    public void setData(int data)
    {
        this.data=data;

    }
}



class LinkList
{
    Node head=null;
 
    public void addValue(int data,int pdata)
    {
        Node newNode=new Node(data);
        if(head == null)
        {
            head=newNode;
        }
        else if(head.getData() == pdata && head.getNext() == null)
        {
            head.setNext(newNode);
     
        }
        else
        {
            Node trav=head;
            //Node prev=null;
            while(trav != null && trav.getData() != pdata)
            {
                //prev=trav;
                trav=trav.getNext();
             
            }
         
            if(trav == null)
            {
                System.out.println("Give Value not found");
            }
            else
            { 
                Node temp= trav.getNext();
                newNode.setNext(temp);
                trav.setNext(newNode);
            }
         
        }
    }
    public void deleteValue(int data)
    {
     
        if(head==null)
        {
            System.out.println("LInk LIst is empty");
        }
        else if(head.getData() == data)
        {
            head=head.getNext();
     
        }
        else
        {
            Node trav=head;
            Node prev=null;
            while(trav != null &&  trav.getData() != data)
            {
                prev=trav;
                trav=trav.getNext();
             
            }
         
            if(trav == null)
                System.out.println("Give Value not found");
         
            else
            {
                prev.setNext(trav.getNext());
            }
         
        }
    }
    public void display()
    {
        if(head==null)
        {
            System.out.println("LInk LIst is empty");
        }
        else
        {
            Node trav=head; 
            while(trav.getNext() !=null )
            {
                System.out.print(trav.getData()+"->");
                trav=trav.getNext();
             
            }
         
            System.out.println(trav.getData());
        }
    }
}

class PracQuiz
{
        public static void main(String args[]) throws IOException
        {
            LinkList ls=new LinkList();
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            int ch,d,p;
            do
            {
                System.out.println("Menu----");     
                System.out.println("1.Insert after value"); 
                System.out.println("2.Delete By value"); 
                System.out.println("3.Display"); 
                System.out.println("4.Exit"); 
                System.out.println("ENter Your Choice"); 
                ch=Integer.parseInt(br.readLine());
             
                switch(ch)
                {
                case 1:
                    System.out.println("Insert data after you want your New Node"); 
                    d=Integer.parseInt(br.readLine());
                    System.out.println("Insert  value  after you want to enter new Node"); 
                    p=Integer.parseInt(br.readLine());
                    ls.addValue( d, p);
                    break;
                case 2:
                    System.out.println("Insert  data of node that you want to delete"); 
                    d=Integer.parseInt(br.readLine());
                    ls.deleteValue(d);
                    break;
                case 3:
                    System.out.println("Your Link list is:");
                    ls.display();
                    break;
                case 4:         
                    break;
                }
             
            }while(ch!=4);
                   
        }
 
}

Friday, 10 August 2012

program to use of MosueListener and MouseMotionListener interfaces in applet.



import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
<applet code="MyMouse" width=500 height=400>
</applet>
*/
public class MyMouse extends Applet implements MouseListener,MouseMotionListener
{
String msg=" ";
int x,y;
public void init()
{
addMouseListener(this);
addMouseMotionListener(this);
}
public void mouseClicked(MouseEvent me)
{
x=me.getX();
y=me.getY();
msg="click";
showStatus("x--"+x+"  y--"+y +"moused clicked");
repaint();
}
public void mouseEntered(MouseEvent me)
{
x=me.getX();
y=me.getY();
msg="";
showStatus("x--"+x+"  y--"+y +"moused Enterd");
repaint();
}
public void mouseExited(MouseEvent me)
{
x=me.getX();
y=me.getY();
msg="";
showStatus("x--"+x+"  y--"+y +"moused Exited");
repaint();
}
public void mousePressed(MouseEvent me)
{
x=me.getX();
y=me.getY();
msg="";
showStatus("x--"+x+"  y--"+y +"moused Pressed");
repaint();
}
public void mouseReleased(MouseEvent me)
{
x=me.getX();
y=me.getY();
msg="Released";
showStatus("x--"+x+"  y--"+y +"moused Released");
repaint();
}
public void mouseDragged(MouseEvent me)
{
x=me.getX();
y=me.getY();
msg="*";
showStatus("x--"+x+"  y--"+y +"moused Dragged");
repaint();
}
public void mouseMoved(MouseEvent me)
{
x=me.getX();
y=me.getY();
msg="";
showStatus("x--"+x+"  y--"+y +" moused moved");
repaint();
}
public void paint(Graphics g)
{
 
g.drawString(msg,x,y);
}
}

Tuesday, 7 August 2012

what is open source ERP ? advantages and disadvantages of it.


INTRODUCTION:
           Open source ERP is an enterprise resource planning (ERP) software system whose source      code is made publicly available.The open source model allows companies to access the ERP system's code and customize it using their own IT department instead of paying extra for vendor customization services and licensing, as is typically the case with closed source programs.
          Open source ERP can be particularly attractive to small to mid-sized businesses (SMBs) that want to upgrade or customize their ERP systems without paying large licensing and support fees.
For open source ERP software to be a viable option, companies must have an IT staff with considerable ERP development and programming skills.
There are several Open source ERP software packages available like:
1.       ERP5
2.       GNU Enterprise
3.       OpenBravo
4.       OpenERP
5.       Opentaps
6.       WebERP 

ADVANTAGES :
  • Reduced costs(vendor ,licensing fees)
  • Reduced Dependence on Vendor
              Organization can make the necessary modifications and alterations required on its own     without  depending on the vendor. By using Open Source ERP you are not locked to a particular company's product. 
  •  Ease of Use:
              Open Source ERP is easy to use and understand. It handles the functions easily thereby making it easy for the small companies to implement ERP.
DISADVANTAGES:
  • Support :
              
    The reliance on external sources for support of an enterprise system may be extremely expensive if in-house technology department  has not  required skills.
  • Updates :
              
    The software provider provides  updates .These updates may require additional testing on the part of a company to ensure that the update or patch does not cause any issues with the installed solution. If a company has limited resources to perform regression testing then this may require hiring a technology company to perform this.
  •    Maintenance:
                The organization not having a efficient staff to maintain a system as a result increased a maintenace cost.

Thursday, 19 July 2012

Display all properties in java

public class Display 
{
    public static void main(String[] args) 

   {
         System.getProperties().list(System.out);
    }
}

Saturday, 7 July 2012

program that describe use of ActionListener interface in applet

import java.lang.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
<applet code="text" width=200 height=200>
</applet>
*/
 public class text extends Applet implements ActionListener
{
    Label lbl1,lbl2;
    TextField txt1,txt2;
    Button b;
    String s;
      public void init()
      {
       lbl1=new Label("Text1");
       txt1=new TextField(10);
       lbl2=new Label("Text2");
       txt2=new TextField(20);
        b=new Button("Enter");
        add(lbl1); 
        add(txt1); 
        add(lbl2); 
        add(txt2);
         add(b); 
        txt1.addActionListener(this);
        txt2.addActionListener(this);
        b.addActionListener(this);
       }
        public void actionPerformed (ActionEvent ae)
       { int n1,n2,ans;
    try
    {
    n1=Integer.parseInt(txt1.getText());
    n2=Integer.parseInt(txt2.getText());
    ans=n1+n2;
    s="Addition of n1 ans n2  is "+ ans;
    repaint();
    }
    catch(NumberFormatException e)
    {
       
    s=txt1.getText()+" "+txt2.getText();
    repaint();
    }
       }
       public void paint(Graphics g)
       {
        g.drawString(s,100,100);
     

       }
}

program to illustrate use of Label, TextField in applet.


import java.awt.*;
import java.applet.*;
import java.awt.event.*;

/* <applet code = "applet1" height=150 width=380>
   </applet>
*/

public class applet1 extends Applet implements ActionListener
{
   TextField age,hobby;
  public void init()
      {
            Label l1,l2;
            l1 = new Label("Age :- ",Label.RIGHT);
            l2 = new Label("Hobby :- ");
     
            age=new TextField(5);
            hobby=new TextField(12);
           
            add(l1);
            add(age);
            add(l2);
            add(hobby);
           
            age.addActionListener(this);
            hobby.addActionListener(this);
               
       }
   // User pressed Enter
   public void actionPerformed(ActionEvent ae)
   {
    repaint();
    }
   public void paint(Graphics g)
    {
     g.drawString("Age :- " + age.getText(),6,60);
     g.drawString("Hobby :- " + hobby.getText(),6,80);
    }     
}      

program that dispaly rotating banner in applet

import java.awt.*;
import java.applet.*;

/* <applet code="banner" width=300 height=200>
   </applet> */

 public class banner extends Applet implements Runnable 
   {
     Font f;
    String mgs="welcome to applet programming language...";
    Thread t=null;
    int state;
    boolean stopflag;
 public void init()
   {
     f=new Font(mgs,Font.ITALIC|Font.BOLD,30);
    setBackground(Color.red);
    setForeground(Color.black);
    setFont(f);

   }
 public void start()
   {
    t=new Thread(this);
    stopflag=false;
    t.start();
   }
 public void run()
   {
    char ch;
    for(;;)
    {
    try
     {
      repaint();
      Thread.sleep(500);
      ch=mgs.charAt(0);
      mgs=mgs.substring(1,mgs.length());
      mgs +=ch;
      if(stopflag)
        break;
     }catch(InterruptedException e){}
   }
 }
 public void stop()
   {
    stopflag=true;
    t=null;
   }
 public void paint(Graphics g)
   {
    g.drawString(mgs,100,100);
   }
 }

Earn money with blogging site or your website





                         You can earn money by putting advertisement on your website or blogging site. There are several alternative are available from which you can select that are as follows.You can also used more than one ad network but before doing so check their compatibility with each other.
                          The different ad network are as follows:
  1.    Google adsense  
                          It is one of the best ad network.You can simply make an google adsense account that is free of charge.It is one of most trusted ad network.It pay on the basis of  pay per click.
    The minimum amount it pay is $100.There are several way available for taking payment you can choose any one of it. The ad come in may size one of them is as follows you can click on it.

                          To make an account go to following link:
    www.google.com/AdSense

  2. BitVertiser  
                                    BitVertiser is an ad network that used pay per click method to display ad on your web site.If you are advertiser(want to advertise your product) than it offer biding mechanism on the basis of your biding they performed advertising that means they display on their publisher's web site.
                                It provides several way of displaying advertisement on your website like Graphical ads,Pop-Under Ads,Display Ads that increases your profit.    
                                  BitVertiser used 4 different method for payment to you(publisher) that are as follows(you can choose on of them):
      1. paypal($ 10 minimum)
      2. skrill/moneyBrooker($ 10 minimum)
      3. check ($ 100 minimum) 
      4. Wire($ 500 minimum)
                       To Sign Up as Publisher(want to put ad on website to generate income) click following link:
Make money from your Website or Blog with BidVertiser
     
    3. Kontera ad Network     
                         Knotera  used in-text advertising method..That is they choose words from your website to diaplay  advertisement. Thus such things are perfromed automatically by kontera. The word that are displaying ad are dispaly in Double under lines. As visitor go on that word with thier mouse pointer the ad will display. As vistior click or visit that advertisement. It increased your revenue.
                        If  you want to used kontera then your content should be decent.  The minimum amount pay by kontera to their publisher  is  25$. if your account reach this amount they pay you by your defined payment method.In kontera you can set your limit of payment(by default it is 25$).
                       Link for kontera sign up as publisher--http://publishers.kontera.com/


     4. Chitika ad Network
                      Chitika used pay per click method to pay their publisher.for example it will display advertisement on your website and as may user click on that advertisement Chitika pay to you...
for example ad like...
                      If  you click on above advertisement it will increase count of hit in your chitika account.
                      The link for sign up as publisher on chitika is:
http://chitika.com/publishers/

    5. Text Link Ad Network

                          This is one of ad network that allow you to sell your website space to display advertisement. You can sell word within your content or web site and they display text link ad like Kontera ad network (But people mostly sell ad space on their web site ). They used algorithm to identify your space price and then any advertiser can buy your ad space to display your ad and hence, your income is generated. The payment schemes are check (minimum 25$), paypal(minimum 25$), TLA Voucher.
                          The link for sign up as publisher on Text Link Ad Network  is:
https://www.text-link-ads.com/r/advertiser/register 
        
     6.Amazon Association
                          That is you can associated with amazon.com and sell their different  kind product(mostly people sell Books,Mobile phones,Electronics, Computers & Accessories) and get up to 15 % of commission from selling things.
                          The link for sign up as publisher on Text Link Ad Network  is:
https://affiliate-program.amazon.com/             
           If  you like this than click here--

Tips to increase revenue from advertising on my website .

                    Remember my following points to increase revenue with advertisement your web site.


1. Provide Good content to your reader
                           If your content is good than it increase your visitor and hence it increase your revenue by different aspects like if  visitor on your site is increased as a result and if you are displaying ad of CPM based or Cost per click (CPC/PPC) than it increased your revenue.


2. Don't put ad at one corner
                           Mostly  All ad network count in the way that is  total click /total appearing of ad and than multiply it with price of single click and at last you get you money amount.As many visitor visit your web site and there is not hit on ad is generated than it will directly decrease your earning. 
                           That is not only display ad on web site but put it in middle of content and all other such position like on the side of scroll bar or other decent place from where you get more hit in Cost per click (CPC/PPC) model and as a result it increased your profit.
 

3.Use combination of more than one ad network
                           you can use more than one ad network to increase profit by putting advertisement of different ad network providers. By my point of you the best combination is BitVertiser and Google ad Sense that both follow Cost per click (CPC/PPC) model to pay thier publisher (who put ad on their web site ) .
 
4.Be selfish 
                          Identify  your needs also with your visitors need that make balance to increase your revenue that is put ad at such place that you think to become an earning area for you on your web site and do no think more about anything else.


5.Increase Traffic on your site
                         For this you can take help of social site to advertisement your site and as more people is aware about your site as more hit on your site increase and as a result your revenue is increase from web site advertisement.


6. Monitor your site
                          Use available several tools to monitor your site and to identify that change in your site is needed or not . Google adsense is best  ad network that provide you your own desk board to identify such things.