Proving that $x^5 = x \pmod{10}$ for every integer $x$.
Why is the last digit of $n^5$ equal to the last digit of $n$?
Should import statements always be at the top of a module? states:  Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.  However if the class/method/function that I am importing is only used in rare cases, surely it is more efficient to do the import when it is needed? Isn't this: class SomeClass(object):      def not_often_called(self)         from datetime import datetime         self.datetime = datetime.now()  more efficient than this? from datetime import datetime  class SomeClass(object):      def not_often_called(self)         self.datetime = datetime.now() another balls and bins question I've seen many variations of this problem but I can't find a good, thorough explanation on how to solve it. I'm not just looking for a solution, but a step-by-step explanation on how to derive the solution.  So the problem at hand is:   You have m balls and n bins. Consider throwing each ball into a bin uniformly and at random.    What is the expected number of bins that are empty, in terms of m and n? What is the expected number of bins that contain exactly 1 ball, in terms of m and n?   How would I approach solving this problem?  Thanks! How to find the URLs accessed by iOS Apps? pip: AttributeError: 'module' object has no attribute 'SSL_ST_INIT' Why should I avoid multiple inheritance in C++? Is it a good concept to use multiple inheritance or can I do other things instead? Explain $\iint \mathrm dx\,\mathrm dy = \iint r \,\mathrm \,d\alpha\,\mathrm dr$ It is changing the coordinate from one coordinate to another. There is an angle and radius on the right side. What is it? And why?  I got:  $2\,\mathrm dy\,\mathrm dx = r(\cos^2\alpha-\sin^2\alpha)\,\mathrm d\alpha \,\mathrm dr$,  where $x = r \cos(\alpha)$ and $y = r \sin(\alpha)$.  but cannot understand and get the right side. The problem emerged when trying to integrate $\displaystyle \int_0^\infty e^{\frac{-x^2}{n^2}}\,\mathrm dx$ where I tried to change the problem knowing $r^2=x^2+y^2$ but stuck to this part. What is the change in the title called and why is it so? Is $\{\emptyset\}$ a subset of $\{\{\emptyset\}\}$? How to store lots of small text in a SQL Server database? How would you explain why $e^{i\pi}+1=0$ to a middle school student? Hi I was asked by a friends child who is in middle school why $e^{i\pi}+1=0$. Now I couldn't think of a way to explain it so he would understand. Albert Einstein once said “If you can't explain it simply, you don't understand it well enough” so how would I explain it. Autofill feature isn't iterating numbers properly when using the AVERAGE() formula in Microsoft Excel Can current be induced in a superconductor? The layman's question. Is there a maximum temperature that can be reached by air on Earth due to global warming? For example, one that would prevent living organisms from functioning? I read somewhere that with the increase of the sun's brightness by 10%, the average temperature on our planet will be 47 C. This, however, only for about 600 million years. Would global warming enable reaching such a high average temperature? List files sorted by the number of lines they contain equivalent norms in Banach spaces of infinite dimension Suppose $ X $ is a Banach space with respect to two different norms, $ \|\cdot\|_1 \mathrm{ e } \|\cdot\|_2 $. Suppose there is a constant $ K &gt; 0 $  such that $$ \forall  x \in X, \|x\|_1 \leq K\|x\|_2 .$$ show then that these two norms are equivalent How to detect if a function is called as constructor? Given a function:  function x(arg) { return 30; }   You can call it two ways:  result = x(4); result = new x(4);   The first returns 30, the second returns an object.  How can you detect which way the function was called inside the function itself?  Whatever your solution is, it must work with the following invocation as well:  var Z = new x();  Z.lolol = x;  Z.lolol();   All the solutions currently think the Z.lolol() is calling it as a constructor. Can I ever play Undertale again normally? The ending I got is :      the genocide   When I reset my file, my past choices still take effect. I want to start a clean run.  I don't want to buy the game again, what do I do? Plotting recursive function using pgfplots \addplot Is it possible to plot a recursive function using pgfplots \addplot command?  I tried like this;  \documentclass{article} \usepackage{pgfplots}  \pgfmathdeclarefunction{fac}{1}{   \pgfmathparse{(#1&lt;=1)+                 (#1&gt;1)*#1*fac(#1-1)   } }  \begin{document} fac(5) is \pgfmathparse{fac(5)}\pgfmathresult  \end{document}   But the result seems to be an infinite recursion, as the entire function is being evaluated. I have a scenario where I have multiple threads adding to a queue and multiple threads reading from the same queue. If the queue reaches a specific size all threads that are filling the queue will be blocked on add until an item is removed from the queue.  The solution below is what I am using right now and my question is: How can this be improved?  Is there an object that already enables this behavior in the BCL that I should be using?  internal class BlockingCollection&lt;T&gt; : CollectionBase, IEnumerable {     //todo: might be worth changing this into a proper QUEUE      private AutoResetEvent _FullEvent = new AutoResetEvent(false);      internal T this[int i]     {         get { return (T) List[i]; }     }      private int _MaxSize;     internal int MaxSize     {         get { return _MaxSize; }         set         {             _MaxSize = value;             checkSize();         }     }      internal BlockingCollection(int maxSize)     {         MaxSize = maxSize;     }      internal void Add(T item)     {         Trace.WriteLine(string.Format("BlockingCollection add waiting: {0}", Thread.CurrentThread.ManagedThreadId));          _FullEvent.WaitOne();          List.Add(item);          Trace.WriteLine(string.Format("BlockingCollection item added: {0}", Thread.CurrentThread.ManagedThreadId));          checkSize();     }      internal void Remove(T item)     {         lock (List)         {             List.Remove(item);         }          Trace.WriteLine(string.Format("BlockingCollection item removed: {0}", Thread.CurrentThread.ManagedThreadId));     }      protected override void OnRemoveComplete(int index, object value)     {         checkSize();         base.OnRemoveComplete(index, value);     }      internal new IEnumerator GetEnumerator()     {         return List.GetEnumerator();     }      private void checkSize()     {         if (Count &lt; MaxSize)         {             Trace.WriteLine(string.Format("BlockingCollection FullEvent set: {0}", Thread.CurrentThread.ManagedThreadId));             _FullEvent.Set();         }         else         {             Trace.WriteLine(string.Format("BlockingCollection FullEvent reset: {0}", Thread.CurrentThread.ManagedThreadId));             _FullEvent.Reset();         }     } } I am a dual Australian/British citizen with an expired emergency Aussie passport and a valid UK passport. What are my chances for an Aussie visit? I was going to have to miss my brother's wedding on Jan 4th but he bought me a flight today. But my Aussie passport is expired and was only an emergency passport to begin with. I'm born and bred Aussie, just been away for ten years. I'm hoping to arrive on UK passport, show the expired Aussie one and the wedding invite and my return ticket for two weeks later and hope they understand.   What are my chances? Also planning on going to the Aussie embassy on Monday to see what they say but want to know my chances of just entering on a UK passport. A projection operator $P$ is defined as $P^2$=$P$. Use this definition to find the eigenvalues of this operator.   In this question is it necessary to define what the projection operator is? And won't the eigenvalue just be zero?