Skip to content

Instantly share code, notes, and snippets.

View tanzby's full-sized avatar
🏠
Working from home

iceytan tanzby

🏠
Working from home
  • GuangZhou,China
View GitHub Profile
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
@tanzby
tanzby / compressimage_msg_to_cvmat.h
Created December 2, 2020 14:13
Convert sensor_msgs::CompressedImagePtr to cv::Mat
cv::Mat img = cv::imdecode(cv::Mat(msg->data), cv::IMREAD_GRAYSCALE);
@tanzby
tanzby / techrep.cls
Created November 24, 2020 10:24
Latex Document Class for Writing a Tech Report
\ProvidesClass{techrep}[Latex class for Tech Report]
\NeedsTeXFormat{LaTeX2e}
\LoadClass[10pt, a4paper, UTF8]{ctexart}
\usepackage[
top=2cm,
bottom=2cm,
left=2cm,
right=2cm
]{geometry}
@tanzby
tanzby / gen_random.h
Created October 9, 2020 06:09
Generate Uniform Random Value
#include <random>
template <typename T>
int UniformRand(const T min, const T max)
{
static thread_local std::mt19937 generator(std::random_device{}());
std::uniform_int_distribution<T> distribution(min, max);
return distribution(generator);
}
@tanzby
tanzby / compute_area_of_two_overlap_triangles.cpp
Last active September 10, 2020 15:11
program for computing area of two overlap triangles
#include <iostream>
#include <Eigen/Eigen>
using namespace std;
class TriangleOverlap
{
public: