I hereby claim:
- I am bholt on github.
- I am bholt (https://keybase.io/bholt) on keybase.
- I have a public key whose fingerprint is AEAA C7A8 DE91 8434 B88F 88CD EE4E 54E0 0859 5279
To claim this, I am signing this object:
import inspect | |
import re | |
def fmt(s): | |
""" | |
Interpolate arbitrary expressions inside '{}' in strings (similar to Ruby or Scala). | |
It should go without saying that because this uses `eval`, it is unsafe to use with any user-provided inputs. | |
It is also probably terribly slow because it's using `inspect` to get the caller's local variables. | |
Example: |
# start a new session if there isn't one to attach to already | |
new-session | |
# Make global tmux shortcut "ctrl+t" | |
set -g prefix ^t | |
# Renumber windows when they're closed so you don't have weird missing numbers. | |
set-option -g renumber-windows on | |
# Make colors work right. |
#!/bin/bash | |
# usage: slurm-ssh [host] [shell] | |
# e.g.: salloc -N2 slurm-ssh | |
# n01 (salloc n[01,04]) > | |
# or: | |
# slurm-ssh n01 | |
# or: | |
# slurm-ssh n01 zsh | |
DIR=$(pwd) |
c.blue <- "#0072B2" | |
c.yellow <- "#E69F00" | |
c.green <- "#009E73" | |
c.red <- "#D55E00" | |
c.pink <- "#CC79A7" | |
c.gray <- "#999999" | |
palette <- c( | |
'follow'=c.blue, | |
'newuser'=c.yellow, |
#include <future> | |
using namespace std; | |
template< typename T > | |
class ConcurrentQueue { | |
Queue<T> q; | |
mutex m; | |
condition_variable cv; | |
bool closed; |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# Usage: salloc <options> slurm-ssh | |
first=$(scontrol show hostname $SLURM_NODELIST | head -n1) | |
env=$(printenv | grep SLURM | sed -rn "s/=(.*)/='\1'/p" | paste -d' ' -s) | |
exec ssh $first -t "$env zsh" |
template< typename T > | |
void work(T t) { | |
try { throw t; } | |
catch (int x) { printf("int\n"); } | |
catch (std::string x) { printf("string\n"); } | |
} | |
int main(int argc, char *argv[]) { | |
work(0); |
forall(words, n, [=](string w) { | |
// hash partitioning | |
size_t idx = hash(w) % ncells; | |
delegate(cells+idx, [=](Cell& cell) | |
{ // runs atomically | |
if (cell.count(w) == 0) cell[w] = 1; | |
else cell[r] += 1; | |
}); | |
}); |
GlobalAddress<Graph> g; | |
/////////////////////////////////////////////// | |
// GraphLab synchronous engine: scatter phase | |
// loop over all vertices in graph | |
forall(g, [=](Vertex& v){ | |
// only scatter from vertices that have been signaled to do scatter | |
if (v->active_minor_step) { | |
v->active_minor_step = false; |