Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gregmankes on github.
  • I am gregmankes (https://keybase.io/gregmankes) on keybase.
  • I have a public key ASAnIBF8SYq1dguKaW7AvmKJGqO1fbJg6H9tazeB2WkKTAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am gregmankes on github.
  • I am pappingfandas (https://keybase.io/pappingfandas) on keybase.
  • I have a public key ASBQT5ceP_EwnP37rd70rAEdIyPDOE9EoKDQ5P3AigCZsQo

To claim this, I am signing this object:

from pulp import *
def read_input_file(filename):
f = open(filename,"r")
i = 0
G = {}
vertices = set([])
for line in f:
if i >= 3:
to_add = line.split(" ")
from time import clock
from random import randint
import sys
def changeslow(V, A):
C = [0]*len(V)
minimum = changeslowhelper(V, A, C)
return (minimum[0], minimum[1])
def changeslowhelper(V, A, C):
@gregmankes
gregmankes / thislove.ino
Last active August 3, 2016 15:45
The generic code for the heart-to-heart project, swap 'hunter dozen' to your event name and swap the numbers associated with it (hunter_dozen_button_pressed_1,2,3...) to flash this to multiple particles
/*****************************************************
* Author: Greg Mankes
* Date: 1/8/16
* Description: This Program publishes and subscribes
* to an event to a separate photon. When each Photon
* receives the event, the board LED will light up.
* When a user presses a button, the photon will
* publish an event
****************************************************/
@gregmankes
gregmankes / todo.c
Created May 20, 2016 18:38
Main Function from todo
// Main Function from todo
int main()
{
// Implement
printf("\n\n** TO-DO LIST APPLICATION **\n\n");
DynamicArray* list = dyNew(8);
char command = ' ';
do
{
printf("Press:\n"
@gregmankes
gregmankes / Project_3.ino
Last active November 5, 2016 04:51
A simple PI controller for a motor and encoder combination
/* interrupt routine for Rotary Encoders
tested with Noble RE0124PVB 17.7FINB-24 http://www.nobleusa.com/pdf/xre.pdf - available at pollin.de
and a few others, seems pretty universal
The average rotary encoder has three pins, seen from front: A C B
Clockwise rotation A(on)->B(on)->A(off)->B(off)
CounterCW rotation B(on)->A(on)->B(off)->A(off)
and may be a push switch with another two pins, pulled low at pin 8 in this case
raf@synapps.de 20120107