Skip to content

Instantly share code, notes, and snippets.

View ericxtang's full-sized avatar

Eric Tang ericxtang

View GitHub Profile
@ericxtang
ericxtang / gist:1130273
Created August 7, 2011 10:21
k difference for interview street challenge
nk = STDIN.gets.split(" ")
nums_str = STDIN.gets.split(" ")
n = nk[0].to_i
k = nk[1].to_i
nums = nums_str.collect{|num| num.to_i}.sort!
h = {}
count = 0
pragma solidity ^0.4.2;
import "CodeStorage.sol";
contract SampleContract {
address csAddr;
string sourceUrl;
function SampleContract(address _csAddr, string _sourceUrl) {
csAddr = _csAddr;
Verifying that "ericxtang.id" is my Blockstack ID. https://onename.com/ericxtang
@ericxtang
ericxtang / expvar_examples.go
Created February 14, 2017 01:17
examples for using expvar
package main
import "fmt"
import "time"
import "expvar"
import "encoding/json"
type Nodes struct {
peers map[string][]string
}
@ericxtang
ericxtang / latency.txt
Created April 3, 2017 19:56 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD

Keybase proof

I hereby claim:

  • I am ericxtang on github.
  • I am ericxtang (https://keybase.io/ericxtang) on keybase.
  • I have a public key ASCxFJZ2g3D20zYOyypn0PQO_UvM1LL7xxCkGOQZHcgZ1Qo

To claim this, I am signing this object:

@ericxtang
ericxtang / ladder.md
Created June 9, 2017 16:40 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
0x30a8c918ff01f87b19901491761b1d2554a55108
0x960e4e676e3c3ba35b54807086aad52da153f04f
0x441bf0c5b6c71819546dab980b3fa1b8e27fab32