This code doesn't behave how I expect it to.  #include&lt;iostream&gt; using namespace std;  class Class {     Class()     {         cout&lt;&lt;"default constructor called";     }      ~Class()     {         cout&lt;&lt;"destrutor called";     } };  int main() {         Class object(); }   I expected the output 'default constructor called', but I did not see anything as the output. What is the problem?
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?
Dual citizenship passports and visas This is about entering the USA. I have   Hungarian citizenship with a 10 year B1/B2 visa in my passport I got before Hungary became part of the VWP. Real soon now, I will become a Canadian citizen (my oath is on April 5th) and will get a passport.   Since I, as a person, have a visa, am I obliged to enter into the USA with that? Or can I just forget it and use my Canadian passport? I know I could do whatever I want if I didn't have a visa but with that in the picture I am unsure.  describes a number of situations but not mine. Why should the first person pronoun 'I' always be capitalized? Why should we capitalize the first person pronoun 'I' even when it does not appear at the beginning of a sentence? Why is it not the case for other pronouns? When looking for the path to an executable or checking what would happen if you enter a command name in a Unix shell, there's a plethora of different utilities (which, type, command, whence, where, whereis, whatis, hash, etc).  We often hear that which should be avoided. Why? What should we use instead? Copy all files created after a specific hour in command line (Windows)? I would like to easily copy a batch of files from one very big directory to another based on the hour of creation (every hour i want to copy the files from last hour).  I have used Xcopy /D function but you can only put the date but not the hour.  Is there another command?  the directory is really big and it's very long to test each file for it's creation date in a Script. Xcopy is great but lacks the hour. Can I travel to the USA while working remotely for my non-US employer? Why can’t the Doctor’s companions understand babies and horses? The Doctor claimed to speak both horse and baby. The reason human companions can understand every language is because the TARDIS translates. So why can't anyone else understand babies and horses? Let $A$ be a commutative ring with $1$. Let $I$ and $J_k$, $k=1,\dots,n$ be ideals of $A$ with $I\subseteq \cup _{k=1}^n J_k$. Then I have obtained the following:  (1) If $J_k$, $k=1,\dots,n$, are prime ideals, then there exists some $j$ such that $I\subseteq J_j$.   (2) If $A$ is a principal ideal ring, then there exists some $j$ such that $I\subseteq J_j$.   I want some counterexamples that for all $k=1,\dots,n$, $I$ is not contained in $J_k$. How to get the counterexamples? Suppose that $X_1, \ldots, X_n \sim N(0,1)$ are independent random variables. I am interested in finding a constant C that satisfies:  $$ E\left[\max_{1\leq i\leq n}|X_i|\right] \leq C \sqrt{log\  n} $$  I know one method is to employ the moment generating function trick, then take logs of both sides. However, I was wondering if there exists a more direct method. thanks! Python string.join(list) on object array rather than string array In Python, I can do:  &gt;&gt;&gt; list = ['a', 'b', 'c'] &gt;&gt;&gt; ', '.join(list) 'a, b, c'   Is there any easy way to do the same when I have a list of objects?  &gt;&gt;&gt; class Obj: ...     def __str__(self): ...         return 'name' ... &gt;&gt;&gt; list = [Obj(), Obj(), Obj()] &gt;&gt;&gt; ', '.join(list) Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt; TypeError: sequence item 0: expected string, instance found   Or do I have to resort to a for loop? Probability Number A greater Number B Given $a \in \{1,2,...,250\}$ and $b\in \{0,1,...,1000\}$  What is the probability that $a &gt; b$?  I know there already is  question with a very similar question, however it's over an interval of $\mathbb{R}$ so I hope there is another way opposed to the Integral used in the formal solution.  How does one go about calculating said probability? How do I run executable scripts in Nautilus? When I double-click on a script in Nautilus to run it, the script just opens in my text editor with no option to run it. Using Nautilus, how do I run executable text files and/or scripts? How to remove app which is greyed out, can't be deleted, won't open and doesn't appear in apps list? I have this app with a greyed out icon which I'm trying to delete.    I tap and hold, and it asks me if I want to delete it and its data. I confirm and nothing happens.  I try to open it and nothing happens.  I go to Settings>General>Usage and it's not in the list.  I reboot the device and it's still here.  Is there another way to force deletion of this (ghost) app? How do I challenge an audit failure? I've run through Both SO and Meta searches for an answer, as well as reviewing the , and I cannot find a canonical process to challenge an audit failure.  I can find discussions of the single-choice "I Understand" topic that appear unresolved, in that no solution presently exists.  The particular question in point is .  Despite the number of up-votes, I feel that this quite clearly falls into a common closure category: "Here's my problem; how do I write the program?"  Compare this to   I also failed review on the first link I posted above, .  This looks like a case of code review, rather than SO.  I don't want to get rid of audits; I've learned good things from some of my failures, especially at the start.  However, in the past few weeks, a majority of my failures have been highly questionable, and I've drawn more than one suspension from those that are outright wrong by current standards.  If we have a challenge mechanism, please point me in the right direction.  Otherwise, it's simply not worth the annoyance any more, and I'll drop back to merely comments and answers. \vphantom and superscripts (currently deleted (visible only to 10kers)) is a great example of a duplicate question that should not be deleted. [Note: this question was later merged into , which resulted in the original being hard-deleted. This issue with merging  ] The titles of the duplicates are completely different.  Having duplicates around greatly aids search hits on the site. We need to keep questions like this around for the benefit of the community. Both questions have around 4K views.  They are both relevant.  I cannot believe that a question with over 3K views is being deleted. Edit Search for python continue line and python line break in google.  Both answers are top hits.  They should both be open. Refreshing Formula Fields Dynamically (without save) I have an "invoice" custom object which has a couple of summarising formula fields in. I also have a complicated and dynamic visualforce page for building the invoice objects.  As the user is completing this form, different areas are dynamically updated to show "latest" values. This is all fine where I am copying data about or performing bespoke lookups and maths, but - in what is really the simplest case - a formula field, I can find no way to get the value to update, without performing some weird cyclic save + reload of the whole object.  This is inappropriate for a couple of reasons (the object should not be saved until the invoice is complete + accepted) and the other option I have found online is to spoof the value by duplicating my formula field maths into the custom controller and re-executing them there - also unacceptable from a code/logic location/duplication perspective.  Is there anyway to "force" an object/page to recalculate it's formula fields, either through standard or extended controllers? Was Elrond, in Tolkien's opinion, more inherently powerful than Galadriel? I always thought it was the other way around, but then I read this (Letter 246):     "Of the others only Gandalf might be expected to master him – being an emissary of the Powers and a creature of the same order, an immortal spirit taking a visible physical form. In the 'Mirror of Galadriel', 1381, it appears that Galadriel conceived of herself as capable of wielding the Ring and supplanting the Dark Lord. If so, so also were the other guardians of the Three, especially Elrond. But this is another matter. It was part of the essential deceit of the Ring to fill minds with imaginations of supreme power."   This "especially Elrond" confuses me. I don´t think that Elrond is inherently more powerful than Galadriel, who is described as the greatest of the Noldor, except for Fëanor (and possibly even his equal).  A quote from Unfinished Tales says:     "...In this he (Tolkien) emphasized the commanding stature of   Galadriel already in Valinor, the equal if unlike endowments of   Fëanor; and it is said here that so far from joining in Fëanor's   revolt she was in every way opposed to him."   Furthermore,      "A queen she was of the woodland Elves, the wife of Celeborn of   Doriath, yet she herself was of the Noldor and remember the Day before   days in Valinor, and she was the mightiest and fairest (so even   fairer than Arwen I would guess) of all the Elves that remained in   Middle-earth."   (The Silmarillion, of the Rings of Power)  And again...     "Galadriel was the greatest of the Noldor, except Fëanor maybe, though   she was wiser than he, and her wisdom increased with the long years."   (the Shibboleth of Fëanor)  Restating it:     "These two kinsfolk (Fëanor and Galadriel), the greatest of the   Eldar in Valinor, were unfriends for ever." "Who together with the   greatest of all the Eldar, Luthien Tinuviel, daughter of Elu Thingol,   are the chief matter of the legends and histories of the Elves."   (Unfinished Tales)  The latter means that Luthien, Fëanor and Galadriel are the chief matter of the history and legends. It seems to me that Tolkien thought of those three as the creme de la creme of the elven crop.  Reading all that I have serious problems believing that Elrond could be superior to her. As great as Elrond is, descending from Melian, he is no equal of Fëanor, who is said to be the mightiest of all elves, and if Galadriel is his equal, then there is no way that Elrond would be mightier than her.  Maybe I just read this "especially Elrond" wrong; it could as well mean that especially Elrond was deceived into thinking that he could master the ring, because that was the deceit of the ring. And Tolkien said explicitly that only Gandalf could possibly master it.  So, what do you think? In a  question, an answerer says:  an empty bag is a bag with nothing inside it.  Makes sense, but I'm reading a textbook right now that says:  The empty set has only one subset (namely, itself).  Which seems odd to me. If a set is empty, why would it contain a subset? Regardless of whether or not the subset is also an empty set, the &quot;empty set&quot; still contains a subset, so how is it really &quot;empty&quot;? To go back to the empty bag analogy, it just sounds like my text book is saying:  an empty bag is a bag with nothing but an empty bag inside it.  Which doesn't make sense because then the bag isn't empty. I can't wrap my head around this concept. Say I have a huge text file (>2GB) and I just want to cat the lines X to Y (e.g. 57890000 to 57890010).  From what I understand I can do this by piping head into tail or viceversa, i.e.   head -A /path/to/file | tail -B   or alternatively  tail -C /path/to/file | head -D   where A,B,C and D can be computed from the number of lines in the file, X and Y.  But there are two problems with this approach:   You have to compute A,B,C and D. The commands could pipe to each other many more lines than I am interested in reading (e.g. if I am reading just a few lines in the middle of a huge file)   Is there a way to have the shell just work with and output the lines I want? (while providing only X and Y)? I don't follow understand what this theorem is saying: "Every function $f: A \to{\cal P}(A)$ is not surjective."   Is this saying so for example let A = {1,2,3} then the power set of A is {},{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3} Is this saying that there is no surjective function that takes every element in each of its power sets to atleast 1 element in A?  Is my understanding correct?