« first day (1573 days earlier)      last day (1084 days later) » 

1:14 AM
0
Q: Floor of complex number

BubblerBackground Complex floor is a domain extension of the mathematical floor function for complex numbers. This is used in some APL languages to implement floor ⌊, ceiling ⌈, residue |, GCD ∨, and LCM ∧ on complex numbers. For the rest of this challenge, an integer refers to a Gaussian integer, i.e. ...

 
 
5 hours later…
RGS
6:39 AM
@Adám ok, I give up
 
 
2 hours later…
RGS
8:32 AM
Tried updating Link and now it is even worse than before 🤣
 
9:08 AM
(,∘.,)⍣n⍨ is a neat idiom for cartesian power
 
 
3 hours later…
12:00 PM
Wrote the partition function in APL again, this time with memoization
partition←{
    ⍵≤0:⍵=0
    m←⍬
    p←{
        ⍵≤0:⍵=0
        ⍵≤≢m:m[⍵]
        z←⍵+{2÷⍨⍵-3×⍵×⍵}⍤0⊢↑(⊢,-)⊂⍳⍵
        ⊢m,←-/+⌿p⍤0⊢z
    }
    r←p⍤0⊢⍳⍵
    m[⍵]
}
Thinking of writing in k←⌈6÷⍨1+0.5*⍨1+24×⍵ and using ⍳k at end of z instead of the entirety of ⍳⍵ which adds a lot of extra lookups
I do seem to have a bug
      partition 6353
¯1.508503541E82
      partition 6352
3.466844567E81
      partition 100000
DOMAIN ERROR
partition[8] ⊢m,←-/+⌿p⍤0⊢z
                   ∧
⍝ Found another limit
 
@Sherlock9 reimplementation of ⊂?
 
Oh no I mean the number-theoretic partition function
 
12:19 PM
@dzaima I didn't see these mentions until now, sorry. My feeling on this is more about not being aggressive about constraints caused by historical decision making. I don't see any utility in papering over long running discussions by lambasting people who made decisions that are (currently) unpopular but which were much less clear cut at the time.
I'm sorry if "ignorant" sounds harsh, but it's just a straight up reality -- the computer programming industry cycle essentially runs on trashing the previous king of the hill while simultaneously entertaining delusions that no one who came before had any idea about how to "do it right".
 
12:34 PM
@ab5tract when, say, I complain about singletons being awful, I do mean that they're awful now, and I think it's reasonable to not be happy with now-awful things being in continued use.
@ab5tract The important distinction being that what was "done right" in the 1960s isn't "done right" for today. I don't think anyone is complaining about things being "done wrong" for the time it was made
 
@dzaima That's not how I read sentences like "APL seems like a bunch of shit cobbled together" ... At all. What I read there is that there is no respect for the fact that the way Dyalog APL looks today is a grand result of decades worth of decision making. Constantly railing about ⎕IO ("how dare someone allow both sides of an argument to get their way?? that's even dumber than just choosing the obviously wrong and super stupid 1"), all of that negativity, showed little to no respect history.
*of history. I'm sorry you perceive what I'm saying as anti-criticizing APL. I don't feel that way at all. I'm simply saying that this room feels a lot nicer to stop by in without all the negative attitude directed towards APL in general and Dyalog's implementation in particular.
It's not like people were bringing up new complaints. It was the same litany day after day.
I did not mention this to spread negativity further. I wanted @Adám to know that I for one appreciated the decision. It must have been a really hard one to make and I get the impression he cares a great deal about the APL community here and everywhere. I hope we can leave it there.
 
12:50 PM
@ab5tract well, if someone sees APL as a cobbled-together mess, that's the way they see it, regardless of whether it has 60 years of history, or if it was made yesterday. Because, effectively, it is precisely the same, from the user's perspective. And when someone is expected to write code in a language, I believe they have every right to be upset at anything bad, regardless of whether there's a reason for it.
 
@dzaima A right to be upset that a software that comes from a specific history doesn't magically meet all the expectations of today? I have an equal right to be offended by such behavior.
 
@ab5tract that's just people complaining about things until they are fixed. That happens literally everywhere
 
@dzaima Some places more respectfully than else where. I found the behavior of folks near to trolling. I wrote as much in support of one side of a difficult decision. Why can't you leave it at that? Funniest thing about ignorance and ignorant behavior, the person being called out usually doesn't know about their ignorance to begin with. That's kind of the whole deal with ignorance. My perspective is mine. Please let it rest?
 
I guess my problem is using reasons that don't apply anymore (no other languages to learn from, no experience from decades of usage) as actual defense for flaws. They're reasons for the flaws, but they're not reasons to keep the flaws around, and teach the flaws to people today.
 
1:06 PM
@dzaima Maybe that's the ignorance I am perceiving... ignorance of the sheer weight of backwards compatibility and customer demand in determining the shape of a commercial language implementation. The attitude that these longstanding implementation details are reflective of a preference for flawed software and flawed solutions is just ... it's not accurate and it's resembles the kind of behavior I would expect on a game forum or a movie fandom chat, not in serious developer chat.
Even if they wanted to fix every single issue being raised, it would be impossible to do it in time for tomorrow, let alone yesterday.
 
@ab5tract Whatever the reason, in the end, Dyalog is a suboptimal APL for my personal usage. Like it or not.
 
@dzaima I don't understand this attitude that I have some stake in whether it is effective for you in this moment. My problem was with people who felt that way sitting here and bashing something without any respect to there being concrete, identifiable, and often immovable barriers to things being any other way than they currently are.
I found it annoying. I celebrated it's absence. I will now go back to lurking.
 
1:25 PM
@ab5tract Still, historical reasons and causes, however immovable, aren't reasons to not change things now. Would "An array language made today shouldn't extend singletons as if they were scalars." be better than "singletons are horrible!" to you? Because, to me, both are conveying the same thing.
 
1:40 PM
@ab5tract Software that doesn't meet 'all the expectations of today' is unfit for purpose. If (Dyalog) APL doesn't, and won't try to keep up with modern expectations, it is a legacy language, for maintaining legacy codebases, and any attempt at portraying it as something feasible for use in the modern world is straight up lies.
 
First and most importantly, the purpose of this chatroom is to educate, first about the APL languages and descendants, and then about the historical context. But seeing as the main purpose is to educate, and not to squabble, please refrain from arguing so heatedly in this channel. The trouble is not the matter of the discussion, but the overtaking of the channel such that it is awkward to change the subject onto lighter matters of education as I have wanted to do now for an hour. I do not ask that you do not argue, merely that you both do so with awareness of the forum in which you are doin
 
 partition←{
     d←{⊃{⍺(+@(⍺×⍳⌊⍺÷⍨≢⍵))⍵}/⍵,⊂w⍴0}⍳w←⍵
     p←⍵⍴0
     1-⍨{⍵=0:1
         p[⍵]>0:p[⍵]
         r←⍵÷⍨+/(∇×d⌷⍨⍵-⊢)¨1-⍨⍳⍵
         ⊢p[⍵]←r}⍵
 }
@Sherlock9 here's a modification of a function I made for a project euler problem
it can probably be improved, I wrote it ages ago
your function is actually faster
 
2:02 PM
@rak1507 Oh that's interesting. Let me take a look
@rak1507 Yeah, that's where I got the inspiration too
 
mathworld.wolfram.com/PartitionFunctionP.html not sure which function you use, but I use the divisor sum based one
 
Let me try to write it in APL-like syntax
 
ah, nice
that's fine as is
 
Trying to convert it to J and I have no idea where the editor is XD
 
2:24 PM
 p3←{
     p←⍵⍴0
     {⍵<0:0 ⋄ ⍵=0:1 ⋄ ×⍵⊃p:⍵⊃p ⋄ ⊢p[⍵]←-/+/∇¨⍵-(2÷⍨⊢×1-⍨3×⊢),∘-⍨⍪⍳⍵}⍵
 }
new attempt using that formula, significantly faster
 
@rak1507 Ooh that's very nice, and it might work better with my attempted J translation
 
3:15 PM
The longer I work on this J translation, the nicer I think Dyalog APL is XD
I've seen complaints about modified assignments to arrays and how they're handled (there is a massive bug, if I remember the complaints correctly), but at least Dyalog APL appears to have them
Not sure how to do p[⍵]←... in J
And I'm not sure how J does recursion either
@rak1507 You can shorten ⍵-(2÷⍨⊢×1-⍨3×⊢) to ⍵+(2÷⍨⊢×1-3×⊢)
 
wasn't trying to golf necessarily, but nice
 
Yeah, I figured. I put some golfs in my code like ⍵≤0:⍵=0 but that's not as readable I suppose
 
RGS
“wasn't trying to golf necessarily” – weirder words had never been spoken
 
lol
 
3:43 PM
Alright so the following J code doesn't work
inner_p=: 3 : 0
   if. y<.0 do.
     0
   elseif. 0 <. y { memo do.
     y { memo
   else.
     z =. -/+/"1 inner_p"0 y+(2%~]*1-3*])(],:-)>:i.y
     memo =: z y} memo
     z
   end.
   )

partition=: 3 : 0
   memo=:1,y$0
   inner_p y
   )
Oh it's < not <.
Got it!
inner_p=: 3 : 0
   if. y<.0 do.
     0
   elseif. 0 < y { memo do.
     y { memo
   else.
     y { memo =: memo y}~ -/+/inner_p"0 y+(2%~]*1-3*])(],:-)1+i.y
   end.
   )

partition=: 3 : 0
   memo=:1,y$0
   inner_p y
   )
 
cool
I'm sure there was a J solution for this published somewhere, but idk where
 
4:06 PM
J looks like tradfns on shrooms
 
lol
j seems to generally be very tacit, which is understandable considering how much of a pain other forms are
 
Found it! An essay on partitions code.jsoftware.com/wiki/Essays/…
 
I hear J's getting something like dfns (with the digraphs {{ and }}), which might be nicer to use than :
 
yeah
although you have to put a space after them or something
which is pretty horrible
 
It's a small price to pay for non-tacit inline functions
 
4:27 PM
@rak1507 have you done rosalind.info/problems/tree? I don't understand why the example data should give 3 and not 2... :/
 
@xpqz Node 3 isn't connected to anything else yet
 
Ah yes, silly me.
Thanks
 
lol, I was wondering the same thing, I haven't done it before
 

« first day (1573 days earlier)      last day (1084 days later) »