Skip to content

Instantly share code, notes, and snippets.

@whatisor
whatisor / README.md
Created December 22, 2015 10:01 — forked from bsergean/README.md
Anti-aliasing (FXAA) with headless-gl and three.js

Aliased

Anti-aliased

Getting the code

@whatisor
whatisor / pid.cpp
Created January 6, 2016 03:47 — forked from bradley219/.gitignore
PID C++ implementation
#ifndef _PID_SOURCE_
#define _PID_SOURCE_
#include <iostream>
#include <cmath>
#include "pid.h"
using namespace std;
class PIDImpl
@whatisor
whatisor / sift.cpp
Created August 28, 2017 06:38 — forked from lxc-xx/sift.cpp
OpenCV's SIFT implementation
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
@whatisor
whatisor / openvino-arm.note
Created November 14, 2019 18:42
openvino-arm.note
Dont use optimization flag for compilation if use MYRIAD
@whatisor
whatisor / RealsenseTool.hpp
Created December 31, 2019 07:32
RealsenseTool.hpp
#pragma once
#include <exception>
#include <librealsense2/rs.hpp>
#include <librealsense2/rsutil.h>
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
using namespace cv;
@whatisor
whatisor / fisheye2spherical.frag
Last active January 6, 2020 02:45
Fisheye to spherical conversion shader
// Fisheye to spherical conversion
// Assumes the fisheye image is square, centered, and the circle fills the image.
// Output (spherical) image should have 2:1 aspect.
// Strange (but helpful) that atan() == atan2(), normally they are different.
//Refer http://blog.yeezia.com/?post=91
kernel vec4 fish2sphere(sampler src)
{
vec2 pfish;
float theta,phi,r;
vec3 psph;
@whatisor
whatisor / Docker proxy Need 2 Do
Created August 11, 2020 03:40
Docker proxy Need 2 Do
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo nano /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://ip:port"
Environment="HTTPS_PROXY=http://ip:port/"
Environment="NO_PROXY="localhost,127.0.0.1,::1"
mkdir ~/.docker
nano ~/.docker/config.json
@whatisor
whatisor / update-committer.sh
Created April 14, 2021 06:25
Change Committer info of all old commits
#!/bin/sh
git filter-branch -f --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Nguyen Xuan Huong"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@whatisor
whatisor / gist:e114606079e5c99752ea5678429800b6
Last active June 10, 2021 03:43
How to call Java function from jni
1. Jni:
extern "C" JNIEXPORT void JNICALL
Java_com_example_javaactivity_initApplicationNative(
JNIEnv* env, jobject obj)
{
__android_log_print(ANDROID_LOG_VERBOSE, "jni", "jni initApplicationNative");
env->GetJavaVM(&javaVM);
jclass cls = env->GetObjectClass(obj);
activityClass = (jclass) env->NewGlobalRef(cls);
activityObj = env->NewGlobalRef(obj);
Checked test: toFixed(0) x 5,057,837 ops/sec ±0.56% (66 runs sampled)
Checked test: Math.floor x 4,522,238 ops/sec ±0.84% (67 runs sampled)
Checked test: ~~ x 12,077,987 ops/sec ±0.34% (67 runs sampled)