Github can render LaTeX equations in jupyter notebooks but directly embedding equations in markdown files don't work. Solution is to embed URL correspondingto LaTeX equation. The page below shows how to convert LaTeX to URL. All the credit goes to this gist and its comments.
This file contains hidden or 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
| # A simple implementation of Stack data structure in python | |
| # LIFO: last (item) in, first (item) out | |
| # Insert at the end, pop the front of the list | |
| class Stack(): | |
| def __init__(self): | |
| self.items = [] | |
| def isEmpty(self): |
This file contains hidden or 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
| def pointAlignment(ref, move): | |
| """ | |
| Mahd Sadjadi (2017) | |
| This is a function which takes two sets of | |
| points each with N points (both inputs are assumd to be | |
| numpy arrays of N*2 shape). The first input is | |
| the reference grid and the second is the point set to | |
| be aligned with the reference. | |
| This function shifts and rotate points to | |
| make the two sets aligned and returns the |
This file contains hidden or 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
| """ | |
| Mahd Sadjadi (2018) | |
| This is a set of functions to compute the | |
| energy barrier between two spring networks. | |
| The morphing is done using the linear interpolation. | |
| Example: | |
| ------- | |
| s1 = np.random.rand(10,2) | |
| s2 = np.random.rand(10,2) |
This file contains hidden or 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
| def isFlipped(sites1, sites2, bonds): | |
| """ | |
| Check if neighbors of a vertex | |
| have changed the cyclic order. | |
| """ | |
| def sortClockwiseAroundVertex(coordinates, root, neighbors): | |
| ''' | |
| Sort the neighbors of a vertex, | |
| such that the one with lowest index |
This file contains hidden or 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
| # Create a triangle + label of vertices | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| %matplotlib inline | |
| fig, ax = plt.subplots(1,1,figsize=(5,5)) | |
| ax.plot(*coordinates[bonds].T, '-o', lw=3); | |
| for i, p in enumerate(coordinates): |
In Pyspark, you can use:
persisted_RDDs = spark.sparkContext._jsc.getPersistentRDDs()
for (i, rdd_) in persisted_RDDs.items():
rdd_.unpersist()
spark is of type pyspark.sql.session.SparkSession.
OlderNewer