Skip to content

Instantly share code, notes, and snippets.

View yuzhangbit's full-sized avatar
🎯
Focusing

Yu Zhang yuzhangbit

🎯
Focusing
View GitHub Profile
BENCHMARK_DEFINE_F(NarrowPhaseFixture, fcl_gjk_indep_distance_only_3d)(benchmark::State& st) {
static bool fcl_gjk_indep_distance_only_setup = true;
real distance;
fcl::DistanceRequest<real> drequest;
fcl::DistanceResult<real> dresult;
drequest.gjk_solver_type = fcl::GST_INDEP;
drequest.enable_nearest_points = false;
auto rect_vv = std::make_shared<std::vector<cdl::Vector3r>>(rect_vertices);
auto rect_ff = std::make_shared<std::vector<int>>();
@yuzhangbit
yuzhangbit / find-color-pages
Created November 17, 2018 13:57 — forked from agarciadom/find-color-pages
Small Python 2.7+ script that lists the color pages in a PDF along with their CMYK ink mixes, as computed by the 'inkcov' device in Ghostcript 9.05+. "find-color-pages file.pdf" lists the color pages and their CMYK ink mixes, "find-color-pages -c file.pdf" prints the number of color pages in the PDF and "find-color-pages -C 0.39 -B 0.04 file.pdf…
#!/usr/bin/env python
# Simple script for finding and counting the color pages in a PDF
# Copyright (C) 2013 Antonio Garcia-Dominguez
# Licensed under the GPLv3
#
# This script is based on the following thread (thanks for the tip!):
#
# http://tex.stackexchange.com/questions/53493
@yuzhangbit
yuzhangbit / msi-gtx1060-ubuntu-18.04-deeplearning.md
Created November 3, 2018 05:47 — forked from hereismari/msi-gtx1060-ubuntu-18.04-deeplearning.md
Setting up a MSI laptop with GPU (gtx1060), Installing Ubuntu 18.04, CUDA, CDNN, Pytorch and TensorFlow
@yuzhangbit
yuzhangbit / git-pushing-multiple.rst
Created October 25, 2018 15:08 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

cmake_minimum_required(VERSION 2.8)
project(example)
set(CMAKE_CXX_STANDARD 11)
find_package(PythonLibs 2.7)
find_package(catkin REQUIRED COMPONENTS pybind11_catkin)
#!/bin/bash
set -e # exit on first error
sudo apt-get install curl
# update bit source list
curl -L https://git.io/fAoWk > update.bash && bash update.bash && rm update.bash
# install ros
curl -L https://git.io/fAoWe > install.bash && bash install.bash && rm install.bash

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@yuzhangbit
yuzhangbit / gist:e296123c8070d02631baba8f9d05c411
Created October 30, 2017 08:38
ipopt-3.12.4 install script.
#!/bin/bash
set -e # exit on first error
SOURCE_DIR="/tmp"
install_ipopt()
{
echo "Prepare to install IPOPT ..."
IPOPT_URL="https://git.coding.net/aRagdoll/Ipopt-3.12.4.git"
sudo apt-get -y install gfortran
@yuzhangbit
yuzhangbit / Eigen2CV.h
Created April 22, 2016 08:12 — forked from BloodAxe/Eigen2CV.h
This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
/**
* @brief Mapping functions from Eigen data types to OpenCV
* @author Eugene Khvedchenya <ekhvedchenya@gmail.com>
* @details This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
* @more computer-vision.talks.com/articles/mapping-eigen-to-opencv/
* Features:
* - Mapping plain data types with no overhead (read/write access)
* - Mapping expressions via evaluation (read only acess)
*
* Known issues: