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 nltk.corpus import wordnet | |
import threading | |
from queue import Queue | |
from datetime import datetime | |
import time | |
class WordSearch: | |
def __init__(self): | |
self.combo = set() |
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 uuid | |
import hashlib | |
splitter = '$' | |
def hash_password(password): | |
# userid is used to generate a random number | |
salt = uuid.uuid4().hex # salt is stored in hex value | |
hash_pass = '{}{}{}'.format( | |
hashlib.sha256(salt.encode() + password.encode()).hexdigest(), |
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
''' | |
VICTOR's sorting algorithm! | |
=> vicSort | |
HOW vicSort WORKS | |
not_sorted = [2, 4, 1, 8, 5] | |
sorted = [] | |
[2] # If no element in `sorted` add the first one |
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 numpy as np | |
project_dir = '/Users/victor/Documents/Devcrib/DigiSchools/desktop/digischools-desktop' | |
ignored_files = ['node_modules', 'package-lock.json', 'uploads', 'fonts', | |
'bootstrap-grid.min.css', 'bootstrap.css', 'bootstrap.min.css', 'dropzone.css', | |
'owl.carousel.min.js', 'jquery.min.js', 'jquery-1.10.2.js', 'owl.carousel.min.css', | |
'owl.theme.default.min.css', 'owl.video.play.png', 'pretty.min.css', | |
'jquery_upload.min.js', 'datatables.min.js', 'dataTables', 'datatables.min.css', | |
'bootstrap.min.js', 'dropzone.js', 'tether.min.js', 'wow.min.js', 'font-awesome.min.css', |
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 nltk | |
from nltk.corpus import state_union | |
from nltk.tokenize import PunktSentenceTokenizer | |
''' | |
POS tag list: | |
CC coordinating conjunction | |
CD cardinal digit |
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
# coding: utf-8 | |
# # 5-Layer Convnet for classifying the MNIST dataset | |
# In[1]: | |
# importing the dependencies | |
import tensorflow as tf | |
import numpy as np |
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 re | |
''' | |
Identifiers: | |
\d = any number | |
\D = anything but a number | |
\s = space | |
\S = anything but a space | |
\w = any letter |
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 numpy as np | |
time_taken_for_one_weight = 0.04 | |
weights_to_try = 1000 | |
weights_in_net = 8 # for 1 layer | |
one_year = 3600*24*365 | |
years_to_train = time_taken_for_one_weight*(weights_to_try**weights_in_net)/one_year | |
print('{:,}'.format(years_to_train)) |
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 urllib.request | |
import urllib.parse | |
def get(url): | |
try: | |
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'} | |
req = urllib.request.Request(url, headers=headers) | |
reqeust = urllib.request.urlopen(req) | |
resp = request.read().decode() |
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 matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
import urllib | |
import numpy as np | |
def bytespdates2num(formt, encoding='utf-8'): | |
strconverter = mdates.strpdate2num(formt) | |
def bytesconverter(b): | |
s = b.decode(encoding) | |
return strconverter(s) |
OlderNewer