Clojure kata: looks like there is some weird input in a-test7
Test 7 expected: (= (in-array ur vr) rr) - actual: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.String at java.lang.String.compareTo
There are not only strings passed in the test array, is this expected ?
You are thinking of each value in the kernel as a per-color channel value, but that is incorrect. Each value is a per-pixel value. Maybe I can draw it out more clearly:
When we first start, the kernel should be centered on A:
[A(edge) * 0.2][A(edge) * 0 ][B(edge) * 0 ]
[A(edge) * 0 ][ A * 0.2][ B * 0.2]
[C(edge) * 0 ][ C * 0.2][ D * 0.2]
Could someone explain how the results are obtained ? I can't figure out where the numbers come from. Are the numbers of the kernel supposed to be applied to a pixel or to a color component ? Where does the 63 value comes from ?
It seems that the "right" way to round in real world outside of this kata is to use the
round
function from org.cloure/math.numeric-tower: https://stackoverflow.com/questions/5072492/how-do-i-trim-the-decimal-of-a-number-using-clojure-or-jython#5072766Хитрец.
Thanks, I'm glad you explained this.
the important bit here is that "*" is nothing special in Clojure. It is just a function that happens to be built-in the standard library, but is otherwise a normal Clojure function. You can see it's source there: https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/core.clj#L1000-L1010
Weird language
Neat. Didn't know about
string/reverse
vs.reverse
and\newline
.nice utility functions
Thansk ! You could see it as an alias. You just have to realize that (defn abc [] ...) is shorthand for (def abc (fn [] ...)).
Very nice. Is this like creating an alias?
I just tried the kata and I had no problem at all. Furthermore 74 guys passed the Clojure kata. Could the problem be in your code?
Clojure kata: looks like there is some weird input in a-test7
Test 7 expected: (= (in-array ur vr) rr) - actual: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.String at java.lang.String.compareTo
There are not only strings passed in the test array, is this expected ?
You are thinking of each value in the kernel as a per-color channel value, but that is incorrect. Each value is a per-pixel value. Maybe I can draw it out more clearly:
When we first start, the kernel should be centered on A:
So then per channel, our formulas end up being:
Could someone explain how the results are obtained ? I can't figure out where the numbers come from. Are the numbers of the kernel supposed to be applied to a pixel or to a color component ? Where does the 63 value comes from ?
A year after, have you found what this message is about ? I am in the same situation right now.
This comment is hidden because it contains spoiler information about the solution
Loading more items...