Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged scala

0 votes
474 views
1 answer
    I'm trying to define some structure like this case class Transformer[From, To]( name: String, get: PaymentEvent => From, to: From => To I want ... ],shapeless.HNil]]] fields.flatMap(new filterName(names)) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
341 views
1 answer
    class TestClass[T](val x: T) { def +(other: TestClass[T]) = x + other.x } this definition gives me the following compile error: error: type ... Double as a type parameter and use addition in Scala?? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
456 views
1 answer
    I'm trying to remove the scrollbars in a javafx webview. Search on forums, the suggestion is to make them invisible as follows: browser.getChildrenUnmodifiable( ... is surrounded in Scala code. Thanks! S See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
611 views
1 answer
    Presenting here before possibly filing a bug. I'm using Spark 1.6.0. This is a simplified version of the problem I'm dealing with. I've filtered a ... bug, or is this expected behaviour? If expected, why? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
345 views
1 answer
    I want to create a hashmap to store parameters names and their values. The parameters however are with different types. I could use HashMap[String, Any], but ... Or is there any better way to store pair? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
370 views
1 answer
    I am trying a write a file to hdfs using scala and I keep getting the following error Caused by: org.apache.hadoop.ipc.RemoteException: Server IPC version 9 ... What change should I do to make this work? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
516 views
1 answer
    I have a SBT build where the tests create temporary files into a directory called temp. How can I tell SBT to delete this folder when I call the clean task? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
341 views
1 answer
    Why can't i define a variable recursively in a code block? scala> { | val test: Stream[Int] = 1 #:: test | } <console>:9: error: forward ... a code block but throws a compilation error in a code block. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
703 views
1 answer
    Is there a way to reference Spark DataFrame columns by position using an integer? Analogous Pandas DataFrame operation: df.iloc[:0] # Give me all the rows at column position 0 See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
284 views
1 answer
    I get different behaviour in 2.9.1 and 2.10 nightly -- what changed? Welcome to Scala version 2.9.1.final (OpenJDK Client VM, Java 1.6.0_22). Type in ... Some(3) map (x => List(x, -x)) flatten See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
725 views
1 answer
    As part of sbt-assembly I want to include both src and test class files in jar. Sbt-assembly includes only src files with dependencies. Is there any way ... I can include test classes also in same jar? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
562 views
1 answer
    E.g. i want to compose stream of 1, 2, 3 and 4, 5 in single one, so result should be: 1, 2, 3, 4, 5. In other words: if ... that Also did similar attempt with datetime included, but with same result. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
440 views
1 answer
    I'd like to use val ratings = data.map(_.split(',') match { case Array(user,item,rate) => Rating(user.toInt,item.toInt,rate.toFloat) }) val model ... may produce error. How can i do to solve the problem? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
422 views
1 answer
    Is it possible to use Option[_] member in a case class used with Dataset API? eg. Option[Int] I tried to find an example but could not find any ... I moved the case class outside of the Main function. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
456 views
1 answer
    Why can I write val flat: List[Int] = List(Some(1), Some(2)).flatMap(i => i) But not val flat: List[Int] = List(Some(1), Some(2)).flatMap(_) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
384 views
1 answer
    RDD has a very useful method aggregate that allows to accumulate with some zero value and combine that across partitions. Is there any way to do that with ... capable of doing the same? Thanks a lot! VK See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
306 views
1 answer
    We have a project with several subprojects which can compile under both Scala 2.10 and 2.11, one subproject which only compiles under 2.10 ( ... the aggregate project and still avoid this problem? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
373 views
1 answer
    We're trying to submit a spark job (spark 2.0, hadoop 2.7.2) but for some reason we're receiving a rather cryptic NPE in EMR. Everything runs just ... Also, how can we resolve it? We're pretty stumped. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
334 views
1 answer
    I built random forest models using ml.classification.RandomForestClassifier. I am trying to extract the predict probabilities from the models but I only saw ... share your thought or solutions. Thanks! See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
396 views
1 answer
    I have List[Double], how to convert it to org.apache.spark.sql.Column. I am trying to insert it as a column using .withColumn() to existing DataFrame. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
320 views
1 answer
    I have experienced a problem with SBT loading in a local CSV file. Basically, I've written a Spark program in Scala Eclipse which reads the ... not (despite working under home/projects directory). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
480 views
1 answer
    When I run code like: setUp( scenario1.inject(constantUsersPerSec(1) during (1 second)), scenario2.inject(constantUsersPerSec(1) during (1 second)) ).protocol() ... to be changed to run it one by one? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
553 views
1 answer
    To have a database available in scalatest with evolutions I use this extension of the default PlaySpec inspired by this SO question: trait ResetDbSpec extends PlaySpec with ... Play 2.5.10 and Slick 3.1. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
432 views
1 answer
    Is there a way to overload methods in Scala that take multiple parameter lists? E.g. I'd like to do this: def foo(a: Int)(b: Int)(c: ... parameter might be considered optional in some cases, for example. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
673 views
1 answer
    I am trying to read Parquet files without using Apache Spark and I am able to do it but I am finding it hard to read specific columns. I am not ... columns from the file. I want to read specific columns. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
469 views
1 answer
    I'm creating a series of webservices for my application and i have the need to access a different database based on the serviceCode that is passed as a ... or am i forced to add a resource everytime? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
292 views
1 answer
    I have been reading about Dotty, since it looks like it is about to become scala 3, and noticed that type projections are deemed "unsound" and removed ... so that we can cache the result in container } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
403 views
1 answer
    Downloaded play-2.0 from type safe yesterday, following instructions as far as I can, but when I come to build with sbt I get unresolved dependency ... appreciate any guidance on where to look... Thanks See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
...