
代码分享
文章平均质量分 65
Soonyang Zhang
书读半本,浅尝辄止,天资鲁钝,岁月蹉跎,一事无成。
展开
-
AF_XDP socket 测试
linux xdp例子测试原创 2023-02-26 20:08:11 · 1541 阅读 · 1 评论 -
xdp测试例子
xdp,ebf测试原创 2023-02-07 22:16:50 · 1558 阅读 · 0 评论 -
MovieLens数据集处理
movieLens数据集处理,验证zipf分布。原创 2023-01-26 21:03:17 · 817 阅读 · 0 评论 -
招标网站信息爬取
招标网站爬取,采用python语言实现的爬虫原创 2022-11-30 09:47:43 · 4023 阅读 · 1 评论 -
linux守护进程示例-linux daemon and singal handler
Introduction 为什么要用守护进程,参考博客[1]。Code Show you my fucking source code. Code is copied from here and there, referece form nginx [2], netdata [3], mosquitto [4].turtle.c/*****************************Project:turtleAuthor:zsyCreate:2021/03/09To test dae原创 2021-03-10 10:09:53 · 566 阅读 · 0 评论 -
python tcp epoll server
tcp_epoll_server.py# author zsy 865678017@qq.com# 2021/01/26#https://www.jianshu.com/p/cdfddb026db0#https://github.com/fschr/simpletcp/blob/master/simpletcp/serversocket.pyimport signal, osimport threadingimport socketimport selectimport errnoc原创 2021-01-26 20:33:04 · 261 阅读 · 0 评论 -
mininet multihomed topology
multihomed topology created in mininet to test the performance for mptcp or multipath quic. 7h.py#!/usr/bin/python# author zsy# 2020.12.11#from mininet.topo import Topofrom mininet.net import Mininetfrom mininet.cli import CLIfrom mininet.link原创 2020-12-11 15:16:02 · 352 阅读 · 0 评论 -
Evaluation LEDBAT congestion control on ns3
LEDBAT[1]是Bittorrent客户端上使用的一种拥塞控制机制。大公司在开发基于UDP的网络应用时,应该建立拥塞控制机制。因为网络中的数据流应该遵从以下原则:不给当前的网络制造麻烦;保证数据流的带宽公平性,不恶意竞争带宽。 P2P应用不知道安慰了多少宅男寂寞无聊的夜晚,在互联网中的流量中p2p流量中占有很大的份额。以至于当年有些ISP要封锁P2P应用。当年Bittorrent要使用UDP进行数据传输时,在网络中引起了骚动。鉴于Bittorrent在网络中占用的流量,再加上无任何拥塞控制机制的UD原创 2020-05-27 09:31:43 · 655 阅读 · 0 评论 -
bounded zipf distribution-truncated Zipf distribution
zipf分布的python实现,参考了[1],[2]。[2]是一个在NDN网络中关于cache的一个仿真器。 code:import numpy as npimport randomimport matplotlib.pyplot as pltN = 7x = np.arange(1, N+1)alpha=1.1pdf=x**(-alpha)pdf/=pdf.sum()cdf=...原创 2020-01-06 21:16:18 · 262 阅读 · 0 评论 -
Poisson point processes-泊松点过程代码
在矩形中,产生符合泊松分布的点,代码实现参考[1]。possion_point_rectangle.pyimport randomimport timeimport numpy as npimport matplotlib.pyplot as pltxMin=0;xMax=1;yMin=0;yMax=1;xDelta=xMax-xMin;yDelta=yMax-yMin; #r...原创 2019-12-29 16:58:20 · 2822 阅读 · 4 评论 -
fmp4码率统计
我使用的视频是peaky blinders的S01E01,文件格式为mkv,大小550KB,时长56min,1024x544。 使用ffmpeg将mkv重新打包为mp4。ffmpeg -i input.mkv -y -vcodec copy -acodec copy output.mp4 使用ffmpeg,将mp4生成m4s的小文件,需要重新编码。每两秒生成一个片,编码速率设置为2Mbp...原创 2019-12-06 19:49:09 · 490 阅读 · 0 评论 -
harmonic mean-调和平均数
调和平均数的公式[1]:H=n1x1+1x2+1x3+...+1xnH=\frac{n}{\frac{1}{x_1}+\frac{1}{x_2}+\frac{1}{x_3}+...+\frac{1}{x_n}}H=x11+x21+x31+...+xn1n 定义很简单,具体有什么应用价值呢,网上的博客没有说。[2]是研究dash视频传输的,就是怎么根据预测的带宽,去请求合...原创 2019-12-05 21:15:39 · 3104 阅读 · 2 评论 -
multi-arm bandit模型代码分享
实现了一个multiarm bandit的代码,主要实现的算法:ϵ\epsilonϵ-greedy和UCB,Thompson Sampling。UCB的选择依据为:a=maxaIaIa=r‾a+σa×2×log(T)N(a)a=\max_a I_a \\ I_a=\overline r_a+\sigma_a\times \sqrt{\frac{2\times log(T)}{N(a)}}...原创 2019-12-03 22:49:27 · 1025 阅读 · 0 评论 -
gnuplot errorbar
data1.txtexperiments avg min max title11 1.2 1.1 1.32 1.4 1.3 1.63 1.5 1.3 1.74 1.5 1.2 1.75 1.1 0.9 1.3 data2.txtexperiments avg min max title21 1.5 1.3 1.7 2 1.2 1....原创 2019-10-30 09:03:25 · 1165 阅读 · 0 评论 -
visual studio在主工程中导入静态库工程
又他妈的一个上午浪费到这样一个无意义的事情中了。fuck!原创 2018-10-09 16:12:50 · 1141 阅读 · 1 评论 -
分离出文本中c++后缀文件cc和h名称
有个需求,有一堆源码,需要给这些代码写cmake文件。一个文件名的复制粘贴太慢。于是就想到采用awk的方式,对文本中的数据进行处理。将c++中的两种后缀文件分离出来。 -awk 匹配文件后缀BEGIN{ cline_counter=0; hline_counter=0;}{string=$1;if(match(string,"[.]cc")){ string...原创 2018-05-19 16:01:09 · 594 阅读 · 0 评论 -
一个丢包率计算程序
根据数据包序号,统计丢包率原创 2018-01-07 11:43:45 · 8877 阅读 · 2 评论