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 <condition_variable> | |
#include <mutex> | |
#include <atomic> | |
/** | |
* A lock-free user space "mutex" implemented by std | |
* | |
* The core idea is very simple: | |
* 1. when there is no contention, we use atomic release/acquire synchronization to do a lock-free lock/unlock. | |
* 2. when there is contention, we use the syscall lock/unlock. | |
* |
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 math | |
import numpy_financial as npf | |
def get_irr(loan, X, plan_month): | |
"""Finacial concept""" | |
v = [-loan] | |
for i in range(plan_month): | |
v.append(X) | |
return npf.irr(v) |
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
Checks: > | |
*, | |
-abseil-*, | |
-altera-*, | |
-android-*, | |
-boost-*, | |
bugprone-*, | |
cert-*, | |
clang-analyzer-*, | |
concurrency-*, |
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
if type rg &> /dev/null; then | |
export FZF_DEFAULT_COMMAND='rg --files' | |
export FZF_DEFAULT_OPTS='-m' | |
fi | |
function grepcode(){ | |
grep $1 ./ -r -n -I | |
} | |
function findfile(){ |