- Frank Andare's Page on Medium.com : https://frank-andrade.medium.com/
- Python-Guide.org's The Hitchhiker’s Guide to Python! : www.python-guide.org
- Hugging Face Co.'s guides on training AI models : https://huggingface.co/
- HappyTransformer - an implementation of Hugging Face's transformers library : https://happytransformer.com/
- Random Forest in Python by Will Koehrsen : https://towardsdatascience.com/random-forest-in-python-24d0893d51c0
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 | |
screen_size = 40 | |
theta_spacing = 0.07 | |
phi_spacing = 0.02 | |
illumination = np.fromiter(".,-~:;=!*#$@", dtype="<U1") | |
A = 1 | |
B = 1 | |
R1 = 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
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | |
' Hit Ctrl+F and find the second instance of "here" | |
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | |
exetxt = "" | |
loc = 0 | |
eax="eax":ecx="ecx":edx="edx":ebx="ebx":esp="esp":ebp="ebp":esi="esi":edi="edi" | |
cs="cs":ds="ds" | |
al="al":cl="cl":dl="dl":bl="bl" | |
ah="ah":ch="ch":dh="dh":bh="bh" | |
ax="ax":cx="cx":dx="dx":bx="bx":sp="sp":bp="bp":si="si":di="di" |
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 selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
packed_extension_path = '/path/to/packed/extension.crx' | |
options = Options() | |
options.add_extension(packed_extension_path) | |
driver = webdriver.Chrome(options=options) |
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
:: This batch file converts HTML files in a folder to docx. | |
:: It requires Pandoc, and a list of files to convert | |
:: named file-list, in which each file is on a separate line, | |
:: and contains no spaces in the filename. | |
:: | |
:: Don't show these commands to the user | |
@ECHO off | |
:: Set the title of the window | |
TITLE Convert html to docx | |
:: This thing that's necessary. |
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 PyPDF2 import PdfFileReader, PdfFileWriter | |
import os | |
import glob | |
import sys | |
def removeWatermark(input_fname, output_fname): | |
with open(input_fname, "rb") as inputFile, open(output_fname, "wb") as outputFile: | |
reader = PdfFileReader(inputFile) | |
writer = PdfFileWriter() |
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 random import SystemRandom as SR | |
def f1(arr): | |
s = 0 | |
for i in range(len(arr)): | |
for j in range(len(arr[i])): | |
s += arr[i][j] | |
return s | |
def f2(arr): |
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
"""making a dataframe""" | |
df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB')) | |
"""quick way to create an interesting data frame to try things out""" | |
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd']) | |
"""convert a dictionary into a DataFrame""" | |
"""make the keys into columns""" | |
df = pd.DataFrame(dic, index=[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 tkinter import * | |
from tkinter.colorchooser import askcolor | |
class Paint(object): | |
DEFAULT_PEN_SIZE = 5.0 | |
DEFAULT_COLOR = 'black' | |
def __init__(self): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer