Just found out that matchAll is not supported by many browser versions.  Is there an ES5 safe alternative for the string.prototype.matchAll method?  const regexp = /(?:\[(.*?)\]\((.*?)\))|([^[]+)/g; const matchedElements = Array.from(value.matchAll(regexp));
I want to match a portion of a string using a  and then access that parenthesized substring:  var myString = "something format_abc"; // I want "abc"  var arr = /(?:^|\s)format_(.*?)(?:\s|$)/.exec(myString);  console.log(arr);     // Prints: [" format_abc", "abc"] .. so far so good. console.log(arr[1]);  // Prints: undefined  (???) console.log(arr[0]);  // Prints: format_undefined (!!!)   What am I doing wrong?    I've discovered that there was nothing wrong with the regular expression code above: the actual string which I was testing against was this:  "date format_%A"   Reporting that "%A" is undefined seems a very strange behaviour, but it is not directly related to this question, so I've opened a new one, .    The issue was that console.log takes its parameters like a printf statement, and since the string I was logging ("%A") had a special value, it was trying to find the value of the next parameter.
Is there a website listing the location of all the Windows 10 lock screens? Windows 10 has an extensive collection of lock screen photos, many of which have  here on Travel.SE.  Is there a website which lists the location of all of these photos? I imagine Microsoft has purchased an official license, so they should have a record about the photographer and the place where the photo was taken. Why are there gaps in my IDENTITY column values? Intraclass correlation coefficient vs. F-test (one-way ANOVA)? I'm a little confused regarding the intraclass correlation coefficient and one-way ANOVA.  As I understand it, both tell you how similar observations within a group are, relative to observations in other groups.  Could someone explain this a little better, and perhaps explain the situation(s) in which each method is more advantageous? Number of genes required to sustain life Are there estimates of the minimum number of genes required to sustain life?   In what I mean by life here, I don't include viruses. Can multiple render systems be used? Review sections to be always in the same place I find it not comfortable to have the order of the review sections changing all the time.  Within few seconds it changed from        to        Wouldn't it be better to have all of them in the same position, no matter the number of posts in each queue?  It assumes that the most important part is to lower the queue, although it is said there is no problem in having Close Votes with thousands of items. IMOH, most of us prefer going to one or other section (for example I like "Suggested edits") rather than to the queue with the most items, so having them changing their position makes it not that intuitive.  What do you think? How to completely delete and app from iphone (including all the data and history) So this problem particularly emerged with the Tinder app. I was using Tinder with a user account (A) and one day I logged out and created a new user account (B) which I never succeeded to activate due to sms verification problems, so I decided to login again with my old account. But even when I delete the Tinder app and reinstall it again, it still shows the B account logged in to the app. This means that IOS is somewhere storing a history for this app. Now I'm looking for a way to delete this history.  Note that this question is not necessarily about a certain app, but rather about where IOS stores historical data of apps and how to delete those histories alongside with the app.  P.S: If there are solutions like changing UUID of my i-phone that wouldn't damage my phone (I'm new to iphone so I'm not sure what I'm saying. For instance this jailbreaking thing which I keep hearing about and I'm not sure what it exactly does to my phone, doesn't sound like an I idea that I like), I'm open to them. Is it possible to associate non-blend files with Blender? Is there a way to make Blender auto import files that are not .blend when you open them?  For example if you open a .fbx file by double clicking on it, and you have Blender set as default application, then import it to a new .blend.  Is it possible to make Blender import this .fbx file just like you would do it manually by using File > Import > FBX?  By default, Blender just opens up and loads default new scene when you open anything that is not .blend file. What's the legal way to stream music online? It's really hard getting a definite answer on this so I'm going to ask it here. Is there a legal way to stream new music on a website without getting artist consent first. There seems to be a lot of popular sites like hotnewhiphop.com doing this that are hosting from both the US and Canada so I'm guessing there is a grey area that allows it. For the record I don't allow downloads of the music and simply stream each song in a player. Understanding the difference between two theorems related to $|G\,:\,K|=|H\,:\,K|\cdot|G\,:\,H|$. Given a compact set $K$ and closed set $E,$ prove: $E\cap K\neq \emptyset $ Let $K\subseteq \mathbb{R}^n$ be a compact set and $E\subseteq \mathbb{R}^n$ a closed set, such that: $$\inf\{d(x,y):x\in K, y\in E\}=0$$ where $d(x,y)=\sqrt{\sum_j(x_j-y_j)^2}$ Prove: $E\cap K\neq \emptyset $  I tried to work with the definitions of compact and closed sets, and I understand that from what's given of the distance between elements in $K$ and $E$, that they are very close,  but couldn't really get further. Any help appreciated. Which is correct: "what if there was" or "what if there were"? Possible Duplicate:          Is this correct grammar?     What if there was a Stack Overflow on…    Shouldn't it be "what if there were a Stack Overflow on…"? Lazy evaluation in C++ C++ does not have native support for lazy evaluation (as Haskell does).  I'm wondering if it is possible to implement lazy evaluation in C++ in a reasonable manner. If yes, how would you do it?  EDIT: I like Konrad Rudolph's answer.  I'm wondering if it's possible to implement it in a more generic fashion, for example by using a parametrized class lazy that essentially works for T the way matrix_add works for matrix.  Any operation on T would return lazy instead. The only problem is to store the arguments and operation code inside lazy itself. Can anyone see how to improve this? Future Simple and Future Perfect I've read  about Future Simple and Future Perfect, but I still can't understand the exact usage of these two tenses. Is there any diffrence between the following?     I will do my homework by 6 p.m.   I will have done my homework by 6 p.m.       I will do my homework after school   I will have done my homework after school   Also, I've checked the word 'by' in  and there're some confusing examples:       By the time (that) this letter reaches you I will have left the country.   Can I use 'By the time (that) this letter reaches you I will leave the country' instead? Assurance that ST_Envelope works with geography as expected Using PostGIS, I have a table of data with geographic points defined as last_known_coordinates GEOGRAPHY(POINT,4326). I want to find all of these within a geographic bounding box with given top left and bottom right geographic coordinates, and be sure that the calculations are geographic, not geometric, e.g. that the results account for the curvature of the earth. The query I'm using contains the fragment: last_known_coordinates &amp;&amp; ST_MakeEnvelope(?, ?, ?, ?, 4326)::geography As you can tell I'm a bit new to this, and I know what I want, but not necessarily how to do it correctly. Other answers hint that this is correct, but I'd like to know for sure: Will this point data and SQL fragment take into account the curvature of the Earth in the bounding box? if I write,  #!/bin/bash echo "foo"   or  #!/bin/sh echo "foo"   both yields same. I have seen some scripts starting with #!/bin/sh or #!/bin/bash. Is there any difference between them? What's the best way to use SOAP with Ruby? A client of mine has asked me to integrate a 3rd party API into their Rails app.  The only problem is that the API uses SOAP.  Ruby has basically dropped SOAP in favor of REST.  They provide a Java adapter that apparently works with the Java-Ruby bridge, but we'd like to keep it all in Ruby, if possible.  I looked into soap4r, but it seems to have a slightly bad reputation.  So what's the best way to integrate SOAP calls into a Rails app? Can you express $[0,1]$ as a countable disjoint union of closed sets, other than the trivial way of doing this? Prove that if $d$ divides $n$ then $φ(d)$ divide $φ(n)$ for $φ$ denotes Euler’s $φ$-function.  I know that $d|n$ mean there exists some integer $k$ such that $n=kd$, but how can I use this to prove $φ(d)$ divide $φ(n)$ I have keypair (u,r), and two pieces of data, X and Y.  I reveal X publicly but keep Y secret. Y has high entropy.  I then concatenate X and Y, into Z.  I encrypt Z, into "encrypt(Z,u) = Q". r is needed to decrypt Q back into Z.  Later, (when it doesn't matter), r will be revealed and everyone will decrypt Q into Z. At that point, everyone will know that, all along, Q "contained" X. Can I prove that Q contains X before r is revealed (including interactive zero-knowledge proofs)?