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 | |
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
#!/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
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
% 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
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
#!/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
#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
./testlowtran | |
for wavelengths [nm]: 1200.48022 1132.50281 1071.81128 1017.29407 968.054260 923.361084 882.612549 845.308533 811.030029 779.423218 750.187561 723.065796 697.836670 674.308838 652.315735 631.711975 612.369873 594.177063 577.034058 560.852478 545.553772 531.067444 517.330566 504.286407 491.883911 480.076813 468.823242 458.085205 447.828033 438.020142 428.632690 419.639099 411.015198 402.738617 394.788788 387.146729 379.794922 372.717102 365.898285 359.324463 352.982697 346.860901 340.947845 335.232971 329.706543 324.359375 319.182892 314.169006 309.310242 304.599457 300.029999 | |
transmission: 0.934353650 0.653181911 0.980576396 0.988120317 0.922352910 0.928113937 0 |
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
new high-speed USB device number 42 using xhci_hcd | |
New USB device found, idVendor=8086, idProduct=e005 | |
New USB device strings: Mfr=2, Product=1, SerialNumber=3 | |
Product: MERRIFIELD | |
Manufacturer: INTEL | |
SerialNumber: XXX | |
USB disconnect, device number 42 | |
new high-speed USB device number 43 using xhci_hcd | |
New USB device found, idVendor=8086, idProduct=e005 | |
New USB device strings: Mfr=2, Product=1, SerialNumber=3 |