[#100309] How to use backport custom field — Jun Aruga <jaruga@...>
Please allow my ignorance.
9 messages
2020/10/06
[#100310] Re: How to use backport custom field
— "NARUSE, Yui" <naruse@...>
2020/10/06
"Backport custom field" is only available for tickets whose tracker is "Bug".
[#100311] Re: How to use backport custom field
— Jun Aruga <jaruga@...>
2020/10/06
On Tue, Oct 6, 2020 at 4:44 PM NARUSE, Yui <naruse@airemix.jp> wrote:
[#100314] Re: How to use backport custom field
— "NARUSE, Yui" <naruse@...>
2020/10/06
Thank you for confirmation.
[#100322] Re: How to use backport custom field
— Jun Aruga <jaruga@...>
2020/10/07
On Tue, Oct 6, 2020 at 7:25 PM NARUSE, Yui <naruse@airemix.jp> wrote:
[#100326] Re: How to use backport custom field
— "NARUSE, Yui" <naruse@...>
2020/10/07
I added you to "Reporter" role in the project
[#100327] Re: How to use backport custom field
— Jun Aruga <jaruga@...>
2020/10/07
On Wed, Oct 7, 2020 at 1:42 PM NARUSE, Yui <naruse@airemix.jp> wrote:
[#100358] [BUG] ruby 2.6.6 warning with encdb.so — shiftag <shiftag@...>
Hello,
1 message
2020/10/10
[ruby-core:100507] [Ruby master Feature#17277] Make Enumerator#with_index yield row and col indices for Matrix
From:
sawadatsuyoshi@...
Date:
2020-10-22 15:16:35 UTC
List:
ruby-core #100507
Issue #17277 has been updated by sawa (Tsuyoshi Sawada).
I think the current behaviour is natural. You cannot play around with `with_index` since its receiver is `Enumerator`, not `Matrix`, and the information as a matrix is already gone.
You can retrieve the row and column indices easily from the flattened indices:
```ruby
m.each.with_index{|e, index| p index.divmod(m.column_size)}
[0, 0]
[0, 1]
[0, 2]
[0, 3]
[1, 0]
[1, 1]
[1, 2]
[1, 3]
[2, 0]
[2, 1]
[2, 2]
[2, 3]
```
----------------------------------------
Feature #17277: Make Enumerator#with_index yield row and col indices for Matrix
https://bugs.ruby-lang.org/issues/17277#change-88130
* Author: greggzst (Grzegorz Jakubiak)
* Status: Assigned
* Priority: Normal
* Assignee: marcandre (Marc-Andre Lafortune)
----------------------------------------
Given a matrix:
```ruby
matrix = Matrix[[0,2,3,4], [6,7,8,9], [1,4,5,8]]
```
You could get the row and col indices of a matrix using `Matrix#each_with_index`:
```ruby
matrix
.each_with_index { |e, row, col| p [row, col] }
[0, 0]
[0, 1]
[0, 2]
[0, 3]
[1, 0]
[1, 1]
[1, 2]
[1, 3]
[2, 0]
[2, 1]
[2, 2]
[2, 3]
```
You can chain it with other enumerators and access indices within them:
```ruby
matrix
.each_with_index
.filter_map { |e, row, col| [row, col] if e % 4 == 0}
# => [[0, 0], [0, 3], [1, 2], [2, 1], [2, 3]]
```
Meanwhile, `with_index` after `Matrix#each` returns flattened indices, not row or column indices, which does not look right:
```ruby
matrix
.each.with_index { |e, index| p index }
0
1
2
3
4
5
6
7
8
9
10
11
```
I feel we should override `with_index` for `Matrix` so it returns row and column indices.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>