Iterate through an array in javascript
Why is using "for...in" for array iteration a bad idea?
Okay, maybe I'm missing something obvious but consider $h_n(x) = x^{ 1+ \frac{1}{2n-1}}$ on the set $[-1,1]$. Now consider a fixed $x \in [-1,1]$, we have:  $$\lim_{n\rightarrow \infty} h_n(x) = x \lim_{n \rightarrow \infty} x^\frac{1}{2n-1} = x$$  But my book says it's $|x|$? Why? Where do the regions of Westeros appear to align as of the season 6 finale? Based on , my understanding is that there are 9 regions of Westeros subject to the rule of the Iron Throne, from Dorne joining up to Cersei killing Robert.  With whom does [insert region] align in what appears to be Daenerys vs Cersei?   Kingdom of the North -- Daenerys probably but currently busy with White Walkers Kingdom of the Mountain and the Vale -- Daenerys probably but currently busy with White Walkers (supposedly; depends on what Littlefinger has in mind) Kingdom of the Isles and Rivers (Iron Islands) -- Daenerys Kingdom of the Isles and Rivers (Riverlands) -- Cersei because the Freys are with the Lannisters? Kingdom of the Rock -- Cersei because she is a Lannister Kingdom of the Stormlands -- Cersei? Kingdom of the Reach -- Daenerys after invitation of Varys and Ellaria Principality of Dorne -- Daenerys after invitation of Varys presumably Crownlands -- Cersei since Cersei is currently occupying the Iron Throne   Am I understanding this right? Anything wrong? What provokes an opportunity attack?  In 3.X moving out of a threatened square, standing up from prone, casting a spell (unless cast defensively), or making a ranged attack provoked, while in 4e moving out of a threatened square or making a ranged/area attack provoked. Ways to get free and legal access to research papers as a researcher I’ve discovered that website like ResearchGate offer the possibility to ask the paper editor to provide his paper for free. Many are collaborating.  Are there any other ways for researchers to obtain free access to papers? TP-LINK TL-WN823N Unable to connect to network I have a sight hosted on .ie domain but it is near the NI(Northern Ireland) border and the business has a lot of NI traffic. So when someone searches in NI with certain key words I would like the site to appear in the results, it currently doesn't.   I have seen this post    But was wondering the best way around this. Would it be to create a .co.uk version that redirects to the .ie site? Or would I have to create a separate .co.uk site?  Any help appreciated thanks. System.ListException: Before Insert or Upsert list must not have two identically equal elements - Deep Dive I had the following exception thrown at me when trying to process more than one selected records via a custom button in the list view.    Class Code  global class MerchandiseInventoryClass {      webservice static void ConverttoInventory(String[] merchandise_id)    {        //Convert Merchandise collection into Inventory Collection...         Merchandise__c[] merchandise_collection = [SELECT ID,Author__c,Book_Title__c,Edition__c,Publisher__c,Total_Merchandise_QtyTotal_Qty__c,Status__c FROM Merchandise__c WHERE ID = :merchandise_id];          Inventory__c i = new Inventory__c(); //Line 1        List&lt;Inventory__c&gt; newInventory = new List&lt;Inventory__c&gt;();        for(Merchandise__c m : merchandise_collection )        {            if(m.Status__c !='Fully Converted')            {            i.Author__c = m.Author__c ;            i.Book_Title__c = m.Book_Title__c;            i.Edition__c = m.Edition__c;            i.Publisher__c = m.Publisher__c;            i.Qty_Available__c = m.Total_Merchandise_QtyTotal_Qty__c;            i.Merchandise__c = m.Id;            m.Uninventoried_Qty__c = 0;            m.Status__c = 'Fully Converted';            newInventory.add(i);            }        }        insert newInventory;        update merchandise_collection;    }  }   By moving the Line 1 to within the for loop solved the issue for me.  Thanks to this post (refer the Best Answer in that post)    What puzzles me is that WHY i have to instantiate "i" for every iteration within the loop.  Why the list collection ("newInventory") is complaining that are duplicate elements and why should it even confuse in the first place when I am performing an "insert" even ? Centos mysql version is 5.5 however PHPmyadmin still says version 5.1 How can I securely erase a hard drive? I'm planning on selling a USB external hard drive that currently contains an old Ubuntu installation with stored passwords and banking information.  How can I securely erase the drive before selling it? Is there any way to do a correct word count of a LaTeX document? Often assignments (or even papers) have a word count limit. That is not a big deal when using Word, but I don't know how to do that using LaTeX. My solution has been so far to compile the document and then do a rough word count of my pdf file, sometimes even copying the contents of the pdf file and pasting in Word to get a mostly correct Word count.  Is there any tool (maybe even an online tool), package, script or software to do that directly from my .tex document and still get the right word count (i.e., ignore commands, equations, etc)? I've completed 20 suggested edits reviews today. Then, I came across a  and I approved it.   Then, I had a doubt that whether the review count has incremented or not, oh! it's not incrementing. System works fine.  But, take a look at review page,     The edit was already reviewed by one reviewer and then I reviewed it. As I'm the Owner of the post it's enough to approve the edit. But, the review history doesn't show the detail that I had approved it. It's misleading that only one vote of a reviewer who is neither the community user nor the OP nor the moderator, is enough.  So, what should we do in this type of situation?  Is it correct to make OP to review the suggested edit after completing daily limit?  Should we need to display/hide the OP has approved the edit in the review history? Showing that $A\cap B = A\setminus (A\setminus B)$ How does one show that $A\cap B = A\setminus (A\setminus B)$?  My thinking is that if $x\in A\setminus (A\setminus B)$ then this means that $x\in A$ and $x\notin A\setminus B$, which means that $x\in A$ and ($x\notin A$ and $x\in B$), but I don't see why the expression in parentheses should simplify to just $x\in B$. Any insight would be helpful.  Maybe $(x\in A^c$ and $x\in B)$, i.e, $x\in A^c\cap B$ is a possible simplification of the expression in parentheses, but still don't see why this simplifies to just $x\in B$. Divergent or not series? How tipe are this series?  $$\sum_{n=2}^\infty \frac 1 {n^2\ln n}$$ But $$\sum_{n=2}^\infty \frac 1 {n\ln n\ln(\ln n)}$$ I used Condensation Test, but I stack after that. Thanks! Event binding on dynamically created elements? I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. Why doesn't the mirror modifier work with object groups? Why doesn't the mirror modifier work with object groups? I have a group made of four objects to which I want to apply a mirror modifier. For me, it's not working. What are the steps to make apply a mirror modifier to a group of objects? Where can I ask an open discussion question? How to prove that the set of rational numbers are countable? Format a number with optional decimal places in Excel I have numbers in cells in Excel. I want the numbers formatted so that if they have decimal places they show to a maximum of two, and if they have no decimal places it doesn't show any.  For example.    15 should be formatted as 15, NOT 15.00 14.3453453 should be formatted as 14.35 12.1 should be formatted as 12.1  0 should be formatted as 0   The closest custom format code I've come up with is 0.##. Unfortunately this formats 15.00 as 15. (note the extra decimal point).  To further complicate the issue, the spreadsheet is a result of an export from SQL Server Reporting Services. So no macros are possible. Oh well, it looks like 0.## is my best bet, and they can just live with the extra period. I'd like to loop though each feature in a layer and calculate its ellipsoidal area using QgsDistanceArea() in PyQGIS 3.  Everything works fine on unprojected layers, but I get strange results when input layer is in projected CRS.  So far I have written this:  from qgis.core import *  def calculate_area(in_lyr_name, ellipsoid, units):     input_layer = QgsProject.instance().mapLayersByName(input_lyr_name)[0]      area = QgsDistanceArea()     area.setEllipsoid(ellipsoid)      features = input_layer.getFeatures()     feature_area = 0     error_features_counter = 0      for i, feat in enumerate(features):         geom = feat.geometry()         polygon_area = 0         try:             if geom.isMultipart():                 polygons = geom.asMultiPolygon()                 for polygon in polygons:                     polygon_area += area.measurePolygon(polygon[0])             else:                 polygon = geom.asPolygon()                 polygon_area = area.measurePolygon(polygon[0])              feature_area += polygon_area          except AttributeError:  # catches NoneType geometries (broken etc.)             error_features_counter += 1             pass      # calculated area is in sq. metres (see the "else" case)     if units == 'km²':         final_area = feature_area / 1e6     elif units == 'Ha':         final_area = feature_area / 10000     else:         final_area = feature_area     return final area, error_features_counter   How do I get a constant result that does not depend on the presence of projection? can I use same functions with the different type of argument inputs