also, did you know that all parabolas are translated scaled versions of y=x²? (note that scaling has to be uniform, not stretching in a single direction)
I made a really cool tool a few days ago, you enter a regex and it returns the average score, close percentage, etc. of questions whose body or tags match it
All integers \$n > 0\$ can be expressed in the form
$$n = \prod_{\text{prime } p} p^e = 2^{e_2} 3^{e_3} 5^{e_5} 7^{e_7} \cdots$$
This form is also known as it's prime factorisation or prime decomposition, and each integer has a unique prime factorisation.
As the bases are fixed, it is possible to...
Plus ^ being used for bitwise xor in C-like languages
I kind of figured you were joking when it came to the exponentiation part but then it'd be worse if you weren't
Anyway I'm going to go back to making performance optimizations to a program that will sit on my hard drive for ten years then get forgotten and deleted by mistake
The challenge is to reproduce an image close to this one in your favorite language:
Your image must be at least 400 by 400 pixels.
The fill colors don't need to be the same as in the image but they must be different from each other.
Your image must have four quarter circles aligned as in the im...
I was asked by OEIS contributor Andrew Howroyd to post a Code Golf Challenge to extend OEIS sequence A049021.
Would be super great to get a couple more terms for [...] A049021. Kind of thing [...] team golf would excel at.
As I found out the hard way with the help of user202729, the definition ...
(@cairdcoinheringaahing What's unclear with the topo challenge?
Just going to post my idea for the square root multiplies challenge here. Doesn't involve continued fraction however.
#!/bin/python
import random, math, sys, itertools
from gmpy import mpz as Z
def f(n):
from math import isqrt
k = Z(2)
while k.sqrt()**2==k or ((n + 1)**2*k).sqrt()//k+1 - (n**2*k).sqrt()//k < 2:
k += 1
return k
if 0: # naive
best=0
for n in range(1, 10**9):
fn=f(n)
if fn>best:
best=fn
print(n, f(n))
raise 1
if 0:
import decimal
from decimal import Decimal
decimal.DefaultContext.prec=10000
from typing import List, Tuple, Dict, Optional
values: List[Z]=[
#Z(1)<<i for i in range(2000)
No explanation.
Not as efficient as I've expected, but a 100x (or even 10x) speed up is okay.
Voting to close because of the edit "as user 202729 pointed out..." It looks to me that to get from one to the other you have to slide through the point where the Northwest rectangle forms a 4-way corner with the rectangles East, South and Southeast of it. Also, if these two are equivalent, why aren't the 5th and 2nd examples for n=4 equivalent? Extend the west rectangle till it fills the whole west side, then rotate 90 deg. I think this needs clearer definition. — Level River St2 days ago
Specifically the “Also, if these two are equivalent, why aren't the 5th and 2nd examples for n=4 equivalent?”
NOTE: Some terminology used in this challenge is fake.
For two integers n and k both greater than or equal to 2 with n > k (strictly), n is semidivisible by k if any only if n/k = r/10 for some integer r. However, n may not be divisible by k. Put more simply, the base 10 representation of n/k has...
@user202729 In my mind, no, I still don't understand the challenge, even after reading your explanation (which is why I still CV'ed). It may be that I don;t actually understand the challenge at all, rather than "I think I understand this, but there's a couple of unclear points", which is what I believe now. Because it's unclear whether its unclear or not, in my mind, that makes it unclear
@user202729 So, here's the contentious point IMO: "Does every challenge have to be 100% accessible to all to avoid being labelled as 'unclear'?" My answer to that is no, and I think we agree on that point. However, for this challenge, the issue is that I think that I do understand the mathematical concepts behind it. Perhaps not as well as all, or even most, but I think I do have a grasp on the concepts. Even with my knowledge of the challenge, I think there are some areas that need (cont)
(cont) clarity (namely what was brought up in Level's comment). Now the issue is, I'm not fully sure if these bits are unclear to me because either: (1: I actually don't understand as much as I thought I did) or (2: the challenge is actually unclear in those areas). Because of this, I cast a VTC as unclear, assuming I do actually know what I think I know (the OP VTCing as well helped me make this assumption). If, however, people disagree with me and VTRO and RO the question, I really don't mind
Just my 2 cents on the matter
This is probably one of the few questions where I can't leave a comment explaining how I think the challenge can be fixed, because I'm not 100% certain I actually understand it enough to weigh in that significantly, and I'm happy to leave the discussions to those who are 100% certain on it
@user202729 I'd suggest saving both your time and mine; I no longer care what happens with that challenge, so I'm very unlikely to cast a reopen vote, simply because I no longer have the motivation to fully clarify it for myself
Asking Peter why he cast a VTC might be a good start to getting it reopened - it's rare that an OP VTCs their own question, and even rarer to have that VTC not be a dupe close
Some people call it unfriendly, but with all the things the company has been doing, it's best to avoid that term (?)
I'll say the same thing about the recent tips question. After op explained the 200x200 canvas size, it still get closed in the reopen queue (and roomba'ed now)
@user202729 That's understandable, and I do agree that we close too many questions far too quickly. But, as I said, I'm basically ambivalent to that specific challenge, mainly due to the complexity and my lack of confidence in the subject matter
@user202729 That could do with being made more explicit that the OP is asking for tips on how to golf their code. RN it reads as a Python exclusive code golf challenge, and if it is that, it's far too underspecified
@user202729 Yeah, but the question itself doesn't look like a tips question, it looks like the questions from 2011 along the lines of "Do X. This is my attempt btw [code-golf] [python] etc."
The OP has edited one thing in since first posted, and that doesn't make it look any more like a tips question. It should explicitly say in the question: "I'm doing X. Here are the specific specs that must be followed (Y, Z, etc.). My attempt so far is P. How can I shorten it?"
Even the title suggests it's more a code-golf challenge than a tips page: "What is the shortest possible program to make a checkerboard in python using Tkinter?"
@user202729 Yeah, that's a problem. I do try to do that when I can, but sometimes I forget/can't (the app is awful for comments)/expect someone else to do it because I've already done it to 10 other questions that day
Adapted from Tips for restricted source in Python
Just like code-golf, restricted-source pushes one to exploit quirks and hidden features of the Powershell language. Now, We already have a place to collect all these tips for code-golf, those for restricted-source remain transmitted by word of m...
Draw four colorful quarter circles
The challenge is to reproduce this image in your favorite language:
Your image must be at least 400 by 400 pixels.
The fill colors don't need to be the same as in the image but they must be different from each other.
Your image must have four quarter circles a...
@cairdcoinheringaahing thanks. It's frustrating because the moment I posted it people had very strong opinions but I am not sure they will ever comment on the sandboxed version
how can I grep for lines that start with either a capital or lower case letter and everything else is a lower case letter?
Converting my deleted comment into an answer for more visibility
While this is a popular idea (and something I personally support), changing this isn't going to happen, but there is an easy way around it.
This is actually a common idea over on Mother Meta (see here from 2010 or here from 2009). H...
Screenshot
About
The vote counts are a great tool to determine whether an answer is disputed or not. Unfortunately, not many of us have enough time to join all Stack Exchange websites and get 1000 reputation.
This script unlocks the "View Vote counts" feature for those who are not logge...