I am trying to break 2 loops in Python, with one loop inside the other. Of course, when you use the break function in a loop it will only break the loop it's in. Here's the code:  while True:   #Want to break this     x, y, z = sense.get_accelerometer_raw().values()     x = abs(x)     y = abs(y)     z = abs(z)     sense.show_message(strftime('%H:%M', gmtime()), scroll_speed= 0.05, text_colour=[0, 255, 0], back_colour=[255, 0, 0])     if x &gt; 2 or y &gt; 2 or z &gt; 2 :   #Want to break this as well         break #Break goes here??   I want to break the loop started on the top line and the loop started in line 7. How?
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 can you combine all lines that end with a backslash character? Using a common command line tool like sed or awk, is it possible to join all lines that end with a given character, like a backslash?  For example, given the file:  foo bar \ bash \ baz dude \ happy   I would like to get this output:  foo bar bash baz dude happy How to open nautilus without a desktop? I'm using xmonad, and I would like to open a nautilus window to a certain directory, because I like the convenience of browsing inside an encrypted zip file without unzipping it, which nautilus allows.   however, opening nautilus, even with a path argument starts a desktop on the monitor I'm using (There are 8 xmonad monitors) The desktop is inoperative and renders that monitor useless until nautilus is killed.  Is there any way to open just a nautilus window without any desktop starting? Don't delete comments with link to duplicate if they are modified A user just posted his question a second time here on meta after the first was closed as a duplicate. I wrote a comment on the second post, explaining that the answer to his question is in the linked duplicate and that he shouldn't circumvent the closure process by asking a second identical question.  When the second post was closed as a duplicate my comment was automatically deleted. As far as I understand this is a heuristic that removes obsolete comments, which it considers every comment that contains a link to one of the duplicates.  This heuristic is too aggressive and removes comments that go beyond "Duplicate here: link". I suggest that it should be changed to only remove the default duplicate comment, and not any comment that was edited by the owner nor any free-form comment that happens to include a link to the duplicate.  This also triggers for any comment that contains the word "duplicate" and link to any question, not only the question being chosen as duplicate, which makes this much worse. When I am in texture mode one of my objects looks like it is in solid mode. The model is textured like all other models in the scene, but it doesn't look like it is in texture mode.  Screenshot will explain better:      What this model looks like. What all models should look like in texture mode. Error 404 : While using flag What would make a question popular with high views? I was wondering what might be making my questions less attractive to users?  I get very low views most of the time. What should be done to increase a question's popularity? I have built my house in Minecraft PE, and I have a ton of fences and sticks, but I need to know how big of a perimeter I need to let me sleep at night? What is the difference of 3 object declarations of javascript Infinite Product $\prod\limits_{k=1}^\infty\left({1-\frac{x^2}{k^2\pi^2}}\right)$ The "Hurry up, it's raid night" achievement in Starcraft 2 involves "beating Wings of Liberty, on normal, in 8 hours or less."  Is there a recommended mission path to take? Which mission should I take for the branching paths? Does it count time spent on the Hyperion in between missions, or is it exclusively time elapsed on missions. Does replaying a mission affect the time? General tips / hints from those who've unlocked the achievement?  Edit: Just got this achievement tonight, finally! The answer was perfect. This is a  about File Permission and Why 777 is "destructive".   I'm not asking how to fix this problem, as there are a ton of references of that already on Server Fault (reinstall OS). Why does it do anything destructive at all?  If you've ever ran this command you pretty much immediately destroy your operating system. I'm not clear why removing restrictions has any impact on existing processes. For example, if I don't have read access to something and after a quick mistype in the terminal suddenly I now have access well... why does that cause Linux to break? Why does `\texttt` repeat and shrink my equation? When I use \texttt with the caret symbol in an amsmath equation environment, I get a very weird result. Specifically, the text repeats itself four times while shrinking.  MWE:  \documentclass{article} \usepackage{amsmath}  \begin{document}  \begin{equation*}     \texttt{y^o} \end{equation*}  \end{document}   Compiling this document with pdflatex produces the following result:    The same result occurs even if I remove the o character. To fix it I could modify the offending line to \texttt{y$^o$}, but why is this repeating happening in the first place? "Requires 50 reputation" to comment on deleted posts So I recently saw add comment (requires 50 reputation) on a deleted answer. After looking around a bit, it seems to be on all deleted posts now (only deleted posts, normal posts still say just add comment).  I'm sure it wasn't there before (I think it just said add comment (unclickable) or possible nothing).  It is also on , presumably the root cause is the same.  And yes, I do have more than 50 reputation (in case anyone was wondering).  Just to clarify, requires 50 reputation obviously shouldn't be there for users with 50 or more reputation. Choices:   Display nothing Unclickable add comment - probably not ideal Unclickable add comment (disabled for deleted posts) or something along those lines   FYI - You may be somewhat confused right about now if you can't  yet. Greek Text (babel) and English Code Text (listings): Problem I use the babel package in order to write in greek with font "kerkis".  I want to add code in english ("courier new" font) to my latex document but I get some difficulties.  Can anybody help me, please. Thank you in advance.  \documentclass[12pt]{article} \usepackage[english,greek]{babel} \usepackage[utf8x]{inputenc} \usepackage{graphicx} \usepackage{fancybox} \usepackage{verbatim} \usepackage{courier} \usepackage{kerkis} \usepackage{float} \usepackage{geometry} \usepackage{fancyhdr} \usepackage{titlesec} \usepackage{tocloft} \usepackage{hyperref} \usepackage{afterpage} \usepackage{color}    \usepackage{listings}  \renewcommand{\lstlistingname}{Κώδικας}  \lstset{  %matlab   backgroundcolor=\color{white},     basicstyle=\normalsize,    % COURIER NEW?        commentstyle=\color{green},    % comment style   escapeinside={\%*}{*)},           extendedchars=true,               frame=single,                              keywordstyle=\color{blue},       % keyword style   numbers=left,                     numbersep=5pt,                     numberstyle=\normalsize\color{black},    rulecolor=\color{black},           stepnumber=1,                      stringstyle=\color{magenta},     % string style }   \begin{document}  \selectlanguage{greek} Ελληνικά: \textlatin{this word means greek}  \selectlanguage{english} Now I write in english  \selectlanguage{greek} Ελληνικά  %\selectlanguage{english}???  \begin{lstlisting}[caption = \textlatin{example1.m}] { % Entropy E = 0; for i = 1:J     if p(i) ~= 0         E = E + p(i)*log2(1/p(i));     end end } \end{lstlisting}  \end{document} Input image strip without stretching to fit output frame When you add an image strip to the Video Sequence Editor, it stretches/shrinks your image to fit the full output frame.  How can I add an image at its original resolution?  For example, if I add a 60x60 pixel image, it should appear very small in the final 1080p render. LWJGL Eclipse Resource Deployment I'm still experimenting with some OpenGL in LWJGL, and as I get to know more and more about OpenGL, I start to do more complicated things like multi texturing, shadowmapping and more. Now, right now I'm using the src folder (src/res) for my resources, and use src/resourcename in my code. When I export it, this won't work on another location as the relative path is ofcourse incorrect. What would be the best way of deploying your game with all the resources in one file? Maybe put the files in the jar?  I would like to hear from a few people how they store and deploy their project with resources, thanks! In The Force Awakens, Finn and Poe steal and escape in a TIE wearing no personal life support apparatus. TIEs have been upgraded with shields, hyperdrives (for "/sf"), weapons etc, but as far as I know they weren't upgraded with built in life support.   Finn and Poe should have frozen and/or suffocated after hitting space in the TIE. In the Rebels series, Sabine did the same thing. I've looked at what Wookieepedia states about the TIE as well as the old video game Star Wars "TIE Fighter".  Does the movie or any other work explain how Poe and Finn survived? We want to have a plain empty sandbox - one without any configuration metadata or data from Production.  Is it possible to have such a sandbox?  Please advise. I want to make a long shadow just like in this image.  I can create this shadow with shapes and by deleting the unwanted shadows after rasterizing the layer. But it's not very reusable. I can't resize the layer after rasterizing it.  Is there any easy way to make a long shadow like in the image below? How would you categorize email subjects to find similar emails? I have a list of email subjects like:  &lt;XYZ&gt; commented on &lt;ABC&gt; Weekly review for &lt;Company&gt; Your account is ready    And I want to find patterns in them so I can group them.  Is there a well known algorithm I can use?    Preferably with wide language implementations or easy re-implementation. The algorithm should be unsupervised. The number of different emails is not known.   Update:  I think I can break this down into two problems:   Group subjects by the similar words they use, resulting in the following. Each group should be very distinct from the rest (they should be almost perfectly exclusive) and the algorithm should give relatively small number of groups with good length of the common words.  [commented, on] [weekly, review] [your, account, is, ready]  Once grouped, it should be easy to find a state automaton that accepts only the group's subject and thus eliminates variable Then I can go back and check if there are any intersections and tweak the variables.   Having said that, is it better to use a completley different approach like neural nets maybe? I have zero experience with those, but if it makes more sense, I am open to learning.