I have the function below:  def set_x(self,index1, index2, val):     print('Setting X with index1 : ' + str(index1) + ' , index2 : ' + str(index2) + ' with value : ' + str(val))     print(self.x)     self.x[index1][index2] = val     print(self.x)     print('hehe')   Say for example I called it, with parameters, 0, 1 and 785. The actual ouput is below:  Setting X with index1 : 0 , index2 : 1 with value : 785 [[305, 665], [305, 665]] [[305, 785], [305, 785]]   Im expecting it to be:  Setting X with index1 : 0 , index2 : 1 with value : 785 [[305, 665], [305, 665]] [[305,785],[305,665]]   It's like my assignment is setting all the second element of all the array within the array. How will I fix it?
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?
Get material and color of material on a face of an object in Python I want to iterate over the faces of a mesh and get the diffuse color of the material that is assigned to the face. How can I get the material that is assigned to the face of the object and the diffuse color of that material? amsalpha-like bibtex style with manual labels Why doesn't my question show up? is invisible in the  section, but visible in the  section. What gives? What should I do when my neural network doesn't generalize well? Calculating MEAN and STANDARD DEVIATION confussed Let $X$ and $Y$ be independent $N(0; 1)$ random variables. Let $Z = \sqrt{X^2+Y^2}$.  (a) Derive the marginal pdf of $Z$ and then using the marginal pdf to compute ${\rm E}[Z^2]$  (b) Can you propose a different way other than that in (a) to compute ${\rm E}[Z^2]$  (c) Compute ${\rm E}[Z]$.  This is the whole question that I was asked. I can do (c) but I don't know how to find the marginal pdf of $Z$ with the given information and can't seem to find any formulas. Any help would be appreciated. How to combine bold and "code sample" in Markdown? Nikon d5100 producing extremely underexposed images Mathematics for Quantum Mechanics What math should I study if I want to get a basic understanding of quantum mechanics and especially to be able to use the Schrodinger's equation. Is there any SE Site where Questions related to Hacking are on-topic? Complex polynomial and the unit circle Given a polynomial $ P(z) = z^n + a_{n-1}z^{n-1} + \cdots + a_0 $, such that   $\max_{|z|=1} |P(z)| = 1 $      Prove: $ P(z) = z^n $      Hint: Use cauchy derivative estimation    $$ |f^{(n)} (z_0)| \leq \frac{n!}{r^n} \max_{|z-z_0|\leq r} |f(z)| $$ and look at the function $ \frac{P(z)}{z^n} $     It seems to be maximum principle related, but I can't see how to use it and I can't understand how to use the hint. Consider an isosceles triangle. Let r be the radius of the circumscribed circle and p be the radius of the inscribed circle. Prove that the distance d between the centers of these two circles is $$d = \sqrt{r(2p-r)}$$ Why is the method executed immediately when I use setTimeout? What happened to Jarvis at the end of Avengers: Age of Ultron Would depositing large cash amounts cause problems? I saw  recently where a man withdrew $600,000 USD in cash from his bank.  I'm sure many folks here would advise against this move for obvious (and perhaps not-so-obvious) reasons.   My question: suppose you did this and then, some months later, changed your mind and wanted to re-deposit with a bank.  I assume the gent cannot simply walk into a bank with $600,000 USD and deposit it, right?  Wouldn't money-laundering alarms be raised?  Wouldn't the IRS like to know where the money came from? How do I install drivers for the RTL8821CE Network Controller on Ubuntu 20.04? My Laptop (HP Laptop 14-ck1xxx) came with the RTL8821CE Network Controller. When I run lspci | grep Network I get: 03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter  I‘m unable to get the Wi-Fi to work. What I did so far:  Download the repo at . Unzip the file and rename the folder from rtl8821ce-master to rtl8821ce. Run the following commands in the terminal:  cd Downloads/rtl8821ce/ sudo apt install bc module-assistant build-essential dkms sudo m-a prepare sudo ./dkms-install.sh    Everything seemed to install and execute successfully. Then, I rebooted my laptop and made sure secure boot is disabled. However, Ubuntu still displays: No Wi-Fi Adapter Found - make sure you have a Wi-Fi adapter plugged in and turned on  The command uname -r returns: 5.4.0-7634-generic  The command sudo lshw -C network returns: *-network                         description: Ethernet interface        product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:02:00.0        logical name: eno1        version: 15        serial: c4:65:16:08:52:bf        size: 1Gbit/s        capacity: 1Gbit/s        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.178.37 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s        resources: irq:16 ioport:4000(size=256) memory:a1204000-a1204fff memory:a1200000-a1203fff   *-network UNCLAIMED        description: Network controller        product: RTL8821CE 802.11ac PCIe Wireless Network Adapter        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:03:00.0        version: 00        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress cap_list        configuration: latency=0        resources: ioport:3000(size=256) memory:a1100000-a110ffff  What am I doing wrong? How can this be solved? How to get a list of current open windows/process with Java? Does any one know how do I get the current open windows or process of a local machine using Java?    What I'm trying to do is: list the current open task, windows or process open, like in  Windows Taskmanager, but using a multi-platform approach - using only Java if it's possible. Every finite subset of $\mathbb R$ contains its supremum (and its infimum)   Proof Let $A=\{a_1,...,a_n\}$ be a finite subset of $\mathbb{R}$. Since it is non-empty and it is bounded ($\max A$ is an upper bound), it has supremum, that is $\exists \sup A$ and by definition $\forall a \in A \;\, a \leq \sup A$. Let's suppose that $\sup A  \not\in A$ then, since $\max A \in A$ we have that $\max A &lt; \sup A$. But considering that $\mathbb Q$ is dense in $\mathbb R$ we can conclude that $\exists r \in \mathbb Q$ s.t. $\max A &lt; r &lt; \sup A$, but this is absurd since $r$ is an upper bound of $A$ and it is lower than the supremum. Necessarily, $\sup A\in A$.  Is there anything wrong? Is there any way to prove this without using density of $\mathbb Q$ or another property? Thanks in advance. Samba+Windows: Allow multiple connections by different users? I have a machine running Ubuntu with Samba that I use to share stuff with my family's Windows machines in our local network.  Currently they access a share for movies/music/etc with one user.  I want to connect them to another share as a different user (for example, user "goytacaz").  When I try connecting to this new share, Windows gives me "Error 1219" and complains about multiple connections by the same user.  How do I get my machine to accept multiple connections by the same user? Custom DataTable using Vanilla Datables in LWC I'm trying to build a custom datable because I want the functionality to sort, search and paginate and also add action buttons in each row. Initially, my VF page was using  but we have now decided to rebuild that page in LWC.  I found a similar  but it hasn't really worked for me.  I then found  (Javascript) and  (ES2018) I have tried to implement Vanilla Datatables but I keep running into issues such as:      TypeError: Cannot read property 'length' of undefined   The above error is thrown because the library is unable to find the body of the table.   My point is that I feel this library won't work because it's using document, window and so on.   I was wondering if there is a way I could convert this library to something that is more suited to LWC basically have it "export" the modules. Since I'm not a JS expert I'm unable to put the pieces together.   Just for some context, I'll post my code here:  &lt;template&gt;     &lt;table class="sobject-table slds-table slds-table_cell-buffer slds-table_bordered"&gt;         &lt;thead&gt;             &lt;tr class="slds-line-height_reset"&gt;                 &lt;template for:each={fieldSetData} for:item="field"&gt;                     &lt;th key={field.apiName} title={field.fieldLabel} class="" data-scope="col"&gt;                         &lt;div class="slds-truncate" title={field.fieldLabel}&gt;{field.fieldLabel}&lt;/div&gt;                     &lt;/th&gt;                 &lt;/template&gt;             &lt;/tr&gt;         &lt;/thead&gt;         &lt;tbody&gt;             &lt;template for:each={records} for:item="row"&gt;                 &lt;tr key={row} class="slds-hint-parent"&gt;                     &lt;template for:each={row} for:item="data"&gt;                         &lt;td key={data.id} data-label="Name" data-scope="row"&gt;{data.value}&lt;/td&gt;                     &lt;/template&gt;                 &lt;/tr&gt;             &lt;/template&gt;         &lt;/tbody&gt;     &lt;/table&gt; &lt;/template&gt;   import {LightningElement, api, wire} from 'lwc'; import {processRecords} from 'c/recordGenerator'; import getFieldSetData from '@salesforce/apex/FieldSetData.getFieldSetData'; import getSobjectRecords from '@salesforce/apex/DeomoCTRL.getRecords'; import VanillaDatatable from '@salesforce/resourceUrl/VanillaDatatable'; import {loadScript, loadStyle} from 'lightning/platformResourceLoader';  export default class ManageSelectedIndicators extends LightningElement {     @api recordId;     records;     fieldSetData;     @wire(         getFieldSetData,         {objectName: 'SOBJECTName', fieldSet: 'FIELSETName'}     ) wiredFieldSetData({error, data}) {         console.log('wired called in Child')         if (data) {             this.fieldSetData = data;             this.getData();         }     }       constructor() {         super();         console.log('Constructor called in Child');     }      connectedCallback() {         console.log('Connected callback');     }      renderedCallback() {         console.log('Rendered callback');         Promise.all([              loadScript(this, VanillaDatatable + '/VanillaDataTables/src/vanilla-dataTables.js')          ]).then(() =&gt; {              const table = new DataTable(                  document.getElementsByClassName('.sobject-table'),                  //Also tried this.template.querySelector('.sobject-table'),                  {searchable: true, sortable : true}              );          })          .catch(error =&gt; {             console.log(error);          });     }      getData() {         getSobjectRecords ({             sobjectId: this.recordId         })         .then(response =&gt; {             this.records= processRecords(response, this.fieldSetData);         })         .catch((error) =&gt; {             console.log(error);         });     }  }   Edit: I have also tried lwc:dom="manual" that didn't seem to work either.  Is there any other way I could achieve these functionalities? Or do I have to write custom code to achieve this?