Skip to content

Instantly share code, notes, and snippets.

View niebayes's full-sized avatar
:octocat:
good to see you

niebayes niebayes

:octocat:
good to see you
  • Greptime
  • Hangzhou Zhejiang
View GitHub Profile
@niebayes
niebayes / Eigen Cheat sheet
Created July 29, 2020 09:52 — forked from gocarlos/Eigen Cheat sheet
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// 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.
@a6y3ap
a6y3ap / JosephusProblem.java
Last active July 3, 2021 11:49
Josephus Problem using Bitwise Operation (Java)
/*
* Solution of Josephus Problem using Bitwise Operation
* Shifting the most-significant set bit of n to the
* least significant bit will return the safe position.
*
* ====================== EXPLANATION ======================
*
* n (41) the number of people standing in the circle
* n = 101001
*
@marten-voorberg
marten-voorberg / Vector3.py
Last active October 5, 2020 19:09
Vector3 Class Python
import math
class Vector3:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
# Used for debugging. This method is called when you print an instance
def __str__(self):
@omaraflak
omaraflak / main.cpp
Last active March 23, 2024 14:44
Image convolution in C++ + Gaussian blur
#include <iostream>
#include <vector>
#include <assert.h>
#include <cmath>
#include <png++/png.hpp>
using namespace std;
typedef vector<double> Array;
typedef vector<Array> Matrix;
@gocarlos
gocarlos / Eigen Cheat sheet
Last active February 11, 2024 14:07
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// 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.
@squarism
squarism / iterm2.md
Last active May 22, 2024 12:52
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@RDCH106
RDCH106 / OpenCV_Mouse_Event_Handler.cpp
Last active June 19, 2020 12:16
OpenCV Mouse Event Handler
#include "opencv2/opencv.hpp"
#include <iostream>
using namespace cv;
using namespace std;
Mat frame;
void mouseEventHandler(int event, int x, int y, int flags, void* param)
{
@royshil
royshil / SimpleAdHocTracker.cpp
Created March 15, 2015 18:21
Ad-Hoc AR tracker from a planar scene without need for markers
/*
* SimpleAdHocTracker.cpp
*
* Created on: Mar 15, 2015
* Author: roy_shilkrot
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Roy Shilkrot
*
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@rxaviers
rxaviers / gist:7360908
Last active May 24, 2024 08:06
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: