« first day (4399 days earlier)      last day (742 days later) » 

00:30
@NewPosts Perhaps I was overambitious… should I have started by simply asking for a triangular grid of hexagons (ignoring the coloring)?
@AkivaWeinberger I think it's fine (and an interesting pattern). You probably won't get a lot of answers, but that's okay--we have plenty of easy challenges, it's nice to get a moderately difficult one sometimes.
 
1 hour later…
02:02
Do we think code golf is the most appropriate scoring system for this?
That's our most common tag, and the easiest to get right. If you can't think of any other scoring systems, code golf will work just fine
If you do want to use another scoring system, you'll likely have to edit the question (depending on that system). With code-golf, you can just add the tag and you're all set to go
 
3 hours later…
05:02
codegolf.meta.stackexchange.com/a/25559/76323 The esp and ebp still make one with knowledge of x86asm, or at least me, easier understood
05:50
Cursed python:
>>> 0xfor (lambda a, b: a + b) in [1, 2, 3, 4, 5]
15
>>> eggs ,= 0xfor (lambda a, b: a + b) in [1, 2, 3, 4, 5],  # You can save it to eggs with ,= operator
>>> eggs
15
06:10
gee, i wonder why that's getting deprecated
07:00
0
Q: Output a Latin square with a program which is a Latin square

anatolygA Latin square of order n is text which is arranged as a square of n lines by n columns, contains n different characters, and each character appears once in each line and column. For example, here is a Latin square of order 9: Code gOlf ode gOlfC de gOlfCo e gOlfCod gOlfCode gOlfCode OlfCode g...

 
2 hours later…
09:26
0
Q: How to find the counterfeit coin?

EzioMercerYou are the treasurer and you have received information that a counterfeit coin has entered the treasury. All you know is that the counterfeit coin is lighter than the original Knowing how many coins you have in total and using only a balance scale, you need to determine for the minimum number of...

09:37
i made a c program that generates ... an image
@mousetail I had to put that into iPython to understand what you were doing...
It works because o is not a hex character
I know
It's obvious with the syntax highlighting
But in chat it wasn't
I had to google it and go to the SO answer that explains it :p
 
2 hours later…
11:29
0
Q: Find the largest sum of any contiguous subarray of the array

Aitzaz ImtiazLet's say you are given an integer array. Create a function to determine the largest sum of any array's adjacent subarrays. For instance, the contiguous subarray with the largest sum is [4, -1, 2, 1] in the array [-2, 1, -3, 4, -1, 2, 1, -5, 4]. You can employ a variant of Kadane's algorithm to r...

12:25
@RydwolfPrograms relatable
could anyone help me translate scipy.stats.nbinom.cdf(k, n, p) into pure python?
chatgpt seems to give an incorrect translation
here is a test case
In [9]: nbinom.cdf(9, 19, 0.6)
Out[9]: 0.25881393839023303
12:42
I don't use scipy so can't help
13:16
0
Q: Find Sub-matrix with matched cell 1

Aitzaz ImtiazYou are given a matrix of size m x n where each cell can contain either 1 or 0. You need to find the largest square submatrix that contains only 1's. The output should be the area of the largest square submatrix. For example, given the following matrix: 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Th...

happy day of valentine yall
you say that, but you've forgotten who you're talking to
@Ginger I don’t think CGCC is the target population for this event
…ninja’d
me and the persons waiting for our pfp changes to propagate
oop there we go
I sure hope yall have context for this :p
What kind of profile pic is this
hearts but also crying, that’s confusing
13:23
in Off-Topic TNB, Jan 18 at 20:19, by Ginger
*cries sexily*
you need to have context q:
Those eyes are not exactly sexy
that's the joke
anyway, back to your regularly scheduled code golf
thanks edge, very helpful
You use Edge?
Now I understand why you have skewed perceptions of sexyness
@Fatalize It's not voluntary, believe me
I hate edge but use it for reasons I cannot explain here
13:30
@Fatalize who doesn't?
@Ginger You don’t want us to know you’re here during work hours?
no comment
@Simd Especially here, what people call sexy code is not exactly standard
We are kinky programmers
2
don't you even think about starting this discussion again

what the actual hell

Aug 3, 2021 at 23:25, 9 minutes total – 42 messages, 7 users, 12 stars

Bookmarked Aug 3, 2021 at 23:35 by lyxal

oh no not again
13:46
I will immediately forget what I just read
good
0
Q: Minimum Cut finder

Aitzaz ImtiazWrite a program that takes an undirected graph and finds the minimum cut, i.e., the set of edges that, if removed, would disconnect the graph into two or more connected components. The program should have a time complexity of O(n^2m), where n is the number of vertices and m is the number of edges...

14:16
@Fatalize kinky is normal I claim. What is abnormal is telling anyone
I am amazed there is a minimum cut answer already!
Ah, by the OP :)
14:39
Ad: Register now for APL Seeds '23, a free online user meeting on 22 March 2023 from 14:00 UTC. This event is aimed at new APLers and the APL-curious (although all are welcome) and includes a brief introduction to the language and the available learning resources as well as some application demonstrations. More details to follow soon.
@Adám Why does the Dyalog website's favicon have a filled background?
My guess is that it predates transparent background favicons, and that nobody bothered enough to change it.
wow :p
Criterion for website trustworthiness:
1. Red line through https
2. (NEW!) Solid-background favicon
Switch to new "improved" website is supposed to happen "soon".
the same way a chat upgrade is supposed to happen "soon"? :b
14:43
@Ginger non-secure http is actually not a real problem for content-only websites.
@Ginger No, I've actually seen the staging version of the new site.
@Ginger Ah, right. But http://help.dyalog.com/latest was updated 2023-01-20. (You can access the secure version too, though.)
@Ginger Just confirmed that the new site has transparent background on that D icon.
@Ginger Hyped
15:01
@lyxal o_O
@Adám Until I deploy my AI-powered cloud technology to inject slightly wrong information into every HTTP static page
15:43
@Adám nice
15:54
@Ginger Tbf that is the only word which starts with "regur" (aside from variants of it)
That's a dictionary of over 300k words
@Ginger Is this true or made up
@RydwolfPrograms made up lol
the sun will die before chat does
@RydwolfPrograms whered u get that
the dict
Github, don't remember where tho
16:11
ik google has the 10k words on GH
16:27
https://i.sstatic.net/y3ctH.png
Any fast solution?
Does anybody know how the starred messages are sorted?
They aren't just sorted, as they slowly "degrade".
So, how does that exactly work?
might be an interesting cgcc challenge :p
I very much doubt it
It's probably just star count minus/divided by time since posted or starred
sadge
 
1 hour later…
17:52
> 12 binary digits, or 3 nibbles (a 'tribble'), ...
TIL
 
1 hour later…
19:13
0
A: Sandbox for Proposed Challenges

mathcatRandom point inside boundary Given an ASCII art with closed Eulerian paths using | and - (pipes and dashes), output a random point inside the boundary. Eg. given: ---- ​---- | |- --- => |12|- --- | | | | |456| |7| ----- --- ----- --- Any point 1-7 shoul...

LDQ: this or self?
oneself
Or we
@Seggan me
actually maybe i could use this for the object and self for the function itself
so i can do cursed things like fun a() { self() }
@Adám serious?
not really, but you gave no context.
19:22
i think you know what i mean :P
for implicit "this object" references inside functions
Dyalog APL uses ⎕THIS to refer to the current namespace.
i.e. java/kotlin this or python/rust self
and for the current function, but self would work for that.
@Adám yeah... this aint APL :P
Python self is just a convention
19:24
yeah ik but its a pretty much unanimous one
@Seggan this
me would actually sound kind of cool for example recursive mapping of self, as if the function was speaking.
Idea: Like it in lambdas, allow that in methods :p
fn add { this + that }
I've long been wanting ⎕THAT to refer to the last result, like TI-Basic's Ans
@emanresuA Add that to the list of things I hate about python :p
I mean, yes, that would give the user some flexibility, but the fact that you have to add "self" as the first argument of every class outweighs it.
19:36
Worth noting in Rust you still need to specify self as an argument, despite it having special meaning (that's so that you can clarify whether the method mutates the object)
So it's not a Python-only thing to have that annoying self in every method
@RydwolfPrograms oof
IIRC it also means the only thing you need to do to make a method static is just not include a self
I'd definitely prefer python's @staticmethod
Ew
Is that actual syntax
I mean a static keyword maybe, but @staticmethod looks like a complete kludge
ig yeah
But so much potential was lost on Python's decorators, IMO they should have made it a major feature.
20:12
Okay I've just come back to my RTO prototype. Opinions?
hmm
Some things I'm not sure on:
1. Those `CPython:` left-aligned things look kind of odd; maybe no colon would be better?
2. That dropdown on the right doesn't fit, but it seems like it'd be too tall if I tried to make it consistent with the rest of the UI
I also want an "additional options" button thing to bring up a popup where you can change other settings, but that's gonna be a future task
Really those're the only issues I see right now
the cpython/pypy things seem top-aligned with the buttons which looks a bit odd. also about the colons and alignment, have you tried right alignment or do you not like that
Worse:
It's that weird thing that happens sometimes
I forgot how to fix that, I think I just need to spam some display: flex
you should be able to just make the whole row a flex and do align-items: center in theory
sometimes doesn't work but usually fixes it
20:18
@hyper-neutrino As in like, everything in the box?
like, right align the category names so the colons line up
oh right
Looks better I think
@hyper-neutrino This is apparently a <table> so I don't think that'll work
Lemme try
ah. yeah idk how to use tables; i typically avoid them lol
Oh hang on apparently this is like the one place where vertical-align actually works
Much better
20:26
Do y'all think it'd make sense to have disabled copies of versions present in one variant but not another? So that they line up?
E.g.:
why not use display:grid?
Not familiar with it, and a table works fine
It's like half the HTML at the cost of 4 lines of CSS
Plus a lot of extra options
Are you sure that'd handle things like wrapping right?
And the amount of HTML doesn't matter much when it's all dynamically generated (client side no less)
Yes it wraps properly
Table doesn't
20:35
No, table wraps exactly how I need it to
Table doesn't wrap at all
It just looks terrible if your screen is too narrow
???
It sure does
Grid that
Did you do that manually with JS?
No
Pure CSS
Grid works like that by default, I had no idea you could do that with <table>
what does your css look like?
20:38
I don't know what it is you think I'm doing
My CSS is just this:
#lang table {
    border-spacing: 0;
}

#lang table td {
    border: none;
    padding: 0;
    vertical-align: top;
}
But how do you wrap?
presumably all of the options are in one cell
The buttons just wrap...they're in a flex div
@RydwolfPrograms idt that's a good idea
it implies CPython 1.0.2 exists but isn't supported by RTO
Oh you are not using a table for the buttons, just the labels on the left
which don't wrap
20:40
^^^ and too much clutter
And the buttons are just in a flex box?
Ah ok, I was talking about the buttons themselves, if you want them to align vertically with the row below you could use grid
The table's just to make the column of variant names a consistent width, and prevent overflowing from putting them underneath the variant name
@hyper-neutrino That's true I guess
(although the way this is meant to be used, it would imply that. I'm just using made up Python versions, but it's supposed to be the same versioning for the different interpreter options)
I am considering dropping the multiple-variants-in-the-same-language thing tho, and just having different versions, with multiple languages (like Python (CPython), Python (PyPy), etc.)
It does make it more cluttered (and possibly intimidating to someone who isn't sure which Python or which JS they're supposed to use), tho
20:58
(I mean, I suppose that problem exists for either solution, but with the current one you can have the most recent version of a sensible default interpreter selected)
21:28
I think I'm just gonna end up writing my own (domain-specific) JS framework lol
The page layout is entirely dynamic (e.g., you don't need compiler args for brainfuck, but you need two sets for a language that transpiles to a compiled language, you use an image upload/editor instead of a text input for non-ascii piet, etc.)
Which makes it very annoying to write with JS's built-in DOM stuff
Isn't that exactly what existing frameworks are good at?
21:44
@Seggan That should use recur
Saint Valentine (Italian: San Valentino; Latin: Valentinus) was a 3rd-century Roman saint, commemorated in Western Christianity on February 14 and in Eastern Orthodoxy on July 6. From the High Middle Ages, his Saints' Day has been associated with a tradition of courtly love. He is also a patron saint of Terni, epilepsy and beekeepers. Saint Valentine was a clergyman – either a priest or a bishop – in the Roman Empire who ministered to persecuted Christians. He was martyred and his body buried on the Via Flaminia on February 14, which has been observed as the Feast of Saint Valentine (Saint Valentine...
@Seggan DreamMaker uses src and DreamMaker is DEFINITELY a language worth taking inspiration from.
@Seggan I'd lean toward this, especially if it's part of the syntax
<classHandle>.__currentObject__
i'd go self if it's an explicit argument and this if it's implicit
@Seggan reject keywords, use 😎
22:07
@emanresuA better yet, <functionHandle>.calledOn()
😎.function()
Because the class has self confidence
But maybe @@ or some other symbol set
I'd love to see something like that
all of the object's methods are in scope unqualified, you can treat normal functions like they're methods supplying the first argument as the object they're called as methods of, if you call a function with too few arguments it tries a method call with an implicit this argument
@UnrelatedString even better: random.choice(filter(lambda i: type(i.__owner__()) == <class object>, locals()))
therefore the syntax for accessing the current object is... the identity function
for extra cursed points you can also name the default identity function this :P
ah yes, this().function()
22:13
equivalent to this().this().function()
. - .
this(this().(function.this())())
Idea: thisn't() which returns any random value that isn't what you called it on
debug.callstack[-1]()
wait wait wait
make *lone parentheses* the identity function
().function()
that's fucking vile
22:17
last returning the last function called.
So you can assign this=last at the top of the function
Make it late binding too
@ATaco *((ThisClass *) (&myFirstField))
a = 0; filter(lambda i: "a" in i.__locals__(), type(<class handle>).__instances__())
wide brain
@ATaco x => {[y => {this = last ;...} for _ in x}
And all the functions refer to the last thing generated
That would be funny
I appreciate how quickly any request for advise for syntax devolves into "How can we write the worst language possible"
22:24
it's FOR SCIENCE!
your object wants to pass itself into a function? just pass the function into itself
it'll understand
__globals__.__currentContext__.__thisObject__
missing __environment__
GlobalsFactory.getGlobals().getCurrentContext() != null ? GlobalsFactory.getGlobals().getCurrentContext().getCurrentObject() : null
Brainchild just forces an additional argument into function definitions/calls called this, although this is not a keyword and can be re-assigned or assigned outside a class/function.
Though BrainChild also has no way to handle varadic or default arguments…
22:58
I wonder the potential of a compiled language which is built around an Entity Component System data model, instead of a classical OOP model.
23:19
@UnrelatedString YES
23:29
@lyxal coffeescript uses @member()
@lyxal i should really make apostrophe a legal character :P
@ATaco ikr
…Variable Union Types… everything...
(a & b)+=3
0
Q: How spherical is my ellipsoid?

Parcly TaxelDefine the (unnormalised) Willmore energy of a surface as the integral of squared mean curvature over it: $$W=\int_SH^2\,dA$$ For surfaces topologically equivalent to a sphere \$W\ge4\pi\$, and \$W=4\pi\$ iff it is actually a sphere. Thus the energy quantifies how spherical a surface is. In Septe...

not very, I'd say
(array WHERE this.index==3) = 3
wait is that actual syntax
23:35
Nope, just a concept.
ah
whats an ECS model
I've never seen ECS used for non-graphical stuff
nvm wikipedia to the rescue
Entity Component Systems. Data is split into "Components" which store data, and controlled by "Systems" which operate on Components. They are collected as "Entities" which can refer back to the Components and Systems.
@emanresuA Can theoretically be also used for Database stuff.
Best used when you need to reuse code for properties shared by many things, but those things are conceptually different.
@Seggan i don't like the idea of using @ since it brings to mind python decorators and java annotations, but maybe $ could work
23:43
What if, if this is used too many times / line, the compiler errors with "programmer is overly narcissistic"?
That's called Objective INTERCAL
🧏()
@UnrelatedString yeah me neither
Feb 6 at 18:06, by Seggan
so i decided to do python style decorators
Feb 6 at 18:06, by Seggan
except that they can take any type (not just functions), and since functions are syntax sugar for variables in Rol, any variable assignment can be annotated
Brainchild doesn't have Decorators, but it has Macros which can sorta work as Decorators.

« first day (4399 days earlier)      last day (742 days later) »