Skip to content

Instantly share code, notes, and snippets.

View kingsimba's full-sized avatar

Feng Zhaolin kingsimba

  • NavInfo
  • Beijing
View GitHub Profile
@kingsimba
kingsimba / config_sample.json
Last active July 6, 2022 12:46
config_sample.json
{
"configs":[
{
"devices":[
"asd2323",
"dsfas34"
],
"config":{
"depth_camera":{
"enable":false
@kingsimba
kingsimba / benchmark_eigen_speed.cpp
Last active October 26, 2021 09:44
Compare eigen with traditional way of calculating large amount of standard deviation
// Compare eigen with traditional way of calculating large amount of standard deviation
// Result (Raspberry PI model 4B - Compiled with GCC 8.3 with -O3)
// Eigen: 1071 ms
// Traditional: 2464 ms
// Result (AMD Ryzen 5 4600G - Compiled with clang 13.0.0 with -O3):
// Eigen: 129 ms
// Traditional: 777 ms
@kingsimba
kingsimba / string_slice.cpp
Last active February 9, 2021 14:04
Try to make std::string more efficient
#include "string_slice.h"
#include "gf_string.h"
#include "jansson/jansson.h"
#include "pch_gis_runtime.h"
#include "tr_stdlib.h"
bool StringCharIter::Next(wchar32* cOut, int* consumedBytesOut) {
int32_t c;
const char* newStr = utf8_iterate(str_, length_, &c);

Modifying an Existing Docker Image

To install a custom package or modify an existing docker image we need to

  1. run a docker a container from the image we wish to modify
  2. modify the docker container
  3. commit the changes to the container as a docker image
  4. test changes made to image

1.) Running a docker container from an image

@kingsimba
kingsimba / configure_muliple_gcc.sh
Created April 27, 2020 05:14 — forked from SunnyRaj/configure_muliple_gcc.sh
Configure multiple GCC versions on ubuntu
#!/usr/bin/env bash
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo apt-get install -y gcc-4.8 g++-4.8 gcc-4.9 g++-4.9 gcc-5 g++-5 gcc-6 g++-6 gcc-7 g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10