Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Suo danielsuo

View GitHub Profile
View pid.diff
diff --git a/pid.txt b/pid.txt
index e453170..3015dbf 100644
--- a/pid.txt
+++ b/pid.txt
@@ -1,6 +1,6 @@
-def _PID_update(self, dt):
+def _Predictive_PID_update(self, dt):
'''
- This instantiates the PID control algorithms.
+ This instantiates the Predictive PID control algorithms.
View cg
def cg(A, b, x0=None, maxiter=None, tol=1e-5):
x = x0 or np.zeros_like(b)
k = 0
kmax = maxiter or len(b)
r = b - A @ x
p = r
d_o = np.dot(r, r)
d_n = d_o
View tadpoles_gmail.js
/*
Bookmarklet to download image / movie from tadpoles
Sources:
https://gist.github.com/sfrdmn/8834747 by sfrdmn, unlicenced but I hope you won't sue me :3
https://stackoverflow.com/a/49500465/2550406 by Leeroy, CC-BY-SA
*/
;(function() {
// Probably should do some validation, but whatever
var l = document.links;
View click.js
var simulateMouseEvent = function(element, eventName, coordX, coordY) {
element.dispatchEvent(new MouseEvent(eventName, {
view: window,
bubbles: true,
cancelable: true,
clientX: coordX,
clientY: coordY,
button: 0
}));
};
View tadpoles.js
/*
Bookmarklet to download image / movie from tadpoles
Sources:
https://gist.github.com/sfrdmn/8834747 by sfrdmn, unlicenced but I hope you won't sue me :3
https://stackoverflow.com/a/49500465/2550406 by Leeroy, CC-BY-SA
*/
;(function() {
// Probably should do some validation, but whatever
var images = [window.location.href + "?d=t"]
@danielsuo
danielsuo / ray.tmux
Last active Aug 15, 2018
Start ray processes in tmux
View ray.tmux
#!/usr/bin/env bash
set -x
# NOTES
# - Requires tmux 2.3 or greater
# - Run in the appropriate Python environment
# - Check out the keybindings for helpful tips
# - We could also do this in tmuxinator
View blockstack
Verifying that "danielsuo.id" is my Blockstack ID. https://onename.com/danielsuo
View keybase.md

Keybase proof

I hereby claim:

  • I am danielsuo on github.
  • I am danielsuo (https://keybase.io/danielsuo) on keybase.
  • I have a public key whose fingerprint is 1E76 9585 EBCD 36F0 E62A 1CD5 B136 A0CD 3950 E7E5

To claim this, I am signing this object:

View cycles.h
#pragma once
#include <time.h> /* for clock_gettime */
#include <error.h>
#include <stdio.h>
#include <stdlib.h> /* for exit */
#include <stdarg.h>
#include <inttypes.h>
#define MILLION 1000000L
View docker-parsec-run
This file has been truncated, but you can view the full file.
sudo docker run --rm -it --cpuset-cpus="0" danielsuo/parsec -a run -i test -p blackscholes -n 1 2>&1 | tee -a ./out/blackscholes-test-1-0.out
sudo docker run --rm -it --cpuset-cpus="0" danielsuo/parsec -a run -i simdev -p blackscholes -n 1 2>&1 | tee -a ./out/blackscholes-simdev-1-0.out
sudo docker run --rm -it --cpuset-cpus="0" danielsuo/parsec -a run -i simsmall -p blackscholes -n 1 2>&1 | tee -a ./out/blackscholes-simsmall-1-0.out
sudo docker run --rm -it --cpuset-cpus="0" danielsuo/parsec -a run -i simmedium -p blackscholes -n 1 2>&1 | tee -a ./out/blackscholes-simmedium-1-0.out
sudo docker run --rm -it --cpuset-cpus="0" danielsuo/parsec -a run -i simlarge -p blackscholes -n 1 2>&1 | tee -a ./out/blackscholes-simlarge-1-0.out
sudo docker run --rm -it --cpuset-cpus="0" danielsuo/parsec -a run -i native -p blackscholes -n 1 2>&1 | tee -a ./out/blackscholes-native-1-0.out