If you are given a string like "foo bar 32536364" and a regex /foo bar \d+/, how can you check if the regex matches the full string and not some substring in the string? Also I cannot change the input values such as putting ^ and $.  Thanks
How can I test if a RegEx matches a string exactly?  var r = /a/; r.test("a"); // returns true r.test("ba"); // returns true testExact(r, "ba"); // should return false testExact(r, "a"); // should return true
I forgot what email I used for my other ploxtic id: how do you find out what my email was?   The account is user:2078229. I have a question.  I have been given this proof: "For any $n$ in the integers where $n&gt;2$, show there are at least $2$ elements in $U(n)$ that satisfy $x^2=1$."  I have gone through and actually proved this, (that the numbers are $1$ and $n-1$) but i didn't' know how to prove that $n-1$ is in fact in the set $U(n)$. Is it because two consecutive numbers are always relatively prime? What is role-playing, and where do I start? I have been told that roleplaying is great fun. I've looked and looked and it all seems so complicated. Could anyone tell me a good place to start, and what sort of things you end up doing in roleplaying? My group of 8 level 3 players are about to run through the Thundertree Ruins and will probably have a hand at fighting the dragon. My question stems from the fact that a single poison breath attack from the dragon will outright kill all but 1 player assuming they fail their saving throws.  I understand this encounter is supposed to be ridiculously deadly, but I don't want to be punishing my players for testing the lengths at which they can fight stuff. A fight should be challenging and they should be able to try and run away, but instant obliteration seems a bit much.  All PCs are level 3 (HP in parenthesis):   Wood elf moon druid  (27) dwarven frenzy barbarian (44) fire genasi archer ranger (37) (pseudodragon companion (12)) wood elf assassin rogue (27) human wild magic sorcerer (22) dragonborn fighter (29) human monk (24) human fighter (32) This might be a bizarre but crucial question, can I fully trust leaving my laptop in repairs (Genius Bar) while they have full access to it ?  I recently went to the genius bar to get my display fixed, and apparently they asked for my laptop's password just in case they need some "testing" after they're done. Can't they do that as a guest account ?  I got sensitive information on my laptop such as passport copies etc, as well as passwords saved in Safari's keychains for my bank account, paypal, amazon etc ..  The service is due later on today, shall I change my password and ask them to contact me directly if they need something specific ?? They're going to fix in 3 hours so I'll be in the mall whilst they finish. $$\int^2_{-2}\frac{x^2}{1+5^x}$$  How do I start to integrate this?  I know the basics and tried substituting $5^x$ by $u$ where by changing the base of logarithm I get $\frac{\ln(u)}{\ln 5}=x$, but I got stuck.  Any hints would suffice preferably in the original question and not after my substitution.  (And also using the basic definite integrals property.)  Now I know only basic integration, that is restricted to high school, so would prefer answer in terms of that level. Unexpected output of xargs "named" vs "that is named" Can I run two 4k (3840x2160) displays at 60hz on a Macbook Pro 13" 2015 I think the title says it all. Can I run two 4k (3840x2160) displays, both at 60hz on a Macbook Pro 13' 2015? I understand they might need to be SST and each connected to a Thunderbolt 2 port. But I cannot get a confirmation whether that setup would work.    says:     Simultaneously supports full native resolution on the built-in display and up to 3840 by 2160 pixels on up to two external displays, both at millions of colors.   …   Support for up to 5120-by-2880 resolution at 60Hz on a single external display (model with AMD Radeon R9 M370X only)   Unfortunately, it does not state at what frequency the two displays can be run.    says:     With OS X Yosemite v10.10.3 and later, most single-stream 4K (3840x2160) > displays are supported at 60Hz operation on the following Mac computers: … MacBook Pro (Retina, 13-inch, Early 2015) and later. MacBook Pro (Retina, 15-inch, Mid 2014) and later   Unfortunately it does not state whether two displays can be run at 3840 by 2160 at 60hz Why is a person's location exclusively tied to their communicator? In Star Trek it is frequently seen that when a crew member wants to avoid being tracked, they'll leave their communicator somewhere (quarters, corridor etc) which throws the computer and ship's security off their trail.  However, the entire interior of the ship is under constant surveillance by the internal sensors. Barring damage to the ship or sensors, or some space phenomenon causing radiation X to create interference, why aren't these internal sensors able to continue tracking every person on board regardless of where their comm-badge is? In the worst case, they should be able deduce who the errant individual is by simple subtraction: "I can see where all the other comm-badges are, so subtract them and the remaining life form must be the person I am looking for." But this never seems to be done either.  Is Star Fleet security really so inept or is there some other limitation in play that is never mentioned? What does this depiction of a black hole in the movie Interstellar mean? Word or phrase for mere coincidence that brings happiness What does "apostrophe s" stand for in "What's it all mean"? I heard someone on a TV show say:     What's it all mean?   As far as I know, 's could be the short form of has and is. But in this case, it seems more like to be the short form of does. Am I correct? Biblatex: nested citations with the \textcites command I'd like to type a citation within the text and another citation inside the parenthesis for the year, something like this:     The work of Author 1 (year; cited by Author 2, year)   For this, I've tried different options of the \textcite command but without results. Also I saw the solution posted , which works for multiple citations within parenthesis but not for in-text citations.  Any suggestion? A thin-walled container of mass $m$ floats vertically at the separation surface of the two liquids of density $ρ_1$ and $ρ_2$  . The whole mass of the container is concentrated in the part of height $h$.  The question is to determine the immersion depth $h'$of the container in the lower liquid if the bottom of the container has a thickness $h$ and an area $S$ and if the container itself is filled with the liquid of density $ρ_1$.    I applied the fundamental principle of the statics on the container  $Balance$ $Sheet$:  The weight of the container ($-mg$)  The buoyancy force applied by the fluid with density $ρ_2$ ($ρ_2gSh$)  The weight of the fluid with density  $ρ_1$  (-$ρ_2gSh'$)  I summed up the forces and set them to zero and find my $h'$  but then  realised that the fluid with density  $ρ_1$  applied also a buoyoncy force on the top of the container , and the fluid with density  $ρ_2$  applied a buoyoncy force on the other fluid.  Where's the problem ? Books or resources for learning unified view of classical statistics? I did a science PhD doing applied bayesian statistics, and I liked it so much that I decided to shift to statistics.  For the last 2-3 years have been working at a firm that has more of a frequentist focus.  It seems to me that the bayesian approach (at least what I learned) has an underlying theory that was laid out and I could understand.  Now I find this - more classical - field fascinating but I am looking for some resources to get a unified view of the matter.  For example, I am learning and applying anovas, F-tests and chi-squares, thinking about degrees of freedom, etc but part of me is looking for deeper understanding that would make it more than just methods.  Does anyone have any suggestions on books or more resources that provide such a unified, deeper focus? X,Y are independent exponentially distributed then what is the distribution of X/(X+Y) Been crushing my head with this exercise. I know how to get the distribution of a ratio of exponential variables and of the sum of them, but i can't piece everything together.  The exercise goes as this:  If X,Y are independent exponentially distributed with beta = 1 (parameter of the exponential distribution = 1) then what is the distribution of X/(X+Y)  Any ideas?  Thanks a lot. Constant term in Lagrangian Why can we always drop any constant term in a Lagrangian density in quantum field theory?  This issue is somehow related to the constant term being some kind of cosmological constant.  Can you please explain this issue? Software for text search in files I am looking for a software that will search text in files from a folder similar to .  Is there something similar? Prove there's a simple path of length $k$ in a simple graph $G$ where all the vertices have degree of at least $k$.   Relevant definitions:  $G$ is a simple graph that consists of a vertex set $V(G) = \{v_1, v_2, ..., v_n\}$ and an edge set $E(G) = \{e_1, e_2, ..., e_m\}$ where each edge is an ordered pair of vertices. The edge $\{u,v\}$ is denoted $uv$.  A walk of length $k$ is a sequence $v_0,e_1,v_1,e_2,...,e_k,v_k$ of vertices and edges such that $e_i=v_{i-1}v_i$ for all $i$. A path is a walk with no repeated vertex.   My attempt:  Induction, for $k=1$ it's obvious.  Suppose for $k-1$ and we'll prove for $k$.  Let $G$ be a simple graph such that $\forall v \in V : d(v)\ge k$.  We can assume that there are at least $k+1$ vertices since there are $k$ neighbours to every vertex.  Let $v_0$ be some vertex, it has $k$ neighbours, we'll move to one of its neighbours say $v_1$ and remove $v_0$. So now there are $k$ vertices with a degree of at least $k-1$ and from the induction hypothesis we'll have a path of length $k$.  Is using only $k$ vertices from $n$ right? Does it keep the generality when using only all the neighbours of $v_0$?