Wednesday, June 27, 2012

propeller display totorial



what is propeller display...
watch this video...
http://www.youtube.com/watch?v=Jc6D_NTv4y0&feature=related




http://www.google.com/url?sa=t&rct=j&q=propeller%20clock%20tutorial&source=web&cd=3&sqi=2&ved=0CFUQFjAC&url=http%3A%2F%2Fobex.parallax.com%2Fobjects%2Fdownload%2Faux%2F67%2F&ei=xo_qT9e5IInNrQfmltm7BQ&usg=AFQjCNEZH0NxCwZ6U0uwNDE0A_CH-Qqy5w&cad=rja

Tuesday, June 26, 2012

LED cube

please see this video for a moment.....
It's marvelous..

www.youtube.com/watch?v=6mXM-oGggrM

you can make it by visit this tutorial...
http://www.instructables.com/id/Led-Cube-8x8x8/


also see this video... awesome..
http://www.youtube.com/watch?v=dVHP7Nhsn4E&feature=related

Selenium Automation Tool

selenium is an automation tool.It mean it's help to automate the test cases for your web application.

cool :)

find tutorial here....
http://www.mediafire.com/?fnef5uotl097sj8

Sunday, June 24, 2012

add String array into sql table using single query



  String []com={"heart-Q","spade-Q","heart-J","diamond-10"};

        String sql="INSERT INTO `tset`(`id`,`name`) VALUES(?,?)";

                PreparedStatement pstmt=con.prepareStatement(sql);
           
                for (int i = 0; i < com.length; i++) {
                     pstmt.setInt(1, i);
                     pstmt.setString(2, com[i]);
                     pstmt.addBatch();
       
        }
           
        pstmt.executeBatch();



Saturday, June 23, 2012

insert multiple values using single statement in sql


INSERT INTO 'tablename' ('column1', 'column2') VALUES
  ('data1', 'data2'),
  ('data3', 'data4'),
  ('data5', 'data6'),
  ('data7', 'data8');

Saturday, June 16, 2012

Make a 230V LED lamp

This is the circuit diagram for 230v LED lamp
Low power consumption.

This is how to make LED main lamp with emergency light feature




private recommendation : I make this circuit and it's work successfully... :)

Monday, June 4, 2012

how to backup and read samsung phone messages in a pc

1.open messages in your phone.
2.go to folder view (using bottom popup menu)
3.go to inbox.
4.backup  messages you want, to memory card or phone memory (using bottom popup menu)
5.go to sentbox.
6.backup  messages you want, to memory card or phone memory (using bottom popup menu)
7.connect your phone to pc via data cable or bluetooth (or use any other way to  get the copy of your backup messages to pc :)) and get a copy of your backup messages.

messages will be shown as .vmg extension

8.now download the samsung message reader.jar from below link.
http://www.mediafire.com/?xv9ow9nyqq5ml21

9.run the jar file by using the command java -jar Samsung_Message_reader.jar

then there will be open a window like this




10.Click on choose button.then there will be open window like this
















11.open the message directory.Then you can see the results


(this is a my own program.more user friendly versions coming soon...... I use this software to read my messages of my samsung GT-C6712 phone)

Sunday, June 3, 2012

add different colours to fonts in java


public class Main {
public static void main(String[] args) {
    JTextPane textPane = new JTextPane();
    StyledDocument doc = textPane.getStyledDocument();

    Style style = textPane.addStyle("I'm a Style", null);
    StyleConstants.setForeground(style, Color.red);

    try { doc.insertString(doc.getLength(), "BLAH ",style);} //print "BLAH" in red
    catch (BadLocationException e){}

    StyleConstants.setForeground(style, Color.blue);

      try { doc.insertString(doc.getLength(), "BLEH",style);}   //print "BLEH" in blue
    catch (BadLocationException e){}

    JFrame frame = new JFrame("Test");
    frame.getContentPane().add(textPane);
    frame.pack();
    frame.setVisible(true);
}
}

how to append string to textarea in another class


///second class which haven't text area
public class SecondClass {
    private TextArea tArea;
    SecondClass(TextArea ta) {
        tArea = ta;
    }
    void printOnTextArea() {
        System.out.println("*** printOnTextArea() ***");
        tArea.append("call from Second Class in printOnTextArea()");
    }
}


//main class which have the text area want to print string (when button2 click, print the string)

....
button2.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent arg0) {
        secondClass = new SecondClass(textArea);
        secondClass.printOnTextArea();
    }
});
....

compare two DATE in java


import java.util.Date;
public class CompareDate{

  public static void main(String[] args) {
 Date firstDate = new Date();
  try{
  Thread.sleep(1000);
  }catch(Exception e){
  }
  Date secondDate = new Date();
  System.out.println("FirstDate:="+firstDate);
  System.out.println("SecondDate:="+secondDate);
  if(firstDate.compareTo(secondDate) > 0)
  System.out.println("Second Date is initialized before First Date");
  else if(firstDate.compareTo(secondDate) < 0)
  System.out.println("Second Date is initialized after First Date");
  else
  System.out.println("First Date and Second Date are equal");
  }
}

How to convert String into java.util.Date



import java.text.*;
import java.util.*;

public class DateFormatTest
{
  public DateFormatTest()
  {
    String dateString = "2001/03/09";
   
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/mm/dd");
    Date convertedDate = dateFormat.parse(dateString);

    System.out.println("Converted string to date : " + convertedDate);
  }

  public static void main(String[] argv)
  {
    new DateFormatTest();
  }
}



}


more info goto:

http://www.roseindia.net/java/java-conversion/StringToDate.shtml

how to exit from a java program

using
System.exit(0);

get file name from file in java


import java.io.File;
 
  public class GetFileName  {
  public static void main(String[] args){
  File file = new File("C:\\Hello.txt");
  String fileName= file.getName();
  System.out.println("The File is "+fileName);
 }
 }