I have seen in my legacy embedded code that people are using signed char as return type. What's the need to put signed there? Isn't that implicit that char is nothing but signed char.
The code below compiles, but has different behavior for the char type than for the int types.  In particular     cout &lt;&lt; getIsTrue&lt; isX&lt;int8&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;uint8&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;char&gt;::ikIsX  &gt;() &lt;&lt; endl;   result in 3 instantiations of templates for three types: int8, uint8 and char. What gives?  The same is not true for ints: int and uint32 which result in the same template instantiation, and signed int another.  The reason seems to be that C++ sees char, signed char and unsigned char as three different types. Whereas int is the same as a signed int. Is this right or am I missing something?  #include &lt;iostream&gt;  using namespace std;  typedef   signed char       int8; typedef unsigned char      uint8; typedef   signed short      int16; typedef unsigned short     uint16; typedef   signed int        int32; typedef unsigned int       uint32; typedef   signed long long  int64; typedef unsigned long long uint64;  struct TrueType {}; struct FalseType {};  template &lt;typename T&gt; struct isX {    typedef typename T::ikIsX ikIsX; };   // This  int==int32 is ambiguous //template &lt;&gt;            struct isX&lt;int  &gt;    { typedef FalseType ikIsX; };  // Fails template &lt;&gt;            struct isX&lt;int32  &gt;  { typedef FalseType ikIsX; }; template &lt;&gt;            struct isX&lt;uint32 &gt;  { typedef FalseType ikIsX; };   // Whay isn't this ambiguous? char==int8 template &lt;&gt;            struct isX&lt;char  &gt;  { typedef FalseType ikIsX; }; template &lt;&gt;            struct isX&lt;int8  &gt;  { typedef FalseType ikIsX; }; template &lt;&gt;            struct isX&lt;uint8 &gt;  { typedef FalseType ikIsX; };   template &lt;typename T&gt; bool getIsTrue(); template &lt;&gt;           bool getIsTrue&lt;TrueType&gt;() { return true; } template &lt;&gt;           bool getIsTrue&lt;FalseType&gt;() { return false; }  int main(int, char **t ) {    cout &lt;&lt; sizeof(int8) &lt;&lt; endl;  // 1    cout &lt;&lt; sizeof(uint8) &lt;&lt; endl; // 1    cout &lt;&lt; sizeof(char) &lt;&lt; endl;  // 1     cout &lt;&lt; getIsTrue&lt; isX&lt;int8&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;uint8&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;char&gt;::ikIsX  &gt;() &lt;&lt; endl;     cout &lt;&lt; getIsTrue&lt; isX&lt;int32&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;uint32&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;int&gt;::ikIsX  &gt;() &lt;&lt; endl;  }   I'm using g++ 4.something
"Dear Sir or Madam" versus "To whom it may concern" When is it appropriate to use the terms Dear Sir or Madam and To whom it may concern?  The rules I was taught state that Dear Sir or Madam should be used when you're writing a letter to a person about something that person has direct involvement in (e.g. returning a defective product to a customer service department).  By the same rules, To whom it may concern would be used for situations in which the recipient is a third party to the topic of the letter (e.g. regarding a letter of reference or recommendation).  Was I taught correctly?  Is the rule actually something else?  Or is this one of those situations where many people have an opinion but there is no real rule? How do I build a house for my NPCs? Grep: unexpected results when searching for words in heading from man page Capturing emoticons using regular expression in python (Ubuntu 13.04 with GNOME Shell, upgraded, GNOME version 3.8) Recently, I upgraded Ubuntu to 13.04. the default desktop is gnome-shell. Except Nautilus, other software border doesn't disappear when I make them to be maximized. I checked the problem for these software:  LibreOffice Firefox Rhythmbox thunderbird GNOME-Terminal  On the other hand there are three bars on maximized mode:  GNOME Shell panel  Title-bar for software which contains - + x (minimise, maximise, close) buttons.  Software menu-bar  Number &quot;2&quot; is extra. Is a package missing? Deploy a project using Git push Is it possible to deploy a website using git push? I have a hunch it has something to do with using  to perform a git reset --hard on the server side, but how would I go about accomplishing this? Why is my variable local in one 'while read' loop, but not in another seemingly similar loop? Guaranteed lifetime of temporary in C++? Does C++ provide a guarantee for the lifetime of a temporary variable that is created within a function call but not used as a parameter?  Here's an example class:  class StringBuffer { public:     StringBuffer(std::string &amp; str) : m_str(str)     {         m_buffer.push_back(0);     }     ~StringBuffer()     {         m_str = &amp;m_buffer[0];     }     char * Size(int maxlength)     {         m_buffer.resize(maxlength + 1, 0);         return &amp;m_buffer[0];     } private:     std::string &amp; m_str;     std::vector&lt;char&gt; m_buffer; };   And here's how you would use it:  // this is from a crusty old API that can't be changed void GetString(char * str, int maxlength);  std::string mystring; GetString(StringBuffer(mystring).Size(MAXLEN), MAXLEN);   When will the destructor for the temporary StringBuffer object get called?  Is it:   Before the call to GetString? After GetString returns? Compiler dependent?   I know that C++ guarantees that a local temporary variable will be valid as long as there's a reference to it - does this apply to parent objects when there's a reference to a member variable?  Thanks. What packages will let me use Cyrillic characters in math mode? Note I'm not actually planning on writing any, for instance, Russian prose or even any Russian words. It's just that, on paper, I've always had the habit of denoting sets by uppercase roman letters, sets of sets by script letters and, when the need arises, sets of sets of sets by uppercase Cyrillic letters. Is there some package I can load which will allow me to typeset (in LaTeX math mode) Cyrillic letters much as I would typeset Greek letters? ie. $\Zhe$ to produce an uppercase zhe. Thanks! Why does a candle blow out when we blow on it? Our breath is 16% oxygen and only 4% CO2 No, this is not a , nor is it a solicitation on  to backup or  and only a little bit about Where to backup and When to do it.  This is basically a strategy question: what, where and when all together. "How" is not really relevant: there are tons of back-up programs out there and they all do the same basic thing: make copies of data.  But the real question is: are these back-up programs making copies of the data important to you?  How should you install&amp;run Ubuntu while safeguarding your data?  There is no "one size fits all" when it comes to computers, Ubuntu versions or a backup strategy, therefore I've split this up into 5 basic user types with each their own answer:       (or you're running in UEFI mode!)   And as the above does not fit everyone, one for the impatient:   !    So click one of the above links and go to your user type!  P.S. If you're running a server farm and you've read this question so far, I'm sorry: this is about a single PC, not a network, nor a server farm. How to detect if a function is called as constructor? Given a function:  function x(arg) { return 30; }   You can call it two ways:  result = x(4); result = new x(4);   The first returns 30, the second returns an object.  How can you detect which way the function was called inside the function itself?  Whatever your solution is, it must work with the following invocation as well:  var Z = new x();  Z.lolol = x;  Z.lolol();   All the solutions currently think the Z.lolol() is calling it as a constructor. Non trivial valuation over a finite extension $F/\mathbb{Q}_p$ is equivalent to the one induced by $v_p$ I'm really having a hard time with this topic in probability theory and I was wondering if someone has any tricks, tips or anything useful to help me understand it. In my notes I am told that $X\sim$Uniform$[0,1]$ and $Y\sim$Uniform$[0,1]$. My professor wrote:      $f_{X+Y}(Z) = \int_0^Z f_X(x) f_Y(Z-x)\;dx \neq Z$   Then somehow he came up with these cases where $Z$ is defined, and used that in making the pdf. I'm just not sure of how he did this or how he also came to find $P(X_1+X_2\le 2)$. Can someone help me fill in the blanks? I went to him directly but he just said the same thing as in lecture and wasn't helpful. We have in and out degree of a directed graph G. if G does not includes loop (edge from one vertex to itself) and does not include multiple edge (from each vertex to another vertex at most one directed edge), we want to check for how many of the following we have a corresponding graph. the vertex number start from 1 to n and the degree sequence are sort by vertex numbers.  a) $d_{in}=(0,1,2,3), d_{out}=(2,2,1,1)$  b) $d_{in}=(2,2,1), d_{out}=(2,2,1)$  c) $d_{in}=(1,1,2,3,3), d_{out}=(2,2,3, 1,2)$  I want to find a nice way instead of drawing graph.  for (C): For an irrational number $\alpha$, prove that the set $\{a+b\alpha: a,b\in \mathbb{Z}\}$ is dense in $\mathbb R$ I am not able to prove that this set is dense in $\mathbb{R}$. Will be pleased if you help in a easiest way. $A=\{a+b\alpha: a,b\in \mathbb{Z}\}$ where $\alpha$ is a fixed irrational number. Geometric intuition of improper integrals I am aware that the area under the curve of $\frac{1}{x}$ is infinite yet the area under the curve of $\frac{1}{x^2}$ is finite.   Calculus and series wise, I understand what is going on, but I can't seem to get a good geometric intuition of the problem. Both curves can be shown to converge to $0$ (the curves themselves, not the area), and on the interval from $1$ to infinity, the two curves have nothing intrinsically different. Can someone please provide me with an good geometric intuition of what's going on? I can't find anything on the web, people seem to not want to explain it geometrically. $$f(x,y) = \begin{cases} 2 &amp; 0&lt; x&lt; y&lt;1  \\     0 &amp;\text{otherwise} \end{cases} $$  I need to find   the density function of $y$ and conditional pdf of $X$ given $Y$.   My answer is coming out to be   $2y$ $\frac1y$ What does this depiction of a black hole in the movie Interstellar mean? I was expecting a whirlpool in 3D and the matter glowing from friction as it nears the center, as I expected a event horizon to be negligible visually.  How does this depiction work? How big is the central sphere? I am puzzled by the perpendicular circles. Are they the event horizons if they are both visible? What would be a path of a particle as it gets swallowed into the singularity? Can you negate the Frightened condition by not looking at the source of your fear? As the title says, if you cause a creature to be Frightened of you, as in the Frightened condition, but they can somehow manage to not see you, do they stop rolling with disadvantage to attacks/ability checks?  Below are scenarios to illustrate my question.  Scenarios:   If a creature is frightened of you, and they turn their back against you to hit someone else, would they no longer have disadvantage to attack rolls/ability checks? If a creature is frightened of you and they have Blindsight, can they close their eyes to stop seeing you, and hence stop rolling with disadvantage? If a creature has 60 ft of movement and is frightened of you, and there is a corner they can reach in 15 ft that will block you from sight, can they run to that corner to stop being frightened, then run back to attack without disadvantage? Assume they would not provoke OA to do this, although the OA is immaterial to the question.