This file contains hidden or 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
# coding: utf-8 | |
import os | |
import sys | |
from cffi import FFI | |
from twisted.internet.defer import Deferred | |
from twisted.internet import reactor | |
from twisted.python import log |
This file contains hidden or 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 <cassert> | |
template <typename Func> | |
class impl | |
{ | |
private: | |
impl(const impl &) = delete; | |
impl & operator=(const impl &) = delete; | |
public: |
This file contains hidden or 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 <unistd.h> | |
#include <fcntl.h> | |
#include <sys/socket.h> | |
#include <sys/select.h> | |
int | |
async_open(const char * filename, int flags) | |
{ | |
// create pipe |
This file contains hidden or 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
// how to use boost.asio + sendfile(2) | |
// Michał Papierski <[email protected]> | |
#include <iostream> | |
#include <string> | |
#include <boost/asio.hpp> | |
#include <boost/make_shared.hpp> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/ref.hpp> | |
#include <boost/bind.hpp> | |
#include <boost/enable_shared_from_this.hpp> |
This file contains hidden or 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
# | |
# cgicc 3.2.10 cmakified | |
# by Michal Papierski <[email protected]> | |
# | |
cmake_minimum_required (VERSION 2.8.7) | |
project (cgicc) | |
set (VERSION "3.2.10") | |
execute_process (COMMAND "(hostname || uname -n) 2>/dev/null | sed 1q" | |
RESULT_VARIABLE HOST) |
This file contains hidden or 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 <boost/tuple/tuple.hpp> | |
#include <boost/utility.hpp> | |
#include <vector> | |
#include <boost/typeof/typeof.hpp> | |
#include <boost/foreach.hpp> | |
struct person | |
{ |
This file contains hidden or 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 <stdexcept> | |
#include <boost/type_traits.hpp> | |
#include <boost/utility/enable_if.hpp> | |
class binstream | |
{ | |
public: | |
struct str | |
{ | |
inline str(char * & output, std::size_t length) |
This file contains hidden or 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 <libxml/parser.h> | |
#include <libxml/tree.h> | |
#include <libxml/HTMLtree.h> | |
struct xml_attribute | |
{ | |
xmlNodePtr node_; | |
std::string key_; | |
xml_attribute(xmlNodePtr node, std::string const & key) |
This file contains hidden or 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 <cstdlib> | |
#include <iostream> | |
#include <queue> | |
#include <stdexcept> | |
struct policy | |
{ | |
}; | |
struct allocator: policy |
This file contains hidden or 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 <cstdlib> | |
#include <cstdio> | |
template <int N> | |
struct bottles; | |
template <> | |
struct bottles<100> | |
{ | |
}; |