I hereby claim:
- I am dirvine on github.
- I am dirvine (https://keybase.io/dirvine) on keybase.
- I have a public key ASA2eTly6DqSDQl54W0_CvfbASdSiA_xvXcQsl_jnPrQFwo
To claim this, I am signing this object:
google.com | |
youtube.com | |
facebook.com | |
baidu.com | |
yahoo.com | |
amazon.com | |
wikipedia.org | |
google.co.in | |
twitter.com | |
qq.com |
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! |
#include <boost/program_options.hpp> | |
#include <thread> | |
#include <chrono> | |
#include <iostream> | |
namespace po = boost::program_options; | |
int main(int ac, char* av[]) { | |
po::options_description desc("Allowed options"); | |
desc.add_options() |
I hereby claim:
To claim this, I am signing this object:
This is a small demo of how to create a library in Rust and call it from Python (both CPython and PyPy) using the CFFI instead of ctypes
.
Based on http://harkablog.com/calling-rust-from-c-and-python.html (dead) which used ctypes
CFFI is nice because:
ctypes
#ifndef MY_CLASS_H | |
#define MY_CLASS_H | |
#include <tuple> | |
#include <utility> | |
template <typename T, typename U> | |
struct MyClass { | |
T first; | |
U second; |
/* | |
* ===================================================================================== | |
* | |
* Filename: turing.cc | |
* | |
* Description: | |
* | |
* Version: 1.0 | |
* Created: 30/07/12 19:16:46 | |
* Revision: none |
/* | |
* ===================================================================================== | |
* | |
* Filename: max_template.cc | |
* | |
* Description: simple template example | |
* | |
* Version: 1.0 | |
* Created: 25/07/12 19:56:01 | |
* Revision: none |
// sfinae test for has ThisFunc() method | |
template <typename T> | |
class has_this_func { | |
typedef char one[1]; | |
typedef char two[2]; | |
template <typename U> static one test(decltype(&U::ThisFunc()); // could also be *U::Routing() for pointer to ThisFunc | |
// the above gets masked out as sfinae will choose two | |
template <typename U) static two test(...); | |
public: | |
static bool const value = sizeof(test<T>(0)) == sizeof(one); |
union Endian { | |
char c; | |
int i; | |
Endian(void) : i(1) { }; | |
bool big(void) { return !!c; }; | |
} endian; | |
cerr << (endian.big() ? "big" : "little"); |