I've been working in python for a while now but just now I've encountered an error that I can't explain.   def b():     return -6 a = b() if a is -6:     print("Hi")   Whenever I run this I don't get into the if function and nothing gets printed. but if I make the number bigger than -6 meaning -5, -4 and etc this works properly.  def b():     return -5 a = b() if a is -5:     print("Hi")   can someone explain to me why is this happening? the == operator work as it should but if is it not.
My  has failed me.  In Python, are the following two tests for equality equivalent?  n = 5 # Test one. if n == 5:     print 'Yay!'  # Test two. if n is 5:     print 'Yay!'   Does this hold true for objects where you would be comparing instances (a list say)?  Okay, so this kind of answers my question:  L = [] L.append(1) if L == [1]:     print 'Yay!' # Holds true, but...  if L is [1]:     print 'Yay!' # Doesn't.   So == tests value where is tests to see if they are the same object?
Here is the blender window I have:    As you see, it doesn't have the menu that is usually displayed at the top of the screen.  How can I get the menu back? html - how to remove right margin completely? Remove category & tag base from WordPress url - without a plugin Where can I find a repository for older unsupported releases? I remember I saw a apt mirror somewhere containing older distributions but I cannot find it anymore. Does anybody know where to find it? Yes, it's time for me to complain about plagiarism again.  We already have Suggested Edit audits, but I would like to see Tag Wiki and Tag Wiki Excerpt audits that specifically introduce copied content for that tag without including the appropriate source(s), and warn people who approve it that they just approved a tag with plagiarized text.  For example, an audit for the  tag could be:     Microsoft SQL Server is a relational database management system developed by Microsoft. As a database, it is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet). There are at least a dozen different editions of Microsoft SQL Server aimed at different audiences and for different workloads (ranging from small applications that store and retrieve data on the same computer, to millions of users and computers that access huge amounts of data from the Internet at the same time). Its primary query languages are T-SQL and ANSI SQL.   Anyone who spends 15 seconds Googling this will see where it came from -- the problem is, most people don't.  I know with Suggested Edit Audits, it's just random text to catch the most egregious reviewers; for this, you would have to most likely select a small sample of tags, and then create their copy-and-paste entries for audits.    The whole point of this would be to raise awareness for people who have figured out how to recognize and pass Suggested Edit audits, but still don't understand the finer nuances of reviewing. Reflection is quad dependent and looks non realistic Im rendering varous objects with a Sharp glossy effect but the reflections are quad dependent on the object (image below), meaning they behave separately within every quad making it look 8bit-like. Can anyone tell me why this happens?. (Im pretty sure subdividing would fix it but I want to know why I cant have a low poly object reflecting normaly.  The object has 2 modifiers: Subdiv Surface and Solidify. (Perhaps the Subdiv is causing it?). Help me you Blender savys I dont have a powerful CPU to test and test within every render would take me hours and hours.  Image: Limit of $\lim_{n\rightarrow \infty} \sum^{n}_{i=1} \frac{1}{\sqrt {n^2 +i} }$ I am a super newbie for Ubuntu and basically need Ubuntu for a Python package.  I would like to run a Python file in say e:/username/folder1/folder2/python.py. I tried every method online and the only reply is bash: cd./e: No such file or directory. I am not sure whether it is because of the bash windows or virtualenv.  When I use bash on Ubuntu on Windows, ls, it says VIRTUALENV_DIR. cd, it says /home/username. The cd .. etc changes the directory a little, but not another drive, nor the folder I would like it to find. Suppose the mean noon-time temperature for September days in San Diego is 24∘ and the standard deviation is 4.9. (Temperature in this problem is measured in degrees celsius)  On September 26, 1963, the all-time record of noon-time temperature in San Diego of 44∘ was hit. Assume the temperature distribution is symmetric around the mean, what is the Chebyshev bound for the probability of breaking (or tieing) this record?  I am having a hard time understanding this. Could someone explain to me how to do this? Reading the question posted  left me with a more general question:  Given the professional title and name: Dr. (First Name)(Last Name), is there some way to differentiate between the holder of a philosophical doctorate and a medical doctor? Wouldn't it be more appropriate for a PhD holder to have the title (First Name)(Last Name), PhD? What is the limit of:  $$\lim_{n\to \infty} \frac{n^1+\dots+n^n}{1^n+\dots+n^n} = ?$$  I did some computation with big numbers, I guess it is in the interval $\left(\frac{1}{2},1\right)$. Executing multiple commands from a Windows cmd script I'm trying to write a Windows cmd script to perform several tasks in series. However, it always stops after the first command in the script.  The command it stops after is a maven build (not sure if that's relevant).  How do I make it carry on and run each task in turn please?  Installing any software or configuring the registry etc is completely out of the question - it has to work on a vanilla Windows XP installation I'm afraid.  Ideally I'd like the script to abort if any of the commands failed, but that's a "nice to have", not essential.  Thanks. When I'm watching a film in Mythtv the screen turns to black every 10 - 15 mins and I have to log back into Ubuntu. Very annoying!  How do I disable the black screen / screensaver / logout in Unity?  There no longer seems to be any options to turn the screen saver off as there were in Ubuntu prior to Unity. Force figure placement in text I have a problem when a lot of figures are in question. Some figures tend to "fly around", that is, be a paragraph below, although I placed them before that paragraph. I use code:  \begin{figure}[ht] \begin{center} \advance\leftskip-3cm \advance\rightskip-3cm \includegraphics[keepaspectratio=true,scale=0.6]{slike/visina8} \caption{} \label{visina8} \end{center}\end{figure}   to place my figures. How can I tell latex I REALLY want the figure in that specific place, no matter how much whitespace will be left? How to search the internet for terms with special characters As I learnt from this , Google has no ability to search for special characters. Let's say I want to search for ss!. Are there any other search engines that can achieve this? Please do not propose any programming code search engines since this is a general search. Why does $\lim_{n \to\infty}a_{n+1} = \lim_{n\to\infty}a_n$? Assume that $\{a_n\}$ is a convergent sequence. How to use the definition of a limit of a sequence to prove that $\lim\limits_{n \to\infty}a_{n+1} = \lim\limits_{n\to\infty}a_n$? How do I use itertools.groupby()? I haven't been able to find an understandable explanation of how to actually use Python's itertools.groupby() function.  What I'm trying to do is this:  Take a list - in this case, the children of an objectified lxml element Divide it into groups based on some criteria Then later iterate over each of these groups separately.  I've reviewed , but I've had trouble trying to apply them beyond a simple list of numbers. So, how do I use of itertools.groupby()?  Is there another technique I should be using?  Pointers to good &quot;prerequisite&quot; reading would also be appreciated. Cancellation of Direct Products I was trying to concatenate text files in sub-folders and tried:  cat ./{mainfolder1,mainfolder2,mainfolder3}/{subfolder1}/book.txt &gt; out$var   However this did not return anything. So, tried adding a non existing 'subfolder2'  cat ./{mainfolder1,mainfolder2,mainfolder3}/{subfolder1,subfolder2}/book.txt &gt; out$var   And this time it did work out, concatenating the files successfully. Why does this happens? Why does reading a record struct fields from std::istream fail, and how can I fix it?