« first day (4584 days earlier)      last day (283 days later) » 

2:38 AM
Q: Shorten this recursive even fibonacci implementation

Wheat WizardI have the following Haskell code to generate the even values of the Fibonacci sequence as an infinite list: z=zipWith(+) g=z((*2)<$>0:0:g)$z(0:g)$(*2)<$>scanl(+)1g This works by starting with 0,2 and then defining every following term to be the sum of: twice all prior terms the previous term t...

3:01 AM
@NewPosts will post an answer after lunch
4 hours later…
6:45 AM
@Bubbler rip closed
7:36 AM
@AidenChow self-closing question :p
CMC: Given an integer n, return the smallest integer k such that all kth Fibonacci numbers are divisible by n.
7:53 AM
What are "all kth Fibonacci numbers"? F0, Fk, F2k, ...?
@Bubbler. ntt_par was clearly the fastest on my PC
yeah I saw the update
Is that surprising?
Your code is very cool
I will pose a challenge with larger ints soon
@Simd please don't
@Bubbler how come?
I think it’s a very interesting area
And maybe even practically useful!
(….maybe…. :) )
8:02 AM
managing high precision in individual cells becomes the bottleneck
not the core algorithm anymore
@Bubbler right although there are still different approaches possible
That’s what makes it so interesting to me
A good karatsuba implementation would be very interesting to time too
@Simd I mean, the submissions will just be the same FFT and NTT, but way slower because u128 division or some other multi-precision arithmetic
"way slower" being X times slower for pretty much the same X value for every submission
@Bubbler I don’t know what tradeoff are needed if you want 256 bit outputs
In any case, thank you for your awesome answers
@Simd There is no tradeoff at all.
I can also time the code more accurately which would be good
I don’t know if we have ever had any code using the new _BitInt
The c23 thing
@Bubbler if you are multiplying x bit numbers, at some point you want to do that not using naive multiplication, no?
8:19 AM
@Bubbler what was confusing you?
@Simd Incorrect, naive multiplication is the fastest (because simple loops are pretty fast) up to, say, 24 64-bit numbers (which is what dashu uses)
@Neil Not really, I guess it's the only interpretation that makes sense but figured I'd ask
OK, so then the answer is yes, obviously
as opposed to "yes, obviously"
and it's kinda unnecessarily complex because it is equivalent to "find the first k>0 where Fk is divisible by n" :P
@Bubbler I guess 24 is "some point" :)
or is it a trick question where the answer is always k=0?
8:25 AM
Is that when karatsuba is faster?
@Simd seems so
@Bubbler I think it's hardware department at least to se
@Bubbler I think it's hardware department at least to some degree
The Wikipedia page claims a much lower threshold
@Simd but "24 64-bit numbers" here is pretty large, it is literally a 24*64=1536-bit number
@Simd that's likely outdated. I'd rather trust benchmarks for a currently maintained library
@Simd not implemented in gcc/clang yet
@Bubbler that is true
@Bubbler I thought it was in clang but that's just from the dev notes so I might have that wrong
8:42 AM
oh ok, I figured out how to use it
so you can do this, but the result seems to be just a fully inlined naive multiplication
But if it's unsigned, the maximum number it can store is only:

@TheEmptyStringPhotographer yes but the context is the number to store in one cell in the convolution challenge
9:05 AM
CMC: Given an integer k, output the formula for F(kn+k) in terms of F(kn) and F(kn-k), where F(n) is the Fibonacci sequence
@RydwolfPrograms I'm implementing it, but in a website instead. It's actually getting some progress, since I managed to hook it up to a database.
@TheEmptyStringPhotographer How will you bypass CORS then? There is a reason people do it as a userscript
You will need data from stack overflow right? But you can't fetch data from different websites client side because of the same origin policy
If you have a website you have a different origin, while a user script has the same origin as SE
1. I'm using the API.
2. I don't know if this makes the issue less of an issue, but I'm using GitHub Pages.
9:18 AM
Does the API have CORS?
You wouldn't be able to use it clientside if it didn't have cors headers
It didn't use to, might be a recent change
well, I haven't tested yet...
i still need to add the fetch code
...that might not work then
You may be able to host on vercel then use the serverless functioninality to create a CORS proxy
@mousetail could I add the CORS header in the fetch function directly?
9:27 AM
@Bubbler cool!
@TheEmptyStringPhotographer No, the server needs to add it
Or you won't be able to access the content of the response client-side
@mousetail Well, it does seem to send the request, but it results in a 403 error since the access token apparently does not match the key.
but then it also sent a 400
For GET requests it doesn't prevent sending the request, just reading the content of the response
For POST requests it CORS will prevent sending the request at all
@Neil Lucas(k), -(-1)^k
@mousetail It let me see the response, which was a json object with the 403 error.
9:32 AM
In the script or in the inspector?
@mousetail I made the script log the json to the console, so both i guess.
Then it may have the required CORS headers
the end of the fetch code line was .then((json) => console.log(json))
Why use .then instead of await?
@mousetail I can understand it more easily.
I am not the all-knowing god of JavaScript.
10:08 AM
I managed to query the API using javascript! yes!
on the web!
10:19 AM
right now time to configure the review buttons
10:30 AM
@Bubbler wow it's that easy? well, thanks for letting me know
1 hour later…
11:35 AM
Q: Print a meter of numbers to a specified limit

TKDKid1000The question may be unclear, but example outputs aren't. Given an input number n, output a number meter formatted like this: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 The input number is 20 in this example. All numbers should be printed, and any size of numb...

11:47 AM
posted on August 18, 2023 by [Object object]‭

Simple challenge: Read a byte, swap bit 7 with 0, 6 with 1, 5 with 2 and 4 with 3 and then output the byte. For example the byte 0b1001'1100 would turn into 0b0011'1001...

1 hour later…
1:16 PM
@mousetail Almost certainly not
Most APIs don't, and it provides a way for users to securely sign in with the API
How did they manage to query data then? It seems they may have it enabled on a few routes at least if the photographer isn't lying
No I mean they don't have CORS protections, sorry
Must be a recent addition then, I know I struggled with that before
Maybe most APIs have CORS but the ones I need to work with hardly ever have it
4 hours later…
5:12 PM
@mousetail Maybe because I registered an app on Stack Apps?
It's a header
Isn't it required to register?
@mousetail If you want to use access tokens
RSNBATWPL stands for "Read SE's Nineteenth Byte At The Work Place Lol"
2 hours later…
6:59 PM
Here is how to bypass a RecursionError in Python:
def f():
    except RecursionError:
7:10 PM
Is your program raising a RecursionError? Just say no! Python legally cannot RecursionError without your permission
if you golf and remove recursion error you will unfortunately not be able to ctrl+c
@TheEmptyStringPhotographer This will eventually crash with recursion error but it will take 2^n steps where n is the recusion limit
aka 2^1000
Depending on how many stack frames you use before even getting to f, and how big your memory is
def f():
    except RecursionError:
        sys.setrecursionlimit(sys.getrecursionlimit() + 1)
This should go on for longer though
@mousetail import sys
7:20 PM
I have implicit imports
in 3.11 the default reclimit is 1000
also i hate my keyboard
It depends on some things, it's usually 1000 yes
@mousetail I guess… the script eventually errored and then was printing more than 50,000 lines to STDERR, so this could be a contender for longest error message compared to program size.
You could post it as an answer to that question
Or at least see if there is already a longer python answer
7:34 PM
@mousetail I don’t think there is a question like that.
Yes there is
What’s the link?
why is there a blank space at the end of chat
reloading fixed it nvm
Q: Largest Error Message in 100 bytes

someoneThe goal is to raise the error message with the most bytes! The error message may not be generated by the program itself, such as Python's raise. errors that do not terminate the program are not allowed unless they do not show an error message. Here is an example in python that raises 243041 byte...

@Joao-3 It looks better.
7:37 PM
> Python 3, ≈
A(A(A(9,9),A(9,9)),A(A(9,9),A(99,99))) where A is the Ackermann function,or limited by RAM
Looks like there is :p
It needs to specifically be an error
And while not required it's only really interesting if you don't raise it yourself
does forkbombing on linux count as an error message
A: Loopholes that are forbidden by default

The Empty String PhotographerUsing a very high base (like base Graham’s number) in a challenge where you need to output a big number In my answer, I just outputted 10, and claimed it was in base number that is bigger than any number printed in the challenge by another submission. And of course, this seems like cheating.

8:04 PM
@Joao-3 It won't generate a long error at all, fork bombs typically don't generate any error at all
8:20 PM
CMP: Do you use the Firefox shortcut Ctrl+M (mute)? Would you be okay with a userscript overriding that in chat?
never even heard of it
but also never heard of any other way to mute tabs when the little icon for actively playing audio pops up
*doesn't pop up
i could see someone wanting to specifically preemptively mute chat
It's under the right click menu on the tab right?
I didn't even know the little icon for audio could be interacted with
...that it is
yeah i don't think anyone would have issues with overriding ctrl+m
Oh and it'd only be when the text box is focused and Ctrl+K is already overridden, so I'm definitely good to override it I think
yeah lmao
8:25 PM
jsyk, this is the most downvoted loophole (lol) codegolf.meta.stackexchange.com/a/1078/111471
Is it? There may be others with more negative points but also more upvotes
Well, it has 122 downvotes
What's the most downvoted post in all of meta?
8:41 PM
Q: January 2020 Moderator Election — Community Interest Check

JNatThis community last had an election last year, and has recently seen their moderator team reduced by two. As such, by request of the remaining two moderators on the team, and to find replacements for Mego and Dennis, we're looking at scheduling an election to start somewhere in January 2020. To...

CMC: code anything remotely interesting in typescript type system
@Joao-3 That's not even close to the no builtings loophole
no that loophole has more downvotes
Exactly, so it's not the lowest post on meta
loopholes are answers not questions lol
I said posts
2 hours later…
10:44 PM
so yall there is a little bit of a conundrum with coding in desmos with actions that id like some feedback with. so basically the only "meta-compliant" way (at least that im aware of) to take input if you are going to use actions is to use \ans, which is an allowed I/O method.
but they recently took out that functionality as it wasnt meant to be used on the main graphing calculator and that it was too inconsistent
so now there are no "meta-compliant" ways i can think of to take input while still conforming to the agreed-upon default I/O methods.
the only other way to take input for actions is to hardcode an input variable, which as yall know, isnt allowed
It is for languages where there is no STDIN
eg ///
i was about to mention that
You can't get input any other way except for hardcoding it in the header
So there's some leeway there
but the difference here is that desmos does technically have a form of acceptable I/O, namely functions, except actions cant act on functions
they act on variables directly
now if u allow hardcoded variables for desmos then it would also be golfier to not use functions at all
and that would be an even bigger conundrum
so whats the solution here? can we not do any challenges requiring actions?
u can also say that hardcoded variables are only allowed for solutions using actions, but then there are many challenges that can be solved with both no actions and actions
and also it seems like a super specific rule just for one lang, i would preferably like a more "general" solution that isnt desmos-specific
theres also another issue of my old "desmos with actions" answers utilizing \ans that are now broken becuz that functionality was removed
hmm ok i was commenting with another user @fwoosh on one of their posts (which is where I noticed the issue) and they suggested the following:
would (byte count aside) having a function initialize the variables, and then starting the ticker, work? — fwoosh 7 mins ago
as i said in a reply to that comment, i dont immediately see an issue with that form of I/O (albeit not too byte efficient) tho i would like yalls opinions on this
11:43 PM
you... could start by putting that bit in a function :P
also wait is there a particular reason the cast and pipeline get actually have to be repeated
like per name
@UnrelatedString no, I just wanted to make a point :p
this is my hail mary for getting catfm working
if this fails I'm out of ideas
and I will weep

« first day (4584 days earlier)      last day (283 days later) »