News for hackers. Stuff that matters.
Re:Julia 1.0 by stabbles on Thursday August 09, 2018 @11:10AM (#17724820)
Maybe you could use complex numbers to index matrices
Re:Julia 1.0 by 3JPLW on Thursday August 09, 2018 @11:28AM (#17724998)
Sure can:

    # Magic
    julia> Base.to_indices(A, inds, I::Tuple{Complex, Vararg{Any}}) = (real(I[1]), imag(I[1]), to_indices(A, Base._maybetail(Base._maybetail(inds)), Base.tail(I))...)

    julia> A
    4×5 reshape(::UnitRange{Int64}, 4, 5) with eltype Int64:
     1  5   9  13  17
     2  6  10  14  18
     3  7  11  15  19
     4  8  12  16  20

    julia> A[3 + 2im]
    7
```
Re:Julia 1.0 by jordigh on Thursday August 09, 2018 @03:42PM (#17727758)
Story time!

When Octave was getting a lot of traffic from the first Coursera machine learning class, when it was just Andrew Ng doing a course and before the Coursera org existed, we were getting a lot of novice users who would do something like

    some_matrix(i,j) = 5
and get cryptic errors about how matrices cannot be indexed by complex numbers. This is because by default, in Matlab and Octave `i` and `j` are functions that evaluate to the imaginary unit. You have to overwrite the function names with `i=2, j=3` or whatever beforehand, which novices often forget. This was happening often enough that I pushed some patches to warn, "did you forget to assign i or j?" if someone tried to index matrices with complex numbers.

Point is, people in Matlab and Octave often unintentionally try to index by complex numbers.

Re:Julia 1.0 by ChrisRackauckas on Thursday August 09, 2018 @11:28AM (#17725003)
And quaternions for image stacks in ML? Troll, but not too troll...
Re:Julia 1.0 by elcritch on Thursday August 09, 2018 @07:56PM (#17729588)
That’s a right kind of wrong... and could work with FEA tensor too... ;)