« first day (810 days earlier)      last day (1847 days later) » 

1:09 AM
⎕←↑[0.5] 'Hip' 'Hop'
 
@TessellatingHeckler
HH
io
pp
 
Axis A HALF ??? x_x
 
1:56 AM
0 0 0 0 1 0 0
0 0 0 0 1 0 1
0 0 0 0 1 1 0
0 0 0 0 1 1 1
the operation I want to do is condense consecutive 1 down to a single 1, but this will make the rows different lengths, so I can't work out how to do it with reduce or similar as they want fixed amount of inputs and outputs
 
ngn
2:13 AM
@TessellatingHeckler 2⊥⍣¯1⊢15 20
⍣¯1 means inverse function (literally: apply the function -1 times)
is to separate the ¯1 from the argument
 
@ngn what; how does applying the inverse of decoding, end up being the right quantity of bits
 
ngn
@TessellatingHeckler magic :)
@TessellatingHeckler mix () introduces a new axis. the number in square brackets shows where it should be inserted
 
@ngn 😩
as I saw in a tribute to John Scholes:


('<'∘,⍣¯1) (,∘'>'⍣¯1) '<ha>'
ha
(Join ‘<‘ to the front and ‘>’ to the end of the letters <ha>, negative one times).
 
ngn
@TessellatingHeckler i'm not sure if this can be solved elegantly. probably split () into a vector of vectors and process each (¨) one separately
 
@ngn I've got as far as splitting it into a vector, solving one at all is proving difficult
I was trying pairwise equality 2 =/ and logical operations
and had something which almost worked but left off the far right 1
 
ngn
2:22 AM
@TessellatingHeckler do you want to collapse only consecutive 1s (and not consecutive 0s)?
 
yes
they're going to merge back into strings, where the 0 is taken from the original text, and 1 is asterisk'd out
I want "t*" instead of "t***" because repeated wildcards don't do anything
 
ngn
@TessellatingHeckler something like this should work: {⍵/⍨~2∧/0,⍵}¨↓
 
@ngn that looks close to things I tried, and considered catenating a 0 placeholder to one side or another .. but what is commute doing in there?
 
ngn
@TessellatingHeckler ⍵/⍨something means something/⍵
it's a compress operation
 
@ngn that works so well it instantly shows me how it's the wrong thing for me to be doing. Now the 1 will also have moved so I can't use their positions as indexes into the text. Ooops
really seems like about 50% of APL's functions all do the same thing as each other
 
ngn
2:31 AM
@TessellatingHeckler there is some overlap but not as much as you think
@TessellatingHeckler i'm not sure i understand. do you want to convert the boolean mask to a list of indices?
 
(⍳5)[⍸1 0 1 0 1]
1 0 1 0 1/⍳5
 
ngn
yeah, those should be equivalent
 
@ngn I did convert them with iota underbar and merged my two matrices originally
now I can't change the size of one of them first, then merge them
should have thought of thatttt
DOMAIN ERROR
{⍵/⍨~2∧/0,⍵}'t***'
so that would be the boolean matrix compress of omega
but I guess it's logical ^ which is not valid for characters
so maybe if I use = and instead of a prefix 0, a prefix character
⎕←{⍵/⍨~2=/'a',⍵}'t***'
 
@TessellatingHeckler
t*
 
ngn
2:36 AM
@TessellatingHeckler in this example you had booleans, not characters
using = doesn't sound right...
⎕←{⍵/⍨~2=/'a',⍵}'tt***'
 
@ngn
t*
 
ngn
you don't want to collapse the ts, do you?
⎕←{⍵/⍨~2∧/0,'*'=⍵}'tt***'
 
@ngn
tt*
 
@ngn yes in that example I had booleans not characters. Now I realise I can't do this removal of consecutive things until after I convert everything to characters, because if I do it first, I lost the information which tells me which characters to take. So instead, I need to convert to characters first, then remove consecutive asterisks
@ngn oh no, I don't, good point
I generate booleans for all combinations of asterisk positions, by counting 1..(2^length-1), in binary, and then overlay the asterisks on many copies of the original text
 
ngn
@TessellatingHeckler are you solving project euler? this reminds me of a problem there
 
2:43 AM
@ngn No, but I am solving a golf / challenge; it's not that I need an answer, but that I want to work through something in APL and try to solve (as much as I can) myself
 
2:59 AM
*et*pe
*et*y*
*et*y*e
*et*yp*
*et*ype
*etT*
...
noice
I think that's as far as I'm going to be able to get with this one; @ngn thanks for your help and explanations :)
 
ngn
@TessellatingHeckler my pleasure
 
whenever I'm quickly reaching for a dfn/each like {⍺..⍵}¨... that feels like it's not idiomatic APL and I should avoid it if possible; is there anything to that feeling?
 
ngn
Nov 6 '18 at 6:17, by dzaima
@nathanrogers a simple way to score the speed of an APL program is count the number of ¨. The more, the worse it'll be.
 
haha, ok; (you found that quickly)
 
 
2 hours later…
4:59 AM
@TessellatingHeckler @dzaima @ngn Iverson deliberately made it so because base conversion is matrix multiplication by the base powers and matrix multiplication traditionally "transposes" its left argument:
⍞←(2*⌽⍳4) +.× 2 2 2 2⊤12 10 ⊣ ⎕IO←0
 
@Adám 12 10
 
@ngn On tryapl 1 ⋄ '' ⋄ 2 will give you an extra newline between 1 and 2. For the bot (and TIO, because that's what it uses) you need ⎕← in front of everything yo want to print. So ⎕←1 ⋄ ⎕←'' ⋄ ⎕←2 gives you an extra newline.
 
5:17 AM
@TessellatingHeckler Create an new axis of length ⌈/⍴¨'Hip' 'Hop' (3) "before axis 1" where "axis 1" is length ⍴'Hip' 'Hop' (2), so the result will have shape 3 2.
@TessellatingHeckler That is by definition ⍸1 0 1 0 1
 
 
3 hours later…
8:22 AM
@dzaima Can I get the exact hardware and OS you used for these tests? Also which compiler do you use for dzaima/APL?
 
@Adám linux mint x64, some oldish i3 processor, java 10 with the ./build in the repository. can't give more detailed info rn, not home.
 
 
3 hours later…
11:16 AM
@dzaima I reported it first thing this morning and now 18.0 matches dzaima/APL for many of these. We're looking into the rest.
 
 
3 hours later…
2:31 PM
this was my test setup - ⎕ex-ed in my APL, and the output executed in Dyalog:
https://tio.run/##hVLLattAFN3rKwZtxg/VlpSkDSFxMXjThWiQvQuhKHJaDG1iGlNohXalGCcTugnurtBsjAl00ZqAl/afzI@4594ZKaUEOouZc8899zUzaXL2IbnYbNqR/vI18J0uDpnl@vrmxUtAX@jLzyLLE@Dnoc9Lq98FffIYjdjhEI5d6YxSASC8ZkWC7b8VjUAKGdZD6QicWn1P5MOZ4AztWdgnONnkgBrTNRbVtng3DMlqVrSeMreeopZZZFiOhGSwss5k/S@dZUhVN6Jkn4zkgPf9xg71M54n3NalleirCbkbO/pqzJSQgZ7Cy0NasMWA9Kuf1gsUlsj6q47jXAzNvWVaLT04Pa0WeTOTWAQ9AvlqNkqhdXCx9GZCPorM0uq668T8wrzW91rN2hE91Wjw7nQ1E8hlgtxOzLVdj6u7AFxdq5vVLC7rdYsaPWwZcDI4Co/zsnQvMhOk2Hta3fHPSM/7p7CRj81XFOrryS3aIxdG0uoXqppvpJbcZ
@Adám so it was actually something fixable? now i'm more intrigued
 
@dzaima We naively did the singleton extension and then log, instead of doing ln on the arguments and then the computation based on that. Furthermore, Java used to use the library C functions that we currently use, but they recently switched to assembler code supplied by Intel. We will have a look at using that too, or at least start special-casing log₂ and log₁₀ as the C library has dedicated functions for those.
 
woah those arc-trigs
https://tio.run/##xZjNahRBEMfveYo570LZVd3VHxD1WWYTFEGiKAh6Eg8STCI5RNaD4MWTCLkseMkp@ybzIrHmq7uDMzlOhyVMd8jOj6r6/6u6j@qTd/Xbu7u6@XxJ66ekup/mYkfqYDOxd9BcnTdXH//7/JnfnPzTA/v951Le9On1m1fPq0oejt9XVfdw1C4@VMNqv320/1uNK/mPH1NfdTO/eTPz9psH2X61bM3Xb8cvK0B5rFApoPYhLnRLJ2gIEjq9OBytqY@J/FagRrRu0dK8OHlWKGzUXPysRzaPXdiedAtC8KpLalVpcGRCcThOcAq8jnABiReHqwUuZtWbrvIiHPMAZ0AF9EXg6qzkMJac9oChU4OWiPqAtgjcZoQzmEVO4MyYVpGqDcvDDYHr4SyBi3AYwHGsOXRMywtiFZOqGXxKqhOBJotj7ZZP6iq3OE4Wp8GaAc0Bea0LoOkRDRWEFLUAiAOaBvYeC6ClhDrQuUqNSgmlAkKoV1GjrWfkaBSydsrLR22VFGp0104HhTJ0omwVKsp1avmo0X6b@67JdcB2CJsX36UCEt
my apl would have the advantage of all numbers being doubles already always, but it's not that big of an advantage
 
2:55 PM
@dzaima Me too:
      ]runtime -c "¯1○a" "(⊂'NaN')⊣@(=⍨)a"

  ¯1○a            → 6.5E¯1 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
* (⊂'NaN')⊣@(=⍨)a → 2.0E¯2 | -98% ⎕
 
@Adám
VALUE ERROR
 
@DyalogAPL Be quiet!
@dzaima Notice the * indicating that the results are not the same.
 
@Adám oh yeah, duh :|
and the rest i assume is int→double overhead..
 
3:09 PM
@dzaima No, again Intel assembler code vs C lib.
 

« first day (810 days earlier)      last day (1847 days later) »