Why does python2 output differs from python3 when comparing variables(objects?)
"is" operator behaves unexpectedly with integers
Mock a service while running a BrowserTest? I am trying to test the output of a controller that returns some information in a given page. This controller has a custom http client injected into it.  I want to create a BrowserTest that can navigate to a fake node, and then test for certain text or values. I also want to change the mock to return different values, so I can further test the output to account for those cases.  I tried:      $client = $this-&gt;getMockBuilder('\Drupal\mymodule\Client\AuthorizeClient')       -&gt;disableOriginalConstructor()       -&gt;getMock();     $client-&gt;expects($this-&gt;any())       -&gt;method('request')       -&gt;with('w12345', FALSE)       -&gt;willReturn([]);      $this-&gt;container-&gt;set('mymodule.auth_client', $client);   But I get errors in the test that refer to the original class, and not the one I am trying to replace. I looked around in the core but wasn't really able to find what I was looking for. Does it make sense to do this? Is there a way to do a Kernel test to test responses from the route in question? Spambots causing server crashes. How do I block them? Where do I ask where to ask? The IPA symbol for the labiodental flap (ⱱ) How to get class object's name as a string in Javascript? Atiyah-Macdonald, Exercise 5.4 I was having some trouble with the following exercise from Atiyah-Macdonald.     Let $A$ be a subring of $B$ such that $B$ is integral over $A$. Let $\mathfrak{n}$ be a maximal ideal of $B$ and let $\mathfrak{m}=\mathfrak{n} \cap A$ be the corresponding maximal ideal of $A$. Is $B_{\mathfrak{n}}$ integral over $A_{\mathfrak{m}}$?   The book gives a hint which serves as a counter-example. Consider the subring $k[x^{2}-1]$ of $k[x]$ where $k$ is a field, and let $\mathfrak{n}=(x-1)$. I am trying to show that $1/(x+1)$ could not be integral over $k[x^{2}-1]_{\mathfrak{n}^{c}}$.  I have understood why this situation serves as a counterexample. But I am essentially stuck at trying to draw a contradiction. A hint or any help would be great. Kali Linux: apt update returns "Hash Sum mismatch" error I'm experiencing exactly the same issue as described in this question: . Before you mark this as a duplicate however, I have tried the solutions posted there, as well as on numerous other sites, including:  sudo apt-get clean sudo rm -rf /var/lib/apt/lists/* sudo apt-get update   Editing /etc/apt/sources.list with alternate official mirrors, such as  deb http://mirrors.ocf.berkeley.edu/kali kali-rolling main non-free contrib or deb https://http.kali.org/kali kali-rolling main non-free contrib  Everything worked after I first imported the VM. I ran sudo apt update and it found some ~650 packages to upgrade. I ran sudo apt upgrade and it encountered an error partway through. That error was solved using sudo apt --fix-broken install, but that is when this hash sum error began. Unfortunately due to hours of troubleshooting I no longer have the details of the earlier error, but I believe it was an error extracting a package due to corrupt data.  I've tried multiple official mirrors, but I get the same error. Additionally, when I downloaded the Packages.gz file  on my Windows machine (VM host) and computed the SHA256 hash, I got the exact hash that apt printed as the expected value. This led me to believe that the error was not with the mirror but with my VM.  The next thing I tried was wget https://mirrors.ocf.berkeley.edu/kali/dists/kali-rolling/main/binary-amd64/Packages.gz followed by sha256sum Packages.gz, which provided yet another different hash output.  To be clear, I have seen 3 different hashes for the same file:   The "correct" hash shown by apt as expected, which is the one that windows also produced after downloading the file using a browser The incorrect hash calculated by apt, which led to the error A different hash calculated by sha256sum after downloading the file using wget using the same URL as for the browser download   I should also note that I have only been referencing the SHA256 hash in each step. The other hash functions are also mismatched when I run sudo apt update, but the file size is the same. I had considered that downloads might be failing due to limited disk space (it is a VM after all) but I don't think that's the case.  What am I missing? Include the "People Reached" and "Helpful Flags (count)" data in SEDE I know the new profile design hasn't been updated for  on the network yet, so maybe this is a bit too early. Nonetheless, please include the &quot;People Reached&quot; data in  at your earliest convenience. Also, I was just made aware that users helpful flag counts are now publicly displayed on their  towards the top-right, underneath the people reached stat. So please include this data in SEDE as well. Avoid large spaces between text and equations I use the options  \renewcommand{\baselinestretch}{1.25} \setlength{\parskip}{0pt} \setlength{\parindent}{0pt}    in the preamble of my document and most of the time the document looks like intended. Once in a while though, especially when I use multiline-equations, I get huge spaces right before and after the equation and the surrounding text, for example:    Is there any way I can avoid that without removing the \parskip option? I am currently learning electromagnetism and I am getting really annoyed using a physical hand to accomplish the right hand rule. I get it, i've seen diagrams, and i've solved problems with it but still somehow I mess up because I bend a finger or twist my wrist a strange way. I am tired of using my hand.  So my question is can I find an entirely mathematical basis for this?  Lets say for any given diagram I define the positive $x$ axis as going to the right, the positive $y$ axis as going up and the positive $z$ axis as going into the page. Then I just did unit vectors for everything to determine the missing component?  As I understand it $\vec{F} = q (\vec{V}\times\vec{B})$ and with that definition I am confident I could find out the direction of the electric field given the velocity of a particle of charge and the magnetic field but how can I re-arrange this so I can solve for other variables? For example what does $\vec{B}$ equal in terms of a cross product involving $\vec{V}$ and $\vec{F}$? Debugging with command-line parameters in Visual Studio I'm developing a C++ command-line application in Visual Studio and need to debug it with command-line arguments. At the moment I just run the generated EXE file with the arguments I need (like this program.exe -file.txt) , but this way I can't debug. Is there somewhere I can specify the arguments for debugging? How Do I Compute the Eigenvalues of a Small Matrix? If I have a $2\times 2$ or $3\times 3$ matrix, how should I go about computing the eigenvalues and eigenvectors of the matrix?  NB: I am making this question to provide a unified answer to questions about eigenvalues of small matrices so that all of the specific examples that come up can be marked as duplicates of this post. See . php String Concatenation, Performance In languages like Java and C#, strings are immutable and it can be computationally expensive to build a string one character at a time.  In said languages, there are library classes to reduce this cost such as C# System.Text.StringBuilder and Java java.lang.StringBuilder.  Does php (4 or 5; I'm interested in both) share this limitation?  If so, are there similar solutions to the problem available? When I use a multiclass move to choose Animal Companion, do I get Command for free? How can one derive Schrödinger equation? Typing strange letters¿ w/o numpad? How do i type ♣ (alt+5) and ♥ (alt+259) and other characters like it on a keyboard w/o a numberpad? using the numbers 1-9-0 doesnt activate those characters. Note i want to TYPE and not use that windows program to select/copy/paste Please give me feedback on my answer to this question. Question: For all $ n\geq1:\binom{2n}{0}+\binom{2n}{2}+\binom{2n}{4}+\cdots+\binom{2n}{2k}+\cdots+\binom{2n}{2n} $   is equal to $ \binom{2n}{1}+\binom{2n}{3}+\binom{2n}{5}+\cdots+\binom{2n}{2k+1}+\cdots+\binom{2n}{2n-1} $. Answer: False, since;  Let $a=1,  b=-1$  and $n=1$  ,$k=0$   , using Binomial expression.  $$(a+b)^n=  \sum   \binom{n}{k}  a^{k}b^{n-k}$$  Then $(1+-1)^{2(1)}=\binom{2}{0}1^{0}(-1)^{2-0}+\binom{2}{1}1^{1}(-1)^{2-1}+\binom{2}{2}1^{2}(-1)^{2-2}=\binom{2}{0}-\binom{2}{1}+\binom{2}{2}$  Thus :For all $n\geq1:  \binom{2n}{0}+\binom{2n}{2}+\binom{2n}{4}+\cdots+\binom{2n}{2k}+\cdots+\binom{2n}{2n}   \ne \binom{2n}{1}+\binom{2n}{3}+\binom{2n}{5}+\cdots+\binom{2n}{2k+1}+\cdots+\binom{2n}{2n-1}$  . Cannot turn Bluetooth off I continue to find it amazing that something as “bulky” and macroscopic as a static magnetic or electric field is actually a manifestation of virtual photons.  So putting on your QFT spectacles, look closely at the space near the pole of a powerful magnet – virtual photons! Now look between the plates of a charged capacitor – virtual photons again!   But if it’s all virtual photons, how do we get the difference between a magnetic and electric field?  [This question needs the tag "magnetostatics" as well]. How exactly do automatic updates work? I received an email this morning stating that my Wordpress site had been automatically updated to the latest version. I knew about the feature but I've always wondered exactly how it works.  PHP isn't a permanently-running process: it only runs when requested. So as far as I can tell, Wordpress can only update itself when someone loads a web page. But the update process is not instantaneous, so surely a user visiting the site would have a really slow page load.  Is there a different trick they use for automatic updates? I've searched all over the place but haven't found any explanation.