Skip to content

Instantly share code, notes, and snippets.

@chhenning
chhenning / matrix.cpp
Created December 4, 2017 20:59
Exchange data to and from cpp and numpy using buffer protocol
#include <numeric>
#include <vector>
#include <pybind11/pybind11.h>
namespace py = pybind11;
/*
A very generic matrix class
*/
@chhenning
chhenning / main.cpp
Last active September 10, 2017 14:46
Download a website
std::string html;
std::string error;
int64_t http_code = 0;
std::string destination_ip;
double total_time;
double name_lookup_time;
double connect_time;
@chhenning
chhenning / gist:5041396
Last active December 14, 2015 06:19
using boost::gil::io::scanline_read_iterator code sample
typedef tiff_tag tag_t;
typedef scanline_reader< typename get_read_device< const char*
, tag_t
>::type
, tag_t
> reader_t;
reader_t reader = make_scanline_reader( "C:/boost/libs/gil/io/test_images/tiff/test.tif", tag_t() );