I've got a form that people can fill out and the results of the form are displayed on a page. The form is limited to 2000 characters, however there's nothing limiting how many line breaks there can be, so someone could just put one character per line and get 2000 line breaks, which clutters up the page pretty badly. I'm looking to limit the number of lines that they can type into the textarea so the limits are 2000 characters or 40 lines, whichever comes first.  I would also need this to be protective of people pasting large amounts of text into the form as well. I looked at a lot of other posts about this but none of the answers worked when I tried them. Thanks!
I'm looking for a javascript that can limit the number of lines (by line I mean some text ended by user pressing enter on the keyboard) the user is able to enter in textarea. I've found some solutions but they simply don't work or behave really weird. The best solution would be a jquery plugin that can do the work - something like , but it should be able to limit text line count not character count.
Infinite Series $\sum\limits_{n=1}^\infty\left(\frac{H_n}n\right)^2$ How can I find a closed form for the following sum? $$\sum_{n=1}^{\infty}\left(\frac{H_n}{n}\right)^2$$ ($H_n=\sum_{k=1}^n\frac{1}{k}$). Is there a name for this database schema of key values? Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44f72ff0 that was originally added here Windows 7's PATH and environment variables are corrupted Which is the biggest object which can interfere with itself? Borel-Cantelli-related exercise: Show that $\sum_{n=1}^{\infty} p_n < 1 \implies \prod_{n=1}^{\infty} (1-p_n) \geq 1- S$. This is supposed to be related to the  (my justification for the independence tag). In Williams' Probability with Martingales, 2BCL is proven and then the following is given as an exercise:  Prove $S \doteq \sum_{n=1}^\infty p_n &lt; \infty \implies \prod_{n=1}^\infty (1-p_n) &gt; 0$ assuming $0 \leq p_n &lt; 1$. Hint: Show that $S &lt; 1 \implies \prod_{n=1}^\infty (1-p_n) \geq 1 - S$.   Proving the hint: I tried to find $\{a_n\}$ s.t. $$\prod_{n=1}^\infty (1-p_n) \geq \prod_{n=1}^\infty e^{a_n} = e^{\sum_{n=1}^\infty a_n} \geq 1 - \sum_{n=1}^\infty a_n \geq 1 - S &gt; 0$$ That is, find $\{a_n\}$ s.t.: 1a. $1 - p_n \geq e^{a_n}$ 1b. $a_n \leq p_n$ I thought of $a_n = \ln(1-p_n)$ (a reason why $p_n &lt; 1$, I guess) Is that right? Edit: Actually, assuming my proof is right, is $S &lt; 1$ used in the proof? If so, where?  From Williams book: How can I find the possible values that $\gcd(a+b,a^2+b^2)$ can take, if $\gcd(a,b)=1$ What are the different endings in Dishonored? In Dishonored the game as I am escaping the prison, I got a prompt that warned me:      Using stealth and nonlethal approach has benefits. Fewer rats and   weepers, some people react favorably, and the final outcome is not as   dark.   What are all the different endings? And how much chaos yields them? And what is the optimal ending? How to amplify 3.3V to 10V by using an NPN transistor? How to select resistor based on current, how does the amplification happen? Every affine variety in $\mathbb A^n$ consisting of finitely many points can be written as the zero locus of $n$ polynomials I am reading Gathmann's free online notes on Algebraic Geometry. One exercise asks to show that     "Every affine variety in $\mathbb A^n$ consisting of finitely many points can be written as the zero locus of $n$ polynomials".    There is a hint says "interpolation". I don't know how to start with the hint.   If $n=2$, we can use interpolation to get 1 polynomial for finitely many points. But we need to show 2 polynomials instead. I am also not sure how to apply interpolation for higher dimensions. Anyone can help? Thank you! Remote start up a machine that is in the shut down state? Possible Duplicate:          May I know how can one remote start up a machine that is in a shut down state? How can I programmatically create a new cron job? I want to be able to programatically add a new cron job, what is the best way to do this?  From , it seems I could dump the current crontab and then append a new one, piping that back into crontab:  (crontab -l ; echo "0 * * * * wget -O - -q http://www.example.com/cron.php") | crontab -   Is there a better way? Named parameters in JDBC How many subgroups of order $n$ does $D_n$ have? How many subgroups of order $n$ does $D_n$ have?  My work:  Since subgroups of $D_n$ are either cyclic or dihedral, the subgroups of order $n$ of $D_n$ are $\left&lt; r \right&gt;$ (cyclic) and $D_{n/2}$ (dihedral). However, this works only for $n$ is even and $n\geq 2$. I don't know how to do when $n$ is odd. Notify-osd notifications appear unthemed in top-left corner Do photons lose energy due to gravitational redshift? If so, where does the lost energy go? In the gravitational redshift, the frequency of photons radiated from some source is reduced. As the energy of a photon is given by $\hbar\omega$, if the frequency is reduced where is the lost energy? Problem installing .deb in Software Install Ubuntu 20.04 I have just bought a Nikon 50mm f/1.8D prime lens.  I took this picture (leg of my glasses frame on a mouse, and a LED desk lamp is on top of it) : f1.8, 1/80s, ISO 200   The purple fringing is right in the middle of the picture. Does it happen very often to this lens? How do you name your ViewModel classes? I just discovered Matlab's factor()-function, and I randomly typed in 20081294819, and to my surprise it only had two factors (5099 and 3938281)! I had expected many more factors for such a big number and wondered how normal this was. The following is what I've done in my investigation so far.  In the first figure below, I have plotted the probability that some number below $10^k$ has $m$ indistinct prime factors.  The second figure shows the evolution of the probability of finding a number with $m$ indistinct prime factors as the numbers one is looking at grows, i.e. it is just another way to visualize the same data. I have left out all points of zero probability.  If one looks at the first part of the figure, it seems that the peak of the curve for some $k$ shifts toward higher $m$ as $k$ grows.   My first question is this: Does this behavior (i.e. the peak shifting toward higher $m$ as $k$ grows) continue indefinitely, or will the peak stabilize at some point? The latter seems unlikely but I can't be sure.  My second question is this: Approximately how fast does the peak-value $m_{peak}$ move as $k$ grows?  I briefly looked at the , but this involves distinct primes and I don't really know much number theory, so any help would be greatly appreciated!