Skip to content

Instantly share code, notes, and snippets.

View sshh12's full-sized avatar
👨‍💻
Where there is code, there is code.

Shrivu Shankar sshh12

👨‍💻
Where there is code, there is code.
View GitHub Profile
@sshh12
sshh12 / DPSChecker.py
Last active March 25, 2018 18:49
aka how I got my license
from xml.dom import minidom
import requests
import time
Q_ID = 17937
LOC_ID = 3532
DAYS = 3
AUTH = "fill me"
TARGET_MONTH = "fill me"
@sshh12
sshh12 / probdist.py
Created November 5, 2017 23:11
Prob of even distribution of n over k values.
import matplotlib.pyplot as plt
import random
import math
def get_prob(n, k, trials=200000):
perfect = 0
for _ in range(trials):
@sshh12
sshh12 / pan.py
Last active November 17, 2017 00:35
PickANumber
def get_scores(nums, turn=0, a=0, b=0):
if len(nums) == 0:
return (a, b)
else:
left = get_scores(nums[1:],
def multiadder(n):
if n == 1:
return lambda t: t
else:
return lambda a: lambda b: multiadder(n-1)(a+b)
def multiadder2(n):
if n == 1:
def f(x):
return x
@sshh12
sshh12 / HackResponse.md
Last active December 6, 2023 17:59
Hacking My Grades...

Email Response

The information you sent was amazing. I think you definitely have a future in computers. 

I am sharing your information with the manufacture of the Home Access Center (HAC), SunGard. 

I will share their findings with you as well. 

Thank you again for your honorable and ethical approach to an issue. 
@sshh12
sshh12 / CountLines.py
Last active March 25, 2018 18:48
Count total lines of code
import glob
import os
## Count
exts = ['.py', '.js', '.md', 'java', '.html', '.css', '.pde']
def count_lines(fn):
i = 0
@sshh12
sshh12 / CS UIL.ipynb
Created March 22, 2018 00:38
Messing w/CS UIL Data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from textblob.classifiers import DecisionTreeClassifier as TextClassifier
from datetime import datetime
import matplotlib.pyplot as plt
import csv
num_months = 13
with open('train.csv', 'r') as fp:
clf = TextClassifier(fp, format="csv")
@sshh12
sshh12 / ArrayMaker.java
Created September 4, 2018 18:40
Array Runtime Tests
public class ArrayMaker {
public static void main(String[] args) {
int N = 150000;
for(int n = 500; n < N; n += 100) {
long sumInt = 0, sumLong = 0, sumObject = 0;
import numpy as np
import cv2
class CellularAutomaton:
def __init__(self, size=1000, rule=0):
self.size = size
self.rule = rule