In the script below, something strange happens when the second loop starts. The list area_1 changes value even though it is not involved in that loop at all. Same happens with area_2 after the third loop. server_1 = 'x1' server_2 = 'x2' server_3 = 'x3' table = [     {'Terminal': 'site_1', 'City': 'London', 'Station': server_1},     {'Terminal': 'site_2', 'City': 'London', 'Station': server_1},     {'Terminal': 'site_3', 'City': 'London', 'Station': server_2},     {'Terminal': 'site_4', 'City': 'New York', 'Station': server_3},     {'Terminal': 'site_5', 'City': 'New York', 'Station': server_1},     {'Terminal': 'site_6', 'City': 'New York','Station': server_2},     {'Terminal': 'site_7', 'City': 'Tokyo', 'Station': server_3},     {'Terminal': 'site_8', 'City': 'Tokyo', 'Station': server_3},     {'Terminal': 'site_9', 'City': 'Tokyo', 'Station': server_2}     ] city_index = [      {'City':'London', 'Lat': 51.48,'Long': -0.14 },     {'City':'New York', 'Lat': 40.69,'Long': -74.26 },     {'City':'Tokyo', 'Lat': 35.51,'Long': 138.64 } ] area_1 = [] for i in city_index:     area_1.append(i)     area_1[-1].update({'Station': server_1, 'Count of terminals': sum(q['City'] == i['City'] and q['Station'] == server_1 for q in table)}) area_2 = [] for i in city_index:     area_2.append(i)     area_2[-1].update({'Station': server_2, 'Count of terminals': sum(q['City'] == i['City'] and q['Station'] == server_2 for q in table)}) area_3 = [] for i in city_index:     area_3.append(i)     area_3[-1].update({'Station': server_3, 'Count of terminals': sum(q['City'] == i['City'] and q['Station'] == server_3 for q in table)})  all = area_1 + area_2 + area_3  for i in all:     print(i)  Output: (Notice the station key) {'City': 'London', 'Lat': 51.48, 'Long': -0.14, 'Station': 'x3', 'Count of terminals': 0} {'City': 'New York', 'Lat': 40.69, 'Long': -74.26, 'Station': 'x3', 'Count of terminals': 1} {'City': 'Tokyo', 'Lat': 35.51, 'Long': 138.64, 'Station': 'x3', 'Count of terminals': 2} {'City': 'London', 'Lat': 51.48, 'Long': -0.14, 'Station': 'x3', 'Count of terminals': 0} {'City': 'New York', 'Lat': 40.69, 'Long': -74.26, 'Station': 'x3', 'Count of terminals': 1} {'City': 'Tokyo', 'Lat': 35.51, 'Long': 138.64, 'Station': 'x3', 'Count of terminals': 2} {'City': 'London', 'Lat': 51.48, 'Long': -0.14, 'Station': 'x3', 'Count of terminals': 0} {'City': 'New York', 'Lat': 40.69, 'Long': -74.26, 'Station': 'x3', 'Count of terminals': 1} {'City': 'Tokyo', 'Lat': 35.51, 'Long': 138.64, 'Station': 'x3', 'Count of terminals': 2}  All 3 lists become identical at the end = area_3. Can someone please explain why this is happening? Why are area_1 and area_2 being overwritten?
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?
Travelling to Italy without my spouse who is a UK citizen I'm using Ubuntu 16.04 and there's no fglrx! Can anyone please help and tell me if this sentence is correct?  &quot;A significant amount of zombies were detected in your city.&quot;  In my opinion it should be &quot;A significant amount of zombies was detected in your city.&quot; because &quot;amount&quot; should be in agreement with &quot;was&quot; even though amount usually refers to something plural. Are both (was and were) acceptable in this case? Edit1: Yes, &quot;number&quot; would be the correct one in this case. So allow me to ask one more thing.  &quot;A significant amount of purchases were detected...&quot;  Does the use of &quot;number&quot; apply in this case also? As purchase is not exactly a thing/person. And if no, is it correct to say &quot;A significant amount of purchases were detected...&quot;? Edit2: So, please tell me what is the correct phrasing?  &quot;A significant amount of purchases were detected...&quot; &quot;A significant amount of purchases was detected...&quot;  Or, since purchases are countable, is the use of &quot;number&quot; instead of &quot;amount&quot; correct here, as in:  &quot;A significant number of purchases were detected...&quot; &quot;A significant number of purchases was detected...&quot;  Or would amount be correct since a purchase involves money and it refers to the amount of money? Would greatly appreciate an answer, and if possible a detailed explanation. How to add images in select list? Code after bullet list isn't rendered correctly Possible Duplicate:         If there is a list immediately followed by a code block the code block is not recognized as code (Even though there is a newline between the two).  int answer = 42;  Note: This happens both in the WMD preview and in the final (server rendered) post. Have you ever tried this before?  static void Main(string[] args) {     int x = 10;     x = x++;     Console.WriteLine(x); }   Output: 10.  but for   static void Main(string[] args) {     int x = 10;     x++;     Console.WriteLine(x); }   Output: 11.  Could anyone explain why this? Relating the union of the power set of a set to the set itself Prove that $f$ has finite number of roots Let $f:[0,1]\to \mathbb{R}$ be a differentiable function. If there do not exist any $x\in[0,1]$ such that $f(x)=f'(x)=0$, prove that $f$ has only finite number of zeros in $[0,1]$.   I'm not getting any idea how to proceed. Content Assist for JSF2 + CDI (weld) beans + Eclipse Helios Let $A$ and $B$ be two real $n\times n$ matrices such that $AB-BA=A$ Prove that $A$ is not invertible and that $A$ is nilpotent.  My attempt is the following. It holds that $AB=(B+I)A$ If $A$ were invertible, $B=A^{-1}(B+I)A$. Taking trace on both sides yields $tr(B)=tr(B)+n$, hence $n=0$, which is a contradiction. I can't prove that $A$ is nilpotent though. My prisoners wont move from the holding to cell to the actual cell I have a cell block with 25 cells but none of my prisoners will move there from the holding cell. I have working power and water beds and toilets they are separate from each other it has all the requirements why wont it work? Any ideas? isolated non-normal surface singularity I am looking for an isolated non-normal singularity on an algebraic surface. One obvious example occurs to me: the union of two $2$-dimensional affine subspaces of $\mathbb{A}^4$ which meet in a point. But this seems like "cheating." Can someone provide an irreducible example? I am unable to print documents using my HP printer. However, I am able to print test pages.  What I tried:  I have tried removing and re-installing the printer from the system settings but I can only print once (the first task). Then all the following tasks get stuck at the "Rendering Completed" status.  I additionally tried restarting the computer which leads in the same task mentioned above.  Moreover, I logged into the CUPS system ( 1.6.2) from http://localhost:631  From there, I removed the printer, restarted it and re-installed with no sucess.  System Specifications:  System : Ubuntu GNOME 13.04  Memory: 3.9 GB  CPU : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ × 2   OS-type : 32 bit  Graphics: Gallium 0.4 on NVA3  Printer: HP Deskjet 2050 j510 Series  IP Adress: localhost  I had no problems with my previous OS which was Pinguy OS 11.04 ( a distro based on Ubuntu 11.04) and it's the first time I use my printer at this OS.  Screenshots:   My printer stuck at "Rendering Completed" status.     From the CUPS web interface; you can see that "Rendering Completed" is stuck at the state of the print process.  **EDIT:**I tried printing from the pdf.js pdf viewer of firefox: I wait for about 5 minutes for a 10 pages document to print, the document is printed like faded and sort of in bold font (I accuse rendering for that). Then the status of the printer gets stuck at 'Rendering Completed' but I can print later on. Again, for the next prints I wait for 5 minutes minimum ( I wait for the 'Rendering....' bar to fill ) and the printing is weird. I've got a stylesheet that will not, for whatever reason, apply list-style-type to a UL element. I'm using YUI's Grid CSS with their reset-fonts-grid.css file, which I know strips that out as part of the CSS reset.  After calling YUI, I call the stylesheet for the website and in there have a block for UL:  ul {list-style-type: disc;}   I've also tried setting it via list-style but get the same result. I know that the above CSS block is getting read as if I add things like padding or margins those do get applied. The style-type isn't showing up in either Firefox or IE.  The only other CSS I've applied to UL's are in a #nav div but that CSS doesn't touch the list-style-type, it uses the reset that YUI provided, and YUI and the site style sheet are the only two CSS sheets that are called.  I've also got FCKEditor on the admin side of the site and that editor does show the bullet styles so I know it has to be something with the CSS that isn't being filtered by FCKEditor. Checking the way to stop duplicate names - validation rules or triggers What is better to have? A pokemon with higher IV but lower CP or vice versa? Me and my friends have encountered this situation many times. We need to decide which Pokemon to evolve. Take the following scenario:   Growlithe A: 20% more CP than Growlithe B. (898 instead of 743). Growlithe B: 26% more IV than Growlithe A. (87 instead of 69 in this case).   I didn't give more details about each Pokemon because I'd like a general answer that others can use.  Thank you kind folks!  P.S this is not a duplicate, since I understand what a higher IV interprets into.  Yes, a higher IV will define the MAX CP, but it's not the only thing to consider. A higher IV also means better chance of better moves for the evolved pokemon - and those are much more important than a high CP. Also consider that I have many Arcanines and I don't have the stardust to max them out (that is a different question). How long does the Truffle take to move in after building the mushroom biome? Given two separate annulus with centers $[C_1,C_2]$ and their corresponding radii being $[R_1,r_1]$ and $[R_2,r_2]$ respectively, larger radius being $R$. There are methods to look at whether they are overlapping or not. If they overlap how to find the overlapping area. Is there any close form expression for it?  equation of first annulus   $r_1^2&lt;(x-x_{c1})^2 + (y-y_{c1})^2 &lt;R_1^2$   equation of second annulus  $r_2^2&lt;(x-x_{c2})^2 + (y-y_{c2})^2 &lt;R_2^2$  If there are three circles overlapping, we get overlapping area as solution to set of 4 in-equations by least squares approach(Though we don't end up getting total area but, area within tangents of circles ). Avoiding "(Not Responding)" label in windows while processing lots of data in one lump I occasionally need to process a large amount of data from one package off the network, which takes sufficiently long that when the user tries to interact with the application windows adds the "(Not Responding)" string to the window title. I am aware this is because the processing is being done within a call to handle a message (some way up the stack) and therefore is blocking the message pump. I'm also aware the ideal way to deal with this is to process the data asynchronously in a separate thread so the pump can continue running, however this is a LARGE desktop application which is single threaded from top to toe and safely spinning this processing off is not feasible in our time frame.  So with that in mind, is there by any chance a way I can at least avoid the "not responding" moniker (which to most users reads as "has crashed") by telling windows my application is about to be busy before I begin the work? I believe there is something along these lines when responding to a request to close, one can keep asking windows for more time to avoid it proclaiming that your not "closing in a timely fashion"  I should add this is a C++ MFC application. Short story about dead soldiers bodies being reused