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
def readVolatile[T](l: T): T = macro readVolatile_impl[T] | |
def readVolatile_impl[T: c.WeakTypeTag](c: Context)(l: c.Expr[T]): c.Expr[T] = { | |
import c.universe._ | |
l.tree match { | |
case Select(obj, sel) => | |
val name = c.Expr[String](Literal(Constant(sel.encoded))) | |
val objRef = c.Expr[Any](obj) | |
l.actualType match { | |
case x if (x =:= typeOf[Int]) => reify { |
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
Some GC time recorded, accepted: 5, ignored: 6 | |
measurements: 10378.641435, 11963.530569, 11378.469428, 10396.542717, 10984.350433 | |
After outlier elimination: 10378.641435, 10396.542717, 10984.350433, 11378.469428, 11963.530569 | |
After applying noise: 10378,641, 10396,543, 10984,350, 11378,469, 11963,531 | |
Test threw exception: java.util.NoSuchElementException: key not found: Parameters(SamplePageRank -> [[I@1e1c2fc6) | |
java.util.NoSuchElementException: key not found: Parameters(SamplePageRank -> [[I@1e1c2fc6) | |
at scala.collection.MapLike$class.default(MapLike.scala:228) | |
at scala.collection.AbstractMap.default(Map.scala:58) | |
at scala.collection.MapLike$class.apply(MapLike.scala:141) | |
at scala.collection.AbstractMap.apply(Map.scala:58) |
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
object IMB1 extends App { | |
type French = String | |
type English = String | |
case class SentencePair(eng: English, fr: French) | |
case class Translation(eng: English, prob: Double) | |
case class WordPair(eng: English, fr: French) | |
val EPS = 1e-6 | |
var iter = 0 | |
def finished = iter > 5 |
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
from nltk.tokenize import word_tokenize | |
from math import erf, log | |
import sys | |
import numpy | |
eng_filename = sys.argv[1] | |
ru_filename = sys.argv[2] | |
output_filename = sys.argv[3] |
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
Exception in thread "main" java.lang.ExceptionInInitializerError | |
at scala.collection.workstealing.benchmark.scalameter.RangeBenchmark$$anonfun$3.apply(ParRangeBenchmark.scala:33) | |
at scala.collection.workstealing.benchmark.scalameter.RangeBenchmark$$anonfun$3.apply(ParRangeBenchmark.scala:33) | |
at org.scalameter.Gen$$anon$1$$anonfun$warmupset$1.apply(Gen.scala:13) | |
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328) | |
at scala.collection.Iterator$class.foreach(Iterator.scala:727) | |
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157) | |
at org.scalameter.execution.SeparateJvmsExecutor$$anonfun$sample$1$1.apply(SeparateJvmsExecutor.scala:49) | |
at org.scalameter.execution.SeparateJvmsExecutor$$anonfun$sample$1$1.apply(SeparateJvmsExecutor.scala:39) | |
at org.scalameter.execution.package$Main$.mainMethod(package.scala:73) |
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
def gcd(a: Int, b: Int) { | |
if (a == 0) { | |
(0, 1, b) | |
} | |
else { | |
val (d, x1, y1) = gcd(b % a, a) | |
val x = y1 - (b / a) * x1 | |
val y = x1 | |
(x, y, d) | |
} |
NewerOlder