在线上Java程序中经常遇到进程程挂掉,一些状态没有正确的保存下来,这时候就需要在JVM关掉的时候执行一些清理现场的代码。Java中得ShutdownHook提供了比较好的方案。 JDK在1.3之后提供了Java Runtime.addShutdownHook(Thread hook)方法,可...
分类:
编程语言 时间:
2014-06-28 21:10:44
阅读次数:
378
/** * @version 2.0 * @author sharks*//** * Instruction * this version will use IO * apply file to store data * it just a table double click table ca.....
分类:
其他好文 时间:
2014-06-28 14:05:29
阅读次数:
300
一、什么是HOOK? "hook"这个单词的意思是“钩子”,"Windows Hook"是Windows消息处理机制的一个重要扩展,程序猿能够通过它来钩住(截获)感兴趣的消息,并用事先编好的一个函数(钩子过程)来处理这些消息!当然,这个处理是在消息到达目标窗体之前进行的。 钩子过程(hook p.....
模板方法模式(template method pattern) 详解本文地址: http://blog.csdn.net/caroline_wendy模板方法模式(template method pattern): 在一个方法中定义一个算法的骨架, 而将一些步骤延迟到子类中. 模板方法使得子类可以在不改变算法结构的情况下, 重新定义算法中的某些步骤.模板方法可以进行挂钩(hook), 钩子(hoo...
分类:
其他好文 时间:
2014-06-22 18:49:01
阅读次数:
227
Last night it took me about two hours to learn arrays. For the sake of less time, I did not put emphaises on the practice question, just now when reading the book, I found that some methods
referred...
分类:
其他好文 时间:
2014-06-22 17:14:10
阅读次数:
152
转自:http://blog.csdn.net/chenzujie/article/details/7011639先来看两段小程序:1)、#include #include void main(void){char *str1 = "just have fun";char *str2 = "happ...
分类:
编程语言 时间:
2014-06-20 15:12:51
阅读次数:
254
题目
Given a digit string, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is given below.
In...
分类:
其他好文 时间:
2014-06-18 12:03:16
阅读次数:
227
Structural Things
An
active class is a class whose objects own one or
more processes or threads and therefore can initiate control activity. An active class is just like a class except that it...
分类:
其他好文 时间:
2014-06-17 22:44:27
阅读次数:
310
题目
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" ...
分类:
其他好文 时间:
2014-06-17 21:34:00
阅读次数:
189
昨天尝试了一系列的可疑模块拦截试验,尽管最终的方案还存在着一些兼容性问题,但大体思路已经明确了:静态模块:使用 MutationObserver 扫描。动态模块:通过 API 钩子来拦截路径属性。提到钩子程序,大家会联想到传统应用程序里的 API Hook,以及各种外挂木马。当然,未必是系统函数,任...
分类:
其他好文 时间:
2014-06-17 15:55:53
阅读次数:
208