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
Python code to calculate inflection points |
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
/* | |
* From https://www.open-mpi.org/faq/?category=runcuda | |
* Command: | |
* $ mpic++ cuda_aware_check.cpp | |
* $ mpirun a.out | |
* Program that shows the use of CUDA-aware macro and runtime check. | |
* Requires Open MPI v2.0.0 or later. | |
*/ | |
#include <stdio.h> | |
#include "mpi.h" |
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
#Requires -RunAsAdministrator | |
# Unlock-PowerCfg - v22.05.11 | |
# Disable "Connected Standby" | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Power' -Name 'CSEnabled' -Value 0 -Force | |
# Get Power Settings entries and add/set 'Attributes' to 2 to unhide | |
$PowerCfg = (Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings' -Recurse).Name -notmatch '\bDefaultPowerSchemeValues|(\\[0-9]|\b255)$' | |
foreach ($item in $PowerCfg) { Set-ItemProperty -Path $item.Replace('HKEY_LOCAL_MACHINE','HKLM:') -Name 'Attributes' -Value 2 -Force } |
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 | |
find . -regex ".*\.\(opus\|ogg\|m4a\)" -print0 | | |
while IFS= read -r -d $'\0' filename; do | |
echo $filename | |
name="${filename%.*}" | |
< /dev/null ffmpeg -nostats -loglevel 0 -n -i "$filename" -b:a 0 -codec:a libmp3lame -vn "./$name.mp3" | |
done |
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
def blockAverage(datastream, isplot=True, maxBlockSize=0): | |
"""This program computes the block average of a potentially correlated timeseries "x", and | |
provides error bounds for the estimated mean <x>. | |
As input provide a vector or timeseries "x", and the largest block size. | |
Check out writeup in the following blog posts for more: | |
http://sachinashanbhag.blogspot.com/2013/08/block-averaging-estimating-uncertainty_14.html | |
http://sachinashanbhag.blogspot.com/2013/08/block-averaging-estimating-uncertainty.html | |
""" |
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 -e | |
# Distro: Amazon Linux AMI release 2015.03 | |
# Derived from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos | |
# Builds the dependencies in parallel prior to starting FFmpeg build. | |
sudo yum update -y | |
sudo yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel yasm libogg libvorbis-devel libvpx-devel |
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
from scipy.interpolate import UnivariateSpline | |
import numpy as np | |
def curvature_splines(x, y=None, error=0.1): | |
"""Calculate the signed curvature of a 2D curve at each point | |
using interpolating splines. | |
Parameters | |
---------- | |
x,y: numpy.array(dtype=float) shape (n_points, ) |
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 | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |