Data dodania Pytanie
2017-11-18 20:11 Making a HTTP API server asynchronous with Future, how does it make it non-blocking? »
I am trying to write a HTTP API server which does basic CRUD operation on a specific resource. It talks to an external db server to do the operations....
(3) odpowiedzi
2017-11-18 16:11 How to compose two Flows side-by-side? »
Is there an Akka streams combinator for doing the following (or something to that effect)? (Let's call it and for now.) (flow1: Flow[I, O, Mat]).and[...
(1) odpowiedzi
2017-11-18 16:11 Is there an inject equivalent for Haskell in the context of free monads »
I'm trying to translate this Scala's cats example about composing free monads. The gist of the example seems to be the decomposition of separate conc...
(1) odpowiedzi
2017-11-17 21:11 Scala - design choices when splitting code over traits, classes, objects »
My code is always a mess, and I think I lack some foundational knowledge. When I try to split functionality out over traits and objects, I'm not quit...
(1) odpowiedzi
2017-11-17 19:11 Why is Spark breaking my stage into 3 different stages with the same description and DAG? »
I have a 5 worker node cluster with 1 executor each and 4 cores per executor. I have an rdd that is spread over 20 partitions that I check with the ...
(0) odpowiedzi
2017-11-17 09:11 WSClient Play Framework SSL setup »
I am trying to use the WSClient in my Play app with a custom ssl config, but it's not working. My controller looks like this: @Singleton class HomeC...
(0) odpowiedzi
2017-11-16 19:11 Understanding FoldLeft in ScalaZ »
I'm reading some articles about ScalaZ and have a question about understanding it. In this article, we generalize the sum function, to abstract away t...
(1) odpowiedzi
2017-11-16 10:11 How to write scala code not like java code? »
During an interview, the tech lead said my scala code was just like java code, but using scala api and he wanted me to improve on that. I am a 3-year...
(1) odpowiedzi
2017-11-16 09:11 How to return the original collection type from generic method »
I have a generic method that should return a collection of the same type as input: def removeN[A, C <: Seq[A]](s: C, n: Int): C = { s.take(n) ++...
(1) odpowiedzi
2017-11-16 00:11 Unable to use Apache Commons CLI Option.builder() in Scala »
In a spark shell or application (written in Scala/maven build), I am unable to use the static builder method from the Apache Commons CLI package. I h...
(1) odpowiedzi
2017-11-15 21:11 Invert a Map (String -> List) in Scala »
I have a Map[String, List[String]] and I want to invert it. For example, if I have something like "1" -> List("a","b","c") "2" -> List("a",...
(1) odpowiedzi
2017-11-15 14:11 Overriding `Comparison method violates its general contract` exception »
I have a comparator like this: lazy val seq = mapping.toSeq.sortWith { case ((_, set1), (_, set2)) => // Just propose all the most connected nod...
(1) odpowiedzi
2017-11-15 07:11 Scala call length() on very long string throws exception: Maximum String literal length exceeded »
I wrote a scala solution for HackerRank BigSorting , and got RuntimeException in some test case. I tested the input in scastie, it seems the problem ...
(2) odpowiedzi
2017-11-14 23:11 Adding a list of managed libraryDependencies (of an arbitrary length) within an SBT Build »
In a nutshell, I have written a tool in scala that generates a list of jars from those stored in a directory locally, that parses a given repo identif...
(1) odpowiedzi
2017-11-14 22:11 Yield after if within nested for loop »
I'm having trouble with a nested for loop and using yield properly. The problem is if I have two lists of the form List[(Int,Int)] val ls = (1,5)::(...
(1) odpowiedzi
2017-11-14 15:11 Inferred type in for comprehension »
Setup: import scalaz._; import Scalaz._ case class Foo(map: Map[Int, String] = Map.empty, set: Set[Int] = Set.empty) val `foo.map`: Lens[Foo, Map[I...
(0) odpowiedzi
2017-11-13 23:11 installing jdk/sbt on new ubuntu machine »
I'm trying to install SBT on a fresh Ubuntu 16.04 machine on AWS. I've never had a problem installing (following instructions) before, but I am now. ...
(1) odpowiedzi
2017-11-13 20:11 Why I can store null in Int when doing conversion from Java but not otherwise? »
In the following code, I am creating a Java collection. Later when I convert it to Scala, I can store null in Int. But I cannot store null if I straig...
(2) odpowiedzi
2017-11-13 08:11 How to add jar file into the class-path while running another jar file during run time »
I have a jar file(mts.jar) to run and it requires another jar(hook.jar) to be added at the runtime. mts.jar is dependent on some of the classes pres...
(1) odpowiedzi
2017-11-12 20:11 Scala Function founds Unit while i return boolean »
Im getting error in if(Liste.length>1), i want to make a function to return true if list is ordered low to high. Having some problems with Boolean ret...
(2) odpowiedzi
2017-11-12 18:11 Scala change data iniside 2D list and return new list »
If lets say I have val ll : List[List[Int]] = List(List(1,2,3), List(4,5,6), List(7,8,9)) What I want to do is multiple each number inside my list...
(2) odpowiedzi
2017-11-12 16:11 Remove duplicates within Spark array column »
I have a given DataSet : +-------------------+--------------------+ | date| products| +-------------------+----------------...
(3) odpowiedzi
2017-11-12 13:11 Array[Byte] does not take type parameters »
In Haskell, I can constraint a parameter to a type class, for example: Prelude> f x y = x * y Prelude> :t f f :: Num a => a -> a -> a ...
(2) odpowiedzi
2017-11-11 18:11 Alternative to Gatling »
I’ve been having issues lately because my dependencies has been updated to use netty 4.1 and Gatling has not been updated for a while, and still wor...
(3) odpowiedzi
2017-11-11 16:11 StackOverflow during typeprovider macro expansion »
I was playing around a bit with macros and I thought writing a json type provider would be a good start to get a deeper understanding of how all this ...
(0) odpowiedzi
2017-11-11 11:11 spark sbt with graphx »
I am new to scala and sbt thing, so I am not sure why I am getting the error. The following is my build.sbt name := "graphx-example" version := "1....
(1) odpowiedzi
2017-11-10 23:11 Two libraries bring in different version of the same dependency. How to import them both? »
I have the following situation: + DentistApp L TreatsLibrary L IceCream 1.0 L CavityCausesLib L IceCream 2.0 Now I get a VerifyErro...
(1) odpowiedzi
2017-11-10 11:11 How to keep listening in FP? »
I want to use Kafka for sending messages between microservices. Kafka uses publish subscribe mechanism, that it is mean, a producer produces messag...
(1) odpowiedzi
2017-11-10 00:11 How to write a DataFrame into a MySQL table »
Sorry if it sounds vague but can one explain the steps to writing an existing DataFrame "df" into MySQL table say "product_mysql" and the other way ar...
(1) odpowiedzi
2017-11-09 15:11 Scala: Apply same function to 2 lists in one call »
let say I have val list: List[(Int, String)] = List((1,"test"),(2,"test2"),(3,"sample")) I need to partition this list in two, based on (Int, Stri...
(2) odpowiedzi
2017-11-09 05:11 could anyone can explain what this means »
scala> val sample ="1,2013-07-25 00:00:00.0,11599,CLOSED" sample: String = 1,2013-07-25 00:00:00.0,11599,CLOSED scala> sample.split(",")(1).spl...
(3) odpowiedzi
2017-11-09 01:11 How do I call a method that only exists on one of the 2 types in an Either? »
I have an array of objects of type Either[A, B]. If I know for a particular element whether it is an A or a B, how do I call a method on it that only ...
(3) odpowiedzi
2017-11-08 22:11 Handling record size more than 3GB in spark »
I'm getting below exception when an individual record size is more than 3GB ` java.lang.IllegalArgumentException App > at java.nio.CharBuffer.allo...
(1) odpowiedzi
2017-11-08 17:11 SBT: How to package an instance of a class as a JAR? »
I have code which essentially looks like this: class FoodTrainer(images: S3Path) { // data is >100GB file living in S3 def train(): FoodClassifi...
(2) odpowiedzi
2017-11-08 14:11 Calling generic function with Functor using subclass (cats/scalaz) »
I've been messing around with some basic examples of Cats/Scalaz and also walking through tutorials to get a feel and I've hit a case which I'm sure t...
(2) odpowiedzi