Match between brakets that may contain other brakets I am trying to find a regex that matches brakets that may contain other brakets.  Example:  Match1(Match2())   I want the output to be: Match1:   &nbsp;&nbsp;$0 => 'Match1(Match2())'    &nbsp;&nbsp;$1 => 'Match1'    &nbsp;&nbsp;$2 => 'Match2()' Match2:   &nbsp;&nbsp;$0 => 'Match2()'    &nbsp;&nbsp;$1 => 'Match2'    &nbsp;&nbsp;$2 => ''  Is there a way to get it done, e.g. \w+\(.*?\)
Can regular expressions be used to match nested patterns? Is it possible to write a regular expression that matches a nested pattern that occurs an unknown number of times? For example, can a regular expression match an opening and closing brace when there are an unknown number of open/close braces nested within the outer braces?  For example:  public MyMethod() {   if (test)   {     // More { }   }    // More { } } // End   Should match:  {   if (test)   {     // More { }   }    // More { } }
Multivariate differentiability verification I have tried an attempt on the following:  Let $F:U\in \Bbb{R}^n\to \Bbb{R}$ and $f:\Bbb{R}\to \Bbb{R}$ where $f$ is an even function. Now $F(\mathbf{x})=f(|\mathbf{x}|)$, where $|\ . |$ is the Euclidean norm. Given $f$ is $C^r$, I have to show that $F$ is $C^r$.  My attempt was to argument by induction. I showed that $F$ is $C^1$, basically using univariate chain rule on $\frac{\partial f\left(\sqrt{x_1^2+\dots+x_n^2}\right)}{\partial x_1}$ and arguing that it would be continuous using the fact that $f$ is $C^r$. Since the argument works for all $x_i$, it establishes first-differntiability for $F$ and continuity of the operator $DF(\mathbf{x})$. Then I moved on to show $F$ is $C^r$ assuming $F$ is $C^{r-1}$ and $f$ is $C^r$. Now what I did was partially differentiate:  $$ {\partial \over \partial x_2} \left[\frac{\partial ^{k-1}f}{\partial x_1^{k-1}}\right] = \underbrace{{\partial \over \partial |\mathbf{x}|} \left[\frac{\partial ^{k-1}f}{\partial x_1^{k-1}}\right]}_{(1)} . \underbrace{{\partial |\mathbf{x}| \over \partial x_2}}_{(2)} $$  My argument runs as follows: this partial derivative is continuous since $f$ is $C^r$ and hence $(1)$ is continuous. Continuity of $(2)$ is establishd in a similar manner, since $\sqrt{\mathbf{x}}$ is $C^r$ if $\mathbf{x} \neq \mathbf{0}$. Then the product would be continuous. I am uneasy on multivariate arguments and dont know if my approach is completely off track. I didnt use the even function property, so I am sure I might me missing something. Any hints and references would be welcome. Thanks! How can I check if a given number is even or odd in C? When are stopovers permitted on Japan Railways (JR) trains? Regarding : in general, what are the rules governing stopovers for JR trains if one does not use a rail pass? A stopover means you have a ticket from stations A to B (say, Tokyo to Hiroshima) and you disembark and exit the ticket gates at an intermediate station (say, Kyoto).  (Spoiler alert: it's complicated.) Footnotes layout in multicols environment I am using the package multicol to typeset a one-column (spanning the entire text width) heading and a two-column main text block. In order to do so, I begin the multicols environment along with the start of the text block. The one-column heading spans a small fraction of the text height in the front page and I need to set a footnote there, before starting the two-column environment. I'd like to have that footnote typeset under the first column in the two-column running text. How could I possibly do this?   Moreover, I'd like to have the footnotes typeset in a single column under one of the text columns -- I don't even mind having them as two-column footnotes, but what I do not want is a footnotes layout spanning the entire text width. I have tried with the command \twocolumnfootnotes from the class memoir, with the packages ledmac, dblfnote, and even with ftnright (the latter complains about its being used in a single-column document, due to that one-column heading). None has proved useful in this setting. As a less than MWE, just to convey a more concrete depiction of my scenario, let us consider:  \documentclass{memoir}  \usepackage{multicol}  \begin{document}  A single-column heading\footnote{Here I have my footnote.}  \begin{multicols}{2} Here I am in the two-column environment, and I want my footnotes being set in accordance with the document's ``columnwidth''.\footnote{A footnote in the two-column environment.} \end{multicols}   \end{document} $S_3$ permutes the elements of $\mathbb{R}^3$, show that $\sigma (x_1, x_2, x_3) = ( x_{\sigma^{-1}(1)}, x_{\sigma^{-1}(2)}, x_{\sigma^{-1}(3)})$. I am working on a prototype, one function of which is to detect whether an object is "in range" by a few cm. Right now I'm just using an Arduino and a cheap  that operates at 13.56 MHz:    I've successfully gotten it to detect the tag, but only at a distance of about 3-4 cm when the tag is oriented parallel to the antenna.  According to my  , the HF band allows read ranges of between 10 cm and 1 m for passive tags, depending on factors like antenna size, tag size and orientation, and transceiver power.  I realize this inexpensive reader is not up to task as-is, but I'm interested in building something that achieves read ranges of 15-20 cm.  Some criteria:   No need to read multiple tags; only whether one tag is in range or not. No need to write to the tag. Cannot use an active tag.   I'm not experienced with RFID reader construction (yet) but am interested in knowing what I should pursue.  Here are some things I've considered:   Ditch the embedded antenna on the cheap RFID reader and construct my own, larger antenna. I'd need to see if the onboard  is up to the task of providing additional power. Look for a different IC around which to build a reader from scratch. Find a ready-made solution instead of trying to build one (more cost-effective?). Use something other than RFID for simple proximity detection.   I am experienced with microcontrollers and basic electronics, and have made audio and lighting projects, but this is a first with RFID. Since I don't need to read multiple tags, which RFID is suitable for, I've considered maybe some sort of magnet and hall-effect sensor, but the range does not seem adequate. I considered using an ultrasonic proximity detector, but the application calls for detecting the tagged object while ignoring untagged ones (ultrasonic would produce false positives on untagged objects). I've considered some sort of reflective surface placed on the object, and detecting reflected light, but the object orientation is not reliable enough to maintain alignment.  So, in a nutshell, What modifications can I make to my existing reader, or what alternate technology should I pursue to achieve 15-20 cm detection of a passively tagged object?  I plan on connecting whatever proximity detector is used to a microcontroller using SPI. Notation for infinite product in reverse order This question is related to notation of infinite product.   We know that, $$ \prod_{i=1}^{\infty}x_{i}=x_{1}x_{2}x_{3}\cdots $$  How do I denote $$     \cdots x_{3}x_{2}x_{1}  ?    $$  One approach could be  $$ \prod_{i=\infty}^{1}x_{i}=\cdots x_{3}x_{2}x_{1} $$  I need to use this expression in a bigger expression so I need a good notation for this. Thank you in advance for your help. Subgroups of finitely generated groups are not necessarily finitely generated I was wondering this today, and my algebra professor didn't know the answer.      Are subgroups of finitely generated groups also finitely generated?    I suppose it is necessarily true for finitely generated abelian groups, but is it true in general?  And if not, is there a simple example of a finitely generated group with a non-finitely generated subgroup?  NOTE:  This question has been merged with another question, asked by an undergraduate.  For an example not involving free groups, please see Andreas Caranti's answer, which was the accepted answer on the merged question. What are your thoughts on writing your text in images?  I'm not saying throughout the whole website... But in certain key locations like image carousels. And I'm not talking about the special cases where you have font types that browsers can't render. I'm talking about text that uses standard fonts and is not too big (3/4 bullets).  Should I embed the text in the images that compose the carousel? Or should I apply the text to the images as "real text" HTML?  What are the advantages/ disadvantages of using text in an image? I am trying to make a snowball that triggers a command when it hits a player in 1.15, but I don't know how to do that. When I do execute at @e[type=snowball] run gamemode spectator @a[distance=..2] it only runs the command if it goes right next to them. 16.04 Cannot install anything from Ubuntu Software center Whenever I double click a deb file, it'd be opened in software center. However, when I click "install" button, it'd change to "installing" for a second but then turn back to "install" and nothing happens. It also says "This software comes from a 3rd party and may contain non-free components" at the bottom. I have enabled all the options in Software &amp; Updates and also tried reinstalling software center but nothing helped. Can I possibly recover the Windows system partition that I deleted (100MB)? After moving to SSD I deleted the System Partition (100MB) from my previous drive, causing mass destruction.  I tried to delete the System Partition which windows 7 creates (on my previous disc as I moved to SSD) and when I tried to extend the main partition size to include the new Unallocated Space it asked me if I wanted to convert the disc to Dynamic.  I simply pressed yes and the partition simply disappeared into unallocated space. All of my family pictures / videos lost.  After reading an article on Microsoft they said to recreate the partition with the same exact size, so I tried to do that but it didn't work. I did not format the drive at all when I created partitions.  How can I possibly recover the partitions?  Thanks! I know mathematically the answer to this question is yes, and it's very obvious to see that the dimensions of a ratio cancel out, leaving behind a mathematically dimensionless quantity. However, I've been writing a  (the specifics of which are out of scope), which has me thinking about the problem because I decided to handle angle units as dimensioned quantities, which seemed natural to enable the unit conversion with degrees. The overall purpose of the library is to disallow operations that don't make sense because they violate the rules of dimensional analysis, e.g. adding a length quantity to an area quantity, and thus provide some built-in sanity checking to the computation. Treating radians as units made sense because of some of the properties that dimensioned quantities seemed to me to have:  The sum and difference of two quantities with the same dimension have the same physical meaning as both quantities separately. Quantities with the same dimension are meaningfully comparable to each other, and not meaningfully comparable (directly) to quantities with different dimensions. Dimensions may have different units that are scalar multiple (sometimes with a datum shift).  If the angle is treated as a dimension, my 3 made up properties are satisfied, and everything &quot;makes sense&quot; to me. I can't help thinking that the fact that radians are a ratio of lengths (SI defines them as m/m) is actually critically important, even though the length is cancelled out. For example, though radians and steradians are both dimensionless, it would be a logical error to take their sum. I also can't see how a ratio of something like (kg/kg) could be described as an &quot;angle&quot;. This seems to imply to me that not all dimensionless units are compatible, which seems analogous to how units with different dimensions are not compatible. And if not all dimensionless units are compatible, then the dimensionless &quot;dimension&quot; would violate made-up property #1 and cause me a lot of confusion. However, treating radians as having dimension also has a lot of issues, because now your trig functions have to be written in terms of $\cos(\text{angleUnit}) = \text{dimensionless unit}$ even though they are analytic functions (although I'm not convinced that's bad). Small-angle assumptions in this scheme would be defined as performing implicit unit conversions, which is logical given our trig function definitions but incompatible with how many functions are defined, especially since many authors neglect to mention they are making those assumptions. So I guess my question is: are all dimensionless quantities, but specifically angle quantities, really compatible with all other dimensionless quantities? And if not, don't they actually have dimension or at least the properties of dimension? Prove that: area of triangle $S_{ABC}=p \cdot R$, where p is half perimeter of triangle $DEF$ Prove that: area of triangle $S_{ABC}=p \cdot R$, where p is half perimeter of triangle $DEF$. $AD,CF, BE$ are altitudes. Is there a simple way? UK Visa in an expired Nigerian passport - what to use? Cannot Delete Item "Could Not Find This Item" issue A friend sent a long a file (a .rar) he wanted me to check out for him before he installed it.  I downloaded it and unrared it with no problems, but it was full of .exe's instead of the intended contents (fonts) so I advised him to delete it immediately and not use.  I then proceeded to do the same, but the folder simply will not delete. Oddly the files went fine, and I never ran anything, but this is what I'm seeing:   Could not find this item  This is no longer located in C:\Users\This_User\Desktop. verify the item's location and try again.   I've tried the following things with no help:   Using "Unlocker" to Unlock and delete Using move on reboot and rebooting Using PendMoves (from sysinternals) and rebooting Elevating a cmd line, doing a dir /x to get the short name of the folder, and then del 'shortna~1' Moving the folder to a new folder and then trying to delete the parent folder   I'm on Windows 7 RTM, very fresh install. Any thoughts?  Update: Just to confirm, I've run Hijack this and half a dozen other malware detectors, and everything came back clean (no extra processes, no other obvious badness). Rebooting in safe mode didn't help either. Proof: $\|X\|_2\leq \sqrt{n}\|X\|_\infty$ (Euclidean Norm)  Proof that $\|X\|_2\leq \sqrt{n}\|X\|_\infty$, if $x \in \mathbb{R^n}$.   With that, proof $\|X\|_\infty \to 0 \implies \|X\|_2\to 0$  I'm stuck:  $\|X\|_2= \sqrt{x^2_1+x^2_2+...+x^2_n}\leq\sqrt{n}\sqrt{x^2_1+x^2_2+...+x^2_n}$  I don't know how to use the fact: $\|X\|_\infty=\max(|x_1|,|x_2|,...,|x_n|)$ Number of solutions of $x_1+2x_2+\cdots+kx_k=n$? Usage of 'shall' in questions Let's say I want to arrange a lesson with my coach and I say:  Shall we have a lesson on Monday?  I understand the use of 'shall' in American English is considered to be formal, whereas this is not the case in British English. I would like to understand the different connotations (is it formal? is it a request for confirmation? is it a suggestion?) that the following questions have:  A. Shall we have a lesson on Monday? B. Can we have a lesson on Monday? C. Should we have a lesson on Monday? D. Could we have a lesson on Monday? E. Are we having a lesson on Monday? F. Will we have a lesson on Monday? G. Are we going to have a lesson on Monday? If two variables have 0 correlation, why are they not necessarily independent? Are zero correlated variables independent under special circumstances ?  If possible, I am looking for an intuitive explanation, not a highly technical one.