This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import matplotlib.pyplot as plt | |
import networkx as nx | |
from_id = None | |
G = nx.DiGraph() | |
for line_num, line in enumerate(open("baton.txt", "r")): | |
# find a line with only one id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from starcluster.clustersetup import ClusterSetup | |
from starcluster.logger import log | |
class AdditionalPackages(ClusterSetup): | |
def __init__(self): | |
pass | |
def run(self, nodes, master, user, user_shell, volumes): | |
log.info('install gcc-4.7 on master') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '{sum += $3} END {print sum/NR}' filename.txt | |
awk '{sum += ($3-7.2589)^2} END {print sqrt(sum/NR)}' filename.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shuffle() { | |
awk 'BEGIN{srand();} {printf "%06d %s\n", rand()*1000000, $0;}' | sort -n -T./ | cut -c8- | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
row_assign_ = nomad_allocator<std::remove_pointer<decltype(row_assign_)>::type>().allocate(num_rows_); | |
// is this really better than | |
row_assign_ = my_allocator<int>().allocate(num_rows_); | |
// ...? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{xparse} | |
\NewDocumentCommand\word{m+m+g}{% | |
\IfNoValueTF{#3} | |
{\item { {\bf #1}}: #2} | |
{\item { {\bf #1}}: #2\\ {\em #3}}% | |
} |