Introspector 是一个专门处理bean的工具类.用来获取Bean体系里的 propertiesDescriptor,methodDescriptor.
要理解这个,就要理解下面几个议题.
*bean是啥?
普通的class 可能有 computerAges(){ }等方法.
Bean是 一个field ,有 get 或者set. 除了这些别无其他.
...
分类:
其他好文 时间:
2014-11-21 18:45:21
阅读次数:
228
Introspector 是一个专门处理bean的工具类.用来获取Bean体系里的 propertiesDescriptor,methodDescriptor.
要理解这个,就要理解下面几个议题.
*bean是啥?
普通的class 可能有 computerAges(){ }等方法.
Bean是 一个field ,有 get 或者set. 除了这些别无其他.
...
分类:
其他好文 时间:
2014-11-21 18:44:59
阅读次数:
231
哇哦,感觉有点难哦,三个骰子,分别具有k1,k2,k3个面,抛骰子,若向上的一面分别对应为a,b,c,那么得分归0,否则得分加上三个骰子向上那一面数字之和,求得分超过n的时候抛骰子的次数的期望
一开始很容易想到常规的做法,以目标状态为边界,当前状态到目标状态所需要的期望为方程,dp[i]代表 当前到目标分数的期望,这是发现状态转移是这个样子的
dp[i] = dp[0] * p0 + ...
分类:
其他好文 时间:
2014-11-21 18:44:49
阅读次数:
203
Introspector 是一个专门处理bean的工具类.用来获取Bean体系里的 propertiesDescriptor,methodDescriptor.
要理解这个,就要理解下面几个议题.
*bean是啥?
普通的class 可能有 computerAges(){ }等方法.
Bean是 一个field ,有 get 或者set. 除了这些别无其他.
...
分类:
其他好文 时间:
2014-11-21 18:45:38
阅读次数:
320
哇哦,感觉有点难哦,三个骰子,分别具有k1,k2,k3个面,抛骰子,若向上的一面分别对应为a,b,c,那么得分归0,否则得分加上三个骰子向上那一面数字之和,求得分超过n的时候抛骰子的次数的期望
一开始很容易想到常规的做法,以目标状态为边界,当前状态到目标状态所需要的期望为方程,dp[i]代表 当前到目标分数的期望,这是发现状态转移是这个样子的
dp[i] = dp[0] * p0 + ...
分类:
其他好文 时间:
2014-11-21 18:43:27
阅读次数:
232
在《C++ Primer》第五版中,关于模版实参推断,讲述了如下内容
1.类型转换与模版类型参数
2.函数模版的显式实参
3.尾置返回类型
4.类型转换
5.函数指针和实参推断
6.模版参数推断和引用
书中留给大家一些习题,要求大家给出模版参数的推断类型,参见16.2.5节练习。问题是如何验证我们的答案是否正确,我在这里给出一段代码,抛砖引玉!
template voi...
分类:
编程语言 时间:
2014-11-21 18:42:59
阅读次数:
363
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the largest ...
分类:
其他好文 时间:
2014-11-21 18:43:17
阅读次数:
196
log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: /opt/logs/log.log (没有那个文件或目录) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.ja...
分类:
其他好文 时间:
2014-11-21 18:44:59
阅读次数:
230
log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: /opt/logs/log.log (没有那个文件或目录) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.ja...
分类:
其他好文 时间:
2014-11-21 18:42:40
阅读次数:
205
log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: /opt/logs/log.log (没有那个文件或目录) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.ja...
分类:
其他好文 时间:
2014-11-21 18:43:13
阅读次数:
205
log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: /opt/logs/log.log (没有那个文件或目录) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.ja...
分类:
其他好文 时间:
2014-11-21 18:44:20
阅读次数:
288
log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: /opt/logs/log.log (没有那个文件或目录) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.ja...
分类:
其他好文 时间:
2014-11-21 18:41:13
阅读次数:
240
log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: /opt/logs/log.log (没有那个文件或目录) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.ja...
分类:
其他好文 时间:
2014-11-21 18:42:59
阅读次数:
324
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the largest ...
分类:
其他好文 时间:
2014-11-21 18:41:59
阅读次数:
174
TopK问题,即寻找最大的K个数,这个问题非常常见,比如从1千万搜索记录中找出最热门的10个关键词.
方法一:
先排序,然后截取前k个数.
时间复杂度:O(n*logn)+O(k)=O(n*logn)。
方法二:
最小堆.
维护容量为k的最小堆.根据最小堆性质,堆顶一定是最小的,如果小于堆顶,则直接pass,如果大于堆顶,则替换掉堆顶,并heapify整理堆,其中heapify...
分类:
编程语言 时间:
2014-11-21 18:42:10
阅读次数:
225
awk是Unix环境下一种非常好的语言,适合于文本处理和报表生成,它还有许多精心设计的特性,允许进行特殊技巧程序设计。对于短消息来说,比如处理话单文件,使用awk就非常方便,鉴于测试组大部分人对awk并不熟悉,因此仅以本文作一个提纲挈领的介绍,希望对初学者迅速掌握awk有所帮助。
2 第一部分:入门 2.1 第一个awk程序
所有的编程书籍都是通过一个“Hello wo...
分类:
其他好文 时间:
2014-11-21 18:42:10
阅读次数:
130
编译一个能在 arm 平台上用的动态库,结果报错如下:
relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
./obj/xxx.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
其实错误信息已经给出解决办法了,加...
分类:
其他好文 时间:
2014-11-21 18:40:09
阅读次数:
3187