How Do I Stop a Web Service Method That Has Been Executed
Abort Ajax requests using jQuery
To seek the maximum value of $S=x_1x_2+x_2x_3+\cdots+x_nx_1$ on this domain:  $x_1+x_2+\cdots+x_n=0$ and  $x_1^2+x_2^2+\cdots+x_n^2=1$.  I have made some trivial observations:  1) $S\in[-1,1)$ by the rearrangement inequality.  2) We can make $S$ arbitrarily close to $1$ by increasing $n$.  3) An equivalent problem is to minimise $(x_1-x_2)^2+\cdots+(x_n-x_1)^2$.  But does the maximum have a meaningful closed form  for each $n$? How to print colored text to the terminal? How can I output colored text to the terminal in Python? I have a site which is only for US/Canada/UK visitors. I don't want to make it visible to other visitors.  I tried to put IP ranges in .htaccess (Deny IP) but it does not work for me. May be I have inaccurate IP lists or I am doing something wrong. Cannot do a `composer install` even though my minimum stability is listed as dev I am trying to build the master branch in my project after updating to 8.5.0, but am being met with an error from composer (which I did not get on my develop branch):     The requested package drupal/focal_point 1.0.0-beta6 is satisfiable by   drupal/focal_point[1.0.0-beta6] but these conflict with your   requirements or minimum-stability.   In my composer file, I have:  "drupal/focal_point": "^1.0",   as well as:  "minimum-stability": "dev",   How can I fix this so TravisCI gets unstuck? It worked fine for the develop branch, and the master is now updated with it. How to parse a time into a Date object from user input in JavaScript? I am working on a form widget for users to enter a time of day into a text input (for a calendar application). Using JavaScript (we are using jQuery FWIW), I want to find the best way to parse the text that the user enters into a JavaScript Date() object so I can easily perform comparisons and other things on it.  I tried the parse() method and it is a little too picky for my needs. I would expect it to be able to successfully parse the following example input times (in addition to other logically similar time formats) as the same Date() object:   1:00 pm 1:00 p.m. 1:00 p 1:00pm 1:00p.m. 1:00p 1 pm 1 p.m. 1 p 1pm 1p.m. 1p 13:00 13   I am thinking that I might use regular expressions to split up the input and extract the information I want to use to create my Date() object. What is the best way to do this? Find n such that $n^5 - n$ is divisible by $120$. (*Here $n$ belongs to the natural number set)  Seems a trivial problem, but the answer mentioned in the text book seemed incomplete to me so I'm here just to ensure whether approach to this problem is correct or not.  So my approach is as follows: We know that $n^5 - n$ can be written as $n^5-n = n(n-1)(n+1)(n^2 + 1)$  Now since it's product of three consecutive natural numbers so it's divisible by $3! = 6$. Now using Fermat's Little theorem we can prove that $n^5= n \mod5$ hence $n^5 - n$ is divisible by $5$ as well. So $n^5 - n$ is divisible by $30$. Now to ensure their is another factor of $4$ in the term we need to ensure that $n^5 - n$ is divisible by $8$. I found that all odd natural numbers and multiples of $8$ makes $n^5 - n$ divisible by $8$, hence $n^5 - n$ is divisible by $120$. But in the text book they have only mentioned odd natural numbers as answer, which seemed incomplete to me.  Thanking everyone in advance:P Convert string to Title Case with JavaScript ON an American street, but IN a British one. Do the twain ever meet? Apparently, you can speed up your computer by adding more RAM. Is the amount of ram to be added is directly or indirectly related to the amount of hard-disk  space, processor speed, Motherboard etc... Can the memory of a RAM be compared with Virtual Memory and Cache Memory?  Note: About my PC Configuration: Intel core i5 processor, Motherboard DP55WB 4GB RAM, 700 GB Hard-disk space. Why does the jquery change event not trigger when I set the value of a select using val()? Alternative ways to say "if and only if"? There are some scenarios about which I would like to get some confirmation:   when defining a concept A,      We call A, if ... [definition of   concept A]   Does "if" here mean equivalence instead of just sufficiency? Is it incorrect to replace "if" with "if and only if"?    For precisely what condition is    B satisfied?   Does "precisely" mean asking for necessary and sufficient condition for B? Some other ways to say "if and only if" / "necessary and sufficient"?   Some references that summarize some standard terminologies in Mathematics  such as this one?  Thanks and regards! Meaning of the buffers/cache line in the output of free Why does my server show              total      used      free   shared buffers    cached     Mem: 12286456  11715372    571084        0   81912   6545228 -/+ buffers/cache:  5088232   7198224    Swap: 24571408     54528  24516880   I have no idea on calculating the memory in linux. I think it says that 5088232 is used where as 7198224 is free, meaning it is actually consuming 5GB of RAM? Why is $\mathbb{R}^2$ not a subspace of $\mathbb{R}^3$? I cannot understand why $\mathbb{R}^2$ is not a subspace of $\mathbb{R}^3$.   My reasoning is as follows: Choose any elements $v_1$ and $v_2$ from $\mathbb{R}^2$, add them together you get an element of $\mathbb{R}^2$ and same for scalar multiplication and $0$ vector is an element of $\mathbb{R}^2$. So where did I go wrong? Let $V$ be a vector space over a field $F$ and $T$ a linear operator on $V$. If $T^2$$=$ $0$, what can you say about the relation of the range of $T$ to the null space of $T$? When to use an interface instead of an abstract class and vice versa? This may be a generic OOP question. I wanted to do a generic comparison between an interface and an abstract class on the basis of their usage.   When would one want to use an interface and when would one want to use an abstract class? Finite groups with exactly one maximal subgroup How to find distance from the latitude and longitude of two locations? A "fast" way for  computing $ \prod \limits_{i=1}^{45}(1+\tan i^\circ) $? Which  is the fastest paper-pencil approach to compute the product $$ \prod  \limits_{i=1}^{45}(1+\tan i^\circ) $$ I see people say statement as question while speaking by raising their voice at the of it to mean it's a question.   For example consider followings.         You want to stay here? ==> Is used to mean "Do you want to stay here?"   You guys spoke to anyone? ==> Is used to mean "Did you guys speak to anyone?"      Are these really used by native speaker in casual speech? And can I write them in the same way while writing them as dialogue by putting them between quotes? Are there any special grammar rules for these kind of questions? In Dummit and Foote, Exercise 15.18 (p. 727 3rd edition) one is asked to prove that for a commutative ring with unity $R$, and $f$ a non-nilpotent element of $R$, that the localization $R_f$ is isomorphic to $R[x]/(xf - 1)$.  I have done this, using the strategy outlined in the problem, using the universal property of $R_f$ proved in Theorem 36. The problem I have is this:  If $R_f \cong R[x]/(xf - 1)$ and $\phi:R[x] \to R_f$ is a surjective homomorphism, it stands to reason that $\text{ker}(\phi)$ should be $(xf - 1)$. I cannot show this directly. The surjective homomorphism I have in mind is, for:  $p(x) = a_0 + a_1x + \cdots + a_mx^m$  $\phi(p) = \dfrac{a_0}{1} + \dfrac{a_1}{f} + \cdots + \dfrac{a_m}{f^m}$  It is clear to me that $\phi$ annihilates $(xf - 1)$, so that ideal is contained in the kernel. What I cannot show is the other containment, or equivalently:  If $\phi(g) = 0_{R_f}$ then $g(x) \in (xf - 1)$. The trouble I am running into is that $R$ might be a "bad" ring, containing a lot of zero-divisors, $f$ might even be a zero-divisor (being non-nilpotent is a considerably weaker property), so the usual polynomial tricks of the division algorithm or using the irreducibility of $xf - 1$ aren't much use, here.  I feel I am missing something obvious....what is it?