Skip to content

Instantly share code, notes, and snippets.

View thejevans's full-sized avatar

John Evans thejevans

View GitHub Profile
@thejevans
thejevans / workshop2
Created May 11, 2017 21:42
Workshop 2
Slide 3:
void setup() {
pinMode(6, OUTPUT);
}
void loop() {
int j = analogRead(1);
analogWrite(6, j/4);
}
@thejevans
thejevans / !Workshop_1
Last active February 18, 2019 17:54
Makerspace_Workshop_1_Arduino_Intro
Link to presentation:
https://docs.google.com/presentation/d/1rklrRGW5udTUR9XmM4PtCNwZ1L_dxudQS08pqznV3J4/edit?usp=sharing
"""
John Evans
PHYS476
Homework 2
Problem 2
3/10/2018
"""
import sys
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
"""
John Evans
PHYS476
Homework 2
Problem 1
3/10/2018
"""
import sys
from sklearn.neighbors import KNeighborsClassifier
import pandas as pd
proxy:
secretToken: "6b6847da2357051a396859394124027c730f8a47dd82ac22fa7a3491fa72d25b"
https:
hosts:
- jupyter.thejevans.com
letsencrypt:
contactEmail: thejevans@gmail.com
hub:
extraEnv:
I set everything up in a stable way on my home system, finally. This has gpu support.
you have a home directory that is fast, but doesn't have much space:
~/
you have a data directory that is a bit slower, but has tons of space:
/data/users/<username>
your jupyter directory is:
/data/users/<username>/notebooks
#!/usr/bin/python
import sys
from array import *
# returns true if x is prime, false is not
def is_prime(x):
if x < 2:
return True
if x >= 2:
# Card has nvidia driver
lspci -nnk -d 10de:1c03
lspci -nnk -d 10de:10f1
modprobe vfio
modprobe vfio_pci
# VGA
echo '0000:01:00.0' > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
echo '10de 1c03' > /sys/bus/pci/drivers/vfio-pci/new_id
echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
echo 1 > /sys/bus/pci/rescan
sleep 1
# Card has nvidia driver
lspci -nnk -d 10de:1c03
lspci -nnk -d 10de:10f1
# coding: utf-8
# ### Homework 4
# #### Problem 3 -- Autoencoder
# ###### John Evans
# ###### 4/26/18
# ##### Imports