Found 23984 results in 6077 files, showing top 50 files (show more).
github.com/llvm-mirror/clang:lib/Sema/AnalysisBasedWarnings.cpp: [ master, ] c++
709:   const DeclRefExpr *Needle;
705: /// a particular declaration (the needle) within any evaluated component of an
714:   ContainsReference(ASTContext &Context, const DeclRefExpr *Needle)
715:     : Inherited(Context), FoundReference(false), Needle(Needle) {}
726:     if (E == Needle)
chromium.googlesource.com/arc/arc:third_party/android/external/chromium/chrome/browser/sync/syncable/syncable.h: [ master, ] c++
1002:     EntryKernel needle;
1001:     // look something up in an index.  Needle in haystack metaphor.
android.googlesource.com/platform/external/chromium:chrome/browser/sync/syncable/syncable.h: [ master, ] c++ Duplicate result
github.com/tensorflow/tfjs-examples:lstm-text-generation/ui.js: [ master, ] javascript
29:     needle: 'Nietzsche'
33:     needle: 'Jules Verne'
37:     needle: 'Shakespeare'
41:     needle: 'TensorFlow.js Code (Compiled, 0.11.7)'
279:       opt.innerHTML = TEXT_DATA_URLS[key].needle;
android.googlesource.com/platform/external/clang:lib/Sema/AnalysisBasedWarnings.cpp: [ master, ] c++
591:   const DeclRefExpr *Needle;
587: /// a particular declaration (the needle) within any evaluated component of an
596:   ContainsReference(ASTContext &Context, const DeclRefExpr *Needle)
597:     : Inherited(Context), FoundReference(false), Needle(Needle) {}
608:     if (E == Needle)
github.com/GoogleCloudPlatform/microservices-demo:src/paymentservice/package-lock.json: [ master, ] json
1038:             "needle": "^2.2.0",
1023:         "needle": {
chromium.googlesource.com/native_client/pnacl-clang:lib/Sema/AnalysisBasedWarnings.cpp: [ master, ] c++
579:   const DeclRefExpr *Needle;
575: /// a particular declaration (the needle) within any evaluated component of an
582:   ContainsReference(ASTContext &Context, const DeclRefExpr *Needle)
584:       FoundReference(false), Needle(Needle) {}
595:     if (E == Needle)
android.googlesource.com/platform/superproject:external/clang/lib/Sema/AnalysisBasedWarnings.cpp: [ master, ] c++ Duplicate result
github.com/chromium/chromium:third_party/abseil-cpp/absl/strings/str_replace_benchmark.cc: [ master, ] c++
30:   const char* needle;
76:       const char* needle_string = nullptr;
79:         auto needlepos = after_replacing_many->find(r.needle, pos);
82:           needle_string = r.needle;
87:       after_replacing_many->replace(next_pos, strlen(needle_string),
80:         if (needlepos != std::string::npos && needlepos < next_pos) {
81:           next_pos = needlepos;
android.googlesource.com/platform/external/clang_35a:lib/Sema/AnalysisBasedWarnings.cpp: [ master, ] c++
577:   const DeclRefExpr *Needle;
573: /// a particular declaration (the needle) within any evaluated component of an
580:   ContainsReference(ASTContext &Context, const DeclRefExpr *Needle)
582:       FoundReference(false), Needle(Needle) {}
593:     if (E == Needle)
github.com/GoogleCloudPlatform/microservices-demo:src/currencyservice/package-lock.json: [ master, ] json
1016:             "needle": "^2.2.0",
1001:         "needle": {
github.com/html5rocks/www.html5rocks.com:static/demos/lemdoodle/examples/lem-planes/lem-const.js: [ master, ] javascript
172:   'needle': ['intro-finale/items-needle-thread', 'intro-finale/items-needle'],
223:     'needle', 'halo', 'noodles', 'neutron', 'nose'
github.com/html5rocks/www.html5rocks.com:static/demos/lemdoodle/examples/lem-embedded/lem-const.js: [ master, ] javascript
172:   'needle': ['intro-finale/items-needle-thread', 'intro-finale/items-needle'],
223:     'needle', 'halo', 'noodles', 'neutron', 'nose'
chromium.googlesource.com/chromium/src:third_party/abseil-cpp/absl/strings/str_replace_benchmark.cc: [ master, ] c++ Duplicate result
chromium.googlesource.com/ios-chromium-mirror:third_party/abseil-cpp/absl/strings/str_replace_benchmark.cc: [ master, ] c++ Duplicate result
github.com/apache/incubator-hawq:src/backend/optimizer/util/clauses.c: [ master, ] c
4510: 	Expr *needle;	/* This is the expression being searched */
4514:  * expression_matching_walker checks if the expression 'needle' in context is a sub-expression of hayStack.
4520: 	Assert(ctx->needle);
4527: 	if (equal(ctx->needle, hayStack))
4542: 	ctx.needle = expr1;
github.com/apache/hawq:src/backend/optimizer/util/clauses.c: [ master, ] c Duplicate result
chromium.googlesource.com/chromium:sync/syncable/directory.h: [ trunk, ] c++
536:     EntryKernel needle;
535:     // look something up in an index.  Needle in haystack metaphor.
github.com/apache/incubator-openwhisk-client-js:package.json: [ master, ] json
57:     "needle": "^2.1.0"
github.com/google/rekall:rekall-core/rekall/scan.py: [ master, ] python
170:     needle = None
171:     needle_offset = None
540:     needles = []
59:         """Is the needle found at 'offset'?
63:             checked for the needle.
173:     def __init__(self, needle=None, needle_offset=0, **kwargs):
175:         self.needle = needle
176:         self.needle_offset = needle_offset
180:         buffer_offset = buffer_as.get_buffer_offset(offset) + self.needle_offset
181:         if buffer_as.data.startswith(self.needle, buffer_offset):
182:             return self.needle
185:         # Search the rest of the buffer for the needle.
186:         buffer_offset = buffer_as.get_buffer_offset(offset) + self.needle_offset
187:         dindex = buffer_as.data.find(self.needle, buffer_offset + 1)
532:             yield ("StringCheck", dict(needle=expected_bytes,
533:                                        needle_offset=rel_offset + array_offset))
553:                 needle=self.needles[0])
96:     def __init__(self, needles=None, **kwargs):
100:           needles: A list of strings we search for.
103:           RuntimeError: No needles provided.
109:         if not needles:
110:             raise RuntimeError("No needles provided to search.")
114:         if max([len(x) for x in needles]) > 50:
118:         # sure all the needles are bytes too.
119:         byte_needles = [utils.SmartStr(x) for x in needles]
120:         tree = acora.AcoraBuilder(*byte_needles)
539:     # Override with the needles to check for.
542:     def __init__(self, needles=None, **kwargs):
544:         if needles is not None:
545:             self.needles = needles
550:         if len(needles) == 1:
557:                 needles=self.needles)
587:         self.needles = []
595:             self.needles.append(tmp.obj_vm.read(0, tmp.obj_size))
597:         # The common string between all the needles.
599:             ("MultiStringFinderCheck", dict(needles=self.needles)),
github.com/GoogleCloudPlatform/appengine-php:php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c: [ master, ] c
874: 	mbfl_wchar_device needle;
875: 	int needle_len;
879: 	int needle_pos;
890: 		if (c == (int)pc->needle.buffer[pc->needle_pos]) {
891: 			if (pc->needle_pos == 0) {
894: 			pc->needle_pos++;						/* needle pointer */
895: 			if (pc->needle_pos >= pc->needle_len) {
897: 				pc->needle_pos--;
900: 		} else if (pc->needle_pos != 0) {
902: 			h = (int *)pc->needle.buffer;
907: 				m = (int *)pc->needle.buffer;
908: 				n = pc->needle_pos - 1;
916: 						pc->needle_pos = 0;
921: 					pc->needle_pos--;
982:     mbfl_string *needle,
987: 	mbfl_string _haystack_u8, _needle_u8;
988: 	const mbfl_string *haystack_u8, *needle_u8;
991: 	if (haystack == NULL || haystack->val == NULL || needle == NULL || needle->val == NULL) {
1015: 	if (needle->no_encoding != mbfl_no_encoding_utf8) {
1016: 		mbfl_string_init(&_needle_u8);
1017: 		needle_u8 = mbfl_convert_encoding(needle, &_needle_u8, mbfl_no_encoding_utf8);
1018: 		if (needle_u8 == NULL) {
1023: 		needle_u8 = needle;
1026: 	if (needle_u8->len < 1) {
1032: 	if (haystack_u8->len < needle_u8->len) {
1038: 		unsigned int needle_u8_len = needle_u8->len;
1042: 		                    *needle_u8_val = needle_u8->val;
1044: 			jtbl[i] = needle_u8_len + 1;
1046: 		for (i = 0; i < needle_u8_len - 1; ++i) {
1047: 			jtbl[needle_u8_val[i]] = needle_u8_len - i;
1058: 		p += needle_u8_len;
1064: 			q = needle_u8_val + needle_u8_len;
1066: 				if (q == needle_u8_val) {
1089: 		unsigned int needle_u8_len = needle_u8->len, needle_len = 0;
1093: 		                    *needle_u8_val = needle_u8->val;
1095: 			jtbl[i] = needle_u8_len;
1097: 		for (i = needle_u8_len - 1; i > 0; --i) {
1098: 			unsigned char c = needle_u8_val[i];
1101: 				++needle_len;
1103: 				++needle_len;
1107: 			unsigned char c = needle_u8_val[0];
1109: 				++needle_len;
1111: 				++needle_len;
1116: 		qe = needle_u8_val + needle_u8_len;
1118: 			if (-offset > needle_len) {
1119: 				offset += needle_len; 
1144: 		if (p < e + needle_u8_len) {
1147: 		p -= needle_u8_len;
1150: 			q = needle_u8_val;
1154: 					p -= needle_u8_len;
1180: 	if (needle_u8 == &_needle_u8) {
1181: 		mbfl_string_clear(&_needle_u8);
1193:     mbfl_string *needle
1201: 	if (haystack == NULL || needle == NULL) {
1204: 	/* needle is converted into wchar */
1205: 	mbfl_wchar_device_init(&pc.needle);
1207: 	  needle->no_encoding,
1209: 	  mbfl_wchar_device_output, 0, &pc.needle);
1213: 	p = needle->val;
1214: 	n = needle->len;
1225: 	pc.needle_len = pc.needle.pos;
1226: 	if (pc.needle.buffer == NULL) {
1229: 	if (pc.needle_len <= 0) {
1230: 		mbfl_wchar_device_clear(&pc.needle);
1239: 		mbfl_wchar_device_clear(&pc.needle);
1244: 	pc.needle_pos = 0;
1260: 				pc.needle_pos = 0;
1267: 	mbfl_wchar_device_clear(&pc.needle);
github.com/firebase/oss-bot:appengine/package-lock.json: [ master, ] json
1528:             "needle": "^2.2.1",
1513:         "needle": {
github.com/google/cargo-raze:examples/vendored/non_cratesio_library/cargo/vendor/memchr-2.0.1/src/lib.rs: [ master, ] rust
106:     needle: u8,
261:     needle1: u8,
262:     needle2: u8,
330:     needle1: u8,
331:     needle2: u8,
332:     needle3: u8,
114:     /// Creates a new iterator that yields all positions of needle in haystack.
115:     pub fn new(needle: u8, haystack: &[u8]) -> Memchr {
117:             needle: needle,
128:         iter_next!(self, memchr(self.needle, &self.haystack))
138:         iter_next_back!(self, memrchr(self.needle, &self.haystack))
144: /// Returns the index corresponding to the first occurrence of `needle` in
148: /// magnitude faster than `haystack.iter().position(|&b| b == needle)`.
162: pub fn memchr(needle: u8, haystack: &[u8]) -> Option<usize> {
170:     fn memchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
175:                         needle as c_int,
190:     fn memchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
191:         fallback::memchr(needle, haystack)
198:     fn memchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
199:         haystack.iter().position(|&b| b == needle)
202:     memchr_specific(needle, haystack)
207: /// Returns the index corresponding to the last occurrence of `needle` in
221: pub fn memrchr(needle: u8, haystack: &[u8]) -> Option<usize> {
225:     fn memrchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
232:                           needle as c_int,
244:     fn memrchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
245:         fallback::memrchr(needle, haystack)
252:     fn memrchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
253:         haystack.iter().rposition(|&b| b == needle)
256:     memrchr_specific(needle, haystack)
270:     /// Creates a new iterator that yields all positions of needle in haystack.
271:     pub fn new(needle1: u8, needle2: u8, haystack: &[u8]) -> Memchr2 {
273:             needle1: needle1,
274:             needle2: needle2,
285:         iter_next!(self, memchr2(self.needle1, self.needle2, &self.haystack))
295: pub fn memchr2(needle1: u8, needle2: u8, haystack: &[u8]) -> Option<usize> {
306:         if let Some(found) = slow(needle1, needle2, &haystack[..i]) {
310:     let repeated_b1 = repeat_byte(needle1);
311:     let repeated_b2 = repeat_byte(needle2);
325:     slow(needle1, needle2, &haystack[i..]).map(|pos| i + pos)
342:         needle1: u8,
343:         needle2: u8,
344:         needle3: u8,
348:             needle1: needle1,
349:             needle2: needle2,
350:             needle3: needle3,
363:             memchr3(self.needle1, self.needle2, self.needle3, &self.haystack)
374:     needle1: u8,
375:     needle2: u8,
376:     needle3: u8,
389:         if let Some(found) = slow(needle1, needle2, needle3, &haystack[..i]) {
393:     let repeated_b1 = repeat_byte(needle1);
394:     let repeated_b2 = repeat_byte(needle2);
395:     let repeated_b3 = repeat_byte(needle3);
410:     slow(needle1, needle2, needle3, &haystack[i..]).map(|pos| i + pos)
573:                 fn prop(needle: u8, haystack: Vec<u8>) -> bool {
574:                     $memchr(needle, &haystack); true
616:                 fn prop(needle: u8, haystack: Vec<u8>) -> bool {
617:                     $memrchr(needle, &haystack); true
717:         fn prop(needle1: u8, needle2: u8, haystack: Vec<u8>) -> bool {
718:             memchr2(needle1, needle2, &haystack);
772:     // needle
773:     fn positions1<'a>(needle: u8, haystack: &'a [u8])
778:                          .filter(move |&(_, &elt)| elt == needle)
782:     fn positions2<'a>(needle1: u8, needle2: u8, haystack: &'a [u8])
788:             .filter(move |&(_, &elt)| elt == needle1 || elt == needle2)
793:         needle1: u8,
794:         needle2: u8,
795:         needle3: u8,
802:                 elt == needle1 || elt == needle2 || elt == needle3
887:             needle1: u8,
888:             needle2: u8,
889:             needle3: u8,
892:             memchr3(needle1, needle2, needle3, &haystack);
1002:         fn qc_memchr_double_ended_iter(needle: u8, data: Vec<u8>,
1009:             let iter = Memchr::new(needle, &data);
1013:             all_found.iter().cloned().eq(positions1(needle, &data))
1017:             let needle = 0;
1018:             let answer = positions1(needle, &data);
1019:             answer.eq(Memchr::new(needle, &data))
1023:             let needle = 0;
1024:             let answer = positions1(needle, &data);
1025:             answer.rev().eq(Memchr::new(needle, &data).rev())
1029:             let needle1 = 0;
1030:             let needle2 = 1;
1031:             let answer = positions2(needle1, needle2, &data);
1032:             answer.eq(Memchr2::new(needle1, needle2, &data))
1036:             let needle1 = 0;
1037:             let needle2 = 1;
1038:             let needle3 = 2;
1039:             let answer = positions3(needle1, needle2, needle3, &data);
1040:             answer.eq(Memchr3::new(needle1, needle2, needle3, &data))
1045:             let needle = 0;
1046:             let mut iter = Memchr::new(needle, &data);
1049:                 .filter(|&&elt| elt == needle)
github.com/google/cargo-raze:examples/vendored/complicated_cargo_library/cargo/vendor/memchr-2.0.1/src/lib.rs: [ master, ] rust Duplicate result
github.com/yeoman/generator-angular:route/index.js: [ master, ] javascript
63:     needle: '.otherwise',
github.com/fuchsia-mirror/third_party-clang:lib/Sema/AnalysisBasedWarnings.cpp: [ master, ] c++ Duplicate result
chromium.googlesource.com/chromium/codesearch:src/third_party/abseil-cpp/absl/strings/str_replace_benchmark.cc: [ master, ] c++ Duplicate result
github.com/fuchsia-mirror/third_party-rust:src/libcore/str/pattern.rs: [ master, ] rust
270:     needle: char,
749:     needle: &'b str,
761: struct EmptyNeedle {
273:     /// The number of bytes `needle` takes up when encoded in utf8
275:     /// A utf8 encoded copy of the `needle`
294:             if ch == self.needle {
313:             // the last byte of the utf8 encoded needle
364:             if ch == self.needle {
383:             // the last byte of the utf8 encoded needle
444:             needle: self,
769:     fn new(haystack: &'a str, needle: &'b str) -> StrSearcher<'a, 'b> {
770:         if needle.is_empty() {
773:                 needle,
784:                 needle,
786:                     TwoWaySearcher::new(needle.as_bytes(), haystack.len())
803:                 // empty needle rejects every char and matches every empty string between them
818:                 // as long as it does correct matching and that haystack and needle are
827:                                                       self.needle.as_bytes(),
862:                                                self.needle.as_bytes(),
866:                                                self.needle.as_bytes(),
897:                                                            self.needle.as_bytes(),
931:                                                     self.needle.as_bytes(),
935:                                                     self.needle.as_bytes(),
949:     /// critical factorization index for reversed needle
954:     /// to a (byte & 63) == j present in the needle.
960:     /// index into needle before which we have already matched
962:     /// index into needle after which we have already matched
1040:     fn new(needle: &[u8], end: usize) -> TwoWaySearcher {
1041:         let (crit_pos_false, period_false) = TwoWaySearcher::maximal_suffix(needle, false);
1042:         let (crit_pos_true, period_true) = TwoWaySearcher::maximal_suffix(needle, true);
1056:         // needle, and we want to determine whether u is a suffix of
1058:         // "Algorithm CP2", which is optimized for when the period of the needle
1060:         if &needle[..crit_pos] == &needle[period.. period + crit_pos] {
1062:             // compute a separate critical factorization for the reversed needle
1070:             let crit_pos_back = needle.len() - cmp::max(
1071:                 TwoWaySearcher::reverse_maximal_suffix(needle, period, false),
1072:                 TwoWaySearcher::reverse_maximal_suffix(needle, period, true));
1078:                 byteset: Self::byteset_create(&needle[..period]),
1083:                 memory_back: needle.len(),
1096:                 period: cmp::max(crit_pos, needle.len() - crit_pos) + 1,
1097:                 byteset: Self::byteset_create(needle),
1117:     // One of the main ideas of Two-Way is that we factorize the needle into
1121:     // that (u, v) is a critical factorization for the needle.
1123:     fn next<S>(&mut self, haystack: &[u8], needle: &[u8], long_period: bool)
1129:         let needle_last = needle.len() - 1;
1132:             // position + needle_last can not overflow if we assume slices
1134:             let tail_byte = match haystack.get(self.position + needle_last) {
1148:                 self.position += needle.len();
1155:             // See if the right part of the needle matches
1158:             for i in start..needle.len() {
1159:                 if needle[i] != haystack[self.position + i] {
1168:             // See if the left part of the needle matches
1171:                 if needle[i] != haystack[self.position + i] {
1174:                         self.memory = needle.len() - self.period;
1183:             // Note: add self.period instead of needle.len() to have overlapping matches
1184:             self.position += needle.len();
1186:                 self.memory = 0; // set to needle.len() - self.period for overlapping matches
1189:             return S::matching(match_pos, match_pos + needle.len());
1204:     // a reversed haystack with a reversed needle, matching first u' and then v'.
1206:     fn next_back<S>(&mut self, haystack: &[u8], needle: &[u8], long_period: bool)
1215:             // end - needle.len() will wrap around when there is no more room,
1218:             let front_byte = match haystack.get(self.end.wrapping_sub(needle.len())) {
1232:                 self.end -= needle.len();
1234:                     self.memory_back = needle.len();
1239:             // See if the left part of the needle matches
1243:                 if needle[i] != haystack[self.end - needle.len() + i] {
1246:                         self.memory_back = needle.len();
1252:             // See if the right part of the needle matches
1253:             let needle_end = if long_period { needle.len() }
1255:             for i in self.crit_pos_back..needle_end {
1256:                 if needle[i] != haystack[self.end - needle.len() + i] {
1266:             let match_pos = self.end - needle.len();
1267:             // Note: sub self.period instead of needle.len() to have overlapping matches
1268:             self.end -= needle.len();
1270:                 self.memory_back = needle.len();
1273:             return S::matching(match_pos, match_pos + needle.len());
756:     Empty(EmptyNeedle),
774:                 searcher: StrSearcherImpl::Empty(EmptyNeedle {
github.com/angular/gulp-clang-format:package-lock.json: [ master, ] json
1416:             "needle": "^2.2.0",
1397:         "needle": {
github.com/apache/airavata-django-portal:django_airavata/apps/api/package-lock.json: [ master, ] json
1226:             "needle": "^2.2.0",
1207:         "needle": {
android.googlesource.com/platform/external/qt:Mac-4.7.4/src/scripttools/debugging/qscriptsyntaxhighlighter.cpp: [ master, ] c++
129:     const QString needle;
128:     inline KeywordHelper(const QString &word) : needle(word) {}
134:     return helper.needle < QLatin1String(kw);
139:     return QLatin1String(kw) < helper.needle;
github.com/GoogleChrome/chrome-app-samples:samples/text-editor/lib/ace/search.js: [ master, ] javascript
49:         needle: "",
74:         if (!this.$options.needle)
94:         if (!options.needle)
204:             var needle = this.$options.needle;
206:             needle = lang.escapeRegExp(this.$options.needle);
210:             needle = "\\b" + needle + "\\b";
218:         var re = new RegExp(needle, modifier);
github.com/GoogleChrome/chrome-app-samples:samples/text-editor/lib/ace/mode/text.js: [ master, ] javascript
135:             needle: needle
117:         var needle = line.substring(Math.max(startOuter, 0),
121:         if ((startOuter >= 0 && /^[\w\d]/.test(needle)) ||
122:             (endOuter <= lineCols && /[\w\d]$/.test(needle)))
125:         needle = line.substring(selection.start.column, selection.end.column);
126:         if (!/^[\w\d]+$/.test(needle))
github.com/fuchsia-mirror/third_party-cmake:Source/cmTarget.cxx: [ master, ] c++
602:   const cmSourceFileLocation& Needle;
618:   const cmSourceFileLocation& Needle;
604:   LocationMatcher(const cmSourceFileLocation& needle)
605:     : Needle(needle)
611:     return loc.Matches(this->Needle);
621:   TargetPropertyEntryFinder(const cmSourceFileLocation& needle)
622:     : Needle(needle)
633:                    CreateLocation(this->Needle.GetMakefile()));
636:                         LocationMatcher(this->Needle)) != locations.end();
github.com/apache/incubator-openwhisk-client-js:lib/client.js: [ master, ] javascript
8: const needle = require('needle')
13:  * This implements a request-promise-like facade over the needle
14:  * library. There are two gaps between needle and rp that need to be
16:  * needle's non-excepting >=400 statusCode responses into exceptions
36:   // this situation than needle
39:   return needle(opts.method.toLowerCase(), // needle takes e.g. 'put' not 'PUT'
github.com/fuchsia-mirror/third_party-rust:src/librustc_mir/util/collect_writes.rs: [ master, ] rust
33:     needle: Local,
24:             let mut visitor = FindLocalAssignmentVisitor{ needle: local, locations: vec![]};
42:         if self.needle != *local {
github.com/fuchsia-mirror/third_party-rust-crates:rustc_deps/vendor/memchr/src/lib.rs: [ master, ] rust Duplicate result
github.com/fuchsia-mirror/third_party-rust-crates:rustc_deps/vendor/twoway/src/lib.rs: [ master, ] rust
143:     needle: &'b str,
155: struct EmptyNeedle {
163:     pub fn new(haystack: &'a str, needle: &'b str) -> StrSearcher<'a, 'b> {
164:         if needle.is_empty() {
167:                 needle: needle,
178:                 needle: needle,
180:                     TwoWaySearcher::new(needle.as_bytes(), haystack.len())
195:                 // empty needle rejects every char and matches every empty string between them
210:                 // as long as it does correct matching and that haystack and needle are
219:                                                       self.needle.as_bytes(),
255:                                                self.needle.as_bytes(),
259:                                                self.needle.as_bytes(),
291:                                                            self.needle.as_bytes(),
325:                                                     self.needle.as_bytes(),
329:                                                     self.needle.as_bytes(),
344:     /// critical factorization index for reversed needle
349:     /// to a (byte & 63) == j present in the needle.
355:     /// index into needle before which we have already matched
357:     /// index into needle after which we have already matched
435:     pub fn new(needle: &[u8], end: usize) -> TwoWaySearcher {
436:         let (crit_pos_false, period_false) = TwoWaySearcher::maximal_suffix(needle, false);
437:         let (crit_pos_true, period_true) = TwoWaySearcher::maximal_suffix(needle, true);
451:         // needle, and we want to determine whether u is a suffix of
453:         // "Algorithm CP2", which is optimized for when the period of the needle
455:         if &needle[..crit_pos] == &needle[period.. period + crit_pos] {
457:             // compute a separate critical factorization for the reversed needle
465:             let crit_pos_back = needle.len() - cmp::max(
466:                 TwoWaySearcher::reverse_maximal_suffix(needle, period, false),
467:                 TwoWaySearcher::reverse_maximal_suffix(needle, period, true));
473:                 byteset: Self::byteset_create(&needle[..period]),
478:                 memory_back: needle.len(),
491:                 period: cmp::max(crit_pos, needle.len() - crit_pos) + 1,
492:                 byteset: Self::byteset_create(needle),
512:     // One of the main ideas of Two-Way is that we factorize the needle into
516:     // that (u, v) is a critical factorization for the needle.
518:     fn next<S>(&mut self, haystack: &[u8], needle: &[u8], long_period: bool)
524:         let needle_last = needle.len() - 1;
527:             // position + needle_last can not overflow if we assume slices
529:             let tail_byte = match haystack.get(self.position + needle_last) {
543:                 self.position += needle.len();
550:             // See if the right part of the needle matches
553:             for i in start..needle.len() {
554:                 if needle[i] != haystack[self.position + i] {
563:             // See if the left part of the needle matches
566:                 if needle[i] != haystack[self.position + i] {
569:                         self.memory = needle.len() - self.period;
578:             // Note: add self.period instead of needle.len() to have overlapping matches
579:             self.position += needle.len();
581:                 self.memory = 0; // set to needle.len() - self.period for overlapping matches
584:             return S::matching(match_pos, match_pos + needle.len());
599:     // a reversed haystack with a reversed needle, matching first u' and then v'.
601:     fn next_back<S>(&mut self, haystack: &[u8], needle: &[u8], long_period: bool)
610:             // end - needle.len() will wrap around when there is no more room,
613:             let front_byte = match haystack.get(self.end.wrapping_sub(needle.len())) {
627:                 self.end -= needle.len();
629:                     self.memory_back = needle.len();
634:             // See if the left part of the needle matches
638:                 if needle[i] != haystack[self.end - needle.len() + i] {
641:                         self.memory_back = needle.len();
647:             // See if the right part of the needle matches
648:             let needle_end = if long_period { needle.len() }
650:             for i in self.crit_pos_back..needle_end {
651:                 if needle[i] != haystack[self.end - needle.len() + i] {
661:             let match_pos = self.end - needle.len();
662:             // Note: sub self.period instead of needle.len() to have overlapping matches
663:             self.end -= needle.len();
665:                 self.memory_back = needle.len();
668:             return S::matching(match_pos, match_pos + needle.len());
150:     Empty(EmptyNeedle),
168:                 searcher: StrSearcherImpl::Empty(EmptyNeedle {
android.googlesource.com/platform/external/qt:Windows-4.7.4/src/scripttools/debugging/qscriptsyntaxhighlighter.cpp: [ master, ] c++
129:     const QString needle;
128:     inline KeywordHelper(const QString &word) : needle(word) {}
134:     return helper.needle < QLatin1String(kw);
139:     return QLatin1String(kw) < helper.needle;
chromium.googlesource.com/arc/arc:third_party/chromium-ppapi/third_party/abseil-cpp/absl/strings/str_replace_benchmark.cc: [ master, ] c++ Duplicate result
chromium.googlesource.com/chromium/src/third_party:abseil-cpp/absl/strings/str_replace_benchmark.cc: [ master, ] c++ Duplicate result
github.com/apache/marmotta:libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/builder/collect/SQLProjectionFinder.java: [ master, ] java
39:     private String needle;
43:     public SQLProjectionFinder(TupleExpr expr, String needle) {
44:         this.needle = needle;
50:         if(node.getName().equals(needle)) {
59:             if(g.equals(needle)) {
68:         if(node.getName().equals(needle)) {
77:             if(elem.getSourceName().equals(needle)) {
eclipse.googlesource.com/jgit/jgit:org.eclipse.jgit/src/org/eclipse/jgit/util/RawSubStringPattern.java: [ master, ] java
59: 	private final byte[] needle;
57: 	private final String needleString;
75: 		needle = new byte[b.length];
77: 			needle[i] = lc(b[i]);
91: 		final int needleLen = needle.length;
92: 		final byte first = needle[0];
109: 				if (neq(needle[j], text[si]))
72: 		needleString = patternText;
96: 		final int maxPos = rcs.endPtr - needleLen;
108: 			for (int j = 1; j < needleLen; j++, si++) {
131: 		return needleString;
github.com/googlearchive/chrome-app-samples:samples/text-editor/lib/ace/search.js: [ master, ] javascript Duplicate result
chromium.googlesource.com/native_client/nacl-toolchain:newlib/newlib/libc/string/memmem.c: [ master, ] c
58:   const unsigned char *needle = (const unsigned char *) needle_start;
24: 	lengths of your haystack and needle, <<memmem>> can be much
49: _DEFUN (memmem, (haystack_start, haystack_len, needle_start, needle_len),
52: 	const void *needle_start _AND
53: 	size_t needle_len)
60:   if (needle_len == 0)
68:   while (needle_len <= haystack_len)
70:       if (!memcmp (haystack, needle, needle_len))
83:   if (haystack_len < needle_len)
90:   if (needle_len < LONG_NEEDLE_THRESHOLD)
92:       haystack = memchr (haystack, *needle, haystack_len);
93:       if (!haystack || needle_len == 1)
96:       if (haystack_len < needle_len)
98:       return two_way_short_needle (haystack, haystack_len, needle, needle_len);
100:   return two_way_long_needle (haystack, haystack_len, needle, needle_len);
88:      coefficient.  However, avoid memchr for long needles, since we
github.com/googlearchive/chrome-app-samples:samples/text-editor/lib/ace/mode/text.js: [ master, ] javascript Duplicate result
chromium.googlesource.com/native_client/nacl-newlib:newlib/libc/string/memmem.c: [ master, ] c Duplicate result
github.com/GoogleCloudPlatform/gcsbeat:vendor/github.com/gobwas/glob/match/contains.go: [ master, ] go
9: 	Needle string
13: func NewContains(needle string, not bool) Contains {
14: 	return Contains{needle, not}
18: 	return strings.Contains(s, self.Needle) != self.Not
24: 	idx := strings.Index(s, self.Needle)
31: 		offset = idx + len(self.Needle)
57: 	return fmt.Sprintf("<contains:%s[%s]>", not, self.Needle)
github.com/apache/marmotta:libraries/ostrich/backend/3rdparty/abseil/absl/strings/string_view_test.cc: [ master, ] c++
699:     std::string needle;
721:     SCOPED_TRACE(s.needle);
727:       EXPECT_EQ(sp.find(s.needle, pos),
728:                 st.find(s.needle, pos));
729:       EXPECT_EQ(sp.rfind(s.needle, pos),
730:                 st.rfind(s.needle, pos));
731:       EXPECT_EQ(sp.find_first_of(s.needle, pos),
732:                 st.find_first_of(s.needle, pos));
733:       EXPECT_EQ(sp.find_first_not_of(s.needle, pos),
734:                 st.find_first_not_of(s.needle, pos));
735:       EXPECT_EQ(sp.find_last_of(s.needle, pos),
736:                 st.find_last_of(s.needle, pos));
737:       EXPECT_EQ(sp.find_last_not_of(s.needle, pos),
738:                 st.find_last_not_of(s.needle, pos));
github.com/angular/protractor:testapp/package-lock.json: [ master, ] json
1493:             "needle": "^2.2.0",
1474:         "needle": {