Data dodania Pytanie
2017-04-01 08:04 Apache Spark Object not Serializable Exception for json parser »
I am reading the data[json as String] from kafka queue and tring to parse json as String into case class using liftweb json api. here is the code Sni...
(1) odpowiedzi
2017-04-01 07:04 In Scala enumerations how does one interpret 'val RED, GREEN, BLUE = Value'? »
The defined way to describe an enumeration is the following: object Color extends Enumeration{ type Color = Value val RED, GREEN, BLUE = Value }...
(1) odpowiedzi
2017-03-31 22:03 How Immutability is Achieved in Scala Streams? »
It might become silly but I have question regarding to Scala Stream evaluation in immutable fashion. Lets say I have a Stream like this (All lines ex...
(2) odpowiedzi
2017-03-31 16:03 What's the benefit of scalaz.concurrent.Future, in comparison to scalaz.ContT[Trampoline, Unit, ?] »
I was looking for a data type for asynchronous operations. I found that scalaz.ContT[Trampoline, Unit, ?] supports all features in scalaz.concurrent....
(0) odpowiedzi
2017-03-31 14:03 If-else without else causes recursive function to repeat »
Why does the following produce the output "ayyayy" and not just "ayy" (once)? def iftest(b: Boolean): Unit = { if(b) iftest(false) print("ayy") }...
(1) odpowiedzi
2017-03-30 15:03 Akka Stream connect to multiple sinks »
I have implemented a custom component in akka stream which takes elements as input, groups and merges them based on a key and sends them out through o...
(2) odpowiedzi
2017-03-30 15:03 Convert RDD[Map[String, String]] to Spark dataframe »
I'm trying to convert a val rec: RDD[Map[String, String]] into a Spark dataframe. But when I execute: val sqlContext = new SQLContext(sc) val df = ...
(1) odpowiedzi
2017-03-30 12:03 Mongo timezone aggregation »
Is there a way to take timezone into account when running a mongo query? We have an issue whereby since the clocks have gone forward (to BST) our mong...
(0) odpowiedzi
2017-03-29 20:03 How can I solve the Diverging implicit expansion for type »
I want to make my case class Event[K, V] beeing ordered by key K always. But I need to be able to compare Events of differnt Values V. How can I solve...
(1) odpowiedzi
2017-03-29 13:03 Cannot copy case class with repeated parameters »
Why can I not use the copy method of a case class with repeated parameters? For example why does the last line of this code give me the error? case ...
(1) odpowiedzi
2017-03-29 11:03 Best practices of handling HTTP response with scala »
I have ServerA which exposes an API method for a client, which looks like this: def methodExposed()= Action.async(json) { req => val reqAsMod...
(2) odpowiedzi
2017-03-29 10:03 Type parameter in play-json read/write macro »
I have a parametrized case class CaseClass[T](name: String, t: T) for which I would like to have serialization/deserialization using play-json (2.5). ...
(1) odpowiedzi
2017-03-28 19:03 Scala Array Generics vs Vector Generics »
So I have been working on a refactor in my project to convert Vector's in my code to Array's. The reason being that my application needs to be very pe...
(2) odpowiedzi
2017-03-28 14:03 akka-http and JsonEntityStreamingSupport »
I'm currently doing some experiment with akka and its persistency stack, wrapped with akka-http stack. Note: For persistency, i'm using non-official ...
(1) odpowiedzi
2017-03-28 10:03 Return a sequence with dynamic type in scala »
I'm trying to define a function, which should return a range from 1 to n of type T. Here, T is given as user-input and an implicit def method is avail...
(1) odpowiedzi
2017-03-28 07:03 In Scala, why does a type annotation must follow for the function parameters ? Why does the compiler not infer the function parameter types? »
I have a simple question, why is the Scala compiler not able to infer the function parameter types by itself ? ...
(2) odpowiedzi
2017-03-27 17:03 Refined and existential types for runtime values »
Suppose I want to map between some strings and integer identifiers, and I want my types to make it impossible to get a runtime failure because someone...
(2) odpowiedzi
2017-03-27 15:03 Pattern Matching - @ versus :? »
Given: case object A What's the difference, if any, between the @ and : in: def f(a: A.type): Int = a match { case aaa @ A => 42 } and def...
(4) odpowiedzi
2017-03-27 11:03 Scala- zip with futures »
Below is the code which i am trying to understand: object Tryouts extends App{ val studentIds= Future{ List("s1","s2","s3") } val...
(1) odpowiedzi
2017-03-26 15:03 Motivation behind Scala package objects »
What are the advantages of the object package syntax over simply letting you add functions and variables to a package ? example: package object some...
(1) odpowiedzi
2017-03-26 12:03 Scala proper using of Try and Option combined together »
I'm using Try() to wrap calls to not-100%-reliable 3-rd party service which return Option() of some type therefore receiving Some(DataDto) or None. S...
(1) odpowiedzi
2017-03-26 01:03 Why is there no :: Operator on scala map? »
when using Scala immutable lists I can easily do 1 :: List(2, 3, 4) and this gives me a new list and I am still using immutable data structures. S...
(1) odpowiedzi
2017-03-25 23:03 Understanding reduceByKey function definition Spark Scala »
The reduceByKey function for a Pair RDD in spark has the following definition: def reduceByKey(func: (V, V) => V): RDD[(K, V)] I understand that...
(2) odpowiedzi
2017-03-25 22:03 Getting unique values of pairs in an RDD when the order within the pair is irrelevant »
I have a rdd with the values of a,b a,c a,d b,a c,d d,c d,e what I need is an rdd that contains the reciprocal pairs, but just one set. It would h...
(1) odpowiedzi
2017-03-25 08:03 Is connection pooling in akka-http using the source queue Implementation thread safe? »
Refering to the following implementation mentioned in: http://doc.akka.io/docs/akka-http/10.0.5/scala/http/client-side/host-level.html val poolClie...
(2) odpowiedzi
2017-03-24 16:03 How to convert an array of array of Doubles to an RDD[String] »
I need to convert an Array[Array[Double]] to an RDD, e.g [[1.1, 1.2 ...], [2.1, 2.2 ...], [3.1, 3.2 ...], ...] to +-----+-----+-----+ | 1.1 | 1.2 | ...
(2) odpowiedzi
2017-03-24 15:03 How to construct an actor together with its wrapper? »
I'm trying to write an actor called ActorManager which wraps another actor called RealActor. The idea is that the ActorManager can process all message...
(2) odpowiedzi
2017-03-24 13:03 Akka Cluster Joining with DNS Load Balancing »
Looking at the akka cluster documentation it appears that you have to know the server & port values of at least 1 "seed node" to join the cluster....
(1) odpowiedzi
2017-03-24 08:03 Scala code prettification - loop 2D array with if statement »
Hey i am pretty new to functional programming so what is the most scala-like way to write this peace of code? var ANSWERS_ARRAY // Is array for ((row...
(2) odpowiedzi
2017-03-24 02:03 Scala Exception Handling »
I am writing data from parquet to Tableau. For this For each partition, I have created a table and create a tableau row from parquet row Insert ea...
(1) odpowiedzi
2017-03-23 17:03 scala set sbt breakpoint without Intellij »
I am trying to migrate off Intellij (it keeps breaking, losing configuration options and generally being more painful to use than a text editor and a ...
(2) odpowiedzi
2017-03-23 17:03 How to pattern match int strings? »
I'm trying to figure out what the best way to pattern match a string representation of an int in Scala. What I really want to be able to do is somethi...
(4) odpowiedzi
2017-03-23 17:03 Infer common super-type »
Here is what I am trying to do def merge[A, B, C](eithers: Either[A,B]*)(implicit ev1: A <:< C, ev2: B <:< C): Seq[C] = eithers.f...
(2) odpowiedzi
2017-03-22 19:03 Scala: partitioning number into n almost equal-length ranges »
I am trying to implement a function: def NumberPartition(InputNum:Int,outputListSize:Int):List[Range] such that: NumberPartition(8,3)=List(Range(0...
(3) odpowiedzi
2017-03-22 13:03 Scala - infix operator for super can't be called infix »
Suppose I have the following structure trait A { def \ (v: String) = ... def + (v: String) = ... } case class B extends A { override def...
(1) odpowiedzi