I need to make email validation on client side same with FILTER_VALIDATE_EMAIL. So what would be the equivalent regex on javascript with the FILTER_VALIDATE_EMAIL?  I found that FILTER_VALIDATE_EMAIL regex is from here:  but when I tried to copy paste the regex to javascript I get SyntaxError: Invalid regular expression: /#&lt;error&gt;/: Invalid group
Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.
My question comes from what I learned in the movies, considering I have not yet been able to read the books. I would just like to know why Severus Snape called himself the Half-Blood Prince? Did many people call him that or did he just think that it was a cool nickname? This question might be answered in the books so feel free to quote from it. I am trying to slice up my models using the Boolean modifier.  After applying the modifier on my smooth mesh, I get the expected result, a flat dissection to separate my mesh into two.  The problem lies in how I can resolve the visual "jaggered" edge that separates my (smooth) mesh exterior from the flat dissection face.    Is it possible to achieve a smooth-to-flat variation without this artifact?   I tried to alter a mixture of the two but end up with artifacts, or unwanted blocky flat mesh faces around the dissection edge of my mesh. Given that not all employees have a diamond:     All Stack Overflow employees aren't given a moderator diamond; the Community team has tightened up internal policies regarding who gets one and who doesn't. [...] —      can we have some visual indication that they are an employee?  This was  back in 2011, but declined. However, the situation appears to have changed now with fewer employees being given a diamond.  That way when they post on a meta site we know that it's somewhat "official".  Failing that please ensure that everyone includes the fact they're an employee in their profile given that  to add employee to their profile pages was also declined. What is the center of $D_{2n}/Z(D_{2n})$ What is the center of $D_{2n}/Z(D_{2n})$. I see that when $n=2^k$ then I have a $p$-group so the center is not trivial. But when $n$ is not power of $2$ how can i know what is the center of this group?. Surely when $n$ is odd then the center is trivial. How to run find -exec? I'd like to find the files in the current directory that contain the text "chrome".  $ find . -exec grep chrome find: missing argument to `-exec'   What am I doing wrong? What is the "Bootable flag" option when installing a distro? Is the "bootable flag" needed in today's distributions? If not, then why is it still in the installers? What is it exactly? Does an Echo Knight fighter's echo provoke an opportunity attack when it moves? How can two dates be compared in a shell?  Here is an example of how I would like to use this, though it does not work as-is:  todate=2013-07-18 cond=2013-07-15  if [ $todate -ge $cond ]; then     break fi                              How can I achieve the desired result? How do I help my third-grader focus on homework? My child just entered third grade, and the homework load is much higher this year, with a lot of writing and math drills. It is all work that she can do easily, but it's causing the whole family a lot of pain, because she's have a really hard time just sitting down and doing it — asking many questions about things she clearly actually knows, and getting distracted by the smallest thing going on around her. (Setting up a special quiet area isn't helping, because the distractions could be her pencil or a sudden burst of word association based on something in the lesson.)  So, a page of writing and a couple of pages of math which could be done in fifteen minutes total is taking an hour and a half. She can easily explain the reasoning behind the math problems, but when it comes to writing down what she just said, it's like pulling teeth. She'll slowly write a word, sounding it out in slow motion as she writes each word. And she'll say that she doesn't understand a question, but when she actually gets her mind pointed at it, she can write a great answer. And she's clearly picking up the concepts in class; I have no doubt that she actually understands, which is part of our frustration.  My wife feels like she's just wanting attention, but I think it's more about our daughter's own ability to focus. We both feel that sitting down and working painfully through each question isn't really helping her. That works, but my wife feels like it's just rewarding the behavior, and I feel like it's not really helping her learn any better focus on her own, which, you know, she'll need in actual life. And, we're happy to spend child with our kid, this pretty much the opposite of quality time.  Neither rewards or consequences seem to have any effect, and nor do charts. All of those things basically just seem to add another layer of complication, distraction, and misery. What else can we do? I understand that faster-than-light communication is impossible when making single measurements, because the outcome of each measurement is random. However, shouldn't measurement on one side collapse the wave function on the other side, such that interference effects would disappear? Making measurements on "bunches" of entangled particles would thus allow FTL communication, by making observed interference effects appear or disappear. How does such an experiment not:  1) Clearly imply that faster-than-light communication is possible?  or  2) (if #1 is rejected) Imply that measurement of one half of an entangled pair does not cause the collapse of the other half's wave function.  Why doesn't this thought experiment clearly show that if we maintain that FTL communication is ruled out, we must also rule out "universal collapse" in the Copenhagen interpretation?  EDIT: Here is an example of an explicit experiment (though I think experts could come up with something better):  You can entangle a photon with an electron such that the angle of the photon is correlated with the electron's position at each slit of a double slit experiment. If the photon is detected (it's outgoing angle measured), then which-path information is known, and there is no interference. If the photon is not detected, the interference remains.   The experiment is designed such that the photon and electron go in roughly opposite directions, apart from the tiny deflection which gives which-path information. You set up a series of photon detectors 100 ly away on one side, and your double slit experiment 100 ly away in the opposite direction. Now you produce the entangled pairs in bunches, say of 100 entangled pairs, each coming every millisecond, with a muon coming between each bunch to serve as a separator.   Then the idea is that someone at the photon detector side can send information to someone watching the double-slit experiment, by selectively detecting all of the photons in some bunches, but not in others. If all of the photons are detected for one bunch, then the corresponding electron bunch 200 ly away should show no interference effects. If all of the photons are not detected for one bunch, then the corresponding electron bunch 200 ly away would show the usual double-slit interference effects (say on a phosphorus screen). (Note that this does not require combining information from the photon-detector-side with the electron-double-slit side in order to get the interference effects. The interference effects would visibly show up as the electron blips populate the phosphorus screen, as is usual in a double-slit experiment when which-path information is not measured.)  In such a way the person at the photon detectors can send '1's and '0's depending on whether they measure the photons in a given bunch. Suppose they send 'SOS' in Morse code. This requires 9 bunches, and so this will take 900 milliseconds, which is less than 200 years. The point is that such an experiment would only work if you assume that the measurement of the photon really does collapse the wave function nonlocally. Eclipse error: "The import XXX cannot be resolved" Can I fail to deserialize with XmlSerializer in C# if an element is not found? I am using XmlSerializer to write and read an object to xml in C#.  I currently use the attributes XmlElement and XmlIgnore to manipulate the serialization of the object.  If my xml file is missing an xml element that I require, my object still deserializes (xml -> object) just fine.   How do I indicate (preferably via Attributes) that a certain field is "required"?  Here is a sample method of what I am using currently:  [XmlElement(ElementName="numberOfWidgets")] public int NumberThatIsRequired {     set ...;     get ...; }   My ideal solution would be to add something like an XmlRequired attribute.     Also, is there a good reference for what Attributes are available to manipulate the behavior of XmlSerializer? Problem about the definition of Euclidean domain Infinite Series $\sum\limits_{k=1}^{\infty}\frac{k^n}{k!}$ What's the scope of a variable initialized in an if statement? bash: ./program: cannot execute binary file: Exec format error I'm trying to run a program, but an error happens like this:  bash: ./program: cannot execute binary file: Exec format error   The result of file program was:  program: ELF-32-bit LSB executable, ARM, EABI4 version 1 (SYSV), dynamically linked(uses share libs), for GNU/LINUX 2.6.16, not stripped   How can I fix this error?  I'm using Ubuntu 14.04.2 (amd64) with VMware. I also tried with Ubuntu i386, but result was same. Should I load an entire html page with AJAX? Method always returns true? Moment of inertia of a cylinder about its base I've tried to find the moment of inertia of a cylinder rotating about an axis parallel to its base (i.e about the 'End diameter') as one can see  . But when I checked my results with different references ,I've found that it's incorrect!.I need a help to figure out where I did it wrong. since $$I=\int\limits x^2.dm$$ $$dm = \rho.dv$$ where $$dv= r.d\theta . dr .dh$$ &amp; $$\rho=\frac{M}{\pi R^2 H}$$ $M$:cylinder total mass. $H$:total height of cylinder. $R$:the radius of the cylinder. The distance of each infinitesimal element from the axis of rotation would be : $$\sqrt{r^2+h^2}$$ Therfore, $$I= \frac{2M}{ R^2 H}\int\limits_{0}^{R} \int\limits_{0}^{H}\, r(r^2+h^2)dh\,dr$$ and this gives a result of : $$\frac{M~H^2}{3}+\frac{M~R^2}{2}$$ Which is obviously wrong since the second term should be multiplied by a factor of $1/2$. Say I have a huge text file (>2GB) and I just want to cat the lines X to Y (e.g. 57890000 to 57890010).  From what I understand I can do this by piping head into tail or viceversa, i.e.   head -A /path/to/file | tail -B   or alternatively  tail -C /path/to/file | head -D   where A,B,C and D can be computed from the number of lines in the file, X and Y.  But there are two problems with this approach:   You have to compute A,B,C and D. The commands could pipe to each other many more lines than I am interested in reading (e.g. if I am reading just a few lines in the middle of a huge file)   Is there a way to have the shell just work with and output the lines I want? (while providing only X and Y)?