Skip to content

Instantly share code, notes, and snippets.

@mgrantham18
mgrantham18 / jetson_stats.py
Last active April 11, 2022 17:40
System Usage monitor for Nvidia Jetson Nano Developer Kit. Runs in terminal so works over SSH.
import os
import time
import curses
def main():
try:
os.system("tegrastats --stop")
os.system("tegrastats --interval 1000 --logfile tegrastats.log &")
stdscr = curses.initscr()
curses.start_color()
@mgrantham18
mgrantham18 / slope-field.py
Last active April 26, 2018 13:35
Plot a slope field from a differential equation
#plots slope field of a differential equation
import matplotlib.pyplot as plt
import math
fig, ax = plt.subplots(figsize=(10, 10))
ax.plot([-10.5,10.5],[0,0],"-", color="#000000")
ax.plot([0,0],[-10.5,10.5],"-", color="#000000")
x = -10 #min x
while x <= 10: #max x
y = -10 #min y
while y <= 10: #max y