Found 44659 results in 9396 files, showing top 50 files (show more).
github.com/PolymerLabs/arcs-live:concrete-storage/node_modules/grpc/node_modules/needle/lib/needle.js: [ master, ]
150: function Needle(method, uri, data, options, callback) {
2: // Needle -- HTTP Client for Node.js
13:     debug       = require('debug')('needle'),
26: var user_agent  = 'Needle/' + version;
39: // these are the status codes that Needle interprets as redirects.
151:   // if (!(this instanceof Needle)) {
152:   //   return new Needle(method, uri, data, options, callback);
172: Needle.prototype.setup = function(uri, options) {
283: Needle.prototype.start = function() {
378: Needle.prototype.get_request_opts = function(method, uri, config) {
404: Needle.prototype.should_follow = function(location, config, original) {
426: Needle.prototype.send_request = function(count, method, uri, config, post_data, out, callback) {
785:     return new Needle(method, uri, null, options, callback).start();
791:     return new Needle(method, uri, data, options, callback).start();
796:   return new Needle(method, uri, data, opts, callback).start();
68:   boundary                : '--------------------NODENEEDLEHTTPCLIENT',
github.com/kubernetes/minikube:site/package-lock.json: [ master, ]
1127:             "needle": "^2.2.1",
1108:         "needle": {
github.com/html5rocks/www.html5rocks.com:static/demos/lemdoodle/examples/lem-planes/combined.js: [ master, ]
5051:   'needle': ['intro-finale/items-needle-thread', 'intro-finale/items-needle'],
5102:     'needle', 'halo', 'noodles', 'neutron', 'nose'
13797:     'intro-finale/items-needle-thread',
13798:     'intro-finale/items-needle',
15100:   'intro-finale/items-needle-thread': { width: 68, height: 65, x: 834, y: 0 },
15101:   'intro-finale/items-needle': { top: 8, width: 59, height: 51, x: 904, y: 0 },
github.com/html5rocks/www.html5rocks.com:static/demos/lemdoodle/examples/lem-embedded/combined.js: [ master, ]
5024:   'needle': ['intro-finale/items-needle-thread', 'intro-finale/items-needle'],
5075:     'needle', 'halo', 'noodles', 'neutron', 'nose'
13843:             nItems = ['needle', 'noodles'];
15362:     'intro-finale/items-needle-thread',
15363:     'intro-finale/items-needle',
16665:   'intro-finale/items-needle-thread': { width: 68, height: 65, x: 834, y: 0 },
16666:   'intro-finale/items-needle': { top: 8, width: 59, height: 51, x: 904, y: 0 },
github.com/apache/beam:website/www/site/themes/docsy/userguide/package-lock.json: [ master, ]
1098:             "needle": "^2.2.1",
1079:         "needle": {
github.com/kubernetes/website:themes/docsy/userguide/package-lock.json: [ master, ]
1098:             "needle": "^2.2.1",
1079:         "needle": {
github.com/llvm-mirror/clang:lib/Sema/AnalysisBasedWarnings.cpp: [ master, ]
727:   const DeclRefExpr *Needle;
723: /// a particular declaration (the needle) within any evaluated component of an
732:   ContainsReference(ASTContext &Context, const DeclRefExpr *Needle)
733:     : Inherited(Context), FoundReference(false), Needle(Needle) {}
744:     if (E == Needle)
android.googlesource.com/platform/external/rust/crates/memchr:src/memmem/mod.rs: [ master, ]
520:     pub fn needle(&self) -> &[u8] {
651:     pub fn needle(&self) -> &[u8] {
712:     needle: CowBytes<'n>,
836:     fn needle(&self) -> &[u8] {
1006:     needle: CowBytes<'n>,
1045:     fn needle(&self) -> &[u8] {
730: pub(crate) struct NeedleInfo {
987: impl NeedleInfo {
7: the empty needle, the standard library reports matches only at valid UTF-8
51: # Example: repeating a search for the same needle
54: measurable in some workloads. In cases where the same needle is used to search
103:                 needle: Vec<u8>
105:                 proptests::matches_naive(false, &haystack, &needle, $fwd)
118:                 needle: Vec<u8>
120:                 proptests::matches_naive(true, &haystack, &needle, $rev)
167: /// with respect to both the needle and the haystack. That is, this runs
168: /// in `O(needle.len() + haystack.len())` time.
190:     needle: &'n N,
192:     FindIter::new(haystack, Finder::new(needle))
201: /// with respect to both the needle and the haystack. That is, this runs
202: /// in `O(needle.len() + haystack.len())` time.
224:     needle: &'n N,
226:     FindRevIter::new(haystack, FinderRev::new(needle))
229: /// Returns the index of the first occurrence of the given needle.
231: /// Note that if you're are searching for the same needle in many different
238: /// with respect to both the needle and the haystack. That is, this runs
239: /// in `O(needle.len() + haystack.len())` time.
257: pub fn find(haystack: &[u8], needle: &[u8]) -> Option<usize> {
259:         rabinkarp::find(haystack, needle)
261:         Finder::new(needle).find(haystack)
265: /// Returns the index of the last occurrence of the given needle.
267: /// Note that if you're are searching for the same needle in many different
274: /// with respect to both the needle and the haystack. That is, this runs
275: /// in `O(needle.len() + haystack.len())` time.
294: pub fn rfind(haystack: &[u8], needle: &[u8]) -> Option<usize> {
296:         rabinkarp::rfind(haystack, needle)
298:         FinderRev::new(needle).rfind(haystack)
307: /// needle.
342:                 self.pos = pos + core::cmp::max(1, self.finder.needle().len());
354: /// needle.
359:     /// When searching with an empty needle, this gets set to `None` after
398: /// A single substring searcher fixed to a particular needle.
403: /// concern when it's necessary to re-use the same needle to search multiple
410: /// the lifetime of its needle.
417:     /// Create a new finder for the given needle.
419:     pub fn new<B: ?Sized + AsRef<[u8]>>(needle: &'n B) -> Finder<'n> {
420:         FinderBuilder::new().build_forward(needle)
423:     /// Returns the index of the first occurrence of this needle in the given
429:     /// with respect to both the needle and the haystack. That is, this runs
430:     /// in `O(needle.len() + haystack.len())` time.
456:     /// with respect to both the needle and the haystack. That is, this runs
457:     /// in `O(needle.len() + haystack.len())` time.
486:     /// borrows the needle.
489:     /// this copies the needle.
505:     /// needle itself. Namely, a finder's needle can be either borrowed or
506:     /// owned, so the lifetime of the needle returned must necessarily be the
513:     /// Returns the needle that this finder searches for.
515:     /// Note that the lifetime of the needle returned is tied to the lifetime
517:     /// finder's needle can be either borrowed or owned, so the lifetime of the
518:     /// needle returned must necessarily be the shorter of the two.
521:         self.searcher.needle()
525: /// A single substring reverse searcher fixed to a particular needle.
530: /// concern when it's necessary to re-use the same needle to search multiple
537: /// the lifetime of its needle.
544:     /// Create a new reverse finder for the given needle.
546:     pub fn new<B: ?Sized + AsRef<[u8]>>(needle: &'n B) -> FinderRev<'n> {
547:         FinderBuilder::new().build_reverse(needle)
550:     /// Returns the index of the last occurrence of this needle in the given
559:     /// with respect to both the needle and the haystack. That is, this runs
560:     /// in `O(needle.len() + haystack.len())` time.
587:     /// with respect to both the needle and the haystack. That is, this runs
588:     /// in `O(needle.len() + haystack.len())` time.
617:     /// borrows the needle.
620:     /// this copies the needle.
636:     /// needle itself. Namely, a finder's needle can be either borrowed or
637:     /// owned, so the lifetime of the needle returned must necessarily be the
644:     /// Returns the needle that this finder searches for.
646:     /// Note that the lifetime of the needle returned is tied to the lifetime
648:     /// finder's needle can be either borrowed or owned, so the lifetime of the
649:     /// needle returned must necessarily be the shorter of the two.
652:         self.searcher.needle()
672:     /// Build a forward finder using the given needle from the current
676:         needle: &'n B,
678:         Finder { searcher: Searcher::new(self.config, needle.as_ref()) }
681:     /// Build a reverse finder using the given needle from the current
685:         needle: &'n B,
687:         FinderRev { searcher: SearcherRev::new(needle.as_ref()) }
703: /// variety of parameters (CPU support, target, needle size, haystack size and
708:     /// The actual needle we're searching for.
713:     /// A collection of facts computed on the needle that are useful for more
725: /// A collection of facts computed about a search needle.
731:     /// The offsets of "rare" bytes detected in the needle.
735:     /// one or two bytes. If we pick bytes from the needle that occur
742:     /// A Rabin-Karp hash of the needle.
764:     /// A special case for empty needles. An empty needle always matches, even
767:     /// This is used whenever the needle is a single byte. In this case, we
771:     /// linear time guarantee. In general, it's used when the needle is bigger
782:     fn new(config: SearcherConfig, needle: &'n [u8]) -> Searcher<'n> {
785:         let ninfo = NeedleInfo::new(needle);
787:             prefilter::forward(&config.prefilter, &ninfo.rarebytes, needle);
788:         let kind = if needle.len() == 0 {
790:         } else if needle.len() == 1 {
791:             OneByte(needle[0])
792:         } else if let Some(fwd) = x86::avx::Forward::new(&ninfo, needle) {
794:         } else if let Some(fwd) = x86::sse::Forward::new(&ninfo, needle) {
797:             TwoWay(twoway::Forward::new(needle))
799:         Searcher { needle: CowBytes::new(needle), ninfo, prefn, kind }
803:     fn new(config: SearcherConfig, needle: &'n [u8]) -> Searcher<'n> {
806:         let ninfo = NeedleInfo::new(needle);
808:             prefilter::forward(&config.prefilter, &ninfo.rarebytes, needle);
809:         let kind = if needle.len() == 0 {
811:         } else if needle.len() == 1 {
812:             OneByte(needle[0])
814:             TwoWay(twoway::Forward::new(needle))
816:         Searcher { needle: CowBytes::new(needle), ninfo, prefn, kind }
837:         self.needle.as_slice()
861:             needle: CowBytes::new(self.needle()),
890:             needle: self.needle.into_owned(),
908:         let needle = self.needle();
909:         if haystack.len() < needle.len() {
918:                 if rabinkarp::is_fast(haystack, needle) {
919:                     rabinkarp::find_with(&self.ninfo.nhash, haystack, needle)
921:                     self.find_tw(tw, state, haystack, needle)
933:                     rabinkarp::find_with(&self.ninfo.nhash, haystack, needle)
935:                     gs.find(haystack, needle)
947:                     rabinkarp::find_with(&self.ninfo.nhash, haystack, needle)
949:                     gs.find(haystack, needle)
955:     /// Calls Two-Way on the given haystack/needle.
970:         needle: &[u8],
980:                 return tw.find(Some(&mut pre), haystack, needle);
983:         tw.find(None, haystack, needle)
988:     pub(crate) fn new(needle: &[u8]) -> NeedleInfo {
990:             rarebytes: RareNeedleBytes::forward(needle),
991:             nhash: NeedleHash::forward(needle),
1005:     /// The actual needle we're searching for.
1007:     /// A Rabin-Karp hash of the needle.
1015:     /// A special case for empty needles. An empty needle always matches, even
1018:     /// This is used whenever the needle is a single byte. In this case, we
1022:     /// linear time guarantee. In general, it's used when the needle is bigger
1028:     fn new(needle: &'n [u8]) -> SearcherRev<'n> {
1031:         let kind = if needle.len() == 0 {
1033:         } else if needle.len() == 1 {
1034:             OneByte(needle[0])
1036:             TwoWay(twoway::Reverse::new(needle))
1039:             needle: CowBytes::new(needle),
1040:             nhash: NeedleHash::reverse(needle),
1046:         self.needle.as_slice()
1058:             needle: CowBytes::new(self.needle()),
1074:             needle: self.needle.into_owned(),
1087:         let needle = self.needle();
1088:         if haystack.len() < needle.len() {
1097:                 if rabinkarp::is_fast(haystack, needle) {
1098:                     rabinkarp::rfind_with(&self.nhash, haystack, needle)
1100:                     tw.rfind(haystack, needle)
1164:         needle: &[u8],
1168:             naive_rfind(haystack, needle) == search(haystack, needle)
1170:             naive_find(haystack, needle) == search(haystack, needle)
1174:     /// Naively search forwards for the given needle in the given haystack.
1175:     fn naive_find(haystack: &[u8], needle: &[u8]) -> Option<usize> {
1176:         if needle.is_empty() {
1178:         } else if haystack.len() < needle.len() {
1181:         for i in 0..(haystack.len() - needle.len() + 1) {
1182:             if needle == &haystack[i..i + needle.len()] {
1189:     /// Naively search in reverse for the given needle in the given haystack.
1190:     fn naive_rfind(haystack: &[u8], needle: &[u8]) -> Option<usize> {
1191:         if needle.is_empty() {
1193:         } else if haystack.len() < needle.len() {
1196:         for i in (0..(haystack.len() - needle.len() + 1)).rev() {
1197:             if needle == &haystack[i..i + needle.len()] {
1212:     /// Each test is a (needle, haystack, expected_fwd, expected_rev) tuple.
1258:     /// accepts a haystack and a needle and returns the starting position
1259:     /// of the first occurrence of needle in the haystack, or `None` if one
1264:         for &(needle, haystack, expected_fwd, _) in SEARCH_TESTS {
1265:             let (n, h) = (needle.as_bytes(), haystack.as_bytes());
1269:                 "needle: {:?}, haystack: {:?}, expected: {:?}",
1278:     /// accepts a haystack and a needle and returns the starting position of
1279:     /// the last occurrence of needle in the haystack, or `None` if one doesn't
1284:         for &(needle, haystack, _, expected_rev) in SEARCH_TESTS {
1285:             let (n, h) = (needle.as_bytes(), haystack.as_bytes());
1289:                 "needle: {:?}, haystack: {:?}, expected: {:?}",
5: arbitrary bytes. For all non-empty needles, these routines will report exactly
75:         rabinkarp::NeedleHash,
715:     ninfo: NeedleInfo,
751:     pub(crate) nhash: NeedleHash,
989:         NeedleInfo {
1008:     nhash: NeedleHash,
76:         rarebytes::RareNeedleBytes,
741:     pub(crate) rarebytes: RareNeedleBytes,
android.googlesource.com/platform/external/rust/crates/bstr:src/ext_slice.rs: [ master, ]
3081:     pub fn needle(&self) -> &[u8] {
3164:     pub fn needle(&self) -> &[u8] {
3211:     needle: &'n [u8],
3239:     needle: &'n [u8],
3255:     fn needle(&self) -> &'n [u8] {
625:     /// Returns true if and only if this byte string contains the given needle.
639:     fn contains_str<B: AsRef<[u8]>>(&self, needle: B) -> bool {
640:         self.find(needle).is_some()
679:     /// Returns the index of the first occurrence of the given needle.
681:     /// The needle may be any type that can be cheaply converted into a
684:     /// Note that if you're are searching for the same needle in many
691:     /// with respect to both the needle and the haystack. That is, this runs
692:     /// in `O(needle.len() + haystack.len())` time.
710:     fn find<B: AsRef<[u8]>>(&self, needle: B) -> Option<usize> {
711:         Finder::new(needle.as_ref()).find(self.as_bytes())
714:     /// Returns the index of the last occurrence of the given needle.
716:     /// The needle may be any type that can be cheaply converted into a
719:     /// Note that if you're are searching for the same needle in many
727:     /// with respect to both the needle and the haystack. That is, this runs
728:     /// in `O(needle.len() + haystack.len())` time.
747:     fn rfind<B: AsRef<[u8]>>(&self, needle: B) -> Option<usize> {
748:         FinderReverse::new(needle.as_ref()).rfind(self.as_bytes())
752:     /// needle. The iterator yields byte offset positions indicating the start
758:     /// with respect to both the needle and the haystack. That is, this runs
759:     /// in `O(needle.len() + haystack.len())` time.
791:         needle: &'n B,
793:         Find::new(self.as_bytes(), needle.as_ref())
797:     /// needle in reverse. The iterator yields byte offset positions indicating
803:     /// with respect to both the needle and the haystack. That is, this runs
804:     /// in `O(needle.len() + haystack.len())` time.
836:         needle: &'n B,
838:         FindReverse::new(self.as_bytes(), needle.as_ref())
1423:     /// The needle may be any type that can be cheaply converted into a
1468:     /// The needle may be any type that can be cheaply converted into a
1509:     /// Replace all matches of the given needle with the given replacement, and
1535:     /// When the needle is an empty string:
1547:         needle: N,
1551:         self.replace_into(needle, replacement, &mut dest);
1555:     /// Replace up to `limit` matches of the given needle with the given
1581:     /// When the needle is an empty string:
1593:         needle: N,
1598:         self.replacen_into(needle, replacement, limit, &mut dest);
1602:     /// Replace all matches of the given needle with the given replacement,
1636:     /// When the needle is an empty string:
1651:         needle: N,
1655:         let (needle, replacement) = (needle.as_ref(), replacement.as_ref());
1658:         for start in self.find_iter(needle) {
1661:             last = start + needle.len();
1666:     /// Replace up to `limit` matches of the given needle with the given
1700:     /// When the needle is an empty string:
1715:         needle: N,
1720:         let (needle, replacement) = (needle.as_ref(), replacement.as_ref());
1723:         for start in self.find_iter(needle).take(limit) {
1726:             last = start + needle.len();
3035: /// A single substring searcher fixed to a particular needle.
3040: /// concern when it's necessary to re-use the same needle to search multiple
3050: /// lifetime of its needle.
3055:     /// Create a new finder for the given needle.
3057:     pub fn new<B: ?Sized + AsRef<[u8]>>(needle: &'a B) -> Finder<'a> {
3058:         Finder(memmem::Finder::new(needle.as_ref()))
3062:     /// borrows the needle.
3065:     /// this copies the needle.
3074:     /// Returns the needle that this finder searches for.
3076:     /// Note that the lifetime of the needle returned is tied to the lifetime
3078:     /// finder's needle can be either borrowed or owned, so the lifetime of the
3079:     /// needle returned must necessarily be the shorter of the two.
3082:         self.0.needle()
3085:     /// Returns the index of the first occurrence of this needle in the given
3094:     /// with respect to both the needle and the haystack. That is, this runs
3095:     /// in `O(needle.len() + haystack.len())` time.
3118: /// A single substring reverse searcher fixed to a particular needle.
3123: /// concern when it's necessary to re-use the same needle to search multiple
3133: /// the lifetime of its needle.
3138:     /// Create a new reverse finder for the given needle.
3140:     pub fn new<B: ?Sized + AsRef<[u8]>>(needle: &'a B) -> FinderReverse<'a> {
3141:         FinderReverse(memmem::FinderRev::new(needle.as_ref()))
3145:     /// borrows the needle.
3148:     /// this copies the needle.
3157:     /// Returns the needle that this finder searches for.
3159:     /// Note that the lifetime of the needle returned is tied to the lifetime
3161:     /// a finder's needle can be either borrowed or owned, so the lifetime of
3162:     /// the needle returned must necessarily be the shorter of the two.
3165:         self.0.needle()
3168:     /// Returns the index of the last occurrence of this needle in the given
3177:     /// with respect to both the needle and the haystack. That is, this runs
3178:     /// in `O(needle.len() + haystack.len())` time.
3206: /// needle.
3215:     fn new(haystack: &'h [u8], needle: &'n [u8]) -> Find<'h, 'n> {
3216:         Find { it: memmem::find_iter(haystack, needle), haystack, needle }
3234: /// needle.
3243:     fn new(haystack: &'h [u8], needle: &'n [u8]) -> FindReverse<'h, 'n> {
3245:             it: memmem::rfind_iter(haystack, needle),
3247:             needle,
3256:         self.needle
3432:                 self.last = start + self.finder.needle.len();
3487:                 let nlen = self.finder.needle().len();
gerrit.googlesource.com/plugins/image-diff:package-lock.json: [ master, ]
1435:                 "needle": "^2.2.1",
1410:         "needle": {
1412:             "resolved": "https://registry.npmjs.org/needle/-/needle-2.5.0.tgz",
github.com/ampproject/amp.dev:pixi/cloud-function/package-lock.json: [ future, ]
938: 				"needle": "bin/needle"
1147: 				"needle": "^2.5.2",
2371: 				"needle": "^2.5.2",
928: 		"node_modules/needle": {
930: 			"resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz",
944: 		"node_modules/needle/node_modules/debug": {
2220: 		"needle": {
2222: 			"resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz",
github.com/apache/trafficcontrol:traffic_portal/app/src/package-lock.json: [ master, ]
1616:                 "needle": "bin/needle"
1871:                 "needle": "2.4.0",
4391:                 "needle": "2.4.0",
1606:         "node_modules/needle": {
1608:             "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz",
1622:         "node_modules/needle/node_modules/debug": {
1630:         "node_modules/needle/node_modules/ms": {
4193:         "needle": {
4195:             "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz",
github.com/apache/trafficcontrol:experimental/traffic-portal/build/package-lock.json: [ master, ]
1065:         "needle": "bin/needle"
1230:         "needle": "2.4.0",
2783:         "needle": "2.4.0",
1055:     "node_modules/needle": {
1057:       "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz",
1071:     "node_modules/needle/node_modules/debug": {
2640:     "needle": {
2642:       "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz",
chromium.googlesource.com/native_client/nacl-llvm-project-v10:clang/lib/Sema/AnalysisBasedWarnings.cpp: [ master, ]
727:   const DeclRefExpr *Needle;
723: /// a particular declaration (the needle) within any evaluated component of an
732:   ContainsReference(ASTContext &Context, const DeclRefExpr *Needle)
733:     : Inherited(Context), FoundReference(false), Needle(Needle) {}
744:     if (E == Needle)
android.googlesource.com/platform/external/clang:lib/Sema/AnalysisBasedWarnings.cpp: [ master, ]
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)
chromium.googlesource.com/devtools/devtools-frontend:node_modules/mocha/package.json: [ master, ]
131:     "needle": "^2.5.0",
chromium.googlesource.com/native_client/pnacl-clang:lib/Sema/AnalysisBasedWarnings.cpp: [ master, ]
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)
github.com/google/myanmar-tools:clients/js/package-lock.json: [ master, ]
1892:             "needle": "^2.2.1",
1871:         "needle": {
1873:           "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz",
android.googlesource.com/platform/external/clang_35a:lib/Sema/AnalysisBasedWarnings.cpp: [ master, ]
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/bazelbuild/rules_nodejs:tools/fine_grained_deps_npm/package-lock.json: [ master, ]
768:             "needle": "^2.2.0",
751:         "needle": {
github.com/googlei18n/myanmar-tools:clients/js/package-lock.json: [ master, ] Duplicate result
github.com/google/kf:docs/kf.dev/themes/docsy/userguide/package-lock.json: [ master, ]
1098:             "needle": "^2.2.1",
1079:         "needle": {
github.com/apache/hawq:src/backend/optimizer/util/clauses.c: [ master, ]
4575: 	Expr *needle;	/* This is the expression being searched */
4579:  * expression_matching_walker checks if the expression 'needle' in context is a sub-expression of hayStack.
4585: 	Assert(ctx->needle);
4592: 	if (equal(ctx->needle, hayStack))
4607: 	ctx.needle = expr1;
chromium.googlesource.com/chromium:sync/syncable/directory.h: [ trunk, ]
536:     EntryKernel needle;
535:     // look something up in an index.  Needle in haystack metaphor.
chromium.googlesource.com/git/chromium:sync/syncable/directory.h: [ trunk, ] Duplicate result
github.com/GoogleCloudPlatform/cloud-ops-sandbox:website/themes/docsy/userguide/package-lock.json: [ master, ] Duplicate result
android.googlesource.com/platform/external/jazzer-api:agent/src/jmh/java/com/code_intelligence/jazzer/runtime/FuzzerCallbacksBenchmark.java: [ master, ]
173:     String needle;
179:       needle = randomString(length, asciiOnly);
199:     FuzzerCallbacks.traceStrstr(state.haystack, state.needle, state.pc);
204:     FuzzerCallbacksOptimizedNonCritical.traceStrstr(state.haystack, state.needle, state.pc);
211:     FuzzerCallbacksOptimizedCritical.traceStrstrJava(state.haystack, state.needle, state.pc);
217:     FuzzerCallbacksOptimizedNonCritical.traceStrstrJava(state.haystack, state.needle, state.pc);
github.com/google/llvm-propeller:clang/lib/Sema/AnalysisBasedWarnings.cpp: [ plo-dev, ] Duplicate result
github.com/kubernetes/contributor-site:themes/docsy/userguide/package-lock.json: [ master, ] Duplicate result
github.com/apache/druid:web-console/src/react-table/react-table-utils.ts: [ master, ]
76:   needle: string;
123:   const { mode, needle } = modeAndNeedle;
145:   const { mode, needle } = modeAndNeedle;
74: interface FilterModeAndNeedle {
88: export function parseFilterModeAndNeedle(
102: export function combineModeAndNeedle(mode: FilterMode, needle: string): string {
121:   const modeAndNeedle = parseFilterModeAndNeedle(filter);
143:   const modeAndNeedle = parseFilterModeAndNeedle(filter);
83:   needle: string,
85:   return addOrUpdateFilter(filters, { id, value: combineModeAndNeedle(mode, needle) });
98:     needle: m[2] || '',
103:   return `${mode}${needle}`;
126:       return String(value) === needle;
129:       return String(value) !== needle;
132:       return String(value) <= needle;
135:       return String(value) >= needle;
138:       return caseInsensitiveContains(String(value), needle);
149:       return column.equal(needle);
152:       return column.unequal(needle);
155:       return column.lessThanOrEqual(needle);
158:       return column.greaterThanOrEqual(needle);
161:       return F('LOWER', column).like(`%${needle.toLowerCase()}%`);
91: ): FilterModeAndNeedle | undefined {
122:   if (!modeAndNeedle) return true;
144:   if (!modeAndNeedle) return;
github.com/apache/incubator-doris:be/src/vec/common/volnitsky.h: [ master, ]
146:     const UInt8* needle;
147:     size_t needle_size;
148:     const UInt8* needle_end = needle + needle_size;
75: static inline bool isFallbackNeedle(const size_t needle_size, size_t haystack_size_hint = 0) {
248:     const std::vector<StringRef>& needles;
251:     std::vector<size_t> fallback_needles;
36:   * `haystack` and `needle` can contain zero bytes.
39:   * - if the `needle` is too small or too large, or too small `haystack`, use std::search or memchr;
41:   *    hash from the bigram of needle -> the position of this bigram in needle + 1.
44:   * - bigrams can be inserted several times if they occur in the needle several times;
45:   * - when searching, take from haystack bigram, which should correspond to the last bigram of needle (comparing from the end);
48:   * - if not found, skip to haystack almost the size of the needle bytes;
62:         UInt8; /// Offset in the needle. For the basic algorithm, the length of the needle must not be greater than 255.
76:     return needle_size < 2 * sizeof(Ngram) || needle_size >= std::numeric_limits<Offset>::max() ||
142: /// @todo store lowercase needle to speed up in case there are numerous occurrences of bigrams from needle in haystack
150:     size_t step = needle_size - sizeof(VolnitskyTraits::Ngram) + 1;
152:     /** max needle length is 255, max distinct ngrams for case-sensitive is (255 - 1), case-insensitive is 4 * (255 - ...(2 bytes skipped)...
167:     VolnitskyBase(const char* const needle_, const size_t needle_size_,
169:             : needle {reinterpret_cast<const UInt8*>(needle_)},
170:               needle_size {needle_size_},
171:               fallback {VolnitskyTraits::isFallbackNeedle(needle_size, haystack_size_hint)},
172:               fallback_searcher {needle_, needle_size} {
183:         for (auto i = static_cast<ssize_t>(needle_size - sizeof(VolnitskyTraits::Ngram)); i >= 0;
185:             bool ok = VolnitskyTraits::putNGram<CaseSensitive, ASCII>(needle + i, i + 1, needle,
186:                                                                       needle_size, callback);
202:         if (needle_size == 0) return haystack;
206:         if (fallback || haystack_size <= needle_size || fallback_searcher.force_fallback)
209:         /// Let's "apply" the needle to the haystack and compare the n-gram from the end of the needle.
210:         const auto* pos = haystack + needle_size - sizeof(VolnitskyTraits::Ngram);
211:         for (; pos <= haystack_end - needle_size; pos += step) {
304:             const char* cur_needle_data = needles[last].data;
305:             const size_t cur_needle_size = needles[last].size;
308:             if (VolnitskyTraits::isFallbackNeedle(cur_needle_size)) {
316:                 buf += cur_needle_size - sizeof(VolnitskyTraits::Ngram) + 1;
321:                 step = std::min(step, cur_needle_size - sizeof(VolnitskyTraits::Ngram) + 1);
322:                 for (auto i = static_cast<int>(cur_needle_size - sizeof(VolnitskyTraits::Ngram));
325:                             reinterpret_cast<const UInt8*>(cur_needle_data) + i, i + 1,
326:                             reinterpret_cast<const UInt8*>(cur_needle_data), cur_needle_size,
330:             fallback_searchers.emplace_back(cur_needle_data, cur_needle_size);
64:         UInt8; /// Index of the string (within the array of multiple needles), must not be greater than 255.
247:     /// needles and their offsets
272:     explicit MultiVolnitskyBase(const std::vector<StringRef>& needles_)
273:             : needles {needles_}, step {0}, last {0} {
274:         fallback_searchers.reserve(needles.size());
284:      * This function is a kind of fallback if there are many needles.
285:      * We actually destroy the hash table and initialize it with uninitialized needles
290:      *     search inside the haystack with the known needles
294:         if (last == needles.size()) return false;
297:         fallback_needles.clear();
301:         size_t size = needles.size();
309:                 fallback_needles.push_back(last);
318: ...(3 bytes skipped)...             /// this is the condition when we actually need to stop and start searching with known needles
336:         const size_t fallback_size = fallback_needles.size();
338:             if (fallback_searchers[fallback_needles[i]].search(haystack, haystack_end) !=
351:                         if (res + needles[ind].size <= haystack_end &&
362:         const size_t fallback_size = fallback_needles.size();
367:             if (fallback_searchers[fallback_needles[i]].search(haystack, haystack_end) !=
369:                 answer = std::min(answer, fallback_needles[i]);
380:                         if (res + needles[ind].size <= haystack_end &&
398:         const size_t fallback_size = fallback_needles.size();
403:             if (auto pos = fallback_searchers[fallback_needles[i]].search(haystack, haystack_end);
416:                         if (res + needles[ind].size <= haystack_end &&
430:         const size_t fallback_size = fallback_needles.size();
433:                     fallback_searchers[fallback_needles[i]].search(haystack, haystack_end);
434:             if (ptr != haystack_end) answer[fallback_needles[i]] = count_chars(haystack, ptr);
446:                         if (answer[ind] == 0 && res + needles[ind].size <= haystack_end &&
github.com/google/rekall:rekall-core/rekall/scan.py: [ master, ]
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)),
chromium.googlesource.com/chromium/src/third_party:rust/memchr/v2/crate/src/memmem/mod.rs: [ master, ] Duplicate result
github.com/apache/sling-whiteboard:serverless-microsling/package-lock.json: [ master, ]
992:         "needle": "^2.1.0"
901:     "needle": {
903:       "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz",
github.com/google/virtual-authenticators-tab:package-lock.json: [ master, ]
1694:             "needle": "^2.2.1",
1675:         "needle": {
github.com/google/cyanobyte:docs/themes/docsy/userguide/package-lock.json: [ master, ] Duplicate result
github.com/google/streetview-publish-client-libraries:client_libraries/nodejs_library/package-lock.json: [ master, ]
1140:             "needle": "^2.2.1",
1125:         "needle": {
github.com/yeoman/generator-angular:route/index.js: [ master, ]
63:     needle: '.otherwise',
github.com/google/gvisor-website:themes/docsy/userguide/package-lock.json: [ master, ] Duplicate result
github.com/apache/incubator-doris:be/src/vec/common/string_searcher.h: [ master, ]
74:     const uint8_t* const needle;
309:     const char* const needle;
333:     const char* const needle;
75:     const uint8_t* const needle_end;
236:     size_t needle_size;
76:     /// first character in `needle`
82:     /// vector of first 16 characters of `needle`
90:     StringSearcher(const CharT* needle_, const size_t needle_size)
91:             : needle {reinterpret_cast<const uint8_t*>(needle_)},
92:               needle_end {needle + needle_size} {
93:         if (0 == needle_size) return;
95:         first = *needle;
100:         const auto* needle_pos = needle;
106:             if (needle_pos != needle_end) {
107:                 cache = _mm_insert_epi8(cache, *needle_pos, n - 1);
109:                 ++needle_pos;
120:         if (needle_end - needle > n && page_safe(pos)) {
128:                     const auto* needle_pos = needle + n;
130:                     while (needle_pos < needle_end && *pos == *needle_pos) ++pos, ++needle_pos;
132:                     if (needle_pos == needle_end) return true;
143:             const auto* needle_pos = needle + 1;
145:             while (needle_pos < needle_end && *pos == *needle_pos) ++pos, ++needle_pos;
147:             if (needle_pos == needle_end) return true;
156:         if (needle == needle_end) return haystack;
186:                             const auto* needle_pos = needle + n;
188:                             while (haystack_pos < haystack_end && needle_pos < needle_end &&
189:                                    *haystack_pos == *needle_pos)
190:                                 ++haystack_pos, ++needle_pos;
192:                             if (needle_pos == needle_end) return haystack;
207:                 const auto* needle_pos = needle + 1;
209:                 while (haystack_pos < haystack_end && needle_pos < needle_end &&
210:                        *haystack_pos == *needle_pos)
211:                     ++haystack_pos, ++needle_pos;
213:                 if (needle_pos == needle_end) return haystack;
229: // Searches for needle surrounded by token-separators.
241:     TokenSearcher(const CharT* needle_, const size_t needle_size_)
242:             : searcher {needle_, needle_size_}, needle_size(needle_size_) {
243:         if (std::any_of(needle_, needle_ + needle_size_, isTokenSeparator)) {
244:             //throw Exception{"Needle must not contain whitespace or separator characters", ErrorCodes::BAD_ARGUMENTS};
252:         // use searcher only if pos is in the beginning of token and pos + searcher.needle_size is end of token.
271:             pos += needle_size;
287:                (p + needle_size >= haystack_end || isTokenSeparator(*(p + needle_size)));
313:     LibCASCIICaseSensitiveStringSearcher(const CharT* const needle_, const size_t /* needle_size */)
314:             : needle(reinterpret_cast<const char*>(needle_)) {}
320:                                  reinterpret_cast<const char*>(needle));
337:     LibCASCIICaseInsensitiveStringSearcher(const CharT* const needle_,
338:                                            const size_t /* needle_size */)
339:             : needle(reinterpret_cast<const char*>(needle_)) {}
345:                                      reinterpret_cast<const char*>(needle));
github.com/apache/openwhisk-client-js:package.json: [ master, ]
55:     "needle": "^2.4.0"
github.com/grpc/grpc.io:themes/docsy/userguide/package-lock.json: [ master, ] Duplicate result
github.com/GNOME/libdazzle:src/search/dzl-fuzzy-index-cursor.c: [ mainline, ]
65:   const gchar                     *needle;
408:   lookup.needle = query;
github.com/tensorflow/tfjs-examples:lstm-text-generation/data.js: [ master, ]
26:     needle: 'Nietzsche'
31:     needle: 'Jules Verne'
36:     needle: 'Shakespeare'
40:     needle: 'TensorFlow.js Code (Compiled, 0.11.7)'
github.com/googlesamples/functions-as-a-service:package-lock.json: [ master, ]
1274:             "needle": "^2.2.1",
1255:         "needle": {
github.com/GoogleChrome/chrome-extensions-samples:apps/samples/text-editor/lib/ace/search.js: [ master, ]
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:apps/samples/text-editor/lib/ace/search.js: [ master, ] Duplicate result
android.googlesource.com/platform/external/libwebsockets:include/libwebsockets/lws-fts.h: [ master, ]
168: 	const char *needle;
github.com/GNOME/gnome-notes:src/bjb-controller.c: [ mainline, ]
47:   gchar          *needle;
68:   PROP_NEEDLE,
526: bjb_controller_apply_needle (BjbController *self)
777: bjb_controller_set_needle (BjbController *self, const gchar *needle )
787: bjb_controller_get_needle (BjbController *self)
556: on_needle_changed (BjbController *self)
45:   /* needle, notebook and group define what the controller shows */
122:   g_free (self->needle);
147:   case PROP_NEEDLE:
148:     g_value_set_string (value, self->needle);
175:   case PROP_NEEDLE:
176:     self->needle = g_strdup (g_value_get_string (value));
193:   const gchar *needle = NULL;
196:       needle = biji_item_get_uuid (item);
209:     if (needle && g_strcmp0 (item_path, needle) == 0)
213:     else if (!needle && BIJI_IS_NOTE_OBJ (
308:   if (!self->needle || g_strcmp0 (self->needle, "") == 0)
323:     if (g_strrstr (title, self->needle) != NULL)
330:       if (g_strrstr (content, self->needle) != NULL)
529:   gchar *needle;
531:   needle = self->needle;
536:   if (needle == NULL || g_strcmp0 (needle,"") == 0)
552:   biji_get_items_matching_async (self->manager, self->group, needle, update_controller_callback, self);
558:   bjb_controller_apply_needle (self);
598:       bjb_controller_apply_needle (self);
648:     /* Apply the needle to display the relevant items.
656:       bjb_controller_apply_needle (self);
738:   properties[PROP_NEEDLE] = g_param_spec_string ("needle",
739:                                                  "Needle",
761:                     gchar         *needle)
766:               "needle", needle,
779:   if (self->needle)
780:     g_free (self->needle);
782:   self->needle = g_strdup (needle);
783:   on_needle_changed (self);
789:   if (!self->needle)
792:   return self->needle;
827:     bjb_controller_apply_needle (self);
834:   g_clear_pointer (&self->needle, g_free);
836:   self->needle = g_strdup ("");
871:       bjb_controller_apply_needle (self);
877:     bjb_controller_apply_needle (self);
894:     on_needle_changed (self);
github.com/GoogleChrome/chrome-extensions-samples:apps/samples/text-editor/lib/ace/mode/text.js: [ master, ]
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))