Data dodania Pytanie
2018-02-19 12:02 Nested Objects with ScalikeJDBC »
I want to have nested objects with a flat database table in ScalikeJDBC. Meta(id: String) Poll(meta: Option[Meta], value: String) with mapping to ...
(2) odpowiedzi
2018-02-19 12:02 Is there a way to validate the syntax of raw spark sql query? »
Is there a way to validate the syntax of raw spark SQL query? for example, I would like to know if there is any isValid API call spark provides? val...
(1) odpowiedzi
2018-02-19 09:02 Method calling a function that takes a String and returns Unit »
I am trying to write a method that can take a function of type (String) => Unit. This does not seem to work. val sayHelloToPerson : (String) => ...
(3) odpowiedzi
2018-02-18 22:02 Consolidate a list of Futures into a Map in Scala »
I have two case classes P(id: String, ...) and Q(id: String, ...), and two functions returning futures: One that retrieves a list of objects given a...
(2) odpowiedzi
2018-02-18 15:02 Slick 3: How to construct dynamic filter with optional column? »
I need to construct dynamic filter based on some criteria which involves optional column: Criteria case class Criteria( name: Option[String] = Non...
(1) odpowiedzi
2018-02-18 08:02 Recursive DataType in Scala »
Hi I was wondering if someone could explain this signature I found in the Spark codebase. It looks like a recursive datatype, it's used to build the ...
(1) odpowiedzi
2018-02-17 17:02 Pattern matching with HKT - avoid having to cast return type »
In the following example, while the pattern match is technically correct, obviously the casting is bad. Can I reformulate that without having to use a...
(1) odpowiedzi
2018-02-17 17:02 How to return a NodeSeq without a root node? »
I'm new to Scala and I'm working in a project written fully in Scala, and I want to modify a case class that contains a method that return a NodeSeq, ...
(1) odpowiedzi
2018-02-17 09:02 How do I work with a Scala process interactively? »
I'm writing a bot in Scala for a game that uses text input and output. So I want to work with a process interactively - that is, my code receives out...
(1) odpowiedzi
2018-02-16 22:02 How to instantiate a nested generic class defined in scala from java? »
I'm trying to instantiate a nested generic Scala class from Java and running into this compilation error. Can someone help? Thanks outer.scala: clas...
(3) odpowiedzi
2018-02-16 19:02 Shared state in functional application »
Okay I'm trying to understand how to do programming without variables. I've managed a simple tic-tac-toe game but it depended on a tail recursive sta...
(0) odpowiedzi
2018-02-16 15:02 Alpakka : how to deserialize xml to objects - Is there a more concise pattern for deserializers? »
I have complex XML data (it might contain a lot of data and could have more than 15GB) which has a sophisticated nature with a deep structure. We nee...
(1) odpowiedzi
2018-02-16 07:02 Filtering on multiple columns in Spark dataframes »
Suppose I have a dataframe in Spark as shown below - val df = Seq( (0,0,0,0.0), (1,0,0,0.1), (0,1,0,0.11), (0,0,1,0.12), (1,1,0,0.24), (1,0,1,0.27), ...
(1) odpowiedzi
2018-02-15 17:02 How to check covariant and contravariant position of an element in the function? »
This is a code snippet from one of the articles that I read regarding contravariance and covariance in scala. However, I fail to understand the error ...
(2) odpowiedzi
2018-02-15 16:02 Why can Scala and sbt compile this code? »
Example of Scala Worksheet case class Test(name: String) case class TestMapped(name: String, otherProperty: String) protected...
(1) odpowiedzi
2018-02-15 11:02 How to make this function pure »
My understanding about pure functions are that the output of the function only depends on the input. And they are referentially transparent. But then...
(1) odpowiedzi
2018-02-15 10:02 Why thunks must be explicitly forced when you define Streams iin Scala? »
I am reading a Scala textbook regarding Streams sealed trait Stream[+A] case object Empty extends Stream[Nothing] case class Cons[+A](h: () => A, ...
(1) odpowiedzi
2018-02-14 17:02 Scala cats, flatMap on cartesian? »
Given: import cats.syntax.cartesian._ type M[X] = Future[Either[Error, X]] val ma: M[A] = ??? val mb: M[B] = ??? I know I can do that: def doStuf...
(1) odpowiedzi
2018-02-14 11:02 Work on list of tuples in Scala - part 1 »
I'm new to Scala, and trying to understand how to work on lists of tuples, so I've created a fictive list of people: val fichier = List(("Emma Jacobs...
(2) odpowiedzi
2018-02-14 10:02 How to parse CSV which contains \n in data using Apache Spark? »
I have some CSV files which have \n character in the data itself. I am trying to read these files in Apache Spark 2.2 but Spark is not able to read th...
(2) odpowiedzi
2018-02-14 09:02 Aggregate duplicate records by maintaining the order and also include duplicate records »
I am trying to solve an interesting problem, it's easy to just do a groupBy for aggregation like sum, count etc. But this problem is slightly differen...
(3) odpowiedzi
2018-02-13 17:02 sbt: error importing resteasy-client »
I am try to add keycloak client to my sbt project. And it wants a ResteasyClientBuilder, so i try to add it to libraryDependencies and after I am typ...
(1) odpowiedzi
2018-02-13 14:02 What is the meaning or use of { _ => } and _ = somefunctionname() in scala »
As in the question, why do people write code in the most confusing manner in scala as in _ = function1(arg1, arg2) and anObject.method(ar...
(1) odpowiedzi
2018-02-13 09:02 Left-biased and Right-biased? »
I read an article about partial unificaton and the author mentioned about Left-biased and Right-biased datatypes. Could someone please explain it to m...
(1) odpowiedzi
2018-02-13 00:02 Elegant grouping of implicit value classes »
I'm writing a set of implicit Scala wrapper classes for an existing Java library (so that I can decorate that library to make it more convenient for S...
(1) odpowiedzi
2018-02-12 16:02 FS2 Stream exception handling not working »
I am having a problem with FS2 and exception handling. What I want is that, given a Stream[IO,A], when I map on it using an f: A => B that can thro...
(1) odpowiedzi
2018-02-12 15:02 Apache Flink, get last event in the window »
I'm working on a project where i have a window with a size of 4 days, with a step of 1 day .timewindow(Time.days(4), Time.days(1)) and i have also ...
(0) odpowiedzi
2018-02-12 02:02 What is functor bias? »
Following up from C++ Functors - and their uses, I have come across 'right biased functor' and 'left biased functor'. I have tried to do some research...
(1) odpowiedzi
2018-02-11 19:02 Scala: Create custom OptionT monad from cats for learning »
we are creating our own OptionT of cats for understanding, how monads are work and monads transformation flow. While creating our own custom monad get...
(3) odpowiedzi
2018-02-11 18:02 concat_ws removes null string from output in spark data frame »
This is the Output of my data frame val finaldf.show(false) +------------------+-------------------------+---------------------+---------------+---...
(1) odpowiedzi
2018-02-11 16:02 How to provide a JUnit4 "conformance" test suite for an interface »
I would like to provide a test suite for an interface in our library so that clients that implement the interface can easily test their implementation...
(2) odpowiedzi
2018-02-10 21:02 How to implement Functor[Dataset] »
I am struggling on how to create an instance of Functor[Dataset]... the problem is that when you map from A to B the Encoder[B] must be in the implici...
(1) odpowiedzi
2018-02-10 16:02 What is the meaning of the cons "::" operator right after the "new" key word in this code snippet? »
I'm studying Scala and see in a tutorial the following definition. There are 3 "::". My understanding is that the first "::" is a method in class List...
(1) odpowiedzi
2018-02-10 13:02 Scala and cats: Implicit conversion to identity monad »
I have a function that computes sum of squares for numeric types as shown below. import cats.syntax.functor._ import cats.syntax.applicative._ import...
(1) odpowiedzi
2018-02-10 10:02 Accessing that object's variables »
I am trying to write an object comparison script in scala. It just need to compare two object's variables of the same type class Student (name : Stri...
(3) odpowiedzi