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 继续阅读 »
2020-10-05 Lingxian Kong
This blog was sent to openstack-discuss mailing list originaly. As the official Victoria release is approaching and it has been a long time silence for Trove in the upstream, I think it's good time for me as the Trove PTL for the last 3 dev cycles to have a project update. The things that will be described below have 继续阅读 »
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 继续阅读 »
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. 继续阅读 »
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。 继续阅读 »
2020-11-24 ruki
xmake is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the configuration syntax is more Concise and intuitive, very friendly to novices, can get started quickly in a short time, allowing users to focus more on the actual projec 继续阅读 »
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 继续阅读 »