I have the below regex to match email address with atleast one @ and one .  [-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+\.[a-zA-Z]{2,4}   Am wondering can it be simplified further to match email address with atleast one @ and one .?
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.
Code after bullet list isn't rendered correctly Possible Duplicate:         If there is a list immediately followed by a code block the code block is not recognized as code (Even though there is a newline between the two).  int answer = 42;  Note: This happens both in the WMD preview and in the final (server rendered) post. How do I create a script file for terminal commands? I know I've seen somewhere how to typeset 1/2 as ½, but with arbitrary fractions (that is, a macro that takes two arguments and makes the first denominator and the second numerator...). Now I can't seem to find it.  How do I typeset an arbitrary fraction the same way as ½? Noether's Theorem: Lie groups vs. Lie algebras; finite vs. infinitesimal symmetries I've had a brief look through similar threads on this topic to see if my question has already been answered, but I didn't find quite what I was looking for, perhaps it is because I'm finding it hard to put words on my question and I hope that you will be able to help me ask it clearly.  I'm trying to link what I know from mathematics to what we are writing in physics for Noether's theorem. If I understand correctly we are looking at the symmetries of the action i.e. under which symmetry groups is it invariant. Noether's theorem allows us to calculate a conserved current in the case of a continuous symmetry (Lie groups), by means of so-called infinitesimal symmetries which I believe to be elements of the Lie algebra (so the tangent space to the neutral element) of the Lie group.  I'm guessing that if the action is invariant under the symmetry then it's "variation" should be 0 when we vary the system (space-time coordinate, or field) using this symmetry; it is exactly this step that I would like to understand better, how can I formalize this step correctly mathematically? How should I understand this variation, and how does it's calculation give rise to the elements of the Lie algebra? Compile TeX (directly) into SVG using the command line Is there a way to directly compile TeX code into the SVG image format (rather than going the detour over TeX => PDF => SVG)?  I found this question:   But I don't want to do it online - it should be a command-line call. Install MS Truetype Fonts system-wide for all users I would like to install the MS Truetype Fonts that come through the package ttf-mscorefonts-installer, so I did:  sudo apt-get install ttf-mscorefonts-installer   Accepting the license, the process completes without any errors. The fonts end up in     /usr/share/fonts/truetype/msttcorefonts   as expected. Just to be sure, I also did a  sudo fc-cache -f -s -v   which among other things says in its output:     /usr/share/fonts/truetype/msttcorefonts: caching, new cache contents: 60 fonts, 0 dirs   So far, so good (and inline with question ) However, when I then open any font dialog (e.g. in OpenOffice or the font dialog of the terminal) I don't see all of the new fonts. For Arial, the standard form is missing, but bold and italic are there. Times New Roman is missing altogether.  I can use nautilus to browse to the font directory, double click the Arial.ttf file and see the font in all its beauty. I can even click the install button then and the font is copied over to my personal ./fonts directory and from there on visible to my apps. But it is not picked up from the system directory.  How do I get these fonts available system-wide for all users? Clearing Recently used coordinate reference systems using QGIS? After using some non usual SRC for demonstration purpose, I wish to clear my  "Recently used coordinate reference systems" list for the sake of praticity.  Is it possible?   I am using QGIS 2.10.1. I know the correct pronunciation (I think) of the words "ask" and "asked", but I quite often hear them pronounced as "ahks" and "ahksed" (almost like an "r" sound). I've heard it both in conversation and on television shows (both Australian and American).   Are these pronunciations due to dialect, or are they alternative pronunciations or incorrect pronunciations? If they are the correct pronunciation, should I use them or the "normal" pronunciation? How does body fat leave your body? So I know that it’s not from tears or sweat because they are composed of mainly water and sodium, it’s not from going poo or pee as poo and pee are made of the parts of food that supply your body with no nutrients and your body also doesn’t “burn body fat” because there is a theory that no matter is ever destroyed so it’s none of those but another thing is it’s not your hair, ear wax, finger nails or anything of that sort because people can lose over 17 pounds in 3 months but you can’t build up that amount of hair , ear wax or whatever else in three months so how does body fat leave your body Is it pythonic for a function to return multiple values? In python, you can have a function return multiple values.  Here's a contrived example:  def divide(x, y):     quotient = x/y     remainder = x % y     return quotient, remainder    (q, r) = divide(22, 7)   This seems very useful, but it looks like it can also be abused ("Well..function X already computes what we need as an intermediate value.  Let's have X return that value also").  When should you draw the line and define a different method? What is the purpose of the 'nobody' user? After I read  I noticed that there is a user account named 'nobody' in my Ubuntu system.   Also I noticed that I can login in this account from terminal using the following command and my password:  sudo su nobody     It doesn't mind me at all, but I want to know what is the purpose of this user? Is it created by default on a fresh install of Ubuntu or is created by installing a particular package? Why are there only derivatives to the first order in the Lagrangian? Computer unstable at lower temperatures My computer is playing some strange joke at me, and I'm at a loss.  Everybody knows that hot temperatures causes many components to become unstable and even cause damage. When I built this machine, I was careful to do a bunch of experiments with different airflow configurations, with CPU-and-GPU intensive benchmarks running, and measuring the temperature at different points to find the best configuration.  Generally, the internal temperature of this machine is very close to ambient temperature (with 2 exceptions: the GPU always runs ~10°C above ambient, and the CPU goes to at most ~12°C above ambient when running CPU-intensive applications).  Now comes the problem: at really cold mornings. At cold mornings (~10°C (50°F) or below), the system shows really strange general instability. Beeps from the BIOS, the operating system displays strange messages about memory corruption and PCI devices that failed to initialize, and then, everything hangs. The computer hangs to the point that all USB devices turn of. Hitting the Reset button blanks the screen but the mainboard fails to proceed to the boot.  I never thought that low temperatures could cause computer instability. And 10°C is not that cold, it is still within operating temperatures of all components as far as I checked.  I'm quite sure it is related with the temperature. There were too many cold and warm mornings that demonstrated that the problem only showed in the cold ones. I'm working around this problem by letting the computer sit at the GRUB menu for some 5-10 minutes before letting the OS start, or blowing hot air inside the case if I'm in a hurry.  I don't know what should I approach next to find the source of this problem. Since it is difficult to reproduce (I need a cold morning, and the computer must be cooled down (powered off for many hours)), I need to plan ahead the experiment, since it stabilizes after a few minutes on.  Machine is an ASUS P5VDC-X equipped with Intel P4 64-bit 3GHz, 2GB of DDR2 RAM, a 500W PSU and an nVidia GeForce 9600GT. Everything else was already disconnected/removed before and the problem persisted, so the problem should be in one of these remaining parts.  Any help is appreciated! How to make math font huge Note: $x_n$ is a sequence which is not necessarily convergent.    The following was my attempt. Since $\lim_{n\to \infty}a_n=a$ then $\limsup_{n\to \infty}a_n=a$ . Also $\sup(a_nx_n)=\sup(a_n)\sup(x_n)$. Therefore, $\limsup_{n\to \infty}a_nx_n=\limsup_{n\to \infty}a_n\limsup_{n\to \infty}x_n=a\limsup_{n\to \infty}x_n$.    I am not sure if this is correct. So could someone please show me how it is done. Thanks Replaced wrong car in garage in GTA Online Calculate distance of galaxy 13 billion years ago How can I calculate the distance of a point from Earth now vs 13 billion years ago? The excerpt below claims it is 8 times further now. Can someone provide relevant equations ? How to link to apps on the app store I am creating a free version of my iPhone game. I want to have a button inside the free version that takes people to the paid version in the app store. If I use a standard link    the iPhone opens Safari first, and then the app store. I have used other apps that open the app store directly, so I know it is possible.  Any ideas? What is the URL Scheme for the app store? Windows 10 doesn't shut down properly Why do people risk death by joining Starfleet if not for money or preservation of their homes? Watching Star Trek made me think of a few "deeper" questions about Starfleet, which are all related to the Star Trek TV series.  So, let's take for example the Dominion War: people are dying every second, ships get destroyed and cadets are still joining although they know they are probably going to die unless they are with Picard or Sisko.  As I read and got to understand, money has no value anymore, latinum is the general trading currency in the universe. But people on Earth don't trade and don't earn their paychecks. Earth is a much better place than today and yet young boys and girls from every culture/civilization are joining Starfleet as they are willingly signing their death note.  Why are they joining, what motivates them? They might know that they're probably going to die.  They don’t earn paychecks. They could be doing any other job, yet they choose this. And what's more interesting how many died on battlefields must be lined up in front of StarFleet every day?  What do they receive after service? Why are they doing it other than preserving their homes?