What do you want to save?
Add Code snippet
New code examples
-
Java 2022-02-03 12:21:34
tsp simulated annealing code
/// <span class="code-SummaryComment"><summary></span> /// Annealing Process /// <span class="code-SummaryComment"></summary></span> public void Anneal() { int iteration = -1; double tempera... Add solution -
Javascript 2022-02-03 00:15:48
jquery noconflict
var dom = {}; dom.query = jQuery.noConflict( true ); Add solution -
Javascript 2022-02-02 19:51:32
select everything but an element in react
import reactDom from "react-dom"; import history from "../history"; const Modal = () => { return reactDom.createPortal( <div onClick={() => history.push("/")} className="ui dimmer modals visib... Add solution -
Python 2022-02-02 10:30:11
make correlated array with cholesky decomposition python
import numpy as np #desired expected rho (of the distribution of the corr matrix) rho = 0.5 # desired correlation matrix cor_matrix = np.ones((5,5))* rho np.fill_diagonal(cor_matrix,1) # 1s in diagonal print(cor_matrix) # this is artificial case but it... Add solution -
Python 2022-02-02 06:06:04
matplotlib animation
import matplotlib.pyplot as plt from matplotlib import cm import numpy as np from celluloid import Camera numpoints = 10 points = np.random.random((2, numpoints)) colors = cm.rainbow(np.linspace(0, 1, numpoints)) camera = Camera(plt.figure()) for _ in ra... Add solution