The following statement is written in :  if the g flag is not used, only the first complete match and its related capturing groups are returned. In this case, the returned item will have additional properties as described below.  Then, below the &quot;Additional properties&quot; subchapter is stated this:  As explained above, some results contain additional properties as described below.  groups: An array of named capturing groups or undefined if no named capturing groups were defined. See Groups and Ranges for more information. index: The index of the search at which the result was found. input: A copy of the search string.   However, when I execute the , the console.log output doesn't seem to be what is expected in the snippet comments.   var str = 'For more information, see Chapter 3.4.5.1'; var re = /see (chapter \d+(\.\d)*)/i; var found = str.match(re);  console.log(found);  // logs [ 'see Chapter 3.4.5.1', //        'Chapter 3.4.5.1', //        '.1', //        index: 22, //        input: 'For more information, see Chapter 3.4.5.1' ]  // 'see Chapter 3.4.5.1' is the whole match. // 'Chapter 3.4.5.1' was captured by '(chapter \d+(\.\d)*)'. // '.1' was the last value captured by '(\.\d)'. // The 'index' property (22) is the zero-based index of the whole match. // The 'input' property is the original string that was parsed.    Why the additional properties of String#match (or RegExp#exec, as the result is said to be same) are not in the returned result? Is this feature planned but not implemented today?  Found out that's the SE Overflow's snippet console that doesn't output these properties. An issue has been opened on .
I want to match a portion of a string using a  and then access that parenthesized substring:  var myString = "something format_abc"; // I want "abc"  var arr = /(?:^|\s)format_(.*?)(?:\s|$)/.exec(myString);  console.log(arr);     // Prints: [" format_abc", "abc"] .. so far so good. console.log(arr[1]);  // Prints: undefined  (???) console.log(arr[0]);  // Prints: format_undefined (!!!)   What am I doing wrong?    I've discovered that there was nothing wrong with the regular expression code above: the actual string which I was testing against was this:  "date format_%A"   Reporting that "%A" is undefined seems a very strange behaviour, but it is not directly related to this question, so I've opened a new one, .    The issue was that console.log takes its parameters like a printf statement, and since the string I was logging ("%A") had a special value, it was trying to find the value of the next parameter.
I do not know how to prove this question: $m^{\phi(n)}+n^{\phi(m)}\equiv 1 \pmod {mn}$ where $m$ and $n$ are relatively prime.  Can anyone help? How can I access the apache basic-auth username in a PHP script? I have over 400 open-ended responses. The total has been coded by one rater, and a 10% identical sample of the total has been coded by 2 raters. There is a choice of 14 nominal codes, of which the rater can use any number per case, though most cases have between 1-4 codes. Which statistical test is the most appropriate to determine if I have inter-rater agreement on the 10% sample?   Also am I right in assuming that I will need to treat each code as a variable and look for the level of agreement for each variable?   I'm using SPSS 21.  Much thanks, Kellie How should a physics student study mathematics? Note: I will expand this question with more specific points when I have my own internet connection and more time (we're moving in, so I'm at a friend's house).  This question is broad, involved, and to some degree subjective.  (I started out as a physics-only student, but eventually decided to add a mathematics major. I am greatly interested in mathematics; the typical curriculum required for physics students is not deep or thorough enough; mathematics is more general (that means work!); and it only requires a few more classes. Naturally, I enjoy  immensely.)  This question asks mainly of undergraduate-level study, but feel free to discuss graduate-level study if you like.  Please do not rush your answer or try to be comprehensive. I realize the StackOverflow model rewards quick answers, but I would rather wait for a thoughtful, thorough (on a point) answer than get a fast, cluttered one. (As you probably know,  produces clear, useful writing; and a properly-done comprehensive answer would take more than a reasonable amount of time and effort.) If you think an overview is necessary, that is fine.  For a question this large, I think the best thing to do is focus on a specific area in each answer.    Update: To Sklivvz, Cedric, Noldorin and everyone else: I had to run off before I could finish, but I wanted to say I knew I would regret this; I was cranky and not thinking clearly, mainly from not eating enough during the day. I am sorry for my sharp responses and for not waiting for my reaction to pass. I apologize.  Re: Curricula:   Please note that I am not asking about choosing your own curriculum in college or university. I did not explicitly say that, but several people believed that was my meaning. I will ask more specific questions later, but the main idea is how a physics student should study mathematics (on his or her own, but also by choosing courses if available) to be a competent mathematician with a view to studying physics.  I merely mentioned adding a mathematics major to illustrate my conclusion that physics student need a deeper mathematical grounding than they typically receive.   And now I have to run off again. When given $p = 5, q = 11, N = 55$ and $e = 17$, I'm trying to compute the RSA private key $d$.  I can calculate $\varphi(N) = 40$, but my lecturer then says to use the extended Euclidean algorithm to compute $d$. That's where I get stuck.    Here's my work so far:  First I use the Euclid algorithm to calculate:  40 = 2(17) + 6  17 = 2(6) + 5 6 = 1(5) + 1 = gcd   So I know the GCD is 1. Applying the 'extended' section of the algorithm:  6 = 40-2(17) 5 = 17-2(6) 1 = 6-1(5) 1 = 6-1(17-2(6)) 3(6) = 1 (17) 3(40 - 2(17)) - 1(17) 3(40) - 3(17)   I know the answer is $33$, but I have no idea how to get there using the extended Euclidean algorithm. I can't figure out why I'm getting $3(40) - 3(17)$ when I know the answer should contain $33$. Overview of basic facts about Cauchy functional equation The  asks about functions $f \colon \mathbb R \to \mathbb R$ such that $$f(x+y)=f(x)+f(y).$$ It is a very well-known functional equation, which appears in various areas of mathematics ranging from exercises in freshman classes to constructing useful counterexamples for some advanced questions. Solutions of this equation are often called . Also a few other equations related to this equation are often studied. (Equations which can be easily transformed to Cauchy functional equation or can be solved by using similar methods.) Is there some overview of basic facts about Cauchy equation and related functional equations - preferably available online? I want to learn to use biper and biblatex in Lyx. This is how I would do it in LaTeX traditionally with biblatex and biber  \documentclass[12pt,a4paper,oneside,pdftex]{report} \usepackage[backend=biber]{biblatex} \addbibresource{minCuts.bib} ... \printbibliography \end{document}   The error is apparently originating from the \bibliographystyle command and biblatex package getting mixed, by . But I have no \bibliographystyle command in Preamble so they should not be mixed unless Lyx is somehow importing the \bibliographystyle.   How to resolve the biblioraphystyle error in Lyx with Biber and Biblatex?    Settings by the instructions  and Error        Document > Settings > Bibliography > Biber                  In Document > Settings > LaTeX Preamble                   Insert > List / TOC > BibTeX Bibliography...                        Package biblatex Error : '\bibliographystyle' invalid. Undercooked beans in chili? I made a bit of a mistake, being a lazy bachelor and inexperienced at cooking.  I was making chili and when it came time to add beans I discovered I didn't have any canned beans.  I did however have some dried beans.  I decided to save time and add these directly to the pot of chili and add some water.  However, after much simmering the beans maintain a certain unpalatable crispness.  I have also read that undercooked beans contain a chemical lectin which can cause stomach discomfort.  I have also read that beans should be soaked, the water discarded to remove the lectin, and then boiled to cook them.  Is there any way to salvage this?  Should I just continue cooking the chili for hours?  Will I have to throw out my potentially delicious chili? Word for sentences that make sense when read backwards? Is there a word for sentences that make sense when read normally or backwards (not necessarily by reversing the words)? Example:     "Are you as bored as I am?" What is the best way to dump entire objects to a log in C#? So for viewing a current object's state at runtime, I really like what the Visual Studio Immediate window gives me.  Just doing a simple  ? objectname   Will give me a nicely formatted 'dump' of the object.    Is there an easy way to do this in code, so I can do something similar when logging? Quantum systems without a classical analogue? I am now reading the quantum mechanics textbook by Dirac (chap. 4, $\S21$, p. 88).   He says that his quantization procedure does not include all possible systems in quantum mechanics and there are systems without a classical analogue.  How is this possible? Special package combination gives "No room for new \write." What does $\dot\sim$ notation (dot over tilde) mean, in the context like $x \mathrel{\dot\sim} \mathcal N(0,1)$?  Turns out it is easier to find how to typeset it correctly:  that one should type \mathrel{\dot\sim} instead of simply \dot\sim to fix the spacing issue -- than to find what it actually means. It has only been used  on CV until now; is it standard? Understanding the parameters inside the Negative Binomial Distribution I was trying to fit my data into various models and figured out that the fitdistr function from library MASS of R gives me Negative Binomial as the best-fit. Now from the  page, the definition is given as:     NegBin(r,p) distribution describes the probability of k failures and r   successes in k+r Bernoulli(p) trials   with success on the last trial.   Using R to perform model fitting gives me two parameters mean and dispersion parameter. I am not understanding how to interpret these because I cannot see these parameters on the wiki page. All I can see is the following formula:    where k is the number of observations and r=0...n. Now how do I relate these with the parameters given by R? The help file does not provide much information either.   Also, just to say a few words about my experiment: In a social experiment that I was conducting, I was trying to count the number of people each user contacted in a period of 10 days. The population size was 100 for the experiment.   Now, if the model fits the Negative Binomial, I can blindly say that it follows that distribution but I really want to understand the intuitive meaning behind this. What does it mean to say that the number of people contacted by my test subjects follows a negative binomial distribution? Can someone please help clarify this? This has always been a big want for me. I love using multi-monitor setups but only want a single laptop. Does the 2011 MBP Thunderbolt support chaining multiple monitors together? I know that you can add a monitor and say, a few hard drives, but can you connect it to 2 27" monitors and your flat screen TV (for example)? Thanks! Duplication formula for gamma function Using the  for $\Gamma(x)$ and $\Gamma\Big(x + \frac12\Big)$, how can I prove the ? This is problem $10.7.3$ in the book , by Boros and Moll.  Any help is highly appreciated. I was surprised to only recently notice that      An object of any density can be large enough to fall within its own   Schwarzschild radius.   Of course! It turns out that supermassive black holes at galactic centers can have an average density of less than water's.  Somehow I always operated under the assumption that black holes of any size had to be superdense objects by everyday standards.  Compare the Earth to collapsing into a mere 9mm marble retaining the same mass, in order for the escape velocity at the surface to finally reach that of light.  Or Mt. Everest packed into one nanometer.  Reading on about this , it increases proportionally with total mass.  Assuming matter is accumulated at a steady density into a spherical volume, the volume's radius will only "grow" at a cube root of the total volume and be quickly outpaced by its own gravitational radius.  Question: For an object the , what would have to be its diameter for it to qualify as a black hole (from an external point of view)?  Would this not imply by definition that:   The Earth, Solar system and Milky Way are conceivably inside this black hole? Black holes can be nested/be contained within larger ones? Whether something is a black hole or not is actually a matter of perspective/where the observer is, inside or outside? Limit $\lim_{x \to \infty}{\sin{\sqrt{x+1}}-\sin{\sqrt{x}}}$ I want to compute $$\lim_{x \to \infty}{\sin{\sqrt{x+1}}-\sin{\sqrt{x}}}.$$  Is it OK how I want to do?    $$\sin{\sqrt{x+1}}-\sin{\sqrt{x}}=2\sin{\frac{\sqrt{x+1}-\sqrt{x}}{2}}\cos{\frac{\sqrt{x+1}+\sqrt{x}}{2}}=2\sin{\frac{1}{2(\sqrt{x+1}+\sqrt{x})}}\cos{\frac{\sqrt{x+1}+\sqrt{x}}{2}}$$  I'm not surem but I want to say that $$|\cos \frac{\sqrt{x+1}-\sqrt{x}}{2}| \leq 1$$ $$\sin{\frac{1}{2(\sqrt{x+1}+\sqrt{x})}} \to 0 \mbox{ when } x \to \infty$$ So the limit is $0$ ?  I thinks is not because  if I say that $ \displaystyle|\sin{\frac{1}{2(\sqrt{x+1}+\sqrt{x})}}| \leq 1$ I will obtain that another limit than $0$.   Thanks :) Why there is no operator for time in QM? I have found the command to delete files older than 5 days in a folder  find /path/to/files* -mtime +5 -exec rm {} \;   But how do I also do this for subdirectories in that folder?