Skip to content

Instantly share code, notes, and snippets.

@FrankHB
FrankHB / C++吧城门纪略20140530.txt
Last active August 29, 2015 14:02
C++吧城门纪略20140530
缘起:
http://tieba.baidu.com/p/3063141987
首先是羊驼受不鸟了:
http://tieba.baidu.com/p/3073589768
城门本体:
http://tieba.baidu.com/p/3074520245
混战:
@FrankHB
FrankHB / daze_player.cc
Created July 26, 2014 10:50
daze_player
// http://tieba.baidu.com/p/3172996151
struct daze_player : player
{
state s;
virtual state play( std::size_t milisecond_left, const std::vector< state > & self_history, const std::vector< state > & opponent_history )
{
s = (((millisecond_left + std::size_t('d')) * self_history.size() / (opponent_history.size() + std::size_t('a')) + std::size_t('z')) + std::size_t('e') * (self_history.size() ^ opponent_history.size())) % 3;
return s;
}
};
@FrankHB
FrankHB / 150422.cc
Last active October 19, 2015 00:43
UTF-8 decoding/encoding performance test
// LICENSE: MIT
// Based on: https://github.com/9chu/minicodecvt/blob/master/TestCpp/main.cpp
// Depends on:
// rapidjson: https://github.com/miloyip/rapidjson .
// minicodecvt: https://github.com/9chu/minicodecvt
// YSLib: https://github.com/FrankHB/YSLib
// MCF: https://github.com/lhmouse/MCF
// Prerequisite:
// *-w64-mingw32-g++ supports '-std=c++14'.
// Run Tool/install-sysroot.sh in YSLib repo dir to install Sysroot
@FrankHB
FrankHB / 未开化案例研究5.txt
Created March 6, 2016 09:09
未开化案例研究5
2016-03-06 15:42
本系列几乎已成半年刊了。
不是什么大书特书的东西。关键字“原教旨主义”。
属于第一类族群,演化程度中等。
正文
@FrankHB
FrankHB / faq.md
Last active February 27, 2024 01:24
贴吧相关 FAQ 、资源链接和其它附带清单。

FAQ

包含若干待定整理内容。

待补充

const/常量表达式(constant expression) 的联系和不同。

参考:

@FrankHB
FrankHB / todo-reading.md
Created May 24, 2016 02:58
备选阅读列表

概要

长期坑。

PLT

【int32】帅气魔理沙<lolita@marisa.moe> 2015-09-12 13:47:57
http://web.cs.ucla.edu/~palsberg/tba/papers/nielson-nielson-csd99.pdf
http://lambda-the-ultimate.org/node/4768
@FrankHB
FrankHB / POSIX-bad-design.md
Last active August 15, 2016 15:48
UNIX/POSIX烂设计

糟糕的设计审计和接口设计质量

例如几乎没什么用的文件锁

综合示例

sem_open 允许 EINTR ,凭空制造 race condition ,根本没法确定打开时是不是同时创建了信号量。

而文件系统持久语义导致不 sem_unlink 就会在最后/进程挂掉以后遗留空的信号量(如果权限设置有问题后面访问/创建同名的信号量都麻烦)。

@FrankHB
FrankHB / 161109.md
Last active November 19, 2016 15:32
161109

http://tieba.baidu.com/p/4860024843

56L @福音战士01 :

这是典型地没学明白。

首先是没搞清楚语言的目的和应用领域,其次是不明白现在对语言的应用的一些常见外延。

一条条分析。

@FrankHB
FrankHB / test.txt
Last active December 8, 2019 11:45
NPL Console test code
"NOTE", "This file is moved.", "https://github.com/FrankHB/NPLC/blob/b523633b439085b42a73c0e66ddd17454b1b91c1/NBuilder/test.txt";