« first day (1073 days earlier)      last day (1875 days later) » 

03:09
@ThePuzzlerThree How did you end up wanting to learn code golf but not knowing what code golf is? πŸ€”
 
5 hours later…
08:19
Dec 7 '19 at 0:42, by H.PWiz
I was under the impression that all optimisations at dyalog were supposed to preserve behaviour with floating point numbers
Having just watched this. I still have the impression that +/≑{⍺+⍡}/ should always be true
@H.PWiz Yes indeed it should. The odd behaviour of +/ is very old, and we are reluctant to change it as that would surprise people with new values. It isn't an optimisation at all β€” quite the opposite, in fact β€” as it prevents us from reordering the summation to speed it up. That's why we recommend using 1βŠ₯ which has no guarantee of order.
So what order does +/ use?
Marshall says it goes from right to left in the talk. But surely that's what {⍺+⍡}/ does
@H.PWiz Strict left-to-right.
@H.PWiz I know, but that was just in general for f/ even though it wasn't technically true for the specific instance using +. I also noticed.
That's funny
βŽ•←(+/-{⍺+⍡}/)1,9/1e¯13
08:27
@Bubbler
¯6.661338148E¯16
βŽ•←βŽ•CT
@Bubbler
1E¯14
      2βŠƒβŽ•WG'APLVersion' β‹„ 'cmpx'βŽ•CY'dfns' β‹„ f←?1e5⍴0 β‹„ cmpx '+/f' '1βŠ₯f'
17.1.36847.0
  +/f → 9.4E¯5 |    0% βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•
  1βŠ₯f → 4.3E¯4 | +354% βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•
      2βŠƒβŽ•WG'APLVersion' β‹„ 'cmpx'βŽ•CY'dfns' β‹„ f←?1e5⍴0 β‹„ cmpx '+/f' '1βŠ₯f'
18.0.37436.0
  +/f → 8.7E¯5 |   0% βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•
  1βŠ₯f → 3.4E¯5 | -62% βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•
cmpx didn't mark the results as different due to βŽ•CT, but if I set βŽ•CT←0 it will.
If I want to sum over an axis other than 1st, is 1∘βŠ₯⍀k recommended?
@Bubbler From 18.0, yes, since 1βŠ₯ is (luckily) like +⌿ and not +/. Btw, you don't need ∘ in most cases.
08:39
@Adám btw, have you checked a new APLcart entry proposal?
@Bubbler Yes. There are two reasons why I didn't take any (visible) action. One is that I'm on vacation this week. The other is that I was wondering if a shortcut was possible using βŽ•DR (which is super fast):
βŽ•←5∧{⍉2βŠ₯⍺⍺/{(-⍺⍺ 0>⍡)βͺ⍺⍺ 2βŠ₯⍣¯1⊒⍡}⍉⍺,[0.5]⍡}¯4 β‹„
βŽ•←5∧{2βŠ₯(11βŽ•DR ⍺)⍺⍺(11βŽ•DR ⍡)}¯4
@Adám
4
4
Interesting idea, though that would break if the two values have different bit width
@Bubbler True, but this was just a prototype. One could combine the arrays with something like ⍺,[0.5]⍡ and use a single 11βŽ•DR.
(And it also breaks if the arguments go out of signed 32-bit range)
08:51
It would switch to floats.
09:33
@Adám Possibly i not understand well APL have in my mind one meaning
of each operator (¨) different... but
some APL primitives as "+" little seems to me a little or no,
thinked because it is easier doing
a+b when a and b are numeric array even different lenght
define + in the way

1 + 1 2 3 return 1 2 4
1 1 + 1 2 3 return 1 3 4

(so padding both array with necessary 0 in the left, for doing +)
and it is easy too doing the actual 1+1 2 3 in apl as

1+¨1 2 3

this is not only for + but for all operator as +
@RosLuP I already countered about the padding. You've gotten + wrong. You are thinking of it as ∘+¨ or +¨βŠ‚:
βŽ•←1 2 4∘+¨1 2 3
@Adám
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚2 3 5β”‚3 4 6β”‚4 5 7β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜
βŽ•←1 2 4+¨βŠ‚1 2 3
@Adám
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚2 3 4β”‚3 4 5β”‚5 6 7β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜
so you say that +¨ is ok for scalar in the right?
09:38
@RosLuP Yes, both left and right. M∘+¨N is the same as (βŠ‚M)+¨N.
possible it is better each has as right argument only one list (even if contain only 1 element or 0 element too, but one list)
@RosLuP Or as left argument, yes. Or any non-scalar array, for that matter. Indeed, such are the rules of ¨ (and scalar functions): either the arguments must have matching shapes, or one has to be a scalar (well, singleton, but don't rely on that).
Ugh. We should disallow multiple assignment without parens!
@AdΓ‘m How about {(βŽ•DR βŽ•DR(⍺⍺⌿11βˆ˜βŽ•DR))⍺,[0.5]⍡}?
I noticed βŽ•DR doesn't add a new axis, so the proper way to convert back should be towards the original format.
@Bubbler Just use βŽ•DR⍀0 to add an axis.
⍞←10∧{(βŽ•DR βŽ•DR(⍺⍺⌿11βˆ˜βŽ•DR⍀0))⍺,[0.5]⍡}¯4
09:54
@Adám 8
⍞←10∧{⍉2βŠ₯⍺⍺/{(-⍺⍺0>⍡)βͺ⍺⍺2βŠ₯⍣¯1⊒⍡}⍉⍺,[0.5]⍡}¯4
@DyalogAPL Good morning.
⍞←10∧{⍉2βŠ₯⍺⍺/{(-⍺⍺0>⍡)βͺ⍺⍺2βŠ₯⍣¯1⊒⍡}⍉⍺,[0.5]⍡}¯4
@Adám 8
2βŠ₯ doesn't handle sign bit by itself anyway, and the new function above is blazing fast: (f1 is my original submission, f3 is the new one)
@Adám "Sure, filling with zeros can make sense for + and -, because that's their identity element. " even for max, min, x, division, etc
      arr←(2*31)-?100 100⍴2*32
      arr2←(2*31)-?100 100⍴2*32
      dfns.cmpx '#.arr ∧#.f1 #.arr2' '#.arr ∧#.f3 #.arr2'
  #.arr ∧#.f1 #.arr2 → 3.5E¯3 |   0% βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•βŽ•
  #.arr ∧#.f3 #.arr2 → 4.6E¯5 | -99% βŽ•
09:57
@Bubbler I told you βŽ•DR is super fast :-)
Yeah, it's really impressive.
@Bubbler No it isn't. Think about what the interpreter needs to do to convert something to its binary representation!
@RosLuP Uh, no. What would you say 10 6 3÷2 3 should give?
10 6 3÷2 3 ->> 10 6 3÷0 2 3 ok not for division
because would be one error division by zero
but the programmer has to write in the way never division by 0
Right. While this would be a possible extension (although the identity element makes more sense than constant 0), in bar far most cases, what would be a length error is actually indicative of a problem rather than the programmer wanting this.
the problem is division by zero, so to know that in the right there is no 0, and not have some positive extension with fill some 0
10:08
@RosLuP Why 0?
βŽ•←¨βŠ‚1 2 3
@RosLuP
SYNTAX ERROR
@Adám because n ÷0 is one error
@RosLuP No, I mean why fill with 0 specifically?
because when one has to compute something using digits, the number has less digit 90% of time is fill in the left with 0
βŽ•←,¨βŠ‚1 2 3
10:14
@RosLuP
β”Œβ”€β”€β”€β”€β”€β”
β”‚1 2 3β”‚
β””β”€β”€β”€β”€β”€β”˜
βŽ•←βŠ‚1 2 3
@RosLuP
β”Œβ”€β”€β”€β”€β”€β”
β”‚1 2 3β”‚
β””β”€β”€β”€β”€β”€β”˜
@RosLuP Oh, you want to fill on the left. Hm. I was thinking that 1 1 1+ would increment the first 3 elements. And then 2 2× would double the first two element. But that'd require × to fill with 1s.
βŽ•←βŠ‚,βŠ‚1 2 3
@RosLuP
β”Œβ”€β”€β”€β”€β”€β”€β”€β”
β”‚β”Œβ”€β”€β”€β”€β”€β”β”‚
β”‚β”‚1 2 3β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”˜
10:15
βŽ•←βŠ‚,βŠ‚1 2 3
@RosLuP
β”Œβ”€β”€β”€β”€β”€β”€β”€β”
β”‚β”Œβ”€β”€β”€β”€β”€β”β”‚
β”‚β”‚1 2 3β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”˜
i don't like fill with 1... i like fill 0
@RosLuP I didn't mean always fill with 1. I meant fill with the identity element, or alternatively, do nothing on the extra elements.
βŽ•←β‰’βŠ‚βŠ‚1 2 3
@RosLuP
1
10:20
βŽ•←β‰’βŠ‚1 2 3
@RosLuP
1
βŽ•←β‰’β΄βŠ‚1 2 3
@RosLuP
0
βŽ•←β΄βŠ‚1 2 3
@RosLuP
10:24
βŠ‚1 2 3 is a scalar right? it is not one list… why β‰’βŠ‚1 2 3 return 1?
possible all is one list?
@Adám "Uh, no. What would you say 10 6 3÷2 3 should give? " it should give for me 10 6 3÷0 2 3 so (10÷0)(6÷2)(3÷3) so one division by zero error...
βŽ•←1999{k←⌈/β‰’¨(a b)←⍎¨βˆ˜β•¨βΊβ΅β‹„f←{((k-≒⍡)⍴0),⍡}β‹„10βŠ₯(f a)⌈f b}2000
@RosLuP
2999
10:39
βŽ•←1990{k←⌈/β‰’¨(a b)←⍎¨βˆ˜β•¨βΊβ΅β‹„f←{((k-≒⍡)⍴0),⍡}β‹„10βŠ₯(f a)⌈f b}0
@RosLuP
1990
βŽ•←1998{k←⌈/β‰’¨(a b)←⍎¨βˆ˜β•¨βΊβ΅β‹„f←{((k-≒⍡)⍴0),⍡}β‹„10βŠ₯(f a)⌈f b}9
@RosLuP
1999
βŽ•←1{k←⌈/β‰’¨(a b)←⍎¨βˆ˜β•¨βΊβ΅β‹„f←{((k-≒⍡)⍴0),⍡}β‹„10βŠ₯(f a)⌈f b}9
@RosLuP
9
10:42
βŽ•←9{k←⌈/β‰’¨(a b)←⍎¨βˆ˜β•¨βΊβ΅β‹„f←{((k-≒⍡)⍴0),⍡}β‹„10βŠ₯(f a)⌈f b}11
@RosLuP
19
@RosLuP β‰’ counts how many major cells there are. It doesn't say anything about the rank of its argument. A scalar has one major cell. β‰’1⍴3 and β‰’1 2⍴3 also both give 1.
@RosLuP I get why you would want to fill with 0 for + and -, but why would you want to fill with 0 for × and ÷?
 
2 hours later…
12:34
cell what means?
i understand until sets and elements (pheraps)
 
2 hours later…
15:40
@nihilazo Hi there. Interested in APL?
 
1 hour later…
16:41
@Adám yeah, but I'm really unsure how and where to start with learning it, and what practical uses it has that other languages struggle at
 
3 hours later…
19:24
hello
is anyone online?
@nihilazo If you haven't seen tryapl.org then it's a place to try basic APL commands, without installing anything, or needing to install any special keyboard handling. It's good enough to see what the core of APL can do even if you can't use much advanced stuff from there. I also have little idea what practical use it has, but it is quite addictive if you like that kind of thing.
hello there
how are you?
Alright, thanks. You?
19:29
not bad
do you play dungeons and dragons?
@TessellatingHeckler do you play dungeons and dragons?
Nope, never have.
you should
what do you code in?
i code in python, html 5, and APL
What makes you recommend D&G ?
its real fun
@TessellatingHeckler also anyone that plays i want to see if they want to join my scheduled session for out of the abyss
I mostly code in Windows PowerShell, and I can branch from there to some C#, some Python. I'm not a programmer and don't code anything big in any language, but I can make sense of bits of code in popular languages.
@ThePuzzlerThree Ahh, right. I think this chatroom is possibly wayy too quiet to find just the right people in at just the right time.
19:38
:(
welp
i have to go
see you around
c'ya. Escape from the abyss safely

« first day (1073 days earlier)      last day (1875 days later) »