list indices must be integers or slices not str I have a code like this,   def myfunction(json_dict):      mylistsize = len((list(json_normalize(json_dict,'data')['title'])))-1      print(mylistsize)      data = [c for c in json_dict['data']][0]#This line when it is 0 or 1 or 2 works for me.      df = pd.DataFrame()      data_paragraphs = data['paragraphs']   But when I change it to include all the elements of my array, to something like this -   data = [c for c in json_dict['data']][0:mylistsize]   It gives me an error on this line -     data_paragraphs = data['paragraphs']  Kindly help me with this.
Understanding slice notation I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.
When is a cellular automaton "bidirectional"? Can't understand how to draw it. Retrieving date in sql server, CURRENT_TIMESTAMP vs GetDate() Using SQL Server - which is the fastest or best practice method to use for date retrieval? Is there a difference? Why intra-word ** highlighting is broken to protect programming_underscore_usage? Union of connected subsets is connected if intersection is nonempty Out of Bag Error makes CV unnecessary in Random Forests? User is able to edit a file using vim I have a file named file.txt with some contents located in /home/myuser directory and I change the permissions of that file to root.root and 644.   -rw-r--r-- 1 root root 1.4K Jan 15 07:09 file.txt   Then I switched to myuser and opened it with vim(without sudo) and tried to edit and save it :wq! and I got output like:  "file.txt" E949: File changed while writing Press ENTER or type command to continue   Then I hit enter and then again :wq! and the output was :  WARNING: The file has been changed since reading it!!! Do you really want to write to it (y/n)?   I hit y, the file got saved and exit from vim.  The question is why a file with ROOT privileges and read-only access for a user changed by the way?  PS: 1. myuser is a sudo user.   The user permissions after saving the file changed to myuser.myuser as well.  -rw-r--r-- 1 myuser myuser 1.4K Jun 27 18:57 file.txt Auto Increment Problem in Mysql Indefinite integral of $ \int \frac{x^3}{\sqrt{x^2+1}} \,\text{d}x$. Can you please provide any sort of hint or suggestion on how to find the following indefinite integral?  $$\int\frac{x^3}{\sqrt{x^2+1}}\text{d}x$$  I tried substituting everything but it didn't work. I also tried trigonometric substitution but I couldn't find any valid trigonometric identity for $ \sqrt{\cos^2(x)+1} $ or $ \sqrt{\sin^2(x)+1} $. How to calculate the signal-to-noise ratio (SNR) in an image? I am working with an image X, I apply the "adaptive median filter" in it and I get the image Y. I'd like to measure the SNR in both in order to evaluate the quantity of noise deleted.   I know the formula to calculate the SNR is:   SNR = Psignal / Pnoise  but I don't know how to get these values from both images I have. I was thinking in substract the image X from Y and get the noise value. But I am not sure about the method. I am using 301 redirects for all URLs.  Should I change sitemap URLs now?  The sitemap currently contains the following URLs:   example.com/cat/1.html example.com/cat/2.html example.com/cat/3.html   Should I change the sitemap's URLs to a new destination?   example.com/cat/year/1.html example.com/cat/year/2.html example.com/cat/year/3.html Prove $aba^{-1}b^{-1}\in{N}$ for all $a,b$ I am trying to prove the above with the conditions that N is normal to G and $G/N$ is abelian.  So then for $Na,Nb\in{G/N}, NaNb=NbNa$.  But $NaNb=Nab=Nba$, so then we know $ab=ba$, so G is abelian.  So if $ab\in{G}, N=abN(ab)^{-1}=abN(ba)^{-1}=baNa^{-1}b^{-1}....$ and i'm getting lost... 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? "a ten years old boy" or "a ten year old boy" Difference between “with”, “at” and “for” with a business title and a company name How can an 18 month old be taught that bullying is not ok? He seems to like causing the trouble it brings upon him, and bullying, mean acts also seem to please him. He likes to sit on his younger cousin (my son), push him down, and steal his toys. His parents seem to be at a loss about it, and I don't really have any good suggestions to give. Thanks. Show lim sup (an) = lim inf (an) for increasing for increasing sequence of subsets. What is the reason behind "non-static method cannot be referenced from a static context"? The very common beginner mistake is when you try to use a class property "statically" without making an instance of that class. It leaves you with the mentioned error message:     You can either make the non static method static or make an instance of that class to use its properties.   Why? I am not asking for solutions. I would be grateful to know what is the reason behind it. The very core reason!  private java.util.List&lt;String&gt; someMethod(){     /* Some Code */     return someList;             }  public static void main(String[] strArgs){                // The following statement causes the error. You know why..     java.util.List&lt;String&gt; someList = someMethod();          } Implementing the decorator pattern in Python I've been using Texmaker for ~5 years now and prefer it over other editors because of its flexibility.   Is there a way to auto-indent LaTeX code in TeXmaker so that the code becomes more manageable ?