Data dodania Pytanie
2017-09-20 20:09 Spark Streaming Guarantee Specific Start Window Time »
I'm using Spark Streaming to read data from Kinesis using the Structured Streaming framework, my connection is as follows val kinesis = spark .rea...
(0) odpowiedzi
2017-09-20 14:09 How to make compiler check that 2 method arguments have the same type? »
Probably I am missing something fundamental here, but I was refactoring certain things in my code and on the halfway I noticed that my code compiles, ...
(2) odpowiedzi
2017-09-20 13:09 groupByKey vs. aggregateByKey - where exactly does the difference come from? »
There is some scary language in the docs of groupByKey, warning that it can be "very expensive", and suggesting to use aggregateByKey instead whenever...
(2) odpowiedzi
2017-09-19 22:09 Prevent 0-ary functions from being called implicitly in Scala »
I got nipped by a production bug where I passed an impure 0-ary function to a class that mistakenly expected a a bare result type. def impureFunc(): ...
(1) odpowiedzi
2017-09-19 19:09 Does Scala tuple type uses all of its elements to compute its hash code? »
Or does Scala compute tuple hashcode using something independent of its elements, like memory address? In other words, given two Tuple2s (a, b) and (...
(2) odpowiedzi
2017-09-19 10:09 Chisel3: How to get verilog,cpp and vcd files simultaneously »
I am a novice with chisel. I would be using it in my project in coming days and I am trying to get familiar with the library. After working with Chi...
(1) odpowiedzi
2017-09-19 04:09 Finding a map in list/vector of maps in Scala »
I have a vector/list of maps (Map[String,Int]). How can I find if a key-value pair exists in one of these maps in the list of maps using .find? ...
(2) odpowiedzi
2017-09-18 23:09 Shapeless: Iterate over the types in a Coproduct »
I want to do something really simple, but I'm struggling to craft the correct search or just understanding some of the solutions I've seen. Given a m...
(1) odpowiedzi
2017-09-18 21:09 scala weird symbol "_@" meaning »
I am wondering what this scala symbol is: _@. (Search engines have trouble with weird characters so it's hard to find anything on google...) Here is...
(1) odpowiedzi
2017-09-18 06:09 How do I change a project's id in SBT 1.0? »
I have a bunch of SBT 0.13 project definitions that look like this: lazy val coreBase = crossProject.crossType(CrossType.Pure).in(file("core")) .se...
(1) odpowiedzi
2017-09-17 16:09 Scala - function which takes a type composition of 2 traits »
I want my function to receive a type which implements 2 traits. Is it possible to create an "adhoc" trait type like that? For instance: trait t1 { ...
(1) odpowiedzi
2017-09-17 14:09 Higher-order unification for type constructor inference »
def meh[M[_], A](x: M[A]): M[A] = x meh((x: Int) => "") After SI-2712 (https://issues.scala-lang.org/browse/SI-2712) fix type A is inferred to th...
(1) odpowiedzi
2017-09-17 14:09 Scala's TreeSet `min` operation performance »
When exploring Scala's standard library, I found out, that TreeSet doesn't override min operation at all, so this operation is derived from Traversabl...
(0) odpowiedzi
2017-09-17 04:09 Filtering list of tuples - better readability »
What is a good way( read better readability) to filter a list of tuples. I'm using tupleList.filter(_._2).map(_._1) But this does not feel readable...
(3) odpowiedzi
2017-09-16 23:09 Scala objects and thread safety »
I am new to Scala. I am trying to figure out how to ensure thread safety with functions in a Scala object (aka singleton) From what I have read so ...
(3) odpowiedzi
2017-09-16 15:09 How can I obtain the DAG of an Apache Spark job without running it? »
I have some Scala code that I can run with Spark using spark-submit. From what I understood, Spark creates a DAG in order to schedule the operation. ...
(1) odpowiedzi
2017-09-16 12:09 How to Inject() into a class with constructor parameters? »
I have a WebSocket controller which creates per connection actor handler: class WebSocketController @Inject()(cc: ControllerComponents)(implicit exc:...
(2) odpowiedzi
2017-09-15 11:09 Scala: implicitly converted type as implicit param of a method »
I have a method that expects some implicit param of type String. I have an object of class MyClass which I want to pass to that method implicitly. Fi...
(1) odpowiedzi
2017-09-15 08:09 Find wrapped array entry that is not empty »
I´m new with spark. My problem is that I have to find in a list, these which are not empty. When I use the filter function is not null, than I get a...
(2) odpowiedzi
2017-09-15 03:09 sbt corrupts terminal display »
This is a head scratcher for me; I'm on Mac OS 10.11.6 and I recently started using sbt for scala. I'm running into the situation that every time I r...
(1) odpowiedzi
2017-09-14 13:09 Play Framework Stop responding after 2-3 days »
I am using play framework and it stops responding after 2-3 days and when I restart server then everything works fine. Please let me know what I am...
(1) odpowiedzi
2017-09-14 13:09 Prepend to vector scala »
Newbie to scala, im finding the symbolic notation for dealing with collections confusing. To append an item to a list or vector i can use: List(1, 2,...
(1) odpowiedzi
2017-09-14 09:09 Scalatest building and running in Intellij, but not building the project when run on the command line with maven »
I'm able to run my tests in a spec file individually when using intellij, however when I try running with Maven on the command line the project will n...
(1) odpowiedzi
2017-09-12 23:09 Scala: Function0 vs by-name parameters »
Can anyone give a definitive answer on how by-name parameters => T and Function0 parameters () => T are transformed into one another by the Scal...
(1) odpowiedzi
2017-09-12 18:09 Get type of a "singleton type" »
We can create a literal types via shapeless: import shapeless.syntax.singleton._ var x = 42.narrow // x: Int(42) = 42 But how can I operate with In...
(2) odpowiedzi
2017-09-12 16:09 Spark Dataframe Group by having New Indicator Column »
I need to group by "KEY" Column and need to check whether "TYPE_CODE" column has both "PL" and "JL" values , if so then i need to add a Indicator Colu...
(2) odpowiedzi
2017-09-11 20:09 Unwrap/strip Shapeless Coproduct objects »
I have a domain that looks like this: package object tryme { type ALL = AlarmMessage :+: PassMessage :+: HeyMessage :+: CNil } import com.tryme._ ...
(2) odpowiedzi
2017-09-11 18:09 is it possible to implement flip as a Scala function (and not a method) »
As a part of learning Scala I try to implement Haskell's flip function (a function with signature (A => B => C) => (B => A => C)) in Scala - and imple...
(1) odpowiedzi
2017-09-11 11:09 What is Applicative Builder »
I am scala and functional newbie and trying to learn applicatives. val o1 = Some(1) val o2 = Some(2) val o3 = Some(3) val result = (o1 |@| o2 |@| o3)...
(1) odpowiedzi
2017-09-10 22:09 With a Scala Either, how do you stop at the first error, but gets the already computed values »
For example, let say I have a function def foo(): Either[String, Int] = ??? I want to call this function 3 times. If all the values are Right, I wa...
(3) odpowiedzi
2017-09-10 21:09 Decoding structured JSON arrays with circe in Scala »
Suppose I need to decode JSON arrays that look like the following, where there are a couple of fields at the beginning, some arbitrary number of homog...
(1) odpowiedzi
2017-09-10 16:09 Scala can't infer type arguments of Java method »
I have the following sophisticated type hierarchy in Java: // the first type interface Element<Type extends Element<Type>> { Type foo...
(1) odpowiedzi
2017-09-09 21:09 How to properly pass many dependencies (external APIs) to a class in Scala? »
How to properly pass many dependencies (external APIs) to a class in Scala? I'm working on the application that uses many APIs to collect data. For A...
(1) odpowiedzi
2017-09-09 12:09 How to create a custom Seq with bounded type parameter in Scala? »
Consider the following working custom Seq: class MySeq[B](val s: Seq[B]) extends Seq[B] with GenericTraversableTemplate[B, MySeq] with SeqLike[B, My...
(2) odpowiedzi
2017-09-09 03:09 Scala way to remove duplicate in an Array »
I want to learn how to write for loop functions without declear "var" at the front of the code. For example, I want to remove duplicates in an interge...
(3) odpowiedzi