g = nx.complete_graph([
"playground equipment", "evanescent champagne", "curved spacetime",
"magic flute", "market returns", "spotty memory",
"languid feeling", "include numpy as np", "acidic chemical",
"downton abbey", "tumble weeds", "precede the cause"])
node_locs = nx.circular_layout(g)
theta = {k: np.arctan2(v[1], v[0]) * 180/np.pi for k, v in node_locs.items() }
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
#!/bin/bash | |
function actual_path() { | |
if [ [ -z "$1" ] -a [ -d $1 ] ]; then | |
echo $(cd $1 && test `pwd` = `pwd -P`) | |
return 0 | |
else | |
return 1 | |
fi | |
} |
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 mpi4py import MPI | |
import numpy as np | |
comm = MPI.COMM_WORLD | |
rank = comm.Get_rank() | |
nprocs = comm.Get_size() | |
DEBUG = 0 | |
def move_info(info2move): |
Merged from https://github.com/joelparkerhenderson/git_commit_message and https://chris.beams.io/posts/git-commit/
- Commit messages must have a subject line and may have body copy. These must be separated by a blank line.
- The subject line must not exceed 50 characters
- The subject line should be capitalized and must not end in a period
- The subject line must be written in imperative mood (Fix, not Fixed / Fixes etc.)
- The body copy must be wrapped at 72 columns
- The body copy must only contain explanations as to what and why, never how. The latter belongs in documentation and implementation.
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 random | |
import time | |
# inspiration: https://mathematica.stackexchange.com/questions/39361/how-to-generate-a-random-snowflake | |
# see https://www.redblobgames.com/grids/hexagons/ for information | |
# about hexagon grids and coordinate systems | |
# neighbors in axial coordinates | |
DIRS = [(1, 0), (1, -1), (0, -1), (-1, 0), (-1, 1), (0, 1)] |
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
// by dave @beesandbombs :) | |
float[][] result; | |
float t, c; | |
float ease(float p) { | |
p = c01(p); | |
return 3*p*p - 2*p*p*p; | |
} |