For example I have '-Werror=return-type' because I'll get weird bugs if I accidentally forget to return a value in my function. I don't know why it isn't an error in C++. I also have missing-variable-declarations to avoid bugs. However I don't want unused-variable/label as errors on debug builds because I'll have a few of them before I finish writing the code. (That error is on in release build). Recently I added macro-redefined which inspired this question because there's a lot more I should add. Which warning as errors do you guys recommend in debug builds?
What compiler warning level do you recommend for different C/C++ compilers?  gcc and g++ will let you get away with a lot on the default level.  I find the best warning level for me is '-Wall'.  And I always try to remove fix the code for the warnings it generates.  (Even the silly ones about using parenthesis for logical precedence rules or to say I really mean 'if (x = y)')  What are your favorite levels for the different compilers, such as Sun CC, aCC (HPUX ?), Visual Studio, intel?  Edit:  I just wanted to point out that I don't use "-Werror" (but I do understand it's utility) on gcc/g++ because, I use:   #warning "this is a note to myself"   in a few places in my code.  Do all the compilers understand the #warning macro?
This is from page 3 of  ().  Copying the relevant segment:     Stirling’s approximation tells us $\sqrt{2\pi n} (n/e)^n \leq n! \leq e^{1/12n} \sqrt{2\pi n} (n/e)^n$. In particular we can use this to say that   $$ {n \choose k} \leq \left(\frac{en}{ k}\right)^k$$   I tried the tactic of combining bounds from $n!$, $k!$ and $(n-k)!$ and it didn't work. How does this bound follow from stirling's approximation? Which site deals with career development questions for programmers? Is there any site in the network where career development questions about the programming profession can be asked ? I thought Programmer's was the site for it, but that doesn't appear to be the case. Blending colors in photoshop and illustrator Boundary conditions for calculus of variations in phase space and under canonical transformations This might be a stupid question, but I just don't get it. In Hamiltonian mechanics when examining conditions for a $(\boldsymbol{q},\boldsymbol{p})\rightarrow(\boldsymbol{Q},\boldsymbol{P})$ transformation to be canonical one starts with $$ \dot{q}_ip^i-H(\boldsymbol{q},\boldsymbol{p},t)= \dot{Q}_iP^i-\bar{H}(\boldsymbol{Q},\boldsymbol{P},t)+\frac{d}{dt}W(\boldsymbol{q},\boldsymbol{Q},t)$$ where $\bar{H}$ is the transformed Hamiltonian, and $W$ is the generating function (now a function of $\boldsymbol{q}$ and $\boldsymbol{Q}$). This term shouldn't break Hamilton's principle, since $$ \delta\int_{t_1}^{t_2} dt\frac{d}{dt}W(\boldsymbol{q},\boldsymbol{Q},t)=\delta W(\boldsymbol{q},\boldsymbol{Q},t)|_{t_2}-\delta W(\boldsymbol{q},\boldsymbol{Q},t)|_{t_1}=0-0=0 .$$ But I don't see why the variation of $W$ should disappear at the endpoints (say at $t_1$). Expanding leads to: $$ \delta W(\boldsymbol{q},\boldsymbol{Q},t)|_{t_1}=\left(\frac{\partial W}{\partial q_i}\right)_{t_1}\underbrace{\delta q_i(t_1)}_{=0}+ \left(\frac{\partial W}{\partial Q_i}\right)_{t_1}\delta Q_i(t_1)=\left(\frac{\partial W}{\partial Q_i}\right)_{t_1}\delta Q_i(t_1).$$ $\boldsymbol{Q}$ is itself a function of $\boldsymbol{q}$ and $\boldsymbol{p}$, so $$ \delta Q_i(t_1)=\left(\frac{\partial Q_i}{\partial q_k}\right)_{t_1}\underbrace{\delta q_k(t_1)}_{=0}+\left(\frac{\partial Q_i}{\partial p_k}\right)_{t_1}\delta p_k(t_1)=\left(\frac{\partial Q_i}{\partial p_k}\right)_{t_1}\delta p_k(t_1). $$ It seems as if we also needed the variation of $\boldsymbol{p}$ to vanish at the endpoints, and I don't get this because (at least in cartesian coordinates) $\boldsymbol{p}=m\dot{\boldsymbol{q}}$ and the velocity can be different along the original and the varied orbitals even at the endpoints (they can point in totally different directions), so in general $\delta \dot{\boldsymbol{q}}(t_1)\neq 0$. What am I doing wrong? Can someone help me with this, please? How can I take a photo using a slow shutter speed without it being overexposed? When I try to take a picture using a slow shutter speed in daylight it is overexposed. How can I change the settings so it isn't overexposed? How to provide translations for a WordPress TinyMCE plugin? I know that I can get my translations into JavaScript doing:      $MyTranslations = array(         'translation1' =&gt; __("Some String 1", "MyTranslations"),         'translation2' =&gt; __("Some String 2", "MyTranslations")     );     wp_localize_script( 'jquery', 'my_translations', $MyTranslations );   But looking at some of WordPress TinyMCE plugins they use calls like this:  { title : ed.getLang('advlink.link_desc'), ... }   How is WordPress getting their translations into getLang()? Am I supposed to do it this way or do I just use my first bit of code and access the variables directly like:  { title : my_translations.translation1, ... } Why am I getting black photos when I use the Manual feature on my DSLR? Matrix in a matrix I would like to draw a matrix with top left, top right, bottom left and bottom right blocks. The top left should be a 3x3 matrix with numerical entries, the top right is 0, the bottom left is 0 and the bottom right is just a "single" entry uJ. Here is my attempt.    $ \left[ \begin{array}{c|c} [\begin{array{c|c|c} 0 &amp; 0 &amp; 2\mathrm tr(MM^{*}) \\ 0 &amp; 0 &amp; -ua \\ u &amp; -ua &amp; 0 \end{array}]     &amp;  0\\ \hline 0 &amp; uJ  \end{array}\right]. $    I would like to emphasize that the non-top-left entries are not just single entries, but blocks, so I do not want to just make a 4 by 4 matrix with vlines and hlines and additional 0's. Using single quote by curly braces in String.format in Dynamic SOQL I'm struggling to use String.format to replace a token with a value when the token is within single quotes:  Example:  String query = String.format('SELECT Id FROM Availability WHERE Person__c = \'{0}\'', personId);   String query is equal to:  SELECT Id FROM Availability WHERE Person__c = {0}   Rather than:  SELECT Id FROM Availability WHERE Person__c = '234567890' windows 7 desktop icons: new icon placement When moving/saving/etc a new file on the desktop, the icon appears second (just after "Computer"). I find it annoying, since I want my "special" icons to be first (such as the recycle bin, "Network", etc.).  Can this behavior be changed? Finding the number of zeros of $f(z) = z^n$ if $|f(z)| < 1 $ for all $z$ with $|z|=1$. Suppose $f: \overline{\mathbb{D}} \to \mathbb{C}$ is continuous, analytic in $\mathbb{D}$ and satisfies $|f(z)|&lt;1$ for $|z|=1$. Find the number of solutions to the equation $f(z) = z^n$ where $n$ is a positive integer. ($\mathbb{D}$ is the unit disk).  Some of my own attempts: Using the Maximum/Minimum Principle, we can split up the the problem in $2$ parts: Suppose $f$ is constant. It then holds that $z^n = c$ has exactly $n$ zeros because of the fundamental theorem of algebra.  Suppose $f$ is not constant. It holds that $f$ has at least one zero  in $\mathbb{D}$. It of course also holds that $z^n$ has a zero of multiplicity $n$ at the origin. I think I'm supposed to hit with stuff like Rouché's theorem, the Argument Principle or Schwartz lemma, but nothing seems to fit.   Thanks in advance. Is there any difference between "offense" and "offence"? $\int_{\frac{1}{3}\pi}^{\frac{2}{3}\pi} {\sin(x)\;dx}$ using Riemann sums? How should a GM deal with "standing orders?" default permissions for /var/www I was trying to open a file and write to it with PHP at /var/wwwfolder but it wasn't working so I did  sudo chmod 777 /var/www   now I want to set the permissions for /var/www to the default. what are the default permissions for /var/www? Write access without read access Is it possible for a user to have a write access to a file and not be able to read it? How is it possible?   I tried the following commands:  debianbox@debian:~/posix/io$ touch filetest debianbox@debian:~/posix/io$ ls -l filetest -rw-r--r-- 1 debianbox debianbox 0 14 oct.  03:10 filetest  debianbox@debian:~/posix/io$ echo "Hello World" &gt; filetest debianbox@debian:~/posix/io$ cat filetest Hello World  debianbox@debian:~/posix/io$ chmod u-r filetest debianbox@debian:~/posix/io$ cat filetest cat: filetest: Permission forbidden  debianbox@debian:~/posix/io$   As you can see here, I have write but not read access on this file. How can this be possible? Is this considered as a bug? If not, in what situation would this be useful? How to format number with comma in apex I'm struggling to understand the concept of quantum entanglement. I've distilled my understanding into an analogy, and I need your help to validate it. Here it is:  Let's say I receive two envelopes. Both envelopes have this written on them:     Hello! Open this letter...   If the paper inside is red, then other envelope has blue paper.   If the paper inside is blue, then other envelope has red paper.   So, if I open one letter, and the paper inside is red, then I know the other letter contains the blue paper.  Is this equivalent to quantum entanglement? The fact that I will know the color of the other paper when I open (i.e. observe) one envelope?  In theory, if one of the letters "appeared" in a different galaxy, I would still know the color of the paper inside that letter, just by opening my letter, instantly, correct?  Before I open the letter, is the paper inside each envelope in superposition (??), i.e. 50/50, red or blue?  In this analogy, I am assuming that what's written on the letters is true. Is this a correct assumption in quantum physics? I think so yes?  In real quantum physics, would I be able to change the color of one paper, so that I change the color of the other one? No right? How to prove $n^5 - n$ is divisible by $30$ without reduction How can I prove that prove $n^5 - n$ is divisible by $30$? I took $n^5 - n$ and got $n(n-1)(n+1)(n^2+1)$ Now, $n(n-1)(n+1)$ is divisible by $6$. Next I need to show that $n(n-1)(n+1)(n^2+1)$ is divisible by $5$. My guess is using Fermat's little theorem but I don't know how. I still do not understand what a  precisely is. Is it exactly the same as a particle? Or only an excited state?  And why does it make a peak in some diagrams? And which diagrams?