sometimes using rm -rf in script could be catastrophic  example  rm -rf $TMP/$folder   when TMP and $folder are without any value , it will actually   removing all under "/"  so I am asking how to use the rm -rf in the scripts so it will be safe?
Sometimes I use, $PROJECT_HOME/* to delete all files in the project. When the environment variable, PROJECT_HOME is not set (because I did su and the new user doesn't have this environment variable set), it starts deleting all files from the root folder. This is apocalyptic.  How can I configure bash to throw error, when I use an undefined environment variable in the shell?
On  the delete notice is above, instead of below the close notice. Why is this happening? I understand this was made on purpose, but would like to know the reasoning. Kinetic energy is simple, right?! from the equation it seems as though if you know the speed and mass you'll know the work. Let's try to prove it. let's assume we know the acceleration and distance for now. $$w=mda$$ So the distance is $$d= 1/2 *at^2$$ Then  $$t = \sqrt{2d/a}$$ So $a*t$, which is the speed, is  $$a*\sqrt{2d/a} = a* \sqrt{2d}/\sqrt{a} = \sqrt{2da} = \sqrt{2w/m}$$ So regardless of the distance or acceleration, if you know the work and the mass, you can calculate the speed which is  $$v=\sqrt{2w/m}$$  What if you know the speed and the mass? You can easily calculate the work. $$v = \sqrt{2w/m}$$ Then  $$v^2 = 2w/m$$  That would mean  $$m*1/2*v^2=W $$ Rearrange it and  $$W= 1/2 *m *v^2$$ would be the equation.  What if you have an initial speed and a new speed and want calculate the amount of work done after an initial speed to get the new speed? You'll just subtract the total work from the initial speeds work.  $$1/2mv^2 - 1/2ms^2$$  where s is  the initial speed and v is the new speed. However if you do it the other way which is  $$d= 1/2at^2 + vt$$ and solve it the answer would be $$1/2ms^2  + 1/2msv$$ Why aren't they equal? Where does the extra kinetic energy come from in a gravitational slingshot? I read in  in this site that the KE a free-falling ball acquires is not originated by the attracting body but that energy was actually stored in the ball when it had been lifted to the height it dropped from.  In this way, it was said, gravity is subject to the conservation of energy principle and cannot change the total energy of an object.  Consider now the maneuver known as a  (also gravity assist) used by space probes such as the . A space probe approaches a planet with velocity $v$, slingshots around, and ends up with velocity $v+2U$, where $U$ is the velocity of the planet.  Consider the energy of the probe. Before, it was $E_i=\frac{1}{2} mv^2$ and after it is $E_f=\frac{1}{2} m(v+2U)^2$. It looks like $E_f$ is much bigger than $E_i$ - but where did the additional energy come from?   Is this not a violation of the conservation of energy principle? How do I install gfortran? I am trying to install gfortran in my computer with Ubuntu 12.04 by using these commands,  sudo -i apt-get update apt-get install gfortran   but I found the program saying "unable to locate package gfortran". Then on a Ubuntu page I found some question regarding the same problem and I went through the solution from them but again I couldn't install the gfortran package.  Can anybody tell me how to install it? Installing grounded light fixture on box with no ground conductor I'm installing a brand new motion activated security light to an existing box on my garage. After removing the old light, I notice it only has white/black wiring while the new light fixture has of course white/black/green (ground) wires to attach. What do I do if no ground wire is available with the old box? MySQL Hashing Function Implementation I know that php has md5(), sha1(), and the hash() functions, but I want to create a hash using the MySQL PASSWORD() function.  So far, the only way I can think of is to just query the server, but I want a function (preferably in php or Perl) that will do the same thing without querying MySQL at all.  For example:  MySQL hash -> 464bb2cb3cf18b66  MySQL5 hash -> *01D01F5CA7CA8BA771E03F4AC55EC73C11EFA229  Thanks! Description of varieties in $\mathbb{P}^2\times \mathbb{P}^1$ If $[x:y]$ are coordinates of $\mathbb{P}^1$ and $[X:Y:Z]$ are coordinates of $\mathbb{P}^2$, what do the following varieties look like?   $V(x^2X+y^2Y+xyZ)\subset \mathbb{P}^2\times \mathbb{P}^1$ $V(x^2X^2+y^2Y^2+xyZ^2)\subset \mathbb{P}^2\times \mathbb{P}^1$   As of now, I don't quite know how to visualize these varieties. A detailed geometric picture would be especially welcome. Why the statement "there exist at least one bound state for negative/attractive potential" doesn't hold for 3D case? Previously I thought this is a universal theorem, for one can prove it in the one dimensional case using variational principal.   However, today I'm doing a homework considering a potential like this:$$V(r)=-V_0\quad(r&lt;a)$$$$ V(r)=0\quad(r&gt;a)$$ and found that there is no bound state when $V_0a^2&lt;\pi^2\hbar^2/8m$.  So what's the condition that we have at least one bound state for 3D and 2D? Unable to set DYLD_FALLBACK_LIBRARY_PATH in shell on OSX 10.11.1 In shell scripts used for unit testing with dynamic libraries in a directory other than the typical @rpath, I have previously been able to set DYLD_FALLBACK_LIBRARY_PATH to set the directory containing the libraries. Under 10.11.1, bash seems to ignore attempts to set this environment variable:  $ sh -x testscript.sh + DYLD_FALLBACK_LIBRARY_PATH=/Users/something/testinglibs + export DYLD_FALLBACK_LIBRARY_PATH + exec printenv   and DYLD_FALLBACK_LIBRARY_PATH is not present in printenv's output.  Is this a security-related hack in 10.11's shell? I haven't been able to find this change documented in man pages or online. How to add element by element of two STL vectors? Presentation of SL$(n,\mathbb{Z}_p)$ I know a presentation of the special linear group SL$(2,3)$(). My question is that-     Can we give a presentation for SL$(n,\mathbb{Z}_p)$ in general or in more general can we  give a presentation for SL$(n,\mathbb{F})$,where $\mathbb{F}$ is field.   As J.P. Serre had given presentation for SL$(2,\mathbb{Z})$   $$\mathrm{SL}_2(\mathbb{Z}) = \langle \,S, T \mid S^4 = 1, (ST)^3 = S^2 \,\rangle$$ where, \begin{align}     S &amp;=     \begin{pmatrix}     \phantom{-}0&amp; 1 \\ -1 &amp; 0     \end{pmatrix},     &amp;     T &amp;=      \begin{pmatrix}     1 &amp; 0 \\ 1 &amp; 1     \end{pmatrix}. \end{align} I wants it to be more general. This is on Stack Overflow. On Meta I'm able to see what the tags are on the right side of the screen. In fact, I think yesterday or some point earlier today I saw tags on the right side of the screen (I can't screenshot or remember correctly).  It's right above the asked and active heading.  I know this is minor but what happened to it? It might be useful for browsing instead of having to look at the bottom of the question post.    Found an image on Google and it shows the tags on the right side of the screen: I am nearing the end of my PhD and I would quite like to buy a "thank you" gift for my supervisor (although, she's the socially awkward type who I'm sure will be greatly embarrassed to receive one).  I'm just wondering whether a gift is the done thing? And if so, what sort of gift seems appropriate? I suppose a bottle of wine would be a safe choice? Aggregate Rating not displayed in Google search results Why are Marketing Cloud timestamps not stored in the same timezone as Sales Cloud? reveals x2 code snippets. The first result is to  which has a lot of documentation and explanation, along with some useful discussion underneath.   However, , whilst not containing so much documentation, includes sample code for passing commands such as start, stop and restart. It also creates a PID file which can be handy for checking if the daemon is already running etc.  These samples both explain how to create the daemon. Are there any additional things that need to be considered? Is one sample better than the other, and why? Compute: $\lim_{n \rightarrow \infty}\sqrt{n}(A_{n+1} − A_n)$ where $A_n = \frac{1}{n}(a_1 + a_2 + \cdots + a_n)$ Let $\{a_n\}, {n\geq 1}$, be a sequence of real numbers satisfying $|a_n|\leq 1$ for all $n$. Define  $$A_n = \frac{1}{n}(a_1 + a_2 + \cdots + a_n),$$ for $n\geq 1$. Then find $\displaystyle\lim_{n \rightarrow \infty}\sqrt{n}(A_{n+1} − A_n)$ .    I proceed in this way  $$\lim_{n \rightarrow \infty}\sqrt{n}(A_{n+1} − A_n)=\lim_{n \rightarrow \infty}\sqrt{n}\left[\frac{1}{n+1}(a_1 + a_2 + \cdots + a_n+a_{n+1})-\frac{1}{n}(a_1 + a_2 + \cdots + a_{n})\right]=\lim_{n \rightarrow \infty}\left[{(na_{n+1}-a_1 - a_2 - \cdots - a_n})\frac{1}{\sqrt{n}(n+1)}\right]$$  Please help me to complete from here It would seem that one way of proving this would be to show the existence of non-algebraic numbers. Is there a simpler way to show this? Command "find -name" must be enclosed in quotes or it doesn't work. Why is that? find . -name *.rb   doesn't work on my ubuntu  I have to do  find . -name "*.rb"   to get it to work.  Why is that? What is a field, really? There was a reason why I constantly failed physics at school and university, and that reason was, apart from the fact I was immensely lazy, that I mentally refused to &quot;believe&quot; more advanced stuff until I understand the fundamentals (which I, eventually, never did). As such, one of the most fundamental things in physics that I still don't understand (a year after dropping out from the university) is the concept of . No one cared to explain what a field actually is, they just used to throw in a bunch of formulas and everyone was content. The school textbook definition for a field (electromagnetic in this particular case, but they were similar), as I remember it, goes like:  An electromagnetic field is a special kind of substance by which charged moving particles or physical bodies with a magnetic moment interact.  A special kind of substance, are they for real? This sounds like the authors themselves didn't quite understand what a field is so they decided to throw in a bunch of buzzwords to make it sounds right. I'm fine with the second half but a special kind of substance really bugs me, so I'd like to focus on that. Is a field material? Apparently, it isn't. It doesn't consist of particles like my laptop or even the light. If it isn't material, is it real or is it just a concept that helps to explain our observations? While this is prone to speculations, I think we can agree that in scope of this discussion particles actually do exist and laws of physics don't (the latter are nothing but human ideas so I suspect Universe doesn't &quot;know&quot; a thing about them, at least if we're talking raw matter and don't take it on metalevel where human knowledge, being a part of the Universe, makes the Universe contain laws of physics). Any laws are only a product of human thinking while the stars are likely to exist without us homo sapiens messing around. Or am I wrong here too? I hope you already see why I hate physics. Is a field not material but still real? Can something &quot;not touchable&quot; by definition be considered part of our Universe by physicists? I used to imagine that a &quot;snapshot&quot; of our Universe in time would contain information about each particle and its position, and this would've been enough to &quot;de&quot; it but I guess my programmer metaphors are largely off the track. (Oh, and I know that the uncertainty principle makes such (de)serialization impossible — I only mean that I thought the Universe can be &quot;defined&quot; as the set of all material objects in it). Is such assumption false? At this point, if fields indeed are not material but are part of the Universe, I don't really see how they are different from  except for perhaps a more geeky flavor. When I talked about this with the teacher who helped me to prepare for the exams (which I did pass, by the way, it was before I dropped out), she said to me that, if I wanted hardcore definitions,  a field is a function that returns a value for a point in space.  Now this finally makes a hell lot of sense to me but I still don't understand how mathematical functions can be a part of the Universe and shape the reality.