here is my code:  object test extends App {    private val PLAYER_REGEX = """[\s\S]*(?:&lt;td class="align-middle plus-size"&gt; &lt;s class="text-muted"&gt;|&lt;td class="align-middle plus-size"&gt;)(.*)(?:&lt;/s&gt; &lt;/td&gt;&lt;/tr&gt;|&lt;/td&gt;&lt;/tr&gt;)""".r   val str ="""&lt;td class="align-middle plus-size"&gt; &lt;s class="text-muted"&gt;first&lt;/s&gt; &lt;/td&gt;&lt;/tr&gt;"""   val str2 ="""&lt;td class="align-middle plus-size"&gt;second&lt;/td&gt;&lt;/tr&gt;"""    private def find(str:String) = {     PLAYER_REGEX.findFirstMatchIn(str) match {       case Some(data) =&gt; data.group(1).trim       case None =&gt; "Not found"     }   }   println(find(str))   println(find(str2)) }   And Output is   first&lt;/s&gt; second   My question is - why those redundant   &lt;/s&gt;    in first case? I thought that   (?:&lt;/s&gt; &lt;/td&gt;&lt;/tr&gt;|&lt;/td&gt;&lt;/tr&gt;)     should select first occurence   &lt;/s&gt; &lt;/td&gt;&lt;/tr&gt;    but looks like it select   &lt;/td&gt;&lt;/tr&gt;???   Off course I can trim it, but it looks ugly. If you can provide another regex I'll also will be glad:)
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?
Downloading from the main Ubuntu archive is slow even when it's not release day, how can I get apt-get to automatically use a mirror that is close to me? Dictionary definitions  often seem to use the terms sentience, awareness, and consciousness as if they are synonymous with each other. Is this really the case? If not, how do they differ? Some books suggest that sentience and awareness are simply facets of the larger concept of consciousness. How long are the life phases of a dragon? Where is the right place to register/enqueue scripts & styles Is it true that the order of $ab$ is always equal to the order of $ba$? How do I prove that if $a$, $b$ are elements of group, then $o(ab) = o(ba)$?   For some reason I end up doing the proof for abelian(ness?), i.e., I assume that the order of $ab$ is $2$ and do the steps that lead me to conclude that $ab=ba$, so the orders must be the same. Is that the right way to do it? Every time the DeLorean travels in time, it appears in the same place as the place it left. But that's the same place relative to the Earth's surface. In space-time terms, that point is constantly moving: the Earth rotates on its axis at a speed of one revolution per day, and moves around the Sun at a speed of one revolution per year (a roughly circular orbit with a radius of 93 million miles). The Sun is orbiting around the centre of our galaxy, pulling its planets with it, and our galaxy is moving relative to all other galaxies.  So if the DeLorean does not move in space in absolute terms, then a time-jump of even a few minutes would place it outside the Earth's atmosphere as the planet would have moved a few miles in that time. Therefore, to prevent this, the car's computer has to calculate the precise movement of the Earth (and Hill Valley) over the required interval travelled.  Two questions:   A computer powerful enough to do that kind of calculation probably couldn't have fitted into a car in 1985. So where did Doc get it from? If he could calculate the spatial displacement to remain in the same place on the Earth's surface that accurately, why couldn't he adjust those calculations to make the DeLorean appear wherever he wanted? Possible Duplicate:          I am always confused with the prepositions to use when indicating an event happening at a place. Should I use "at" or "in" or "on"?  For example:     We had our dinner at the McDonalds at/in the shopping centre at/on Sixth   Avenue.   The McDonalds restaurant is in the shopping centre. The shopping centre is located at Sixth Avenue. So am I right to say "the McDonalds in the shopping centre at Sixth Avenue"?  Now, what if it was a street instead of an avenue? Say for example:     We had our dinner at the McDonalds at/in the shopping centre at/on Coral Street.   Here, somehow, I find it natural to say "the McDonalds at the shopping centre on Coral Street".  How do I determine the right prepositions to use? And how would the different prepositions give different meanings to the sentence? Can inductor voltage and capacitor current change abruptly? I understand that inductor current and capacitor voltage cannot change abruptly, but can inductor voltage and capacitor current change abruptly?  I have a feeling the answer is no but I cannot explain why. Quick question: what is the compiler flag to allow g++ to spawn multiple instances of itself in order to compile large projects quicker (for example 4 source files at a time for a multi-core CPU)? booting windows 10 spends too long In august 2015, I have upgrade my laptop from windows 8.1 to windows 10. But it spends always 10 minutes to boot it. It is not normal that it spends so long. What can I do for boot him faster? Below some information about my laptop.   age: +/- 2 year (on august 2015) edition: Windows 10 Home   File trace are removed.  Update:    I must also say that always there comes a windows update, I have the same problem again form slow booting. Is it good that I turn off the updates? If yes, how can I do that? Also it is in periods that my pc booting to slow. Some time it is like normal (a few seconds) and other times a few minutes. I don't know how it comes that it is fast or slow. Does pointwise equicontinuous and uniformly equicontinuous implies compactness? If every sequence of pointwise equicontinuous functions $M \rightarrow \mathbb{R}$ is uniformly equicontinuous, does this imply that $M$ is compact? Logic Behind StackOverflow Question IDs This works perfectly:  $ inotifywait --event create ~/foo Setting up watches. Watches established. /home/ron/foo/ CREATE bar   However, this just sits there when directory tun0 is created under /sys/devices/virtual/net.  $ inotifywait --event create /sys/devices/virtual/net Setting up watches. Watches established.   Since those folders are world readable, I'd expect inotifywait to work.  So, what am I doing wrong?  Thanks Short story with aliens who hear their own thoughts as god-like voices I would have read this about 20-25 years ago.  I believe the subject was an alien individual, but it could have been a non-standard human instead.  The hook of the story was that the subject lacked an organ like the  that allows the halves of the brain to communicate efficiently, allowing the illusion of a single consciousness.  The subject is conscious, and has thoughts, but is subject to hearing commands like "Wash your hands!" "Fetch water!" within its head.  I recall the subject (and others like the subject) believing that the voices are their gods talking to them.  To the reader it becomes clear that this is a separate part of the subject's own mind that is responsible for long-term planning and simply can't communicate with the rest of the mind in the way a "normal" human is accustomed to. Limit of $s_n = \int\limits_0^1 \frac{nx^{n-1}}{1+x} dx$ as $n \to \infty$ Let $s_n$ be a sequence defined as given below for $n \geq 1$. Then find out $\lim\limits_{n \to \infty} s_n$.   \begin{align}   s_n = \int\limits_0^1 \frac{nx^{n-1}}{1+x} dx  \end{align}  I have written a solution of my own, but I would like to know it is completely correct, and also I would like if people post more alternative solutions. Finding all differentiable $f(z) = u(x) + iv(y)$ in $\mathbb{C}$ where $u(x),v(y)$ are real valued functions.   I’m not sure what to do. Would $f$ be differentiable simply if and only if both $u$ and $v$ were differentiable?   My thinking is that if the limit $$ \lim_{h \to 0}\frac{f(z+h)-f(z)}{h} $$  exists then it would be equal to  $$ \lim_{h \to 0}\frac{u(x+h)-u(x)}{h} + i\lim_{h \to 0}\frac{v(y+h)-v(y)}{h} $$  and therefore would exist if they existed. But that doesn’t seem quite right.  I also thought about using Cauchy-Riemann equations, but seeing that I’m trying to find ones that are differentiable rather than those that aren’t, I thought they wouldn’t be of much help. How does the bounty system work? It's possible to offer and award bounties of reputation on questions.   What is a bounty? How can I find questions that have a bounty attached? How do I start a bounty? When can I start a bounty? Why is the system requiring me to choose a bounty amount that's higher than the minimum? Can I use Markdown formatting in the bounty remarks? Can I edit the remark? How long is the bounty period? How do I award a bounty? Can I award a bounty to my own answer? Can I award a bounty to an old answer? If I offer a bounty on someone else's question, can I award the bounty to their answer? After awarding the bounty, can I remove it or move it to another answer at a later time? What happens if there's no answer after the bounty period? What happens if I feel my question is still unanswered? What is automatic awarding? Are bounty awards exempt from the 200 points/day reputation limit? How does Community Wiki mode affect bounties? How does user deletion or post dissociation affect bounties? Can I award a bounty to an answer from a deleted user or one where the author was dissociated? Can I offer a second bounty after the first one has expired? Can I raise my bounty? What happens if a bounty question is closed or deleted? Why can't I vote to close or migrate a bounty question? What happens if I delete my account while I have an active bounty? Do I keep an awarded bounty when I delete my answer? What happens if a question where I awarded a bounty later gets deleted or migrated? Can I cancel my bounty? Can I affect / divide / share part of my bounty to two (or more) users? How many outstanding bounties can a single user have?      See also:  in the Help Center Change \headheight for a \pagestyle Uploading an image from the web can leave paste broken in editor Is there a safe way to determine how powerful an opponent is?