Skip to content

Instantly share code, notes, and snippets.

View mntone's full-sized avatar
🏠

monotone mntone

🏠
View GitHub Profile
@mntone
mntone / coding-style.md
Last active December 28, 2015 14:09
mntone のコーディングスタイル(日本語版)。英語版は必要になったら書く予定。

私「mntone」の C++ コーディングスタイルについて

コーディングスタイル基本則

ポインター、リファレンス、ハンドル、トラッキングリファレンスなど

それぞれ型側に近づけて記述する

const T* const value
const T& value
const T^ value
@mntone
mntone / niconico_context.h
Last active December 29, 2015 17:39
niconico_context 管理用クラス。実装段階。 (Nov 2013 CTP)
#pragma once
namespace mntone { namespace niconico {
/// <summary>
/// niconico の API 用コンテクストを管理します
/// </summary>
class niconico_context
{
public:
@mntone
mntone / xor.pl
Created December 2, 2013 00:31
xor を審議を確かめるために書いたやつ。2NAND, 2NOR, INV で構成
for( my $a = 0; $a <= 1; ++$a )
{
for( my $b = 0; $b <= 1; ++$b )
{
print( $a, ' ', $b, ' ', ( !( ( !!( $a & $b ) ) | ( !( $a | $b ) ) ) ) == 1 ? 1 : 0, "\n" );
}
}
__END__
@mntone
mntone / cookie_parser.cpp
Last active December 31, 2015 10:39
Open Niconico 用 Cookie Parser 実装。C++ REST SDK にバックポートの可能性あり。現状は修正 BSD license です。
@mntone
mntone / ibytestream.hpp
Last active August 29, 2015 13:57
バイトストリームを容易に扱うための ibytestream。MIT ライセンスで。
#pragma once
#include <istream>
namespace mntone { namespace utility {
class ibytestream
: std::basic_istream<uint8_t>
{
public:
using baseistream = std::basic_istream<uint8_t>;
@mntone
mntone / Class1.cpp
Last active August 29, 2015 14:01
C# の Stream 変換検証
#include "pch.h"
#include "Class1.h"
using namespace Concurrency;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Storage::Streams;
using namespace StreamTestFactory;
IBuffer^ Class1::GetBuffer()
@mntone
mntone / linq.hpp
Last active August 29, 2015 14:02
C++ および C++/CX で Linq っぽいことを可能にするクラス
#pragma once
#include <numeric>
#include <type_traits>
#include <vector>
#ifdef __cplusplus_winrt
#include <collections.h>
#endif
namespace Linq {
@mntone
mntone / Program.cs
Created June 30, 2014 00:49
IndexOf いろいろ比較。
using System;
namespace StringIndexOfSpeedTest
{
class Program
{
static void Main( string[] args )
{
var data = "bbbbbbbbbbbbbbbbbbbbbbbbbbb[bbbbbbbbbbbbbbbbbbbbbbbbbbb";
var find = '[';
@mntone
mntone / EventWrapper.h
Last active August 29, 2015 14:08
C++/CX でイベントをうまく自動で開放するラッパー
// MIT license
// Copyright (C) 2014 mntone. All rights reserved.
#pragma once
#include <functional>
namespace Mntone { namespace Nicola { namespace Utilities {
template<typename T>
class EventWrapper final