Most voted "scala" questions
Scala (Scalable language) is a general-purpose, multiparadigma programming language designed to express common programming patterns in a concise, elegant, and type-safe way.
Learn more…29 questions
Sort by count of
-
17
votes1
answer632
viewsWhat are the main differences between Kotlin and Scala?
It is already clear differences between Kotlin and Java, such as: More concise (up to 40% code reduction) Null Safety Type inference Data class Interoperable with Java However, all these features…
-
13
votes2
answers1533
viewsMaterial for the study of functional languages: scala, Haskell and Erlang
Well, I asked a question recently and it was suspended because it is a matter of opinion of each person, so here I repeat my question to be more clear what I want: Could someone please pass me…
-
10
votes1
answer292
viewsScala memory leak and processes (memory Leak)
I have a fairly complex system in Scala, with multiple threads and simultaneous system calls. This system is having some problem, because busy memory grows over time. The image below shows the…
-
6
votes1
answer441
viewsWhat is the difference between Kotlin data class and Scala case class?
In Scala we have case classes, for example: case class Pessoa(nome: String, sobrenome: String) and in Kotlin we have data classes: data class Pessoa( val nome: String, val sobrenome: String ) What’s…
-
5
votes1
answer411
viewsWhat is the Scala Collection equivalent to Concurrenthashmap?
Hello, how can I implement a Concurrenthashmap in Scala?
-
5
votes1
answer88
viewsHow to make atomic updates with Triemap and Concurrenthashmap?
In Java ConcurrentHashMap has an interesting property. Operations such as putIfAbsent, remove, replace, computeIfAbsent, computeIfPresent, compute and merge are atomic. Example: final Map<String,…
-
4
votes1
answer107
viewsStopping a router when your child router ends
I have a Ator that would be the Root and this actor Root has a router with 5 instances, and this same router also has a router with 5 instances. How can I stop ArquivoParaProcessar and warn the Root…
-
3
votes1
answer465
viewsHow to use java.String.format in Scala?
I’m trying to use the method .format string. But if I put %1, %2, etc. in the string, the java.util exception.Unknownformatconversionexception is released, pointing to a confusing Java code: private…
-
3
votes2
answers87
viewsHow to extract json from a jsonp in a Scala string
I’m using Scala and I have an http response like this: _SS_MainSolrCallbackH( { response: { numFound: 1, start: 0, maxScore: 4.9338827, docs: [ { tipo: "M", id: "mus1933196",a s: 4.9338827, u:…
-
3
votes2
answers64
viewsHow to iterate over a huge amount of records with scala sorm
I want to iterate over a lot of records from a table with sorm, but I want to do it in a memory efficient way. Today I use this code: Db.query[Items].whereEqual("title", someTitle).fetch.foreach {…
-
3
votes1
answer17224
viewsPKIX path building failed: sun.security.Provider.certpath.Suncertpathbuilderexception: Unable to find Valid Certification path to requested target url
Hello, I’m trying to compile my project using the sbt, but causes an SSL error: Server access Error: sun.security.validator.ValidatorException: PKIX path building failed:…
-
3
votes1
answer304
viewsDifferences between Java and Scala
What are the main differences between Java and Scala? Both have these similarities: Both are object oriented Both compile to bytecode and run in the JVM They both have Amble (Java 8)…
-
3
votes0
answers69
viewsSparkstreaming Consumer Kafka
I’m doing a test with sparkstreaming consuming from a Kafka topic. When start the job it presents the following message: 18/06/06 20:39:25 ERROR ReceiverTracker: Deregistered receiver for stream 0:…
-
2
votes0
answers147
viewsSend local files to Google Cloud Storage in Scala
How do I upload a local file to Google Cloud Storage using the Scala language? This file needs to be publicly accessible for download. Post in English…
-
2
votes1
answer50
viewsIntellij 14 and Scala Plugin. Error when locating standard methods
I upgraded my Intellij IDEA to version 14 and now it is no longer recognizing some methods within my Scala program. The IDE can’t even find the simplest of methods: println("Hello world") What to…
-
2
votes1
answer78
viewsWhat is the Substitution Model in Scala - Replacement Model
Substitution Model - Replacement Model What is the concept behind? How It Works? What it affects the way we program in Scala
-
2
votes1
answer122
viewsCorrect form of Scala NULL checking in Java
First of all, I want to say that I’m a total layman in Scala. I know almost nothing but the basics of language. Knowing this, let’s go to my question. I am in a project where there are libraries…
-
2
votes1
answer51
viewsHow to add dependencies in build.sbt so that they are available in modules?
I am starting to use SBT for scala projects and would like to create a project like: APP ...Module1 ...Module2 ...Module3 ... build.sbt would like to know how to build.sbt dependencies so that they…
-
2
votes0
answers22
viewsHow to use AWS Glue to obtain 'batch' data in semi-structured BD?
Is it possible to use AWS Glue to retrieve data incrementally in a semi-structured SQL database? The data on-premise that I intend to export to the AWS cloud are in a single table, with primary key,…
-
1
votes1
answer68
viewsError when running Scalatra test on Intellij
I’m trying to run the following test of scalatra within the intellij: class Test extends ScalatraFlatSpec with Matchers { addServlet(classOf[MainServlet], "/*") "Home Page" should "show hello" in {…
-
1
votes1
answer44
viewsscala-plicking used in common classes
I’m trying to use scala-pickling because the site on github makes it look like it’s a very simple tool to use. The fact is that I’m not able to make the simple following work (in REPL): scala>…
scalaasked 9 years, 3 months ago Hélio Moura 11 -
1
votes1
answer74
viewsWhat’s the difference in defining a variable using "val" only and one using "Lazy"?
I am studying Scala and I found some codes where several variables are defined with the syntax "Lazy". Even reading some materials in English, I could not reach a clear definition. What’s the…
scalaasked 5 years, 7 months ago Fernando Delago 11 -
1
votes0
answers32
viewsHow to deal with Scala x Java classcasting
I’m having a problem working with heritage between Scala and Java. To contextualize, follow an example that reflects my problem. Java Class public class Animal { } Java Class public class Cat…
-
1
votes0
answers19
viewsHow does "while / do" work in Scala 3?
Reading the changes planned for Scala 3, I discovered that the do-while was discontinued. I understand that a loop do-while can always be rewritten as a while. That said, the article examples with a…
-
0
votes1
answer51
viewsNosuchelementexception: None.get em play framework para scala
I created the upadte method, but when I test it shows the error Nosuchelementexception: None.get UserController object UserController extends Controller { def update(id:Long) = DBAction { implicit…
-
0
votes2
answers68
viewsHow to remove square parentheses from a scala array
I have an array of dates [2014-11-08 06:27:00.0], and would like to remove the square brackets 2014-11-08 06:27:00.0. val conf = new SparkConf(true) .set("spark.cassandra.connection.host",…
-
0
votes1
answer34
viewsWhat does the Object clause define in Scala?
Studying some projects, I found an intriguing code, where in addition to the clause class that defines an object, already known from Java, there is the clause object, unknown to me until then.…
scalaasked 7 years, 8 months ago Murillo Goulart 3,391 -
0
votes1
answer115
viewsRead multiple variables in the same line (Scala)
I need to read three variables in the same line in Scala, I read an answer in English but the method did not work, "readline" and "toInt" are not recognized. Follow my code. If anyone knows a way…
-
0
votes0
answers16
viewsGatling/Scala: Returns error in Jsonpath - Extraction Crashed: end of input expected
Hello! I’m new to Gatling/Scala and the scenario is as follows: I need to make a request in an API and use the Response data in a new call, which is the load itself. However, Gatling returns the…