I have a string and I wrote following code to extract "NewUsers19" from that.    function getNoOfUsers() {    var noSpace = "UserRejectedOrderCount25NewUsers19FundedNewUsers14DepositAmount($)43165.23DepositCount75WithdrawAmount($)53510";   var regex = /(?:NewUsers)([0-9]+)/;   var value = regex.exec(noSpace);   return value;    }     The regex worked fine in online editors but I don't know why it does not work in Google App Script. Any help will be appreciated.
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.
Citing multiple authors with alternate separator than "and" using BibTeX I'm using LyX on Linux Mint 14 ...  Using BibTeX with the apalike style and some modifications in the preamble, I've managed to get the bibliography as it should be except for one thing. When I cite a work with multiple authors it gets printed with the separator "and" which isn't correct for my language (Danish). Curiously it's displayed correctly in the user interface of Lyx - for example "(Wittgenstein og Waismann 2003 - which led me to believe everything was ok but in the pdf the separator "and" is used both in the reference and in the bibliography.  Is there any way to fix this using BibTeX, or can it only be done with biber 1.5, as suggested in the last comment here:   I really hope their is because getting biber to work using the following guide has thus far proven to be impossible:   Help much appreciated ... I really hope I won't have to relapse into setting my master thesis up in LibreOffice. Was Luke aware the Emperor was a Sith Lord? Similar to , I'm asking the more specific question, was Luke aware that the Emperor was a Sith Lord? I don't recall it being mentioned in any of the films.  If yes, at what point does he learn this? If not why did Yoda or Obi-Wan not warn him?  Perhaps he could have avoided being defenseless and struck by Force Lightning if he'd been made aware? Do gravitational lenses work on gravitational waves? I am creating a query that finds the shortest path from dangerous crossing nodes to hospitals (many-to-many). I have the proper output from pgr_dijkstra, with output as follows  seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost  -----+----------+-----------+---------+------+------+------+----------    1 |        1 |         2 |       3 |    2 |    4 |    1 |        0    2 |        2 |         2 |       3 |    5 |    8 |    1 |        1    3 |        3 |         2 |       3 |    6 |    9 |    1 |        2    4 |        4 |         2 |       3 |    9 |   16 |    1 |        3    5 |        5 |         2 |       3 |    4 |    3 |    1 |        4    6 |        6 |         2 |       3 |    3 |   -1 |    0 |        5    7 |        1 |         2 |       5 |    2 |    4 |    1 |        0    8 |        2 |         2 |       5 |    5 |   -1 |    0 |        1   I am trying to use st_makeline to create seperate lines for each individual node path, however thus far the function has been creating one big line SELECT  st_transform(st_makeline(t1.the_geom),4326)         FROM pgr_dijkstra(                 'SELECT osm_id as id, source, target, cost FROM spatial.melbourne_edges',                 array(select hospital_id from hospitals_in_vicinity),                  array(select crossing_id from dangerous_crossing_nodes), false) as route                 inner join spatial.melbourne_nodes t1 on route.node = t1.id --);  How am i able to make a column of all the different paths? What is the differences between &> and 2>&1 There are two forms of redirection the standard output and standard error into standard output. But which one is better? and why the &amp;&gt; is considered the perfect?  I can't find what is the differences so that many tutorials and even bash manual state that  &amp;&gt; is better!   So Why shall I use &amp;&gt; and not 2&gt;&amp;1  Mainly using bash shell    EDIT: Thanks for commentors   Only >&amp; works in csh or tcsh  In ksh only 2>&amp;1 works.  dash use >file 2>&amp;1 redirection only  Then which one to use to ensure my script is compatible with other systems whatever the used shells are! .gitignore for Visual Studio Projects and Solutions $$\lim_{x\rightarrow 0}\frac{(1+x)^{1/x}-e+\frac{ex}{2}}{x^2}=\,?$$   by directly substituting $x=0$ i got $\infty$ by using L-H's rule, i got $-1/8$   the given options are  $a)\frac{24e}{11}$    $b)\frac{11e}{24}$    $c)\frac{e}{11}$    $d)\frac{e}{24}$    may be the question would be  $$\lim_{x\rightarrow 0}\frac{(1+x)^{1/x}-e+\frac{ex}{2}}{x^2}=\,?$$ How can I access google.com outside the US? I live in the UK, and whenever I visit google.com I am redirected to google.co.uk, but I want to see my website's rankings on the US version (I presume the results are different). Is there a way to do this? Prove $e^{x+y}=e^{x}e^{y}$ by using Exponential Series Does electricity flow on the surface of a wire or in the interior? When trying to add a bit more detail to a related , I realized I don't know how to specify which one of the available Bash word types to execute. According to help type there are five word types:   alias keyword function builtin file   It's possible for a word to have several types (true is just an example; a more commonly overridden word would be cd):  $ type -a true true is a shell builtin true is /bin/true   How do you force the execution of a specific synonym? So far, in order of precedence:   alias: This is a special case since it has precedence over all the other synonyms. Forcing this would only be useful when the command should fail if the alias is not defined.  $   keyword:  $   function:  $   builtin:  $ builtin true  file:  $ command true $ $(which true) $ /bin/true    :   Quoting a word excludes aliases and keywords. That is,  $ 'true'   will run only the function, builtin or file. How can I make a time delay in Python? I would like to know how to put a time delay in a Python script. I've just installed Ubuntu and I need either video, wireless, or some sort of other manufacturer (non-opensource) driver. How can I run the tool that will fetch all of these for me? I'd like graphical instructions.  Related: Fast way to copy a large file on a LAN I am having some trouble with NFS, and I'd like to try using just plain old TCP.  I have no idea where to begin, though.  Hardware-wise, I am using an ethernet crossover cable to network two netbooks.  To network them, I type  $ sudo ifconfig eth0 192.168.1.1 up &amp;&amp; ping -c 10 -s 10 192.168.1.2 &amp;&amp; sudo /etc/init.d/nfs-kernel-server start   on the first netbook and  $ sudo ifconfig eth0 192.168.1.2 up $ ping -c 10 -s 10 192.168.1.1 $ mount /mnt/network1   on the second  where /mnt/network1 is specified in /etc/fstab as  192.168.1.1:/home /mnt/network1 nfs noauto,user,exec,soft,nfsvers=2 0 0  as well as in /etc/exports (using the syntax of that file), on the first netbook.  The above works fine, but the files and directories are huge. The files average about half a gigabyte a piece, and the directories are all between 15 and 50 gigabytes.   I'm using rsync to transfer them, and the command (on 192.168.1.2) is  $ rsync -avxS /mnt/network1 ~/somedir   I'm not sure if there's a way to tweak my NFS settings to handle huge files better, but I'd like to see if running an rsync daemon over plain old TCP works better than rsync over NFS.  So, to reiterate, how do I set up a similar network with TCP?  UPDATE:  So, after a good at few hours of attempting to pull myself out of the morass of my own ignorance (or, as I like to think of it, to pull myself up by my own bootstraps) I came up with some useful facts.  But first of all, what led me on this rabbit trail instead of simply accepting the current best answer was this: nc is an unbelievably cool program that resolutely fails to work for me. I've tried the netcat-openbsd and netcat-traditional packages with no luck whatsoever.  The error I get on the receiving machine (192.168.1.2) is:  me@netbook:~$ nc -q 1 -l -p 32934 | tar xv Can't grab 0.0.0.0:32934 with bind tar: This does not look like a tar archive tar: Exiting with failure status due to previous errors   route gives:  me@netbook:~$ route Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface default         dir-615         0.0.0.0         UG    0      0        0 wlan0 link-local      *               255.255.0.0     U     1000   0        0 eth0 192.168.0.0     *               255.255.255.0   U     2      0        0 wlan0 192.168.1.0     *               255.255.255.0   U     0      0        0 eth0   But, here's the good news: having the static IP addresses set in /etc/network/interfaces, which I started doing while trying to get nc working, fixed all my NFS problems and rekindled my love for NFS.  The exact configuration I used (with 192.168.1.1 for the first netbook, of course) was:  auto eth0 iface eth0 inet static address 192.168.1.2 netmask 255.255.255.0   With those settings, the two netbooks will be able to ping each other directly after being booted up, without even an ifup.  Anyway, I'd still really like to see nc in action, so I'm hoping someone help me debug this process. Calculating Image boundary / footprint of satellite images using open source tools? Fixed Field of $\sigma, \tau$ Let $k$ be a field and let $K=k(x)$ be the rational function field in one variable over $k$. Let $\DeclareMathOperator{\aut}{Aut}\sigma, \tau \in \aut(K)$ s.t. $$\sigma\left(\frac {f(x)}{ g(x)}\right)=\frac {f(1/x)}{g(1/x)}\qquad \&amp;\qquad \tau\left(\frac {f(x)}{ g(x)}\right)=\frac {f(1-x)}{g(1-x)}.$$ Find the fixed field $F$ of $&lt;\sigma, \tau&gt;$. Determine $\DeclareMathOperator{\gal}{Gal}\gal(k/F)$. Find an $h \in F$ so that $F=k(h)$.   Now for the first automorphism $\sigma$, I think if I concentrate on $k[x]$ it will give me some idea. Now, if $f(x)=a_0+a_1x+a_2x^2+ \cdots + a_nx^n \in k[x]$ then if $x^n \sigma(f(x))=f(x)$ the case will be $a_i=a_{n-i}$ $\forall i=0(1)[n/2]$. So all the funtions in $K$ which will be fixed by $\sigma$ are of the form $\frac {f(x)}{ g(x)}$ where $f(x)=a_0+a_1x+a_2x^2+ \cdots + a_nx^n$ and $g(x)=b_0+b_1x+b_2x^2+ \cdots + b_nx^n$ such that $a_i=a_{n-i}$ $\forall i=0(1)[n/2]$ and $b_i=b_{n-i}$ $\forall i=0(1)[n/2]$.   Please check whether am I right or not?  And any ideas for the rest of the part? My book tells me that of the solutions to the Lagrange system, the smallest is the minimum of the function given the constraint and the largest is the maximum given that one actually exists.  But what if we only have one point as a solution? How to know whether Lagrange multipliers gives maximum or minimum? Time traveler asks archaeologist for help in transporting a girl from dinosaur Earth to present day Many decades ago, I read a short story about a time traveler who asks an archaeologist for help.  He convinces the archaeologist that he can time travel by bringing him back a freshly killed dinosaur (small one.)  The time traveler needs help because when traveling back in time to the age of the dinosaurs he met a girl and wants to transport her back to the present.  However only one person can travel in time at a time so he needs the archaeologist at the other end to wait for the girl.  The archaeologist agrees to help.  Unfortunately after the traveler goes back he and the girl find themselves in the middle of a battle between aliens on Earth.  They are chased by a dinosaur and never make it back to the present.  The archaeologist meanwhile is digging for evidence that the traveler went back in time and the story or my recollection of it ends with that. Does addition imply an order? Consider any integer, suppose a number 3. We can break any such integer down into a sequence of 1's. So, we can write: $$ 3\equiv1+1+1 $$ 3 represents what we get when we add 1 to 1 to another 1. Conceptually, what I am getting confused with, is the fact that notionally, at least according to this definition, there is one unit at the beginning, to which we add another, and yet a third. There seems to be a sequence here, which would imply there being an order. Am I missing something obvious? Is there a design pattern for dropdown lists in iOS?