Skip to content

Instantly share code, notes, and snippets.

@j-fu
Last active September 10, 2020 16:16
Show Gist options
  • Save j-fu/5afae23d4c9676b20b4f0551a97dccd1 to your computer and use it in GitHub Desktop.
Save j-fu/5afae23d4c9676b20b4f0551a97dccd1 to your computer and use it in GitHub Desktop.
update for 05b919d
### A Pluto.jl notebook ###
# v0.11.14
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : missing
el
end
end
# ╔═╡ 8d418e20-f2c3-11ea-2914-b16be7cf6b24
using PlutoUI,Markdown
# ╔═╡ 89f53302-f357-11ea-1567-c5bab8ba61c3
begin
global prettyprintln(output)=show(stdout,MIME("text/plain"),output)
global hrule()=html"<hr height=5,color=#888>";
end;
# ╔═╡ 8accf282-f358-11ea-062e-7ba68b10d8e8
hrule()
# ╔═╡ fbd16f82-f2f2-11ea-17c2-c3635e53f7c9
md"##### My Test $(@bind mytest CheckBox())"
# ╔═╡ ac6a6eb8-f26f-11ea-3903-a7fea6a447ec
md"x=$(@bind x Slider(0.00 : 0.01 : 0.30))"
# ╔═╡ 84944fce-f27b-11ea-36ab-47cfbe6f2cdb
md"y=$(@bind y Slider(0.00 : 0.01 : 0.30))"
# ╔═╡ ae37a0e0-f232-11ea-04a6-794f9e48f412
if mytest @with_output println("x=$(x), y=$(y)") end
# ╔═╡ 6833a2de-f2cc-11ea-182b-c5ce7d3b39e4
if mytest y+1 end
# ╔═╡ 3e04a342-f221-11ea-133a-8bd98e77f235
if mytest @with_output begin
println("xxx")
println("yyy")
prettyprintln(rand(5,5).*x)
end end
# ╔═╡ 81bd3974-f342-11ea-1107-f98073e63e73
@cond mytest @with_output begin
println("xxx")
println("yyy")
@warn "oh no"
println(rand(40).*x)
end
# ╔═╡ Cell order:
# ╠═8d418e20-f2c3-11ea-2914-b16be7cf6b24
# ╠═89f53302-f357-11ea-1567-c5bab8ba61c3
# ╟─8accf282-f358-11ea-062e-7ba68b10d8e8
# ╟─fbd16f82-f2f2-11ea-17c2-c3635e53f7c9
# ╟─ac6a6eb8-f26f-11ea-3903-a7fea6a447ec
# ╟─84944fce-f27b-11ea-36ab-47cfbe6f2cdb
# ╠═ae37a0e0-f232-11ea-04a6-794f9e48f412
# ╠═6833a2de-f2cc-11ea-182b-c5ce7d3b39e4
# ╠═3e04a342-f221-11ea-133a-8bd98e77f235
# ╠═81bd3974-f342-11ea-1107-f98073e63e73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment