This piece of code    String Str = new String("${project_loc:A}/Foo.yaml;${project_loc:B}/Bar.yaml"); System.out.println(Str.replaceFirst("[$][{].*[}]/", ""));   prints   Bar.yaml   while what I am trying to achieve is:  Foo.yaml;${project_loc:B}/Bar.yaml   Why is it stopping at second closing braces i.e. }, not at first?   What regex exp can be passed to replaceFirst() to achieve the desired result?  FYI: I tried few things at  but couldn't find any success.
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}?
From the pmset man page:     POWER SOURCE ARGUMENTS      -g with a 'batt' or 'ps' argument will show the state of all attached power sources.      […] Certain Apple battery calibration tools may temporarily disable   battery charging, even though your Apple portable is plugged into AC   power.      Such tools will never surprise you with this behavior; you will know   it's happening. This state will be reflected in an additional line of   output to 'batt' or 'ps' readings, including the pid of the app   inducing this behavior.       'ChargeInhibit':    1432    So, does any piece of publicly available software exist to force the battery not to charge? I'm desperatly confused by notations and formulations so if someone could clarify the following things a little Í would be deeply grateful. The Lie algebra $\mathfrak{so}(1,3)_+^{\uparrow}$ of the proper orthochronous Lorentz group $SO(1,3)_+^{\uparrow}$ is given by \begin{equation} [J_i,J_j]=i \epsilon_{ijk} J_k \end{equation} \begin{equation} [J_i,K_j]=i \epsilon_{ijk} K_k \end{equation} \begin{equation} [K_i,K_j]=- i \epsilon_{ijk} J_k \end{equation} We can now define new generators with the old ones $N^{\pm}_i= \frac{1}{2}(J_i \pm i K_i)$ which satisfy \begin{equation} [N^{+}_i,N^{+}_j] = i \epsilon_{ijk} N^{+}_k ,\end{equation} \begin{equation} [N^{-}_i,N^{-}_j] = i \epsilon_{ijk} N^{-}_k ,\end{equation} \begin{equation} [N^{+}_i,N^{-}_j] = 0. \end{equation} where we can see that $N^{+}_i$ and $N^{-}_i$ make up a copy of the Lie algebra $\mathfrak{su}(2)$ each. My problem is to get what is going one here mathematically precise. Are the following statements correct and if not why:  When we build the new operators from the old generators we complexified $\mathfrak{so}(1,3)_+^{\uparrow}$ \begin{equation}(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} = \mathfrak{so}(1,3)_+^{\uparrow}\otimes \mathbb{C} \end{equation} We saw that $\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C}$ is isomorph to two copies of the complexified Lie algebra of $\mathfrak{su(2)}$: $(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} \simeq \mathfrak{su(2)}_{\mathbb{C}} \oplus \mathfrak{su(2)}_{\mathbb{C}} $. Where exactly did we need that $\mathfrak{su(2)}$ is complexified here? The Lie algebras defined by $N^{\pm}_i$ are exactly those of $\mathfrak{su(2)}$ and we never use complex linear combination of $N^{\pm}_i$ or am I wrong here? $\mathfrak{su(2)}_{\mathbb{C}}$ is isomorph to $(\mathfrak{sl}(2,\mathbb{C}))_\mathbb{C}$: \begin{equation}\mathfrak{su(2)}_{\mathbb{C}} \simeq (\mathfrak{sl}(2,\mathbb{C}))_\mathbb{C} \end{equation} Here $(\mathfrak{sl}(2, \mathbb{C}))_\mathbb{C}$ denotes the complexified Lie algebra of $SL(2,\mathbb{C})$ Is $(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} \simeq (\mathfrak{sl}(2, \mathbb{C}))_\mathbb{R}$ correct?  Here $(\mathfrak{sl}(2, \mathbb{C}))_\mathbb{R}$ denotes the real Lie algebra of $SL(2,\mathbb{C})$ Is $(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} \simeq (\mathfrak{sl}(2, \mathbb{C}))_\mathbb{C} \oplus (\mathfrak{sl}(2, \mathbb{C}))_\mathbb{C}$ correct?  I looked this topic up in different books and each seemed to state something different. One book even used three differrent versions of $\mathfrak{sl}(2,\mathbb{C}) $ namely: $\mathfrak{sl}(2,\mathbb{C}) $, $(\mathfrak{sl}(2,\mathbb{C}))_\mathbb{C}$ and $(\mathfrak{sl}(2,\mathbb{C}))_\mathbb{R}$.  states simply that $\mathfrak{sl}(2,\mathbb{C}) $ is the complexification of $\mathfrak{su(2)}$ without making any reference to $SL(2,\mathbb{C})$ which does not help me either. Any help would be great. How to run Windows 10 from an external hard drive? I am currently able to boot from an external drive or multiboot USB. Taking this concept one step further, I have 3 questions:   1) Is it possible to install and run Windows 10 on a portable external hard drive or USB card with the same functionality of being installed on the internal drive?   2) Is it considered legal to do so or will it affect Windows updates in any way?   3) What are the steps to do that? (please outline steps I can follow so I don't lose a drive in the process). :)  EDIT: My question deals specifically with Windows 10, the legality and method of making it a standalone OS running from an external device and what effect if any it has on Windows Update; questions not dealt with in the other question. Converting GeoPDF to vector format like CAD or shapefile? I want to convert a GeoPDF that has vectors entity in it to a vector format and preserve the real coordinates of these vectors. The GeoPDF has been exported from ArcMap and has layers in it.  I have try GDAL, but it rasterize the PDF before exporting it. Which is not good for me. Also I don't want a solution that would convert this image back to vectors, too complicated for the data I have.  Is someone aware of any tool that can do that? The resulting format can be a CAD file or a shapefile or anything that is a vector format. Time reversal symmetry and T^2 = -1 How can I find the points at which two circles intersect? Given the radius and $x,y$ coordinates of the center point of two circles how can I calculate their points of intersection if they have any? Custom attributes - Yea or nay? When customers buy things from a store, you say:  (1) Customers give ABC Store business.  If I "turn this around", can I say:  (2) ABC Store obtains or acquires business from its customers.  Do these verbs work in (2)? iPhone App CrashReport I have a file, which was encrypted with AES-128 in ECB mode. I know the format of the original file and know that all files in this format have the same headers. So, I have an encrypted block and the original block.  Can I get the encryption key, using this information? Dimensions of Scale (Gamma) and Offset (Beta) in Batch Norm While implementing Batch Normalization for a particular layer 'L' with 'n' hidden neurons/units in a Neural Network, we first normalize the Activation values of that layer using their respective Mean and Standard Deviation, and then apply the Scaling and Offset factor as shown:     X-norm = (X - mu)/sd X' = (Y * X-norm) + B       where    mu = mean of X and it is a (n,1) vector          sd = standard deviation of X and it is also a (n,1) vector         X = Activation values of layer 'L' with dimension (n,m) if mini-batch    size = m   X-norm = normalized X with dimension (n,m)   Y = Gamma / Scaling factor   B = Beta / Offset factor   Now my question is, what are the dimensions of Gamma and Beta ? Are they (n,1) vectors or are they (n,m) matrices ? My intuition says that since they somewhat are analogous to the Mean and Standard Deviation, they should be (n,1) vectors. Image uploads from the editor strip preceding line breaks Recently, using the image uploader in the post editor has starting stripping preceding line breaks; placing the image directly after any previous text instead of at the current cursor position. This means that the inserted image is placed inline as part of the previous line of text rather than in a new paragraph as it did previously...  Before inserting the image (note the cursor position):        After inserting the image:        This also happens after the Markdown for a horizontal rule, which destroys the rule and gives us a bunch of hyphens followed by an image instead:        Seems the behaviour is a bit inconsistent... Sometimes I get the behaviour shown above and sometimes it leaves a single newline, I'm not sure when or why but single line breaks are ignored in Markdown so the rendered result is the same regardless.  Obviously it's useful to be able to have inline images, but I'm pretty certain most images aren't intended to (and shouldn't) be. Image upload from photo gallery So this is pretty obvious. Image upload?    How about allowing to attach images in questions from the photo gallery, by perhaps sending the image for off-site storage like done from the full-web version? How can I withdraw a publication from a predatory (fake) journal and resubmit to a legitimate journal? I have published a paper in a fake journal. I want to withdraw the paper from that journal.   After successful withdrawal from the fake journal, can I can submit the same paper to a legitimate journal? Name of component on output side cable of a DC power adapter? Expected Value of Normal CDF I am trying to calculate the expected value of a Normal CDF, but I have gotten stuck. I want to find the expected value of $\Phi( \frac{a-bX}{c} )$ where $X$ is distributed as $\mathcal{N}(0,1)$ and $\Phi$ is the standard normal CDF.  I know I can transform $\frac{a-bX}{c}$ to be a normal random variable $\mathcal{N}\left(\frac{a}{c},\frac{b^2}{c^2}\right)$ where $\frac{b^2}{c^2}$ is the variance of the normal random variable. I'm not sure if this helps though.  I think that the expected value of a CDF is $0.5$ but since $\Phi$ is the CDF of a standard normal CDF and $\frac{a-bX}{c}$ is not standard normal I do not think the expected value should be 0.5. I tried integrating the CDF, but I do not believe I did it correctly.  When $a = -2.3338$, $b = 0.32164$, $c = 0.94686$, I believe the correct answer is approximately $0.009803$. I found this through simulation.  I would appreciate any help or suggestions. Cruising the old questions I came across juantheron asking for $\int \frac {\sec x\tan x}{3x+5}\,dx$ He tried using $(3x+5)^{-1}$ for $U$ and $\sec x \tan x$ for $dv$while integrating by parts.  below is his work.  How can I calculate $$ \int {\sec\left(x\right)\tan\left(x\right)  \over 3x + 5}\,{\rm d}x $$  My Try:: $\displaystyle \int \frac{1}{3x+5}\left(\sec x\tan x \right)\,\mathrm dx$  Now Using Integration by Parts::  We get  $$= \frac{1}{3x+5}\sec x +\int  \frac{3}{(3x+5)^2}\sec x\,\mathrm  dx$$  Here he hit his road block.   I tried the opposite tactic   Taking the other approach by parts.   let $$U= \sec x \tan x$$ then$$ du= \tan^2 x \sec x +\sec^3 x$$ and $$dv=(3x+5)^{-1}$$ then $$v=\frac 1 3 \ln(3x+5)$$ Thus $$\int \frac {\sec x \tan x}{3x+5}\,dx= \frac {\ln(3x+5)\sec x \tan x}{3} - \int \frac {\ln(3x+5) [\tan^2 x \sec x +\sec^3 x]}{3} \,dx$$    As you can see I got no further than he did.   So how many times do you have to complete integration by parts to get the integral of the original $\frac {\sec x \tan x}{3x+5} \, dx$ or is there a better way? Derivative of conjugate multivariate function What does it mean to "program to an interface"? I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible? Does the series $\sum_{n=1}^{\infty}|x|^\sqrt n$ converge pointwise? If it then what would be the sum? Does the series $\sum_{n=1}^{\infty}|x|^\sqrt n$ converge pointwise?