« first day (628 days earlier)      last day (2013 days later) » 
00:00 - 17:0017:00 - 00:00

12:02 AM
I might even have to put the take ravel iota as an idiom in my compiler. :-)
Call it the Tridiom?
 
12:27 AM
It's slow because it's creating permutations of strings probably
and I did it in string format, beceause I needed it in the form of xx:xx:xx:.. and xxxx-xxxx-xxxx, as well as another format that I'm forgetting
i don't understand this one'0123456789ABCDEF'[(12⍴16)⊤⍳16.7e6]
 
Did you see that my example above also gives it in string format?
 
it just spews lots of numbers
 
It doesn't.
 
tha'ts what I'm saying, I don't understand the output
 
⎕←⎕DR '0123456789ABCDEF'[(12⍴16)⊤⍳500]⊣⎕IO←0
 
12:30 AM
@arcfide
WS FULL
 
LOL
⎕←⎕DR '0123456789ABCDEF'[(12⍴16)⊤⍳500]⊣⎕IO←0
 
@arcfide
80
 
i don't get what that does
8 bit character
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
that's one line of output
i don't get it mang
 
Did you see the other lines that I entered below that to explain how that line works?
⎕←⍉¨':-'⊣@(' '∘=)¨(17⍴1 1 0)(14⍴5↑4⍴1)⍀¨⊂'0123456789ABCDEF'[(12⍴16)⊤?5⍴2*48]⊣⎕IO←0
 
@arcfide
┌─────────────────┬──────────────┐
│4C:9A:69:64:90:03│4C9A-6964-9003│
│3A:52:A4:2E:47:06│3A52-A42E-4706│
│BF:DB:B5:4A:25:D8│BFDB-B54A-25D8│
│F6:54:C8:5A:9D:52│F654-C85A-9D52│
│95:74:FB:B0:8D:F6│9574-FBB0-8DF6│
└─────────────────┴──────────────┘
 
12:36 AM
@ngn yes I'd already arrived at that solution, but in the form of
{'0123456789ABCDEF'[⍵]}¨⍳6⍴16
no I don't see an explanation
I just see the 5 random
 
Did you see the other lines that I typed below that one with all the other expressions? They are all there. They explain that line.
 
i don't see anything that qualifies as an explanation, just that "it starts at 0 and I can shift it to any address I want"
I don't understand the output
 
The 5 random example explains the algorithm.
It also explains the output.
 
5 reshape of 2 to the 48th encode
i don't have the slightest what that means
 
Did you look up the definitions?
 
12:41 AM
definitions of what?
 
The primitives.
Did you try evaluating the sub-expressions?
 
yes but there's like 2 man.
12⍴16, got it
⊤5⍴2*48 is what makes no sense to me
what does that argument to ⊤ mean?
 
That's not what I typed.
That's also not how you parse APL.
 
that's what I'm saying. I'm completely new
talk to me like someone completely new
I don't know what I'm doing
and I've never used encode so knowing what it does in this circumstance is difficult for me to parse
 
I am. I'm saying you need to try to study those expressions. You said that you understood how to parse APL previously, yes?
 
12:44 AM
yeah... because it feels that way
up until I get something out of left field like this one
because I've never seen it before
 
This isn't left field, it's the same parsing rules as before.
APL has very simple parsing rules, generally. This is not doing anything special.
So, the first thing you should do is identify the left and right arguments to encode.
 
⍳16.7e6 or whatever it was scientific notation, iota of that, a list from zero to that
the left argument is 16 16 16 16... etc
i identified that
 
Right. And what did I use instead of the iota expression for the random case?
 
it doesn't help me in understanding what encode is doing. and I have the docs up
5⍴2*48
 
No.
 
12:46 AM
??
ok ?5⍴2*48
 
Right.
 
yes I get that it's random
 
Alright, great.
 
but again, what is 5⍴2*48. is that a constant? what is that?
 
So now, what do the docs say about Encode?
Did you try it out?
 
12:47 AM
yes and I got 5 random mac addresses
I have the help thing up with dyadic encode
 
Right.
But I mean, did you try out 5⍴2*48?
 
I see nothing here explaining to me what it would do with 2*48
 
That should tell you what you wanted to know.
 
And what did it give you?
 
12:48 AM
2.814749767E14 5x
 
Right.
And so then what is the right argument to Encode?
In this example, at least.
 
5 random numbers < 2.814749767E14
 
Right.
 
i got all that
 
Now, what are those 5 random numbers?
 
12:49 AM
random
 
They're just five MAC addresses, right?
Because a MAC address is just a number.
Just a number in the range [0,2*48).
 
oh
so the left is 12 base 16 encoded digits from the number in the right
 
No, but you're on the right track.
 
⊢ you m ean this?
 
The left argument is a base, number system, encoding, polynomial thingy (I forget the exact term), array shape, &c.
 
12:52 AM
oh, right tRack
 
We're talking about Encode, not Right Tack.
If you read the definition of Encode you should recognize this as a common pattern.
 
you said right track, :P I misread it
 
:-) Sorry.
So we've simply split out each random number into its constituent base 16 digits.
For a fixed integer size.
 
@dzaima again we're talking about number theory to an otherwise simply stated but highly unperformant problem
 
You should hopefully notice that this is literally equivalent to the mapping of linear indices of a vector into the row-major indices of an array of a given shape.
This is not number theory.
This is middle school math.
It's simply two different ways to write a number.
Or, put another way, two different ways to Encode a number.
And we're dealing with MAC addresses, which are just numbers anyways.
To see the mapping from Encoding to Iota (Indices), see this:
⎕←⍳3 3 3⊣⎕IO←0
 
12:57 AM
@arcfide
┌─────┬─────┬─────┐
│0 0 0│0 0 1│0 0 2│
├─────┼─────┼─────┤
│0 1 0│0 1 1│0 1 2│
├─────┼─────┼─────┤
│0 2 0│0 2 1│0 2 2│
└─────┴─────┴─────┘
┌─────┬─────┬─────┐
│1 0 0│1 0 1│1 0 2│
├─────┼─────┼─────┤
│1 1 0│1 1 1│1 1 2│
├─────┼─────┼─────┤
│1 2 0│1 2 1│1 2 2│
└─────┴─────┴─────┘
┌─────┬─────┬─────┐
│2 0 0│2 0 1│2 0 2│
├─────┼─────┼─────┤
│2 1 0│2 1 1│2 1 2│
├─────┼─────┼─────┤
│2 2 0│2 2 1│2 2 2│
└─────┴─────┴─────┘
 
⎕←3 3 3⊤⍳27
 
@arcfide
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 0
0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2 0
1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0
 
Oops.
⎕←3 3 3⊤⍳27⊣⎕IO←0
 
@arcfide
0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2
0 0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2
0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2
 
But you should already have seen that, right, because you tried out the Encode expression already, right? :-)
Put another way, the enumeration of sequential MAC addresses to the display formats you described is literally and most directly rephrased as saying the mapping/encoding of a set of numbers on a range [X,Y) to their base 16 representations using a fixed integer size of 6 octets with either : or - as place separators at widths 8 and 16 bits, respectively.
The above expression literally does just that with 5 random numbers.
Does that make sense?
 
1:16 AM
@nathanrogers If you examine the asymptotic and constant factor complexities between the examples I gave and the code snippet you gave, you should see where the performance penalties are.
In particular, remember that each array value other than a simple array value requires its own array header, and that catenation without optimized, idiomatic forms requires linear time to compute.
 
Life is but a dream
But right now it’s a nightmare
 
It is? What's got you down?
 
Ah, whoops, wrong chat room - don’t mind me
 
Hahaha.
Life with APL is meant to be dreamy, but it shouldn't become a nightmare!
 
There’s a fine line :P
“Life can only be understood backwards; but it must be lived forwards.” Don’t remember the author of that, but it applies to APL too! ;)
 
1:21 AM
Oh, here's a fun demo:
⎕←⎕SIZE¨'YX'⊣(Y←⍳3 3 3)(X←3 3 3⊤⍳27)
 
@arcfide
┌────┬───┐
│1344│128│
└────┴───┘
 
That relates to the above.
 
1:33 AM
so there's still something I'm not understanding
perhaps its a gap in my knowledge about hex
 
Sure.
 
because usually I'm only dealing with hex in 2 columns
 
What's up?
 
as opposed to a representation of a base 10 number
like RGB, I've never really thought about hex larger than 2 columns
 
2 columns?
2 digits?
 
1:34 AM
yes
 
Okay.
What has you down?
 
so understanding how 8.318241542E13 ≡ 4 11 10 7 6 10 5 2 9 11 13 3 in some way
that's where my confusion lies, but again, that isn't to say I don't understand the behavior, but that I don't understand how one could arrive at that solution
 
You mean, how did I arrive at the solution I did, or how does that equivalence hold?
 
i'm assuming you arrived at the solution with a thorough understanding of the relationships between different counting systems
 
Not at all, really.
 
1:37 AM
oh good
 
But different counting systems is relatively trivial. However, that's a roundabout way to get there.
But every counting system works in exactly the same way.
In this case, I arrived at the solution because that solution is almost a word for word translation of the problem statement.
 
see and that's where I disagree. for me this is clearly a combinations problem
not a base 16 counting problem
 
A MAC address is by definition a 48-bit integer.
That's literally how it's defined.
 
not to someone who never directly interacts with hex
 
MAC addresses are not strings.
 
1:39 AM
except they are
 
They aren't. :-)
 
in just about every program on any project that I've worked on
hex "numbers" can be found inside of ""
 
No more than writing the digits 1, 0, 5, and 6 adjacent to one another means that 1056 the number is the same as 1 0 5 6 the string.
 
in most ides representing hex without "" will have nice red squigglies everywhere, and you probably won't compile
 
Any project that stores any such number as a string is either exceptionally lazy, wrong, or plane crazy.
 
1:41 AM
or web developers who have no need for real hex numbers
 
Maybe that's a bit of a strong statement.
 
just that they want some rgb value
 
But it's close.
Every number has to be represented as a string when we write it.
That's true for pen and paper and for files.
We write numbers as strings.
But that's true for all numbers.
They should not be encoded in memory as string types in the programming language.
And they are not, in their definition, defined as such.
They are defined as a 48-bit integer.
With a specific endianness, usually.
And there are a set of common writing methods for writing a MAC address.
But those encodings of a MAC address are just different methods for writing a number.
They are just like some countries use 1,000,000.57 to represent 1.57e6 and others might write 1 000 000,57.
Oops.
That's not right.
I mean 1e6+.57
The same goes for RGB values.
So, if you say that you want some set of MAC addresses, that's by definition asking for some set of numbers in a given range.
 
harumph
 
You may then say that you want a string representing those values, but that's just a display problem/encoding problem on top of that.
Same as asking someone to write down their phone number with one style or another.
It's still the same number.
 
1:46 AM
harumph m'gurtz
 
So, that breaks the problem down into 1) how to generate a set of numbers; and, 2) how to display a number in the MAC address standard formatting styles.
Generating a set of numbers is basically trivial, or a single primitive in APL.
The MAC address format takes a number and encodes it in HEX.
Encoding a number into its digits of a given base and for a given size is literally the definition of encode with a repeating element left argument.
And mapping a digit to a specific string representation is literally just an indexing problem, which is bracketing.
From there, the only question is where to put the placeholders : and -.
 
ok so... can you explain to me the first thing you wrote?'0123456789ABCDEF'[(12⍴16)⊤⍳16.7e6]
 
And that's literally the Expand function with substitution (@).
That's literally read as "the HEX encoding of a 12 digit base 16 encoding of the numbers on the range [0,16.7e6)."
 
its like 300 character fields each result. i tried a reshape on it thinking I understood the output, but I failed apparently
 
Did you take the shape of it?
The other expressions showed you how to deal with its shape.
But all you need to do is look at my encode examples above.
However, taking the shape of it is probably a good start.
 
1:51 AM
12 x 16.7 million
 
Right.
 
so then... each row is a mac address?
 
….
 
I DONT GET IT...............................
 
:-)
Shapes are given in row-major order.
So if there are 12 rows and 16.7e6 columns....
 
1:53 AM
you'ins with all your math talk
so then each column is a mac address...
 
Each column is a MAC address, right!
Winner winner chicken dinner!
Give this man a victory log!
⎕←⍟
 
@arcfide
⍟
SYNTAX ERROR
 
cute. so then a ↑ should show mac by mac?
 
No.
 
the more comfortable I feel...
 
1:55 AM
LOL
You are trying to use nested arrays again. :-)
 
no really
things start to feel intuitive for 1 second
 
In this case, just transpose the result and you will get something of the shape 16.7e6 12.
 
and then there's a bed of barbed spikes waiting for a dink
 
Notice the transpose that I have in all of my other examples?
That switches it so that each MAC address has its own row.
There is absolutely no reason in this case why you would want to store your MAC addresses as strings, but even much less, to store them as a nested vector of strings.
 
yeah, that's what I was using ↑↓ for yesterday
 
1:57 AM
Those don't transpose things, they mix and split things.
 
which appear to do the same thing for stri... I. MEAN. BOXED. CHAR. VECTORS. OR. SUMMAT.....
 
Mix and Split exchange depth for rank, transpose permutes shape.
⎕←(⍴X)(≡X)(⍴↑X)(≡↑X)⊣X←(5 4 3)(3 2 1)
 
@arcfide
┌─┬─┬───┬─┐
│2│2│2 3│1│
└─┴─┴───┴─┘
 
really is there no like... idk, NOVICE problems to solve in APL? maybe something that doesn't require linear algebra and number theory?
 
This problem didn't require number theory or linear algebra. :-)
 
1:59 AM
i mean
 
It does require that you know how number systems work.
 
working with APL is requiring a prettty dense level of understanding matrix behavior
 
But then again, if you're working with MAC addresses you really should know how that works.
 
listen
I had to generate a bunch of strings in a csv
so combinations seemed the most obvious algorithmic solution
 
Hrm.
 
2:00 AM
these are the types of solutions python, c#, js, and the lot tend to encourage
 
How much formal C.S. education have you had, if you don't mind me asking?
You said that you were working on this stuff, so I might have incorrectly assumed that you had a 2 or 4-year C.S. degree, sorry.
 
from itertools import product
no I'm completely self taught
 
Okay, I'll keep that in mind.
 
i've taught myself through trigonometry
and working through calculus as I can
 
These are the sorts of things you would learn in a CS101 course.
 
2:01 AM
I was 6 years army, and no formal education
 
Okay, that makes sense.
 
more electrical engineer than sotware
 
That's no big deal, it's just that you should expect to have some holes in your C.S. theory that might give you fits at times.
 
soldered circuits and used spectrum analyzers for debugging satcom circuitry
tell me what to learn then
I'm banging my head against the wall
 
:-) Welcome to C.S.
We all have a little lump on our heads from our table meets head days.
 
2:02 AM
I've been employed in the field for a few years now, and these are not things you come accross in enterprise software
everything is map, filter, reduce, or some kind of linq expression, or some form of OOP design pattern
nobody, and I mean not even the masters in comp sci guys I've encountered solve things at all past manual iteration and OOP design patterns
most of them can't wrap their brains around recursion or anonymous functions, let alone a ycombinator.
tell me what I need to learn, because I'm not learning anything from these copy pasta mafiosos
 
Didn't you say that the MAC addresses problem came from your field?
 
I was helping some network engineer generate some mac addresses in a csv for some automation thing
 
There are a ton of classic C.S. books that would be good, but if you're leaning towards APL, then seeing how APL solves a lot of problems would be great.
 
he couldn't code, and I remembered product from itertools in python
so it took my 10 minutes to write, but then like 10 minutes to execute at the same time
 
The APL Idiom list is a great start, as is the classic APL book, and Hui's archive of papers and my "Getting Started with APL" blog post.
 
2:06 AM
links?
 
That final link is a collection of other links.
The great thing about APL is that allows you to serendipitously leverage prior domain knowledge to solve a wide range of problems. However, if you don't have that prior domain knowledge, then solving problems without understanding their underlying structure can be difficult.
The Encode, function, for instance, manifests the generalized functionality found across various domains, such as time, polynomials, number systems, permutations, SAT solving, and so forth, but you have to understand those domains before that can become clear.
 
MasteringDyalogAPL.pdf
this is what I've been working through
 
:-)
That's a good book for learning the APIs, but the Intro will help you learn dfns.
However, it won't teach you how to think like an APLer.
The introduction is still a good bit of reading though.
BBL
Feel free to continue asking questions. :-)
 
@arcfide about your research
 
The problems you're dealing with probably have simple solutions in APL, but your team and the field just isn't aware of them.
 
2:13 AM
I'm looking at your github, but what am I looking to read there?
 
Depends on what you're after.
But the README should contain some links to publications that are fun.
 
what you were saying earlier about trees
trees
 
And if you want, you can read the code. :-)
Oh, you can read some of the publications, particularly the "Key to a …" paper, which shows trees using depth vectors, and then cmp/e.cd which is the updated version of the compiler using parent-sibling vectors instead of depth vectors for tree manipulation.
If you also want to learn more about tree traversal instead of tree manipulation, you can read up on the original APL book as well as "Graph Algorithms in the Language of Linear Algebra."
 
@arcfide well, what have you got for a book on linear algebra?
 
I took a course in linear algebra in college, but I'm not sure I can recommend the book.
However, just about any book will probably be fine. However, I think most people would assert that you don't need a lot of linear algebra experience to use APL.
 
2:27 AM
but then...
you
 
Just learn what the operations are, and learn how they relate.
 
"Graph Algorithms in the Language of Linear Algebra."
i mean
 
That's because people consider APL to be a "language of linear algebra."
That doesn't mean that theoretical Linear Algebra is likely to be a good "daily driver" skillset.
It certainly doesn't hurt at all.
But most people, including myself, probably couldn't go beyond the basics.
And most of the basics you can learn on Wikipedia.
 
i see
 
However, having a Linear Algebra textbook is probably a nice thing to have.
However, things like rank, shape, row-major order, the relationship between elements and their indices, and the core APL primitives are all something you should know and feel comfortable with.
Depth is probably also an important concept, as is "cell" from J, which modern APL also uses.
Simply going through the APL Idiom list is probably a good way to explore the primitives and what you can do with them.
 
2:33 AM
i haven't seen "depth" before
this?
 
That would be a fun read, but you generally want the Finn APL Idiom list from the APL Wiki.
Those are examples that you may or may not want to use in practice, but they are very useful to learn the language.
You have seen depth before, because I used it above.
37 mins ago, by arcfide
⎕←(⍴X)(≡X)(⍴↑X)(≡↑X)⊣X←(5 4 3)(3 2 1)
 
i haven't seen the word used, and I don't know what it refers to
 
Did you read the basic APL cheat sheet?
I also used the word above.
I generally recommend the heavy use of the APL reference material available.
Dyalog has some of the most comprehensive reference material around.
It's especially good to go through the primitives and understand their documentation.
 
 
3 hours later…
5:33 AM
@arcfide aplwiki.com/FinnAplIdiomLibrary#The_FinnAPL_Idiom_Library this is bonkers. I don't understand a thing this page is talking about
 
6:19 AM
@nathanrogers I recommend this compilation of three idiom lists, FinnAPL's, IBM's, and Dyalog's. (CC: @arcfide)
 
ngn
7:04 AM
@arcfide sure, encode (⊤) is better, it doesn't create so many temporary nested vectors
@arcfide you mean mix ravel iota. in k !list does that:
 !2 3 4
(0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
 0 0 0 0 1 1 1 1 2 2 2 2 0 0 0 0 1 1 1 1 2 2 2 2
 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3)
@arcfide there are recognised idioms that consist of more than 2 primitives, e.g. dyalog's {(+/∧\' '=⍵)↓⍵}
 
7:26 AM
@ngn it comes from the desire to have f:+' or f:,' mean anything. we need to choose valence upfront, and defaulting to dyad is useful for x#'y
 
ngn
@pierre thanks. for reference, here's a link to attila's answer too
@pierre in theory, the valence of +' could be determined at parse time, and + could have the same valence, but i understand the desire to have consistency
 
ngn
7:53 AM
when isolated, like in f:+', the derv is ambivalent, just the way f:+/ and f:+\ are, so the status quo is fine there
but in larger expressions, like *+'a, it's easy to determine how +' will be applied
 
ngn
8:18 AM
it's a similar situation with compositions, eg (*|)0 1 - theoretically the parser could determine that (*|) is applied monadicly, so the rightmost verb in it (|) is monadic and the result should be 1, not *|[0 1]
 
 
1 hour later…
9:26 AM
@ngn (*|) is a noun, there's no syntax to apply it dyadically
@ngn +' is ambivalent but not ambiguous. we know it reads 'plus each', not 'flip each'
 
ngn
@pierre ah! you're right. apl habits... :)
@pierre ok, here's another line of thought (i hope i'm not being too annoying): in a%*+b it's clear that % is dyadic, and * and + are monadic. in f:+ the + is assumed to be dyadic. the parser could do the same for a%'*'+'b and f:+' at no extra runtime cost
@pierre (*|)[0 1;2 3] would be clearly "dyadic" (if that's the right term for [ ] syntax). (*|) . args would be unclear.
 
 
1 hour later…
11:18 AM
@dzaima CTO says the documentation is overly zealous, and that certain dfns are invertible, but only if they are Dyalog idioms. We can fix the named-vs-unnamed issue.
 
 
3 hours later…
ngn
1:48 PM
i modelled the +'x ←→ +:'x idea in my impl. nothing broke in my past golfs
 
 
1 hour later…
2:52 PM
@ngn Do you have QAs for already posted code golf solutions?
 
ngn
@Adám yes
 
 
1 hour later…
4:12 PM
hey I need a pointer on the ⍣ operator
⍣ function
I need the function to repeat until ∨/25=⍵
how would I write f⍣(∨/25=) the correct way?
 
@nathanrogers f⍣(∨/25=⊣)
 
how can I tell the repl to display the definitions of functions instead of ∇fn_name
 
@nathanrogers turn ]boxing on or enter ]defs
 
I'm getting a domain error
I run f f f f f f f f f a
and it works fine
but using the prod is throwing domain error
 
@nathanrogers What is the shape of ?
 
4:20 PM
4
or n
 
@nathanrogers Is it a simple array?
 
@nathanrogers Why not 25∊⊣?
 
4:35 PM
adddice ← {⍵+a×~⍺<⍵+a←?(⍴⍵)⍴6}
game ← {(⍺*2){{⍵++/(sl[;1]∊⍵)×sl[;2]}¨⍺ adddice ⍵}⍣((⍺*2)∊⊣)⍵/1}
sl←4 2⍴3 10 10 10 23 ¯9 17 ¯11
⎕←5 game 4
 
@nathanrogers
VALUE ERROR
 
⎕←5 game 4
snakes and ladders :D I did a thing!
left argument of game is the length of the board, so it creates a square board of ⍺x⍺, the right argument is number of players
winner←{'Player '((⍺ game ⍵)⍳⍺*2)' is the winner!'}
is there a more idiomatic way to do this? {⍵++/(sl[;1]∊⍵)×sl[;2]}

sum the right column where in first column
{⍵+⊃⌽sl[⍸sl[;1]∊⍵;]} that also works
{⍵+⊃⌽sl[⍸sl∊⍵]}
but then so does that
 
00:00 - 17:0017:00 - 00:00

« first day (628 days earlier)      last day (2013 days later) »