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 python3 | |
import os | |
import tempfile | |
import subprocess | |
import fitz # PyMuPDF for reading PDFs | |
import re | |
import statistics | |
import argparse | |
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
#!/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 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 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 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 python | |
import argparse | |
import subprocess | |
import shlex | |
import shutil | |
import sys | |
def check_programs(*progs): | |
all_success = True |
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 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 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
#!/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 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 collections | |
JointInfo = collections.namedtuple( | |
"JointInfo", | |
[ | |
"index", | |
"name", | |
"type", | |
"q_index", |
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 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 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
;;; diction.el --- minor mode to interface the command diction | |
;;; Copyright Sven Utcke <[email protected]> | |
;; 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 <[email protected]> | |
;; Maintainer: Sven Utcke <[email protected]> |
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 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() |
NewerOlder