Skip to content

Instantly share code, notes, and snippets.

View tianweidut's full-sized avatar
🎯
Focusing

tianwei tianweidut

🎯
Focusing
View GitHub Profile
@tianweidut
tianweidut / code_contest_template.cpp
Created October 9, 2012 07:40 — forked from wweic/code_contest_template.cpp
Code template for programming contest
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
import os, sys
class Winpdb(object):
'''Embed a Winpdb server.
If you have to tunnel to connect remotely from the Winpdb client, run:
ssh -C -N -f -L 51000:localhost:51000 $SERVER_HOST
@tianweidut
tianweidut / nth_percentile.py
Created April 1, 2016 06:09 — forked from ageron/nth_percentile.py
Explanation of 90th percentile
def nth_percentile(dataset, percentile = 90):
sorted_dataset = sorted(dataset)
new_length = len(sorted_dataset) * percentile / 100
return sorted_dataset[0:new_length]
def mean(dataset):
return sum(dataset)/float(len(dataset))
dataset = [5, 9, 7, 101, 4, 8, 109, 104, 6, 1, 110, 106, 3, 107, 105, 2, 102, 10, 103, 108]
percentile_90 = nth_percentile(dataset)
@tianweidut
tianweidut / cloudSettings
Created July 30, 2020 11:47 — forked from yetone/cloudSettings
vscode-settings-public
{"lastUpload":"2020-05-13T10:46:00.823Z","extensionVersion":"v3.4.3"}