regex pattern to match first 2 numbers in a string
Learning Regular Expressions
What should I do, as my submitted paper is still under review after 1 year? I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question: How to disable Excel number autoformat My friend and I have been wracking our heads with this one for the past 3 hours... We have 2 point masses, $m$ and $M$ in a perfect world separated by radius r.  Starting from rest, they both begin to accelerate towards each other. So we have the gravitational force between them as:  $$F_g ~=~ G\frac{Mm}{r^2}$$  How do we find out at what time they will collide?  What we're having trouble with is this function being a function of $r$, but I have suspected it as actually a function of $t$ due to the units of $G$ being $N(m/kg)^2$.  I've tried taking a number of integrals, which haven't really yielded anything useful.  Any guidance?  No, this is not an actual homework problem, we're just 2 math/physics/computer people who are very bored at work :) Why doesn't Quicksilver create sonic booms? Triangle Inequality question with fractions Given $a, b \in \mathbb{R}$, prove that   $$\frac{|a + b|}{1 + |a + b|} \le \frac{|a|}{1 + |a|} + \frac{|b|}{1+|b|}$$  When does equality hold?  The only useful thing I could get (using the triangle inequality) is:  $$\begin{align}1 + \left|\left(a + \frac{ab}{2}\right) + \left(b - \frac{ab}{2}\right)\right| &amp;\le 1 + \left|a + \frac{ab}{2}\right| + \left|b - \frac{ab}{2}\right|\\ &amp;\le 1 + |a| + |b| + |ab|\\ &amp;=(1 + |a|)(1 + |b|)\end{align}$$  But it seems to be inapplicable! Any ideas? Are there any rules on when to use icons vs. icons with text vs. just text links in a web application?  For example:    vs.   save  vs.  save    Extra question: Is  save -or- save  preferable? Question 5.33 from "Topology and its Applications"  by Baesner is to compute the fundamental group of the torus ($T^2$) with $n$ points removed. I can "see" in my mind that if we remove one point we get a bouquet of two circles. Less clear is what happens when we remove two (or more) points. Any hints? Making a WinForms TextBox behave like your browser's address bar When a C# WinForms textbox receives focus, I want it to behave like your browser's address bar.  To see what I mean, click in your web browser's address bar. You'll notice the following behavior:    Clicking in the textbox should select all the text if the textbox wasn't previously focused. Mouse down and drag in the textbox should select only the text I've highlighted with the mouse. If the textbox is already focused, clicking does not select all text. Focusing the textbox programmatically or via keyboard tabbing should select all text.   I want to do exactly this in WinForms.  FASTEST GUN ALERT: please read the following before answering! Thanks guys. :-)     Calling .SelectAll() during   the .Enter or .GotFocus events won't   work because if the user clicked the   textbox, the caret will be placed   where he clicked, thus deselecting all   text.      Calling .SelectAll() during the .Click event won't work because the user won't be able to select any text with the mouse; the .SelectAll() call will keep overwriting the user's text selection.      Calling BeginInvoke((Action)textbox.SelectAll) on focus/enter event enter doesn't work because it breaks rule #2 above, it will keep overriding the user's selection on focus. Are amounts of money singular or plural? Are the two sentences correct or is one of them incorrect?     1) Five billion dollars is earmarked for the project.   2) Five billion dollars has been earmarked for the project.   I know dollars are countable. So I think both 'is' and 'has been' are correct here.   Also, do they differ in meaning? Version: Ubuntu 16.04  I have used it some weeks, but now it gives me this message when I'm trying to install software and update or upgrade:  Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) /var/lib/apt/lists/ locked   followed by this:    .  and another error:  ** (appstreamcli:4560): WARNING **: Exception: Unable to get write lock on /var/cache/app-info/xapian/default: already locked   What should I do? How do I eliminate reflection on glass? When I take a picture through a window, I often see a reflection on the glass. I have noticed that this occurs mostly when it is dark or overcast outside or it is especially bright on my side of the glass. How can I stop this? A curious integral The following integral has been on my mind for a while $$\int_0^\infty \frac{\sin(x)}{e^x-1}\,\mathrm d x \tag{$\dagger$}$$    Let us indicate the integrand as $f(x)=\frac{\sin(x)}{e^x-1}$. The following are a couple of observations.   The integrand can be extended by continuity in $0$ since $$\lim_{x\to 0}f(x)=\lim_{x\to 0}\frac{\frac{\sin(x)}{x}}{\frac{e^x-1}{x}}=1$$ This is the original reason I started playing around with this integral. Mathematica yields the result $$\int_0^\infty \frac{\sin(x)}{e^x-1}\,\mathrm d x=\frac{\pi}{2}\textrm{Coth}(\pi)-\frac 12 \approx 1.076674047$$ which, following numerical evidence, seems correct. Complex analysis may be useful here, since the integrand is a holomorphic function on $\mathbb C$. I tried writing $\sin(z)=\frac{e^{iz}-e^{-iz}}{2i}$, but I was not able to find an appropriate integration contour to solve the problem. The $-1$ in the denominator breaks the simmetry of the expression. This made most of my substitutions useless.   Can this integral be evaluated correctly, preferrably through complex analytic methods? Trouble creating 3TB ext4 partition due to msdos-partition-table-imposed error Cell reference with colour formatting Is it possible to reference a cell in Google Sheets so that cell where it gets displayed also displays it using the same text and cell colour formatting?  =A1   Will only reference cell's value. But if that particular cell has red background and white text I'd like that to be copied as well.  I'm leaning toward existing formula solutions rather than scripts. If applicable of course. If I have an adjacency matrix for a graph, can I do a series of matrix operations on the adjacency matrix to find the connected components of the graph? How are large amounts of money expected to be made during the early parts of the Waterdeep: Dragon Heist adventure? "Speed" of Gravity and Speed of Light how to show image in table cell through json parsing I can't see my background image in the 3D view I try to set up an image as background for a basic blender tutorial, but it isn't visible.  This is the image I try to have as background: