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> import scala.collection.par._ | |
import scala.collection.par._ | |
scala> import scala.collection.views.BlitzViews._ | |
import scala.collection.views.BlitzViews._ | |
scala> import scala.collection.par.Scheduler.Implicits.sequential | |
import scala.collection.par.Scheduler.Implicits.sequential | |
scala> val mymap = new Map[Int,Int](_ + 10) |
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
class A{ | |
class Color{} | |
val o1: {def color:Any} = new {def color: Any = 1 } | |
val o2 = o1.asInstanceOf[{def color: Color}] | |
o2.color | |
} |
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 A.; | |
import A..anon; | |
import A..anon.1; | |
import java.lang.Class; | |
import java.lang.Object; | |
import java.lang.String; | |
import java.lang.Throwable; | |
import java.lang.ref.SoftReference; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; |
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
class X { | |
private def foo = 1 | |
} | |
object X { | |
class Inner extends X { | |
override private def foo = 2 | |
} | |
} | |
14:48 14:47 ~/Projects/211x/sandbox (2.11.x)$ s |
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
214. | |
http://www.scala-lang.org/api/current/index.html#scala.collection.Iterable | |
// if name is listed twice - most likely one is mutable and the other is immutable | |
::, AbstractBuffer, AbstractIterable, AbstractIterable, AbstractMap, AbstractMap, | |
AbstractMap, AbstractSeq, AbstractSeq, AbstractSet, AbstractSet, AnyRefMap, | |
Appended, Appended, Appended, ArrayBuffer, ArraySeq, ArrayStack, BitSet, BitSet, | |
BitSet, BitSet1, BitSet2, BitSetN, Buffer, BufferProxy, Cons, DefaultKeySet, |
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
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) | |
} |
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
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 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 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 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) |
OlderNewer