Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for stringFind (0.29 sec)

  1. src/strings/search_test.go

    		{"abc", "acca", -1},
    		{"aa", "aaa", 0},
    		{"baa", "aaaaa", -1},
    		{"at that", "which finally halts.  at that point", 22},
    	}
    
    	for _, tc := range testCases {
    		got := StringFind(tc.pat, tc.text)
    		want := tc.index
    		if got != want {
    			t.Errorf("stringFind(%q, %q) got %d, want %d\n", tc.pat, tc.text, got, want)
    		}
    	}
    }
    
    func TestFinderCreation(t *testing.T) {
    	testCases := []struct {
    		pattern string
    		bad     [256]int
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 01 21:52:00 UTC 2018
    - 1.9K bytes
    - Viewed (0)
  2. src/strings/export_test.go

    			if int(m) != r.tableSize && t.table[m] != nil {
    				s += Repeat(".", depth) + string([]byte{byte(b)})
    				s += r.printNode(t.table[m], depth+1)
    			}
    		}
    	}
    	return
    }
    
    func StringFind(pattern, text string) int {
    	return makeStringFinder(pattern).next(text)
    }
    
    func DumpTables(pattern string) ([]int, []int) {
    	finder := makeStringFinder(pattern)
    	return finder.badCharSkip[:], finder.goodSuffixSkip
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  3. test/typeparam/boundmethod.go

    	}
    
    	// For now, a lone type parameter is not permitted as RHS in a type declaration (issue #45639).
    	// x2 := []StringInt[myint]{StringInt[myint](5), StringInt[myint](7), StringInt[myint](6)}
    	//
    	// // stringify on an instantiated type, whose bound method is associated with
    	// // the generic type StringInt[T], which maps directly to T.
    	// got2 := stringify(x2)
    	// want2 := []string{"5", "7", "6"}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 25 14:29:30 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  4. platforms/documentation/docs/src/snippets/native-binaries/windows-resources/groovy/src/hello/cpp/hello.cpp

    #include <iostream>
    #include <windows.h>
    #include <string>
    #include "hello.h"
    #include "resources.h"
    
    std::string LoadStringFromResource(UINT stringID)
    {
        HINSTANCE instance = GetModuleHandle("hello");
        WCHAR * pBuf = NULL;
        int len = LoadStringW(instance, stringID, reinterpret_cast<LPWSTR>(&pBuf), 0);
        std::wstring wide = std::wstring(pBuf, len);
        return std::string(wide.begin(), wide.end());
    }
    
    void hello() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 528 bytes
    - Viewed (0)
  5. platforms/native/language-native/src/integTest/groovy/org/gradle/language/fixtures/app/DuplicateWindowsResourcesBaseNamesTestApp.groovy

    #include <iostream>
    #include <windows.h>
    #include <string>
    #include "hello.h"
    
    std::string LoadStringFromResource(UINT stringID)
    {
        HINSTANCE instance = GetModuleHandle("hello");
        WCHAR * pBuf = NULL;
        int len = LoadStringW(instance, stringID, reinterpret_cast<LPWSTR>(&pBuf), 0);
        std::wstring wide = std::wstring(pBuf, len);
        return std::string(wide.begin(), wide.end());
    }
    
    void hello() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Nov 16 20:20:03 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  6. src/internal/trace/base.go

    type frequency float64
    
    // mul multiplies an unprocessed to produce a time in nanoseconds.
    func (f frequency) mul(t timestamp) Time {
    	return Time(float64(t) * float64(f))
    }
    
    // stringID is an index into the string table for a generation.
    type stringID uint64
    
    // extraStringID is an index into the extra string table for a generation.
    type extraStringID uint64
    
    // stackID is an index into the stack table for a generation.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  7. src/strings/clone_test.go

    		}
    	}
    }
    
    func BenchmarkClone(b *testing.B) {
    	var str = strings.Repeat("a", 42)
    	b.ReportAllocs()
    	for i := 0; i < b.N; i++ {
    		stringSink = strings.Clone(str)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 17:24:17 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  8. src/internal/trace/oldtrace.go

    	}
    	var addErr error
    	add := func(id stringID, s string) {
    		if err := evt.strings.insert(id, s); err != nil && addErr == nil {
    			addErr = err
    		}
    	}
    	for id, s := range pr.InlineStrings {
    		nid := max + 1 + uint64(id)
    		it.inlineToStringID = append(it.inlineToStringID, nid)
    		add(stringID(nid), s)
    	}
    	max += uint64(len(pr.InlineStrings))
    	pr.InlineStrings = nil
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 17.2K bytes
    - Viewed (0)
  9. platforms/native/platform-native/src/testFixtures/groovy/org/gradle/nativeplatform/fixtures/app/WindowsResourceHelloWorldApp.groovy

    #include <iostream>
    #include <windows.h>
    #include <string>
    #include "hello.h"
    
    std::string LoadStringFromResource(UINT stringID)
    {
        HINSTANCE instance = GetModuleHandle("hello");
        WCHAR * pBuf = NULL;
        int len = LoadStringW(instance, stringID, reinterpret_cast<LPWSTR>(&pBuf), 0);
        std::wstring wide = std::wstring(pBuf, len);
        return std::string(wide.begin(), wide.end());
    }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Nov 16 20:20:03 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  10. src/internal/trace/generation.go

    			}
    			frames = append(frames, pc)
    
    			if _, ok := pcs[pc]; !ok {
    				pcs[pc] = frame{
    					pc:     pc,
    					funcID: stringID(funcID),
    					fileID: stringID(fileID),
    					line:   line,
    				}
    			}
    		}
    
    		// Add the stack to the map.
    		if err := stackTable.insert(stackID(id), stack{pcs: frames}); err != nil {
    			return err
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 22:14:45 UTC 2024
    - 12.1K bytes
    - Viewed (0)
Back to top