This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[8:41:1]% WALLET_PASSPHRASE=test gdb --args ./bitcoind -nolisten -noirc -addnode= | |
GNU gdb (GDB) 7.0.1-debian | |
Copyright (C) 2009 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. Type "show copying" | |
and "show warranty" for details. | |
This GDB was configured as "x86_64-linux-gnu". | |
For bug reporting instructions, please see: | |
<http://www.gnu.org/software/gdb/bugs/>... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@domU-12-31-39-0F-76-61:/home/ubuntu# cat /etc/cassandra/cassandra.yaml | |
# Cassandra storage config YAML | |
# NOTE: | |
# See http://wiki.apache.org/cassandra/StorageConfiguration for | |
# full explanations of configuration directives | |
# /NOTE | |
# The name of the cluster. This is mainly used to prevent machines in | |
# one logical cluster from joining another. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def suffixes[A](xs: List[A]): List[List[A]] = xs match { | |
case Nil => Nil::Nil | |
case x::xs => (x::xs)::suffixes(xs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def catenate[A](xs: List[A], ys: List[A]) : List[A] = xs match { | |
case Nil => ys | |
case x::xs => x :: (catenate(xs, ys)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update[A](xs: List[A], i: Int, y: A) : List[A] = (xs, i) match { | |
case (Nil, _) => throw new AssertionError("Invalid subscript") | |
case (x::xs, 0) => y::xs | |
case (x::xs, i) => x::update(xs, i - 1, y) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Stack[+T] { | |
def isEmpty : Boolean | |
def cons[U >: T](x: U) : Stack[U] | |
def head : T | |
def tail : Stack[T] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ListStack { | |
def apply[T] : ListStack[T] = new ListStack[T](List()) | |
} | |
class ListStack[T] private (val l: List[T]) extends Stack[T] { | |
def isEmpty = l.isEmpty | |
def cons[U >: T](x: U) = new ListStack(x::l) | |
def head = l.head | |
def tail = new ListStack(l.tail) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed abstract class LIST[+T] | |
case object NIL extends LIST[Nothing] | |
final case class CONS[T](head: T, tail: LIST[T]) extends LIST[T] | |
object CustomListStack { | |
def apply[T] = new CustomListStack[T](NIL) | |
} | |
class CustomListStack[T] private (private val l: LIST[T]) extends Stack[T] { | |
def isEmpty = l match { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed abstract class CustomStack[+T] extends Stack[T] | |
case object EmptyCustomStack extends CustomStack[Nothing] { | |
def isEmpty = true | |
def cons[T](x: T) = new NonEmptyCustomStack[T](x, EmptyCustomStack) | |
def head = throw new IllegalArgumentException("Can't take head of an empty list") | |
def tail = throw new IllegalArgumentException("Can't take tail of an empty list") | |
} | |
final case class NonEmptyCustomStack[+T](head: T, tail: CustomStack[T]) extends CustomStack[T] { | |
def isEmpty = false | |
def cons[U >: T](x: U) = new NonEmptyCustomStack[U](x, this) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Set[T] { | |
def insert(x: T): Set[T] | |
def member(x: T): Boolean | |
} |