yomichi / juliabook-samples Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
stable 部分を個別のバージョン(v1 とか v1.3 とか)にするとページがあります。
https://docs.julialang.org/en/v1/stdlib/REPL/#Key-bindings-1
同じ原因で P13 の Style Guide 系のリンクも切れています。
using Base.Threads
をしないと
ERROR: LoadError: UndefVarError: @threads not defined
と言われます。
P82 の rw_stat.jl の 16行目の randomwalk function 内の for index の範囲は 0:nsteps
ではなく 1:nsteps
だと思います。
now()
を Dates.now()
とするか、
事前に
@everywhere using Dates
が必要だと思います。
P71 の「内部インストラクタ」は「内部コンストラクタ」の typo だと思います。
P89 で 「print_range は以前定義した関数です。」とありますが、本文中に print_range の定義はされていないと思います。
i には 1,2,3,4,5 が入り、sleep(5) が max なので 5秒かかると思います。
julia> @time @sync begin
for i in 1:5
@async (sleep(i); println("$i $(now())"))
end
println("0 $(now())")
end
0 2020-01-28T14:18:18.968
1 2020-01-28T14:18:19.99
2 2020-01-28T14:18:20.99
3 2020-01-28T14:18:21.989
4 2020-01-28T14:18:22.988
5 2020-01-28T14:18:23.989
5.020843 seconds (55.86 k allocations: 2.693 MiB)
P66 で出てくる readall ですが、無いと言われてしまいます。Julia の VERSION は 1.3.1 です。
julia> VERSION
v"1.3.1"
help?> readall
search: @threadcall readavailable isreadable
Couldn't find readall
Perhaps you meant read, read!, readdir, real, findall or @threadcall
No documentation found.
Binding readall does not exist.
julia>
42 が promise に入っていないので syntax エラーになります。
julia> task = Task(() -> (sleep(1); println(now())); 42)
ERROR: syntax: invalid keyword argument syntax "42"
Stacktrace:
[1] top-level scope at REPL[64]:1
task = Task(() -> (sleep(1); println(now())); 42)
↓
task = Task(() -> (sleep(1); println(now()); 42))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.