Break out of two loops and two if statements - Python I have a section of code used to find a key value within a dictionary. The current method i'm using works, however i'm attempting to speed up the execution of the script. To do this i want to move the if ticker in tick: to immediately after for tick in trades_dic[&quot;Ticker&quot;].items():. The intention of which is to speed up this element by removing the need to check all combinations. Full section of code below, any help would be much appreciated. :)     for tick in trades_dic[&quot;Ticker&quot;].items():         for stat in trades_dic[&quot;Status&quot;].items():             if ticker in tick and &quot;Open&quot; in stat:                 (tick_k, tick_val) = tick                 (stat_k, stat_val) = stat                 if tick_k == stat_k:                     (active_k, v) = tick                     break         else:             continue         break
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?
Showing margins/frames in beamer slides I have some plasterboard screws like this:     However, without a drill I have a job getting them into the wall. Am I safe to use normal screws on hangings that aren't going to be taking a great deal of weight? In this case it is a rack of coat hooks. Binding energy and mass I’ve been told that a greater binding energy means the nucleus is more tightly bound, and therefore that decreases the mass of the nucleus with respect to its nucleons when separated. But why does a tighter nucleus mean a smaller mass? 50GB of disk space missing On a 120GB SSD hard drive in a MacBook only 70GB are available. The missing 50GB are not even shown as free space.  Here is what the output of Disk Utility looks like:        As you can see on the first screenshot the disk has 120GB. However, the partition chart on the same screenshot only shows 70GB. Also the other two screenshots show that only 70GB out of 120GB seem to be available.  The command diskutil list shows that the physical disk0 is 120GB big, but the synthesized disk1 only 70GB:  /dev/disk0 (internal, physical):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      GUID_partition_scheme                        *121.3 GB   disk0    1:                        EFI EFI                     209.7 MB   disk0s1    2:                 Apple_APFS Container disk1         70.0 GB    disk0s2  /dev/disk1 (synthesized):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      APFS Container Scheme -                      +70.0 GB    disk1                                  Physical Store disk0s2    1:                APFS Volume Macintosh HD            60.2 GB    disk1s1    2:                APFS Volume Preboot                 21.7 MB    disk1s2    3:                APFS Volume Recovery                509.9 MB   disk1s3    4:                APFS Volume VM                      2.1 GB     disk1s4 I've seen the word static used in different places in C code; is this like a static function/class in C# (where the implementation is shared across objects)? Is $\mathbf{Q}(\sqrt{2}, \sqrt{3}) = \mathbf{Q}(\sqrt{2}+\sqrt{3})$? Is $\mathbf{Q}(\sqrt{2}, \sqrt{3}) = \mathbf{Q}(\sqrt{2}+\sqrt{3})$ ?    $$\mathbf{Q}(\sqrt{2},\sqrt{3})=\{a+b\sqrt{2}+c\sqrt{3}+d\sqrt{6} \mid a,b,c,d\in\mathbf{Q}\}$$   $$\mathbf{Q}(\sqrt{2}+\sqrt{3}) = \lbrace a+b(\sqrt{2}+\sqrt{3}) \mid a,b \in \mathbf{Q} \rbrace  $$  So if an element is in $\mathbf Q(\sqrt{2},\sqrt{3})$, then it is in $\mathbf{Q}(\sqrt{2}+\sqrt{3})$, because $\sqrt{6} = \sqrt{2}\sqrt{3}$.  How to conclude from there? new array.sty and colortbl.sty incompatibility? I just upgraded my texlive distribution and can no longer insert space in table rows using \\[x pt] syntax when colortbl is loaded.  It seems that recent changes to array.sty might be the problem as this is the only package to change recently.  Can anyone suggest a workaround?  MWE  \listfiles \documentclass{article} \usepackage{colortbl} \begin{document} \begin{tabular}{l}   \hline   No space below with \texttt{colortbl.sty} loaded. \\[10mm]   \hline \end{tabular} \end{document}   File versions in use:   article.cls    2014/09/29 v1.4h Standard LaTeX document class   size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option) colortbl.sty    2012/02/13 v1.0a Color table columns (DPC)    array.sty    2018/04/07 v2.4g Tabular extension package (FMi)    color.sty    2016/07/10 v1.1e Standard LaTeX Color (DPC)    color.cfg    2016/01/02 v1.6 sample color configuration   pdftex.def    2018/01/08 v1.0l Graphics/color driver for pdftex What does "rc" in .bashrc stand for? Is it "resource configuration", by any chance? 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. Determine Whether Two Date Ranges Overlap Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap?  As an example, suppose we have ranges denoted by DateTime variables StartDate1 to EndDate1 and StartDate2 to EndDate2. "I use to", or "I used to" Which is the correct sentence, if there is a correct one?     I use to be a hitman.        I used to be a hitman.   I've read the second sentence recently in a book, but I was sure it should be I use to be a hitman. How to change text format of summary/trimmed field? Is there a straightforward way to change the summary/trimmed text to "full html" in Drupal 8?  There are workarounds such as creating separate body fields and using them as the summary but I am specifically asking about changing the text format of default summary/trimmed field of "Text (formatted, long, with summary)".  To put it another way, how to I add the CKEditor bar to the summary/trimmed text. Is "this Monday" or "next Monday" the correct way to refer to the very next Monday in the future? Possible Duplicate:          When I refer to the very next Monday that will occur in the future, I say "next Monday". Some colleagues refer to it as "this Monday", with "next Monday" meaning the second Monday which will occur in the future (I would refer to that as "Monday week", "this Monday" to me would mean the most recent Monday in the past).  Are these both acceptable usages, or is one more correct than the other? bracket style border around elements Let be $u,v\in\mathbb{R}^n$, then $\det(I+uv^\intercal)=1+v^\intercal u $ where $I$ denotes the identity matrix of order $n$. How to prove this?   what I did:   let be $A=\{n\in\mathbb{N}: \forall u,v \in \mathbb{R^n}, \det(I+uv^\intercal)\neq1+v^\intercal u  \} $, and suppose $A\neq \varnothing $, then for the well-orderer-principle there exists $n_0\in A$ such $n_0\leq n,\;\forall n\in A$. since $1\notin A,\; n_0\neq 1 \rightarrow n_0-1\in\mathbb{N}\setminus A  $ so: $$\forall u,v\in\mathbb{R^{n_0-1}}: \det(I+uv^\intercal)=1+v^\intercal u $$ Then, let be $u,v\in\mathbb{R}^{n_0}$, so $$\det(I+uv^\intercal)= \displaystyle\sum_{j=1}^{n_0}(-)^{1+j}a_{1j}\det(A_{1j})$$ where $a_{ij}=\begin{cases} u_iv_j+1 &amp; i=j \\ u_iv_j &amp; i\neq j \end{cases}$, and $A_{1j}$ is the  submatrix of $I+uv^\intercal$ that results deleting the i-file and j-column. Then I try to open the term for $j=1$ and try to use the relation for the new matrix of $n_0-1$ order with the determinant because it holds the same form but I have other terms which difficult me the work. Do you know other method?.  Ps. , in page 2 I've found something similar but I don't understand what it means PS. I'm taking a course of numerical analisys Draw integers independently & uniformly at random from 1 to $N$ using fair d6? Is the convex hull of a compact set compact? Let $V$ be a normed vector space and $K$ a compact subset of $V$. Is the convex hull of $K$ given by $$\langle K \rangle = \left\{\sum_{i=1}^n t_i x_i\mid x_i\in K, t_i≥0\text{ s.t. }\sum_i t_i=1\right\}$$ again compact? Find and Replace Inside a Text File from a Bash Command How do you persuade an organization to value UX? UX is such an underrated field in a lot of industries. I wonder how companies consider employing UX designers and even heavily valuing their suggestions. Some big companies happen to see the light and invest in UX, and that keeps them on top of others. However, UX people rarely make it to the top management. In Don Norman's talk (  ), out of so many UX people (I don't know exactly), only two were vice presidents. I assume that there are even less influential UX designers in developing countries, and that's what makes it even harder for people like me. In the same talk, Don Norman suggested that UX designers should approach their executives like marketing people, showing how investing in something will affect profit. Perhaps, it's the best thing to do but it has to be mastered for it to be executed successfully.   I'm a fresh grad and am looking for a job. I think, working for a company with a more conventional job description would be the way to go. When I'm already influential enough, I'll go up to the executives and show them how UX will improve sales (in whatever industry it is. I just want to do UX)  Do you do UX as consultants or are you employed? How do you persuade companies to invest in UX? Are you lucky enough to be employed by people who you didn't have to persuade to value UX? This should be a fairly trivial problem. I'm trying to open an ofstream using a std::string (or std::wstring) and having problems getting this to work without a messy conversion.  std::string path = ".../file.txt";  ofstream output;  output.open(path);   Ideally I don't want to have to convert this by hand or involve c-style char pointers if there's a nicer way of doing this?