Skip to content

Instantly share code, notes, and snippets.

@yumetodo
yumetodo / CMakelists_Boost_asio_cpp11_buffers_reference_counted.txt
Last active August 29, 2015 14:27
Boost.asioの付属サンプル、cpp11/buffers/reference_counted.cppをCMakeするもの。CMakelists.txtとリネームしてcppと同じパスに置いてください
cmake_minimum_required(VERSION 2.8.4)
project(buffers)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_HOME_DIRECTORY}/bin")
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
@yumetodo
yumetodo / x264guiEx_runbat.cpp
Last active August 29, 2015 14:27
x264guiExのrunbat.cppにあるrun_bat_file関数(line:43)をstd::stringとか使って書き換え、run_bat_file_cpp関数(line:262)を作った。ビルドテストなんてしてない。
#include <Windows.h>
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
#include "auo.h"
#include "auo_version.h"
#include "auo_util.h"
#include "auo_conf.h"
#include "auo_settings.h"
#include "auo_system.h"
@yumetodo
yumetodo / DxGraphicHandle.cpp
Last active August 26, 2015 08:21
DxLibraryのグラッフィクハンドルとサウンドハンドルのラッパー
#include "DxGraphicHandle.h"
#include "DxLib.h"
#ifdef DxHANDLE_WRAP_USE_EXCEPTION
#include "DxHandleException.h"
#endif
DxGHandle::DxGHandle(const std::string & FileName) DxHANDLE_NOEXCEPT {
this->GrHandle = LoadGraph(FileName.c_str());
#ifdef DxHANDLE_WRAP_USE_EXCEPTION
if (-1 == this->GrHandle) throw DxGHandle_runtime_error("画像の読み込みに失敗しました");
#endif
@yumetodo
yumetodo / jyanken.cpp
Created October 4, 2015 17:15
C++14でありきたりなじゃんけんプログラム。静的if文ください
#include <cstdint>
#include <iostream>
#include <exception>
#include <stdexcept>
#include <type_traits>
#include <limits>
#include <algorithm>
#include <climits>
#include <random>
#include <cstdlib>
'Boost Software License 1.0 (BSL1.0)
'copyright (c) 2015-2016 yumetodo
Dim WshShell
Dim WshFS
Dim url
Dim html
Dim cmd1
Dim path
Set WshShell = CreateObject("WScript.Shell")
Set WshFS = CreateObject("Scripting.FileSystemObject")
#include <iostream>
#include <stdexcept>
#include <cstdint>
#define CONSTEXPR_FUNCTION constexpr
void foo() noexcept(false) {
throw std::runtime_error("error test");
}
namespace detail {
@yumetodo
yumetodo / GitHubAPIまとめ.md
Last active December 24, 2015 00:09
add link
@yumetodo
yumetodo / make_array.cc
Created January 31, 2016 13:56 — forked from lichray/make_array.cc
Factory function of std::array
#include <array>
#include <functional>
template <typename... T>
using common_type_t = typename std::common_type<T...>::type;
template <typename T>
using remove_cv_t = typename std::remove_cv<T>::type;
template <bool, typename T, typename... U>
std::vector<std::string> split(const std::string &str, char delim) {
std::vector<std::string> res;
std::size_t current = 0, found;
while ((found = str.find_first_of(delim, current)) != std::string::npos) {
res.emplace_back(str, current, found - current);
current = found + 1;
}
res.emplace_back(str, current, str.size() - current);
return res;
}
@yumetodo
yumetodo / asm_instruction_analyser.cpp
Last active March 2, 2016 16:53
for dumpbin.exe's output
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <cctype>
#include <unordered_map>
#include <vector>
#include <chrono>
namespace detail {
struct string_include {