Skip to content

Instantly share code, notes, and snippets.

View Andrew-Pynch's full-sized avatar
🎯
Focusing

Andrew Pynch Andrew-Pynch

🎯
Focusing
View GitHub Profile
@Andrew-Pynch
Andrew-Pynch / hiragana-to-romanji.ts
Created April 20, 2023 13:59
Typescript hiragana to romanji map
const hiraganaToRomajiMap: Map<string, string> = new Map([
['あ', 'a'],
['い', 'i'],
['う', 'u'],
['え', 'e'],
['お', 'o'],
['か', 'ka'],
['き', 'ki'],
['く', 'ku'],
['け', 'ke'],
@Andrew-Pynch
Andrew-Pynch / english_alphabet
Created March 16, 2022 01:41
line separated english alphabet
a
b
c
d
e
f
g
h
i
j
int rows, cols;
int scl = 20;
int w = 2920;
int h = 1080;
float flying = 0;
// 2d array in java
float[][] terrain;
import cv2
import numpy as np
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
REBUILD_DATA = False # set to true to one once, then back to false unless you want to change something in your training data.
# Ping PLC
ping -t 10.114.4.10 > C:\Users\apynch\Github\scripts\ignition.txt
# Ping google
ping -t google.com > C:\Users\apynch\Github\scripts\google.txt
new_q = (1 - LEARNING_RATE) * current_q + LEARNING_RATE * (reward + DISCOUNT * max_future_q)
q_table[observation][action] = reward
def crop_lower_half(fnames): # fnames is a list of jpg names in a folder
for i, file in enumerate(fnames):
cropped_image = crop(open_image(jpg_extractions[i]), 1910, 1.29995, 0)
print(i)
print(file)
cropped_image.save("/home/andrew/Github/neuralink-bot/image_manipulation/cropped_jpgs/top_crop/top_crop_%s.jpg" % (str(i)))
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
vidcap = cv2.VideoCapture('neuralink3.mp4')
success,image = vidcap.read()
count = 0
while success:
def order_files_by_date(path_to_folder, file_type):
files = glob.glob("%s*%s" % (path_to_folder, file_type))
files.sort(key=os.path.getmtime)
return files