Popular Posts
Enable SSL connection for Jsoup import org.jsoup.Connection; import org.jsoup.Jsoup; import javax.net.ssl.*; import java.io.IOException; import java.security.KeyManagement... Word break tag : <wbr/> (HTML5) The  HTML  <wbr>  tag  is  used  defines  a  potential  line  break  point  if  needed.  This  stands  for  Word  BReak. This  is  u... Build an OpenVPN server on android device Preparation An android device, in this case, Sony xperia Z is used Root permission required Linux Deploy for deploy i...
Stats
Current appliction location
System.AppDomain.CurrentDomain.BaseDirectory
Date format memo
Available Picture Formatting Codes
Specifier Description Examples
y One-digit year. If the year cannot be specified in one digit then two digits are used automatically. "7"
"95"
yy Two-digit year with leading zeroes if required. "07"
yyyy Full four-digit year. "2007"
g or gg Indicator of Anno Domini (AD). "A.D."
M One-digit month number. If the month cannot be specified in one digit then two digits are used automatically. "1"
"12"
MM Two-digit month number with leading zeroes if required. "01"
MMM Three letter month abbreviation. "Jan"
MMMM Month name. "January"
d One-digit day number. If the day cannot be specified in one digit then two digits are used automatically. "3"
"31"
dd Two-digit day number with leading zeroes if required. "03"
ddd Three letter day name abbreviation. "Wed"
dddd Day name. "Wednesday"
h One-digit hour using the twelve hour clock. If the hour cannot be specified in one digit then two digits are used automatically. "9"
"12"
hh Two-digit hour using the twelve hour clock with leading zeroes if required. "09"
H One-digit hour using the twenty four hour clock. If the hour cannot be specified in one digit then two digits are used automatically. "1"
"21"
HH Two-digit hour using the twenty four hour clock with leading zeroes if required. "09"
t Single letter indicator of AM or PM, generally for use with twelve hour clock values. "A"
"P"
tt Two letter indicator of AM or PM, generally for use with twelve hour clock values. "AM"
"PM"
m One-digit minute. If the minute cannot be specified in one digit then two digits are used automatically. "1"
"15"
mm Two-digit minute with leading zeroes if required. "01"
s One-digit second. If the second cannot be specified in one digit then two digits are used automatically. "1"
"59"
ss Two-digit second with leading zeroes if required. "01"
f Fraction of a second. Up to seven f's can be included to determine the number of decimal places to display. "0"
"0000000"
z One-digit time zone offset indicating the difference in hours between local time and UTC time. If the offset cannot be specified in one digit then two digits are used automatically. "+6"
"-1"
zz Two-digit time zone offset indicating the difference in hours between local time and UTC time with leading zeroes if required. "+06"
Execute a STRING as a query
MySQL:
BEGIN
    SET @sql = CONCAT('SELECT * FROM ', table_name, ' WHERE id = ', vID);
    PREPARE stmt FROM @sql;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt;
END
BEGIN
    PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
    SET @a = 3;
    SET @b = 4;
    EXECUTE stmt1 USING @a, @b;
    DEALLOCATE PREPARE stmt1;
END;
Create web service client cross SSL with eclipse
When creating web service cross SSL using eclipse, it occuss some error like below:

And it can't build the client source from this way.
To solve this problem, there are two ways to achieve it.
1. Connection wsdl using HTTP protocol.
and it seems to be a stupid way when this web service only provide HTTPS protocol.
2. Save the wsdl file from the url and use local file to create client.
a. Save the wsdl as a local file. (Such as myService.wsdl)
b. Copy the wsdl file to the project.
c. right click the wsdl file -> [ Web Services ] -> [ Generate Client ]
d. Congratulations. You got it.
Screen capture
import java.awt.AWTException;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class Case062 {

    /**
     * @param args
     * @throws AWTException
     * @throws IOException 
     */
    public static void main(String[] args) throws AWTException, IOException {
        // TODO Auto-generated method stub
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension screenSize = toolkit.getScreenSize();
        Rectangle screenRect = new Rectangle(screenSize);
        Robot robot = new Robot();
        BufferedImage image = robot.createScreenCapture(screenRect);
        ImageIO.write(image, "jpg", new File("capture.jpg"));
    }

}
LitJSON (C#) & org.json.me (Java)
LitJSON (C#) http://litjson.sourceforge.net/doc/manual.html#quickstart
org.json.me (Java) http://www.json.org/java/index.html