👀 Reading hidden code
👀 Reading hidden code
👀 Reading hidden code
1
2
1:5
6
👀 Reading hidden code
[1,2,1:5,6]
DomainError with -1.0:
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
Here is what happened, the most recent locations are first:
- throw_complex_domainerror
(f::Symbol, x::Float64) from math.jl:33 - sqrtfrom math.jl:567
- sqrtfrom math.jl:1221
- |>
(x::Int64, f::typeof(sqrt)) from operators.jl:966 - from This cell: line 1
ap |> sqrt
ap |> sqrt
👀 Reading hidden code
-1
ap = -1
👀 Reading hidden code
@bind oo Slider(1:10000)
👀 Reading hidden code
1
sleep(.5); oo
👀 Reading hidden code
begin
using Images
using PlutoUI
end
👀 Reading hidden code
Multiple expressions in one cell.
How would you like to fix it?
1
2
👀 Reading hidden code
DomainError with -1.0:
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
Here is what happened, the most recent locations are first:
- throw_complex_domainerror
(f::Symbol, x::Float64) from math.jl:33 - sqrtfrom math.jl:567
- sqrt
(x::Int64) from math.jl:1221 - from This cell: line 1
sqrt(-1)
sqrt(-1)
👀 Reading hidden code
@bind go Button("Go!")
👀 Reading hidden code
0.259735
0.827688
0.134627
0.47059
0.952686
0.038839
0.70826
0.0477394
0.903666
0.976527
0.304991
0.344564
0.99382
0.917818
0.644774
0.898185
0.708885
0.465554
0.709624
0.80958
0.211669
0.244733
0.447326
0.460595
0.525276
0.224303
0.220612
0.471148
0.619107
0.287111
data = let
go
rand(100)
end
👀 Reading hidden code
52.51125667643765
sum(data)
👀 Reading hidden code
throwto (generic function with 1 method)
Base.throwto
👀 Reading hidden code
:.=
svec(" .=\n\nPerform broadcasted assignment. The right-side argument is expanded as in\n[`broadcast`](@ref) and then assigned into the left-side argument in-place.\nFuses with other dotted operators in the same expression; i.e. the whole\nassignment expression is converted into a single loop.\n\n`A .= B` is similar to `broadcast!(identity, A, B)`.\n\n# Examples\n```jldoctest\njulia> A = zeros(4, 4); B = [1, 2, 3, 4];\n\njulia> A .= B\n4×4 Array{Float64, 2}:\n 1.0 1.0 1.0 1.0\n 2.0 2.0 2.0 2.0\n 3.0 3.0 3.0 3.0\n 4.0 4.0 4.0 4.0\n\njulia> A\n4×4 Array{Float64, 2}:\n 1.0 1.0 1.0 1.0\n 2.0 2.0 2.0 2.0\n 3.0 3.0 3.0 3.0\n 4.0 4.0 4.0 4.0\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
377
:path
"docs/basedocs.jl"
:for
svec(" for\n\n`for` loops repeatedly evaluate a block of statements while\niterating over a sequence of values.\n\n# Examples\n```jldoctest\njulia> for i in [1, 4, 0]\n println(i)\n end\n1\n4\n0\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
752
:path
"docs/basedocs.jl"
:macro
svec(" macro\n\n`macro` defines a method for inserting generated code into a program.\nA macro maps a sequence of argument expressions to a returned expression, and the\nresulting expression is substituted directly into the program at the point where\nthe macro is invoked.\nMacros are a way to run generated code without calling [`eval`](@ref Base.eval), since the generated\ncode instead simply becomes part of the surrounding program.\nMacro arguments may include expressions, literal values, and symbols. Macros can be defined for\nvariable number of arguments (varargs), but do not accept keyword arguments.\nEvery macro also implicitly gets passed the arguments `__source__`, which contains the line number\nand file name the macro is called from, and `__module__`, which is the module the macro is expanded\nin.\n\n# Examples\n```jldoctest\njulia> macro sayhello(name)\n return :( println(\"Hello, \", \$name, \"!\") )\n end\n@sayhello (macro with 1 method)\n\njulia> @sayhello \"Charlie\"\nHello, Charlie!\n\njulia> macro saylots(x...)\n return :( println(\"Say: \", \$(x...)) )\n end\n@saylots (macro with 1 method)\n\njulia> @saylots \"hey \" \"there \" \"friend\"\nSay: hey there friend\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
175
:path
"docs/basedocs.jl"
:...
svec(" ...\n\nThe \"splat\" operator, `...`, represents a sequence of arguments.\n`...` can be used in function definitions, to indicate that the function\naccepts an arbitrary number of arguments.\n`...` can also be used to apply a function to a sequence of arguments.\n\n# Examples\n```jldoctest\njulia> add(xs...) = reduce(+, xs)\nadd (generic function with 1 method)\n\njulia> add(1, 2, 3, 4, 5)\n15\n\njulia> add([1, 2, 3]...)\n6\n\njulia> add(7, 1:100..., 1000:1100...)\n111107\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
948
:path
"docs/basedocs.jl"
:do
svec(" do\n\nCreate an anonymous function and pass it as the first argument to\na function call.\nFor example:\n\n```julia\nmap(1:10) do x\n 2x\nend\n```\n\nis equivalent to `map(x->2x, 1:10)`.\n\nUse multiple arguments like so:\n\n```julia\nmap(1:10, 11:20) do x, y\n x + y\nend\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
923
:path
"docs/basedocs.jl"
:||
svec(" x || y\n\nShort-circuiting boolean OR.\n\nSee also: [`|`](@ref), [`xor`](@ref), [`&&`](@ref).\n\n# Examples\n```jldoctest\njulia> pi < 3 || ℯ < 3\ntrue\n\njulia> false || true || println(\"neither is true!\")\ntrue\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
1020
:path
"docs/basedocs.jl"
:struct
svec(" struct\n\nThe most commonly used kind of type in Julia is a struct, specified as a name and a\nset of fields.\n\n```julia\nstruct Point\n x\n y\nend\n```\n\nFields can have type restrictions, which may be parameterized:\n\n```julia\nstruct Point{X}\n x::X\n y::Float64\nend\n```\n\nA struct can also declare an abstract super type via `<:` syntax:\n\n```julia\nstruct Point <: AbstractPoint\n x\n y\nend\n```\n\n`struct`s are immutable by default; an instance of one of these types cannot\nbe modified after construction. Use [`mutable struct`](@ref) instead to declare a\ntype whose instances can be modified.\n\nSee the manual section on [Composite Types](@ref) for more details,\nsuch as how to define constructors.\n")
nothing
:module
Base.BaseDocs
:linenumber
1115
:path
"docs/basedocs.jl"
:julia
svec("**Welcome to Julia ", "1.7.3", ".** The full manual is available at\n\n https://docs.julialang.org\n\nas well as many great tutorials and learning resources:\n\n https://julialang.org/learning/\n\nFor help on a specific function or macro, type `?` followed\nby its name, e.g. `?cos`, or `?@time`, and press enter.\nType `;` to enter shell mode, `]` to enter package mode.\n")
nothing
:module
Base.BaseDocs
:linenumber
14
:path
"docs/basedocs.jl"
Symbol("}")
svec(" {}\n\nCurly braces are used to specify [type parameters](@ref man-parametric-types).\n\nType parameters allow a single type declaration to introduce a whole family of\nnew types — one for each possible combination of parameter values. For example,\nthe [`Set`](@ref) type describes many possible types of sets; it uses one type\nparameter to describe the type of the elements it contains. The specific _parameterized_\ntypes `Set{Float64}` and `Set{Int64}` describe two _concrete_ types: both are\nsubtypes ([`<:`](@ref)) of `Set`, but the former has `Float64` elements and the latter\nhas `Int64` elements.\n")
nothing
:module
Base.BaseDocs
:linenumber
480
:path
"docs/basedocs.jl"
:where
svec(" where\n\nThe `where` keyword creates a type that is an iterated union of other types, over all\nvalues of some variable. For example `Vector{T} where T<:Real` includes all [`Vector`](@ref)s\nwhere the element type is some kind of `Real` number.\n\nThe variable bound defaults to [`Any`](@ref) if it is omitted:\n\n```julia\nVector{T} where T # short for `where T<:Any`\n```\nVariables can also have lower bounds:\n\n```julia\nVector{T} where T>:Int\nVector{T} where Int<:T<:Real\n```\nThere is also a concise syntax for nested `where` expressions. For example, this:\n\n```julia\nPair{T, S} where S<:Array{T} where T<:Number\n```\ncan be shortened to:\n\n```julia\nPair{T, S} where {T<:Number, S<:Array{T}}\n```\nThis form is often found on method signatures.\n\nNote that in this form, the variables are listed outermost-first. This matches the\norder in which variables are substituted when a type is \"applied\" to parameter values\nusing the syntax `T{p1, p2, ...}`.\n")
nothing
:module
Base.BaseDocs
:linenumber
1174
:path
"docs/basedocs.jl"
:ans
svec(" ans\n\nA variable referring to the last computed value, automatically set at the interactive prompt.\n")
nothing
:module
Base.BaseDocs
:linenumber
1233
:path
"docs/basedocs.jl"
:module
svec(" module\n\n`module` declares a [`Module`](@ref), which is a separate global variable workspace. Within a\nmodule, you can control which names from other modules are visible (via importing), and\nspecify which of your names are intended to be public (via exporting).\nModules allow you to create top-level definitions without worrying about name conflicts\nwhen your code is used together with somebody else’s.\nSee the [manual section about modules](@ref modules) for more details.\n\n# Examples\n```julia\nmodule Foo\nimport Base.show\nexport MyType, foo\n\nstruct MyType\n x\nend\n\nbar(x) = 2x\nfoo(a::MyType) = bar(a.x) + 1\nshow(io::IO, a::MyType) = print(io, \"MyType \$(a.x)\")\nend\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
75
:path
"docs/basedocs.jl"
Symbol("()")
svec(" ()\n\nParentheses are used to group expressions, call functions, and construct [tuples](@ref Tuple) and [named tuples](@ref NamedTuple).\n")
nothing
:module
Base.BaseDocs
:linenumber
503
:path
"docs/basedocs.jl"
:abstract
svec(" abstract type\n\n`abstract type` declares a type that cannot be instantiated, and serves only as a node in the\ntype graph, thereby describing sets of related concrete types: those concrete types\nwhich are their descendants. Abstract types form the conceptual hierarchy which makes\nJulia’s type system more than just a collection of object implementations. For example:\n\n```julia\nabstract type Number end\nabstract type Real <: Number end\n```\n[`Number`](@ref) has no supertype, whereas [`Real`](@ref) is an abstract subtype of `Number`.\n")
nothing
:module
Base.BaseDocs
:linenumber
59
:path
"docs/basedocs.jl"
:.
svec(" .\n\nThe dot operator is used to access fields or properties of objects and access\nvariables defined inside modules.\n\nIn general, `a.b` calls `getproperty(a, :b)` (see [`getproperty`](@ref Base.getproperty)).\n\n# Examples\n```jldoctest\njulia> z = 1 + 2im; z.im\n2\n\njulia> Iterators.product\nproduct (generic function with 1 method)\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
408
:path
"docs/basedocs.jl"
:import
svec(" import\n\n`import Foo` will load the module or package `Foo`.\nNames from the imported `Foo` module can be accessed with dot syntax\n(e.g. `Foo.foo` to access the name `foo`).\nSee the [manual section about modules](@ref modules) for details.\n")
nothing
:module
Base.BaseDocs
:linenumber
39
:path
"docs/basedocs.jl"
:export
svec(" export\n\n`export` is used within modules to tell Julia which functions should be\nmade available to the user. For example: `export foo` makes the name\n`foo` available when [`using`](@ref) the module.\nSee the [manual section about modules](@ref modules) for details.\n")
nothing
:module
Base.BaseDocs
:linenumber
49
:path
"docs/basedocs.jl"
:?
svec(" a ? b : c\n\nShort form for conditionals; read \"if `a`, evaluate `b` otherwise evaluate `c`\".\nAlso known as the [ternary operator](https://en.wikipedia.org/wiki/%3F:).\n\nThis syntax is equivalent to `if a; b else c end`, but is often used to\nemphasize the value `b`-or-`c` which is being used as part of a larger\nexpression, rather than the side effects that evaluating `b` or `c` may have.\n\nSee the manual section on [control flow](@ref man-conditional-evaluation) for more details.\n\n# Examples\n```\njulia> x = 1; y = 2;\n\njulia> x > y ? println(\"x is larger\") : println(\"y is larger\")\ny is larger\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
730
:path
"docs/basedocs.jl"
Symbol(")")
svec(" ()\n\nParentheses are used to group expressions, call functions, and construct [tuples](@ref Tuple) and [named tuples](@ref NamedTuple).\n")
nothing
:module
Base.BaseDocs
:linenumber
503
:path
"docs/basedocs.jl"
Symbol("@var_str")
svec(" var\n\nThe syntax `var\"#example#\"` refers to a variable named `Symbol(\"#example#\")`,\neven though `#example#` is not a valid Julia identifier name.\n\nThis can be useful for interoperability with programming languages which have\ndifferent rules for the construction of valid identifiers. For example, to\nrefer to the `R` variable `draw.segments`, you can use `var\"draw.segments\"` in\nyour Julia code.\n\nIt is also used to `show` julia source code which has gone through macro\nhygiene or otherwise contains variable names which can't be parsed normally.\n\nNote that this syntax requires parser support so it is expanded directly by the\nparser rather than being implemented as a normal string macro `@var_str`.\n\n!!! compat \"Julia 1.3\"\n This syntax requires at least Julia 1.3.\n\n")
nothing
:module
Base.BaseDocs
:linenumber
1210
:path
"docs/basedocs.jl"
:elseif
svec(" if/elseif/else\n\n`if`/`elseif`/`else` performs conditional evaluation, which allows portions of code to\nbe evaluated or not evaluated depending on the value of a boolean expression. Here is\nthe anatomy of the `if`/`elseif`/`else` conditional syntax:\n\n```julia\nif x < y\n println(\"x is less than y\")\nelseif x > y\n println(\"x is greater than y\")\nelse\n println(\"x is equal to y\")\nend\n```\nIf the condition expression `x < y` is true, then the corresponding block is evaluated;\notherwise the condition expression `x > y` is evaluated, and if it is true, the\ncorresponding block is evaluated; if neither expression is true, the `else` block is\nevaluated. The `elseif` and `else` blocks are optional, and as many `elseif` blocks as\ndesired can be used.\n\nIn contrast to some other languages conditions must be of type `Bool`. It does not\nsuffice for conditions to be convertible to `Bool`.\n```jldoctest\njulia> if 1 end\nERROR: TypeError: non-boolean (Int64) used in boolean context\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
699
:path
"docs/basedocs.jl"
:using
svec(" using\n\n`using Foo` will load the module or package `Foo` and make its [`export`](@ref)ed names\navailable for direct use. Names can also be used via dot syntax (e.g. `Foo.foo` to access\nthe name `foo`), whether they are `export`ed or not.\nSee the [manual section about modules](@ref modules) for details.\n")
nothing
:module
Base.BaseDocs
:linenumber
29
:path
"docs/basedocs.jl"
:local
svec(" local\n\n`local` introduces a new local variable.\nSee the [manual section on variable scoping](@ref scope-of-variables) for more information.\n\n# Examples\n```jldoctest\njulia> function foo(n)\n x = 0\n for i = 1:n\n local x # introduce a loop-local x\n x = i\n end\n x\n end\nfoo (generic function with 1 method)\n\njulia> foo(10)\n0\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
229
:path
"docs/basedocs.jl"
:begin
svec(" begin\n\n`begin...end` denotes a block of code.\n\n```julia\nbegin\n println(\"Hello, \")\n println(\"World!\")\nend\n```\n\nUsually `begin` will not be necessary, since keywords such as [`function`](@ref) and [`let`](@ref)\nimplicitly begin blocks of code. See also [`;`](@ref).\n\n`begin` may also be used when indexing to represent the first index of a\ncollection or the first index of a dimension of an array.\n\n# Examples\n```jldoctest\njulia> A = [1 2; 3 4]\n2×2 Array{Int64,2}:\n 1 2\n 3 4\n\njulia> A[begin, :]\n2-element Array{Int64,1}:\n 1\n 2\n```\n")
nothing
:module
Base.BaseDocs
:linenumber
1082
:path
"docs/basedocs.jl"
Symbol("\"")
svec(" \"\n`\"` Is used to delimit string literals.\n\n# Examples\n\n```jldoctest\njulia> \"Hello World!\"\n\"Hello World!\"\n\njulia> \"Hello World!\\n\"\n\"Hello World!\\n\"\n```\n\nSee also [`\"\"\"`](@ref \"\"\").\n")
nothing
:module
Base.BaseDocs
:linenumber
2808
:path
"docs/basedocs.jl"
:help
svec("**Welcome to Julia ", "1.7.3", ".** The full manual is available at\n\n https://docs.julialang.org\n\nas well as many great tutorials and learning resources:\n\n https://julialang.org/learning/\n\nFor help on a specific function or macro, type `?` followed\nby its name, e.g. `?cos`, or `?@time`, and press enter.\nType `;` to enter shell mode, `]` to enter package mode.\n")
nothing
:module
Base.BaseDocs
:linenumber
14
:path
"docs/basedocs.jl"
Symbol("{")
svec(" {}\n\nCurly braces are used to specify [type parameters](@ref man-parametric-types).\n\nType parameters allow a single type declaration to introduce a whole family of\nnew types — one for each possible combination of parameter values. For example,\nthe [`Set`](@ref) type describes many possible types of sets; it uses one type\nparameter to describe the type of the elements it contains. The specific _parameterized_\ntypes `Set{Float64}` and `Set{Int64}` describe two _concrete_ types: both are\nsubtypes ([`<:`](@ref)) of `Set`, but the former has `Float64` elements and the latter\nhas `Int64` elements.\n")
nothing
:module
Base.BaseDocs
:linenumber
480
:path
"docs/basedocs.jl"
:__module__
svec(" __module__\n\nThe argument `__module__` is only visible inside the macro, and it provides information\n(in the form of a `Module` object) about the expansion context of the macro invocation.\nSee the manual section on [Macro invocation](@ref) for more information.\n")
nothing
:module
Base.BaseDocs
:linenumber
211
:path
"docs/basedocs.jl"
Symbol("@")
svec(" @\n\nThe at sign followed by a macro name marks a macro call. Macros provide the\nability to include generated code in the final body of a program. A macro maps\na tuple of arguments, expressed as space-separated expressions or a\nfunction-call-like argument list, to a returned *expression*. The resulting\nexpression is compiled directly into the surrounding code. See\n[Metaprogramming](@ref man-macros) for more details and examples.\n")
nothing
:module
Base.BaseDocs
:linenumber
468
:path
"docs/basedocs.jl"
:try
svec(" try/catch\n\nA `try`/`catch` statement allows intercepting errors (exceptions) thrown\nby [`throw`](@ref) so that program execution can continue.\nFor example, the following code attempts to write a file, but warns the user\nand proceeds instead of terminating execution if the file cannot be written:\n\n```julia\ntry\n open(\"/danger\", \"w\") do f\n println(f, \"Hello\")\n end\ncatch\n @warn \"Could not write file.\"\nend\n```\n\nor, when the file cannot be read into a variable:\n\n```julia\nlines = try\n open(\"/danger\", \"r\") do f\n readlines(f)\n end\ncatch\n @warn \"File not found.\"\nend\n```\n\nThe syntax `catch e` (where `e` is any variable) assigns the thrown\nexception object to the given variable within the `catch` block.\n\nThe power of the `try`/`catch` construct lies in the ability to unwind a deeply\nnested computation immediately to a much higher level in the stack of calling functions.\n")
nothing
:module
Base.BaseDocs
:linenumber
819
:path
"docs/basedocs.jl"
Docs.keywords
👀 Reading hidden code
asdf
md"# asdf"
👀 Reading hidden code
html"""<script>
d3 = import "d3"
return d3
</script>"""
👀 Reading hidden code
grabframe (generic function with 1 method)
function grabframe(relativeframepos)
t = relativeframepos * 2 * π
ω = 2π
c = 4.
frame = [sin(ω*t - √(x^2 + y^2)/300*c) for y in -200:399, x in -300:499]
return Gray.(frame .^ 2)
end
👀 Reading hidden code
grabframe(x)
👀 Reading hidden code
"a/b"
begin
m=MIME("a/b")
string(m)
end
👀 Reading hidden code
@bind x Slider(0:0.01:1)
👀 Reading hidden code