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
// clang++ -std=c++1y a.cc -o a.exe | |
#include <cstdio> | |
void seq(){} | |
template<class T, class... P> void seq(T arg, P... args){ static_cast<void>(arg()); seq(args...); } | |
auto curry = [](auto f){return [f](auto... x){return [=](auto y){return f(x..., y); }; }; }; | |
auto make_seq = [](auto f){return [f](auto... x){seq([=]{return f(x);}...); }; }; | |
auto seq_curry = [](auto f){return curry(make_seq(f)); }; | |
template<size_t N> |
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 <ytest/timing.hpp> // https://github.com/FrankHB/YSLib/blob/master/YBase/include/ytest/timing.hpp | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
using namespace ytest::timing; | |
struct tr | |
{ |
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
缘起: | |
http://tieba.baidu.com/p/3063141987 | |
首先是羊驼受不鸟了: | |
http://tieba.baidu.com/p/3073589768 | |
城门本体: | |
http://tieba.baidu.com/p/3074520245 | |
混战: |
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
// 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; | |
} | |
}; |
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
// 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 |
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 <string> | |
#include <iostream> | |
using namespace std; | |
template<typename T> | |
inline const T& | |
max_xx(const T& x, const T& y) | |
{ | |
return y < x ? x : y; | |
} |
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 <iostream> | |
#include <shlobj.h> | |
#include <shlwapi.h> | |
#include <objbase.h> | |
//#include <Windows.Foundation.h> | |
using namespace std; | |
class COM | |
{ |
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 <string> | |
#include <algorithm> | |
#include <cstring> | |
#include <utility> | |
#include <cassert> | |
#include <iostream> | |
using namespace std; | |
#if 1 |
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
#define YB_T_NO_MATH 1 | |
//#define YB_T_NO_IOSTREAM 1 | |
//#define YB_T_NO_TIMING 1 | |
#define YTEST_B 4 | |
#include "../../Temp/test.h" | |
#include <ysbuild.h> | |
#include <Helper/HostWindow.h> | |
#include <windows.h> | |
#include "../HelperEx/Shells.h" | |
#include <NPL/SContext.h> |
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
template<typename _type, std::uintmax_t _vNum = 1, std::uintmax_t _vDen = 1, | |
bool _bIsFloat = std::is_floating_point<_type>::value> | |
struct normalized_max; | |
template<typename _type, std::uintmax_t _vNum, std::uintmax_t _vDen> | |
struct normalized_max<_type, _vNum, _vDen, true> | |
{ | |
static yconstexpr _type value = double(_vNum / _vDen); | |
}; |
OlderNewer