I'm getting Property 'groups' does not exist on type 'RegExpExecArray' when trying  const r = /\w+, (?&lt;foo&gt;\w+)/ const m = r.exec('hello, world')  if (m) {     const groups = m.groups }   Javascript has an option to call .groups on a regex exec result. And I know the output is actually an array... but grabbing a specific index to get the groups seems a bit hacky. Is pulling from the list the only option in Typescript?
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.
How to get Intel Dual Band Wireless-AC 3168 work on Ubuntu 16.04? A reward becomes a penalty if I am working to build a reinforcement agent with DQN. The agent would be able to place buy and sell orders for a day trading purpose. I am facing a little problem with that project. The question is "how to tell the agent to maximize the profit and avoid the transaction where the profit is less than 100$".  I want to maximize the profit inside a trading day and avoid to place the pair (limit buy order, limit sell order) if the profit on that transaction is less than 100$. The idea here is to avoid the little noisy movements. Instead, I prefer long beautiful profitable movements. Be aware that I thought using the "Profit &amp; Loss" as the reward.  "I want the minimal profit per transaction to be 100$" ==> It seems this is not something that is enforceable. I can train the agent to maximize profit per transaction, but how that profit is cannot be ensured.  At the beginning, I wanted to tell the agent, if the profit of a transaction is 50 dollars, I will remove 100 dollars, then It becomes a penalty of 50 dollars for the agent. I thought it was a great way to tell the agent to not place a limit buy order if you are not sure it will give us a minimal profit of 100$. It seems that all I would be doing there is simply shifting the value of the reward. The agent only cares about maximizing the sum of rewards and not taking care of individual transactions.   How to tell the agent to maximize the profit and avoid the transaction where the profit is less than 100$? With that strategy, what guarantee that the agent will never make a buy/sell decision that results in less than 100 dollars profit? Does the sum of reward - # transaction * 100 can be a solution? Where do I find the maximum node? A lot of people recommend to use the maximum node for glass setup, but I can't find that node. Nothing comes up when I search for it.  Where do I find it? I know of 2 basic kinds of default web icons for websites:   : place an .ico formatted file at the root of your site named favicon.ico and most desktop browsers will find it and display it in various contexts (bookmarks, tabs). Can also be added in code, which allows you to specify other names and other graphics types to the file, though there are :  &lt;link rel="shortcut icon" href="/favicon.ico" /&gt; &lt;link rel="icon" href="/favicon.ico" /&gt;  : place a png formatted file called either apple-touch-icon.png or apple-touch-icon-precomposed.png at the root of your site and iPhone OS/iOS versions of Safari will pick those up and store them when the site is added to the Home Screen. Can also be added with code like:  &lt;link rel="apple-touch-icon" href="/custom_icon.png" /&gt;    Are there any other default icon graphics for a website a webmaster can include? If $E$ has measure zero, then does $E^2$ have measure zero? Currently I'm just working through measure theory just to see if its something I would like to take.  Unfortunately I am stuck on this problem from Carothers.     If $m^*(E)=0$, then $m^*(E^2)=0$.   Where $m^*$ denotes outer measure and $$E^2=\{x^2:x\in E\}.$$  I toyed with the idea that $I_k &lt; 1 \Rightarrow I^2_k &lt; I_k$.  However I am at a loss as to how to set up a chain of inequalities (which is what I am assuming I need). When / how should I ask about a manuscript's status in review? Shortcut for toggling between different windows of same app? I opened two Google Chrome windows (because I am using multiple Gmails) and when I do the Cmd ⌘ Tab ⇥ shortcut it just shows me other applications that I opened but does not show me the other Chrome windows that are already opened.  How to switch to the other Google Chrome window that I opened using keyboard shortcut? I know that any group satisfying $x^2=1$ for all $x$ is abelian. Is the same true if $x^3=1$? I don't think it is, but I can't find a basic counterexample. Let $A$ be a ring that is not a field and $M$, $N$ modules over $A$. What conditions on $M,N$ (and maybe also on $A$) guarantee that $\operatorname{Hom}_A(M,N)$ is finitely generated? Is it enough to assume $M,N$ finitely generated? Native Youtube app suddenly stopped working on iPad 1 It's been some weeks now, whenever I try to used my Youtube app, it tells me it's impossible to connect to Youtube. Since it's an iPad 1, I have had trouble finding information online.  Did Google or Apple stop supporting the app? Is it finally obsolete? Is there another app I could use that works on iOS 5?  Just to be clear, I did not tinker with my device. I did not change its parameters, I did not jailbreak it, it connects to the Internet just fine and I've tried the app on different Internet connections. Also, this is not a login problem, the app just refuses to let me browse videos, whether I'm logged in or not.  Thanks for your help. My ubuntu partition was deleted and I can't boot from either a DVD or USB Is the word "data" now considered singular? If so, what about "datum"? How do I change which audio jacks are used for input and output? I'm using a Realtek HD audio card built-in my motherboard. The Windows driver comes with a control panel that allows me to select which back panel jacks are used for what. So for example I can make both the blue jack and green jack for output and only the red one for mic-in. (Whereas by default, the blue jack is for line in, which I never need.)  How can I do the same under Linux? If possible, please don't suggest something that involves PulseAudio or JACK; I'd like to do it the plain way, e.g. by editing ALSA configuration files, if possible. The way I understand it, my problem should have nothing to do with software servers redirecting streams, just instructing the driver to treat this jack as so and so because it's hardware supported.  Thank you very much! Kind of converse of Kolmogorov maximal inequality Let $S_n=\zeta_1+...+\zeta_n$ where $\zeta_i$ are independent with $E\zeta_i=0, E\zeta_i^2=\sigma_i^2&lt;\infty, |\zeta_i|&lt;K$.  Then, $P(\max_{1 \leq m  \leq n}|S_m| \leq x) \leq (x+K)^2/\operatorname{var}(S_n)$.  How do we show this?  The hint says that I should use the fact that $S_n^2-\sum_{m \leq n}\sigma_m^2$ is a martingale. But I am totally clueless....  Any hint would be appreciated! Thanks and regards. When I measure a 9V DC wall adapter power supply with a multimeter it shows 11.8V. When connected to my board this voltage lowers to 10V. Is this normal? Should I be afraid of toasting my  supplied board when using this adapter?  Edit: This regulator accepts up to 12V inputs. So that will be no problem. A second "9V" adapter yields 15V to the multimeter. Will this one burn my circuit? Regression with only categorical variables How to convert Strings to and from UTF8 byte arrays in Java In Java, I have a String and I want to encode it as a byte array (in UTF8, or some other encoding). Alternately, I have a byte array (in some known encoding) and I want to convert it into a Java String. How do I do these conversions? How to make a Rigid Body fall off a conveyor belt? I've created conveyor belt and and two objects with rigid body physics. But the first object won't fall and second object falls backwards.  How can I fix it? El Capitan froze and rebooted (Macbook Pro Retina Mid 2012) 2.3 Ghz Intel Core i7 8GB DDR3: Was running NetAdmin Pro which is monitoring  my office LAN, processors consumption was at  ~15 - 20%. Simultaneously I ran WiFI Explorer,  3.7% no more than 5% CPU usage. And I was  updating Xcode to v 7.3.1 and was browsing and  watching video from playground.ru Watch the videos until half of it (20mins) the Video froze I moved the mouse and turned out  the whole OSX is frozen. littleSnitch v 3.7 has no reaction I immediately pull the Ethernet adaptor and  MacBook just went to black screen. I then  switch off the wireless router. (My MacBook Pro  is connected to the network via Ethernet  adaptor and via WiFi router bearing different IP, I was thinking of cutting both network  communication, in case it was an intrusion) MacBook just restarted itself to login screen,  after 15-20 sec of black screen and total  silence) I again restarted and booted into Recovery  mode use disk utility. After completing disk  check. Login and previously opened programs resume  back (NetAdmin Pro, WiFi Explorer, Yandex  browser, Activity Monitor and AppStore) AppStore doesn't resume the download  everything else is functioning normally and in Addition I have got my calendar open after login (I did not launch accidental nor was it set to  start with system login)   Question 1: Are there any way to know what was happening and what was OS El Capitan last reaction before it froze and rebooted?  Question 2: Are there any software better than "Console" v10.11 to interpret what was going on before it crashes?  P.S. Thank you in advance, I will try to upload the Console messages later from the MacBook Pro    DDT-2:~ Chaleune$ syslog | grep -i "shutdown cause"  Jun 22 14:15:37 DDT-2 kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 22 20:34:46 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 23 15:18:23 DDT-2 kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 24 17:58:32 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 24 20:09:52 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 24 22:58:15 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5Jun 25 14:43:36 DDT-2 kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 25 21:55:31 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: 3  Jun 25 22:20:57 localhost kernel[0] &lt;Notice&gt;: Kext com.apple.driver.AppleOSXWatchdog failed to load (0xdc008012).Previous shutdown cause: 5  Jun 26 10:18:44 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 26 12:09:45 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 26 18:00:31 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 27 13:05:58 DDT-2 kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 27 22:56:11 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  Jun 28 14:18:27 DDT-2 kernel[0] &lt;Notice&gt;: Previous shutdown cause: 5  *Jun 29 18:56:21 localhost kernel[0] &lt;Notice&gt;: Previous shutdown cause: -128*  Jun 29 23:31:22 DDT-2 kernel[0] &lt;Notice&gt;: Previous shutdown cause: -128      shows the following   dsIllInstErr                  = 3,    /illegal instruction error/ dsChkErr                      = 5,    /check trap error/ userCanceledErr               = -128    gave the following interpretation:   03 Illegal Instruction The computer has a specific vocabulary of machine language instructions it can understand. If a computer tries to execute an instruction that isn't in its vocabulary, you see this error code. It's less likely than error 02, but still very common. 05 Range Check Error Programmers can use an instruction in the Motorola 68000 to check if a number is within a certain range. This error indicates that the number tested isn't in the specified range. -128  userCanceledErr         User canceled an operation The interaction of TeX and Lua can be quite delicate at times.  While the former has category codes and tokens, the latter has escape sequences and datatypes.  Mixing the disparate concepts of these two worlds can lead to unexpected behaviour which favours common errors, known as gotchas. In the community wiki answer below you can find an overview of the common mistakes that people make when getting to grips with LuaTeX.