I'm new to Perl and is working with regular expressions. I am not able to decide how Perl resolves the ambiguity for a regex match when multiple matches are possible for a given query string. For example   ('hellohellohello' =~ m/h.*o/)   This could match 'hello', 'hellohello' or 'hellohellohello'. Which one will it choose - shortest or largest match ? What if we want opposite behavior (like if default is to find the shortest match then finding the largest match) ? In case the answer to the first is largest consider  ('hello    hellohello' =~ m/h.*o/)  Here, it could match from the first line (before the newline character) or the second line (after the newline character) - first vs largest match. Which one will it use ?   What are the complete set of rules that can be used to decide which substring of a string would match a given regex (might be some case other than the one mentioned in the examples where multiple matches could be found) ?
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}?
Error message "Strict standards: Only variables should be passed by reference" For what $n$ is $U_n$ cyclic? When can we say a multiplicative group of integers modulo $n$, i.e., $U_n$ is  cyclic?   $$U_n=\{a \in\mathbb  Z_n \mid \gcd(a,n)=1 \}$$  I searched the internet but did not get a clear idea. Photoshop resize circularly I am trying to make a histogram with the fitted curve plotted on it. Here's the mwe:   \documentclass[a4paper]{scrartcl}     \usepackage{tikz}     \usepackage{pgfplots,pgfplotstable}     \usepackage{filecontents}     \pgfplotsset{compat=1.10}     \usepackage[active,tightpage]{preview}     \setlength\PreviewBorder{2pt}     \newcommand{\plots}{0.611201}     \newcommand{\plotm}{2.19882}     \begin{filecontents}{data.dat}     2 0.0629921259843     3 0.0236220472441     4 0.0314960629921     5 0.125984251969     6 0.0629921259843     7 0.102362204724     8 0.110236220472     9 0.0551181102362     10 0.0629921259843     11 0.0314960629921     12 0.0236220472441     13 0.0314960629921     14 0.0629921259843     15 0.0551181102362     16 0.0393700787402     17 0.0472440944882     18 0.00787401574803     19 0.0393700787402     24 0.00787401574803     27 0.00787401574803     33 0.00787401574803     \end{filecontents}     \begin{document}     \begin{preview}      \begin{tikzpicture}     \begin{axis}[     yticklabel style={/pgf/number format/fixed},     scaled y ticks = false,     minor y tick num={1},     xtick pos=left,     legend cell align = left,     legend style={draw=none},     xlabel = {group size},     ylabel = {ratio}     ]     \addplot[blue,ybar,fill, fill opacity=0.3, bar width = 0.8,] table {data.dat};     \addplot[red, line width = 1,domain=1:40,samples=100] {1/(x*sqrt(2*pi)*\plots)*exp(-(ln(x)-\plotm)^2/(2*\plots^2))};     \legend{empirical,lognormal fit}     \end{axis}     \end{tikzpicture}     \end{preview}     \end{document}     As you can see, the legend is not really good. How can I change the legend so it looks more like this? Assuming I have a Czech license and break a minor law in Germany which incurs me a certain number of "violation points" (e.g. speeding), would those points be eventually transferred to my Czech license? I would obviously have to pay the fine (either on the spot or by mail), but it's not clear if EU countries exchange data on traffic points.  I would limit the scope to EU/EEA license holders driving within the EU/EEA, to avoid an overly broad question. Also assume that the person in question is resident in his home country and is only visiting other EU/EEA countries as a tourist. How do I delete all Folders with a specific name (e.g. 128Kbps_Songs) without deleting its files  For example if I have directory "MP3_SONGS" with subdirectories "A", "B", "C" and each subdirectory has MANY directory Contains Film Name "FILM_NAME1", "FILM_NAME2", "FILM_NAME3" in it, In That Each Film NAme I have specific Folder NAme (128Kbps_Songs) in this "128Kbps_Songs" Folder I have That Film mp3 Songs Files  how can I remove the Folder "128Kbps_Songs", in Each Film_Name directory and Have to get these mp3 songs in that FILM_NAME..   ( Have to Delete 128Kbps_Songs Folder in all FILM_NAME without deleting the mp3 Songs in it, have to get the mp3 in FILM_NAME Directory..  MP3_SONGS (Parent Directory) ------ A , B, C  A (Sub Directory1) ------ FILM_NAME1 , FILM_NAME2 B (Sub Directory2) ------ FILM_NAME3 , FILM_NAME4 c (Sub Directory3) ------ FILM_NAME5 , FILM_NAME6  FILM_NAME1 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME1 (MP3 Files) FILM_NAME2 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME2 (MP3 Files)  FILM_NAME3 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME3 (MP3 Files) FILM_NAME4 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME4 (MP3 Files)  FILM_NAME5 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME5 (MP3 Files) FILM_NAME6 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME6 (MP3 Files)  Need Files in: FILM_NAME1 (Directory)  ------ FILM_NAME1 (MP3 Files) FILM_NAME2 (Directory)  ------ FILM_NAME2 (MP3 Files)  FILM_NAME3 (Directory)  ------ FILM_NAME3 (MP3 Files) FILM_NAME4 (Directory)  ------ FILM_NAME4 (MP3 Files)  FILM_NAME5 (Directory)  ------ FILM_NAME5 (MP3 Files) FILM_NAME6 (Directory)  ------ FILM_NAME6 (MP3 Files) For about 2 days I'm trying to configure Ubuntu so that I can send an email, but when I type in:  echo "Subject: sendmail test" | sendmail -v my@email.com   I'll get:  postdrop: warning: unable to look up public/pickup: No such file or directory Mail Delivery Status Report will be mailed to &lt;andreigbr&gt;.   Even if I change my@email with mine, the inbox will be empty. Can somebody help me, please? I watched about 5 tutorial about how to send an email fom the command line but still doesn't work. GRUB does not detect Windows Vertical line only in one part of a table I need some help on  putting a vertical line in the second part of the table, I don't know how to do it since the tabularx I declared does need to have that only in the second part. The code I used is:  \begin{tabularx}{\linewidth}{|XX|} \hline \multicolumn{2}{|c|}{\textbf{title name}}\\ \hline something: &amp; else \\ something: &amp; else \\ something: &amp; else \\ \hline \multicolumn{2}{|c|}{bla bla blah}\\ \hline title text: &amp; description 1 \\ title text: &amp; description 1 \\ \hline \end{tabularx}   And the render of the table looks like this:    I just need a \vline between title text and description (it I use \vline it works only for the first line but the description text and sometimes the title, are few lines long). How to create Mist in Blender I already tried several ways to create Mist in Blender, but it never worked 100%. I use Blender 2.78 and I want to create Mist like in this scene here.  What are the exact steps?     Here is what I have tried so far:  I already tried this:  but it simply did not work .. I dont know why.  (EDIT: I managed to fix it: Check out this graphic:   Until now I already used objects successfully as Mist-creators (Volume Scatter under Volume Material). The bad thing about using Objects as Mist-creator is that they dont have an endless mist range + the mist can not be bright. Normally it appears grayish result is bad..  Check it out  Please help If every compact set is closed, then is the space Hausdorff? So, somehow over the weekend, my 1GB USB flash drive has managed to become write-protected.  There is no switch on the stick, so I'm concluding that something has corrupted at some point.  Obviously I can't format it or remove.  The output from dmesg | tail is:  Buffer I/O error on device sdb1, logical block 328168 lost page write due to I/O error on sdb1 sd 73:0:0:0: [sdb] Unhandled sense code sd 73:0:0:0: [sdb] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE sd 73:0:0:0: [sdb] Sense Key : Data Protect [current] Info fld=0x0 sd 73:0:0:0: [sdb] Add. Sense: Write protected sd 73:0:0:0: [sdb] CDB: Write(10): 2a 00 00 05 08 00 00 00 01 00 Buffer I/O error on device sdb1, logical block 328200 lost page write due to I/O error on sdb1   I think the second and final lines are a giveaway to corruption, but I don't know how to interpret this output.  Could someone help to see if this output gives any indication?  I usually eject the drive before removing it, but I may have been lax once or twice.  The data isn't critical, it's just bugging me.  Any suggestions on how to fix it (if the drive even can be) would be greatly appreciated. Prove every element of $G$ has finite order. How can I create documents in LaTeX using a calligraphic first letter for chapters? Terminal not displaying colors for directory listings I want to import graphics into my main input file using the macro \includegraphics. It does not work if the filename contains spaces.   also discusses this subject, but there is no solution there.  My compilation routine is latex->dvips->ps2pdf (because of PSTricks). Why does correlation matrix need to be positive semi-definite and what does it mean to be or not to be positive semi-definite? I have been researching the meaning of positive semi-definite property of correlation or covariance matrices.   I am looking for any information on   Definition of positive semi-definiteness; Its important properties, practical implications; The consequence of having negative determinant, impact on multivariate analysis or simulation results etc. Is there a travelling speed of for electric field? If yes, what is it? Consider two circuits containing a battery, bulb, switch and conducting wires but of length 1 meter in one case and 1000KM in other. When switched on at the same time both the bulbs glow instantaneously. I think it is because, electric filed travels from positive terminal of battery to negative terminal through wire almost instantaneously.  My question is there any speed for this electric field? If yes, what is it? By any modification in this circuit is it possible to induce any delay in glowing the bulb? Beryllium Vacuum Sphere Boat/Aircraft How to relate areas of circle, square, rectangle and triangle if they have same perimeter?? I was given a question which was like:     Suppose that a circle, square, rectangle and triangle have same perimeter. How area their areas related??   My work:  I broke the question in parts and tried to prove it seperately:  STEP $1$. Suppose the given perimeter is $P$.So the radius of circle will be ${r=P/2\pi}$.  And hence area of the circle will be:   ${P^2/4\pi}$.  Side of square will be $P/4$ and hence area of square will be $P^2/16$.   It is obvious that ${P^2/4\pi}$  >  $P^2/16$.   So Area of circle is more than area of square.  STEP $2$: Whether by using $AM&gt;GM$ inequality or by using a bit of differentiation, we can get that product off two quantities is maximum when they are equal.  So, Area of square is more than Area of rectangle.  Here, the hardest part come (at least for me). I can't relate the area of triangle to any of Circle, Square or Rectangle. It would have been easy if the triangle was Equilateral, Right angle but the question is talking about a general triangle.  However, when I considered the situation with different examples (Assuming the perimeter and calculating the area, I got the relation:  Circle > Square > Rectangle > Triangle.  I shall be highly thankful if you guys can establish the relation in purely mathematical way.  EDIT: This question does not ask that whether circle have the largest area among all 2-D figures or not. The OP just want to relate the areas of Circle, Square, Rectangle, Triangle in a pure mathematical way.