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
// dynamically load the script on demand | |
class ScriptLoader { | |
constructor(script) { | |
this.script = script; | |
this.scriptElement = document.createElement('script'); | |
this.head = document.querySelector('head'); | |
} | |
load () { | |
return new Promise((resolve, reject) => { |
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
// | |
// This is a lattice random walk config generator using pivot algorithm. | |
// can be self-avoid or not self-avoid | |
// lattice_SAW(chain array, number of steps(monomers), step length(bond), self-avoid or no-self-avoid) | |
// | |
// Created by guangshi on 8/25/14. | |
// Copyright (c) 2014 Guang Shi. All rights reserved. | |
// | |
#include <math.h> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# cython: language_level=3 | |
import cython | |
import numpy as np | |
from cython.parallel import prange, parallel | |
from libc.math cimport sqrt | |
from libc.math cimport nearbyint | |
@cython.boundscheck(False) | |
@cython.wraparound(False) |
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 matplotlib.pyplot as plt | |
import matplotlib.colors as mcolors | |
# here 'gs-style' is the name reference to the custom matplotlib style | |
# typically saved to ~/.matplotlib/stylelib/ | |
plt.style.use('gs-style') | |
# Fixing random state for reproducibility | |
np.random.seed(19680801) |
OlderNewer