Can someone explain why this block of code is valid syntax? Why does it compile?  void foo(){} enum class X { X1, X2 };  int main() {     auto s = X::X1;     foo(),s = X::X2;     return 0; }   Using Apple LLVM version 9.0.0 (clang-900.0.38).  Edit:  The line in question as Some Programmer Dude mentioned       foo(),s = X::X2;
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 are the shell's control and redirection operators? I often see tutorials online that connect various commands with different symbols. For example:  command1 |  command2 command1 &amp;  command2 command1 || command2     command1 &amp;&amp; command2   Others seem to be connecting commands to files:  command1  &gt; file1 command1  &gt;&gt; file1   What are these things? What are they called? What do they do? Are there more of them?    . Hibernate JPA Sequence (non-Id) Is it possible to use a DB sequence for some column that is not the identifier/is not part of a composite identifier?   I'm using hibernate as jpa provider, and I have a table that has some columns that are generated values (using a sequence), although they are not part of the identifier.  What I want is to use a sequence to create a new value for an entity, where the column for the sequence is NOT (part of) the primary key:  @Entity @Table(name = "MyTable") public class MyEntity {      //...     @Id //... etc     public Long getId() {         return id;     }     //note NO @Id here! but this doesn't work...     @GeneratedValue(strategy = GenerationType.AUTO, generator = "myGen")     @SequenceGenerator(name = "myGen", sequenceName = "MY_SEQUENCE")     @Column(name = "SEQ_VAL", unique = false, nullable = false, insertable = true, updatable = true)     public Long getMySequencedValue(){       return myVal;     }  }   Then when I do this:  em.persist(new MyEntity());   the id will be generated, but the mySequenceVal property will be also generated by my JPA provider.  Just to make things clear: I want Hibernate to generate the value for the mySequencedValue property. I know Hibernate can handle database-generated values, but I don't want to use a trigger or any other thing other than Hibernate itself to generate the value for my property. If Hibernate can generate values for primary keys, why can't it generate for a simple property? Why does Calculate button remain gray in Group Stats Plugin for QGIS? In my case I failed to use  plugin (2.0.30) with QGIS 2.14.11 and 2.18.3 on windows64.  Tested on several datasets: points, polygons, and csv.- But I am not sure what I have missed.    I want to click on this Calculate button. How do I install openjdk 7 on Ubuntu 16.04 or higher? I would like to upgrade my main system to 16.04, but I work on projects that require OpenJDK 7.   Apparently it is not available from a trivial apt-get install openjdk-7-jdk. Only versions 8 and 9 are listed in the repository.  Can anyone point me to instructions on how to install it? Does mass distribution/center of mass affect free fall? An everyday is example would be cars. If you were to drop a car, not taking air resistance into account, would a front-heavy car tumble forward as it fell? And a car with a perfect 50/50 front/rear weight distribution fall straight? Does mass distribution/center of mass affect free fall? Or would they both fall straight down without tumbling? Can you explain why please? Differences in the behaviour of pinching a garden hose and closing a tap Let's say you have a garden hose connected to an ordinary water tap which is opened fully. If you pinch the end of the hose, water leaves the hose at a higher speed (and this can be useful while watering plants, to reach pots which are further away). However when a tap (with no hose connected) is opened only slightly, water flows out at a low speed, possibly even in drops.  The actions of pinching the end of a hose and of almost-closing an open tap seem similar, so why the difference in behaviour? How to add text to end of line when pattern is matched? inputs:  line1 with the PATTERN that contains ( )  line2 with the PATTERN that contains ( )  lineN with the PATTERN that contains ( )    outputs:  line1 with the PATTERN that contains ( ) ; line2 with the PATTERN that contains ( ) ; ... lineN with the PATTERN that contains ( ) ;   I tried this:  find . -name "test.txt" -print | xargs sed -i "/PATTERN/ s/$)/); /g"   but it didn't work. Why is the \bf command applied to more than I asked? MWE:  \documentclass{article}  \usepackage{bm}  \begin{document} $$x(t), \bf{x}(t), \bf{x(t)}$$ \end{document}   Result:    Question:  Why are the second and third x(t) typeset the same? In the second  expression, it was asked to apply \bf to only x.  EDIT:  I had not payed attention to it when asking the question, but I would like to have a bold and italic x. How to test for minimum amount of items in inventory and execute a command if true How do I gunzip all files recursively in a target directory? I'd like to know what is the command to use to gunzip all files in a target directory recursively? I tried to use the unzip command but it didn't work.  I tried the command from Diagonal lines in table cell I need this table:    (each row and column should have the same height and length, last cell should be divided by diagonal line). I tried the following code:  \documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage{array} \usepackage{makecell} \newcolumntype{x}[1]{&gt;{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}} \begin{document} \setlength{\extrarowheight}{0.1cm} \begin{tabular}{|x{0.5cm}|x{0.5cm}|x{0.5cm}|x{0.5cm}|x{0.5cm}|}\hline &amp;&amp;&amp;&amp;20\\ \hline &amp;&amp;&amp;&amp;30\\ \hline &amp;&amp;&amp;&amp;45\\ \hline 15&amp;12&amp;18&amp;50&amp;\diaghead(-3,2){\hskip \hsize}{$a_i$}{$b_j$}\\ \hline \end{tabular} \end{document}   but text in the last cell is displayed incorrectly and cells are not the same.     How can I change that? How do I cure Sanguinare Vampiris? I have Sanguinare Vampiris. I don't really want to become a vampire. How can I cure myself? (mód 1) is not copied correctly Please consider the following MWE:  \documentclass{article} \usepackage[spanish]{babel} \selectlanguage{spanish} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}  \begin{document} Works: áéà  Does not work: \(\pmod1\) \end{document}   The áéà text is copied correctly, but if I try to copy (mód 1) it says: (m´od 1).  Does anyone know why this happens? How is it solved?  Thanks! Can I set up a Mac for a multi head / multi user environment? How to get from Gatwick airport to Paddington? What's the most straightforward way to get from Gatwick airport to Paddington station in London using public transport?   I'm mostly interested in travel time &amp; general smoothness of the trip (e.g. buying just one ticket for the whole trip would be nice). Price is a secondary concern. Is there a way to show statistic info? Is there a way to get Statistic info in Blender? Or heads up display? Like when I select a group of vertices, I need a way to know how many vertices are selected and How many polygons "or triangles my scene has. The page I'm trying to fetch is public.  The server logs show no request.  Google reports that any page on my site is "Temporarily unreachable". It won't even fetch the verification file, a static HTML file that was successfully used to verify with the webmaster tool application itself.   My site is running on the .  What is causing this? Scala Lists of lists of integers How were the number of rounds for different key sizes of AES selected? The number of AES rounds increases with the key length. Why increase the number of rounds at all, and how were these round counts chosen? Can I open Microsoft Word and Excel files with Ubuntu?