`
eyesmore
  • 浏览: 363896 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
  ByteBuffer 的 flip 方法,许多人都知道是写操作后,即将要开始读操作,需要flip一把。但是,compact方法,知道的人似乎比较少,它用在什么场景呢?本文就是回答这个问题的。   import java.nio.ByteBuffer; public class T { public static void main(String[] args) { ByteBuffer buf = ByteBuffer.allocate(8); buf.put((byte)0x00); buf.put((byte)0x01); buf.put ...
个人总结 Direct Buffer  vs.  Heap Buffer 1、 劣势:创建和释放Direct Buffer的代价比Heap Buffer得要高; 2、 区别:Direct Buffer不是分配在堆上的,它不被GC直接管理(但Direct Buffer的JAVA对象是归GC管理的,只要GC回收了它的JAVA对象,操作系统才会释放Direct Buffer所申请的空间),它似乎给人感觉是“内核缓冲区(buffer in kernel)”。Heap Buffer则是分配在堆上的,或者我们可以简单理解为Heap Buffer就是byte[]数组的一种封装形式,查看JAVA源代码实现, ...
ALTER TABLE `access` ADD `email` VARCHAR(64) DEFAULT NULL; ALTER TABLE `access` ADD UNIQUE INDEX uidx_email (email); ALTER TABLE `access` ADD `email` VARCHAR(64) DEFAULT NULL,ADD UNIQUE INDEX uidx_email (email); ALTER TABLE `access` DROP COLUMN email;
mysqldump --default-character-set=GBK -d --socket=/data/mysqlpayment/passport_3366/sock/mysql.sock  passport_database_name > script_passport.sql
mysql> grant all privileges on *.* to 'root'@'%' identified by 'root654321' with grant option; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
mysql> select FROM_UNIXTIME(regdate/1000,'%Y %D %M %h:%i:%s %x')as date from passport_user_info where userid = 10699366 \G                                              *************************** 1. row *************************** date: 2010 28th December 01:52:58 2010 1 row in set (0.00 sec)
<div> <embed src="http://player.youku.com/player.php/sid/XMjM5NTQxOTg4/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed> < ...

tcpdump

简单的TCPDUMP命令:   tcpdump -i eth0 -n  host 123.125.120.31 and dst port 80 | grep -v 60.247.30.1    
public static LoginAuthResponse parseAuthResult(String authResult) throws LoginAuthException {         LoginAuthResponse resMsg = new LoginAuthResponse();         String[] responseItems = authResult.split("[/^][$][/^]" );//分割符^&^要撇开Perl正则语法集保留字(可怕的笑脸)         if (responseItems == nu ...
用Linux命令行实现SQL的groupby 需求 给定一个sql脚本文件,里面全是insert操作,样例如下: insert into `passport_daily` (uid,loginname,ip,operatetime,result) values ('9454268',' 876334249@qq.com','222.168.129.186','1281801604225','register'); insert into `passport_d ...
http://stackoverflow.com/questions/224868/easy-simple-to-use-lru-cache-in-java Easy, simple to use LRU cache in java I know it's simple to implement, but I want to reuse something that already exist. Problem I want to solve is that I load configuration (from XML so I want to cache them) fo ...
request.setCharacterEncoding 关于编码   概述 从Servlet2.3开始,支持客户端内容协商。服务端内容协商,很早就有,服务端在返回的数据中通过Content-Type来指定返回的数据内容。在REST叫嚣的背景下,客户端也需要协商:例如通过PUT方法提交一段XML或JSON数据来更新服务端的一个对象。客户端可通过URL后缀名.xml或.json的方式来告诉服务端提交的数据类型;也可通过HTTP头的Content-Type来告之服务端提交的数据类型。   关于该问题的Blog 【 1 】给出了两个办法 http://forum.sp ...
  http://www.xml.com/pub/a/2005/12/21/json-dynamic-script-tag.html?page=1   http://www.xml.com/pub/a/2005/12/21/json-dynamic-script-tag.html?page=2   http://www.xml.com/pub/a/2005/11/09/fixing-ajax-xmlhttprequest-considered-harmful.html  
1 老是弹出Quick update error 这个问题的解决办法是关闭自动更新 Windows > Preferences > MyEclipse Enterprise Workbench > Community Essentials, 把选项 "Search for new features on startup"的前勾去掉即可. 2 关闭updating indexes Window > Preferences > Myeclipse Enterprise Workbench > Maven4My ...
在一个Action里面单独覆盖: (http://www.mkyong.com/struts2/struts-2-override-the-interceptor-parameters/) In Struts 2, you can set or override the interceptor parameters via the generic <param> tag. See below example   <package name="default" namespace="/" extends="st ...
Global site tag (gtag.js) - Google Analytics