2014-08-23 Kun Ren
The motivation of pipeline operator is to make code more readable. In many cases, it indeed better organizes code so that the logic is presented in human-readable fluent style. In other cases, however, such operators can make things worse. 继续阅读 »
2014-05-31 Kun Ren
Gitbook is rather a relatively new concept on the web. It provides a user-friendly framework for authors to write and produce online books with beautiful illustrations and responsive interactions. It allows authors to write in Markdown syntax, which is very easy to learn and use, so that they can focus more on the cont 继续阅读 »
2014-07-29 Kun Ren
(This article is adapted to the latest version of rvest package.) In my previous post, I demonstrated how we can scrape online data using existing packages. 继续阅读 »
2014-08-06 Kun Ren
rlist 0.3 is released! This package now provides a wide range of functions for dealing with list objects. It can be especially useful when they are used to store non-tabular data. 继续阅读 »
2014-08-04 Kun Ren
pipeR 0.4 is released! Check it out at the project page. In this new version, two things happen. First, %>>% handles everything. Second, the introduction of Pipe object. 继续阅读 »
2014-08-16 Kun Ren
In pipeR 0.4 version, one of the new features is Pipe() function. The function basically creates a Pipe object that allows command chaining with $, and thus makes it easier to perform operations in pipeline without any external operator. 继续阅读 »
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. 继续阅读 »
2017-02-16 王财勇
极坐标变换定义 我们知道在二维坐标系中,有直角坐标系,也有极坐标系,二者的转换关系是: 如下图: 如图,直角坐标系的圆心与极坐标系的圆心一一对应,且圆弧BA可以通过极坐标变换到极坐标系$\rho=r$的一条直线上,实现由圆形到直线的转换。这往往在一些图像处理中很有用。 more 实际上,我们在图像处理中,往往还不是处理这样的圆弧,而更多的是处理圆环区域。如下, 同理,我们可以把(a)图中的圆环区域1234,转换成矩形区域(b).矩形区域与圆环存在一定的对应关系,区域转换满足:转换前后两区域顶点1234一一对应,转换后的矩形区域宽为圆环内外弧长之差$(\phi_2-\phi_1)\cdot R_2$,高为圆 继续阅读 »
2014-08-07 Kun Ren
Here is a quiz on magrittr and you may check if you are really good at using it. Since the CRAN version currently does not support nested ., it won't be interesting to make a quiz on that version. All the following examples are using the latest development version on GitHub. You can do the same test with the CRAN versi 继续阅读 »
2016-06-12 Lu Huang
本节实现的是使用OpenCV里自带的有关滚动条的函数,可以调节R、G、B三个数值,并显示颜色。 回调函数 滚动条设置 显示设置的颜色 实现过程 引用与创建空图 不再赘述,代码如下。 ``` python import cv2 import numpy empty image img = np.zeros((512, 512, 3), np.uint8) ``` 设置空的回调函数 作为滚动条值变化时的回调函数,这里不需要做任何设置,设置为pass: ```python callbacks def nothing(x): pass ``` 创建四个滚动条 其中三个分别为R、G和B,其值范围为0~25 继续阅读 »