« first day (278 days earlier)      last day (2360 days later) » 

1:13 PM
#Dyalog Webinar 6 - Source Code Management with GitHub and #APL - join us on Thursday 7th December at 16:00 UTC at https://dyalog.tv/Webinar
 
1:39 PM
⍺ ⊆ ⍵ begins a new partition in whenever the corresponding positive int in is greater than its left-hand neighbour. Zeros in omit their corresponding items in .
⍺ ⊂ ⍵ begins a new partition in whenever the corresponding Bool in is 1. Zeros in join their corresponding item in to the current partition, or drops them if there is none (i.e. the leftmost partition has not begun yet.)
 
1:54 PM
@Adám I tried {(2≡/⍵)⊂⍵} for that first CMC you posted but it raises a length error (because (2≡/⍵) generates a list 1 size smaller than the length I assume?)
Also tried swapping for = to no avail.
 
@J.Salle The first element is always "new", so you need to prepend a 1, so {(1,2≡/⍵)⊂⍵}
@J.Salle Nicely done, btw. Now you can also make it into a train.
 
2:09 PM
@Adám Yeah I usually try to make them work as a Dfn before trying to go for a train. It's still not doing what I need, though. Gotta think some more
okay now it works, I used instead
 
@J.Salle Oh, right, you've got it the wrong way: use or .
 
Would the 1, count as the X in a Xgh train? Or would that be the 2 and the 1, is the ?
Or is the X the whole 1,2?
 
@J.Salle Both. 1 is X in 1 , (2≠/⊢) and 2 is X in 2 ≠/ ⊢
 
@Adám Okay, I'll try working with that
 
3:14 PM
So, my chat wasn't connecting so I went out to get some lunch. I can't seem to get a train to work; I've tried multiple combinations of 1,2≠/ with and and ⊢⊣, all of them raise a RANK ERROR or a SYNTAX ERROR. 1,2≠/ followed by the list works properly, I just can't seem to get it to work with
 
 
1 hour later…
4:29 PM
@J.Salle As ≠/ has a left argument (namely 2), it needs a right argument too, and since you just want the unmodified argument, that's .
{(2≠/⍵)⊂⍵}
 (2≠/⊢)⊂⊢
However, there is a solution half the length of that, using .
 
@Adám for the record: since I need the 1,, 1,(2≠/⊢)⊂⊢ doesn't work. I had to do ((1,2≠/⊢)⊂⊢) for that to work properly. I'll look into the solution
 
4:45 PM
@Adám I don't see how would work here. I'd need to get the list to be enclosed with parens to nest it, no?
Idk how I'd make (1 1 1) 4 5 (6 6) (7 7) 3 to pass it as an argument to , especially not in 3 characters
Actually I just noticed that's not right either since it groups 4 and 5 together facedesk
 
5:29 PM
@J.Salle Uh, the result should be approximately (1 1 1) 4 5 (6 6) (7 7) 3 (except each element should be a vector). will do the enclosing for you, you just need to tell it where the partitions begin, i.e. where list changes. So, for strictly positive ascending integers, you can just do ⊆⍨ but how about numbers in general? Actually, now I realise that my solution will only work on ascending numbers (i.e. even non-ints), but only when sorted. Never mind.
 
@Adám Okay, I managed to get to ⊆⍨ on my own and found that exact problem hahahahahah
 
@J.Salle Well, by idea was ⍳⍨⊆⊢
 
I got a result of ⊆⍨(⍋⊃¨⊂) which is technically correct, but it sorts the list, so {(1,2≠/⍵)⊂⍵} would be the best solution?
 
5:53 PM
@J.Salle Yes. And you're getting good at this! They can be shortened to ⊆⍨⍋⊃¨⊂ and ⊢⊂⍨1,2≠/⊢
 
@Adám I tried ⊆⍨⍋⊃¨⊂ but it raises a Rank Error? ⊢⊂⍨1,2≠/⊢ returns what would be the argument for (which is 1 0 0 1 1 1 0 1 0 1), not the list.
Weird, if I enclose ⊆⍨⍋⊃¨⊂ in parens, then it works fine.
 
@J.Salle ⊆⍨⍋⊃¨⊂ is a train; you need to name it or paren it to apply it.
@J.Salle Same goes for ⊢⊂⍨1,2≠/⊢
 
Oh, duh. I knew I was forgetting something >.>
 

« first day (278 days earlier)      last day (2360 days later) »