« first day (1822 days earlier)      last day (819 days later) » 

12:50 PM
@Adám Thank you for your last video: https://www.youtube.com/watch?v=kufxBzDfB4Y
To me, it very hard to avoid branching and this video help me a lot!
 
1:06 PM
@Leandro You're very welcome. I'm happy to hear that you found it useful.
 
I also loved to learn about the GPU part
 
@Adám I added an extra section layer.
(not deployed yet)
 
Interesting, I heard about the "avoid branching" thing in APL as soon as my first search on the topic (I wanted to know how to handle a branch)
I learned it before I learned about guards
I think it was a Dyalog document, too
I'm not finding it, unfortunately
stackoverflow.com/a/32426323/1418103 I did come accross this answer, this dude seems to know what he's talking about
 
heh
 
1:35 PM
@xpqz omg a reference book
 
@Razetime My rework of the cultivations series: xpqz.github.io/cultivations
 
i see
 
2:04 PM
@xpqz Nice.
 
 
2 hours later…
4:09 PM
CMC: 5-digit prime "wordle" solver (converged.yt/primel)
 
Better way to have a numeric matrix from a character one? ↑⍎¨↓ (↑⍣≡0∘⎕JSON) '["1 1 1", "2 2 2"]'
Also, when should I use ⎕VFI?
 
4:31 PM
@xpqz cute website
 
↑⍎¨↓ or ⍎⍤1
seem okay. Use ⎕VFI in production code, where security is more important than code golf.
↑⍣≡(//⎕VFI)¨⎕JSON'["1 1 1", "2 2 2"]'
 
@xpqz with or without dfns.pco
would be mighty convenient with pco
is everyone's "fixed font" button phasing in and out?
 
@Razetime I'm definitely using pco to pre-calculate all 5-digit primes with no repeated digits
 
oh, repdigits are excluded?
 
y
 
4:36 PM
wordle is fine with repeated letters soo
 
Is it???
Maybe I'm mistaken (on the repeated digits)
On wordle, maybe thats' why I failed utterly the other day..
 
wordle has some rules governing repeated letters but long story short, yes they're allowed
 
Ok, then I count 8363 qualifying primes
 
4:54 PM
@Razetime ^
 
nice score
 
APL wins.
 
The problem of ⍎⍤0, is that ⍎' ' return nothing, right?
And what is an example of a security problem?
 
@MasterQuiz can execute anything. Including deleting files etc.
Like the bad old days of PHP SQL injection, unless you santitise carefully data you don't control.
 
@xpqz Is the first number chosen for being the best ore, or just a random number?
 
5:03 PM
I calculated the best prime based on the commonest occurring digit in each place.
There are several equally good.
Also wanted the most unique digits.
 
@xpqz But I'm sending data to tryAPL.org, should I still use ⎕VFI?
@xpqz Ok, I was thinking about something like that.
 
@xpqz interesting how it does the repeated digits
 
I use to my heart's content if I control the data (which is pretty much always).
If I wrote a service, or otherwise had to rely on dirty data, I'd shy away from .
 
5:31 PM
@MasterQuiz See also ⎕CSV
(⎕CSV⍠'Separator' ' ')('1 -2 3' '4 +5 6')'N' 2
⍎ and ⎕VFI both choke on the minus sign, while ⎕CSV does (normally) what you want.
⎕CSV also has a ton of options.
 
@MasterQuiz Adám has a video exploring parsing with ⎕CSV if you're interested
 
@Adám i find it a bit weird that functions return domain error when the result is too big to compute
because mathematically speaking, the domain is the interval on which the function is defined. Using the most basic definition of a factorial, it's defined on all natural numbers.
      !1000000
DOMAIN ERROR
      !1000000
      ∧
wouldn't it make more sense to raise something like a LIMIT ERROR here?
 
⋄ 1e10000
 
@rak1507
SYNTAX ERROR
      1e10000
      ∧
 
is there a workaround that allows me to determine whether the input to a function is just too high or it's actually outside of the domain (like ⍵=0 for ÷⍵)
 
5:45 PM
that is a bit weird too
 
that's. so weird
 
huh
 
⋄⍎10000⍴'9'
 
@KamilaSzewczyk
SYNTAX ERROR
      ⍎10000⍴'9'
      ∧
 
weird, for me the syntax error is prepended with an eval symbol for some reason.
      ⍎vec
⍎SYNTAX ERROR: Invalid token
 
5:56 PM
@FawnLocke I've seen it two times, but I keep forgetting about it
 
Well, that's okay. As a wise person once said if it's written down you don't have to remember it
Referencing it and the docs are why they're there :)
 
@FawnLocke I keep forgetting of the existence of ⎕CSV, not even how it works. That's the problem
 
Ah, I see. Well that just comes with practice, recognizing there's a way to improve your code later on is part of the fun
 
6:22 PM
@MasterQuiz Its not a natural go-to as an alternative to ⎕VFI or ⍎, I think a lot people forget about it for that use case. I know I do. (In fact I just found a bug in it, so I wonder how many people really put it through its paces.)
But it really is powerful solution to all the junk that something like excel might throw into a csv file.
 
@PaulMansour what's the bug you found?
 
The thousands variant will not work on a string without a decimal. So 3,000.25 will convert, but 3000 will not.
3,000 will not
When converting a column to numeric
In 18.0
I've got a lengthy legacy function for converting a char mat into a numeric vector. I think ⎕CSV can do it trivially, handling all the many things one needs to test for... but I just hit that bug.
 
Hi, can anybody help me understand how works in dyalog? I understand that the rank is always reduced by one, but what I don't understand is how. I am used to how J does it with insert, since that is literally just "inserting" the function between the items of the array. Is there some general expression that can be translated to?
 
(f⌿⍤¯1) is insert f⌿ between major cells
⌿ reduces along the first axis which might ring some bells
Hmm J's insert seems to be closer to ∘. I can't quite grep a translation
 
6:39 PM
The problem for me is that I don't understand how the rank always is reduced by 1, and the rest of the shape stays the same. Say I have a matrix M←2 3 4⍴⍳24 and i ⍪⌿M, in J, this would give me a 6 by 4 matrix, which makes sense as that is what i get when i put a ⍪ in between the two major cells. But in apl it gives me a 3 by 4 matrix with each element being a vector of length 2.
Therefore I would be happy if anybody knows a way to write this same result in a general way, without using ⌿ directly :)
 
I think it might be ⊃f/⊂⍤¯1 but for that specific example ,[⍳2] is probably easiest
 
Is ⋄ ⍉⍪⍉2 3 4⍴⍳24 the output you want?
 
@FawnLocke
 1  2  3  4
13 14 15 16
 5  6  7  8
17 18 19 20
 9 10 11 12
21 22 23 24
 
⋄ ,[⍳2]2 3 4⍴⍳24 ⍝ I think it's this?
 
@rak1507
 1  2  3  4
 5  6  7  8
 9 10 11 12
13 14 15 16
17 18 19 20
21 22 23 24
 
6:45 PM
The problem is not that i want some result, the problem is that I don't understand ⌿ in APL fully
 
@rak1507 more precisely, it's ↑ f¨/ ⊂⍤¯1
 
ah thanks
⋄ 2 3 4⍴⍳24 ⋄ {⍺,'f',⍵}⌿2 3 4⍴⍳24
 
So, when running ⍪⌿2 3 4⍴⍳24, between what elements does ⍪ gets evaluated?
 
@rak1507
 1  2  3  4
 5  6  7  8
 9 10 11 12

13 14 15 16
17 18 19 20
21 22 23 24
┌──────┬───────┬───────┬───────┐
│1 f 13│2 f 14 │3 f 15 │4 f 16 │
├──────┼───────┼───────┼───────┤
│5 f 17│6 f 18 │7 f 19 │8 f 20 │
├──────┼───────┼───────┼───────┤
│9 f 21│10 f 22│11 f 23│12 f 24│
└──────┴───────┴───────┴───────┘
 
Ah, well ⌿ is a right to left reduce, i.e successively applying a function between elements of an array. The rank is reduced by nature of the operation
 
6:47 PM
@rak1507 ahhhh
It's between the elements on the axis
 
@pmikkelsen between elements at the same position in each cell
 
⋄3 4 5⍴⍳60⋄{⍺,'f',⍵}⌿3 4 5⍴⍳60
 
@rak1507
 1  2  3  4  5
 6  7  8  9 10
11 12 13 14 15
16 17 18 19 20

21 22 23 24 25
26 27 28 29 30
31 32 33 34 35
36 37 38 39 40

41 42 43 44 45
46 47 48 49 50
51 52 53 54 55
56 57 58 59 60
┌────────────┬────────────┬────────────┬────────────┬────────────┐
│1 f 21 f 41 │2 f 22 f 42 │3 f 23 f 43 │4 f 24 f 44 │5 f 25 f 45 │
├────────────┼────────────┼────────────┼────────────┼────────────┤
│6 f 26 f 46 │7 f 27 f 47 │8 f 28 f 48 │9 f 29 f 49 │10 f 30 f 50│
├────────────┼────────────┼────────────┼────────────┼────────────┤
 
That makes much more sense, thanks a lot. :) I'm working on my own apl interpreter just for the fun of it, and it is difficult to implement stuff that I don't understand
 
reduce is one of the most complicated APL primitives to implement, yeah. Among and f⍤a
 
6:50 PM
Yeah i imagine ⍤ being a bit difficult
 
you can also bracket axis it: ⋄{⍺,'f',⍵}⌿[2]3 4 5⍴⍳60
 
@dzaima
┌─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────┐
│1 f 6 f 11 f 16  │2 f 7 f 12 f 17  │3 f 8 f 13 f 18  │4 f 9 f 14 f 19  │5 f 10 f 15 f 20 │
├─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┤
│21 f 26 f 31 f 36│22 f 27 f 32 f 37│23 f 28 f 33 f 38│24 f 29 f 34 f 39│25 f 30 f 35 f 40│
├─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┤
│41 f 46 f 51 f 56│42 f 47 f 52 f 57│43 f 48 f 53 f 58│44 f 49 f 54 f 59│45 f 50 f 55 f 60│
 
Just a question, is there anything bracket axis can do, which cannot be done with rank? Other than maybe the fractional axis stuff
 
something like ,[⍳2] is annoying without bracket axis
 
hmm maybe I should learn J to understand leading axis better
Better, yet, BQN
 
6:54 PM
the hard part of is making sense of the right operand format and understanding what it even does. The actual implementation can actually be pretty simple (if you ignore the mess of conditionals handling the various modes of the right operand)
 
Alright i see
 
7:40 PM
@RikedyP This reduction is risky if the data actually represents a martrix, as bad values
will shift the columns out of order.
And if all the values are good, the reduction is unneeded. Could just do:
↑1⊃¨⎕VFI¨
 

« first day (1822 days earlier)      last day (819 days later) »