-
Notifications
You must be signed in to change notification settings - Fork 0
/
random_shit
100 lines (64 loc) · 1.8 KB
/
random_shit
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
http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js
==============================================================
val begin = List(1.0, 2.0, 3.0)
val end = List("a", "b", "c")
begin ++ end
end ++ begin
begin.take(2).drop(1) ++ end.drop(1)
trait Tree[A]
case class Node[A](subTrees: List[Tree[A]]) extends Tree[A]
case class Leaf[A](content: A) extends Tree[A]
val first: Tree[Int] = Leaf(2)
val second = Leaf(4)
val top = Node(List(first, second))
val coll = Set(first, second, top)
coll take 1
(1 until 100).sum
def stub = true
if (stub) "Hello" else "ByeBye"
=================================================================
val begin = List(1.0, 2.0, 3.0)
val end = List("a", "b", "c")
begin ++ end
end ++ begin
begin.take(2).drop(1) ++ end.drop(1)
trait Tree[A] {
def head: A
def tail: Tree[A]
}
case class Node[A](subTrees: List[Tree[A]]) extends Tree[A] {
def head = ???
def tail = ???
}
case class Leaf[A](content: A) extends Tree[A] {
def head = ???
def tail = ???
}
val first: Tree[Int] = Leaf(2)
val second = Leaf(4)
val top = Node(List(first, second))
val coll = Set(first, second, top)
coll take 1
(1 until 100).sum
def stub = true
if (stub) "Hello" else "ByeBye"
=======================================================
val begin = List(1.0, 2.0, 3.0)
val end = List("a", "b", "c")
begin ++ end
end ++ begin
begin.take(2).drop(1) ++ end.drop(1)
trait Tree[A]
case class Node[A](subTrees: List[Tree[A]]) extends Tree[A]
case class Leaf[A](content: A) extends Tree[A]
val first: Tree[Int] = Leaf(2)
val second = Leaf(4)
val top = Node(List(first, second))
val coll = Set(first, second, top)
coll take 1
(1 until 100).sum
def stub = true
if (stub) "Hello" else "ByeBye"
lazy val bigList = (1 to 100).permutations
val aabb = Map("a" -> 1, "b" -> 2, "c" -> 3)
aabb("a")