This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def cdf(a): | |
X = np.sort(np.arraya(a)) | |
Y = np.array(range(a.size)) / float(a.size) | |
return X, Y | |
def ccdf(a): | |
X = np.sort(np.array(a)) | |
Y = (np.full(a.shape, fill_value=a.size) - np.array(range(a.size))) / float(a.size) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) | |
{ | |
char *buf = NULL, *p = NULL; | |
unsigned long i, page_size = 4096, offset = 0, buf_size = 1UL << 10UL; | |
setbuf(stdout, NULL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
import time | |
import signal | |
import threading | |
import subprocess | |
class MemoryMonitor(threading.Thread): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
import itertools | |
import numpy as np | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
# 1. Update and the fonts in the parent direcotry | |
# import os | |
# import sys | |
# sys.path.insert(0, os.path.dirname(os.getcwd())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_fontproperties(font, fontsize): | |
if font == 'monaco': | |
fontproperties = mpl.font_manager.FontProperties(fname='Fonts/Monaco.ttf', size=fontsize) | |
elif font == 'times': | |
fontproperties = mpl.font_manager.FontProperties(fname='Fonts/Times New Roman.ttf', size=fontsize) | |
elif font == 'helvetica': | |
fontproperties = mpl.font_manager.FontProperties(fname='Fonts/Helvetica.ttf', size=fontsize) | |
elif font == 'libertine': | |
fontproperties = mpl.font_manager.FontProperties(fname='Fonts/Libertine.ttf', size=fontsize) | |
elif font == 'nanum_gothic': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/hashtable.h> | |
#define CONN_HASH_BITS 4 | |
DEFINE_HASHTABLE(conn_hash, CONN_HASH_BITS); | |
struct dvs_hash_node { | |
int val; | |
struct hlist_node hash_node; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import socket | |
import getpass | |
import logging | |
class ContextFilter(logging.Filter): | |
def filter(self, record): | |
record.hostname = socket.gethostname() | |
record.user = getpass.getuser() | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipreqs --force ./ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder