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

02:38
0
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...

03:01
@NewPosts will post an answer after lunch
 
4 hours later…
06:45
@Bubbler rip closed
07:36
@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.
07:53
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…. :) )
08:02
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?
08:19
@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?
08:25
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
08:42
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:

2410312426921032588580116606028314112912093247945688951359675039065257391591803200669085024107346049663448766280888004787862416978794958324969612987890774651455213339381625224770782077917681499676845543137387820057597345857904599109461387122099507964997815641342300677629473355281617428411794163967785870370368969109221591943054232011562758450080579587850900993714892283476646631181515063804873375182260506246992837898705971012525843324401232986857004760339316735
@TheEmptyStringPhotographer yes but the context is the number to store in one cell in the convolution challenge
09:05
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.
09:18
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?
09:27
@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
strange
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.
09:32
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
I managed to query the API using javascript! yes!
on the web!
10:19
right now time to configure the review buttons
10:30
@Bubbler wow it's that easy? well, thanks for letting me know
 
1 hour later…
11:35
0
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
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…
13:16
@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…
17:12
@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…
18:59
Here is how to bypass a RecursionError in Python:
def f():
    try:
        f()
    except RecursionError:
        f()
19:10
Is your program raising a RecursionError? Just say no! Python legally cannot RecursionError without your permission
5
@TheEmptyStringPhotographer
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():
    try:
        f()
    except RecursionError:
        sys.setrecursionlimit(sys.getrecursionlimit() + 1)
        f()
This should go on for longer though
@mousetail import sys
19:20
I have implicit imports
okay????
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
19:34
@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
4
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.
19:37
> 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
0
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.

20:04
@Joao-3 It won't generate a long error at all, fork bombs typically don't generate any error at all
20:20
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
20:25
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?
20:41
-42
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…
22:44
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
23:43
ugh
lovely
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
profusely

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