Why is the sizeof a std::pair different to the sum of the sizeof its elements? I was trying to create a pair type using dynamic memory and then return it's address to the calling function, but on checking the size of the pair object I got confused:  pair&lt;int,vector&lt;int&gt; &gt; vec;                          //not dynamic definition vec=make_pair(3,vector&lt;int&gt; {1,2,3,4,5,8,9,0,6});    //9 element in vector cout&lt;&lt;sizeof(vec.second)&lt;&lt;endl;   OUTPUT: 24  and on doing: sizeof(vec) the output is 32, size of int on my system is 4.  Can someone please explain how the size of 9 ints is 24 and after adding the first member of the pair it becomes 32?
Why isn't sizeof for a struct equal to the sum of sizeof of each member? Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?
Creating all possible line segments between all points using QGIS Closure of $\{\frac{1}{n}\}:=M$ In $\mathbb{R}$ with standard topology the closure of the above set $M$ is $M \cup 0$. I fail showing this by purely topological means. I.e. not using the fact that this holds in the reals as a metric space and deduce it for the induced topology.  I assumed that there exist a closed subset $A$ containing $M$ but not 0. Hence, the complement of $A$ is an open subset containing 0. Does this already yield a contradiction or do I need a different approach?  Could you help me on this? When "Questions that may already have your answer" (similar questions) appear as a right column, it overflows and overlaps the footer.  (shown in the figure)        This happens on all SE network sites on which I have asked questions.  Also this happens to other columns also like "How to Format". Computational complexity of Fibonacci Sequence I understand Big-O notation, but I don't know how to calculate it for many functions. In particular, I've been trying to figure out the computational complexity of the naive version of the Fibonacci sequence:  int Fibonacci(int n) {     if (n &lt;= 1)         return n;     else         return Fibonacci(n - 1) + Fibonacci(n - 2); }   What is the computational complexity of the Fibonacci sequence and how is it calculated? When an option expires does that constitute a buy or sell A similar question recently asked about stock sales and option buys triggering wash sale rules.  If an option expires, is that considered a buy/sale ?  What I mean is: let's assume I have a call option with a target date of August 16. Now I sell the underlying stock somewhere before that (after July 16th). Does that trigger wash sale rules (if the option expires in the money, exercised by default) ?  Is an option expiring out of the money considered a sale ? Why does virtualbox only have 32-bit option, no 64-bit option on Windows 7? I have downloaded and installed the newest  for my Windows 7 (64-bit OS), but when I want to install 64-bit Linux, the New->Create Virtual Machine only displays 32-bit option, no 64-bit option. Could anyone give any clues about this issue? Thanks very much in advance! This is a little bit off topic as it is not exactly related to TeX.  I saw recently that  was updated to 1.020 which comes with math table support.  Does any one had a chance to play with this font and use it with unicode-math, and in particular with the LuaTeX engine?  I am very interested in purchasing a complete set of this nice fonts family. However I am concerned about its usability with the unicode-math package. Unlike Cambria Math or XITS Math, Minion Math does not come with a single font, instead it has 20 (4 weights 5 optical sizes) fonts. So it will be better to know how it works before spending 700 euro.  In particular, say the following minimal document, will it use correct optical size of the fonts for each of the three formulas? I had trouble with using correct optical size of Minion Pro fonts with fontspec. I worked it out with the SizeFeatures and OpticalSize. However, I am not so sure if the same strategy will work for Minion Math with unicode-math. In addition, in Cambria Math, etc., the bold symbols and alphabets are chosen directly from the unicode math enabled fonts. But in Minion Math, from the glyph tables on their websites, there seems no bold alphabets in each font. So will the mathbf in the document below work out of box?  \documentclass{article} \usepackage{fontspec} \setmainfont{Minion Pro} \usepackage{unicode-math} \setmathfont{Minion Math} % or what ever fonts name actually is  \begin{document} \fontsize{5}{5}\selectfont \[ \mathbf{E} = mc^2 \] \fontsize{10}{10}\selectfont \[ \mathbf{E} = mc^2 \] \fontsize{36}{36}\selectfont \[ \mathbf{E} = mc^2 \] \end{document} set fontsize for TikZ figure Why Does Software Updater Say No updates Available, but apt-get upgrade Shows updates available? Doing bad in undergraduate but good in a masters program Is “I medalled in volleyball” a grammatically correct sentence? According to OED, medal is a verb and a noun. I haven't seen any usage of the word as a verb, but I am assuming the above sentence is correct. Proving that an additive function $f$ is continuous if it is continuous at a single point Suppose that $f$ is continuous at $x_0$ and $f$ satisfies $f(x)+f(y)=f(x+y)$. Then how can we prove that $f$ is continuous at $x$ for all $x$? I seems to have problem doing anything with it. Thanks in advance. How can I read off the fact that gravity is associated with spin-2 particles from the Einstein-Hilbert action? I have often heard that the gravitational field has spin $2$. How can I read the spin of the field from the Einstein-Hilbert action  $$S=\int \! \mathrm{d}^4x \,\sqrt{|g|} \, \mathcal{R} \, \, \, ?$$ When you are viewing an app in Google Play store, it displays the following : Updated, Size, Installs, Current Version, Requires Android, and Rating.  I am trying to do some research and figure out the initial release / publish dates of different apps. Is there a way to get this information from Google Play, or perhaps a website with this information? While watching  play for the gold medal in London 2012, I noticed Williams was going about her business while Sharapova was grunting each time she hit the ball.  After doing some , grunting in tennis dates back to 1962. Although men grunt, women draw more attention due to their high-pitched grunts. In addition, there is an initiative to eliminate excess grunts in the next generation of tennis players.  Another quote from said research says:     "I have not found in my 32 years anybody who says grunting or not   grunting has an empirically positive or negative effect on performance   -- it's all about belief system."   What is this "belief system?"  If grunting is not related to performance, why do tennis players do it excessively? How to check that a cubic polynomial is irreducible? Starting scheduled task by detecting connection of USB device PHP: Return all dates between two dates in an array Would Dr Hannibal Lecter allow himself to be a consultant with Clarice if Miggs hadn't behaved improperly to her? What formula should be used to determine "hot" questions? Right now  is fairly broken -- it's a simple descending sort by views. As Joel said , it is &quot;a self-fulfilling prophecy.&quot; But this is not intentional, it's only because we haven't had time to improve it yet! As I sit down to write a better algorithm, I thought you guys might have some insight into what would make a good formula to determine the &quot;hot&quot; questions -- over the last 24 hours, the last week, the last month, and all time. Here are the variables we have to work with:  Votes [aka Score] Views Answers Answer Votes [aka Score] Whether the question has an accepted answer or not Time question was originally asked Time of last activity on question Reputation of asker Reputation(s) of answerers  Joel cited the reddit formula as an example, but I think our site is a little different than just a basic link submission site. Plus, we have more variables and data to work with. I found a  describing a few formulas: Y Combinator Hacker News  (p - 1) / (t + 2)^1.5 p = votes (points) from users t = time since submission in hours  Reddit  t = (time of entry post) - (Dec 8, 2005) x = upvotes - downvotes y = {1 if x &gt; 0, 0 if x = 0, -1 if x &lt; 0) z = {1 if x &lt; 0, otherwise x} log(z) + (y * t)/45000  Thoughts? Ideas? I don't want to overthink this; I just want the &quot;hot&quot; questions to be relevant and useful to us. So the simpler the algorithm the better! Based on my analysis of the above and the comments so far, here's the second version of what I have implemented so far. This might suck. I don't know:  (log(Qviews)*4) + ((Qanswers * Qscore)/5) + sum(Ascores) -------------------------------------------------------- ((QageInHours+1) - ((QageInHours - Qupdated)/2)) ^ 1.5  Note that accepted answers weight not at all in hotness. This is intentional, as I feel accepted answers are a fine social contract, but not a good data point for question or answer quality. This algorithm will heavily favor questions with LOTS of answers, as the sum(Ascores) are now included -- one assumes if there are lots of answers, there will be a lot more voting on the answers, too. Update: Note that this formula is what is used on the  linked from the homepage of each site. It is not the formula used to determine the  list. See .