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 hashlib as hash | |
# Specify how many bytes of the file you want to open at a time | |
BLOCKSIZE = 1024 * 1024 * 8 # 8mb | |
def hash_file(fname: str): | |
sha = sha256() | |
with open(fname, 'rb') as fh: | |
while buff := fh.read(BLOCKSIZE): | |
sha.update(buff) |
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
#!/usr/bin/python2 | |
#####################################NOTICE###################################### | |
### This program is free software: you can redistribute it and/or modify ### | |
### it under the terms of the GNU General Public License as published by ### | |
### the Free Software Foundation, either version 3 of the License, or ### | |
### (at your option) any later version. ### | |
### This program is distributed in the hope that it will be useful, ### | |
### ### | |
### but WITHOUT ANY WARRANTY; without even the implied warranty of ### | |
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### |
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
<html> | |
<head> | |
<title>AI vs Old Master</title> | |
<link rel="preconnect" href="https://fonts.googleapis.com"> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet"> | |
<style> | |
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap'); | |
body { |
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
name: sdm | |
channels: | |
- pytorch | |
- conda-forge | |
- defaults | |
dependencies: | |
- _libgcc_mutex=0.1=conda_forge | |
- _openmp_mutex=4.5=2_kmp_llvm | |
- abseil-cpp=20211102.0=h27087fc_1 | |
- absl-py=1.2.0=pyhd8ed1ab_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
from PIL import Image | |
import numpy as np | |
import pyprind | |
import random | |
import os | |
import pygame | |
from collections import defaultdict, Counter | |
class MarkovChain(object): |
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
const s3 = require('@aws-sdk/client-s3') | |
class SaneS3 { | |
constructor(...args) { | |
this.client = new s3.S3Client(...args) | |
} | |
} | |
Object.entries(s3).forEach((entry) => { | |
let [name, fn] = entry |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from PIL import Image | |
mem = {} | |
cols = {0:(0, 0, 0),1:(128, 0, 0),2:(0, 128, 0),3:(128, 128, 0),4:(0, 0, 128),5:(128, 0, 128),6:(0, 128, 128),7:(192, 192, 192),8:(128, 128, 128), | |
9:(255, 0, 0),10:(0, 255, 0),11:(255, 255, 0),12:(0, 0, 255),13:(255, 0, 255),14:(0, 255, 255),15:(255, 255, 255),216:(0, 0, 0, 0),16:(0, 0, 0), | |
17:(0, 0, 95),18:(0, 0, 135),19:(0, 0, 175),20:(0, 0, 215),21:(0, 0, 255),22:(0, 95, 0),23:(0, 95, 95),24:(0, 95, 135),25:(0, 95, 175),26:(0, 95, 215), | |
27:(0, 95, 255),28:(0, 135, 0),29:(0, 135, 95),30:(0, 135, 135),31:(0, 135, 175),32:(0, 135, 215),33:(0, 135, 255),34:(0, 175, 0),35:(0, 175, 95), | |
36:(0, 175, 135),37:(0, 175, 175),38:(0, 175, 215),39:(0, 175, 255),40:(0, 215, 0),41:(0, 215, 95),42:(0, 215, 135),43:(0, 215, 175),44:(0, 215, 215), | |
45:(0, 215, 255),46:(0, 255, 0),47:(0, 255, 95),48:(0, 255, 135),49:(0, 255, 175),50:(0, 255, 215),51:(0, 255, 255),52:(95, 0, 0),53:(95, 0, 95), |
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 | |
from keras import Sequential | |
from keras.layers import LSTM, Dense, Dropout, Activation | |
import numpy as np | |
from matplotlib import pyplot | |
def get_data(): | |
data = pd.read_csv('eeg_data.csv') | |
return data[data.apply(lambda x: np.abs(x - x.median()) / x.std() < 4).all(axis=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
var Dictionary = new Set([ | |
"a", | |
"aah", | |
"aardvark", | |
"aardvarks", | |
"ab", | |
"aback", | |
"abacus", | |
"abacuses", | |
"abaft", |
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
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
db = SQLAlchemy() | |
from models import User | |
def create_app(config=None): | |
app = Flask("testing") | |
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://" |
NewerOlder