I ran into a situation like this:  if(true,false) {     cout&lt;&lt;"A"; } else {     cout&lt;&lt;"B"; }   Actually it writes out B. How does this statement works? Accordint to my observation always the last value counts. But then what is the point of this?  Thanks
How does the comma operator work in C++?  For instance, if I do:  a = b, c;     Does a end up equaling b or c?   (Yes, I know this is easy to test - just documenting on here for someone to find the answer quickly.)  Update:  This question has exposed a nuance when using the comma operator.  Just to document this:  a = b, c;    // a is set to the value of b!  a = (b, c);  // a is set to the value of c!   This question was actually inspired by a typo in code.  What was intended to be  a = b; c = d;   Turned into  a = b,    //  &lt;-  Note comma typo! c = d;
What is the use of the square brackets [] in sql statements? POSIX compliant way to redirect stdout and stderr to a file I am trying to write a script which is POSIX compliant, so it can run on any *nix system (Debian, Fedora, CentOS, AIX, Arch... ALL of them). When it comes to redirection, I am rather confused on what is supported by POSIX and what is not.  If I redirect ls -l file missingfile &amp;&gt; out.txt this works perfectly in bash. The line from stderr complaining that missingfile doesn't exist, and the permissions output from file, are both in out.txt. However, I believe this is only working because these shells support more than just POSIX standard operators. Upon researching this question I've come across conflicting answers.  , for example, seems to imply that &amp;&gt;, &gt;&amp;, &gt;&gt;&amp; and &amp;&gt;&gt; are non-standard operations. However,  explicitly states that some-program &gt; some_file 2&gt;&amp;1 is POSIX compliant. Does this mean that the &gt;&amp; operator (using digits for stderr &amp; stdout) is POSIX compliant whereas using &amp;&gt; to auto redirect both stderr and stdout to a file is not POSIX compliant? Or are both &amp;&gt; and &gt;&amp; not POSIX compliant / POSIX compliant (one of these two people are wrong)?  I considered just avoiding the &amp; sign completely and using ls -l file missingfile &gt;out.txt 2&gt;out.txt however this comes with its own issue. Running the ls command this way causes the shell to open two file handles for out.txt, both pointing to offset 0 in the file. So when ls looks for these two files, one of the messages gets clobbered.  What one would expect ls -l file missingfile &gt;out.txt 2&gt;out.txt to output:  -rw-r--r-- 1 blah blah 0 Jun  3 13:18 file ls: cannot access 'missingfile': No such file or directory   What is actually output:  -rw-r--r-- 1 blah blah 0 Jun  3 13:18 file le or directory   What is the best way to redirect both stdout and stderr to a file in a POSIX compliant fashion? What is the perception of students who take a gap year between their graduation and starting graduate school? I am an undergraduate mathematics major, entering my fourth year. I plan on applying to graduate school, but I have not yet taken the GRE exams, and there a few key courses (Topology and Algebra in particular) that I have not taken yet, so I am hesitant to take the Advanced Math GRE too soon. (If you're wondering why I haven't taken Topology and Algebra yet, it's because I was trying to secure a CS degree, which sidetracked my mathematical studies last year. It was a healthy branching out experience, and one that helped me realize my true academic passion.)  My main question: what is the perception of students who take a gap year between their graduation and starting graduate school?  I think I will take the GRE tests this fall, a) for practice and b) if I score high, then I might as well apply sooner rather than later. However, I ask this question to gauge how much energy I should put into preparing for the tests this fall. If I hear, "You should really do your best to avoid any gap in your education," then I will work my butt off in preparation for the tests. But if I hear, "It's totally okay take a gap year before going into graduate school," then I would give myself more freedom in terms of my non-standardized-exam studies, extracurriculars, and in general social activities. I figure the answer to this question won't be as cut-and-dry as I hope, but any advice would be appreciated!  Just to clarify, my gap year would not consist of me sitting at my desk taking practice GRE exams all day... That would be a pitiful use of my time. I definitely plan working either as an intern or a research assistant at a successful organization. It seems like the general consensus is that taking time off is okay, and potentially beneficial, assuming you actually do something in that gap. I’m going to Germany for a semester exchange and I have a long-stay visa from Germany. Can I travel to the other Schengen states during this period with this visa or do I have to apply for a separate short stay Schengen visa?  My visa is German national visa type D. It is for a duration of 4 months, i.e., longer than 90 days. It says on the visa that the long stay visa is valid in Deutschland, which is different from my earlier visa, which I had when I visited Germany earlier; that one was a short stay visa and said it was valid in Schengen Staten.  Perhaps my current visa means that I can stay in Germany for a period of longer that 90 days can visit the other Schengen states if I don’t exceed the 90 day period. How can you test what color different people perceive? SQL Server: Cannot insert an explicit value into a timestamp column ROC vs Precision-recall curves on imbalanced dataset I just finished reading  discussion. They argue that PR AUC is better than ROC AUC on imbalanced dataset.   For example, we have 10 samples in test dataset. 9 samples are positive and 1 is negative. We have a terrible model which predicts everything positive. Thus, we will have a metric that TP = 9, FP = 1, TN = 0, FN = 0.  Then, Precision = 0.9, Recall = 1.0. The precision and recall are both very high, but we have a poor classifier.  On the other hand, TPR = TP/(TP+FN) = 1.0, FPR = FP/(FP+TN) = 1.0. Because the FPR is very high, we can identify that this is not a good classifier.  Clearly, ROC is better than PR on imbalanced datasets. Can somebody explain why PR is better? Effect on loading a DC motor - load torque Could someone give a (detailed) explanation (perhaps with formulas) of how the load (torque) affects the armature current of a DC motor (separately excited or shunt or series)?  As the load torque increases the speed of the motor decreases, and assuming the terminal voltage stays constant, the EMF will become lower and thus the armature current will increase.  But could someone give me the formula that shows the relation between load torque and armature current?  Is it something like:   \$T_\text{developed} = T_\text{shaft} + T_\text{friction windage} + T_\text{load}\$ ,   where \$T_\text{developed} = K \, \text{flux}_\text{pole} \,I_\text{armature}\$ ?  But then you have  \$P_d = P_s + P_{f_w} + P_l   \$  where \$P_d = K \,\text{flux}_\text{pole}\, I_\text{armature}  \,\omega_m\$  In the last formula you can't see that as the increase due to \$P_\text{load }\$ the armature current increases because maybe someone can say the speed \$\omega_m\$ increases.  And how come at no-load the armature current and thus the torque developed is zero? Is it really zero, or do I have to assume there is some current flowing?  Could also explain me the principle of torque developed. Because at no load, the shaft torque is equal to torque developed, right? Bjarne Stroustrup once mentioned in one of his bigthink interviews that one of the greatest problems most programmers have is not finding or using the right libraries.  On stackoverflow and programmers, I've observed a trend towards questions like "I want to do this, is there a [library | programming language] for that", or "I have these {n} [library | language] candidates for my project; which one would yield me the least amount of headache given these requirements".   Since questions like these aren't exactly programming questions in the sense of "this code should do this, but it does this, why?", they are often (though not always) being closed as "not constructive" because they do not have a definite answer (which is true, and according to the FAQ they would be off-topic on both stackoverflow and programmers).  Nonetheless, I think library questions are valid, and that it is helpful for any programmer to receive independent input from experienced programmers (at least it helps me a lot every time I browse through one of those closed questions, which I found through google). Does anyone agree that posting library choice questions should be explicitly allowed on either stackoverflow or programmers? Can a regular salaried (w2) employee opt to pay quarterly taxes? As a consultant, I got used to paying quarterly taxes. Now that I'm a regular w2 salaried employee, I'm subject to normal withholding on each pay statement. I would like to keep making exact quarterly payments instead of having a (generally incorrect) amount held back each paycheck.   I haven't been able to find any information on the 1040-es that would make me think I'm ineligible to do so, but I suspect that it may be the case. I'd have to stop paycheck withholdings by updating my w4 to either have a high number of exemptions or mark myself as exempt from taxes, which I assume is where the rub lies.   So, as a regular salaryman, is it possible for me to pay taxes exclusively through quarterly payments in lieu of traditional withholdings? Are tile bonuses counted twice if 2 new words are formed? An example:    O  O?   There is a triple letter tile to the right of the bottom O, indicated with a ?.  If I place an X on it, making the words OX (vertical) and OX (horizontal), do I score 50 points (scoring the tile twice) or 34 (scoring it once)? Isometric Embedding of a separable Banach Space into $\ell^{\infty}$ I'm working with some code that widely uses the idiom of returning a pointer to a static local variable.  eg:  char* const GetString() {   static char sTest[5];   strcpy(sTest, "Test");   return sTest; }   Am I right in thinking that this is safe?  PS, I know that this would be a better way of doing the same thing:  char* const GetString() {   return "Test"; }   Edit: Apologies, the function signature should of course be:  const char* GetString(); Per the kernel documentation:  This control is used to define how aggressive the kernel will swap memory pages.  Higher values will increase aggressiveness, lower values decrease the amount of swap.   However this is kind of vague. I'm trying to figure out exactly what the parameter ultimately controls. I know it adjusts how aggressively the kernel tries to swap out pages, but what decision making process in the kernel code does it affect?  Does it adjust how long ago a page must have been accessed before the kernel swaps it out? If so what does the default value of 60 represent? And how much is changed by a increment/decrement of 1 (a formula would be nice)? Or does it swap out pages based on their access frequency? Or something else? New rule preventing multiple @notifies causing Convert to Comment to fail Apparently, an image is not worth a thousand words, as without at least a few words this won't meet quality standards. CSS: Special Fluid Layout Problems Boot partition full, can't remove kernels Remmina remoteapp over RDP I was wondering how to use remmina to open applications on a Windows machine over rdp using remoteapp (or seamless or whatever it's actually called).  I've already used Kim Knight's  to set up remoteapp on a Windows 7 machine and I can connect and run remote apps fine from another windows box.  Allegedly FreeRDP (which Remmina uses for its RDP Plugin) has support for remoteapp. I'm not sure how to make use of it though. I can't find any examples of people actually doing this online but there is a , from which I can infer that there is some way to run remote apps.   I've tried many combinations of settings for Client, Startup Program and Startup Path in the Advanced tab when configuring an RDP connection in Remmina, but I can't make it work. I can connect to Windows boxes with RDP just fine, just not running a remoteapp. Damage reduction and damage resistance: how to calculate? Assume a character has both damage reduction and damage resistance vs an incoming attack.  One example of damage reduction is the Heavy Armor Master feat:     While you are wearing heavy armor, bludgeoning, piercing, and slashing damage that you take from non magical weapons is reduced by 3.   One example of damage resistance is the blade ward cantrip:     You extend your hand and trace a sigil of warding in the air. Until the end of your next turn, you have resistance against bludgeoning, piercing, and slashing damage dealt by weapon attacks.    Let's assume a character with both effects above is hit by a nonmagical weapon attack dealing slashing damage. The attack deals 10 damage. What happens:   Damage reduction applies reducing damage to 7, then damage resistance (rounds down). Character takes 3 damage. Damage resistance applies, halving to 5, then damage reduction takes it to 2 damage. How to get rid of OTA software update notification? I upgraded my Nexus 4 to Lollipop a few days ago but I don't like it. I'll leave out my reasons because they're not relevant here. I wiped my phone and installed a clean stock 4.2.2 version instead. I'm happy with this.  Not long after, Android automatically downloaded the 4.3 upgrade and notifies me with the choices "Later" and "Install". I don't want to do this upgrade.  How do I:   get rid of the notification, and  remove the downloaded update (to free up precious storage space).     I have already tried choosing "Later" but the same notification immediately reappears.    Based on Google search results, I also tried going to Settings &gt; Apps &gt; All &gt; Google Services Framework and unticked "show notifications" but it still appears. Force stop or disable also doesn't seem to help, so I've re-enabled the service including notifications. I didn't see any other apps in this list that sounded relevant - did I just not see it?