« first day (4646 days earlier)      last day (494 days later) » 

00:03
CMC: write a program/function F such that for any positive rational A, F(A) = positive rational B, F(B) = C, and A<C<B
(failing for precision/size limits is allowed but the code must be theoretically correct of course)
0
A: Sandbox for Proposed Challenges

Dannyu NDosPerform Gray Addition Objective Given two non-negative integers encoded in unbounded-length Gray code, add them and output the result, where the result is also encoded in Gray code. Gray code There are many equivalent formulation of Gray code, but here's an intuitive one. The Gray code encodes ea...

Do golfing languages have builtin for encoding/decoding Gray codes?
not directly afaik
an easy way to check that is to check out the shortest answers on the Gray code challenge
I guess the answer is no, then.
00:10
@thejonymyster correct me if I've misunderstood, but wouldn't that be impossible? F(B) needs to generate both > B and < B at the same time
which doesn't make sense
oh my mistake
i know how to fix it, should i just repost the whole thing with the fix
yeah ill just do that one sec
CMC: (corrected) write a program/function F such that for any positive rational A, F(A) = positive rational B, F(B) = C, and C is between A and B (exclusive)
3
(failing for precision/size limits is allowed but the code must be theoretically correct of course)
so A <= C <= B?
yep
nope
A < C < B or A > C > B
ah
strictly between, not equal to either bound
otherwise x=>x would be the sol :P
00:26
@DannyuNDos iirc one way is easier, n^n>>1
01:00
Sandbox posts last active a week ago: Is this your answer? answer-chaining
 
3 hours later…
03:59
Well, seeing Catija and V2Blast gone was a gut punch to wake up to after a rough bout of illness :/
@thejonymyster Great challenge! Python, 31 bytes: lambda x:8*x/min(4+2*x*x,4*x*x)
im still trying to solve it so gg for having an answer even LOL
@cairdcoinheringaahing ye rippp
@CommandMaster wow, whats the idea behind this? its really cool to see it in action
@thejonymyster There's also lambda x:(1+max(1,x))/x/2 which almost works except for a fixed point at x=1
04:02
Oh, and gonna throw this up on the starboard as well, cause, while he wasn't a CM for as long as Catija, he was one of the most active CMs on our site, if you check the edits :P
right now im trying some concatenation nonsense
which doesnt seem to be working
@CommandMaster sorry to ping again but this looks really elegant when graphed, very fun
at first i thought that meeting point was an error but then i realized its root 2 lol
@thejonymyster Wait, I have a shorter version, Python, 25 bytes: lambda x:min(x/2+1/x,2/x)
also nice, im noticing the same fixed point, which i imagine is key to the strategy somehow :P
The idea is that if x>sqrt(2) we just take 2/x, otherwise we want a value slightly closer to sqrt(2), so we do a Newton iteration (x+2/x)/2=x/2+1/x
wow! ouch my brain
05:14
@cairdcoinheringaahing Glad you're better (if you are by now)! Yeah losing those two CMs really sucks, and I'm sure as a mod y'all'll feel it even more than us
It really does feel like SE's walking through a room of legos and making a beeline to step on every one they see sometimes
Slowly recovering. Had to get a meningitis vaccination and it's kicked me in the teeth. And yeah :/
Less than a month ago, V2 was in 20th byte doing the regular check-in
damn
@thejonymyster and root 2 is just used because it's a very convenient irrational number, i.e. doesn't have to be handled as input :P
@cairdcoinheringaahing y'all are getting quarterly check ins?
@lyxal CGCC is an established site :P
But yeah losing Cat and V2 is just bad altogether
05:25
it invariably goes "Anything we can help with?" followed by 2-4 responses of "uhhhhhh, nothing comes to mind"
Even as a new mod I can understand how bad it feels
@lyxal Yep :/
it's bittersweet as well, I just hit 1 year as a mod, where, tbh, Slate, Catija and V2Blast have been the CMs I've interacted with. And now, 2 of them are gone
05:53
@cairdcoinheringaahing Oh hey, I got a Men B vaccination like a week ago. All I got was just a super sore arm tho (doesn't help my friend likes patting people on the shoulder >:|)
@RydwolfPrograms This is actually the second time I got vaxxed against it, cause my exchange uni requires vaccinations and I couldn't get my records back home, so they just went, "Get another one" :P
06:06
now meningitis will get you instead
 
1 hour later…
07:11
me omw to get the caird vaccine
cairdvid23
07:33
@lyxal Bruh, that's just "don't use Jelly"
 
1 hour later…
08:58
Does a challenge where the base26 encoding of the code has to be a concatenation of words (from some given wordlist) sound interesting?
 
2 hours later…
10:55
in C23, can you define a function that squares a number whether it is an int or a float?
hi @CommandMaster
@Simd Hello
@CommandMaster your random factored integer code is great
I haven't had a chance to profile it but I did notice that it gets much slower when the bit size goes up. Is that the primality tests that slow down or is there more rejection do you think?
Both, probably
ok
I did have a question, I don't really understand all your optimizations. If I change int x = std::uniform_int_distribution<>(vI/2+1, vI)(rng); to be (1, vI)(rng) instead should I still expect the outputs to be correctly distributed? In other words, are any of the optimizations tailored to the exact question being asked?
11:11
@Simd The return value is problematic, but the compiler puts the arguments into different registers so it should technically be possible
@Simd It's part of Bach's algorithm, it returns a random factored value in the range [N/2, N] (and this is case for small N)
if I wanted a random factored value in the range [1, N] I was wondering what to change
@CommandMaster Would that be using generics somehow?
@Simd Ah, no, it would be more complicated, but you can split [1, N] to [N/2, N], [N/4, N/2], ..., and choose a range with the correct probability
@CommandMaster ah ok... that is interesting and slightly surprising
 
3 hours later…
14:31
@CommandMaster since when does a composer do math lol
well if we're talking bach that music was all super structured so i wouldnt be surprised if there were literaly written algorithms
@CommandMaster im totally down to add your tex bounty to the absurd thematic bounty post; do you have permission to edit it in or would i have to add it / make it community wiki or something?
14:50
@Seggan It's a different Bach, Eric Bach
@thejonymyster Thanks, I'll edit it
and feel free to stick it wherever you want in the post, top/bottom/middle/whatever :p
i wonder if any of those will ever be solved :think:
15:17
Added it. I might do the Rubik's cube one, but it's hard to find a good algorithm
 
1 hour later…
16:20
@cairdcoinheringaahing could you unfreeze this room pls?
 
3 hours later…
19:00
Did SE get a slightly different UI design? The colours look slightly different.
 
2 hours later…
20:52
CMC write code that compiles but gives a different output in C11 and C23
21:14
iirc there's at least one macro for doing exactly that so i assume that's off limits :P
21:55
oh hey the colors are live
they're pretty nice ig
question titles are hard to read
wait where is this
are we getting a/b tested perhaps
@RydwolfPrograms nyeh heh heh! I did it myself!.
@UnrelatedString its live network-wide
i want to report that the contrast on the title for favorite tags is pretty bad
22:00
huh, i can definitely tell the difference on the mother meta post but nothing seems different on cgcc
contrast seems pretty low, was it like that before?
specifically the background for the tags is too close to the background of the summary
where would it make sense to report this?
watched tag*
 
2 hours later…
23:43
@Ginger ugh, I'm going to have to fix my voting buttons again

« first day (4646 days earlier)      last day (494 days later) »