Skip to content

Instantly share code, notes, and snippets.

View sidd607's full-sized avatar
🧑‍💻

Siddartha Sekhar Padhi sidd607

🧑‍💻
View GitHub Profile
@sidd607
sidd607 / CowinQuery.py
Last active May 28, 2021 15:20
Python Script to keep querying the Cowin website to fetch available time slots
# Conditions
USE_PINCODES = False # FLAG to search by pincode or district
VACCINE_CHOICE = ["COVISHIELD", "COVAXIN"]
AGE_LIMIT = [18]
PINCODES_TO_SEARCH = ["110037"]
DISTRICT_CODES_TO_SEARCH = ["140","141","142","143","144","145","146","147","148","149","150"]
TIME_INTERVAL = 60 # in seconds
ALLOW_DESKTOP_NOTIFICATION = True # Requires additional libraries -> https://pypi.org/project/py-notifier/
DOSE1 = "available_capacity_dose1"
DOSE2 = "available_capacity_dose2"
class Node:
def __init__ (self, info):
self.left = None
self.right = None
self.info = info
def addLeft(self, node):
self.left = node
def getLeft(self):
class SudokuSolver:
# Initializing required variables and validate board
def __init__(self, board, boardSize=9, boxSize=3):
self.boardSize = boardSize
self.boxSize = boxSize
self.board = board
self.__validateBoard__()
# Validate if the board is of the proper format else throw an exception
def __validateBoard__(self):
MAX = 999999999
def get_min(a, b, c, index):
if a <=b and a <=c:
return a, index -1
if b <=a and b <= c:
return b, index // 2
if c <= a and c <= b:
return c, index // 3
@sidd607
sidd607 / price_tracker.py
Last active February 27, 2019 09:19
Tracks the profit/loss of cryptco currencies through koinex ticker API
#!/usr/bin/env python
"""
author: sidd607@gmail.com
version: 0.0.1
Reads the buy details from a csv file (coins.csv) and calculates the wallets profit
Uses Koinex API tracker
csv format
Coin,Date,Quantity,BuyPrice,Cost
https://search-siddtest-xcno5mgnsqidqwrzg2js25i5ge.us-west-2.es.amazonaws.com/_plugin/kibana/#/visualize/
create?type=histogram&indexPattern=plivoredshift&_g=()&_a=(
filters:!(),
linked:!f,
query:(
query_string:
(analyze_wildcard:!t,query:'*')),vis:
(aggs:!((id:'1',params:(),schema:metric,type:count),
(id:'3',params:(field:cloud_rate,order:desc,orderBy:'1',size:5),
#-------------------Retrieving and Cleaning Data--------------
data = read.csv("filter.csv",header=T, na.strings=c(""))
sapply(data, function(x) sum(is.na(x)))
data = subset(data,select=c(2,3,5,6,7,8,10,12))
data$Age[is.na(data$Age)] = mean(data$Age, na.rm = T)
#is.factor(data$Sex)
#is.factor(data$Embarked)
data = data[!is.na(data$Embarked),]
rownames(data) = NULL
trainData = data[1:800,]
@sidd607
sidd607 / logistic_regression.R
Created March 29, 2016 17:23 — forked from mick001/logistic_regression.R
Logistic regression tutorial code. Full article available at http://datascienceplus.com/perform-logistic-regression-in-r/
# Load the raw training data and replace missing values with NA
training.data.raw <- read.csv('train.csv',header=T,na.strings=c(""))
# Output the number of missing values for each column
sapply(training.data.raw,function(x) sum(is.na(x)))
# Quick check for how many different values for each feature
sapply(training.data.raw, function(x) length(unique(x)))
# A visual way to check for missing data
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <vector>
using namespace std;
using namespace cv;
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <vector>
using namespace std;
using namespace cv;