Skip to content

Instantly share code, notes, and snippets.

View lizhongz's full-sized avatar

Lizhong lizhongz

  • Google
  • Mountain View
View GitHub Profile
@lizhongz
lizhongz / simple_bloom_filter.go
Last active August 29, 2015 14:17
A simple bloom filter written for learning Cassandra
/*
This code is written for learning Cassandra's key-value storage,
where Bloom Filter is used to check the existence of a key in a replica.
*/
package main
import "fmt"
import "math"
/*
@lizhongz
lizhongz / finger_table.go
Last active August 29, 2015 14:18
Calculate figure table of nodes in Chord protocol
/* Calculate finger tables of nodes in Chord Protocol */
package main
import "fmt"
import "math"
/*
cacl_finger_table calculates the finger table of a node in
Chord procotol.
Parameters
@lizhongz
lizhongz / decorator.cpp
Last active September 13, 2023 08:55
C++ decorator measuring the execution time of a function
#include <functional>
#include <chrono>
#include <iostream>
template <class> struct ExeTime;
// Execution time decorator
template <class R, class... Args>
struct ExeTime<R(Args ...)> {
public:
@lizhongz
lizhongz / exec_time_decorator.py
Created October 9, 2015 15:37
Python Execution Time Decorator
def exec_time(func):
def inner(*args, **kwargs):
import time
st = time.time()
ret = func(*args, **kwargs)
et = time.time() - st
print "execution time %s seconds" %(et)
return ret
return inner

Keybase proof

I hereby claim:

  • I am lizhongz on github.
  • I am lizhong (https://keybase.io/lizhong) on keybase.
  • I have a public key ASCIyHJRMpspVakexuSO8DEN3TRumkgtET4KKi_qDsuWFwo

To claim this, I am signing this object: