This file contains hidden or 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
{ | |
"$schema": "https://json-schema.org/draft/2019-09/schema", | |
"$id": "https://github.com/aicenter/Ridesharing_DARP_instances/blob/main/solution_schema.json", | |
"type": "object", | |
"default": {}, | |
"title": "Instance Solution Schema", | |
"required": [ | |
"cost", | |
"cost_minutes", | |
"plans", |
This file contains hidden or 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
""" | |
serror(error::Exception) -> String | |
Get error and stacktrace as String, e.g. for use in warning. | |
Useful in Jypyter notebooks where error messages are not displayed correctly (https://github.com/JuliaLang/IJulia.jl/issues/1043) | |
Example: | |
```julia | |
julia> try | |
a=b |
This file contains hidden or 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
#Array syntax | |
[x,y,z] | |
vcat(x,y,z) == [x; y; z] | |
hcat(x,y,z) == [x y z] | |
#Square matrix | |
[a b; c d] | |
# Solve Ax=b | |
A\b |
This file contains hidden or 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
# -a archive flag (keep timestamps, ) | |
# -h human readable | |
# -v verbose | |
# --delete delete files from destination that are missing in source | |
# --dry-run perform dry run | |
# If folders end with /, copy the content and not the folder itself | |
rsync -ah --info=progress2 [email protected]:/path/source/ ./path/destination/ --delete |
This file contains hidden or 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
#!/usr/bin/env bash | |
# https://www.cylindric.net/git/force-lf | |
git config core.eol lf | |
git config core.autocrlf input | |
git config --global core.eol lf | |
git config --global core.autocrlf input |
This file contains hidden or 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 matplotlib | |
import matplotlib.pyplot as plt | |
# Avoid Type2 fonts | |
matplotlib.rcParams['pdf.fonttype'] = 42 | |
matplotlib.rcParams['ps.fonttype'] = 42 | |
# Plots looking nice | |
plt.style.use('ggplot') # R-like plots |
This file contains hidden or 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 pandas as pd | |
pd.set_option('display.max_rows', 500) | |
pd.set_option('display.max_columns', 500) | |
pd.set_option('display.width', 1000) |
This file contains hidden or 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
# Autoreload modules when they change | |
%load_ext autoreload | |
%autoreload 2 | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import matplotlib | |
import sys |
This file contains hidden or 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
[diff] | |
tool = pycharm | |
[difftool "pycharm"] | |
cmd = "/c/Program\ Files/JetBrains/PyCharm 2019.1.1/bin/pycharm" diff "$LOCAL" "$REMOTE" && echo "Press enter to continue..." && read | |
[merge] | |
tool = pycharm | |
keepBackup = false | |
[mergetool "pycharm"] | |
cmd = "/c/Program Files/JetBrains/PyCharm 2019.1.1/bin/pycharm" merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED" |