Skip to content

Instantly share code, notes, and snippets.

View 25077667's full-sized avatar
🏠
Working from home

SCC/楊志璿 25077667

🏠
Working from home
View GitHub Profile
@25077667
25077667 / NoThrowAllocator.hpp
Created July 14, 2024 19:00
NoThrowAllocator in C++: A standard-compliant, exception-free memory allocator for high reliability applications.
#ifndef SCC_NOTHROW_ALLOCATOR
#define SCC_NOTHROW_ALLOCATOR
#pragma once
#include <memory>
#include <limits>
#include <new>
namespace scc {
@25077667
25077667 / main.cpp
Created May 21, 2024 19:35
Efficient Resource Management and Evaluation of Large-scale Node Processing in C++
#include <iostream>
#include <memory>
#include <vector>
#include <string>
#include <stdexcept>
#include <stack>
#include <chrono>
// Resource pool for data locality
constexpr auto file_max_number = 20'000'000;
@25077667
25077667 / banchmark.py
Created February 4, 2024 13:00
perfect-forwarding-is-faster-than-c-pointer
import subprocess
import re
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
import json
import datetime
import os
@25077667
25077667 / enable_if98.cpp
Created September 20, 2023 09:34
concepts_in_C++98
#include <iostream>
#include "type_traits.hpp"
template <typename T, typename U>
struct is_addable
{
static const bool
value =
is_arithmetic<T>::value && is_arithmetic<U>::value;
};
@25077667
25077667 / Makefile
Created May 6, 2022 09:12
Universal pdflatex Makefile
src=$(wildcard *.tex)
target=$(patsubst %.tex,%.pdf,$(src))
middles=$(shell pwd)/build
.PHONY:mkdir all clean deepclean
%.pdf: %.tex mkdir
pdflatex -no-shell-escape -output-directory="$(middles)" $<
pdflatex -no-shell-escape -output-directory="$(middles)" $<
all: $(target)