Size: a a a

2016 November 19

АД

Антон Дьячук in Ruby Talks
решил контрол клиентский подноять на turbolinks и не нанимать фронта вообще
источник

АД

Антон Дьячук in Ruby Talks
пока полет нормальный
источник

АД

Антон Дьячук in Ruby Talks
один день бомбило потому что в js вообще нет общих решений
источник

АД

Антон Дьячук in Ruby Talks
а так норм
источник

АД

Антон Дьячук in Ruby Talks
даже если у меня в полторы каски и не удастся все запилить
то мне будет достаточно нанять студента ruby/jquery джуна который все это будет долго и торжественно мантейнить
источник
2016 November 20

NK

ID:297460406 in Ruby Talks
кому нехуй делать
просветите, как здесь блок работает
a.sort! { |x,y| y <=> x }
источник

ES

Eugene Shved in Ruby Talks
а где ты такой увидел?
источник

ES

Eugene Shved in Ruby Talks
ary <=> other_ary → -1, 0, +1 or nil click to toggle source
Comparison — Returns an integer (-1, 0, or +1) if this array is less than, equal to, or greater than other_ary.

Each object in each array is compared (using the <=> operator).

Arrays are compared in an “element-wise” manner; the first element of ary is compared with the first one of other_ary using the <=> operator, then each of the second elements, etc… As soon as the result of any such comparison is non zero (i.e. the two corresponding elements are not equal), that result is returned for the whole array comparison.

If all the elements are equal, then the result is based on a comparison of the array lengths. Thus, two arrays are “equal” according to Array#<=> if, and only if, they have the same length and the value of each element is equal to the value of the corresponding element in the other array.

nil is returned if the other_ary is not an array or if the comparison of two elements returned nil.

[ "a", "a", "c" ]    <=> [ "a", "b", "c" ]   #=> -1
[ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ]            #=> +1
[ 1, 2 ]             <=> [ 1, :two ]         #=> nil
источник

NK

ID:297460406 in Ruby Talks
в документации
источник

NK

ID:297460406 in Ruby Talks
спс
источник

ES

Eugene Shved in Ruby Talks
2.2.2 :006 > a.sort! { |x, y| y <=> x }
=> [3, 2, 1]
2.2.2 :007 > a = [ 4, 6, 5]
=> [4, 6, 5]
2.2.2 :008 > a.sort! { |x, y| y <=> x }
=> [6, 5, 4]
2.2.2 :009 > a = [ 4, 6, 5]
=> [4, 6, 5]
2.2.2 :010 > a.sort
=> [4, 5, 6]
источник

ES

Eugene Shved in Ruby Talks
с числами он творит вот такую штуку
источник

ES

Eugene Shved in Ruby Talks
2.2.2 :011 > a = [ 4, 6, 5]
=> [4, 6, 5]
2.2.2 :012 > a.sort.reverse
=> [6, 5, 4]
2.2.2 :013 > a.sort
=> [4, 5, 6]
источник

ES

Eugene Shved in Ruby Talks
как бы он должен возвращать 1 -1 nill
источник

NK

ID:297460406 in Ruby Talks
да я знаю что он вьідаст вконце
мне бьіло интересно как он работает
тип он передал первьій елемент в x  а потом я чет не понимаю
источник

ES

Eugene Shved in Ruby Talks
а зачем сюда всунули блок и он не выдает это значение я уже не знаю
источник

ES

Eugene Shved in Ruby Talks
The comparison operator. a <=> b is 0 if a == b, 1 if a > b, -1 if a < b.
источник

ES

Eugene Shved in Ruby Talks
это для  Big Decimal
источник

ES

Eugene Shved in Ruby Talks
Comparison—Returns -1, 0, or +1 depending on whether big is less than, equal to, or greater than numeric. This is the basis for the tests in Comparable.
источник

ES

Eugene Shved in Ruby Talks
Bignum
источник