Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 13 17:39
    codecov-io commented #699
  • Dec 13 15:20
    kiroco12 review_requested #699
  • Dec 13 15:16
    kiroco12 synchronize #699
  • Dec 13 15:16

    kiroco12 on enrique-update-server

    Optimized controllers (compare)

  • Dec 13 10:37
    kiroco12 synchronize #699
  • Dec 13 10:37

    kiroco12 on enrique-update-server

    Heroku rebuild (compare)

  • Dec 13 10:23
    codecov-io commented #699
  • Dec 13 10:23
    codecov-io commented #699
  • Dec 13 10:00
    kiroco12 review_requested #699
  • Dec 13 09:59
    kiroco12 synchronize #699
  • Dec 13 09:59

    kiroco12 on enrique-update-server

    Added code suggestions (compare)

  • Dec 12 13:15
    kiroco12 review_requested #699
  • Dec 12 11:51
    kiroco12 synchronize #699
  • Dec 12 11:51

    kiroco12 on enrique-update-server

    Updated sbt plugins and added c… Merge branch 'enrique-update-se… (compare)

  • Dec 10 08:44
    kiroco12 review_requested #699
  • Dec 04 20:52
    codecov-io commented #699
  • Dec 04 20:32
    juanpedromoreno synchronize #699
  • Dec 04 20:32

    juanpedromoreno on enrique-update-server

    Triggers Heroku (compare)

  • Dec 04 19:17
    codecov-io commented #699
  • Dec 04 18:51

    kiroco12 on enrique-update-server

    Fixed library discover (compare)

Tim Gautier
@timgautier
Why do the standard library exercises say that Maps and Sets can be of mixed types?
Min Shi
@minnieshi
Hi, I am at the 'semigroup' exercise. and I am not sure where i can find hint or answer. I am not sure below error is the site error or it is because my answer is just flatout wrong.
Evaluation failed : Compilation Error ; ERROR -> ')' expected but '}' found. at [292, 292, 292]
The 1st exercise example is "Semigroup[Int].combine(1, 2) should be()". and I tried '3' as my answer
Ivan
@Ssstlis
Did you complete the whole exercise? Mentionted by you exercise contains 4 examples, so you should complete all spaces.
Min Shi
@minnieshi
I did try to fill in the whole exercise (4 spaces), and then clicked the 'run' button.
it was like below
Semigroup[Int].combine(1, 2) should be( 3 ) Semigroup[List[Int]].combine(List(1, 2, 3), List(4, 5, 6)) should be( List(1,2,3,4,5,6 ) Semigroup[Option[Int]].combine(Option(1), Option(2)) should be( Some(3) ) Semigroup[Option[Int]].combine(Option(1), None) should be( Some(1) )
Ivan
@Ssstlis
Did you try write Option(3) instead of Some(3)? And your last aswer is wrong.
Aman Aggarwal
@donbox5_twitter
The online compilers seem down. The exercises-evaluation is throwing up error ( There was a problem evaluating your answer, please try again)
Min Shi
@minnieshi
@Ssstlis well..... the error is compilation error. it is not about my answer being wrong. Anyhow i tried to change the Some to Option and changed the last one to None, it is still the same error
Evaluation failed : Compilation Error ; ERROR -> ')' expected but '}' found. at [292, 292, 292]
Ivan
@Ssstlis
Sorry, my bad, your last answer is right.
@donbox5_twitter i don't think so, i try to compile somethings and it compete successfully.
@minnieshi you miss closing ) at the end of second answer, i guess =)
Min Shi
@minnieshi
Thanks a lot @Ssstlis . your answer helped. I did miss that.
luisdavidht
@luisdavidht
Hi ¿ Do you know why I get this error in the excercise? Evaluation failed : C
It seems like the excercise evaluation is not working
Ivan
@Ssstlis
Hi. Do you can attach a screenshot or paste your text? Also it will be more helpful if you say what exercise you try to pass.
M.AbuBakar Khan
@MAbuBak09617265_twitter
Hi today i am facing the problem in code the problrm is given below.
dalhouVA
@dalhouVA
why i can't click on button run?
ml10
@ml10
Verify that you’re logged in and also that you do not have any javascript blockers on the page.
nkatz01
@nkatz01

Hi, I think I found two eg of code that didn't seem right.
eg 1 (factorials): in line 7 of the code, on the site (tail recursion tab) the left hand side parameter to the function call iter, was just set to n (as opposed to n-1 and the field not editable. Solving the problem with this coed therefore seemed impossible.
eg 2: In line 6 of the code, the site (higher order functions tab - last exercise on the page) didn't want to recognize the variable b. Again, solving the code like this seemed impossible.
On the other hand, hen I put my solutions into an online compiler, they gave the right results:
def factorial(n: Int): Int = {

def iter(x: Int, result: Int): Int =
if (x == 0) result
else iter(x - 1, result * x)

iter(n-1, n)
}

factorial(3)
factorial(5)
eg 2
def sum(f: Int => Int, a: Int, b: Int): Int = {
def loop(x: Int, acc: Int): Int = {
if (x >= b) acc
else loop(x + 1, acc + f(x))
}
loop(a, b )
}

sum(x => x, 1, 10)

Also, I wondered if anyone could help me with the last exercise, val compareRationals: (Rational, Rational) => Int =, does it require me to implement a comparison between two rationals or is it just a class type parameterization issue?
please*
nkatz01
@nkatz01
Never mind, I solved it now :) It's the syntax more than anything that I didn't remember and by going back to where the function insertion sort was first declared, in the Standard Library tab, it clicked.
superbee66
@superbee66
Oooo... Reminds me of the good old days of IRC
Tobias Roland
@TobiasRoland
Hi! Question for https://www.scala-exercises.org/std_lib/higher_order_functions; I worry it is confusing to call one of the vals result1andhalf, when the functions are dealing with integers - this can be misinterpreted as result + a half or result / 2 - would it make sense to bump all the numbers instead, so we'd have result 1 through 6? Or maybe result1a/result1b?
JDLavelle28
@JDLavelle28
Answers for the getOrElse example please
JDLavelle28
@JDLavelle28
Got it no worries
KashpirRoman630501
@KomaRash
Hi,don't work run in exercises(
what to do?
Artsiom Miklushou
@mikla

Hi!

https://www.scala-exercises.org/fp_in_scala/functional_data_structures
I'm getting compilation error while trying to submit answers for the last section on the page:

mapViaFold(t)(_ % 2 == 0) shouldBe Branch(Branch(Leaf(false), Leaf(true)), Leaf(false))

Getting this:

Evaluation failed : Compilation Error ; ERROR -> missing parameter type for expanded function ((x$1) => fpinscalalib.FunctionalDataStructuresSection.treeFoldAssert(1, x$1, 0, 1, Branch(Branch(Leaf(false), Leaf(true)), Leaf(false)))) at [438, 438, 438]
ml10
@ml10
Hmm… that’s odd. the same answer works for me. Any chance one of the other inputs is wrong?
Artsiom Miklushou
@mikla
image.png
EgoAkkarin
@EgoAkkarin
Hi! I got a question to the Insertion Sort exercise (https://www.scala-exercises.org/scala_tutorial/standard_library the 1st exercise)
I'm quite sure that "cond" is supposed to check if x is smaller then y but i got no idea how to check that with unnamed(?) values. So how do i compare them?
Juan Manuel Méndez Rey
@vejeta

@EgoAkkarin you could use pattern matching for that. you might need to look at:
https://www.scala-exercises.org/std_lib/pattern_matching and
https://www.scala-exercises.org/std_lib/partial_functions
first.

Don't hesitate to ask again if you need help after doing those.

EgoAkkarin
@EgoAkkarin
Hi @vejeta thanks for your answer.
I did work threw both lesions you send me but I'm still no further with my problem on how to define the Boolean.
I'm actually so lost i don't even have a starting point on what should be written in there.
EgoAkkarin
@EgoAkkarin
i finally made it so no further help needed
Kishor M.N
@kishor2611
image.png
image.png
image.png
not able to run simple code as well. Getting below shown error.
ml10
@ml10
Try quotes around the string.
Ajinkya Borade
@steelx
Kishor M.N
@kishor2611
@ml10 Thanks It worked
eiduralfredsson
@eiduralfredsson
Does anyone know if I can clear all the answers from the Scala Tutorial? I started this ages ago and walked away and now my old answers are still there, but I'd like to start again.
laurenhuntersocial
@laurenhuntersocial
Section: Terms And Types, last exercise - I'm stuck with the "bar".take(2) shouldBe = N any help for solving N would be really appreciated
ml10
@ml10
what have you tried or guessed so far?
laurenhuntersocial
@laurenhuntersocial
@ml10 List(String) "b," "a" / List(“b”, “a”) / val list = List("b", "a") / b, a / "b", "a" / String = "b", "a" / val = "b", "a"
ml10
@ml10
How do your answers compare with the answer for "foo".drop(1) shouldBe “oo”?
laurenhuntersocial
@laurenhuntersocial
@ml10 got it, thx
ml10
@ml10
:thumbsup: