Skip to content

Instantly share code, notes, and snippets.

@walsvid
walsvid / fitPlane.py
Created March 28, 2022 07:42 — forked from RustingSword/fitPlane.py
least square plane fitting of 3d points
import numpy as np
import scipy.optimize
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.gca(projection='3d')
def fitPlaneLTSQ(XYZ):
@walsvid
walsvid / chamfer_distance.py
Created March 28, 2022 07:42 — forked from sergeyprokudin/chamfer_distance.py
Vanilla Chamfer distance computation in NumPy
import numpy as np
from sklearn.neighbors import NearestNeighbors
def chamfer_distance(x, y, metric='l2', direction='bi'):
"""Chamfer distance between two point clouds
Parameters
----------
x: numpy array [n_points_x, n_dims]
@walsvid
walsvid / readEXR.py
Created January 14, 2019 14:28 — forked from jadarve/readEXR.py
Extract RGB and depth channels from exr images.
import numpy as np
import OpenEXR as exr
import Imath
def readEXR(filename):
"""Read RGB + Depth data from EXR image file.
Parameters
----------
filename : str
@walsvid
walsvid / golang, ubuntu go get in china.md
Created April 19, 2018 14:14 — forked from alexniver/golang, ubuntu go get in china.md
ubuntu下, 使用shadowsock和Privoxy帮助你在命令行中, 无障碍进行go get

#前言 由于大家都懂的, 国内使用go get的时候, 经常会各种失败, 如果有vpn的话, 打开vpn, 问题就解决了, 但vpn其实挺不灵活的.

相对来说shadowsock则灵活得多.

#解决方案 shadowsock + Privoxy

思路就是, 使用shadowsock建立一个本地sock5代理, 但因为go get 需要http代理, 所以需要使用privoxy把sock5代理转为http代理.

@walsvid
walsvid / tmux-cheatsheet.markdown
Created May 12, 2017 14:24 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@walsvid
walsvid / tmux-cheatsheet.markdown
Created April 26, 2017 05:57 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

tmux at [-t 会话名]
@walsvid
walsvid / Uninstall-pkg.md
Created April 17, 2017 13:41 — forked from githubutilities/Uninstall-pkg.md
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info 
@walsvid
walsvid / install_nvidia_driver_in_ubuntu1604.md
Last active February 10, 2024 17:39 — forked from terrydang/install_nvidia_driver_in_ubuntu1604.md
Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

@walsvid
walsvid / install_cuda_7_5_Unbuntu_16_04.md
Created March 28, 2017 12:16 — forked from terrydang/install_cuda_7_5_Unbuntu_16_04.md
Ubuntu 16.04 安装 NVIDIA CUDA Toolkit 7.5

Ubuntu 16.04 安装 NVIDIA CUDA Toolkit 7.5

NVIDIA CUDA Toolkit 7.5 目前官方只适配了 Ubuntu 15.04 和 Ubuntu 14.04 两个版本的系统。如果你是这两个系统,可以直接去官方下载安装文件安装。

由于其没有适配 Ubuntu 16.04 ,这里我们通过下载官方为 CUDA 7.5 为 Uubuntu 15.04 适配的 runfile(local) 安装。

@walsvid
walsvid / subsets.py
Created February 4, 2017 12:12 — forked from makto/subsets.py
求某个集合的所有子集
#-*- coding: utf-8 -*-
"""
给定集合 test_case
输出其所有子集
"""
def getsubs(father, size):
"""获取集合 father 的
指定长度 size 的所有子集合"""