I ve made my Computational model (?) and i got this:
x = input()
y = False
breaking = False
u = "1"
while 1:
for i in x:
if y:x += i * 2;y = False;u = i;continue
if i == "1":
x += "2"
x = x[1:]
elif i == "3":
if x[-1] == "0":y = Tru...
There probably isn't something super important that only you can comment about on SO, and once you have a couple quality posts there, you'll have enough rep to comment
In mathematics, Kruskal's tree theorem states that the set of finite trees over a well-quasi-ordered set of labels is itself well-quasi-ordered under homeomorphic embedding. The theorem was conjectured by Andrew Vázsonyi and proved by Joseph Kruskal (1960); a short proof was given by Crispin Nash-Williams (1963). It has since become a prominent example in reverse mathematics as a statement that cannot be proved within ATR0 (a form of arithmetical transfinite recursion), and a finitary application of the theorem gives the existence of the fast-growing TREE function.
In 2004, the result was...
50-100 rep for answers in TypeScript's type system
There aren't many answers here written in TypeScript's (turing complete) type system; as of posting, there six, two of which are my own. I like seeing such answers, so I'll be awarding a 50 rep bounty to answers that meet all of the following cri...
What general tips do you have for golfing in TypeScript's type system? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to TypeScript's type system (e.g. "remove comments" is not an answer).
Please post one tip per answer.
If you're no...
@emanresuA I edited the ungolfed version to add explanatory comments
If it's unclear, please let me know; I've been working with TS types for so long that it reads like normal code to me, so I'm not a great judge of the clarity of my explanation
Are there any restrictions on what programming languages you can use in a challenge, and if you created your own programming language and you wanted to submit it to a code challenge, does there need to be a working interpreter which actually executes the code or can there just be some set out syn...
Are there any restrictions on what programming languages you can use in a challenge, and if you created your own programming language and you wanted to submit it to a code challenge, does there need to be a working interpreter which actually executes the code or can there just be some set out syn...
@Fmbalbuena if you're going to attempt to answer a question on meta, especially something as general as that, i'ts a good idea to have sources (preferably links to older meta posts on the topic) or at least a little bit of justification as to why that's the case
alpha=0.5
sample['u'] = np.random.normal(size=len(sample))
sample['v'] = sample.groupby('state')['u'].transform(lambda x : (1-alpha) * x.to_numpy() + alpha*np.random.normal(size=1))
sample is a pandas df of sample data with people's wages organized by what state they're from and other factors (g...
Infix notation is a method of printing mathematical expressions where each operator sits between its two arguments, such as \$ \left(5 \cdot 4\right) + 3 \$.
Prefix notation is a method of printing expressions where operators sit before their arguments. The equivalent of the above is +*543. It's ...
I feel mildly guilty about procrastinating on learning them, but I procrastinate on actually important stuff already so I should feel guiltier about that :P
@user Wait no it can!
My day has been made
I just found out two languages can theoretically do regex at compile time
This is what it must mean to experience true euphoria
nah this is about the question somebody posted on main a bit ago re; golfing some python code. which is clearly taken from the middle of a project of some kind, i'm guessing a final or some other important one judigng by the time in the semester rn
no need to leave op another comment, i've already asked and all that. unless they give more information which leads me to say 'homie ur doing this very wrong pls write good code not short code' then its fine for now
@rues lmao yeah but also they said they were told to golf it and i'm very concerned about who would give that instruction
@Rɪᴋᴇʀ Yeah, and I think it'd be reasonable to want to shorten code even irl (at least, I've wanted to before), although our methods for golfing often sacrifice performance
i'm almost insulted you'd think i'd stoop to python code to manage a database to spam about. no i'd just give something like, 'help me golf this ansi C function while keeping k&r compliant. must run under WSL on windows or build with clang'
@rues well yeah but those 2 lines aren't really something u can golf very effectively. other than 'remove spaces and shorten variable names' and maybe 'here's a better library to use'
I can't see why it would be required, but I could see someone writing inelegant, long, inefficient code and a teacher telling them to shorten it and make it more readable