I have a trouble with nested for-loop breaking.   The further code suppose to find pixels of certain color, which example contains in opened file with step 50 along x and 20 along y:   im1 = Image.open("C:\\Users\\Poos\\Desktop\\G\\green_pixel.bmp") A = list(im1.getdata())  x = 0 y = 0  im2 = ImageGrab.grab() B = list(im2.getdata())  for x in range(0,1024, 50):     for y in range(0,600, 20):       if(B != A):          im3 = im2.crop((x,y,x+1,y+1))          B = list(im3.getdata())          print(x, y)        else:          print("hooray!")          break        break   As soon as the pixel is detected the both loops should break, printing some text.   But the x-loop won't break wherever the outer break is placed, printing my text multiple times.   It seems that I've tried all possible variants for outer break position, but nothing works.   What is the problem here?
Given the following code (that doesn't work):  while True:     #snip: print out current state     while True:         ok = get_input("Is this ok? (y/n)")         if ok.lower() == "y": break 2 #this doesn't work :(         if ok.lower() == "n": break     #do more processing with menus and stuff   Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied?
I am no native speaker and always confused about the comma in introductory phrases, in particular in prepositional phrases. Is there any hard rule when a comma must be set? If I make a google search for certain phrases, I often find both variants. Typical examples where I am not sure whether a comma must be set are:        First[ly][,] I must phone mother   In this case[,] we must...   For simple problems[,] the algorithm...   From Lemma 1.2[,] we obtain...   For a typical user[,] the algorithm...   In our theory[,] we...   A dark line on the horizon[,] the mountain range we were headed for seemed somehow not as threatening as when we had started out on the trip.   Avidly reading her novel[,] Jane did not notice that her stop was approaching.   To be sure[,] it is not easy to see a solution.   When you get to Rome[,] give me a ring. How do I remove objects from an array in Java? Given an array of n Objects, let's say it is an array of strings, and it has the following values:  foo[0] = "a"; foo[1] = "cc"; foo[2] = "a"; foo[3] = "dd";   What do I have to do to delete/remove all the strings/objects equal to "a" in the array? How to prove $\sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6$? I'd like to find out why  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6 \end{align}  I tried to rewrite it into a geometric series  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = \sum_{n=0}^{\infty} \Big(\frac{1}{2}\Big)^nn^2 \end{align}  But I don't know what to do with the $n^2$. if m varies then find the range of c for which the line $y=mx + c$ touches the parabola $y^2 = 8(x+2)$ .  I tried Put the value $y = mx + c in$ the parabola equation and then done $D = 0$ or $D&gt;0 $  I am getting $16/(m^2 + 8m) &gt;0 $  But in this , how do I neglect m I'm trying to recall a story I read in the 1960s or 1970s, but which I suspect was older than that.  It was about a quasi-immortal family in the twentieth century who lived in a rural area and kept a low profile. It was a stand-alone story and only the family, and perhaps distant relatives, had unusual powers. I don't think they were aliens, just some offshoot of humanity.   They were of varying ages, ranging from relatively young to thousands of years old. They had lived in Europe before immigrating to the American colonies. Each person had a distinctive set of psi powers, ranging from the grandpa, pa, ma and son. I believe the youngest, just called Baby, was the most powerful and least human looking, and lived in the attic. He slept most of the time.  Nothing remains in my memory of the plot.  As I recall, the story had a Theodore Sturgeon feeling to it, with a humorous, ironic touch, but it probably wasn't his. I haven't been able to identify it from looking at a list of his works.  I probably read it in an anthology, but I might have seen it in an old magazine. I'm just not sure.  If anyone can help me identify it, I'd be grateful. Then I can scratch that mental itch. Mis-aligned shapefiles in QGIS? I've updated my Ubuntu to 19.10 couple of weeks ago and on installation system suggests to change or add shortcut for input source selection despite one was already defined previously. I've added ctrl+shift shortcut and just realized that it somehow overlapped any other ctrl+shift+something shortcuts globally, i.e. when I want to open new window in vscode, it opens new tab and it looks like system doesn't see the shift button press.   I tried to search this combination in shortcuts settings, but it's just not there. When should "into" be used rather than "in to," and vice versa? "Into" (one word) and "in to" (two words) are frequently confused.  In what situations should the former be used?  The latter? I have one website. I have two domain names that I want to point to the same site install.   So whether you go to name-one.com or name-two.com you see the exact same site.  Now, I can either set up name-two.com to serve 301 redirect header redirecting to name-one.com – or, I can set up name-two.com as a CNAME in the DNS pointing to name-one.com  What is the different implications for SEO on this? What is recommended?  I would guess it's better for branding to use a 301 redirect, so that visitors will see one consistent url for my site, right?  The reason I want the two domains is that I want a version with regional letters ('ö' instead of 'oe' ) in the name. Intuition for Smooth Manifolds Consider the graphs of the functions $f_1(x) = |x|$, and $f_2(x) = x$ under the subspace topology of $\mathbb{R}^2$.   Both of these graphs are smooth manifolds, just pick coordinate charts to be $(x, f_i(x)) \leftrightarrow x$.   Moreover, they are diffeomorphic via the map $(x, f_1(x)) \rightarrow (x, f_2(x))$.   This seems to clash with my intuition. For example, the graph of $f_1$ has a corner, so it "shouldn't" be smooth, much less diffeomorphic to $f_2$, which is just a straight line.   Can someone explain what's going on here?   In light of these examples, how should I visualize smooth manifolds and diffeomorphisms? Fundamentally, what does a friction force do for a rolling object? I am very confused by the way my textbook explains it. In my textbook , it says:  A wheel rolling on a horizontal flat surface at a constant velocity experiences no friction force. Why?   On the same surface, there is an acceleration of the wheel pointing to the right (probably caused by a force), so the ball is angularly accelerating in the clockwise direction. In this case, a friction force appears, and it is also pointing to the right. How come? What does the friction do for this wheel?  On an inclined plane, a ball freely rolls down the surface. The direction of friction is up the ramp, which confuses me because in the previous example the friction force was in the direction of the wheel's acceleration.   And there is a difference if a wheel is freely rolling and if there is a torque acting on the ball's center of mass. WHY???  What does friction do in these cases? How does it cause an object to roll? Distribution of $Z_n=n \log\left(\frac{\max\left(X_{(n)},Y_{(n)}\right)}{\min\left(X_{(n)},Y_{(n)}\right)}\right)$ The random variables $X_1,X_2,...X_n,Y_1,Y_2,...Y_n $ are independent and $U(0,a)$-distributed. Determine the distribution of $$Z_n=n\cdot \log\left(\frac{\max\left(X_{(n)},Y_{(n)}\right)}{\min\left(X_{(n)},Y_{(n)}\right)}\right)$$ where $X_{(n)},Y_{(n)}$ denotes $n$th order variable.  This problem is giving me a headache. The answer is that $Z_n$ is $\text{Exp}(1)$-distributed. But i can't derive that conclusion. I'd like to show you my derivation, but its so long and contains so many integrals and fractions that it would take a while to write it here. But basically my approach was to derive the distribution of $M=\max(X_{(n)},Y_{(n)})$ and $L=\min(X_{(n)},Y_{(n)})$. I get the following cdf's: $F_M=(F_X\cdot F_Y)^n=(F_X)^{2n}$ and $F_L=1-(1-(F_X)^n)\cdot (1-(F_Y)^n)=1-(1-(F_X)^n)^2$ ,  correct? $F_X $ stands for the cdf of $X_i$  Then i define the random variable $T=\frac{M}{L}$ and compute its cdf to finally be able to derive the distribution of $Z_n=n\cdot \log(T)$. But thats where i think everything goes wrong. Any help appreciated, thanks. Use of capitals and full stops in bullet points Possible Duplicate:          Let's say I have a bullet point list e.g:   Point 1. Point 2.  Point 3.    Notice I have put a capital letter for the starting letter of every bullet point and a full stop at the end. Is this the correct way to do it?  If not, what is the correct way to do it?  Do I put a capital letter and no full stop, or, the other way around, a full stop and no capital letter? Alternatively, do I not put a capital letter or a full stop? Is it only necessary to put a capital letter on the first bullet point and full stop on the last bullet point?  For reference, I'm from the UK so British-English grammar would apply. Find the smallest disk in complex plane containing the eigenvalues of a matrix (NBHM 2012) Consider the given matrix  $$\left[\begin{matrix}1&amp; -2&amp; 3&amp; -2 \\1&amp; 1&amp; 0&amp; 3\\-1&amp; 1&amp; 1&amp; -1\\0&amp; -3&amp; 1&amp; 1&amp;\end{matrix}\right]$$  Find out the smallest disk like ($|z-1| &lt; r$ ) in the complex plane containing the eigenvalues of the given matrix.  One easiest method is to find out the eigenvalues from the characteristic equation of the matrix. I can do it so no problem with it.   I am looking for a method to solve the problem without the above method that can be evaluated in very short time. This type of method is possible, I believe.  Thank you for your help How can I install custom fonts on Android? I am trying to display a Powerpoint slide deck on an android tablet, but the slides contain fonts that don't exist in android.  Is there a way to install custom fonts on the tablet?  If so, how? I think it would be a very useful and quality-improving feature.  As for me, when I speak on something, I often have a visual representation of how it works, or something. It's obvious there are many things (in algorithms, or, say, UI) which are much easier understood with pictures and diagrams, than from scarce text.  So I'd really like here to be a special answer form, where you can attach some visual things to better explain your ideas.  I imagine this form as just a canvas with few painting tools and some basic blocks and patterns. Trying to remember the name of a grade-school book about an alien in a cereal box When I was a kid (Grade school, Elementary, can't remember the exact grade, but it was between 1992 and 1999) I read a book about a kid who found an alien in his cereal.  This alien informed him that he was there to defeat an evil threat to Earth, that took the form of the school's most popular student.  The alien came with a gun that did nothing, and the alien in the popular kid disguise had the power to make the kid's fingernails bleed by damaging his nerve endings.  In the end, it was revealed that the evil alien had a huge craving for, and vulnerability towards, pizza flakes, and was defeated by gorging himself on them and then exploding. Young Adult Fantasy about children living with an elderly woman and learning magic related to their skills Postfix Connection Timed out I used the  tutorial below to setup postfix and dovecot on a Digital Ocean server. But I'm getting "Connection Timed out" when postfix/smtp tries to deliver an email to a remote host like gmail or yahoo..      RECEIVING A NEW MESSAGE /var/log/mail.log    Feb 2 22:33:38 localhost dovecot: auth-worker: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth  Feb 2 22:33:38 localhost dovecot: auth-worker: Debug: pam(app,189.63.49.XXX): lookup service=dovecot  Feb 2 22:33:38 localhost dovecot: auth-worker: Debug: pam(app,189.63.49.XXX): #1/1 style=1 msg=Password:   Feb 2 22:33:38 localhost dovecot: auth: Debug: client out: OK#0111#011user=app  Feb 2 22:33:40 localhost postfix/submission/smtpd[1045]: E9AA724264: client=unknown[189.63.49.XXX], sasl_method=PLAIN, sasl_username=app  Feb 2 22:33:43 localhost postfix/cleanup[1052]: E9AA724264: message-id=  Feb 2 22:33:43 localhost postfix/qmgr[32661]: E9AA724264: from=, size=485, nrcpt=1 (queue active)  Feb 2 22:33:45 localhost postfix/submission/smtpd[1045]: disconnect from unknown[189.63.49.XXX]  Feb 2 22:34:14 localhost postfix/smtp[1053]: connect to mta5.am0.yahoodns.net[98.136.216.25]:25: Connection timed out    Feb 2 22:24:21 localhost postfix/smtp[1013]: connect to mta6.am0.yahoodns.net[98.136.217.202]:25: Connection timed out  Feb 2 22:24:21 localhost postfix/smtp[1014]: connect to gmail-smtp-in.l.google.com[173.194.76.27]:25: Connection timed out  Feb 2 22:24:21 localhost postfix/smtp[1015]: connect to gmail-smtp-in.l.google.com[173.194.76.27]:25: Connection timed out  Feb 2 22:24:21 localhost postfix/smtp[1012]: connect to aspmx.l.google.com[173.194.68.27]:25: Connection timed out    Here is /etc/postfix/main.cf   /etc/postfix/master.cf   Result from #> netstat -nlptu mongodb group values by multiple fields