Skip to content

Instantly share code, notes, and snippets.

View jondef's full-sized avatar
🍵
Happily turning tea into { code; }

Jon Defilla jondef

🍵
Happily turning tea into { code; }
  • Zürich, Switzerland
  • 19:50 (UTC +02:00)
View GitHub Profile
Email: 982092332@qq.com
SN: GAWAE-FCWQ3-P8NYB-C7GF7-NEDRT-Q5DTB-MFZG6-6NEQC-CRMUD-8MZ2K-66SRB-SU8EW-EDLZ9-TGH3S-8SGA
@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.
@jh0ker
jh0ker / mwt.py
Last active February 3, 2023 20:38
Memoize-with-timeout decorator
#!/usr/bin/env python
# Source: http://code.activestate.com/recipes/325905-memoize-decorator-with-timeout/#c1
import time
from functools import wraps
class MWT:
"""Memoize With Timeout"""
_caches = {}
_timeouts = {}