摘要: 为书面语言提供统一的字符编码用十六进制(hexadecimal)表示一个字符16bitshttps://docs.oracle.com/javase/tutorial/i18n/text/unicode.html 阅读全文
posted @ 2015-12-01 14:15 qiangzhu 阅读(150) 评论(0) 推荐(0) 编辑
摘要: xml源码如下 ... 阅读全文
posted @ 2014-05-05 16:05 qiangzhu 阅读(2169) 评论(3) 推荐(0) 编辑
摘要: shuts down an ExecutorService in two phases, first by calling shutdown to reject incoming tasks, and then calling shutdownNow, if necessary, to cancel any lingering tasks: void shutdownAndAwaitTermination(ExecutorService pool) { pool.shutdown(); // Disable new tasks from being submitted try { ... 阅读全文
posted @ 2014-04-10 14:21 qiangzhu 阅读(314) 评论(0) 推荐(1) 编辑
摘要: private static final int CONNECTION_TIMEOUT = 10000; public static String doHttpGet(String serverURL) throws Exception { HttpParams httpParameters = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParameters, CONNECTION_TIMEOUT); HttpConnectionParams.... 阅读全文
posted @ 2014-03-25 18:12 qiangzhu 阅读(14472) 评论(0) 推荐(0) 编辑
摘要: 如何保证只有一个线程在运行,在启动线程的时候停止之前的线程?实例如下: private volatile Thread udpSendThread;线程:class UdpSender extends Thread { @Override public void run() { if (udpSendThread == null) { return; } // other work } }启动线程: private void startUdpSe... 阅读全文
posted @ 2014-03-11 17:15 qiangzhu 阅读(458) 评论(0) 推荐(0) 编辑
摘要: Fragment弹出toast,时不时出现getActivity()空指针,具体原因未查到。解决办法: if (null == fragment || !fragment.isAdded()) { return; }原地址http://stackoverflow.com/questions/11631408/android-fragment-getactivity-sometime-returns-null 阅读全文
posted @ 2014-03-11 17:06 qiangzhu 阅读(7497) 评论(0) 推荐(0) 编辑
摘要: public class WifiAutoConnectManager {private static final String TAG = WifiAutoConnectManager.class.getSimpleName();WifiManager wifiManager; // 定义几种加密方式,一种是WEP,一种是WPA,还有没有密码的情况 public enum WifiCipherType { WIFICIPHER_WEP, WIFICIPHER_WPA, WIFICIPHER_NOPASS, WIFICIPHER_INVALID } // 构造函数 ... 阅读全文
posted @ 2014-02-25 14:39 qiangzhu 阅读(34204) 评论(3) 推荐(1) 编辑
摘要: update user set name= '**' where account = 'pon' Error Code: 1175.You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconnect. 0.000 secSET SQL_SAFE_UPDATE 阅读全文
posted @ 2013-04-15 11:12 qiangzhu 阅读(312) 评论(0) 推荐(0) 编辑
摘要: org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 23 in the generated java fileThe method getJspApplicationContext(ServletContext) is undefined for the type JspFactoryStacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandle 阅读全文
posted @ 2013-04-15 10:58 qiangzhu 阅读(20769) 评论(2) 推荐(2) 编辑
摘要: 解决办法,为远程创建用户并给予权限mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> WITH GRANT OPTION;mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';mysql& 阅读全文
posted @ 2013-04-14 21:11 qiangzhu 阅读(5363) 评论(0) 推荐(0) 编辑