Skip to content

Instantly share code, notes, and snippets.

@yesseecity
yesseecity / make_open_with_cuda.sh
Created March 30, 2022 10:15
Build OpenCV wit CUDA on jetson-TX2
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D EIGEN_INCLUDE_PATH=/usr/include/eigen3 \
-D WITH_OPENCL=OFF \
-D WITH_CUDA=ON \
-D CUDA_ARCH_BIN=6.2 \
-D OPENCV_EXTRA_MODULES_PATH=~/external_pkg/OpenCV/opencv_contrib/modules \
-D CUDA_ARCH_PTX=”” \
-D WITH_CUDNN=ON \
@yesseecity
yesseecity / eular-quaternion.js
Created February 20, 2021 09:25
Eular and Quaternion
function ToQuaternion(yaw, pitch, roll) // yaw (Z), pitch (Y), roll (X)
{
// Abbreviations for the various angular functions
let cy = Math.cos(yaw * 0.5);
let sy = Math.sin(yaw * 0.5);
let cp = Math.cos(pitch * 0.5);
let sp = Math.sin(pitch * 0.5);
let cr = Math.cos(roll * 0.5);
let sr = Math.sin(roll * 0.5);
@yesseecity
yesseecity / someShellScript.sh
Last active January 11, 2023 10:06
In dual OS, sync time on Ubuntu & windows
sudo apt-get install ntpdate
sudo ntpdate time.windows.com
sudo hwclock --localtime --systohc
@yesseecity
yesseecity / .gitconfig
Created May 7, 2020 01:54
My git config
[user]
name = "Tid"
email = "yesseecity@yahoo.com.tw"
[core]
editor = vim
excludesfile = /home/tid/.gitignore
[alias]
tree = log --oneline --decorate --all --graph
~
@yesseecity
yesseecity / gist:f31f9f50b22bd06ec6e85603f1595961
Created November 14, 2019 09:19
My bash style in terminal
prompt="\n[\[\033[0;1;33m\]\h:\[\033[0;1;32m\]${YROOT}\[\033[0;1;36m\]\w\[\e[0;0m\]]\n\[\033[0;1;32m\]\u\[\033[0;1;31m\][\l]\[\033[0;0m\]\j${VIMENV}\$ "
case $TERM in
rxvt*|xterm*)
export PS1="\[\033]0;\H${YROOT}:\w\007\]$prompt"
;;
screen*)
#export PS1="\[\033k\H:\w\033\134\]$prompt"
export PS1=$prompt
;;
@yesseecity
yesseecity / HMM-example.py
Created November 8, 2017 06:10
HMM-example, python2
# -*- coding:utf-8 -*-
# Filename: viterbi.py
# Author:hankcs
# Date: 2014-05-13 下午8:51
states = ('Rainy', 'Sunny')
observations = ('walk', 'shop', 'clean')
start_probability = {'Rainy': 0.6, 'Sunny': 0.4}