I have the following functions   JavaScript  function lettersNumbersOnly(string){    if (/[A-Za-z0-9]/.test(string)) {      console.log('Clean');    }else{      console.log('Not Matching');    } }  $(".test-input").change(function(){   lettersNumbersOnly($(this).val()); });   If I were to put letters and numbers into that .test-input field, I get the "Clean". BUT if I put characters like !2@$% etc. I still get the "Clean" which is not what I want. I just want strictly letters and numbers. Any suggestions?
I need to find a reg ex that only allows alphanumeric. So far, everyone I try only works if the string is alphanumeric, meaning contains both a letter and a number. I just want one what would allow either and not require both.
Why not make it mandatory to leave a reason or at least a remark of some sort whenever down voting?  You see more and more often questions being down voted while many times they are simply perfectly legitimate, as questions/as people being unable to achieve some desirable result. I am not talking about "Hey, please do this and that for me, thanks :D " posts.  I would like to know what reasons there are for not making it mandatory to leave a reason for a down vote. I have a simple question.     over centuries / for centuries   what is the difference?  Thank you. On Ubuntu 12.04 LTS on a Dell Vostro 2420 laptop, each time I start Ubuntu, the screen brightness is set to the maximum level, which gives a high glare. (I have recently installed Ubuntu on the laptop, but did not change any default settings related to brightness, IIRC.) I am currently lowering the brightness manually each time after starting, using the System Settings icon on the left of the screen. Looking for a permanent way to set it to a lower value. How to prove the following limit?   $$\lim_{n \to \infty} (1+1/n)^n = e$$    I can only observe that the limit should be a very large number!   Thanks. What is the solution to the Squirrel sequence of letters question? Javascript Remoting - sending sObject as argument how to solve $\int_{-\infty}^\infty e^{-x^2-x{\tau}} \cdot x\ dx$? iOS Run Code Once a Day How to run adb and fastboot commands from Termux? Is there a C++ decompiler? Problems with partial derivatives. Problems with fonts I'm an average user of LaTeX, but not proficiency. I'm trying to learn from book templates I've found on the web, but I get this error message:  Trying to make PK font ccicons at 1493 DPI... Running miktex-makemf.exe... miktex-makemf: The ccicons source file could not be found. Running ttf2pk.exe... miktex-makemf: PK font ccicons could not be created.  LaTeX Font Warning: Some font shapes were not available, defaults substituted.  !pdfTeX error: pdflatex.exe (file ccicons): Font ccicons at 1493 not found  ==&gt; Fatal error occurred, no output PDF file produced!   I'm using MiKTeX (over Windows 7), and according to the MiKTeX package manager the "ccicons" package is already installed.  Could you please help me solve this problem? How can I work around this TikZ bug: (\x)^2 and \x^2 produce different results in TikZ plot? I have some files with TikZ graphics that have suddenly changed appearance since I upgraded to PGF-2.10.  Here is a minimal example:  \documentclass{minimal} \usepackage{tikz} \begin{document} \pgfversion\par \begin{tikzpicture} \draw[blue] plot[domain=-1:1] (\x,{\x^2 + \x^3}); \draw[xshift=4cm,blue] plot[domain=-1:1] (\x,{(\x)^2 + (\x)^3}); \end{tikzpicture} \end{document}   In PGF 2.00 I had this:    while in 2.10 I have this:    The one on the left in PGF 2.10 looks like the graph of y=x^3 but could also be y=x^3 + x|x|.   This has been  on sourceforge and  on the pgf-users mailing list.  Although I haven't checked myself yet, the bug remains open and some of the commenters below report that problems still exist in the CVS version.   Geoffrey Jones notes the bug is in the 2.00 CVS version:     Hi Matthew, not an answer, just an FYI   that's too large for the comment box.   My compile of your code through pgf   v2.00 produces the result you see with   v2.10, above:       I.e., the difference you observe seems   to pre-date v2.10.   There is a workaround by inserting parentheses.  But since I have so many old lecture files I'd rather find a solution that doesn't involve rewriting my TikZ code.  And I'm squeamish about using the CVS bleeding edge code even if it were fixed, since I don't want to introduce other problems.  Ideally I'd like a simple patch that I can stick at the preamble, or just fix one file in the PGF distro. "Absolutely continuous random variable" vs. "Continuous random variable"? In the book Limit Theorems of Probability Theory by Valentin V. Petrov, I saw a distinction between the definitions of a distribution being &quot;continuous&quot; and &quot;absolutely continuous&quot;, which is stated as follows:  &quot;...The distribution of the random variable $X$ is said to be continuous if $P\left(X \in B\right)=0$ for any finite or countable set $B$ of points of the real line. It is said to be absolutely continuous if $P\left(X \in B\right)=0$ for all Borel sets $B$ of Lebesgue measure zero...&quot;  The concept I am familiar with is:  &quot;If a random variable has a continuous Cumulative Distribution Function, then it is absolutely continuous.&quot;  My questions are: are the two descriptions about &quot;absolute continuity&quot; in (1) and (2) talking about the same thing? If yes, how can I translate one explanation into the other one? I'm using MySQL's AUTO_INCREMENT field and InnoDB to support transactions. I noticed when I rollback the transaction, the AUTO_INCREMENT field is not rollbacked? I found out that it was designed this way but are there any workarounds to this? Is the total energy of the universe zero? In popular science books and articles, I keep running into the claim that the total energy of the Universe is zero, "because the positive energy of matter is cancelled out by the negative energy of the gravitational field".  But I can't find anything concrete to substantiate this claim. As a first check, I did a calculation to compute the gravitational potential energy of a sphere of uniform density of radius $R$ using Newton's Laws and threw in $E=mc^2$ for energy of the sphere, and it was by no means obvious that the answer is zero!  So, my questions:   What is the basis for the claim &ndash; does one require General Relativity, or can one get it from Newtonian gravity? What conditions do you require in the model, in order for this to work? Could someone please refer me to a good paper about this? Gamma Distribution out of sum of exponential random variables How do I reclaim my Clash of Clans account? I got Clash if Clans on my laptop and started a village. Then a couple of weeks later it said "This app was not installed properly". So I went and redownloaded it but it started a new account. How do I reclaim my old one back? Keyboard key stuck or not being recognized; how to fix Installing grub2 in efi-mode in usb flash drive I've two different OS, which one is ubuntu. I'm using a PC, NOT a Mac. I use Chimera bootloader that don't find Ubuntu. So, i'd like to install grub 2 in EFI-mode on flash-drive USB. In this way, i can load Ubuntu only if the usb flash-drive is connected.  I followed this guide  replacing "/dev/sda" in  sudo efibootmgr --create --gpt --disk /dev/sda --part 1 --write-signature --label "GRUB2" --loader "\\EFI\\grub\\grub.efi"   with the usb-pen directory. Then, i've copied the grub.cfg file that exists in Ubuntu partition.Result? Grub2 loads, but when i select the menu entries, grub2 doesn't find any command, or disks. How can i fix this problem?  P.S. Here, there are the photo of the error(when i select ubuntu entry in grub2), the usb-drive's contents and the grub.cfg file