forked from Bridgewater/scala-notebook
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWelcome.snb
73 lines (73 loc) · 2.36 KB
/
Welcome.snb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
"metadata":{
"name":"Welcome",
"user_save_timestamp":"2013-03-13T21:55:13.342Z",
"auto_save_timestamp":"2013-03-13T21:54:57.794Z"
},
"worksheets":[{
"cells":[{
"cell_type":"markdown",
"source":"## Welcome to Scala Notebook\n\nScala notebook is an interactive REPL. You type scala expressions in the browser, and they are evaluated in a Kernel behind the scenes. Cells can contain formatting or code."
},{
"cell_type":"markdown",
"source":"To edit a markdown cell, double-click in the text. "
},{
"cell_type":"code",
"input":"// Simple expressions\nList(1,2,3).reverse\n ",
"language":"scala",
"collapsed":false,
"prompt_number":2,
"outputs":[]
},{
"cell_type":"code",
"input":"// Functions\ndef fact(n: Int):Int = if (n == 0) 1 else n*fact(n-1)",
"language":"scala",
"collapsed":false,
"prompt_number":5,
"outputs":[]
},{
"cell_type":"code",
"input":"// Functions are callable after they are defined. By convention, notebooks evaluate from top to bottom\n// but you must evaluate a cell before it is used\nfact(10)",
"language":"scala",
"collapsed":false,
"prompt_number":6,
"outputs":[]
},{
"cell_type":"code",
"input":"// HTML return types are also suppored\n<table>{ for (row <- 1 to 5) yield \n <tr>{ for (col <- 1 to 4) yield <td>{row*col}</td> }</tr>\n} </table>",
"language":"scala",
"collapsed":false,
"prompt_number":11,
"outputs":[]
},{
"cell_type":"code",
"input":"// Reactive components allow dynamic communication to Scala and Javascript\nval ib = new InputBox(\"\")",
"language":"scala",
"collapsed":false,
"prompt_number":1,
"outputs":[]
},{
"cell_type":"code",
"input":"val ib2 = new InputBox(\"\")",
"language":"scala",
"collapsed":false,
"prompt_number":2,
"outputs":[]
},{
"cell_type":"code",
"input":"// After running this, type text in the second box and it appears in the first\nib.currentValue <-- ib2.currentValue",
"language":"scala",
"collapsed":false,
"prompt_number":5,
"outputs":[]
},{
"cell_type":"code",
"input":"",
"language":"scala",
"collapsed":true,
"outputs":[]
}]
}],
"autosaved":[],
"nbformat":3
}