Again, I have no idea what is going wrong here. I tried debugging but it just returns false no matter what I do. It is supposed to check for a number in the input string, then check if that number is greater than the input variable A and less than the input variable B. function ageCheck(string, a, b) {     const found = string.match(/\d{2,3}/gm)     let containsNumber = false     for (let i = 0; i &lt; found.length; i++) {         const number = parseInt(found[i])         if (number &gt; a &amp;&amp; number &lt; b) {             let containsNumber = true         }     }     return containsNumber }
What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?
Meaning of a set in the exponent Let $ D = 2^\mathbb{N} $, i.e., D is the set of all sets of natural numbers.   What's the meaning of this definition? Intuitively, I would suggest that $ D = \{1,2,4,...\} $ but the explanation "set of all sets" leads me to the guess that this is wrong. I am trying to auto-mount my NFS drives, but it doesn't work too well sadly.  What does work is mounting from CLI:  me@client:/$ sudo mount 192.168.178.4:/mountdir /mnt/mountdir me@client:/$ mount -t nfs 192.168.178.4:/mountdir on /mnt/mountdir type nfs (rw,addr=192.168.178.4)   when I try to add mountdir in the fstab, I cannot mount it due to "protocol not supported" (which seems strange as I can mount it)  $ sudo mount films_d3 mount.nfs: Protocol not supported   So there might be something wrong with my fstab entry. This is my current entry:  192.168.178.4:/mountdir /mnt/mountdir  nfs auto,_netdev,noatime,nolock,bg,nfsvers=4,intr,tcp,actimeo=1800 0 0   During startup I also get this error twice: I was trying to fix the mount-from-fstab first, then worry about that, but nevertheless this might be a different problem:  init: idmapd-mounting (/mnt/kazemat/films_d3) main process (445) killed by TERM signal   This seems to be before the eth0 is initialised, while I thought the "_netdev" option would make the entry wait for the network to be up?  can anywone see the mistake in my fstab entry? Is it possible to "hack" a MacBook so as to be able to install macOS Mojave? C# 4.0 optional out/ref arguments If I solve someones problem instead of answering their question, should I post a comment instead? My understanding is that a question is historically locked because the information in it is too valuable for the question to be deleted.   But if the "valuable information" becomes obsolete, what happens then?  We cannot modify the question content, or the answers for a historically locked question, right? With \setbeamercovered{transparent} covered parts of a slide are displayed transparently. If there is a (small) picture among the text, it is shown as it is. Beamer has only this picture, so it shows this picture. My question: How can I give a gray version of the picture to beamer such that in covered parts of a slide, this gray version is used? What is syntax highlighting and how does it work? I noticed that sometimes my code gets highlighted in different colors when rendered.   What is syntax highlighting? How does it work? Why isn't my code being highlighted correctly? How do I report a bug or request a new language? How do I use syntax highlighting? What languages are currently available on Stack Exchange? Which facility upgrade unlocks maneuver nodes in KSP Why won't my villagers breed I have created the following structure. The intention is to create fairly compact houses for villager breeding.   This is a section of the houses.   I have 2 of these structures, which would resolve to 28 doors and 4 other types of houses meaning I have 32 houses in total. healed healed 3 villager zombies and locked them inside a small house. One of them sometimes shows hearts, but they won't breed.   I am playing vanilla Minecraft 1.8. The doors are spruce.  What is wrong with these houses? Is there something wrong with spruce doors or half slab roofs? Are there attacks that break collision resistance but not preimage resistance? How are reviews assigned? Is there any way to save the order of spaces in Mission Control? Background I'm working on a time series data set of energy meter readings. The length of the series varies by meter - for some I have several years, others only a few months, etc. Many display significant seasonality, and often multiple layers - within the day, week, or year. One of the things I've been working on is clustering of these time series. My work is academic for the moment, and while I'm doing other analysis of the data as well, I have a specific goal to carry out some clustering. I did some initial work where I calculated various features (percentage used on weekends vs. weekday, percentage used in different time blocks, etc.). I then moved on to looking at using Dynamic Time Warping (DTW) to obtain the distance between different series, and clustering based on the difference values, and I've found several papers related to this. Question Will the seasonality in a specific series changing cause my clustering to be incorrect? And if so, how do I deal with it? My concern is that the distances obtained by DTW could be misleading in the cases where the pattern in a time series has changed. This could lead to incorrect clustering. In case the above is unclear, consider these examples: Example 1 A meter has low readings from midnight until 8AM, the readings then increase sharply for the next hour and stay high from 9AM until 5PM, then decrease sharply over the next hour and then stay low from 6PM until midnight. The meter continues this pattern consistently every day for several months, but then changes to a pattern where readings simply stay at a consistent level throughout the day. Example 2 A meter shows approximately the same amount of energy being consumed each month. After several years, it changes to a pattern where energy usage is higher during the summer months before returning to the usual amount. Possible Directions  I've wondered whether I can continue to compare whole time series, but split them and consider them as a separate series if the pattern changes considerably. However, to do this I'd need to be able to detect such changes. Also, I just don't know if this is a suitable way or working with the data. I've also considered splitting the data and considering it as many separate time series. For instance, I could consider every day/meter combination as a separate series. However, I'd then need to do similarly if I wanted to consider the weekly/monthly/yearly patterns. I think this would work, but it's potentially quite onerous and I'd hate to go down this path if there's a better way that I'm missing.  Further Notes These are things that have come up in comments, or things I've thought of due to comments, which might be relevant. I'm putting them here so people don't have to read through everything to get relevant information.  I'm working in Python, but have rpy for those places where R is more suitable. I'm not necessarily looking for a Python answer though - if someone has a practical answer of what should be done I'm happy to figure out implementation details myself. I have a lot of working &quot;rough draft&quot; code - I've done some DTW runs, I've done a couple of different types of clustering, etc. I think I largely understand the direction I'm taking, and what I'm really looking for is related to how I process my data before finding distances, running clustering, etc. Given this, I suspect the answer would be the same whether the distances between series are calculated via DTW or a simpler Euclidean Distance (ED). I have found these papers especially informative on time series and DTW and they may be helpful if some background is needed to the topic area: Is it possible to create individual power settings for each hard drive? I have a number of different drives that I use for different purposes but I only use two of them frequently. I would like for the others to enter sleep mode when not in use, but never my main two.  Is there any way to edit power saving settings for individual drives? Does the order of declaration matter in Java/C#? I've tried to setup an autologin, but that isn't possible, because my home is encrypted. What are the reasons for this?  PS. Here I have described my problem: . There are often situations where buying two separate one-way tickets from A to C via B is cheaper than buying a normal multi-leg ticket. This can be especially useful with airlines such as Ryanair, which specifically avoids selling multi-leg tickets.  Is there a search engine which allows one to search for such flights? I will be attending a summer school which will last 10 days.  I want to know: for applying for a Schengen visa, is the purpose of my trip considered as touristic or study? How did Harry's blood being inside Voldemort save him? There are, of course, an incredible amount of theories on how Harry Potter survived. Problem is that the most important one, the one that is canon, is the one I don't get: how Harry's blood inside Voldemort saves him?  Because all that I have read so far, leaves me with questions. I understand why Voldemort wanted Harry's blood, but why does it save Harry? Why is that necessary to keep the sacrifice alive, while it's still inside Harry? And if Harry lost it at 17 (I have seen some different ideas on this as well), why does Voldemort still have it at 69 (give or take a few)?  To clafiry, the parts I'm talking about:     "For a fleeting instant, Harry thought he saw a gleam of something like triumph in Dumbledore's eyes"    (GoF, right after Harry tells Dumbledore that his blood now goes through Voldemort.)  And:     "He took your blood believing it would strengthen him. He took into his body a tiny part of the enchantment your mother laid upon you when she died for you. His body keeps her sacrifice alive, and while that enchantment survives, so do you"   (Albus Dumbledore in DH)  I just don't get why the blood transfusion thing suddenly gave Harry the chance to survive the whole thing, and it's never really been satisfyingly answered, not to my knowledge at least, as every answer I've read raises more questions.