« first day (771 days earlier)      last day (1869 days later) » 

4:17 AM
@Adám hmm. is there any way to reshape to a ragged/jagged array?
or is there a better way to do things
 
5:16 AM
@ASCII-only You're probably doing something wrong if you need that, but you could maybe use ⍴¨?
 
5:34 AM
i was thinking of a reshape + transpose, no idea how else i'd do it
haven't found an list_of_indices <function> array_to_index function yet
 
5:48 AM
@ASCII-only You can either use indexing brackets array[indices] or indices⌷array
The is mnemonic in being [ squished together with ].
 
@Adám how would you have a list of indices of length 1 though
 
@ASCII-only ,3 although often 3 is enough:
⍞←3⌷3 1 4 1 5
 
@Adám 4
 
⍞←(3 4⍴⎕A)[(2 2)(3 4)]
 
@Adám FL
 
6:02 AM
⍞←(3 4⍴⎕A)[⊂2 2]
 
@Adám F
 
⍞←2 2⌷3 4⍴⎕A
 
@Adám F
 
@ASCII-only Does ^ help?
 
oh wait a second... forgot about index error
 
7:11 AM
just came across this excellent APL tutorial on HN - maybe useful for beginners like me. vector.org.uk/art10011550
 
@ThomasLackner Very nice. The same author also wrote an entire book, Mastering Dyalog APL, available for physical purchase and free download.
 
 
4 hours later…
11:36 AM
Does APL Need a Type System? by Aaron W Hsu at #FnConf18 https://youtu.be/z8MVKianh54 #FunctionalProgramming #DyalogAPL #TypeSystem #InterpretedLanguage #UntypedLanguage #ArrayOrientedProgramming #ExpressiveCode
Just watching #dyalog tv with Jay Foad explaining his #adventofcode methods. Another hour of educating distraction.
 
Ven
12:33 PM
OK, updated the explanation on my post
 
12:57 PM
Does anyone understand the line of code here: youtube.com/watch?v=z8MVKianh54&t=40m20s
That is: (⍳×/s)≡I∘⍋⍨⍋⍋,+⌿¨1+⍳s
I think that I∘⍋⍨ is wrong, and can't figure out what he was trying to get at
 
@H.PWiz Yeah, that doesn't seem right. I can't claim to understand this code (or much of what @arcfide writes), but I don't think A∘f⍨ can ever be right.
 
@Adám Perhaps I is a function. What function would make sense?
 
@H.PWiz Solved: I←⌷⍨∘⊂
It is simply a "saner" indexing, equivalent to ⊇⍨ in my extended Dyalog APL.
 
1:13 PM
I have a question about grabbing a section of a matrix. ⌷ can grab an element or a row or maybe a plane of a cube, but how do I get say a 2 3 4 size section of a 4 6 8 size cube?
 
@H.PWiz Btw, I think this only proves for a specific subset s of the rationals that they are countable. It isn't a proof for all rationals.
 
It seems fairly trivial that a permutation of ⍳×/s matches ⍳×/s after sorting. (Or I'm not understanding)
 
@Sherlock9 The left argument of has one vector per dimension, so layers rows columns⌷cube
 
@Adám If that subset is finite, then it is obviously countable
Perhaps the point is that it somehow gives the general idea of the infinite case
 
@Adám Oh nice
 
1:16 PM
@H.PWiz Probably, but that isn't a proof. Without I, how in the world was the audience at FnConf to gain anything from this part of the presentation?
@Sherlock9 Btw, an alternative is 2 3 4↑offsets↓cube
 
@Adám There are a number of lines of code in that presentation, and I'm sure the point was not to have people understand any of them.
 
@H.PWiz not to have people understand any of them or to have people not understand any of them? ;-)
 
spread ignorance of course! ;)
 
Could be either
 
@H.PWiz At least you got your mention at FnConf. Bravo!
 
1:21 PM
@Adám I'll keep that in mind but I'm finding it hard to grasp at the moment. Maybe with more practice
 
@Sherlock9 Here, look, to find 4 letters of the alphabet beginning after an offset of 3:
⍞←4↑3↓⎕A
 
@Adám DEFG
 
@Adám It's more the "drop how much of the cube and how does it work if you only specify one or two numbers on a cube"
⎕←1 2 3↑2 3 1↓4 4 4⍴⍳64
 
@Sherlock9
46 47 48
 0  0  0
 
Ah nuts
 
1:26 PM
@Sherlock9 If you give or short , they work on cells of rank ≢⍺. Another way to look at it is that pads with ⍴⍵ and pads with 0s
 
Ah ok
 
⎕←2↓4 2 2⍴⍳8
 
@Adám
1 2
3 4

5 6
7 8
 
⎕←2 1↓4 2 2⍴⍳8
 
@Adám
3 4

7 8
 
1:28 PM
Oh, those were bad examples. Should have said ⍳16
 
Oh I see
Upon trying ⍳16 in the IDE, that is
 
@Sherlock9 Right. Try it with as well.
 
Very neat
 
2:12 PM
@Ven -1 by taking argument as simple matrix: ⊢{3⊃e=×/2↑e←⍵⊥⍺:⍵⋄⍺∇⍵+1}1+⌈/∘,
@Ven This one takes argument as given in OP.
 
Ven
@Adám I figured ⌶ could help
 
Ven
2:34 PM
⍉⌽↑⌽ amazing
 
ngn
⎕←⊖s⍴⍋⍋,+⌿¨1+⍳s←8 8 ⊣⎕io←0
 
@ngn
35 42 48 53 57 60 62 63
27 34 41 47 52 56 59 61
20 26 33 40 46 51 55 58
14 19 25 32 39 45 50 54
 9 13 18 24 31 38 44 49
 5  8 12 17 23 30 37 43
 2  4  7 11 16 22 29 36
 0  1  3  6 10 15 21 28
 
Ven
I remember 819! it's "BIG"
 
ngn
@H.PWiz he was probably trying to say that ^ resembles the pairing function used in a popular proof for |Q|=|N|
 
@Ven You explanation still uses . Also, maybe you should explain what the argument format is?
 
Ven
3:06 PM
Good points
 
@ngn Why do you need ⍋⍋ there?
 
@Sherlock9 To convert from values to (consecutive) cardinal numbers.
⍞←⍋⍋ 3 1 4 1 5 9
 
@Adám 3 1 4 2 5 6
 
Oh that is weird. How do you even come up with that?
The whole thing, I mean
 
ngn
@Sherlock9 arcfide's apl expression? or the proof that rationals are countable? or the connection between the two?
 
3:23 PM
@ngn The APL expression. I'm slightly in awe of the math there :O
 
ngn
@Sherlock9 rewind a few minutes in the video and you'll hear how - he was analyzing checkerboard problems and he noticed a pattern he saw here in the orchard, in H.PWiz's golfing
 
3:43 PM
CMC : ASCII-only function to check if its scalar non-negative integer argument is prime.
 
ngn
@Adám 2=0+.=(+\n/1)|n
 
@ngn Not a function.
 
ngn
@Adám can we use ?
 
+|(!(1++)*2+1=-)
 
@ngn Nope. It isn't ASCII.
 
3:50 PM
I think
 
@ngn Thanks a bunch!
 
Hard to golf on a phone
 
@H.PWiz 1=- Wat? That'll always be 0
 
I couldn't think how to just get 2 as the power
So I added 0
 
@H.PWiz {2}
 
ngn
3:52 PM
@H.PWiz {2}
 
Cool
 
@H.PWiz What's up with the factorial?
 
I think n|(!n+1)*2 tells you whether a number is prime. (Wilson's theorem). If it's wrong, it's because I can't test on my phone
 
@H.PWiz Ah, it should be -, not +
 
Oh, sure
 
3:59 PM
@Adám you got any info on embedding compiled APL into another application yet?
 
⍞←(+|(!+-{1})*{2})19
 
@Adám 0
 
@moonheart08 Oh, sorry, I forgot to ask. Anyway, APL isn't usually compiled. You want to call APL though, right?
 
Integers too big?
 
If it can compete with lighting code written in Rust, yes, i'm interested.
(Rust doesn't have good crossplatform SIMD yet, so the APL is kinda a stopgap, but i dont mind)
 
4:03 PM
@H.PWiz Yeah, fails at 13 for ⎕FR←645 and at 19 with ⎕DR←1287. I have a solution that is only limited by memory.
 
I believe you, ( I saw it in the other chat room)
 
@Adám (+|(!+-{1})*{2}) seems to work for 11, weirdly enough
Pardon me let me fix that
 
@Sherlock9 The algorithm is sound, but it requires ridiculously large integers, so APL switches to floats and looses precision.
@ngn Challenge for you: do useful stuff in Dyalog APL using only ASCII. You'll have to find work-around for many common things. Assignments are :For N:In 42⋄:End and you can "call" dfns using globals. The only way I can think of doing function assignments is passing them into a tradop as operands…
 
4:22 PM
@Adám Ah that makes sense
 
@moonheart08 NP. So I spoke briefly with our CTO. We don't have any particular tools in place at this time, but you can of course run APL with a workspace (or as a bound executable) or pipe stuff in or use network communications.
 
@Adám network piping basically kills all of the gains i had in mind, RIP
 
@moonheart08 Network piping? You can pipe through stdin and have APL return write to stdout.
 
yea, i know. But piping just kinda bugs me as icky
guess i'll just do it in rust anyways
 
ngn
@moonheart08 piping? are you and Adam talking about the same b?
 
4:32 PM
@ngn discussing embedding APL into a program
 
4:42 PM
 
Ven
5:13 PM
@Adám updated
 
@Ven Your rep just increased by almost 10%
 
Ven
Yay! thank you.
 
 
5 hours later…
ngn
9:51 PM
 
 
2 hours later…
ngn
11:29 PM
@Adám do you have a solution for the primality testing challenge? (if yes, don't publish it yet pls)
 
@ngn A true ASCII function to determine primeness, even for very large numbers? Yes.
 
ngn
@Adám ok. dfns require , tradfns require , so it can only be a train then
 
@ngn Tradfns don't require imho, but yes, it is a train. (Otherwise it wouldn't be a true function, as a tradfn cannot return a result without ).
@ngn Let me know if you want a tiny hint.
 
ngn
@Adám not yet :) i just need to figure out how to do ⍳⍵ ...
 
@ngn Exactly, just need to figure out how to do ⍳⍵ was the full extent of my hint.
 
ngn
11:41 PM
@Adám ah, don't tell me. i want to find it by myself
 
@ngn No, that's what I mean. I was going to tell you that you just need to figure that out. I wasn't going to tell you how to do it.
 
ngn
oh... ok :)
 
@ngn Heh, I just wrote an ASCII APL program that takes an argument and prints all primes ≤argument
I've got ASCII looping, assignments and basic arithmetic now, so I suspect ASCII APL is TC. Logic can obviously be done using ^ for AND and 1- for not, so that's all in place…
 
ngn
:)
 

« first day (771 days earlier)      last day (1869 days later) »