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. 继续阅读 »
2017-06-18 MoreFreeze
上一篇 CH31 Basic Regular Expressions /和?,前者向后找,后者向前找 CH32 Case Study: Grep Operator, Part One :nnoremap g :grep -R .可以搜索,表示光标下的单词(包括连字符,比更大),之后可以用:cwindow查看quickfix窗口 以上还有一点要修改,如果光标在一个foo;ls下,使用后实际会执行ls命令,原理和SQL注入类似,所以需要用单引号保证字面值,:nnoremap g :grep -R '' . 但上面对于光标有单引号的不启作用,用:echom shellescape(expand(""))可以显示shellescap 继续阅读 »
2015-07-06 Lim Geng
如何正确实现addEvent? 分析一下传统addEvent的实现: // 传统写法大致上是这样 // 作者:Scott Andrew function addEvent(obj, type, fn, useCapture) { if (obj.addEventListener) { obj.addEventListener(type, fn, useCapture); return true } else if (obj.attachEvent) { var r = obj.attachEvent("on"+type, fn); return r; } else { ale 继续阅读 »
2018-03-10 findneo
ctf
baby_N1ES 题目提供两个文件,challenge.py和N1ES.py 。 虽然似乎在模仿AES,但是实际上明文和密文是一一映射的,复杂度不是恶心的100^48 而只是100*48 ,穷举是很快的。一个小障碍是N1ES.py 第71行的L, R = R, L ,这导致了明文的[0:8] 、[8:16]、[16:24]、[24:32]、[32:40]、[40:48] 分别对应的是密文的[8:16]、[0:8] 、[24:32]、[16:24]、[40:48]、 [32:40] ,写穷举脚本时需要注意。 crack.py ```python import base64,string,N1ES key = "wxy191i 继续阅读 »
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-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 继续阅读 »