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
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$]{$documentclass$} | |
\usepackage[T1]{fontenc} | |
\usepackage{lmodern} | |
\usepackage{amssymb,amsmath} | |
\usepackage{euler} | |
\usepackage{ifxetex,ifluatex} | |
\usepackage{fixltx2e} % provides \textsubscript | |
% use microtype if available | |
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex | |
\IfFileExists{microtype.sty}{\usepackage{microtype}}{} |
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
Arg Name or Optional Flags: | |
positional : str = "foo" | |
options : str = "-f", "--foo" | |
Standard: | |
action : str = [store], append, store_true, store_false, store_const, append_const, version | |
default : * = [None] | |
type : callable = [str], argparse.FileType(mode='wb', bufsize=0) | |
Exotic: |
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
IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64") # for desktop | |
message("1") | |
ELSE(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") # for tx2 | |
message("2") | |
ELSE() | |
message(FATAL_ERROR "Unknown System Architecture: ${CMAKE_SYSTEM_PROCESSOR}") | |
ENDIF() |
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
// A simple quickref for Eigen. Add anything that's missing. | |
// Main author: Keir Mierle | |
#include <Eigen/Dense> | |
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d. | |
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols. | |
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd. | |
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major. | |
Matrix3f P, Q, R; // 3x3 float matrix. |
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
# !pip install PyGeometry | |
from geometry import * | |
import numpy as np | |
def quaternion_multiply(p, q): | |
assert isinstance(p, np.ndarray) and p.shape == (4,) | |
assert isinstance(q, np.ndarray) and q.shape == (4,) | |
p0, p1, p2, p3, q0, q1, q2, q3 = p[0], p[1], p[2], p[3], q[0], q[1], q[2], q[3] | |
r0 = + p0 * q0 - p1 * q1 - p2 * q2 - p3 * q3 | |
r1 = + p0 * q1 + p1 * q0 + p2 * q3 - p3 * q2 |
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
Bing image scraper example using Python to query and scrape Microsoft Bing image search. |
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
#!/bin/bash | |
# An easy script to record GIF based on [ffcast](https://github.com/lolilolicon/FFcast). | |
# With default options, you draw a region to start recording, press 'q' to stop, and a `screenshot.gif` file will be saved to current directory. | |
# Read the [WIKI](https://github.com/lolilolicon/FFcast/wiki/GIF-Howto) and this script to learn more details. | |
# Author of this script: huangyuyao@outlook.com | |
STEP1=YES | |
STEP2=YES | |
FPS=10 |
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/python3 | |
""" | |
remove latest file/subfolder in the given folder. | |
Author: huangyuyao@outlook.com | |
""" | |
import sys | |
import os | |
import time | |
import sys |
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
python3 -m pip install --extra-index-url https://rospypi.github.io/simple/ rospy rosbag sensor_msgs --user |
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 os | |
import hashlib | |
def escape(s): | |
allowed = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVQXYZ0123456789_' | |
s = ''.join(i for i in s if i in allowed) | |
return s | |
def make_cache(value_creator, cache_name, cache_dir='__pycache__/'): | |
cache_name = escape(cache_name) |
OlderNewer