Skip to content

Instantly share code, notes, and snippets.

@CKehl
CKehl / springer-free-maths-books.md
Created December 28, 2015 22:17 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@CKehl
CKehl / CMakeLists.txt
Created June 6, 2017 12:16 — forked from erikzenker/CMakeLists.txt
CMake CUDA + C++ in separate files
# CMAKE FILE to separatly compile cuda and c++ files
# with the c++11 standard
#
#
# Folder structure:
#
# |
# +--main.cpp (with C++11 content)
# +--include/
# | |
@CKehl
CKehl / powercrust.h
Created August 7, 2018 11:22 — forked from ialhashim/powercrust.h
Portable Powercrust in C++
// Portable version of powercrust, adapted from https://github.com/timhutton/vtkpowercrust
/*===================================================================================================
vtkPowerCrustSurfaceReconstruction algorithm reconstructs surfaces from unorganized point data.
Copyright (C) 2014 Arash Akbarinia, Tim Hutton, Bruce Lamond Dieter Pfeffer, Oliver Moss
====================================================================================================*/
/*
#include "CellArray.h"
@CKehl
CKehl / voronoi.hpp
Created August 7, 2018 11:22 — forked from ialhashim/voronoi.hpp
Header-only C++ implementation to generate Voronoi diagrams (nice data structure)
// Source: https://github.com/samkusin/gamelabs/tree/master/voronoi
// with a bug fix (ennetws)
/* Usage:
using namespace cinekine;
...
voronoi::Sites sites;
for(int i = 0; i < 5; i++) sites.push_back(voronoi::Vertex(rand()*xBound/RAND_MAX,rand()*yBound/RAND_MAX));
...
voronoi::Graph graph = voronoi::build(std::move(sites), xBound, yBound);
...
@CKehl
CKehl / DBSCAN.hpp
Created August 7, 2018 11:23 — forked from ialhashim/DBSCAN.hpp
Portable Clustering Algorithms in C++ (DBSCAN) and (Mean-Shift) and (k-medoids)
#pragma once
// Code adapted from https://github.com/propanoid/DBSCAN
#include <vector>
#include <algorithm>
#include <omp.h>
// Any basic vector/matrix library should also work
#include <Eigen/Core>
@CKehl
CKehl / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created September 18, 2018 11:45 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@CKehl
CKehl / android-ubuntu
Created September 3, 2019 13:40 — forked from mpaepper/android-ubuntu
How to debug your Android device under Ubuntu
When programming apps for Android, you usually want to test them on real Android devices.
This little gist describes how to do so using Ubuntu 14.
First, you need to download and install the Android development IDE (http://developer.android.com/sdk/index.html) and create an Android project which you want to debug.
Next, you need to setup the debugging mode on your Android device. Starting in Android 4.2 you need to enable the developer options first: 1) Go to settings 2) Go to About Phone 3) Tap the build number 10 times (or more, not sure ;)) and you will get the notification that you enabled it.
Then go to the developer settings and enable the debug mode for your phone.
Now you think you can just plug it into your USB mode? - Nope.
@CKehl
CKehl / 51-android.rules
Created September 3, 2019 13:40 — forked from jdamcd/51-android.rules
Full set of Android USB vendor ID rules for Linux
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev" #Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev" #ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666", GROUP="plugdev" #Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666", GROUP="plugdev" #Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev" #Fujitsu
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev" #Fujitsu Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="091e", MODE="0666", GROUP="plugdev" #Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" #Google
SUBSYSTEM=="usb", ATTR{idVendor}=="201E", MODE="0666", GROUP="plugdev" #Haier
SUBSYSTEM=="usb", ATTR{idVendor}=="109b", MODE="0666", GROUP="plugdev" #Hisense
@CKehl
CKehl / Makefile
Created November 30, 2019 20:17 — forked from sighingnow/Makefile
Detect operating system in Makefile.
# Detect operating system in Makefile.
# Author: He Tao
# Date: 2015-05-30
OSFLAG :=
ifeq ($(OS),Windows_NT)
OSFLAG += -D WIN32
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
OSFLAG += -D AMD64
endif
@CKehl
CKehl / yuvrgb.md
Created September 28, 2024 21:44 — forked from yohhoy/yuvrgb.md
RGB <=> YCbCr(YPbPr) color space conversion
Y  = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
BT.601 BT.709 BT.2020
a 0.299 0.2126 0.2627
b 0.587 0.7152 0.6780