Delete item from list in Python while iterating over it
How to remove items from a list while iterating?
This is, how I download various master branches from GitHub, and I aim to have a prettier script (and maybe more reliable?).  wget -P ~/ https://github.com/user/repository/archive/master.zip unzip ~/master.zip mv ~/*-master ~/dir-name   Can this be shorten to one line somehow, maybe with tar and pipe?  Please address issues of downloading directly to the home directory ~/ and having a certain name for the directory (mv really needed?). Why is it that many of the most important physical equations don't have ugly numbers (i.e., "arbitrary" irrational factors) to line up both sides?   Why can so many equations be expressed so neatly with small natural numbers while recycling a relatively small set of physical and mathematical constants?  For example, why is mass–energy equivalence describable by the equation $E = mc^2$ and not something like $E \approx 27.642 \times mc^2$?  Why is time dilation describable by something as neat as $t' = \sqrt{\frac{t}{1 - \frac{v^2}{c^2}}}$ and not something ugly like $t' \approx 672.097 \times 10^{-4} \times \sqrt{\frac{t}{1 - \frac{v^2}{c^2}}}$.  ... and so forth.    I'm not well educated on matters of physics and so I feel a bit sheepish asking this.   Likewise I'm not sure if this is a more philosophical question or one that permits a concrete answer ... or perhaps even the premise of the question itself is flawed ... so I would gratefully consider anything that sheds light on the nature of the question itself as an answer.    EDIT: I just wished to give a little more context as to where I was coming from with this question based on some of the responses:  @Jerry Schirmer comments:      You do have an ugly factor of $2.997458 \times 10^8 m/s$ in front of everything. You just hide the ugliness by calling this number c.   These are not the types of "ugly constants" I'm talking about in that this number is the speed of light. It is not just some constant needed to balance two side of an equation.  @Carl Witthoft answers:      It's all in how you define the units ...   Of course this is true, we could in theory hide all sorts of ugly constants by using different units on the right and the left. But as in the case of $E=mc^2$, I am talking about equations where the units on the left are consistent with the units on the right, irrespective of the units used. As I mentioned on a comment there:     $E=mc^2$  could be defined using units like $m$ in imperial stones ($\textsf{S}$), $c$ in cubits/fortnight ($\textsf{CF}^{−1}$) and $E$ in ... umm ... $\textsf{SC}^2\textsf{F}^{−2}$ ... so long as the units are in the same system, we still don't need a fudge factor.   When the units are consistent in this manner, there's no room for hiding fudge constants. I've heard Google's algorithm is based on PageRank, and that it has something to do with the links to your site. Can someone explain it, and more importantly, how I can increase my site's PageRank? Do Arcane Ward's starting hit points include the INT modifier once or twice? An abjuration wizard's Arcane Ward states:     [...] The ward has hit points equal to twice your wizard level + your Intelligence modifier.   So how many hit points is this supposed to be?  \$ (2 \times WizardLevel) + INT_{mod}\$  or  \$2 \times (WizardLevel + INT_{mod})\$ ?  I feel like the phrasing hints toward the first calculation, but it's still somewhat ambiguous. Auto mount a disk drive in ubuntu 14.04 LTS (Bookmark directory not found) I'm using ubuntu 14.04 LTS. When I start my pc and click on any bookmark from the file manager it shows this error:   Unable to find the requested file. Please check the spelling and try again. Unhandled error message: Error when getting information for file '/media/angel/DOC/edu': No such file or directory   But when I open DOC drive and again clink on the same bookmark it works properly. Can anybody tell me why is this happening and how to solve this issue?   Edit: Output of lsblk is following: (ubuntu is installed in sda5)  NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0 119.2G  0 disk  ├─sda1   8:1    0  91.3G  0 part  ├─sda2   8:2    0     1K  0 part  ├─sda5   8:5    0  24.1G  0 part / └─sda6   8:6    0   3.8G  0 part [SWAP] sdb      8:16   0 465.8G  0 disk  ├─sdb1   8:17   0  93.2G  0 part  ├─sdb2   8:18   0     1K  0 part  ├─sdb5   8:21   0  93.2G  0 part  ├─sdb6   8:22   0  89.3G  0 part  ├─sdb7   8:23   0  93.2G  0 part  ├─sdb8   8:24   0  93.2G  0 part  └─sdb9   8:25   0   3.8G  0 part  sr0     11:0    1  1024M  0 rom     After opening the disk drive the output of lsblk is bellow:   NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0 119.2G  0 disk  ├─sda1   8:1    0  91.3G  0 part  ├─sda2   8:2    0     1K  0 part  ├─sda5   8:5    0  24.1G  0 part / └─sda6   8:6    0   3.8G  0 part [SWAP] sdb      8:16   0 465.8G  0 disk  ├─sdb1   8:17   0  93.2G  0 part  ├─sdb2   8:18   0     1K  0 part  ├─sdb5   8:21   0  93.2G  0 part  ├─sdb6   8:22   0  89.3G  0 part /media/angel/DOC ├─sdb7   8:23   0  93.2G  0 part  ├─sdb8   8:24   0  93.2G  0 part  └─sdb9   8:25   0   3.8G  0 part  sr0     11:0    1  1024M  0 rom   The output of sudo blkid gives the following information about sdb6:  /dev/sdb6: LABEL="DOC" UUID="04280A22280A12FA" TYPE="ntfs" Can grep output only specified groupings that match? Say I have a file:  # file: 'test.txt' foobar bash 1 bash foobar happy foobar   I only want to know what words appear after "foobar", so I can use this regex:  "foobar \(\w\+\)"   The parenthesis indicate that I have a special interest in the word right after foobar.  But when I do a grep "foobar \(\w\+\)" test.txt, I get the entire lines that match the entire regex, rather than just "the word after foobar":  foobar bash 1 foobar happy   I would much prefer that the output of that command looked like this:  bash happy   Is there a way to tell grep to only output the items that match the grouping (or a specific grouping) in a regular expression? How can I search for a keyword with special characters in Google Search? "Over vs Above" and "Under vs below" Is is possible to say that "Above" means "over" and "Under" means"below", but not the opposite?  According to my grammar:  Over - In a higher position (close or touching) Above - In a higher position  Under - In a lower position (close or touching) Below - In a lower position  Example:     There's a helicopter flying round above / over the school.   I would interpret this sentence as "above" meaning almost touching the school or not. And If I hear "over", the helicopter is almost touching school.  This makes me think about "over" and "on". "On" means that something is touching something, but if "over" can mean also "touch".Well, I would never use "over" to mean "touching something", I would use "on" instead. Why can't variable names start with numbers? I have to admit, I didn't even know spoilers were supported until today, but really bugs me that spoilers just look like empty block quotes before you mouse over them.   Is this a spoiler or just a long empty block quote? I can't tell right away, so it would be really nice if there was some indication of which one it was so I didn't have to push my mouse all the way over to it. What can I say, I'm incredibly lazy.  vs.         I suppose the author should include something that says 'Spoilers below:', but it would be nice if there was some other indication of what it was. I have been reading about the new Salesforce async triggers. Currently, I tend to handle these sort of needs with a trigger that passes data to a 'Handler class' that would evaluate if a certain change has occurred. If it has then we pass those Ids to a queueable class for further processing.   What advantage do CDC and async triggers offer over using queueable or batch apex? How can I quickly get a player back into a session after their character dies? As a GM, what kind of techniques could I use to help a player re-join the gaming session after their character dies? I want to avoid any major interruptions to the flow of the adventure. I would also like to avoid having to end the session immediately or making them sit on the side-lines for the rest of the session. I need to take a screenshot that records my Eclipse IDE menu item status. For example, if I clicked the "Project" menu and there comes a list of menu items. I need to record those menu items.  The problem is when the menu item list window (which works like a context menu window) has the focus, the screenshot function is not working. I tried everything on this  and nothing works as long as the menu items window is opened. Any mouse click will close the context menu window, so I cannot use mouse either. However if there is no context menu window opened then screenshots works fine.  How can I record the screen with context menu window displayed? Accessing variables from other functions without using global variables I've heard from a variety of places that global variables are inherently nasty and evil, but when doing some non-object oriented Javascript, I can't see how to avoid them. Say I have a function which generates a number using a complex algorithm using random numbers and stuff, but I need to keep using that particular number in some other function which is a callback or something and so can't be part of the same function.   If the originally generated number is a local variable, it won't be accessible from, there. If the functions were object methods, I could make the number a property but they're not and it seems somewhat overcomplicated to change the whole program structure to do this. Is a global variable really so bad? Prove linear combinations of logarithms of primes over $\mathbb{Q}$ is independent Suppose we have a set of primes $p_1,\dots,p_t$. Prove that  $\log p_1,\dots,\log p_t$ is linear independent over $\mathbb{Q}$. Now, this implies $ \sum_{j=1}^{t}x_j\log(p_j)=0 \iff x_1=\dots=x_t=0$.  I think I have to use that fact that every $q\in\mathbb{Q}$ can be written as $\prod_{\mathcal{P}}$, where $n_p$ is a unique sequence ($n_2$,$n_3$,$\dots$) with domain $\mathbb{Z}$. Here, $\mathcal{P}$ denotes the set of all integers.  Now how can I use this to prove the linear independency? How to download Bootcamp drivers without Bootcamp assistant? Implications and Ordinary language Does it look good to edit the question you're answering? I have a question about editing practices:  Does it look good to edit a question you have just answered?  For example: say I had just answered a question, then saw that the question had some minor formatting issues. Should I edit it? Does it turn up voters off when they see that I am answering a question I changed, possibly to better suit my answer? Inverse images of images, images of inverse images of a set of vectors What can be said about$\ f^{-1}(f(S))$ and$\ S$, where$\ f(S):=\{f(x):x \in S\}$?   I feel as if$\ f^{-1}(f(S))$ will be smaller than or equal in size (number of elements) to$\ S$.  For example, if$\ f(x)=x$, then$\ f(\{-1, 0, 1, 2\})=\{-1, 0, 1, 2\}$and$\ f^{-1}(f\{-1, 0, 1, 2\})=\{-1, 0, 1, 2\}$ (same size).  But if$\ f(x)=x^2$, then$\ f(\{-1, 0, 1, 2\})=\{0, 1, 4\}$ and$\ f^{-1}(f\{0, 1, 4\})=\{0, 1, 2\}$, which is a little bit smaller than$\ S$.   What can be said about$\ f(f^{-1}(U))$ and$\ U$, where$\ f^{-1}(U):=\{x \in X:f(x) \in U\}$?   The same size as each other? Always?? Possible Duplicate:          I am a little bit confused about asking a question:     Can you please tell me my next work?   or     Could you please tell me my next work?   Which is more correct?