I hereby claim:
- I am rringler on github.
- I am rringler (https://keybase.io/rringler) on keybase.
- I have a public key ASBqcATXxSioDtJfMXH7O-qQRe_Z-dH_wxpPg3wfSH-olAo
To claim this, I am signing this object:
path=$(dirname "$1") | |
basename="animated" | |
filename="animated.gif" | |
counter="0" | |
while [ -e "$path/$filename" ]; do | |
((counter++)) | |
filename="$basename ($counter).gif" | |
done |
I hereby claim:
To claim this, I am signing this object:
def pid_controller(y, yc, h=1, Ti=1, Td=1, Kp=1, u0=0, e0=0) | |
"""Calculate System Input using a PID Controller | |
Arguments: | |
y .. Measured Output of the System | |
yc .. Desired Output of the System | |
h .. Sampling Time | |
Kp .. Controller Gain Constant | |
Ti .. Controller Integration Constant | |
Td .. Controller Derivation Constant |
class PID | |
attr_reader :delta_t, | |
:kp, | |
:ki, | |
:kd, | |
:output_p_prev, | |
:output_i_prev, | |
:output_min, | |
:output_max, | |
:setpoint, |
require 'tsort' | |
class UndirectedGraph < Hash | |
include TSort | |
def initialize(size, edges) | |
super().tap do |hash| | |
(1..size).each { |i| hash[i] = [] } | |
edges.each do |(a, b)| |
def quicksort(array, left = 0, right = nil) | |
right ||= array.size - 1 # Sort the whole array be default | |
# NOTE: This is subtle; we only need to perform the sorting if `left` is less | |
# than `right` | |
if left < right | |
index = sort(array, left, right) | |
quicksort(array, left, index - 1) # Sort left sub_array | |
quicksort(array, index + 1, right) # Sort right sub_array |