I've been struggling for two days to get this to work, but I just can't (I'm terrible at regular expressions :S).  ${test}[arg]   From this text, I need to retrieve two different things: test and arg. To do it, I have created this regex:   (\$\{(\b[a-zA-Z0-9.]+\b)\})(\[(.+)\])?   With that example, it works. However, if I try this other text: ${test}[arg1] - ${test2}[arg2], I just get one match with 2 groups: test and arg1] - ${test2}[arg2, instead of getting 2 different matches: one with groups test and arg1, and the other with groups test2 and arg2.  I hope you can help me out.  Thanks in advance.
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?
Is it possible to set a CNAME record at the top of a domain? (i.e. @ CNAME www, @ CNAME foobar.com., etc.)  My ISP says that it's only possible to use CNAME's for subdomains but I've read somewhere else that is should be possible even if not recommended. I have a problem , i can't open synaptic >:(  root@dopeboy:~# synaptic No protocol specified ** (synaptic:6940): WARNING **: Could not open X display No protocol specified (synaptic:6940): Gtk-WARNING **: cannot open display: :1   I have try to Re-install it but is not working, any idea how to fix?! VPS Ubuntu 14.04 LTS. Fatal error occurred, no output PDF file produced in php file We are using following code in .php script for generate .pdf file.  $result1 = exec("R CMD Sweave /var/www/html/r/r_latex_sweave.Rnw");  $result2 = exec("pdflatex /var/www/html/r/r_latex_sweave.tex");   but, we are getting this errors when we are executing .Rnw and .tex files.  ! I can't write on file `r_latex_sweave.log'. Please type another transcript file name:  ! Emergency stop !  ==> Fatal error occurred, no output PDF file produced!  Note: We have .tex and .Rnw folder in /var/www/html folder? I am a little bit confused by early stopping and in particular by how it can be inserted inside a CV framework. As far as I understand, I can fix the optimal number of epochs (for NN, or number of trees for XGB) by early stopping, that is:   pick a validation set, train with increasing number of epochs until a predefined metric evaluated on the validation set starts worsening that is the optimal number of epochs to prevent overfitting   and that's fine. But then I would like to insert this early stopping framework inside a CV framework: Suppose I have a model with 10 hyperparameters I want to fix via CV. And suppose that there is an eleventh hyperparameter, the number of epochs. My feeling is that one can do like this:   create the K resampled folds, for each of which you have a training and validation set choose a suitable grid for your 10 hyperparameters for each point on the grid train your model in each fold with early stopping, that is use the validation set of the fold to keep track of the preferred metric and stop when it gets worse take the mean of the K validation metric choose the point of the grid (i.e. the set of hyperparameters) that gives the best metric   Questions:   What number of epochs should I choose as optimal? in each of the K folds I have, in general, a different number of stopping epochs.  seems to suggest they take the mean of the K stopping epochs. Is this right? Is it actually a "fair" practice to use the validation metric coming from the early stopping as a proxy of the out-of-sample metric? As  in section 3.4.5, maybe the best thing to do would be:     ...if you want to do early stopping, then in each fold you should take your training set and split it again, holding out a small early-stopping-set to guide the early stopping, and then evaluate the model on the validation set of that fold.   But this seems to me a really intricate process...   Unfortunately, I wasn't able to find references where this issue is presented in a clear and transparent form. Python program to calculate harmonic series Does anyone know how to write a program in Python that will calculate the addition of the harmonic series. i.e. 1 + 1/2 +1/3 +1/4... How does polynomial long division work? $\bigcup \emptyset$ is defined but $\bigcap \emptyset$ is not. Why? Why does $\bigcup \emptyset = \emptyset$ but $\bigcap \emptyset$ is not defined?    If I had to guess, I'd say it's also equal to $\emptyset$. When dragging an object, there is a greater start-up force than the force it takes to keep it moving. Why is this? Why are there two different values for friction? Node.JS Not working on the internet GCD in a PID persists in extension domains Let $R$ be subring of integral domain $S.$ Suppose $R$ is $\text{PID}.$ Let $a\in R$ be a greatest common divisor of $r_1,r_2$ in $R$. ($r_1,r_2 \in R$, not both zero). Could anyone advise me on how to prove $a$ is greatest common divisor of $r_1,r_2$ in $S?$   Hints will suffice, thank you. $\exp(A)$ is orthogonal iff $A$ is skew symmetric Let $A \in M_n(\mathbb R)$ and $\exp(A)=\sum_{i=0}^{\infty}\frac{A^i}{i!}$. How to prove $\exp(A)$ is an orthogonal matrix iff $A^t=-A$?  I can get that $\exp(A)$ is an orthogonal matrix iff $\exp(A^t)=\exp(-A)$, but how to get $A^t=-A$ from it?  What's more, is $\exp(A)$ injective or not? Schengen visa application rejected because my US visa stamp expires in December. What are my options? I went to the Italian consulate in Washington, DC today and they would not accept my visa application because they said my US visa stamp cannot expire less than 3 months after the end of my trip to Italy. Here's my relevant visa and trip info:   US visa stamp expires on 16 Dec 2015 I-797 valid until 3 Mar 2017 Trip to Italy is from 15 Oct to 25 Oct 2015   Is it true that my visa stamp needs to be valid for 3 months after my trip, even though I can legally stay in the US until 2017? Does anyone have any suggestions for getting a Schengen visa in my situation? Design simulates perfectly but won't work on FPGA Sending & Receiving SMS via WiFi Is there a way to send and receive SMS when a cellular signal is not available, but WiFi is?  I'm often on-site at locations where the building has a strong WiFi (Internet) connection, but a simple cell signal is spotty at best. Induction Proof: Fibonacci Numbers Identity with Sum of Two Squares Java: split a List into two sub-Lists? Why my U.S. B1 Visa got refused under 214 (b)? Do proposals on Area 51 expire? Is there any kind of time frame in which new proposals are expected to attain the requisite number of followers to move to the next phase?  I can see where if it takes a year to gather enough followers to take the proposal to beta then maybe the proposal can come into question, but I can also see where others might take longer.  Or is the thought to go ahead and let it take as long as it takes and then it'll all get sorted out during the beta period? What to do when witches appear early in the game? A long time ago I played an older version of Minecraft. Back then witches didn't spawn naturally, so you couldn't find them unless you found a hut. Now I'm playing again, but sometimes when I go down a cave I find one or two witches, and it's really hard to find them back.   So, what is the best you can do to kill witches, specially when two spawn at the same time and you don't have milk? When using unicode-math, how do I get the original calligraphic alphabet back? I am happy with the great majority of what unicode-math does. But at times I find that I prefer a symbol the way it was before. With \varnothing and \complement, for example. In those cases I was able to save them under a different name before loading unicode-math, but this doesn't always work.  Right now I'm trying to access the \mathcal alphabet from plain LaTeX. How might I accomplish this?    Additional Question  I've been looking through unicode-math, trying to figure out where exactly the original \mathcal alphabet gets discarded, but I eventually gave up.  It would be interesting if someone could explain:   how/where the original \mathcal font is defined anyway, and what kind of 'switch' is thrown by unicode-math that makes it unavailable.