« first day (1623 days earlier)      last day (1184 days later) » 

9:51 AM
I'm keen for the cataloguing internship @Adám.
@11Kilobytes Great. Let's give it a little time to see if others want in too, and then we can meet (via Zoom or similar) so I can introduce you to the work. If it still looks right for you after that, then I'll hand you over to the appropriate colleagues to discuss payment. How does that sound?
Sounds good, thanks. @Adám
@Adám Do you have access to the source of "Works in" macro on APL Wiki? (it's for use in the new K wiki btw)
@Bubbler Not sure what you mean by "macro" but everything in APL Wiki should be visible to you.
10:08 AM
@Adám I mean, how to enable the {{Works in|Dyalog APL}} thing in the first place. I don't think it's built-in by default
@Bubbler It is just a normal MediaWiki template with some CSS in Common.css
Oh, thanks.
11:08 AM
does untie the "tie" work like close the file descriptor in other programming languages?
@LdBeth Yes. I'll add those terms to APLcart. Thanks!
oh, and seems (⎕NCREATE⍠'IfExists' 'Error') won't allow create the file with same name in the same session, even the created file is removed in the file system?
@LdBeth You removed the file without untying it?
11:24 AM
@Adám I called ⎕FUNTIE to the tie after finished writing contents to the file
 img writepbm file;data;size;h;s;tie
 tie←file(⎕NCREATE⍠'IfExists' 'Error')0
 h←10,⍨⎕UCS'P4 ',(⍕size←⌽⍴img)
 tie ⎕ARBOUT h
 s←8×⌈8÷⍨⊃size
 data←,⍉s↑⍉img
 data←2⊥⍉((8÷⍨≢data),8)⍴data
 tie ⎕ARBOUT data
 ⎕FUNTIE tie
and the error msg is FILE NAME ERROR: out.pbm: Unable to create file
@LdBeth You're using the wrong untying function. You should use ⎕NUNTIE and not ⎕FUNTIE
I'll ask my colleagues why ⎕FUNTIE doesn't error on negative numbers.
@Adám oh, thank you
0
A: Dither a Grayscale Image

LdBethDyalog APL This is an implementation of ordered dither with a special dither array. The input format is a restricted form of raster PGM while it is also the default style produced by Netpbm programs that requires no comment line, file header separated by newline character rather than arbitrary wh...

12:16 PM
@LdBeth You don't need parens around (readpgm 'input.pgm')
edited ;)
@LdBeth Erroring if the file exists is the default behaviour. You don't need to specify that. However, since all bytes added to the file are ≤255, you could probably create and append to the file using ⎕NPUT, without needing to worry about file ties. Just use ⎕UCS to convert to characters.
12:40 PM
oh, so ⎕UCS doesn't make assumptions to valid UTF-8
Monadic ⎕UCS has nothing to do with encoding. It simply flips characters to code points and vice versa.
(Dyadic ⎕UCS deals with encodings.)
1:12 PM
Ugh, I do not like this "feature" of GNU APL:
      OPY←'OPY'
      ⎕NCOPY
2
@Adám golfing ftw
ikr, but ott imo.
1:41 PM
@Adám any CMCs today?
@xpqz I did actually come up with one, but then I thought it was so good that I put it away for an upcoming competition. Have you solved all the problems at problems.tryapl.org?
Yes.
@xpqz How about this?
1:57 PM
Whilst I've seen Roger's preso on inverted tables, I'm not quite sure what you're after here without some more context.
how about generating Hilbert curves?
@xpqz Inverted tables are basically invtab←↓⍉matrix but that means that various structural primitives don't work. The task is to define a cover for each structural primitive.
@xpqz CMC: Produce 0 0⍴0
2:25 PM
@Adám scoring mechnism?
@Razetime
2:43 PM
I've got a couple 5s but nothing shorter than what's there ⍨
:-) There's a 3, so you could technically brute force it.
@Adám I managed to think of it (primarily by just going through the language bar) but then remembered that I actually knew it before
Yeah, I think I've mentioned it before.
@Adám it's been said 10 times (all by you), and 12 repetitive messages contain it in relation with the old bot
Still fun to post every once in a while. See, even you had forgotten, and re-thought it.
 
3 hours later…
6:16 PM
@Adám did that, boy that was nowhere obvious
that means my knowledge on that primitive was poor :P
 
2 hours later…
RGS
RGS
8:41 PM
@ngn sorry to bother, but do you happen to have a source for the "readability is in the eye of the beholder" sentence I've seen you use?
@JeffZeitlin ditto ↑
9:39 PM
Going thru the apl book and came across this question:
Write a dyadic function Extract which returns the first N items of any given vector. The
value N and the vector itself will be the left and right arguments, respectively:
3 Extract 45 86 31 20 75 62 18
45 86 31
6 Extract 'can you do it?'
can yo

The book gives this answer:
Z←X Extract Y
Z←Y[⍳X⌊⍴Y]
I came up with:
res←L Extract R
res←R[⍳L]
Which seems much more concise and simpler
Am I missing something with the books solution/is something wrong with mine
@mo523 the difference is when the left argument is larger than the right ones length. Yours will error, and the one in the book will truncate the result. (which one is preferable depends on the person, but I'd very much prefer an error)
RGS
RGS
@mo523 Hey there! Out of curiosity, what book are you reading? Mastering Dyalog APL?
Yup. Just started going thru it
Ah I see. Thanks.
Wasn't even thinking about possible errors/ edge cases
RGS
RGS
Cool. Not sure if you are aware of that but there's an online version (mastering.dyalog.com) that is an update of the book. It is still a work in progress, but the first chapters are already there and present a bit more modern APL
Ya Adam told me the same thing. But I have a hard time reading too much material off a screen so I wanted a physical textbook. Paying for it also adds some motivation or me to actually go thru it
RGS
RGS
9:49 PM
Ah I see, I had no idea you bought the actual thing.
Good luck with it, then!
Thanks!
I actually got the last one in stock on Amazon when I bought it
RGS
RGS
Woops, someone is going to have their birthday ruined because of you :P
ngn
ngn
10:22 PM
@RGS "${something} is in the eye of the beholder" is a common phrase, afaik originally from shakespeare ("beauty is ..")
@RGS correction: from somebody else apparently..
Another my answer vs book answer question

Write a monadic function which appends row and column totals to a numeric matrix.
For example, if Mat is the matrix: 75 14 86 20
31 16 40 51
22 64 31 28
Then Totalise Mat should give: 75 14 86 20 195
31 16 40 51 138
22 64 31 28 145
128 94 157 99 478

Book:
sum←+/[2]Y
Z←Y,[2]sum
sum←+/[1]Z
Z←Z,[1]sum

Mine:
res←tot mat
p←mat,+/mat
res←p⍪+⌿p
I think in this time my answer matches up exactly, just using ⌿ and ⍪ instead of /[1] and ,[1]
@mo523 yeah, that's what i see too
Also is [2] even necessary since we're assuming a matrix and / by default reduces on the last axis?
nope
RGS
RGS
11:05 PM
@ngn thanks ngn ○/
I'm a bit stumped by this question and I would rather a nudge in the right direction than looking at the answer

Write a monadic function which returns the lengths of the words contained in a text vector:
Lengths 'This seems to be a good solution'
4 5 2 2 1 4 8

All I can think to right now is to get the locations of the spaces which can delimit individual words somehow... but I'm stuck
Is there some sort of split operator that I'm forgetting?
11:20 PM
You can use x⊂y or x⊆y
11:32 PM
⍸y is also valid I think

« first day (1623 days earlier)      last day (1184 days later) »