-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Akaike Ryoko
committed
Oct 8, 2019
0 parents
commit 764c55b
Showing
212 changed files
with
54,837 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$ sudo apt update | ||
$ sudo apt -y install build-essential | ||
|
||
$ wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.2.0-linux-x86_64.tar.gz | ||
$ tar xvfz julia-1.2.0-linux-x86_64.tar.gz | ||
$ sudo ln -s /home/ubuntu/julia-1.2.0/bin/julia /usr/local/bin/julia |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"cmd": ["ConEmu64", "/cmd", "julia -i", "$file"], | ||
"selector": "source.julia" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
$ wget -P ~/ https://raw.githubusercontent.com/Naereen/nanorc/master/julia.nanorc | ||
$ echo include \"~/julia.nanorc\" >> ~/.nanorc | ||
|
||
|
||
git clone git://github.com/JuliaEditorSupport/julia-vim.git | ||
mkdir -p ~/.vim | ||
cp -R julia-vim/* ~/.vim | ||
|
||
|
||
wget -P ~/julia-emacs/ https://raw.githubusercontent.com/JuliaEditorSupport/julia-emacs/master/julia-mode.el | ||
echo "(add-to-list 'load-path \"~/julia-emacs\")" >> ~/.emacs | ||
echo "(require 'julia-mode)" >> ~/.emacs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
$ sudo apt update | ||
$ sudo apt install --yes build-essential python-minimal gfortran m4 cmake pkg-config libssl-dev | ||
|
||
|
||
$ git clone git://github.com/JuliaLang/julia.git | ||
$ cd julia | ||
$ git checkout v1.2.0 | ||
|
||
$ make -j $((`nproc`-1)) 1>build_log.txt 2>build_error.txt | ||
|
||
|
||
$ cd ~ | ||
# Get link from MKL website | ||
$ wget http://registrationcenter-download.intel.com/[go to Intel MKL web site to get link]/l_mkl_2019.0.117.tgz | ||
$ tar zxvf l_mkl_2019.0.117.tgz | ||
$ cd l_mkl_2019.0.117 | ||
$ sudo bash install.sh | ||
|
||
cd ~/julia | ||
echo "USEICC = 0" >> Make.user | ||
echo "USEIFC = 0" >> Make.user | ||
echo "USE_INTEL_MKL = 1" >> Make.user | ||
echo "USE_INTEL_LIBM = 0" >> Make.user | ||
source /opt/intel/bin/compilervars.sh intel64 | ||
make -j $((`nproc`-1)) 1>build_log.txt 2>build_error.txt | ||
|
||
|
||
$ cd ~ | ||
# Get the link from Intel C++ compilers website | ||
$ wget http://[go to Intel to get link]/parallel_studio_xe_2018_update3_professional_edition.tgz | ||
$ tar zxvf parallel_studio_xe_2018_update3_professional_edition.tgz | ||
$ cd parallel_studio_xe_2018_update3_professional_edition | ||
$ sudo bash install.sh | ||
|
||
cd ~/julia | ||
echo "USEICC = 0" >> Make.user | ||
echo "USEIFC = 0" >> Make.user | ||
echo "USE_INTEL_MKL = 1" >> Make.user | ||
echo "USE_INTEL_LIBM = 1" >> Make.user | ||
source /opt/intel/bin/compilervars.sh intel64 | ||
make -j $((`nproc`-1)) 1>build_log.txt 2>build_error.txt | ||
|
||
|
||
$ sudo ln -s /home/ubuntu/julia/usr/bin/julia /usr/local/bin/julia |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"cmd" : ["julia", "$file", "$args"], | ||
"info" : "Started $project_path$file_name", | ||
"selector" : "source.jl" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$ julia -i hello.jl Al Bo Cyd | ||
$ julia -e "println(factorial(10))" | ||
$ julia --banner=no | ||
|
||
|
||
julia> RandomDevice() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
println("Hello " * join(ARGS, ", ")) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using Random | ||
|
||
ENV["JULIA_EDITOR"] = "vim" | ||
|
||
println("Setup successful") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
$ julia --banner=no -p 2 | ||
|
||
|
||
julia> using Distributed | ||
julia> nworkers() | ||
julia> exit() | ||
|
||
|
||
$ julia --banner=no -p auto -L hello.jl | ||
|
||
|
||
julia> exit() | ||
|
||
|
||
$ julia --banner=no -p auto -L hello2.jl | ||
|
||
|
||
julia> exit() | ||
|
||
|
||
# Linux bash | ||
$ export JULIA_NUM_THREADS=`nproc` | ||
$ julia -e "println(Threads.nthreads())" | ||
|
||
|
||
# Windows cmd | ||
C:\> set JULIA_NUM_THREADS=%NUMBER_OF_PROCESSORS% | ||
C:\> julia -e "println(Threads.nthreads())" | ||
|
||
|
||
D:\> julia --banner=no -p 2 -L hello2.jl | ||
|
||
|
||
julia> pwd() | ||
julia> using Distributed | ||
julia> pmap(i -> (i, myid(), pwd()), 1:nworkers()) | ||
julia> cd("C:\\") | ||
julia> pwd() | ||
julia> addprocs(2) | ||
julia> pmap(i -> (i,myid(),pwd()), 1:nworkers()) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
println("Hello " * join(ARGS, ", ")) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
println("Hello " * join(ARGS, ", ")) | ||
sleep(1) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
julia> x = 10 # 単なるテスト | ||
julia> @edit sin(1.0) | ||
julia> ; | ||
|
||
|
||
# Linux bash | ||
shell> ls | ||
|
||
# Windows cmd | ||
shell> dir | ||
|
||
|
||
julia> include("example.jl") | ||
julia> ? | ||
help?> include | ||
julia> <CTRL-R> | ||
(reverse-i-search)`x =': x = 10 | ||
julia> x = 10 | ||
julia> exit() | ||
julia> @which sin(1.0) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
println("An example was run!") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
julia> using Pkg; Pkg.add("PyPlot") | ||
julia> include("display.jl") | ||
|
||
|
||
$ julia display.jl | ||
$ julia display2.jl | ||
|
||
|
||
julia> transpose(1:100) | ||
julia> rand(100, 100); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using PyPlot, Random | ||
|
||
function f() | ||
Random.seed!(1) | ||
r = rand(50) | ||
@show sum(r) | ||
display(transpose(r)) | ||
print(transpose(r)) | ||
plot(r) | ||
end | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using PyPlot, Random | ||
|
||
function f() | ||
Random.seed!(1) | ||
r = rand(50) | ||
@show sum(r) | ||
display(transpose(r)) | ||
print(transpose(r)) | ||
plot(r) | ||
show() | ||
end | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
julia> ] | ||
(v1.0) pkg> status | ||
(v1.0) pkg> add BenchmarkTools | ||
(v1.0) pkg> status | ||
(v1.0) pkg> precompile | ||
|
||
|
||
julia> using BenchmarkTools | ||
julia> @btime rand() | ||
|
||
julia> ] | ||
(v1.0) pkg> add [email protected] | ||
(v1.0) pkg> pin BSON | ||
(v1.0) pkg> free BSON |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
julia> ] | ||
(v1.2) pkg> add IJulia | ||
|
||
julia> using IJulia | ||
julia> notebook() | ||
|
||
|
||
$ ~/.julia/packages/Conda/hsaaN/deps/usr/bin/jupyter notebook | ||
|
||
|
||
C:\> %userprofile%\.julia\packages\Conda\hsaaN\deps\usr\Scripts\jupyter-notebook | ||
|
||
|
||
ENV["JUPYTER"] = "[path to your jupyter program]" | ||
using Pkg | ||
Pkg.build("IJulia") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
julia> ] | ||
(v1.2) pkg> add Conda | ||
|
||
julia> using Conda | ||
julia> Conda.add("jupyterlab") | ||
|
||
|
||
$ ~/.julia/packages/Conda/hsaaN/deps/usr/bin/jupyter lab | ||
|
||
|
||
C:\> %userprofile%\.julia\packages\Conda\hsaaN\deps\usr\Scripts\jupyter-lab | ||
|
||
|
||
$ wget https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh | ||
|
||
$ sudo bash Anaconda3-5.3.0-Linux-x86_64.sh | ||
|
||
$ /home/ubuntu/anaconda3/bin/jupyter lab | ||
|
||
|
||
C:\> C:\ProgramData\Anaconda3\Scripts\jupyter-lab.exe |
13 changes: 13 additions & 0 deletions
13
Chapter01/13. ターミナルしか使えないクラウド環境でJupyter Notebookを使う/commands.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$ chmod 400 keyfile.pem | ||
|
||
|
||
$ ssh -i path/to/keyfile.pem -L8888:127.0.0.1:8888 ubuntu@[enter_hostname_here] | ||
|
||
$ ~/.julia/packages/Conda/hsaaN/deps/usr/bin/jupyter lab | ||
|
||
C:\> %userprofile%\.julia\packages\Conda\hsaaN\deps\usr\Scripts\jupyter-lab | ||
|
||
|
||
julia> using IJulia | ||
julia> notebook(detached=true) | ||
julia> run(`$(IJulia.notebook_cmd[1]) notebook list`) |
Oops, something went wrong.