Java Éú³ÉÑéÖ¤Âë
javaÉú³ÉÑéÖ¤Âë
ÓкܶàÖÖ·½Ê½£¬ÔÚÍøÉÏÒ²Óкܶà´úÂ룬µ«ÊÇÄÇЩÉú³ÉµÄЧ¹û£¬¸Ð¾õ¶¼²»ÊÇÌØ±ðºÃ£¬ËùÒÔÎÒÔÚËûÃǵĻù´¡ÉϸÄÁ¼ÁËһЩ¡£
µ«ÄÜ»¹¿ÉÒÔÓÃjmagick ,Éú³ÉºÜ¶àºÜìŵÄÑéÖ¤Âë¡£¹ýÁ½ÌìÑо¿Ï¡£ÏȰÑ×î½ü¸ÄµÄÕâ¸ö·¢²¼Ï¹©ÅóÓÑÃDzΡ£
¿ÉÒÔÏÈ¿´¿´ÑùÀý¡£×î½üÔÚ×öÕâ¸öÍøÕ¾¡£´ó¼ÒÓÐÐËȤ¿ÉÒԽн»Á÷¡£Ô¼»á360 ÍøÖ·: www.yuehui360.com
ÑéÖ¤ÂëЧ¹û¿ÉÒÔÔÚ
Ô¼»á360×¢²áÒ³Ãæ http://www.yuehui360.com/register.htm ²é¿´Ð§¹û
ͼƬЧ¹û£º
´úÂëÈçÏ£º
package com.idate.util;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
/**
* @author lqinglong@yahoo.cn
* Ô¼»á360 www.yuehui360.com
*/
public class CodeHelper {
private static final CodeHelper generator = new CodeHelper();
private final String ATTRIBUTE_NAME = "code";
//ͼƬµÄ¿í¶È
private final int WIDTH = 35;
//ͼƬµÄ¸ß¶È
private final int HEIGHT = 55;
//×Ö·û´®³¤¶È
private final int CODE_LENGTH = 4;
//Ëæ»ú×Ö·û´®·¶Î§
private final String RAND_RANGE = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" ;
private final char[] CHARS = RAND_RANGE.toCharArray();
private Random random = new Random();
private CodeHelper(){
//
}
public static CodeHelper getInstance(){
return generator;
}
/**
* Éú³ÉËæ»ú×Ö·û´®
* @return Ëæ»ú×Ö·û´®
*/
private String getRandString(){
StringBuilder sb = new StringBuilder();
for (int i = 0; i < CODE_LENGTH; i++)
sb.append(CHARS[random.nextInt(CHARS.length)]);
return sb.toString();
}
Ïà¹ØÎĵµ£º
ÎÒ½ñÌìѧϰÁËÐìÀÏʦ½²µÄjpa£¬ÎÒ×öÁ˼òµ¥µÄ±Ê¼Ç£º
JPA(Java Persistence API)ÊÇSun¹Ù·½Ìá³öµÄJava³Ö¾Ã»¯¹æ·¶¡£ËüΪJava¿ª·¢ÈËÔ±ÌṩÁËÒ»ÖÖ¶ÔÏó/¹ØÏµÓ³É乤¾ßÀ´¹ÜÀíJavaÓ¦ÓÃÖеĹØÏµÊý¾Ý¡£ËûµÄ³öÏÖÖ÷ÒªÊÇΪÁ˼ò»¯ÏÖÓеij־û¯¿ª·¢¹¤×÷ºÍÕûºÏORM¼¼Êõ£¬½áÊøÏÖÔÚHibernate¡¢TopLinkµÈORM¿ò¼Ü¸÷×ÔΪӪµÄ¾ÖÃæ¡£ÖµµÃ×¢ÒâµÄÊÇ£¬JP ......
ÎÒ½ñÌìѧϰÁËÐìÀÏʦ½²µÄUMLͳһ½¨Ä£ÓïÑÔ£¬ÎÒ×öÁ˼òµ¥µÄ±Ê¼Ç£º
Èí¼þÉúÃüÖÜÆÚ: Èí¼þµÄ²úÉúÖ±µ½±¨·ÏµÄÉúÃüÖÜÆÚ
Èí¼þÉúÃüÖÜÆÚÄÚÓÐÎÊÌⶨÒå, ¿ÉÐÐÐÔ·ÖÎö, ×ÜÌåÃèÊö, ϵͳÉè¼Æ,±àÂë, µ÷ÊԺͲâÊÔ, ÑéÊÕÓëÔËÐÐ, ά»¤Éý¼¶µ½·ÏÆúµÈ½×¶Î
Èí¼þ¹¤³Ì¿ÉÒÔ·ÖΪÈý¸ö´óµÄ½×¶Î:ÐèÇó; Éè¼Æ; ²âÊÔÓëά»¤
Èí¼þµÄÉúÃüÖÜÆÚÏê½â£º
ÎÊÌâµ ......
javaÈ¥³ý×Ö·û´®ÖеĿոñ¡¢»Ø³µ¡¢»»Ðзû¡¢ÖƱí·û
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringUtil {
public static void replaceBlank()
{
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
String str="I am a, I am Hello ok, \n new line ffdsa!";
System.out.p ......
URLµÄopenConnection()·½·¨½«·µ»ØÒ»¸öURLConnection¶ÔÏ󣬸öÔÏó±íʾӦÓóÌÐòºÍ URL Ö®¼äµÄͨÐÅÁ´½Ó¡£³ÌÐò¿ÉÒÔͨ¹ýURLConnectionʵÀýÏò¸ÃURL·¢ËÍÇëÇó¡¢¶ÁÈ¡URLÒýÓõÄ×ÊÔ´¡£
ͨ³£´´½¨Ò»¸öºÍ URL µÄÁ¬½Ó£¬²¢·¢ËÍÇëÇó¡¢¶ÁÈ¡´Ë URL ÒýÓõÄ×ÊÔ´ÐèÒªÈçϼ¸¸ö²½Ö裺
£¨1£©Í¨¹ýµ÷ÓÃURL¶ÔÏóopenConnection()·½·¨À´´´½¨URLConnectio ......
1.
Ôö¼ÓJavaÓ¦ÓÃ
ÔÚandroid_2.1/packages/appsÔö¼Ó¸ÃÏîÄ¿£»
ÔÚbuild/target/product/generic.mkµÄPRODUCT_PACKAGESºóÃæÔö¼Ó¶ÔÓ¦°üµÄÃû×Ö¡£
1.1
´ÓÃüÁîÐ ......