Skip to main content

Questions tagged [scala]

Scala is a general purpose programming language principally targeting the Java Virtual Machine. Designed to express common programming patterns in a concise, elegant, and type-safe way, it fuses both imperative and functional programming styles.

Filter by
Sorted by
Tagged with
0 votes
0 answers
88 views

I am working on a project where I need to transfer thousands of files (each sized between 50-60 MB) every hour from an SFTP server to local storage or AWS S3. I am using Apache Spark 3.5 with Scala 2....
Abhishek 's user avatar
0 votes
1 answer
253 views

I have a web applications (angular) which is connected to backend using websockets. The role of web app is to display data from multiple sources (which are updated constantly by some Scala Spark apps) ...
AlleXyS's user avatar
  • 117
0 votes
2 answers
1k views

I've been trying to refactor some existing code which is in essence a giant nested procedural call inside what should otherwise be an object oriented architecture. The entry point to the relevant code ...
User's user avatar
  • 23
-2 votes
1 answer
693 views

I develop a web application in Angular (frontend) and Scala (backend) for a big data team. Because they use large files for export/import, I build a module which is a copy of Microsoft Excel. So, what ...
AlleXyS's user avatar
  • 117
1 vote
1 answer
230 views

Often, when programming, you'll have different degrees of information to you in different contexts. For example, a web server may have two routes, which recieve information about a Person, one of ...
Joe's user avatar
  • 174
1 vote
1 answer
212 views

I'm making a chat server using sockets and a MySQL database, and after it's working I want to expand it to become a more complex game server. I want to know whether my design is missing anything. ...
Gimme the 411's user avatar
0 votes
1 answer
358 views

I implememted two versions of the collatz problem and felt an icy terror in the pit of my stomach as an optimized solution was slower than tail. The tail recursion is simple: // calculate the next ...
IcedDante's user avatar
  • 157
0 votes
2 answers
2k views

Not sure if this is an appropriate question for here, please let me know! In Scala, the ever so useful Option class has an apply method in its companion object that allows us to quickly wrap any ...
Derek Plautz's user avatar
2 votes
1 answer
143 views

In Scala, sometimes class extends a trait to provide some methods to extending class inside. ScalaTest import org.scalatest._ class ExampleSpec extends FlatSpec with Matchers { ... Matchers trait ...
bigwheel's user avatar
-1 votes
1 answer
551 views

I have some values and methods to define in a scala object. I do not know in which order I should define them. Is there a "good way" to do it? Such as private methods first then public methods? Only ...
BlueSheepToken's user avatar
1 vote
2 answers
158 views

Suppose we need an iterative algorithm for mathematical optimisation. Each iteration takes a long and random time. After each iteration, a stopping condition is checked for the iterate x, based on ...
schrödingcöder's user avatar
12 votes
2 answers
5k views

From what I can tell from Scala and Hack- Mixins: Can have state (ie. instance properties) Can only provide concrete methods Can have constructors, that are called in the same order that their ...
bcherny's user avatar
  • 273
1 vote
1 answer
316 views

I am a beginner to the event-driven data architecture using Kafka / Kinesis as the centrepiece (currently Kinesis) and I have some questions regarding how to build a WebSocket API on such a structure. ...
Julian Wilson's user avatar
1 vote
1 answer
77 views

Project 1: a Java/Maven project Project 2: a Scala/sbt project Thing: generally, an immutable object instantiated in from 3rd party Java library. For example, ThingBuilder.foo("bar").build() ...
Pete's user avatar
  • 736
5 votes
1 answer
896 views

I'm working on a Scala project and Wartremover shows an error about Option#get usage in my code: Option#get is disabled - use Option#fold instead While I do understand how get should often be avoided,...
Cedric Reichenbach's user avatar
1 vote
1 answer
1k views

I have the following pure function (f2 and f3 are pure too): class X { def f1(arg: Type1): Type2 = { val x = f2(arg) val y = f3(x) y } def f2... def f3... } Now, I would like ...
Ram's user avatar
  • 129
0 votes
1 answer
194 views

I have some Scala code that I wish to unit test using ScalaMock: class CancellationManagerSpec extends FlatSpec with MockFactory { "Cancelling a shipment" should "check shipment is not already ...
Robo's user avatar
  • 109
0 votes
1 answer
146 views

I've decided to implement a database wrapper to provide data operations of a web service using postgresql dbms. Models in my database are somelike complex and frameworks like slick do provide more ...
Evhz's user avatar
  • 152
3 votes
2 answers
939 views

I have a one-way large ETL pipeline in Scala where I start with protobuf schema A and end up with protobuf schema B. I want to create a many-to-many mapping between the fields of schema A and schema B,...
Conor's user avatar
  • 109
0 votes
1 answer
891 views

Thanks Maven archetypes the barrier to start developing of services for new RESTful APIs is very straightforward - you can get more or less a project template and start filling in your code. Now as I ...
J. Doe's user avatar
  • 185
1 vote
2 answers
73 views

I have a Playframework application written in Scala. As you might expect, it's primary function is to respond to user requests. Typical request flow: Parse input and figure out what the user wants ...
FullTimeCoderPartTimeSysAdmin's user avatar
3 votes
2 answers
255 views

In functional programming languages, such as Scala, data types and structures, are really important. I am in two minds about the use of type-defs in helping with the readability of the code ...
Maths noob's user avatar
3 votes
1 answer
1k views

I wonder whether a method in a functional programming language should receive all variables from the argument list, or whether it is ok to use variables from the outer scope? But let me explain the ...
Raphael Roth's user avatar
2 votes
1 answer
165 views

If the supervisor and its child actors are sharing the same messages, which is the right place to keep those case classes? Should it be in both Supervisor and the individual actors or should it be in ...
codingsplash's user avatar
4 votes
2 answers
3k views

I have been having quite a time getting this to work reliably for 100s of thousands of terms and potentially millions of pages per source and ETL the resulting data into a database in an automated ...
user3916597's user avatar

1
2 3 4 5