现在位置: 首页 > QCDLonnyqb发表的所有文章
  • 05月
  • 20日
综合 ⁄ 共 21052字 评论关闭
前段时间在一个项目的性能测试中又发生了一次OOM(Out of swap sapce),情形和以前网店版的那次差不多,比上次更奇怪的是,此次搞了几天之后啥都没调整系统就自动好了,死活没法再重现之前的OOM了!问题虽然蹊跷,但也趁此机会再次对JVM堆模型、GC垃圾算法等进行了一次系统梳理; 基本概念 堆/Heap JVM管理的内存叫堆;在32Bit操作系统上有4G的限制,一般来说Windows下为2G,而Linux 下为3G;64Bit的就没有这个限制。 JVM初始分配的内存由-Xms指定,默认是物理内存的1/64但小于1G。 JVM最大分配的内存由-Xmx指定,默认是物理内存......
阅读全文
  • 05月
  • 04日
综合 ⁄ 共 2989字 评论关闭
解读Google分布式锁服务 迟炯 背景介绍 在2010年4月,Google的网页索引更新实现了实时更新,在今年的OSDI大会上,Google首次公布了有关这一技术的论文。 在此之前,Google的索引更新,采用的的批处理的方式(map/reduce),也就是当增量数据达到一定规模之后,把增量数据和全量索引库Join,得到最新的索引数据。采用新的索引更新系统之后,数据的生命周期缩短了50%,所谓的数据生命周期是指,数据从网页上爬下来,到展现在搜索结果中这段时间间隔,但是正如Google所强调的,这一系统仅仅是为增量更新所建立的,并没有取......
阅读全文
  • 10月
  • 04日
编程语言 ⁄ 共 687字 评论关闭
Linux时间戳、日期转换函数: #include <stdio.h> #include <iostream> #include <string> #include <time.h> using namespace std; time_t date_to_timestamp(char *date, char *pfmt) { struct tm t; strptime(date, pfmt, &t); time_t tt = mktime(&t); return tt; } string timestamp_to_date(time_t tt) { struct tm *t = localtime(&tt); char dateBuf[128]; snprintf(dateBuf, sizeof(dateBuf), "%04d-%02d-%02d %02d:%0......
阅读全文
  • 05月
  • 02日
综合 ⁄ 共 2258字 评论关闭
 C. Appleman and Toastman time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Appleman and Toastman play a game. Initially Appleman gives one group of n numbers to the Toastman, then they start to complete the following tasks: Each time Toastman gets a group of numbers, he sums up all the numbers and adds this sum to the score. Then he gives the group to the Appleman. Each time Appleman gets a group consisting of ......
阅读全文
  • 04月
  • 22日
综合 ⁄ 共 1082字 评论关闭
02-06 10:58:39.207: E/InputEventReceiver(764): Exception dispatching input event.02-06 10:58:39.207: E/MessageQueue-JNI(764): Exception in MessageQueue callback:handleReceiveCallback02-06 10:58:39.377: E/MessageQueue-JNI(764): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(16908298, class android.wid......
阅读全文
  • 03月
  • 30日
综合 ⁄ 共 1579字 评论关闭
在使用red5+flash做rpg游戏开发的时候有些功能是需要服务器来提供的,如最简单的多人用户上线,当一个用户上线后后要通知所有其他的用户,这个时候就需要red5去获取所用链接的客户端,然后通知客户端用户上线。当用户下线的时候,也是同样的需要red5的支持。 我在开发的时候是使用red5 0.8的版本。 下面详细介绍一下具体的实现。 ApplicationAdapter是客户端与red5连接的基础 ...在使用red5+flash做rpg游戏开发的时候有些功能是需要服务器来提供的,如最简单的多人用户上线,当一个用户上线后后要通知所有其他的用户,这个时候就需......
阅读全文
  • 03月
  • 21日
综合 ⁄ 共 1787字 评论关闭
.tar解包:tar xvf FileName.tar 打包:tar cvf FileName.tar DirName(注:tar是打包,不是压缩!) ---------------------------------------------.gz 解压1:gunzip FileName.gz 解压2:gzip -d FileName.gz 压缩:gzip FileName.tar.gz 和 .tgz 解压:tar zxvf FileName.tar.gz 压缩:tar zcvf FileName.tar.gz DirName ---------------------------------------------.bz2 解压1:bzip2 -d FileName.bz2 解压2:bunzip2 FileName.bz2 压缩: bzip2 -z FileName.tar.bz2 解压:tar jxvf FileName.tar.bz2 压缩:tar jcvf File......
阅读全文
  • 02月
  • 14日
综合 ⁄ 共 1220字 评论关闭
SilkTest支持两种测试模式,一种是用classic agent,另一种就是用我们今天要介绍的open agent. open agent可以提供和classic agent差不多的录制回放功能。它们主要的差别在于所支持的对象类型,了解这些差别对于需要手工编辑的test case很有用。 classic agent支持的应用类型包括: Windows Forms Java AWT applications Java SWT/RCP applications Java Swing applications Windows API-based client/server applications Powerbuilder applications web applications Web with ActiveX/Visual Basic applications Java Applet......
阅读全文
  • 01月
  • 09日
综合 ⁄ 共 6396字 评论关闭
Android DrawText字符串的绘制 文章分类:Java编程 Java代码 1. package com.Aina.Android; 2. 3. import java.util.Vector; 4. 5. import android.graphics.Canvas; 6. import android.graphics.Color; 7. import android.graphics.Paint; 8. import android.graphics.Paint.FontMetrics; 9. import android.view.KeyEvent; 10. 11. public class TextUtil { 12. 13. private int mTextPosx = 0;// x坐标 14. private int mTextPosy = 0;// y坐标 15. private int mTextWidth = 0;// 绘制宽度 16. private int mT......
阅读全文
  • 12月
  • 24日
综合 ⁄ 共 0字 评论关闭
  • 10月
  • 26日
综合 ⁄ 共 7622字 评论关闭
Apache Cordova Apache Cordova是一套设备API,允许移动应用的开发者使用JavaScript来访问本地设备的功能,比如摄像头、加速计。它可以与UI框架(如jQuery Mobile 或 Dojo Mobile 或 Sencha Touch)等相结合使用,这些UI框架可以使用HTML、CSS和JavaScript开发智能手机应用。 在使用Cordova API时,应用程序的构建可以无需本地代码(如Java或对象C等),使用的是Web技术 由于这些JavaScript API在多个设备平台上是一致的,而且是基于Web标准创建的,因此应用程序的移植很方便,基本不做什么改变 Cordova提供了一套统一的Java......
阅读全文
  • 10月
  • 25日
综合 ⁄ 共 662字 评论关闭
0. 给朋友发了个DEMO,收到提示:丢失 msvcr100d.dll 1. 一看是运行库文件,赶紧让朋友下载并安装vc++ 2010 redistribution,朋友反馈还是提示丢失这个dll文件 2. 把我本地的这个dll拷贝到他机器里,提示成功 3. 太奇怪了啊,这玩意就是vc++运行库文件啊,为啥装了redistribution还不成呢 4. 我注意到了这个文件名的100后面带着一个d字,让我想起了debug~ 5. 在VC里面找设置,终于发现了:Property->C/C++->Code Generation->Runtime Library 6. 总结: msvcr100d.dll,这个dll对应的是C++编译器的Code Generati......
阅读全文