Skip to content

Instantly share code, notes, and snippets.

View paulgribble's full-sized avatar

Paul Gribble paulgribble

View GitHub Profile
@paulgribble
paulgribble / test_motornet.py
Last active November 7, 2023 14:18
motornet tests
import os, time, sys, json
import numpy as np
import torch as th
import matplotlib.pyplot as plt
import motornet as mn
def main_fcn(USE_DUMMY_FUN):
print(f"\nUSE_DUMMY_FUN = {USE_DUMMY_FUN}\n")
@paulgribble
paulgribble / batchsize.py
Created November 5, 2023 15:01
Effect of batch size on simulation time per movement during MotorNet training
# %%
import os
import time
import sys
import json
import numpy as np
import torch as th
import matplotlib.pyplot as plt
import motornet as mn
@paulgribble
paulgribble / pip_upgrade_all.py
Created June 22, 2022 20:37
upgrade all packages using pip
import pkg_resources
from subprocess import call
packages = [dist.project_name for dist in pkg_resources.working_set]
call("pip install --upgrade " + ' '.join(packages), shell=True)
@paulgribble
paulgribble / gist:84bf1bf5e9b71e9ff650382b919289b0
Created January 3, 2019 14:41
some css for an orgmode html export
html {
font-family: verdana, sans-serif;
font-weight: 400;
font-size: 10pt;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
min-width: 800px;
max-width: 800px;
@paulgribble
paulgribble / gist:ecd11869d306a3ac870e
Created November 19, 2015 14:49
MATLAB "hold on" subplot demo for Gavin
x = 1:50;
figure
subplot(1,2,1)
hold on
plot(x, randn(size(x)),'bs-')
plot(x,sin(x),'r+-')
set(gca,'ylim',[-3 3])
plot(x,repmat(1,size(x,2)),'r-','linewidth',2)
plot(x,repmat(-1,size(x,2)),'r-','linewidth',2)
subplot(1,2,2)
matlab2014a retina mac blurry?
(1) cd /Applications/MATLAB_R2014a.app/sys/java/jre/maci64
(2) mv jre jre.orig
(3) ln -s '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' jre
@paulgribble
paulgribble / gist:7291469
Created November 3, 2013 15:30
getting afni working on mac osx 10.9 mavericks with home-brew
Getting afni working on Mac OSX 10.9 Mavericks, using Homebrew
Briefly: parts of afni (e.g. uber_subject.py) require the pyqt library ... and pyqt requires qt ... but the homebrew install of qt is currently broken on osx mavericks 10.9 ... but there is a patch ... but pyqt also requires sip ... and there is a problem where pyqt doesn't like the version of sip, in particular with a newer haswell CPU macbook pro ... but there is a fix ... and we need to add lines to our .bash_profile for afni ... and be careful if you have other python things installed since afni expects to find python things in certain locations
Here is a step-by-step:
1. install Xcode command line tools
xcode-select --install
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@paulgribble
paulgribble / torquemodel
Created November 21, 2012 22:52
torque model
{
"metadata": {
"name": "torqueModel"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@paulgribble
paulgribble / install.sh
Created September 10, 2012 17:45
ubuntu install LaTeX
#!/bin/sh
# LaTeX
echo "installing LaTeX"
sudo apt-get -qq install texlive-full texlive-fonts-extra cm-super texlive-latex-extra auctex
sudo texconfig paper letter
wget http://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts
chmod +x install-getnonfreefonts
sudo ./install-getnonfreefonts
sudo getnonfreefonts garamond