Access to remote server. and we user PYENV for set up python environment.
$ ssh your_remote_server
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
$ vim .zshrc
export PYENV_ROOT=$HOME/.pyenv
export PATH=$PYENV_ROOT/bin:$PATH
function [weightedAve] = weightedAverage(data) | |
h = histogram(data); | |
k = ([min(data):max(data)]*h.Values')/length(data) | |
end |
import os, numpy, PIL | |
from PIL import Image | |
def all_image_file_name(): | |
allfiles = os.listdir(os.getcwd()) | |
# discriminate the JPEG format | |
imlist = [filename for filename in allfiles if filename.split(".")[-1] in ["jpg", "jpeg", "JPG"]] | |
image_file_list = "\n".join(imlist) |
% be the symmetric matrix on computing enviroment. | |
% Twice A, divide 2. | |
A = 0.5*(A+A') | |
% Add upper triangle of A(include diagenal element) to lower triangle matrix of A. | |
A = triu(A)+triu(A,1)' |
res = 10^(-13); | |
A = [[1, 2, 0]; | |
[2, 1, 1]; | |
[0, 1, 0];] | |
[V, D] =eig(A) | |
eigen_value = diag(D); | |
norm(A*V(:,3)-eigen_value(3)*V(:,3)) | |
x = [1; 0; 0] | |
ite = 0; |
n = 5; | |
res = 10^(-13); | |
A = rand(n,n); | |
A = A'+A; | |
x = rand(n,1) | |
x_1 = A*x; | |
ite = 0; | |
while res < abs(norm(x_1)-norm(x)) |
Access to remote server. and we user PYENV for set up python environment.
$ ssh your_remote_server
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
$ vim .zshrc
export PYENV_ROOT=$HOME/.pyenv
export PATH=$PYENV_ROOT/bin:$PATH