Why is this two initialization of 2d list different in python I am new to python, and I am trying to create a 2d list of list array. Below is two approach that I think should work, but one of them is actually not correct. board = [[&quot;.&quot;] * n for _ in range(n)] sth = [[&quot;.&quot; for _ in range(n)]] * n    when I perform assigned on [0][0] to replace '.' with 'Q' , sth initialize every row, while board only initialize first row. If list * n is a soft copy, and every list in each row of sth in the same, why would [&quot;.&quot;] * n not a soft copy ? Here's the result before &amp; after assignment. board[0][0] = 'Q', sth[0][0] = 'Q' board initialize: [['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.']] board assigned  : [['Q', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.']] sth initialize  : [['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.']] sth assigned    : [['Q', '.', '.', '.'], ['Q', '.', '.', '.'], ['Q', '.', '.', '.'], ['Q', '.', '.', '.']]
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?
Can older cards that refer to a player/opponent ever be used on planeswalkers? Many older cards refer to players or opponents, e.g. "deal 3 damage to target player". Can any of these be used on planeswalkers, beyond the fact that you can simply attack them with creatures?  For example:   Would my opponent discard a card if  damaged a planeswalker they control? Would my opponent, the planeswalker, neither, or both amass poison counters from an unblocked ? Can  target a planeswalker? Does  affect planeswalkers? Can  prevent damage to a Planeswalker? Would  be obligated to take damage being dealt to a planeswalker? Can a planeswalker gain loyalty from ? Can  prevent damage to a planeswalker? System freezes/unresponsive/unusable when copying large file to USB Enable External Sharing Programmatically We have a scenario on which we are creating site collections from a provider-hosted app. Some of these site collections will be used by external users. Is there a way from CSOM (server-side) to enable external sharing on the site collection? I haven't found any resources stating whether this is or not doable.  I'm trying to replicate the settings you can specify at the site collections page on the tenant admin site:    Thanks! Numbering equations If I am writing a LaTeX document on TexMaker and I want to number my equation but most probably I will be adding details later on and I do not want to fall into retyping it all over again. So if for example I have an equation and currently called equation (1.2) that I want to refer later as in the following sentence "As you can see in (1.2)" but then I had to edit my document in a way that it becomes (1.3) now instead of (1.2) what should I do in order to avoid editing large number of equations and my reference to them? In 10.04, I had a lot of keyboard shortcuts defined using Super/Mod4 and one single other key,   Super+O ran Opera Super+W opened Nautilus pointing to my Work folder, etc.   In 11.04, these do not seem to work -- only Super+R works to run the terminal, and Super+Shift+W successfully runs Nautilus.  Is there some way I can get these to function again?  Adding them in Keyboard Shortcuts does not work, and neither does adding commands in CompizConfig Settings Manager. How to fix error: The markup in the document following the root element must be well-formed How can anything ever fall into a black hole as seen from an outside observer? The event horizon of a black hole is where gravity is such that not even light can escape. This is also the point I understand that according to Einstein time dilation will be infinite for a far-away-observer.  If this is the case how can anything ever fall into a black hole.  In my thought experiment I am in a spaceship with a powerful telescope that can detect light at a wide range of wavelengths.  I have it focused on the black hole and watch as a large rock approaches the event horizon.  Am I correct in saying that from my far-away-position the rock would freeze outside the event horizon and would never pass it? If this is the case how can a black hole ever consume any material, let alone grow to millions of solar masses.  If I was able to train the telescope onto the black hole for millions of years would I still see the rock at the edge of the event horizon?  I am getting ready for the response of the object would slowly fade.  Why would it slowly fade and if it would how long would this fading take?  If it is going to red shift at some point would the red shifting not slow down to a standstill? This question has been bugging me for years!  OK - just an edit based on responses so far.  Again, please keep thinking from an observers point of view.  If observers see objects slowly fade and slowly disappear as they approach the event horizon would that mean that over time the event horizon would be "lumpy" with objects invisible, but not passed through?  We should be able to detect the "lumpiness" should we not through? Example where schema are better than multiple databases In several database systems (e.g., PostgreSQL and MS SQL Server) there is a concept of schema. There are many questions out there asking what schema are and how they are used; here is a . Usually the answer boils down to "namespace" and "permissions". However, what remains unclear to me is why a schema has any advantage over just adding a new database. A different database allows one to have both separate namespaces and permission assignments.  Can someone provide an example in PostgreSQL where multiple schema in a single database provide an advantage over multiple databases without schema? From a purely organizational perspective they appear equivalent. I was thinking of the noted 1980 paper by Sidney Coleman and Frank de Luccia--"Gravitational effects of and on vacuum decay"-- about metastable vacuum states that could tunnel to a lower energy "true vacuum" with catastrophic results. I suspect the answer is that if our vacuum is a false one, we wouldn't "see" the true one til it hit us. Run Trigger As A Specific User (or Profile)? Is this possible?  I'm not finding help, Google or otherwise, for this.  Situation:  A trigger runs and cycles through groups of Opportunities.  Some of these Opportunities are Closed Won, and most users of the system are not allowed to Edit Closed Wons (especially the Sales team).  But I need this trigger to be able to touch the Opps (it's fired when the User touches the Account and subsequently a group of Opps under that account gets touched).  It is a VALIDATION RULE blocking them.  Ultimately, I may investigate, if no other option, setting a HIDDEN FIELD on the Opp before updating, then clearing if after, and putting bypass code in the Validation rule.  This is a backup plan.  I'd like to know how to "Run As" a specific profile though.  Anyone have an example of this?  I have three profiles out of twelve that can touch Closed Wons... What does "overfull hbox" mean? (Why is there a black mark at the end of a line?) I often see output from TeX with the warning overfull hbox, badness 10000. What does this message mean? Proof that the largest eigenvalue of a stochastic matrix is $1$ Why can't I import a file in the init.m file? Help with Spivak Calculus Ch3 Problem 6a Yet again I find myself stuck on a Spivak question. This time it is simply the question that isn't clear to me. It states:  If $x_1, ..., x_n$ are distinct numbers, find a polynomial function $f_i$, of degree $n-1$ which is 1 at $x_i$ and 0 at $x_j$ for $j\neq i$. Hint: the product of all $(x-x_j)$ for $j\neq i$, is 0 at $x_j$ if $j\neq i$. This product is usually denoted by: $$\prod_{\begin{smallmatrix}{j=1}\\ {j\neq i} \end{smallmatrix}}^n(x-x_j)$$  To be honest I don't know where to begin. I understand how to create a polynomial equation for a given set of results but this is quite strange. I'm not sure exactly what the author is expecting.  The answer book shows:  $$f_i(x)={\prod_{\begin{smallmatrix}{j=1}\\ {j\neq i} \end{smallmatrix}}^n(x-x_j)}/{\prod_{\begin{smallmatrix}{j=1}\\ {j\neq i} \end{smallmatrix}}^n(x_i-x_j)}$$  Which I have expanded out just fine but don't know what to do with. I've been investigating the Cartesian graph of $x^y=y^x$. Obviously, part of the graph is comprised of the line $y=x$ but there is also a curve that is symmetrical about the line $y=x$. (We can prove this symmetry by noting that the function $x^y=y^x$ is self-inverse; all self-inverse functions are symmetrical about the line $y=x$.) An image of the graph is shown below:  I decided to find the intersection point and arrived at an intriguing result: the intersection point between the two curves is at $(e,e)$. The following is my method: If the gradient of the line $y=x$ is $1$, the gradient of the curve at the intersection point must be $-1$ as it's a normal to the line (as it's symmetrical about the line). This means that at that point $\frac{dy}{dx}=-1$. Now to find $\frac{dy}{dx}$. We have $x^y=y^x$. I then used a very powerful tehnique for differentiating these sorts of functions. We know that eg $$x^y=e^{\ln{x^y}}=e^{y\ln{x}}$$ and $$\frac{d}{dx}e^{f(x)}=f'(x)e^{f(x)}$$ Applying it to our function $x^y=y^x$ and using implicit differentiation and the product rule gives us: $$(\frac{dy}{dx}\times \ln x +\frac{y}{x})x^y=(\ln y +\frac{dy}{dx}\times \frac{x}{y})y^x$$ So $$\frac{dy}{dx}x^y\ln x +yx^{y-1}=\frac{dy}{dx}xy^{x-1}+y^x \ln y$$ Extensively rearranging gives: $$\frac{dy}{dx}=\frac{y^x \ln y -yx^{y-1}}{x^y \ln x -xy^{x-1}}$$ Let $\frac{dy}{dx}=-1$: $$y^x \ln y -yx^{y-1}=xy^{x-1}-x^y\ln x$$ But we know $x=y$ since we are at the intersection point with the line $y=x$: $$x^x \ln x -x^x=x^x-x^x\ln x$$ So $2x^x \ln x -2x^x=0$ $$2x^x(\ln x -1)=0$$ This means either $2x^x=0$ or $\ln x -1=0$ but we know $x^x$ is always greater than $0$ so $\ln x =1$, leaving us with: $$x=y=e$$ So I have my answer, but is there any other method of getting it? I have heard there is. Any help will be very welcome. Thanks in advance Performance Advantages to Iterators? What (if any) performance advantages are offered by using iterators. It seems like the 'Right Way' to solve many problems, but does it create faster/more memory-conscious code? I'm thinking specifically in Python, but don't restrict answers to just that. How to get my software into Ubuntu? X and Y are not correlated, but X is significant predictor of Y in multiple regression. What does it mean? X and Y are not correlated (-.01); however, when I place X in a multiple regression predicting Y, alongside three (A, B, C) other (related) variables, X and two other variables (A, B) are significant predictors of Y. Note that the two other (A, B) variables are significantly correlated with Y outside of the regression.   How should I interpret these findings? X predicts unique variance in Y, but since these are not correlated (Pearson), it is somehow difficult to interpret.  I know of opposite cases (i.e., two variables are correlated but regression is not significant) and those are relatively simpler to understand from a theoretical and statistical perspective. Note that some of the predictors are quite correlated (e.g., .70) but not to the extent that I would expect substantial multicollinearity. Maybe I am mistaken, though.    NOTE: I asked this question previously and it was closed. The rational was that this question is redundant with the question "". Perhaps I do not understand the other question, but I believe these are entirely separate questions, both mathematically and theoretically. My question is entirely independent from if "a regression is significant". Furthermore, several predictors are significant, while the other question entails variables not being significant, so I don't see the overlap. If these questions are redundant for reasons I do not understand, please insert a comment prior to closing this question. Also, I was hoping to message the moderator who closed the other question to avoid identical questions, but I couldn't find an option to do so. Assume that given three predicates are presented below: $H(x)$: $x$ is a horse $A(x)$: $x$ is an animal $T(x,y)$: $x$ is a tail of $y$ Then, translate the following inference into an inference using predicate logic expressions and prove whether inference is valid or not (for instance, using natural deduction): Horses are animals.  Horses' tails are tails of animals. My thoughts: I am quite good at translating predicate logic expressions, but here I struggled to come up with formula for Horses' tails. My initial idea was to consider similar sentence such as &quot;w is a tail of a horse&quot; to form required inference, but it was not successful. Would be welcomed to hear your ideas about this task. Cards changing mana color What cards across all sets allow the utilization of mana, either colorless or otherwise, as colored mana of another color?  One early example with an unlimited  1:1 ratio:     Sunglasses of Urza   Continuous Artifact: White mana in your mana pool can also be used as red mana.   What other cards have similar abilities?