I am making a game and all the game runs in a while loop. Because you can't use two while loop, how can I do an action UNTIL something.
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?
Show that a set is dense in $[-1,1]$ Show that $\{\cos\ n:n \in \mathbb{N}\}$ is dense in $[-1,1]$ by using the fact below:      Suppose $x$ is irrational. Then there exists $p_n,q_n \in \mathbb{Z}$   such that $\bigg|x -\frac{p_n}{q_n}\bigg| &lt; \frac{1}{q_n^2}$   I have no idea on how to apply the fact above to show the set is dense in $[-1,1]$. Can anyone help me? In Python, what are metaclasses and what do we use them for? It's a well-known theorem (Corollary 8.10 in Lee Smooth) that given a smooth map of manifolds  $\phi:M\rightarrow N$ and a regular value $p\in N$ of $\phi$, the level set $\phi^{-1}(p)\subset M$ is a closed embedded submanifold. Is the converse true? That is, given an embedded submanifold $S\subset M$, is there necessarily a manifold $N$, smooth map $\phi:M\rightarrow N$, and regular value $p\in N$ of $\phi$ such that $S=\phi^{-1}(p)$?   Prop. 8.12 in Lee Smooth shows that this is true locally; specifically,     Let $S$ be a subset of a smooth $n$-manifold $M$. Then $S$ is an embedded $k$-submanifold of $M$ if and only if every point $p\in S$ has a neighborhood $U\subset M$ such that $U\cap S$ is a level set of a submersion $\phi:U\rightarrow\mathbb{R}^{n-k}$.   (and any level set of a submersion is of course the level set of a regular value). I feel like this is the kind of question where, if there is a counterexample, it probably is very simple, but I wasn't able to come up with one. 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? On , there are download options for only certain logos/icons. Shouldn't this include all the graduated sites logos/icons? I think it should. How to position the paper's authors' addresses on the front page (maketitle)? When I use the following code for the title page of a paper (please see below), the authors' addresses and emails appear on the last page of the paper. However I need them to appear on the first-title page (after the authors' names before the abstract). How can I do this?  \documentclass [reqno, 12pt ]{amsart} ... \begin{document}  \title[paper]{Nice paper}  \author{Me} \address{University} \email{mmm@lala.com} \thanks{.} \author{my friend} \address{Institute} \email{kkk@lala.edu} \thanks{.}  \date{\today} \keywords{XXX }  \begin{abstract} Lalala \end{abstract}  \maketitle Can a Rogue (D&D 3.5) use sneak attack on both the first and second attack? "Easy" vs. "simple" Are those two words equivalent or is there a difference? When would I say something is easy rather than simple, or vice versa? I would like to filter the markers on my (geojson) layer according to two features: year and type of event, ideally using both filters (year and eventType) as check-boxes without using layerGroup at all. I would like to be able to click on a checkbox and update dynamically the markers by filtering them according to feature.properties.eventType too, in addition to the year displayed, something like    &lt;input type="checkbox" id="all" name="all" value="all"&gt;   &lt;label for="all"&gt;All&lt;/label&gt;   &lt;input type="checkbox" id="funfair" name="funfair" value="newsletter"&gt;   &lt;label for="funfair"&gt;Funfair&lt;/label&gt;   &lt;input type="checkbox" id="trade" name="trade" value="trade"&gt;   &lt;label for="trade"&gt;Trade&lt;/label&gt;   &lt;input type="checkbox" id="exhibition" name="exhibition" value="exhibition"&gt;   &lt;label for="exhibition"&gt;Paid exhibition&lt;/label&gt;   etc... which would trigger a  filter: function(feature, layer) {   return feature.properties.eventType == value-of-checkbox; }   I have five types of eventType. So, for instance, if 1890 is checked, the map is showing all 1890 events, no matter what kind of event it is (because by default it would show all events). If the user checks the 'funfair' and the 'trade' checkbox, though, I want the map to show only the 1890 events of the funfair and trade kind, and not other kind of events.  This is my complete script, which so far is working fine with filtering by year.  var oldmap = L.tileLayer('address', {   maxZoom: 12 }),  var modernmap = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {   maxZoom: 12,   id: 'mapbox.streets',   accessToken: 'mytoken' });  var map = L.map('map', {   center: [40.1857864,-4.5536861],   zoom: 7,   layers: [oldmap, modernmap] });  var baseMaps = {   "Old map": oldmap,   "Modern map": modernmap };  var jsontest = {"type": "FeatureCollection",   "features": [     {       "type": "Feature",       "geometry": {         "type": "Point",         "coordinates":  [ -16.5471268,28.4136726 ]       },       "properties": {         "Name":"Point1",         "year":'1892',         "eventType":"funfair",         "notes":""       }     },     {       "type": "Feature",       "geometry": {         "type": "Point",         "coordinates":  [ 2.1753895,41.3767925 ]       },       "properties": {         "Name":"Point2",         "year":'1890',         "eventType":"trade demonstration",         "notes":""       }     }   ]};  var mapLayerGroupsYear = [];  function onEachFeature(feature, layer) {   var year = mapLayerGroupsYear[feature.properties.year];   if (year === undefined) {     year = new L.layerGroup();      //add the layer to the map     year.addTo(map);      //store layer     mapLayerGroupsYear[feature.properties.year] = year;   }    //add the feature to the layer   year.addLayer(layer);    }   var myLayer = L.geoJSON(jsontest, {   onEachFeature: onEachFeature })  L.control.layers(baseMaps, mapLayerGroupsYear).addTo(map);   I am a beginner with leaflet so please forgive the dumb question, in case it is. TP-Link Archer T3U Plus USB adapter Cannot make this wireless adapter work on Ubuntu 20.04... please help. I've tried this:  and now lsusb sees the device, but still doesn't work. lsusb: Bus 002 Device 006: ID 2357:0138 TP-Link 802.11ac NIC uname -r: 5.4.0-39-generic Edit: It works on my other computer with Ubuntu 18.04 using T2U Plus driver from here:  But it does not work with Ubuntu 20.04... sudo modprobe 88x2bu: Gives nothing. modinfo 88x2bu | grep -e version -e 0138 : version:        v5.6.1_30362.20181109_COEX20180928-6a6a srcversion:     9C5282368F93050B7206C8D parm:           rtw_chip_version:int  dmesg | grep 88x2 : [ 8087.334869] 88x2bu: loading out-of-tree module taints kernel. [ 8087.336610] 88x2bu: module verification failed: signature and/or required key missing - tainting kernel [ 8087.341389] usbcore: registered new interface driver rtl88x2bu Since I first learned English, I have been holding this understanding that "and", as a conj. but unlike "but",  can only connect two clauses, not two sentences ended with periods.  But recently, I have seen so many prints, either in entertainment or in academia, where "And" is popularly used in the beginning of a sentence. It seems like the author is trying to connect the sentence just right before and the sentence following "And" in some intended meaning which I don't quite get.  I was wondering if I have been wrong all the time, or if there is a new trend that I fail to understand and accept? How to understand such usage of "and" in rigorous English grammar? If I am right, why it is used differently from "but" in terms of what I mentioned at the beginning of this post? $ KC $ spaces imply $ US $ spaces , but vise versa is false. Pluralizing abbreviations where the noun is not the last word Any way to open windows from the windows bar using a shortcut? for example to open the first window on the left Ctrl+1, to open the second window on the left Ctrl+2.  Im using xfce4 at this moment, but if under xfce4 is not possible, is there any other desktop environment that permits this?  Since I have several windows open for the same application, I not searching for sortcuts related to the application but as I say below, to the window. Validate date format in php How to add a PPA on a server? How can I get a more traditional drop-down like menu for Unity? How can a distribution have infinite mean and variance? Zip all files in directory? Is there a way to zip all files in a given directory with the zip command? I've heard of using *.*, but I want it to work for extensionless files, too. Multiple citations: citation order different to bibliography order I wish to cite several sources at once and sort my in-text citations in a different manner to how they appear in my bibliography. I want my citations to be sorted by year and my bibliography to be sorted by author. I am using BibLaTeX with Biber. I used  to achieve this with TeX Live 2015 but since upgrading to 2016 (as well as upgrading all my packages) this does not work.  Below is a minimal working example (with a second bibliography for illustrative purposes). I wish for the citations to be sorted ascending by year (2001, 2002, 2003) and the bibliographies to be sorted alphabetically (a, b, c) and descending by year (2003, 2002, 2001) respectively, but below is an image of the result; the bibliographies stay true to the desired sorting but the citations in-text are sorted descending by year.  If I remove the last \newrefcontext then everything (citations and bibliographies) is sorted alphabetically, and if I remove both \newrefcontexts then everything is sorted ascending by year (which was the option specified when originally calling BibLaTeX). It seems that the citations follow the last sorting referenced; ynt as per BibLaTeX options when both \newrefcontexts are removed or else whatever sorting is specified in the last \newrefcontext.  I am compiling in order pdflatex, biber, pdflatex, pdflatex and am on MacTeX.  It seems this would have worked as desired in TeX Live 2015 so is this a bug or has something changed which requires the citation sorting to be set in some other way?  \documentclass{article}  \usepackage[            backend=biber,            style=authoryear,            sorting=ynt,            sortcites,            ]{biblatex}  \usepackage{filecontents} \begin{filecontents}{lib.bib} @article{test1,   author = {b},   title = {b},   year=2003, } @article{test2,   author = {c},   title = {c},   year=2001, } @article{test3,   author = {a},   title = {a},   year=2002, } \end{filecontents}  \addbibresource{lib.bib}  \begin{document}      Hello World! \parencite{test1,test2,test3}      \newrefcontext[sorting=nyt]     \printbibliography      \newrefcontext[sorting=ydnt]     \printbibliography  \end{document}     Edit  I have a workaround but it's super crap: Typeset the document with global sorting=ynt, copy the pdf to another file, then typeset the document with global sorting=nyt; using a PDF editing tool (Apple's Preview suffices) cut the pages containing the bibliography with the desired sorting from one PDF and paste into the other. As I said super crap. I'm not sure if I'd even do this as I'd feel dirty, but it's a workaround nonetheless.  If a solution does not exist or this is a bug without a patch, then what would be similar but much better would be some kind of package (which probably doesn't exist) which only changes certain pages at a time within the PDF (while still actually 'compiling' the whole document so that all the citations are done). It might look something like:  % document preamble % ...  \usepackage{onlychange} \onlychangerange{10,12}  % Bibliography found on pages 10--12 % On next compilation will typeset all pages except 10--12  % ...   It's a long shot but maybe someone knows of such a package or this rambling has inspired an actual solution.