« first day (625 days earlier)      last day (2034 days later) » 

ngn
11:03 AM
cmc: shortest apl expr to find how each element of a matrix ranks among its distinct values? in other words, replace all occurrences of the smallest value with 0+⎕io, the second smallest with 1+⎕io, etc
the matrix can be assumed to be numeric and real (not complex)
 
@ngn So something like ⍴⍴,⍳⍨⊂∘⍋∘∪∘,⌷, but shorter?
 
ngn
@Adám I was hoping for something shorter that I might be missing. Currently I have c[⍋c←∪,b]⍳b←⎕, it's for this challenge
 
that doesn’t work
 
ngn
11:19 AM
@FrownyFrog why?
 
4  9 4  9
4  9 4 11
6 12 8  6
---
1 2 1 2
1 2 1 7
7 7 7 7
the tio link
 
Yeah, mine doesn't work.
I had the ∘∪ in the wrong place
 
ngn
in that challenge we can be sure that each distinct element has 5 copies in the matrix - maybe I can take advantage of that...
haha! used ⍋⍋ floor-div by 5 and stripped another 3 bytes :)
 
 
2 hours later…
1:47 PM
@Adám any word on a fix for my ws issues yesterday?
 
@nathanrogers Ah, no I forgot I wasn't going in to the office today, but hang on, let me IM him.
@nathanrogers Try with HKEY_CURRENT_USER instead.
 
a←,⊃∘.,/6/⊂'0123456789abcdef'
⍴a
16777216
awesome
thanks @Adám
 
@nathanrogers Thanks forwarded to Chief Architect.
 
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Dyalog\Dyalog APL/W-64 17.0 Unicode]
"maxws"="8G"
for the record
 
 
1 hour later…
3:31 PM
there should really be more media pertaining to apl/j/k
it seems the only media out there are either teleconferences or just really really brief short videos.
and generally with poor audio quality
 
3:51 PM
@nathanrogers that's.. 2004. More recent APL videos can be found here, though I don't know what exactly are you expecting from APL videos
 
anything interesting, and with better audio than cranking the volume, can still barely hear what the speaker is saying, and also more than just the same presentation over and over. I'm sure many new comers to APL stumbled accross krombergs life in APL, which was exciting and interesting
then there's the interesting history of the APL family of languages, and there's media of the history or people involved
i hadn't seen this page though
what's more is, like videos of ken, I can't find a single video with Arthur whitney. I'd love his thoughts on the langauge, and his ideas that lead to K, and just some general commentary on the design decisions that were and are involved in these languages.
 
There's also this which gives an overview of APL
 
seen that already
presented several times at different events
more stuff like that, or youtube.com/watch?v=a9xAKttWgP4&t=75s
 
4:14 PM
@nathanrogers You know about dyalog.tv?
 
@nathanrogers one interview of arthur's: queue.acm.org/detail.cfm?id=1531242
 
yes about dyalog.tv
i recognized you from there :P
 
@nathanrogers How about APLTrainer?
 
neato
i think I have seen that before, but didn't watch anything there.
 
@nathanrogers Btw, we're sometimes struggling to come up with good subjects for our webinars. If you have any subjects you'd like to see, tell us: webinar@dyalog
 
4:29 PM
anecdotes
 
@nathanrogers On video?
 
yeah, stories. why this word, why this symbol, conversations had between this guy and that, people who made decisions about design of the language that had an impact on its use, proliferation, stories and tales and history
and anything for non-domain experts
I'm a software engineer, and I find any discussion I have on the subject of apl family languages to be completely wasted, as most engineers are taught that succinctness = code smell
so demonstrating practical solutions to software problems would be great, as most of the content I see are academic problems or domain problems, i.e. linear algebra, capital E engineering type stuff
web servers/services, ui, other data structures
I'm sure all that stuff is there, as you guys just linked a lot of things that I haven't seen before
but transliterating solutions in some other language to APL would be beneficial to non Engineer, more computer sciency software developers
 
@nathanrogers simply transliterating things to APL from "regular" languages will almost always result in very bad APL code, giving a very wrong impression
 
@nathanrogers Wow, great feedback! I'll make sure the powers-at-be see this.
 
there are also great demonstrations of APL, but not many explanations. Like the life video. when I first saw it, it seemed as though he was blazing through the solution. as I understand more and have watched it since, it makes sense and it doesn't seem so wild. but making videos aimed at people who don't get it with more explanation would be gravy
 
4:37 PM
@dzaima I think he means re-implementing the APL way. Notice his liking the jugalbandi.
 
@dzaima, but the video I linked above
this one, they do exactly that
and show "this is how we would solve this problem in APL
it's a fun video with good humor, but also powerfully demonstrating how the tools we use to think encourage different natural solutions in a given language
and that a more flexible powerful language reveals more direct solutions
 
@nathanrogers ah I googled "transliterate" and it gave me "write something using the closest corresponding things" :|
 
@Adám yes, exactly :) didn't see your comment there
the jugalbundi was great. a not-so-simple OOP, even FP problem that takes some thinking, but that still has a direct solution in APL. I'm understanding APL, I can read most of what I see, even trains since I was trying to understand tacit J for a bit, and I think tacit APL is much easier to look at... but I'm having difficulty in solving problems. I'll see a problem,
like "bracket balancing"but think to myself, "well this uses looping and stack pushing and popping... that doesn't seem like a problem well suited to APL" because I don't know the tactic that would be used in APL for this kind of problem
 
Got to go — the sun is setting -⊖-
 
haha :P
 
4:52 PM
J trains are pretty much the same
if there is an odd number of terms, they are equivalent in both monadic and dyadic case. For even number the monadic case saves you exactly one byte, J: (%+&1), APL: (⊢÷+∘1)
the dyadic case is like this, APL: ÷∘(2××⍨), J: (%2**~)
only the last term is actually dyadic out of the whole "dyadic" train
the leftmost, that is
 
ngn
5:21 PM
@FrownyFrog isn't one of the *-s dyadic too? so, in J x(f g h i)y ←→ x f g h i y?
 
 
4 hours later…
9:11 PM
how does one convert char to int?
specifically ascii char codes
 
@nathanrogers ⎕UCS
 
9:25 PM
would anything of value be hurt if I made dyadic and return unique elements? (so like (∪∪)/(∪∩))
 
how do you preserve the shape of an array while filtering it?
I want values where true, retaining the shape
er wait.
0@? probably?
 
@nathanrogers what would that even be like? What would you expect from filtering out odd numbers from 2 2⍴⍳4?
 
⍸4=list
so there's a list where some are 4
and I a list of indices where 4=
I want those to be 0
and retain the rest of the list
 
@nathanrogers oh so not filter, but replace with 0
 
without modifying the list
yeah
 
9:32 PM
{0@(⍸⍺⍺¨⍵)⊢⍵}
 
wow
splain plox?
 
@nathanrogers ⍺⍺¨⍵ - execute ⍺⍺ for each of ; - get places where that was truthy; 0@ replace those places with 0; in ⍵. That was out of laziness, that expression could as well be {(0@(⍸⍺⍺¨⍵))⍵}
as a side-note, I've found way too many functions that work fine on multidimensional arrays that I didn't expect to while testing stuff for implementing my APL (including that )
 
9:59 PM
Laziness = ingrained code-golf.
 
10:20 PM
  s←'{()}{[()]}{}{}{}{}'
     open←'({['
  close←')}]'
  {g←{0@(⍸4=⍵)⊢⍵} ⋄ 2,/(g open⍳⍵)+g close⍳⍵}s
I got this going on
what is the next step
I tried
2+/(g open⍳⍵)+-g close⍳⍵
and indexing off of that
but then I kept getting wonky results when recursively applying this
 
@nathanrogers what's the goal - check if parentheses match?
 
becausyes
i don't want the solution
I just don't know where to go next
in the pairwise enlist
perhaps I can get outer values for where cell 0=
o=+/cell
er... no 0=/ cell
because if 1 0 1 then it holds true that I can 1 take left cell and -1take right cell
but I'm not sure how to do that
and in another case where 1 0 0, then I can simply take 1 on the left cell, and 0 0 1, take 1 on the right cell
perhaps there is a way to do a 3-wise reduction and only return where ~0¨=/each cell
i'll keep trying
no, because in the case of 2 1 1 2 3, the second and third cells would be 0 0 1, 1 1 1
and I still get that stupid 1 back
{g←{0@(⍸4=⍵)⊢⍵} ⋄ (2+/(g open⍳⍵)+-g close⍳⍵)~0}s
i mean, this looks really promising, but then it doesn't work recursively X(
 
10:48 PM
  {g←{0@(⍸4=⍵)⊢⍵} ⋄ ∊(-/¨a)↑¨a←2,/(g open⍳⍵)+g close⍳⍵} s
getting there, but I'm not sure where the boolean expression comes in. hmm
how do you take the sign of something?
 

« first day (625 days earlier)      last day (2034 days later) »