« first day (2246 days earlier)      last day (409 days later) » 

5:14 AM
Hack: ⎕SE.⎕FX'stp' '⎕SH''ps -ho ppid $$ | xargs kill -20'''
 
guys any tips on shortening this... codegolf.stackexchange.com/questions/259167/…
like maybe porting the bqn answer somehow
i dont understand the bqn answer there tho
 
5:37 AM
@AidenChow Can a byte by abusing dyadic : ⌈/0,⍋-⍳⍨.
That's what BQN is doing.
It can further remove one byte because BQN's Reduce let's you supply an initial element as a left arg, letting you replace 0, with just 0.
 
5:52 AM
@B.Wilson apl doesnt have that?
@B.Wilson i have no idea whats going on here lol
wat does with two arguments do again?
and whats that squiggly face
 
@AidenChow does a few things. ⍺ f⍨ ⍵ is just ⍵ f ⍺, and f⍨ ⍵ is the same as ⍵ f ⍵.
It also turns arrays into constant functions like, so A≡A⍨ ⍵.
 
ok ive never seen that triple line equal sign thing before :\
ik what it means in math tho :P
 
Ah, sorry, that's just "equal as arrays", i.e. the left side must have same shape, same depth, and same contents.
@AidenChow Dyadic is Index Of and a really good tool to have in your belt :)
 
oh, regular equal sign doesnt cover that? ig it only compare numbers?
 
Yeah, = is a Scalar Function, meaning that it will compare individual elements of the left and right structures. So 'abc'='acc' returns 1 0 1, while 'abc'≡'acc' just returns 0.
@AidenChow Index Of! It's a really good tool to have in your belt :)
 
6:04 AM
@B.Wilson u reply to the same msg twice lol, it must be a really good tool XD
 
@AidenChow Lol. Apparently much better than my cut and paste skills.
Dyadic "indexes into" the left array. I.e. for every element in the right array, it returns whatever index that element is in the left array.
So, e.g, 2 1 2 1 3≡'abc'⍳'babac'.
 
@B.Wilson ah cool! what if it was the other way, like 'babac'⍳'abc'. would it take the first possible one like 2 1 5??
 
yes, and if anything isn't found at all, it gives the next unused index.
 
Yeah. It's good to think about the domain edges like that. Also good to wonder what happens with higher-ranked arrays :)
 
so (⍳⍨) ⍵ is ⍵ ⍳ ⍵?
but what happens if contain duplicate, like 2 2 2 2, wont ⍵ ⍳ ⍵ return 1 1 1 1, not 1 2 3 4 like i want?
 
6:19 AM
It will, so it becomes a type of id numbers.
Many operations can be performed faster on ⍳⍨⍵ than directly on .
 
By the way, is ⍳⍨ as shorthand for ⍳∘≢ really abusing ? I don't see it in the idiom list, so I'd assume that the latter is O(1) while the former is O(n).
 
id numbers??? what now
 
⍳⍨⍵ is only ⍳≢⍵ if ⍵≡∪⍵.
⍳⍨⍵ needs to do all kinds of fancy lookup and hashing etc. so probably O(n log n) or somesuch, whereas ⍳≢⍵ is O(n).
 
ok wait im kinda confused... is ⌈/0,⍋-⍳⍨ the same thing as my answer??
rip... it didnt pass all test cases
 
@AidenChow Yeah, if your input has duplicate elements, then it's not right.
 
6:26 AM
@B.Wilson ah i see...
then how is the bqn doing this then??
didnt u say that the bqn answer was doing this exact thing?
 
I was wrong. Oops! :P
 
man.... then what is bqn doing that is 2 bytes shorter than mines???
 
Looked up the primitives before answering your question, but it turns out that BQN has progressive Index Of as a primitive! . I missed that underbar.
 
Hi APL, one small query
Why does pick zilde work but not with indices?
      ⊃⍬
0
      ⍬[1]
INDEX ERROR
      ⍬[1]
       ∧
      1⊃⍬
INDEX ERROR
      1⊃⍬
       ∧
 
@B.Wilson ohhhh lol, thats the issue with all these similar looking unicode
 
6:34 AM
@sloorush Monadic isn't Pick, it's Disclose, so an entirely different function.
Part of the definition of Disclose is to return the prototype of an empty array.
 
@sloorush smth about returning a prototype, based on what im reading from the wiki
 
Ooh okayy! I was focusing on Monadic ⊃ being first rather than disclose, thanks @B.Wilson @AidenChow!
 
I found dyalog does not support (⍳0)⊂'123' '12' '32' return '123' '12' '32', while APL2 document says so.
 
@Adám BTW, I had a chat with Aaron earlier about Under, since I have lots of thoughts about it. He suggested we form a discussion group, and I propose the name Underground Talk if we do.
@LdBeth That's the same as 0⊂..., no?
 
      (⍳0)≡⍬
1
 
6:49 AM
oh nvm, I meant (⍳0)⊃'123' '12' '32' which works as expected
 
7:17 AM
@B.Wilson You mean an email group?
 
7:45 AM
wtf is going on with my fork... ive been trying to see the issue for ten minutes and i dont see whats wrong.... so i have this function h define elsewhere
and im trying to do {(h ⍵)/(⊢⍵)} as a fork
now {(h ⍵)/(⊢⍵)} is working perfectly fine
then that look like the fork format (f g h) ⍵ -> ( f ⍵) g ( h ⍵)
so i try h/⊢
and wtffffff??? it dont work now??
do i have some fundamental misunderstanding of what a fork is??
this is the train tree:
 
@AidenChow No you don't. It's just because / is a hybrid glyph that can be either a function or an operator, and will be interpreted as an operator if there is a function to its left
 
    ┌┴┐
    / ⊢
  ┌─┘
( where h is)
 
so you have to either parenthesise or use /⍤⊢ to force it
force it to be interpreted as "compress/replicate" function rather than reduce operator
(h/⍤⊢⊢)
 
@RikedyP that didnt work... it still giving me an error
 
what's your actual function?
sorry parens don't work I don't think
 
7:52 AM
cant give actual function... its part of the apl contest. just trying to debug my unsuccessful attempt at converting my dfn to a train
 
let me try and get you an example to work
 
heres the error tho: SYNTAX ERROR: The function requires a left argument
 
yeah I'm also trying an example that's giving me this
might have to wait til @Adám turns up
I either get that or SYNTAX ERROR: The function does not take a left argument
 
⊢⍤/
 
@Adám yo that works, thx!
 
7:55 AM
lol my bad
 
now how does it work tho
 
it forces / to be interpreted as the function by binding it to operator
 
⊢⍤f always gives the same result as f but since an operator cannot be an operand, forces f to be a function. See apl.wiki/hybrid
 
I don't find this workaround particularly pleasant
 
holy crap my train looks less readable than my dfn... i thought converting to a train would make it look nicer lmfao
 
7:57 AM
it doesn't always
in fact, there are a number of aplcart entries I think come across a bit meh for having been trainified
 
Right, it is a bit ugly, but probably less bad than adding four new glyphs.
It does, however, work out nicely when you anyway want to post-process the result of /
 
now im thinking if i should keep my dfn as my submission or switch to the train lol
 
Either is fine.
 
but like what if points get mark off cuz its so unreadable lol
 
choose the one which is better to demonstrate your understanding
 
7:59 AM
@AidenChow Won't happen.
 
hard choice...
@RikedyP one show understanding of train, other show understanding of dfn... :\
obviously cant submit both
 
@AidenChow demonstrate understanding of the problem and how you chose to solve it
it's not an APL language knowledge competition
 
@AidenChow As long as each is optimal for the choice of type, they get judged the same.
 
it's a problem solving competition
someone can submit an entry without a single train or tacit function and do just as well
 
@RikedyP yea... all my submissions are dfns rn
 
8:04 AM
That's fine.
 
what if i mix tacit and dfn throughout the problems... is that score better?
 
@AidenChow makes no difference - that's a personal style choice
but you are welcome to - some people like to mix styles - but whether something is tacit or dfn, by itself, is not a factor in judging
 
ok then what changes to my code will reflect better with the judges, if not for coding choices or readability??
 
but we were talking about simply whether you would be marked higher for using tacit or dfns
readability is broader than that
 
errr but doesnt tacit and dfn affect how readable ur code is...
 
8:10 AM
@AidenChow depends who you ask
 
yea so do readability affect anything?
 
e.g. either or both of using sensible variable names and providing comments that explain why your code is doing what it is doing - to aid in demonstrating to the judges your understanding
↑ an example of a positive, actionable advice for improving readability
 
but phase 1 cant include comments right, only phase 2 can put comments?
 
"prefer tacit over dfn" is not a comment on readability, because it depends on exactly how you spell your function or expression
@AidenChow true
 
@RikedyP also i dont have many variables in my phase 1 solutions... is that bad
 
8:13 AM
@AidenChow ah now that is something that likely can be improved
most, if not all, phase 1 problems can be solved in a single expression, usually without temporary variables
 
ok... so using variables is not good?
 
although one or two in-line assignments in phase one might be okay
@AidenChow not for phase 1 so much, but maybe I should try and give an example - they aren't outright banned
okay beyond this I cannot give any more advice as it would be unfair
 
bruuuuh half my submissions so far have variable in them... this is bad
 
but I will give an example of where I personally (not an official judges statement) believe that lots of variables in a one liner is less good than some equivalent
 
one variable wont be too bad right
 
8:16 AM
@AidenChow no not at all
 
cuz some of the problem need to return 2 element arrays and idk how to reuse the value without storing in a var :\
@RikedyP ah great! all my submission have at most one var, this isnt looking too bad now
 
@AidenChow right - I think you may be thinking too much about very tiny details. Remember, in APL there is always several ways to express the same thing, so we don't have super specific judging criteria like "always use tacit" and "never use variable" because different styles can be used and be equally readable and good solutions
 
its the tiny details that always count in competitions...
 
@AidenChow tiny is in the eye of the beholder, I suppose
@AidenChow that sounds like a very sensible use of a var, imho
 
so u guys dont have some sort of rubric??? isnt that a bit subjective?
@RikedyP now im interested in this example u mention lol
 
8:25 AM
@AidenChow there is an element of subjectivity - and this is an ongoing debate. We certainly could not writing something like "deduct one point for each new variable used in a phase 1 problem" because that would be nonsense
And here comes some subjectivity for you then:
and specifically just for phase 1
{isVowel←⍵∊'AEIOU' ⋄ vowel←isVowel/⍵ ⋄ ≢vowel}'COOLAPL'
this is actually quite a good solution to the sample phase 1 in many ways
and even for phase 2, if you like this coding style, it is a good use of names and variables in my opinion
but a more direct and idiomatic way of expressing the same idea, for phase 1, is to simply add up the 1s
so perhaps this is more demonstrating a less optimal solution than necessarily a comment on variables vs no-variables
 
@RikedyP wow that looks pretty verbose, thats considered good??
 
@AidenChow no not for phase 1
but it's not terrible
 
but obviously {+/⍵∊'aeiou'} is better
but only really because it is more direct, not just because it doesn't use temporary variables
 
what if the variable assignment is like within one expression, not separating with
 
8:36 AM
@AidenChow in production code, some people and organisations prefer a style like this
 
@RikedyP oh ya that looks way more clean
 
@AidenChow again, for one variable, or maybe two at a stretch, that can be okay
@AidenChow well that's subjective ;)
 
@RikedyP lol ya, i think yall really need some kind of rubric or scoring system or smth for this... seems very subjective to what the judge like and dont like...
can easily get marked off just becuz the judge dont like smth in my code
even tho it might look good for someone else
 
@AidenChow we do give scores based on criteria, just not a super specific rubric, and there are a handful of judges of varied experience and taste, so I believe it comes out fair. Obviously we understand that a public rubric would be helpful for contestants, but we would want to write one which continues to allow the flexibility in styles and approaches that we love to see every year.
You're certainly not the first person to raise this issue
although it has only been in the last few years, I don't believe anyone brought it up in the decade before, oddly enough
hopefully we can take that as a sign of interest in the competition having grown
 
@RikedyP lol ya, this my first year doing this competition
recently start learning apl too :D
 
8:43 AM
@AidenChow Well that's awesome
 
@RikedyP ah so it go through multiple judges??
 
glad to have you, and good luck! there have been first-time APLers win in the past, although I think a lot of people take a few goes at it as well
 
@RikedyP thanks! but i consider my chance of winning very very low lol
 
I think most coding competitions have to use some more specific and boring judging criteria like "who submitted solution first" or "wrote the fastest code", so I hope you can understand how we want to preserve what we feel is a pretty unique style of coding competition
 
yea pretty unique, but also some concern about too much subjectivity. after all thats why these other coding competitions u mention have those criteria in the first place
 
8:47 AM
@AidenChow well, although I said you might be overly worrying about certain details, the fact that you're worrying at all is a good sign that you're likely to have a high quality submission
 
@RikedyP idek if im worrying about the right things...
i could be totally off base here and have the most garbage solutions out there
 
@AidenChow I'd worry about solving the problems first and foremost
 
@RikedyP yea i still have to work on 1:10 lol, maybe i should do that first before improving on my other 9 solutions
 
@AidenChow and there's phase 2
 
@RikedyP yea idk if i want to do phase 2... seems like a hassle to get a local copy of apl on my laptop to test everything... and i might need to make my own test case too just to ensure my code is correct
wait u need to submit correct solutions to both problem in phase 2 to qualify for that raffle thing right
or its just partial solution?
 
8:53 AM
rules are on the website:

Phase 2 Random Prizes

You must be a full-time student at the beginning of the competition.
You must correctly solve at least one (1) Phase 1 problem.
You must correctly solve at least one (1) Phase 2 problem.
there are two phase 2 problems - but you must correctly and fully solve one of them
 
oh
like all the tasks?
 
yes
 
:\
what if u even get one task wrong, u r not qualified?
 
Make sure to test your solutions!
 
so like even if u get a random edge case wrong u gonna be disqualified from the raffle right
phase 2 seems way more complex than phase 1 and im already struggling on phase 1 lol
 
9:00 AM
@AidenChow No, we do distinguish between basic and edge cases.
 
@Adám ah, so if u get an edge case wrong u r still qualified?
 
yeah
 
but a basic case not so much?
ah ok
might give it a shot then, at least i know i can butcher the edge cases without much trouble
might have an issue with testing the code tho... dont have local copy
alr oof i gotta be going, this has certainly been enlightening. been talking for longer than i expect lmfao
 
@AidenChow Why is it you cannot install locally?
 
 
5 hours later…
2:24 PM
@Adám Doc for ⎕USING says "The first string specifies the name of a .NET namespace; the second specifies the pathname of an assembly file. This may be a full pathname or a relative one, but must include the file extension (.dll)."
However, dotNET core interface guide has an example like this:
⎕USING←,⊂'System,System.dll'
⎕USING,←⊂'System.Net, System.Net.Requests'
⎕USING,←⊂'System.IO'
What's with that second ⎕USING line not specifying a file extension? Maybe the space is special?
 
2:41 PM
I guess it simply translates to the import statement in csharp
 
That particular example seems to work, but playing around a bit, supplying the .dll extension seems to cause the assemblies to not be found.
E.g. ⎕USING←,⊂'System.Diagnostics,System.Diagnostics.Process' ⋄ Process.GetCurrentProcess calls the method as expected, but with .dll on the assembly name, it generates a value error.
 
If your are using the UNIX version then dll is not likely to be the extension
 
@LdBeth .dll is strange for Linux, but it's Microsoft. For example, /path/to/dotnet/installation/shared/Microsoft.NETCore.App/3.1.25/mscorlib.dll
 
3:07 PM
@Adám u need admin privilege right??
 
@AidenChow Depends. What system are you on?
 
@B.Wilson windows 11
 
3:28 PM
@AidenChow Ah, okay. I know very little about Windows, unfortunately. I would expect there's a way to install under your own user, though. Until someone else with better knowledge than me comes along, it might be worth searching around for general information about installing software as a regular non-admin user.
 
@AidenChow No, you can install as regular user. It should just work if you run the installer.
 
3:44 PM
Much better:
'getpid'⎕SE.⎕NA'I4 libc.so.6|getpid'
'kill'⎕SE.⎕NA'I4 libc.so.6|kill I4 I4'
⎕SE.⎕FX'susp' 'kill getpid 20'
Now ⎕SE.susp will background the session like ctrl-z should :D
 
@Adám ah good to know!
 
4:01 PM
@B.Wilson Maybe ask for that operation to be added, so it can have a keyboard shortcut?
 
@Adám I poked Vince about it a while back. It just took me this long to figure out a proper workaround.
FWIW, I also stuck this on the Forums in the off chance someone finds it useful (hah!): forums.dyalog.com/viewtopic.php?f=20&t=1898
 
@B.Wilson Nice. ("pid_t to be and int:" should say "an", not "and") I'll try to get some attention to that.
 
Cheers. Fixed.
 

« first day (2246 days earlier)      last day (409 days later) »