Data dodania Pytanie
2017-01-11 23:01 takeWhile, dropWhile laziness java9 »
In scala those methods works fine but in java9 dropWhile works differently I think. Here is example for takeWhile Stream.of("a", "b", "c", "de", "f"...
(4) odpowiedzi
2017-01-11 21:01 Why does scalac need a transitive dependency on the classpath »
I'm running into an unexpected (only for me?) ScalaC behavior. The TL;DR is that the following is a recreation of an issue I saw while trying to migra...
(1) odpowiedzi
2017-01-11 15:01 why Partial function in scala is giving run time error for input 0? »
I am expecting my partial function to discard for input 0 , but instead it is giving match error . Will you please explain exactly why is it happening...
(3) odpowiedzi
2017-01-11 10:01 Sbt update shows Server access Error: java.security.ProviderException: java.lang.NegativeArraySizeException »
Yesterday everything was working fine, but today when I execute sbt update I am getting: [info] Resolving org.log4s#log4s_2.11;latest.release ... [er...
(1) odpowiedzi
2017-01-10 19:01 Scala: system commands to a python script with arguments »
So I am sending this system command in Scala: val command = "python other/evaluateAnswers.py 'chemistry earth' 'the chemistry of the world in champa...
(1) odpowiedzi
2017-01-10 14:01 String viewed as a Sequence »
In Daniel's answer from this post: What are Scala context and view bounds? is presented a way of handling a String as a Scala Collection. handlin...
(1) odpowiedzi
2017-01-10 14:01 What is wrong with my project hierarchy? »
I have created a project by importing existing sources in Intellij IDEA. When I run from my comand line,sbt and then console I got this [info] Com...
(1) odpowiedzi
2017-01-09 20:01 Monads as Monoids in practice »
I am trying to understand the relationship between monads and monoids in more practical ways. I apologize in advance if this question makes no sense, ...
(1) odpowiedzi
2017-01-09 18:01 Why is Spark performing worse when using Kryo serialization? »
I enabled Kryo serialization for my Spark job, enabled the setting to require registration, and ensured all my types were registered. val conf = new ...
(0) odpowiedzi
2017-01-09 12:01 Custom Spark datasource with primitive byte arrays - avoid boxing? »
I'm working on a custom Spark datasource and want the schema to include a row of primitive byte array type. My problem is that the bytes in the resul...
(1) odpowiedzi
2017-01-09 06:01 neo4j 3.0 embedded - no nodes »
There's sometime I must be missing about neo4j 3.0 embedded. After creating a node, setting some properties, and marking the transaction as success. I...
(1) odpowiedzi
2017-01-08 20:01 Typeclass Derivation of Coproduct? »
Given the following from the well-written shapeless-guide: package net import shapeless.labelled.FieldType import shapeless._ sealed trait JsonValu...
(1) odpowiedzi
2017-01-08 15:01 How to write a string to Scala Process? »
I start and have running a Scala process. val dir = "/path/to/working/dir/" val stockfish = Process(Seq("wine", dir + "stockfish_8_x32.exe")...
(2) odpowiedzi
2017-01-08 14:01 Difference between === null and isNull in Spark DataDrame »
I am bit confused with the difference when we are using df.filter(col("c1") === null) and df.filter(col("c1").isNull) Same dataframe I am gettin...
(2) odpowiedzi
2017-01-07 20:01 Generic#to, but with Field Names? »
Using Generic#to, I can get the HList representation of a case class: import shapeless._ case class F(x: Int, y: String) scala> Generic[F].to( F(...
(1) odpowiedzi
2017-01-07 10:01 cake pattern - why is it so complicated »
I am trying to learn about the cake pattern. I am reading this blog about it. The example code from that blog is: case class User (name:String,emai...
(1) odpowiedzi
2017-01-07 10:01 Scala - Types and Instantiation »
scala> val a1 = scala.concurrent.Promise[Int] a1: scala.concurrent.Promise[Int] = scala.concurrent.impl.Promise$DefaultPromise@10d59286 I'm not a...
(1) odpowiedzi
2017-01-06 21:01 Is it possible to force named parameters in scala? »
In some method I would like to force parameters to be named. The reason being autogenerated code for which the order of parameters is unspecified (and...
(4) odpowiedzi
2017-01-06 18:01 Why does creating a map function whose parameter is of type `Nothing => U` appear to work? »
I'm writing Scala code that uses an API where calls to the API can either succeed, fail, or return an exception. I'm trying to make an ApiCallResult m...
(2) odpowiedzi
2017-01-06 06:01 explanation on scala for comprehension with Option »
I have the following definition: def f: Option[String] = Some(null) the following evaluates to None: for {x:String <- f} yield { x } th...
(2) odpowiedzi
2017-01-05 22:01 Print ALL defined variables/method signatures in Spark Shell - Scala REPL »
When I use the spark-shell I end up defining many var, val, and methods. At some point I forget what I have available in my session. How do I print th...
(1) odpowiedzi
2017-01-05 19:01 Convert CompletableFuture (Java 8) to Future (Scala) »
I want to change the return type of the method below to Future[Unit] def send(data: Array[Byte]): CompletableFuture[Void] = { val f:CompletableFutu...
(1) odpowiedzi
2017-01-05 15:01 What is the usage of _ in Int => Int = _ + 1 »
In the code below, what is the classification (or technical name) of the usage of the underscore character? scala> def f: Int => Int = _ + 1 f:...
(2) odpowiedzi
2017-01-04 23:01 Why can't I match on a Seq.empty? »
I tried matching a seq like this: val users: Seq[User] = .... users match { case Seq.empty => .... case .. } I got an error saying: stable...
(2) odpowiedzi
2017-01-04 20:01 Single Element Lists Have Same Head But Are Not Equal? »
Given two List[A] instances, under what circumstance could the following be true? list.head == otherList.head // returns true list.size == 1 ...
(1) odpowiedzi
2017-01-04 19:01 Scala - Multiple inheritance with App trait »
Consider two traits, TestTrait1 and TestTrait and assume NewObject extends both. The idea is to make use of variable in TestTrait1 in TestTrait. The b...
(1) odpowiedzi
2017-01-03 16:01 A compiling error about scala type inference »
I am doing a simple exercise which asks me to implement a standalone 'map' function on a list using foldRight. And the solution I came up with is this...
(1) odpowiedzi
2017-01-03 15:01 Meaning of `A >: Null`? »
I attempted to write a function that won't compile if null is passed: $scala Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_1...
(3) odpowiedzi
2017-01-03 10:01 Tail recursive fold on a binary tree in Scala »
I am trying to find a tail recursive fold function for a binary tree. Given the following definitions: // From the book "Functional Programming in Sc...
(1) odpowiedzi
2017-01-03 05:01 How in Scala , trait "Null" can be instantiated producing "null"? »
From the API doc I found that Null is a trait, but it says its sole instance is null. abstract final class Null extends AnyRef Null is - toget...
(1) odpowiedzi
2017-01-02 17:01 How to fold a collection of endomorphism with cats »
Given a function def f(i: I) : S => S I would like to write a pretty common combinator g def g(is : Seq[I], init: S) : S The easy implementat...
(1) odpowiedzi
2017-01-02 13:01 Object creation syntax difference »
Is there a difference between new ClassName and new ClassName()? Is it only a syntax difference or is there a scala magic happening in the background?...
(1) odpowiedzi
2017-01-02 07:01 What is special about case classes in Akka? »
I have read that case classes can be used with pattern matching. But, I am able to use a regular class with pattern matching as well. This question gi...
(1) odpowiedzi
2017-01-01 21:01 contramap method doesn't make any sense to me »
I am reading about the contramap method in Functors. What I understand about them is that if I have a type class F[B] (for example List[Int]) and I ha...
(0) odpowiedzi
2017-01-01 20:01 Reset Akka actors to initial state »
I have actors that do a simulation, and then send back data. I would like to be able to run the simulation multiple times, so I need to reset the inte...
(1) odpowiedzi