Skip to main content

All Questions

Tagged with
1 vote
0 answers
30 views

Evaluating an expression with shunting yard algorithm

I'm learning Scala and wrote a simple infix expression evaluator using the shunting yard algorithm. As opposed to the wikipedia example, this implementation evaluates the expression in place instead ...
TorbenPutkonen's user avatar
1 vote
0 answers
40 views

Relational join of two datasets

Front Matter I'm learning Scala and have not gotten used to functional programming and the language. I'm hoping a review of my naively implemented code can help me bridge my object-oriented ways to ...
Zhao Li's user avatar
  • 111
1 vote
2 answers
81 views

Extracting items from comma/semicolon-delimited strings, discarding parts after a hyphen

New Scala dev here. Is there a more idiomatic or efficient way to accomplish this in Scala? Given a list of the following strings, I need to obtain the unique 'main parts' once any parts including ...
Jonathan Spiller's user avatar
2 votes
2 answers
801 views

Scala app to transpose columns into rows

This is the first application or really any Scala I have every written. So far it functions as I would hope it would. I just found this community and would love some peer review of possible ...
GenericDisplayName's user avatar
-1 votes
1 answer
57 views

Perform KS-test on Random Number Generator [closed]

I've just started practicing Functional Programming in Scala in some days. This is the code I used to perform KS-test on a random number generator. ...
khanh's user avatar
  • 151
4 votes
1 answer
204 views

Find an ideal speed to cross all traffic lights when they are green

As a second exercise with Scala I tried to solve another puzzle. In this puzzle, we have to find the highest speed that allows a driver to cross all the traffic lights when they are green, without ...
Stud's user avatar
  • 786
2 votes
1 answer
162 views

Finding the nearest defibrillator exercise from CodingGames

For my first attempt at Scala I decided to solve a simple exercise on codingame.com. Based on a string input containing the user location, the defibrillators count and a list of defibrillators ...
Stud's user avatar
  • 786
2 votes
1 answer
4k views

Removing stop words from a Spark Dataframe

I am trying to apply a function to two Spark Dataframes (in Zeppelin): ...
schoon's user avatar
  • 131
5 votes
1 answer
264 views

Scala Docx generator from CSV input, using the docx4j library and Scala Swing

I am working on an application which takes as input a CSV file containing a list of attributes and a .docx template containing variable names equal to the columns ...
Claudius's user avatar
4 votes
2 answers
115 views

Find the minimum number of operations (concat, add and subtract) for the numbers 1-9 to equal 100

I am beginning to learn Scala and functional programming, and I came across this puzzle. This looked like good practice and I have a solution but just want some hints in terms of functional approach ...
Squiblebob's user avatar
3 votes
1 answer
1k views

Scala traits for arithmetic expressions

I am learning Scala and want to know, what is preferred style of writing a function for a trait. First: ...
zero_coding's user avatar
3 votes
1 answer
176 views

MarsRover in Scala

This is my first attempt at Scala programming. I tried to be functional but I'm not sure if I have achieved that. DataTypes.scala ...
leoOrion's user avatar
  • 387
3 votes
4 answers
211 views

Displaying nested arithmetic expressions as a string using Scala pattern matching

I am learning the concepts of pattern matching in Scala. Following is an exercise for the same. The task is to define a show function that outputs an expression as ...
shaktimaan's user avatar
14 votes
1 answer
448 views

All RGB colors in one image

This is a program to solve: Images with all Colors from Code Golf: Make images where each pixel is a unique color (no color is used twice and no color is missing). Create the image purely ...
Utku Demir's user avatar
1 vote
1 answer
276 views

Triangle numbers finder in Scala

I'm new to Scala and learn it by solving some Project Euler problems. Here is the solution to problem 42 from Project Euler. The task is to read words from file, then sum ordinal numbers of each ...
Dmitry Zinkevich's user avatar

15 30 50 per page