I am trying to loop through my list of lists, and change the values. I want this to print [['1','2'],['3','4']]. but it prints [['3','4'],['3','4']]. Can anyone please explain why this is happening? When I put a print statement, count increase for each iterations.   edit: it works if I manually create a list like [[0,0],[0,0]]. So what is the [[0]*2]*2 doing differently? They both look like 2d lists.  class Sudoku:     def __init__(self):         self.board=[[0]*2]*2  s=Sudoku() count=1 for i in range(2):    for j in range(2):        s.board[i][j]=count        count+=1 print(s.board)
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?
Is it possible to embed a scrollable frame inside a PDF? (This is an end-of-year crazy question)   Is it possible to embed a (scrollable) frame or a PDF inside a PDF? If so, how to do it in (pdf)LaTeX?  This is something pretty common in HTML (see for example ). Here it is a webpage with PDF frames   Here it is a fake screenshot so you get the idea.  Portable and non-portable (e.g. only-Acrobat) answers are welcomed.     Example of a down arrow below a frame. The up arrow can be on top of the frame and the triangles point up. Objective-C: Use singleton vs. use class as an object? Copying and pasting features using PyQGIS I have created a table join between two shapefiles which I've named 'OSMM' and 'Mastermap'. I want to copy and paste all features (polygons) without a match from the target layer ('Mastermap') into the parent shapefile ('OSMM'). I can't find any up-to-update code for QGIS 3.6. Here is my code so far: #1. loads the SHP files uri = 'C:/Users/xx/Downloads/OSMM.shp' vlayer = iface.addVectorLayer(uri,&quot;&quot;,&quot;ogr&quot;) uri = 'C:/Users/xx/Downloads/Mastermap.shp' vlayer = iface.addVectorLayer(uri,&quot;&quot;,&quot;ogr&quot;)  #2. Joins &quot;InvoiceNum&quot; from OSMM to Mastermap layerToJoin = QgsProject().instance().mapLayersByName('OSMM')[0] target = QgsProject().instance().mapLayersByName('Mastermap')[0] myJoin = QgsVectorLayerJoinInfo() myJoin.setJoinFieldName('InvoiceNum') myJoin.setTargetFieldName('InvoiceNum') myJoin.setJoinLayerId(layerToJoin.id()) myJoin.setUsingMemoryCache(True) myJoin.setJoinLayer(layerToJoin) myJoin.setJoinFieldNamesSubset(['InvoiceNum']) target.addJoin(myJoin)  #3. Selects NULL features from Mastermap params = { 'EXPRESSION' : '\&quot;OSMM_InvoiceNum\&quot; is NULL', 'INPUT' : 'C:/Users/xx/Downloads/Mastermap.shp', 'METHOD' : 0 } processing.run(&quot;qgis:selectbyexpression&quot;, params)  So how do I perform the PyQGIS version of Ctrl+C on 'Mastermap' and Ctrl+V into 'OSMM'? Presumably I will then need to use the following code: #5. Save the changes OSMM.commitChanges() Given sequence of $L-$Lipschitz functions which converges pointwise, prove uniform convergence Let $f_n:[a.b]\rightarrow \mathbb{R}$ be sequence of $L-$Lipschitz functions, that is: $$\forall x,y\in[a,b]: |f_n(x)-f_n(y)|\leq L|x-y|$$   Suppose $f_n \rightarrow f$ pointwise, prove $f_n \rightrightarrows f$   I have all the parts of the puzzle for the proof, and I'm trying to put them all together, I'm using  in my answer.  I would appreciate is you could correct my proof, and if you have an alternative proof, I would be more then happy to see it.  My proof:   Let $\epsilon&gt;0.$  $f_n$ are uniformly continuous on $[a,b]:$  $\tag{1} \exists \delta&gt;0\ \forall x,y\in[a,b]: |f_n(x)-f_n(y)|&lt;\frac{\epsilon}{3}$  $f$ is also $L-$Lipschitz:  $\tag{2} \forall x,y\in[a,b]:|f(x)-f(y)|&lt;L|x-y|=\frac{\epsilon}{3}$  Let us set a partition of $[a,b]$ such as Stephen Montgomery-Smith suggests:     Pick points $x_1,\dots,x_m \in [a,b]$ which are distance   $\frac{\epsilon}{3}$ from each other.        For each $1 \le i \le m$, find a number $N_i$ so that for all $n \ge  N_i$ we have $|f_n(x_i)-f(x_i)| \le \epsilon/3$.   Let $N = \max_{1 \le i \le m} N_i$      Now given any $x \in [a,b]$, pick $1 \le i \le m$ such that $|x-x_i| &lt;\frac{\epsilon}{3L}:  |f_n(x)-f(x)|&lt;\frac{\epsilon}{3} \tag{3}$   $$\begin{align}|f_n(y)-f(y)| &amp;=|f_n(y)-f_n(x)+f_n(x)-f(x)+f(x)-f(y)| \\ &amp;\leq |f_n(y)-f_n(x)| + |f_n(x)-f(x)|+|f(x)-f(y)| \\ &amp;&lt; \frac{\epsilon}{3} + \frac{\epsilon}{3} + \frac{\epsilon}{3} = \epsilon \\\end{align}$$ Would this look natural:     StackExchange is a helluva site! I found out about this site at Facebook.    Or should we use the preposition on:     StackExchange is a helluva site! I found out about this site on Facebook.    Or are both okay?   (Inspired by a ) author not appearing in \maketitle in amsart I am new to the amsart document class. For some reasons \author (etc..) is not showing after I use \maketitle. This is my tex:  \documentclass[12pt,reqno,a4paper]{amsart}  \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{mathrsfs}  \usepackage{amsthm}  \usepackage{latexsym}  \usepackage{pictexwd} \usepackage{pdftricks} \usepackage{natbib} \usepackage{setspace} \usepackage{color} \usepackage[affil-it]{authblk}  \begin{document}  \title{Temptation, Asymmetric information and Committment}  \author{Mark}  \affil{University of Leicester}  \date{February 2014}  \maketitle  \begin{abstract} To be written \end{abstract}  \section{introduction}  ...  \end{document}   and this is the output:   can anybody help me out? The Safari Back Button Problem I do some minor programming and web work for a local community college. Work that includes maintaining a very large and soul destroying website that consists of a hodge podge of VBScript, javascript, Dreamweaver generated cruft and a collection of add-ons that various conmen have convinced them to buy over the years.   A few days ago I got a call "The website is locking up for people using Safari!" Okay, step one download Safari(v3.1.2), step two surf to the site. Everything appears to work fine.  Long story short I finally isolated the problem and it relates to Safari's back button. The website uses a fancy-pants javascript menu that works in every browser I've tried including Safari, the first time around. But in Safari if you follow a link off the page and then hit the back button the menu no longer works.  I made a pared down webpage to illustrate the principle.  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt; &lt;html&gt; &lt;head&gt;&lt;title&gt;Safari Back Button Test&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt; &lt;/head&gt; &lt;body onload="alert('Hello');"&gt; &lt;a href="http://www.codinghorror.com"&gt;Coding Horror&lt;/a&gt; &lt;/body&gt; &lt;/html&gt;   Load the page and you see the alert box. Then follow the link off the page and hit the back button. In IE and Firefox you see the alert box again, in Safari you do not.  After a vigorous googling I've discovered others with similar problems but no really satisfactory answers. So my question is how can I make my pages work the same way in Safari after the user hits the back button as they do in other browsers?  If this is a stupid question please be gentle, javascript is somewhat new to me. How does Windows 7 licensing work for running the OS as Virtual Machines? I plan on buying Windows 7 Ultimate Edition to run on an old Pentium 4. I also want to run Windows 7 virtual machines inside Windows 7. My question is two fold:   Do I need a license for each Virtual Machine? Does the answer change if I use a third party virtualization platform (e.g. , , , etc) as opposed to ? Why does Ubuntu 12.10 not detect my Win7 partition? How do I prove the sequence $x_{n+1}=\sqrt{\alpha +x_n}$, with $x_0=\sqrt \alpha$ converges? ( boundedness?) Humorous time travel short story about a man's dealings with other versions of himself Okay, similar questions to this have been asked before, but not about the particular short story I am trying to find.  It was in an anthology of short sci fi stories, possibly award winning ones or at least someone's compilation of favourites. (I think)   It was a long time ago, maybe 1970s or 80s, so the story could date back to even the 1960s for all I know, but probably the 1970s.  It was the funniest story about time travel where a person meets incarnations of himself, that I have ever read. It was either derivative of 'By His Bootstraps' or the other way around, but my recollection is that this story was funnier.  Maybe my memory is playing tricks on me and it WAS 'By His Bootsraps', but I am almost certain that it wasn't, because when I read that recently it seemed unfamiliar and not as funny.  In the one I am trying to recall, the guy is also bemused and irritated by the behaviour of other incarnations of himself, like the Heinlen story, but the repartee between versions of himself and his extreme frustration is much more hilarious.  I have a vague recollection that he is in a spaceship during the story, but not absolutely sure. There seemed to be a lot of clambering around, ladders, bulkheads, etc, unlike the Heinlen story.  I'm almost certain it isn't any of the commonly suggested stories and I'm quite sure it wasn't a short film where he shoots his older self, or a full length novel. Someone will have read it and (un)remembered it fondly like me, I feel sure! What is the smallest positive integer $n$, such that there exist positive integers $a$ and $b$, with $b$ obtained from $a$ by a rearrangement of its digits, so that   $a – b = 11\dots 1$ (The number of '$1$'s equal to $n$)?   Is there any example that can satisfy the equation? Is Mana Weaving ok if it's followed by a thorough shuffle? My friends and I are relatively new to MtG. At some point, one of them introduced us to the idea of mana weaving, and we'd do this to declump our decks prior to a very thorough shuffling. However, at the Theros pre-release, one of us was asked not to do this, and we learned it was frowned upon and ceased to do it.  I just now came across , and it sounds like mana weaving's only bad if you use it to leave your deck in an even distribution, and it's OK if your deck is then thoroughly shuffled. In hindsight, the judge may have simply thought my friend wouldn't have shuffled afterwards, but at the time I came under the impression it was frowned upon even if you did shuffle afterwards.  So: is mana weaving my deck OK, if I shuffle it very thoroughly afterwards? Measuring the distance between lines and points in QGIS Using QGIS - I have a vector of fault lines.  I have point data in the form of a csv which I have also loaded into QGIS.  I need to know how far each point is from the nearest fault line then enter this distance in a new column in the csv file. Any ideas? how to change my hostname? My hostname is localhost, reported by hostname command, and terminal prompt root@localhost:~#.  How can i change it to mismis.com with mismis alias? and what is the proper configuration.  I confused after reading some articles on web.  My /etc/hosts:  127.0.0.1       localhost 127.0.1.1       srv345.myweb.com      srv345 178.162.231.61  janstone.mismis.com    janstone # The following lines are desirable for IPv6 capable hosts ::1     localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters I am Indian passport holder living in Hungary for 4 years and I have been issued a Temporary residence permit (EU Schengen).  Can I go to visit Dublin without any visa, or do I need to apply for a UK visa? I know Ireland still in Schengen but part of United Kingdom. I'm new to Ubuntu. I installed it today, but the first thing I encounter is that I can only connect to the Internet through wifi.  Can someone help me?   iwconfig result :  eth0      no wireless extensions.  lo        no wireless extensions.   lspci:  00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM     Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (rev a1) 03:00.0 Network controller: MEDIATEK Corp. MT7630e 802.11bgn Wireless Network Adapter 04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5289 (rev 01) 04:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0a)   lspci -nnk | grep 0280 -A2:  03:00.0 Network controller [0280]: MEDIATEK Corp. MT7630e 802.11bgn Wireless Network Adapter [14c3:7630]     Subsystem: Foxconn International, Inc. Device [105b:e074] 04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device [10ec:5289] (rev 01) An operator on the other side of the Schrödinger equation A form of the  is  $$     \left[-\frac{\hbar^2}{2m} \nabla^2 + V(\vec{r}, t)\right]\Psi = i\hbar \frac{\partial}{\partial t} \Psi $$  The bracketed term is of course the Hamiltonian, and the whole equation can hence be written as  $$     \hat{H}\Psi = i\hbar \frac{\partial}{\partial t} \Psi $$  My question is, is there a existing/named operator represented by $i\hbar \frac{\partial}{\partial t}$? That is, can we further rewrite the equation as  $$     \hat{H}\Psi = \hat{\Theta}\Psi $$  For some predefined operator $\hat{\Theta} = i\hbar \frac{\partial}{\partial t}$? How to chat to all I very rarely see chats too all and don't know how to do it myself. Normally it's SHIFT + ENTER The following hotkeys have been tried: - SHIFT + ENTER - CTRL + ENTER - ALT + ENTER Android: textview hyperlink