Skip to content

Instantly share code, notes, and snippets.

{
"$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",
"""
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
@BoZenKhaa
BoZenKhaa / arrays.jl
Last active February 21, 2020 15:28
Julia notes
#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
@BoZenKhaa
BoZenKhaa / rsync.bash
Created February 13, 2020 18:16
Backup with rsync
# -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 login@server.vom:/path/source/ ./path/destination/ --delete
#!/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
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
import pandas as pd
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
@BoZenKhaa
BoZenKhaa / jupyter_imports.py
Last active July 19, 2019 15:40
Tips for jupyter imports
# 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
@BoZenKhaa
BoZenKhaa / .gitconfig
Last active January 29, 2023 14:20 — forked from NamPNQ/.gitconfig
Pycharm as a default git difftool and git mergetool on Windows. Add the following to ~/.gitconfig
[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"