Here's what I'm doing now:  @memoized def reversed_matching(matching_cls):      class ReversedMatching(ReversedSequenceMatching):          def __init__(self, *args, **kwargs):             super().__init__(matching_cls, *args, **kwargs)      return ReversedMatching   I want to bind one argument of a class and return the “partial class”. I can't use  because that can't be used with  and  and the like. Is there a nicer way to write this?
How can I bind arguments to a Python method to store a nullary functor for later invocation?  Similar to C++'s boost::bind.  For example:  def add(x, y):     return x + y  add_5 = magic_function(add, 5) assert add_5(3) == 8
virtualbox crash on kernel 4.13.0-26 Ubuntu 16.04 LTS Virtualbox 5.0.40 ubuntu r 115130  Today after upgrading to kernel 4.13.0-26 guest vbox machines started to crash whole ubuntu. just hard poweroff is working.  If I startup with kernel 4.10.0-42 everything works fine.  what may be the problem ? Make mod_wsgi use python2.7.2 instead of python2.6? i am running Ubuntu 10.04.1 LTS  and it came pre-packed with python2.6 but i need to replace it with python2.7.2.   (The reason is simple, 2.7 has a lot of features backported from 3 )  i had installed python2.7.2 using  ./configure make make altinstall   the altinstall option installed it, without touching the system default version, to /usr/local/lib/python2.7 and placed the interpreter in /usr/local/bin/python2.7  Then to help mod_wsgi find python2.7 i added the following to /etc/apache2/sites-available/wsgisite  WSGIPythonHome /usr/local   i start apache and run a test wsgi app BUT i am greeted by python 2.6.5  and not Python2.7  Later i replaced the default python simlink to point to python 2.7  ln -f /usr/local/bin/python2.7 /usr/bin/python   Now typing 'python' on the console opens python2.7 but somehow mod_wsgi still picks up python2.6  Next i tried,  PATH=/usr/local/bin:$PATH export PATH   then do a quick restart apache, but yet again its python2.6 !!    Here is my $PATH  /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games   contents of /etc/apache2/sites-available/wsgisite  WSGIPythonHome /usr/local   &lt;VirtualHost *:80&gt;      ServerName wsgitest.local     DocumentRoot /home/wwwhost/pydocs/wsgi     &lt;Directory /home/wwwhost/pydocs/wsgi&gt;         Order allow,deny         Allow from all     &lt;/Directory&gt;      WSGIScriptAlias / /home/wwwhost/pydocs/wsgi/app.wsgi  &lt;/VirtualHost&gt;   app.wsgi  import sys  def application(environ, start_response):     status = '200 OK'     output = sys.version      response_headers = [('Content-type', 'text/plain'),                         ('Content-Length', str(len(output)))]     start_response(status, response_headers)      return [output]   Apache error.log  'import site' failed; use -v for traceback [Sun Jun 19 00:27:21 2011] [info] mod_wsgi (pid=23235): Initializing Python. [Sun Jun 19 00:27:21 2011] [notice] Apache/2.2.14 (Ubuntu) mod_wsgi/2.8 Python/2.6.5 configured -- resuming normal operations [Sun Jun 19 00:27:21 2011] [info] Server built: Nov 18 2010 21:20:56 [Sun Jun 19 00:27:21 2011] [info] mod_wsgi (pid=23238): Attach interpreter ''. [Sun Jun 19 00:27:21 2011] [info] mod_wsgi (pid=23239): Attach interpreter ''. [Sun Jun 19 00:27:31 2011] [info] mod_wsgi (pid=23238): Create interpreter 'wsgitest.local|'. [Sun Jun 19 00:27:31 2011] [info] [client 192.168.1.205] mod_wsgi (pid=23238, process='', application='wsgitest.local|'): Loading WSGI script '/home/wwwhost/pydocs/$ [Sun Jun 19 00:27:50 2011] [info] mod_wsgi (pid=23239): Create interpreter 'wsgitest.local|'.   Has anybody ever managed to make mod_wsgi run on a non-system default version of python ? Proving an entire, complex function with below bounded modulus is constant. How would I show that an entire function $f$ with the property $|f(z)| \geq 1$ must be constant?    I'm aware of Liouville's theorem, just not sure how to apply it here. Why is this sentence correct? “She suggested that he go to the cinema.” Why is this sentence correct?     She suggested that he go to the cinema.   I would definitely use goes instead of go. "It was recommended that" + verb in present tense It was recommended that the international development partners develop guidelines or a roadmap to help countries take the necessary steps to select the right tool for their purposes.   Why is it using present tense "develop" in the sentence which is actually a past tense "It was recommended"? How do you do load testing and capacity planning for databases? This is a  about capacity planning for databases. Related:      I'm looking to create a canonical question of tools and methods of capacity planning for databases. This is intended to be a canonical question. Obviously, the general workflow is:  Put your scenario in place Add monitoring Add traffic Evaluate results Remediate based on results Rinse, repeat until reasonably happy  Please feel free to describe different tools and techniques for different web-servers, frameworks, etc., as well as best-practices. I am wondering what the difference between a definition and an axiom.  Isn't an axiom something what we define to be true?  For example, one of the axioms of Peano Arithmetic states that $\forall n:0\neq S(n)$, or in English, that zero isn't the successor of any natural number. Why can't we define 0 to be the natural number such that it isn't the successor of any natural number?  In general, why is an axiom not a definition?   Are there cases where we can formulate definitions as axioms or vice versa? Why aren't variable-length arrays part of the C++ standard? Let $\{X_n\}_{n=1}^\infty$ be a sequence of random variables converging to a random variable $X$. Does this fact implies that $\lim\limits_{n\to \infty} EX_n = EX$?  If not, is there any other sufficient condition? How to assign dynamic Ids for ui:inputDate element inside aura:iteration? As title says, How do I assign dynamic Ids for ui:inputDate elements inside aura:iteration?  Here is the reproducible version of the problem I am facing:  HelloWorldApp.app  &lt;aura:application &gt;     &lt;c:inputDateExample /&gt; &lt;/aura:application&gt;   inputDateExample.cmp  &lt;aura:component &gt;     &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}"/&gt;     &lt;aura:attribute name="datesList" type="List" /&gt;     &lt;table&gt;         &lt;aura:iteration items="{!v.datesList}" var="dateItem"&gt;             &lt;tr&gt;                 &lt;ui:inputDate aura:id="date-id"                                value="{!dateItem}"                                displayDatePicker="true"                               blur="{!c.fldChanged}"/&gt;             &lt;/tr&gt;         &lt;/aura:iteration&gt;     &lt;/table&gt; &lt;/aura:component&gt;   inputDateExampleController.js  ({     fldChanged : function(component, event, helper) {         console.log('Value changed');         //How do I find from which date element, event is fired??         //The below method finds both date elements because the Id is not unique         var dateComponent = component.find('date-id');         console.log(dateComponent);         console.log(dateComponent[0].get("v.value"));     },     doInit : function(component,event,helper){         var datesArray = [];         datesArray.push("2017-01-01");         datesArray.push("2017-01-31");         component.set("v.datesList",datesArray);     } })   This produces the below output and I need to find which element user is clicking on??    Notes:   I can assign unique Id for tr element but not sure how to use that inside component.find() method. I can assign dynamic id for plain input tags but there is too much markup involved for making these similar to lightning date element. I tried giving html5 data attributes for ui:inputDate but it doesn' accept.   Any workarounds or anything I am missing here? There is the next characterization for valuation domains:  Let $D$ be an integral domain and $K$ its field of fractions. The following are equivalent:   For every nonzero $x$ in $K$, either $x$ in $D$ or $x^{−1}$ in $D$. The ideals of $D$ are totally ordered by inclusion. The principal ideals of $D$ are totally ordered by inclusion (i.e., the elements in D are totally ordered by divisibility.) There is a totally ordered abelian group $Γ$ (called the value group) and a surjective group homomorphism (called the valuation) $v :$ $K^×$ $→ Γ$ with $D = \{ x ∈$ $K^×$ | $v(x)$ ≥ $0 \}$ $∪$ {0}.   The equivalence between 1, 2 and 3 are clear, and I understand that the fourth can be found in Krull's article (1936), but I don't speak german and I can't find a proof anywhere. Any link or hint will be much appreciated. I am trying to copy the contents of a folder to another folder in a different directory using terminal.  Would somebody be able to provide me an example of the command line syntax required to achieve this? How do the tens­es and as­pects in English cor­re­spond tem­po­ral­ly to one an­oth­er? Is it a bad practice to catch Throwable? I am typing a command, I remember I have to check something, if I press Ctrl+U the command disappears and I can type something else, but then the command I was typing is not in the history.  Is there a way to recover that command, or a different shortcut that I can press to save somewhere the command? Can thebibliography be sorted by citation order? Or is there a solution with an inlined bibliography that can be sorted?  Not having an additional .bib file would be preferable.  My current bilbiography is inluded in the rest of the article inside a thebibliography block.  \begin{document} \section{Example} The citations in\cite{ne} the bibliography should\cite{flowers} be ordered  according which order they appear in the text.   \begin{thebibliography}{9}  \bibitem{fetebok} \emph{Internal Combustion Engine Fundamentals}  \bibitem{ne} \emph{Förbränningsmotorer}  \bibitem{flowers} \emph{HCCI Research Towards Development for Stationary Power  Applications}  \end{thebibliography}   Should output:  The citations in[1] the bibliography should[2] be ordered  according which order they appear in the text.   Bilbiography [1] Förbränningsmotorer [2] HCCI Research Towards Development for Stationary Power Applications [3] Internal Combustion Engine Fundamentals A smooth vector field on $S^2$ vanishing at a single point How to implement a single instance Java application? Sometime I see many application such as msn, windows media player etc that are single instance applications (when user executes while application is running a new application instance will not created).  In C#, I use Mutex class for this but I don't know how to do this in Java. Private IP address in public DNS We have an SMTP only mail server behind a firewall which will have a public A record of mail..  The only way to access this mail server is from another server behind the same firewall.  We do not run our own private DNS server.  Is it a good idea to use the private IP address as an A record in a public DNS server - or is it best to keep these server records in each servers local hosts file? Is the above statement true? If I have already proven that the set is linearly independent, is it automatically given that the subset is also linearly independent? If so, how would I go about showing that as a proof.