ack

How can I install and use ack library on Windows?

。_饼干妹妹 提交于 2019-12-02 14:06:15
I have never used Perl, but I am really impressed by the ack , which I would like to use for source code searching, etc. Can anyone guide me of how to make use of this excellent library on Windows? Start by installing perl http://strawberryperl.com/ Install App::Ack by typing (in a windows command shell) C:\>cpan App::Ack And undoubtedly this will prove useful http://learn.perl.org/ Not all the tests pass on all versions of Windows. You can most likely get 100% functionality from ack even if the install tests fail. Here is the command to force installation if failing tests prevent a normal

ack does not work when run from “grep-find” in Emacs on Windows

不羁岁月 提交于 2019-12-01 20:42:44
问题 I'm trying to use ack-grep as a replacement for grep + find in Emacs on Windows, but ack-grep exits immediately (successfully) without printing any matches. I've tried just about every conceivable combination of command-line parameters to ack-grep, but nothing seems to work. M-x grep-find Enter "ack html" to search for files containing "html". Ack exits immediately, printing nothing: -*- mode: grep; default-directory: "c:/" -*- Grep started at Tue Feb 23 23:50:52 ack html Grep finished

ack does not work when run from “grep-find” in Emacs on Windows

我怕爱的太早我们不能终老 提交于 2019-12-01 19:10:01
I'm trying to use ack-grep as a replacement for grep + find in Emacs on Windows, but ack-grep exits immediately (successfully) without printing any matches. I've tried just about every conceivable combination of command-line parameters to ack-grep, but nothing seems to work. M-x grep-find Enter "ack html" to search for files containing "html". Ack exits immediately, printing nothing: -*- mode: grep; default-directory: "c:/" -*- Grep started at Tue Feb 23 23:50:52 ack html Grep finished (matches found) at Tue Feb 23 23:50:52 Executing the same command "ack html" in cmd.exe works fine (showing

storm入门 第四章 消息的可靠处理

夙愿已清 提交于 2019-12-01 12:30:58
4.1 简介 storm可以确保spout发送出来的每个消息都会被完整的处理。本章将会描述storm体系是如何达到这个目标的,并将会详述开发者应该如何使用storm的这些机制来实现数据的可靠处理。 4.2 理解消息被完整处理 一个消息(tuple)从spout发送出来,可能会导致成百上千的消息基于此消息被创建。 我们来思考一下流式的“单词统计”的例子: storm任务从数据源(Kestrel queue)每次读取一个完整的英文句子;将这个句子分解为独立的单词,最后,实时的输出每个单词以及它出现过的次数。 本例中,每个从spout发送出来的消息(每个英文句子)都会触发很多的消息被创建,那些从句子中分隔出来的单词就是被创建出来的新消息。 这些消息构成一个树状结构,我们称之为“tuple tree”,看起来如图1所示: 图1 示例tuple tree 在什么条件下,Storm才会认为一个从spout发送出来的消息被完整处理呢?答案就是下面的条件同时被满足: tuple tree不再生长 树中的任何消息被标识为“已处理” 如果在指定的时间内,一个消息衍生出来的tuple tree未被完全处理成功,则认为此消息未被完整处理。这个超时值可以通过任务级参数 Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS 进行配置,默认超时值为30秒。 4.3 消息的生命周期

Searching multiple patterns (words) with ack?

随声附和 提交于 2019-11-30 15:24:17
问题 I want to search multiple patterns in a directory containing recursive directories and files . I know command for grep which is as follows grep -e '(pattern1)|(pattern2)' or grep -r -E 'string1|string2|string3' /var/www/http What is the command for that using ack or ag ? 回答1: This should be enough: ack -R 'string1|string2' As -R is the default, you can omit it: ack 'string1|string2' From man ack : -r , -R , --recurse Recurse into sub-directories. This is the default and just here for

Searching multiple patterns (words) with ack?

删除回忆录丶 提交于 2019-11-30 13:28:19
I want to search multiple patterns in a directory containing recursive directories and files . I know command for grep which is as follows grep -e '(pattern1)|(pattern2)' or grep -r -E 'string1|string2|string3' /var/www/http What is the command for that using ack or ag ? This should be enough: ack -R 'string1|string2' As -R is the default, you can omit it: ack 'string1|string2' From man ack : -r , -R , --recurse Recurse into sub-directories. This is the default and just here for compatibility with grep. You can also use it for turning --no-recurse off. If you want to get the pattern from a

ack-grep: chars escaping

核能气质少年 提交于 2019-11-30 11:15:30
My goal is to find all " <?= " occurrences with ack. How can I do that? ack "<?=" Doesn't work. Please tell me how can I fix escaping here? Since ack uses Perl regular expressions, your problem stems from the fact that in Perl RegEx language, ? is a special character meaning "last match is optional". So what you are grepping for is = preceded by an optional < So you need to escape the ? if that's just meant to be a regular character. To escape, there are two approaches - either <\?= or <[?]= ; some people find the second form of escaping (putting a special character into a character class)

ack regex: Matching two words in order in the same line

喜你入骨 提交于 2019-11-30 08:02:32
I would like to find lines in files that include two words, word_1 and word_2 in order, such as in Line A below, but not as in Line B or Line C : Line A: ... word_1 .... word_2 .... Line B: ... word_1 .... Line C: ... word_2 .... I have tried $ack '*word_1*word_2' $ack '(word_1)+*(word_2)+' and the same commands with ^ appended at the beginning of the regex (in an attempt to follow the Perl regex syntax). None of these commands return the files or the lines I am interested in. What am I doing wrong? Thanks! You want to find word_1 , followed by anything, any number of times, followed by word_2

How to let ack support more filetypes?

点点圈 提交于 2019-11-30 04:12:36
in ack's home page , there lists a lot of file type, but without aspx, is it possible to let ack support it? prime23 On window,add .ackrc file under C:\Documents and Settings\yourname,with content --type-set=aspx=.aspx you can set a type to multi file extension,seperate by "," --type-set=aspx=.aspx,.ascx Note ack syntax and behaviour has changed significantly with version 2. The equivalent of the above in version 2 would be: --type-set=aspx:ext:aspx,ascx Where the syntax is --type-set TYPE:FILTER:FILTERARGS and FILTER can be any of ext, is, match, firstlinematch . You should definitely read

How to exclude several lines around match with grep or similar tool?

假装没事ソ 提交于 2019-11-29 15:42:35
I can find all non-matched lines of file with grep -v 'my_pattern' some_file . Also i can print few strings before/after/around match with -A , -B or -C options of grep. But i can't combine these two options to exclude lines with pattern and certain amount of lines near matched lines - grep shows entire file as result. For example, i have log with a lot of patterns like this: 25.02.2012 10:41:37 here goes memory state 25MiB free 16MiB allocated max free block is 4MiB I'd like to filter them. Of course, i can write custom perl/awk script, but is there more elegant way to do this? You can use