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
| #!/usr/bin/env bash | |
| # Ensure that your CWD is your project root | |
| wget https://pypi.python.org/packages/source/s/simpy/simpy-3.0.5.tar.gz#md5=19262488f1b0e6b77556820dd2b42d67 | |
| tar xzf simpy-*.tar.gz | |
| mv simpy-*/simpy . | |
| # Cleanup deployment artifacts | |
| rm simpy-*.tar.gz | |
| rm -rf simpy-* |
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 = [8,1,3,4,5,10] | |
| ans = 22 | |
| def non_adjacent_sum(A): | |
| # Small cases | |
| if len(A) < 3: | |
| return max(A) | |
| # Base cases | |
| prev_prev, prev = A[0], A[1] |
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
| .svm-example { | |
| position: relative; | |
| height: 60px; | |
| width: 340px; | |
| margin: 1.5em auto; | |
| line-height: 60px; | |
| } | |
| .svm-example div { | |
| position: absolute; | |
| top: 10px; |
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
| import numpy as np | |
| # The Fibonacii matrix | |
| M = np.array([[0, 1], [1, 1]], dtype=np.float32) | |
| # Compute the eigendecomposition of the matrix | |
| w, v = np.linalg.eig(M) | |
| inv_v = np.linalg.inv(v) | |
| base_case = np.array([0, 1]).T # base case as a column vector |
OlderNewer