g++ -g tree.cpp # For random alloc
g++ -g tree.cpp -DUSE_ARENA # For continious
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 itertools | |
import numpy as np | |
from subprocess import Popen, PIPE | |
from pprint import pprint | |
from tqdm import tqdm |
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
c_compiler: | |
_auto_depends: true | |
archiver: &id001 | |
- x86_64-linux-gnu-ar | |
- rcs | |
compiler: &id002 | |
- x86_64-linux-gnu-gcc | |
- -pthread | |
- -Wno-unused-result | |
- -Wsign-compare |
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
# https://github.com/gpakosz/.tmux | |
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, | |
# without any warranty. | |
# Copyright 2012— Gregory Pakosz (@gpakosz). | |
# -- navigation ---------------------------------------------------------------- | |
# if you're running tmux within iTerm2 | |
# - and tmux is 1.9 or 1.9a |
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
# imports | |
import threading | |
import typing | |
import functools | |
# Constants | |
class LockConstants: | |
PRINTLOCK = threading.Lock() | |
SOMEOTHERLOCK = threading.Lock() |
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 | |
c16 = np.complex128() | |
f16 = np.float128() | |
f8 = np.float64() | |
i8 = np.int64() | |
u8 = np.uint64() | |
c8 = np.complex64() | |
f4 = np.float32() |
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
class Solution: | |
def findMinArrowShots(self, points: List[List[int]]) -> int: | |
if points == []: | |
return 0 | |
points.sort(key = lambda p: p[1]) | |
res = 1 | |
cur_top = points[0][1] | |
for point in points: | |
if point[0] <= cur_top: | |
continue |
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
CHECK := $(shell which clang) | |
ifeq ($(CHECK),) | |
$(warning no clang found, consider apt-get install clang, using gcc now) | |
CC = gcc | |
else | |
$(info using clang over gcc) | |
CC = clang | |
endif |
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 <unistd.h> | |
#include <iostream> | |
#include <thread> | |
int getNumberOfCPUs(void) | |
{ | |
unsigned concurentThreadsSupported = std::thread::hardware_concurrency(); | |
// std::cout << "Thread: " << concurentThreadsSupported << std::endl; | |
#if defined _WIN32 | |
SYSTEM_INFO sysinfo; |
NewerOlder