I am implementing a scenario where user inputs an numeric answer in the edit text, which is being compared with addition of two numbers while inputting text using addTextChangeListener. I am trying to calculate true and false counters. I get true counters perfectly in below code.   etTestAddAnswer.addTextChangedListener(new TextWatcher() {                 @Override                 public void beforeTextChanged(CharSequence s, int start, int count, int after) {                  }                  @Override                 public void onTextChanged(CharSequence s, int start, int before, int count) {                     if (etTestAddAnswer.getText().toString().length() == (String.valueOf((firstDigit + secondDigit)).length())) {                         if (etTestAddAnswer.getText().toString().equalsIgnoreCase("")) {                             etTestAddAnswer.setError("Left Blank");                             YoYo.with(Techniques.Wobble)                                     .duration(750)                                     .playOn(tlTestAddAnswer);                         } else {                             if (Integer.parseInt(etTestAddAnswer.getText().toString()) == (firstDigit + secondDigit)) {                                 correctCounter += 1;                                 etTestAddAnswer.setText("");                                 Toast.makeText(AdditionTestActivity.this, "Correct", Toast.LENGTH_SHORT).show();                                 if (finalCounter &lt; 10) {                                     initGame();                                 } else {                                     testAddTime.cancel();                                      //Toast.makeText(AdditionTestActivity.this, "True Answer :" + correctCounter + "\n" + "Wrong Attempts" + falseCounter + "\n" + "Time " + toolbarTimeTestAddition.getText().toString(), Toast.LENGTH_SHORT).show();                                 }                             } else {                                 YoYo.with(Techniques.RubberBand)                                         .duration(750)                                         .playOn(tlTestAddAnswer);                                 etTestAddAnswer.requestFocus();                                 falseCounter += 1;                                 Log.d(TAG, "False Answers: " + falseCounter);                                 etTestAddAnswer.setError("False Answer, \n Try Again..!!");                             }                          }                      } else if (etTestAddAnswer.getText().toString().length() &gt; (String.valueOf((firstDigit + secondDigit)).length())) {                         YoYo.with(Techniques.RubberBand)                                 .duration(750)                                 .playOn(tlTestAddAnswer);                         etTestAddAnswer.requestFocus();                         Log.d(TAG, "onTextChanged: " + falseCounter);                         //falseCounter++;                         etTestAddAnswer.setError("False Answer, \n Try Again..!!");                     }                 }                  @Override                 public void afterTextChanged(Editable s) {                  }             });   But the false counter is incorrect. Like if i am on fifth question and give my first wrong input, the false counters log is like this:  1 2 3 4 5   It should only increment one. Any ideas??
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
How to get a function name as a string? In Python, how do I get a function name as a string, without calling the function?  def my_function():     pass  print get_function_name_as_string(my_function) # my_function is not in quotes   should output "my_function".  Is such function available in Python? If not, any ideas on how to implement get_function_name_as_string, in Python? How to answer questions in a conference talk that I should know the answer to, but don't? Picklist dependent on 2 controlling picklist Deciding what answer to accept: the correct one-liner or the later elaborate one with code? Lately I've been getting some good answers to some specific questions. However, I've been hesitating on what answer I should accept.  Do I go with the short quick answer or do I accept a later answer where someone has elaborated on the previous answer with some code?  It's not really important but it kind of bugs me to not accept an answer when people have taken the trouble of replying.  Here's two examples: I have a realm with a few of my friends and i want to play the creeper primed sound at him but i am afraid he will see the command and ignore it  Im using: /playsound minecraft:entity.creeper.primed block  Version: 1.14.2 New rule preventing multiple @notifies causing Convert to Comment to fail Apparently, an image is not worth a thousand words, as without at least a few words this won't meet quality standards. How to prove $x^{n}$ is not uniformly continuous How to prove $x^{n}$ is not uniformly continuous on the interval $[0, +\infty)$? Does the English language have an official Academy? For some languages, there are academies that decide topics such as grammar and spelling of things, for example, for the Spanish language, there are 22 academies in 22 different countries, all making decisions on spanish grammar in their country. I would like to know if there is something that serves the same purpose for the English language. Does the Symmetric difference operator define a group on the powerset of a set? $G$ is the set of all subsets of a set $A$, under the operation of $\triangle\;$: Symmetric Difference of sets.  $A$ has at least two different elements.  I need to check if this is a group, and if it does to show if the group is abelian and/or finite.  Associativity - easy from Symmetric Difference. Identity element - empty group. Inverse element - each element is inverse to itself. Am I right?  abelian? finite? Most people know the famous equation:    What were his steps of thinking for this equation that helped us discover so much about our world? Ubuntu 16.04 slow boot (apt-daily.service) My boot is horribly slow, and I don't know why.  $ systemd-analyze  Startup finished in 10.975s (kernel) + 49.732s (userspace) = 1min 708ms $ systemd-analyze blame           34.971s apt-daily.service          20.590s snapd.refresh.service          17.113s grub-common.service          16.033s apport.service          16.027s networking.service          15.894s ondemand.service          15.860s irqbalance.service          15.655s speech-dispatcher.service          11.695s ModemManager.service           9.772s accounts-daemon.service           8.626s NetworkManager-wait-online.service           8.058s systemd-logind.service           8.053s bluetooth.service           7.944s gpu-manager.service           7.896s alsa-restore.service           7.892s pppd-dns.service           7.882s rsyslog.service           7.860s avahi-daemon.service           7.844s dev-sda1.device           7.842s systemd-user-sessions.service           7.648s lightdm.service           7.610s teamviewerd.service           6.445s apparmor.service   Also, during boot-up, I see a message that says something like:  device descriptor read/all, error -62 ata1 softreset failed (device not ready) #most of the times error loading journal #(sometimes) Test WP failed, assume Write Enabled Asking for cache data failed     #most of the times Assuming drive cache: write through   apt-daily.service slows the boot the most. Any idea on how to tackle that?  I have Ubuntu MATE 16.04. Conceptual half-life Question So I have this word problem and I’m a bit confused about it. I have the answer and explanation but I still don’t understand: The half-life of carbon-14 is approximately 5730 years, while the half-life of carbon-12 is essentially infinite. If the ratio of carbon-14 to carbon-12 in a certain sample is 25% less than the normal ratio in nature, how old is the sample?     A. Less than 5730 years      B. Approximately 5730 years      C. Significantly greater than 5730 years, but less than 11460 years      D. Approximately 11460 years  Correct Answer: A Explanation: Because the half-life of carbon-12 is essentially infinite, a 25 percent decrease in the ratio of carbon-14 to carbon-12 means the same as a 25 percent decrease in the amount of carbon-14. If less than half of the carbon-14 has deteriorated, then less than one half-life has elapsed. Therefore, the sample is less than 5730 years old. Be careful with the wording here—the question states that the ratio is 25% less than the ratio in nature, not 25% of the ratio in nature, which would correspond to choice (D). How is the ratio of the carbon isotopes relevant to half-lives? What is the purpose of saying the half-life of an isotope is infinite? What is meant by “the normal ratio in nature”? Just based on the answer, it seems like the question said “25% of a carbon sample decayed, how old is this sample?” Obviously it’s younger than 5,730 years (the time for its first half life) because if only 25% decayed that means half a half-life has passed. I don’t see how isotopes and ratios would change this problem at all. Edit: Every answer here was very informative and helpful. It was tough to pick a best answer. I picked Cosma’s because it clicked with me. If you’re reading this and want to understand radiocarbon dating, look at every answer because there is some useful information in every answer What is the word for the emotion I feel when I see someone being humiliated? When I see someone else being embarrassed / humiliated, for example a singer forgetting their words in a concert, I would say something like "I feel embarrassed for them". But is there a better word to describe this feeling?  I would say it's a mix of:   Empathetic discomfort for someone else's humiliation Tension; hope that spectators will be forgiving Frustration that I cannot help them   Other scenarios I would feel the same emotion:   Seeing someone make a presentation, the slides are all out of order, and their face gets red with embarrassment while there's a tense silence in the room. Seeing someone make an embarrassing social blunder in front of unforgiving people. Seeing a speaker who keeps making a distracting and annoying gesture, and they don't realize that the whole audience is annoyed. Seeing someone be taken advantage of, like seeing someone naively and happily accept a terrible offer on a car. Seeing a person of strong image (for example the CEO of your company) do something like accidentally leave their webcam on after a conference call, and employees see him/her let out a big burp and pick their nose or something.   In these cases it's important that the audience is not forgiving, even if they don't confront the person about it. The person may or may not know they are being humiliated.  "Pity" as proposed in an answer seems very close, but I think it lacks a few components. I think "pity" has a chronic connotation - that you are referring to the general state of things rather than a specific event.  I think "pity" also depends on the subject suffering, but in my example they are often oblivious.  It could very well be that there is no word for this at all.  NOTE: Some people do not feel the same way I do in this scenario, so you may not think this question makes any sense. Same question listed twice in reputation list This might not be a bug but I see the same question list twice in my reputation display, I know it is grouping things by a six hour difference, but is this really expected?    The first list says 2 events but shows all 5, similarly the second list says 3 events and shows all five. Why is it that Frisian is considered the closest related language to English? It is commonly asked "What is the closest language to English?" and the equally common answer is         Except that there is rarely a reason given for this connection; the most that is given are baldly stated 'facts' (e.g. "English and Dutch are in the same 'Low German' group")  Can anyone give any substantive reasons? For example, an comparative overlap of vocabulary, a distance metric of phonology, privately shared syntactic rules among all the rules in West German languages. When overriding equals in Java, why does it not work to use a parameter other than Object? I ran into an interesting behavior recently.  It seems that if I override .equals() to take a parameter other than Object, it doesn't get called.  Can anyone explain to me why this is happening?  It seems to violate my understanding of polymorphism in OOP, but maybe I'm missing something.  Here's much simpler code that shows what I'm seeing:  public class MyClass {   private int x;   public MyClass(int n) { x = n; }   public boolean equals(Object o) { return false; }   public boolean equals(MyClass mc) { return x == mc.x; }   public static void main(String[] args) {     List&lt;MyClass&gt; list = new ArrayList&lt;MyClass&gt;();     list.add(new MyClass(3));     System.out.println("Contains 3? " + list.contains(new MyClass(3)));   } }   When this is run, it prints "Contains 3? false".  It looks like the equals(Object) function is called, even though there is another that would work.  By contrast, if I write equals like this the code works as expected:  public boolean equals(Object o) {   if(!(o instanceof MyClass))     return false;   MyClass mc = (MyClass)o;   return x == mc.x; }   Why isn't it figuring out which version of the function to call based on the type of the parameter? Artinian affine $K$-algebra I got this question in homework:     Let $\{0,1\}^A$ the set of all functions from A (not necessarily a finite set)       to $\{0,1\}$. Find a correspondence (function) between $\{0,1\}^A$ and       $\mathcal P(A)$ (The power set of $A$).       Prove that this correspondence is one-to-one and onto.   I don't know where to start, so I need a hint. What does it mean to find a correspondence? I'm not really supposed to define a function, right?  I guess once I have the correspondence defined somehow, the proof will be easier.  Any ideas? Thanks! How to start a background process in Python? "invalid EFI file path" while booting Windows