This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
->> 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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);}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <memory> | |
#include <boost/optional.hpp> | |
#include <boost/utility/in_place_factory.hpp> | |
template<typename T> | |
class x_enable_shared_from_this | |
{ | |
public: | |
std::shared_ptr<T> shared_from_this() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <system_error> | |
const std::error_category& sqlite3_error_category() | |
{ | |
class sqlite3_error_category : public std::error_category | |
{ | |
virtual const char* name() const noexcept override | |
{ | |
return "sqlite3"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Runtime.InteropServices; | |
using System.Runtime.InteropServices.ComTypes; | |
namespace Egtra | |
{ | |
namespace Internal | |
{ | |
[Guid("0000000c-0000-0000-C000-000000000046")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
NYSL Version 0.9982 | |
---------------------------------------- | |
A. 本ソフトウェアは Everyone'sWare です。このソフトを手にした一人一人が、 | |
ご自分の作ったものを扱うのと同じように、自由に利用することが出来ます。 | |
A-1. フリーウェアです。作者からは使用料等を要求しません。 | |
A-2. 有料無料や媒体の如何を問わず、自由に転載・再配布できます。 | |
A-3. いかなる種類の 改変・他プログラムでの利用 を行っても構いません。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <cstdarg> | |
#include <stdio.h> | |
std::string strvprintf(const char* format, std::va_list arg) | |
{ | |
std::string ret; | |
ret.resize(32); // この値は根拠なし。もう少し大きくても良いかもしれない。 | |
auto n = static_cast<std::size_t>(vsnprintf(&ret[0], ret.size(), format, arg)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File | |
import java.io.FileOutputStream | |
import java.io.FileInputStream | |
import java.io.BufferedWriter | |
import java.nio.ByteBuffer | |
//import java.util.zip.ZipEntry | |
//import java.util.zip.ZipOutputStream | |
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry | |
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#using <PresentationCore.dll> | |
#using <PresentationFramework.dll> | |
#using <WindowsBase.dll> | |
using namespace System; | |
namespace wpf = System::Windows; | |
namespace input = System::Windows::Input; | |
[STAThread] |
OlderNewer