Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
For example, if you call
toArray()
on the matrixyou get
[["1", "2", "3"], ["4", "5", "6"]]
.Fixed the issues.
This comment is hidden because it contains spoiler information about the solution
And what should I do? :)
Hi,
Thank you for the feedback.
I already have random tests for the 5th section (matrix-matrix multiplication). Do you want me to add random tests to other sections as well? (The reason I didn't do it originally is because I didn't want to write the solution in the Test Cases, preventing some hackerage which gives you access to the methods in the test class. If you think I shouldn't fear that, I'll add them
The reason I don't use
assertArrayEquals
is because (as far as I know) it compares the elements usingassertEquals(expected, actual)
, but that is inappropriate for comparing floating-point values, because of the limited precision of course, so I had to write my own method which usesassertEquals(expected, actual, delta)
. If you have any suggestions on that, please let meknow.
As Unnamed pointed out, it really is pretty much just an
(E[][])
typecast when creating the new array. The point of this kata is to have matrices to be used like tables for data storage, so you really want to make it generic.Resolved
Yes, I have experienced the same just now, it's because of an ArrayIndexOutOfBoundsException. Apparently, what JUnit does is it catches the exception and prints the message, but doesn't show the exception and doesn't print the stack trace either. I'll wrap my tests into try-catch blocks, so that every exception is printed out.
Functional programming is cool because it makes programming a lot like maths. Instead of writing some kind of defition keyword, a parameter list, then a body with all kinds of return statements, I just simply write f x = 2 * x, which is like f(x) = 2x.
I already liked the concept when I got to know the new functional concepts in Java 8, and I really like lambda expressions. But Haskell brings that to a whole new level of purely functional programming.
By the way, I started learning Haskell, because it seemed very interesting to me. :) It is an amazing language!
There we go. Finally I figured out how to do this.
I pasted the code, ran it, and published it immediately. But I forgot to add the JavaScript part to the description, so I wanted to edit it, and it didn't let me again to choose the node version. Then I tried something else: I forked my own translation, added the description and published it again. Now when I try to edit my fork, it works and allows me to select node version.
You can accept it now, if you think it has everything okay. :)
Okay, go ahead. I guess I will be notified when you reject it.
What I can advise is that you delete or decline or whatever the translation, so I can try to translate it again and hope it works. I have copied everything so you can delete it safely.
I absolutely have no clue what you are talking about. I mean, when I first published the translation there weren't any errors whatsoever. Then I modified something in the description and wanted to re-publish, but then the node problem came. And I still cannot do anything, it still says the node error to me, and the list in which one can select the version of the language (next to the list of languages) doesn't show up to me in the translation editor. So I don't know what happened here.
And by the way, arrow functions only need braces around the body if they contain more than 1 statement. Maybe it throws the error because of the older node version.
This comment is hidden because it contains spoiler information about the solution
Loading more items...