How to check the array list has contains value??  for example:  var number = [1, 9, 9, 4];  if(number == [1, 9, 9, 4]){ //true} else if(number == [2, 1, 5, 4){ //false;} else if(number == [9, 1, 4, 9){ //false;}   if there any method to see to check the array list has contains value eg"1994"?? Thank you very much!!!!
What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: function contains(a, obj) {     for (var i = 0; i &lt; a.length; i++) {         if (a[i] === obj) {             return true;         }     }     return false; }  Is there a better and more concise way to accomplish this?
Trying to figure what language this PDA (pushdown automata) accepts I have the following PDA and I can't figure our what words it accepts, would like to get some help with figuring this out.    Of course it only accepts if that stack is empty in the accepting state. How to align prices in columns when both 2 digit and 4 digit variations of a price exist? How do remove "Ignoring file in directory /etc/apt/sources.list.d/ as it has an invalid filename extension? I have put a bounty on , however I don't see it appear in the  (also not when I'm not logged in).  Why is this. Aren't all bounty questions supposed to be visible there? A positive alternative to "smelling" to describe something with a pleasant odor When one hears that something smells, one would generally assume that it smells bad.   Isn't there a word which wouldn't bring to mind the idea of a bad odor? For example, how would you describe pot-pourri (assuming you like the smell of pot-pourri)? If possible, I would like an adjective, or a word that could takes the place of an adjective. iPhone 7 Plus takes days to turn on showing Apple logo or black screen I’ve had this issue for months but in the last couple of days it’s got very very bad.  When my phone runs out of battery it needs like 2–3 days to turn back on. At the beginning of this problem the phone would need about 1h. Every time when my phone goes off again the time to switching on goes up.  What does this all look like? Well, when my phone died I put it on the charger, then the logo appears and goes off. When it goes off, a black screen pops out with a little white line on in it, then it turns on back to Apple logo. It keeps doing this until it turns on which is 1 or 2 even now 3 days.  I tried to restore it and also update it but nothing happens, literally nothing happened. What is different about the Mac ISO image? At that location there is an ISO image which is described as "This image is adjusted to work properly on Mac systems."  What specific problems on the Mac does this image address that the standard images don't? I ask because I need to know which ISO to recommend to Apple Mac users. Which IP address do I use to access my server? I'm running a Samba server on my MacBook and I've also set up port forwarding to said server from my router.  My public IP is 106.51.x.x (according to google and a few other services) and my Mac's local IP is 192.168.x.x, but when I head to my router's configuration page, it says my external IP is 10.242.x.x.  This is what I don't understand, when connected to my home WiFi, using the 10.242.x.x address works just fine. But if I try to access the same over 4G, the connection times out.  As for the public address, neither WiFi nor 4G works.  Is there some setting on my Mac (I'm running MacOS Sierra) that I must alter to make it visible to the public? Let $f:[0;1]\to\mathbb R$ be continiously differentiable Why is fundamental group insufficient to classify manifolds? Intuition for groups This is quite a non-standard question, certainly for mathematics, though I believe it is no less important (for me and my peers, i.e. grads).  The course I am reading so far introduced us to Groups, rings, fields, etc. in the first year, progressing to characters, reps etc in the latter years.  However, even with representation theory I still don't feel like I have a good intuition.  How do you gain intuition in such an area. I know there will be a response of doing examples, but this doesn't really help - I've done lots already.  Am I doomed. Removal of statistically significant intercept term increases $R^2$ in linear model Finishing a proof: $f$ is injective if and only if it has a left inverse I've already done a lot of searching (in particular: ) to try to prove this statement:      $f: A \to B$ is injective if and only if it has a left inverse. [I'm going to also assume $A$ and $B$ are nonempty.]   My attempt so far:     $\Leftarrow$ Suppose $f$ has a left inverse and $f(a_1) = f(a_2)$ for    $a_1, a_2 \in A$. Then there is a function $g: B \to A$ such that   $g\left(f(a_1)\right) = a_1$ and $g\left(f(a_2)\right) = a_2$. Since   $g$ is well-defined, it follows that $g\left(f(a_1)\right) =  g\left(f(a_2)\right)$, and hence $a_1 = a_2$.         $\Rightarrow$Now   suppose $f$ is injective. Then $f(a_1) = f(a_2) \implies a_1 = a_2$.   Furthermore, since $A$ is nonempty, there is an element $x \in A$.   Define $g: B \to A$ by  \begin{equation*} g(b) = \begin{cases}  f^{-1}(b), &amp; b \in \text{Im}(f) \\ x, &amp; b \in A \setminus  \text{Im}(f)\text{.} \end{cases} \end{equation*} This mapping is   well-defined, since if $f$ is injective, $f^{-1}(b)$ is unique.   My main question: does this imply that if $f: A \to B$ is injective that any mapping $g: \text{Im}(f) \to A$ is bijective? Otherwise, I don't understand why we can even use $f^{-1}$ on an element. [Please read the link above for more details - in proof 1.] I would like to be able to transpose a tabular(x) table like in the following example. It is not necessary to be completely automated, but I don't want to change the data order, which is a painful and stupid. By "not completely automated" I mean that e.g. the headers can be done seperately etc.  Let's see the MWE:  \documentclass{article}  \usepackage{booktabs} \def\Midrule{\midrule[\heavyrulewidth]}  \begin{document}  \centering  \begin{tabular}{*6c}\toprule \bfseries Name &amp; Alice &amp; Bob &amp; Chuck &amp; Dave &amp; Eve\\\Midrule \bfseries Sex &amp; Female &amp; Male &amp; Male &amp; Male &amp; Female\\\midrule \bfseries Age &amp; 18 &amp; 19 &amp; 20 &amp; 21 &amp; 22\\\bottomrule \end{tabular}  \bigskip  Which I want to look like  \bigskip  \begin{tabular}{*3c}\toprule \bfseries Name &amp; \bfseries Sex &amp; \bfseries Age\\\Midrule Alice &amp; Female &amp; 18\\\midrule Bob &amp; Male &amp; 19\\\midrule Chuck &amp; Male &amp; 20\\\midrule Dave &amp; Male &amp; 21\\\midrule Eve &amp; Female &amp; 22\\\bottomrule \end{tabular}   \end{document}     Note: I know that , but I would like to get it without expl3 (mostly because people would might use my code quite often have an old LaTeX installed and I cannot be convincing them to change this). From A Classical Introduction to Modern Number Theory by Ireland and Rosen, page 33:     Corollary 1 (Euler's Theorem). If $(a,m) = 1$, then $a^{\phi(m)} \equiv 1\,(m)$.      Proof. The units in $\mathbb{Z}/m\mathbb{Z}$ form a group of order $\phi(m)$. If $(a,m) = 1$, $\bar{a}$ is a unit. Thus $\bar{a}^{\phi(m)} = \bar{1}$ or $a^{\phi(m)} \equiv 1\,(m)$.   If I'm interpreting this correctly, this proof implicitly uses the fact(?) that if $G$ is a group and $x\in G$, then $x^{|G|}=1$, where $1$ is the identity element of $G$.  If this is indeed true, can someone explain why? (I have had no prior exposure to group theory.) The Complete Rate-Limiting Guide System program problem detected? Xml validation using XSD schema The following code helps me validate an XML file with an XSD schema.  XmlReaderSettings settings = new XmlReaderSettings(); settings.Schemas.Add(null, xsdFilePath); settings.ValidationType = ValidationType.Schema; settings.ValidationEventHandler += new System.Xml.Schema.ValidationEventHandler(settings_ValidationEventHandler); XmlDocument document = new XmlDocument(); document.Load(xmlFilePath); XmlReader rdr = XmlReader.Create(new StringReader(document.InnerXml), settings);  while (rdr.Read()) {  } isValid = true;   The ValidationEventHandler also tells me what the errors are, but doesn't tell me on 'where' or 'on which line' they are located. Is there any way to get the line number where the XML fails to be validated? Reference — What does this symbol mean in PHP? Calculating de Broglie wavelength