Preface: I am an absolute novice with Linux, please don't judge strictly.   I have a directory containing several images (over 100) of a .pnm extension. I wish to rename them in such a sense, that their names should be "img1.pnm", "img2.pnm", "img3.pnm", etc. So they should have a common part in their names––"img" and different indicies running from "1".  How can I do this?
I have a directory which contains numbered image files, something like this:  01.png 02.png 03.png 03.svg 04.png 05.png 06.jpg 07.png 08.png 09.png 09.svg 10.png   Sometimes there may be multiple versions of a file in different formats (eg. a png and svg version of the 03 and 09 files above) but the numbers are otherwise consecutive.  Typically there are 40-80 such files in each directory.  The numbers correspond to the order these images appear in a manuscript (a Word document, but that's not important).  There is no other way to determine the order of the images.  If I add a new image to the manuscript I need to place a copy of the image in this directory with the correct numbering.  So if the new image is the fifth in the manuscript I need to rename the files in the directory to this in order to make room for it:  01.png 02.png 03.png 03.svg 04.png 06.png 07.jpg 08.png 09.png 10.png 10.svg 11.png   What is the most straightforward way from the command line, or from a script or macro to renumber all the files starting at a certain number?  I have a standard Fedora Linux install using bash.
What exactly happens when a Weeping Angel is quantum locked? Say, we have a query like this:  select a.*,b.* from  a join b on a.col1=b.col1 and len(a.col1)=10   Assuming the above query uses a Hash Join and has a residual, the probe key will be col1 and the residual will be len(a.col1)=10.  But while going through another example, I could see both the probe and the residual to be the same column. Below is an elaboration on what I am trying to say:  Query:  select * from T1 join T2 on T1.a = T2.a    Execution plan, with probe and residual highlighted:         Test data:    create table T1 (a int, b int, x char(200)) create table T2 (a int, b int, x char(200))  set nocount on declare @i int set @i = 0 while @i &lt; 1000   begin       insert T1 values (@i * 2, @i * 5, @i)     set @i = @i + 1   end  declare @i int set @i = 0 while @i &lt; 10000   begin     insert T2 values (@i * 3, @i * 7, @i)     set @i = @i + 1   end   Question:    How can a probe and a residual be the same column? Why can't SQL Server use the probe column only? Why does it have to use the same column as a residual to filter rows again?  References for test data: was closed as "Not constructive" a little while ago by CasperOne. I'm not here to argue about the closure; in fact, I'm forced to agree that, as it stands, the question is explicitly a polling question and eligible to be closed for that reason.  I'd like to see it preserved, however; it's got a fair bit of useful in-depth information for ObjC/Cocoa developers on the "singleton" topic.* It's also (possibly more importantly) a great duplicate target -- have a look at the list of linked questions. I want to try to stave off deletion, and hopefully get it reopened.** (I did vote for reopening, but it expired.)  My thought is to edit the question itself into a "constructive" form, but after spending some time pondering how to do so, I'm not crazy about any of the ideas that I've come up with. Essentially they all involve reworking the question to fit the answers:   Rewrite the question so that the accepted answer fits exactly. "I've got this singleton implementation, but I really want the creation to happen earlier in my app's execution. How can I make that happen?" This is artificial and (in my opinion) doesn't make a particularly good question. Make the question still general, but more concrete and focused on the implementation give in the body. "What are the pitfalls associated with this singleton creation procedure? Are there other features that my singleton should have?" This is still skirting the border of discussion->NC, and none of the answers really respond to this exactly. Remove the implementation from the question and just ask for the "best" implementation. This obviously requires coming up with stringent criteria for "best", and, while it would preserve the relationship between the Q and A's best, might not even move it out of NC territory.   I'm looking for suggestions of ways to re-write this so that it can stick around. Alternatively, if you think I should just be advocating for a historical lock, say so.   If you think my basic premise is faulty and don't think the question should be preserved at all, I respectfully request that you just downvote me instead of answering -- I'd prefer not to turn this into an argument about the merits of the question, and I definitely don't want it to become a(nother) "deletionist"/"inclusionist" skirmish (and I am not infrequently ).    *Quite a bit of it unfortunately in comments.  **Historical locking would also be an acceptable solution to me, but it doesn't seem to fit the "controversial" criterion. File /etc/ld.so.nohwcap is missing in Debian 7 What is the file /etc/ld.so.nohwcap used for?. In my machine (Debian 7), this file is not found. Therefore, Which package or library this file belongs to? Homeomorphism between the unit disc and the unit square I know that the function that describes the homeomorphism is: $f(x,y) =       \begin{cases}     \frac{x^{2}+y^{2}}{\max(|x|,|y|)}(x,y) &amp;\quad\text{if } (x,y)\ne  (0,0) \\       \text{} (0,0) &amp;\quad\text{if } (x,y) =  (0,0) \\       \end{cases}$  But it's impossible to me to show that $f(x,y)$ is an homeomorphism. Mostly i can't see the injectivity. Plotting a Continuous signal Degree of minimum polynomial at most $n$ without Cayley-Hamilton? How do I create a shortcut for a script, and run it as a .desktop file? I have installed Teamspeak onto my Ubuntu 15.10 system. Teamspeak requires a script to be ran in-order to start. How can I create a symbolic link that is a .desktop so I can open the .desktop file, and have it run the script? I have looked at a few methods, but they all seem like hotfixes. Is there a proper way to do this? Volumetric Windows 10 logo effect I'm trying to recreate the windows 10 background effect on a logo I've made in blender.  Half the logo has a glass like material, the other half has a steel like material. And I'm using cycles at the moment.  I've put various light sources behind the logo and tried a few variations of volumetric scatter in the world to get the god ray sort of feel coming off the logo, but it's just not looking anywhere near as effective as I'd like.  I know the win10 background was a real set and photographed, but has anyone come across a tutorial to do something similar in blender?  I'm very new to the tool, I'd appreciate any pointers in the right direction. How to exclude files from Visual Studio compile? I'm in the process of refactoring a project.  I've got an entire subfolder which is known to be broken.  Is there any declarative way to exclude that folder from the compile temporarily while I test the refactoring thus far?  I realize I could delete the folder, but I'd like to do this through configuration if possible. Count down in timeout is cut off The time out countdown which is flying in is missing half of the number.  Note the 33 here:        Can this be fixed please? How can I do a brute force (ciphertext only) attack on an CBC-encrypted message? Given a CBC ciphertext and IV, how can I find the encryption key?  We are limited with an 8 chars key, each char in the range of [a..h], so I can generate every possible key (these are only $8^8 = 2^{24}$ (about 4 million) different possible keys).  How would I go about finding the correct one though? How to Find Nearby iOS Devices (GPS locations) using same app What package should I use to typeset units? I know there are a few packages related to typesetting units:   unitsdef units, which can be seen as a "base package" used by unitsdef SIunits siunitx, which is the successor to SIunits maybe others? like cjwunits and hepunits   What is the difference between them? Do they also work inside Math mode? And, more importantly, which one should I use?  Suggestion for people trying to answer this question: show some examples of how to typeset both simple and complex units. For instance, try typesetting these items:   100 Celsius 3 x 10^5 km/s gravitational constant is measured in N m^2/kg^2 10 kHz = 1 s^{-4} sin(x) meters   I think these examples cover most needs when writing scientific texts: simple measurements (value + simple unit), values written in scientific notation, simple fractional units, complex fractional and squared units, units without any value accompanying them, units with arbitrary exponents, and arbitrary math code instead of a simple value. I've recently updated to Ubuntu 15.04 and after installing the latest nvidia drivers (346.59) which worked on ubuntu 14.10 seems to have caused some trouble on boot.  All I get is the following when booting:   A purple screen for about a second and then  [0.514409] ACPI PPC Probe failed. Starting version 219  A black screen with a message of my monitor saying : No Signal detected.   I am using a GTX 970. datetime.parse and making it work with a specific format Where exactly does energy quantisation come in for light? Planck quantised the energy of light in order to solve the black body radiation problem. However, I am confused as to exactly what he quantised. On one hand, I have seen that he quantised the energy of oscillators in the black body (source below).     However, the second version of the story I've heard is that it is simply that light energy is given off in discrete chunks (where every photon itself can have any value of energy it likes depending on frequency and is not quantised).   To me, the first idea doesn't make sense because $E=hf$ and as $f$ can be any real number that means the energy of each photon can be any real number. I would believe the second version, however I don't understand how this version of quantisation leads to reducing the number of high frequency waves emitted and thus solving the UV catastrophe. Could you please explain exactly how releasing energy in chunks (of arbitrary size themselves) means less will be released in the higher frequencies? Command for forcing a pointer ungrab (captured mouse release) Sometimes Firefox doesn't release the mouse after dragging, so I need to kill the application to force it to release its pointer grab.  Is there any command to force an application to ungrab the pointer without killing it? Performance of a Trigger vs Stored Procedure in MySQL $A^A$ in category of graphs (reference is Lawvere/Schanuel, Session 31, Ex. 1)  I'm trying to calculate the exponential object $A^A$ and its evalution map $e \colon A \times A^A \to A$ in the category of graphs, where $A$ is the "arrow graph" (ie. one arrow and two dots).  In the following, $D$ is the graph with one dot and no arrows, $1$ is the terminal object in this category (graph with one dot and one arrow, the loop).  So far I have:   The points of $\mathbf{1}\to A^A$ correspond to the maps $A\to A$ (via two standard isomorphisms), and since $\mathbf{1}$ is the loop, and there is one map of graphs $A \to A$, there is one loop in $A^A$. The dots $D\to A^A$ correspond to the maps $A \times D \to A$, of which there are four, hence four dots in $A^A$. The arrows $A \to A^A$ correspond to the maps $A \times A \to A$, of which there are four, hence four arrows in $A^A$.   But I'm stuck on how to put these together to constitute $A^A$ and its evaluation map.