Skip to content

Commit

Permalink
Restore test1.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Feb 27, 2021
1 parent 3bc9055 commit bdeaec4
Showing 1 changed file with 113 additions and 113 deletions.
226 changes: 113 additions & 113 deletions sample/test1.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.14.0
# v0.11.3

using Markdown
using InteractiveUtils
Expand All @@ -13,9 +13,6 @@ macro bind(def, element)
end
end

# ╔═║ 878a4750-b15e-11ea-2584-8feba490699f
using Test

# ╔═║ fd0763a0-b163-11ea-23b4-a7bae7052e19
md"# File picker"

Expand All @@ -25,15 +22,6 @@ md"# Notebook interaction"
# ╔═║ 6dde0352-b15e-11ea-2fa8-7327cc366c1a
md"## Running multiple cells"

# ╔═║ 7370dcc0-b15e-11ea-234b-23584c864b61
ma = 1

# ╔═║ 75b21a30-b15e-11ea-3046-2170ec097e63
mb = 2

# ╔═║ 7b74dd40-b15e-11ea-291a-d7e10a185718
@test ma + mb == 3

# ╔═║ f0b821b0-b15f-11ea-1f64-dd33aa85b54e
md"## Moving cells"

Expand Down Expand Up @@ -74,26 +62,6 @@ md"## Stack traces"
# ╔═║ 84888e20-b160-11ea-1d61-c5934251d6dd
html"<div style='height: 100vh'></div>"

# ╔═║ 9dc4a0a0-b15f-11ea-361c-87742cf3f2a2
function ef(x)


sqrt(-x)
end

# ╔═║ aab109c0-b15f-11ea-275d-31e21fcda8c4
ef(1)

# ╔═║ 976bc2a0-b160-11ea-3e7a-9f033b0f2daf
function eg(x)


sqrt(-x)
end

# ╔═║ 9c74f9b2-b160-11ea-35fb-917cb1120f5b
eg(1)

# ╔═║ ea3f77f0-b166-11ea-046e-ef39bfc57d0f
md"## Bad errors"

Expand All @@ -106,21 +74,6 @@ md"# Bonds"
# ╔═║ 3a14b3f0-b165-11ea-153d-796416ee5ccc
md"## Lossy"

# ╔═║ 41a75500-b165-11ea-2519-bbd0feaef6cf
@bind bl1 html"<input type='range' max='100000'>"

# ╔═║ 4ccbf670-b165-11ea-1951-c17ffb8a58cf
sleep(.5); bl1

# ╔═║ 8bb26902-b165-11ea-048c-d7f7a72006ee
@assert bl1 isa Int64

# ╔═║ e559eaf0-b165-11ea-0d81-ffc480afe8f3
@bind bl2 html"<input type='range' max='100000'>"

# ╔═║ e63be680-b165-11ea-0fd3-bd4e0bf92eb8
bl2

# ╔═║ 59966a90-b163-11ea-1786-e56e45f06dd0
md"## Recursive"

Expand All @@ -130,73 +83,20 @@ md"## Scrolling"
# ╔═║ 431d17c0-cfff-11ea-39b5-394b34438544
md"### `text/html`"

# ╔═║ f2c0bb90-b162-11ea-24a1-3f864a09e5ee
@bind bw1 html"<input type='range' value='0'>"

# ╔═║ a4d4ac28-cfff-11ea-3f14-15d2928d2c88
zeros((bw1, bw1))

# ╔═║ 56e6f440-b15e-11ea-1327-09932af5b5bd
HTML("<div style='height: $(bw1)vh'></div>")

# ╔═║ 2296ac80-b163-11ea-3d00-ed366fa9ce3e
@bind bw2 html"<input type='range' value='0'>"

# ╔═║ 20d72230-b163-11ea-39c2-69bf2c422d50
HTML("<div style='height: $(bw2)vh'></div>")

# ╔═║ 55d116d6-cfff-11ea-25fc-056ce62c8bcd
zeros((bw2, bw2))

# ╔═║ 76c98394-cfff-11ea-0b6c-25260a8a3bb9
zeros((10,10));

# ╔═║ 32b5edc0-b15d-11ea-09d6-3b889f6d397a
md"# Rich display
## `image/svg+xml` and `image/jpeg`"

# ╔═║ 52cb1264-d824-11ea-332a-55964f3d8b90
begin
struct A end
struct B end

function Base.show(io::IO, ::MIME"image/svg+xml", x::A)
write(io, read(download("https://raw.githubusercontent.com/fonsp/Pluto.jl/master/frontend/img/logo.svg")))
end
function Base.show(io::IO, ::MIME"image/jpg", x::B)
write(io, read(download("https://fonsp.com/img/doggoSmall.jpg?raw=true")))
end
nothing
end

# ╔═║ 5d59acfe-d824-11ea-1d7b-07551a2b11d4
A()

# ╔═║ 64d929aa-d824-11ea-2cc1-835fbe38be11
B()

# ╔═║ 661c112e-d824-11ea-3612-4104449c409e
[A(), B()]

# ╔═║ 3be84600-b166-11ea-1d24-59212363543f
md"## `text/plain`"

# ╔═║ 42f0a872-b166-11ea-0c71-355d62f67fca
ra = 1:100

# ╔═║ 794bc212-b166-11ea-0840-fddb29190841
1:13

# ╔═║ 95898660-b166-11ea-1db1-df7f3c4f1353
"<b>I am not bold</b>"

# ╔═║ 2859a890-b161-11ea-14e9-b7ddaf08195a
md"## Tree view"

# ╔═║ 23f41dd2-b15c-11ea-17d2-45b3e83093ba
Ref(Dict(:a => [1,md"![](https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/PDS_70.jpg/567px-PDS_70.jpg)", md"# Hello"], [3,4] => :b))

# ╔═║ 88bd7aae-b15f-11ea-270e-ab00e6a01203
["asdf", "<b>I am not bold</b>"]

Expand Down Expand Up @@ -378,18 +278,6 @@ asdfdasd
# ╔═║ 46fc284a-d682-11ea-34b6-69874efcaf65
md"### Text wrapping"

# ╔═║ 4d452956-d682-11ea-3aeb-cd7d1b2f67dc
s="12345678012345678012345678012345678012345678012345678012345678012345678012345678012345678012345678012345678056780123456780123456780123456780123456780123456780123456780123456780123456780120123456780\n\n\"\"\n\n5678012345678012
7801234567801234567801234567 7801234567801234567801234567 7801234567801234567801234567 7801234567801234567801234567 7801234567801234567801234567
πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§β€β€β€βœ”
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."

# ╔═║ 4e320206-d682-11ea-3dfe-b77f6e96f33a
Text(s)

# ╔═║ 1bb05fc0-b15d-11ea-3dae-7734f66a0c56
md"# Testing machinery"

Expand Down Expand Up @@ -426,6 +314,118 @@ html"""
"""

# ╔═║ 878a4750-b15e-11ea-2584-8feba490699f
using Test

# ╔═║ 7370dcc0-b15e-11ea-234b-23584c864b61
ma = 1

# ╔═║ 75b21a30-b15e-11ea-3046-2170ec097e63
mb = 2

# ╔═║ 7b74dd40-b15e-11ea-291a-d7e10a185718
@test ma + mb == 3

# ╔═║ 9dc4a0a0-b15f-11ea-361c-87742cf3f2a2
function ef(x)


sqrt(-x)
end

# ╔═║ aab109c0-b15f-11ea-275d-31e21fcda8c4
ef(1)

# ╔═║ 976bc2a0-b160-11ea-3e7a-9f033b0f2daf
function eg(x)


sqrt(-x)
end

# ╔═║ 9c74f9b2-b160-11ea-35fb-917cb1120f5b
eg(1)

# ╔═║ 41a75500-b165-11ea-2519-bbd0feaef6cf
@bind bl1 html"<input type='range' max='100000'>"

# ╔═║ 4ccbf670-b165-11ea-1951-c17ffb8a58cf
sleep(.5); bl1

# ╔═║ 8bb26902-b165-11ea-048c-d7f7a72006ee
@assert bl1 isa Int64

# ╔═║ e559eaf0-b165-11ea-0d81-ffc480afe8f3
@bind bl2 html"<input type='range' max='100000'>"

# ╔═║ e63be680-b165-11ea-0fd3-bd4e0bf92eb8
bl2

# ╔═║ f2c0bb90-b162-11ea-24a1-3f864a09e5ee
@bind bw1 html"<input type='range' value='0'>"

# ╔═║ a4d4ac28-cfff-11ea-3f14-15d2928d2c88
zeros((bw1, bw1))

# ╔═║ 56e6f440-b15e-11ea-1327-09932af5b5bd
HTML("<div style='height: $(bw1)vh'></div>")

# ╔═║ 2296ac80-b163-11ea-3d00-ed366fa9ce3e
@bind bw2 html"<input type='range' value='0'>"

# ╔═║ 20d72230-b163-11ea-39c2-69bf2c422d50
HTML("<div style='height: $(bw2)vh'></div>")

# ╔═║ 55d116d6-cfff-11ea-25fc-056ce62c8bcd
zeros((bw2, bw2))

# ╔═║ 76c98394-cfff-11ea-0b6c-25260a8a3bb9
zeros((10,10));

# ╔═║ 52cb1264-d824-11ea-332a-55964f3d8b90
begin
struct A end
struct B end

function Base.show(io::IO, ::MIME"image/svg+xml", x::A)
write(io, read(download("https://raw.githubusercontent.com/fonsp/Pluto.jl/master/frontend/img/logo.svg")))
end
function Base.show(io::IO, ::MIME"image/jpg", x::B)
write(io, read(download("https://fonsp.com/img/doggoSmall.jpg?raw=true")))
end
nothing
end

# ╔═║ 5d59acfe-d824-11ea-1d7b-07551a2b11d4
A()

# ╔═║ 64d929aa-d824-11ea-2cc1-835fbe38be11
B()

# ╔═║ 661c112e-d824-11ea-3612-4104449c409e
[A(), B()]

# ╔═║ 42f0a872-b166-11ea-0c71-355d62f67fca
ra = 1:100

# ╔═║ 794bc212-b166-11ea-0840-fddb29190841
1:13

# ╔═║ 23f41dd2-b15c-11ea-17d2-45b3e83093ba
Ref(Dict(:a => [1,md"![](https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/PDS_70.jpg/567px-PDS_70.jpg)", md"# Hello"], [3,4] => :b))

# ╔═║ 4d452956-d682-11ea-3aeb-cd7d1b2f67dc
s="12345678012345678012345678012345678012345678012345678012345678012345678012345678012345678012345678012345678056780123456780123456780123456780123456780123456780123456780123456780123456780120123456780\n\n\"\"\n\n5678012345678012
7801234567801234567801234567 7801234567801234567801234567 7801234567801234567801234567 7801234567801234567801234567 7801234567801234567801234567
πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§πŸ‘©β€πŸ‘©β€πŸ‘§β€β€β€βœ”
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."

# ╔═║ 4e320206-d682-11ea-3dfe-b77f6e96f33a
Text(s)

# ╔═║ 7e2cc6c0-b15d-11ea-32b0-15394cdebd35
function ask(kind, str::Markdown.MD)
HTML("<div class='test $(kind)'>" * sprint(show, MIME"text/html"(), str) * "</div>")
Expand Down

0 comments on commit bdeaec4

Please sign in to comment.