Skip to content

Instantly share code, notes, and snippets.

View yocox's full-sized avatar

Xiao Ke-Ting yocox

  • zillians
  • Taiwan
View GitHub Profile
@yocox
yocox / 個人崇拜.txt
Created August 1, 2020 14:09
總是失敗的諸神
作者 yoco (眠月...) 看板 Chat
標題 Re: 沃草發聲明了
時間 Wed Jun 10 03:23:15 2015
───────────────────────────────────────
※ 引述《lilith (我是飛彈貓)》之銘言:
> 以前有個信基督教的朋友說 如果你進教會是想找聖人 那你會很失望
> 搞公民運動大概也是這樣吧
恩阿,也不只是公民運動,而是任何事情都是這樣
@yocox
yocox / thread_worker.cpp
Last active July 23, 2020 21:46
Thread Worker: Run member functions with object its own thread
#include <chrono>
#include <functional>
#include <iostream>
#include <mutex>
#include <queue>
#include <thread>
#include <condition_variable>
// 這個 class,每一個 object 都帶有一個自己的 thread 其特點是,所有的 member
// function 都會在這個 object 自己的 thread 上執行
@yocox
yocox / setting.json
Created June 23, 2020 13:55
Windows Terminal Settings
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
"profiles":
@yocox
yocox / fib-benchmark.txt
Last active January 29, 2019 08:39
fib benchmark
=============================================================
Result
=============================================================
-------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------
BM_for_loop/5 2.89 ns 2.89 ns 247343717
BM_for_loop/10 5.20 ns 5.20 ns 100000000
BM_for_loop/20 7.10 ns 7.10 ns 99506551
BM_for_loop/30 10.3 ns 10.3 ns 67737903
@yocox
yocox / ufcs.hh
Created April 19, 2013 02:40
Universal Function Call Syntax in C++
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <array>
template <typename ValueType>
struct ufcs_holder {
ufcs_holder(ValueType& v) : v_(v) {}