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
function ratbatalert () | |
{ | |
# low battery alert for ratpoison | |
while true; | |
do | |
batt=$(upower -e|grep BAT0) | |
string_percent=$(upower -i $batt|grep 'percent') | |
percent=$(sed "s,percentage: ,," <<< $string_percent) | |
number=${percent::-1} | |
state=$(upower -i $batt|grep 'state') |
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
alias l="ls" | |
alias ll="ls -l" | |
alias la="ls -a" | |
alias act="source env/bin/activate" | |
alias v="vim" | |
alias v3="virtualenv -p python3 env" | |
alias v2="virutalenv -p python2 env" | |
Blue='\[\e[01;34m\]' | |
White='\[\e[01;37m\]' |
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
#! /bin/bash | |
git clone --depth 1 https://github.com/theSage21/judge-interface | |
cp -r questions judge-interface/webserver/ | |
cd judge-interface | |
./setup.sh | |
source env/bin/activate | |
cd webserver | |
cp -r questions/* ./ | |
python upload.py |
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 os | |
import sys | |
import time | |
import configparser | |
from threading import Thread | |
ALIVE = True # SOFTWARE IS RUNNING | |
SPEAKING = True # IS It speaking | |
book = sys.argv[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
# We use a class since, well it makes more sense this way and | |
# is easier to maintain in the future | |
class DB: | |
''' | |
BelonQuery Database | |
''' | |
def __init__(self, columns_and_types): | |
''' | |
columns must be list of (colname, type) |
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
# Define some special things | |
SPECIAL = '*|' | |
ALPHABET = '10' | |
EPSILON = None | |
# functions | |
def automaton_print(automaton): | |
"Neatly prints the automaton" | |
states, alphabet, start, final, transfer = automaton | |
print('STATES : ', states) |
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
# Based on | |
# https://www.packtpub.com/books/content/rotation-forest-classifier-ensemble-based-feature-extraction | |
from sklearn.datasets import make_classification | |
from sklearn.metrics import classification_report | |
from sklearn.cross_validation import train_test_split | |
from sklearn.decomposition import PCA | |
from sklearn.tree import DecisionTreeClassifier | |
import numpy as np | |
def get_data(): |
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 os | |
import time | |
import cv2 | |
import sys | |
print('python script.py harr.xml 1') | |
print(sys.argv) | |
script, casc, nodisplay = sys.argv | |
nodisplay = (nodisplay == '0') |
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
# AUTHOR: Arjoonn Sharma | |
# LICENSE: MIT | |
# Recommended Reading before tinkering with code: | |
# https://en.wikipedia.org/wiki/Heaviside_step_function | |
# https://en.wikipedia.org/wiki/Perceptron | |
def dot_product(vector1, vector2): | |
"Returns the dot product between two vectors" | |
# assertions allow us to make sure some things are true before | |
# we proceede. Here dot product is only defined for vectors |
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 pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import networkx as nx | |
import pickle | |
from collections import deque | |
import multiprocessing as mp | |
import editdistance | |
import os |