I have a below python code:  def get_sess(sheet, i):     first_time = True     old_eid = " "     old_sess = " "     k = dict()     p = []     for i in range(i, 2712):  # (pt1)         eid = str(sheet.cell_value(i, 2)).zfill(3)         if first_time:             old_eid = eid             first_time = False         if old_eid == eid:             old_sess = str(sheet.cell_value(i, 21)).zfill(3)             if d:                 for z in range(len(d)):  # (pt2)                     if d[z]['sess_name'] == old_sess:                         # This means this sess data is already saved in list, so ignore                         continue             new_sess = old_sess             weight = sheet.cell_value(i, 14)             product = str(sheet.cell_value(i, 5)).zfill(3)              k['sess_name'] = old_sess             k['weight'] = weight              t = 0             while new_sess == old_sess:                 product = str(sheet.cell_value(i + t, 5)).zfill(3)                 p.append(product)                 t = t + 1                 new_sess = str(sheet.cell_value(i + t, 21)).zfill(3)             k['product'] = p             d.append(k)   In the above function, I have two for loop at pt1 and pt2. In second for loop, I have a if condition where I am checking if the old_sess is same as sess stored in list, if yes I need to skip all the code after it and want to reach my code back again at first for loop. But if I use continue or break in the if condition, it will only break the second for loop and will execute the rest of the code which is what I dont want.   Is there any way we can directly jump to first for loop if if condition becomes true.  Thanks
Is there a goto or any equivalent in Python to be able to jump to a specific line of code?
The separation between the two plates of a capacitor is increased I had the following question on a quiz recently:     A capacitor consisting of two parallel plates, separated by a distance $d$, is connected to a battery of EMF ε. What happens if the separation is doubled while the battery remains connected?    The correct answer was "The electric charge on the plates is halved." However, we were previously given a question in which a circuit consists of a capacitor of 6 μF and a resistor of 300,000 Ω connected to a battery, and the separation between the plates of the capacitor is quadrupled. However, in this circumstance, the charge on the capacitor immediately after the plates are separated remains the same, and the potential difference across the capacitor increases.   I am confused as to why these questions have different answers to them, despite having an extremely similar setup. My best guess is that the circuit in the second question also has a resistor, but I am not sure, and help would be greatly appreciated. I just came across this glowy ore, and my 'Sharp Silver Pickaxe' won't mine it. I'm playing on the PC version of Terraria, if that helps.  How do I mine the glowy ore block? Is it (if at all) possible in Blender 2.6+?   If not, will future versions of Blender support it?  I see some old posts ( and ) saying that it is not possible. However, I found  referring to operators under  that allowed me to add sensors and controllers from python.  bpy.ops.logic.sensor_add(type='ALWAYS', object=my_obj.name) bpy.ops.logic.controller_add(type='LOGIC_AND', object=my_obj.name)   However I am not able to find any way to link them from python. I tried following (but did not work):  new_controller = my_obj.controllers[-1] new_sensor = my_obj.sensors[-1]   It throws AttributeError saying that object has no attribute 'controllers' :-/ Seeking options for Spatial ETL (Extract, Transform, Load)? I am interested in the pros and cons of various spatial ETL (extract, transform, load) tools.  If you have used the items listed here (or add your own), I seek your opinions and experiences.  In particular I would like to see usability comparisons of:    (proprietary)  (proprietary, subset of FME features)  (open source)  (open source)  (I don't know that it is truly ETL, but more of a file translation toolset) Any additional lot listed   There is no need to give a review of ALL software mentioned.  If you are experienced with even one then that will be very beneficial in making a decision about which direction to go.  Example: I am looking to create a schema conversion function that will allow me to select the input layer, create a translation, and output to a new, pre-defined schema.  Optimally, after creating the translation script, I would like to have an interactive form where I can "map" fields in my input layer to the output layer (ie- The output layer will have a field called "Address", what is it called in the input layer?)  Some were mentioned in the Q&amp;A at   And here are a couple of related articles that I found. Automate fixes for issues found by Sonar Terminal method of formatting storage drive I want to know how to format a storage drive from the terminal. Helpful things to provide in the answer would be often used options for commands and base knowledge that one can use to extrapolate future uses. Specifically I would like to know how to format in the different file systems such as NTFS, FAT32, EXT4, etc. Information on how to partition the drive via terminal is also wanted.  I am trying to format a high capacity external hard drive (EHDD) into NTFS - from the terminal.   I know I can use gparted for this as well as other GUI programs, but I still want to now how to do it from the terminal. Suppose Player 1 has a Dragon on the table and  in hand, while Player 2 has two Spiders on the table.  Player 1 chooses to attack with the Dragon and Player 2 chooses to block with one of the Spiders.  Before combat damage is to be dealt, Player 1 uses Unsummon on the blocking Spider.    Does Player 2 take any life damage from the attacking Dragon? C++ cout hex values? How to get a vintage/dreamy look like this photo?   It has some yellow color cast and seems like extra blur added in post process? Quick way to subtract white outline from knotwork pattern in Illustrator? I am working with a pretty complex traced AI that I received, and I want to basically make it so that all the visually black stuff is shapes, and all the white outlines (invisible here) are removed. Most of the spaces when a line crosses over another is created by a white outline.   I know about expanding appearance and the pathfinder tool, but because there are so many lines that are crisscrossing, I haven't had an easy way of minusing the fronts away. I could expand appearance and sort every object carefully, but I feel like there may be a quicker way of doing this.  If I put it in Photoshop as a smart object in 'screen' mode, it looks right.. I could put that back in Illy and trace it, but I don't want to complicate the paths. Is being a right triangle both necessary and sufficient for the Pythagorean Theorem to hold? I recently encountered a Stack Overflow question (since closed) in which the OP was testing for whether a triangle was right by whether or not it "met" the criteria of the Pythagorean Theorem (i.e. whether or not the square of the hypotenuse is equal to the square of the two sides). The code was to this effect:  public void Test(int a, int b, int c) {    if ((c * c) == ((a * a) + (b * b)) {      System.out.println("This is a right triangle");    }    else {      System.out.println("This is not a right triangle");    } }   (There are obviously some other problems with this code, like the fact that it doesn't validate the input to make sure that the inputs are positive and the fact that it only accepts integers).  The question was asking about something completely different in the code and never directly addressed the test, but I got to thinking: is this a valid test for whether a triangle is a right triangle?  Obviously, the Pythagorean Theorem states that, for all right triangles, $a^2 + b^2 = c^2$ (where $a$ and $b$ are sides and $c$ is the hypotenuse). This will hold for all right triangles, so being a right triangle is a sufficient condition for the Pythagorean Theorem to hold.  Is it also a necessary condition? I.e. if $c^2 = a^2 + b^2$ for some arbitrary triangle, is the triangle necessarily a right triangle? Or are there counterexamples? I've heard of kits that can fix your Xbox 360 if you happen to get the . Do any of these work, and do they void your warranty? Are there any other noteworthy tips or tricks? How can I make a div not larger than its contents? I have a layout similar to:  &lt;div&gt;     &lt;table&gt;     &lt;/table&gt; &lt;/div&gt;   I would like for the div to only expand to as wide as my table becomes. The Safari app has disappeared from my iPhone? I can't find the safari icon on my iphone 4?  I have tried resetting home screen layout and that doesn't work.  My restrictions button is 'on' and it asks for a password for this button.  I don't have a password.  Can you help? Thanks, Toy Line (Production) Run I am not sure about the meaning of this:          Transformers: Generation 1 (also known as Generation One or G1) was a children's toy line that ran from 1984 to 1991 and was produced by Hasbro.     Would the following rewrite be better?        Transformers: Generation 1 (also known as Generation One or G1) was a children's toy line the production of which ran from 1984 to 1991 and was produced by Hasbro. Re-Structuring a JSON Given a filesystem path, is there a shorter way to extract the filename without its extension? I want to reinstall Ubuntu, but I also want all information and settings to disappear. So everything looks like the first time I installed it. Is it possible to do so via Terminal? Or what are the steps I should follow? How to use siunitx and tabularx together? I'm using the tabular features of siunitx (for what it is worth: v1.3 since I'm on TexLive 2009) to align numbers in tables, eg.  \begin{tabular}{ p{1.5cm} S S S } bla &amp; 1.23 &amp; 4.5 &amp; 67.89 \tabularnewline \end{tabular}   and that works perfectly fine.  Now I would like to have this table span a specific width, or rather to have several tables to have the same width. For this I would normally use tabularx  \begin{tabularx}{\textwidth}{ p{1.5cm} X X X } bla &amp; 1.23 &amp; 4.5 &amp; 67.89 \tabularnewline \end{tabular}   Now, is there a way to combine the two? To have the number formatting and alignment features of siunitx inside an automatically resizing table? I have a shapefile with 9000 agriculture fields and what I like to do is to determine for each field (=each polygon) the direction of the longest segment.  For instance, the selected polygon in the screenshot has its longest segment from west to east so I would like to mark give the polygon the attribute W (for west) or either E (for east).   Is there any solution to solve my problem in a fast but generalized way?   I do not need very detailed results. It's just for the interpretation of a question.   I'm seeking an answer using ArcGIS 10.2 for Desktop.  To be more precise on what I'm looking for I try to explain more practical: I'm doing winderosion analysis for a specific area with 9000 fields. As result I have a potential susceptibility for each field. I like to check, if the fields with high susceptibility are correlated to a certain orientation of the fields, e.g. check if most of the fields with high risk are oriented in the main winddirection or not.   The search for the longest segment is not really important for me. It was just an idea I had to determine the direction. So forget about the longest segment if there is a way to determine the direction with another method ;)