Over a decade ago I imagined an improved version of grep that would use indexes to make recursive searching faster.  I never got around to writing it, but I wonder if somebody else did!  My original idea was:   Keep a cached index of word -&gt; [line-numbers] for each file, which would automatically update when the file size or timestamp changes. Use the cache for lightning-fast searches over any files with up-to-date indexes, if the expression can make use of it. For search expressions where the index cannot help, default to grep's usual behaviour.   Although this optimization would be limited to whole-word-searching, I thought it should be grep-compatible, so that it could be dropped in to replace /usr/bin/grep and help speed up various existing scripts that use grep.  There are limitations to this idea:   Only word-searches or searches including certain \\&lt;...\\&gt; terms would be able to benefit from the indexes, and the latter case could be complex to implement. The time taken to check file stats to ensure the caches are up-to-date might make the time saved on searches minimal.   So do you think it would be worthwhile, or does point 2 make the idea worthless?  And has someone already tried this?  If so, do please share.
I am currently facing a "performance problem" while using grep. I am trying to locate the occurrences of many (10,000+) keywords in many (think Linux kernel repository size) files. The objective is to generate a kind of index for each keyword:   keyword: my_keyword filepath 1 filepath 2 ------ keyword: my_keyword2 ...   Being fairly new to shell scripting, I have tried a few naive approaches:  while read LINE; do     echo "keyword: "$LINE &gt;&gt; $OUTPUT_FILE     grep -E -r --include='Makefile*' "($LINE)" . &gt;&gt; "$OUTPUT_FILE"     echo "-----" done &lt; $KEYWORD_FILE   This takes about 45 minutes to complete, with the expected results.  Note: all they keywords I search for are located in a file ("KEYWORD_FILE", so fixed before anything starts), and the files in which to search can be determined before the search starts. I tried to stored the list of files to search in before the search like that:  file_set=( $(find . -name "Kbuild*" -o -name "Makefile*") )   and then replace the grep call by  echo {$file_set[*]} | parallel -k -j+0 -n 1000 -m grep -H -l -w "\($LINE\)" &gt;&gt; "$OUTPUT_FILE"   It takes about an hour to complete&hellip;  Question: considering I can use whatever technique I want, provided it's sh compliant, how can this be done "faster" and/or more efficiently ?  Perhaps grep is not the tool to use, and my use of parallel is wrong&hellip; any ideas are welcome!
What follows if we fail to reject the null hypothesis? What conclusions can we draw if $p&gt;\alpha$? Does not rejecting the $H_0$ mean anything? Handling multiple regex matches in Ampscript Given this string:  SET @text = "&lt;a href=""https://salesforce.stackexchange.com""target=""_blank""&gt;Salesforce&lt;/a&gt; &lt;a href=""https://stackoverflow.com"" target=""_blank""&gt;Everything else&lt;/a&gt;"   And this function:  SET @matching = '\s+(?:[^&gt;]*?\s+)?href="([^"]*)"' SET @output = RegExMatch(@text, @matching, 1)   How can I manage to find and print an arbitrary number of matches in my string? E.g. in above example, I would like to present e.g. a rowset with each URL in each row. Android: Using default styles How can I subdivide this plane into even squares? My very simple Greasemonkey script is not running? Choosing the best model from among different "best" models How do you choose a model from among different models chosen by different methods (e.g. backwards or forwards selection)?  Also what is a parsimonious model? Update on Ubuntu - coloured lines around everything Everyday I check for updates on Ubuntu 16.04 LTS. I updated to 4.4.0-65-generic today and now on everything I'm getting thick rainbow coloured lines around every dialog box in every program. My setup is pretty standard. Skylake i5-6500, Nvidia 950gtx. Does anyone know how to fix it? Correlation coefficient between a (non-dichotomous) nominal variable and a numeric (interval) or an ordinal variable I've already read all the pages in this site trying to find the answer to my problem but no one seems to be the right one form me...  First I explain you the kind of data I'm working with...  Let's say that I have an array vector with several names of city, one for each of 300 users. I also have another array vector with scores response to a survey of each user or a continuous value for each user.  I would like to know if exist a correlation coefficient that compute the correlation between these two variables so, between a nominal and a numeric/continuous or ordinal variables.  I've searched on the Internet and in some pages they suggest to use the contingency coefficient or Cramer's V or Lambda coefficient or Eta . For each of this measure the just say that they could be applied for such data in which we have a nominal variable and interval or numerical variable. The thing is that searching and searching, trying to understand every one of them, sometime is written or watching the examples that they are reasonable to use them if you have dichotomous nominal variable, except for Cramer's V, other time is not written any requirement for the type of data. A lot of other pages say that is right to apply regression instead, that is right, but I would just simply like to know if there is a coefficient like pearson/spearman for this kind of data.  I also think that is no so properly to use Spearman Correlation coeff since the cities are not sortable.  I have also built the function of Cramer'sV and Eta by myself (I'm working with Matlab) but for Eta they don't talk about any p-value to see if the coefficient is statistically significant...  In the matlabWorks site there is also a nice toolbox that says to compute eta^2 but the kind of input it needs is not understandable.  Is here someone that have done a test like mine? If you need more detail to understand the kind of data I'm using just ask me and I'll try to explain you better. Other word for person who does something to others but does'nt like it done to them This is a duplicate question but has still not been answered for me. I'm so close to the exact word - I know there is one out there - but the closest word I can find is a hypocrite --     a person who claims to have certain moral principles or beliefs but behaves in a way that shows they are not sincere.    The word I'm looking for is a person who does not claim things, but does thing to another and they consider it wrong or immoral to have done to them. Roman numerals become “too wide” in table of contents Proving $9^n - 8n - 1$ is divisible by $8^2$ for $n\ge 0$? $f(x)f(1/x)=f(x)+f(1/x)$ Find a function $f(x)$ such that:  $$f(x)f(1/x)=f(x)+f(1/x)$$  with $f(4)=65$.  I have tried to let $f(x)$ be a general polynomial: $$a_0+a_1x+a_2x^2+\ldots a_nx^n$$  which leaves $f(1/x)$ as:  $$a_0+a_1{1\over x}+a_2{1\over x^2}+\ldots + a_n{1\over x^n}$$  On comparing the coefficients of both sides, we see that:  $$2a_0=(a_0)^2+(a_1)^2+(a_2)^2+\ldots+(a_n)^2$$  And  $$a_1=(a_0a_1)+(a_1a_2)+ \ldots +(a_{n-1}a_n)$$  I don't know how to proceed further. I know I need to compare coefficients and come to a conclusion based on their values, but I don't see what to do next. How to tenderize large squid? My whole life I've been buying small squid (maybe 4-6" long bodies without the head and tentacles), which are very mildly chewy and tender.  All it takes is sautee them in a little OO and they are good to eat, IOW, no additional tenderizing is needed.  Yesterday I got some large squid, about 1 lb each before cleaning, probably 10"+ long without the head, probably 5-6 times as much meat as the little ones I usually get.  I remember trying to cook that before and they came out very tough and with a bit of unpleasant odor.  Is there a way to marinate and tenderize large squid and to somehow neutralize the odor? Post-hoc tests after Kruskal-Wallis: Dunn's test or Bonferroni corrected Mann-Whitney tests? I have some non-Gaussian distributed variable and I need to check if there are significant differences between the values of this variable in 5 different groups.  I have performed Kruskal-Wallis one-way analysis of variance (which came up significant) and after that I had to check which groups were significantly different. Since the groups are kind of sorted (the values of the variable in the first group are supposed to be lower than the values of the variable in the second group which are supposed to be lower than the values of the variable in the third group and so on) I only performed 4 tests:  Group 1 vs Group 2 Group 2 vs Group 3 Group 3 vs Group 4 Group 4 vs Group 5   I have performed this analysis with two different methods. I started by using Dunn's Multiple Comparison Test but nothing came up significant. On the other hand if I use Mann-Whitney test and correct for the number of tests (4) using Bonferroni, 3 tests come up significant.  What does it mean? Which results should I trust? New global search doesn't like tags So, I was given the following problem as part of a homework assignment.     Suppose $f'(x) &gt; 0$ in $(a,b)$. Prove that $f$ is strictly increasing in $(a,b)$, and let $g$ be its inverse function. Prove that $g$ is differentiable, and that   $$g'(f(x)) = \frac{1}{f'(x)}$$   I have proven that $f$ is strictly increasing in $(a,b)$, and I could prove that $g'(f(x)) = 1/f'(x)$ if I could prove that $g$ is differentiable. The problem is that I am having trouble with a proof of that. Any advice?   Also, as a reference, this is exercise 5.2 from Baby Rudin. The USB has various purposes for data transfer, movement of input and output signals for hardware like connecting an Android device to another Display screen (USB on the go), charging the device etc.(during a device charge the voltage drawn from the USB is same irrespective of the device or OEM then Why are two USB Cables different ?  A USB of one manufacturer may not be supporting another manufacturer. We get problems if we do connect them like      or What happens to a Devil when its alignment is forcibly changed? According to PHB 122, in the section entitled Alignment in the Multiverse, for most creatures, "alignment is a moral choice." Myth says good-aligned gods created the races that are free to choose to be evil (they have free will), while evil-aligned gods created the races that are very inclined towards evil, since they were born to serve the evil god in the first place.  However, there are some types of creatures -- like devils -- which embody an alignment in its essence:     Alignment in the Multiverse, PHB 122      A devil does not choose to be lawful evil, and it doesn't tend toward lawful evil, but rather it is lawful evil in its essence. If it somehow ceased to be lawful evil, it would cease to be a devil.   My first thought was to not take this reading literally. The text could have meant that a neutral evil devil "isn't really a devil," but really, it's still a devil. It's a bit like imagining a guitarist who loses both hands. The loss of some part of a person's essence makes them not the same person anymore.  However, keeping my attention on it, I'm finding this text more and more difficult to interpret. If a devil "is lawful evil in its essence" then what does it mean when "it would cease to be a devil"? What happens to a devil when its alignment is forcibly changed?  There are , and a devil can be subject to some of them. I wanted to align a set of equations to left. I found on the Internet that you can do it easily with align* environment.   I found it here:   So I did it:  \begin{align*}  f(b)-f(a)=&amp;f((b_1,b_2,\dots,b_k))-f((a_1,a_2,\dots,a_k))=\ &amp;=\sum_{i=1}^{k}[f((a_1,\dots,a_{i-1},b_i,\dots, b_k))-f((a_1,\dots,a_i,b_{i+1},\dots, b_k))  \end{align*}   Unfortunately, I got bunch of red errors saying that there are missing $s. Why? Doesn't that align* environment provide a math environment already? I got  question in review. First sentence is:     I know there is a  question, but no answers.   And indeed the two questions are virtually identical. I started to flag as duplicate - but the original question had no answer at the time, so it wouldn't be correct and apparently . (I didn't go so far as to try to submit the flag).  What is the proper action here? How do we want such a question to be handled? Should both (or more) questions stay open indefinitely until either is answered and somebody gets the good idea to do the duplicate linking?   As the new question is essentially a bump to the front page (perhaps with re-tagging), especially in the case where the OP knows that a previous question exist, perhaps something should be done to enable bumping re-emphasizing without writing the new question.  As I wrote this,  actually got an answer. So the old one should now be closed as a duplicate of the new - but my question remains for the case where all known/found duplicate questions have no answer?  Ironically, just before asking this, the "Questions that may already have your answer" gave me ... (Although the suggestion has no answer). So it has been asked before - the comment there even suggest the ability to re-emphasize.