« first day (1390 days earlier)      last day (1263 days later) » 

2:42 AM
@Razetime Execution timed out
@rak1507 Execution timed out
 
3:28 AM
@rak1507 facepalm how did i not realize that..
looks like the bot is back up
⋄'Are you alive, sir?'[5 3 16]
 
@Razetime yes
 
 
2 hours later…
5:15 AM
@Razetime I've signed up, but am not allowed to comment. Maybe ask OP of you can take input in reverse (it seems like it based on the text, but doesn't hurt to ask). If so, then you've got a 1-byter.
 
5:46 AM
a1-byter?
isn't ⌽ required?
@Adám hm, email verification maybe
ih nvm taking the coefficients in reverse
that doesn't sound right idk
@Adám ok, done
Did you see the drive link I sent?
 
6:30 AM
i am impressed.
jeez APL
this isn't a challenge i expected a 1-byter for to say the least
but also not surprised APL did it
 
6:57 AM
@Razetime I did, but didn't take a close look yet. Speaking of which, you have mult←{⍺+⍵×256} ⋄ mult / … there, which is simply 256⊥⌽…
@Razetime Hold on, you didn't actually run the code, did you?
 
TIO shows the right output
...for the test cases, so if ⊥ does something weird that won't show
 
@moonheart08 You're talking about your (?) code golf challenge, I presume. I was responding to the file Razetime linked.
 
ah
'yea it's mine
 
7:16 AM
@Adám I did run individual parts
 
@Razetime I highly recommend running the code as a whole at least once. For instance, you'd discover that control structures like :If aren't allowed inside dfns {}. :-)
 
it worked on png and gif
oh.
darnit
good thing I asked
what's the syntax for running files?
 
There isn't really one yet. You can hack it, but for now, your best option is to make the entire thing a giant tradfn or alternatively make it into a namespace.
 
ok
so basically
remove the dfn wrapper
and make that a tradfn
and then make the whole thing a tradfn
 
No, either one giant tradfn and remove the inner braces, or wrap everything in :Namespace … and change the inner brace to a tradfn.
 
7:24 AM
ok gianf tradfn it is
sO
 
Don't forget to manually localise used names then.
 
I guess I'll make the tradfn print out the values as well
 
Any problem with returning a result?
 
I just wanna make sure if it's printing everything correctly
 
OK, but if you return a result, it gets printed unless captured.
 
7:40 AM
ok my jpg part is wrong
it works great for anything else
 
Do think you can fix the jpg part or do you need help?
 
ok I think I fixed it
lemme send another link
Most of the problem was with the buffer having negative numbers
and I was searching for positive numbers
@Adám Here
 
7:56 AM
@Razetime That looks much better. No for the final version, all the used variable names should b localised, and the tradfn should take an argument instead of prompting, and return a result instead of printing.
 
wait how do tradfns take arguments
 
Btw, pro-tip: ⎕NTIE 0 will assign the first available tie number.
 
Returning results is easy enough
@Adám Ah, I took the snippet from the docs
@Adám how do i get the number for ⎕NREAD?
 
@Razetime Check out APL Wiki.
@Razetime That's imgTie
 
gr8
 
8:04 AM
@Razetime What does pos←⊃⍸(255 216 255)⍷buffer do? I don't see pos used later.
@Razetime Is there a reason you have ⎕FR←1287 and ⎕PP←34? afaict, you're only dealing with integers here.
 
@Adám paranoia
 
:-)
 
@Adám um i need to look at the vb file
 
@Razetime I have a question about the logic here:
	 dataPos←⊃⍸buffer[markerPos+1]∊192,193,194,195,197,198,199,201,202,203,205,206,207
 ⍝ If the data exists, add in the info.
	 :If ×dataPos
 
that is wrong I think
need to find a proper section
 
8:09 AM
Could it happen that the first element of buffer[markerPos+1] is indeed a member of that long vector? If so, then ⊃⍸ will give 0 which probably isn't right when doing ×dataPos
 
yep that's not right
should be 2⊃ probably
 
The third element?
 
sorry, 1⊃
 
Don't you mean to ask if any such position exists?
1⊃ will fail with a length error if the list has 0 or 1 elements.
 
i think datapos is supposed to find the FF, XX block for the image data
and pos is supposed to verify if jpeg
and those two got mixed up
cause if there's no FF, D8, FF is should say unknown
so it should be :If ≢pos
 
8:16 AM
@Razetime Only 1 is truthy, so :If 0<≢pos or :If ×≢pos
 
ok
ok now let me finish the apl cultivation tradfn clas
so, I'm supposed to return all attributes as a heterogeneous array, correct?
∇(imgattrs)←readImageInfo
 
Yeah, that makes sense. Maybe a for element vector or a three element vector where one element is a two-element diminsions' vector. Btw, you can use a name list for the result in the header.
 
then this: ∇(d_imageType d_width d_height d_depth)←readImageInfo
∇(d_imageType d_width d_height d_depth)←readImageInfo filename
 
That looks sensible.
 
LOL
ok, width and height of jpg's are turning out wrong
 
8:34 AM
Testing is a good thing.
 
sure is
 
9:08 AM
it is very satifying to see the lines of a trdfn appear one by one after you paste it
@Adám So I'm doing something wrong here:
⍝ get first jpeg marker which matches required spec
		markerPos←2+⊃⍸(2{(⍺=255)∧⍵∊192,193,194,195,197,198,199,201,202,203,205,206,207}/buffer)
		⍝ dataPos←1+⊃markerPos[⍸{buffer[⍵+1]∊192,193,194,195,197,198,199,201,202,203,205,206,207}¨markerPos]
		d_imageType←'JPG'
	⍝ get the two required bytes, and get dims
		d_height←buffer[mult/markerPos+5 4]
		d_width←buffer[mult/markerPos+7 6]
	⍝ Color depth
		d_depth←buffer[markerPos+8]×8
 
I have to bring my son to school. Will have a look in about half an hour.
 
9:46 AM
I have noted a discrepancy between Dyalog and GNU APL. For the following expression: ⊃⍬ Dyalog returns 0, while GNU APL returns ⍬. Which one is more correct?
To me, the GNU APL result seems more logcal.
 
<klg> remember ⎕ML
<klg> ⋄↑⍬
 
dyalog and GNU act the same afaict, it's just the ⎕ML difference again ( and being swapped between GNU APL and Dyalog)
 
0 ⍴ 0
 
@EliasMårtenson As klg says, GNU's ⊃Y is Dyalog's ↑Y and vice versa, so they agree.
 
Oh right
 
9:49 AM
Now, a valid question is which of the two glyph schemes makes the most sense.
@Razetime Other than some redundant parentheses and braces, what seems to be the problem?
 
 
1 hour later…
10:57 AM
it doesnt seem to give the right dimensions
 
That might be an issue ;-) Have you tried tracing through it to see if it goes along the expected pathways?
 
11:13 AM
tracing?
 
11:24 AM
@Adám IT WORKS
 
@Razetime Great! Did you try with all supported file types?
@Razetime Ctrl+Enter instead of Enter allows you to step through the code line by line.
 
PNG, JPG, GIF working
need to try BMP
couldn't find one of those yet
gonna download one
 
Microsoft Paint can create BMPs.
 
I am on mac.
maybe preview can
 
Oh :-)
 
11:30 AM
yup preview can
it's just hidden away
 
So, BMP works too?
 
height is wrong
not sure why, cause it's just direct indexing
 
Maybe an off-by-one error?
 
		' get the width
		m_Width = Mult(bBuf(18), bBuf(19))

		' get the height
		m_Height = Mult(bBuf(22), bBuf(23))
 ⍝ Get dimensions
     d_width←mult/buffer[18 19]
     d_height←mult/buffer[22 23]
both use 0-indexing
 
Hm, that does look the same. And you're using the right name? d_ vs m_?
 
11:36 AM
yeah I named eveything d_
 
Did you localise all your variables and clean up your workspace?
 
let me step through
@Adám ok, so what exactly does this mean
⎕SHADOW?
 
@Razetime No, just ;name1;name2 after the header (either on the same line or one or more separate lines).
 
oh I'll do that then
I cleared workspace and it still gives a wrong answer
 
Time to step through then. But sounds like you're almost there.
 
11:43 AM
ok, looks like bmp images have a property of negiative height?!
file /Users/⎕⎕⎕⎕/Pictures/mostafa-meraji-RXooPt4tz9U-unsplash.bmp
/Users/⎕⎕⎕⎕/Pictures/mostafa-meraji-RXooPt4tz9U-unsplash.bmp: PC bitmap, Windows 3.x format, 640 x -427 x 24
 
@Razetime Aha, but that doesn't matter for our purposes of finding the dimensions, so just take the absolute value of that.
 
yeah, I'm not getting negative height
I'm getting a huge value instead
readImageInfo '/Users/⎕⎕⎕⎕/Pictures/mostafa-meraji-RXooPt4tz9U-unsplash.bmp'
 BMP  640 65109 24
 
Oh, ⋄ (2*16)-65109
 
@Adám 427
 
65536|<height expression> then
 
11:49 AM
What does your height-expression give?
 
oh, 65536|⍨
height expression gives 65109
mult←{⍺+⍵×256}
mult is used in every image type
 
@Razetime Sure, but do you know that all BMPs will be in reverse, or do you have to handle both cases somehow?
 
need to handle both, probably
I need a positive test case
looks like mac only makes bottom up ones
 
I'll try making a few.
 
11:56 AM
hello
if i have a java program whats the best room to ask it
 
@Razetime Aha, so it isn't a gigantic value you're getting but rather a negative one, but you end up with an unsigned int. So, if the value is ≥2*15, do the mod-thing.
 
these stack exchange chats seem rather inactive.
 
@javaproblem201 hello there
 
hello!
 

 Java

Dedicated to the discussion of the Java programming language a...
 
11:57 AM
thank you!
uh i need 20 rep
 
But of course, the proper thing is to ask a full question on SO.
 
@Adám d_height←{⍵>2*15:⍵:⍵|65536}mult/buffer[22 23]
 
@Razetime I think
 
don't mind me using : twice
 
I know, you meant diamond.
 
12:00 PM
ok great
looks like it works
 
Do one more test on each file type, and then I'd be delighted to see the code.
 
@Razetime Looks good. You still have a few names to localise (hint: APL's editor will colour global differently from locals). You don't have to localise names that occur in the header. It is also good practice to untie (hint: ⎕NUNTIE) files when you're done with them.
 
yes I'll do that
 
Other than that. Congratulations on your very first (?) real-world APL program!
 
12:15 PM
haha thanks
@Adám colour meaning syntax highlighting?
 
@Razetime Yes, yours is a better term.
 
i don't see it
nevermind it's very faint
 
You can customise your syntax highlighting to make it clearer.
 
@Razetime Perfect. Thank you muchly, sir!
 
12:28 PM
you are welcome
whats it for
 
@Razetime Not sure exactly. Our CTO (Morten Kromberg) asked me to find someone here that could do it. I think it is for a Bridge app of some sort.
 
have fun
why here though
should be simple enough for anyone to do
 
12:46 PM
@Razetime d_depth←1+buffer[10]∧7 should probably be a bitwise AND, not a logical AND.
 
1:06 PM
@Adám oh, I'll add that
 
@Razetime Also, ⎕IO is a variable that needs localising.
 
@Adám bitwise and snippet {⍉2⊥∧/2⊥⍣¯1⍉⍺,[0.5]⍵} gives me a rank error
 
I just implemented disclose with axis. The specification of it in the ISO spec is broken. Not only does it have actual errors, it doesn't actually cover multi-dimensional inner cells. I think I've implemented it correctly, and for my test cases it returns the same as Dyalog. However, if anyone would like to test it, that would be really useful.
 
what exactly is going wrong with the bitwise and
RANK ERROR: Invalid axis
readImageInfo[52] d_depth←1+buffer[10]{⍉2⊥(-∧/0>b)⍪∧/2⊥⍣¯1⊢b←⍉⍺,[0.5]⍵}7
 
 
1 hour later…
2:32 PM
@Razetime It is ⎕IO-sensitive, so you need ¯0.5 instead of 0.5.
 
RGS
@Adám ⎕IO-0.5 as some would say
 
@EliasMårtenson Disclose? It is a good idea to avoid that word… (I'm a ware the standard uses that term.)
@EliasMårtenson So you're saying that {(((⍳⍴⍴Z1)~A),A)⍉Z1←↑⍵} (with the Dyalog def. of ) is wrong?
 
@Adám ಠ_ಠ why would mix be called disclose
(really disclose makes sense only for ⊂⍣¯1 but whatever)
 
@dzaima It says right there in the APL Wiki article:
> a primitive to extract the contents of a nested scalar
CMC: A tacit, strictly monadic no-op function. I.e. like but always erroring if given a left argument.
 
@Adám 3 if itself is allowed to be in the solution
 
2:47 PM
yes yes, that.
 
but only dyadic seems a bit harder
 
Was next CMC.
(or )
 
@dzaima 3 in dzaima/APL, still thinking about dyalog
@dzaima currently have 7 in dyalog
@Adám have 5 for but only dyadic
@dzaima also 3 for dyadic-only . So all 3 are 3-byters in dzaima/APL :D
 
3:07 PM
@Adám No, I'm saying that the ISO spec is wrong.
And since I mostly try to follow the spec, I'm a bit stumped. Now, Dyalog seems to have made a reasonable interpretation of the intent of the spec, so I was wondering if I did it right.
 
3:23 PM
@EliasMårtenson my random tests of comparing result shapes with dyalog didn't show any differences
 
@dzaima Yup, me too.
@EliasMårtenson Uh, but that is what the ISO spec says, no?
 
Let me know if it makes sense :-)
 
3:50 PM
@EliasMårtenson Not sure what you're getting at. It has that exact formula.
 
@Adám In section 10.2.25, under evaluation sequence, it refers to A without explaining what it is.
If I assume A is actually K, it doesn't explain what happens when the size of K is less than the rank of first-thingy of B.
It also doesn't explain what happens if K is, say 5 vs. ,5
 
Right K and A are clearly confused here.
@EliasMårtenson It may be that that behaviour is up to the implementation.
@EliasMårtenson That's probably addressed separately under general singleton leniency.
 
@Adám Possibly, but in other places the spec is quite specific on these things.
 
E.g. the order in which issues are detected (which influences which error is signalled) is up to the implementation. (Which is why error-based programming can be unreliable.)
 
4:00 PM
In the spec, there is an empty line after the specification of Z1. I'm wondering if there is missing text there that is supposed to say: define A to be ,K
@Adám If you look at, say, the description in 10.2.10, you can see how much more specific that description is.
It explains very clearly the types of errors, and in what order those are checked.
 
Yeah, you appear to be right. I can take it up internally at Dyalog if you want, and maybe we can all approach ISO to ask for an amendment.
 
@Adám I don't know if there is a way to report errors in the standards.
Perhaps they have an errata that I don't have a copy of.
 
4:27 PM
What is an efficient implementation of dyadic ~? Is it possible to do better than O(n^2)?
 
create a set out of the left argument, o(n)
 
That assumes insertion into the set is O(1). It's typically O(log n), but sure, close enough.
I guess I'll do it that way. Thanks.
 
I thought it was O(1) but idk much about time complexity
 
4:54 PM
@rak1507 Depends on how many lies about hash tables you're willing to believe. Practically speaking hash table insertion is more like √n.
@EliasMårtenson In Dyalog 18.0, all set functions are implemented using Membership and then filtering. See the performance notes, section "Dyadic Set Functions".
 
5:10 PM
@Marshall Thanks.
In Dyalog, when I use ]BOX ON, the boxing is very limited. Can I change it so it's more like what GNU APL gives me?
 
@EliasMårtenson ]box -s=max
 
@Adám Thanks
 
Or if you only want it for a single thing: ]display expression
 
@Adám Thanks. I do want it for everything.
 
The fact ⊃⍋ is special cased is nice
Why is 1⊥ so much faster than +⌿, couldn't +⌿ be adapted to be as fast?
 
5:17 PM
I personally find it distracting and too verbose, so I keep the min style and use ⎕SE.Dyalog.Utils.repObj if I want to know exactly what something is.
@rak1507 No, because with +/ and +⌿ we promise the order in which numbers are summed, precluding vector instructions.
 
Does the order in which they are summed really matter? Do people use +⌿ specifically to sum in a particular order?
 
@rak1507 Probably not, but we can't have people's accounts suddenly change amounts. (Yes, I know, one shouldn't use floats for money…)
 
There. Dyadic ~ implemented.
I get so exhausted every time I realise I forgot to implement a core APL function. My list of unimplemented functions is still quite long.
 
@EliasMårtenson How, like the standard, or like the more sensible version based on dyadic ?
 
I didn't even read the standard for that one. I just did it the way Dyalog does it.
 
5:26 PM
;-(
 
@Adám Oh, what should be changed?
Dyalog allows multi-dimensional values on the right side of ~. So I did the same.
 
@EliasMårtenson dyadic allows high rank on both sides. (imo this is largely pointless, but that's my thoughts about much of high rank stuff so idk)
 
@EliasMårtenson Yeah, but it is simply ~∘, whereas aplcart.info?q=high-rank without is much more powerful.
 
My version requires rank 0 or 1 on the left, any rank on the right. It just uses ravel order anyway.
I don't understand ∘ completely. Isn't ~∘ just equal to ~?
 
@EliasMårtenson Adám is saying that the current definition of ~ is pointless, as if it required a vector right argument, you could reimplement the current version with just ~∘, (equal to a dfn of {⍺~,⍵})
 
5:31 PM
@EliasMårtenson Yes, that's the point. The high-rank, leading-axis oriented (i.e. sees the set as the collection of major cells) is more powerful and ^
 
@EliasMårtenson f∘g is just "f, but right argument is preprocessed with g" (and the , after in these messages is a part of the code block)
 
Got it.
@dzaima Yeah, I realise that now :-)
 
@dzaima (personally, i'm fine with ~s current definition as the cell-based high rank stuff is useless to me, and the ravelling fits my ravelling args)
 
While f⍥g is "f but both arguments are preprocessed with g"
 
I've written 595 tests, mostly for different APL functions. 8000 lines of code in the tests compared to 10000 lines for the actual software. Did I mention I really hate writing tests?
 
5:36 PM
In which language are the tests written?
 
@EliasMårtenson so 13 lines per test? You could certainly use a bit less lines per test
 
@Adám Well, the test case is APL, but the verification of the test is in Kotlin.
 
At least all your tests are fun ;-)
 
@Adám Haha. :-)
 
Could you store the test cases in a more compact format like json and then go through each of them?
 
5:39 PM
The tests are not just verifying the output of the interpreter. It also verifies that the underlying data is of the correct form.
@rak1507 Well, possibly. I've been thinking about ways to do it. It's not the amount of code that is the problem though. It's thinking about what to test, and then verifying it manually in GNU APL and Dyalog.
I have macros to generate a lot of the boilerplate anyway.
 
Fair enough
 
@EliasMårtenson even checking for deferred execution should be possible within the interpreter. If your & & outputting work correctly (for which i'd understand writing native tests), the rest should be doable within
 
I just find it horribly boring, and I was just venting here. :-)
@dzaima Yes. It's a good point.
 
my BQN test stuff - test is the actual tester, rest are files with tests (except types which tests for behavior equality over different datatypes of equal things)
 
@dzaima That's pretty neat.
So the first # is the separator between code and the expected value?
 
5:48 PM
@EliasMårtenson yeah. (# is the comment character in BQN, so i allow comments after the expected value)
 
@dzaima I like that one.
 
@dzaima (to note is that doesn't actually test many builtins, but rather language features. i rely on marshalls ones for builtin stuff)
 
@dzaima The reason I'm building mine in Kotlin is that it integrates with the Kotlin test framework, so when I get failues it integrates nicely in the development tool.
I get nice stack traces and can very quickly find the offending code.
 
@EliasMårtenson that specific tests message is about overtaking in reshaping (like the behavior of 12↑,¨⍳10), and what that specifically is might change but the test will always work
 
6:22 PM
@dzaima testing performance is incredibly annoying. The timings of an expression often stabilize in a session, only to stabilize to a different value (with a 5% difference) in another, and i'm definitely dealing with something that needs to be more precise than 5% :|
 

« first day (1390 days earlier)      last day (1263 days later) »