I have a nested for and if structure as in below:  for i in range(n):     for j in range(n):         if i!=j:             if i&lt;j:                 if i!=0 and j!=0:                     if max==saving[i,j]:                         c1 = i                         c2 = j   I want to break all of the if conditions and for loops when c1 and c2 are found.  Where should I use "break" control ?  Thanks.
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?
How to select distinct field values using Solr? Every natural number can be written as the sum of distinct Fibonacci numbers? Probability that two random numbers are coprime is $\frac{6}{\pi^2}$ This is a really natural question for which I know a stunning solution. So I admit I have a solution, however I would like to see if anybody will come up with something different. The question is     What is the probability that two numbers randomly chosen are coprime?   More formally, calculate the limit as $n\to\infty$ of the probability that two randomly chosen numbers, both less than $n$ are coprime. Do gravitational waves slow down as they pass through matter? I've heard that gravitational waves travel at the speed of light, and have some parallels to electromagnetic waves.  EM waves slow down as they pass through matter (speed of light in glass is slower than in vacuum, for instance).  Do gravitational waves also slow down as they pass through matter?  If so, are there any effects like  when matter passes through a medium at a speed greater than the velocity of gravity in that medium?  Do large masses like stars or Jupiter act as ball lenses for gravitational waves? I have recently joined Ubuntu version 16.04. When i open the terminal it displays this message "To run a command as administrator(user "root"), use sudo command ". Please help me with this problem asap.  It happened to me (@waltinator), too. I did CtrlAltt to open a teminal, and is my wont, did 3 CtrlShiftt to open additional teminal screens. The additional screens got the message:  To run a command as administrator (user "root"), use "sudo &lt;command&gt;". See "man sudo_root" for details.   before my .bashrc finished.    I can't find anywhere in my .bashrc or its included files where I attempt to sudo anything (sounds like a Bad Idea) during my login process. I do set up aliases that sudo when evaluated, but not when defining the alias:  $ egrep 'sudo |su ' .bashrc .bash_aliases /etc/profile.d/color_ls.sh etc/bash_path_funcs/*  .bashrc:# makes "sudo" easier: sudo less $LESS files .bash_aliases:alias bigopenfiles="sudo lsof / | awk '{if(\$7 &gt; 1048576) print \$7/1048576 \"MB\" \" \" \$9 }' | sort -n -u"  .bash_aliases:alias deletedfiles="sudo lsof / | egrep 'PID|\(deleted\)'" .bash_aliases:alias bigopenfiles="sudo lsof / | awk '{if(\$7 &gt; 1048576) print \$7/1048576 \"MB\" \" \" \$9 }' | sort -n -u"  .bash_aliases:alias deletedfiles="sudo lsof / | egrep 'PID|\(deleted\)'" .bash_aliases:alias aptfixkey="sudo gpg --keyserver keyserver.ubuntu.com --recv-keys " .bash_aliases:alias susp="sudo -v &amp;&amp; sleep 20 &amp;&amp; echo 'Zzzzzzzzzzzzzzzzzzzzz' &amp;&amp; date &amp;&amp; sudo pm-suspend &amp;&amp; date &amp;&amp; echo 'Awake'" .bash_aliases:alias update='wupdatestatus=99;while [[ $wupdatestatus -ne 0 ]] ; do sudo apt-get update; wupdatestatus=$?;echo "status=$wupdatestatus";if [[ $wupdatestatus -ne 0 ]] ; then date; sleep 300; fi; done' .bash_aliases:alias upgrade='wupgradestatus=99;while [[ $wupgradestatus -ne 0 ]] ; do sudo apt-get upgrade; wupgradestatus=$?;echo "status=$wupgradestatus"; if [[ $wupgradestatus -ne 0 ]] ; then date; sleep 300; fi; done' .bash_aliases:alias upgradedl='wupgradestatus=99;while [[ $wupgradestatus -ne 0 ]] ; do sudo apt-get --download-only upgrade; wupgradestatus=$?;echo "status=$wupgradestatus"; if [[ $wupgradestatus -ne 0 ]] ; then date; sleep 300; fi; done' .bash_aliases:alias dist-upgrade='wupgradestatus=99;while [[ $wupgradestatus -ne 0 ]] ; do sudo apt-get dist-upgrade; wupgradestatus=$?;echo "status=$wupgradestatus"; if [[ $wupgradestatus -ne 0 ]] ; then date; sleep 300; fi; done' .bash_aliases:alias wup='wifi;sudo rmmod rt2800usb;sudo modprobe rt2800usb;nmcli con up id Nick;wifi;ping3 slashdot.org' .bash_aliases:    sudo tail -n 50 $( ls -rt1 /var/log |sed -e 's%^%/var/log/%'| tail -n 6 ) grep: /etc/profile.d/color_ls.sh: No such file or directory   None of the logs help:  $ sudo grep -l sudo /var/log/* /var/log/*/* 2&gt;/dev/null     shows nothing interesting.  How do I track down who/what is trying to sudo when I login? Problem with option border of class standalone I tested a MWE given in question . Following the documentation (page 9) I used the class option border={left right bottom top} with left=right=top=0pt and bottom=20pt (20pt only to show the effect here).  With the version 2012/09/15 v1.1b of standalone and the following MWE I get no 20 pt margin at the bottom of my picture.  What is the problem?  MWE:  \documentclass[% % border=1pt   border={0pt 0pt 20pt 0pt} %left right bottom top ]{standalone}% http://ctan.org/pkg/standalone \begin{document} $2^5 = x_5 \times y^8$ \end{document} Attribute editing in QGIS on geoJson file We have vector files in the format of geoJson files. We need to keep it in geoJson format as it is picked up by mobile devices via Restful services.  The problem is we want to change the attributes of the features in QGIS but it seems like this is not possible. We don't have to add or remove columns. We simply need to edit the existing data.  Is there a work around for this?  Are there any plugins that I can download that will allow me to do this in QGIS? First order differential equations with 2 varriables Does anybody know how to solve the following differntial equation?  $$w^2\cdot r+\frac{dw}{dt}\cdot r+\frac{dr}{dt}\cdot w=3g$$  where w and r are a function of time so $w(t)$ and $r(t)$. $g$ is a constant  EDIT: This equation came from a thought problem of mine which I will now explain since I still do not know how to approach the problem.  Basically I want to design a spiral track in which a vehicle will accelerate. However the total acceleration needs to be constant.   The vehicle will have 2 acceleration components, a radial component ($a_r$) and a change in speed component ($a_s$). Since we want constant acceleration: $a_r + a_s = constant$  From circular motion we know that $a_r = \omega ^2 r$ where $r$ is the radius, and $\omega$    Further we know that $v=\omega*r$, therefore: $a_s=\frac{d}{dt}(\omega r)$  For constant acceleration $a_{total} = a_r + a_s = \omega ^2 r + \frac{d}{dt}(\omega r) =constant$  Further usefull information: Length of the track covered at a certain time $l=v*t=\omega r t$  With all this the radius will be a function of time, $r(t)$ and the angular velocity will be a function of time, $\omega (t)$  Boundary conditions: $r(0)  = 0$ $\omega (0) = 0$  Now I would like to find a possible set of solutions to create a track by implementing end boundary conditions that i choose e.g. $v(t_{end})=100 [m/s]$ and $l(t_{end})=5000 [m]$  Here is a diagram for clarity: I have my mobile phone (Samsung Galaxy S2) running on ICS. Recently I activated Microsoft Exchnage ActiveSync to connect to my corporate email. It disabled all the security options like 'Pattern Unlock'. I hated it, and removed my microsoft active exchange account from the phone, but these options are still disabled. How do I get it enabled? Pros and Cons of a Decentralized Puppet Architecture We have around 300 RHEL servers that are currently connecting to a Puppetmaster server.  However, we have noticed some performance bottlenecks and it is the point of failure in our system.  I am fairly new to puppet in general and I am considering creating a decentralized puppet architecture instead of having Puppet clients connect to the Puppetmaster server.  Aside from what I would suspect to happen such as performance gain and lack of signing and exchanging SSL certs for new machines, what are other pros and cons to setting up a decentralized architecture? SQL Server compatibility with New TLS Standards How to format hard drive Is it the airport security at the country you flying from? I highly doubt it because I have been to countries where it's so corrupted that you buy the airport officials for the price of a dinner.   Is it the aircrew' responsibility? Again I don't think they care much - unless there is severe punishments - in corrupted third world countries.   I have been personally in a situation when an officer at a certain airport insisted on examining my British passport before he allowed me to move to the gate because I refused to slip him a $100 note. I was travelling to the UK yet I have another passport which is valid and it is issued by the country I was flying from, which means he had no reason whatsoever - nor I think he cared - to examine my British passport to check if it's valid.  Edit to summarize it, I want to expose as little as possible of information about my dual nationality. For that I need to know whom I am obligated to show my passport(s) What's a word/phrase for a player/seducer? I can't seem to remember this particular word/phrase. I'm almost certain it's a two-word phrase. It specifically refers to someone who is skilled with the ladies, ie, someone who knows the tricks of the trade.  Usage: - "Unless you're a X-Y, that's not going to work with her."  Edit :  I'm not looking for 'ladies man', 'casanova', 'womanizer' etc. This phrase refers to someone who's more of a pro and one who is serious about his business. When quoting something said by someone else, should I use a comma before the quote? Suppose I quote the definition given in a dictionary. Am I correctly using the the punctuation marks in the following sentences? (I am using them in the way I think correct in American English.)     One of the meanings of cat is, "a small animal with soft fur that people often keep as a pet."        A cadet is, "a young person who is training to become an officer in the police or armed forces."   Should I use a comma only when I explicitly quote somebody?     Groucho Marx once said, "Although it is generally known, I think it's about time to announce that I was born at a very early age."   Should I use a comma in this case too?     As Groucho Marx said,            No one is completely unhappy at the failure of his best friend.      On Comma Sense, A fun-damental guide to punctuation (Richard Lederer and John Shore), I read the following about using the comma:     Use commas to set off complete quotations:           The great general George S. Patton once said, "No, no—the war is this way, you idiots!" Since upgrading to OS X El Capitan, I've noticed a change in the Terminal: Executed lines show an opening bracket on the left, and a closing bracket on the right, as shown in this screenshot:    Similar questions have been asked here:          Some of the questions are referring to these brackets as marks, and the Terminal's Edit menu has a couple of entries related to marks, for example:   Edit > Marks > Mark as Prompt and Send Return Edit > Clear to Previous Mark Edit > Navigate > Jump to Previous Mark     Is there a summary of what these marks can be used for? I have not seen any reference to this new feature in any of the El Capitan feature overviews. I'm studying for actuarial exams, but I always pick up mathematics books because I like to challenge myself and try to learn new branches.  Recently I've bought Topology by D. Kahn and am finding it difficult.  Here is a problem that I think I'm am answering sufficiently but any help would be great if I am off.  If $d$ is a metric on a set $S$, show that  $$d_1(x,y)=\frac{d(x,y)}{1+d(x,y)}$$ is a metric on $S$.  The conditions for being a metric are $d(X,Y)\ge{0}, d(X,Y)=0$ iff $X=Y$, $d(X,Y)=d(Y,X)$, and $d(X,Y)\le{d(X,Z)+d(Z,Y)}$.  Thus, we simply go axiom by axiom.  1)  Since both $d(x,y)\ge{0}$ and $1+d(x,y)\ge{0},$ it is clear that $d_1(x,y)\ge{0}$.  (Is this a sufficient analysis?) 2) $d_1(x,x)=\frac{d(x,x)}{1+d(x,x)}=\frac{0}{1+0}=0$. 3) $d_1(x,y)=\frac{d(x,y)}{1+d(x,y)}=\frac{d(y,x)}{1+d(y,x)}=d_1(y,x).$ 4) $d_1(x,y)=\frac{d(x,y)}{1+d(x,y)}\le{\frac{d(x,z)+d(z,y)}{1+d(x,z)+d(z,y)}}=\frac{d(x,z)}{1+d(x,z)+d(z,y)}+\frac{d(z,y)}{1+d(x,z)+d(z,y)}\lt\frac{d(x,z)}{1+d(x,z)}+\frac{d(z,y)}{1+d(z,y)}=d_1(x,z)+d_1(z,y).$  However, #4 is strictly less, not less than or equal to, according to my analysis, so where did I go wrong? How can I suspend/hibernate from command line? How can I suspend or hibernate my laptop using command line, without installing additional software? What is a smart pointer and when should I use one? Ubuntu installer can't find any disk on Dell XPS 13 9350 I am trying to install Ubuntu 14.04 / 15.10 on my Dell XPS 13 9350 (November 2015).  I created a bootable USB disk which boots fine but the installer and the file manager do not detect the hard drive.  What is the problem? How can I solve it?