This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AVX example. Compile with: | |
// clang++ simd.cc -O3 -osimd -lopencv_core -lopencv_highgui -lopencv_imgproc -std=c++14 -mavx -mfma | |
#include <chrono> | |
#include <iostream> | |
#include <immintrin.h> | |
#include <opencv2/opencv.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import math | |
import numpy as np | |
import sympy | |
def rotation_quat(v, a): | |
q = np.zeros(4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Computes the nth power of x in a rather funny way. | |
*/ | |
template<size_t N> inline uint64_t power(int x) { | |
const auto half = power<N >> 1>(x); | |
const auto half2 = half * half; | |
return (N & 1) ? (half2 * x) : half2; | |
} | |
template<> inline uint64_t power<0>(int x) { return 1; } | |
template<> inline uint64_t power<1>(int x) { return x; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import glfw | |
import math | |
import numpy as np | |
import random | |
import sys | |
from OpenGL.GLUT import * | |
from OpenGL.GLU import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mutex> | |
#include <thread> | |
#include <vector> | |
#include <iostream> | |
/** | |
* Computes the maximum of a vector in parallel, using n threads. | |
*/ | |
template<typename T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import cv2 as cv | |
import numpy as np | |
import sys | |
SIZE = (640, 480) | |
def m(p, q, f): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c... | |
[build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c]: (information) Too many #ifdef configurations - cppcheck only checks 12 of 45 configurations. Use --force to check all configurations. | |
Checking build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c: SDCC... | |
Checking build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c: SIMULATE_VERSION_PATCH... | |
Checking build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c: SIMULATE_VERSION_PATCH;SIMULATE_VERSION_TWEAK... | |
Checking build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c: _CRAYC... | |
Checking build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c: _MSC_BUILD;_MSC_VER... | |
Checking build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c: _MSC_FULL_VER;_MSC_VER... | |
Checking build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c: _MSC_VER... | |
Checking build/CMakeFiles/3.3.2/CompilerIdC/CMakeCCompilerId.c: _MSC_VER;_WIN32... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import logging | |
import os | |
import socket | |
import subprocess | |
import sys | |
import threading | |
import paramiko |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env runhaskell | |
{-# LANGUAGE GeneralizedNewtypeDeriving, | |
LambdaCase, | |
NamedFieldPuns, | |
RecordWildCards #-} | |
import Control.Applicative ((<$>)) | |
import Control.Monad | |
import Control.Monad.Except | |
import Control.Monad.Reader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
with open('points.csv') as f: | |
a = np.loadtxt(f) | |
p3d = a[:,0:3] | |
p2d = a[:,3:5] |
NewerOlder