I'm quite new with regular expression, i'm using it in angularjs. I need to check an input field, and I need to accept only positive decimal values with no more than 3 digits after the point:  3 3.5 3.567 0.236   and reject values like  0 0. . .6 .635 3.6589   I tried this regexp:  var result = /([1-9]\d*)\.(\d{1,3})/.test(value) || /[1-9]\d*(?=\s|$)/.test(value);   and more or less it works, but still   it accepts values with more than 3 digits after the point, like 45.9876 it accepts .356 values (a number starting with . )   what I'm missing?
What is the regular expression for a decimal with a precision of 2?  Valid examples:  123.12 2 56754 92929292929292.12 0.21 3.1   Invalid examples:  12.1232 2.23332 e666.76   The decimal point may be optional, and integers may also be included.
Given that $$f\left(\frac{x+y}{2}\right)\leqslant \frac{f(x)+f(y)}{2}~,$$ how can I show that $f$ is convex. Thanks.      Edit: I'm sorry for all the confusion. $f$ is assumed to be continuous on an interval $(a,b)$. Irreducible cyclotomic polynomial I want to know if there is a way to decide if a cyclotomic polynomial is irreducible over a field $\mathbb{F}_q$? How to integrate OpenCV Manager in Android App Where should looking-for-resources questions go? Questions like looking for css templates, blog templates, icons ... In general, resources (let's leave the licensing terms aside for now) which you might need when building a project of your own. Where should those questions go?  They're definitely not on-topic on Stack', SuperUser maybe although I doubt it. Webapps? Hmm, probably not.  Is there a place where they would be on-topic on the SE network? Does the shape of a containter affect the apparent mass of liquid inside it when measured by a scale? For both containers it is true that:  $p_{bottom}=p_{atm}+\rho gh$ and $F_{bottom}=a*p_{bottom} \iff F_{bottom}=a*p_{atm} + a\rho gh$  I do not know how a scale functions, but I guess that the only force it can count is the force by the liquid on the bottom of each container (the only surface that is in touch with the scale is the bottom of the container). Thus, if we measured the mass of these two masses of water (lets assume that the mass of the containers is negligible) it would appear to be the same in each case. Am I right? Using crawl rules to exclude Allitems.aspx, DispForm.aspx Is anyone having any idea on how to exclude List Forms from Search result.  I tried lot many things suggested on google, but none of them seems to be working. $$  \lim_{n\to\infty} n^{1/2} \int_{0}^{1} \frac{1}{(1+x^2)^n}\mathrm{d}x=0 $$  Is my answer correct? But I am not sure of method by which I have done. I'm trying to split a string up into words and punctuation, adding the punctuation to the list produced by the split.  For instance:  &gt;&gt;&gt; c = "help, me" &gt;&gt;&gt; print c.split() ['help,', 'me']   What I really want the list to look like is:  ['help', ',', 'me']   So, I want the string split at whitespace with the punctuation split from the words.  I've tried to parse the string first and then run the split:  &gt;&gt;&gt; for character in c: ...     if character in ".,;!?": ...             outputCharacter = " %s" % character ...     else: ...             outputCharacter = character ...     separatedPunctuation += outputCharacter &gt;&gt;&gt; print separatedPunctuation help , me &gt;&gt;&gt; print separatedPunctuation.split() ['help', ',', 'me']   This produces the result I want, but is painfully slow on large files.  Is there a way to do this more efficiently? How to troubleshoot booting to a black screen on VirtualBox I was using 13.04 as a guest OS on my VirtualBox 14.2.18. Host is Windows 8. After upgrade to 13.10 Ubuntu does not start. I can see a black screen and blinking cursor. I am pretty new to Ubuntu. I suspect a problem with graphics drivers. I can access tty and all files (/home) are there. How to retrieve a module's path? I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from.  How do I retrieve a module's path in python? How can I run everything as root I have dual booted to lubuntu (with Windows XP) and everytime and then I'm getting asked for my password. How do I run everything as root and not ask a password again? Ideally I wanted to run nginx but it has permission denied issues:  apathetic@ubuntu:~$ service nginx start Starting nginx: nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2012/08/03 20:06:25 [warn] 4762#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 2012/08/03 20:06:25 [emerg] 4762#0: open() "/var/run/nginx.pid" failed (13: Permission denied) nginx: configuration file /etc/nginx/nginx.conf test failed Cloning an SD card onto a larger SD card I'm using Ubuntu 12.04. I have an old 4GB SD card, and have just bought a new 16GB SD card. I would like to copy everything from my old 4GB SD card onto the new 16GB SD card. I was afraid that the usual copy-and-paste trick would miss out something, so I wanted to clone the old 4GB SD card onto the 16GB SD card. I used the dd command in a shell, following instructions in .  This worked with one small caveat. The new SD card now appeared to be 4GB. I later found out this is because the primary partition on the 16GB SD card has now shrunk to 4GB. I have solved this problem, and I think I understand it. However, my question now is, how do I clone my old 4GB SD card onto my new 16GB SD card without making the primary partition on the 16GB SD card shrink to 4GB? This seems like a pretty softball question, but I always have a hard time looking up this function because there seem there are so many variations regarding the referencing of char and tchar. combine 2 fields in 1 to use it in the "group by" section of the reports is it possible to combine two fields in one and use that field to group by in reports? for example, i would like to combine ee id and ee name fields in 1 and show as 1 field in the "group by" section on reports. I'm looking for a word that means     someone (especially a boss) who is not pleased (with your work, attitude etc.) no matter how hard you try. Does a photon in vacuum have a rest frame? List files sorted by the number of lines they contain How can I list the number of lines in the files in /group/book/four/word, sorted by the number of lines they contain?   ls -l command lists them down but does not sort them HTTP and HTTPS impacts on SEO I have a website http://www.domain_1.com/ hosted in a shared webserver.  I have used SSL for another website https://www.domain_2.com/ on the same server.  Due to some technical limitations (single IP), if you try https://www.domain_1.com, browser will show the same domain_2 website. But this is not a concern for me.  Question: will this scnario impact SEO of domain_1 (non-HTTPS) site? Equation of motion of a free particle We know that the equation of motion of particle can be derived from the respective action. But in the book I am reading, the author is saying:     ... timelike worldline of a massive particle is parametrised by proper time, $x^a=x^a(\tau)$. The velocity (tangent) vector is $u^a \equiv \dot{x}^a(\tau)$. This is normalised as $u^au_a =-c^2$.   How can one derive e.o.m? Any way to find out what US Customs & Border Protection has in their database on me? I travel from the US to Canada occasionally (about once per year on average) with my family. We are all US citizens and travel with US passports. Every time we re-enter the United States, I am given extra scrutiny.  Most recently, we used an automated check-in procedure at the airport. These are terminals where you scan your passport &amp; fill out a customs declaration online and it prints a receipt which you take to the customs agent. When I got my receipt, it had a big "X" printed on it and we were directed to a line to talk to an agent.  In the past, I've had questions directed at me or my family: "Have you ever been to New York?", "Do you own any firearms?", and once "Where is your daddy?" directed at my then 4 year old son. The agents also seem to examine my photo &amp; my face more closely than the other members of my family.  We get through customs OK, but it gives me a some anxiety. I suspect that there's someone out there with the same name (I have a pretty common name) who is on a "no fly" list or something.  My question is this: is there any way to find out what they're looking for when they scan my passport &amp; see my name? Like a Freedom of Information request or something? I know I could/should ask when I'm in the line, but as I said, it makes me pretty anxious.