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
(defn get-hash [type data] | |
(.digest (java.security.MessageDigest/getInstance type) (.getBytes data) )) | |
(defn sha1-hash [data] | |
(get-hash "sha1" data)) | |
(defn get-hash-str [data-bytes] | |
(apply str | |
(map | |
#(.substring |
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
/* | |
* stupid congestion control | |
* | |
*/ | |
#include <linux/module.h> | |
#include <net/tcp.h> | |
static int fixed_cwnd __read_mostly = 1000; | |
module_param(fixed_cwnd, int, 0644); |
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 java.util.concurrent.*; | |
import java.util.concurrent.atomic.AtomicLong; | |
class QueueCachedTaskRunner<T> implements Runnable { | |
private final BlockingQueue<T> queue; | |
private ExecutorService executor; | |
private AtomicLong taskCount = new AtomicLong(); | |
QueueCachedTaskRunner(int queueSize, int numThread) { | |
this.queue = new LinkedBlockingQueue<>(queueSize); |
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 matplotlib.pyplot as plt | |
from matplotlib.animation import FuncAnimation | |
import polars as pl | |
import matplotlib as mpl | |
import requests | |
from datetime import datetime, timedelta | |
import enum | |
import time | |
from playsound import playsound | |
import threading |