Instantly share code, notes, and snippets.

View spline.h
#pragma once
#include <sophus/se3.hpp>
// follows spline fusion paper
// modified from minimal_ceres_sophus and kontiki
// forward declaration
namespace ceres
{
View autodiff.cc
#include <glog/logging.h>
#include <unsupported/Eigen/AutoDiff>
#include <unsupported/Eigen/LevenbergMarquardt>
template <typename T>
Eigen::Matrix<T, Eigen::Dynamic, 1>
func(const Eigen::Matrix<T, Eigen::Dynamic, 1> &xs,
const Eigen::Matrix<T, 3, 1> &x)
{
auto xsa = xs.array();
View SATurtle.cc
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
namespace SATurtle {
struct CNF {
CNF(const std::string &fn);
int vc = 0; // #var
View ceres_ba.cc
#include <Eigen/Core>
#include <ceres/ceres.h>
#include <ceres/rotation.h>
#include <fstream>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <vector>
DEFINE_string(problem, "problem-49-7776-pre.txt", "dataset file name");
View fibo.cc
#include <iostream>
template<int N>
struct fibo_result { int val = N; };
template<int ...Ns>
struct fibo_impl;
template<int a, int b, int I, int ...Ns>
struct fibo_impl<a, b, I, I, Ns...>
View ast_dump.py
#!/usr/bin/env python3
import sys
import clang.cindex
INDENT = 4
K = clang.cindex.CursorKind
def is_std_ns(node):
return node.kind == K.NAMESPACE and node.spelling == 'std'
View packages.el
;;; packages.el --- lsp-cquery layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Shen Chao <scturtle@Enigma.lan>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
View .stalonetrayrc
icon_gravity E
geometry 5x1-0+0
max_geometry 5x1-0+0
background "#000000"
icon_size 20
kludges force_icons_size
skip_taskbar
View gan.py
from __future__ import print_function
import numpy as np
from scipy.stats import norm
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.contrib.layers as tfl
import tensorflow.contrib.framework as tff
def minibatch(features):
size_a, size_b, size_c = features.get_shape()[1], 3, 3
View pf.py
import numpy as np
from scipy.stats import norm
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.patches import Arrow, Circle
fig = plt.figure("pf", figsize=(7., 7.))
ax = fig.gca()
landmarks = [[20., 20.], [20., 50.], [20., 80.],