2014-04-05 Kun Ren
As we know, a Brownian motion is usually formulated as $$dx_t = \mu\,dt+\sigma\,dW_t$$ which is the continuous case of a random walk. In some cases, it is quite convenient to use this formulation to describe the characteristic of asset prices due to its highly unpredictable behavior. 继续阅读 »
2014-10-12 Klaus Ma
Problem Description: Given a sequence of integers a1, …, an and q queries x1, …, xq on it. For each query xi you have to count the number of pairs (l, r) such that 1 ≤ l ≤ r ≤ n and gcd(al, al + 1, …, ar) = xi. is a greatest common divisor of v1, v2, …, vn, that is equal to a largest positive integer that divides all 继续阅读 »
2013-06-02 Klaus Ma
For the performance tuning, the simplest way is to record how many time is elapsed in a function. The only difficulty we’re facing is that: there maybe many exit for a function. Thanks to C++’s constructor/deconstructor feature, it’s easy for developer to record the elsaped time. 继续阅读 »
2016-06-18 Lu Huang
本节实现的是使用OpenCV里自带的函数,计算程序的执行时间。 获取系统时钟数 获取系统时钟频率 实现过程 初始时间 不再赘述,代码如下。 ``` python time start t1 = cv2.getTickCount() ``` 执行代码 我这里执行的是之前绘制直方图的代码,请参考我的博客和GitHub。 结束时间 获取程序结束时间。 ```python time end t2 = cv2.getTickCount() ``` 计算执行秒数 利用getTickFrequency()获取时钟频率。 python t = (t2-t1)/cv2.getTickFrequency() print 继续阅读 »
2016-06-12 MoreFreeze
Last month I have study a course on Coursera, it is called Learning how to learn. It is a course that teach you how to learn efficiently. I made some notes about it and share here. (I just list each view point which I think is important, but I think I can figure out better way to show next time) 继续阅读 »
2016-08-17 craneyuan
具体操作 在eclipse中,打开Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素,参照下面注释规范对应设置即可 注释规范 文件(Files)注释标签 ```java /** * FileName: ${file_name} * @Description: ${todo} * @author: crane-yuan * @version V1.0 * Createdate: ${date} ${time} * Copyright: 继续阅读 »
2015-09-02 Klaus Ma
Thanks for your recognition, that makes me exciting and exciting! How time fast! It's really lucky for me to live in such a great team; I'd like to wok here with you for another 50 years, just not sure whether I can see screen clearly when I'm 80 years old :). 继续阅读 »
2015-11-09 litaotao
1. import module 流程 首先,明确一下 import module_name 和 from module_name import module_element 是两条可执行的语句。 其次,sys.modules 里记录了当前 run time 下所有已经导出的 module。 继续阅读 »
2016-11-15 ruki
Recently, xmake's description syntax has been enhanced to support two different grammar styles at the same time. The set-add style The key-val style The set-add style This is xmake's classic style, for example: lua target("test") set_kind("static") add_defines("DEBUG") add_files("src/*.c", "test/*.cpp") 继续阅读 »
2015-08-09 Klaus Ma
What Is Google C++ Mocking Framework? When you write a prototype or test, often it's not feasible or wise to rely on real objects entirely. A mock object implements the same interface as a real object (so it can be used as one), but lets you specify at run time how it will be used and what it should do (which methods 继续阅读 »