« first day (1308 days earlier)      last day (1345 days later) » 
01:00 - 18:0018:00 - 00:00

6:00 PM
@Adám how could i include a .NET .dll/.so in Dyalog? (also is there a reason ⎕USING gives no errors, and is completely fine with ⎕using←1↓⎕AV?)
 
@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 ?
 
@Adám just ⎕USING←'/path/to/file.dll' doesn't seem to work. if it should, then i guess there's something i've screwed up on my part
 
@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
 
@dzaima You at least need a comma in front of the path, if not including the namespace name as ^ says.
 
6:06 PM
Then you can run WebUtility.UrlDecode ⊂hash and Dyalog finds WebUtility name in the System.Net namespace, implementation in the System.dll file
 
@TessellatingHeckler You don't need to enclose it. We'll do that for you:
      ≡⎕using←⎕A
1
      ≡⎕using
2
 
@Adám I have that backwards, don't I? You need to enclose it for catenating a second name(?) ⎕USING←'this'` and ⎕USING,←⊂'that'
 
@TessellatingHeckler Right, of course.
 
@TessellatingHeckler that particular thing doesn't seem to work, but others do so i have to assume i'm doing something wrong with my dll
 
@Adám :|
@dzaima ⎕USING←'System' 'System.Net,System.dll' works in my tioCode "abusive" dfn ?
 
6:11 PM
@dzaima Meaning you can get other libraries to work for you from inside APL?
 
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 i haven't tried any other dlls, but DateTime works
 
OK, good. Just wanted to make sure you had .NET enabled.
@TessellatingHeckler You can use Core on Windows too.
 
@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 I guess so, but it'd need some kind of syntax to put code in TIO's various fields.
The code should then be right inside table.tsv
We'd need to generate the TIO url in JS, but that shouldn't be hard, since TIO's frontend does it.
 
6:15 PM
if it were PowerShell I'd use hashtables, since TIO is a website JSON would make sense, or a custom:
HEADER:
...
CODE:
...
FOOTER:
...
INPUT:
...

That would make the TSV a little unwieldy, with multiline code
I was thinking a make/build stage
@Adám Do any of the examples use TIO's optional "additional argument" fields?
 
@TessellatingHeckler I've been so proud of not having that or a backend.
@TessellatingHeckler No, that field isn't used by Dyalog APL.
 
@dzaima got it to work \o/
 
@Adám I understand that. :)
I'll write off that idea; blocks of multiline code in each row of the TSV sounds unmanagable
@dzaima Cool; what DLL is it? I haven't looked at .Net Core on Linux, curious what you've found that might be useful
 
@TessellatingHeckler it's mine :>
i'll show it working once it's working
 
6:27 PM
@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
 
@cannadayr Interesting, I would have thought it'd be much easier to translate TMA to APL than to other PLs.
 
oh it is, but there is much less prior work than other languages
im also a very visual/spacial thinker, so usually I have to read a paper, think about it for a bit, and step thru things individually
more of a network effect than a language feature effect
but once I do complete an algorithm, it usually just works
and by that point i have internalized it such that I have a strong mental representation of it that makes the implementation almost moot
 
ngn
6:44 PM
@cannadayr can you show your sha2 impl?
 
sure i can post to github
 
Do you happen to have a DEFLATE decompressor, by any chance?
 
@TessellatingHeckler That's gzip/zlib, no?
 
@TessellatingHeckler no but thats a good prj idea
 
ngn
6:52 PM
@cannadayr thanks! i'll study it. i was working on crypto hashes in c recently, for ngn/k. here's my take on sha2.
 
my gnu apl sha256 implementation is slooooooow btw
@ngn yea I picked sha256 as a warmup to blake128 but havent gotten around to it yet
 
ngn
@cannadayr i haven't done blake either
i decided i'd better do a cipher first
aaron hsu used to have some crypto lib in apl, btw
 
@ngn Why are your comments so verbose‽
 
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
 
ngn
@Adám wdym?
 
6:54 PM
sry, its post-afternoon and my brain is repeating itself
@ngn is this sha2 or sha3? I see keccak..
 
@ngn big-endianbe, merkle-damgard construction with paddingmerkle-damgard constr w pad.
 
ah same file nvm
 
ngn
@cannadayr look at the highlighted code, above keccak
 
your C is both mystical and completely incomprehensible to me hah
 
ngn
@cannadayr it's mostly like whitney's: C=char, I=int, .. if you read the beginning of k.h it should be a lot less mystical
@Adám how should i abbreviate them? :D
 
6:59 PM
ah ya i looked a little at hsu's crypto library. not too much tho.
 
ngn
@cannadayr may i ask for what purpose you need crypto?
 
theres a lotve hash algorithms used in distributed networking
 
ngn
@cannadayr nearly 50 lines for aes! meh. i was expecting something better.
 
ehh, works for me.
clarity > line count imo
if i wrote in dyalog could probably make it much cleaner/faster
 
ngn
@cannadayr but once it's clear, shorter=simpler
 
7:03 PM
to a degree
depends on what you end up optimizing for
 
ngn
0.simplicity 1.speed
 
ive never been good at the whitney style C code or apl to an extent
 
ngn
it's a habit you develop gradually. i think it helps a lot with productivity.
 
id have to muse about what I optimize for
tentatively id say malleability and purity
(purity in terms of local variables and side effects)
im sure if I spent some time to playing with it I could factor it down smaller but it wasnt high on my concern list when I wrote it
i dont consider myself a very talented programmer, more like a drunken child playing with blocks.
 
ngn
@cannadayr same here :)
 
7:08 PM
ive had much more success on the networking/protocols and more recently data over my prof career
tbh my current job doesnt even involve writing software. mostly sql and shell. and i use apl to do ad-hoc data analysis
 
ngn
@cannadayr like in my 3x3 lang comparison :)
 
I hath returned
 
hah
 
@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.
 
i want to like K, but I just find APL much easier to read (maybe familiarity)
also I like to mess around w/ math/physics and K seems more optimized for flat, time series based data
 
7:12 PM
d e f l a t e
 
@matt Wanting more?
 
been a long time
 
if I worked in finance and somebody drove a dump truck full of money to my apartment id change my mind and all my beliefs pretty quickly tho
my fav line about K I saw on reddit was something like "I get paid $400k to code golf in my underwear"
 
ngn
@cannadayr k has many overloads because of the limited character set. on the other hand apl has trains.
 
yea im not a big fan of the overloads in K or digraphs in J
 
ngn
7:17 PM
both hurt "readability", but with enough practice your eyes just get accustomed to the patterns.
 
trains im agnostic about.
i would prefer a syntax where theyre no longer needer
 
@ngn trains allow writing better code. limited symbol set doesn't though
 
@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
 
ngn
@cannadayr functions at odd/even positions in trains have different meanings
@dzaima i'm not sure
 
@ngn that's a solved problem if you don't hate whitespace
 
7:18 PM
thoughts on my learning apl more
:/
 
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 ⍺ ⍹ ⍵} )
sry to hear that @matt
 
@dzaima trains also aren't forced to be used. Of course, if they seem to be a net negative, don't use them!
 
yeah just too complicated imo
 
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
 
what did you just say
 
ngn
7:21 PM
@matt i hope you're not discouraged by the other conversations we're having here? apl is worth learning
 
oh its not that its just been a while since i was in here last
 
ngn
@dzaima they take up syntactic "space" that could have been used in better ways
 
& i forgot literally all of it anyway
 
ngn
@dzaima f g h could have been a straightforward {f g h⍵} (or dyadic: {f g ⍺h⍵}) instead of this weird odd-even thing
 
@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.
@ngn But those can be written as f⍤g⍤h
 
7:27 PM
@ngn that's just trivially saving 3-4 chars, which is cool and all if you must golf code, but not that useful otherwise
 
ngn
@Adám f g h is simpler than f⍤g⍤h, it should do the simpler thing (i think)
 
@Adám yep that was one of the things I appreciated reading the spec, still want to spend some time playing around w/ BQN so I can internalize it.
my company is giving us all a "wellness day" on friday so maybe ill set some time aside for that
 
@ngn I agree that the symbol for atop is unfortunate. BQN has better composition symbols.
 
@dzaima (trains also "save chars", but at least it's non-trivial enough to lead to interesting usages, imo)
 
@cannadayr You may want to use the reply functionality so it becomes clearer what you're responding to.
 
7:29 PM
@Adám will do
 
I meant reply, not ping :-)
 
ohhh
 
ngn
@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
i don't get this feeling with k
i've done my trolling for the evening :)
i'm much more interested in crypto
 
@ngn "the squiggles" ah yes
 
@ngn crypto for what field?
 
ngn
7:34 PM
@cannadayr i'd like to invest some time in learning fhe, mpc, and related stuff
(computing on data without knowing the data)
 
@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
@cannadayr in mpc there's an assumption that communication channels are already secure :)
 
@ngn pretty big assumption
 
ngn
@cannadayr tls's job
 
@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
 
7:41 PM
@cannadayr Can you share any examples?
 
@ngn one of my last jobs involved sys admin-ing 5k+ domains and 8+ MTA domains, so learning TLS was pretty required
@TessellatingHeckler TLS examples?
 
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
 
mean as the quantity spread over the shape; hey that visualises quite nicely
 
@cannadayr Is there a reason your stdev has inner braces?
I mean, isn't { 0.5*⍨mean 2*⍨⍵-⍨mean ⍵ } clearer?
 
RGS
7:50 PM
@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 Is {⍺*⍨⍵-mean ⍵} a meaningful (no pun intended) concept?
 
RGS
@Adám you just had me pause the music to give it some focused thought!
 
@TessellatingHeckler there are shorter implementations using trains / dyalog ive seen
 
@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.
 
RGS
7:58 PM
@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
 
@cannadayr indeed, (+/÷≢) is one of the first trains shown (assuming I've got it right)
 
RGS
@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
 
alright y'all, im off to get some work in and do errands and whatnot. cheers.
 
@TessellatingHeckler Roger Hui would correct you to (+⌿÷≢), but depending on the audience's background, I prefer (f+g) or (+,-) as easier to grasp.
 
@Adám would correct me? what's different? that appears to be sum divide tally the same as I typed?
 
RGS
8:13 PM
@TessellatingHeckler ⋄ (+⌿÷≢) (1 1 1)(2 2 2)(3 3 3)(10 100 1000)
 
@RGS 4 26.5 251.5
 
@RGS Missing a ?
 
RGS
@Adám nope
Using ⌿ you get to do the average of vectors in a clean way, for e.g.
 
oh, ⌿ not / right
 
@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.
 
RGS
8:14 PM
@Adám would use this to find, e.g. the centre of mass of a set of points
 
@RGS Uh, are you sure you know the exact difference between +⌿ and +/?
 
RGS
@Adám I don't mean to average each vector, I mean to find the average vector
 
@Adám I didn't see the overstruck minus symbol, I thought they were identical except for the monospaced font
 
@RGS Are you sure you're not missing a monadic in your expression?
 
RGS
@Adám yes! Where would you put it?
 
8:17 PM
Between the mean function and the vector of vectors.
 
⋄ (+⌿÷≢) ↑(1 1 1)(2 2 2)(3 3 3)(10 100 1000)
 
@TessellatingHeckler 4 26.5 251.5
 
RGS
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)
 
Well, yeah, and the difference between +/ and +⌿ is only noticeable by rank>1, and will make your vector of vectors into a matrix.
+/ is simply +⌿⍤1 but since your argument was already rank 1, it wouldn't matter.
 
RGS
@Adám yeah wait, you are absolutely right
 
8:20 PM
@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.
 
RGS
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
 
      ]runtime -c ⊃(+⌿÷≢)vov (+⌿÷≢)↑vov

  ⊃(+⌿÷≢)vov → 1.0E¯6 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  (+⌿÷≢)↑vov → 8.9E¯7 | -16% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
      vov←?100⍴⊂3⍴1000
      ]runtime -c ⊃(+⌿÷≢)vov (+⌿÷≢)↑vov

  ⊃(+⌿÷≢)vov → 8.0E¯6 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  (+⌿÷≢)↑vov → 3.5E¯6 | -57% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
@Adám is it?
 
@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
 
8:32 PM
@Adám cool, that seems easy enough ... can I have more than a single item in a file, just random code - a tradfn and a dfn, or two tradfns, etc.?
 
@dzaima I know so little about stuff like that. Can you email support@ ?
 
otherwise, yay, more pointless stuff \o/
https://dzaima.github.io/paste/#0tVLNTsJAEL73Kea2EAntFlE08eBfDAeJBo0HwqHQrWBaaqBG1Jg0HEwkYjhA5GJiTEw08SYHz/om@wQ@gtsfKtBS4GAz6X7z7cw3szsLYH30vnuYTWd26E0bbWZjfEnXCC9fSmVN4tMykfaq@gkpGjV@Yz/DF@0lLqsqApS9qBlEQ5wtAwUmwLQy20fAQlwSLxTiSgVdYeH74eex@3aNIglI0Faftj6wEOUwBhFDAnOLGJIYljC3jCGFYQW7ArT5rP8Jb0kGOShrBCKiIAqQAjEZ5VK8mORtH4urgsAM1nfddD2yFsvFk3kmE3U6SdCXptMJ6G7Q2IdhPpqDwA5gPnpwi6xJQPT26euVNj9ps4MggmpsJOy@SV3STlULGaRusEVX2E8uKwqpkopFqKRybJQYONercg1FOdq5ox3TZ@@2hTPmhMS5eHOa7Ix12@wkjVzmTFXzDNjmHaztYwILt4NiQvjwrZC6AWFW9@57dnMauuJBZtaE2WLN1ePsGXqeM1rPdd/CsIb
 
@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.
 
RGS
@TessellatingHeckler whenever I need that I just create a Namespace to hold everything together
 
That said, Dyalog recommends one file per item, but an item can of course be a :Namespace or :Class or :Interface with many members.
 
RGS
8:37 PM
@Adám is the .apl instead of .dyalog extension recommended or what..?
 
@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.
 
@RGS No, it was just an example.
@TessellatingHeckler Yes, but it won't establish the code in the workspace (unless you tell it to).
 
alt-tab from the editor to the main workspace window changes the focus, but the editor stays over the top, lol; but only the first time
@Adám unless I alt-f f fix it
 
@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.
 
RGS
@Adám where does one learn that? past webinar?
 
8:45 PM
@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'
 
RGS
@Adám that's also a nifty thing to be able to do ⍥
 
@Adám diversion; in what order do you put them? There are no unique identifiers in the tsv, are there?
 
@RGS Yeah.
@TessellatingHeckler Reorder.
 
keeping notes for these file instructions; I should have started doing this months ago for things mentioned in chat
like how to complete the autocomplete suggestion tip
 
8:50 PM
@TessellatingHeckler You can just choose that: Options→Configure→Auto Complete.
 
RGS
@TessellatingHeckler also cf. this
 
@Adám Wow I can set it to TAB, perfect
 
RGS
(@Adám "They can also be used as Undo and redo in the editor. " has a casing inconsistency :) will u fix it or do you want a tiny PR?)
 
@RGS Thanks!
 
@RGS Fixed. Thanks.
 
8:56 PM
I put :Namespace TIOHelper at the top of the file, above my tioCode←{} dfn, and :EndNamespace at the end ... "cannot fix object without a name"
it has a name, TIOHelper is its name, or tioCode, and those are the only two objects I want to name, and they have names
 
@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
 
9:12 PM
@Adám Ohhhhhh that, ok
 
RGS
@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...
is this feasible?
 
@RGS Easy under Windows. What did you search of on APLcart?
 
@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.
 
9:28 PM
@TessellatingHeckler Yeah, I've created PPM files from APL before, but under Windows, there are built in methods to generate BMP, GIF, and PNG.
 
RGS
9:48 PM
@Adám image
@TessellatingHeckler thanks!
 
@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.
 
RGS
@Adám ugh turns out I did, I just didn't know I wanted to find that
 
I guess I should add image and picture as synonyms to Bitmap
 
RGS
> 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 'mybitmap'⎕WC'Bitmap'('CBits'rgb)
 
RGS
10:02 PM
@Adám so if I had the bits and cmap props, I would do 'mybitmap' ⎕WC 'Bitmap' ('CMap' cmapvar) ('Bits' bitsvar)?
And the ⎕WC sees 'Bitmap' as the first character vector and then takes what comes next to build a bitmap?
 
Yup, that's the syntax for all objects created by ⎕WC. However, you can also set the properties after creating the object.
 
RGS
@Adám but can I set nothing at all from the get-go? Because 'mybitmap' ⎕WC 'Bitmap' doesn't seem to do anything useful on my machine
 
@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.
 
RGS
@Adám ah ok, thanks :)
 
After the creation, you should also be able to access the properties directly as mybitmap.CBits
If you use dfns, you may want to use ⎕NEW instead of ⎕WC as it returns a ref you then assign (or use) as a normal value.
Just beware that ⎕NEW enforces a strict structure on its right argument: It must be a two element vector of 'ObjectType'(vector of name-value pairs)
 
RGS
10:11 PM
@Adám damn, that's why it wasn't working
 
⎕NEW is the "modern" way, but I usually just fall back to ⎕WC because it is so forgiving ¯\_(⍨)_/¯
 
RGS
@Adám in handling the arguments?
thanks for this, already generated my first bmp image from within APL
the docs are fairly decent, good job (Y)
 
@RGS Yeah.
@RGS Yeah, that part of our documentation is quite good. I'd like some examples on each page, but it is passable.
 
10:39 PM
@Adám Can I show the image (created via ⎕NEW or ⎕WC) to screen?
 
RGS
@Bubbler I think that is what the 'Image' is for
 
@Bubbler Sure, you just have put it in a form.
@Bubbler Minimal example:
'bm'⎕WC'Bitmap' ('Cbits'(?100 100⍴¯1+2*24))
'f'⎕WC'Form'
'f.i'⎕WC'Image' (20 10)('Picture' 'bm')
 
RGS
hmmm
There is something I don't understand
I am trying to create a 2-colour image, where one colour is random and the other is white
why do I always get black?
 
Care to share your code?
 
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?
 
RGS
10:53 PM
@TessellatingHeckler the fractional part of ¯2.3 is .3 in mathematics, yes.
@Adám should I paste it here?
 
@RGS Something like 'bm'⎕WC'Bitmap' ('Cbits'(((⊢,?)¯1+2*24)[?100 100⍴2])) ⋄ 'f'⎕WC'Form' ⋄ 'f.i'⎕WC'Image'(0 0)('Picture' 'bm') ?
@RGS Sure, why not?
 
RGS
@Adám I thought I had to paste too much code but I don't
∇ bitmap ← MakeLogo
    mask ← 5 RecMakeImg 512
    (r g b) ← ?3⍴256
    cbits ← 256∘⊥¨ ↓⍉↑ (r×mask) (g×mask) (b×mask)
    bitmap ← ⎕NEW 'Bitmap' (⊂'CBits' cbits)
∇
⍺ RecMakeImg ⍵ creates a boolean matrix, where 0 means white and 1 means the rgb colour I create next
 
So the fractional part can be anything of 1∘|, (1||), or (××1||)
 
RGS
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
 
10:58 PM
We can include all three with appropriate description, I think
 
@RGS Can we continue this tomorrow? I have a meeting with a VIP at 9:30…
 
RGS
@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
 
11:15 PM
@RGS I think you can get away with color←256⊥?3⍴256 ⋄ cbits←mask×color (black bg) or cbits←color⌈maskׯ1+2*24 (white)
 
ngn
@RGS avatars generated by SE have rotational (not reflectional) symmetry
 
11:38 PM
@RGS If only the VIP knew they could join here to talk :-P
 
01:00 - 18:0018:00 - 00:00

« first day (1308 days earlier)      last day (1345 days later) »