This file contains hidden or 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 json | |
USERNAME = '<adminname>' | |
BACKUP = '<backup_file>.json' | |
def parse_item_json(item_json): | |
name = item_json['item']['type'] | |
amt = item_json['item'].get('amount', 1) | |
return name, amt |
This file contains hidden or 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 PIL import Image | |
im = Image.open('banner.png').convert('RGB') | |
width, height = im.size | |
col_start = -1 | |
for c in range(width): | |
content = False | |
for r in range(height): | |
color = im.getpixel((c, r)) | |
if color != (255, 255, 255): |
This file contains hidden or 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
// Shridux - A superior global state management library | |
class GlobalStore { | |
_initState = {}; | |
_bindings = {}; | |
setStore(newState) { | |
for(let key in newState) { | |
if(!(key in this._bindings)) { |
This file contains hidden or 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
# http://www.saitek.com/uk/prod-bak/multi.html | |
from pynput.keyboard import Key, Controller | |
import hid | |
import time | |
keyboard = Controller() | |
name = 'Pro Flight Multi Panel' | |
vend_id, product_id = None, None |
This file contains hidden or 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 matching import Player, HospitalResident | |
from collections import defaultdict | |
import csv | |
def read_csv_ranks_v1(fn, other_fields=2): | |
users = {} | |
items = [] |
This file contains hidden or 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 cv2 | |
import numpy as np | |
import pyaudio | |
import librosa | |
import librosa.display | |
import matplotlib.pyplot as plt | |
import time | |
rate = 16000 | |
chunk_size = rate // 4 |
This file contains hidden or 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 numpy as np | |
import cv2 | |
class CellularAutomaton: | |
def __init__(self, size=1000, rule=0): | |
self.size = size | |
self.rule = rule |
This file contains hidden or 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
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; |
This file contains hidden or 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 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") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.