When I try to copy a value stored in a list of list to another list of list, Spyder in Anaconda mistakenly assign the value to all lists of the first dimension.  Please see the code below.  I tried to print the value A[0][2] and self.image[2][0] before doing the assignment, they show the correct answer of 0 and 1. But when completing the task of assignment, the address of A[0][2] seems to be read in correctly as A[i][2] for all i.  class BImage(object):      def __init__(self, image):         self.image = image         self.d1 = len(image)         self.d2 = len(image[0]) if len(image) &gt; 0 else 0      # with a strange bug     def transp_image(self):         A = [[0]*self.d1] * self.d2         for i in range(self.d2):             for j in range(self.d1):                 # error:                 # when i == 0, j == 2, self.image[2][0] == 1                 # assign the value 1 to A[][2], instead of just A[0][2]                 A[i][j] = self.image[j][i]          self.image = A         k = self.d2         self.d2 = self.d1         self.d1 = k
I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?
Relativity and Galaxy Rotation Speed TP-LINK TL-WN823N Unable to connect to network Chat arrangement question: Left or right? I'm building a small chat. Now I see but in other chats (whatsapp, facebook mobile chat, sms ...) that the arrangement is always the same:  Left: the chat partner. right: myself      Why is that? Can I make `find` return non-0 when no matching files are found? How does the admissions process work for Ph.D. programs in the US, particularly for weak or borderline students? This is a question from the book Methods of Real Analysis by R. R. Goldberg.     If $(s_n)$ is a sequence of real numbers and if $$\sigma_n=\frac{s_1+s_2+\cdots+s_n}{n}$$ then prove that: $\operatorname{{lim sup}}\sigma_n \leq \operatorname{lim sup} s_n$.   I don't have any idea how to start working on this problem. Please help. Thanks. Can $(X_1,X_2) \cap (X_3,X_4)$ be generated with two elements from $k[X_1,X_2,X_3,X_4]$? Can $(X_1,X_2) \cap (X_3,X_4)$ be generated with two elements in the ring $R=k[X_1,X_2,X_3,X_4]$? Can it be generated with three elements? (Here $k$ is a field.)    Thanks for any help. In ubuntu 11.04 there was a workaround using gconf-editor and setting key /apps/gnome_settings_daemon/plugins/xrandr/active to false.  However there is no such key in gconf-manager using ubuntu 11.10 (gnome 3). Are mixed geometry types allowed in shapefiles? Does the shapefile support mixed geometry types (ie. point and polygon all in the same file)? I am stuck with the identity  $$ F_{2n} = \sum_{k=1}^n \binom{n}{k} F_k, $$  which happens to be formula . I am using induction, but so far without too much result.  $$ \sum_{k=1}^{n+1} \binom{n+1}{k} F_k = \\ F_{n+1} + \sum_{k=1}^n \binom{n+1}{k} F_k = \\ F_{n+1} + \sum_{k=1}^n \binom{n}{k} F_k + \sum_{k=1}^n \binom{n}{k-1}F_k =\\ F_{n+1} + F_{2n} + \sum_{k=1}^n \binom{n}{k-1}F_k, $$   I am stuck with the sum $ \sum_{k=1}^n \binom{n}{k-1}F_k$, because, on the other hand   $$ F_{n+1}+ \sum_{k=1}^n \binom{n}{k-1}F_k = F_{2n+1} $$  Which would conclude the proof. What am I missing? How to convert string to byte array in Python Please help me to draw the following diagram:  \begin{displaymath} \xymatrix{ H\ar[r]&amp;H .1={}_HI_Q\supset 1.Q&amp;Q\ar[l]_\epsilon^{\cong}  \\  &amp;R\ar[u]\ar[r]&amp;R\ar[u] } \end{displaymath} Is Design School a Requirement for Graphic Design? Is it required for people to go to design schools to become a Graphic Designer? I've heard many cases where they have started from scratch without previous education in design and are doing fine as freelancers/working in studios.  Would it be better to go to a design school to become a Graphic Designer? How much leverage would it give you if you went to one? How to use unicode characters in Windows command line? We have a project in Team Foundation Server (TFS) that has a non-English character (š) in it. When trying to script a few build-related things we've stumbled upon a problem - we can't pass the š letter to the command-line tools. The command prompt or what not else messes it up, and the tf.exe utility can't find the specified project.  I've tried different formats for the .bat file (ANSI, UTF-8 with and without ) as well as scripting it in JavaScript (which is Unicode inherently) - but no luck. How do I execute a program and pass it a Unicode command line? The two sentences here both indicate that, at some point in the past, I performed some work:   I did work I worked   What is the difference between these two sentences? Does constructing one with did and the other with a simple past change the meaning? Not packages and not all applications. Just the applications user installed by himself from whatever source (Software Center, manually added PPA, etc.). If the above is not possible - a list of all installed applications or at least a GUI which lists the applications so I can take screenshots of it.  I've read a dozen of similar questions and people posting answers usually don't even get close to OP question merit. Please note that my question includes 'user installed'.   Answer: It is not currently possible in Ubuntu Linux.  (choosing tijybba's answer as the closest one though) Setting background-image using jQuery CSS property Prologue:  This is an effort to follow up on  which is marked as a duplicate of  highly voted and status-declined feature request (although they seem to be different, one focusing on the OP and the other on the downvoter).   My New Year's resolution was to downvote more.  So on January 3rd or so, I saw a post that was low quality, and downvoted.  Two days later, I came back to see if it was ready to be deleted or had gotten piled with downvotes, to find it with a significant positive score!  At which point, I noticed that the answer had been significantly improved.  So I retracted my downvote, changed it to an upvote, and immediately resumed my dearth of downvoting again.  I think I have a responsibility to downvote bad posts, despite that oh-so-painful -1 rep penalty.  But if I am also going to have the responsibility to follow up on every downvote I cast, I'm not going to bother. I don't want my downvote to leave a residual penalty on posts that were once low quality, and I am not going to trouble myself to keep checking up on every post I downvoted.  Can a downvoter have an option to be notified when a post they voted down was edited?  I wouldn't make this an automatic thing, because not all downvoters want it, and it isn't applicable to all cases of downvoting (although  that this should be part of the responsibility of a downvoter).  Personally, I would make this a universal toggle on-off option on the user profile page, not a question-by-question option, but I don't have strong feelings about it. Passport validity for Canada I am traveling from Boston to Canada by cruise ship. The first port of arrival is on July 30 and the last port in Canada is on August 4. Then I'm flying on August 5 from Montreal to California. My passport is valid until August 20th. Will I have a problem? How do I limit the number of rows returned by an Oracle query after ordering?