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
This is a collection of linear algebra routines in NumPy | |
I find myself frequently reinventing the wheel, so these are minimal working examples for different problems I have |
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 ase | |
from ase import io | |
import os,time | |
import numpy as np | |
import itertools | |
import matplotlib.pyplot as plt | |
import matplotlib | |
fl=os.popen("ls *.pdb").read().split()[0] | |
mol=io.read(fl) |
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
for i in test*.py; do export j=`echo $i | sed 's/.py/.profile/g'`; python2 -m cProfile -o $j $i ; python2 -c "import pstats ; print(pstats.Stats('$j').sort_stats('tottime').print_stats(20))"; done > |
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
soxi -D * | awk '{SUM += $1} END { printf "%d:%d:%d\n",SUM/3600,SUM%3600/60,SUM%60}' |
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 | |
in=$1 | |
# colors that work are pink, white, brown, blue?, violet?, grey? | |
sf1=0.90; sf2=0.10; \ | |
sox -m \ | |
-v $(echo "$(sox $in -n stat -v 2>&1) * ${sf1}" | bc -l) $in \ | |
-v ${sf2} <(sox $in -p synth pinknoise) \ | |
-b 16 $(echo pink_${in}) |
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 tornado.gen | |
import tornado.process | |
import time | |
@tornado.gen.coroutine | |
def launch(pid): | |
time.sleep(0.01 * pid) | |
if pid != None: | |
print("hello, world from process {:}".format(pid + 1)) |
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
gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ hsize 3 | |
gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ vsize 3 |
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
grep --color='auto' -P -n "[^\x00-\x7F]" file |
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 | |
from __future__ import print_function | |
import websocket | |
import argparse | |
import json | |
import time | |
websocket.enableTrace(False) |
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
# install mkl | |
RUN apt update && apt install -y --force-yes apt-transport-https && \ | |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \ | |
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \ | |
sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list' && \ | |
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install cpio intel-mkl-64bit-2018.3-051 && \ | |
(find /opt/intel -name "ia32*" -exec rm -rf {} \; || echo "removing ia32 binaries") ; \ | |
(find /opt/intel -name "examples" -type d -exec rm -rf {} \; || echo "removing examples") ; \ | |
(find /opt/intel -name "benchmarks" -exec rm -rf {} \; || echo "removing benchmarks") ; \ | |
(find /opt/intel -name "documentation*" -exec rm -rf {} \; || echo "removing documentation") ; \ |
OlderNewer