How to avoid reference issue with array append in python Let's take the following code  board = [[0,0,0],[0,0,0],[0,0,0]] versionsOfBoard = [] versionsOfBoard.append(board); #this will keep the versions of board array print(versionsOfBoard); # output # [[[0,0,0],[0,0,0],[0,0,0]]] # later I change few values in the board and append 'board' to my versions array board[0][0] = 1 versionsOfBoard.append(board) print(versionsOfBoard) # output # [[[1, 0, 0], [0, 0, 0], [0, 0, 0]], [[1, 0, 0], [0, 0, 0], [0, 0, 0]]] # if you notice here, the 0th index value is also changed board[1][2] = 1 versionsOfBoard.append(board) print(versionsOfBoard) # output # [[[1, 0, 0], [0, 0, 1], [0, 0, 0]], [[1, 0, 0], [0, 0, 1], [0, 0, 0]], [[1, 0, 0], [0, 0, 1], [0, 0, 0]]]   Every index value displays the latest state of 'board'. it is referencing the board. I have tried with .append(board[:]) and .append(board.copy()). Both these options too do not solve the problem.  Any help would be highly appreciated
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?
Accessing the iPhone's Call log with the iPhone SDK It was either a short story or a novel. I read it about 20 years ago, and some vague memory of it stuck.  It's set in a future where everyone's allotted role is decided by a series of tests once they reach a certain age. They are then classified into a group which decides what jobs they will do.  Our hero rather controversially gets a perfect score in the tests. Nobody had done that in a long time. and at first he worries about what this might mean. He is sent to work for the mysterious scientists who maintain the computer that runs society. Most people don't know they exist. He is disappointed to learn he has to be their tea boy, and learn a tea making ceremony perfectly.  In the process he learns how to fool the machine, and eventually to circumvent the controls society has placed on him. He makes several visits to an area outside the control of the machine - where people are living in poverty and lawlessness.  Can't remember the author, or the name, just that basic idea, and the fact that early in the book is a very grand "tea ceremony" where he must make the tea perfectly. I have some problems with this exercise. I don't know if it can be done. Consider the polynomial $ x^n - a \in \mathbb{Q} $ Can I compute the Galois group of this over $\mathbb{Q}$? Maybe having a nice "basis.  The splitting field is given by $\mathbb{Q}(\zeta_n,\alpha)$ , where $\zeta_n$ is a primitive root of unity , and $\alpha$ is some number such that $\alpha^n = a $. Well first of all, I want a $\underline{"good basis"}$ for the splitting field. In the sense that the minimal polynomials, of the adjoined elements, are different (in this case the computation of the galois group is very simple).  For example one easy case, it's when $a&gt;0$, then $(a)^{\frac{1}{n}} \in \mathbb{R}$ , so clearly the minimal polynomial of $(a)^{\frac{1}{n}} , \zeta_n$ are distincs, and I'm done. If $n$ is odd then , it's also easy, since one root it's also real, for example $x^3-3 $, the real root is $ \root 3 \of { - 3}  =  - \root 3 \of 3  $ , so I can consider the splitting field as $\mathbb{Q}(-\root 3 \of 3 , \zeta_3 )=\mathbb{Q}(\root 3 \of 3 , \zeta_3 )$. The difficult case is when $n$ is even and $a&lt;0$ , for example  $x^8+20$ or $x^4+20$ in some cases as in the second, there are particular cases since there exist algorithms for the Galois group of quartics, but in general. It can be done?  $\underline{Remark}$ I'm searching a $\underline{"good basis"}$ for the splitting field. In the sense that the minimal polynomials, of the adjoined elements, are different since in this case the computation of the galois group is very simple. No, this is not a , nor is it a solicitation on  to backup or  and only a little bit about Where to backup and When to do it.  This is basically a strategy question: what, where and when all together. "How" is not really relevant: there are tons of back-up programs out there and they all do the same basic thing: make copies of data.  But the real question is: are these back-up programs making copies of the data important to you?  How should you install&amp;run Ubuntu while safeguarding your data?  There is no "one size fits all" when it comes to computers, Ubuntu versions or a backup strategy, therefore I've split this up into 5 basic user types with each their own answer:       (or you're running in UEFI mode!)   And as the above does not fit everyone, one for the impatient:   !    So click one of the above links and go to your user type!  P.S. If you're running a server farm and you've read this question so far, I'm sorry: this is about a single PC, not a network, nor a server farm. Hungerford's book of algebra has exercise $6$ chapter $3$ section $6$ [Probably impossible with the tools at hand.]:     Let $p \in \mathbb{Z}$ be a prime; let $F$ be a field  and let $c \in  F$. Then $x^p - c$ is irreducible in $F[x]$ if and only if $x^p - c$   has no root  in $F$. [Hint: consider two cases: char$(F) = p$ and   char$(F)$ different of $p$.]   I have attempted this a lot. Anyone has an answer? No continuous function switches $\mathbb{Q}$ and the irrationals Can a possessive S be attached to nouns that are not human beings (or animals)? Can a possessive S be attached to nouns that are not human beings (or animals)?  For example, instead of saying "the back of the chair", can I say "the chair's back"?   I remember learning that not everything can get a possessive s, but this issue is not clear to me. I am working on the following problem from group theory:     If $G$ is a group of order $2n$, show that the number of elements of $G$ of order $2$ is odd.   That is, for some integer $k$, there are $2k+1$ elements $a$ such that $a \in G,\;\; a*a = e$, where $e$ is the identity element of $G$. Ubuntu 14.04 Wireless not working: no network interface. Atheros [168c:003e] device Product of binomial coefficient as a basis Via command line, I have a log file I'd like to keep track of.  What I want is to have, basically, a tail that refreshes when the log is updated making the text scroll upwards as new lines are appended to the log file.  Is there anything out there that does that without having to write some code? Why my U.S. B1 Visa got refused under 214 (b)? I went for B1 U.S. Visa at the U.S. Embassy in Delhi.   Interviewer: *Good Morning*. Me: *Good Morning* Interviewer: *What is your designation?* Me: *I am a Software Engineer.* Interviewer: *What is the name of your company?* Me: *It is XXX (I replied).* Interviewer: *What is the name of your client?* Me: *It is YYY (I replied).* Interviewer: *Have you ever been to U.S. before?* Me: *NO* Interviewer: *Have you ever been abroad before?* Me: *NO*   At this point he rejected my Visa with letter mentioning 214 (b) as the reason. I don't know why he actually rejected it.  But, I have decent 2+ years of experience with my company. And, I was going on a business meeting with the client. I would have come back after 2 weeks.  I don't know if re applying will help. Polygonizing a raster yields lots of little squares? I have a pdf with the area of a county that I want to separate into multiple shapefiles (polygons) based on color.   As shown in the first picture there are 4 colors so I would need to separate based on color between those four. But first, I need to convert it into a vector (unless there is an easier way).   Doing so, I get the second image as an output by using the polygonize tool which when zoomed in very close, has a lot of tiny squares where color should be different. I was wondering if there is a way to break a raster up by color even though the image isn't smart. Adding hyperlinks to pop-up data in qgis2web? Does anyone know if it is possible to add hyperlinks to image fields etc. in the pop-up windows of Qgis2web?  I've had a look in the layers javascript file, but the image source path isn't rendered using html, so I can't simply append &lt;a href" to it.  The image is coming in via the usual method of having a field that contains the path of the image file.  I'd like to achieve linking of the image, like in the example below. Alternatively, I could just populate the 'more info' field with the URL, but if I did that I'd like to avoid just doing it by having a field that contains the entire URL, as some may be quite long (these will only be internal links). Which objects can I use in a finalizer method? Calculus book recommendations (for complete beginner) Well I have not started calculus yet but I am really keen to. I would love if you suggest some books.  Points to be noted:   I really don't like the way textbooks are written so please no "textbooks"  I am COMPLETELY beginner in calculus. I know a little bit of trigonometry and what functions are but not really in depth.The book should start from the base, I mean really from the base. I may require a precalculus book too if the books don't cover that. I would really love if the book shows how calculus was developed, why it was developed and things like that.   Well,thanks in advance! How do I SSH to machine A via B in one command? When can I say that $\cup H_i$ is a group? Let $G$ be a group and $\{H_i\}_{i\in I}$ a family of subgroups. I would like to find a condition that will imply that $\cup_{i\in I} H_i$ is a subgroup. I know that it's not true in general, I need help to find this condition.  Any help is welcome.  Thanks a lot. the numer of partial function between two sets in combinatoric way evaluate the limit as $x$ approaches $0$ of $(\cos x-1)/x$ without l'Hopital's rule I know with l'Hopital's rule it becomes $-\sin(x)$ which has the limit $0$. However, I have been wondering how to evaluate this limit without l'Hopital's rule.