Skip to content

Instantly share code, notes, and snippets.

@wx257osn2
wx257osn2 / tuple.cpp
Last active December 31, 2015 22:08
O(log N) C++11 constexpr tuple
#include<type_traits>
#include<array>
#include<utility>
#include<algorithm>
#ifdef VEILER_USE_TUPLE_STRICT_AND_POSITIVE_INSTANTIATION
#define VEILER_TUPLE_STRICT_CHECK(...) typename std::enable_if<(__VA_ARGS__)>::type* = nullptr
#define VEILER_TUPLE_POSITIVE_NOEXCEPT(...) noexcept(__VA_ARGS__)
#else
@wx257osn2
wx257osn2 / cxx_advent_calendar_2013.md
Last active December 23, 2020 04:08
C++ Advent Calendar 2013 20日目 「対数オーダーtupleを作ろうとしたが力尽きた」

対数オーダーtupleを作ろうとしたが力尽きた

当記事は「C++ Advent Calendar 2013」の20日目の記事です.

2013/12/21 追記 : 進捗できました


どうも,@wx257osn2で名乗ったほうが通じやすいIです.[^1]

@wx257osn2
wx257osn2 / delete_logs.query
Created September 8, 2014 09:14
(◔⊖◔)
begin;
delete from logs;
commit;
vacuum;
@wx257osn2
wx257osn2 / gist:8cee1725d5275e9993ce
Last active August 29, 2015 14:16
ICE at Torino(VC++ Nov 2013 CTP)
#pragma warning(disable:4592)
#pragma warning(disable:4425)
#pragma warning(disable:4503)
#include<utility>
#include<tuple>
#include<memory>
namespace temple{
Checking file system on C:
The type of the file system is NTFS.
Volume label is Windows 8.
A disk check has been scheduled.
Windows will now check the disk.
CHKDSK is verifying files (stage 1 of 5)...
@wx257osn2
wx257osn2 / state3.cpp
Created May 20, 2015 01:24
ねるねるねるね with Direct2D1.0
#include <will/_2dim.hpp>
#include <will/com.hpp>
#include <vector>
#include <cstdint>
#include <cmath>
#include <d2d1.h>
std::int64_t timer;
double w, h;
@wx257osn2
wx257osn2 / algebraic_data_type.hpp
Last active October 3, 2015 04:34 — forked from plasma-effect/algebraic_data_type.hpp
algebraic_data_type
#pragma once
#ifndef PLASMA_ALGEBRAIC_DATA_TYPE
#define PLASMA_ALGEBRAIC_DATA_TYPE
// Copyright plasma-effect 2015
// Distributed under the Boost Software License, Version 1.0.
// (See http://www.boost.org/LICENSE_1_0.txt)
#include<tuple>
#include<memory>
@wx257osn2
wx257osn2 / install.sh
Last active October 9, 2017 05:17
Warning script about commit to master branch(git pre-commit hook)
#!/bin/sh
mkdir -p ~/.git_template/hooks
git config --global init.templatedir ~/.git_template
cat pre-commit >> ~/.git_template/hooks/pre-commit
chmod +x ~/.git_template/hooks/pre-commit
@wx257osn2
wx257osn2 / mecab.hpp
Created December 29, 2017 09:36
MeCabのC++ラッパー
//Copyright (C) 2017 I
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef MECAB_HPP_INCLUDED_
#define MECAB_HPP_INCLUDED_
#include <string_view>
#include <memory>
#include <stdexcept>
#include <mecab.h>
@wx257osn2
wx257osn2 / amp_graphics.h.patch
Created June 13, 2021 17:48
The patch for amp_graphics.h in order to match the standard conformation degree of the compiler on VS2019 16.10.1
diff --git a/amp_graphics.h b/amp_graphics.h
index c63de07..98bd512 100644
--- a/amp_graphics.h
+++ b/amp_graphics.h
@@ -638,6 +638,24 @@ _Ret_ IUnknown * get_sampler(const Concurrency::accelerator_view &_Av, const sam
} // namespace direct3d
+template <typename _Src_type, typename = typename std::enable_if<details::texture_traits<_Src_type>::is_texture, void>::type> void copy(const _Src_type &_Src, _Out_ void * _Dst, unsigned int _Dst_byte_size);
+template <typename _Src_type, typename = typename std::enable_if<details::texture_traits<_Src_type>::is_texture, void>::type> void copy(const _Src_type &_Src, const index<_Src_type::rank> &_Src_offset, const extent<_Src_type::rank> &_Copy_extent, _Out_ void * _Dst, unsigned int _Dst_byte_size);