To be able to edit code and run cells, you need to run the notebook yourself. Where would you like to run the notebook?

This notebook takes about 20 seconds to run.

In the cloud (experimental)

Binder is a free, open source service that runs scientific notebooks in the cloud! It will take a while, usually 2-7 minutes to get a session.

On your computer

(Recommended if you want to store your changes.)

  1. Copy the notebook URL:
  2. Run Pluto

    (Also see: How to install Julia and Pluto)

  3. Paste URL in the Open box

Frontmatter

If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and social media.

Author 1
"/tmp"
👀 Reading hidden code
tempdir()
15.8 μs
👀 Reading hidden code
import Dates
175 μs
2020-01-01
👀 Reading hidden code
now = Dates.Date(2020)
19.3 μs
"Experiment 1 (01 Jan 2020).jl"
👀 Reading hidden code
"Experiment 1 (" * Dates.format(now, Dates.DateFormat("dd u yyyy")) * ").jl"
41.3 ms
👀 Reading hidden code
Enter cell code...
68.3 μs
cute_name (generic function with 2 methods)
👀 Reading hidden code
begin
function cute_name(;suffix=".jl")
titlecase(rand(adjectives)) * " " * rand(nouns) * suffix
end
function cute_name(dir::AbstractString; suffix=".jl")
base = cute_name(;suffix="")
chosen = base * ".jl"
n = 1
while isfile(joinpath(dir, chosen))
n += 1
chosen = base * " " * string(n) * ".jl"
end
joinpath(dir, chosen)
end
end
2.8 ms
"/tmp/jl_2Obw5P"
👀 Reading hidden code
trash = mktempdir(; cleanup=false)
4.9 ms
👀 Reading hidden code
for i in 1:100
touch(cute_name(trash))
end
32.8 ms
"/tmp/jl_2Obw5P/Important report.jl"
cute_name(trash)
👀 Reading hidden code
26.8 μs
"Unexpected blueprint.jl"
cute_name()
👀 Reading hidden code
13.1 μs
f (generic function with 2 methods)
f(x=rand())=x
👀 Reading hidden code
589 μs
0.734680411954322
f()
👀 Reading hidden code
11.2 μs
96
length(adjectives) * length(nouns)
👀 Reading hidden code
14.6 μs
adjectives = [
"groundbreaking"
"important"
"novel"
"fun"
"interesting"
"fascinating"
"surprising"
"unexpected"
]
👀 Reading hidden code
15.4 μs
nouns = [
"discovery"
"experiment"
"story"
"journal"
"notebook"
"revelation"
"computation"
"creation"
"analysis"
"invention"
"blueprint"
"report"
]
👀 Reading hidden code
40.3 μs
Iterators.countfrom(1)
👀 Reading hidden code
2.8 ms
Error message

MethodError: no method matching filter(::var"#7#8"{typeof(>)}, ::Base.Iterators.Count{Int64})

Closest candidates are:

filter(::Any, ::Tuple) at /opt/hostedtoolcache/julia/1.7.3/x64/share/julia/base/tuple.jl:363

filter(::Any, ::Array{T, N}) where {T, N} at /opt/hostedtoolcache/julia/1.7.3/x64/share/julia/base/array.jl:2479

filter(::Any, ::AbstractDict) at /opt/hostedtoolcache/julia/1.7.3/x64/share/julia/base/abstractdict.jl:434

...

Stack trace

Here is what happened, the most recent locations are first:

  1. filter(c -> c>4, Iterators.countfrom(1))
filter(c -> c>4, Iterators.countfrom(1))
👀 Reading hidden code
---
Error message

syntax: unexpected ","

Computers are hard!
first(Iterators.filter(, Iterators.countfrom(1)))
👀 Reading hidden code
---