« first day (1838 days earlier)      last day (833 days later) » 

9:41 AM
is there a way to play sounds from inside Dyalog APL?
 
For a simple pling on Windows, do 'Windows.Beep'⎕CY'quadna' ⋄ Beep 1. Cross-platform, you can throw a sound file at the HTMLRenderer.
 
ok i will have to see HTMLRenderer then
 
You could probably also start an external OS process using whatever is installed.
 
ah yeah but i'd want to to be playable from dyalog on anything
 
I miss APL+'s ⎕BEEP or ⎕SOUND
 
9:48 AM
the obvious way is to write to a wav file but that is less nice than playing it directly from the program
 
Can you run a headless cef instance under Dyalog?
 
If by "headless" you mean invisible/background, then yes.
 
I do, and cool.
 
Most GUI objects have a Visible property.
 
 
2 hours later…
11:33 AM
A non-empty array is simple if and only if it has a depth of 0 (which makes it a scalar) or 1.

Can't the non-empty part be removed? Arrays are still simple if they're empty and have depth 0 or 1, correct?
 
@FawnLocke Yeah, empty or not is irrelevant. Simple ←→ 1≥|⍤≡
 
Okay, gotcha
 
This particular formulation is not on APLcart because 1=≡,Y is optimised.
Oh, and because I came up with ⊂≡⊆ when we added
 
Is the |⍤ necessary? When will an array be simple and have elements of differing depth?
 
It won't, but 1≥¯2
 
11:43 AM
Ah, right.
Thanks for clarifying, perhaps it's useful to remove irrelevant information? Or is that better suited to a more friendly yet comprehensive resource
 
11:54 AM
@FawnLocke Not sure what you're suggesting?
 
Well, the aplwiki intends to comment on history, implementation differences, differing models, etc - which is good.

And the Dyalog docs are subpar in areas, besides being unable to contribute to them.

I'm just curious if it'd be a good idea to create a middle-ground
 
I think apl.wiki/Simple_array is the right place to include definitions/formulas/equivalences like these.
Btw, about not being able to contribute to the Dyalog docs: I am planning on lobbying for migration to an open GitHub-based system, so contributions can become possible.
 
Good to know
I think that'd solve my current qualm
 
Go for it!
 
 
2 hours later…
1:42 PM
@Adám The point was that for example ≡0⍴⊂⊂⊂'abc' is 4, but should be considered simple (it's a valid left argument to reshape).
 
@Marshall OK, that's a good point.
Maybe (1=≡0,⊢) would be a better test.
So in BQN, you cannot have a non-simple empty array?
 
I see
 
In other words, in BQN, ≡¨(⥊¨↕0)‿(⥊¨↕1)‿(⥊¨↕2)‿(⥊¨↕3) gives 1‿2‿2‿2
The corresponding APL, ≡¨(,¨⍳0)(,¨⍳1)(,¨⍳2)(,¨⍳3) gives 2 2 2 2
 
@Adám is it "depth foreach (deshape it over 0)(deshape it over 0,1)etc"
 
Correct.
 
1:51 PM
@Adám What is this supposed to do?
 
Test if empty or simple.
Probably much better to do (⊂≡⊆)∨0∊⍴
 
Do you mean (1=∘≡0,⊢)?

(1=≡0,⊢) isn't a valid train
Maybe I'm low on caffeine :^)
 
Yes, my bad.
 
2:15 PM
@Adám BQN doesn't have any concept of "simple array" (it uses "array of numbers" or "array of characters" when necessary), but any empty array has depth 1. Things don't depend on fills unless they really have to.
 
 
2 hours later…
4:41 PM
hey, are there any values of m that wouldn't make these two expressions produce the same result?

⌽m
(⊖⍤1)m
and if not, does that hold for any pair of functions where one operates on the first axis and the other operates on the last?
 
@justin2004 No, and ⊖⍤1 is completely equivalent, and so too for all such pairs.
 
@Adám i thought so but the performance difference in dyalog made me think there might be some checks being done:
https://github.com/phantomics/april/issues/208#issuecomment-1030741818
do you know what accounts for that performance difference?
 
@justin2004 Operators have overhead, and the array in question is tiny:
      size←4000 ⋄ m← size size ⍴ ⍳size×size
      cmpx     '⌽m'      '(⊖⍤1)m'
  ⌽m     → 8.8E¯3 |  0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  (⊖⍤1)m → 8.9E¯3 | +1% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
oh, yesterday i couldn't increase size beyond 4 without it taking a very long time. let me try again. i was also using diamond but i read cmpx doesn't like diamond.
 
if Dyalog can't reverse a 16 item array, something is definitely very wrong
 
4:57 PM
ok i just tried again with 4000 and it runs quickly... i must have done something silly... or i was still using diamond. thanks @Adám
 
No worries.
 
so if ⌽ and ⊖⍤1 are equivalent -- does that generalize to all pairs of functions where one operates on the first axis and the other on the last axis?
 
Yes.
 
nice! i think that'll make a nice optimization for april... well "an" optimization at least.
 
@justin2004 The markdown of your last message in that issue is mangled. You have link markdown inside your code block.
 
5:04 PM
@Adám fixed it. ty.
 
 
2 hours later…
6:59 PM
@Adám how was the dyadic circle function designed?
i feel like a lot of these functions don't serve a particular use
10, -10, -11 to name a few
 
Let me find the paper…
@KamilaSzewczyk The story of — will you add it to the wiki's page or shall I?
 
7:59 PM
@KamilaSzewczyk notice that the left argument can also be any array of matching rank. So you can do (2 2⍴¯9 ¯11 9 10)○(2 2⍴1 2j2 ¯3 4j2) instead of figuring out how to apply different functions to different cells of an array
While this kind of computation is common to be seen on books about linear algebra
so even for example ¯9○ is just identity function, it is still useful to include that.
So the design of is trying to avoid the "array of functions" concept.
$$\left(
\begin{array}{cc}
\cos\theta&-\sin\theta\\
\sin\theta&\cos\theta
\end{array}
\right)$$
for example, you will find is handy for computing the above matrix that can be used to rotate a 2D vector.
 
8:19 PM
i used the ○'s features a lot when i did a challenge someone sent of calculating the angle from one entity in a 3d space to another. it was fun, lots of sins, tans and cosines, esspecially the arctan was useful
 
8:53 PM
screen←{(⍳⍺)+¨⍨⊂⍵}
is there a tacit version of this function? i watched a dyalog webinar on how to spot trains and such so i tried with this function and i have been so close so many times but i can't get it to work
like i got this to work: screen←((⍳z)+¨⍨⊂)
but obviously i hid the left argument in a variable instead of actually having it as a left operand
 
+¨⍨ is just +
it'd be (⍳⍤⊣ + ⊂⍤⊢), not much better than {(⍳⍺) + ⊂⍵}
with reverse compose, it could be ⍳⍛+∘⊂
 
@dzaima huh thanks, thats neat i should learn how to use ⍤. but yea not much better i suppose
@dzaima huh what's reverse compose? is it a thing from another version or?
 
⍤ is just a 2-train (f g)

X f⍤g Y ←→ f (X g Y)
f⍤g Y ←→ f (g Y)

here it's evaluated as (⍳ ⍺⊣⍵) + (⊂⍺⊢⍵)
 
@BrianBED it's {(⍺⍺ ⍺) ⍵⍵ ⍵} - pre-process left argument by the left operand before giving it to the right
(regular being {⍺ ⍺⍺ (⍵⍵ ⍵)} - pre-process right argument)
 
@BrianBED +∘⊂⍨∘⍳⍨
 
9:05 PM
daaaamn
 
Or even +∘⍳⍨∘⊂ (one char shorter)
 
@Adám not any shorter than the version though
@Adám ..or that
 
@dzaima True, but doesn't need parens for inline application.
 
@Adám Didn't think of this one
 
Of course, none of these are particularly easy to read. The version with is much nicer.
 
9:07 PM
It's a character shorter?

⍳⍤⊣+ ⊂⍤⊢ - 7
+∘⍳ ⍨∘⊂ - 6
Unless I'm failing at counting
 
The f⍛g∘h pattern (which Marshall dubbed split-compose) is fairly common.
 
Yeah
 
@FawnLocke Not sure what you're getting at here. Surely 7−6=1.
 
@FawnLocke that was for +∘⊂⍨∘⍳⍨
 
Oh, okay
Ah I misinterpreted the ...or that
Anyway
 
9:21 PM
o forgot to say thanks... thanks guys :D
 
Danish politeness ;-) Velbekommen.
 
ahh tussind takk men jeg er føroyiskur
:)
 
Undskyld. Jeg ved faktisk ikke om færinger anser sig som danske eller ej.
 
hm jeg har ingen ide ¯_(ツ)_/¯
 
Hov, du tabte den her: \
 
9:29 PM
lol
 
Anyway, we should probably stick to English in general. I'd love to visit the Faroe Islands one day.
 
Oooo yea nice place. I write better english anyway
 

« first day (1838 days earlier)      last day (833 days later) »