How do I check if string contains substring?
How to check whether a string contains a substring in JavaScript?
Who can see what in my profile? When editing my user profile (name, date of birth, etc.), how can I tell which information can be seen by other users (publicly visible) and what is only used by the system (and how it's used)? What is the importance of the Diophantine inequality $\frac{1}{p} + \frac{1}{q} + \frac{1}{r} > 1$? In Humphreys' book  Introduction to Lie algebras and Representation Theory(3rd printing, p.62), the Diophantine inequality $$\frac{1}{p} + \frac{1}{q} + \frac{1}{r} &gt; 1$$ appeared while classifying all Coxeter graphs of irreducible root systems. Under the assumption $p \geq q \geq r \geq 2 $, the possible triples turn out to be $(p,2,2), (3,3,2),(4,3,2),(5,3,2)$, which correspond to the Coxeter graph $\text{D}_{p+2}, \text{E}_6, \text{E}_7, \text{E}_8$, respectively.  It seems quite straightforward to solve the inequality in positive integers, but Humphreys said that      This inequality, by the way, has a long mathematical history.   without further comment. So I want to know if this Diophantine inequality has any important significance, or if it has appeared in other context (maybe relevant history) before. Mac OS X Darwin: how to reset admin password? What is it called when you use many words to describe the word you want to use? What is it called when you use many words to describe the word you want to use?  I know there is a technical word that's used in foreign language acquisition that means using many words to describe a word you don't know.  I'm doing it now, just talking and beating around the bush until someone can tell me the word I'm looking for. "Geometric" or "Geometrical"? I have read the excellent answers to  - my question is specifically about usage.   Is there a best practice for deciding between the variants geometric and geometrical in writing? A  shows that geometrical was more popular until about 1965, when they switched. What grammatical rules, if any, would be relevant here? Interpretation of simple predictions to odds ratios in logistic regression I'm somewhat new to using logistic regression, and a bit confused by a discrepancy between  my interpretations of the following values which I thought would be the same:    exponentiated beta values  predicted probability of the outcome using beta values.    Here is a simplified version of the model I am using, where undernutrition and insurance are both binary, and wealth is continuous:  Under.Nutrition ~ insurance + wealth   My (actual) model returns an exponentiated beta value of .8 for insurance, which I would interpret as:     "The probability of being undernourished for an insured individual is .8 times the probability of being undernourished for an uninsured individual."   However, when I calculate the difference in probabilities for individuals by putting in values of 0 and 1 into the insurance variable and the mean value for wealth, the difference in undernutrition is only .04. That is calculated as follows:   Probability Undernourished = exp(β0 + β1*Insurance + β2*Wealth) /                              (1+exp(β0 + β1*Insurance + β2*wealth))   I would really appreciate it if someone could explain why these values are different, and what a better interpretation (particularly for the second value) might be.     Further Clarification Edits As I understand it, the probability of being under-nourished for an uninsured person (where B1 corresponds to insurance) is:  Prob(Unins) = exp(β0 + β1*0 + β2*Wealth) /               (1+exp(β0 + β1*0+ β2*wealth))   While the Probability of being under-nourished for an insured person is:  Prob(Ins)= exp(β0 + β1*1 + β2*Wealth) /            (1+exp(β0 + β1*1+ β2*wealth))   The odds of being undernourished for an uninsured person compared to an insured person is:  exp(B1)   Is there a way to translate between these values (mathematically)? I'm still a bit confused by this equation (where I should probably be a different value on the RHS):  Prob(Ins) - Prob(Unins) != exp(B)   In layman's terms, the question is why doesn't insuring an individual change their probability of being under-nourished as much as the odds ratio indicates it does?  In my data, Prob(Ins) - Prob(Unins) = .04, where the exponentiated beta value is .8 (so why is the difference not .2?) I need to process a large file, around 400K lines and 200 M. But sometimes I have to process from bottom up. How can I use iterator (yield return) here? Basically I don't like to load everything in memory. I know it is more efficient to use iterator in .NET. Integration of $\int\frac{1}{x^{4}+1}\mathrm dx$ I'm new to tikz-qtree, and can't find an automatic way to do something that qtree did very nicely.  With qtree, if you don't have a label for a single intermediate node, you get a straight line from the grandmother to the granddaughter.  With tikz-qtree, you get a "kink".  Compare the following:  With qtree:  \documentclass{article} \usepackage{qtree}  \begin{document}  \Tree [ Wiiiiiiiiiide [ nar- -row ] ]  \Tree [ nrw [ wiiiiiiiiiiiii- -iiiiiiiiiiiide ] ]  \end{document}   With tikz-qtree  \documentclass{article} \usepackage{tikz,tikz-qtree}  \begin{document}  \Tree [ Wiiiiiiiiiide [ nar- -row ] ]  \Tree [ nrw [ wiiiiiiiiiiiii- -iiiiiiiiiiiide ] ]  \end{document}   Is there any way to get the nice straight line in tikz-qtree, or do I have to adjust it manually?  Thanks in advance. Dump of my own Stack Exchange content Is there a way to quickly save all my Stack Exchange content across all Stack Exchange sites, as hundreds of HTML pages? (for me probably 15 or 20 sites: SO, dsp.SE, unix.SE, etc.)?  The ideal way would be one .HTML file for each question that I asked / answered / commented? What would be the ideal tool for that?    Remark: I've already read interesting questions like  but it doesn't exactly answer my concern here. Proving $\sqrt2$ is irrational I used the method of contradiction by assuming that $\sqrt 2$ is a rational number. Then, by the definition of rational number, there exist two integers $p$ and $q$ whose ratio equals $\sqrt 2$. Thus, $$\frac pq = \sqrt2\tag{x}$$  Squaring both sides, $$p^2/q^2 = 2\tag{a}$$  or $$p^2 = 2q^2\tag{b}$$ This means that $p^2$ is an even number, implying that $p$ is even.  Now, any even integer can be written as $2^kf$ where $f$ is any odd integer and $k$ is some positive integer (the minimum value of $k$ and $f$ is $1$ since even numbers start from $2 = 2^1\cdot1$). For odd numbers, $k=0$.  For example, $8 = 2^3 \cdot 1$, $4= 2^2 \cdot 1$, $18= 2^1 \cdot 9$, $24 = 2^3 \cdot 3$, $-12= 2^2 \cdot(-3)$, etc.  Now, from $(b)$, $q^2$ can be even or odd.  Case 1: $q^2$ is even (thus meaning $q$ is even). Then $p= 2^{k_1} \cdot f_1$ (say) and $q = 2^{k_2} * f_2$ (say). Note here in this case, both conditions $k_1=k_2$ and $f_1=f_2$ can't hold simultaneously since that would mean $p/q =1$ and here $p/q =\sqrt2$ (from $(x)$)). Let's consider the condition when $k_1=k_2=k$ but $f_1\ne f_2$. Then $$\frac{p^2}{q^2}=\frac{(2^kf_1)^2}{(2^kf_2)^2} = \frac{f_1^2}{f_2^2} =2$$ (from $(a)$), i.e.: odd/odd ($f_1$ and $f_2$ are odd) can never equal $2$.  Now lets consider $f_1=f_2=f$ but $k_1\ne k_2$, thus $(2^{k_1}f)^2/(2^{k_2}f)^2= 2^{2(k_1-k_2)}= 2$ meaning $k_1 - k_2 = 0.5$ but $k_1,k_2$ are integers, so their difference can't be $0.5$. (Also here, $k_1-k_2$ must be greater or equal to $1$ since $2^{k_1-k_2}=\sqrt 2$, $k_1-k_2$ can't be negative since $\sqrt 2&gt;1$, but $k_1-k_2\ge1$ can't satisfy $(a)$ since the minimum value of $p/q$ in this case will be $2$ which is surely greater than $\sqrt2$.)  Now lets consider $f_1\ne f_2$ and $k_1\ne k_2$, thus $\frac{(2^{k_1} f_1)^2}{(2^{k_2} f_2)^2}= 2^{2(k_1-k_2)}\frac{f_1^2}{f_2^2}$ can never equal $2$ since $\frac{f_1^2}{f_2^2}$ is either odd or "odd/odd" ie: it doesn't contain 2 as a factor and $2^{2(k_1-k_2)}$ is a power of $2$. So in $2^{2(k_1-k_2)}\frac{f_1^2}{f_2^2}$, there's no chance of cancellation of the odd factor $\frac{f_1^2}{f_2^2}$.  Case 2: $q^2$ is odd (thus meaning $q$ is odd). $q=f'$ (say, here $k=0$ for $q$ but not for $p$), thus from $(a)$ $2^{2k}\frac{f^2}{f'^2} = 2$ but this isn't possible since a power of $2$ multiplied with odd factor can't equal $2$.  Thus, both case 1 and 2 suggest that for any possible combination of $k_1,k_2,f_1$ and $f_2$, $p/q\ne\sqrt2$, i.e.: for no value of integers $p$ and $q$, $p/q = \sqrt2$. Thus, this contradicts our assumption that $\sqrt2$ is rational. Therefore it must be irrational.  PLS NOTE that i would like to clarify that $f_1^2$/$f_2^2$ is either an odd integer or a fraction of odd/odd or 1/odd form, thus not containing  2 as a factor,for any $2^n$, if it has to be reduced to 2 , must be multiplied with $1/ 2^(n-1)$ but $f_1^2$/$f_2^2$ can't be of $1/2^[n-1]$ form since for odd nos, in $2^k$*f notation, k is 0 , so 2 vanishes as $2^k$ becomes 1 in this case thus f1/f2 can't be represented as  1/ $2^(n-1)$ in which n has to be existent.  therefore $2^{2(k_1-k_2)}\frac{f_1^2}{f_2^2}$ can never equal 2 as to further explain the 3rd condition of case 1  Difficulty: is my approach correct? This proof which I thought is different from proofs found on the internet or books since I have used $p$ and $q$ as any integers, which may have a common factor. So I am not sure if I am on right track. Will someone please check this out and make kind comments? Objective-C Static Class Level variables Several wands and other magic items in the DMG cite &quot;spellcaster&quot; as an attunement requirement, specifically &quot;requires attunement by a spellcaster&quot; while others list multiple spellcasting classes (e.g., a Staff of Fire &quot;requires attunement by a druid, sorcerer, warlock, or wizard&quot; p. 201). However, all the DMG states in this regard is:  Some magic items require a creature to form a bond with them before their magical properties can be used. This bond is called attunement, and certain items have a prerequisite for it. If the prerequisite is a class, a creature must be a member of that class to attune to the item.¹ (If the class is a spellcasting class, a monster qualifies if that monster has spell slots and uses that class's spell list. [emphasis and footnote added] (p. 136)  The language of the Mage Slayer feat describes a spellcaster as a creature casting or concentrating on a spell.  You have practiced techniques useful in melee combat against spellcasters [...] When a creature within 5 feet of you casts a spell ... [and] When you damage a creature that is concentrating on a spell ... (PHB, p. 168)  From the above, it does not appear that &quot;spellcaster&quot; would necessarily be considered a class or group of classes, so Are characters that can cast spells, regardless of their class(es), considered spellcasters? Or, put another way, Does &quot;spellcaster&quot; (as an attunement prerequisite) mean any creature who can cast a spell or does it mean all classes with the Spellcasting feature? I can think of five particular cases—innate abilities, two subclasses and two feats: High Elves know one wizard cantrip (0-level spell) of their choice. Drow can cast the dancing lights cantrip, 1st-level spell faerie fire and 2nd-level spell darkness. Forest Gnomes know the minor illusion cantrip, and Tieflings can cast the thaumaturgy cantrip and 2nd-level spells hellish rebuke and darkness. Also, many monsters have innate spellcasting abilities, which would trigger the Mage Slayer feat. Starting at 3rd level, both the Eldritch Knight (Fighter Martial Archetype) and Arcane Trickster (Roguish Archetype) gain the ability to cast wizard spells and gain wizard spell slots (potentially) up to 4th-level spells. PHB, pp. 75 &amp; 98. The latter's 17th-level Spell Thief feature also states &quot;you gain the ability to magically steal the knowledge of how to cast a spell from another spellcaster,&quot; (Ibid.) which strongly implies that (at least) the Arcane Trickster is a spellcaster, although neither subclass is specifically listed as a prerequisite for any magic item in the DMG. Eldritch Knight and Arcane Trickster are also found under Multiclassing, Spell Slots in the PHB:  You determine your available spell slots by adding together all your levels in the bard, cleric, druid, sorcerer, and wizard classes, half your levels (rounded down) in the paladin and ranger classes, and a third of your fighter or rogue levels (rounded down) if you have the Eldritch Knight or the Arcane Trickster feature. (p. 164)  With the Ritual Caster feat, a character chooses a spellcasting class (except paladin or ranger) and gains the ability to cast spells of that class with the ritual tag as rituals. The character immediately gets two 1st-level ritual spells of that class and has the potential to (eventually) learn all of the ritual spells of the chosen class. PHB, p. 169. With the Magic Initiate feat, a character chooses a particular spellcasting class (except paladin or ranger) and immediately learns two cantrips and one 1st-level spell from the class with no further advancement. PHB, p. 168. By definition, it seems all of the above would qualify as spellcasters, but I feel spellcaster typically (or maybe traditionally) refers to bard, cleric, druid, paladin, ranger, sorcerer, warlock and wizard.   I believe an exception would be a 13th level or higher Thief (Roguish Archetype) due to the Use Magic Device feature. PHB, p. 97. I'm desperatly confused by notations and formulations so if someone could clarify the following things a little Í would be deeply grateful. The Lie algebra $\mathfrak{so}(1,3)_+^{\uparrow}$ of the proper orthochronous Lorentz group $SO(1,3)_+^{\uparrow}$ is given by \begin{equation} [J_i,J_j]=i \epsilon_{ijk} J_k \end{equation} \begin{equation} [J_i,K_j]=i \epsilon_{ijk} K_k \end{equation} \begin{equation} [K_i,K_j]=- i \epsilon_{ijk} J_k \end{equation} We can now define new generators with the old ones $N^{\pm}_i= \frac{1}{2}(J_i \pm i K_i)$ which satisfy \begin{equation} [N^{+}_i,N^{+}_j] = i \epsilon_{ijk} N^{+}_k ,\end{equation} \begin{equation} [N^{-}_i,N^{-}_j] = i \epsilon_{ijk} N^{-}_k ,\end{equation} \begin{equation} [N^{+}_i,N^{-}_j] = 0. \end{equation} where we can see that $N^{+}_i$ and $N^{-}_i$ make up a copy of the Lie algebra $\mathfrak{su}(2)$ each. My problem is to get what is going one here mathematically precise. Are the following statements correct and if not why:  When we build the new operators from the old generators we complexified $\mathfrak{so}(1,3)_+^{\uparrow}$ \begin{equation}(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} = \mathfrak{so}(1,3)_+^{\uparrow}\otimes \mathbb{C} \end{equation} We saw that $\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C}$ is isomorph to two copies of the complexified Lie algebra of $\mathfrak{su(2)}$: $(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} \simeq \mathfrak{su(2)}_{\mathbb{C}} \oplus \mathfrak{su(2)}_{\mathbb{C}} $. Where exactly did we need that $\mathfrak{su(2)}$ is complexified here? The Lie algebras defined by $N^{\pm}_i$ are exactly those of $\mathfrak{su(2)}$ and we never use complex linear combination of $N^{\pm}_i$ or am I wrong here? $\mathfrak{su(2)}_{\mathbb{C}}$ is isomorph to $(\mathfrak{sl}(2,\mathbb{C}))_\mathbb{C}$: \begin{equation}\mathfrak{su(2)}_{\mathbb{C}} \simeq (\mathfrak{sl}(2,\mathbb{C}))_\mathbb{C} \end{equation} Here $(\mathfrak{sl}(2, \mathbb{C}))_\mathbb{C}$ denotes the complexified Lie algebra of $SL(2,\mathbb{C})$ Is $(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} \simeq (\mathfrak{sl}(2, \mathbb{C}))_\mathbb{R}$ correct?  Here $(\mathfrak{sl}(2, \mathbb{C}))_\mathbb{R}$ denotes the real Lie algebra of $SL(2,\mathbb{C})$ Is $(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} \simeq (\mathfrak{sl}(2, \mathbb{C}))_\mathbb{C} \oplus (\mathfrak{sl}(2, \mathbb{C}))_\mathbb{C}$ correct?  I looked this topic up in different books and each seemed to state something different. One book even used three differrent versions of $\mathfrak{sl}(2,\mathbb{C}) $ namely: $\mathfrak{sl}(2,\mathbb{C}) $, $(\mathfrak{sl}(2,\mathbb{C}))_\mathbb{C}$ and $(\mathfrak{sl}(2,\mathbb{C}))_\mathbb{R}$.  states simply that $\mathfrak{sl}(2,\mathbb{C}) $ is the complexification of $\mathfrak{su(2)}$ without making any reference to $SL(2,\mathbb{C})$ which does not help me either. Any help would be great. Calculating the average area of the states listed in states.txt Need someone to calculate the average area, in square miles, of the states listed in states.txt. States.txt (file): State           Population   SqMi      Region  ------------------------------------------ California           39.37   163.7       West Texas                29.36   268.6      South Florida              21.73    65.7      South New_York             19.33    54.7  NorthEast Pennsylvania         12.78    46.1  NorthEast Illinois             12.59    57.9    Midwest Ohio                 11.69    44.8    Midwest Georgia              10.71    59.4      South North_Carolina       10.60    53.8      South Michigan             9.97    96.7    Midwest  Output should look like this: Average Area: 82.85 square miles  Note my awk program will be ran like this: awk –f &lt;file.awk&gt; states.txt How do I check the integrity of a storage medium (hard disk or flash drive)? I've run across (personally or by proxy) a bunch of storage media that exhibited physical problems during their life. Hard disks, solid state drives and other flash storage media all fail after some time. The situation is worse with USB flash drives and flash cards because of the large amount of suppliers with inferior flash cell and flash controller quality.  How can I reliably detect if a storage drive suffers from physical damage?  Note that this question isn't about file system integrity (which can be checked with ). Footnote to a footnote How can I make a footnote to a footnote? E.g.,  Playfair's axiom\footnote{so called in honor of mathematician John Playfair, etc, etc., but was actually discovered by Proclus\footnote{Greek mathematician, etc, etc.}} I'm trying to measure the execution time of a process that I call via the command line (i.e., I want to find out how long it takes to for the process to finish). Is there any command that I can add to the command calling the process that will achieve this? Why do some adjectives follow the nouns they modify? Right now I can only think of one instance in which this regularly occurs.  The adjective proper is sometimes placed after the noun it modifies, e.g:      A class of cold-blooded oviparous or ovoviviparous vertebrated animals whose skin is covered with scales or scutes; the reptiles proper.   What is this word order called, and why is it ever used?  Edit: I really want to know about proper, and while the word hyperbaton relates to post-positivity when it is meant to be rhetorically impacting, it doesn't seem to fit with ubiquitous post-positivity, such as that of proper.  I've accepted hyperbaton as the correct term/reason for almost all post-positive constructions, but I'd like a complete answer to include proper. If granted omniscience and we know that $\beta_1$ in a multiple linear regression model is truly 0, what does that mean in words (and math notation)?  The model is: $Y = \beta_0 + \beta_1X_1 + \beta_2X_2 + \epsilon$  Does $\beta_1 = 0$ mean:   Empirically: "If we make infinite, perfect measurements of our data, $\hat\beta_1$ approaches 0 at the limit?" [Math: ??] Formally: "In the true, finite population of our data, $X_1$ has 0 association with $Y$ and their vectors of values are perfectly linearly independent, uncorrelated, and orthogonal?" [Math: ??]   What does $\beta_1 = 0$ mean, precisely?