@dzaima What exactly do you mean by "include"? Different from pointing at it in ⎕USING? (⎕USING is just a path, it doesn't care that you name your libraries with funny names.
@dzaima Dyalog appears to do a late-bound/runtime lookup when it meets a name in your code that isn't defined, and then goes searching through the ⎕using namespaces and DLLs; could it be possible for those namespaces / dlls to not exist yet at the time you set ⎕using ?
@dzaima I think you need the namespace from inside the file, and to enclose the string if there's only one entry for ⎕using; ⎕USING←⊂'System.Net,System.dll' the System.Net namespace which is stored in the file System.dll
oh, which is on Windows, so probably not relevant if you're on Linux and using .Net Core - although I did switch to WebUtility because it should be on .Net Core
@Adám speaking of tioDecode, would it be useful to have tioEncode and keep the code samples in plain text files with the APLCart source and generate TIO links from them?
@TessellatingHeckler Right, but maybe four columns: HEADER, CODE, FOOTER, INPUT and make the frontend split on ⋄s so the table contents can be used in a session as well.
re: apl cultivation ideas → I would say the biggest challenge I have when I work in APL isn't necessarily the language, its translating math papers and data structures/algorithms using TMA into APL. But thats sortve a broad, open ended topic.
most of it depends on prior work. for example, a few weeks ago I wrote a sha256 implementation in APL using pure dfns, but i would have never been able to do that if there werent a lotve blog posts that step thru each transformation step
i do a lot of messing around w/ networking stuff, and I think blake would be very useful for hashes that you need an expandable hash depending on number of times youre hashing something across your various clusters
@Adám I think so, yes; en.wikipedia.org/wiki/DEFLATE it's what TIO uses for the data compression, and it's a JavaScript/browser builtin. It's what my MemoryStreams are using .Net for.
@ngn I keep thinking APL has too many overloads because of the limited character set. Having to determine monadic vs dyadic use by context makes things difficult for no great benefit that I can see except fitting more things on an IBM printer ball
yea, i would prefer just using dfns but polyadic functions using infix notation is difficult (for example how would you pass in "foo" to {(⍺ ⍶ ⍵) foo ⍺ ⍹ ⍵} )
the thing ive found i enjoy the most about APL is how the notation has enabled me to internalize algorithms that I was completely incapable of w/o the notation
@cannadayr BQN solves this by letting functions take functions as arguments, and allowing functions to be elements in arrays. Trains don't really solve the general problem of applying one of f1, f2 or f3 between ⍺ and ⍵ depending on whether ⍺ g ⍵ returns 1, 2, or 3.
@dzaima interesting - yes, but outside of golfing i'd prefer straighforward
apl is perfect for golfing - there's enough complexity and overlapping responsibilities in the squiggles, so the same thing can be achieved in many different ways
@ngn ahh interesting. I'm only a little familiar. I am also interested in crypto, but more in using it to secure distributed networks. something like yggdrasil for example yggdrasil-network.github.io
@ngn im pretty familiar w/ X509, but not at an algorithm level, mostly just working w/ certs and whatnot. would like to dig into noise as well. hotp/totp too
examples of > the thing ive found i enjoy the most about APL is how the notation has enabled me to internalize algorithms that I was completely incapable of w/o the notation
(my reply was out of context, but the little arrow on the left links back to that comment of yours; it's the closest this chat has to threads)
sure, here would be my standard example: mean ← {(⍴⍵)÷⍨+/⍵} stdev ← { {0.5*⍨mean ⍵} {2*⍨⍵-⍨mean ⍵} ⍵ } skew ← {+/(⍺*⍨⍵-mean ⍵)÷(⍴⍵)×⍺*⍨stdev ⍵} ⍝ ⍺ ← 3 → skew ◊ ⍺ ← 4 → kurtosis
it would be much more difficult (for me personally at least), to have an understanding of those statistical functions, without relying on APL as a notation
@TessellatingHeckler you do realize this chat has something similar to threads? e.g. if you hover over this message of mine it will highlight the message of yours I am replying to
@Adám when I wrote it I was translating the wikipedia definitions and at the time 2 dfns seemed to be clearer to me. im not particularly tied to it and theres always a better way (yours for example).
@Adám its one of those things where I wrote it once and havent had to touch it since so I never bothered
@RGS Yep; that is what I was trying to point out to cannadayr; my message was "in reply to" theirs, just from a way back so it wasn't obvious; but it was linked.
@TessellatingHeckler oh the one that was linked was the one a couple of msgs above; I thought you meant the one immediately on top, which doesn't have the actual reply arrow, just a ">" which I interpreted as quoting cannadayr; that's what confused me, especially because I thought I had already seen you use the "reply" functionality
@Adám not that I'm aware of; {⍵ - mean ⍵} comes up a lot, but I have never seen anyone just simply exponentiating those values and then not doing anything with them. You'd usually, at least sum them
@TessellatingHeckler Yes, but ≢ finds the length along the first axis, and +⌿ sums along the first axis, so (+⌿÷≢) finds the column averages of a matrix, while (+/÷≢) makes no sense for a matrix.
Ah because it is enclosed, is that what you mean? Fair enough, then I was missing a ↑, yes; but funnily enough I would probably write it as ⋄ ⊃(+⌿÷≢) (1 1 1)(2 2 2)(3 3 3)(10 100 1000)
@RGS That's not very efficient, as it forces the interpreter to go pointer chasing. (+⌿÷≢)↑ can use vector instructions. Actually, (≢÷⍨1⊥↑) is even better, but more obscure.
I just kept thinking about a "list" of the things you want to average out, but this "list" is always rank 1, hitting your point about +/ and +⌿ being indistinguishable
@TessellatingHeckler Especially on Windows. If you just have a single APL item (function, operator, class,…) open in the editor, do File→Save As… then whenever you make a change to that item using the editor, the change is written to file, and if you use an external editor on the file, then the next time you open the editor on the APL item, it'll ask if you want to fetch the new definition.
@Adám a C# function returning new object[]{new object[0],new object[0]} seems to become quite mangled in Dyalog - with ]box on it prints as a [null] and an empty cell, and with ]box off it crashes Dyalog on printing
@TessellatingHeckler Yes, you can, but there's no easy way to get that into the editor in the first place. If you create such a file, and 2⎕FIX'file://path/to/file.apl it, then it should "just work". Btw, this ⎕FIX thing is how you get your content back from the file when you start up a clean APL interpreter.
@Adám when I start up a clean APL interpreter I just assume everything is gone :) It looks like )ed c:\sc\tio-parse.dyalog will open my code from file.
@TessellatingHeckler Right, which is just doing the ⎕FIX under the covers :-) I've bound that to Ctrl+S btw.
@TessellatingHeckler I so hate that bug. The bane of my existence. They claim they can't fix it, as it is an issue in Windows. I'm still wondering if we couldn't do a "onFocus="GetFocus()" or something.
@TessellatingHeckler There are also more involved was to use source in files, including the new Link system which will automatically two-way sync a namespace (including # if you want) and a directory in real-time, without you having to explicitly tell APL to save things in files or load things from them.
@Adám Windows has been getting more aggressive about blocking programs from jumping to the foreground and stealing focus in recent years; not sure I've seen it with alt-tab inside a program, but Dyalog is a non-trivial program
@TessellatingHeckler You can actually have APL load things automatically upon starting. That's what I do. I simply have most lightweight things autoload into category namespaces in ⎕SE, so e.g. to reorder APLcart's table.tsv file, I write ⎕SE.APLcart.ReorderFile'/g/aplcart/table.tsv'
@TessellatingHeckler You can't change nameclass in the editor. I was actually just working on a tool to help you do this, last week. Instead, do )ed ⍟TIOHelper and then paste in your tioCode
@Adám say I want to generate an image with APL. How would one go about that? In a perfect world I could generate 3 matrices (or a cube with 3 layers) being the RGB channels (maybe a fourth one for alpha?) and then save it with some special ⎕function...
@RGS PPM image file format is ASCII text numbers for the pixel values with a fairly simple header - en.wikipedia.org/wiki/Netpbm#PBM_example the third example is a colour one.
@RGS OK, so you found the Image object, right? Its documentation starts out by describing the Points property, and then the Picture property which can be a Bitmap. Go look up the Bitmap object then.
> A Bitmap may be created either from a file (.BMP, .GIF or .PNG) or from APL arrays. To create a Bitmap object using ⎕WC, you can either specify the File property or the CBits property, or the Bits and CMap properties.
I managed to figure out I care about the CBits property because that's what allows me to set each pixel to an arbitrary rgb value
so now say I have the cbits properly set in the variable rgb. How do I use that and ⎕WC to create the bitmap..?
@RGS Ah, it seems that Bitmap is a bit special in that you must specify what the origin of the data will be. Other properties (and in general, most properties for most objects) can be set later, though.
APLCart tells me 1∘|N is Fractional part of number; It gives the fractional part of ¯2.3 as 0.7 which I didn't expect. I see the help for it (residue) says it does something different for negative numbers, is that considered the fractional part of a negative number, or could the description note that it's only the fractional part of positive numbers?
but the "background" is black, so I figured 0 is for black and 255 is for white, so in the cbits line I changed it to cbits ← 256∘⊥¨ 256 - ↓⍉↑ (r×mask) (g×mask) (b×mask) but the image I get still has a black background
@Adám Lucky VIP, locking such a prime timeslot w/ u
Thanks for all the help, rest well
SILLY ME, doing 256 - ... makes 0 map to 256, which is still 0 because the max value is 255 -.-
btw, does anyone know the nick of this guy? I've seen him around a couple of times:
ok in case ppl didn't get it, I was just joking; please don't start scrolling back like crazy... I just generated this img
maybe I should create a thisSEAccountDoesNotExist site, just like the thispersondoesnotexist.com one; and all this is on-topic because this is what I just used APL 'Bitmap' for