Skip to content

Instantly share code, notes, and snippets.

View mntone's full-sized avatar
🏠

monotone mntone

🏠
View GitHub Profile
@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
@mntone
mntone / NonClosingStreamWrapper.cs
Created February 6, 2015 07:40
Dispose を回避する Stream (MIT license)
using System;
using System.IO;
namespace XXX
{
internal class NonClosingStreamWrapper: Stream
{
private Stream _stream;
public NonClosingStreamWrapper( Stream stream )
@mntone
mntone / ReactiveProperty2.cs
Last active August 29, 2015 14:21
(en) ReactiveProperty factory extensions.
// This file is under The MIT License (MIT).
using Reactive.Bindings;
using System;
using System.Linq.Expressions;
using System.Reactive.Concurrency;
namespace Mntone.Reactive.Bindings
{
public static class ReactiveProperty2
{
@mntone
mntone / VideoHost.cs
Created June 25, 2015 01:31
HwndHostを継承してHWND (native window handle)を作ってみたサンプル! 別プロセスから描画したりもできるので、自由なことができる(にやにや)。プロセス間通信は別途必須。 ちなみにほぼコピペ https://msdn.microsoft.com/ja-jp/library/ms752055.aspx
using System;
using System.Runtime.InteropServices;
using System.Windows.Interop;
namespace Testsuruo
{
public sealed class VideoHost : HwndHost
{
private IntPtr hwndHost;
internal const int
@mntone
mntone / log.txt
Created August 16, 2015 16:19
IkaLog を実行したときにでたログ。
>python IkaLog.py
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cv::cvtColor, file ..\.
.\..\opencv-3.0.0\modules\imgproc\src\color.cpp, line 7564
Traceback (most recent call last):
File "D:\Desktop\IkaLog\IkaLog.py", line 92, in <module>
core()
File "D:\Desktop\IkaLog\IkaLog.py", line 20, in core
scn_gamestart = IkaScene_GameStart()
File "D:\Desktop\IkaLog\IkaScene_GameStart.py", line 50, in __init__
self.map_list.append(self.load_mapname_mask(data1, 'タチウオパーキング'))