I hereby claim:
- I am williamchan on github.
- I am wizzlechan (https://keybase.io/wizzlechan) on keybase.
- I have a public key whose fingerprint is F64A 16D1 7D30 80DF D0E4 1C5E F9B3 96E9 0ABF FB68
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/** This is so slick. | |
* When working with Streams, use val instead of def so that memoization is enabled by default. | |
* | |
* Also see See http://derekwyatt.org/2011/07/29/understanding-scala-streams-through-fibonacci/ | |
*/ | |
import scala.math.BigInt | |
lazy val fibs: Stream[BigInt] = BigInt(0) #:: | |
BigInt(1) #:: | |
fibs.zip(fibs.tail).map { n => n._1 + n._2 } |
<#-- For formatting third-party file returned by License Maven Plugin. | |
Format is semicolon-delimited: license; name; groupId; artifactId; version; url | |
--> | |
<#function licenseFormat licenses> | |
<#assign result = ""/> | |
<#list licenses as license> | |
<#assign result = result + license/> | |
</#list> | |
<#assign result = result + ";"/> |
trait Enum { //DIY enum type | |
import java.util.concurrent.atomic.AtomicReference //Concurrency paranoia | |
type EnumVal <: Value //This is a type that needs to be found in the implementing class | |
private val _values = new AtomicReference(Vector[EnumVal]()) //Stores our enum values | |
//Adds an EnumVal to our storage, uses CCAS to make sure it's thread safe, returns the ordinal | |
private final def addEnumVal(newVal: EnumVal): Int = { import _values.{get, compareAndSet => CAS} | |
val oldVec = get |
for i in $(find . -name *Test.scala); | |
do grep -s \"@RunWith(classOf\\[JUnitRunner\\])\" $i; | |
if [ $? -ne 0 ]; | |
then | |
echo $i; | |
fi; | |
done |
echo "Running mocha tests with grunt..." | |
echo `grunt -version` | |
npm install | |
grunt simplemocha --force |