I'm having trouble distinguishing the differences when initializing objects using constructors.  I've also read that Bjarne recommends the {} syntax but that it's mostly equivalent to the () syntax so I think that I understand that part.  The problem occurs on line 40 with Car b();.  #include &lt;iostream&gt; #include &lt;conio.h&gt;  class Car { public:     Car() // initialize car     {         std::cout &lt;&lt; "Default constructor called" &lt;&lt; std::endl;         ++carNumber;     }     ~Car() // destroy car     {         --carNumber;     }      static int getCarNumber() { return carNumber; };  private:     static int carNumber; }; int Car::carNumber = 0;  int main() {      // Equivalent     std::cout &lt;&lt; "Car a{};" &lt;&lt; std::endl;     Car a{};     std::cout &lt;&lt; "Car d = Car{};" &lt;&lt; std::endl;     Car d = Car{};      // Equivalent     std::cout &lt;&lt; "Car e;" &lt;&lt; std::endl;     Car e;     std::cout &lt;&lt; "Car c = Car();" &lt;&lt; std::endl;     Car c = Car();       std::cout &lt;&lt; "Car b(); " &lt;&lt; std::endl;     Car b(); // this line      std::cout &lt;&lt; "CarNumber: " &lt;&lt; Car::getCarNumber() &lt;&lt; std::endl;     _getch();     return 0; }   This is the output of the program:  Car a{}; Default constructor called Car d = Car{}; Default constructor called Car e; Default constructor called Car c = Car(); Default constructor called Car b(); CarNumber: 4   I'm confused with "Car b()". I think the compiler is interpreting it as a funcition that returns a Car, but if that's the case I don't see where the function may be implemented (it should cause an error?").  I expected "Car b()" to call the default constructor I made but it doesn't.
Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++?  MyObject  object;  // ok - default ctor MyObject  object(blah); // ok  MyObject  object();  // error   I seem to type "()" automatically everytime. Is there a good reason this isn't allowed?
How to edit / how to format box overlapping with footer when scrolling down I just edited an answer on Unix&amp;Linux and when scrolling down, the semi-transparent right sidebar boxes "How to edit" and "How to format" kept their fixed positioning and overlapped with the page footer.     While posting this, I have seen several (not) duplicate questions about this issue, and although from my personal taste, I would prefer the boxes to stop scrolling before the footer is reached, I can accept the development teams decision to let it overlap.   However, on all those other posts, the boxes had an opaque background, so that the footer was hidden and the box content was readable. Here the boxes are transparent though, so the texts get mixed and are no longer well readable. ViewExpiredException in Firefox and IE after migrating to Jboss 7.0 AS Traces of all positive powers of a matrix are zero implies it is nilpotent Let $A$ be an $n\times n$ complex nilpotent matrix. Then we know that because all eigenvalues of $A$ must be $0$, it follows that $\text{tr}(A^n)=0$ for all positive integers $n$.  What I would like to show is the converse, that is,      if $\text{tr}(A^n)=0$ for all positive integers $n$, then $A$ is nilpotent.   I tried to show that $0$ must be an eigenvalue of $A$, then try to show that all other eigenvalues must be equal to 0. However, I am stuck at the point where I need to show that $\det(A)=0$.  May I know of the approach to show that $A$ is nilpotent? Node access based on view mode Java Access Denied How To Create A 'Two-Sided' Unique Index On Two Fields? How can I efficiently create a unique index on two fields in a table like this: create table t (a integer, b integer);  where any unique combination of two different numbers cannot appear more than once on the same row in the table.  In order words if a row exists such that a=1 and b=2, another row cannot exist where a=2 and b=1 or a=1 and b=2.  In other words two numbers cannot appear together more than once in any order.  I have no idea what such a constraint is called, hence the 'two-sided unique index' name in the title.  Update: If I have a composite key on columns (a,b), and a row (1,2) exists in the database, it is possible to insert another row (2,1) without an error.  What I'm looking for is a way to prevent the same pair of numbers from being used more than once in any order... I'd like to ask for help with a task that I've been given.  The task goes like this: In a poker game (52 cards), 5 players are given 5 cards each. What is the probability that both the first and the third player will get a full-house?  It's apparent that the probability of the first player getting a full house is  $\frac{\binom{13}{1} * \binom{4}{3} * \binom{12}{1} * \binom{4}{2}}{\binom{52}{5}}$  Then the second player gets 5 random cards, so $\frac{\binom{13}{1} * \binom{4}{3} * \binom{12}{1} * \binom{4}{2}}{\binom{52}{5}} * \binom{47}{5}$  Now the third player is supposed to get a full house, I'm assuming it should look like this: $\frac{\binom{13}{1} * \binom{4}{3} * \binom{12}{1} * \binom{4}{2}}{\binom{52}{5}} * \binom{47}{5} * \frac{\binom{13}{1} * \binom{4}{3} * \binom{12}{1} * \binom{4}{2}}{\binom{42}{5}}$  The fourth and the fifth player both receive 5 random cards, so the final equation should be:$\frac{\binom{13}{1} * \binom{4}{3} * \binom{12}{1} * \binom{4}{2}}{\binom{52}{5}} * \binom{47}{5} * \frac{\binom{13}{1} * \binom{4}{3} * \binom{12}{1} * \binom{4}{2}}{\binom{42}{5}} * \binom{37}{5}* \binom{32}{5}$  This is how I would solve the task, but I'm not sure that my solution for the third player is correct. Could anyone more experienced than me have a look at my solution?  Also I'm sorry if there is a solution for this type of task on this site, I tried looking for it and I found a lot of poker probability questions, most of them were however focused on only one player and not multiple players, which is my case. Uncertainty principle and multiple observers list files and store it in variables I'm new with shell programming. My goal is to give the user a selection which file should be run. I catch all available scripts in one var with:  var=$(find script*)   so far so good, this is the output:      echo $var     script1 script2 script3 scr...   now I want to store each file in a singel variable to run it in later selection  select SEL in script1 script2 script3 .......... case $SEL in         $Script1) echo ($Script1 will start) &amp;&amp; ./$script1 ;;         $Script2) echo ($Script2 will start) &amp;&amp; ./$script2 ;;         $Script3) echo ($Script3 will start) &amp;&amp; ./$script3 ;;         $Sc..) echo ($Scr.... will start) &amp;&amp; ./$scrip.... ;;         $Sc...) echo ($Sc...... will start) &amp;&amp; ./$scrip..... ;;         *) echo "choose on of the availabel files";;     esac done   I don't have a clue how should I should separate all files if I don't know how many and the exactly length of each file.  I tried to split with echo ${var[1]} and echo $var[1] but this dosn't work. I recive either a empty output or the whole string. Why does (0 < 5 < 3) return true? What is a good Hash function? I saw a lot of hash function and applications in my data structures courses in college, but I mostly got that it's pretty hard to make a good hash function. As a rule of thumb to avoid collisions my professor said that:  function Hash(key)   return key mod PrimeNumber end   (mod is the % operator in C and similar languages)  with the prime number to be the size of the hash table. I get that is a somewhat good function to avoid collisions and a fast one, but how can I make a better one? Is there better hash functions for string keys against numeric keys? Where is the cron / crontab log? I can print with printf as a hex or octal number.  Is there a format tag to print as binary, or arbitrary base? I am running gcc. printf(&quot;%d %x %o\n&quot;, 10, 10, 10); //prints &quot;10 A 12\n&quot; print(&quot;%b\n&quot;, 10); // prints &quot;%b\n&quot; My wife and I are preparing to sell our home and are discovering some weird things. Our home was built in 1958, so it is older. We found this in a corner that had some furniture in front of it.   We are wondering    What kind of wiring is this?  Is it safe to handle or remove? How can I report bugs with or request features for the Stack Exchange mobile apps? I'm using the official Stack Exchange mobile app for iOS or Android, and  My app crashed! It doesn't look good on my new smartphone. It won't run after I updated my device. I noticed another bug. I have an idea for a new feature which is currently not in the app.  How do I report bugs with or request features for the iOS and Android apps? Also:  I've used the built-in functionality of the app to report a bug or submit a feature request. Did I do the right thing? The app prompted me to post on Meta after an error occurred. Should I post about it here? I'm wondering why the latest version is from 2017. I've heard rumors that the apps are no longer supported; is that true? I can't find the app on my device's app store anymore! Where did it go?     We get a lot of bug reports from users about the mobile apps, which are unsupported, and at the moment, there is no centralized Q&amp;A pair for those to be closed as duplicates of (the relevant answers are spread across multiple unrelated questions). This question is an FAQ proposal, to serve as a directly-related duplicate target for those questions. Is there any way to see the custom messages/remarks of resolved/expired bounties? Choosing OpenLayers or Leaflet? I was debating with one of my collegues on OpenLayers v/s Leaflet. I made a point that OpenLayers is much better API if we wish to build a project, where you need direct connectivity to the Geoserver and PostGIS.  Then I found , which looks pretty new but has the features of connectivity with the Geoserver and PostGIS.  So my project details are as follows,   Use the map interface to fetch Feature Info Create a customized tool that takes the lat/lon from user as to where he/she clicks on the map and then fetches the Climate Data from the raster (which is handled by a py script on the server) Allows user to upload excel, which is sent to the py script, which returns a GeoJSON, which creates Vector Features on the map Allow user to create vector polygons, which will fetch the Features it intersects from the WFS Layer. Fetches Layer from the PostGIS Datastore on GeoServer and displays the layers on the map.   So now I am confused on which is better and why using OpenLayers over Leaflet makes more sense or not? Boot to console (standard method fails) I'm trying to get Ubuntu to boot directly to the console. I don't want to completely remove the GUI because I still kind of need it for training wheels sometimes, but I don't want to deal with it if I don't need it. In the past I have been able to achieve this pretty easily in previous versions by editing /etc/default/grub, but for some reason it's not working on 15.10. Here is my /etc/default/grub file: # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: #   info -f grub -n 'Simple configuration'  GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2&gt; /dev/null || echo Debian` #GRUB_CMDLINE_LINUX_DEFAULT=&quot;quiet splash&quot; GRUB_CMDLINE_LINUX=&quot;text&quot;  # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM=&quot;0x01234567,0xfefefefe,0x89abcdef,0xefefefef&quot;  # Uncomment to disable graphical terminal (grub-pc only) GRUB_TERMINAL=console  # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480  # Uncomment if you don't want GRUB to pass &quot;root=UUID=xxx&quot; parameter to Linux #GRUB_DISABLE_LINUX_UUID=true  # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY=&quot;true&quot;  # Uncomment to get a beep at grub start GRUB_INIT_TUNE=&quot;480 440 1&quot;  As you can see, I have commented out quiet splash, changed the value of GRUB_CMDLINE_LINUX to &quot;text&quot;, and uncommented GRUB_INIT_TUNE. However, the only thing that seems to make a difference is the quiet boot. When I add and remove the hash from that line it affects the behavior when the machine boots, so I know grub is updating when I tell it to. But no matter what I do it still loads the GUI immediately. Should I use an offset for my Poisson GLM? I am carrying out research to look at differences in fish density and fish species richness when using two different underwater visual census methods. My data was originally count data but then typically this is changed to fish density but I have still decided to use a Poisson GLM, which I hope is right.   model1 &lt;- glm(g_den ~ method + site + depth, poisson)   My 3 predictor variables are method, site and depth which I ordered as factors when I input them.   My response variables are grouper species richness, grouper density and the same for other fish groups. I am aware that density is not an integer and it is numerical data e.g 1.34849. I am now however getting this error:      In dpois(y, mu, log = TRUE) : non-integer x = 0.037500   I've been reading up and many people suggest using an offset, is this the most advisable thing to do? Which objects can I use in a finalizer method?