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 | |
for f in "$@" | |
do | |
w=`cat "$f" | sed "s/ */\\n/g" | sed "s/[^a-zA-Z0-9]//g" | sed "s/[0-9]*//g" | sed "/^$/d" | wc -w` | |
s=`cat "$f" | tr -d " \t\n\r" | sed "s/\./\\n/g" | sed "s/\?/\\n/g" | sed "s/\!/\\n/g" | wc -l` | |
z=$(expr "$w" / "$s") | |
echo $f: | |
echo " "$w words | |
echo " "$s sentences |
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
Show hidden characters
// Sublime Text settings | |
{ | |
"auto_complete_commit_on_tab": true, | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"default_line_ending": "unix", | |
"detect_indentation": true, | |
"font_size": 13, | |
"ignored_packages": | |
[ | |
"Vintage" |
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
[ | |
{ "name": "Priority: Low", "color": "#009800" }, | |
{ "name": "Priority: Medium", "color": "#fbca04" }, | |
{ "name": "Priority: High", "color": "#eb6420" }, | |
{ "name": "Priority: Critical", "color": "#e11d21" }, | |
{ "name": "Status: Abandoned", "color": "#000000" }, | |
{ "name": "Status: Accepted", "color": "#009800" }, | |
{ "name": "Status: Available", "color": "#bfe5bf" }, | |
{ "name": "Status: Blocked", "color": "#e11d21" }, | |
{ "name": "Status: Completed", "color": "#006b75" }, |
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 | |
# https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions | |
# Install prerequisites | |
sudo apt install subversion git-core git-svn | |
sudo apt install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig1-dev libxrender-dev libncurses5-dev | |
sudo apt install cmake | |
sudo apt install libgstreamer-plugins-base1.0-dev # qt5 | |
# Checkout |
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 | |
# If boost not found install libboost-all-dev | |
# If unable to find libpng12-dev use sudo apt-add-repository "deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe" && sudo apt update && sudo apt install libpng12-dev | |
sudo apt-get install libboost-dev zlib1g-dev libpng12-dev libjpeg8-dev libtiff5-dev libopenexr-dev autoconf | |
git clone https://github.com/POV-Ray/povray.git | |
cd unix/ | |
source ./prebuild.sh |
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 | |
sudo apt-add-repository ppa:swi-prolog/stable | |
sudo apt update | |
sudo apt install swi-prolog |
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
def np_convolve2d(a, v, mode='valid', keep_dims=False): # mode='valid' | |
"""Convolve an image with filter_n using valid mode | |
In valid mode the output consists only of those elements that do not rely on the zero-padding. | |
# TODO: full and same modes | |
Parameters | |
---------- | |
a : (N,) array_like | |
First one-dimensional input array. | |
v : (M,) array_like |
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
def concatenate_array_files(src_dir, file_name): | |
"""Create a memory-mapped array comprised of the concatenation of every | |
.npy file in a directory | |
Parameters | |
---------- | |
src_dir : str | |
Directory of 2D .npy arrays with matching feature counts | |
file_name : str | |
File in which to save the concatenated arrays |
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
from itertools import islice, repeat, chain, combinations | |
import random | |
def contents_as_str(iterable, delim=' '): | |
"""Provides the contents of an iterable as a string. | |
Parameters | |
---------- | |
iterable : Iterable |
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 | |
echo Please enter the user@hostname | |
read userhost | |
ssh-keygen -t ecdsa -b 521 | |
echo Please reenter the file in which to save the key plus .pub | |
read pubfile |
OlderNewer