ack

Where is `_softmax_cross_entropy_with_logits` defined in tensorflow?

无人久伴 提交于 2021-02-08 14:00:09
问题 I am trying to see how softmax_cross_entropy_with_logits_v2() is implemented. It calls _softmax_cross_entropy_with_logits() . But I don't see where the latter is defined. Does anybody know how to locate its definition? $ ack '\b_softmax_cross_entropy_with_logits\b' tensorflow/compiler/tests/binary_ops_test.py 176: gen_nn_ops._softmax_cross_entropy_with_logits, tensorflow/python/kernel_tests/xent_op_test.py 52: loss, backprop = gen_nn_ops._softmax_cross_entropy_with_logits( 75: loss, backprop

What is generally faster, grepping through files or running a SQL LIKE %x% query through blobs?

♀尐吖头ヾ 提交于 2020-01-01 08:58:04
问题 Say I'm designing a tool that would save code snippets either in a PostgreSQL/MySQL database or on the file system. I want to search through these snippets. Using a search engine like Sphinx doesn't seem practical because we need exact text matches of code when searching code. grep and ack and has always worked great, but storing stuff in a database makes a large collection of stuff more manageable in certain ways. I'm wonder what the relative performance of running grep recursively over a

Escaping a parenthesis in grep/ack

你说的曾经没有我的故事 提交于 2019-12-31 17:54:41
问题 I want to look for the string "methodname(", but I am unable to escape the "(". How can I get grep methodname( * or ack-grep methodname( * to work? 回答1: There's two things interpreting the ( : the shell, and ack-grep . You can use '' , "" , or \ to escape the ( from the shell, e.g. grep 'methodname(' * grep "methodname(" * grep methodname\( * grep uses a basic regular expression language by default, so ( isn't special. (It would be if you used egrep or grep -E or grep -P .) On the other hand,

Escaping a parenthesis in grep/ack

最后都变了- 提交于 2019-12-31 17:54:32
问题 I want to look for the string "methodname(", but I am unable to escape the "(". How can I get grep methodname( * or ack-grep methodname( * to work? 回答1: There's two things interpreting the ( : the shell, and ack-grep . You can use '' , "" , or \ to escape the ( from the shell, e.g. grep 'methodname(' * grep "methodname(" * grep methodname\( * grep uses a basic regular expression language by default, so ( isn't special. (It would be if you used egrep or grep -E or grep -P .) On the other hand,

Escaping a parenthesis in grep/ack

牧云@^-^@ 提交于 2019-12-31 17:54:29
问题 I want to look for the string "methodname(", but I am unable to escape the "(". How can I get grep methodname( * or ack-grep methodname( * to work? 回答1: There's two things interpreting the ( : the shell, and ack-grep . You can use '' , "" , or \ to escape the ( from the shell, e.g. grep 'methodname(' * grep "methodname(" * grep methodname\( * grep uses a basic regular expression language by default, so ( isn't special. (It would be if you used egrep or grep -E or grep -P .) On the other hand,

How to truncate long matching lines returned by grep or ack

喜夏-厌秋 提交于 2019-12-29 03:11:15
问题 I want to run ack or grep on HTML files that often have very long lines. I don't want to see very long lines that wrap repeatedly. But I do want to see just that portion of a long line that surrounds a string that matches the regular expression. How can I get this using any combination of Unix tools? 回答1: You could use the grep option -o , possibly in combination with changing your pattern to ".{0,10}<original pattern>.{0,10}" in order to see some context around it: -o, --only-matching Show

TextMate: Find in Files seems to have out-of-date cache (maybe because of AckMate?)

别说谁变了你拦得住时间么 提交于 2019-12-24 21:16:41
问题 I have installed AckMate a while ago, and the problem I describe here never happened to me before, so maybe it's because of AckMate...? Here we go: often when I'm searching inside a project, TextMate finds occurrences of the search pattern in "old versions" of files, meaning it the search pattern has definitely been there once, but isn't anymore! Take a look at the screen: I searched for encoding_name, and it found it, but when opening the file, there it isn't anymore (but it has been there a

ack - Binding an actual file name to a filetype

安稳与你 提交于 2019-12-22 08:15:44
问题 For me ack is essential kit (its aliased to a and I use it a million times a day). Mostly it has everything I need so I'm figuring that this behavior is covered and I just can't find it. I'd love to be able to restrict it to specific kinds of files using a type. the problem is that these files have a full filename rather than an extension. For instance I'd like to restrict it to build files for buildr so i can search them with --buildr (Similar would apply for mvn poms). I have the following

How to use named regex groups in ack output?

南楼画角 提交于 2019-12-20 10:37:26
问题 Suppose I have a foo.txt file with the following content: [2010-11-13 12:00:02,656] [2010-11-13 12:00:02,701] [2010-11-13 12:00:02,902] When I ack for the date portion with the following, it works: ack "(?P<foo>\d{4}-\d{2}-\d{2})" foo.txt --output "\$1" 2010-11-13 2010-11-13 2010-11-13 But when I try to use --output with the named group "foo", I cannot get it to work: ack "(?P<foo>\d{4}-\d{2}-\d{2})" foo.txt --output "(?P=foo)" (?=foo) (?=foo) (?=foo) Any help is greatly appreciate it. Thanks

ack: Exclude specific directories from search via regex

十年热恋 提交于 2019-12-20 09:48:59
问题 How do I ignore specific directories via RegEx with ack? I can use the --ignore-dir option, but this does not let me specify a RegEx. I want to be able to ignore any directory, which has the words test or tests or more complicated patterns in its name. I also tried a negative lookbehind via ack -G '(?<!test)' pattern but this does not work. It does not exclude the test directories. 回答1: Use the undocumented option "--invert-file-match" (ack version on my system: 1.96): $ ack pattern -G 'test