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
function qs() { | |
# Also use qs as shortcut to qstat -j | |
if [ $# -gt 0 ] | |
then | |
jobNum=$1 | |
qstat -j ${jobNum} | |
fi | |
# Just one call to qstat; "double quotes" around "${qstat_contents}" below maintain the line breaks |
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
function qda() { | |
# Delete all jobs containing $1 in their (shortened) name | |
jobName=$1 | |
# Get list of job numbers | |
jobList=$(echo "`qstat`" | grep "${jobName}" | awk '{print $1;}') | |
# Delete individually | |
for job in ${jobList} | |
do | |
qdel ${job} | |
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
#!/bin/sh | |
# matlab_np.sh | |
# Shell script to run a Matlab function from the bash shell | |
# Ensure Matlab function is on the path first | |
# NB Matlab breaks the bash shell, hence stty echo | |
# stty echo works by itself; stty sane is just-in-case; haven't confirmed that it's necessary. | |
# | |
# Example usage: $ matlab_np.sh functionName 'string arg' arg2 ${arg3}... | |
# Use with Qsub: $ ${QSUB_CMD} matlab_np.sh functionName arguments | |
# NB do not Qsub matlab directly as your arguments won't be passed to the Matlab function |
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
# .bashrc | |
# simple qsub: assings 8GB memory for 1 hour. Call with: $ nq8 script.sh | |
alias nq8='qsub -l h_rt=01:00:00 -l tmem=8.0G -l h_vmem=8.0G -l vf=4.0 -l s_stack=10240 -R y -j y -S /bin/csh -b y -cwd -V' | |
# Shell function to echo the current time along with status updates | |
echoStatusTime() { | |
STATUS_TEXT=$1 | |
NOW=$(date +%T) | |
DATE=$(date +%F) |
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
; Some Autohotkey shortcuts I use | |
#NoEnv | |
SetWorkingDir %A_ScriptDir% | |
GroupAdd, Explore, ahk_class CabinetWClass | |
GroupAdd, Explore, ahk_class ExploreWClass | |
SetTitleMatchMode, 2 | |
; load many useful global variables | |
LoadVariables() |
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
{ | |
"version": 1, | |
"disable_existing_loggers": "False", | |
"formatters": { | |
"simple": { | |
"format": "# {asctime} {name:8s} {levelname:6s} {message}", | |
"datefmt": "%m/%d/%Y %I:%M:%S %p", | |
"style": "{" | |
} | |
}, |
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
# Python snippets to check list contents | |
# Given two lists, A and B ... | |
# Check all the items from A are present in B: | |
set(B).issuperset(set(A)) | |
# Given a list of substrings A and another list of (longer) strings B which might contain those substrings ... | |
# e.g. | |
A = ['one', 'two', 'three'] |
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
' Demonstrating mixed argument types to Application.OnTime (Integer and String). | |
' See these pages for more: | |
' - http://www.markrowlinson.co.uk/articles.php?id=10 | |
' - https://www.mrexcel.com/forum/excel-questions/81724-calling-procedure-parameters.html | |
' - https://stackoverflow.com/questions/31439866/multiple-variable-arguments-to-application-ontime | |
Sub RunMe() | |
Dim testName As String | |
Dim counter As Integer | |
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
Codes and abbreviations for U.S. states, territories, and other regions | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
ISO | ISO 3166 codes (2-letter, 3-letter, and 3-digit codes from ISO 3166-1; 2+2-letter codes from ISO 3166-2) | |||||||||
ANSI | 2-letter and 2-digit codes from the ANSI standard INCITS 38:2009 | |||||||||
USPS | 2-letter codes used by the United States Postal Service | |||||||||
USCG | 2-letter codes used by the United States Coast Guard (red text shows differences between ANSI and USCG) | |||||||||
Abbreviations: | ||||||||||
GPO | Older variable-length official US Government Printing Office abbreviations | |||||||||
AP | Abbreviations from the AP Stylebook (red text shows differences between GPO and AP) | |||||||||
Name | status of region | ISO | ANSI-alphabetic | ANSI-numeric | USPS | USCG | GPO | AP | Other abbreviations | |
United States of America | Federal state | US USA 840 | US | 00 | U.S. | U.S. | U.S.A. |
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
REM Windows batch script to set up Jupyter QtConsole and Notebook in a Python3 virtual environment. | |
REM Place this script .bat file inside the root venv directory (same level as 'Scripts' and 'Lib' subfolders), and run. | |
REM Also creates convenience launching scripts. | |
REM Get current directory name and full path | |
for %%* in (.) do set VenvDirName=%%~nx* | |
set VenvDirFullPath=%~dp0 | |
REM Activate the venv | |
call %VenvDirFullPath%Scripts\activate.bat |
OlderNewer