forked from n8han/scala-notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWelcome.snb
136 lines (136 loc) · 4.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{
"metadata":{
"name":"Welcome",
"user_save_timestamp":"2013-03-13T21:55:13.342Z",
"auto_save_timestamp":"2013-05-10T13:38:02.603Z"
},
"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":[{
"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":1,
"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":4,
"outputs":[]
},{
"cell_type":"code",
"input":"fact(10)",
"language":"scala",
"collapsed":false,
"prompt_number":7,
"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":8,
"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":[]
}]
}],
"nbformat":3
}