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/python3 | |
import os | |
import sys | |
import pathlib | |
import shutil | |
import tempfile | |
import urllib.request | |
import concurrent.futures |
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
class Person( object ): | |
def __init__( self, name, parent ): | |
self.name = name | |
self.children = [] | |
self.parent = parent | |
if parent: | |
parent.children.append( self ) | |
banana = Person( "Banana" ) | |
cherry = Person( "Cherry", parent=banana ) |
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
try: | |
do_something() | |
except IndexError: | |
raise SomeOtherException() |
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
void ObservableDualActionJoystick::TaskPrePeriodic(RobotMode mode) { | |
uint32_t currBtn = GetAllButtons(); | |
if (m_observer != nullptr) { | |
int mask = 1, buttonId = 0; | |
for ( int buttonId = 0; buttonId < 64; buttonId++ ) { | |
if (m_prevBtn & mask != currBtn & mask) { | |
m_observer->ObserveDualActionJoystickStateChange(m_port, buttonId, currBtn & mask); | |
} | |
mask <<= 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
from mpl_toolkits.mplot3d import axes3d | |
import matplotlib.pyplot as plt | |
from matplotlib import cm | |
import numpy as npfig = plt.figure() | |
ax = fig.add_subplot(111, projection='3d')anchors | |
a = [0,57.735,30] | |
b = [50,-28.868,30] | |
c = [-50,-28.868,30]O = [0,0,0]X = np.arange(c[0],b[0],1) | |
Y = np.arange(b[1],a[1],1)def calc_T(a,b,c,o): | |
A = np.array([[(a[0]-o[0])/m.sqrt((a[0]-o[0])**2+(a[1]-o[1])**2+(a[2]-o[2])**2),(b[0]-o[0])/m.sqrt((b[0]-o[0])**2+(b[1]-o[1])**2+(b[2]-o[2])**2),(c[0]-o[0])/m.sqrt((c[0]-o[0])**2+(c[1]-o[1])**2+(c[2]-o[2])**2)], [(a[1]-o[1])/m.sqrt((a[0]-o[0])**2+(a[1]-o[1])**2+(a[2]-o[2])**2),(b[1]-o[1])/m.sqrt((b[0]-o[0])**2+(b[1]-o[1])**2+(b[2]-o[2])**2),(c[1]-o[1])/m.sqrt((c[0]-o[0])**2+(c[1]-o[1])**2+(c[2]-o[2])**2)], [(a[2]-o[2])/m.sqrt((a[0]-o[0])**2+(a[1]-o[1])**2+(a[2]-o[2])**2),(b[2]-o[2])/m.sqrt((b[0]-o[0])**2+(b[1]-o[1])**2+(b[2]-o[2])**2),(c[2]-o[2])/m.sqrt((c[0]-o[0])**2+(c[1]-o[1])**2+(c[2]-o[2])**2)]]) |
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 | |
""" | |
Simple pomodoro tracker that has been heavily customized to my personal needs. | |
Each pomodoro will wait for user input before continuing on meaning that | |
working a little long into your break does not reduce the duration of your | |
break (the break timer doesn't start until you press enter). When it is time | |
to move on, pomodoro will present a notification repeatedly using libnotify. |
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 random | |
import time | |
class Item(): | |
def __init__(self, x, y, z, width, height, depth): | |
self.x = x | |
self.y = y | |
self.z = z | |
self.width = width | |
self.height = height |
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 enchant | |
d = enchant.Dict("en_US") | |
num_mappings = { | |
1: [], | |
2: ['a', 'b', 'c'], | |
3: ['d', 'e', 'f'], | |
4: ['g', 'h', 'i'], | |
5: ['j', 'k', 'l'], |
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
# These are the people who are invited to my wedding | |
GUESTS = [ | |
"Linda", | |
"Paige", | |
"Lauren", | |
"Melissa", | |
"Ragnor", | |
"Thor", | |
"Gertrude", | |
"Yoshi", |
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 <stdio.h> | |
#include <cmath> | |
struct TalonPIDConfig { | |
float p = 0.0; | |
float i = 0.0; | |
float d = 0.0; | |
float f = 0.0; | |
}; |
NewerOlder