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 | |
progress_color = (112 / 255, 19 / 255, 28 / 255) | |
white_color = (1.0, 1.0, 1.0) | |
colors = [progress_color, white_color] | |
ps = [0.0, 0.1, 0.2, 0.25, 0.3, 0.33, 0.4, 0.5, 0.6, 0.66, 0.7, 0.75, 0.8, 0.9, 1.0] | |
for p in ps: | |
fig, ax = plt.subplots(figsize=(1,1), frameon=True) |
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 torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import torch.nn.functional as F | |
import torchvision | |
import torchvision.transforms as transforms | |
import time |
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 big_ol_pile_of_manim_imports import * | |
import math | |
from scipy import signal | |
# Sorry for the messy code... I blame it on sleep deprevation and procrastination. | |
class DrawSine(Animation): | |
CONFIG = { | |
"run_time": 5, |
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/env python3 | |
from networktables import NetworkTables | |
import time | |
class Network: | |
def __init__(self, nt_ip): | |
NetworkTables.initialize(server=nt_ip) |
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 math | |
def form_bytes(bstring): | |
'''Forms an integer given bytes of inverted LL/HH form | |
:param bstring: a bytestring of length 2 in LL/HH form | |
:returns: the integer value of the bytes in the form 0xHHLL | |
''' | |
return ord(bstring[0]) + ord(bstring[1]) * 16**2 | |
def correct_angle(theta, distance): |
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
#include <Wire.h> | |
#define LIDAR_ADDRESS 0x62 | |
#define COMMAND_REG 0x00 | |
#define STATUS_REG 0x01 | |
#define DIST_REG 0x8f | |
#define ReadNoBias 0x03 | |
#define ReadBias 0x04 |
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 | |
import scipy.sparse.linalg | |
BLUE1 = 80 | |
BLUE2 = 81 | |
BLUE3 = 82 | |
RED1 = 84 | |
RED2 = 85 | |
RED3 = 86 | |
BLUE_AUTO_OWN = 6 |
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
package org.usfirst.frc.team263.robot; | |
import edu.wpi.first.networktables.NetworkTableEntry; | |
import edu.wpi.first.networktables.NetworkTableInstance; | |
/** | |
* Wrapper class for getting and setting Limelight NetworkTable values. | |
* | |
* @author Dan Waxman | |
*/ |
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 cv2 | |
import numpy as np | |
from timeit import default_timer as timer | |
w , h = 640, 480 | |
wd, hd = 360, 240 | |
n = 10**4 | |
def setup(): | |
random_image = np.random.choice([x for x in range(255)], h*w*3) |
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/env python | |
from pyquery import PyQuery as pq | |
import time | |
import requests | |
import os | |
class WriteData: | |
def __init__(self, outfile): | |
self.f = open(outfile, 'a') |
NewerOlder