This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//$fn = 90; | |
diameter = 30.5; | |
spacing = 2; | |
width = 4 * spacing + 3 * diameter; | |
depth = 2 * spacing + diameter; | |
height = 20 + spacing; | |
difference() { | |
scale([0.94, 0.85, 1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.stats import rv_continuous | |
import matplotlib.pyplot as plt | |
class double_well_gen(rv_continuous): | |
def _pdf(self, x, mu, sigma): | |
sigma2 = sigma**2 | |
return ((np.exp(-(x - mu)**2 / (2.0 * sigma2)) | |
+ np.exp(-(x + mu)**2 / (2.0 * sigma2))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun switch-to-python-buffer () | |
"Switch to Python shell buffer quickly." | |
(interactive) | |
(let ((python-buffer (get-buffer "*Python*"))) | |
(if python-buffer | |
(switch-to-buffer python-buffer) | |
(run-python)))) | |
(global-set-key (kbd "C-c z") 'switch-to-python-buffer) | |
(global-set-key (kbd "C-c C-z") 'switch-to-python-buffer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.gaussian_process import GaussianProcessRegressor | |
def gradient(gpr: GaussianProcessRegressor, Xstar: np.ndarray) -> np.ndarray: | |
"""Evaluate the gradient of a Gaussian process at a given point.""" | |
X = gpr.X_train_ | |
m, n = Xstar.shape[0], X.shape[0] | |
assert Xstar.shape[1] == X.shape[1] | |
Xstar_minus_X = Xstar[:, np.newaxis, :] - X[np.newaxis, :, :] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.decomposition import PCA | |
from scipy.spatial.distance import pdist | |
def get_points_from_square(num_points: int, ambient_dim: int) -> np.ndarray: | |
"""Get points from a grid of a linear manifold (a square in this case) endowed with the Euclidean metric. | |
""" | |
aux = np.linspace(-1, 1, int(np.sqrt(num_points))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*[ Radius of big circle ]*/ | |
r0 = 150; | |
/*[ Radius of tube ]*/ | |
r1 = 8; // r0/10.0; | |
/*[ Tolerance ]*/ | |
rtol = 0.2; | |
module joint(r) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Tuple | |
import numpy as np | |
import scipy.spatial | |
DEFAULT_NUM_EIGENPAIRS: int = 10 + 1 | |
def diffusion_maps(points: np.ndarray, epsilon2: float, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import mdtraj as md | |
import tqdm | |
def compute_distance_matrix(trajectory: md.Trajectory) -> np.ndarray: | |
"""Compute distance matrix. | |
""" | |
topology = trajectory.topology |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reset | |
load '~/gnuplot-colorbrewer/qualitative/Set2.plt' # Optional | |
set terminal push | |
set terminal epslatex size 3.22in, 2.255in | |
set output "fig-example.tex" | |
unset key | |
set border 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; StumpWM initialization file. | |
(ql:quickload "swank") | |
(in-package :stumpwm) | |
(setf *window-border-style* :none | |
*resize-hides-windows* nil) | |
;;; Redirect output to ~/.stumpwm.d/stumpwm.log |