自分用お役立ち情報まとめ
デザイン
- データ視覚化のデザイン
- colorblind-friendly palette
- https://personal.sron.nl/~pault/
import gurobipy as gp
from gurobipy import GRB
with gp.Env(empty=True) as env:
env.start()
with gp.Model(env=env) as m:
#!/usr/bin/env python | |
import sys | |
import fileinput | |
import re | |
diff = -8 | |
def repl(matched): | |
h = int(matched.group(1)) + diff |
static inline int encode_distance(int start, int distance) { return ((start + 1) << 4) + distance; } | |
static inline int decode_distance(int x) { return x & ((1 << 4) - 1); } | |
static inline int node_visited(int x, int v) { return (x >> 4) == v + 1; } | |
template <typename Graph> | |
static void extend_closed_neighborhood(Graph const& G, Graph& H, int v, int radius, int buffer[]) { | |
assert(0 <= v && v < G.number_of_nodes()); | |
assert(radius >= 0); |
#!/bin/bash | |
TIMEOUT=timeout | |
run_with_timeout() { | |
oldopt=$- | |
set +e | |
$TIMEOUT $@ | |
ret=$? | |
if [[ $ret -eq 124 ]]; then |
#!/usr/bin/env python3 | |
""" | |
Santorini benchmark launcher. | |
""" | |
__author__ = 'Yosuke Mizutani' | |
__version__ = '0.0.4' | |
__license__ = 'Apache License, Version 2.0' | |
import sys |
# Original version: https://gist.github.com/mogproject/50668d3ca60188c50e6ef3f5f3ace101 | |
from collections import defaultdict | |
import networkx as nx | |
import plotly.graph_objects as go | |
from typing import Any, List, Dict, Tuple, Union, Callable | |
Vertex = Any | |
Edge = Tuple[Vertex, Vertex] | |
Num = Union[int, float] |
pip install PyGitHub
You may want to use pip3
instead of pip
.