Skip to content

Instantly share code, notes, and snippets.

View kheaactua's full-sized avatar

Matthew Russell kheaactua

View GitHub Profile
@kheaactua
kheaactua / pickle_with_dispatch.py
Created March 25, 2021 12:23
Simple pickling example with a dispatchtable
import copyreg
import pickle
class Foo(object):
def __init__(self, bars):
self.bars = bars
def __str__(self):
return 'foo(%s)'%', '.join(['%s(%s)'%(type(b).__name__, b) for b in self.bars])
@kheaactua
kheaactua / CMakeLists.txt
Created February 4, 2019 16:48
Comparing using Eigen::Map vs constructing a Vector3f
project(MapPoint)
cmake_minimum_required(VERSION 3.0.2)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
add_library(StopWatch StopWatch.h StopWatch.cpp)
target_compile_features(StopWatch PUBLIC cxx_std_11)
CXX = clang++
boost_base := ${HOME}/.conan/data/boost/1.60.0/ntc/stable/package/3de93f54463683a59d0674ac75727b8457727fc8
all:
${CXX} -o example -L${boost_base}/lib -I${boost_base}/include example.cpp
@kheaactua
kheaactua / CMakeLists.txt
Last active April 9, 2018 13:33
WML Linking in MSVC: Minimal Working Example
cmake_minimum_required(VERSION 3.1)
project(wmlexample)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CONFIGURATION_TYPES "Release")
if (WIN32)
set(CONAN_WML_ROOT C:/Users/mrussell/.conan/data/wml/3.x/ntc/stable/package/a4501f33ae09df332b76b4d6f0e5cebffbe83874 CACHE PATH "Path to WML")
set(CONAN_BIN_DIRS_WML ${CONAN_BASE_DIRS_WML}/bin)
else()
set(CONAN_WML_ROOT "/home/matt/.conan/data/wml/3.x/ntc/stable/package/aa0498c70db8439f7f74687e9366567b85010fa5" CACHE PATH "Path to WML")
@kheaactua
kheaactua / App.cpp
Created January 15, 2018 19:33
Example of Q_FLAG_NS not functioning
#include "App.h"
@kheaactua
kheaactua / BlobModel.cpp
Created April 25, 2017 20:29
ListView not displaying
#include "app/qobjs/BlobModel.h"
#include <QtGlobal>
BlobModel::BlobModel(QObject* parent)
: QAbstractListModel(parent) { }
BlobModel::~BlobModel()
{
removeRows(0, rowCount());
@kheaactua
kheaactua / MyPointBuffer.h
Last active February 24, 2017 16:55
Small buffer that contains (and creates) point data that is later read into an OpenGL buffer
#ifndef MYPOINTBUFFER_H_CMWR60UT
#define MYPOINTBUFFER_H_CMWR60UT
#include <QtGui/QOpenGLFunctions>
#include <QVector>
class MyPointBuffer {
public:
MyPointBuffer() {
std::random_device rd;