Data dodania Pytanie
2017-11-29 08:11 Multiple assignment using Array but with an optional element »
I have a source file like this: replace 1 3 xyz reverse 0 2 print 1 4 And I would like to assign these elements line by line using Array: val Arra...
(2) odpowiedzi
2017-11-28 22:11 Functional programming idiom for applying a series of void functions to a single value »
Given a value foo and a Stream of Consumer<Foo> void functions, what's the most concise way to apply each function to the value? Right now I hav...
(2) odpowiedzi
2017-11-28 18:11 Extending a Function1 in Scala »
In few examples, I have seen that an object or a class extends Function1. E.g. object Cash extends (CashProduct => String) in Hidden features of ...
(2) odpowiedzi
2017-11-28 13:11 List of case classes doesn't match T <: Serializable »
Given a type definition T <: Serializable, why doesn't this match everything that is serializable, including a List of serializable instances? I.e...
(1) odpowiedzi
2017-11-28 13:11 How to compute the sum of orders over a 12 months period sliding by 1 month per customer in Spark(scala) »
I am relatively new to spark with Scala. currently I am trying to aggregate order data in spark over a 12 months period that slides monthly. Below i...
(1) odpowiedzi
2017-11-27 20:11 Multi-Value Assignment Behavior in Scala »
When Scala evaluates the following multiple value assignment: val a, b, c = UUID.randomUUID() I expected a == b && b == c && c == a...
(1) odpowiedzi
2017-11-27 20:11 Writing RDD Data to CSV with Dynamic Columns in Spark - Scala »
I am reading multiple files from an HDFS directory, and for each file the generated data is printed using: frequencies.foreach(x => println(x._1 +...
(2) odpowiedzi
2017-11-27 16:11 SBT - ignore compile errors (in tests)? »
in my current SBT project test:compile reports all errors, but does not generate class files for the valid and unrelated tests. It would be useful t...
(0) odpowiedzi
2017-11-26 13:11 How to create a Source from Future[Iterator]? »
I have a Future[Iterator]. I want to feed this iterator to my Stream. Here, I still want to construct a Source from the Iterator like we do using Sour...
(2) odpowiedzi
2017-11-26 09:11 Runtime cost of implicit definitions in Scala's typeclass pattern »
I am looking at this article, on how Typeclasses are simulated in Scala using implicits. If I am not wrong, a new instance is constructed on runtime ...
(1) odpowiedzi
2017-11-26 01:11 How to split RDD for better performance? »
I have built a Spark RDD where each element of this RDD is a JAXB Root Element representing a hierarchical XML Record. I want to split this RDD so as...
(2) odpowiedzi
2017-11-25 21:11 Insert records in batch Slick »
I want to insert more than 10 rows of data into the Task table, so I have created a list of these records. Except for my table, I have a repository wi...
(1) odpowiedzi
2017-11-25 17:11 functional parallelism and laziness in Scala »
Background I have been reading the book Functional Programming in Scala, and have some questions regarding the content in Chapter 7: Purely functiona...
(1) odpowiedzi
2017-11-25 12:11 how to disclude development.conf from docker image creation of play framework application artifact »
Using scala playframework 2.5, I build the app into a jar using sbt plugin PlayScala, And then build and pushes a docker image out of it using sbt p...
(3) odpowiedzi
2017-11-25 01:11 How to submit Spark jobs generated at runtime? »
So for my use case I need to create and submit Spark streaming jobs at runtime. Having done some googling, I don't think that there's a simple way of ...
(2) odpowiedzi
2017-11-24 19:11 What is the use of FastFuture in akka »
What is the use of Fastfuture in akka, not clear from the documentation: Provides alternative implementations of the basic transformation operatio...
(1) odpowiedzi
2017-11-24 08:11 Spark Map task getting stuck due to (?) really big GC times (logs inside), where to go from here? »
I'm doing a project based on http://learningfrombigdata.com/semantic-similarity-between-sentences-using-apache-spark/ with some slight modifications t...
(0) odpowiedzi
2017-11-24 08:11 Higher degrees of higher kinded types? »
I just recently learned about higher kinded types, but every example I was presented with only used a degree-2 kind (* -> *) -> *, like Functor....
(2) odpowiedzi
2017-11-23 11:11 How to get creation date of a file using Scala »
One of the requirements in my project needs to check if the file's creation date and determine if it is older than 2 days from current day. In Java, t...
(1) odpowiedzi
2017-11-23 00:11 Can I map over a list and expand it at the same time in Scala? »
I have a list of Tuple-2 like this: val stuff = List( ("!thing","value"), ("otherthing","value") ) I want to pass over this list and create objects...
(3) odpowiedzi
2017-11-23 00:11 Adding a new column to a Dataframe by using the values of multiple other columns in the dataframe - spark/scala »
I am new to spark SQL and Dataframes. I have a Dataframe to which I should be adding a new column based on the values of other columns. I have a Neste...
(1) odpowiedzi
2017-11-22 21:11 Strange Error With Scala Generics Implementation »
I have the following trait: trait SomeTrait { def doSomething[V](msg: Message[V]): Message[V] } The Message[V] is a case class as below: case cl...
(2) odpowiedzi
2017-11-22 16:11 How to extract particular element from the column for each row? »
I have the following DataFrame in Spark 2.2.0 and Scala 2.11.8. +----------+-------------------------------+ |item | other_items ...
(1) odpowiedzi
2017-11-22 12:11 forEach loop on array with fat arrow »
I would like to print an array line by line with carriage return. Simple implementation is [1,2,3].forEach(function(x) {console.log(x)}) to get this ...
(2) odpowiedzi
2017-11-21 20:11 Test two scala shapeless HList types for equivalence via implicit »
I'm interested in testing whether two HList heterogeneous records are "equivalent"; that is, they have the same key/val pairs, but not necessarily in ...
(2) odpowiedzi
2017-11-21 18:11 How to explode StructType to rows from json dataframe in Spark rather than to columns »
I read a nested json with this schema : root |-- company: struct (nullable = true) | |-- 0: string (nullable = true) | |-- 1: string (nulla...
(1) odpowiedzi
2017-11-21 18:11 For comprehensions Future and Either »
I am struggling in how to compose a sequence of asynchronous processes in a nice monadic way. Each step of the process could fail so it is retrieving ...
(1) odpowiedzi
2017-11-20 16:11 Bootstrapping data into webpack bundled javascript from html »
I've recently converted a React app from a globals-everywhere script-tag-per-js-file setup into a bundled webpack app (great!). However, in the app ...
(1) odpowiedzi
2017-11-20 13:11 How to match, but not consume, a path prefix in Akka HTTP? »
my Akka HTTP application reverse-proxies some requests to an internal HTTP system: pathPrefix("/api/") { (path("some-upload-endpoint") & post) ...
(1) odpowiedzi
2017-11-20 01:11 No var or breakable: How to "break" when a predicate is met, in an array traversal? »
How would I write this programming logic into a functional method signature? I am attempting to loop/traverse an array until a condition is met, then ...
(2) odpowiedzi
2017-11-20 00:11 Scala why flatMap treats (x => x) different than (identity) »
First, map treats x => x identical than identity List(1,2,3).map(x => x) //res0: List[Int] = List(1, 2, 3) List(1,2,3).map(identity) //res1: ...
(2) odpowiedzi
2017-11-19 19:11 Is there something infeasible about statically-typing actor models of interprocess communication? »
So I only recently encountered akka outside of a toy capacity, and I can't help notice that it and OTP share dynamic typing despite scala's general pr...
(1) odpowiedzi
2017-11-19 19:11 How to use Java lambdas in Scala »
I have the following code: source .mapValues(value -> value + " Stream it!!!") .print(Printed.toSysOut()); as you can see, mapValues exp...
(2) odpowiedzi
2017-11-19 18:11 Scala compiler does not infer type properly »
I am reading Chapter 6 of Functional Programming in Scala. I've approached the last exercise of the Chapter (i.e.: 6.11) and it makes me doubtful abou...
(1) odpowiedzi
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