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:
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 |
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)| |
class PID | |
attr_reader :delta_t, | |
:kp, | |
:ki, | |
:kd, | |
:output_p_prev, | |
:output_i_prev, | |
:output_min, | |
:output_max, | |
:setpoint, |
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 |
I hereby claim:
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 |
#!/bin/bash | |
## | |
# Controls TP-LINK HS100,HS110, HS200 wlan smart plugs | |
# Tested with HS100 firmware 1.0.8 | |
# | |
# Credits to Thomas Baust for the query/status/emeter commands | |
# | |
# Author George Georgovassilis, https://github.com/ggeorgovassilis/linuxscripts |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
agentCount: null, | |
didInsertElement() { | |
const comp = this; | |
let values$ = Bacon.fromEvent(this, 'test'); | |
module Memoizable | |
# Usage: | |
# | |
# class Foo | |
# extend Memoizable | |
# | |
# memoize def bar | |
# 'bar' | |
# end | |
# end |