« first day (861 days earlier)      last day (1783 days later) » 

ngn
3:13 AM
@Adám @MortenKromberg the example inputs for DoubleDegrees and Components seem wrong - shouldn't the first row be nVertices nEdges?
 
ngn
3:32 AM
some of the examples are not copy-paste-able, e.g. there's a hard to notice extra space in NumNumNum ' 10713223141516271819'; MakeMines' and CountMines' output is split vertically and gets copied as multiple matrices
"the argument to the functions you will write will a character array" - missing "be"?
how do i #.Submit if i use .dyalog instead of .dws?
 
ngn
4:31 AM
in Romberg: "$R^n_n$ should be computed at most once for each m and n" (that's an R with subscript n and superscript n) - the superscript should probably be m
 
 
2 hours later…
6:29 AM
@ngn Can you help me make it more clear that when going with If you use some other APL system, there is no #.SubmitMe because it isn't needed.
No matter which way you participate, you don't need to run #.foo — that's why there isn't any #.foo ;-)
 
 
4 hours later…
10:28 AM
Simple code puzzle, "Add 1 to each digit of a number, but no carrying, nines just become tens, e.g. 449944 becomes 55101055". APL 3 days, PowerShell 30 seconds. But I'm quite pleased I could solve without a loop of modulo/remainder; tio.run/##SyzI0U2pTMzJT///PyUzPbOk@FHbhOpHvVsfdS151LvC0OBR7xYg/…
 
@TessellatingHeckler your digits function could just be 10∘⊥⍣¯1
 
⍞←{10⊥(,1,⍨⍪10=n)/,⍉10 10⊤n←1+10⊥⍣¯1⊢⍵}449944
 
@Adám 55101055
 
NSL FTW
 
@dzaima That doesn't work in Nars2000
what's NSL, @Adám ?
 
10:35 AM
@TessellatingHeckler nsl.com
 
But of course, golfed:
⍞←⍎∊⍕¨1+⍎¨⍕449944
 
@Adám 55101055
 
@Adám wow, taking that apart I see how it works, but it's so foreign
 
@TessellatingHeckler Let me know if you need help.
 
10:51 AM
@Adám Thank you; I had to stare hard at (,1,⍨⍪10=n) to parse it and work out that it wasn't doing a catenate-selfie, the only bit I can't follow now is how you came up with it, and I guess that's just a lot of experience
 
@TessellatingHeckler No, ,⍨ here is just , with swapped arguments.
 
I really wanted to use so i ended up with this monstrosity
 
@TessellatingHeckler Think about it: first we find the digits by expression in base-10, then we increment, then we find the digits of those numbers in two-digit base-10, but this inserts leading zeros, so we just filter those out. The second digit is always kept, so we can hard-code that. The first digit will be 0 or 1 in the two-digit base-10 representation, so we can use that as-is.
@dzaima Another fun solution:
⍞←{10⊥(≠\=⍨)@(9∘<)1+d/⍨1+9=d←10⊥⍣¯1⊢⍵}449944
 
@Adám 55101055
 
@Adám "then we find the digits of those numbers in two-digit base-10", and that's brilliant! At least I didn't carry on down the approach of replicating the 9s twice to add another column
 
11:05 AM
Approach for finding a clever APL solution to problem X: 1. Try and 2. Try something else…
 
a bit shorter version of the mathy one
@Adám afaict that'd have to involve using ⌈10⍟ which immediately tells me to go back to because floats are awful
 
@dzaima Ah, maybe it should be and .
 
maybe there's something in Dyalog or IEEE 754 that disallows that to give an incorrect result, but my philosophy with floats is to always assume a ±0.00000000001
 
and are another source of clever solutions:
⍞←{10⊥10|1+(d,⍨≠⍨i)[⍋(i←⍸9=d),⍳≢d←10⊥⍣¯1⊢⍵]}449944
 
@Adám 55101055
 
11:15 AM
@Adám but they have awful time complexity so i try to use them only when the nlogn sorting is actually necessary
related challenge: given 2 sorted arrays, merge them in one sorted array in O(n) time. is that even possible without loops?
 
ngn
@Adám i use dyalog v15 (i hope i'm still allowed to) and it can't load the newer dws. i think "(optional)" after the first mention of #.SubmitMe would do
 
@ngn SubmitMe is required, not optional.
 
^ SubmitMe is required for the Dyalog version, and since you can't even load the dws file, the whole tab that contains SubmitMe is unrelated to what you'll have to do
 
ngn
@dzaima "tab"? isn't SubmitMe a function in the dws?
 
11:31 AM
@ngn There are two expandable "workflows",
 
@ngn the tab in the webpage (under If you use Dyalog APL (recommended)) doesn't apply to you if you can't open the dws file
 
@ngn We'll amend the site text to say 16.0 is required. This was the intention, otherwise the hints to use don't make sense.
 
ngn
this passage in the pdf left me with the impression that i must run #.SubmitMe from the dws:
The Contest2019 workspace contains:
[...]
• #.SubmitMe – a function used to package your solution for submission. [...]
On non-Windows platforms, you'll be presented with a character-based prompt and
response interaction.
further it says: "#.SubmitMe will create a file called Contest2019.dyalog which
will contain any code or data you placed in the #.Problems namespace. You will then upload the
Contest2019.dyalog file using the contest website."
so, if i put my code directly in the .dyalog file, it's already considered "packaged"?
 
@ngn Yes.
I think for next year, we should just get rid of the workspace, and do .dyalog file only for everyone.
 
ngn
@Adám i think that would be better
 
11:41 AM
@ngn Above that, it says Develop your solutions using either the workspace or the template. and then there are two headers, Using the Contest2019.dws workspace and Using the Contest2019.dyalog template file but the latter is on the next page, and the formatting isn't very suggestive. The way it looks on the site is probably clearer.
 
ngn
also, the stubs in the .dyalog file had better be in the same order as the problems in the pdf
 
@ngn Actually, the best may be having stub files rather than a scripted namespace of them. Of course, that'd require zipping to upload in one go, but really, so what?
 
ngn
@Adám right... for some reason i assumed #.SubmitMe involves network communication to send the solutions for judging
 
9 mins ago, by ngn
further it says: "#.SubmitMe will create a file called Contest2019.dyalog which
will contain any code or data you placed in the #.Problems namespace. You will then upload the
Contest2019.dyalog file using the contest website."
 
ngn
and why did you say this:
23 mins ago, by Adám
@ngn SubmitMe is required, not optional.
 
11:47 AM
21 mins ago, by dzaima
^ SubmitMe is required for the Dyalog version, and since you can't even load the dws file, the whole tab that contains SubmitMe is unrelated to what you'll have to do
probably meaning that submitting the dws file is not allowed
 
ngn
lol, history has literally started repeating itself :)
 
:D
 
ngn
@Adám file per problem? wouldn't that be overkill? i expect most solutions to be oneliners
what i really miss is an automated way to test my solutions. i had to write one myself and manually copied the example inputs and outputs, which was frustrating due to pdf issues
 
@ngn No, one file per function/operator.
 
@Adám that'd make using other functions from one very annoying as all would have to be loaded individually (unless there's some way to load the entire folder). one file per domain would be somewhat understandable, but still annoying
 
12:00 PM
@dzaima Yeah, we're working on the new way to load an entire directory tree with one file per item. So you'd get a single dir for the entire contest, and it'd have subdirs with stub files. And a single ]Import path/dir would load it all in.
 
@Adám would that load every file individually in the top level or keep a structure of the folders as namespaces or something?
 
@dzaima It would keep the structure as named unscripted namespaces, unless you ask for it to flatten the structure with ]Import path/dir -flatten
And if you use Link.Create instead of Import, it will synchronise your changes back to file as you edit.
You are allowed to use scripted namespaces (optionally in subdirs) — they'll just be preserved as monolithic text files.
@DIDIx13 Welcome. Interested in APL?
 
Hi @Adám
I might missunderstood what APL stand for in this context
 
APL (named after the book A Programming Language) is a programming language developed in the 1960s by Kenneth E. Iverson. Its central datatype is the multidimensional array. It uses a large range of special graphic symbols to represent most functions and operators, leading to very concise code. It has been an important influence on the development of concept modeling, spreadsheets, functional programming, and computer math packages. It has also inspired several other programming languages. == History == === Mathematical notation === A mathematical notation for manipulating arrays was developed by...
 
Yes in my head APL stands for housing assistance thanks for the clarification
Now I have a good read at least :)
 
12:26 PM
CMP: We're designing a proper system function to replace 819⌶ (half-hearted) "case map" which will do both (simple, but complete) Unicode case mapping (prep for display) and Unicode case folding (prep for case-insensitive comparison). What should it be called?
 
12:45 PM
@Adám i'd think that depends on it's usage - is it an operator or function, in what format are the options taken (numbers, strings, or do you plan to have multiple functions for different cases)
 
@dzaima It is very early in development, but the current proposal is an ambivalent function: 1⎕nnn Y for upper-map, ¯1⎕nnn Y for lower-map, ⎕nnn Y for case-fold.
 
for shortness/simplicity, ⎕CC for Convert Case
of course, not having a quad would be the best option, but it might not be an option
 
@dzaima I thought of ⎕C which looks akin to the other "texty" quads: ⎕A ⎕D ⎕R ⎕S.
@dzaima You mean one/two/three new glyphs?
 
@Adám or just update / like your extensions (of course, i don't know how many existing things rely on domain errors of those)
 
1:00 PM
@dzaima Probably none, but there are two issues:
1. The proposal is to act like monadic + and leave non-characters untouched, so you can do 'abc'1.5≡⍥⎕C'ABC'1.5
2. Uppercasing and lowercasing does not share the mathematical properties of and in that ⌈≡⌊∘⌈ and ⌊≡⌈∘⌊
 
@Adám how do I apply an operator to each column of a 2×N array such as ↑(0 0 0 1)(0 0 1 0)?
 
@J.Sallé You don't look for , I suppose?
 
@TorstenGrust that's exactly what I'm looking for. Thanks!
 
1:17 PM
@J.Sallé Since J.Sallé already answered, I'll just add that in general, you can use /[k] where k is the axis that is to be reduced away.
 
@Adám Oh nice, I'll also keep that in mind. I don't think I've used much so I didn't remember that
 
ngn
1:50 PM
@Adám maybe reuse ⎕ucs for that?
and rename ⎕ucs to ⎕u to make us golfers happy :)
 
@ngn Ooh, like with numeric ¯1/0/1 left arg. Nice.
 
@Adám i don't like that idea - imo it feels like a hack to not need to choose specific data, and when there is both data to uppercase & leave alone you'll have to pick too
 
@dzaima If not for that, you'd have to wrap the quadfn in a traversing fn, which will be slow and awkward.
 
@Adám you hopefully wouldn't be using & on an array containing both numbers & chars (i wouldn't be opposed to ⌈'a'3 erroring), and the properties can live on staying number specific
 
@dzaima But ⌈'abc' 'def' should work, just like ⌈(1.2 3.4)(5.6 7.8) no?
 
1:59 PM
@Adám yeah, why not
@Adám requiring traversing (≡ having mixed types in arrays) is already a sign of bad code which imo doesn't deserve getting help
 
@dzaima Because then it can't just traverse and convert on the fly, as it has to keep a table of which types it has seen so far. Also, should ⌈⍬'' be allowed, etc?
@dzaima traversing ≢ having mixed types. traversing ≡ having nested arrays, and ⌈'john' 'doe' must work.
 
@Adám yeah, it probably would be better for consistency & speed to allow ⌈'a'3, i was just saying that as in anyone actually using that, shouldn't be
@Adám and that should work. what's a case when you can't extremely easily (≡ doing a simple n⊃) separate numbers from strings, and there aren't many mixed type arrays (or an array of arrays)?
e.g. ('ab' 1.3)('cd' 2.6)('ef' 3.9) is a bad format to store data, and imo shouldn't be helped to be usable easily (besides converting away from it)
and what if i had the data ('ab' 1 'ms') ('cd' 2 'Ms') and wanted to uppercase the 'ab' and 'cd' but not 'ms' & 'Ms'?
 
@dzaima If ⌈'abc' 'def' is allowed and ⌈(1 2)(3 4) is allowed, then it would be too costly to disallow ⌈'abc' (3 4). In fact, in principle, disallows refs, but it doesn't actually check:
⍞←⍋(2 #)(1 ⎕SE)
 
@Adám 2 1
 
@dzaima In that case you'd do ⌈@1¨ or ⌈⍢⊃¨ or ⌈⍢(⊃¨)
@dzaima Besides, what would you suggest for casefolding? |?
 
2:14 PM
@Adám my point is that not requiring specific picking for the previous case is kind of strange (and imo way less readable/understandable)
@Adám that is a good question - probably
 
@dzaima Remember that the main goal here is case folding for case-insensitive comparison. It is unlikely (but possible, e.g. username password) that you want partial case-insensitivity.
 
@Adám and imo it is unlikely that someone would actually use the fact that ⎕C would ignore numbers
 
@dzaima Another issue is that we may likely want variant options for this, e.g. for Turkic and full mapping/folding.
 
is there any case when any of the operations result in splitting a character into two/merging 2 to 1?
 
 
1 hour later…
ngn
3:30 PM
@Adám i have a question about the Romberg problem
"returns $R^m_n$ for the given function and interval." - where does m come from?
in the next paragraph we have "$R^n_n$ should be computed at most once for each m and n" which makes no use of m
maybe the problem author had to correct one of these but changed the other one instead
 
Those indeed should be flipped (Rnn for the given function...) and (Rmn should be computed...) hopefully that will be fixed soon in the text
 
Ven
@DIDIx13 May I guess.. You're francophonic?
I've been only working on my compiler in Haskell for during lunch break... I need to go back to APL.
 
ngn
@RichardPark thanks
 

« first day (861 days earlier)      last day (1783 days later) »