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
| "traverse left with Stream and IO" >> { | |
| implicit def traverseImplicit = StreamLeftTraverse | |
| var result: Seq[Int] = Seq() | |
| val f = (i: Int) => (result = result :+ i).pure[IO] | |
| (1 to 3).toStream.map(f).sequence.unsafePerformIO | |
| result must_== Seq(3, 2, 1) | |
| } | |
| "traverse right with Stream and IO" >> { |
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 ActorSpecification extends BaseSpecification | |
| with ArgumentsArgs | |
| with ArgumentsShortcuts | |
| with MustThrownMatchers | |
| with ShouldThrownMatchers | |
| with FormattingFragments | |
| with StandardResults | |
| with StandardMatchResults | |
| with PendingUntilFixed | |
| with TimeHelpers |
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
| libraryDependencies += Seq( | |
| "net.databinder" %% "unfiltered-filter" % "0.5.1", | |
| "net.databinder" %% "unfiltered-jetty" % "0.5.1", | |
| ) |
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
| package scalaz.example | |
| object Reader extends App { | |
| /** | |
| * Manual propagation of the environment (in the example, `contextRoot`.) | |
| */ | |
| object Config0 { | |
| def fragment1(contextRoot: String) = <a href={contextRoot + "/foo"}>foo</a> |
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
| package my.collections | |
| class CirculrBufferIterator[T](buffer:Array[T], start:Int) extends Iterator[T]{ | |
| var idx=0 | |
| override def hasNext = idx<buffer.size | |
| override def next()={ | |
| val i=idx | |
| idx=idx+1 | |
| buffer(i) | |
| } |
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
| >show update | |
| [info] commons-io:commons-io:1.2: | |
| [info] (Artifact(commons-io,jar,jar,None,ArraySeq(),None,Map()),project/.ivy/cache/commons-io/commons-io/jars/commons-io-1.2.jar) | |
| [info] (Artifact(commons-io,src,jar,Some(sources),ArraySeq(),None,Map()),project/.ivy/cache/commons-io/commons-io/srcs/commons-io-1.2-sources.jar) | |
| [info] (Artifact(commons-io,doc,jar,Some(javadoc),ArraySeq(),None,Map()),project/.ivy/cache/commons-io/commons-io/docs/commons-io-1.2-javadoc.jar) | |
| > show update-sbt-classifiers | |
| ... | |
| [info] commons-collections:commons-collections:3.2.1: | |
| [info] (Artifact(commons-collections,src,jar,Some(sources),ArraySeq(),None,Map()),project/.ivy/cache/commons-collections/commons-collections/srcs/commons-collections-3.2.1-sources.jar) |
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
| import java.lang.Thread | |
| import scala.collection.mutable.Queue | |
| import akka.actor.Uuid | |
| import akka.actor.scala2ActorRef | |
| import akka.actor.Actor | |
| import akka.event.EventHandler | |
| /* | |
| * Sleeping Barber Code Club Problem | |
| * See (http://en.wikipedia.org/wiki/Sleeping_barber_problem) |
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
| public class StringTokenizer { | |
| private static ThreadLocal<String[]> tempArray = new ThreadLocal<String[]>(); | |
| public static String[] tokenize(String string, char delimiter) | |
| { | |
| String[] temp = tempArray.get(); | |
| int tempLength = (string.length() / 2) + 2; | |
| if (temp == null || temp.length < tempLength) | |
| { |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <scheme name="OxbowSolarizedDark" version="1" parent_scheme="Default"> | |
| <option name="LINE_SPACING" value="1.2" /> | |
| <option name="EDITOR_FONT_SIZE" value="13" /> | |
| <option name="EDITOR_FONT_NAME" value="Consolas" /> | |
| <colors> | |
| <option name="ADDED_LINES_COLOR" value="" /> | |
| <option name="ANNOTATIONS_COLOR" value="2b36" /> | |
| <option name="ANNOTATIONS_MERGED_COLOR" value="" /> | |
| <option name="CARET_COLOR" value="dc322f" /> |
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
| import java.util.Arrays | |
| abstract class Sorter { | |
| def sorted(a: Array[Int]): Array[Int] | |
| } | |
| object SimpleSorter extends Sorter { | |
| def sorted(a: Array[Int]) = { | |
| Arrays.sort(a) | |
| a |