« first day (651 days earlier)      last day (2003 days later) » 

2:07 AM
Processing looks so cool. Why did I abandon it for Swing + JavaFX in middle school... '-'
 
 
2 hours later…
3:53 AM
Dyalog '18 has come to an end but the slides from presentations and workshops are being added to https://www.dyalog.com/user-meetings/dyalog18.htm – videos of presentations will start to be published soon.
 
 
3 hours later…
6:23 AM
@dzaima any chance of getting transform added to APLP5?
 
7:06 AM
@nathanrogers try adding this to G's getRaw? can't test because at school :|
@Quintec Processing is cool for pretty images but once you need a text field or reasonable speed, it becomes horrible
 
 
6 hours later…
1:00 PM
Yeah true, but pretty pictures :P
 
1:23 PM
I'm trying to solve the "ASCII Art Octagons" task using APL. I reached the point when I have a matrix with indices (1 or 2) and I want to use it to extract the symbols form the string ' #'. I thought it is simply ' #'[...], but apparently I miss something.
My solution until now is:

f←(((5∘=+6∘=)⊢)(+/⊢∘,))⌺3 3⊢<(((⊖⌊⊢)⌽⌊⊢)(∘.+⍨(⍳¯2+3×⊢)))
f 4
0 0 0 1 1 1 1 0 0 0
0 0 1 0 0 0 0 1 0 0
0 1 0 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 0 1 0
0 0 1 0 0 0 0 1 0 0
0 0 0 1 1 1 1 0 0 0
I'll appreciate an explanation how to deal with indexing. Thanks!
I forgot to add 1 to the matrix
 
@GalenIvanov Or change ⎕IO←0. So you don't have an issue now?
 
no, I don't know how to use this matrix to index into ' #'
I thouhgt this will work:
f←' #'[(((5∘=(1++)6∘=)⊢)(+/⊢∘,))⌺3 3⊢<(((⊖⌊⊢)⌽⌊⊢)(∘.+⍨(⍳¯2+3×⊢)))]
 
@GalenIvanov Oh, you cannot use bracket indexing in a tacit function.
 
aha
so I need ⌷
 
@GalenIvanov Or or use a dfn.
 
1:39 PM
@GalenIvanov you don't actually need to index into ' #' though. You can just replace the zeroes (or ones if you're using ⎕IO←1) with spaces
 
@J.Sallé Wouldn't that be longer?
 
@Adám not sure
 
⋄ f←(((⊃∘' #'¨1+5∘=+6∘=)⊢)(+/⊢∘,))⌺3 3⊢<(((⊖⌊⊢)⌽⌊⊢)(∘.+⍨(⍳¯2+3×⊢))) ⋄ ⎕←f 4
 
@Adám
   ####
  #    #
 #      #
#        #
#        #
#        #
#        #
 #      #
  #    #
   ####
 
@GalenIvanov ^
 
1:41 PM
@Adám Thanks!
 
Using ⎕IO←0 removes the need for the 1+ though doesn't it?
 
Yes, it does
 
@J.Sallé But there is an which may need adjustment.
@GalenIvanov Do you want golfing tips?
 
@Adám I just tested with IO 0 and it seems to be working
 
@J.Sallé Gives me a smaller octagon.
@GalenIvanov Btw, welcome. Another J'er sees the light…
 
1:55 PM
@Adám oh yeah I hadn't noticed that
 
2:10 PM
@Adám Yes, I see the light :) But so little time to learn everything I want...
 
2:22 PM
I only see darkness, as hard as I try :P
 
@Quintec Try opening your eyes ;-)
@Quintec Can I help? Want a personal learning session?
 
blinks wha...?
 
 
1 hour later…
3:54 PM
@Adám in your opinion, how easy would it be to find an APL function that, when fed itself (as a string) as argument, returns a single unicode character?
Trying to code a Cops' submission for this challenge but I don't know if what I did is actually hard to break or not
 
@J.Sallé
 
@Adám I should have mentioned it's a specific character
Not just any character
 
@dzaima what are you at school for?
 
@J.Sallé '$'⊢2∘⊃
 
@Adám ಠ_ಠ that literally killed everything I've done so far
Apparently APL is not the best language to do this in >.>
I had a cool function too that returned my avatar
 
4:06 PM
@dzaima function transform(float,float) does not exist
 
@nathanrogers ? what kind of question is that
@nathanrogers oh, did you mean Processings translate, not some transform?
 
I mean, I don't know you at all. Maybe its a post grad, maybe its something more specific. Maybe its more mathematical and not computer science? I'm not sure
yes that. Processing translate
 
@nathanrogers then just replace the transforms with translates
 
I but almost put together my own coordinate system and translation in apl, but it was buggy
 
@nathanrogers well literally all it should be is just adding some coordinates to coordinates
 
4:16 PM
I couldn't get the rotation to work correctly
and it was more about getting the numbers added at the right times to all the numbers
@dzaima so then translate just modifies some global that is added to arguments to draw methods at the time the draw method is called?
 
@nathanrogers or something like that. I don't really know how processing works :p
 
4:41 PM
well i guess it might not be exactly that because scale & rotate can get text into shapes it otherwise couldn't be, but it's close enough.
 
@J.Sallé 'ᚠ'⊢2∘⊃?
 
@Adám oh no, mine was way waaay more convoluted
 
@J.Sallé What was it?
 
it involved a couple ⎕UCSs and stuff
@Adám gotta get it back from the repl's history, lemme find it
 
@dzaima well while we're talking about it, do you have scale and rotate?
translate worked as you posted earlier
 
4:48 PM
@nathanrogers just create two extra copies, replacing translate with scale & rotate :p
 
wow cool
 
@J.Sallé I suggested having 1=≡,⎕UCS 1497 on my business card.
 
@dzaima what do I set the arguments to rotate (expects arguments like rotate(float))
just p.x?
 
@Adám found it: ⎕UCS⊢5677+1⊥∊2⊥⍣¯1¨⊢⎕UCS⎕
 
@nathanrogers oh right. Doing rotate((float) w.asDouble()) should work (removing the xy definition)
 
4:50 PM
@J.Sallé What did you mean by this?
 
@Adám well the challenge basically says "create a program that generates unique output when the argument is the program itself"
and the shorter the output, the better
So I wanted a 1 character unicode output, which you proved is not the best approach
 
works great @dzaima
should scale be a scalar, or a 2d vector?
 
@J.Sallé What should it output if the argument is not itself?
 
it looks optional I guess, nvm
 
@nathanrogers scale can stretch & squish things, if you don't need that, you can remove the option
 
4:54 PM
sure
 
@Adám anything as long as its not the same as that
 
@J.Sallé Then should work. It returns '⊢' iff the argument is '⊢' otherwise is returns its argument.
 
ngn
+500 rep for the shortest k solution to this challenge
 
@everyone, thoughts on jelly?
 
@Adám it's a cops and robbers challenge though
 
4:58 PM
@Adám that does a very bad job at not giving away the program from the output :p
 
@J.Sallé I never quite understand C&Rs.
 
@nathanrogers tried learning it, failed miserably, learned APL instead.
 
@nathanrogers In what context?
@dzaima @J.Sallé Can you link to the challenge?
 
@Adám one person does what the challenge describes, another person does a different thing that the challenge describes. It's not more complicated than that :p
 
in the context of a programming language @Adám, though I don't mind me some jam and toast
 
4:59 PM
1 hour ago, by J. Sallé
Trying to code a Cops' submission for this challenge but I don't know if what I did is actually hard to break or not
 
@dzaima Oh, I didn't notice. Was just leaving the office.
@AttilaVrabecz @pierre A treat for you.
 
@ngn just to be extra clear, the submission will have to validate input, but you won't consider that part?
 
ngn
@J.Sallé i was thinking of ignoring validation altogether but i've been told i can't override the challenge's rules with my bounty :(
 
@nathanrogers Jelly is an interesting exercise in how compact code can be, but of course it makes way to many sacrifices to be practically useful. I do find left-to-right intriguing though, and every once in a while I experiment with how a left-to-right APL would be.
 
@ngn Yeah I was about to comment on that. I suggest subtracting the byte count for the validation from the total
Googled ngn/k (to look for the repo) and I got this answer: prntscr.com/lfjqtg
So apparently, $$ngn \approx \frac{2 \times 10^{20} s^2 K \times U.S. Dollars}{kg\times m^2}$$
 
5:21 PM
@J.Sallé That's not rendering for me. Also, why use math when you have APL?
 
@Adám well I really like the way TeX renders math, for one. I can make an APL version too though, just a sec
 
@all What do you think of this idea? Just like A B C⌷array selects layers A, rows B, columns C, so if A B C≡⍸¨a b c then a b c/array should give the same result.
Here is a model Slash←{1=≡⍺:⍺/⍵ ⋄ ⊃{(⊃⍺)/[⊃⌽⍺]⍵}/(⍺{⍺⍵}¨(⍳≢⍺)),⊂⍵}
 
⎕←'ngn ',(⎕UCS 8776),' (2×10',(∊⎕UCS 8306 8304),'×/s',(⎕UCS 8306),'K U.S. Dollars)÷(kg×m',(⎕UCS 8306),')'
 
@J.Sallé
ngn ≈ (2×10⁲⁰×/s⁲K U.S. Dollars)÷(kg×m⁲)
 
ngn
@J.Sallé yep, that's more or less what i did: require two solutions in an answer - one with and one without validation
 
5:32 PM
@Adám I tried to make it look pretty too >.>
 
ngn
@J.Sallé i thought google knew much more than that about me :)
 
@ngn I forgot to add a ×k there though
 
ngn
@Adám try the first bookmarklet here: math.ucla.edu/~robjohn/math/mathjax.html
 
6:08 PM
@Adám ^ or this tacoscript for a permanent solution
 
6:19 PM
The tacoscript is the one I use. I like it a lot
 
6:46 PM
@dzaima @J.Sallé But if we get used to using mathjax, we forget those that don't have it.
 
@Adám true, but ¯\_(ツ)_/¯
 
7:02 PM
was going for the bounty... then remembered I've never practically coded in k
 
@EriktheOutgolfer Should be fairly similar to RAD.
 
 
1 hour later…
8:13 PM
@dzaima I've added extensions to / \ . I've swapped so f⍀ is ∘. and f\ is ∘.f⍨∘⍉⍨ (which is what J has for /). All four (corresponding to dzaima/APL's and ) allow a nested left argument with one vector per leading/trailing dimension (omitting dimensions is OK) and each/the vector may be short too. / and pad with 0s; \ and pad with 1s.
 
8:33 PM
@Adám when is ∘.f⍨∘⍉⍨ useful?
 
@dzaima By far most times, it is the same as ∘.f. Only when has rank over 2 does it make a difference. I'm not sure why J chose that for outer product.
@dzaima Actually, I may be mistaken. J treats transposed compared to APL for f.g. Not sure if that's the case for ∘.f too.
 
What does the expression dzaima was asking about mean?
(On mobile eek)
 
@Quintec {(⍉⍺) ∘.f ⍵}
 
Oh gotcha thanks
@J.Sallé ChatJax++ is my weapon of choice
 
8:53 PM
I'm planning on extending (and ) in a similar manner, so that one can "cut" an array with a single application of . For example:
      (1 0 1 0)(1 1 0 1)⊂4 4⍴⎕A
┌─┬──┬─┐
│A│BC│D│
│E│FG│H│
├─┼──┼─┤
│I│JK│L│
│M│NO│P│
└─┴──┴─┘
 
right, still have to decide what to do with splits
 
@dzaima What do you mean?
 
@ngn we have 30 bytes w/o checks
 
@Adám I don't find & that useful (hence why they're not implemented) & I really want a normal split
 
@dzaima Even with my existing extension to ?
@dzaima Does normal split mean split on as opposed to split according to?
 
9:00 PM
Oct 11 at 15:00, by dzaima
@Adám this feels way too long for a "correct" split
@Adám so numbers >1 insert n-1 ⍬s before the item?
 
@dzaima I remember, but "correct" split is not very well defined, and if you specify it precisely, it becomes very arbitrary. Isn't this the same issue as a filter operator versus the compress function?
@dzaima Yes (except not but rather whatever is appropriate)
Anecdote from Roger Hui: Ironic that K only has depth and not rank (>1), because Arthur Whitney invented !
 
how about 1 0 1 1 0 0 f 'abcdef'⍬ 'b' ⍬ 'ef'?
though i guess that doesn't allow splitting on >1 char
actually wait that could be done by marking the splitting place as a number >1
 
@dzaima I'm not sure I understand how that works. Can you define f?
 
@dzaima you should be able to do that with a small modification to x, right? (Multiplication)
 
@Adám hmm, gimme a bit
 
9:07 PM
@dzaima (even in English)
 
ngn
@pierre cool! my best is 31
 
ngn
@pierre if you're worried about someone stealing your idea, you could post md5 or sha1 of the solution and reveal it after the deadline
 
copy down the letters, add bars on ones, add in empty regions
 
@dzaima So runs of 1s collapse to while runs of 0s become sections?
 
9:12 PM
@Adám runs on 1s don't collapse (or did i misunderstand what you meant by that?)
 
@dzaima Runs of 0s become sections, N-runs of 1s become (1⌊N-1)⍴⊂⍬
 
and then this
@Adám why a 1⌊ there?
 
@dzaima Because an initial 1 became 1
 
@Adám that's because it cut off the start (which just happened to have 0 elements)
 
@dzaima Runs of 0s become sections. All other numbers consume that many elements to produce a single ?
 
9:17 PM
@Adám non-zero numbers don't always produce , they just split the input there, and continue on. If it happens to cut off another number just after, adding a is just logical
maybe not even writing the would help illustrate it better. Given | b | | e f, and "normal" splitting on | gives you the result
 
@dzaima What is the significance of the parenthesised zero in: 1 0 1 0 2 (0) 0 f 'abcdefg'⍬ 'b' 'd' 'g'?
 
@Adám no idea, I was wondering what to do with it too
 
@dzaima ⍨
 
either just ignore it, or force it to be 0. really it doesn't have to be there
 
@dzaima I'd like to see an APL model so I can play around with it. I'd also like to see it in context to understand how you would use it.
CMC: Implement dzaima's splitting function.
 
ngn
9:22 PM
@pierre i found it! :) 30 bytes too
 
by some reason I really felt like implementing it in javascript
 
@dzaima You should be able to translate that to a tradfn.
 
@Adám right, that's a good start
though beyond this i don't see it being very useful..
another split idea because why not
or would it make more sense to take n+1 bits instead of n-1 to allow chopping off empty sections at the ends?
oh that's just with a 1 prepended..
and you've already added >1 adding s
 
9:58 PM
@dzaima {⍵⊆⍨~(0,2∨/⊢)⍣(≢1↓⍺)⊢⍺⍷⍵}?
@dzaima :-) Maybe my extension isn't so bad after all?
 
imo only ever discarding elements at all if the start is not 1 is the strangest thing ever
 
@dzaima Hm, maybe it could be extended to allow dropping elements. E.g. ¯1 means drop this element.
 
@Adám doesn't quite work the same
(and I've already made this)
 
@Adám But how would you both get 1 or more sections while also removing that element?
We need ¯0 so |⍺ is how many sections begin at each position (content in last one) and 0 means do not begin any section here; ¯0 means do not begin any section here and do not include this element; 1 mean begin one section here; ¯1 means begin one empty section here; 2 means empty section plus begin one here; ¯2 means two empty sections here.
¯1 1 ¯0 ¯0 1 0 ⊂ 'abcdef''b' 'ef'
 
10:23 PM
@ngn does your k have div, e.g. -4!#x ?
 
@pierre Isn't that remainder? ¯4|≢x?
 
4!#x would be the remainder
 
@pierre So what does it do with negative left arg?
 
it does div
 
@pierre How is that different from ÷/%?
 
10:28 PM
it's integer division, e.g. -2!5 is 2
 
@pierre So -x!y is _y%x?
 
yep
 
@pierre Isn't that a waste of a precious symbol? Or is that for performance?
 
not if you already have mod on x!y
for positive x
 
Interesting, why is ÷ faster than |?
 
10:36 PM
x!y for mod is nice and usually does fit into k (even k4 only has x!table overloaded for positive x). extensive overloads hurt readability though
 
@pierre I'm not questioning mod, I'm questioning intdiv.
 
ah yes, i forgot that -x! is analogous to ibeam in k4 :-) if you have already mod, putting anything more remote than div there is too much imho
 
@pierre I agree, but why not just extend mod to negative numbers as well?
 
that doesn't seem to be of any use?
note that k does not have commute and putting divisor in front is important
 
@pierre Yeah, ÷ and - are really backwards. ÷⍨ and -⍨ are much more natural.
Counter-argument is of course that - and ÷ as they are, lend themselves well to a default left argument for the monadic case.
Why does K have - as negate but % is not reciprocal (but rather square-root)? Negate is as easy (1-) as reciprocal ().
 
10:51 PM
% is reciprocal in k3 and k4
 
Divisor in front? So like ÷⍨, right?
 
rcp is quite useless. even if you manage to find a use for it, you pay with fp accuracy
 
@pierre Very useful if you don't have a nth-root primitive.
 
i mean reciprocal (rcp)
 
@Adám K has -x as 1-x?
 
10:57 PM
@Zacharý Yes.
 
So -1 is 0?
 
@Zacharý Oh, no, typo. I meant 0-
 
in q it's literally reciprocal btw :-) i don't think anyone actually types this
 
Is Q verbose?
 
@Zacharý Q is kind-of semi-verbose K.
 
11:00 PM
depends on what you're doing. usually needlessly so
q has useful table ops exposed as infix words
 
More verbose without being more readable, so what's the point?
 
Well, if they're named decently, it might be somewhat more readable
 
@dzaima I added pushmat and popmat, but they don't seem to be working. Or at least I can't get them to
@dzaima I lied
Your app is so bangin awesomesauce
I added push matrix and pop matrix as pum and pom because, in keeping with your abbv naming
 
11:40 PM
https://tio.run/##fVTNbtNAEL7vU8wtTZumjiGIGxIHKk7wClt7nRr8E2ynhVY5gaI0NAgpQq2QuHDKoUeqShybN9kXCd/MOm1Sia7qdHdm9pu/b1b3k93wRMepXi7ttx@v39jRd0@luof/p3b8c2fPTq@3/SHZr18oy4tU5NPrxQ3BiLAbkgryrKwKHWes5B87/csXkvyYDuPeoUiuBQIiez7O7PmEFUOFlRdxL84IRuQvbux0Tm@77TI@MSwBAGueex7hU/vYQ7uvFNuYatCXe6dDPidpOyB3zszxS50kLj47/UVBYXRlStJ0wPI8oyCJg/dKHZmglPiuyLfjSzv9I3G@y102djRr7bHN7ZyxFGoEcSOMs15Drbw4n4qQXUAtPnC6OB@ZxJ098nAM49QdQ/x0d3w4e@GzQgf1vbYzTHVZOsPFjc/6rJes4Wjgro7sRuN@fd3rwGJIRJuRKsWhcTgcA7tjF4IraALhAr967FPlQPo7mvnE4bvetaiD/uC7r8hTj/@ENCtRFzbPvAfCJ06olK7AoKDiUp4mPqU@b7bs2W87@Qw6NeGMG4A2jGbcD7pjVIfSjuOclLh
this where pushMatrix and popMatrix are used in your code. just rotates rectangles orbiting a mass in the center.
I have a data structuring question. Location, velocity, size, mass, these are all 2d vectors, but now along comes angular motion, and I only need a scalar. Is there a problem with having a vector of alternating scalar and 0, in keeping with the 2d vectors? In dzaima apl, I'm doing `↓,/⍬ 2∘⍴¨⍵, where ⍵ is a vector of vecctors of my pairs.
having the angle be a vector of (angle1 0 angle2 0 angle3 0) means I can keep the same transformation. how else can I accomplish this?
 

« first day (651 days earlier)      last day (2003 days later) »