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
# Copyright (c) 2010 Curt Micol <[email protected]> | |
# Permission to use, copy, modify, and distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. | |
# THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
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 io.Source | |
import java.io.ByteArrayInputStream | |
import org.scalacheck.{Arbitrary, Gen, Prop} | |
import org.specs2.mutable.Specification | |
import org.specs2.ScalaCheck | |
class ParserSpec extends Specification with ScalaCheck { | |
val gameParameterGenerator = for { | |
loadTime <- Gen.oneOf(1 to 50000) | |
turnTime <- Gen.oneOf(1 to 50000) |
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
Show hidden characters
{ | |
"cmd": ["sbt-no-color compile"], | |
"file_regex": "^\\[error\\] ([.a-zA-Z0-9/-]+[.]scala):([0-9]+):", | |
"selector": "source.scala", | |
"working_dir": "${project_path:${folder}}", | |
"shell": "true" | |
} |
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.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 |
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
<?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 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 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 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 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 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> |
OlderNewer