I have the following code:   def new():      test = [ {} ] *2     test[0]['a'] = 6     return test   First, I generate a list with 2 empty dictionaries Then I ONLY input the value 6 into key 'a' in the FIRST dictionary However, when I return the value test, it showed that test = [{'a':6, 'a':6}  How is that possible?
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?
I've only seen The Force Awakens once, but I'm as far as I can remember, Phasma doesn't really do much, except:      get taken hostage that one time and disable the shields around the Starkiller after being asked twice   Was she originally supposed to play a bigger role?  I was really expecting to see much more of her, or at least see her in combat. The grammaticality of "that don't impress me much" I'd like to know how the sentence "That don't impress me much" sounds to a native English speaker.  The phrase is the title of a song by Shania Twain, and to my eyes it contains a clear error. It is obviously intended, and I want to know what was the effect that the author wanted to obtain.  Other examples that come to mind:   “She's got a ticket to ride, but she don't care” — The Beatles “My love don't cost a thing” — Jennifer Lopez “It don't matter” — Akon “She don't care about me” — heard in the Lost series “It Don't Mean a Thing” — a jazz album title “The Sun Don't Lie” — another album title Is it possible to install Ubuntu FROM a smartphone? So, I'm in a situation were I want to install ubuntu in my laptop (currently running windows 8) but I don't happen to have pendrives, CDs or the like available. The only "external" device I have with me is a samsung galaxy s2 with a micro SD-card in it.   Is it possible to use the phone as a pendrive to install ubuntu from it somehow? (without damaging the phone's OS and data) Automatically determine tags while writing a question Can we modify "Ask question" to automatically suggests tags based on your question content.   So instead that user needs to type "team-foundation-server" or "TFS" or "TeamFoundationServer" he will see list of tags auto-populated with ajax which he (or she) can then select and it will be associated with the question. So basically only thing we need is code which will cross-match question content with list of known tags while user is typing and display results in some nice ajax-enabled list/cloud/whatever UI control. This should be separate control for tags suggestions so user still has option to use standard tag list input to type-in tags.  In this case, instead of three (or more) tag variations we would have only one tag for Team-Foundation-Server. Proving $\int_{0}^1\frac{x-1}{\log x}dx=\log 2$ and $\int_{0}^1\frac{\log x}{x-1}dx=\frac{\pi^2}{6}$ I would like to know how to prove the following two definite integrals.  A: $$\int_{0}^1\frac{x-1}{\log x}dx=\log 2$$  B:$$\int_{0}^1\frac{\log x}{x-1}dx=\frac{\pi^2}{6}$$  I found these two by using wolfram-alpha, but I can't prove them. I suspect that the following relations might be used.  $$\log 2=1-\frac{1}{2}+\frac{1}{3}-\frac{1}{4}+\cdots=\sum_{n=1}^\infty\frac{(-1)^{n-1}}{n}$$and$$\frac{\pi^2}{6}=\frac{1}{1^2}+\frac{1}{2^2}+\frac{1}{3^2}+\frac{1}{4^2}+\cdots=\sum_{n=1}^\infty\frac{1}{n^2}$$  I need your help. Is there a constructive way to exhibit a basis for $\mathbb{R}^\mathbb{N}$? Assuming the Axiom of Choice, every vector space has a basis, though it can be troublesome to show one explicitly. Is there any constructive way to exhibit a basis for $\mathbb{R}^\mathbb{N}$, the vector space of real sequences? Why does bash say No such file or directory when the file is on the path I tried to install ffmpeg in trusty/Ubuntu 14.04 and got the following message:  $sudo apt-get install ffmpeg  Reading package lists... Done Building dependency tree        Reading state information... Done Package ffmpeg is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'ffmpeg' has no installation candidate   Why isn't the package available? Change elements on different positions within a list Two of my friends are getting married. They're both huge Doctor Who geeks, and actually met through a DW RPG. Their wedding invitation contained a very subtle DW reference (you wouldn't have been able to tell unless you were very familiar with the show yourself.)   Doctor Who's been running long enough that there are quite a few nice quotes for basically every occasion in life. I was hoping someone would know a nice wedding-related one, or maybe one about love, that I could include in a wedding card? How do I select all but two types of entities in Minecraft with the type selector? Difference of Gamma random variables Suppose $k$ is a field, $A$ is a $k$-subalgebra of the polynomial ring $k[x]$. Must $A$ be a finitely generated $k$-algebra?   Thanks. Remove Escape on TouchBar in Safari The question "How to disable Escape key in Safari" was asked here a few times. Now since on the new MacBook Pros the Escape key is a touchscreen button, it is much easier to press it accidentally, but there is a good chance we can actually remove it in Safari once and for all.  How to remove  Escape button from TouchBar in Safari? (or any specific app)  There is no such option in Customize Touch Bar... menu: $\sum\limits_{n=1}^{\infty}\frac{1}{1+z^n}$, $|z|&gt;1$.  There are two facts that my professor uses that I am confused about.  The first is: $|1+z^n| \geq ||z|^n-1|$, I believe this is true for any $|z|$.  The other is: $\frac{1}{|z|^n-1} \leq \frac{2}{|z|^n}$, I believe this is also true for any $|z|$.  Can anyone prove these statements for me? C# - Keyword usage virtual+override vs. new Currently, once an edit by a user without full edit privilege is suggested, it can be either approved or rejected.  There is a known edge case that cause suggested edits to get auto rejected: (aka edit conflict)   User with full edit privilege click "edit" and start typing. Let's name this user Joe. Since the user from previous step did not yet send the edit, users without full edit privilege can still click the "edit" as well, oblivious to the fact someone else is editing the same post in those very seconds. Such user click "edit" too and start typing. Let's name this user Kenny. Kenny is faster than Joe: he send his edit first, creating new suggested edit. Joe is still typing. Joe finally done typing. He send his edit to its merry way oblivious to the consequences. As result of the full edit made by Joe, Kenny's suggested edit is kicked away and rejected. Boom.   This is all known and reported many times.  where the user got it hard with at least two auto rejections in short period of time. Some concrete examples: , , .  For edge case, it became pretty thick edge. This is not just minor hassle: enough rejections, and the user is banned from suggesting for a whole week: and remember we're talking here about good edits made by good users. The above used to count for the ban, but . Thanks Gilles for requesting such a change!   I know it was already suggested to lock edits and similar solutions, but I suggest whole different approach: instead of auto rejecting the suggested edit, dismiss it, i.e. cancel it like it never existed same way a bounty can be revoked by moderator.  In the edit suggestion page it will show "Dismissed" instead of Approved or Rejected maybe with a tooltip explaining what caused this. This will soften the blow from those edge cases, taking the edge out of them. :) Word for someone that always has to be right Is there a word for someone that always has to be right? The person gets angry if they are not. Without recasting and in lieu of unsightly suspensive hyphenation, could these work? The en dash (which means "to") is used between the figures, and the hyphens are used in the compound modifier. To me, the examples below are concise and clear.  Do you agree that the examples below are 100% punctuated correctly--yes or no?  45–50-year-old men  10–20-mile radius  $45–$55-million-per-year industry  $100,000–$150,000-a-year savings  10–15-degree temperature difference  $2–$5-per-day service fees  45–75-cent-a-week raises  55–65-mph speed zone  15–20-ounce steaks  20%–40%-a-year tax increases How to allow non-superusers to mount any filesystem? Is it possible to allow some particular users (e.g. members of a group) to mount any filesystem without superuser privileges on Linux?  Another question might have been "in what ways a user can harm a system by mounting filesystems?"