Skip to content

Instantly share code, notes, and snippets.

View Kuo-TingKai's full-sized avatar
🏠
Working from home

Kuo Ting-Kai Kuo-TingKai

🏠
Working from home
View GitHub Profile
@StuartGordonReid
StuartGordonReid / BinaryMatrixRank.py
Created August 25, 2015 15:57
Python implementation of the Binary Matrix Rank cryptographic test for randomness
def matrix_rank(self, bin_data: str, q=32):
"""
Note that this description is taken from the NIST documentation [1]
[1] http://csrc.nist.gov/publications/nistpubs/800-22-rev1a/SP800-22rev1a.pdf
The focus of the test is the rank of disjoint sub-matrices of the entire sequence. The purpose of this test is
to check for linear dependence among fixed length sub strings of the original sequence. Note that this test
also appears in the DIEHARD battery of tests.
:param bin_data: a binary string
@qnighy
qnighy / S1B.v
Created August 24, 2014 14:13
HoTT : Construct a fiber bundle (fiber space = Bool, base space = S1), and prove the total space is homotopy equivalent to S1 itself.
Require Import Overture PathGroupoids Equivalences Trunc HProp HSet.
Require Import types.Unit types.Paths types.Sigma types.Forall types.Arrow.
Require Import types.Bool types.Universe Misc.
Require Import hit.Circle.
Local Open Scope path_scope.
Local Open Scope equiv_scope.
Instance isequiv_negb' : @IsEquiv@{Type Type} Bool Bool negb.
Proof.
refine (@BuildIsEquiv
@sennajox
sennajox / Methods of disk io performance testing
Last active March 5, 2023 11:38
Methods of disk io performance testing
测试磁盘IO性能的几种方法
在磁盘测试中最关心的几个指标分别为:iops(每秒执行的IO次数)、bw(带宽,每秒的吞吐量)、lat(每次IO操作的延迟)。
当每次IO操作的block较小时,如512bytes/4k/8k等,测试的主要是iops。
当每次IO操作的block较大时,如256k/512k/1M等,测试的主要是bw。
1. 最简单的dd
dd是linux自带的磁盘读写工具,可用于测试顺序读写。
一般而言,磁盘读写有两种方式:BufferIO、DirectIO,DirectIO可以更好的了解纯磁盘读写的性能。
1.1 dd测试DirectIO