This file contains 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
import org.scalacheck.Gen | |
import org.scalacheck.Arbitrary | |
import org.scalacheck.Prop | |
import org.scalacheck.Prop.AnyOperators | |
import org.scalacheck.Properties | |
class ListSizeSpec extends Properties("ListSize") { | |
property("sublists") = { | |
val gen: Gen[(List[Int], List[Int])] = { |
This file contains 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 Tree { | |
def v: Int | |
} | |
case class Leaf(v: Int) extends Tree | |
case class Node(left: Tree, right: Tree, v: Int) extends Tree | |
val genLeaf = for { | |
v <- Arbitrary.arbitrary[Int] | |
} yield { | |
Leaf(v) |
This file contains 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
version: 2.1 | |
executors: | |
scala_jdk_executor: | |
docker: | |
- image: circleci/openjdk:8-jdk | |
commands: | |
sbt_cmd: | |
description: "Build with sbt" |
This file contains 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
class s_xml_UtilityTest extends O { | |
def isNameStart__V() { | |
mod:Lorg_junit_Assert$.assertTrue__Z__V(mod:s_xml_Utility$.isNameStart__C__Z(98)); | |
mod:Lorg_junit_Assert$.assertTrue__Z__V(mod:s_xml_Utility$.isNameStart__C__Z(58)) | |
} | |
def trim__V() { | |
val x: s_xml_Elem = new s_xml_Elem().init___T__T__s_xml_MetaData__s_xml_NamespaceBinding__Z__sc_Seq(null, "foo", mod:s_xml_Null$, mod:s_xml_TopScope$, false, { | |
val $$buf: s_xml_NodeBuffer = new s_xml_NodeBuffer().init___(); | |
$$buf.$$amp$plus__O__s_xml_NodeBuffer(new s_xml_Text().init___T("\n ")); | |
$$buf.$$amp$plus__O__s_xml_NodeBuffer(new s_xml_Elem().init___T__T__s_xml_MetaData__s_xml_NamespaceBinding__Z__sc_Seq(null, "toomuchws", mod:s_xml_Null$, mod:s_xml_TopScope$, true, new sjs_js_WrappedArray().init___sjs_js_Array([]))); |
This file contains 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
/** fizzbuzz.c */ | |
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <limits.h> | |
#include "fizzbuzz.h" | |
const char* fizzbuzz(signed long n) |
This file contains 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
;; Disable `M-p' and `M-n; in Ensime minor mode | |
(eval-after-load "ensime-mode" | |
'(progn | |
(define-key ensime-mode-map (kbd "M-n") nil) | |
(define-key ensime-mode-map (kbd "M-p") nil))) |
This file contains 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
/** | |
* Based on Java listings by Bruce Eckel | |
* Dining Philosophers in Java 8, Dec-29 2016 | |
* http://bruceeckel.github.io/2016/12/29/dining-philosophers-in-java-8/ | |
*/ | |
package concurrent | |
// concurrent/StickHolder.scala |
This file contains 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
// Based on the following Usenet posting | |
// as seen on "Scala: The First Ten Years", Scala Days Berlin, 2014 | |
// From: Miles Sabin | |
// Date: 2004-04-04 10:24:54 GMT | |
// Subject: Member types in Scala | |
// Newgroup: comp.lang.scala | |
package com.milessabin.example |
This file contains 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
package org.npr.weekendedition.sunday.puzzle.people.will.shortz | |
/** | |
* Find all the permutations of numbers and ops | |
* Build infix expresions | |
* Find all expressions that evaluate within interval (e.g. 1 to 40) | |
* | |
*/ | |
object Main extends App { |
This file contains 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
import java.lang._ | |
import scala._ | |
import scala.Predef._ | |
import scala.concurrent.Future | |
import scala.concurrent.Await | |
import scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object ComposeFutures extends App { |
NewerOlder