« first day (1457 days earlier)      last day (1198 days later) » 

6:52 AM
funny idea: execute with axis value
 
@ngn i'm trapping domain errors, because the streams are "infinite", which means they're going to halt eventually
and they'll halt because of a domain error in the iterator or mapping function
i don't want it to be handled by something else / displayed
@Adám hmm, right, i was thinking if i can somehow avoid using tradfns, but this feels really weird for me. there is no way to mutate a vector a few stack frames above in a dfn?
 
ngn
7:40 AM
@KamilaSzewczyk sounds fragile. what if a domain error is signalled for a different reason?
 
yeah, it's quite fragile for now
i'm trying to rewrite this all as a class
 
ngn
@KamilaSzewczyk i don't see how tradfns or oop can help you, to be honest
 
the API will be a bit more elegant, also i can hold some state variables
 
ngn
@KamilaSzewczyk can you post the source code in copy-pastable form?
 
old?
okay, wait a second
 
ngn
7:43 AM
yeah, like in yesterday's screenshot
 
ngn
thanks
 
no problem
 
ngn
what argument do you give to Stream?
 
5 200 Stream '2×⍵' '1+⍵' '⎕←⍵'
 
ngn
7:46 AM
ok, that gives me a 0
 
you could try forcing it to collect the results, by swapping out the 1st string as '⍣2×⍵', but that doesn't work
@ngn because the stream doesn't get collected
i needed to implement better limit, some sort of a working and non-erroring collect
∇ init aStart;aIterator will this work as a valid declaration of a tradfn taking two arguments?
i've seen it in some code somewhere, but i think aIterator here will be a local and not anything else
 
That declares aStart as the name for and makes aIterator just a private variable
 
okay, so i'll move it to the beginning
 
ngn
@KamilaSzewczyk i must be missing something. you don't call app at all
 
@ngn if you ask for collection, then i append a finisher everywhere which calls app with the argument
 
ngn
7:58 AM
the first of ⍵ doesn't start with ⍣, so the part of the code that says "app⍵" is never reached
 
@ngn in this case, yes
5 200 Stream '⍣2×⍵' '1+⍵'
this would work, if my code worked
which unfortunately doesn't seem to be the case
 
@dzaima is it possible to have ranges to and from infinity in dzaima/APL?
 
ngn
@KamilaSzewczyk ah alright, now i get a value error for app
 
if you have any tips regarding code style, i'll take everything
because i'm dead lost in my own code
 
ngn
@KamilaSzewczyk let me first understand what it's doing :)
i'm a slow reader
 
8:01 AM
i'm both a slow reader and thinker
writing this code took me about two days
which is ridiculous
 
@Razetime What would that do? And can't you use Rank?
 
Rank?
I want to use it for a question regarding interval notation
it takes union of each list, and then intersects everything after that
 
@Razetime Still doesn't answer what it would do.
 
I want to use … with infinity and then perform set operations
 
use my streams when they're done :^)
 
ngn
8:07 AM
@KamilaSzewczyk very strange: when i put ⎕←⍬ at the beginning of inner (in lim), it works
 
(chat markdown for strikethrough is three dashes)
 
@KamilaSzewczyk sure
@ngn how did you figure this out
 
i can't even begin to understand why that would change anything
maybe i found third dyalog bug while writing my code :)
 
ngn
8:09 AM
@Razetime i tried my secret super-advanced debugging technique: ⎕←⍺⍵
 
sadly not all software is idiotproof
@ngn i was debugging using ctrl+enter
 
@ngn genius
 
but sometimes the interpreter segfaulted
 
ngn
i'm sure @Adám will bring this to the attention of the relevant developers
it does look like a bug
 
@Razetime I still don't get where with axis comes it.
 
8:17 AM
@Adám what do you think of that code
 
@Adám oh that was just a random shower thought™️
 
(What‽ Unicode has both ™ and ™️‽ What's wrong with them‽)
 
but, think about it: execute with axis
 
doesn't even work on rank≥2, so axis makes no sense.
 
ngn
@Adám one of them should've been TMN :)
 
8:21 AM
If it executed each row of a matrix, then sure, ⍎[1] could execute each column, but seriously, that's like never useful.
 
@Adám i know but funny command work on matrix
      A←⍉↑'2+3+4' '4+5+6'⋄⍎[1]A
  9 15
 
More interesting:
      (⍎,⍎[1])2 3⍴⎕D
12 345 3 14 25
 
I'm gonna make my own dialect, with only this part changed
 
@Razetime definitely no. And even if you could, no operations could be done on them as they'd take forever
 
What would be a good name?
APLWithExecuteFirst
@dzaima alright :P
I just want to get it under 34 bytes fnsdfjsn
 
8:30 AM
@Razetime But why not simply make a leading axis function and then use the regular Rank instead of the anomalous Axis? Execute←⍎¨,⌿
@KamilaSzewczyk @ngn I'll report it.
 
I actually mailed earlier revision of that code to the support
because it segfaulted the interpreter
 
Good. Thank you, but this is a different issues. Do you want to email this too, or do you want me to log it?
 
i'll mail it in a second
 
Super.
 
> We have made important fixes to 18.0 in the time since then, so please visit our website and download our latest available Dyalog for Linux from our Download Zone.
hmm
 
8:43 AM
This latest bug reproduces in my month-old 18.1
 
okay, i'll install that
where can i download 18.1
there's only 18.0 on the website
 
You can't. It hasn't even entered Beta yet!
 
I got this error message when I opened RIDE:
> Could not load bridge interface functions. (Error 0x00000000: "libhostfxr.so: cannot open shared object file: No such file or directory")
 
Yeah, very annoying. I added a workaround to that yesterday.
 
@Razetime Your current answer is not even correct
 
8:46 AM
okay, it seems gone
 
@Adám comedy is more important than utility
 
@Razetime Funnier statement if you remove both "the"s.
 
@Adám mailed
 
Thank you.
 
for now, is there a workaround which won't obscure the console?
 
8:51 AM
Yes, ⎕←⍬⊤⍬
 
hmm, okay, thanks
 
@Adám how do I make output to the output window instead of debug?
 
@Razetime Why do you want that?
 
@Bubbler Because output without line break to stdout.
 
I want to output without newlines to STDOUT for this
 
Outputting to STDERR is allowed by default, if you're solving a Code Golf challenge
 
9:06 AM
Never output to stderr, unless EOF is read.
that's in the challenge description
 
wtf.
 
or alternatively
how do I make ⎕← output without newline
 
Answer for both questions is that you can't directly do so. However, maybe you can redirect stderr to stdout…
Alternatively, you should be able to use ⎕ARBOUT to send raw bytes to the stdout stream.
 
@Bubbler thanks a looot
@Adám this would make the ⎕: prompts come up in stdout
 
Wait, you have s too? Just use ⍎⍞.
 
9:14 AM
@Adám Can you? I tried various X values but nothing worked
 
I don't know much about this. Let me see if I can get Andy in here.
 
@Adám wait how exactly?
 
He's in a meeting. I've ordered a notification when he's available.
@Razetime Getting input from is almost the same as ⍎⍞
 
oh ok got it
ok now how do I redirect our stderr stuf
 
You have to do that from the command line when you start APL.
 
9:17 AM
oh well then
so much effort aaaaa
 
You're doing something unusual.
 
well, onto the next question
old questions are bees
 
Just skip challenges with messy I/O. That saves time a lot
... or anything before 2016 or whatever
 
9:32 AM
every time I look through the challenges in the SEDE query they all seem impossible :((
or very hard
 
@rak1507 use the random question script that redwolf made
I've found a bunch of 200s from there
 
@Razetime oh do you have a link?
 
dumb question how do I use user scripts
 
@rak1507 also, here's my list of possibly solvable questions
@rak1507 chrome -> tampermonkey
 
9:36 AM
wow that's a lot
 
firefox -> greasemonkey
 
<moon-child> I thought greasemonkey had come under new ownership and was no longer trustworthy
 
I use Tampermonkey on FF.
 
<moon-child> and tampermonkey works on ff now
 
I have ~50s on my list, all for 200 and some 400
 
9:37 AM
oh great I';; switch to that
 
though I haven't tried much recently
 
wow lol I don't keep actual lists I just skim through the query
 
if you do finish one of those in apl, just comment on the list and i'll add a checkmark
 
alternatively, violentmonkey if you don't like that tampermonkey isn't open-source
 
sounds like a good idea
@Razetime I would feel bad using your list
right which one of the monkeys do I use, too many options
 
9:38 AM
the point is to prevent boredom, not hoard rep, so go ahead :P
@rak1507 tampermonkey
 
@Razetime I thought the point was to get ready for The competition…
 
uhh it was initally to find easy 100s
then it became a graphical output only list
and now I just use it for boredom
If I was getting ready for the competition, it would make more sense to attempt actually hard math based questions rather than these
 
the competition... I should probably do some actual proper hard APL practice so that I can do the hard ones
 
ngn
writing comments is more important than maths :)
 
For phase II, you'd want to exercise writing good APL. So yes, including comments.
I guess you could use CR for feedback…
 
ngn
9:41 AM
good as imagined by the organizers
 
Good as decided by the organisers.
 
i don't know how should i prepare for the competition
probably i'll try myself at it but nothing will come out of it lol
 
@ngn well, yeah. Everyone's gonna have a different definition of "good", you literally cannot satisfy everyone
 
prepare for the competition by spamming andriy makukha
 
@KamilaSzewczyk Solve the problems from previous years.
 
9:42 AM
Is APL.TA dead btw?
 
ngn
@dzaima that's why it's not an objective criterion
 
read the winners blog posts
 
@Bubbler Reminds me that I've not been on TA since like, forever.
 
@ngn you're obsessed with having objective criterions :p
 
@Bubbler And no, it isn't, we've just not gotten around to putting stuff there yet, but are planning on using it.
 
9:44 AM
the 1st phase doesn't seem difficult
so doesn't the 2nd phase from 2020
 
ngn
@dzaima cgcc is. and programming competitions in general are.
 
true that
 
@KamilaSzewczyk Last one is draconian
 
@ngn cause that's what the organizers decided. Code golf can have an objective definiton, "Good" cannot
 
@dzaima I'm sure you're aware that programming competitions can have objective criteria
 
9:46 AM
Most programming competitions judge only right or wrong, with time limit
This is objective
 
i think objective criterions for contests are essential
 
Other competitions with human judges are not
 
Then think of it more like a talent show.
 
ngn
in which the talent is not even shown? (i.e. solutions not published)
 
In which the talent is writing an obscene amount of comments?
 
9:48 AM
@Bubbler right, but pure performance isn't the goal of the APL problem solving competition. You can disagree with that it isn't, but within the limits that it is, there's not really much choice on how to do scoring
 
ngn
@dzaima performance??
 
@dzaima correctness and then speed to break ties
 
@Adám also writing efficient code is a bit far from code golf(although I could ignore that)
 
more or less
 
Actually I don't like the most programming competitions way, and I'm fine with APL one
 
ngn
9:49 AM
@dzaima it's about correctness first of all
 
@ngn ok right, i did forget that people can write incorrect submissions. But that shouldn't be the majority
 
@Bubbler well you would be, you weren't the one who might have lost out on a prize due to subjective marker opinions
 
(of course, one should judge being wrong much more harshly than there not being any comments)
 
ngn
@dzaima exactly
 
@dzaima Oh yes, and we do.
 
9:55 AM
I wonder if there's a person who submitted lookup tables for all the questions
 
lol
 
Personally I'd recommend getting more familiar with challenges, and some
 
as I expected
also getting familiar with writing efficient APL
 
@Razetime You can't, because phase I uses random arguments, and for phase II we don't publish what we'll test with.
 
linear algebra 😱
 
9:56 AM
@Adám there's always a big enough lookup table for any given problem
 
As an example, I used for 2020 Phase 2 Q9 to solve an important step
 
@Razetime We limit submission size…
 
boooooo
 
@Bubbler if that's mobiles, it does tell you to use that, so it's quite obvious
 
ngn
@Adám are you going to publish the tests after the contest?
 
9:57 AM
iirc
 
But it takes a little bit of (mathematical) effort to use it without errors I think
or to understand why it works in certain cases
 
it requires less insight than other linear algebra might require though, which is the hard bit (to me)
 
Also some basic and maybe
APL is a mathematical language after all
Knowing to write some regex helps too, mostly for string processing problems
 
One thing I have learned properly from code golf is regex
 
ngn
@Bubbler if anyone knows how to write regex, it's rak1507 :) (judging by aoc20)
 
10:27 AM
lol
if the questions are too hard for me I can always try and persuade my smarter friends to learn APL and get the referral prize
 
10:42 AM
@rak1507 While you really should understand the problem and solution well to write the code and comment it such that we can understand your understanding, there is really no way for the judges to prove that you figured out the solution without talking to people / googling (I'm also not sure that's a criterion, but obviously copying the dfns library verbatim isn't gonna be considered great). This is not official advice.
 
to me talking to people and googling are two very different issues, googling is researching yourself, and talking to people is basically cheating to me
 
@rak1507 Then we are all hopeless
 
Arguably last years winner won because of his googling and research into the different algorithms for question 8
 
@rak1507 It is not a test under exam conditions, people have months
The crux of the "good" to me really is the (fundamentally subjective) aspect of good programming - expressing ideas to other humans in the form of executable code
 
Yeah that makes sense
 
10:45 AM
For which you almost always have to make trade-offs in the real world between time spent coding, execution speed, memory usage, readability and maintainability etc.
 
@Adám sorry to drag comments from earlier - i found this comment from AW interesting re: depth and the history of k development web.archive.org/web/20041020215135/http://www.kx.com/listbox/k/…
 
@Bubbler Well partially all it takes is for people to post their specific questions as a thread there and post a link here, but this place seems to have evolved quite naturally over the years so I'm not gonna be the one dickhead going "please, please guys... hey guys can you post your Qs over there please". Really I should be doing that for both TA but also getting people to repost certain questions on stack overflow as well.
 
even with @ngn's 'deep where' it can sometimes be awkward to target parts of a nested structure, but i guess the point in k is that keeping things flat often keeps it simple
i haven't had a chance yet but i'm looking forward to digging into aaron/johnE/arthur's work on trees
 
 
1 hour later…
ngn
11:57 AM
@chrispsn that archive is a real treasure
 
@chrispsn Love the fact that AW's obsession with conciseness extends to a one-letter email address.
 
how does one ⎕FIX a class?
is it possible to stop the status output window from appearing?
and have the errors logged elsewhere
 
@KamilaSzewczyk ⎕FIX ':Class myclass' ':field public answer←42' ':EndClass'
 
@RikedyP Having completed the beta test of the comp, that was a concern I raised -- it wasn't quite clear to me if this is a problem-solving competition, or a "beauty contest". If a set problem can be solved trivially, or significantly easier by using a routine found in the 'dfns' workspace -- arguably the closest thing Dyalog has to a standard library -- to me, that's a great, practical, production-oriented path to take.
If you don't agree (the competition management committee) - then don't set problems where this is the case.
 
ngn
12:12 PM
@Adám ping?
 
@ngn me or Dyalog?
 
ngn
dyalog
 
I don't know. I assume not. And afaik, nobody has ever requested that we do that. You are free to use the official contact email to request otherwise.
 
ngn
:D
 
one mistake i constantly make while writing APL is vectors of strings
 
12:18 PM
@KamilaSzewczyk We were just discussing this annoyance today. For now, you can hack it away by editing ide.js where there's only one mention of StatusOutput. I assume that making that function be a no-op solves the problem.
 
@RikedyP as to plagiarism/research -- that's a grey area, right? Half a century's worth of the best APL code snippets are to be found in APLCart. It's part of my workflow now to first try to articulate what I want to achieve and enter that into APLCart. Is that acceptable?
 
for some reason i end up iterating on individual characters, sometimes i end up joining them, sometimes i end up splitting the string and catenating each letter in boxes
the nest operator seems to be a godsend in most cases
 
@KamilaSzewczyk You're welcome.
 
@xpqz most things in APLcart are pretty short snippets/idioms, it's not as if a complicated problem will be easily solved by looking in it
 
Sure. What about Rosetta Code?
 
12:22 PM
Again, it probably has some ideas you can use but not full (or very good) solutions
To me all online resources are fair game, but asking others for hints/tips shouldn't be allowed, but other people might think differently
 
ngn
@xpqz the dfns workspace is better for more advanced stuff
 
@KamilaSzewczyk Trick: {⎕SE.Dyalog.Utils.repObj⍎⍵⊣'∊'⎕ED⍵}'cv'
 
@ngn There sure is a wide variety in there. Some of it your doing, I note.
 
ngn
@xpqz hm, not really. i have only a few small contributions.
 
new syntax for streams, for now
map/each/filter/limit now works, collect also works
 
ngn
12:27 PM
oop - no thanks
 
lol
i wish APL had more scala-ish model of objects, not classes
i'm using a class only to keep my state in a single place, pretty much nothing else
 
@KamilaSzewczyk Maybe consider a namespace?
 
smart, but then you can't have streams in streams
 
Because…?
 
i wish i could get rid of this ugly eval, but it doesn't look like i can get rid of it
@Adám because namespace variables are static, not bound to a single stream
you can't interleave operations on two streams
 
12:32 PM
@KamilaSzewczyk And it works with classes?
 
yes
you just create a new instance
 
@KamilaSzewczyk Just create a new namespace, no?
 
the only other choice is passing around the state as a boxed array through a couple of dfn's
 
ngn
@KamilaSzewczyk can we see your source code?
 
sure thing
 
12:33 PM
Not as a screenshot, please.
 
it's not perfect, at least for now
but it's much more cozy to work with for me
 
ngn
i should have said, can we copy-paste your source code :)
 
why would you copy paste this crap
i plan on putting it in my APL dialect prototype soon-ish
anyways, yes, CC0 for that one
@Adám i was feeling that huge code walls may be annoying to someone
autism moment, kind of
 
ngn
@KamilaSzewczyk to try to understand what's that thing that cannot be done with dfns, but can be done with oop and tradfns
 
obviously it can be done with dfns, but dfns are very annoying to work with
 
12:36 PM
@KamilaSzewczyk SE chat limits the display size, with a link to show all.
 
right, i forgot about that
 
ngn
@KamilaSzewczyk ok..
 
here are a few reasons why i picked this over dfns:
1) the code feels more readable than keeping the state in a single boxed array
2) no scoping problem, no dyalog bugs to work around
3) tradfn's don't return after a single non-assignment statement
 
you can get around that by doing _←whatever
 
for comparison, the small dfn you've seen took me around a day to write, and the thing you've seen a second ago took me 10 minutes to write, debug and test
 
12:38 PM
or using ⊣
 
ngn
@KamilaSzewczyk 0) ? 1) readability is in the eye of the reader 2) that's a bug, i believe 3) i agree
 
spot the ⎕IO←0 warrior
lol
 
lol
 
the thing i don't like about the current solution is it's verbosity
this felt almost as bad as java
 
yeah it does look a bit grim
 
12:41 PM
:If 0≠≢'aStart'
    current←⊃aStart
    :If 2=≢aStart
        iterator←2⊃aStart
    :Else
        iterator←'⍵+1'
    :EndIf
:Else
    current←1
    iterator←'⍵+1'
:EndIf
i had no idea how to make it not-bad
 
ngn
@KamilaSzewczyk write 1000 programs like that one, and you'll be able to do it in minutes :)
 
fun ~3.5 years ahead.
 
ngn
maybe more :)
 
0≠≢'aStart' huh?
did you mean to put quotes around that?
 
oh no
absolutely not, i overlooked that somehow
 
12:43 PM
that'll be £1000 for my consulting services
 
ngn
because :ControlStructures drown your attention in the noise they make :)
 
that's surprising that it didn't make a difference
 
fair, okay
i will finish prototyping this
and then golf it
 
lol
 

« first day (1457 days earlier)      last day (1198 days later) »