Skip to content

Instantly share code, notes, and snippets.

View edimetia3d's full-sized avatar

edimetia3d

View GitHub Profile
@edimetia3d
edimetia3d / .clang-tidy
Created April 11, 2024 11:59
google style based clang tidy
Checks: >
*,
-abseil-*,
-altera-*,
-android-*,
-boost-*,
bugprone-*,
cert-*,
clang-analyzer-*,
concurrency-*,
@edimetia3d
edimetia3d / ten_years.py
Created October 13, 2023 08:40
Assets change of buying a apartment in china in tensor?
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)
@edimetia3d
edimetia3d / std_futex.h
Last active March 23, 2022 03:34
A lock-free user space "mutex" implemented by std
#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.
*