I'm using regex to match if a string contains at least an alphabet in it. but when the string contains special characters (not in regular Cp1252 encoding) it is giving me result as not matched even when string is having other alphabets. Here is my code  import java.util.regex.Matcher; import java.util.regex.Pattern;  public class StringContainsAlphabetsExample { public static void main(String[] args) {  Pattern pattern = Pattern.compile(".*[a-zA-Z]+.*");   String splChar = "has Alphabet";  Matcher matcher = pattern.matcher(splChar);   if (matcher.matches()) {       System.out.println("Matched");  } else {       System.out.println("Not Matched");   }  } }   Here is the String that causing error   String splChar = "This text has a special char.​ ";      Copy and paste the above string in notepad to see the special char.    Please let me know how to filter this special characters in the string or any work around to find if string contains alphabets.
For example, this regex  (.*)&lt;FooBar&gt;   will match:  abcde&lt;FooBar&gt;   But how do I get it to match across multiple lines?  abcde fghij&lt;FooBar&gt;
Proving $\frac{x}{y} +\frac{y}{z} + \frac{z}{x} \ge 3$ for positive $x,y,z$ Suppose $x,y,z$ are real positive numbers, prove that: $$\dfrac{x}{y} +\dfrac{y}{z} + \dfrac{z}{x} \ge 3$$ with equality when $x=y=z$.  Can someone help me find an easier solution? I started with assume only two are equal, without loss of generality, $x=y$. Then we get $$1 + \dfrac{x}{z} + \dfrac{z}{x}$$ $$1 + \dfrac{x^2 + z^2}{xz} = 1+ \dfrac{(x-z)^2 + 2xz}{xz} = 1 + 2 + \dfrac{(x-z)^2}{xz} \ge 3$$ To prove the general result I considered using a derivative with respect to $y$ to show that, starting with $x=y$ and increasing $y$ by a tiny amount, will show the equation's derivative as positive. I haven't gotten this to work yet. Any ideas? How do I have no default web browser, so the system asks what browser to use when I click on a link? I use Internet Explorer for some things and Chrome for others. I'd like to have a choice when I click on a link of which browser to open the link in. Is this possible in Windows? I am currently running Windows 8, although there should be similarities between versions.  To the best of my knowledge this isn't possible. Why is quantum entanglement considered to be an active link between particles? From everything I've read about quantum mechanics and quantum entanglement phenomena, it's not obvious to me why quantum entanglement is considered to be an active link. That is, it's stated every time that measurement of one particle affects the other.  In my head, there is a less magic explanation: the entangling measurement affects both particles in a way which makes their states identical, though unknown. In this case measuring one particle will reveal information about state of the other, but without a magical instant modification of remote entangled particle.  Obviously, I'm not the only one who had this idea. What are the problems associated with this view, and why is the magic view preferred? I have a JavaScript widget which provides standard extension points. One of them is the beforecreate function. It should return false to prevent an item from being created.   I've added an Ajax call into this function using jQuery:  beforecreate: function (node, targetNode, type, to) {   jQuery.get('http://example.com/catalog/create/' + targetNode.id + '?name=' + encode(to.inp[0].value),    function (result) {     if (result.isOk == false)          alert(result.message);   }); }   But I want to prevent my widget from creating the item, so I should return false in the mother-function, not in the callback. Is there a way to perform a synchronous AJAX request using jQuery or any other in-browser API? Label and caption without float I’d like to have an environment that works much like a float, except that it doesn’t float.  That is, in fact, I’d like to be able to define an environment that has a label and a caption.  I explicitly do not want to use a floating environment, though. For one thing, floats do many things fancy which I just don’t need, nor want (such as spacing) and for another, floats have their share of problems (for example consider the problem of ).  Is there a ready-made way to achieve this? Of course, I could always write my own based on the result of the other answer, i.e. harnessing \refstepcounter. But I’m not sure how to use that, documentation is scarce, and I’d prefer an existing solution. I want to add this iostat command to my .bashrc and create an alias for it: iostat -xk 2 $(findmnt -T ~ | awk 'END {print $2}')  I'm adding this to my .bashrc: alias ios='iostat -xk 2 $(findmnt -T ~ | awk 'END {print $2}')'  Unfortunately, it doesn't work. If I run the above iostat command in a terminal it works, but when I run the ios alias it no longer works. And yes, I restart my shell every time. What's a common interjection for the reaction to something creepy and disgusting (like some insects or spooky places, etc.)? Historical flight data outside of the USA? How to calculate stays against 90/180 visa rules? Some destinations have a "90/180 rule" which says you can come and go but you must not spend over 90 days out of any 180 days in the area.  concerns this rule.  At least Schengen and Turkey have this rule, probably depending on where the traveller is from and what kind of visa they apply for.  Maybe I'm a dummy but I've always had a lot of trouble trying to add up how many days I've spent in such places when I've entered and left several times over recent months.  Is there an easy way to do this I'm missing or is it difficult for everybody? I'm guessing something based on counting backwards from the end date might be the trick?  Maybe you know of an app or website that can do this for you. Is there a RegExp.escape function in JavaScript? Is "double hashing" a password less secure than just hashing it once? Is hashing a password twice before storage any more or less secure than just hashing it once?  What I'm talking about is doing this:  $hashed_password = hash(hash($plaintext_password));   instead of just this:  $hashed_password = hash($plaintext_password);   If it is less secure, can you provide a good explanation (or a link to one)?  Also, does the hash function used make a difference?  Does it make any difference if you mix md5 and sha1 (for example) instead of repeating the same hash function?  Note 1:  When I say "double hashing" I'm talking about hashing a password twice in an attempt to make it more obscured.  I'm not talking about the .  Note 2:  I know I need to add a random salt to really make it secure.  The question is whether hashing twice with the same algorithm helps or hurts the hash. ...where each object also has references to other objects within the same array?  When I first came up with this problem I just though of something like   var clonedNodesArray = nodesArray.clone()   would exist and searched for info on how to clone objects in javascript. I did find a  on StackOverflow (answered by the very same @JohnResig) and he pointed out that with jQuery you could do  var clonedNodesArray = jQuery.extend({}, nodesArray);   to clone an object. I tried this though, this only copies the references of the objects in the array. So if I   nodesArray[0].value = "red" clonedNodesArray[0].value = "green"   the value of both nodesArray[0] and clonedNodesArray[0] will turn out to be "green". Then I tried  var clonedNodesArray = jQuery.extend(true, {}, nodesArray);   which deep copies an Object, but I got "too much recursion" and "control stack overflow" messages from both Firebug and Opera Dragonfly respectively.  How would you do it? Is this something that shouldn't even be done? Is there a reusable way of doing this in Javascript? In Bash, two integers can be compared using conditional expression     arg1 OP arg2      OP is one of -eq, -ne, -lt, -le, -gt, or -ge. These   arithmetic binary operators return true if arg1 is equal to, not equal   to, less than, less than or equal to, greater than, or greater than or   equal to arg2, respectively. Arg1 and arg2 may be positive or negative   integers.   or arithmetic expression:     &lt;= &gt;= &lt; &gt; comparison      == != equality and inequality   Why do we have two different ways for comparing two integers? When to use which?  For example, [[ 3 -lt 2 ]] uses conditional expression, and (( 3 &lt; 2 )) uses arithmetic expression. Both returns 0 when the comparison is true  When comparing two integers, can these two methods always be used interchangeably? If yes, why does Bash have two methods rather than one? How can I minimize Thunderbird 60.2.1 to tray after "MinimizeToTray revived" add-on stopped working? After update, my Thunderbird stopped getting minimized with the "MinimizeToTray revived" add-on. Is there any way to minimize my Thunderbird? Any other add-on that works with the new version? The iOS-app should provide (at least) the same features as the site and the ability to edit your profile is not so unimportant.  In my opinion, the user should be able to change the every single info-field in his profile (including, but not limited to nickname, description, profile picture) by pressing an "Edit" button which should be located somewhere on his or her profile view. Export nodes from Drupal 4? What's the difference between "uname -r" and "uname -v"? I think I have managed to work this out, however there is no solution provided with the question so I thought it best to check.   My working:  Let $(x,y) \in (A \times B) \cup (C \times D)$  $\Rightarrow x \in (A$ or $C)$ and $y \in (B$ or $D)$  $\Rightarrow (x, y) \in (A \cup C) \times (B \cup D)$  $\Rightarrow (A \times B) \cup (C \times D) \subseteq (A \cup C) \times (B \cup D)$  Now let $(x,y) \in (A \cup C) \times (B \cup D)$  $\Rightarrow x \in (A$ or $C) $ and $y \in (B$ or $D)$  $\Rightarrow (x, y ) \in (A \times B) \cup (A \times D) \cup (C \times B) \cup (C \times D)$  $\Rightarrow (A \cup C) \times (B \cup D) \nsubseteq (A \times B) \cup (C \times D)$  $\Rightarrow (A \times B) \cup (C \times D) \not= (A \cup C) \times (B \cup D)$  Is this correct?  Thank you. Self-Contained Proof that $\sum\limits_{n=1}^{\infty} \frac1{n^p}$ Converges for $p > 1$ What does it mean to "program to an interface"? I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?