« first day (1839 days earlier)      last day (1112 days later) » 

00:06
A fun way to express 2n+1 ⊢∘(1∘+)\
@FawnLocke Simpler: (1+⊢)\
Right, of course
Pro-tip: double your backticks to disable backslash escapes.
Thanks!
00:49
this changes the color of a displayed image, but when done inside a function it isn't done globally so i can't make a loop display an animation for example.

'BM'⎕WC'Bitmap'('Bits'(800 800⍴40⌿40/disp))('CMap'(4 3⍴255 0 0 0))

so how do i make it global?
Not sure what your overall code does, but every time you run that line, you re-create the bitmap. You might want to look at ⎕WS to set new values for the bitmap instead.
Btw, are you sure you want to use Bits and CMap instead of CBits?
i have no idea :D
i just searched in this chat for displaying an image and i copied
ill look on apl cart see what i find
OK, you probably want CBits which allows full colour images instead of a 256-colour palette.
huh wdym? i was able to use full range
hm i actually don't know whats the diffrence between full palet and 256 palet... i thought 256 was the max range
It isn't the range of the channels, it is the number of distinct colours at any given time.
00:55
ohhh i wasn't able to use more than 255 distinct colors?
Correct. Much simpler, imo, to use a single matrix to represent your bitmap directly, instead of indices into a colour palette.
You know about RGB, right?
@Adám o also, my code is a map explorer with structures and such
@Adám ye ye
A colour number is 256⊥R G B where each channel is in the range 0–255
And so you simply make the CBits property a matrix of such colour numbers.
@Adám yes definetly. it took me a bit to figure out how to use it the way i used it
'BM'⎕WC'Bitmap'('CBits' matrix_of_col_nums)
and then to update the bitmap:
'BM'⎕WS'CBits' matrix_of_col_nums
Alternatively, you can use the property via the namespace syntax: BM.CBits←matrix_of_col_nums
01:00
@Adám the format of "matrix_of_col_nums" is it "3 3⍴⊂3⍴0"(3x3 pixel image) ?
No, a 3-by-3 black image would be 3 3⍴0
Why 0? Because 0=256⊥0 0 0
wait let me get the hang of the ⊥ as i've never used it before
It is base decode. It converts from base-256 to a normal (base-10) number.
(255,127,0)₂₅₆ = 16744192
In APL: ⋄ 256⊥255 127 0
@Adám 16744192
Should give a nice orange.
01:07
'BM'⎕WC'Bitmap'('CBits'(3 3⍴256⊥255 127 0))
this should work right?
it doesn't for me and idk why
This works for me:
  'f'⎕WC'Form'
  'f.b'⎕WC'Bitmap'('CBits'(16 16⍴256⊥255 127 0))
  'f.i'⎕WC'Image'(0 0)('Picture' 'f.b')
awesome did for me too. perfect template
And then you can update (and even resize) the image on the fly like f.b.CBits←16/16⌿?16 16⍴256*3
ahhhhhhh was just about to ask
Also note that you can update just subsets of the entire image like with f.b.CBits[⍳16;⍳16]←256⊥255 127 0
01:27
ah right so the same way with any array nice.
 
7 hours later…
08:00
@KamilaSzewczyk Added explanation to the SKI implementation.
 
2 hours later…
09:48
Today I used Dyalog to cut the wordle search space. Don't judge me. gist.github.com/xpqz/0b594ded5dcaaa84bfdea0cd0ff6454c
10:03
hm what is the right way to start RIDE? I've made a .vbs, that when run runs another .bat script, and that bat script starts up RIDE... but like there has to be a proper way right?
10:16
@BrianBED Remind me which OS you're on.
@Adám windows
windows 10 to be exact
.vbs and .bat make it glaringly obvious that it's windows
¯_(ツ)_/¯
D'uh.
Can't you just make a shortcut to C:\Users\<user>\AppData\Local\Programs\Dyalog\Ride-4.4\Ride-4.4.exe?
huh good question... probably... one sec
10:17
@BrianBED (You need to double the backslash.)
i have a hotkey for the emoji. too lazy
:)
🤷‍♂️🤷 ← ⊞Win+. followed by typing "shrug"
huh.... well i always prefered the text version for some reason
I use the APL version: ¯\_(⍨)_/¯
also, it was today i found out how to make a tab always be ontop :D
10:21
A tab?
like yea well any page or like... yea idk what else you'd call them other than a tab. a program?
Oh, how do you do that? I have a Microsoft add-on for it.
@Adám i love how commute/constant looks like a confused face
@xpqz wordle←∧/∊
OOooo. i have a hotkey script:
^SPACE:: Winset, Alwaysontop, , A
10:23
Ah, AHK.
ctrl+space to set it on or off
neat
@KamilaSzewczyk That's how your face ends up looking if you use commute constantly.
@BrianBED How do you remove formatting?
what formating?
@Adám i don't have that much problem with reading it to be fair
Me neither. Just joking around.
10:24
@Adám is there supposed to be formating?
No, I mean in applications with rich text (emails, Word, etc.), Ctrl+Space tends to remove formatting from the selected text.
@xpqz ⎕C doesn't need an ¨
the thing that gets me is long trains
i find it hard to read them
@BrianBED I have three different ones, with different escape rules ¯\_(ツ)_/¯
@KamilaSzewczyk The thing that gets me is parentheses. I don't mind a long trains if they are "flat".
@Adám really?? I can't read flat long trains
10:27
the thing that gets me is trains. i find it hard to read them
@Adám ah autohotkey takes a key input and just like... makes the computer forget it even recived the input. like AHK just takes over the input. and as i don't use that formating feature then i'm sure i'll be fine. if i do eventually need it i'll just change it then
@xpqz Any trains? (+,-)?
i can read small trains, paranethesised or not nearly instantly
@Adám me too, but, depending on positioning, just operator chains as some tine can be enough, or parentheses can be just fine
but anything more than 6-7 functions becomes tricky
10:29
Joking aside, I'm getting better, but they still feel like deliberate obfuscation to me. Personal opinion.
i had a hotkey for time formating where it'd write the current time down to the minute, and if you press shift while you did the key combination it'd write the time in a file friendly format so like with : and . replaced with ; and ,
super neat until i accidentally deleted half of my hotkeys a week ago
@KamilaSzewczyk Like ⊢∘≢÷⍨1⊥⊣*⍨⊢-⊢∘≢÷⍨1⊥⊢ — I find it easier to read than {(+⌿⍺*⍨⍵-(+⌿⍵)÷≢⍵)÷≢⍵}
huh?
to me the second one is waaay easier to read
To me, too
@Adám heh, i was about to make an example of stdev too
10:31
My problem is that for the dfn, my eyes have to jump left and right, whereas the train reads linearly (in either direction, even).
Here's another long flat train: 2÷⍨1⊥⊢⌷⍨∘⊂⍋⌷⍨∘⊂∘⌈2÷⍨0 1+≢ which is {2÷⍨+⌿(⊂(⊂⌈2÷⍨0 1+≢⍵)⌷⍋⍵)⌷⍵} — this time the train is much easier for me because of the long nested parens.
Yeah.
cool but you could probably make it more readable with brace indexing
at least i'd do it
trains sadly can't do it
Yes, I was just about to: {2÷⍨+⌿⍵[(⍋⍵)[⌈2÷⍨0 1+≢⍵]]}
this reads much better
10:35
would help a lot here: 2÷⍨1⊥⊢⊇⍨⍋⊇⍨∘⌈2÷⍨0 1+≢ or {2÷⍨+⌿⍵⊇⍨(⍋⍵)⊇⍨⌈2÷⍨0 1+≢⍵}
in my hypothetical APL i'd probably encourage bracket indexing by somehow improving it but not sure how just yet
With ⊇⍨ the two have approximately equal readability to me. I can handle a single parenthesised function call, like (f⍵)
@Adám the s confused me there a bit; f⍨∘g is extremely unintuitive to me (or maybe i'm too used to BQN and the comfort of ⊸⟜)
⌷⍨∘⊂ is common
right, but there's a ∘⌈ here too
10:41
true
oh yea about BQN, should i learn it?
if you want to
hm... no idea what it is or what it's about. heard it's like APL... I'm prob not gonna try it for now
11:39
I can't seem to be able to turn boxes on in the Dyalog APL repl... )box on gives an error
] not )
@dzaima system commands delenda est
@xpqz It's being discussed on the Dyalog forums, too: forums.dyalog.com/viewtopic.php?f=30&t=1831
Yeah ⊇⍨∘⌈ is the only slightly hard to read part of that train
damn the dyalog forums look so nostalgic
@dzaima it still doesn't work... I get VALUE ERROR: Undefined name: ⎕SE.UCMD
11:53
@Dincio ah, that. Your session file is somehow messed up
maybe someone should write a walkthrough of that error :)
@dzaima nice haha
How are you starting Dyalog?
@FawnLocke hard agree. with dreamscape in the background, unregistered hypercam and sloppily typing in the notepad window.
i was imagining a 50-page book :)
@BrianBED If you like APL, learn the other array languages, too. It broadens horizons, and once you know one, it's easier to pick up another.
seeing old Dyalog versions on youtube videos feels weird to me too
especially this GoL one
I would ignore the language you're using entirely and try to grok the theory using the language as a confirmation tool
If you want to learn array programming that is
I started with J
but I think it'd be better off for me if i started with APL
 
3 hours later…
MrV
MrV
14:56
Hello everyone, so I familiar with APL but don't know anything about J. I solving a problem and stumbled across a solution from Roger Hui. Can anyone explain what's happening here or how would you write it in APL?
ndiv=: */ @: >: @: {: @: (__&q:)
nufs=: 3 : '-: >: */ >: +: {: __ q: y'
Link: https://code.jsoftware.com/wiki/Puzzles/Unit_Fraction_Sum
@MrV q: is prime factors, so you'll probably need a library function (like factors or pco from the dfns workspace).
MrV
MrV
@Adám ...interesting. Can you explain the logic here? Because J is a mystery to me.
@Adám If you are interested in the problem: projecteuler.net/problem=108
@Adám I found the jwiki link from Roger Hui's post in the solutions thread from the same site.
15:18
@MrV Here is a literal translation, primitive for primitive, with no guarantee that it'll work:
ndiv ← {×/ 1+ ⊃⌽ 2 pco ⍵}
nufs ← {2÷⍨ 1+ ×/ 1+ 2× ⊃⌽ 2 pco ⍵}
MrV
MrV
15:40
@Adám Thank you so much. Got it!(btw->ndiv←{×/1+1↓2 pco ⍵} and nufs←{2÷⍨1+×/1+2×1↓2 pco ⍵} was what I did after changes)
15:58
I'm struggling to formulate something in APL, and I'm wondering if someone could give me a hint or push in the right direction? I have an array of integers, and I want to split that into an array for each sequence of increasing integers.

Ie, (1 2 1 2 3 1 2 5) -> (1 2) (1 2 3) (1 2 5)
@taronish Find the points where the sequence isn't increasing, then use that as left argument to
@Adám Thank you - I tried this, but I will try again!
@taronish Have a look at 2 f/
@Adám Yes, that's what I've been doing but I've been struggling a bit since it ends up 1 shorter than my original array.
I will work through a simple example by hand.
Ah, but you always want to begin a section at the first element, so prepend a 1.
16:05
@Adám Thank you ... I don't know why I was struggling like that.
https://imgur.com/CzcdrNk
ok so i messed a bit with github and i made a aplf file inside a github repo and i tried connecting with it through ]link.create but i got errors so i just removed the github repo and deleted the folder and remade it by pasting the text back in and now it's working but keeps warning me:
Linked: # ←→ C:\Users\brian\Persinal\Scripts\APL\game\myGame; 1 imports failed (⎕SE.Link.Links[1].inFail)
even tho the import did succeed, i'm still woried what the error means
16:21
@BrianBED Have a link at ⎕SE.Link.Links[1].inFail to see what failed. Also, without knowing what's in your repo.
16:35
i mean i know what file failed, and it's the only file that i want to import, so here's the repo: github.com/Brian-ED/myGame
note that it's deleted on my pc as the linking didn't work
You should probably link straight to /code/
@BrianBED You have a stray }⍬ on the 'f.i'⎕WC line:
ha wait that's why?
'f.i'⎕WC'Image'(0 0)('Picture' 'f.b')}⍬
'f.i'⎕WC'Image'(0 0)('Picture' 'f.b')
oh i didn't know an error in the code could make an error in the linking process
APL can't determine where the code begins and ends if the braces are mis-matched.
16:43
ah alright
thanks
 
3 hours later…
19:59
what are the requirements for apearing in the apl campfire? :o
@BrianBED Anyone can show up to the events. As featured guests, I tend to invite people that have had influence on APL's development, or are otherwise able to tell part of the APL history.
hm where can you watch live? is it on twitch or yt?
if possible ofcorse
yea i know its on zoom but how do you join?.... oh wait can you join through password thing there? i never used zoom
Pretty easy: Compute the passcode, click the link, enter the passcode. Voilà.
(You don't even need to download Zoom; you can click the "join from browser" link.)
20:17
oh too late... i did
:)
I'm working on problems.tryapl.org 2017 problem 3. Any suggestions for improving this, in terms of style?
{⍵/⍨q∨~2∘|¨+\q←'"'=⍵}
@taronish You don't need there.
@Adám Ok, thanks. I thought I needed it.
You also don't need ¨
It is useful to familiarise yourself with the concept of scalar functions.
I do know what they are, but I don't always know which they are ... thank you.
It makes sense though.
20:26
The whole 2|+\ construct is the running parity, which is ≠\
Whoa ... head explodes
Also, a hint: q∧~p is the same as q>p for Booleans q and p
why not ⍲ at that point?
Oh, wait, my bad.
It is an not an .
q∨~p is the same as q≥p for Booleans q and p
Wow ...
Thank you.
20:31
⍱ ?
i mean i assume boolean operations are faster than ≥
wait unless that was your point
Comparisons are Boolean operations on Boolean arguments.
Unrelated side-note for language nerds: With my proposed language developments {⍵/⍨q≥≠\q←'"'=⍵} could be written as the derived function (not a train!) ≠\⍛≤⍤=∘'"'⍛⫽
20:50
i have a dislexic friend, like he can't read or write in any language. well he can read like 10 words a minute in feroese but no english, and well we tried apl as he really wanted to program and it went well for a first session. i wonder if he'd still be limited by not being able to read but hey atleast he's way less limited
@BrianBED do specific fonts help him with English? I can imagine it going either way really, as most of the time the symbols in an expression are quite distinctive, but maybe some sequences will be hard? I'd be interested to hear how it goes, though
@BrianBED Well, if symbols (icons, emoji, streetsigns, etc.) are not a problem for him, they hey, by all means, go for it! Maybe he should even focus on tacit APL programming to avoid variable names.
ah yaaa true
That's a niche for which I've never really considered that APL might have an advantage.
i'm not a good doctor so idk how dyslexia works. Tho maybe if he looks at one symbol at a time he could understand it. maybe dyslexia is a problem with reading words not letters is my theory... but again not a doctor
20:55
My understanding is that dyslexia varies a lot between individuals.
looking in the wikipedia page it seems to be mostly on words... anyways we'll see how it goes. he was pretty enthusiastic and experimenting so i'm hoping it won't be too scary when keywords for link and load and such come up
He should be able to accomplish quite a lot even just with the core symbol language. (Though he won't be able to save his work…)
ye ye. and i'm sure he can memorize some keywords
Does he know spoken English?
yea he speaks fluently english and feroese. ok danish
21:03
That's nice. Maybe some of the APL videos would be interesting for him too.
the niceness on apl is also how small the keywords are
@Adám OOoo haven't even thought of that
by keywords i mean like. variable names and function names
Ah yes, using ⎕DT is probably easier for him that if it was called DateTime
@BrianBED Well, for his own definitions, he can stick with single letters, if that suits him better.
ya ya definetly
Anecdotally, I used to program APL while standing in the crowded tube (metro) trains in London, balancing my laptop on one hand, typing with the other. I could only be effective thanks to APL's brevity.
it's funny, we had a unity corse where we used C# ofcorse. he was behind on writing the program but he wasn't bad at all at understanding what the structure did. pretty interesting
@Adám ahhh thats neat
21:19
@BrianBED from my experience APL is a really good language for dyslexic people
OOoo you know someone with dyslexia?
or just by intuition
instead of using letters that kinda have no meaning and fuse with each other in your brain, you use something akin to pictograms if it makes sense.
i know a person with dyslexia
i can't imagine a person with dyslexia writing J or K though
I get "dyslexia" when reading these
Me too.
As one gains experience with APL, I think it is normal be begin reading constructs as units, e.g. ×/ and ∧.= and +/∧\. I wonder if that would pose an issue to people with dyslexia.
huh yea that'd be interesting. reading long code might pose an issue too (by long i mean like 20 characters)
thankfully 20 characters of APL decompresses to >50 lines of Java :)
21:24
That's probably a bit of an exaggeration in most cases, unless using one of the more powerful operators like or .
yeah, I was a bit exagerrating
palaiologos.rocks/posts/linalg-apl <- but i could totally see this one becoming relatively fat
i remember a friend sent me a 15 line code i got down to like 15 characters... that was incredibly fun
Maybe even long code won't be such an issue, if reading more-or-less symbol-by-symbol works.
@KamilaSzewczyk You've got a in there; that'll be… a lot of code.
21:27
lol, yeah
@KamilaSzewczyk That doesn't fit on my screen, and there are too many lines between the open and close braces for me to line them up by naked eye. How many lines is that function?
419
:)
wait im looking in wrong link i think
Yeah, that's the whole lib.
wait no i think i got that right...
oh yea idk
oh well you could do ctrl - to see more of the code ¯\_(ツ)_/¯
I think it is 80 lines.
Compared to (effectively) 3 lines of APL.
However, those APL lines are very dense, and compounded using s
So a more reasonable count of the APL code would be 8 lines.
This fits well with the 10× rule-of-thumb my father claimed.
22:28
@Adám i would like to add. my biggest reason for trying apl was when i remade a python game in APL and used 6?6. i swear in python it took me like 10 lines minimum. tbf i could have done it way better probably but still that was hilarious to me
22:51
Sad story: I haven’t touch J for a month and I can barely recognize any previous code I wrote
23:08
aw, happens
23:33
i wonder what would happen if there was an operating system built with apl in mind. iirc microsoft had plans on making one. i can only imagine how cool that would be... fast? maybe using like... no space? less errors even? less finiky? who knows if a simple programming language would change much but would be awesome if it existed

« first day (1839 days earlier)      last day (1112 days later) »