Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Suo danielsuo

View GitHub Profile
View gist:10012107
{
"metadata": {
"language": "Julia",
"name": "",
"signature": "sha256:bf86d1d75f8c18eac70819da255df50cd505b244107d4c8c00f77449607e4304"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
View gist:8035872
document.getElementById('button').addEventListener('click', function() {
if (BigScreen.enabled) BigScreen.toggle();
else // fallback for browsers that don't support full screen
}, false);
View TWEEN Easing
TWEEN.Easing = {
Linear: {
None: function ( k ) {
return k;
}
View TWEEN.Interpolation
TWEEN.Interpolation = {
Linear: function ( v, k ) {
var m = v.length - 1, f = m * k, i = Math.floor( f ), fn = TWEEN.Interpolation.Utils.Linear;
if ( k < 0 ) return fn( v[ 0 ], v[ 1 ], f );
if ( k > 1 ) return fn( v[ m ], v[ m - 1 ], m - f );
return fn( v[ i ], v[ i + 1 > m ? m : i + 1 ], f - i );
@danielsuo
danielsuo / parsec.py
Last active Dec 23, 2016
Collecting CPU utilization on the PARSEC benchmark (parsec.cs.princeton.edu)
View parsec.py
#!/usr/bin/python
import sys, subprocess
apps = [
'blackscholes',
'bodytrack',
'canneal',
'dedup',
'facesim',
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
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 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 blockstack
Verifying that "danielsuo.id" is my Blockstack ID. https://onename.com/danielsuo
@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