Skip to content

Instantly share code, notes, and snippets.

View samsonq's full-sized avatar
🏀
Balling

Samson Qian samsonq

🏀
Balling
View GitHub Profile
@samsonq
samsonq / DDOS.py
Last active January 30, 2021 07:19
Denial of Service
from DOS import DOS
import requests
class DDOS(DOS):
def __init__(self):
"""
Author: Samson Qian
"""
import numpy as np
from matplotlib import pyplot as plt
class LogisticRegression:
"""
A Logistic Regression model that uses single-featured, labeled data. Contains methods to
"""
Author: Samson Qian
"""
import numpy as np
class Convolution:
"""
A convolution layer used to convolve an image with pixels. Represented by a 3-d array with
a specified number of filters to use and the size of the filters.
@samsonq
samsonq / newton.py
Last active February 21, 2021 21:21
Newton's Method
import numpy as np
import sympy as sym
import math
class NewtonsMethod:
"""
Newton's Method to find zeros and optimize functions.
"""
def __init__(self, f):
@samsonq
samsonq / a_star.py
Last active September 17, 2021 05:57
Search Algorithms
import numpy as np
def a_star():
...
@samsonq
samsonq / kadane.py
Last active October 31, 2023 16:56
Kadane's Algorithm for Maximum Sum Subarray
class MaxSumSubarray:
"""
Approaches to solving the Maximum Subarray problem.
"""
def __init__(self, arr):
self.arr = arr
def brute_force(self):
"""
Uses brute force approach to find maximum sum of subarray for inputted array.
@samsonq
samsonq / gradient_descent.py
Created March 4, 2021 01:17
Gradient Descent
import numpy as np
def gradient_descent():
...
@samsonq
samsonq / git
Created March 8, 2021 23:53
Git Commands
// delete branch locally
git branch -d <branchName>
// delete branch remotely
git push origin --delete <branchName>
@samsonq
samsonq / sort.py
Created March 8, 2021 23:56
Sorts
class Sort:
def __init__(self, arr):
self.arr = arr
def brute_force(self):
return
def quick_sort(self):
return
@samsonq
samsonq / heroku_deploy
Last active March 11, 2021 00:31
Heroku Application
// 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