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
def fibonacci_sequence(n, n1, n2): | |
assert n > 0, "output length must be > 0" | |
sequence = [n1, n2] | |
while len(sequence) < n: | |
sequence.append(sequence[-1]+sequence[-2]) | |
return sequence | |
def recursive_fibonacci(n, n1, n2, sequence=[]): | |
if len(sequence) < 2: |
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
""" | |
Implementation of Principal Component Analysis | |
Author: Samson Qian | |
""" | |
import numpy as np | |
class PCA: | |
""" | |
Principal Component Analysis | |
""" |
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 matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
import random | |
def brownian_model_plot(length): | |
# Length of array (or how long motion is modeled) | |
X = np.zeros((length,2)) | |
for i in range(0,len(X) - 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
**Basic Characters**: | |
^ | |
Matches the expression to its right, at the start of a string before it experiences a line break | |
$ | |
Matches the expression to its left, at the end of a string before it experiences a line break | |
. | |
Matches any character except newline | |
a | |
Matches exactly one character a |
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 random | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import animation | |
from matplotlib.animation import FuncAnimation | |
def updatePosition(position, index, operator): | |
p = list(position) | |
if operator: | |
p[index] += 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
from blockcypher import * | |
import json | |
from cryptos import * | |
def getBalance(adr): | |
res = get_address_full(address=adr, coin_symbol="doge") | |
return int(res['balance']) / 100000000 | |
def sendDoges(fromPriv,toPub, amount): |
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
// Ensure `README.md` and `setup.py` are properly set up | |
// Update distribution packages | |
python -m pip install --user --upgrade setuptools wheel | |
python -m pip install --user --upgrade twine | |
// Create package distribution files | |
python setup.py sdist bdist_wheel | |
ls dist // ensure dist files are present |
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
// login | |
heroku login -i | |
// add repo to heroku | |
// create or pick existing heroku project name | |
heroku git:remote -a {your-project-name} | |
// deploy heroku app | |
git push heroku master |
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
class Sort: | |
def __init__(self, arr): | |
self.arr = arr | |
def brute_force(self): | |
return | |
def quick_sort(self): | |
return |
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
// delete branch locally | |
git branch -d <branchName> | |
// delete branch remotely | |
git push origin --delete <branchName> |