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 | |
set -e | |
# you can directly run this with: bash <(curl -Ls "https://gist.githubusercontent.com/jkbjh/c83e5bf6d708f590f77ccdd6b2ef0a40/raw/mujoco-210-user-install.sh?$(date +%s)") | |
# (the date query parameter is to to prevent caching when downloading through curl.) | |
export START_DIR=$(pwd) | |
export MJ_DIR=$HOME/.mujoco | |
# Check if the file exists | |
if [ -e "$MJ_DIR/mujoco210/bin/compile" ]; then | |
echo "mujoco already there, not downloading." |
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
#!/usr/bin/env python | |
import argparse | |
import re | |
import subprocess | |
import sys | |
import uuid | |
url_rex = re.compile( | |
"^(?P<user>.*?)@(?P<host>.*?):(?:(?P<port>[0-9]*?))?(?P<path>.*?/.*?)$" | |
) |
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
#!/usr/bin/env python | |
import argparse | |
import subprocess | |
import shlex | |
import shutil | |
import sys | |
def check_programs(*progs): | |
all_success = True |
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
#!/usr/bin/env python3 | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import countryinfo # for populations | |
FUTURE = 28 | |
POPULATION = { | |
"Czechia": countryinfo.CountryInfo("Czech Republic").population(), | |
} |
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 | |
set -e | |
set -x | |
# you can directly run this with: bash <(curl -Ls "https://gist.githubusercontent.com/jkbjh/c83e5bf6d708f590f77ccdd6b2ef0a40/raw/mujoco-210-user-install.sh?$(date +%s)") | |
# (the date query parameter is to to prevent caching when downloading through curl.) | |
export START_DIR=$(pwd) | |
export MJ_DIR=$HOME/.mujoco | |
mkdir -p $MJ_DIR | |
pushd $MJ_DIR | |
curl -LJ 'https://github.com/deepmind/mujoco/releases/download/2.1.0/mujoco210-linux-x86_64.tar.gz' -o $MJ_DIR/mujoco210_linux.tgz |
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 collections | |
JointInfo = collections.namedtuple( | |
"JointInfo", | |
[ | |
"index", | |
"name", | |
"type", | |
"q_index", |
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
# a selection of small numpy helper functions | |
import joblib | |
def apply_along_axes(func, data, axes): | |
""" | |
apply function along axes and use joblib parallel to execute the function on the selections. | |
might result in a large allocation for reconstructing the result. | |
only makes sense if the sub-executions are sufficiently costly. | |
""" |
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
;;; diction.el --- minor mode to interface the command diction | |
;;; Copyright Sven Utcke <Sven.Utcke@gmx.de> | |
;; Emacs Lisp Archive Entry | |
;; Filename: diction.el | |
;; Version: $Id: diction.el,v 1.8 2005/09/29 12:55:52 utcke Exp $ | |
;; Keywords: diction, style | |
;; Author: Sven Utcke <Sven.Utcke@gmx.de> | |
;; Maintainer: Sven Utcke <Sven.Utcke@gmx.de> |
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 importlib | |
import subprocess | |
import re | |
import os | |
import joblib | |
from joblib import parallel_backend, Parallel, delayed | |
found_imports = sorted(list(set([x.lstrip().rstrip() for x in subprocess.check_output("findimports -p -l 1 |grep -v ':' |sort -u", shell=True).decode("utf-8").rstrip().lstrip().split("\n")]))) | |
installed_packages = subprocess.check_output('pip list | tail -n +3 | cut -d" " -f1', shell=True).decode("utf-8").rstrip().lstrip() |
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
"""Dark magic for interactive python.""" | |
import builtins | |
import time | |
def ipy_here(leak_variables=True): | |
import IPython | |
import inspect | |
parent_frame = inspect.currentframe().f_back |
NewerOlder