Questions tagged [canonical]
is for questions about canonical questions or answers, i.e. those often used or referred to.
188
questions
109
votes
2
answers
8k
views
Questions about thread+loop not working without print statement
Consider the following scenario in Java:
A developer has written a loop that waits for some state to be changed from a different thread.
The loop doesn't seem to see the change.
The developer adds a ...
75
votes
4
answers
3k
views
What to do about hundreds of the same basic question?
For the umpteenth time someone asked the question "what does 'str object is not callable' mean?" with the tag [python]. This is a very common error for newbies, so it just gets asked over and over and ...
72
votes
6
answers
2k
views
Canonical duplicate for "floating point is inaccurate"
The question of "why is my floating point operation coming up as 0.0999999999999784" comes up really frequently. Usually we just leave a link to What Every Computer Scientist Should Know About ...
72
votes
3
answers
1k
views
Making canonical answers easier to find
How can we make canonical answers easier to find, especially from the review queue?
I was stumbling upon many Java questions with ArrayIndexOutOfBoundsException, being sure there must be some question ...
71
votes
2
answers
3k
views
Let's not strive to make all canonical questions a pain to make
I've noticed a rather disturbing trend revolving around canonical questions. It seems as though many people tend to think that canonical questions should be community wiki, that they should not award ...
67
votes
3
answers
1k
views
Deliberately opening duplicate questions as search targets
In the last year and a half I've answered almost 500 questions in the promise tag. We have a rather small community there and we like to open canonicals such as this one this one or that one. They ...
66
votes
3
answers
3k
views
"Duplicate questions" versus "RTFM"
I have added a question in my answer to iTextSharp - when extracting a page it fails to carry over Adobe rectangle highlighting important info
I don't want to sound frustrating, but I would really ...
63
votes
1
answer
788
views
Let me find canonical questions
Firstly some definition.
A “canonical question” is a question that is the “target” of at least 1 question that has been closed as a duplicate.
“Direct canonical weight” is the number questions that ...
59
votes
3
answers
1k
views
Process for nominating and promoting canonical questions
In the bash tag, we get a lot of duplicates. Off the cuff, I would speculate that 10-20% of all Bash questions are reiterations of maybe 50 common questions -- basic quoting, variables, syntax, ...
55
votes
3
answers
863
views
What to do about this deleted "canonical" question and its duplicates?
While looking at the result of my SEDE query for find duplicates of deleted questions, I noticed a rather large number of java questions about ArrayIndexOutOfBoundsExceptions that were all orphaned ...
51
votes
3
answers
1k
views
Canonical, language-agnostic question for if(var != "x" || var != "y" ...)
At least three times today I've seen questions about the following kind of if statement:
if (var != "x" || var != "y" || var != "z")
The most recent is Why is my if statement activating when it is ...
51
votes
1
answer
12k
views
What is a canonical question/answer, and what is their purpose?
Question:
What is a canonical question/answer, and what is their purpose?
Here is wikipedia's definition of "canonical":
Canonical is the adjective for canon, literally a 'rule', and has come to ...
47
votes
1
answer
1k
views
Canonical question needed: Java's infamous ArrayList(int n)
We've got a few dozen or so Java questions floating around that are of the form:
I've initialized my ArrayList with new ArrayList<Object>(50), but the size is 0! What's wrong with this?
......
45
votes
2
answers
902
views
Can we clean up Eclipse "Error: Could not find or load main class"?
Let me start by saying I don't know exactly what we should do here.
This search: [eclipse] "Could not find or load main class" is:question returns 104 questions. Note that the phrase is in quotes ...
44
votes
3
answers
808
views
What should I do about a lack of good canonical questions?
I have been growing increasingly annoyed by the lack of good canonicals and the number of bad questions that are commonly used as duplicate targets. (Sometimes because there's no better alternative, ...
43
votes
2
answers
1k
views
How to handle questions whose root cause is an already well-answered issue?
Debugging-help questions usually have this format:
I am trying to do stuff.
I wrote this code:
stuff code
But it does not do stuff, it goes bleh instead. What went wrong?
Sometimes the cause ...
42
votes
3
answers
934
views
Is this an acceptable canonical question and answer for a common Java exception?
I believe this is related to this question, but it appears that a question and answer have been proposed as a canonical resource for java.lang.ArrayIndexOutOfBoundsException. The asker of this ...
42
votes
0
answers
1k
views
17+ questions all on the same topic with no good answers
I have been trying to connect two computers together using Python and pass information between them. While I have a broad grasp of Python, my networking knowledge (stuff like public/private IP ...
41
votes
1
answer
2k
views
Canonical question for Java "resources in JAR"
Based on the community's positive response to my canonical question about Spring, I think it would be helpful to have a similar canonical about using classpath resources from JAR files or similar ...
40
votes
3
answers
2k
views
Is there a canonical duplicate for "how do I fix my ArgumentNullException" questions?
I was reviewing this question from the "first posts" queue. Since it's asking more or less "How to fix my ArgumentNullException?", I instantly thought this question could be closed ...
40
votes
0
answers
868
views
Canonical question about parsing mathematical expressions for duplicate closure
Is there any canonical question about parsing mathematical expressions1 with the proper tools and methods, which can be used for duplicate closure?
1 A somewhat OK answer should be able to parse an ...
40
votes
8
answers
2k
views
How can we handle a question where the problem in the title is different from the problem in the body, and OP refuses to change the title?
This is the post. The title has usually been "How do I calculate square root in Python?", but the body is actually about a problem that's specific to division in Python 2 (namely that 1/2 ...
38
votes
3
answers
713
views
How to handle questions closed as an incorrect duplicate
At least once a week, a user will ask a question on one of the asp.net-mvc sites as to why their model, or a property of their model is null when they submit their form back to the controller's action ...
37
votes
4
answers
2k
views
What to do with "programming" Qs that are actually just basic arithmetic/ratio questions?
There's a category of questions that are only titularly "programming" and are in fact just simple ratio or pre-algebra questions, example:
Transform rotation based on the "Minutes" (Unity ...
36
votes
1
answer
745
views
Can I self-answer a question in order to demonstrate a modern approach?
OK, let's say that there's an API. And in that API, there is a function. This function is critical for modern use of that API, so lots of people use it.
However, this function is woefully designed. ...
36
votes
1
answer
739
views
The topic area ".NET async/await/TPL" needs a canonical answer on cooperative cancellation
In the .NET space there has been a lot of interest in things like async, await and TPL in the recent years. A very common issue is that someone expects cancellation to be one of these:
immediate
pre-...
34
votes
1
answer
863
views
How can I add a canonical Q&A for a question that keeps showing up in similar forms?
I have been seeing a lot of questions come through in the Android tag recently that are all basically minor variants on the same core question.
These questions usually get answered with basically the ...
34
votes
2
answers
1k
views
How best to redirect all duplicates of "Why doesn't <Python string method> do anything unless you assign its result"?
What's the best way to create and name a primary source question to redirect the high volume of Python questions asking why calling a string operation doesn't change the string.
Naming this something ...
33
votes
8
answers
1k
views
Are canonical duplicates useful anymore?
To quote CodeCaster's answer from Is there a canonical duplicate for "how do I fix my ArgumentNullException" questions? :
Over the years I kinda grew against closing questions as those very ...
33
votes
1
answer
806
views
A canonical answer is not actually canonical; what to do?
C++ has this issue, which is called "most vexing parse". It is a never-ending source for duplicate questions. It seems that we don't have a canonical answer for that. But worse, we have a highly-...
32
votes
7
answers
2k
views
Creating the Windows 10 calendar in VBA Excel: can we allow broad and useful "canonical" self-answers?
This is concerning the question: How can I create the Windows 10 calendar in VBA Excel?
This question has 4 close-votes and a lot of upvotes. It is a self-answer that appears broad… until you realise ...
32
votes
2
answers
1k
views
What to do with all the questions about scanf?
You've probably seen it. The thousands of different questions where the solution is changing scanf("%c to scanf(" %c, that is, put a space before %c. At first it was funny, but I do get tired of it ...
32
votes
2
answers
712
views
How to organize the finding or writing and advertise the existence of canonical questions?
I know of a few questions that get asked and answered on a daily basis. For example in the C# tag:
How to read [this JSON] into a model?
How to read CSV data?
How to write CSV data?
Why doesn't my ...
32
votes
2
answers
601
views
Seeking Canonical: Non-returning PHP Recursion
I've scratched together a heap of open or suboptimally closed pages that are all resolved in the exact same way.
I would like to close them with a single canonical page that will best help researchers....
31
votes
2
answers
957
views
Canonical question on how to use parameterized queries in C#
I recently notice a lot of "Why doesn't my SQL statement work?" questions, where the cause of the problem is some improperly formatted (date) or improperly escaped (string) value.
Of course, we all ...
31
votes
7
answers
952
views
Canonical question for "=" typo for "=="
One of the most common errors that inexperienced programmers (and even some pros) make is using = when they mean == in a comparison
if (var = value) {
// do something
}
The most recent example ...
31
votes
1
answer
572
views
Deciding a Canonical Question for R: How to load packages automatically/ by default?
I suggest we need a canonical for this (it comes up all the time, let's merge the duplicates into it). Below are my suggestions on what are duplicates, and non-duplicates, and why; let me know what ...
30
votes
2
answers
906
views
Looking for a canonical answer to web development language relationships and flow
Over and over between PHP and JavaScript questions I see a lot of question askers who don't understand the difference between server-side and client-side code. I would really like to see a good answer ...
30
votes
4
answers
964
views
How can I title a question about a problem that doesn't have a common description?
Recently I wrote a self-answered question, addressing one certain problem, that causes a lot of questions on Stack Overflow that usually get wrongly closed with incorrect dupe target.
But got a ...
28
votes
4
answers
1k
views
What should be done with this specific highly upvoted question asking how to debug a Node.js application?
The following question has gathered a couple hundred thousand views and more than 800 upvotes:
How do I debug Node.js applications?
How do I debug a Node.js server application?
Right now I'm mostly ...
28
votes
1
answer
453
views
Canonical answer for PHP within JavaScript questions [duplicate]
If you're following the PHP tag you'll see multiple questions like this one coming up on a daily (sometimes even hourly) basis.
Those questions are most likely:
I include this PHP code into my ...
27
votes
1
answer
728
views
Should my canonical about read_clipboard usage in Pandas be on Meta or Main?
If you've ever tried answering questions in pandas, you'll know 90% of them cannot be answered unless the OP posts their data (or, at least a sample) that gives us an idea what they're working with ...
27
votes
1
answer
935
views
Is there a canonical question for a common misuse of `or` in Python?
Every few days, I see one or two questions like this:
Why is "bad answer" never printed?
answer = input("Yes or No").lower()
if "yes" or "no" in answer:
print("good answer")
else:
print("...
26
votes
1
answer
2k
views
Canonical Q/A for 'Module 'x' has no attribute 'y' in Python
This seems to come up quite a lot.
In Python, someone writes a script which has the same name as a module they want to import from it. The import succeeds, but when they try to access an attribute of ...
26
votes
3
answers
1k
views
What to do about off-by-one questions?
Is there anything we can do about the oft-experienced off-by-one error? I've noticed that a steady stream of questions from people who don't realize what the error means, and people who've made a ...
26
votes
1
answer
538
views
Canonical question for ArrayIndexOutOfBounds questions
I was just looking at this question here: Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 200 when I happened to notice it's rather interesting "Related" section:
The abundance ...
26
votes
4
answers
1k
views
Is there a canonical for passing callback functions in JavaScript?
There are a lot of questions within the javascript tag that have to do with passing callback functions wrong, for example doing this:
setTimeout(foo(), 3000);
Instead of, correctly:
setTimeout(foo, ...
25
votes
4
answers
780
views
Can anyone suggest a good generic "turn this JavaScript object to this JavaScript object" question for duplicates?
Basically I'm a bit fed up of questions along the lines of
Here's a JavaScript/JSON object I need to be this similar but slightly
different JavaScript/JSON object. Please can someone do this for ...
25
votes
0
answers
435
views
Is there a canonical jQuery $(document).ready() question?
One of the most common errors that jQuery programmers make is forgetting to put their code inside $(document).ready(function() { ... });. The most recent I noticed is JSFiddle script not working ...
24
votes
1
answer
680
views
Is there a canonical question for user-defined type guards in TypeScript?
I frequently see a question in the TypeScript tag where an asker does some logic that semantically should be enough to check that a given type supports a certain operation, but does not satisfy the ...