« first day (1226 days earlier)      last day (1431 days later) » 
06:00 - 18:0018:00 - 00:00

RGS
6:02 PM
(damn it, I was still missing a , in (↑2/⊂,⍺) )
 
Oh boy, I'm dreadfully confused about this dataype... the short summary is that ⎕DR = 326 Pointer (32-bit or 64-bit as appropriate). Who knew there were pointer types in APL?!?!
 
@AviF.S. what is (1 2)(3 4 5) if not an array of 2 pointers to 2 other arrays?
my non-⌺, probably reasonably inefficient, solutions in dzaima/APL because why not:
https://dzaima.github.io/paste/#07ZOxilRBEEXz@YoT7qJgV1d1db9k843M/BkRZBEV9S2zMKKBocEGZruDIEbul2x/iV3OBKs4sMGABgOPx6XrQtWBe09Q9Gk/f3/6ePyenPaXy0Siv33B0VGfr/r87fjB7XJ9e/GaoW8@bES833zt82Wfr/u8Pqa/eTVcY7J@NiH51/NVk0Vfveur5zu@L/seLce@MwQyaEiDAh6yQoNpSEmIxJGrs/CLIoaUkI5UpIWcyIksQ@ZMVrJt/bmQnVxDNvKEpiFV0IzGVjW0oL7xf9p97vd9jz7HfVrRhgapJUywIDXFDAtKc6xibctjEyVRgrRkilKCtBSKU4KyNMqEp63fBc94kLrhBQ9Sr3jDY2tNVKHmf8RflWrUIK1OrdQgrRMt0eT3gCzuE5I7AVncJyR3AjL8q93nXu979HFx8rc@y599Hh1@@OPy0abRhzYf2nxo8//Y5p8#dAPL
 
@dzaima Huh, I wouldn't have thought about it that way. Surprise that APL does. Well, it's my fault for not having used ⎕DR before. There's still more that I was about to post, as it doesn't completely answer my question. But thanks! It certainly helps!
Longer version: It's generated by my attempt to replace letters in a string with their indices in the alphabet. Of course, this isn't correct because the numbers have to be ⍕, but curious what it's doing
 
@AviF.S. namespaces are also pointers, they're mutable after all
 
      ⎕A⍸@(∊∘⎕A)'(A B)((D E)C)'
( 1   2 )(( 4   5 ) 3 )
Yet:
      ,¨⎕A⍸@(∊∘⎕A)'(A B)((D E)C)'
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
│(│1│ │2│)│(│(│4│ │5│)│3│)│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
 
6:06 PM
@Adám i wonder how would a stencil solution compare to a + some //
 
And ≢/⍴ are both 13 (length of the second one), so I've no idea why it prints extraneous spaces...
 
RGS
@dzaima I already have a stencil solution, in a single line it becomes {(⍺>1)↓({⊂⍵}⌺(↑2/⊂⍺)) ⍵↑⍨ -(⍴⍵)+ 2× ⌈2÷⍨¯1+⍺} so you can code a ⍴↑↓⍉ solution and then compare the two :P
 
@RGS thing is, i'm way too lazy to figure out the proper ↓↑⍉⍴ solution :p
 
After looking at the bitmap generated by ' '=..., '('=..., ')'=... & ⎕D∊⍨..., everything else also lines up with it being the string: '(1 2)((4 5)3)'
 
RGS
@dzaima ¯\(⍥)/¯
 
6:10 PM
But again, it prints more spaces than that & it's a pointer...
 
@AviF.S. try ⍴¨ on both
 
Other clue is that I can append characters to it and it prints the same way, as if it really is a character vector, but the length, display & type aren't matching those other clues...
          ⍴¨⎕A⍸@(∊∘⎕A)'(A B)((D E)C)'
┌┬┬┬┬┬┬┬┬┬┬┬┬┐
││││││││││││││
└┴┴┴┴┴┴┴┴┴┴┴┴┘
 
@AviF.S. that's telling you all the elements are scalars. What you have is the equivalent of '(' 1 ' ' 2 ')' '(' …
 
The other way it differs from a character vector is that you can't apply ⍎ to it directly, you have to do ⍎⍕ to get the array represented...
@dzaima Ugh, it's so painfully obvious now I can't bear to look at myself...
@dzaima I was so terribly confused...
What's a better way to figure out the type of something? There must be a way to have seen that it was a mixed vector of characters and number, and even which was which, no?
 
RGS
@AviF.S. use ¨ to map the 'type function' over the vector
no?
 
6:15 PM
@AviF.S. dzaima/APL has a mode to quote character/string literals for cases like that. i'll see what are the options for Dyalog
 
@RGS Not only did that not work, unfortunately, but there also might be something more ideal than seeing a list of numbers representing data types, no?
 
Umm... I have a MATH question, not necessarily an APL question - but I'll take a solution in APL...
 
Feels cooler: {⊂[2 4]⍵⍴⍨,3,⍨⍪3÷⍨⍴⍵}
 
RGS
@JeffZeitlin I hope it is an easy one :P
 
@dzaima Darn, that was even in Adám's tips... Thanks!
@JeffZeitlin Ooohh?
 
6:18 PM
In a traditional role-playing game, I can roll 2D6 once every four "years", and if I roll 8+, I get two "skills"
 
@AviF.S. seems the best dfns option is still to look at - notice the ~s at the bottom. Sadly it doesn't do anything cool for mixed-type simple arrays
 
There is an alternate set of rules where I can roll 2D6 once every year, to get one skill. What should be the one-year roll value to have the same expectation of skills as rolling 2D6 for 8+ every four years?
 
RGS
@JeffZeitlin you get 2 skills if you get a 8+ and you get 0 skills otherwise, correct?
 
@RGS - Correct
 
@dzaima Great idea, thanks! :)
 
RGS
6:22 PM
36÷⍨1⊥∊8≤∘.+⍨1+⍳6 gives the prob of rolling 8+
(beware I have ⎕IO←0 set)
so that rolling 2D6 every 4 years gives the expectation of 2×36÷⍨1⊥∊8≤∘.+⍨1+⍳6 skills every four years, which is roughly 0.833
now if you are to roll 2D6 each year, you need the expectation to be 0.833÷4 each year, that is roughly 0.208
 
@AviF.S. (i'd still use repObj)
 
RGS
@JeffZeitlin am I making sense?
 
I think so, but I believe you've got a sign error and a fencepost error somewhere; AnyDice says that the probability of 8+ on 2D6 for a single roll is 41.67%
 
RGS
@JeffZeitlin that is what I have as well, 36÷⍨1⊥∊8≤∘.+⍨1+⍳6 gives 0.4166 IF you have ⎕IO←0
 
Then where is the 0.8333 coming from?
 
RGS
6:27 PM
@JeffZeitlin If I get 2 skills by rolling a 8+, then the expected number of skills I gain every 4 years is 2×(prob of rolling 8+)
 
Ah. Got it.
 
RGS
@JeffZeitlin nice :) so now can we turn our attention to the "rolling 2D6 every year"?
 
Yes, I just worked through your code and "got" it.
 
RGS
@JeffZeitlin awesome! but please do let me know if something I say looks weird/wrong
(I have the bad habit of making mistakes ⍨)
 
/me nods
 
RGS
6:32 PM
@JeffZeitlin so actually lets modify it just slightly so we have a vector that gives the prob of rolling k+, with k in 1, 2, ..., 12
not necessarily the best APL expression for it, but (1+⍳12){36÷⍨1⊥∊⍺≤⍵}¨⊂∘.+⍨1+⍳6 gets the job done
 
Hold on...
 
RGS
which gives 1.00 1.00 0.97 0.92 0.83 0.72 0.58 0.42 0.28 0.17 0.08 0.03 if I round to 2 decimal places
@JeffZeitlin yes; does it look weird or is it giving the wrong results?
 
... which is consistent with AnyDice, so I'll take the code as correct. The "hold on" was more so I could try to work through the code and understand what was going on.
 
@AviF.S. This:
      a←⎕A⍸@(∊∘⎕A)'(A B)((D E)C)'
      Type←⊃0⍴⊂
      Num←0=Type
      ↑a(Num a)
( 1   2 ) ( ( 4   5 ) 3 )
0 1 0 1 0 0 0 1 0 1 0 1 0
 
RGS
@JeffZeitlin awesome, maybe this 36 ÷⍨ +/¨ (1+⍳12)≤¨ ⊂∊∘.+⍨1+⍳6 looks better
∊∘.+⍨1+⍳6 generates all 2D6 roll sums and enlists them
(1+⍳12)≤¨⊂ goes over the numbers 1 to 12 and checks which of the roles are ≤ than the given number
36 ÷⍨ +/¨ then for each of those numbers we sum them and do that divided by 36 because there are 36 different 2D6 rolls
ok
 
6:38 PM
Right.
 
RGS
so we were at the point that the 4-year rule gives an expected 0.8333 skills every 4 years
 
RGS
so if I am to roll every year, if I need to obtain on average 0.833÷4 skills per year
and 0.833÷4 gives roughly 0.208
so my yearly rule should have an expectation of 0.208 skills, right?
 
Right.
 
RGS
awesome; now if you inspect our vector of probs, can you see the "problem"?
 
6:40 PM
No close match - we need a "9.5" or thereabouts.
 
RGS
yup
9+ is too lenient and 10+ is too restrictive
a possible fix might be requesting a specific roll order or smth like that; e.g. roll 8+ and roll the smaller number first
(no idea if these specific restrictions add up to the correct probability)
@JeffZeitlin do you want to keep exploring this in any direction? or "are we done"?
 
I think I need to put it on hold for now while I check some actual numbers from the game rules.
 
RGS
sure :p feel free to ping me any time to discuss some probabilities/combinatorics + APL :)
Are you playing D&D, if I may ask?
 
Traveller, not D&D :)
 
You can get pretty close with 6D6 rolling 25+, 0.205847
 
RGS
6:45 PM
@voidhawk nice! how'd you find these numbers?
 
@voidhawk - Yes, but Traveller is traditionally always 2D6, maybe 3D6 in very specific circumstances.
 
I see - I used to play Shadowrun 3rd ed, so we had what felt like hundreds of d6's
@RGS Basically ran ⍪{⍉(⍳6×⍵),⍪6{(6*⍺)÷⍨+/⍵≤,+/¨⍳⍺⍴6}¨⍳6×⍵}¨⍳10 and looked for close numbers
 
RGS
@voidhawk +← 1
 
Wait. Why is it division, rather than root?
 
RGS
@JeffZeitlin where? in the 0.833 divide by 4?
 
6:52 PM
Yes
 
RGS
please check my understanding first:
in the new ruleset I get to roll 2D6 each year regardless of what happened in previous years and if I roll "well", I get one extra skill regardless of how many skills I already earned
 
RGS
ok. so by the time 4 years have passed, the number of skills you earned is obviously the number of skills you earned in the 1st year + skills earned in 2nd year + skills earned in 3rd year + skills earned in 4th year
 
Right
 
RGS
but the nr of skills you gain each year is something that is completely unrelated to what happened in the prev years and what will happen in the upcoming years
 
6:57 PM
Correct
 
RGS
so that the prob of gaining a skill remains constant throughout the years
so the expectation of (skills earned this year) is also constant throughout the years
 
That implies, then, that if I have 100% probability in four years of one skill (I don't have to roll, it's automatic), I should need a 9+ rolling every year.
 
RGS
@JeffZeitlin I couldn't follow. In the yearly ruleset you get a free skill every 4 years?
 
No. I looked up one career in the four-year set, and in that career, you are guaranteed one skill in each four-year term.
 
RGS
ok, but I didn't understand how that changes our calculations
 
7:01 PM
So, to have the same skill expectation in the once-per-year set, it should be 25%, which is roughly 9+ on 2D6 annually.
(25% each year)
 
RGS
Yes, if you want the yearly system to give on average 1 skill every 4 years, then 9+ is what you are aiming for (roughly)
but does that mean you ended up understanding why we divided by 4 instead of taking the 4th root?
 
Yes; it's just that intuitively, the 9+ seemed like it was too HIGH, rather than too LOW.
(technically, it's a sconch too low - but 10+ is too high)
 
RGS
@JeffZeitlin (exactly)
@JeffZeitlin I see, but if you took the 9+ lower, to things like 7+ or 8+ then you'd be making it really easy to earn a skill in a single year, so that by the time 4 years have elapsed, you earned a lot of skills :-P
 
...which is actually the problem I'm discussing on a mailing list!
 
RGS
@JeffZeitlin alright, so what are you going to do?
 
7:07 PM
Well, now that I have good numbers to discuss with, I can actually work up how to change the extant rules to fix the problem.
 
RGS
great :D
 
... and add some rules for the careers that didn't have one-year versions.
 
@Adám If it had occurred to me it were a mixed vector, this would've been a beautiful display of which were which! But is there a generalization I'm not seeing here, for what you're suggesting in the future?
 
RGS
if you wanna stick with 2D6, notice that 3⍕7 8÷36 is 0.194 0.222
so if you are allowed to earn skills with specific combinations of rolls that aren't necessarily "addition of the two numbers"
then you can aim for a rule that accepts 7 or 8 out of the 36 possible rolls, for those 19.4 / 22.2% probabilities of earning a skill
with 2D6, those are the best you can do to match the 0.833 for a 8+ 2D6 4-year rule
to match the "earn 1 skill every 4 years for sure" then you can find an yearly rule for 2D6 that accepts 9 out of 36 rolls
 
Well, in writing my own rule, I can theoretically do anything I want, but there are certain traditions which will meet significant resistance if broken...
 
RGS
7:11 PM
@JeffZeitlin of course
what type of rolls are common? k+ and what else?
 
(Rule Zero of any roleplaying game, Kevin Siembada notwithstanding: "An ye like it not, CHANGE IT!")
k+ or k-, basically.
 
RGS
@JeffZeitlin well those are the same, so yeah
and D6 is all you have?
 
Yes. Most of the time 2D6, occasionally 3D6 or 1D6
Later versions and mass combat rules might allow 4D6 or 5D6, but it was more likely that they'd change the damage level rules and muffin it back to 2D6
 
RGS
hmm if you were allowed to propose crazy rolls, you could do "roll an odd number and then roll something larger" for 25% (equivalently, roll an even number and then something smaller)
 
@DudeMan Welcome back!
@DudeMan Did you get an opportunity to watch the GoL video, by any chance? It's a lot of fun :)
@all Forgot to mention that I really meant ⍳ rather than ⍸ in ⎕A⍸@(∊∘⎕A)'(A B)((D E)C)', so don't follow my bad example :)
 
RGS
7:51 PM
re: GOL I was running some random GOL simulations and came accross this fun lad
 
8:49 PM
@AviF.S. Uh, yes, this is a general solution. It will take any array and recursively replace all numbers with 1 and an all characters (and other simple scalars) with 0.
 
9:11 PM
What would you do to convert a character to It's ascii value? Is that what ⎕ucs is for?
 
@Wezl Yes, monadic ⎕UCS. Did you try APLcart?
 
@Adám Ok, I'll stop bugging you and start using that
 
@Wezl I don't mind answering, but I'm not always around. :-) That said, please let me know if you try searching for something and don't find it, whether with your initial search terms or at all.
 
9:25 PM
@matt.s Hi. Interested in APL?
 
RGS
@Adám what is the point of enumerating local variables in a tradfn?
 
@RGS Creating a separate symbol table for the new stack frame.
 
RGS
@Adám which means..? :P
 
@RGS When entering a function that can see its environment, but also can shadow some of the surrounding symbol table, there must be a new symbol table. The locals' declaration defines that symbol table.
 
RGS
ah ok
I guess I get it
otherwise the variables I declare become global?
I find the docs are extremely hard to navigate :/
Looking "tradfn" up returns only 2 results and neither looks really good
so, @Adám, what is the syntax to enumerate a tradfn's local variables?
 
9:52 PM
@RGS Hm, I don't think there is any short way to do it, other than get the ⎕NR of the function and remove all comments and strings. Remove up until before the first ; on the first line. Locals are then all names following ;.
 
RGS
@Adám oh, you misunderstood the question
I meant the syntax you use to code it, I never wrote a tradfn in my life and the stubs in the contest file don't have local variables enumerated so I can't really work from that
 
@RGS Oh.
 
RGS
@Adám oh wow, I wrote "tradfn" in APLCart and because I didn't find a single line with a ∇ I disregarded all the results ⍨
sorry for that
 
@RGS Should I add as a keyword to those two?
@RGS Have you tried exploring all the code that comes with Dyalog?
 
RGS
@Adám I am absolutely positive I did not :)
apart from having a look at the dfns for Gauss-Jordan elimination and the prime sieve ones, not really
 
9:58 PM
@RGS How about looking at the instructions?
 
RGS
@Adám didn't think of that... :/
@Adám I don't think so... I searched for "tradfn" and a bunch of results popped up and then I didn't read the descriptions, I looked at the code samples to look for a tradfn header, that I thought started with ∇
When I saw no code sample had a ∇ I assumed I was not going to find what I wanted.
 
@RGS The isn't actually related to tradfns at all.
 
RGS
@Adám (I am having a hard time finding this code in my machine)
 
@RGS There are a bunch of workspaces in the "ws" dir of the install dir, and a bunch of stuff to explore in ⎕SE.
 
RGS
@Adám found the workspaces
"a bunch of stuff to explore in ⎕SE" means what, exactly?
i.e. how do you explore a quad thingy?
What I mean is: by "a bunch of stuff to explore in ⎕SE" do you mean the source code of ⎕SE? I don't know if it makes sense to talk about the source code of ⎕SE
@Adám wait what is ∇ for, then?
 
10:09 PM
@RGS ⎕SE is a root namespace, just like #. You can navigate to it with )cs ⎕SE or just type ⎕SE. and use AutoComplete to explore. Set Options>Configure>Auto Complete>Make suggestions after: 0. Or you can open the Workspace Explorer (second button in the "Tool" toolbar). Or use ]map ⎕SE (huge output!).
 
RGS
@Adám the auto-completion was a nice tip, was able to look at some random code in ⎕SE
incidentally I looked at code that had some notes starting with a date and "Adam:" who I assumed was you :P
 
@RGS But good challenge nontheless.
@RGS Yup, internal changelogs. Now you can see some of what I do when I'm not/while hanging out here.
 
RGS
Apart from that, I looked into ⎕SE.Dyalog.Utils and I noticed that in the display function something named ch is used but it isn't defined in that file (i searched for it with the search bar) so those files have interdependencies?
 
@RGS Uh, it is defined on line [1] of display.
 
RGS
...
someone didn't follow your style guide: parenthesizing stranding assignment; I thought ch was being used as left argument to ⎕PP
either way, sometimes your answers just make me feel ridiculous xD enough for today, gotta go get some sleep
Thanks for your help, as per usual ○/
 
10:20 PM
@RGS Now you understand why I added that to the style guide. That particular function is a great example of what my guide tries to avoid.
 
RGS
10:31 PM
@Adám yes I do...
 
10:55 PM
@Adám what historical mistake is the cause of that one?
was there a time when the prepended syntax didn't exist?
 
@RGS @dzaima It is just the symbol to open and close the built-in line editor — you know form the typewriter days.
 
@Adám right.. Now we have typewriters to blame for strangeness in modern APLs syntax too. ¯\_(ツ)_/¯
 
@dzaima Not really. The huge enormous fundamental design mistake was using the same symbol for both opening and closing the editor. If they had only used two different symbols (e.g. and ) the world we live in would have looked very different.
 
@Adám imo planning for an inline editor in the REPL itself is a problem. But either way, the only distinction between a tradfns header and source being that the header is only at the first line is bad enough.
 
@dzaima Is that really so different from other languages' function headers?
Bedtime — ○/
 
11:05 PM
@Adám Every other practical language I know I'm pretty sure has a way to tell syntactically whether a line defines a function or not. In APL a←b c d can be either a header or assignment.
 
RGS
@Adám I'm gonna touch up on APL Cart's "range" search results so you can expect a PR from me any time soon-ish (TODO)
 
06:00 - 18:0018:00 - 00:00

« first day (1226 days earlier)      last day (1431 days later) »