« first day (1419 days earlier)      last day (1225 days later) » 
00:00 - 23:0023:00 - 00:00

12:10 AM
@Adám Thanks for the link to the event !
 
 
2 hours later…
2:15 AM
@rak1507 just replace the life function in my answer with the stencil version
 
 
3 hours later…
5:22 AM
@Adám Thanks for notifying!
 
6:12 AM
0
Q: Create a binary matrix based on information given by an "Excel" table in the APL language

Rodrigo MirandaI have an APL challenge to solve. I received information in a table (Excel) in which the lines represent equipment and the columns represent the days of a year. In each cell I have information on the number of hours that this equipment will receive maintenance. When the table cell has a value of ...

 
6:24 AM
At least the loading part would be easy in KAP. Just use the loadExcelFile function. :-)
 
 
3 hours later…
9:43 AM
@EliasMårtenson If they export the excel file as csv, then ⎕CSV should work
 
10:05 AM
Does anyone have a url for or a pdf copy of an early paper called something like 'do thr ltrr nms run fst'? It discussed an early APL urban myth that the structure of the symbol table in APL\360 took more time to locate symbols longerr than 3 characters.
 
@RomillyCocking How early is early, years-wise?
 
10:20 AM
@RomillyCocking My father claimed that.
 
10:31 AM
@RikedyP 1970s?
@Adám I think it was true for a while, but only for a beta version of APL. Or maybe the FORTRAN II version of the interpreter.
 
@RomillyCocking Later on, with APL*PLUS, it became reversed, where short names were stored "inline", while longer names became refs to a symbol table, and dealing with the symbols was faster than dealing with the full names!
 
ngn
11:18 AM
@xpqz @rak1507 @Razetime day14
 
I'm embarressed to show my solution.
Whilst I got the right answer, it took a long time to run.
 
ngn
@xpqz i bruteforced it too (takes ~30s on my slow computer) to get the star as early as possible, then spent a lot time thinking about a better solution
 
oh, that makes me feel moderately better
 
@RomillyCocking There's this:
> using (and reusing) single-character variable names as much as reasonably possible.
But this speaks about memory consumption, not execution speed.
 
@ngn fwiw (not attempted to golf it) - gist.github.com/xpqz/c80e65a469a01fac55e20472e80f3b5c
Takes ~30s on my considerably faster computer.
 
ngn
11:37 AM
@xpqz shouldn't 65435 be 65536?
 
@ngn yes, the inclusion exclusion
 
ngn
@xpqz correct answer and 29s here! :)
 
Ok, correct is good.
Any suggestion how to deal with the sparse matrix? My eyes bleed looking at what I did.
 
@RomillyCocking Well I couldn't find it in Quote Quads of the 70s - I'll keep looking now and then and let you know if anything pops up
 
ngn
@xpqz maybe use a smaller type for the big matrix
the values are 64bit but there aren't that many of them, and they can be indexed
@ngn oops, i meant "memory" (vector), not "matrix"
 
11:51 AM
I have 80123 addresses ranging from 4341629681 to 68461854547
in the end state
 
ngn
@xpqz float could be much simpler: {⍉(⍵⍴2)⊤⍳2*⍵}
 
o yeah
 
ngn
⍝ Address and value in decimal - nitpick: they are not in decimal, they are just numeric scalars. decimal would be 10⊥⍣¯1⊢⍵ or ⍕⍵
 
ngn
12:18 PM
@xpqz interesting how you do exactly the same as what a k dict would do :) mem is the keys and val is the values. you search in mem and append to both if not found.
ideally this should be just dict[k]←v where dict is a pair of vectors internally
 
I tried also doing a 1500⌶ on the keys, but that made no discernible performance difference. The problem is clearly algorithmic.
 
ngn
it is
 
12:45 PM
Ok, golfed it a smidge.
Only a smidge, tho.
 
ngn
@xpqz 0⊃.. -> .. ?
 
ofc
 
 
2 hours later…
2:24 PM
Any feedback?
 
2:37 PM
An idea ? Add a drawing of a bookshelf with at least one book that Iverson mentioned a lot :
A History of Mathematical Notations by Cajori. Going through the book, one can appreciate even more the genius of Ken Iverson.
 
2:59 PM
@Adám on the image?
or the question?
 
@Razetime The image.
 
hmm
don't know enough to add there really
 
(0,x)+(x,0) is from here and happens to be valid (and equivalent) in APL and J and K.
 
cool
I should read some of his books
 
ngn
@Adám and in all three the pair of parens on the right is unnecessary :)
 
3:06 PM
Yup.
@Razetime See here and the link there to books.
 
@Razetime ⊢1 1⍴1⍪1
@Razetime {(∊⍵)[2×⍳4]}{⊢/4 2⍴⍵}
 
@Adám nice!
 
3:25 PM
@Razetime I'd use , instead of when the former is enough. For clarity.
 
sure, done
 
@RikedyP I wonder if it was in the STSC newsletter? I'll ping some of the old guard and see if they know of it.
 
New version:
 
looks less empty, I like it
 
3:42 PM
I wish Permanent Marker's 0 looked different from its o
 
ngn
@Razetime try complex
 
I never use complex ⍨
 
ngn
you're missing a lot :)
 
well I need to relearn what I did in 10th grade
 
White version.
 
ngn
3:52 PM
@Razetime {s⍳(0j1*⍳4)+⍵⊃s←0,+\×\∊0j1*2/,\99↑1} (⎕io←0)
 
6
A: Wind me a number snake!

ngnAPL (Dyalog Classic), 32 29 bytes 1+×⍨-{⊖∘⌽⍣⍵⌽{⌽⍉,⌸⍵+≢⍵}⍣2⍣⍵⍪⍬} Try it online! Uses ⎕io←1. Starts with a 0-by-1 matrix (⍪⍬). 2N times (⍣2⍣⍵) adds the height of the matrix (≢⍵) to each of its elements, puts 1 2...height on its right (,⌸), and rotates (⌽⍉). When that's finished, corrects the ...

@ngn cool, post it
 
ngn
@Razetime hits the limit in the last test :(
 
yeah mine does too
except last 2
so dfns.tree displays function trees, how can I use it with normal trees?
like the nested tree type that dfns.tfmt works with
 
4:14 PM
@Razetime Look at tnest and tview
 
4:27 PM
sure
 
4:47 PM
@ngn Can you explain how the mapping from 2d works in your day11 solution?
 
ngn
5:02 PM
@xpqz sure, i'll try. when you flatten (,⍵) a matrix m with shape ⍴m its set of coordinates changes from ⍳⍴m to ⍳×/⍴m right? they become simply the indices of a vector. the mapping between the two can be done with k←(⍴m)⊥i j and its inverse i j←(⍴m)⊤k where i j are a pair of indices in m, and k is an index in ,m
@xpqz does this answer the question?
 
Thank you. Let me do some experiments to see if I get it...
 
5:22 PM
Yes, I see now how it works.
 
 
2 hours later…
7:29 PM
How would you solve this problem in APL using a single reduction:
Calculate the sum of the squares of the two largest numbers?
i.e. 1 2 3 = 13
i.e. 4 4 4 = 32
 
I'd probably do something like {+/2*⍨⍵[2↑⍒⍵]}
my solution to day 14 (last line is far too long)
 
ngn
@rak1507 wow. this is very fast.
 
really?
I thought it was quite slow
 
ngn
@rak1507 my timings could be skewed because of the slow laptop, but i get 3.1s for yours and 7.7s for mine. and i thought mine was doing well..
 
Oh cool, never thought I'd write any code that was faster than yours
 
7:47 PM
@rak1507 That looks very good. Extended would have an advantage, though: +.×⍨2↑∧
 
using +.× to square is smart, did not think of that
 
It isn't any shorter than +/×⍨
 
'single reduction' to me implies O(n), and sorting is O(n log n) so maybe there's a better way
 
I guess you could traverse and collect the largest two.
 
I know (⊃⍒) is optimised, does that mean 2(⊃⍒)array is optimised to find the second largest in o(n)?
or is it just monadic
 
7:49 PM
You mean (2⊃⍒)array and no, it isn't.
 
I think this is O(n) {+/×⍨⍵[m,⊃⍤⍒0@(m←⊃⍤⍒⍵)⊢⍵]}
assuming they're positive, if not replace 0 with the minimum
Might as well do that anyway, {+/×⍨⍵[m,⊃⍤⍒(⌊/⍵)@(m←⊃⍤⍒⍵)⊢⍵]}
 
Aha, that's a clever (ab)use of the optimisation.
 
Doubt it will ever be any faster than the regular one
 
comparison of some approaches (random 1000 elements)
 
Actually that one is a lot faster than my original one for large arrays
 
7:56 PM
 
your first one fails for duplicate maximums @dzaima
like 0 4 4
 
@rak1507 right, the first one does fail, and is the reason i wrote the third one there
 
The third one also fails
 
@rak1507 ಠ_ಠ forgot a after
 
Oh
Right yeah
I'm biased of course but I still prefer my one
Shorter and not that much slower
 
7:59 PM
@dzaima Since most methods are slowing down with more elements, you could first run it on chunks of length 1e4 and then on the combined results. But maybe the extra copy would cost too much for that to work.
 
The interesting ones:
      a←?1e6⍴1e6
      ]runtime -c  "2↑{⍵[⍒⍵]}a" "{⍵[2↑⍒⍵]}a" "{m←⊃⍤⍒⍵ ⋄ ⍵[m,⊃⍤⍒(⌊/⍵)@m⊢⍵]}a"

  2↑{⍵[⍒⍵]}a                    → 7.2E¯3 |    0% ⎕⎕⎕⎕⎕⎕⎕
  {⍵[2↑⍒⍵]}a                    → 3.9E¯2 | +434% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {m←⊃⍤⍒⍵ ⋄ ⍵[m,⊃⍤⍒(⌊/⍵)@m⊢⍵]}a → 9.9E¯4 |  -87% ⎕
 
Also you could do ⊃⍤⍒ to get the first element and ⌈/ for the second one.
 
Ah, true.
 
@Marshall that
(makes sense that performs like rak's)
 
Makes a surprisingly small difference
 
8:03 PM
this is a surprisingly simple problem with a not-so simple solution
 
I forgot how close ⊃⍤⍒ is to ⌈/.
 
@code_report Simple solution exists. Performant solution is a bit involved.
 
@Adám true
 
well I'd say something like {+/2*⍨⍵[2↑⍒⍵]} is simple, it's only when you try and do it in o(n) time that it becomes more complex
I'd say that's true in any language as well, I can't think of any off the top of my head that have inbuilt optimisations for getting the second highest number or something like that
 
8:05 PM
yea, i agree. in C++ people would complain about the perf. the reason I asked this question is because I showed a C++ solution to the problem in a recent talk, and a colleague wrote an article saying my "accumulate" solution wasn't STL-ish quuxplusone.github.io/blog/2020/12/14/no-raw-loops-you-say
I was hoping there was some beatiful idiomatic APL single-reduction solution so that I could say it is the best we can do with what we have. However, in APL we can do ...
but seems like it is just a tricky
 
@Marshall Wouldn't thunks have made the naive solutions fast?
 
I mean, I see their point and realistically if you want something that can be extended to the first n, sorting is the way to go
 
as in a lazy sort?
 
2↑⍒ would be understood by the interpreter as the programmer only wanting the indices of the two largest values.
 
@code_report was this replying to me?
 
8:08 PM
@rak1507 no replying to @Adám
 
@Adám well, you'd still need to implement the actual algorithm. Thunks just help in recognizing it
 
Not terrible: ⊃⍤⍒(⊃,{⌈/(⌊/⍵)@⍺⊢⍵})⊢
General solution:
2 {r⊣(⌊/{r,←⍵⌷⍨i←⊃⍤⍒⍵ ⋄ ⍺@i⊢⍵}⍣⍺⊢)⍵⊣r←⍬} a
APLcart material?
 
Maybe but the simple solution is obvious and also not that much worse, I doubt people will really ever need performance for something like this
 
@rak1507 Isn't 2↑⍒ the obvious solution, though with terrible performance?
 
Yeah
 
8:24 PM
So at least the one using 2↑ on the sort idiom should be promoted, but this one still more than twice as fast on as little as a thousand integers.
 
I doubt people commonly need the speed for that, but I suppose adding it can't hurt
 
I still think sort primitives would be good. Then 2↑∧ would be the obvious, and a pretty good, choice.
 
I agree, sort primitives would be really cool
When I first came across APL and saw they had 1 character matrix inversing but not sorting I was very confused
I know what I do more that's for sure
 
Yeah, that does appear odd. And now that we have both unique mask and unique, we might as well have both grade and sort.
 
Agreed, although I don't know what character would be ideal for it, ∧/∨ don't really 'fit' with the dyadic uses
 
8:27 PM
True, but that ship has basically sailed with and and now .
 
Yeah true
 
My idea with and is that they are the symbols often used on columns to indicate sort order, plus they are simpler versions of and . with a + gives , sort of.
dzaima/APL uses < and > which are also good, and at least related to their dyadic functions, though and would be more strictly correct.
 
I think I'd prefer them over ∨ and ∧, although I'm not sure
 
Which ones?
 
I think ∨ and ∧ are probably graphically better but ≤ and ≥ make more sense
 
ngn
8:33 PM
@Adám when you're finished with this, pls explain to @rak1507 how vec⊤⍵ works
 
?
 
@icon-creation-committee apl385.com/favicon.ico is another apl icon
 
ngn
@rak1507 from your day14: 1↓⍉2⊥⍣¯1⊢(2*35),n there's a better way: ⍉(36⍴2)⊤n
 
oh well yeah (36⍴2)⊤n
 
@ngn @rak1507 There's a thorough lesson on it.
 
8:35 PM
yeah
Just thought of that
thanks :) always do ⊥⍣¯1⊢ by default
 
ngn
@rak1507 a clear sign it deserves shorter syntax
 
Agreed
scalar⊤stuff when
 
ngn
@rak1507 input parsing could be somewhat shorter
 
I'm not too bothered about that, it does the job
 
@ngn Yes, and I think that is one of the very few cases where I'd risk breaking backwards compatibility. The current result of scalar⊤stuff is equivalent to the much more obvious scalar|stuff except for floats where you'd also need ⎕CT←0. With array notation, scalar(⎕CT:0).|stuff is much clearer to the reader than scalar⊤stuff.
 
ngn
8:41 PM
@rak1507 line3: mems n←↓⍉↑⍎∘⍕¨'\d+'⎕S'&'¨a/⍨~m
 
@Adám +10 on adding a sort primitive. Makes me very sad that there isn't a single glyph to sort
 
Ok fair play that is a lot simpler
 
@code_report Which do you prefer, / or </> or /?
 
I hate ⍎∘⍕¨ though
that just feels like code golf
 
ngn
@rak1507 i don't have particular feelings about it, could be ⍎¨⍕¨
 
8:43 PM
It's more the method of doing it
 
@code_report Alternatively, a sane Select function such that (⍋⊇⊢) is sort wouldn't be too shabby either. Even more so if we had reverse-compose ("before") so one could write ⍋⍛⌷⍨ instead.
 
⍎¨¨ is the same anyway I think
 
ngn
@rak1507 same length, more arrayful: ↑⍎¨⍕¨.. -> ⍎⍤1⍕↑..
 
@Adám I agree that and would definitely make more sense (and i'd probably pick them over < and > now), but still are kind of weird as they're scalar operations. If there were dyadic TAO comparisons, I'd definitely prefer monadic versions of those for sorting. (and i really like my monadic ∨∧⍱⍲ so i'm definitely not giving up / for sorting)
 
I think I'll go with mems n←↓⍉↑⍎¨¨'\d+'⎕S'&'¨a/⍨~m
 
8:48 PM
CMC: Spot the odd one out:
 
i don't know I would have to think about it. And most of the time when I try to figure out how to use ⌷ I end up failing. I agree that some mechanism that is "fork"-like would be nice enough
 
APL because it's the only good language :P
 
nonsense
 
@Adám that is the "Amecian President Lines" logo XD. it is better than the Dyalog logo IMO. an orange box with a D on it has nothing to do with APL
 
@code_report Yes, because is trying to do too much, and failing at the most basic task. That's why I want a new Select function. And yes, it has to be ⍋⍛⊇⍨ not with a .
 
8:51 PM
although I stopped using that logo a while back, and started using the orange box
 
@code_report Sure, Dyalog's logo is for Dyalog, not for APL. Every few days, we discuss a proper APL logo here…
 
And every time it gets even more convoluted
 
what's the blue logo in the bottom right?
 
@Wezl F#
 
@Wezl Good point. Many of these don't exactly scream their language name…
 
8:53 PM
As far as saying the language name, D and Go have definitely won there
 
how are you supposed to differentiate racket, clojure, and haskell?
 
I think those languages are "well known" enough that many people know
 
all of them are lambdas, animals, or initialisms/names
@code_report true
 
Maybe something simple like
 
I'm not saying F# is a good logo, it just seems like when your whole company is based around a language of symbols, it is a missed opportunity on the logo front
 
8:55 PM
Looks better than most of the ones posted before I think
 
Round version:
 
or go the "American President Lines" route ... and just but APL in the logo
 
how about text saying ">+/÷≢"
it shows the symbols
 
Yeah, I was about to say…
CMP: What are the two most ubiquitous 3-symbol APL phrases?
One is definitely +.×
 
@Wezl or 'APL'≡⌈/⍵
 
9:01 PM
⊢≡⌽ and ≠⊆⊢
I would say
 
How is this for a logo?
 
it could be rearranged for spacing
but it's nice
 
Just a rough draft. The dots, being operators, should probably be coloured differently from the functions.
*∘÷ is nice too, but not universally supported.
Hm, ∘.× but I don't like it.
 
simple and scaleable
 
9:17 PM
maybe if you happen to be carrying around a magnifying glass...
 
and monochromatic
you can type out a .xbm
it's fun to type out svgs when you're bored
 
 
I prefer the other one because it fits on a grid.
 
Agreed, but +/∧\ is very famous, and easy to explain.
 
I hadn't seen it before
 
9:33 PM
Number of leading 1s in a boolean vector.
 
Was just passing through and thought I'd clean up that merged A P and L logo (i.imgur.com/UHCy7Ja.png) and toss in a joke one (i.imgur.com/BvR1SWr.png) while I was at it
 
That last one might get us in trouble with IBM…
@Wezl How about:
 
@Adám naively I thought it was a play on prettier's logo
:56431454 good, but now it doesn't fit in 13x13
 
If you have lots going on in a logo like that it becomes entirely unreadable at small resolutions (i.imgur.com/AfZRcv9.png) such as a favicon, and there's no one central "piece" of the logo that centres it and that the eye is drawn to (esp. because the APL lettering there is hardly differentiated from the other symbols, and the huge amount of deadspace)
 
@Bottersnike Good points. Any ideas, then?
 
9:41 PM
Fresh out of those, unfortunately
 
Btw, this last one has infinity.
 
the italics don't help it fit on the grid, either
 
And representatives of each "class": array, function, monadic operator, dyadic operator.
@Wezl Well, I can change font.
 
APL386 is simple, which is a good thing here
 
How about a very simple ⍺*⎕
People have used ⍺⍴⌊ but it seems abusive.
 
9:44 PM
⍺⍴⌊ is more obvious to non APLers than ⍺*⎕
 
Yes, and ⍺*⎕ looks like a Unicode fail.
 
it shows each class, but it loses the pleasant symmetry of before
it could have ∨.∧ at the top so there aren't two +s
some of the symmetry came from the symbols being the same size, so they could be manually tweaked
 
@Wezl Two +s?
@Wezl I already made much smaller.
 
@Adám sorry, I was referring to a previous version
 
That was a typo. +/⍬ is 0 but ⌊/⍬ is ∞
How is this for a simple 3D array logo?
I'm sure someone can pull this off better than me, but how's this?
 
10:08 PM
@code_report Do people hate (⊂∘⍋⌷⊢)?
 
@RikedyP Yes. And it isn't even optimised either.
 
As a wild thought, what about embracing the alpha and morphing it into the three letters (i.imgur.com/YtaXr33.png), then for smaller versions discarding the P and L and just making use of the alpha (i.imgur.com/otbDhO9.png)
 
@Bottersnike Yeah, Acre basically does that, together with my cube from above:
My problem with this is that isn't really universal for APL implementations. Two of the three major implementations don't use that symbol.
How about using ⍟ ?
Every APL has that.
 
@Adám Aye that's pooey, I personally think it looks kind of cute though (but I'm partial to all the 3-trains in brackets). I agree that something like (⍋⊇⊢) would be better, I'm not that bothered about which of <>∧∨≤≥ would be monadic sort I think any of them is a bit of a compromise over what might have been a special-made symbol anyway
@Adám Yeah people seem to like log but my scatalogical self just sees cat butthole too often
 
@RikedyP Even in APL385?
 
10:15 PM
@Adám In APL385 it looks like a wheel
 
Ugh.
@RikedyP So? Why re-invent it?
 
@Adám Ok I will stop abusing the images now
 
@RikedyP I can't even see them
 
You're missing out
 
 
10:18 PM
@rak1507 beat me to it
@Wezl Can you see the logo images from before though?
 
That face one is going to give me nightmares
 
but I proxy them through google docs
 
@Wezl Yeah the last two just came from google image searches
 
102
Q: Imgur.com blocked, what are my options?

user1454117My organization's proxy blocks http://i.stack.imgur.com/, and they refuse to lift that block. Is there any way for me to work around that to see screenshots and images users post in questions? While most questions don't include images, the entire meaning of other questions is based on those imag...

 
@rak1507 me too i kinda regretted after I posted it but not enough to delete
 
10:20 PM
We could use ∘.○ with some colour. That's kinda cute.
 
@Adám I have a bit of a lean towards ⍉ as a 1-glyph attempt
(∘.○)
 
@RikedyP Not ⍤APL⍉ ?
 
(∘.×) (≠⊆⊢) (∘.○) (⌽=⊖)
When are kaomoji becoming valid APL? (」°ロ°)」
@Wezl I adopted that for my youtube channel youtube.com/channel/UCOx-h5m9MeV14rG4PicRB7g
 
@RikedyP (⌊○⍙○)⌊ is valid
 
@RikedyP before, or just now?
 
10:26 PM
@Wezl before - Adam pointed out that adding ⊢ makes it a valid function that gives boolean mask of items greater than the mean ⊢>+⌿÷≢
@Wezl However, I wouldn't be opposed to it being used in more places as a signifier of APL generally - it's just a bit wide for a "logo" per se
 
I'm sure Aaron Hsu has that on a tshirt
 
@Adám contest - which definition of ⍙ makes the most interesting function
 
Also, it being tacit, isn't very universal.
 
yeah
 
10:29 PM
@RikedyP Well, with ⍙←+ it makes ⌊2π⌊x⌋⌋
 
well I'm out of ideas again
 
@Bottersnike Cubist approach:
… but may give some people bad vibes.
 
@Adám You always seem a bit too comfortable being a few missed strokes away lol
@Adám I kinda liked where this was going - maybe a version with the dot in the middle and no APL
 
Heh, some use stylised prompts, like >_ or $> ― maybe we can use APL's prompt as logo? ;-)
 
:56431928
+⌿÷≢
 
10:38 PM
 
That's cute.
 
it's simpler than my previous apple
 
Hey, how about a plain apple?
 
that's also simple
simpler meaning better
for logos
 
That one is nice
 
10:48 PM
Maybe with a bit of kerning.
 
hehehe even better
 
00:00 - 23:0023:00 - 00:00

« first day (1419 days earlier)      last day (1225 days later) »