How to create a 2D list in python where all elements are the same? I want to create a n x n 2D list of lists in python, where all elements are equal to False. So I tried this:  array = [[False] * n] * n   This appears to give me what I want, but if I want to change an element in the (i, j) position, say:  array[i][j] = not array[i][j]   this changes all the elements in the jth column, rather than just affecting (i, j) position. I realize this is because all the rows in the list are just referencing the first row.  Is there a non verbose way in vanilla python (no numpy) to create a 2D list of lists without the internal referencing (is that what it's called) ?
List of lists changes reflected across sublists unexpectedly 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?
Is there a way to view Google Chrome browsing history past three months ago? I'm trying to find a page I looked at months ago but it looks like it's disappeared off the face of the planet. I thought I would have better luck looking through my Google Chrome browsing history, but I can't see history past September. Can I force Google Chrome to display history further into the past? Can I retrieve the history manually from a directory? Is the history data gone? What is the importance of eigenvalues/eigenvectors? What is the importance of eigenvalues/eigenvectors? How to write a good PhD literature review? Request root privilege from within a script Unable to upgrade pip It seems that most people who use the ignored tags feature end up with a fairly long list of those tags.  Although , it is sometimes necessary to add new ignored tags manually (typically when adding some-tag*).  It would be a lot easier if the add box was above the long list of ignored tags rather than below. I suppose the same would apply to the favorites tags for consistency's sake. Electric circuits in TeX, LaTeX, and Friends What are some ways to draw electric circuits in TeX systems?  I'm making this community wiki since I haven't found a question related to this.  I was thinking along the lines of . What do you think of that? Other examples are more than welcome, of course. AutoHotkey Equivalent for OS X? Is there an equivalent product/method for AutoHotkey. For those that don't know, its a product that allows you to program your mouse movements and keyboard. This allows me to "macro" certain functions on programs instead of having to do it manually. In the old days they used to call them keyboard stuffers. But that is only half of the solution as I need a "mouse movement" stuffer as well.  Is there such a beast? How do I avoid rendering glitches from overlapping faces? For instance, here I have two cubes that are offset only on the x-axis. When I render them (using Blender's internal renderer), the overlapping faces interfere with each other and the result looks awful. A quick and easy solution would be to offset them by just a smidget, but is there another solution that allows faces to overlap and not exhibit this graphical glitch? Irreducible polynomial which is reducible modulo every prime How to show that $x^4+1$ is irreducible in $\mathbb Z[x]$ but it is reducible modulo every prime $p$?   For example I know that $x^4+1=(x+1)^4\bmod 2$. Also $\bmod 3$ we have that $0,1,2$ are not solutions of $x^4+1=0$ then if it is reducible the factors are of degree $2$. This gives that $x^4+1=(x^2+ax+b)(x^2+cx+d)$ and solving this system of equations $\bmod 3$  gives that $x^4+1=(x^2+x+2) (x^2+2x+2) \pmod 3$. But is there a simpler method to factor $x^4+1$ modulo a prime $p$? When used like this:  import static com.showboy.Myclass;  public class Anotherclass{}   what's the difference between import static com.showboy.Myclass and import com.showboy.Myclass? How to uninstall Intel Linux Graphics Installer and revert to default drivers Isn't less just more? When I do more filename and less filename, it would seem that the resulting terminals are quite similar. I can navigate and search through my files identically (j, Space, /pattern, etc.).  I find it hard to believe that less is more and vice versa. Are there any differences between the two? How to get color of pixel in coordinates 123, 456 in screen? My AppleScript app needs to get color of pixel in coordinates 123, 456 in screen. Working in a group blender project Me and my team are new to blender, we are now planning for a small project. What I want to ask here are some questions regarding the team work:   We use git for version control in web projects, Is there any special version control for blender project. Creating object of each file and integrating in the project is one way we saw to complete the project. But is there any good way to work in the group?   Please tell us from your experience what might be the best way to work together in a group blender project. I want it to be look like this:    I have an HDD and an SSD in my PC, I want to install Ubuntu to SSD, I have windows on HDD. I want to be able to boot ubuntu from the windows 10 uefi boot manager. How do I do it? What does "Ubuntu" mean, and why did they choose that particular name? Best practice for Rails App to run a long task in the background? When I format a drive to NTFS under Windows and plug it into the Ubuntu machine it is perfectly usable, but when I format it under Ubuntu using Disks (delete all partitions and create one single partition with NTFS) it does not show up when plugged into the Windows machine. Please note that in both cases the USB drive contains only one, primary partition formatted to NTFS, for example: /dev/sdb - the actual device /dev/sdb1 - the only, primary partition I've observed this behaviour both with a solid state USB pen-drive as well as an external USB magnetic HDD. How to (re)format a USB HDD or a stick to NTFS under Ubuntu so it is usable under Windows? biblatex and new line for DOI, URL and Eprint