« first day (4447 days earlier)      last day (388 days later) » 

1:50 AM
I am running into the weirdest Safari-specific bug: inconsistently, when I change the background color of the page itself, things with background-color: inherit don't always update. The only way I've found to fix it that works is to set them to be hidden and then un-hidden again, which means I now have this code
  if isSafari
    elements.main.hidden = true
    # Yes, the 1 here is necessary. A timeout of 0 is worse than not doing this at all.
    setTimeout((=> elements.main.hidden = false), 1)
However, that means that I have to implement isSafari. I can't well use navigator.userAgent because everything claims to be Mozilla and AppleWebKit and Safari, so for now I'm using the deprecated navigator.vendor property
 
0
Q: Write a Python Function Decorator for which Return Values have the same Tree-Like Structure as the Calling Argument(s)

Samuel MuldoonWrite a Python Function Decorator for which Return Values have the same Tree-Like Structure as the Calling Argument(s) Ideally we would have the following: Write a decorator for camel_to_underscore such that camel_to_underscore has the following behavior: CODE RETURN VALUE camel_to_under...

 
 
6 hours later…
7:55 AM
flagged as spam, right?
 
 
2 hours later…
10:19 AM
Has anyone tried to write restricted-complexity programs in brainfuck?
 
11:07 AM
You’d probably have to use an optimizing compiler like awib in order to make addition and multiplication single operations, or else you’re in for a heck of a time
 
11:44 AM
@Bbrk24 Of course.
But because every cell can only hold 0 to 255 you are not going to do arithmetic with two cells anyway.
@Bbrk24 What really matters is the random access of an array.
 
12:12 PM
Is there a brainfuck interpreter out there that uses a doubly-linked list? Given how MP movement works, you don’t really need it to be an array.
Also, I think awib collapses sequences of many > into a single operation (though I’m not 100% on that)
 
 
3 hours later…
3:41 PM
0
Q: Doors and guards

lesobrodRelated but noticeably different You are the leader of the guard in the dungeon of an ancient castle. There are N doors in the dungeon and N guards with keys. Guard with index i may operates with doors that have multiple indexes: i, 2 * i, 3 * i, ... The way he operates is very dumb: he just tog...

 
4:22 PM
0
Q: Implement grambulation

caird coinheringaahin gConsider the following spiral of positive integers: We now define grambulation as a binary operation \$\lozenge : \mathbb N \times \mathbb N \to \mathbb N\$, using this grid. Some example inputs and outputs for grambulation are: \begin{align*} 1 & \lozenge 9 = 25 \\ 1 & \lozenge 2 = 11 \\ 11 & \...

 
@NewPosts I have also found an extension of this to negative and rational numbers that I might do, depending on how this challenge goes :P
 
Arrrgh :-( Martin Ender, whose legacy of computational regex answers played a big part in inspiring me to be active on CGCC ~5 years after my initial post, finally has some activity on CGCC after 2 years of seemingly total inactivity (or 5 years since any heavy activity)... and it's in response to me pointing out a bug in one of his Retina answers. But his response is not to fix the answer, it's to delete it :-(
It always saddened me that I became active in regex on CGCC just as he was becoming inactive. When I found a bug in one of his answers 4 days ago, I secretly hoped he'd actually come back to fix it. I didn't expect deletion. And it's a 5 year old answer, so it's not like anybody besides me was going to notice it. If he were actually going to fix it I think he would just edit it. Deleting it, editing it, and undeleting it is only something that makes sense on fairly new answers, isn't it?
 
Depends on how easy the fix is
And, if he has the time to fix it now. It's entirely possible he logged in, saw someone pointing out his answer was invalid, realised he would need a bit more time than he had to fix it, and deleted it for now
 
Hopefully.
 
That also reminds me I have a number of deleted answers I should probably go back and fix :P
 
4:34 PM
Hehe.
 
I tend to check CGCC while in line for coffee each morning, and then make a note of stuff I need to go back to later (e.g. flags). If someone leaves a comment on one of my answers about invalidity, I just delete the answer, then inevitably forget about fixing it (cause deleting the answer removes the comment from your inbox, so it doesn't even leave a reminder ಠ_ಠ)
 
 
2 hours later…
6:55 PM
@cairdcoinheringaahing is it just me or is there one more space in your username than there used to be
 
7:13 PM
May I ask why?
 
I assume it's because your name had a problem with not wrapping, and was part invisible, in certain contexts. I don't recall ever seeing that myself though.
 
Well between the current spacing and the pronouns injected by a userscript, there's now four lines of text next to his profile picture, which messes with the spacing between messages
 
@Bbrk24 Chat already caused the g to wrap onto a new line without the space
 
oh
 
So I thought it'd be funny to change it for a bit
 
7:20 PM
makes sense
 
Nope, wrong SS
Eh, I don't think I can find it. But it's been doing it for years
 
7:56 PM
@cairdcoinheringaahing You mean this chat? The way the page displays for me, there's room for about twice the width of your name. Are you zoomed way in, like 170%? If I zoom to 170% then your current name's g becomes invisible except in your most recent message where the avatar is bigger.
And if I zoom in farther than 170%, everything but "caird" becomes invisible. It's that part that I assume is the reason you did the name change... the threshold zoom for your "last name" disappearing was lower before you added the space. But it's still possible with the added space, just needs a slightly higher zoom.
 
I keep TNB at a 90% zoom, on a laptop
 
I'm guessing it's because of large fonts used by the laptop to compensate for its pixels being very small.
 
For me it's caird\ncoinheringaahin g
 
This is what it shows for me:
 
Lol
 
8:24 PM
 
Ah, so that's why you did it! One diamond wasn't enough!
This is what it looks like to me, BTW:
 
@Deadcode Yeah, I have no idea why it shows me with 2 diamonds :P
Think it's a bug in the Chat Improvements userscript
 
Did you manually adjust the margin to be that small size using userscript? if not, why is it different for you? Or if so, why not make it a just big enough to accommodate your original name?
 
@Deadcode Nope, it's just like that. I am on a fairly small laptop screen, so my chat window is pretty cluttered
 
Oh, right, of course. It adjusts the margin to be some percentage of the total width.
 
8:37 PM
 
Ah, totally makes sense now. At 100% zoom, the window width needs to be ≥ 2143 pixels to not mess with your name.
 
@cairdcoinheringaahing Interesting that for me without userscripts, the diamond is after coinheringaahing, while for you, both diamonds are after caird
 
Interestingly enough, this is what it looks like for me when I enter an incognito window (logged out, no userscripts):
 
9:03 PM
yeah the chat window is always a bit too small for usernames on my laptop
 
It used to show my full username + pronouns with only a slight gap below, but then I had to go and get elected as a mod
 
@cairdcoinheringaahing I see basically this but only one diamond
Next to longer messages where there's more room, though, it looks like this:
 
9:22 PM
well i've just made a stylesheet to fix it so that is nice
 
9:32 PM
what's the usual time people wait before posting a sandbox challenge to main
 
Firstly,
8
A: Is OK to post a challenge for a sandbox post with 0 votes but is 1 week old

caird coinheringaahin gPost Sandbox challenges when they're ready to be posted, not based on score or time The reason score/time are recommended (e.g. wait a week, have a positive score etc.) is because these are usually good ways of measuring if your challenge idea will do well. For example, a negatively scored Sandbo...

@Jacob Secondly, what's the challenge?
 
it's nothing special, i posted it on sandbox yesterday and it got 3 upvotes
i just want to know how long people usually wait
i don't need to post it immediately lol
 
9:47 PM
@Jacob I wait one week.
 
10:01 PM
i seem to remember being told to wait a day or two if there’s no comments
 
10:15 PM
A good rule of thumb is to wait a few days, ask for feedback, then if you don't get any, wait a couple more days and post
@NewPosts CMC: Find two distinct integers x, y such that x◊y = y◊x. Alternatively, prove that no such integers exist
A quick geometric examination makes me think that no such pair exists, but I'm not sure how to prove it
 
... What is ◊?
 
APL statement sep.
 
@ATaco grambulation, defined in the replied-to new post
 
10:36 PM
since converting a number to its coordinates is a bijection and you can easily convert f'(x)<>f'(y) into a vector formula, couldn't you then easily prove that x<>y == y<>x would require 2f'(y)-f'(x) == 2f'(x)-f'(y) => f'(y) == f'(x) which is a contradiction if x =/= y since it's bijective
 
@cairdcoinheringaahing heheh imagine not constantly checking code golf way too many times each day :p
 
@hyper-neutrino It is not bijective, as it isn't injective: f(1, 2) = 11 = f(13, 12)
 
CMC Given Positive Integers N, B where B >= 2 determine the minimum number of digits in base B required t fully represent N.
 
that has to just be floor(log_B(N))+1, right? something involving a logarithm at least
 
@ATaco does convert-to-base length work?
 
10:45 PM
Probably, Never said it was a hard challenge :P
82,2 => 7
Bonus, Optimise for Speed.
 
Try it Online! in Vyxal for 2 bytes
Which is convert-to-base length
 
here's one: implement sqrt or log in Trilangle (integer + bitwise arithmetic only)
More seriously: when looking at challenges to introduce Trilangle with when I first created it, someone suggested to me a challenge to implement Heron's formula. Not exactly trivial in a language that only has integer arithmetic and no sqrt builtin
 
@ATaco ≢⊤ in extended dyalog apl too.
 
11:05 PM
In Swift, it's 1 byte shorter to use log, but that requires import Darwin/Glibc/CRT/etc
{String($0,radix:$1).count}
{floor(log($0)/log($1))+1}
 
@ATaco QBasic, 37 bytes:
INPUT n,b
WHILE n
d=d+1
n=n\b
WEND
?d
@Bbrk24 Ooh, log might work in QBasic actually
 
@DLosc What is \ ?
uh
formatting
 
@Bbrk24 Integer division
 
ah, I see
 
Help...I can't run apt update
Err:6 cli.github.com/packages stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
Ign:11 ppa.launchpad.net/deadsnakes/ppa/ubuntu lunar InRelease
Err:12 ppa.launchpad.net/deadsnakes/ppa/ubuntu lunar Release
  404  Not Found [IP: 185.125.190.52 80]
Get:13 ppa.launchpad.net/swi-prolog/stable/ubuntu kinetic InRelease [23.8 kB]
Err:13 ppa.launchpad.net/swi-prolog/stable/ubuntu kinetic InRelease
 
11:14 PM
577
Q: How do I fix the GPG error "NO_PUBKEY"?

AgmenorI added some extra repositories with the Software Sources program. But when I reload the package database, I get an error like the following: W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBK...

 
@DLosc Yep, 34 bytes:
INPUT n,b
?INT(LOG(n+.1)/LOG(b))+1
 
@Bubbler Already tried, only worked for one of the two
Ugh this but with any API owned by Google/AWS/...
How do they manage to overcomplicate stuff to such a point that it'd be easier to just write a web scraper from scratch
I just wanna automatically translate a sentence
 
11:29 PM
@DLosc Why +.1? Just to convert it to a float?
 
@cairdcoinheringaahing sorry, the bijection was the number to the grid coordinate
 
aaaand of course the translate API doesn't support API keys
You have to use OAuth
Why does Google hate people
I just wanna translate text
 
spin up selenium, enter text to google translate page, and grab the result
 
@hyper-neutrino ....that's still not a bijection
Wait, I'm an idiot
 
11:55 PM
Jun 26, 2022 at 5:25, by an idiot
As y'all can see, I'm an idiot
 
0
Q: Shortest distinguishable slice

JacobFor this challenge, a slice of a string is defined as an upper and lower index that can "cut" a piece of a string. All characters from the string in the range [start, end) are part of that slice. If the upper index exceeds the string's length, the overflow is ignored. For example, the (zero-index...

 

« first day (4447 days earlier)      last day (388 days later) »