Skip to content

Instantly share code, notes, and snippets.

@egtra
egtra / git_ptr.hpp
Created September 28, 2014 16:20
Global Interface Tableのラッパー
/*
git_ptr.hpp: Copyright 2014 Egtra
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
@egtra
egtra / FileDescriptorTest-MemStream-Multiple-Async-FTM.cpp
Created May 18, 2015 19:36
非同期ドロップ処理フリースレッドマーシャラー + CFSTR_FILEDESCRIPTORで複数ファイル (SHCreateMemStream)
#define UNICODE
#define _UNICODE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#define _ATL_NO_AUTOMATIC_NAMESPACE
@egtra
egtra / FileDescriptorTest-Forms-MemStream-Multiple-Async-FTM.cpp
Created May 18, 2015 19:38
非同期ドロップ処理フリースレッドマーシャラー + CFSTR_FILEDESCRIPTORで複数ファイル (Windows Forms + SHCreateMemStream)
#define UNICODE
#define _UNICODE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#include <string.h>
@egtra
egtra / FileDescriptorTest-Directory.cpp
Last active August 29, 2015 14:21
CFSTR_FILEDESCRIPTORで実在しないフォルダをエクスプローラへドラッグ&ドロップする実験
#define UNICODE
#define _UNICODE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#define _ATL_NO_AUTOMATIC_NAMESPACE
@egtra
egtra / FileDescriptorTest-Directory-Forms.cpp
Created May 24, 2015 08:30
CFSTR_FILEDESCRIPTORで実在しないフォルダをエクスプローラへドラッグ&ドロップする実験 (Windows Forms)
#define UNICODE
#define _UNICODE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#include <string.h>
@egtra
egtra / FileDescriptorTest-Directory-WPF.cpp
Created May 24, 2015 08:31
CFSTR_FILEDESCRIPTORで実在しないフォルダをエクスプローラへドラッグ&ドロップする実験 (WPF)
#define UNICODE
#define _UNICODE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#include <string.h>
@egtra
egtra / FileDescriptorTest-File-with-Path-WPF.cpp
Last active August 29, 2015 14:23
CFSTR_FILEDESCRIPTORで実在しないファイル(相対パスでフォルダ名指定あり)をエクスプローラへドラッグ&ドロップする実験 (WPF)
#define UNICODE
#define _UNICODE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#include <string.h>
@egtra
egtra / result.txt
Created July 31, 2011 06:15 — forked from gfx/result.txt
->> g++4 -Wextra -Wall -DNDEBUG -O3 simple_refcount.cc && ./a.exe
sizeof(String) : 8
sizeof(std::string) : 4
intrusive_ptr<String> 1.107
boost::shared_ptr<string> with make_shared 1.559
boost::shared_ptr<string> with new 1.778
std::shared_ptr<string> with make_shared 1.248
std::shared_ptr<string> with new 1.779
string 0.655
@egtra
egtra / TweenEncryptString.vb
Created November 24, 2011 14:28
TweenEncryptString
' Tween - Client of Twitter
' Copyright (c) 2007-2011 kiri_feather (@kiri_feather) <kiri.feather@gmail.com>
' (c) 2008-2011 Moz (@syo68k)
' (c) 2008-2011 takeshik (@takeshik) <http://www.takeshik.org/>
' (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
' (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
' (c) 2011 Egtra (@egtra) <http://dev.activebasic.com/egtra/>
' All rights reserved.
'
' This file is part of Tween.
@egtra
egtra / recursive_func_in_lambda.cpp
Created March 9, 2012 17:59 — forked from pseuxdonimo/recursive_func_in_lambda.cpp
C++11のラムダ式で再帰
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
typedef std::function<int (int)> F;
F Fix(std::function<F (F)> f)
{
return [=](int t) {return f(Fix(f))(t);};