Data dodania Pytanie
2017-05-28 01:05 Scala: get list with the first element of three lists not repeating any element »
I have a scala List[List[Person]] with the following elements: Person(Antonio) Person(Maria) Person(Joao) Person(Antonio) Person(Susana) Person(Laur...
(2) odpowiedzi
2017-05-28 00:05 Spark RDD default number of partitions »
Version: Spark 1.6.2, Scala 2.10 I am executing below commands In the spark-shell. I am trying to see the number of partitions that Spark is creating...
(1) odpowiedzi
2017-05-27 17:05 How to use Tagged Type in Play routes file with Pathbindable »
For a service that handle a lot of ided entities, I'm trying to have some strong typing. To achieve this I'm using a technique based on phantom types/...
(0) odpowiedzi
2017-05-27 13:05 Scala, play - cannot insert into Postgresql database »
I have a simple scala and play code for inserting product into database. My database config in application.conf looks like: db.default.hikaricp.conn...
(2) odpowiedzi
2017-05-27 03:05 Scala: Get element of a list with with two restrictions »
I have a list of type Example with the following elements: Example("One", "1", null) Example("Two", "1", null) Example("Three", "2", someObject) Exam...
(2) odpowiedzi
2017-05-27 01:05 scala: error: recursive value needs type »
I'm trying to write a short snippet of scala code to understand parenthesesless method and postfixOps. Here is my code: import scala.language.postfix...
(2) odpowiedzi
2017-05-26 16:05 why is scala method serialisable while function not? »
I have a spark RDD defined like this: val dataset = CreateRDD(data.filter(someFilter)) I observed the following: //if filter is defined as functio...
(1) odpowiedzi
2017-05-26 15:05 reverse using foldLeft in scala »
def foldLeft[A, B] (as: List[A], z: B) (f: (B, A) => B) : B = as match { case Nil => z case Cons(x, xs) => foldLeft(xs, f(z, x))(f) } de...
(2) odpowiedzi
2017-05-26 11:05 scala - What Map[(A, B)] mean? »
I'm reading the Scala Map doc, and got confused by this method signature def zipAll[B](that: collection.Iterable[B], thisElem: A, thatElem: B): Map[...
(1) odpowiedzi
2017-05-26 09:05 Why future has side effects? »
I am reading the book FPiS and on the page 107 the author says: We should note that Future doesn’t have a purely functional interface. This i...
(3) odpowiedzi
2017-05-25 23:05 Using berkeley hardfloat »
I am using Chisel3 in my project. I tried to import hard float library as folow: import chisel3._ import hardfloat._ but unfortunately, I am getti...
(1) odpowiedzi
2017-05-25 21:05 Scala Script: Explain this class cast error to ScalaClassLoader on Windows »
Consider following scala script: import scala.reflect.internal.util.ScalaClassLoader object Test { def main(args: Array[String]) { val classlo...
(1) odpowiedzi
2017-05-25 18:05 Scala way of merging tuples in a list using functional programming techniques »
Say I have: val list: List[(Long, Boolean)] = List((0, false), (0, true), (1, true), (1, true)) and in the end I want: List((0, false), (1, true))...
(2) odpowiedzi
2017-05-24 15:05 Shapeless : Checking of the Type Constraints of Polymorphic Functions (lifted types) »
I am writing an internal DSL, and am using Shapeless to enforce type safety. However, I have got stuck with an issue. The simplified version of the p...
(1) odpowiedzi
2017-05-24 11:05 Scala order implicit conversions? »
I have some problem in scala order implicit, can someone help me? Below are some classes definition, and what I want to do is to compare Leaf and Nod...
(2) odpowiedzi
2017-05-24 05:05 Scopes in Chisel and scala »
I am new to chisel and I have designed basic circuits and a simple risc-v processor with it but I still can't figure out how the scope works in Scala/...
(1) odpowiedzi
2017-05-24 02:05 Why can I concatenate String and Int in Scala? »
I'm trying out some things in Scala, coming from Python. Since Scala is a lot more strict about keeping types consistent, I was surprised to find out ...
(3) odpowiedzi
2017-05-23 10:05 Why class <:<[-From, +To] needs to extends (From => To) in scala standard library? »
i am looking into scala's type level programming and have got some knowledge about it.But i have no idea why class <:< needs to extend from (Fro...
(1) odpowiedzi
2017-05-23 07:05 What is the meaning for reduceByKey(_ ++ _) »
Recently I had scenario to store the the data in keyValue Pair and came across a function reduceByKey(_ ++ _) . This is more of shorthand syntax. I am...
(2) odpowiedzi
2017-05-23 06:05 IntelliJ Scala Case Class Indentation »
This question may have been asked, but I could not find a suitable answer, so I'm posting this as a question here. The problem is that when I create a...
(1) odpowiedzi
2017-05-22 23:05 Scala multi-level pattern matching »
I'm stuck with multi-level pattern matching, in the code below I want to match one particular case which is checked at several levels "cfe is Assignme...
(3) odpowiedzi
2017-05-22 21:05 scalap and javap showing different method signature »
I am facing very weird issue, i am having a maven dependency in my project <dependency> <groupId>org.apache.spark</groupId> &lt...
(0) odpowiedzi
2017-05-22 02:05 how to use scala on netbeans (Windows) »
I am a beginner in scala, I just installed it, but after installation I couldn't use it on netbeans, despite I have already integrated and I didn't fi...
(1) odpowiedzi
2017-05-21 20:05 spark whole textiles - many small files »
I want to ingest many small text files via spark to parquet. Currently, I use wholeTextFiles and perform some parsing additionally. To be more precis...
(1) odpowiedzi
2017-05-21 10:05 Spark error when accessing an empty or null array »
I have a JSON file with this type of schema: { "name" : "john doe", "phone-numbers" : { "home": ["1111", "222"], "country" : "England" } }...
(2) odpowiedzi
2017-05-21 01:05 Unbounded table is spark structured streaming »
I'm starting to learn Spark and am having a difficult time understanding the rationality behind Structured Streaming in Spark. Structured streaming tr...
(1) odpowiedzi
2017-05-20 23:05 Scala recursive type and type constructor implementation »
I have a situation where I need a method that can take in types: Array[Int] Array[Array[Int]] Array[Array[Array[Int]]] Array[Array[Array[Array[Int]]]...
(2) odpowiedzi
2017-05-20 14:05 How to transform Dataset[(String, Seq[String])] to Dataset[(String, String)]? »
Probably this's simple problem, but I begin my adventure with spark. Problem: I'd like to get following structure (Expected result) in spark. Now I ...
(4) odpowiedzi
2017-05-20 14:05 How to remove all tag from xml file using java/Scala? »
I have xml content as <p/> <p>Highlighted Applications</p> <p/> <table> <tbody> <tr> <td> <p&...
(3) odpowiedzi
2017-05-19 18:05 Problems with afterAll() in ScalaTest in case of Future usage »
At the end of my ScalaTest suite I need to do some DB clean up. The cleanup itself is a Future. The suite does not call the super.afterAll() which lea...
(2) odpowiedzi
2017-05-19 12:05 How to convert RDD[Row] to RDD[String] »
I have a DataFrame called source, a table from mysql val source = sqlContext.read.jdbc(jdbcUrl, "source", connectionProperties) I have converted it...
(2) odpowiedzi
2017-05-19 10:05 Scala convert IndexedSeq[AnyVal] to Array[Int] »
I'm trying to solve Codility's GenomicRangeQuery using Scala and to that end I wrote the following function: def solution(s: String, p: Array[Int], q...
(3) odpowiedzi
2017-05-18 22:05 Use circe to preprocess dot-notation style fields »
I have some json that includes some fields that are being flattened into a bson-ish format as in {"foo.bar" : "bash"}. I'd like to transform this to t...
(1) odpowiedzi
2017-05-18 21:05 Stateful computations in Scala using monads »
I've been trying to learn functional programming in Scala, and I finally managed to understand how to use the for comprehension to work with state: #...
(1) odpowiedzi
2017-05-18 09:05 Why does Spark Streaming application work fine using sbt run but does not on Tomcat (as web application)? »
I have a Spark application in Scala which grabs records from Kafka every 10 seconds and saves them as files. This is SBT project and I run my app with...
(1) odpowiedzi