Skip to content

Instantly share code, notes, and snippets.

View csujedihy's full-sized avatar
🍀

Yi Huang csujedihy

🍀
  • Microsoft
  • Redmond, WA
View GitHub Profile
@csujedihy
csujedihy / macos10.9.patch
Created January 12, 2014 03:28
patch for ns2.35 on Mac Os 10.9
diff -aur ns-allinone-2.35.orig/install ns-allinone-2.35/install
--- ns-allinone-2.35.orig/install 2012-09-07 14:36:21.000000000 -0700
+++ ns-allinone-2.35/install 2012-09-07 14:45:52.000000000 -0700
@@ -200,6 +200,7 @@
echo "Darwin detected";
DYLD_LIBRARY_PATH=$CUR_PATH/tcl$TCLVER/unix:$CUR_PATH/tk$TKVER/unix:$DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH
+ export LDFLAGS="-framework CoreFoundation"
test_darwin=true
fi
@csujedihy
csujedihy / p.pac
Created September 4, 2014 02:50
My Pac for shadowsocks
// Generated by gfwlist2pac
// https://github.com/clowwindy/gfwlist2pac
var domains = {
"texpadapp.com":1,
"linode.com":1,
"mega.co.nz":1,
"ip138.com":1,
"dmm.co.jp": 1,
"ggpht.com":1,
main.cpp:119:16: error: no viable overloaded '='
v2[14] = 'S';
~~~~~~ ^ ~~~
./My_vec.h:24:13: note: candidate function not viable: no known conversion from
'char' to 'const My_vec<char>' for 1st argument
My_vec<T>& operator=(const My_vec<T>& vec);
^
main.cpp:248:16: error: no viable overloaded '='
v2[14] = 'S';
~~~~~~ ^ ~~~
class Solution(object):
def lengthOfLIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
tail = []
for i in xrange(0, len(nums)):
idx = bisect.bisect_right(tail, nums[i])
if idx - 1 >= 0 and nums[i] == tail[idx - 1]:
@csujedihy
csujedihy / ViewController.swift
Created August 1, 2017 15:06
EchoServer by SwfitDSSocket
import Cocoa
import SwiftDSSocket
class ViewController: NSViewController {
var client: SwiftDSSocket?
var server: SwiftDSSocket?
let ServerTag = 0
override func viewDidLoad() {
super.viewDidLoad()
@csujedihy
csujedihy / cwndplot.py
Created April 7, 2018 00:44
cwndplot.py
import matplotlib.pyplot as plt
import numpy
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input', type=str, help='data file from netput')
parser.add_argument('-o', '--out', type=str, help='Output the plot to a PDF file')
args = parser.parse_args()
myArgs = (vars(args))
@csujedihy
csujedihy / tcpinfo.txt
Created April 7, 2018 00:45
tcpinfo.txt
Time RTT RcvWnd SndWnd
44 53098 262800 14600
1126 53098 262800 14600
3222 53098 262800 14600
5154 53098 262800 14600
8436 53098 262800 14600
10114 53098 262800 14600
12143 53098 262800 14600
14324 53098 262800 14600
24115 53098 262800 14600