Skip to content

Instantly share code, notes, and snippets.

@catree
catree / tetrun.cpp
Created July 23, 2017 22:46 — forked from jzrake/tetrun.cpp
Example code demonstrating use of tetgen
/* -----------------------------------------------------------------------------
*
* AUTHOR: Jonathan Zrake, NYU CCPP: [email protected]
*
*
* USAGE: $> ./tetrun [number of trials]
*
*
* DESCRIPTION:
@catree
catree / mediator.c
Last active March 23, 2017 00:16 — forked from ashelly/mediator.c
Running Median. Finds the median of the last K inputs in O(lg K). See http://stackoverflow.com/q/5527437/10396 for some details.
//Copyright (c) 2011 ashelly.myopenid.com under <http://www.opensource.org/licenses/mit-license>
#include <stdlib.h>
//Customize for your data Item type
typedef int Item;
#define ItemLess(a,b) ((a)<(b))
#define ItemMean(a,b) (((a)+(b))/2)
typedef struct Mediator_t
@catree
catree / gist:d940780098208234a356845b87dd6bdc
Created March 3, 2017 16:49 — forked from leftclickben/gist:322b7a3042cbe97ed2af
Steps to migrate from SVN to GitLab

Steps to migrate from SVN to GitLab

This process worked for me. I take no responsibility for any damage or loss incurred as a result of following or not following these steps or, for that matter, anything else you might do or not do.

Setup

  • SVN is hosted at svn.domain.com.au.
  • SVN is accessible via http (other protocols should work).
  • GitLab is hosted at git.domain.com.au and:
@catree
catree / README.md
Created January 26, 2017 18:47 — forked from amroamroamro/README.md
[Python] Fitting plane/surface to a set of data points

Python version of the MATLAB code in this Stack Overflow post: http://stackoverflow.com/a/18648210/97160

The example shows how to determine the best-fit plane/surface (1st or higher order polynomial) over a set of three-dimensional points.

Implemented in Python + NumPy + SciPy + matplotlib.

quadratic_surface

@catree
catree / gist:2e5406da14b0ac51052d332d4d4e63e9
Created October 4, 2016 21:22 — forked from rygorous/gist:4172889
SSE/AVX matrix multiply
#include <immintrin.h>
#include <intrin.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
union Mat44 {
float m[4][4];
__m128 row[4];
};
@catree
catree / oclMat_custom_kernel.cpp
Created March 27, 2016 02:13 — forked from atinfinity/oclMat_custom_kernel.cpp
sample code to execute custom OpenCL kernel on OpenCV 2.4.9
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/ocl/ocl.hpp>
// cl_mem構造体を参照するためにインクルード
#if defined __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif