id(5) is id(5)  #returned False id(5) == id(5)  #returned True  is operator returns true if the operands points the same object. Here it is pointing to the same object (i.e., 5). But here, it is returned as False. What's the reason behind that?
Why does the following behave unexpectedly in Python?  &gt;&gt;&gt; a = 256 &gt;&gt;&gt; b = 256 &gt;&gt;&gt; a is b True           # This is an expected result &gt;&gt;&gt; a = 257 &gt;&gt;&gt; b = 257 &gt;&gt;&gt; a is b False          # What happened here? Why is this False? &gt;&gt;&gt; 257 is 257 True           # Yet the literal numbers compare properly   I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100.  Based on the above, I can hypothesize that Python is internally implemented such that "small" integers are stored in a different way than larger integers and the is operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not?
I want to add CaseComment and CaseHistory related list to my visualforce page.   &lt;apex:relatedList list=" " /&gt;  What should be the value for List attribute in the code defined above. When I added   &lt;apex:relatedList list="CaseHistory" /&gt; 'Histories' is also not working   &lt;apex:relatedList list="CaseComment" /&gt; 'CaseComments' is also not working  I get errors saying they are not valid child relationship name for entity Case.  Please help me out on this issue. How do you deal with a player that's determined to play the game in a way that is detrimental to the advancement of the story? . (See comments to the question: the OP tried to include a couple of long XML files, but that wasn't possible.)  What's the recommended approach to including code/data, when there's just too much of it to embed in the question?  I could think of a few approaches myself:   Paste the data to a pastebin and link (and wait for the links to die) Encode the (compressed) data in an image and include that (kludgy!) Implement an attachment feature in Stack&nbsp;Overflow (which will probably be abused) Schengen Business visa without a business invitation letter Apply empty style to the entire bibliography How can I bypass Activation Lock? I bought a used iPhone 4.  The previous owner re-set the phone, but did not remove the device from their iCloud.  It is asking me for their iCloud information when I try to set-up the phone.  I don't have contact with the previous owner anymore.  Is there a way to remove the device from their iCloud so I can use a new one? How can I get file extensions with JavaScript? bracket style border around elements How to flatten a list to return a new list with all the elements? has been edited by .   , see revisions 3 to 4.   Now what he did is totally inexplicable to me, as a matter of fact he destroyed the answer. The new version is neither syntactically valid nor does it make any sense.  Still, the edit got "peer-reviewed" and nodded off.  Is there any way to deal with these kinds of things, other than sighing heavily and rolling back the edit?  Rhetorical side question: Could this be a side-effect of people grinding for reviewer badges? How to list all functions in a Python module? I have a Python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it. I want to call the help function on each one. In Ruby I can do something like ClassName.methods to get a list of all the methods available on that class. Is there something similar in Python? eg. something like: from somemodule import foo print(foo.methods)  # or whatever is the correct method to call When I get exceptions, it is often from deep within the call stack.  When this happens, more often than not, the actual offending line of code is hidden from me:  tmp.rb:7:in `t': undefined method `bar' for nil:NilClass (NoMethodError)         from tmp.rb:10:in `s'         from tmp.rb:13:in `r'         from tmp.rb:16:in `q'         from tmp.rb:19:in `p'         from tmp.rb:22:in `o'         from tmp.rb:25:in `n'         from tmp.rb:28:in `m'         from tmp.rb:31:in `l'          ... 8 levels...         from tmp.rb:58:in `c'         from tmp.rb:61:in `b'         from tmp.rb:64:in `a'         from tmp.rb:67   That "... 8 levels..." truncation is causing me a great deal of trouble.  I'm not having much success googling for this one:  How do I tell ruby that I want dumps to include the full stack? Getting incorrect slope values from an ASTER DEM in QGIS? I have a DEM layer from ASTER satellite and I want to get the slope information from it.  I use terrain analysis > slope, but the output is so wrong. Why is that?  Here is the DEM:     And here is the "Slope" that is totally wrong. It should stretch the values from 0 - 89.9097 but it does not. How to send and receive data from Salesforce to a FTP server My question is how I can intergrate Salesforce with different FTP servers in real time. I have read some articles about it, but to be absolutely sure I thought it would be a good idea to post a question here.  I want to be able to send and receive data from Salesforce as a csv file to a ftp server. How I'm thinking about doing this is listed below.  Send the data:  Create a apex class which query the necessary data in Salesforce and create a csv file. I guess this is trivial? Then send the file to a web service created in Salesforce, just by calling it in the apex code. Create a web service in Salesforce which receives the data from the apex code. This web service should in some way send the data to the appropriate ftp server. I guess I can simply modify some of the code provided by Salesforce to make this work? The file is sent. Receive the data  This one is a bit trickier. I guess I have to pull the data from the FTP server by using my web service, which then send the file collected to the appropriate apex class. Or, the FTP server could send the data to the SFDC web service, I don't know if this is possible? The web services on the other side that sends the data to the ftp server, could send it directly to the SFDC web service, which then again forward it to the apex class. I guess the web service will use the remote site url to connect to the SFDC web service? I hope it is alright to ask something like this here, I am having trouble keeping up with all the special cases and my book is being kind of vague.  I know how to do the standard method of finding diagonal matrices, but I know that triangular matrices are special and my book makes a connection, but it is hard to tell what it is.  Thanks. Convert char to int in C# I would like to set up an APT repository on a server that will provide a couple of packages.  Is there a way to set one up without installing any software on the server?  How do the files have to be organized?    Edit: I must be doing something wrong... can someone please help me? I have the repository at   I'm not sure where or what, but something's misconfigured. I only currently have one package and it's for all architectures.  Here's what's been added to my /etc/apt/sources.list:  deb http://quickmediasolutions.com/apt stable main Having just  from any of the queues, it was reviewing close votes; however, this audit was flawed in that I didn't even cast a close vote.  Often I press the Close button to preview greater detail and sentiment of the closure, spawning the Why should this question be closed dialog box:    Especially for duplicates, where functionality is solely dependent on spawning this dialog.  From Closing > Duplicate, I can search or view selected duplicates:    Although, I realize general closure reasons are summarized on the page:    This question had 6-upvotes, but seemed very localized referencing subjective query is "taking too long" and even had a sqlfiddle link.  Maybe overly broad regarding performance tuning, the OP was posting like a forum with two answer posts to his own question  and  with one of those answers asking follow-up questions.    Wanting to gauge community response, current closure totals struck my curiosity.  So, I pressed the Close button and boom - oh, the humanity!  I failed, and didn't even cast a close vote.    Votes are not cast until a reason for closure is selected and Vote to Close is pressed.  Taking any review very seriously on this site, it only seems fair that my review quality is tested through actionable steps instead of clicking for more detailed information, leveraging the functional design of the close vote user interface.  Sure, it's complex to seed fake vote totals, and then there's controversy of mindless voting in the majority or people who simply cherry pick 4-vote questions.  Still though, it seems unfair I should hesitate to review further information of vote totals and duplicates before skipping due to the implementation of this audit. In the DC Comics Universe, What Happens to Earthlings Under a Red Sun? Simpler proof - Non atomic measures Suppose that $(X,\mathcal{E},\mu)$ is a non-atomic finite measure space (i.e. for every $E \in \mathcal{E}$ with $\mu(E)&gt;0$ there exists $F \subset E$ measurable such that $0&lt;\mu(F) &lt;\mu(E)$.)  a) Prove that for every $ \varepsilon &gt;0$ there is a finite partition of $X$ in measurable subsets $X_1,..,X_n$ such that $\mu(X_i)\leq \varepsilon$.  b) Prove that for every $\alpha \in [0,\mu(X)]$ there exists $E \in \mathcal{E}$ with $\mu(E)=\alpha$.    I guess that a) is given to prove b) more easily. I have the following idea of solution for a) (inspired from , which proves b)  )  Denote  $$ \Gamma = \{ (X_1,..,X_n) : n &gt;&gt; \mu(X)/\varepsilon, X_i \text{ are disjoint }, \mu(X_i)\leq \varepsilon \}$$ ordered by componentwise inclusion. Totally ordered parts $(Y_\alpha)$ of $\Gamma$ have an upper bound element $(\bigcup Y_\alpha^i)_{i=1}^n$ which is still in $\Gamma$.   By Zorn's lemma $\Gamma$ has maximal elements. If a maximal $(X_1..X_n)$ element is not a partition, then we can replace it with something better, of the form $(X_1,..,X_n\cup A)$ where $A \subset X \setminus (X_1 \cup..\cup X_n)$ and $\mu(A)&gt;0$.     My questions are:  1) Is my solution of a) correct? I feel that the part with the upper bound element may not work, since there might be noncountable unions.  2) What is a simpler solution of a)?