I'm having an interesting (albeit frustrating) issue with Python.   I'm attempting to populate a 2d array called plaintexts based on some calculations, and I've found that all of the entries in this array are duplicated. Ie, plaintexts[0] == plaintexts[1] == ... == plaintexts[n]. I assumed I messed up value assignment so I tried to halve my code to find the issue, but after a fruitless hour I assigned a value to plaintexts[0][3] at the end of my code and lo and behold, that same value popped up in every other row.   Below is my relevant code:  placeholder = ['0'] * 33 plaintexts = [placeholder] * len(ciphers)  for i in range(2):      for j in range(1, 2):          for k in range(0,len(ciphers[0])-1,2):             .             .             .             .             if charType == '010':                 if(plaintexts[i][k/2] != '0'):                    .                   .                   .                   .                 else:                     plaintexts[i][k/2] = (' ', xorstr.lower())                   .                   .                   .                   .  plaintexts[0][3] = '13414113133' print plaintexts[0][3] print plaintexts[1][3] print plaintexts   I'd appreciate any help in figuring out the issue.
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?
"be accorded someone" or "be accorded to someone"? When the verb accord means "give or grant", should the passive voice be accorded someone or accorded to someone?  I came across several sentences in a book:     The attention accorded husband-wife relations in Muslim teachings thus confirmed the indigenous view of matrimony as a desirable state, with the birth of children considered essential for the full attainment of adulthood.      Similar processes occurred in Daoism, which percolated into Vietnam from southern China but never received the official patronage accorded Confucianism.   Shouldn't it be "accorded to husband-wife relations", as "given to husband-wife relations"? Equivalent of cURL for Ruby? Which characters unlock each scene? How can I fix a mistake I made on my income tax filing? [US] How can I fix a mistake I made on my income tax filing? How can I access the "Open command window here" option in Windows without holding shift? Let $A$ be the set of all functions $f:\mathbb{R}\to\mathbb{R}$ that satisfy the following two properties. Let $A$ be the set of all functions $f:\mathbb{R}\to\mathbb{R}$ that satisfy the following two properties:  (1) $f$ has derivative of all orders, and  (2) for all $x,y \in \mathbb{R}$, $f(x+y)-f(y-x)=2xf'(y)$.  Which of the following sentences is true?  (a) Any $f\in A$ is a polynomial of degree less than or equal to 1  (b) Any $f \in A$ is a polynomial of degree less than or equal to 2  (c) $\exists f \in A$ which is not polynomial  (d) $\exists f \in A$ which is a polynomial of degree 4  It is a problem from TIFR GS-2018. I have found polynomials upto degree 2 hold this properties but have to exclude the possibility of (c) and (d). I also found out if $f'(x)$ has at most one real root and clearly graph of $f$ is symetric about that root. How can I proceed further? What is the best way to level up in Clash of Clans Shutdown and User button missing in panel I faced with a problem after update,   I missed 2 buttons from above panel, System menu (including shutdown, suspend &amp; …) and User (including log out &amp; …)  how can I restore them !?... Is there an integer $N>0$ such that $\varphi(n) = N$ has infinitely many solutions? Let $\varphi: \mathbb{N} \to \mathbb{N}$ be the totient function.   Is there an integer $N &gt; 0$ such that there are infinitely many integers $n &gt; 0$ such that $$\varphi(n) = N?$$ One of our SQL Server 2014 database transaction logs is growing very fast and I cannot find the root cause for this.  Database in Simple recovery mode. During full backup the log file grows to its limits (800GB) and backup fails.  I checked the transactions during the backup and did not find anything strange.  All transactions are our regular loading and no maintenance jobs (index rebuilds etc.)  I am aware of that backup keep the log from reuse but this mean 800GB changes during the backup period and this does not make any sense.  I had compared this DB to similar DB size, loading and backup duration. The second DB Log is not growing more than 400GB.  DB size is 7TB. Backup time is ~20H. The only time log is growing is during backup. Log_reuse shows correct Backup_Restore. No long running transactions.  The problem is the "speed" of log growth - compared to similar sites with same load and same backup duration, the log is 4 time less. Trying to get my head around the commutator subgroup. This is an excercise from Artin's Algebra:  Let $C$ be the commutator subgroup of $G$. Prove that $G/C$ is abelian.  Here is what I've done:  Let $xC,yC \in G/C$ then $xyx^{-1}y^{-1}C = C$ since $xyx^{-1}y^{-1}$ is a commutator hence belongs to $C$. But then $xyC = yxC$ so $xC$ and $yC$ commute in $G/C$. This can be done for any elements, so $G/C$ is abelian.  This seems somewhat surprisingly short. Is that all there is to it?   Regards How to test a confirm dialog with Cucumber? Decoupling caps, PCB layout Pressing "W" turned my cursor into a circle What is the meaning of "this" in Java? if $f^{(n)}(x_0),g^{(n)}(x_0)$ exist and $\lim_{x\to x_0} \dfrac{f(x)-g(x)}{(x-x_0)^n}=0$ then $f^{(r)}(x_0)=g^{(r)}(x_0 )$ for all $0\leq r\leq n.$ Show:   if $f^{(n)}(x_0),g^{(n)}(x_0)$ exist and   $$\lim_{x\to x_0} \dfrac{f(x)-g(x)}{(x-x_0)^n}=0$$   then $f^{(r)}(x_0)=g^{(r)}(x_0 )$ for all $0\leq r\leq n.$   My attempt:  let n = 1,  since $f'(x_0),g'(x_0)$ exists then The taylor polynomial exists: $$T_{f,1}(x)=f(x_0)+f'(x_0)(x-x_0), \lim_{x\to x_0} \dfrac{f(x)-T_{f,1}(x)}{(x-x_0)}=0$$  $$T_{g,1}(x)=g(x_0)+g'(x_0)(x-x_0), \lim_{x\to x_0} \dfrac{g(x)-T_{g,1}(x)}{(x-x_0)}=0$$  Then, \begin{align} \lim_{x\to x_0} \dfrac{f(x)-g(x)}{(x-x_0)^n} &amp; =\lim_{x\to x_0} \dfrac{f(x)-g(x)+T_{f,1}(x)-T_{f,1}(x)+T_{g,1}(x)-T_{g,1}(x)}{(x-x_0)^n}\\ &amp;=\lim_{x\to x_0} \dfrac{f(x)-g(x)+T_{f,1}(x)-T_{f,1}(x)+T_{g,1}(x)-T_{g,1}(x)}{(x-x_0)^n}\\ &amp;=\lim_{x\to x_0} \dfrac{f(x)-T_{f,1}(x)}{x-x_0}-\lim_{x\to x_0} \dfrac{g(x)-T_{g,1}(x)}{x-x_0}+\lim_{x\to x_0} \dfrac{T_{f,1}(x)-T_{g,1}(x)}{x-x_0}\\ &amp;=\lim_{x\to x_0}\dfrac{T_{f,1}(x)-T_{g,1}(x)}{x-x_0}\\ &amp;=0 \end{align}  Then, \begin{align} \lim_{x\to x_0}\dfrac{T_{f,1}(x)-T_{g,1}(x)}{x-x_0} &amp;=\lim_{x\to x_0}\dfrac{f(x_0)+f'(x_0)(x-x_0)-g(x_0)-g'(x_0)(x-x_0)}{x-x_0}\\ &amp;=\left(f(x_0)-g(x_0)\right)\lim_{x\to x_0}\dfrac{1}{x-x_0}+f'(x_0)-g'(x_0) \\&amp;=0 \end{align} I am confused because  $\lim_{x\to x_0}\dfrac{1}{x-x_0}$ does not exist. Word for a temporary project name Having migrated to Linux from Windows, I would like to find an alternative software to Winmerge or rather learn command line tools to compare and sync two folders on Linux. I would be grateful if you could tell me how to do the following tasks on the command line... (I have studied diff and rsync, but I still need some help.)  We have two folders: "/home/user/A" and "/home/user/B"  Folder A is the place where regular files and folders are saved and folder B is a backup folder that serves as a complete mirror of folder A. (Nothing is directly saved or modified by the user in folder B.)  My questions are:   How to list files that exist only in folder B? (E.g. the ones deleted from folder A since the last synchronization.) How to copy files that exist in only folder B back into folder A? How to list files that exist in both folders but have different timestamps or sizes? (The ones that have been modified in folder A since last synronization. I would like to avoid using checksums, because there are tens of thousands of files and it'd make the process too slow.) How to make an exact copy of folder A into folder B? I mean, copy everything from folder A into folder B that exists only in folder A and delete everything from folder B that exists only in folder B, but without touching the files that are the same in both folders. I can't open/ping any antivirus sites I have a problem with a virus in windows 7, I don't know what kind of virus is infected my OS, I installed kasersky antivirus, and clear all detected viruses. After that I can't open any antivirus sites, can't ping any antivirus sites. example:  C:\Windows\system32&gt;ping kaspersky.com Pinging kaspersky.com [38.117.98.231] with 32 bytes of data: General failure. General failure. General failure. General failure.  Ping statistics for 38.117.98.231:     Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),   When I ping to other sites, I get reply normally: example woth pinging to google.com  C:\Windows\system32&gt;ping google.com  Pinging google.com [31.7.160.224] with 32 bytes of data: Reply from 31.7.160.224: bytes=32 time=2ms TTL=61 Reply from 31.7.160.224: bytes=32 time=2ms TTL=61 Reply from 31.7.160.224: bytes=32 time=1ms TTL=61 Reply from 31.7.160.224: bytes=32 time=1ms TTL=61  Ping statistics for 31.7.160.224:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:     Minimum = 1ms, Maximum = 2ms, Average = 1ms   I tryed any antispyware/antimalware softwares, but null results.  Anyone else encountered this problem? Bash auto_completion with Xubuntu and xrdp from windows I'm using Xubuntu and connecting over RemoteDesktop with Windows 7.  Everything works fine, but the auto_completion in my bash doesn't work. I checked the .bashrc file in my home directory and also the /etc/bash.bashrc.  I uncommend the lines below in my local bashrc configuration and also in bash.bashrc, but nothing changes.  if ! shopt -oq posix; then   if [ -f /usr/share/bash-completion/bash_completion ]; then     . /usr/share/bash-completion/bash_completion   elif [ -f /etc/bash_completion ]; then     . /etc/bash_completion   fi fi