Why does the following produce such different results?  &gt;&gt;&gt; sys.getsizeof(int) # same as sys.getsizeof(object), sys.getsizeof(type) 400  &gt;&gt;&gt; sys.getsizeof(1) 28   Is the actual size of the item 1 equal to the size of the object (400) + the size of the actual integer value (28) = 428, or how exactly does the integer/object creation work here?
I want to know how to get size of objects like a string, integer, etc. in Python.  Related question:   I am using an XML file which contains size fields that specify the size of value. I must parse this XML and do my coding. When I want to change the value of a particular field, I will check the size field of that value. Here I want to compare whether the new value that I'm gong to enter is of the same size as in XML. I need to check the size of new value. In case of a string I can say its the length. But in case of int, float, etc. I am confused.
Why did Obi-Wan allow Leia to get adopted by such a high profile figure? I know that Leia is a princess because she was adopted by the Queen of Alderaan, but why would Obi-Wan allow this? Wasn't the original plan of Obi-Wan and Yoda to hide the Skywalkers from Palpatine? Luke was placed into a very low-profile position, being the child of two farmers on a backwater planet. However, Leia occupies a very important political position.  Is there any reason why Obi-Wan would do this if he was trying to hide her? Freestyle Background color not white? I'm following  and I've set my compositor up in the exact same way as he did, except my background is like a slightly light grey and I don't know why.  In his video's he's getting a bright white as his background and I can't see where I'm going wrong.  Here's the render:   Here's the compositor window:    file.  Please help! I really want to know why it's not happening. What exactly makes quantum computers faster than classical computers? I was trying to do some of these questions to check my understanding about the topic, but I'm not sure if they're correct. Here are my answers.   1) Suppose $f$ is continuous on $[0,1]$. Must there be a nondegenerate closed subinterval $[a,b]$ of $[0,1]$ for which the restriction of $f$ to $[a,b]$ is of bounded variation?   No, because $f(x)$ might be a constant function. In this case, $f(x)$ will not be the difference of two increasing functions...and so will not be of bounded variation.  2) Let $f$ be the Dirichlet function, the characteristic function of the rationals in $[0,1]$. Is $f$ of bounded variation on $[0,1]$?   No, because we cannot express it as the difference of two increasing functions.  3) Let $f$ be a step function on $[a,b]$. Find a formula for its total variation.  If we partition $[a,b]$ in such a way that for each $[x_{i-1}, x_i]$ (which is part of the partition), $x_{i-1}$ and $x_i$ each correspond to the midpoint of a step. I know this is not a formal answer, but I'm just trying to check my understanding. Conceptual half-life Question So I have this word problem and I’m a bit confused about it. I have the answer and explanation but I still don’t understand: The half-life of carbon-14 is approximately 5730 years, while the half-life of carbon-12 is essentially infinite. If the ratio of carbon-14 to carbon-12 in a certain sample is 25% less than the normal ratio in nature, how old is the sample?     A. Less than 5730 years      B. Approximately 5730 years      C. Significantly greater than 5730 years, but less than 11460 years      D. Approximately 11460 years  Correct Answer: A Explanation: Because the half-life of carbon-12 is essentially infinite, a 25 percent decrease in the ratio of carbon-14 to carbon-12 means the same as a 25 percent decrease in the amount of carbon-14. If less than half of the carbon-14 has deteriorated, then less than one half-life has elapsed. Therefore, the sample is less than 5730 years old. Be careful with the wording here—the question states that the ratio is 25% less than the ratio in nature, not 25% of the ratio in nature, which would correspond to choice (D). How is the ratio of the carbon isotopes relevant to half-lives? What is the purpose of saying the half-life of an isotope is infinite? What is meant by “the normal ratio in nature”? Just based on the answer, it seems like the question said “25% of a carbon sample decayed, how old is this sample?” Obviously it’s younger than 5,730 years (the time for its first half life) because if only 25% decayed that means half a half-life has passed. I don’t see how isotopes and ratios would change this problem at all. Edit: Every answer here was very informative and helpful. It was tough to pick a best answer. I picked Cosma’s because it clicked with me. If you’re reading this and want to understand radiocarbon dating, look at every answer because there is some useful information in every answer How to comment lines in rails html.erb files? Why can we use sample variance of the treatment group to estimate population variance of the controls? What does ** (double star/asterisk) and * (star/asterisk) do for parameters? Is "you are welcome" more polite than "no problem"?  What is the general proper reply to a thank-you? Placement of varistor with respect to fuse My design includes a pretty standard AC/DC converter powered by mains for intended use at home. For overvoltage and overcurrent protection, I am planning to use a combination of varistor and fuse placed before the power converter.  I understand it is good practice to put the fuse before the varistor - in an overvoltage event, the varistor will draw a large current that may blow the fuse, protecting the rest of the circuit and even the upstream circuitry.  However, due to extremely tight layout, it is very hard to put the fuse before the varistor.  What risk am I running if I put the varistor before the fuse?  What if I put a second fuse in series with the varistor? Does it negate the varistor's protection of the downstream circuit? Showing that $|N \cap Z(G)| > 1$ for normal subgroups of p-groups How to make a simple app from an applescript! I've got an applescript that I use to open files such as test.txt in vim, using the terminal.  I usually open a file by right-clicking it an selecting the service open in vim (this service is created by me and basically runs the applescript).  How do I build an actual program, that can be set in the "open with" option for a file?  This way, when I double click test.txt, the applescript gets run and the file gets opened in my vim in terminal.app.  I would also like to create custom icons that will be applied to all files I open using this app (using the "Change All..." button).  Where would I begin? Is this easy, because I'm just a novice -although I love programming and would spend much to to get to know all that is needed to do this.  the code is:  on open this_item      tell application "System Events"         if (count (processes whose name is "Terminal")) is 0 then             tell application "Terminal"                 activate                 do script with command "vim " &amp; (POSIX path of this_item) in front window             end tell         else             tell application "Terminal"                 activate                 tell application "System Events" to tell process "Terminal" to keystroke "t" using command down                 do script with command "vim " &amp; (POSIX path of this_item) in selected tab of the front window             end tell         end if     end tell  end open Replace symbols with values without evaluation Permutation count of AABBC Given a string:  $AABBC=A^2B^2C^1$   I am trying to find the Total Permutations (this may be incorrect):  $\dfrac{5!}{2!\cdot2!}=30$  My question is how would I find the partial sums (perhaps the wrong choice in words) when added together would give an index such that:   $AABBC=1$ $ABABC=2$ $CBABA=29$ $CBBAA=30$   (30 might be the wrong number here but is suppose to be the last)   I have tried to draw out a tree structure to get an idea and thought with as the minimum:  $CAABB$  $4(\dfrac{4!}{2!\cdot2!})$ + 1  And:  $CABAB$  I would get something like:  $4(\dfrac{4!}{2!\cdot2!}) + 0 + 1(\dfrac{2!}{2!}) + 0 + 0$  But I am missing something here. How would I find the sums needed for $BACAB$ ?  More specifically I am trying to find the index of a word that is arbitrarily long in alphanumeric.  So the string may also be something like:  $AAAAABBBBDDEEFFFGGGGGHIIIIJJJJKLMOOOPZZZZZ$ Google results for sponsee have scattered definitions in unreliable sources, so it does not appear that is a real word. I'm looking for something similar, a single word.  The specific context is a social group membership application where new members must be sponsored (as in definition 2, here - "one who assumes responsibility for some other person or thing") by existing members. I am looking for a single word to describe the target of such a sponsorship. I am about to sponsor a fraternity, but I would like to have a more general word for what I'm sponsoring. Next time, the fraternity could well be a study club, or something else.  Therefore, what is the sponsored party also called? E.g. if I sponsor somebody, that person is my __? How many ways can you divide $9$ students into three unlabeled teams where one team contains $4$ people, one contains $3$ people and the last contains $2$ people? Unlabeled, meaning that groups with abc = bca = cba, etc  I understand how to do this if the teams are labeled:  $$\frac{9!}{4!3!2!}$$  But there is a term missing in the denominator when the teams are unlabeled and I'm having difficulty understanding how to calculate how many ways the teams can be organized.  There are $3!$ ways to organize the same first group of $3$, $4!$ ways to organize the same second group of $4$ and $2!$ ways to organize the last group of $2$. Why wouldn't you multiply $3!4!2!$ in the denominator?   For instance:  (ABC, DEFG) = (ABC, DEGF)  = (ABC, DFEG) = (ACB, DFGE), etc CSS background opacity with rgba not working in IE 8 How frequently can you ask for a personal reference without being disrespectful? What causes close votes to be annotated with "(deleted)"? Extrude Faces along Local Normals I am trying to extrude faces of a cylinder along local normals. 3dsmax can do it easy, couldn't find how to do it in blender.  The extrude region option extrudes it as shown in the first example. I want it done like the 2nd example.