Skip to content

Instantly share code, notes, and snippets.

View jordanlewis's full-sized avatar
👀
large data banking

Jordan Lewis jordanlewis

👀
large data banking
View GitHub Profile
[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/>...
@jordanlewis
jordanlewis / gist:1650650
Created January 21, 2012 01:27 — forked from pcn/gist:1650568
java backtrace trying to get cassandra started with seeds
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.
@jordanlewis
jordanlewis / PFDS_exercise_2.1.scala
Created January 28, 2012 03:22
PFDS Exercise 2.1
def suffixes[A](xs: List[A]): List[List[A]] = xs match {
case Nil => Nil::Nil
case x::xs => (x::xs)::suffixes(xs)
@jordanlewis
jordanlewis / PDFS_catenate.scala
Created January 28, 2012 03:55
PFDS catenate
def catenate[A](xs: List[A], ys: List[A]) : List[A] = xs match {
case Nil => ys
case x::xs => x :: (catenate(xs, ys))
}
@jordanlewis
jordanlewis / PFDS_list_update.scala
Created January 28, 2012 04:07
PFDS list update
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)
}
@jordanlewis
jordanlewis / PFDS_stack_trait.scala
Created January 31, 2012 06:04
PFDS Stack Trait
trait Stack[+T] {
def isEmpty : Boolean
def cons[U >: T](x: U) : Stack[U]
def head : T
def tail : Stack[T]
}
@jordanlewis
jordanlewis / PFDS_list_stack.scala
Created January 31, 2012 06:44
PFDS ListStack
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)
@jordanlewis
jordanlewis / PFDS_custom_list_stack.scala
Created January 31, 2012 06:50
PFDS CustomListStack
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 {
@jordanlewis
jordanlewis / pfds_custom_stack.scala
Created January 31, 2012 07:02
PFDS CustomStack
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)
trait Set[T] {
def insert(x: T): Set[T]
def member(x: T): Boolean
}