how to exit from set of loops at once and going back to the first loop? when the condition in last "IF STATEMENT" is satisfied for the first j, first g and first s, i want to break all 3 loops containing j, g and s and the code should try next i. If the last "IF STATEMENT" is not satisfied, the code should try next s, next g and next j respectively.   I tried using a flag variable. but it does not give me the result i want. I have made a mistake somewhere. Please help me out to solve this issue. I'm running out of time and really stressed about this matter since i have limited knowledge in python. I would be much grateful if you could sort this problem.  for i  in range(len(A.hp)):    gg= False    while gg==False:      for j in range(len(run_parameters.bits_Mod)):       req_slots[j] = math.ceil((A.T[i]["Traffic"])/(run_parameters.bits_Mod[j]*C))        for g in Temp[i]["Available_ranges"][j]:        for s in range(g[0], g[-1]):           if (s+req_slots[j]-1) &lt;= g[-1]:              if (Temp[i]['cost'][j] &lt;= (run_parameters.PSD)/(run_parameters.OSNR_threshold[j])):                served_count +=1                A.T[i]["First_index"]= s                A.T[i]["Last_index"]= s+req_slots[j]-1                A.T[i]["Status"]= 1                A.T[i]["Selected_MOD"] = j                gg=True
How to break out of multiple loops? 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?
Given a ring $R$ (with unity), prove that if $a \in R$ is nilpotent, then $a+1,a-1$ are both invertible.   Suppose $a^n=0$. Then $1=1-a^n=(1-a)(1+a+\ldots+a^{n-1})$, so $1-a$ is invertible.  If $n$ is odd we can use $1+a^n=(1+a)(1-a+\ldots+a^{n-1})$.  But what if $n$ is even? How to Pivot Multiple Columns in SQL Server I've read many posts about using pivot to get the data in the format I want, but the more I read the more confused I get.  I have this data:    That I'm trying to get into a format similar to this:   For the most part, everything I try results in an SQL error, and the only successful attempt I've had didn't return the data in the format I'm looking for.  Any help would be appreciated. I watched this movie when I was a kid and never discovered it again.  It’s about a boy whose father left him after his divorce from the mother, the kid enters a world somehow where he has a big sword he needs to keep searching for precious stones to fill it with. it has certain holes that look like each stone shape! I also remember the kid going to eat with his mythical (dragon-like friend), and he gets stuck in the restaurant because the crazy restaurant lady won’t let him leave without finishing huge amounts of food!  The kid also gets bullied so I’m guessing the the swords journey is to teach the kid how to deal with all of this... Any hard-working student is a counterexample to "all students are lazy".  What are some simple counterexamples to "if random variables $X$ and $Y$ are uncorrelated then they are independent"? Is it true that if $A$ is a nonnegative primitive matrix, then $AA^T$ is also primitive? Obviously $A^T$ is primitive but in general product of primitive matrices is not primitive.  Any hint? How do I identify which CPU a MacBook uses? Highlighted source code inline with Latex/Minted? I wrote a DLL in .NET and I want to access it in VBScript. I don't want to add it to the assembly directory.   Is there a way to point too the DLL and create an instance of it? How to highlight whole row and column under cursor in OpenOffice Calc? I need to work with large table. Something like in this illustation image will be helpfull for better orientation:    Is there some settings which makes this possible? Can matter be described as the result of the curvature of space, instead of vice versa? Can matter be described as the result of the curvature of space, rather than the curvature of space being the result of matter, and energy being the cause of the curvature of space? I have been looking at the plugin API a bit more in depth recently and I was wondering what real differences there were between action and filter hooks. They both are events that receive data as a parameter and they seem to both be able to do the same things.  Obviously I see that actions are called when actions take place and filters are called when data is manipulated, but it seems to just be a semantic naming difference.  Besides semantics and what they are used for, what real differences are there between them? What ticket reservation do I need for a Schengen visa? I have a visa appointment this Friday 19 at the Italian Consulate in Philadelphia and I have a question about the flight reservation requirement: According to the Visa requirements "Confirmed flight reservation for a round trip showing complete itinerary."  Does this mean I have to reserve the tickets, pay and print the itinerary?  In this case if my visa gets denied then I will lose the money I paid or can I just show the planned itinerary (written not booked)? in this case the travel agency would not give me the Travel Insurance coverage until I book and pay for the reservation.   I am a US green card holder and applying from North Carolina. My dconf/gsettings installation is broken. How can I fix it without Ubuntu reinstall? I run Ubuntu 12.04.1 LTS x64 in VirtualBox. After one very unfortunate misclick (reset saved state instead of load saved state) I got a very annoying problem.  Almost all applications (unity, synaptic, gedit, etc.) print on start:  Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.   And all GUI settings reset after reboot.   Another symptom:  $ GSETTINGS_BACKEND=dconf dconf-editor (dconf-editor:2353): GLib-GIO-WARNING **: Can't find module 'dconf' specified in GSETTINGS_BACKEND GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications   But /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so is present.     What I tried (and it didn't help):   sudo apt-get install -f --reinstall  dconf-tools libdconf0 libdconf-dbus-1-0 dconf-service Build dconf-0.5 from sources and make install it Create empty user profile and start programs there   I have to keep current Ubuntu installation so a complete reinstall is not an option for me.   How can I fix it? I am confused by the orientation of a topological manifold. My understanding is: An orientation of a topological manifold is a choice of generator of the $H^n(M,\mathbb Z)$. So given a manifold, we could have 2 orientation defined on the manifold. For $\mathbb{CP}^2$ on orientation is determined by the complex structure, the other orientation is denoted by $\overline{\mathbb{CP}}^2$. And it is well known that there is no orientation reversing map from $\mathbb{CP}^2$ to itself.  My question is: are they homeomorphic? I guess they are not homeomorphic. But I am confuesed, doesn't the orientations defined on the same manifold, how come after reversing the orientation they become not homeomorphic? How can I get grub2 to boot a different option only on the next boot? Extract information from a text file Substitute for onions and garlic How to reset evolution settings to defaults? I have not used Evolution for long time now and I would like to reset all the settings and start from scratch. How would I be able to do this? Listing feature classes with active domains? Browsing Questions shows the same questions on different pages I have just been looking through the questions to answer those that I can and as I go to the next page (using the Next button at the bottom) I am presented with the same questions.  I imagine this is not a flaw and in fact questions are coming in fast filling up a page pushing my current page to the next one.  An idea to solve would be to set a variable for starting id when I start paging and only clicking an update button will reset the starting id.