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 scalaz.ValidationNel | |
import scalaz.syntax.traverse._ | |
import scalaz.syntax.validation._ | |
import scalaz.std.list._ | |
sealed trait GetOptError | |
case object UnknownArgument extends GetOptError | |
case object EmptyElement extends GetOptError | |
private def parseArguments(i: Int, element: String): List[ValidationNel[GetOptError, (Char, Option[String])]] = |
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
public java.lang.String foo(scala.Option<java.lang.String>); | |
Code: | |
0: aload_1 | |
1: astore_2 | |
2: aload_2 | |
3: instanceof #16 // class scala/Some | |
6: ifeq 34 | |
9: aload_2 | |
10: checkcast #16 // class scala/Some | |
13: astore_3 |
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 scalaz._ | |
import Scalaz._ | |
import scala.concurrent.{ExecutionContext, Future} | |
import scala.concurrent.Await | |
import scala.concurrent.duration._ | |
import ExecutionContext.Implicits.global | |
object FSE extends App { | |
// scalaz doesn't yet have a monad instance for future, here is one. |
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
#!/usr/bin/env bash | |
# | |
# A more capable sbt runner, coincidentally also called sbt. | |
# Author: Paul Phillips <[email protected]> | |
# todo - make this dynamic | |
declare -r sbt_release_version=0.12.3 | |
declare -r sbt_snapshot_version=0.13.0-SNAPSHOT | |
unset sbt_jar sbt_dir sbt_create sbt_snapshot sbt_launch_dir |
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
diff --git a/dist/lib/swagger.js b/dist/lib/swagger.js | |
index 0905b64..291215b 100644 | |
--- a/dist/lib/swagger.js | |
+++ b/dist/lib/swagger.js | |
@@ -56,16 +56,16 @@ | |
if (response.apiVersion != null) { | |
_this.apiVersion = response.apiVersion; | |
} | |
- if ((response.basePath != null) && jQuery.trim(response.basePath).length > 0) { | |
- _this.basePath = response.basePath; |
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
trait UnapplyMT[TC[_[_[_], _]], N[_], MTNA] { | |
/** the type constructor */ | |
type MT[_[_], _] | |
/** The type that MT is applied to */ | |
type A | |
/** The instance of the type class */ | |
def TC: TC[MT] |
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
(defun right-arrow () | |
(interactive) | |
(cond ((looking-back "=") | |
(backward-delete-char 1) (insert "⇒")) | |
((looking-back "-") | |
(backward-delete-char 1) (insert "→")) | |
(t (insert ">")))) | |
(defun left-arrow () | |
(interactive) |
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
scala> val f : Int => List[Int] = List(_) | |
f: Int => List[Int] = <function1> | |
scala> Stream(1,2,3) traverse f | |
res1: List[scala.collection.immutable.Stream[Int]] = List(Stream(1, ?)) |
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
; scala-mode2 found here: https://github.com/hvesalai/scala-mode2 is much better than the scala mode that comes with scalac | |
(add-to-list 'load-path "~/.emacs.d/scala-mode2/") | |
(require 'scala-mode) | |
; http://www.emacswiki.org/emacs/RainbowDelimiters | |
(add-hook 'scala-mode-hook 'rainbow-delimiters-mode) | |
; I get ensime from git: | |
; https://github.com/aemoncannon/ensime | |
; then run `sbt stage` inside the ensime source directory, |
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
[debug] Waiting for thread run-main to exit | |
[error] (run-main) java.lang.AbstractMethodError: spire.example.RandomForestExample$$anonfun$1.apply(Ljava/lang/Object;)Ljava/lang/Object; | |
java.lang.AbstractMethodError: spire.example.RandomForestExample$$anonfun$1.apply(Ljava/lang/Object;)Ljava/lang/Object; | |
at spire.example.CrossValidation$.loop$1(DataSets.scala:234) | |
at spire.example.CrossValidation$.crossValidate(DataSets.scala:242) | |
at spire.example.CrossValidation$.crossValidateClassification(DataSets.scala:259) | |
at spire.example.RandomForestExample$.testClassification(randomforest.scala:40) | |
at spire.example.RandomForestExample$delayedInit$body.apply(randomforest.scala:24) | |
at scala.Function0$class.apply$mcV$sp(Function0.scala:40) | |
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12) |