2017-03-09 YongHao Hu
go
``` var maxFileSize int64 = 10 * 1000 * 1000 //limit upload file to 10m if r.ContentLength > maxFileSize { http.Error(w, "request too large", http.StatusExpectationFailed) return } r.Body = http.MaxBytesReader(w, r.Body, maxFileSize) 继续阅读 »
2018-03-25 findneo
MISC Welcome 使用stegsolve打开,在Analyse->Stereogram Solver 处改变偏移即可。 Crypto streamgame1 streamgame1.py ```python from flag import flag assert flag.startswith("flag{") assert flag.endswith("}") assert len(flag)==25 def lfsr(R,mask): output = (R << 1) & 0xffffff i=(R&mask)&0xffffff lastbit=0 while i!= 继续阅读 »
2016-09-12 Borg
自学python的大四狗发现校招招python的屈指可数,全是C++、Java、PHP,但看了下社招岗位还是有的。于是为了更加确定有多少可能找到工作,就用python写了个爬虫爬取招聘信息,数据处理,最后用R语言进行可视化呈现。项目地址:Github Repo 求关注。 继续阅读 »
2013-04-28 Robert Zhang
more ```cpp include include using namespace std; void hartal(vector & days, int h) { int n = days.size(); int t = h - 1; while (t < n) { int r = t % 7; if (r != 5 && r != 6) days[t] = true; t += h; } } 继续阅读 »
2017-11-30 Vaniot
排序的定义及分类 排序的目标:将无序输入的数据按有序排列 计算的时间复杂度(最差、平均、和最好性能),依据列表(list)的大小(n)。一般而言,好的性能是O(n 3log n),且坏的性能是O(n2)。对于一个排序理想的性能是O(n)。仅使用一个抽象关键比较运算的排序算法总平均上总是至少需要O(n log n)。 内存使用量(以及其他电脑资源的使用) 稳定性:稳定排序算法会让原本有相等键值的纪录维持相对次序。也就是如果一个排序算法是稳定的,当有两个相等键值的纪录R和S,且在原本的列表中R出现在S之前,在排序过的列表中R也将会是在S之前。 依据排序的方法:插入、交换、选择、合并等等。 more 分类 1.按稳定性(在待排序的 继续阅读 »
2014-09-22 Kun Ren
Twelve days after the initial commit, pipeR tutorial is released! If you want to write R code fluently and process data elegantly, I strongly recommend that you read this tutorial which is designed to serve as a complete guide to pipeR package, including how it works with dplyr, rlist, and rvest with vivid examples. 继续阅读 »
2014-08-08 Kun Ren
(This post is rewritten to adapt to the latest release of pipeR) Pipeline is receiving increasing attention in R community these days. It is hard to tell when it begins but more people start to use it since the easy-and-fast dplyr package imports the magic operator %>% from magrittr, the pioneer package of pipeline op 继续阅读 »
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 继续阅读 »
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-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. 继续阅读 »