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
#include "hdf5.h" | |
#define FILE "dset.h5" | |
int main() { | |
hid_t file_id, dataset_id,dataspace_id; /* identifiers */ | |
herr_t status; | |
int i, j, dset_data[4][6], read_data[4][6]; | |
hsize_t dims[2]; |
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 | |
# useful for platforms such as Cygwin that don't currently have GNU Parallel in their repo. | |
# prerequisite: make | |
( | |
wd=$(mktemp -d) | |
wget -nc -P $wd ftp://ftp.gnu.org/gnu/parallel/parallel-latest.tar.bz2 | |
cd $wd |
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
moved to https://github.com/scienceopen/fortran2015-examples |
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
% 200x320 image is now in variable X | |
load clown | |
% I ravel X to a row vector, and unravel with Numpy | |
Xp = py.numpy.reshape(X(:)',size(X),'F'); | |
% Apply Gaussian filter to image | |
Yp = py.skimage.filters.gaussian(Xp,3); | |
% now let's come back to Matlab |
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
cmake -DBUILD_TIFF=ON -DBUILD_opencv_java=OFF -DWITH_CUDA=OFF -DENABLE_AVX=OFF -DWITH_OPENGL=OFF \ | |
-DWITH_OPENCL=OFF -DWITH_IPP=OFF -DWITH_TBB=OFF -DWITH_EIGEN=OFF -DWITH_V4L=OFF -DBUILD_TESTS=OFF \ | |
-DBUILD_PERF_TESTS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \ | |
-DPYTHON3_EXECUTABLE=$(which python3) \ | |
-DPYTHON3_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \ | |
-DPYTHON3_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") .. | |
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/sh | |
# run on remote PC, connect with runvnc.sh | |
vncserver -kill :1 | |
vncserver :1 -geometry 1200x800 -localhost | |
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/sh | |
ssh -f -L 5901:localhost:5901 username@address sleep 1; | |
ssvncviewer localhost::5901 |
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
import matplotlib.pyplot as plt | |
from matplotlib.ticker import MaxNLocator | |
#... | |
ax = plt.figure().gca() | |
#... | |
ax.xaxis.set_major_locator(MaxNLocator(integer=True)) |
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/sh | |
# | |
# finds N biggest directories. | |
# Alternative is "ncdu" a graphical biggest file program | |
\du -hd1 $1 | sort -h | head -n 8 |
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
%% create data, 25 frames of 512x512 pixels | |
data = rand(512,512,25); | |
%% create blank image | |
img = imagesc(rand(512)); | |
ht = title(''); % to show frame number | |
%% for loop to play "movie" | |
for i = 1:25 | |
set(img,'cdata',data(:,:,i)) % update latest frame |