check if a file is already open before trying to delete it
Check if file is already open
Ever since I upgraded to 15.10, fdisk -l reports 16 ram disks (/dev/ram0 ... /dev/ram15). I'm a bit unsure what those are needed for. Is it safe to delete them? If not, how can I get rid of that fdisk output? I'm trying to do some scenes which use a mixture of 3D backgrounds with 2D animated characters.The best way I've figured this out so far is to use a plane with an image sequence of pngs which hold the frames.  The problem with this method is Blender seams to only load image sequences based on image numbering. If I wanted to do a sequence which loops say, frames 0-5, then repeats 4-0 for the 'return' of the animation, I would have to load frames doubled up.  Is there a way, maybe with a script, to change the sequence order? I can see it as a useful plugin but my python skills are pretty much non existent. MySQL SELECT LAST_INSERT_ID() for compound key. Is it possible? Can I get the LAST INSERT ID() for a compound key in MySQL? Do I have to worry about copyright issues for code posted on Stack Overflow? I was wondering about the copyright of code snippets from answers. Let's say you ask a question and the solution consists of ten lines of code, which are given in an answer. Are there any restrictions about the use of that code?   It seems that the content of this page is under the . So does one have to attribute the author if code is used in an open source project? Can it be legally used in closed source projects at all?  I guess ten lines of code are not really problematic, but is there a critical number of lines? How do I redirect to another webpage? How can I redirect the user from one page to another using jQuery or pure JavaScript? In email applications should the text of the cover letter be stated directly in the email or be attached in a separate file? I recently read the .  This book had the idea of the time you live as something that can be used to pay for things. When you run out of "money" you die.  I was wondering is this the original source for this idea? Or does anyone know of an earlier book with the same idea? The difference between with or without intercept model in logistic regression I've been studying the Huddleston and Pullum book for four months now. So far only one thing confuses me: the identity of gerund. Is it a noun or a verb?        His constant smoking upset me.  smoking seems  noun because of adjective constant.   Him/His constantly smoking upset me. smoking seems to be verb because of adverb constantly.   Him/His smoking cigars upset me. smoking seems to be a verb because of object cigars.      "His smoking upset me." So is this smoking gerund a noun or verb? Because there is no differentiation, is it both verb and noun? Maybe it's new word category?  Also his seems to be both  sometimes a subject and at other times a possessive determiner. Is that correct? Why does no physical energy-momentum tensor exist for the gravitational field? Starting  with the Einstein-Hilbert Lagrangian  $$ L_{EH} = -\frac{1}{2}(R + 2\Lambda)$$  one can formally calculate a gravitational energy-momentum tensor   $$ T_{EH}^{\mu\nu} = -2 \frac{\delta L_{EH}}{\delta g_{\mu\nu}}$$  leading to  $$ T_{EH}^{\mu\nu} = -G_{\mu\nu} + \Lambda g_{\mu\nu} = -(R_{\mu\nu} - \frac{1}{2}g_{\mu\nu}R) + \Lambda g_{\mu\nu}. $$  But then, in the paragraph below Eq. (228) on page 62 of  paper, it is said that this quantity is not a physical quantity and that it is well known that for the gravitational field no (physical) energy-momentum tensor exists.  To me personally, this fact is rather surprising than well known. So can somebody explain to me (mathematically and/or "intuitively") why there is no energy-momentum tensor for the gravitational field? If $A$ is a square matrix and $A^2 = 0$ then $A=0$. Is this true? If not, provide a counter-example. This is a proof question and I am not sure how to prove it. It is obviously true if you start with $A = 0$ and square it.   I was thinking:  If $ A^2 = 0 $  then $ A A = 0 $  $ A A A^{-1} = 0 A^{-1}$  $I\,A = 0 $   but the zero matrix is not invertible and that it was not among the given conditions.  Where's a good place to start? Biblatex with Biber: Configuring my editor to avoid undefined citations Running the minimal example  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example,   author  = {Other, Anthony Norman},   title   = {Some things I did},   year    = {2014},   journal = {J.~Irrep. Res.},   volume  = {1},   number  = {1},   pages   = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document}   I get the warning There were undefined references.  I have read  and know that I need to run:   LaTeX Biber LaTeX   However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle?  Answers (sorted alphabetically by editor name)                    Answer guidelines   Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools Is it possible to check out subdirectories of a repository in Git?  Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization:   wordpress/wp-content/plugins/myplugins/  wordpress/wp-content/themes/mytheme/   I want to maintain these directories via Git. In Subversion, I would accomplish this by having trunk/myplugins/ and trunk/mytheme/ directories and checking out subdirectories. Does Git have a way to accomplish the same task using a single repository?  I could just be missing the boat on some Git paradigm, as a long time SVN user with little exposure to Git.  Edit:  storing different content is an interesting way to handle this. creating model mesh and face explosions on Panda3d and Blender How to install qt 4.8 from repository? How to install qt 4.8 and QtCreator from repository ? Which is correct, "you and I" or "you and me"? I have had no problems exporting .fbx files for Unity except recently some of my .fbx started to rotate the mesh. The asset is correctly oriented, but the mesh is rotated 90 degrees. Is there an explanation and fix for why this happens sometimes, and works properly otherwise? Java: how do I check if a Date is within a certain range? I have a series of ranges with start dates and end dates. I want to check to see if a date is within that range.  Date.before() and Date.after() seem to be a little awkward to use. What I really need is something like this pseudocode:  boolean isWithinRange(Date testDate) {     return testDate &gt;= startDate &amp;&amp; testDate &lt;= endDate; }   Not sure if it's relevant, but the dates I'm pulling from the database have timestamps. Should we avoid negative words when writing error messages? What do you call a person who is never content with anything that is given to him? I am looking for an adjective for a person who, no matter what you give him/her (materially or otherwise), is never content and always expects more.